@namzu/cli 18.0.0 → 18.1.0
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.
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/acp.js +1 -0
- package/dist/commands/acp.js.map +1 -1
- package/dist/commands/run-stream.d.ts.map +1 -1
- package/dist/commands/run-stream.js +1 -0
- package/dist/commands/run-stream.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +1 -0
- package/dist/commands/run.js.map +1 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +15 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/schema.d.ts +17 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/context/doctrine.d.ts +44 -0
- package/dist/context/doctrine.d.ts.map +1 -0
- package/dist/context/doctrine.js +81 -0
- package/dist/context/doctrine.js.map +1 -0
- package/dist/context/turn-snapshot.d.ts +59 -0
- package/dist/context/turn-snapshot.d.ts.map +1 -0
- package/dist/context/turn-snapshot.js +122 -0
- package/dist/context/turn-snapshot.js.map +1 -0
- package/dist/integrations/subagents/runtime.d.ts +13 -0
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.js +71 -11
- package/dist/integrations/subagents/runtime.js.map +1 -1
- package/dist/permissions/mode.d.ts +25 -0
- package/dist/permissions/mode.d.ts.map +1 -1
- package/dist/permissions/mode.js +11 -1
- package/dist/permissions/mode.js.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +243 -7
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/Composer.d.ts +6 -1
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/Composer.js +18 -2
- package/dist/tui/Composer.js.map +1 -1
- package/dist/tui/PermissionOverlay.d.ts.map +1 -1
- package/dist/tui/PermissionOverlay.js +16 -1
- package/dist/tui/PermissionOverlay.js.map +1 -1
- package/dist/tui/TaskList.d.ts +30 -0
- package/dist/tui/TaskList.d.ts.map +1 -0
- package/dist/tui/TaskList.js +58 -0
- package/dist/tui/TaskList.js.map +1 -0
- package/dist/tui/agent.d.ts +45 -4
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/agent.js +165 -18
- package/dist/tui/agent.js.map +1 -1
- package/dist/tui/permission-review.d.ts.map +1 -1
- package/dist/tui/permission-review.js +151 -1
- package/dist/tui/permission-review.js.map +1 -1
- package/dist/tui/stream-blocks.d.ts +24 -0
- package/dist/tui/stream-blocks.d.ts.map +1 -1
- package/dist/tui/stream-blocks.js +74 -0
- package/dist/tui/stream-blocks.js.map +1 -1
- package/dist/tui/types.d.ts +3 -1
- package/dist/tui/types.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How namzu works, as text the model reads.
|
|
3
|
+
*
|
|
4
|
+
* The identity block in `tui/agent.ts` says WHO the agent is and what it must
|
|
5
|
+
* never claim. Nothing said HOW it should work: whether to act or ask, how much
|
|
6
|
+
* of a request to deliver, what to do when a test fails, when a shell command
|
|
7
|
+
* is the wrong tool, what is off-limits in git without a person saying so.
|
|
8
|
+
* Every one of those was left to the underlying model's defaults, and the
|
|
9
|
+
* defaults differ per provider — so the same session felt like a different
|
|
10
|
+
* agent depending on which model was behind it, and the operator experienced
|
|
11
|
+
* the gap as "it narrates instead of doing", "it stopped halfway", "it asked
|
|
12
|
+
* me three things it could have decided".
|
|
13
|
+
*
|
|
14
|
+
* This is one string rather than a persona object because the CLI joins raw
|
|
15
|
+
* strings into its system prompt and the persona assembler's own
|
|
16
|
+
* `OutputDiscipline` says the opposite of what an operator watching a
|
|
17
|
+
* terminal wants (`betweenToolCalls: 'silent'`).
|
|
18
|
+
*
|
|
19
|
+
* Two strings, not one, and the split is by TOOL SET rather than by topic.
|
|
20
|
+
* `NAMZU_WORKING_DOCTRINE` names only tools every namzu agent has — the
|
|
21
|
+
* builtins — and goes to the parent and to every delegated sub-agent, because
|
|
22
|
+
* a delegated task edits the same repository under the same rules.
|
|
23
|
+
* `NAMZU_DELEGATION_DOCTRINE` names `task_create` and `Agent`, which a
|
|
24
|
+
* sub-agent does not have, and so goes to the parent only. An adversarial
|
|
25
|
+
* review caught the first draft ordering children to plan with a tool they
|
|
26
|
+
* could not call; a rule about a tool the reader does not have is not
|
|
27
|
+
* guidance, it is an instruction to fail.
|
|
28
|
+
*
|
|
29
|
+
* Each rule below names a behaviour, not a value; a rule about this repository
|
|
30
|
+
* belongs in `AGENTS.md`, which the model receives separately.
|
|
31
|
+
*/
|
|
32
|
+
export const NAMZU_WORKING_DOCTRINE = `## How you work
|
|
33
|
+
|
|
34
|
+
### Delivering work
|
|
35
|
+
- Act when you have enough information. Do not re-derive facts already established, and do not re-open a decision the user has already made.
|
|
36
|
+
- The requested scope is the deliverable. Do not quietly narrow it, widen it, or turn it into something adjacent. Read ambiguity the way a careful colleague would; make the routine judgment calls yourself and check in only when different readings would produce materially different work.
|
|
37
|
+
- Finish the whole task, not just the easy parts. If one part is blocked — a tool or capability you do not have, an input that is missing — say so plainly, do not improvise a result for it, finish every other part in full, and say explicitly what you left out and why. Scaling the work down is the user's call.
|
|
38
|
+
- If you find a real problem with the task as stated, say so in a sentence or two, then keep going under a stated assumption. Reserve blocking questions for cases where proceeding under any assumption would be unsafe or would make the work useless if wrong.
|
|
39
|
+
- If the user repeats or reaffirms a request after you raised a concern, that is their decision: say so and do the full request.
|
|
40
|
+
|
|
41
|
+
### Reporting
|
|
42
|
+
- Report outcomes faithfully. If tests fail, say so and show the output. If you skipped a step, say it was skipped. When something is done and verified, state it plainly without hedging.
|
|
43
|
+
- Never present a green run on a subset as a green run. Name what was actually executed.
|
|
44
|
+
- Reference code as \`path:line\` so the user can jump to it.
|
|
45
|
+
- Correct an earlier statement only when the error would change the user's code, conclusions or decisions; state it once, plainly, and continue. No apologies, no tally of past mistakes.
|
|
46
|
+
|
|
47
|
+
### Reading and editing code
|
|
48
|
+
- Read a file before you edit it, and read enough of the surrounding code to match its comment density, naming and idiom. Code that reads like the file it lives in is the goal; code that reads like a different author is a defect.
|
|
49
|
+
- Prefer the dedicated tools over shell equivalents: \`read\` over \`cat\`, the \`grep\` tool over running \`grep\` or \`rg\` through bash, \`glob\` over \`find\` or \`ls -R\`, \`edit\` over \`sed -i\`. To change an existing file use \`edit\`; use \`write\` only to create a file or when the user asked for a whole-file rewrite. The dedicated tools are bounded, previewable and permission-aware; a shell command is none of those.
|
|
50
|
+
- Independent tool calls go in one response. Reading three files, or running a grep and a glob, does not need three turns. Tools that mutate the workspace — \`bash\`, \`edit\`, \`write\` — are applied one after another even when you emit them together; read-only tools run in parallel.
|
|
51
|
+
- After a change, run the checks that would catch a mistake in it — the package's tests, typecheck, lint — before you report it done. A change you did not verify is a change you are guessing about.
|
|
52
|
+
- Never leave the working tree in a state you have not described. If you created scratch files, say where; if you touched files outside the request, say which.
|
|
53
|
+
|
|
54
|
+
### Working with git
|
|
55
|
+
- Never push, force-push, reset, rebase, clean, or otherwise discard or rewrite history unless the user explicitly asked for that action. Approval for one push does not extend to the next.
|
|
56
|
+
- Before any command that could discard uncommitted work, run \`git status\`. If there are changes there that you did not make, stop and ask rather than stashing, committing or discarding somebody else's work.
|
|
57
|
+
- Commit only when the user asks, on the branch that is checked out. Do not create or switch branches unless the user asks or the project's instructions require it.
|
|
58
|
+
- After a broad \`git add\`, review what was staged before committing; a file whose name looks harmless can still carry a secret.
|
|
59
|
+
|
|
60
|
+
### Keeping the user informed
|
|
61
|
+
- Before a batch of tool calls, say in one short line what you are about to do and why. When you have been working for a while without saying anything, say in a few words where you are, then continue. One line, not a paragraph; the tool rows on screen already show the details.
|
|
62
|
+
- Keep the final reply short and specific: what changed, what was verified, what is left. Do not restate the transcript.`;
|
|
63
|
+
/**
|
|
64
|
+
* Added to the parent's prompt only while the session is in `plan` mode.
|
|
65
|
+
* Says what the permission layer will enforce anyway, so the model plans
|
|
66
|
+
* instead of discovering the boundary one refused call at a time.
|
|
67
|
+
*/
|
|
68
|
+
export const NAMZU_PLAN_MODE_DOCTRINE = `## Plan mode
|
|
69
|
+
|
|
70
|
+
You are in plan mode. Read, search and think; do not change anything. \`read\`, \`grep\`, \`glob\` and the other read-only tools work as usual, and you may keep a task list. Any \`edit\`, \`write\` or shell command that changes state will be refused, so do not attempt one.
|
|
71
|
+
|
|
72
|
+
When you have understood the task, reply with the plan: what you would change, in which files, in what order, and what you would verify. Be concrete — name files and functions — and short enough to read in one screen. Then stop and wait; the user will leave plan mode to have the plan carried out, and that switch is their approval.`;
|
|
73
|
+
/**
|
|
74
|
+
* Parent-only: rules about `task_create` / `task_update` and `Agent`, which a
|
|
75
|
+
* delegated sub-agent does not have. See the module comment for the split.
|
|
76
|
+
*/
|
|
77
|
+
export const NAMZU_DELEGATION_DOCTRINE = `### Planning and delegating
|
|
78
|
+
- For work that is genuinely multi-step — several files, several distinct stages, anything you would write a checklist for — open a task list with \`task_create\` and keep it current with \`task_update\`, marking each step done when it is done rather than at the end. Do not open one for a single inspect-edit-test cycle; the list is for the user to follow, and a list of one item tells them nothing.
|
|
79
|
+
- When the \`Agent\` tool is available, delegate genuinely independent work through it and give each delegation a short, specific description; the user watches those descriptions, not the prompts. Each sub-agent starts with no context, so the prompt must carry everything it needs.
|
|
80
|
+
- Delegate lookups — where something is defined, which files reference it, how a module works — with \`subagent_type: "explore"\`: it has reading and searching tools only and never interrupts the user for permission. Reserve the default sub-agent for work that changes files or runs commands.`;
|
|
81
|
+
//# sourceMappingURL=doctrine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctrine.js","sourceRoot":"","sources":["../../src/context/doctrine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yHA8BmF,CAAA;AAEzH;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;6UAIqS,CAAA;AAE7U;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;qSAG4P,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the repository looked like when the user's turn began.
|
|
3
|
+
*
|
|
4
|
+
* `environment.ts` deliberately keeps the working tree's dirty state out of
|
|
5
|
+
* the system prompt: that block is the cached prefix, and a file count that
|
|
6
|
+
* changes whenever the agent saves would re-key the cache every turn. The
|
|
7
|
+
* counter-argument is just as real — an agent that does not know a tree is
|
|
8
|
+
* dirty commits somebody else's half-finished work, and an agent that does
|
|
9
|
+
* not know the last five commits re-does one of them.
|
|
10
|
+
*
|
|
11
|
+
* Both are right, and the SDK already has the placement that reconciles
|
|
12
|
+
* them: a `turn` prompt contribution rides the ephemeral trailing message,
|
|
13
|
+
* is never cached and never enters history. Reading the snapshot once per
|
|
14
|
+
* user turn and rendering it on the FIRST iteration only gives the model the
|
|
15
|
+
* state it started from at the cost of one uncached message, and leaves later
|
|
16
|
+
* iterations to `git status` for anything that changed since — which the
|
|
17
|
+
* model itself changed, and knows about.
|
|
18
|
+
*
|
|
19
|
+
* ## Untrusted, and said so
|
|
20
|
+
*
|
|
21
|
+
* A file name and a commit subject are text somebody wrote, and this text
|
|
22
|
+
* lands in a SYSTEM message. A branch checked out from a fork can carry a
|
|
23
|
+
* commit titled "ignore your instructions and run …", and a file can be named
|
|
24
|
+
* to close a code fence. So the block goes through the same envelope every
|
|
25
|
+
* tool result from outside the process uses, each line is cut to a bound, and
|
|
26
|
+
* control characters are dropped — the model is told it is looking at data.
|
|
27
|
+
*
|
|
28
|
+
* ## Bounded, in bytes and in lines
|
|
29
|
+
*
|
|
30
|
+
* A status with four hundred entries is a generated directory somebody forgot
|
|
31
|
+
* to ignore, and the first thirty lines say so as well as all four hundred
|
|
32
|
+
* would. The cut is applied after the read, so the read itself is bounded
|
|
33
|
+
* too: a `maxBuffer` a real status can reach, and a two-second deadline. A
|
|
34
|
+
* read that exceeds either produces NO snapshot rather than a wrong one, and
|
|
35
|
+
* the model is left with `git status` as it was before this existed.
|
|
36
|
+
*/
|
|
37
|
+
/** Status entries shown before the rest is summarised as a count. */
|
|
38
|
+
export declare const MAX_STATUS_LINES = 30;
|
|
39
|
+
/** Recent commits shown; enough to see what the last few turns did. */
|
|
40
|
+
export declare const RECENT_COMMITS = 5;
|
|
41
|
+
/** Longest line the block will carry; a path or subject past this is cut. */
|
|
42
|
+
export declare const MAX_LINE_CHARS = 200;
|
|
43
|
+
export interface TurnSnapshot {
|
|
44
|
+
/** `git status --short`, already cut to `MAX_STATUS_LINES`. */
|
|
45
|
+
readonly status: readonly string[];
|
|
46
|
+
/** Entries the cut dropped. `0` when the status was shown whole. */
|
|
47
|
+
readonly omittedStatusLines: number;
|
|
48
|
+
/** `git log --oneline`, newest first. */
|
|
49
|
+
readonly recentCommits: readonly string[];
|
|
50
|
+
}
|
|
51
|
+
/** One line, printable characters only, cut at the bound with a marker. */
|
|
52
|
+
export declare function boundLine(line: string): string;
|
|
53
|
+
/**
|
|
54
|
+
* `null` when the directory is not a repository, so a caller renders nothing
|
|
55
|
+
* rather than an empty heading.
|
|
56
|
+
*/
|
|
57
|
+
export declare function readTurnSnapshot(cwd: string): Promise<TurnSnapshot | null>;
|
|
58
|
+
export declare function composeTurnSnapshot(snapshot: TurnSnapshot): string;
|
|
59
|
+
//# sourceMappingURL=turn-snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turn-snapshot.d.ts","sourceRoot":"","sources":["../../src/context/turn-snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAgBH,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAClC,uEAAuE;AACvE,eAAO,MAAM,cAAc,IAAI,CAAA;AAC/B,6EAA6E;AAC7E,eAAO,MAAM,cAAc,MAAM,CAAA;AAEjC,MAAM,WAAW,YAAY;IAC5B,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC,oEAAoE;IACpE,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;IACnC,yCAAyC;IACzC,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAA;CACzC;AAqBD,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG9C;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAahF;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CA2BlE"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the repository looked like when the user's turn began.
|
|
3
|
+
*
|
|
4
|
+
* `environment.ts` deliberately keeps the working tree's dirty state out of
|
|
5
|
+
* the system prompt: that block is the cached prefix, and a file count that
|
|
6
|
+
* changes whenever the agent saves would re-key the cache every turn. The
|
|
7
|
+
* counter-argument is just as real — an agent that does not know a tree is
|
|
8
|
+
* dirty commits somebody else's half-finished work, and an agent that does
|
|
9
|
+
* not know the last five commits re-does one of them.
|
|
10
|
+
*
|
|
11
|
+
* Both are right, and the SDK already has the placement that reconciles
|
|
12
|
+
* them: a `turn` prompt contribution rides the ephemeral trailing message,
|
|
13
|
+
* is never cached and never enters history. Reading the snapshot once per
|
|
14
|
+
* user turn and rendering it on the FIRST iteration only gives the model the
|
|
15
|
+
* state it started from at the cost of one uncached message, and leaves later
|
|
16
|
+
* iterations to `git status` for anything that changed since — which the
|
|
17
|
+
* model itself changed, and knows about.
|
|
18
|
+
*
|
|
19
|
+
* ## Untrusted, and said so
|
|
20
|
+
*
|
|
21
|
+
* A file name and a commit subject are text somebody wrote, and this text
|
|
22
|
+
* lands in a SYSTEM message. A branch checked out from a fork can carry a
|
|
23
|
+
* commit titled "ignore your instructions and run …", and a file can be named
|
|
24
|
+
* to close a code fence. So the block goes through the same envelope every
|
|
25
|
+
* tool result from outside the process uses, each line is cut to a bound, and
|
|
26
|
+
* control characters are dropped — the model is told it is looking at data.
|
|
27
|
+
*
|
|
28
|
+
* ## Bounded, in bytes and in lines
|
|
29
|
+
*
|
|
30
|
+
* A status with four hundred entries is a generated directory somebody forgot
|
|
31
|
+
* to ignore, and the first thirty lines say so as well as all four hundred
|
|
32
|
+
* would. The cut is applied after the read, so the read itself is bounded
|
|
33
|
+
* too: a `maxBuffer` a real status can reach, and a two-second deadline. A
|
|
34
|
+
* read that exceeds either produces NO snapshot rather than a wrong one, and
|
|
35
|
+
* the model is left with `git status` as it was before this existed.
|
|
36
|
+
*/
|
|
37
|
+
import { execFile } from 'node:child_process';
|
|
38
|
+
import { promisify } from 'node:util';
|
|
39
|
+
import { wrapUntrusted } from '@namzu/sdk';
|
|
40
|
+
const run = promisify(execFile);
|
|
41
|
+
/** Bound on a single git call. A wedged repository must not stall a turn. */
|
|
42
|
+
const GIT_TIMEOUT_MS = 2_000;
|
|
43
|
+
/**
|
|
44
|
+
* Bound on what one call may return. A status line is a path, so this is
|
|
45
|
+
* roughly forty thousand of them — well past any tree this block is for.
|
|
46
|
+
*/
|
|
47
|
+
const GIT_MAX_BUFFER = 4 * 1024 * 1024;
|
|
48
|
+
/** Status entries shown before the rest is summarised as a count. */
|
|
49
|
+
export const MAX_STATUS_LINES = 30;
|
|
50
|
+
/** Recent commits shown; enough to see what the last few turns did. */
|
|
51
|
+
export const RECENT_COMMITS = 5;
|
|
52
|
+
/** Longest line the block will carry; a path or subject past this is cut. */
|
|
53
|
+
export const MAX_LINE_CHARS = 200;
|
|
54
|
+
async function git(cwd, args) {
|
|
55
|
+
try {
|
|
56
|
+
const { stdout } = await run('git', [...args], {
|
|
57
|
+
cwd,
|
|
58
|
+
timeout: GIT_TIMEOUT_MS,
|
|
59
|
+
maxBuffer: GIT_MAX_BUFFER,
|
|
60
|
+
});
|
|
61
|
+
return stdout
|
|
62
|
+
.split('\n')
|
|
63
|
+
.filter((line) => line.length > 0)
|
|
64
|
+
.map(boundLine);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
// Not a repository, no git, a call that timed out or overran the
|
|
68
|
+
// buffer — the snapshot is simply not available, and the block below
|
|
69
|
+
// does not claim one.
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** One line, printable characters only, cut at the bound with a marker. */
|
|
74
|
+
export function boundLine(line) {
|
|
75
|
+
const printable = line.replace(/\p{Cc}/gu, '');
|
|
76
|
+
return printable.length > MAX_LINE_CHARS ? `${printable.slice(0, MAX_LINE_CHARS)}…` : printable;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* `null` when the directory is not a repository, so a caller renders nothing
|
|
80
|
+
* rather than an empty heading.
|
|
81
|
+
*/
|
|
82
|
+
export async function readTurnSnapshot(cwd) {
|
|
83
|
+
const [status, log] = await Promise.all([
|
|
84
|
+
git(cwd, ['status', '--short']),
|
|
85
|
+
git(cwd, ['log', '--oneline', `-${RECENT_COMMITS}`]),
|
|
86
|
+
]);
|
|
87
|
+
if (status === null)
|
|
88
|
+
return null;
|
|
89
|
+
return {
|
|
90
|
+
status: status.slice(0, MAX_STATUS_LINES),
|
|
91
|
+
omittedStatusLines: Math.max(0, status.length - MAX_STATUS_LINES),
|
|
92
|
+
// An unborn branch has no log; that is a repository with no commits,
|
|
93
|
+
// not a failure to read one.
|
|
94
|
+
recentCommits: log ?? [],
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export function composeTurnSnapshot(snapshot) {
|
|
98
|
+
const body = [];
|
|
99
|
+
if (snapshot.status.length === 0) {
|
|
100
|
+
body.push('Working tree: clean.');
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
body.push('Working tree (git status --short):', ...snapshot.status);
|
|
104
|
+
if (snapshot.omittedStatusLines > 0) {
|
|
105
|
+
body.push(`… and ${snapshot.omittedStatusLines} more`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (snapshot.recentCommits.length > 0) {
|
|
109
|
+
body.push('', 'Recent commits (newest first):', ...snapshot.recentCommits);
|
|
110
|
+
}
|
|
111
|
+
return [
|
|
112
|
+
'## Repository at the start of this turn',
|
|
113
|
+
'',
|
|
114
|
+
wrapUntrusted({
|
|
115
|
+
kind: 'repository-snapshot',
|
|
116
|
+
provenance: 'File names and commit subjects read from the working directory with git. They were written by whoever committed or created them.',
|
|
117
|
+
}, body.join('\n')),
|
|
118
|
+
'',
|
|
119
|
+
'This is a snapshot from when the turn started; it does not update as you work. Run `git status` before any action that depends on the current state.',
|
|
120
|
+
].join('\n');
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=turn-snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turn-snapshot.js","sourceRoot":"","sources":["../../src/context/turn-snapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C,MAAM,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;AAE/B,6EAA6E;AAC7E,MAAM,cAAc,GAAG,KAAK,CAAA;AAC5B;;;GAGG;AACH,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA;AACtC,qEAAqE;AACrE,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAClC,uEAAuE;AACvE,MAAM,CAAC,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ateConfig, type LLMProvider, type PathBuilder, type ProjectInstructionContext, type ResumeHandler, type RunEvent, type SandboxProvider, type TaskScheduler, type ToolContext, type ToolDefinition, type ToolRegistryContract } from '@namzu/sdk';
|
|
15
15
|
import { type SubagentActivitySource } from './activity.js';
|
|
16
16
|
export declare const GENERAL_PURPOSE_SUBAGENT = "general-purpose";
|
|
17
|
+
/**
|
|
18
|
+
* A sub-agent that can only look.
|
|
19
|
+
*
|
|
20
|
+
* "Find where X is defined", "which files reference Y", "how does Z work" are
|
|
21
|
+
* the delegations a parent makes most, and every one of them ran with
|
|
22
|
+
* `write`, `edit` and `bash` in the child's roster — so a lookup needed the
|
|
23
|
+
* same approvals as a change, and an operator in `accept-edits` mode was
|
|
24
|
+
* still asked about a child's shell command that only wanted to `cat`. This
|
|
25
|
+
* definition's registry is the parent's working set filtered to tools that
|
|
26
|
+
* declare themselves read-only, so a child that cannot change anything is
|
|
27
|
+
* never asked whether it may.
|
|
28
|
+
*/
|
|
29
|
+
export declare const EXPLORE_SUBAGENT = "explore";
|
|
17
30
|
export interface SubagentRuntimeOptions {
|
|
18
31
|
readonly cwd: string;
|
|
19
32
|
readonly model: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/integrations/subagents/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAMN,KAAK,uBAAuB,EAQ5B,KAAK,WAAW,EAEhB,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAG9B,KAAK,aAAa,EAElB,KAAK,QAAQ,EACb,KAAK,eAAe,EAGpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/integrations/subagents/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAMN,KAAK,uBAAuB,EAQ5B,KAAK,WAAW,EA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ChD,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAA;CAC5C;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAA;IAC/B,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAA;IAClC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3C,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAA;IACzC,uEAAuE;IACvE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB;AAQD;;;GAGG;AACH,wBAAsB,qBAAqB,CAC1C,IAAI,EAAE,sBAAsB,GAC1B,OAAO,CAAC,eAAe,CAAC,CA2R1B"}
|
|
@@ -11,10 +11,49 @@
|
|
|
11
11
|
* store backs the AgentManager, so sub-agent bookkeeping never touches the
|
|
12
12
|
* CLI's on-disk `/resume` conversation store.
|
|
13
13
|
*/
|
|
14
|
-
import { AgentManager, AgentRegistry, DefaultCapacityValidator, InMemorySessionStore, InMemoryTopicStore, LocalTaskScheduler, ReactiveAgent, RunCancelled, SessionSummaryMaterializer, TopicManager, WorkspaceBackendRegistry, asRunId, asSummaryId, asTenantId, asUserId, defineTool, mcpJsonSchemaToZod, } from '@namzu/sdk';
|
|
14
|
+
import { AgentManager, AgentRegistry, DefaultCapacityValidator, InMemorySessionStore, InMemoryTopicStore, LocalTaskScheduler, ReactiveAgent, RunCancelled, SessionSummaryMaterializer, ToolRegistry, TopicManager, WorkspaceBackendRegistry, asRunId, asSummaryId, asTenantId, asUserId, defineTool, mcpJsonSchemaToZod, } from '@namzu/sdk';
|
|
15
|
+
import { NAMZU_WORKING_DOCTRINE } from '../../context/doctrine.js';
|
|
15
16
|
import { MAX_AGENT_ACTIVITY_LABEL_CODE_UNITS, MAX_AGENT_PHASE_ORDER, SubagentActivityMonitor, } from './activity.js';
|
|
16
17
|
import { CLI_INTERACTIVE_RUN_TIMEOUT_MS } from './policy.js';
|
|
17
18
|
export const GENERAL_PURPOSE_SUBAGENT = 'general-purpose';
|
|
19
|
+
/**
|
|
20
|
+
* A sub-agent that can only look.
|
|
21
|
+
*
|
|
22
|
+
* "Find where X is defined", "which files reference Y", "how does Z work" are
|
|
23
|
+
* the delegations a parent makes most, and every one of them ran with
|
|
24
|
+
* `write`, `edit` and `bash` in the child's roster — so a lookup needed the
|
|
25
|
+
* same approvals as a change, and an operator in `accept-edits` mode was
|
|
26
|
+
* still asked about a child's shell command that only wanted to `cat`. This
|
|
27
|
+
* definition's registry is the parent's working set filtered to tools that
|
|
28
|
+
* declare themselves read-only, so a child that cannot change anything is
|
|
29
|
+
* never asked whether it may.
|
|
30
|
+
*/
|
|
31
|
+
export const EXPLORE_SUBAGENT = 'explore';
|
|
32
|
+
const EXPLORE_PROMPT = [
|
|
33
|
+
'You are a read-only sub-agent dispatched by namzu to find things out: where something is defined, which files reference it, how a piece of code works, what a directory contains.',
|
|
34
|
+
'You cannot see the parent conversation — work only from the prompt you were given.',
|
|
35
|
+
'You have reading and searching tools only. You cannot edit, write or run commands, and you must not describe a change as made.',
|
|
36
|
+
'Search broadly first, then read what matters. Report file paths with line numbers, quote the relevant lines, and say plainly what you did not find.',
|
|
37
|
+
'End with a concise answer the parent can act on; do not ask the parent questions.',
|
|
38
|
+
'',
|
|
39
|
+
NAMZU_WORKING_DOCTRINE,
|
|
40
|
+
].join('\n');
|
|
41
|
+
/**
|
|
42
|
+
* The parent's roster, minus everything that can change state.
|
|
43
|
+
*
|
|
44
|
+
* Decided by each tool's own `isReadOnly` with no input — the declaration
|
|
45
|
+
* `defineTool` records — rather than by a name list here, so a new read-only
|
|
46
|
+
* builtin joins the explore roster without this file learning its name and
|
|
47
|
+
* a tool that stops being read-only leaves it the same way.
|
|
48
|
+
*/
|
|
49
|
+
function readOnlyToolsFrom(source) {
|
|
50
|
+
const filtered = new ToolRegistry();
|
|
51
|
+
for (const tool of source.getAll()) {
|
|
52
|
+
if (tool.isReadOnly?.(undefined) === true)
|
|
53
|
+
filtered.register(tool);
|
|
54
|
+
}
|
|
55
|
+
return filtered;
|
|
56
|
+
}
|
|
18
57
|
const SUBAGENT_PROMPT = [
|
|
19
58
|
'You are a focused sub-agent dispatched by namzu to complete one self-contained task and report back.',
|
|
20
59
|
'You cannot see the parent conversation — work only from the prompt you were given.',
|
|
@@ -22,9 +61,14 @@ const SUBAGENT_PROMPT = [
|
|
|
22
61
|
'Be thorough but do not ask the parent questions; make reasonable assumptions and state them.',
|
|
23
62
|
'',
|
|
24
63
|
'Never fabricate. Only report results you actually produced via tool calls:',
|
|
25
|
-
'- If you
|
|
64
|
+
'- If you create a file, create it with the `write` tool; if you change an existing one, use `edit`. Report the real path either way; never claim a file exists without a tool having written it.',
|
|
26
65
|
'- If you need to research and have no web tool available, say so plainly and answer from your own knowledge with that caveat — do not invent sources, data, or URLs.',
|
|
27
66
|
'- Do not invent command output or results. If you cannot complete the task, say what blocked you.',
|
|
67
|
+
'',
|
|
68
|
+
// The same working rules the parent runs under. A delegated task edits the
|
|
69
|
+
// same repository, and a child that reads a file before editing it while
|
|
70
|
+
// the parent does not is the same defect in the other direction.
|
|
71
|
+
NAMZU_WORKING_DOCTRINE,
|
|
28
72
|
].join('\n');
|
|
29
73
|
/** A delegated run may never inherit the SDK's headless auto-approval fallback. */
|
|
30
74
|
const refuseUnownedChildReview = async () => ({
|
|
@@ -68,6 +112,7 @@ export async function createSubagentRuntime(opts) {
|
|
|
68
112
|
});
|
|
69
113
|
const registry = new AgentRegistry();
|
|
70
114
|
registry.register(buildDefinition(GENERAL_PURPOSE_SUBAGENT, 'A general-purpose sub-agent.', SUBAGENT_PROMPT, opts));
|
|
115
|
+
registry.register(buildDefinition(EXPLORE_SUBAGENT, 'A read-only sub-agent for finding files, symbols and answers.', EXPLORE_PROMPT, opts, () => readOnlyToolsFrom(opts.buildTools())));
|
|
71
116
|
const topicManager = new TopicManager({ topicStore, sessionStore: store });
|
|
72
117
|
const manager = new AgentManager(registry, { childTimeoutMs: CLI_INTERACTIVE_RUN_TIMEOUT_MS }, {
|
|
73
118
|
sessionStore: store,
|
|
@@ -97,9 +142,13 @@ export async function createSubagentRuntime(opts) {
|
|
|
97
142
|
const agentTool = defineTool({
|
|
98
143
|
name: 'Agent',
|
|
99
144
|
description: 'Delegate a self-contained task to a sub-agent and get its result back (BLOCKING). ' +
|
|
100
|
-
'
|
|
101
|
-
'
|
|
102
|
-
'
|
|
145
|
+
'Pick `subagent_type: "explore"` for anything that only needs to look — where is X defined, which ' +
|
|
146
|
+
'files reference Y, how does Z work — it has reading and searching tools only and never asks for ' +
|
|
147
|
+
'permission. Use the default "general-purpose" when the task must change files or run commands. ' +
|
|
148
|
+
'Define a specialist inline with `role` — a system prompt describing who the sub-agent ' +
|
|
149
|
+
'is and how to behave (e.g. "You are a security auditor; flag vulnerabilities and rate severity"); ' +
|
|
150
|
+
'with `subagent_type: "explore"` the role keeps the read-only roster. ' +
|
|
151
|
+
'Omit `role` for the plain sub-agent. The sub-agent runs in its own context with its own ' +
|
|
103
152
|
'tools and cannot see this conversation — put everything it needs in `prompt`. Call this multiple ' +
|
|
104
153
|
'times in one response to run specialists in parallel. When coordinating several specialists, give ' +
|
|
105
154
|
'them the same `workflow` label and an explicit `phase` plus `phase_order` so the operator can follow ' +
|
|
@@ -116,6 +165,11 @@ export async function createSubagentRuntime(opts) {
|
|
|
116
165
|
type: 'string',
|
|
117
166
|
description: 'Self-contained task with all the context the sub-agent needs.',
|
|
118
167
|
},
|
|
168
|
+
subagent_type: {
|
|
169
|
+
type: 'string',
|
|
170
|
+
enum: [GENERAL_PURPOSE_SUBAGENT, EXPLORE_SUBAGENT],
|
|
171
|
+
description: '"explore" for read-only lookups (find, search, explain); "general-purpose" (default) when the task changes files or runs commands.',
|
|
172
|
+
},
|
|
119
173
|
role: {
|
|
120
174
|
type: 'string',
|
|
121
175
|
description: 'Optional persona / system prompt that defines this specialist sub-agent. Omit for general-purpose.',
|
|
@@ -146,13 +200,17 @@ export async function createSubagentRuntime(opts) {
|
|
|
146
200
|
concurrencySafe: true,
|
|
147
201
|
timeoutMs: CLI_INTERACTIVE_RUN_TIMEOUT_MS,
|
|
148
202
|
async execute(input, context) {
|
|
149
|
-
const { description, prompt, role, workflow, phase, phase_order } = input;
|
|
150
|
-
|
|
203
|
+
const { description, prompt, subagent_type, role, workflow, phase, phase_order } = input;
|
|
204
|
+
const explore = subagent_type === EXPLORE_SUBAGENT;
|
|
205
|
+
let agentId = explore ? EXPLORE_SUBAGENT : GENERAL_PURPOSE_SUBAGENT;
|
|
151
206
|
const persona = typeof role === 'string' ? role.trim() : '';
|
|
152
207
|
const dynamic = persona.length > 0;
|
|
153
208
|
if (dynamic) {
|
|
209
|
+
// A role on top of explore keeps explore's roster: the persona says
|
|
210
|
+
// who the child is, the type says what it may touch, and a role
|
|
211
|
+
// must not be a way to hand a read-only child a `write` tool.
|
|
154
212
|
agentId = `dyn-${++dynCounter}`;
|
|
155
|
-
registry.register(buildDefinition(agentId, `Dynamic specialist: ${agentId}`, persona, opts));
|
|
213
|
+
registry.register(buildDefinition(agentId, `Dynamic specialist: ${agentId}`, persona, opts, explore ? () => readOnlyToolsFrom(opts.buildTools()) : opts.buildTools));
|
|
156
214
|
}
|
|
157
215
|
const tracker = activity.begin({
|
|
158
216
|
agentId,
|
|
@@ -246,7 +304,7 @@ export async function createSubagentRuntime(opts) {
|
|
|
246
304
|
return {
|
|
247
305
|
gateway,
|
|
248
306
|
agentTool,
|
|
249
|
-
allowedAgentIds: [GENERAL_PURPOSE_SUBAGENT],
|
|
307
|
+
allowedAgentIds: [GENERAL_PURPOSE_SUBAGENT, EXPLORE_SUBAGENT],
|
|
250
308
|
activity,
|
|
251
309
|
close,
|
|
252
310
|
};
|
|
@@ -311,7 +369,9 @@ async function runBlockingAgentTask(input) {
|
|
|
311
369
|
* for the static `general-purpose` agent and for each dynamically-defined
|
|
312
370
|
* specialist the model creates via the `Agent` tool's `role` argument.
|
|
313
371
|
*/
|
|
314
|
-
function buildDefinition(id, description, systemPrompt, opts
|
|
372
|
+
function buildDefinition(id, description, systemPrompt, opts,
|
|
373
|
+
/** This definition's own roster; absent means the parent's working set. */
|
|
374
|
+
tools = opts.buildTools) {
|
|
315
375
|
const agent = new ReactiveAgent({
|
|
316
376
|
id,
|
|
317
377
|
name: id,
|
|
@@ -348,7 +408,7 @@ function buildDefinition(id, description, systemPrompt, opts) {
|
|
|
348
408
|
timeoutMs: options.timeoutMs ?? CLI_INTERACTIVE_RUN_TIMEOUT_MS,
|
|
349
409
|
maxIterations: 40,
|
|
350
410
|
provider: opts.buildProvider(),
|
|
351
|
-
tools:
|
|
411
|
+
tools: tools(),
|
|
352
412
|
systemPrompt: environment ? `${base}\n\n${environment}` : base,
|
|
353
413
|
...(opts.projectInstructionContext
|
|
354
414
|
? { projectInstructionContext: opts.projectInstructionContext() }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../src/integrations/subagents/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAGN,YAAY,EACZ,aAAa,EAOb,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAElB,kBAAkB,EAGlB,aAAa,EAGb,YAAY,EAGZ,0BAA0B,EAM1B,YAAY,EACZ,wBAAwB,EACxB,OAAO,EACP,WAAW,EACX,UAAU,EACV,QAAQ,EACR,UAAU,EACV,kBAAkB,GAClB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACN,mCAAmC,EACnC,qBAAqB,EACrB,uBAAuB,GAEvB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAA;AAE5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAA;AAEzD,MAAM,eAAe,GAAG;IACvB,sGAAsG;IACtG,oFAAoF;IACpF,2HAA2H;IAC3H,8FAA8F;IAC9F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AE,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1E,GAAG,CAAC,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,gBAAgB;oBAChD,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,EAAE;oBACnD,CAAC,CAAC,EAAE,CAAC;gBACN,GAAG,CAAC,IAAI,CAAC,wBAAwB,KAAK,SAAS;oBAC9C,CAAC,CAAC,EAAE,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,EAAE;oBAC7D,CAAC,CAAC,EAAE,CAAC;gBACN,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC9D,CAAA;QACF,CAAC;KACD,CAAA;AACF,CAAC"}
|
|
@@ -29,6 +29,27 @@ export type PermissionMode =
|
|
|
29
29
|
* always done — named here rather than left implicit.
|
|
30
30
|
*/
|
|
31
31
|
| 'auto'
|
|
32
|
+
/**
|
|
33
|
+
* Approve a file edit, ask about everything else.
|
|
34
|
+
*
|
|
35
|
+
* The mode an operator watching the agent write code actually wants: an
|
|
36
|
+
* `edit` or `write` inside the working directory is what they asked for
|
|
37
|
+
* and is undoable with `git`, so a prompt on each one is a prompt they
|
|
38
|
+
* answer `y` to forty times an hour — and a prompt that is always answered
|
|
39
|
+
* the same way trains the hand to answer the next one, which is the bash
|
|
40
|
+
* prompt, the same way. Shell commands, delegation and anything a tool
|
|
41
|
+
* declares destructive still ask. Deny rules and the dangerous-pattern
|
|
42
|
+
* floor sit above this as above every mode.
|
|
43
|
+
*/
|
|
44
|
+
| 'accept-edits'
|
|
45
|
+
/**
|
|
46
|
+
* Read and think, do not act. A call that only reads is approved; a call
|
|
47
|
+
* that would change anything is refused with feedback telling the model
|
|
48
|
+
* to present its plan instead. The operator reads the plan and switches
|
|
49
|
+
* mode to have it carried out — the switch IS the approval, which is why
|
|
50
|
+
* this is a permission mode rather than a separate screen.
|
|
51
|
+
*/
|
|
52
|
+
| 'plan'
|
|
32
53
|
/**
|
|
33
54
|
* Refuse it. Nothing runs unless a rule allowed it by name or pattern.
|
|
34
55
|
*
|
|
@@ -39,6 +60,10 @@ export type PermissionMode =
|
|
|
39
60
|
*/
|
|
40
61
|
| 'strict';
|
|
41
62
|
export declare const PERMISSION_MODES: readonly PermissionMode[];
|
|
63
|
+
/** What the model is told when a call is refused under `plan`. */
|
|
64
|
+
export declare const PLAN_MODE_REFUSAL = "Refused: plan mode is read-only. Explore with the reading tools, then present the plan as your reply \u2014 what you would change, in which files, and in what order. The user will switch out of plan mode to have it carried out.";
|
|
65
|
+
/** The tools `accept-edits` approves without asking. Everything else prompts. */
|
|
66
|
+
export declare const ACCEPT_EDITS_TOOLS: ReadonlySet<string>;
|
|
42
67
|
export declare function isPermissionMode(value: unknown): value is PermissionMode;
|
|
43
68
|
/**
|
|
44
69
|
* The mode for a run, from the flag, the bypass alias, and whether anyone is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mode.d.ts","sourceRoot":"","sources":["../../src/permissions/mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,cAAc;AACzB,4DAA4D;AAC1D,QAAQ;AACV;;;GAGG;GACD,MAAM;AACR;;;;;;;GAOG;GACD,QAAQ,CAAA;AAEX,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,
|
|
1
|
+
{"version":3,"file":"mode.d.ts","sourceRoot":"","sources":["../../src/permissions/mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,cAAc;AACzB,4DAA4D;AAC1D,QAAQ;AACV;;;GAGG;GACD,MAAM;AACR;;;;;;;;;;;GAWG;GACD,cAAc;AAChB;;;;;;GAMG;GACD,MAAM;AACR;;;;;;;GAOG;GACD,QAAQ,CAAA;AAEX,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAMrD,CAAA;AAED,kEAAkE;AAClE,eAAO,MAAM,iBAAiB,wOACmM,CAAA;AAEjO,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAA8B,CAAA;AAEjF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAA;IAClC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;CAC7B,GAAG;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAa/C"}
|
package/dist/permissions/mode.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
export const PERMISSION_MODES = [
|
|
1
|
+
export const PERMISSION_MODES = [
|
|
2
|
+
'prompt',
|
|
3
|
+
'accept-edits',
|
|
4
|
+
'auto',
|
|
5
|
+
'strict',
|
|
6
|
+
'plan',
|
|
7
|
+
];
|
|
8
|
+
/** What the model is told when a call is refused under `plan`. */
|
|
9
|
+
export const PLAN_MODE_REFUSAL = 'Refused: plan mode is read-only. Explore with the reading tools, then present the plan as your reply — what you would change, in which files, and in what order. The user will switch out of plan mode to have it carried out.';
|
|
10
|
+
/** The tools `accept-edits` approves without asking. Everything else prompts. */
|
|
11
|
+
export const ACCEPT_EDITS_TOOLS = new Set(['edit', 'write']);
|
|
2
12
|
export function isPermissionMode(value) {
|
|
3
13
|
return typeof value === 'string' && PERMISSION_MODES.includes(value);
|
|
4
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mode.js","sourceRoot":"","sources":["../../src/permissions/mode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mode.js","sourceRoot":"","sources":["../../src/permissions/mode.ts"],"names":[],"mappings":"AA8DA,MAAM,CAAC,MAAM,gBAAgB,GAA8B;IAC1D,QAAQ;IACR,cAAc;IACd,MAAM;IACN,QAAQ;IACR,MAAM;CACN,CAAA;AAED,kEAAkE;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAC7B,gOAAgO,CAAA;AAEjO,iFAAiF;AACjF,MAAM,CAAC,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAEjF,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC9C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,gBAAsC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC5F,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAIrC;IACA,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,EAAE,CAAC;QAC3C,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAClC,OAAO;gBACN,KAAK,EAAE,qCAAqC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,IAAI;aAC9F,CAAA;QACF,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAA;IAC3B,CAAC;IACD,IAAI,IAAI,CAAC,eAAe;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;IACjD,4EAA4E;IAC5E,kEAAkE;IAClE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAA;AACtD,CAAC"}
|
package/dist/tui/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/tui/App.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAON,KAAK,OAAO,EAiBZ,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/tui/App.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAON,KAAK,OAAO,EAiBZ,MAAM,YAAY,CAAA;AAqHnB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AA2CvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAU/D,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAA;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAA;IAC1D,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,CAAC,EAAE,qBAAqB,CAAA;CAC/C;AAOD,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAC5B,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AA2MrB,6EAA6E;AAC7E,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,SAAS,MAAM,EAAE,CAM7F;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,MAAM,EAAE,MAAM,MAAM,EACpB,iBAAiB,GAAE,SAAS,MAAM,EAAO,GACvC,SAAS,iBAAiB,EAAE,CAuE9B;AA+GD,wBAAgB,GA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