@buffcore/cli 0.8.43 → 0.8.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/commands/prototype/mark-shot.d.ts +31 -0
  3. package/dist/commands/prototype/mark-shot.js +149 -0
  4. package/dist/commands/ui/chat/approval-folders.d.ts +20 -0
  5. package/dist/commands/ui/chat/approval-folders.js +134 -0
  6. package/dist/commands/ui/chat/approval-text.d.ts +11 -0
  7. package/dist/commands/ui/chat/approval-text.js +69 -0
  8. package/dist/commands/ui/chat/approval-writes.d.ts +32 -0
  9. package/dist/commands/ui/chat/approval-writes.js +179 -0
  10. package/dist/commands/ui/chat/claude-permissions.d.ts +4 -4
  11. package/dist/commands/ui/chat/claude-permissions.js +32 -4
  12. package/dist/commands/ui/chat/codex-idle.d.ts +1 -1
  13. package/dist/commands/ui/chat/commit-limits.d.ts +36 -0
  14. package/dist/commands/ui/chat/commit-limits.js +164 -0
  15. package/dist/commands/ui/chat/fresh-critique.js +3 -1
  16. package/dist/commands/ui/chat/fresh-launch.d.ts +5 -0
  17. package/dist/commands/ui/chat/fresh-launch.js +7 -4
  18. package/dist/commands/ui/chat/fresh.js +7 -1
  19. package/dist/commands/ui/chat/gh-api-limits.d.ts +14 -0
  20. package/dist/commands/ui/chat/gh-api-limits.js +74 -0
  21. package/dist/commands/ui/chat/git-words.d.ts +10 -0
  22. package/dist/commands/ui/chat/git-words.js +26 -0
  23. package/dist/commands/ui/chat/host-launched.d.ts +11 -0
  24. package/dist/commands/ui/chat/host-launched.js +35 -0
  25. package/dist/commands/ui/chat/limit-mentions.js +16 -2
  26. package/dist/commands/ui/chat/limit-text.d.ts +15 -0
  27. package/dist/commands/ui/chat/limit-text.js +36 -0
  28. package/dist/commands/ui/chat/limits-hook.js +2 -2
  29. package/dist/commands/ui/chat/limits.d.ts +7 -12
  30. package/dist/commands/ui/chat/limits.en.d.ts +2 -0
  31. package/dist/commands/ui/chat/limits.en.js +2 -0
  32. package/dist/commands/ui/chat/limits.es.js +2 -0
  33. package/dist/commands/ui/chat/limits.js +63 -59
  34. package/dist/commands/ui/chat/planning-limits.js +11 -0
  35. package/dist/commands/ui/chat/publish-limits.js +23 -7
  36. package/dist/commands/ui/chat/turn-guard.d.ts +8 -2
  37. package/dist/commands/ui/chat/turn-guard.js +8 -3
  38. package/dist/commands/ui/commands.en.d.ts +3 -0
  39. package/dist/commands/ui/commands.en.js +3 -0
  40. package/dist/commands/ui/commands.es.d.ts +3 -0
  41. package/dist/commands/ui/commands.es.js +3 -0
  42. package/dist/commands/ui/index.d.ts +42 -0
  43. package/dist/commands/ui/index.js +14 -2
  44. package/dist/commands/ui/plan-brief.d.ts +13 -0
  45. package/dist/commands/ui/plan-brief.js +91 -0
  46. package/dist/commands/ui/plan-files.d.ts +1 -11
  47. package/dist/commands/ui/plan-files.js +2 -48
  48. package/dist/commands/ui/prototype-main.d.ts +5 -0
  49. package/dist/commands/ui/prototype-shot-route.d.ts +16 -0
  50. package/dist/commands/ui/prototype-shot-route.js +98 -0
  51. package/dist/commands/ui/routes.d.ts +2 -0
  52. package/dist/commands/ui/server-core.js +2 -0
  53. package/dist/commands/ui/server-options.js +1 -0
  54. package/dist/commands/ui/server-request.js +5 -0
  55. package/dist/commands/ui/server.d.ts +7 -0
  56. package/dist/commands/ui/server.js +16 -1
  57. package/dist/commands/ui/studio-routes.d.ts +1 -0
  58. package/dist/commands/ui/studio-routes.js +3 -1
  59. package/dist/commands/ui/studio-state.d.ts +6 -0
  60. package/dist/ui/page.js +114 -95
  61. package/docs/PROTOTYPE.md +14 -2
  62. package/docs/WORKBENCH.md +12 -3
  63. package/package.json +11 -11
  64. package/skills/ape-plan-change/SKILL.md +8 -0
  65. package/templates/product/plan/brief.md +29 -0
package/docs/PROTOTYPE.md CHANGED
@@ -52,8 +52,9 @@ screens to it. A product's home is `prototype/home.tsx`, at `/prototype` on its
52
52
  drawer below). The viewer's App view embeds the same home at `?embed=1` (no panel, no device
53
53
  frame), and the workbench's Prototype section opens it.
54
54
 
