Bypass mode (owner opt-in, default off): storebound settings bypass on|off|status and a one-time question in init; MCP owner_step (owner-only commands, dry run first), owner-only api operations with --yes --confirm, console plans may press buttons.final; every action logged to .storebound/owner-actions.log; docs/bypass.md, agent rules, tests

This commit is contained in:
CRTkafa 2026-10-22 02:27:34 +08:00
parent 2598c4953a
commit 9bd17c401d
21 changed files with 218 additions and 13 deletions

View file

@ -6,11 +6,13 @@
// App Privacy answers, Data safety section, listing copy and screenshot copy; every answer is a starting point to edit.
// Lookup per file: templates/profiles/<profile>/<file>, then the profile it builds on, then templates/<file>.
import { appendFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
import { bypassOn, readSettings, setBypass } from './lib/bypass';
import { stdinIsTTY } from './lib/tty';
import { dirname, join, relative, resolve } from 'node:path';
import type { Args } from './lib/args';
import { type AppProfile, PROFILES } from './lib/config';
import { ignoreInRepo } from './lib/git-ignore';
import { log } from './lib/log';
import { log, promptOut } from './lib/log';
import { TEMPLATE_TEXT } from './lib/template-files';
import * as rt from './lib/rt';
@ -74,5 +76,12 @@ export async function run(args: Args): Promise<void> {
// store art (rendered or pulled from the stores) is never committed
const art = ignoreInRepo(join(root, 'store', 'renders'), 'storebound: store art (rendered or pulled from the stores), never committed');
if (art) log('init', `.gitignore: added ${art}`);
// bypass mode is asked once per machine, only of a person at a terminal (default no); agents never answer it
if (readSettings().bypass === undefined && stdinIsTTY() && process.stdout.isTTY && !args.has('yes')) {
promptOut().write('Bypass mode: let your AI agent also press the owner-only buttons (Submit for review, releases, rollouts, testers, replies, prices, console Create)? Every action is logged; turn it off any time with storebound settings bypass off. [y/N] ');
const a = await rt.readLine();
setBypass(a !== null && /^y(es)?$/i.test(a.trim()));
log('init', `bypass mode: ${bypassOn() ? 'ON' : 'off'} (storebound settings bypass on | off)`);
}
log('init', 'next: edit storebound.config.ts, store/*.md and .storebound/credentials.json, then `storebound check`; store/workflows/*.yml: storebound flow list');
}