@sixb/agent 0.2.5 → 0.2.6
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/agent-prompt.d.ts +13 -3
- package/dist/agent-prompt.d.ts.map +1 -1
- package/dist/background-commands.d.ts +2 -2
- package/dist/context-compaction.d.ts.map +1 -1
- package/dist/conversation-messages.d.ts +1 -1
- package/dist/conversation-messages.d.ts.map +1 -1
- package/dist/index.js +339 -240
- package/dist/index.js.map +17 -17
- package/dist/login-shell.d.ts +18 -2
- package/dist/login-shell.d.ts.map +1 -1
- package/dist/model-adapters.d.ts +5 -2
- package/dist/model-adapters.d.ts.map +1 -1
- package/dist/model-lines.d.ts +1 -0
- package/dist/model-lines.d.ts.map +1 -1
- package/dist/run-conversation-turn.d.ts.map +1 -1
- package/dist/run-environment.d.ts.map +1 -1
- package/dist/run-sandbox.d.ts +11 -1
- package/dist/run-sandbox.d.ts.map +1 -1
- package/dist/run-subagent.d.ts.map +1 -1
- package/dist/sandbox-api-context.d.ts.map +1 -1
- package/dist/subagent-tools.d.ts +11 -1
- package/dist/subagent-tools.d.ts.map +1 -1
- package/dist/tools/bash.d.ts +1 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/agent-prompt.ts +62 -28
- package/src/background-commands.ts +8 -6
- package/src/context-compaction.ts +1 -0
- package/src/conversation-messages.ts +11 -4
- package/src/login-shell.ts +30 -3
- package/src/model-adapters.ts +23 -4
- package/src/model-lines.ts +1 -1
- package/src/run-conversation-turn.ts +11 -2
- package/src/run-environment.ts +38 -11
- package/src/run-sandbox.ts +60 -1
- package/src/run-subagent.ts +8 -1
- package/src/sandbox-api-context.ts +7 -1
- package/src/subagent-tools.ts +23 -5
- package/src/tools/bash.ts +9 -10
package/dist/login-shell.d.ts
CHANGED
|
@@ -11,6 +11,22 @@
|
|
|
11
11
|
* Arguments: the script.
|
|
12
12
|
*/
|
|
13
13
|
export declare const LOGIN_SHELL_SCRIPT = "exec \"$BASH\" -c \"$1\" bash";
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* {@link LOGIN_SHELL_SCRIPT}, in a directory the shell changes to itself. A directory that does not
|
|
16
|
+
* exist fails the command with bash's own message, which the model can read and correct. Given
|
|
17
|
+
* to the sandbox instead, it would refuse to start the command, and a refused command leaves the
|
|
18
|
+
* workspace unconfirmed. Falling off the end, unlike `exit`, does not run `~/.bash_logout`.
|
|
19
|
+
*
|
|
20
|
+
* Arguments: the directory, then the script.
|
|
21
|
+
*/
|
|
22
|
+
export declare const LOGIN_SHELL_SCRIPT_IN_DIRECTORY = "cd -- \"$1\" && exec \"$BASH\" -c \"$2\" bash";
|
|
23
|
+
/** `bash` arguments that run `script` as {@link LOGIN_SHELL_SCRIPT} does, in `directory` if given. */
|
|
24
|
+
export declare function loginShellArgs(script: string, directory?: string): string[];
|
|
25
|
+
/**
|
|
26
|
+
* The absolute directory a command's `cwd` names, for the shell to change to. A relative one
|
|
27
|
+
* resolves against the sandbox's working directory, as the bash tool describes it: in a workspace
|
|
28
|
+
* cloned from Git, that is the checkout, not the provider's own directory above it. A model's
|
|
29
|
+
* `cwd` never reaches the provider: see {@link LOGIN_SHELL_SCRIPT_IN_DIRECTORY}.
|
|
30
|
+
*/
|
|
31
|
+
export declare function commandDirectory(workingDirectory: string, cwd: string | undefined): string | undefined;
|
|
16
32
|
//# sourceMappingURL=login-shell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-shell.d.ts","sourceRoot":"","sources":["../src/login-shell.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"login-shell.d.ts","sourceRoot":"","sources":["../src/login-shell.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,kCAA8B,CAAA;AAE7D;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,kDAA4C,CAAA;AAExF,sGAAsG;AACtG,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAI3E;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,gBAAgB,EAAE,MAAM,EACxB,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,MAAM,GAAG,SAAS,CAEpB"}
|
package/dist/model-adapters.d.ts
CHANGED
|
@@ -53,7 +53,10 @@ export type AgentToolOutputFileOf = (toolCallId: string) => AgentToolCallFile |
|
|
|
53
53
|
export declare function agentTraceFromModelSteps(steps: readonly ModelStep[], errorDetails?: AgentErrorDetails, outputFileOf?: AgentToolOutputFileOf): readonly AgentMessagePart[];
|
|
54
54
|
/** Convert an aborted model loop, retaining only coherent content from its in-flight step. */
|
|
55
55
|
export declare function agentTraceFromPartialModelLoop(steps: readonly ModelStep[], partialContent: readonly ModelAssistantPart[], errorDetails?: AgentErrorDetails, outputFileOf?: AgentToolOutputFileOf): readonly AgentMessagePart[];
|
|
56
|
-
/**
|
|
57
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Expose only failures that the tool author explicitly marked as safe for the model and storage,
|
|
58
|
+
* and a stopped sandbox, in fixed words, even when the tool wrapped it.
|
|
59
|
+
*/
|
|
60
|
+
export declare function agentToolErrorText(error: unknown, fallback?: string): string;
|
|
58
61
|
export {};
|
|
59
62
|
//# sourceMappingURL=model-adapters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-adapters.d.ts","sourceRoot":"","sources":["../src/model-adapters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE7D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAExB,KAAK,aAAa,EACnB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-lines.d.ts","sourceRoot":"","sources":["../src/model-lines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAA;IACjC,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,yFAAyF;IACzF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B,GAAG,MAAM,CAOT"}
|
|
1
|
+
{"version":3,"file":"model-lines.d.ts","sourceRoot":"","sources":["../src/model-lines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAA;IACjC,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,yFAAyF;IACzF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B,GAAG,MAAM,CAOT;AAGD,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-conversation-turn.d.ts","sourceRoot":"","sources":["../src/run-conversation-turn.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,4BAA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MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAA;KAC1C,GAAG,cAAc,CAAA;IAClB;;;OAGG;IACH,UAAU,CACR,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,oBAAoB,GAAG,SAAS,GAC9C,IAAI,CAAA;IACP,0FAA0F;IAC1F,kBAAkB,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACjD,2EAA2E;IAC3E,aAAa,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAAA;IACnF;;;OAGG;IACH,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;CACnD;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE;IAC/C,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC,0BAA0B,CAAC,CAAA;IAC7D,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAA;IACvC,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAC7B,GAAG,OAAO,CAAC,IAAI,CAAC,CAsIhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-environment.d.ts","sourceRoot":"","sources":["../src/run-environment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"run-environment.d.ts","sourceRoot":"","sources":["../src/run-environment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAA0B,MAAM,YAAY,CAAA;AACnE,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,cAAc,EACnB,KAAK,eAAe,EAGpB,KAAK,gBAAgB,EAGtB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAE,kBAAkB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D,KAAK,EAAE,uCAAuC,GAC7C,OAAO,CAAC,yBAAyB,CAAC,CAuDpC"}
|
package/dist/run-sandbox.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Sandbox, SandboxNotRunningError } from "@sixb/core";
|
|
2
2
|
import type { SandboxNetworkPolicy } from "@sixb/core/sandboxes";
|
|
3
3
|
import type { AgentWorkspacePromptContext } from "./agent-prompt";
|
|
4
4
|
import type { BackgroundCommands } from "./background-commands";
|
|
@@ -80,4 +80,14 @@ export interface BeforeFinalizeOptions {
|
|
|
80
80
|
* next run while the files stay as they are.
|
|
81
81
|
*/
|
|
82
82
|
export declare function acquireRunSandbox(sandbox: RunSandbox, signal?: AbortSignal): Promise<AcquiredRunSandbox>;
|
|
83
|
+
/**
|
|
84
|
+
* The run's sandbox, which calls `onStopped` each time a command or a file write finds that its
|
|
85
|
+
* provider stopped it, such as at the end of a Vercel session. Whichever tool met it, nothing more
|
|
86
|
+
* runs in it: the run ends instead of the model retrying there.
|
|
87
|
+
*/
|
|
88
|
+
export declare function endsWhenStopped(session: Sandbox, onStopped: (error: SandboxNotRunningError) => void): Sandbox;
|
|
89
|
+
/** Why a run whose sandbox stopped ended, in the words its run and its reader see. */
|
|
90
|
+
export declare function sandboxStoppedError(cause: SandboxNotRunningError, message: string): Error;
|
|
91
|
+
/** The provider's stop a run ended on, when `sandboxStoppedError` says that is why it ended. */
|
|
92
|
+
export declare function sandboxStopOf(error: unknown): SandboxNotRunningError | undefined;
|
|
83
93
|
//# sourceMappingURL=run-sandbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-sandbox.d.ts","sourceRoot":"","sources":["../src/run-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"run-sandbox.d.ts","sourceRoot":"","sources":["../src/run-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO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AM,wBAAwB,2BAA2B,CAAA;AAGhE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAC/C;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,gFAAgF;IAChF,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,sFAAsF;IACtF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,8BAA8B,CAAA;IACrD,QAAQ,CAAC,MAAM,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAChD,iGAAiG;IACjG,QAAQ,CAAC,aAAa,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACnD,qFAAqF;IACrF,QAAQ,CAAC,SAAS,CAAC,EAAE,qBAAqB,CAAA;IAC1C,uEAAuE;IACvE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAA;CACjD;AAED,wBAAsB,6BAA6B,CACjD,KAAK,EAAE,kCAAkC,GACxC,OAAO,CAAC,sBAAsB,CAAC,CA0IjC"}
|
package/dist/subagent-tools.d.ts
CHANGED
|
@@ -140,6 +140,8 @@ export declare class SubagentCoordinator {
|
|
|
140
140
|
* Starting a run already running is a no-op.
|
|
141
141
|
*/
|
|
142
142
|
private readonly startChild;
|
|
143
|
+
/** When the parent conversation last moved workspaces, so paused child sandboxes know. */
|
|
144
|
+
private readonly movedAt?;
|
|
143
145
|
private readonly models;
|
|
144
146
|
constructor(
|
|
145
147
|
/** What the turn offers its children: the project's language models, and its tools. */
|
|
@@ -151,7 +153,9 @@ export declare class SubagentCoordinator {
|
|
|
151
153
|
* it claims the child's run, opens its session and environment, and records its fate.
|
|
152
154
|
* Starting a run already running is a no-op.
|
|
153
155
|
*/
|
|
154
|
-
startChild: (run: SubagentRunRecord, family: FamilyMailbox) => void
|
|
156
|
+
startChild: (run: SubagentRunRecord, family: FamilyMailbox) => void,
|
|
157
|
+
/** When the parent conversation last moved workspaces, so paused child sandboxes know. */
|
|
158
|
+
movedAt?: Date | undefined);
|
|
155
159
|
/** The turn ended: it sends its children nothing more. */
|
|
156
160
|
close(): void;
|
|
157
161
|
/**
|
|
@@ -261,6 +265,12 @@ export declare class SubagentCoordinator {
|
|
|
261
265
|
* spawned with this key, else nothing once checked that the turn may spawn another.
|
|
262
266
|
*/
|
|
263
267
|
private admissionOf;
|
|
268
|
+
/**
|
|
269
|
+
* Whether a paused child finds its workspace where it left it: its provider keeps them, the
|
|
270
|
+
* conversation did not move to a computer since it paused, and it did not move to another
|
|
271
|
+
* workspace before that pause ended.
|
|
272
|
+
*/
|
|
273
|
+
private childKeepsWorkspace;
|
|
264
274
|
/**
|
|
265
275
|
* The run of this turn that continues `paused` in its thread: its model, task and files, this
|
|
266
276
|
* turn's mode, and a trigger of what it goes on with (the outcomes of its calls, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-tools.d.ts","sourceRoot":"","sources":["../src/subagent-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,cAAc,EAEnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,KAAK,0BAA0B,EAG/B,KAAK,kBAAkB,EAEvB,KAAK,eAAe,EAQrB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAML,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,0BAA0B,EAE1B,iBAAiB,EAElB,MAAM,oBAAoB,CA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F9F;;;;OAIG;YACW,UAAU;IAuBxB;;;OAGG;YACW,eAAe;IAiB7B;;;OAGG;YACW,gBAAgB;IAS9B,qFAAqF;YACvE,cAAc;IAoB5B;;;;;OAKG;YACW,YAAY;IAwF1B,OAAO,CAAC,QAAQ;IAOhB,2EAA2E;IAC3E,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,YAAY;CAuBrB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CA0C3E"}
|
package/dist/tools/bash.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CommandResult } from "@sixb/core";
|
|
2
2
|
import type { ModelTool } from "@sixb/core/models";
|
|
3
3
|
import type { BackgroundCommands } from "../background-commands";
|
|
4
4
|
import type { AgentSandboxHandle } from "../sandbox-handle";
|
package/dist/tools/bash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,KAAK,EAAyB,SAAS,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,KAAK,EAA0B,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAGxF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAO3D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BjB,CAAA;AAEV,UAAU,aAAa;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;CACrC;AAED,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAA;IACjC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAA;CAClC;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,cAAc,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,EACjD,UAAU,EAAE,kBAAkB,GAC7B,SAAS,CAAC,aAAa,CAAC,CAkC1B;AAsED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,cAAc,CAEvE;AAiBD,UAAU,cAAc;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAC5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,CAe7E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixb/agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "The Sixb agent harness: one loop, prompt and tools for every runner",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixb",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"prepack": "bun run build"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@sixb/core": "0.2.
|
|
40
|
+
"@sixb/core": "0.2.6"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@sixb/core": "0.2.
|
|
43
|
+
"@sixb/core": "0.2.6",
|
|
44
44
|
"@sixb/sandboxes-local": "0.2.0",
|
|
45
|
-
"@sixb/vercel-ai-gateway": "0.2.
|
|
45
|
+
"@sixb/vercel-ai-gateway": "0.2.6",
|
|
46
46
|
"@types/bun": "latest",
|
|
47
47
|
"@types/hast": "^3.0.5",
|
|
48
48
|
"@types/mdast": "^4.0.4",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"LICENSE"
|
|
64
64
|
],
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@sixb/cli-core": "^0.2.
|
|
66
|
+
"@sixb/cli-core": "^0.2.4",
|
|
67
67
|
"hast-util-from-parse5": "^8.0.4",
|
|
68
68
|
"hast-util-to-mdast": "^10.1.2",
|
|
69
69
|
"mdast-util-gfm": "^3.1.0",
|
package/src/agent-prompt.ts
CHANGED
|
@@ -3,10 +3,10 @@ import { renderInstanceHelp } from "@sixb/cli-core"
|
|
|
3
3
|
import type { AgentSkillDefinition, AgentSystemPromptPartName } from "@sixb/core"
|
|
4
4
|
import type { AgentSystemPromptSize, SandboxModel } from "@sixb/core/internal/agents"
|
|
5
5
|
import type { OntologyDocsIndexEntry } from "@sixb/core/internal/ontology"
|
|
6
|
-
import type { ModelMessage } from "@sixb/core/models"
|
|
6
|
+
import type { LanguageModel, ModelMessage } from "@sixb/core/models"
|
|
7
7
|
import type { SubagentRunFile } from "@sixb/core/storage"
|
|
8
8
|
import { CHILD_FILES_DIRECTORY, formatBytes, SANDBOX_ATTACHMENT_LIMITS } from "./attachments"
|
|
9
|
-
import { renderModelLine } from "./model-lines"
|
|
9
|
+
import { oneLine, renderModelLine } from "./model-lines"
|
|
10
10
|
import type { AgentRequester } from "./requester"
|
|
11
11
|
|
|
12
12
|
export type AgentExecutionMode = "conversation" | "subagent" | "workflow-task"
|
|
@@ -98,8 +98,6 @@ export interface RenderAgentSystemPromptInput {
|
|
|
98
98
|
/** Ontology reference files to list; omitted, the prompt does not mention them. */
|
|
99
99
|
readonly ontologyIndex?: readonly OntologyDocsIndexEntry[]
|
|
100
100
|
readonly sandboxResetAt?: string
|
|
101
|
-
/** When the conversation's turns moved to this workspace, from a computer or another folder. */
|
|
102
|
-
readonly workspaceMovedAt?: string
|
|
103
101
|
readonly workspace?: AgentWorkspacePromptContext
|
|
104
102
|
readonly facts?: AgentRuntimeFacts
|
|
105
103
|
/**
|
|
@@ -109,9 +107,14 @@ export interface RenderAgentSystemPromptInput {
|
|
|
109
107
|
readonly conversation?: string
|
|
110
108
|
/** Models the sandbox CLI can call; omitted, the prompt does not mention them. */
|
|
111
109
|
readonly sandboxModels?: readonly SandboxModel[]
|
|
110
|
+
/** The model the run calls, which the prompt names; omitted, it names none. */
|
|
111
|
+
readonly runningModel?: RunningModel
|
|
112
112
|
readonly memory?: AgentMemoryPromptContext
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
/** What the prompt reads of the run's model: its identity, and its name when it has one. */
|
|
116
|
+
type RunningModel = Pick<LanguageModel, "providerId" | "modelId" | "definition">
|
|
117
|
+
|
|
115
118
|
/** The Agent's memory as the prompt shows it. */
|
|
116
119
|
export interface AgentMemoryPromptContext {
|
|
117
120
|
/** Others read the conversation: the project's memory alone is loaded, whoever sends the turn. */
|
|
@@ -214,7 +217,8 @@ function renderAgentSystemPromptSections(
|
|
|
214
217
|
input.contextDirectory,
|
|
215
218
|
input.skills,
|
|
216
219
|
input.ontologyIndex,
|
|
217
|
-
input.sandboxModels
|
|
220
|
+
input.sandboxModels,
|
|
221
|
+
input.runningModel
|
|
218
222
|
)
|
|
219
223
|
const memory = input.memory && renderMemory(input.memory, input.mode, input.contextDirectory)
|
|
220
224
|
const system = (text: string | undefined): PromptSection[] =>
|
|
@@ -233,14 +237,7 @@ function renderAgentSystemPromptSections(
|
|
|
233
237
|
]),
|
|
234
238
|
promptSectionParts(
|
|
235
239
|
"sandbox_state",
|
|
236
|
-
system(
|
|
237
|
-
[
|
|
238
|
-
input.workspaceMovedAt && renderWorkspaceMove(input.workspaceMovedAt),
|
|
239
|
-
input.sandboxResetAt && renderSandboxReset(input.sandboxResetAt, input.mode),
|
|
240
|
-
]
|
|
241
|
-
.filter(Boolean)
|
|
242
|
-
.join("\n\n")
|
|
243
|
-
)
|
|
240
|
+
system(input.sandboxResetAt && renderSandboxReset(input.sandboxResetAt, input.mode))
|
|
244
241
|
),
|
|
245
242
|
promptSectionParts(
|
|
246
243
|
"agent_instructions",
|
|
@@ -308,9 +305,18 @@ function promptSectionParts(
|
|
|
308
305
|
return [{ part: tagPart, text: `<${tag}>\n` }, ...body, { part: tagPart, text: `\n</${tag}>` }]
|
|
309
306
|
}
|
|
310
307
|
|
|
311
|
-
/**
|
|
312
|
-
|
|
313
|
-
|
|
308
|
+
/**
|
|
309
|
+
* Marks a user message sent after the conversation moved to another workspace (between the cloud
|
|
310
|
+
* and a computer, or between folders). It closes the message rather than the system prompt, so a
|
|
311
|
+
* thread that returns to a workspace keeps that workspace's prompt, and the cached prefix that
|
|
312
|
+
* follows it, byte for byte.
|
|
313
|
+
*/
|
|
314
|
+
export function renderWorkspaceMovedTag(): string {
|
|
315
|
+
return [
|
|
316
|
+
"<sixb_workspace_moved>",
|
|
317
|
+
"This conversation moved to a different workspace before this message. Files, paths and local processes from before this message stayed in the workspace it moved from and are not here; conversation history, artifacts and attachments remain available. Inspect the current workspace before relying on earlier filesystem results, and when reporting a missing file from before this move, note that it stayed in the previous workspace.",
|
|
318
|
+
"</sixb_workspace_moved>",
|
|
319
|
+
].join("\n")
|
|
314
320
|
}
|
|
315
321
|
|
|
316
322
|
/** What a run is told once its thread's workspace was lost and created again. */
|
|
@@ -340,7 +346,8 @@ function renderRuntimeContext(
|
|
|
340
346
|
contextDirectory: string,
|
|
341
347
|
skills: readonly AgentSkillDefinition[],
|
|
342
348
|
ontologyIndex: readonly OntologyDocsIndexEntry[] = [],
|
|
343
|
-
sandboxModels: readonly SandboxModel[] = []
|
|
349
|
+
sandboxModels: readonly SandboxModel[] = [],
|
|
350
|
+
runningModel?: RunningModel
|
|
344
351
|
): { readonly base: string[]; readonly skills: string[]; readonly ontology: string[] } {
|
|
345
352
|
const skillCatalog =
|
|
346
353
|
skills.length === 0
|
|
@@ -398,7 +405,7 @@ function renderRuntimeContext(
|
|
|
398
405
|
'When an Action id is provided, inspect it directly with `sixb actions get <action-id>`; its `inputSchema` is the exact JSON shape accepted by the Action. An object-reference parameter is an object such as `{"objectTypeId":"Type","primaryId":"opaque:id"}`, never a bare id.',
|
|
399
406
|
"Send Action params as one JSON object through standard input with `sixb actions request <action-id> --file -`; it runs the Action and prints the finished run, with its status and any error. Never inspect the environment to infer identifiers.",
|
|
400
407
|
"Do not use ontology or Action listings, broad object inspection, or environment inspection when exact references and commands are already known. Use `--run-id` only for a request-specific idempotency key.",
|
|
401
|
-
...renderModelCommands(sandboxModels),
|
|
408
|
+
...renderModelCommands(sandboxModels, runningModel),
|
|
402
409
|
...fileContext,
|
|
403
410
|
"With read, use relative paths from this prompt or sandboxPath values.",
|
|
404
411
|
"Find files with glob and text with grep before you read them. Read a file before you change it, and change files with edit and write rather than shell commands; a memory save stays one bash command that edits and saves.",
|
|
@@ -416,15 +423,24 @@ const MODEL_COMMANDS: Readonly<Record<(typeof MEDIA_MODEL_KINDS)[number], string
|
|
|
416
423
|
}
|
|
417
424
|
|
|
418
425
|
/**
|
|
419
|
-
* The commands that call the project's models, each followed by its
|
|
420
|
-
* so the agent picks one without listing them. Each call is billed.
|
|
426
|
+
* The model the run is on, then the commands that call the project's models, each followed by its
|
|
427
|
+
* models with what each is for, so the agent picks one without listing them. Each call is billed.
|
|
428
|
+
* The first line stays when there are no commands: a project's only model still names itself.
|
|
421
429
|
*/
|
|
422
|
-
function renderModelCommands(
|
|
423
|
-
|
|
430
|
+
function renderModelCommands(
|
|
431
|
+
models: readonly SandboxModel[],
|
|
432
|
+
runningModel?: RunningModel
|
|
433
|
+
): string[] {
|
|
434
|
+
const language = renderLanguageModelCommand(
|
|
435
|
+
models.filter((model) => model.kind === "language"),
|
|
436
|
+
runningModel
|
|
437
|
+
)
|
|
424
438
|
const media = renderMediaModelCommands(models.filter((model) => model.kind !== "language"))
|
|
425
|
-
|
|
439
|
+
const running = runningModel ? [`You are running on ${formatRunningModel(runningModel)}.`] : []
|
|
440
|
+
if (language.length === 0 && media.length === 0) return running
|
|
426
441
|
|
|
427
442
|
return [
|
|
443
|
+
...running,
|
|
428
444
|
"The project's models are yours to call through `sixb models`.",
|
|
429
445
|
...language,
|
|
430
446
|
...media,
|
|
@@ -432,23 +448,41 @@ function renderModelCommands(models: readonly SandboxModel[]): string[] {
|
|
|
432
448
|
]
|
|
433
449
|
}
|
|
434
450
|
|
|
451
|
+
/** The run's model as the prompt names it, such as `DeepSeek V4.1 Flash (azure/deepseek-v4.1)`. */
|
|
452
|
+
function formatRunningModel(model: RunningModel): string {
|
|
453
|
+
const reference = `${model.providerId}/${model.modelId}`
|
|
454
|
+
const { name } = model.definition
|
|
455
|
+
|
|
456
|
+
return name ? `${oneLine(name)} (${reference})` : reference
|
|
457
|
+
}
|
|
458
|
+
|
|
435
459
|
/**
|
|
436
460
|
* Another model's answer, without a child agent: one generation from the prompt alone. Listed only
|
|
437
|
-
* when the project has several language models, since otherwise there is no other to ask.
|
|
461
|
+
* when the project has several language models, since otherwise there is no other to ask. The
|
|
462
|
+
* run's own model is marked `(you)`, so the agent tells itself apart from the others.
|
|
438
463
|
*/
|
|
439
|
-
function renderLanguageModelCommand(
|
|
464
|
+
function renderLanguageModelCommand(
|
|
465
|
+
models: readonly SandboxModel[],
|
|
466
|
+
runningModel?: RunningModel
|
|
467
|
+
): string[] {
|
|
440
468
|
if (models.length < 2) return []
|
|
441
469
|
|
|
442
470
|
const tiers = [...new Set(models.flatMap((model) => (model.tier ? [model.tier] : [])))]
|
|
443
471
|
const reference = tiers.length > 0 ? "<tier or model>" : "<model>"
|
|
444
|
-
const lines = models.map((model) =>
|
|
445
|
-
|
|
472
|
+
const lines = models.map((model) => {
|
|
473
|
+
const isRunning =
|
|
474
|
+
runningModel !== undefined &&
|
|
475
|
+
model.provider === runningModel.providerId &&
|
|
476
|
+
model.modelId === runningModel.modelId
|
|
477
|
+
|
|
478
|
+
return renderModelLine({
|
|
446
479
|
...(model.tier === undefined ? {} : { tier: model.tier }),
|
|
447
480
|
reference: cliModelReference(model, models),
|
|
448
481
|
...(model.name === undefined ? {} : { name: model.name }),
|
|
482
|
+
...(isRunning ? { details: "(you)" } : {}),
|
|
449
483
|
...(model.description === undefined ? {} : { description: model.description }),
|
|
450
484
|
})
|
|
451
|
-
)
|
|
485
|
+
})
|
|
452
486
|
|
|
453
487
|
return [
|
|
454
488
|
`Ask another model for a second opinion or a quick generation: \`sixb models text "<prompt>" --model ${reference}\`, or \`--file -\` to send a long prompt on standard input. It answers once from the prompt alone, without the project's data or tools, so put everything it needs in the prompt.`,
|
|
@@ -2,7 +2,7 @@ import { randomBytes } from "node:crypto"
|
|
|
2
2
|
import { posix } from "node:path"
|
|
3
3
|
import { AgentToolPublicError, type CommandResult, type Sandbox } from "@sixb/core"
|
|
4
4
|
import { waitForAbort } from "./abort"
|
|
5
|
-
import {
|
|
5
|
+
import { commandDirectory, LOGIN_SHELL_SCRIPT_IN_DIRECTORY } from "./login-shell"
|
|
6
6
|
import { type AgentSandboxHandle, contextPath } from "./sandbox-handle"
|
|
7
7
|
|
|
8
8
|
// A background command runs in the call that starts it, held open until it ends: a provider that
|
|
@@ -116,8 +116,8 @@ export class BackgroundCommands {
|
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
118
|
* Start `command` in the background and return once it runs, its output going to its file. One
|
|
119
|
-
* the sandbox could not start
|
|
120
|
-
* `signal` that aborts before then stops it.
|
|
119
|
+
* the sandbox could not start throws what it said; a directory that does not exist is not one,
|
|
120
|
+
* as the command's shell changes to it. A `signal` that aborts before then stops it.
|
|
121
121
|
*/
|
|
122
122
|
async start(input: {
|
|
123
123
|
readonly handle: AgentSandboxHandle
|
|
@@ -155,10 +155,10 @@ export class BackgroundCommands {
|
|
|
155
155
|
paths.pid,
|
|
156
156
|
paths.exit,
|
|
157
157
|
nonce,
|
|
158
|
+
commandDirectory(sandbox.workingDirectory, input.cwd) ?? sandbox.workingDirectory,
|
|
158
159
|
input.command,
|
|
159
160
|
],
|
|
160
161
|
{
|
|
161
|
-
...(input.cwd === undefined ? {} : { cwd: input.cwd }),
|
|
162
162
|
...(handle.env === undefined ? {} : { env: handle.env }),
|
|
163
163
|
timeout: HELD_TIMEOUT_MS,
|
|
164
164
|
signal: abort.signal,
|
|
@@ -483,12 +483,14 @@ const SIGNAL_SCRIPT = 'kill -s "$1" -- "-$2" 2>/dev/null'
|
|
|
483
483
|
/**
|
|
484
484
|
* Started detached from the held call's own output, in a process group of its own (`set -m`: no
|
|
485
485
|
* `setsid` binary on macOS), its pid written first with the start's nonce, then its exit code once
|
|
486
|
-
* it ended. Its exit is the wrapper's.
|
|
486
|
+
* it ended. Its exit is the wrapper's. Its shell changes to the directory itself: one that does not
|
|
487
|
+
* exist ends it with code 1 and bash's message in its output. Arguments: output, pid and exit
|
|
488
|
+
* files, nonce, directory, command.
|
|
487
489
|
*/
|
|
488
490
|
const START_SCRIPT = `mkdir -p -- "$(dirname -- "$1")" || exit 1
|
|
489
491
|
: > "$1" && rm -f -- "$3" || exit 1
|
|
490
492
|
set -m
|
|
491
|
-
bash -lc '${
|
|
493
|
+
bash -lc '${LOGIN_SHELL_SCRIPT_IN_DIRECTORY}' bash "$5" "$6" < /dev/null >> "$1" 2>&1 &
|
|
492
494
|
pid=$!
|
|
493
495
|
set +m
|
|
494
496
|
echo "$4 $pid" > "$2.tmp" && mv -f -- "$2.tmp" "$2"
|
|
@@ -374,6 +374,7 @@ function conversationEstimateShape(
|
|
|
374
374
|
...(authors?.section === undefined ? {} : { conversation: authors.section }),
|
|
375
375
|
...(plan.sandboxModels ? { sandboxModels: plan.sandboxModels } : {}),
|
|
376
376
|
...(memory ? { memory: memory.prompt } : {}),
|
|
377
|
+
runningModel: plan.model,
|
|
377
378
|
}),
|
|
378
379
|
authors ? conversationAuthorsText(authors) : "",
|
|
379
380
|
].join("\n"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toModelMessages } from "@sixb/core/internal/agents"
|
|
2
2
|
import type { ModelCachingIntent, ModelMessage, ModelReasoning } from "@sixb/core/models"
|
|
3
|
-
import type
|
|
3
|
+
import { renderWorkspaceMovedTag, type SentSettings } from "./agent-prompt"
|
|
4
4
|
import {
|
|
5
5
|
attachmentKey,
|
|
6
6
|
type PreparedAgentAttachmentContext,
|
|
@@ -28,6 +28,9 @@ export function conversationModelMessages(input: {
|
|
|
28
28
|
}): ModelMessage[] {
|
|
29
29
|
const { threadContext, attachmentContext } = input
|
|
30
30
|
const sentTimes = userMessageTimes(threadContext.history, input.project)
|
|
31
|
+
const movedIds = threadContext.history.movedMessageIds
|
|
32
|
+
? new Set(threadContext.history.movedMessageIds)
|
|
33
|
+
: undefined
|
|
31
34
|
const authors = input.conversation
|
|
32
35
|
? conversationAuthors({
|
|
33
36
|
conversation: input.conversation,
|
|
@@ -36,12 +39,16 @@ export function conversationModelMessages(input: {
|
|
|
36
39
|
: undefined
|
|
37
40
|
|
|
38
41
|
return toModelMessages(threadContext.modelMessages, {
|
|
39
|
-
//
|
|
40
|
-
//
|
|
42
|
+
// Workspace transition, then when, then who wrote it: `<sixb_author>` stays the message's last
|
|
43
|
+
// tag, and every piece comes from stored data so cached prefixes stay byte-exact across moves.
|
|
41
44
|
userMessageSuffix: (message) => {
|
|
42
45
|
if (!message.id) return undefined
|
|
43
46
|
|
|
44
|
-
const closing = [
|
|
47
|
+
const closing = [
|
|
48
|
+
movedIds?.has(message.id) ? renderWorkspaceMovedTag() : undefined,
|
|
49
|
+
sentTimes.get(message.id),
|
|
50
|
+
authors?.byMessageId.get(message.id),
|
|
51
|
+
]
|
|
45
52
|
return closing.filter(Boolean).join("\n") || undefined
|
|
46
53
|
},
|
|
47
54
|
fileText: ({ message, partIndex }) =>
|
package/src/login-shell.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { posix } from "node:path"
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Runs a script in a bash that is not a login shell, once a login shell has loaded the profile:
|
|
3
5
|
* the profile's exports reach the script, and its `exit` leaves the login shell alone.
|
|
@@ -12,7 +14,32 @@
|
|
|
12
14
|
*/
|
|
13
15
|
export const LOGIN_SHELL_SCRIPT = 'exec "$BASH" -c "$1" bash'
|
|
14
16
|
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* {@link LOGIN_SHELL_SCRIPT}, in a directory the shell changes to itself. A directory that does not
|
|
19
|
+
* exist fails the command with bash's own message, which the model can read and correct. Given
|
|
20
|
+
* to the sandbox instead, it would refuse to start the command, and a refused command leaves the
|
|
21
|
+
* workspace unconfirmed. Falling off the end, unlike `exit`, does not run `~/.bash_logout`.
|
|
22
|
+
*
|
|
23
|
+
* Arguments: the directory, then the script.
|
|
24
|
+
*/
|
|
25
|
+
export const LOGIN_SHELL_SCRIPT_IN_DIRECTORY = 'cd -- "$1" && exec "$BASH" -c "$2" bash'
|
|
26
|
+
|
|
27
|
+
/** `bash` arguments that run `script` as {@link LOGIN_SHELL_SCRIPT} does, in `directory` if given. */
|
|
28
|
+
export function loginShellArgs(script: string, directory?: string): string[] {
|
|
29
|
+
return directory === undefined
|
|
30
|
+
? ["-lc", LOGIN_SHELL_SCRIPT, "bash", script]
|
|
31
|
+
: ["-lc", LOGIN_SHELL_SCRIPT_IN_DIRECTORY, "bash", directory, script]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The absolute directory a command's `cwd` names, for the shell to change to. A relative one
|
|
36
|
+
* resolves against the sandbox's working directory, as the bash tool describes it: in a workspace
|
|
37
|
+
* cloned from Git, that is the checkout, not the provider's own directory above it. A model's
|
|
38
|
+
* `cwd` never reaches the provider: see {@link LOGIN_SHELL_SCRIPT_IN_DIRECTORY}.
|
|
39
|
+
*/
|
|
40
|
+
export function commandDirectory(
|
|
41
|
+
workingDirectory: string,
|
|
42
|
+
cwd: string | undefined
|
|
43
|
+
): string | undefined {
|
|
44
|
+
return cwd === undefined ? undefined : posix.resolve(workingDirectory, cwd)
|
|
18
45
|
}
|