55
- The studio previews the live draft. Try a journey lists executable journeys from
56
- `prototype/journeys.ts` and uses their translated `role` or a matching role from the plan.
55
+ The studio previews the live draft. Its Journeys list the plan's journeys and plays those the app
56
+ lists in `prototype/journeys.ts` (matched by key, or else by title), with the app's others under
57
+ their translated `role`.
57
58
  `?journey=<key>` starts at the first step. Studio previews replay the requested step from the
58
59
  journey's sample seed, using the same store and reducer as the standalone player. An unknown or
59
60
  empty journey leaves the home usable. Data shows the named seeds for `full`, `empty`, `loading`
@@ -101,6 +102,17 @@ window.name or sessionStorage; window heartbeat messages grant nothing. Every ne
101
102
  the old proof immediately. Old, future or missing nonces and repeated or decreasing counters never renew a lease.
102
103
  Hidden pauses heartbeats and the studio's deadlines; pagehide closes the port and clears the nonce, and unmount stops sending.
103
104
  An expired preview offers the app's own tab while waiting for a late answer. A new studio attempt waits eleven seconds for hello.
105
+ In the studio's preview the studio drives the player over the same port. Before its reply the
106
+ home says it plays (`ape:prototype:player`); choosing a journey, Back, Next and a sample-data choice
107
+ then each send one `ape:prototype:show` message (the current navigation and nonce, and a journey
108
+ key with a step, or a data state; at most 512 characters, read strictly) to the document whose
109
+ hello passed, and the app replays its own journey or seed at once, with no reload. The app answers
110
+ with a fresh reply, from which the studio takes only the step caption. The studio keeps the latest
111
+ choice: when the app says hello again on the same frame (it reloaded itself after an edit), or a
112
+ choice was made while its port had gone stale, the new document gets that choice once it is alive.
113
+ An app that does not say it plays (an older app-shell) is reloaded at each choice instead. The
114
+ frame reloads only for a new address, language or mode, or a retry, and then opens at the
115
+ current choice.
104
116
  No records, actions or credentials cross this connection; readiness grants no recording or approval right.
105
117
  The iframe uses `allow-scripts allow-same-origin`, with no forms, popups, downloads or top navigation;
106
118
  the app must have a different origin and authority (a scheme-only address change is refused, since
package/docs/WORKBENCH.md CHANGED
@@ -99,7 +99,7 @@ build time, or from source when running in the checkout.
99
99
  and previews return HTTP 200 with `ok: false`, so the studio's action transport keeps their detail.
100
100
  The real index follows the commit before post-commit runs, then is checked again for the reply, so new files in the temporary index no longer appear as staged deletions during slow post-commit checks. When a reply carries a commit that is not a plain save (a repository check left working files changed, or the commit could not be compared with them), the real index still moves to that commit by one rule: a path with nothing staged, or staged exactly as reviewed, follows the commit; any other staging is the person's own work and stays (also staging made while a check ran), in a product in a subfolder too, so the file list shows only what is really left; if Git cannot move the index, the detail names the `git reset HEAD --` to run, in the product's folder, and says so when it could not read the index. The page says "A commit exists, but it is not confirmed as saved"; Reload file list re-reads it, an empty list settles Brief, Plan and Journeys once their own files are clean (other steps start a fresh page, never Saved by that alone, even after a refused or failed reload), and the next step (Record, or Brand's approval) then needs its own saved reply.
101
101
  The save's commit is the one it moved main to, or one a `post-commit` hook amended with the same parent and files. When HEAD is anything else (a hook committed on top of the save's commit, or moved HEAD), the save answers that its commit could not be confirmed; the index may already have followed the reviewed commit before that hook ran. The message names the step to finish: in the product's folder, `git reset HEAD --` with the saved paths (it changes only staging; committing from a terminal before it could undo the save), then reload the file list and save again if it still lists them. For a prototype approval, `git checkout HEAD --` with the record's path instead: if the record then shows the approval, it is saved; otherwise approve again.
102
- - Prototype puts the recorded versions, check status, Compare and Approve above the app preview. Try a journey opens a picker and puts Back and Next over the app. Preview options holds Device, Data and sign-in help. Sign-in help offers Open app in new tab. Escape and choosing an action return keyboard focus to the panel's opener. Tabbing out of a popover or Compare closes it and keeps focus at the new control. A phone shows the app edge to edge. The agent's technical references are under Details. A silent app port points to Dev server. A missing home can prepare a design request for the person to send. Below the preview, the unsaved source's file list and its one Save commit the chosen files, Take snapshot checks the saved source, and Record waits for its passing proof. The [prototype connection](PROTOTYPE.md) describes readiness and framing.
102
+ - Prototype is a workspace. Above it, the recorded versions, check status, Compare and Approve. Its bar chooses what you look at (Customer app or Console; Mobile, Tablet or Desktop, with Rotate for a tablet) and what a click does (Select, Comment, Draw, Area; marking draws over the device, `useWorkspaceStage()` in `loop/workspace-state.tsx`). On the left, Journeys (the plan's, by who does them and in which app, joined to the ones the running app plays; the open one lists its steps to jump to) and Screens, with the sample data and sign-in help at the foot; sign-in help offers Open app in new tab. In the middle, the app in its device, zoomed to fit, with a line saying what you see and the step bar (Back, the step, Play, Next) under it. The console is a second frame at the stack's admin address, loaded once shown and kept: switching keeps each one's step and reloads neither; its journeys are followed by hand. The rail folds to its icons on this page. The workspace and its console frame stay in the page while the app starts, stops or is refused; only the app's slot changes. Play stops on any switch of app, journey or device. A phone shows a phone's app edge to edge (a tablet or desktop in its bezel, zoomed to fit), the device choice as icons, and a bar at its foot: Journeys (a sheet), Back, the step, Next and Changes (the agent's tab); on a touch screen the Comment hint says tap. Escape and choosing an action return keyboard focus to the panel's opener. Tabbing out of Compare closes it and keeps focus at the new control. The agent's technical references are under Details. A silent app port points to Dev server. A missing home can prepare a design request for the person to send. Below the preview, the unsaved source's file list and its one Save commit the chosen files, Take snapshot checks the saved source, and Record waits for its passing proof. The [prototype connection](PROTOTYPE.md) describes readiness and framing.
103
103
  Long file paths and report rows wrap within the page; wide tables scroll inside their own box and previews stack when narrow.
104
104
  Saved source refreshes after a reviewed save without a page reload. An empty source read says nothing is recorded yet; a failed read shows a fixed translated sentence, never raw errors. Slow or failed reads leave the preview open, and the controls that need the source show that it is unavailable. Polling and hiding the pane preserve the playing journey and step. The preview's heartbeat checks whether the app is still responding.
105
105
  The chat panel renders only while shown. It opens with the latest 200 messages, and Show earlier adds another page.
@@ -547,7 +547,7 @@ deny `Edit(plan/agents.md)`, `Edit(plan/**/.claude/**)`,
547
547
  Edit rules cover Write too and deny wins; `dontAsk` refuses anything that would need approval.
548
548
  Before each turn the studio also refuses any `.claude` folder beneath `plan/`, naming
549
549
  the folder, so skills planted by a different kind of turn cannot load.
550
- With every hook off, the limits hook included, these turns' deny rules hold the limits below: `Bash(…)` and `PowerShell(…)` prefix denies for `git push`, `curl`, `wget`, `iwr`, `irm`, `Invoke-WebRequest`, `Invoke-RestMethod`, `Start-BitsTransfer`, `ape deploy`/`ape server deploy` (bare, `pnpm` and `npx`), `npm publish` (and npm's shortened `npm pu` to `npm publis`), `pnpm publish`, `yarn publish`, `yarn npm publish` and `gh release create`/`new`/`upload`/`edit`/`delete`, `Read` and `Edit` denies for `.env.prod*` and `.env.staging*`, `WebFetch`, and the secret folders' `Read` denies (`planning-limits.ts`). `dontAsk` already refuses every command outside the two; the denies also hold against the person's own allow rules (prefix forms only: `git -C x push` is refused by `dontAsk` alone). On Autopilot, planning and loop run like any other step (next section): `auto`, or `bypassPermissions` with Never ask, with the limits hook, the card, no command list and the same edit denies; the turn's settings set `disableAllHooks: false`, so the product's own hooks run too. Their instructions say to change only files under `plan/`, and the studio's save still takes only what planning owns (`Edit(plan/**)` less the denies above), so an edit elsewhere stays unsaved.
550
+ With every hook off, the limits hook included, these turns' deny rules hold the limits below: `Bash(…)` and `PowerShell(…)` prefix denies for `git push`, `curl`, `wget`, `iwr`, `irm`, `Invoke-WebRequest`, `Invoke-RestMethod`, `Start-BitsTransfer`, `ape deploy`/`ape server deploy` (bare, `pnpm` and `npx`), `npm publish` (and npm's shortened `npm pu` to `npm publis`), `pnpm publish`, `yarn publish`, `yarn npm publish`, `bun publish`, `lerna publish`, `changeset publish` (bare, `npx`, `pnpm`, `pnpm exec` and `yarn`) and `gh release create`/`new`/`upload`/`edit`/`delete`, `Read` and `Edit` denies for `.env.prod*` and `.env.staging*`, `WebFetch`, and the secret folders' `Read` denies (`planning-limits.ts`). `dontAsk` already refuses every command outside the two; the denies also hold against the person's own allow rules (prefix forms only: `git -C x push` is refused by `dontAsk` alone). On Autopilot, planning and loop run like any other step (next section): `auto`, or `bypassPermissions` with Never ask, with the limits hook, the card, no command list and the same edit denies; the turn's settings set `disableAllHooks: false`, so the product's own hooks run too. Their instructions say to change only files under `plan/`, and the studio's save still takes only what planning owns (`Edit(plan/**)` less the denies above), so an edit elsewhere stays unsaved.
551
551
 
552
552
  #### Permissions follow the level
553
553
 
@@ -561,7 +561,7 @@ Every Claude turn takes its mode from the level in effect (`claude-permissions.t
561
561
 
562
562
  - **Never ask** is a setting under Autopilot only, off by default, kept as `neverAsk: true` in `plan/agents.md` beside `level: auto`. It holds only when main's commit and the working copy both say so; choosing any other level clears it, and a generic save may not change it where a host controls the level. The level chip reads "Autopilot · Never ask" while it is on. A model Claude Code can't run in `auto` starts in `default` without a word, so its calls reach the card; the CLI's init event names the mode it really runs, and the chat then says "Auto mode isn't available for this model; the agent will ask instead."
563
563
  - **The card.** Each launch passes `--permission-prompt-tool mcp__ape_permission__ask` and an `--mcp-config` file naming the one MCP server it adds (`permission-tool.ts`, plain Node); `--disallowedTools` hides that tool from the model. The tool hands each call to the studio over the launch's own local channel (a named pipe, or a socket only its owner opens, at a random name only that launch's arguments carry; not an HTTP route), which closes with the launch. The chat ends with "Your agent wants to run", the exact command and **Allow once**, **Always allow in this step** and **Refuse** (while it waits, the page's own primary button draws as secondary; an answer folds the card to one line while the turn goes on); `POST /api/chats/:id/permission` (`{ id, answer }`, the settings right and the studio Origin, like Allow this folder) answers only the card the running launch shows now. Refused, the agent hears which part and what to run alone ("`grep` is not allowed here; run `pnpm ape prototype snapshot --scene x` alone."); unanswered for 30 minutes, or when the turn ends, it hears that nothing ran. Always allow keeps the exact parts outside the list, as `Bash(<part>)` rules, in `.claude/settings.local.json` under `apeStepAllow.<work>` (Claude Code ignores that key); the studio adds them to that step's `--allowedTools` only, and the running launch reads that list again for each later call, so a command just kept does not ask twice. "This step" is the kind of work, not the rail step: Brand and Prototype both run design turns and share one list. A download, a command the limits could not vouch for (below), a file tool's call, a here-document, a command longer than the card shows, and a command with `%`, `!`, `"` or `*` (Claude Code's wildcard, as in `Bash(node *)` or `Bash(ls:*)`) are allowed once only. The card's text is cut to the chat's limits (2,000 characters for the command, 300 for each program it names, with an ellipsis); a stored card that does not fit them is dropped when the chat is read, and the chat stays.
564
- - **The limits**, at every level, Never ask included: the studio's PreToolUse hook (`limits-hook.ts`, plain Node) is installed for each turn through a `--settings` file that also sets `disableAllHooks: false`, so a product's own settings can't switch it off. It refuses reading a folder of sign-ins or keys (Allow this folder's list), `ape deploy` and `ape server deploy`, `.env.production`, `.env.staging` and `.env.prod` files, `git push` (and its plumbing, `git send-pack`), publishing a package (`npm publish` and every shortened name npm resolves to it, `npm pu` and up; `pnpm publish`, `yarn publish`, `yarn npm publish`: any of those package managers named in the part, `npx npm@10 publish` included, with the value of an option each tool takes one for skipped, `npm --registry x publish`, `pnpm -C dir publish`, while `pnpm --filter publish build` runs) and publishing a release (`gh release create`, `new`, `upload`, `edit`, `delete` and `delete-asset`, `gh -R owner/repo release create` included); a subcommand followed only by `--help` or `-h` runs (`publish-limits.ts`), and sends a network download (`curl`, `wget`, `wget2`, `aria2c`, `certutil -urlcache`, `Invoke-WebRequest`, `iwr`, `irm`, `Invoke-RestMethod`, `Start-BitsTransfer`, `WebFetch`) to the card for Allow once. Each part of a piped or chained command is checked, with continued lines joined first (a trailing `\` in Bash, a backtick in PowerShell) and escaped letters read as letters, and so is what a part hands to another shell (`sh -c`, `bash -lc`, `cmd /c`, `powershell -Command` or `-EncodedCommand`, `pwsh -c`, `eval`), anywhere in the part (`pnpm exec sh -c …`, `env X=1 git push`, `xargs git push`), up to four shells deep, `iex`/`Invoke-Expression` included; a `git commit` or `git tag` message after `-m` and a here-document's body are words, not commands (unless an unquoted here-document runs `$(…)`; its end word is read as Bash reads it, `E"OF"` being `EOF`), git's valued options (`--git-dir x`, `--work-tree x`, `-c a=b`) are skipped to find the subcommand, and a redirection such as `2>&1` stays with its command. The refusal names the part and its limit ("publishing a package"). On a Claude turn, when the hook's own sentence comes back as a command's result (`refusalLimit`, in either language), the chat shows that call as the limit's card, **This can't be allowed here**, with the limit's name, the command and **Copy the command**, and no Allow (recorded on the call's line as `tool.limit`; a command the chat shortened or scrubbed is not offered for copying); the permission card refuses a limit too, should one ever reach it. **The fallback** (`limit-mentions.ts`, `stdin-shells.ts`): when that check refuses and asks nothing, the hook still sends the call to the card, for Allow once only and never kept, at every level Never ask included, when the command's whole text (case ignored, continued lines joined, and read again with its quotes and escapes taken out) mentions a limit: `git` and `push` or `send-pack` anywhere in it (`git stash push` aside, so `git -c alias.p=push p` and `p=push; git $p` ask), `ape` and `deploy`, `npm`, `pnpm` or `yarn` and `publish` (or npm's shortened names) as a word of its own (not `src/publish.ts` or `publish-docs`, a known option's value, or a request for help), `gh` and `release` with `create`, `new`, `upload`, `edit` or `delete`, a secret folder's name (the turn's own folder taken out first), a production settings file, or a download program (the list above, plus `bitsadmin`, `Net.WebClient`, `DownloadString`, `DownloadFile`); and also when a shell or interpreter in a part's program place (`bash`, `sh`, `zsh`, `pwsh`, `powershell`, `cmd`, `node`, `python`, `perl`, `ruby` and the like, after `sudo`, `env`, `xargs` and other leaders) reads its script from standard input (no script or `-c`, `-s`, `-`, a here-document, a here-string or `<`: `echo … | sh`, `bash <<'EOF'`, `sh <<< '…'`), a shell pattern in a path could reach a secret folder or a production settings file (`limit-patterns.ts`: each word with `*`, `?`, `[…]` or `{a,b}` has its braces expanded, up to 256 words, and each path segment is tried as a pattern against those names, so `cat .env.*`, `cat ~/.ss*/id_rsa`, `cat ~/.[s]sh/id_rsa` and `cat .env.produc{t,}ion` ask, while a segment of wildcards only, `dist/*`, `src/**/*.ts`, `*.md` and a literal `.env.example` stay free; the card says "This command uses a pattern that could reach `.env.production`; the studio couldn't tell."), a here-document never reaches its end line, a part runs `iex`/`Invoke-Expression`, or the reading passes its budget (a command over 20,000 characters, 200,000 characters parsed in all, 50 ms, or more than 32 scripts handed on from one part; a script handed on twice is read once). The card says why ("This command mentions `git push`; the studio couldn't tell if it runs it.", from the chat's `asking.unsure`), and a refusal tells the agent the same. A commit message that mentions a limit therefore costs one Allow once click; the check answers in well under a second for any input, so the hook's 30-second timeout, which would let the call run, is never reached. Planning below Autopilot has no hook and keeps its deny rules only. A call the hook can't read, or any error in it, is refused (exit 2, with a plain reason). Deny rules for the secret folders (`Read(//**/.aws/**)` and the rest) back it up in every mode, planning included; for a folder name the product itself is kept under (a product in `~/secrets/…` or `…/.docker/…`), they cover that name inside the product (`Read(./**/secrets/**)`) and in the home folder only, as the hook counts it, so the product stays readable. Planning on Autopilot keeps the same edit denies as design turns (`.claude/**`, `.githooks/**`, `package.json` and the rest of the commands' files, and the chats). **Gaps:** the hook reads command text, so a determined agent can still get past it: under Never ask nothing stops it rewriting the hook script itself; a command name built at runtime from pieces (`g=gi; ${g}t push`, `git $'\x70ush'`, `$(printf gi)t push`, a name read from a file) is neither parsed nor mentioned; a recursive read names no limit in its text (`grep -rn KEY .`, `find ~ -name id_rsa -exec cat {} \;`), so text matching can't catch it; an encoded payload other than `-EncodedCommand` handed to something other than a shell's standard input (`node -e` decoding base64, a script file) is not read; and downloads through other programs (`node` with `fetch`, `git clone`, `pnpm add`, a script) are not caught.
564
+ - **The limits**, at every level, Never ask included: the studio's PreToolUse hook (`limits-hook.ts`, plain Node) is installed for each turn through a `--settings` file that also sets `disableAllHooks: false`, so a product's own settings can't switch it off. It refuses reading a folder of sign-ins or keys (Allow this folder's list), `ape deploy` and `ape server deploy`, `.env.production`, `.env.staging` and `.env.prod` files, `git push` (and its plumbing, `git send-pack`), publishing a package (`npm publish` and every shortened name npm resolves to it, `npm pu` and up; `pnpm publish`, `yarn publish`, `yarn npm publish`, `bun publish`, `lerna publish`, `changeset publish` (`npx @changesets/cli publish` too): any of those tools named in the part, `npx npm@10 publish` included, with the value of an option each tool takes one for skipped, `npm --registry x publish`, `pnpm -C dir publish`, while `pnpm --filter publish build` runs) and publishing a release (`gh release create`, `new`, `upload`, `edit`, `delete` and `delete-asset`, `gh -R owner/repo release create` included, and a `gh api` call that creates or changes one: a method other than GET or HEAD on `repos/{owner}/{repo}/releases…`, or fields or a body with no method named, as gh then posts, `gh-api-limits.ts`); a subcommand followed only by `--help` or `-h` runs (`publish-limits.ts`), a shell write into the approval records, `prototype/versions/` (a redirect into the folder, or any program that names a path in it other than a read such as `cat`, `ls`, `grep`, `find` without `-delete` or `-exec`, `git log`/`show`/`diff`, `Get-Content`; the path read against the shell's folder, `..`, case, patterns, brace lists and `$(…)` counted; on design and validation turns, and planning and loop turns on Autopilot, a program that writes the paths it names aimed at `.` or any folder above, at `prototype` unless a single file is copied in, a patch or archive (`git apply`, `git am`, `patch`, `Expand-Archive`), and a pipe from such a folder into one (`approval-folders.ts`); and, as a text fallback, a command naming both folders that looks like a write, refused when a part is more than a read and carded otherwise, `approval-writes.ts`, `approval-text.ts`), and, on a design, validation, planning or loop turn at the Autopilot level or with no level given (the hook's command line carries the work and the level), a commit or a branch moved (`git commit`, `commit-tree`, `update-ref`, `merge`, `cherry-pick`, `revert`, `rebase`, `am`, `pull`, `hash-object`, `fast-import`, `stash` but `list`/`show`, `reset` to a commit, `branch -f`/`-M`/`-C`, `checkout -B`, `switch -C`, `fetch` into a branch, `git subtree add`/`merge`/`pull`/`split --rejoin`, configuration set anywhere in the command (refused); a subcommand that is not git's own goes to the card; text naming git and one of them, when the parse could not read every git in it, goes to the card; `commit-limits.ts`), and sends a network download (`curl`, `wget`, `wget2`, `aria2c`, `certutil -urlcache`, `Invoke-WebRequest`, `iwr`, `irm`, `Invoke-RestMethod`, `Start-BitsTransfer`, `WebFetch`) to the card for Allow once. Each part of a piped or chained command is checked, with continued lines joined first (a trailing `\` in Bash, a backtick in PowerShell) and escaped letters read as letters, and so is what a part hands to another shell (`sh -c`, `bash -lc`, `cmd /c`, `powershell -Command` or `-EncodedCommand`, `pwsh -c`, `eval`), anywhere in the part (`pnpm exec sh -c …`, `env X=1 git push`, `xargs git push`), up to four shells deep, `iex`/`Invoke-Expression` included; a `git commit` or `git tag` message after `-m` and a here-document's body are words, not commands (unless an unquoted here-document runs `$(…)`; its end word is read as Bash reads it, `E"OF"` being `EOF`), git's valued options (`--git-dir x`, `--work-tree x`, `-c a=b`) are skipped to find the subcommand, and a redirection such as `2>&1` stays with its command. The refusal names the part and its limit ("publishing a package"). On a Claude turn, when the hook's own sentence comes back as a command's result (`refusalLimit`, in either language), the chat shows that call as the limit's card, **This can't be allowed here**, with the limit's name, the command and **Copy the command**, and no Allow (recorded on the call's line as `tool.limit`; a command the chat shortened or scrubbed is not offered for copying); the permission card refuses a limit too, should one ever reach it. **The fallback** (`limit-mentions.ts`, `stdin-shells.ts`): when that check refuses and asks nothing, the hook still sends the call to the card, for Allow once only and never kept, at every level Never ask included, when the command's whole text (case ignored, continued lines joined, and read again with its quotes and escapes taken out) mentions a limit: `git` and `push` or `send-pack` anywhere in it (`git stash push` aside, so `git -c alias.p=push p` and `p=push; git $p` ask), `ape` and `deploy`, `npm`, `pnpm` or `yarn` and `publish` (or npm's shortened names) as a word of its own (not `src/publish.ts` or `publish-docs`, a known option's value, or a request for help), `gh` and `release` with `create`, `new`, `upload`, `edit` or `delete`, a secret folder's name (the turn's own folder taken out first), a production settings file, or a download program (the list above, plus `bitsadmin`, `Net.WebClient`, `DownloadString`, `DownloadFile`); and also when a shell or interpreter in a part's program place (`bash`, `sh`, `zsh`, `pwsh`, `powershell`, `cmd`, `node`, `python`, `perl`, `ruby` and the like, after `sudo`, `env`, `xargs` and other leaders) reads its script from standard input (no script or `-c`, `-s`, `-`, a here-document, a here-string or `<`: `echo … | sh`, `bash <<'EOF'`, `sh <<< '…'`), a shell pattern in a path could reach a secret folder or a production settings file (`limit-patterns.ts`: each word with `*`, `?`, `[…]` or `{a,b}` has its braces expanded, up to 256 words, and each path segment is tried as a pattern against those names, so `cat .env.*`, `cat ~/.ss*/id_rsa`, `cat ~/.[s]sh/id_rsa` and `cat .env.produc{t,}ion` ask, while a segment of wildcards only, `dist/*`, `src/**/*.ts`, `*.md` and a literal `.env.example` stay free; the card says "This command uses a pattern that could reach `.env.production`; the studio couldn't tell."), a here-document never reaches its end line, a part runs `iex`/`Invoke-Expression`, or the reading passes its budget (a command over 20,000 characters, 200,000 characters parsed in all, 50 ms, or more than 32 scripts handed on from one part; a script handed on twice is read once). The card says why ("This command mentions `git push`; the studio couldn't tell if it runs it.", from the chat's `asking.unsure`), and a refusal tells the agent the same. A commit message that mentions a limit therefore costs one Allow once click; the check answers in well under a second for any input, so the hook's 30-second timeout, which would let the call run, is never reached. Planning below Autopilot has no hook and keeps its deny rules only. A call the hook can't read, or any error in it, is refused (exit 2, with a plain reason). Deny rules for the secret folders (`Read(//**/.aws/**)` and the rest) back it up in every mode, planning included; for a folder name the product itself is kept under (a product in `~/secrets/…` or `…/.docker/…`), they cover that name inside the product (`Read(./**/secrets/**)`) and in the home folder only, as the hook counts it, so the product stays readable. Planning on Autopilot keeps the same edit denies as design turns (`.claude/**`, `.githooks/**`, `package.json` and the rest of the commands' files, and the chats). **Gaps:** the hook reads command text, so a determined agent can still get past it: under Never ask nothing stops it rewriting the hook script itself; a command name built at runtime from pieces (`g=gi; ${g}t push`, `git $'\x70ush'`, `$(printf gi)t push`, a name read from a file) is neither parsed nor mentioned; a recursive read names no limit in its text (`grep -rn KEY .`, `find ~ -name id_rsa -exec cat {} \;`), so text matching can't catch it; an encoded payload other than `-EncodedCommand` handed to something other than a shell's standard input (`node -e` decoding base64, a script file) is not read; and downloads through other programs (`node` with `fetch`, `git clone`, `pnpm add`, a script) are not caught.
565
565
  - Below Autopilot, these turns' instructions say a command outside the list pauses for the person, and to run each command alone, without pipes, `&&`, `;` or redirects; at every level they name the limits.
566
566
  - Design turns may run exact `pnpm format`, and delete files below `design/` or `prototype/` without asking (one delete command, alone, every path two levels down or more, never `prototype/versions`).
567
567
  - **Codex** gets the same arguments at every level, Never ask included: `codex exec` with `approval_policy="never"` (it never asks; a call its sandbox refuses fails and the agent hears why) inside the product's `default_permissions = "ape"` profile (`:workspace` writes, deny-read rules, network off). That is already its full-auto form; the studio passes no `--sandbox`, `--full-auto`, `--approve-for-me` or bypass flag, since a sandbox flag would discard the deny-read profile and a bypass removes the sandbox. The studio installs no hook in Codex, so its limits are its sandbox's: network off stops downloads, deploys and a push to a network remote; the profile denies `.env*` and key files inside the product. **Gaps:** a folder of sign-ins outside the product (`~/.aws`, `~/.gnupg`) is readable, and `git push` to a remote on a local path is not stopped.
@@ -845,6 +845,15 @@ The host chooses how to listen or proxy the returned Node server. It fills `plan
845
845
  and compare runs answer 400), and polls `stack.check()` for the dev server's state.
846
846
  Without this adapter, the loopback, Host and run-token guards above still apply.
847
847
 
848
+ A host whose own trusted launcher starts the agent's turns passes `hostLaunched: true` to
849
+ `createUiServer` (a host that starts `ape ui` sets `APE_HOST_LAUNCHED=1`). Turns then launch
850
+ exactly as in 0.8.41: `acceptEdits`, or `dontAsk` with hooks off for planning, at every level,
851
+ with 0.8.41's allow and deny lists and no per-turn settings file, MCP config, permission prompt
852
+ tool or socket; fresh turns keep hooks off through the inline `--settings` JSON and load no
853
+ settings file of their own. The host applies the limits (the upgrade notes list them), and
854
+ Settings says so. The mode belongs to
855
+ `runner.cwd`'s product folder while the server runs (`chat/host-launched.ts`).
856
+
848
857
  A host can pass `level: { source: 'host', where: 'Project console' }` to `createUiServer`.
849
858
  The Level chooser then shows main's committed level and the commit it was read from, read-only,
850
859
  with a fixed English or Spanish sentence naming `where`. `POST /api/level` returns HTTP 409
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buffcore/cli",
3
- "version": "0.8.43",
3
+ "version": "0.8.45",
4
4
  "description": "The `ape` command: create, dev, migrate, seed, prototype, deploy and a local MCP server for coding agents.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "BuffApe",
@@ -45,20 +45,20 @@
45
45
  "playwright-core": "1.63.0",
46
46
  "yaml": "2.9.1",
47
47
  "zod": "4.6.5",
48
- "@buffcore/build-agent": "0.8.43",
49
- "@buffcore/config": "0.8.43",
50
- "@buffcore/modules": "0.8.43",
51
- "@buffcore/storage": "0.8.43",
52
- "@buffcore/tokens": "0.8.43",
53
- "@buffcore/contracts": "0.8.43",
54
- "@buffcore/i18n": "0.8.43",
55
- "@buffcore/db": "0.8.43",
56
- "@buffcore/server": "0.8.43"
48
+ "@buffcore/build-agent": "0.8.45",
49
+ "@buffcore/storage": "0.8.45",
50
+ "@buffcore/contracts": "0.8.45",
51
+ "@buffcore/i18n": "0.8.45",
52
+ "@buffcore/server": "0.8.45",
53
+ "@buffcore/config": "0.8.45",
54
+ "@buffcore/db": "0.8.45",
55
+ "@buffcore/tokens": "0.8.45",
56
+ "@buffcore/modules": "0.8.45"
57
57
  },
58
58
  "devDependencies": {
59
59
  "marked": "18.1.3",
60
60
  "tsx": "4.23.15",
61
- "@buffcore/admin-shell": "0.8.43"
61
+ "@buffcore/admin-shell": "0.8.45"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "node ../../scripts/build-package.mjs && node scripts/bundle.mjs",
@@ -22,6 +22,14 @@ If they correct it, update the brief and ask them to confirm the revised read-ba
22
22
  confirmation on the `Owner confirmation` line. For ongoing work from an older brief without the
23
23
  section, use its agreed scope and suggest adding the section for the next plan.
24
24
 
25
+ ## A summary line under each heading
26
+
27
+ The studio's Brief reads short first: under each `##` heading of `plan/brief.md`, write the
28
+ section's short form as `> Summary: <one line>` and keep it current when the section changes. In
29
+ `Who it is for`, write one per role as `> Summary: Role (app or console): what we know.`; in `Must
30
+ do` and `Later`, one per item worth seeing first. The rest of the section stays as written: Read
31
+ more opens it whole. A section without a summary shows its first sentence.
32
+
25
33
  ## Journeys from a normal day
26
34
 
27
35
  Start each journey in `plan/journeys.md` with a moment in the person's normal day,
@@ -4,12 +4,21 @@ One page, agreed before the work. The process is in BuffCore's `docs/PROCESS.md`
4
4
  stage 1 and the sentence every later decision is tested against. Replace the prompts with answers,
5
5
  then keep it current.
6
6
 
7
+ <!-- Under each heading, a `> Summary:` line is the section's short form: the studio's Brief shows
8
+ it and opens the rest from Read more. Keep it to one line. In Who it is for, write one per role
9
+ (`> Summary: Front desk (console): two people, one screen.`); in Must do and Later, one per item
10
+ worth seeing first. A section without one shows its first sentence. -->
11
+
7
12
  ## The idea
8
13
 
14
+ > Summary: <One line: what the section says.>
15
+
9
16
  <What it is, in one paragraph a person outside the project can repeat.>
10
17
 
11
18
  ## Who it is for
12
19
 
20
+ > Summary: <Role (app or console): what we know. One line per role.>
21
+
13
22
  <The people, their situation, and what they will not tolerate.>
14
23
 
15
24
  <What they already use. What does it replace in their day? List what they use today. Plan to
@@ -17,10 +26,14 @@ replace each listed tool or workflow unless the owner writes "keep using it" bes
17
26
 
18
27
  ## The jobs
19
28
 
29
+ > Summary: <One line: what the section says.>
30
+
20
31
  <The three to seven jobs they need done, in their words. Each becomes a journey.>
21
32
 
22
33
  ## Read-back
23
34
 
35
+ > Summary: <One line: what the section says.>
36
+
24
37
  <In a few sentences from the brief, say who it is for, what they need to do in a normal day,
25
38
  and what it replaces or keeps. Wait for the owner's confirmation before drafting the plan or journeys.>
26
39
 
@@ -28,34 +41,50 @@ and what it replaces or keeps. Wait for the owner's confirmation before drafting
28
41
 
29
42
  ## B2B or B2C
30
43
 
44
+ > Summary: <One line: what the section says.>
45
+
31
46
  <B2B or B2C: does a business or an individual buy it?>
32
47
 
33
48
  ## How it earns
34
49
 
50
+ > Summary: <One line: what the section says.>
51
+
35
52
  <Who pays, for what, and how often. Say if it is free.>
36
53
 
37
54
  ## Must do
38
55
 
56
+ > Summary: <A short item. One line per item worth seeing first.>
57
+
39
58
  <The things the first release must do for its people.>
40
59
 
41
60
  ## Later
42
61
 
62
+ > Summary: <A short item. One line per item worth seeing first.>
63
+
43
64
  <What can wait until a later release.>
44
65
 
45
66
  ## The shape
46
67
 
68
+ > Summary: <One line: what the section says.>
69
+
47
70
  <Web, phone, console, or all three; the surfaces each job uses; the accounts and roles.>
48
71
 
49
72
  ## The constraints
50
73
 
74
+ > Summary: <One line: what the section says.>
75
+
51
76
  <Time, money, data, integrations, languages, devices, the law, what the team already knows.>
52
77
 
53
78
  ## What good looks like
54
79
 
80
+ > Summary: <One line: what the section says.>
81
+
55
82
  <The few outcomes that make this worth building, and how the first person will judge it.>
56
83
 
57
84
  ## Not this time
58
85
 
86
+ > Summary: <One line: what the section says.>
87
+
59
88
  <What is deliberately out of scope, so a later request has a home.>
60
89
 
61
90
  ## Open questions