@sixb/agent 0.2.1 → 0.2.3
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/README.md +2 -1
- package/dist/agent-prompt.d.ts +13 -0
- package/dist/agent-prompt.d.ts.map +1 -1
- package/dist/agent-runtime/preflight.d.ts.map +1 -1
- package/dist/artifacts/board-previews.d.ts +41 -0
- package/dist/artifacts/board-previews.d.ts.map +1 -0
- package/dist/artifacts/layout-check/layout-check.d.ts +38 -6
- package/dist/artifacts/layout-check/layout-check.d.ts.map +1 -1
- package/dist/artifacts/layout-check/overview.d.ts +17 -0
- package/dist/artifacts/layout-check/overview.d.ts.map +1 -0
- package/dist/artifacts/materialize.d.ts +56 -24
- package/dist/artifacts/materialize.d.ts.map +1 -1
- package/dist/artifacts/publish-tool.d.ts +35 -9
- package/dist/artifacts/publish-tool.d.ts.map +1 -1
- package/dist/background-commands.d.ts +95 -0
- package/dist/background-commands.d.ts.map +1 -0
- package/dist/background-notices.d.ts +31 -0
- package/dist/background-notices.d.ts.map +1 -0
- package/dist/computer-runner.d.ts +63 -2
- package/dist/computer-runner.d.ts.map +1 -1
- package/dist/context-compaction.d.ts +3 -0
- package/dist/context-compaction.d.ts.map +1 -1
- package/dist/execution-plan.d.ts +12 -2
- package/dist/execution-plan.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11814 -8722
- package/dist/index.js.map +35 -23
- package/dist/login-shell.d.ts +16 -0
- package/dist/login-shell.d.ts.map +1 -0
- package/dist/run-child.d.ts +3 -0
- package/dist/run-child.d.ts.map +1 -1
- package/dist/run-conversation-turn.d.ts +6 -2
- package/dist/run-conversation-turn.d.ts.map +1 -1
- package/dist/run-environment.d.ts +12 -2
- package/dist/run-environment.d.ts.map +1 -1
- package/dist/run-sandbox.d.ts +23 -0
- package/dist/run-sandbox.d.ts.map +1 -1
- package/dist/sandbox-files.d.ts +19 -0
- package/dist/sandbox-files.d.ts.map +1 -1
- package/dist/subagent-tools.d.ts +3 -1
- package/dist/subagent-tools.d.ts.map +1 -1
- package/dist/tools/background.d.ts +50 -0
- package/dist/tools/background.d.ts.map +1 -0
- package/dist/tools/bash.d.ts +12 -4
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/model-spec.d.ts +9 -2
- package/dist/tools/model-spec.d.ts.map +1 -1
- package/dist/tools/tool-files.d.ts.map +1 -1
- package/dist/tools/tool-outputs.d.ts +12 -2
- package/dist/tools/tool-outputs.d.ts.map +1 -1
- package/dist/tools/web-fetch/cache.d.ts +33 -0
- package/dist/tools/web-fetch/cache.d.ts.map +1 -0
- package/dist/tools/web-fetch/html-markdown.d.ts +25 -0
- package/dist/tools/web-fetch/html-markdown.d.ts.map +1 -0
- package/dist/tools/web-fetch/network.d.ts +55 -0
- package/dist/tools/web-fetch/network.d.ts.map +1 -0
- package/dist/tools/web-fetch/tool.d.ts +96 -0
- package/dist/tools/web-fetch/tool.d.ts.map +1 -0
- package/dist/tools/web-search.d.ts +40 -0
- package/dist/tools/web-search.d.ts.map +1 -0
- package/dist/types.d.ts +5 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/workspace-instructions.d.ts +15 -0
- package/dist/workspace-instructions.d.ts.map +1 -0
- package/package.json +15 -5
- package/src/agent-prompt.ts +64 -5
- package/src/agent-runtime/preflight.ts +2 -1
- package/src/artifacts/board-previews.ts +218 -0
- package/src/artifacts/layout-check/check.cjs +304 -80
- package/src/artifacts/layout-check/layout-check.ts +123 -13
- package/src/artifacts/layout-check/overview.ts +291 -0
- package/src/artifacts/materialize.ts +181 -55
- package/src/artifacts/publish-tool.ts +459 -129
- package/src/background-commands.ts +573 -0
- package/src/background-notices.ts +178 -0
- package/src/computer-runner.ts +211 -9
- package/src/context-compaction.ts +4 -1
- package/src/execution-plan.ts +15 -2
- package/src/index.ts +4 -0
- package/src/login-shell.ts +18 -0
- package/src/run-child.ts +5 -0
- package/src/run-conversation-turn.ts +23 -4
- package/src/run-environment.ts +96 -17
- package/src/run-sandbox.ts +41 -0
- package/src/sandbox-api-context.ts +1 -1
- package/src/sandbox-files.ts +88 -1
- package/src/skills/sixb-artifacts/SKILL.md +48 -25
- package/src/skills/sixb-artifacts/canvas.md +140 -18
- package/src/skills/sixb-artifacts/examples/canvas/onboarding-flow/canvas.json +1 -1
- package/src/skills/sixb-artifacts/page.md +1 -1
- package/src/skills/sixb-artifacts/references.md +15 -12
- package/src/skills/sixb-artifacts/sheet.md +1 -1
- package/src/skills/sixb-artifacts/slides.md +1 -1
- package/src/subagent-tools.ts +19 -7
- package/src/tools/background.ts +127 -0
- package/src/tools/bash.ts +80 -11
- package/src/tools/model-spec.ts +28 -5
- package/src/tools/tool-files.ts +3 -1
- package/src/tools/tool-outputs.ts +46 -6
- package/src/tools/web-fetch/cache.ts +91 -0
- package/src/tools/web-fetch/html-markdown.ts +479 -0
- package/src/tools/web-fetch/network.ts +452 -0
- package/src/tools/web-fetch/tool.ts +619 -0
- package/src/tools/web-search.ts +139 -0
- package/src/types.ts +5 -4
- package/src/workspace-instructions.ts +163 -0
package/README.md
CHANGED
|
@@ -7,7 +7,8 @@ both to the harness.
|
|
|
7
7
|
```text
|
|
8
8
|
runner (the cloud worker today) harness (@sixb/agent)
|
|
9
9
|
claims the run → AgentRunSession builds the prompt and tools, runs the loop, finishes
|
|
10
|
-
opens its environment → openSandbox bash ·
|
|
10
|
+
opens its environment → openSandbox bash · bash_output · bash_stop · read · view_file ·
|
|
11
|
+
publish_artifact · children
|
|
11
12
|
```
|
|
12
13
|
|
|
13
14
|
```text
|
package/dist/agent-prompt.d.ts
CHANGED
|
@@ -70,6 +70,19 @@ export interface AgentWorkspacePromptContext {
|
|
|
70
70
|
readonly url: string;
|
|
71
71
|
readonly authenticatedAccess?: "read" | "write";
|
|
72
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* The instruction files the workspace carries, its repository's root first, as read when it was
|
|
75
|
+
* acquired (see `readWorkspaceInstructions`).
|
|
76
|
+
*/
|
|
77
|
+
readonly instructions?: readonly WorkspaceInstructionsFile[];
|
|
78
|
+
}
|
|
79
|
+
/** A workspace's `AGENTS.md`, or `CLAUDE.md` where a folder has no `AGENTS.md`. */
|
|
80
|
+
export interface WorkspaceInstructionsFile {
|
|
81
|
+
/** From the working directory: `AGENTS.md`, or `../AGENTS.md` for its parent folder's. */
|
|
82
|
+
readonly path: string;
|
|
83
|
+
readonly text: string;
|
|
84
|
+
/** Cut at the size limit: the line the rest of the file starts at. */
|
|
85
|
+
readonly continuesAtLine?: number;
|
|
73
86
|
}
|
|
74
87
|
export interface RenderWorkflowOutputFinalizerPromptInput {
|
|
75
88
|
readonly instructions?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-prompt.d.ts","sourceRoot":"","sources":["../src/agent-prompt.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAA6B,MAAM,YAAY,CAAA;AACjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACrF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,UAAU,GAAG,eAAe,CAAA;AA6E9E,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;IACjC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAChD,mFAAmF;IACnF,Q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BD,kFAAkF;AAClF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,EAChD,SAAS,EAAE,IAAI,EACf,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAGzC;AAED,iGAAiG;AACjG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,CAY3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/preflight.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAiB,OAAO,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/preflight.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAiB,OAAO,EAAE,MAAM,YAAY,CAAA;AA8BxD,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAC9C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,0GAA0G;IAC1G,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACjD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;CACvC;AAED;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,IAAI,CAAC,CAsBf"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { BlobStorage, Sandbox } from "@sixb/core";
|
|
2
|
+
import type { AgentRunMissingPreview } from "@sixb/core/internal/agents";
|
|
3
|
+
import { type BoardPreviewInput, type MissingBoardPreview, type RefusedBoardPreview } from "@sixb/core/internal/artifacts/publish";
|
|
4
|
+
import type { ArtifactVersionRecord } from "@sixb/core/storage";
|
|
5
|
+
import type { AgentSandboxHandle } from "../sandbox-handle";
|
|
6
|
+
import { type CheckedPreview, type CheckedQuery } from "./layout-check/layout-check";
|
|
7
|
+
/** The pictures read and stored, and those that were not, with why. */
|
|
8
|
+
export interface CheckedPreviews {
|
|
9
|
+
readonly previews: readonly BoardPreviewInput[];
|
|
10
|
+
readonly dropped: readonly RefusedBoardPreview[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The pictures the check took that `missing` asks for, read out of the sandbox a batch at a time
|
|
14
|
+
* and each stored in `blobStorage`. A picture the check did not take is left out: the worker
|
|
15
|
+
* renders it later. Each stands alone: one too large or that cannot be read or stored is dropped,
|
|
16
|
+
* and returned with why, and the others are kept.
|
|
17
|
+
*/
|
|
18
|
+
export declare function storeCheckedPreviews(input: {
|
|
19
|
+
readonly handle: AgentSandboxHandle;
|
|
20
|
+
readonly checked: readonly CheckedPreview[];
|
|
21
|
+
readonly missing: readonly AgentRunMissingPreview[];
|
|
22
|
+
readonly blobStorage: Pick<BlobStorage, "put">;
|
|
23
|
+
readonly signal: AbortSignal;
|
|
24
|
+
}): Promise<CheckedPreviews>;
|
|
25
|
+
/**
|
|
26
|
+
* Renders the pictures a stored canvas version's boards miss, in `sandbox`, a blank one created
|
|
27
|
+
* for it: the version's files are written there, each missing board is opened in every mode it
|
|
28
|
+
* misses, and the pictures are stored in `blobStorage`. What the boards' queries return, `queries`
|
|
29
|
+
* holds as the version's publisher read them. Without them a board that reads a query is not
|
|
30
|
+
* pictured: it would show its queries rejecting, which no reader sees. A sandbox without the
|
|
31
|
+
* agent image's browser renders nothing.
|
|
32
|
+
*/
|
|
33
|
+
export declare function renderBoardPreviews(input: {
|
|
34
|
+
readonly sandbox: Sandbox;
|
|
35
|
+
readonly version: ArtifactVersionRecord;
|
|
36
|
+
readonly missing: readonly MissingBoardPreview[];
|
|
37
|
+
readonly blobStorage: Pick<BlobStorage, "put" | "open" | "stat">;
|
|
38
|
+
readonly queries?: Readonly<Record<string, CheckedQuery>>;
|
|
39
|
+
readonly signal: AbortSignal;
|
|
40
|
+
}): Promise<CheckedPreviews>;
|
|
41
|
+
//# sourceMappingURL=board-previews.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"board-previews.d.ts","sourceRoot":"","sources":["../../src/artifacts/board-previews.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACxE,OAAO,EAGL,KAAK,iBAAiB,EAEtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAG/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAe,MAAM,6BAA6B,CAAA;AAiBjG,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAA;IAC/C,QAAQ,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAA;CACjD;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE;IAChD,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;IACnC,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAA;IAC3C,QAAQ,CAAC,OAAO,EAAE,SAAS,sBAAsB,EAAE,CAAA;IACnD,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;IAC9C,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAC7B,GAAG,OAAO,CAAC,eAAe,CAAC,CAwD3B;AAqBD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE;IAC/C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAA;IACvC,QAAQ,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAA;IAChD,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC,CAAA;IAChE,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAA;IACzD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAC7B,GAAG,OAAO,CAAC,eAAe,CAAC,CAmD3B"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { ArtifactTheme } from "@sixb/core/artifacts";
|
|
1
|
+
import type { ArtifactTheme, ArtifactThemeMode, Canvas } from "@sixb/core/artifacts";
|
|
2
2
|
import { type FrameLayout, type LayoutProblem } from "@sixb/core/internal/artifacts/frames";
|
|
3
|
+
import { type ArtifactQueryAnswer } from "@sixb/core/internal/artifacts/publish";
|
|
4
|
+
import type { ArtifactBoardPreviewSize } from "@sixb/core/storage";
|
|
3
5
|
import { type AgentSandboxHandle } from "../../sandbox-handle";
|
|
4
6
|
/** What the layout check found, for the publish tool to report beside the version. */
|
|
5
7
|
export type LayoutCheck = {
|
|
@@ -7,6 +9,10 @@ export type LayoutCheck = {
|
|
|
7
9
|
readonly warnings: readonly LayoutWarning[];
|
|
8
10
|
/** One per slide, or a page's at each width, as the agent names them. */
|
|
9
11
|
readonly screenshots: readonly string[];
|
|
12
|
+
/** Each `pictured` board in each mode the reader sees it in, at its path in the sandbox. */
|
|
13
|
+
readonly previews: readonly CheckedPreview[];
|
|
14
|
+
/** A canvas as it opens in the app, as the agent names it, when the check took it. */
|
|
15
|
+
readonly overview?: string;
|
|
10
16
|
} | {
|
|
11
17
|
readonly status: "skipped";
|
|
12
18
|
readonly reason: string;
|
|
@@ -27,16 +33,25 @@ export interface CheckedBoard {
|
|
|
27
33
|
readonly w: number;
|
|
28
34
|
readonly h: number;
|
|
29
35
|
readonly html: Uint8Array;
|
|
36
|
+
/** Screenshot in every mode, not only the first: it needs its pictures for readers. */
|
|
37
|
+
readonly pictured?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** A board's picture in one mode and size, which the check took. */
|
|
40
|
+
export interface CheckedPreview {
|
|
41
|
+
readonly board: string;
|
|
42
|
+
readonly theme: ArtifactThemeMode;
|
|
43
|
+
/** `full`, a PNG of the board; `small`, a WebP at most 480 pixels wide. */
|
|
44
|
+
readonly size: ArtifactBoardPreviewSize;
|
|
45
|
+
/** Absolute, in the sandbox. */
|
|
46
|
+
readonly path: string;
|
|
47
|
+
/** How large the check wrote it. */
|
|
48
|
+
readonly bytes?: number;
|
|
30
49
|
}
|
|
31
50
|
/**
|
|
32
51
|
* What a page's `sixb.query(name)` reads in the check: the query route's JSON as it answers the
|
|
33
52
|
* requester, or why the query failed for them.
|
|
34
53
|
*/
|
|
35
|
-
export type CheckedQuery =
|
|
36
|
-
readonly result: unknown;
|
|
37
|
-
} | {
|
|
38
|
-
readonly error: string;
|
|
39
|
-
};
|
|
54
|
+
export type CheckedQuery = ArtifactQueryAnswer;
|
|
40
55
|
/** A width a page is checked at, as a laptop and a phone show it. */
|
|
41
56
|
export type PageView = "desktop" | "phone";
|
|
42
57
|
/**
|
|
@@ -67,7 +82,24 @@ export declare function checkLayout(input: {
|
|
|
67
82
|
} | {
|
|
68
83
|
readonly layout: "canvas";
|
|
69
84
|
readonly boards: readonly CheckedBoard[];
|
|
85
|
+
/** The canvas's items, for a picture of it as it opens; none without. */
|
|
86
|
+
readonly canvas?: Canvas;
|
|
70
87
|
})): Promise<LayoutCheck>;
|
|
88
|
+
/** A board whose page draws larger than the board, in CSS pixels. */
|
|
89
|
+
interface OversizedBoard {
|
|
90
|
+
readonly board: string;
|
|
91
|
+
readonly w: number;
|
|
92
|
+
readonly h: number;
|
|
93
|
+
readonly page: {
|
|
94
|
+
readonly w: number;
|
|
95
|
+
readonly h: number;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Each board whose page is larger than the board: the canvas, its preview, and the opened board
|
|
100
|
+
* all show only its top left. The board takes the page's size; the canvas's zoom makes it small.
|
|
101
|
+
*/
|
|
102
|
+
export declare function oversizedWarnings(boards: readonly OversizedBoard[]): LayoutWarning[];
|
|
71
103
|
/** A problem where the check found it: on a deck's slide, or on a page at one width. */
|
|
72
104
|
type CheckedProblem = LayoutProblem & {
|
|
73
105
|
readonly theme: "light" | "dark";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-check.d.ts","sourceRoot":"","sources":["../../../src/artifacts/layout-check/layout-check.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"layout-check.d.ts","sourceRoot":"","sources":["../../../src/artifacts/layout-check/layout-check.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAEpF,OAAO,EAGL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAGnB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAE,KAAK,mBAAmB,EAAsB,MAAM,uCAAuC,CAAA;AACpG,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAElE,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,sBAAsB,CAAA;AAe3E,sFAAsF;AACtF,MAAM,MAAM,WAAW,GACnB;IACE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;IAC1B,QAAQ,CA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E,MAAM,CAAA;IAClB,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC1D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,GAAG,aAAa,EAAE,CAcpF;AAiBD,wFAAwF;AACxF,KAAK,cAAc,GAAG,aAAa,GAAG;IACpC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAA;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAA;IACxB,mCAAmC;IACnC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,GAAG,aAAa,EAAE,CAiFnF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Canvas } from "@sixb/core/artifacts";
|
|
2
|
+
/** The window the canvas opens in: a laptop's. */
|
|
3
|
+
export declare const OVERVIEW_VIEWPORT: {
|
|
4
|
+
readonly width: 1440;
|
|
5
|
+
readonly height: 900;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The page the check screenshots as `overview.png`: the canvas fitted to the viewport as the
|
|
9
|
+
* app's opening fit does, in the theme's tokens, each board its picture at `image(id)`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function canvasOverviewHtml(input: {
|
|
12
|
+
readonly canvas: Canvas;
|
|
13
|
+
readonly tokens: Readonly<Record<string, string>>;
|
|
14
|
+
/** Where each board's picture is, relative to the page. */
|
|
15
|
+
readonly image: (boardId: string) => string;
|
|
16
|
+
}): string;
|
|
17
|
+
//# sourceMappingURL=overview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/artifacts/layout-check/overview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAyB,MAAM,sBAAsB,CAAA;AAczE,kDAAkD;AAClD,eAAO,MAAM,iBAAiB;;;CAAwC,CAAA;AAyBtE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IACjD,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;CAC5C,GAAG,MAAM,CAmDT"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Sandbox, SandboxFileRecord } from "@sixb/core";
|
|
2
2
|
import type { AgentRunArtifacts, AgentRunFileStore } from "@sixb/core/internal/agents";
|
|
3
|
-
import type { ArtifactRecord, ArtifactVersionRecord } from "@sixb/core/storage";
|
|
3
|
+
import type { ArtifactFile, ArtifactRecord, ArtifactVersionRecord } from "@sixb/core/storage";
|
|
4
4
|
export interface MaterializedArtifacts {
|
|
5
5
|
/** Files to write, at paths relative to the sandbox working directory or absolute. */
|
|
6
6
|
readonly files: readonly SandboxFileRecord[];
|
|
@@ -16,35 +16,46 @@ interface ManifestEntry {
|
|
|
16
16
|
readonly kind: string;
|
|
17
17
|
readonly title: string;
|
|
18
18
|
readonly version: number;
|
|
19
|
+
/** The artifact's revision this copy holds: an update made from it starts from there. */
|
|
20
|
+
readonly revision: number;
|
|
21
|
+
/**
|
|
22
|
+
* The version is open: each update replaces it until the user creates a version. A frozen one
|
|
23
|
+
* never changes, and the next update opens the next version.
|
|
24
|
+
*/
|
|
25
|
+
readonly open: boolean;
|
|
19
26
|
/** The artifact's address: an artifact that shows it follows its latest version. */
|
|
20
27
|
readonly address: string;
|
|
21
|
-
/**
|
|
22
|
-
|
|
28
|
+
/**
|
|
29
|
+
* The same at this version, once the user created it, which then never changes: a reply shows
|
|
30
|
+
* what its words describe. None while the version is open.
|
|
31
|
+
*/
|
|
32
|
+
readonly pinned?: string;
|
|
23
33
|
/**
|
|
24
34
|
* Addresses of its parts: a document's sections, a sheet's sheets and charts, a deck's slides, a
|
|
25
35
|
* canvas's boards and sections.
|
|
26
36
|
*/
|
|
27
37
|
readonly parts?: readonly {
|
|
28
38
|
readonly address: string;
|
|
29
|
-
readonly pinned
|
|
39
|
+
readonly pinned?: string;
|
|
30
40
|
readonly name: string;
|
|
31
41
|
}[];
|
|
32
42
|
/** Where the version's files are, as the agent names it; absent when not installed. */
|
|
33
43
|
readonly directory?: string;
|
|
34
44
|
readonly files: readonly string[];
|
|
35
45
|
/**
|
|
36
|
-
* The latest version was
|
|
37
|
-
* another conversation, or the project's code.
|
|
38
|
-
* changes.
|
|
46
|
+
* The latest version was last written outside this conversation: a person's edit in the app,
|
|
47
|
+
* another conversation, or the project's code. An update starts from it and keeps its changes.
|
|
39
48
|
*/
|
|
40
49
|
readonly edited?: true;
|
|
50
|
+
/** The requester reads it, through an object that holds it, and cannot change it. */
|
|
51
|
+
readonly readOnly?: true;
|
|
41
52
|
}
|
|
42
53
|
/**
|
|
43
54
|
* The conversation's artifacts as the run's sandbox holds them: the latest version of each under
|
|
44
55
|
* `<directory>/<id>/`, listed in the manifest, newest first. A publish replaces its artifact's copy
|
|
45
|
-
* and entry, so both stay the latest
|
|
46
|
-
* starts from the
|
|
47
|
-
*
|
|
56
|
+
* and entry, so both stay at the latest revision for the rest of the run: revising from the copy
|
|
57
|
+
* never starts from what the artifact held before. A publish refused because the artifact moved
|
|
58
|
+
* on installs what it moved to.
|
|
48
59
|
*/
|
|
49
60
|
export declare class InstalledArtifacts implements MaterializedArtifacts {
|
|
50
61
|
#private;
|
|
@@ -55,23 +66,45 @@ export declare class InstalledArtifacts implements MaterializedArtifacts {
|
|
|
55
66
|
readonly directory: string;
|
|
56
67
|
readonly manifestPath: string;
|
|
57
68
|
readonly maxBytes: number;
|
|
58
|
-
}, entries: readonly ManifestEntry[], installed: Map<string, number>, files: readonly SandboxFileRecord[]);
|
|
69
|
+
}, entries: readonly ManifestEntry[], installed: Map<string, number>, files: readonly SandboxFileRecord[], bases?: ReadonlyMap<string, readonly ArtifactFile[]>);
|
|
59
70
|
get manifestJson(): string;
|
|
60
|
-
/** The
|
|
61
|
-
|
|
71
|
+
/** The revision the manifest lists for an artifact: the one its copy holds. */
|
|
72
|
+
revisionOf(artifactId: string): number | undefined;
|
|
73
|
+
/** Whether the artifact was installed for the requester to read only. */
|
|
74
|
+
readOnly(artifactId: string): boolean;
|
|
75
|
+
/** Where an artifact's copy is installed, as the agent names it; none when it is not. */
|
|
76
|
+
directoryOf(artifactId: string): string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* The revision an update of an artifact starts from, and its files: those of the copy, which a
|
|
79
|
+
* canvas's update is merged from when others wrote it since.
|
|
80
|
+
*/
|
|
81
|
+
baseOf(artifactId: string): {
|
|
82
|
+
readonly revision: number;
|
|
83
|
+
readonly files: readonly ArtifactFile[];
|
|
84
|
+
} | undefined;
|
|
85
|
+
/** Records the folder the Agent published an artifact from: `path` as it named it. */
|
|
86
|
+
publishedFrom(artifactId: string, folder: {
|
|
87
|
+
readonly path: string;
|
|
88
|
+
readonly absolute: string;
|
|
89
|
+
}): void;
|
|
62
90
|
/**
|
|
63
|
-
* Install
|
|
64
|
-
*
|
|
91
|
+
* Install a revision in place of the artifact's copy, and list it first: the copy, the base of
|
|
92
|
+
* the next update, and the folder the Agent last published it from move together, so an update
|
|
93
|
+
* from that folder never takes out what someone else wrote. One that fails to write them keeps
|
|
94
|
+
* the base as it was, and rejects. One update runs at a time, so
|
|
95
|
+
* parallel publishes never write an older manifest over a newer one. Resolves to the folder it
|
|
96
|
+
* wrote, as the Agent named it, if any.
|
|
65
97
|
*/
|
|
66
98
|
replace(sandbox: Sandbox, published: {
|
|
67
99
|
readonly artifact: ArtifactRecord;
|
|
68
100
|
readonly version: ArtifactVersionRecord;
|
|
69
101
|
}, files: readonly PublishedArtifactFile[], signal: AbortSignal, options?: {
|
|
70
102
|
readonly edited?: boolean;
|
|
71
|
-
|
|
103
|
+
readonly readOnly?: boolean;
|
|
104
|
+
}): Promise<string | undefined>;
|
|
72
105
|
}
|
|
73
106
|
/** What a turn reads of its conversation's artifacts, as its requester, through its session. */
|
|
74
|
-
export type TurnArtifacts = Pick<AgentRunArtifacts, "getVersion" | "list" | "
|
|
107
|
+
export type TurnArtifacts = Pick<AgentRunArtifacts, "getVersion" | "list" | "turnWrites">;
|
|
75
108
|
/**
|
|
76
109
|
* The latest version of each artifact the conversation shares, installed under `<directory>/<id>/`
|
|
77
110
|
* and listed in a manifest, so the Agent edits what was published rather than whatever an older
|
|
@@ -94,19 +127,18 @@ export declare function materializeThreadArtifacts(input: {
|
|
|
94
127
|
readonly maxBytes?: number;
|
|
95
128
|
}): Promise<InstalledArtifacts>;
|
|
96
129
|
/**
|
|
97
|
-
* Install the latest
|
|
98
|
-
* place of the copy the run holds: a parent turn sees what
|
|
99
|
-
* whoever
|
|
100
|
-
* end names each.
|
|
130
|
+
* Install the latest revision of each thread artifact the run's turn wrote, its children's writes
|
|
131
|
+
* among them, in place of the copy the run holds when it holds another: a parent turn sees what
|
|
132
|
+
* its children wrote like its own, whoever wrote since. One that cannot be installed does not stop
|
|
133
|
+
* the others; the error at the end names each.
|
|
101
134
|
*/
|
|
102
|
-
export declare function
|
|
135
|
+
export declare function installTurnArtifacts(input: {
|
|
103
136
|
readonly installed: InstalledArtifacts;
|
|
104
137
|
readonly artifacts: TurnArtifacts;
|
|
105
138
|
readonly blobStorage: AgentRunFileStore;
|
|
106
139
|
readonly sandbox: Sandbox;
|
|
107
|
-
readonly runIds: readonly string[];
|
|
108
140
|
readonly signal: AbortSignal;
|
|
109
|
-
}): Promise<
|
|
141
|
+
}): Promise<string[]>;
|
|
110
142
|
/** A version's files with the bytes each holds. Reading stops when the run is cancelled. */
|
|
111
143
|
export declare function readArtifactVersionFiles(blobStorage: AgentRunFileStore, version: ArtifactVersionRecord, signal: AbortSignal): Promise<PublishedArtifactFile[]>;
|
|
112
144
|
/** A blob's bytes. Reading stops when the run is cancelled. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materialize.d.ts","sourceRoot":"","sources":["../../src/artifacts/materialize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACtF,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"materialize.d.ts","sourceRoot":"","sources":["../../src/artifacts/materialize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACtF,OAAO,KAAK,EACV,YAAY,EAEZ,cAAc,EACd,qBAAqB,EACtB,MAAM,oBAAoB,CAAA;AAQ3B,MAAM,WAAW,qBAAqB;IACpC,sFAAsF;IACtF,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAA;IAC5C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC9B;AAED,qEAAqE;AACrE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAC3B;AAED,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,C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,SAAS,EAAE,aAAa,CAAA;IACjC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAA;IACvC,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,yCAAyC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAqD9B;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE;IAChD,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAA;IACtC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;IACjC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAA;IACvC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAC7B,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAoCpB;AAoFD,4FAA4F;AAC5F,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,iBAAiB,EAC9B,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAQlC;AAED,+DAA+D;AAC/D,wBAAsB,QAAQ,CAC5B,WAAW,EAAE,iBAAiB,EAC9B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,UAAU,CAAC,CAkBrB"}
|
|
@@ -7,7 +7,7 @@ import { type InstalledArtifacts } from "./materialize";
|
|
|
7
7
|
type PublishableKind = ArtifactKind;
|
|
8
8
|
export declare const PUBLISH_ARTIFACT_TOOL_SPEC: {
|
|
9
9
|
readonly name: "publish_artifact";
|
|
10
|
-
readonly description: "Publish a new artifact from a file or directory in the sandbox: a deliverable the user opens beside the conversation. Read the sixb-artifacts skill before the first publish. To change an artifact you already published, use
|
|
10
|
+
readonly description: "Publish a new artifact from a file or directory in the sandbox: a deliverable the user opens beside the conversation. Read the sixb-artifacts skill before the first publish. To change an artifact you already published, use update_artifact. Returns the artifact's id and version; a refusal says what to fix.";
|
|
11
11
|
readonly inputSchema: {
|
|
12
12
|
type: string;
|
|
13
13
|
properties: {
|
|
@@ -28,9 +28,9 @@ export declare const PUBLISH_ARTIFACT_TOOL_SPEC: {
|
|
|
28
28
|
additionalProperties: false;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
-
export declare const
|
|
32
|
-
readonly name: "
|
|
33
|
-
readonly description: "
|
|
31
|
+
export declare const UPDATE_ARTIFACT_TOOL_SPEC: {
|
|
32
|
+
readonly name: "update_artifact";
|
|
33
|
+
readonly description: "Update an artifact of this conversation, or one an object the user may edit holds, from a file or directory in the sandbox: your files replace its current version's, which stays open, and its kind stays. Versions the user created stay as they are. $SIXB_ARTIFACTS lists this conversation's artifacts, each with its current version under $SIXB_ARTIFACTS_DIR/<id>/; open one it does not list with open_artifact first. Returns the version and revision it wrote; a refusal says what to fix.";
|
|
34
34
|
readonly inputSchema: {
|
|
35
35
|
type: string;
|
|
36
36
|
properties: {
|
|
@@ -51,16 +51,34 @@ export declare const PUBLISH_ARTIFACT_VERSION_TOOL_SPEC: {
|
|
|
51
51
|
additionalProperties: false;
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
+
export declare const OPEN_ARTIFACT_TOOL_SPEC: {
|
|
55
|
+
readonly name: "open_artifact";
|
|
56
|
+
readonly description: "Open an artifact $SIXB_ARTIFACTS does not list, such as one a project object holds: its current version is installed under $SIXB_ARTIFACTS_DIR/<id>/ and listed in $SIXB_ARTIFACTS, to read it, or to revise it with update_artifact when the user may change it. Publishes nothing. Returns its title, revision, and whether the user may only read it.";
|
|
57
|
+
readonly inputSchema: {
|
|
58
|
+
type: string;
|
|
59
|
+
properties: {
|
|
60
|
+
id: {
|
|
61
|
+
type: string;
|
|
62
|
+
description: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
required: string[];
|
|
66
|
+
additionalProperties: false;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
54
69
|
export interface PublishArtifactToolInput {
|
|
55
70
|
readonly path: string;
|
|
56
71
|
readonly kind: PublishableKind;
|
|
57
72
|
readonly title: string;
|
|
58
73
|
}
|
|
59
|
-
export interface
|
|
74
|
+
export interface UpdateArtifactToolInput {
|
|
60
75
|
readonly id: string;
|
|
61
76
|
readonly path: string;
|
|
62
77
|
readonly title: string;
|
|
63
78
|
}
|
|
79
|
+
export interface OpenArtifactToolInput {
|
|
80
|
+
readonly id: string;
|
|
81
|
+
}
|
|
64
82
|
interface PublishToolsInput {
|
|
65
83
|
/** The run's artifacts, through its session: what it reads as its requester, and publishes. */
|
|
66
84
|
readonly artifacts: AgentRunArtifacts;
|
|
@@ -76,11 +94,19 @@ interface PublishToolsInput {
|
|
|
76
94
|
readonly installed: Promise<InstalledArtifacts>;
|
|
77
95
|
}
|
|
78
96
|
/**
|
|
79
|
-
* `publish_artifact` and `
|
|
80
|
-
*
|
|
81
|
-
*
|
|
97
|
+
* `publish_artifact` and `update_artifact`: each reads a file or a directory from the sandbox,
|
|
98
|
+
* stores its bytes, and publishes them through the run's session, which applies a run's rules (see
|
|
99
|
+
* `AgentRunArtifacts.publish`). An update replaces the open version's content, or opens the next
|
|
100
|
+
* version after one the user created. What it wrote exists when the tool returns, so the
|
|
82
101
|
* conversation shows it mid-turn and a cancelled run keeps it.
|
|
102
|
+
*
|
|
103
|
+
* `open_artifact` installs one the conversation does not list, as the requester reads it, so an
|
|
104
|
+
* update starts from what it holds.
|
|
83
105
|
*/
|
|
84
|
-
export declare function createPublishArtifactTools(input: PublishToolsInput): readonly [
|
|
106
|
+
export declare function createPublishArtifactTools(input: PublishToolsInput): readonly [
|
|
107
|
+
ModelTool<PublishArtifactToolInput>,
|
|
108
|
+
ModelTool<UpdateArtifactToolInput>,
|
|
109
|
+
ModelTool<OpenArtifactToolInput>
|
|
110
|
+
];
|
|
85
111
|
export {};
|
|
86
112
|
//# sourceMappingURL=publish-tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-tool.d.ts","sourceRoot":"","sources":["../../src/artifacts/publish-tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"publish-tool.d.ts","sourceRoot":"","sources":["../../src/artifacts/publish-tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,YAAY,EAGjB,KAAK,SAAS,EAEf,MAAM,YAAY,CAAA;AASnB,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAEvB,MAAM,4BAA4B,CAAA;AAUnC,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAS9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAS1D,OAAO,EACL,KAAK,kBAAkB,EAGxB,MAAM,eAAe,CAAA;AAStB,KAAK,eAAe,GAAG,YAAY,CAAA;AAenC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;CAc7B,CAAA;AAEV,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;CAc5B,CAAA;AAEV,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;CAY1B,CAAA;AAEV,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CACpB;AAED,UAAU,iBAAiB;IACzB,+FAA+F;IAC/F,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAA;IACrC,+FAA+F;IAC/F,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,mEAAmE;IACnE,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAA;IACvC,mDAAmD;IACnD,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAA;IAC1D,qFAAqF;IACrF,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAChD;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,iBAAiB,GACvB,SAAS;IACV,SAAS,CAAC,wBAAwB,CAAC;IACnC,SAAS,CAAC,uBAAuB,CAAC;IAClC,SAAS,CAAC,qBAAqB,CAAC;CACjC,CA0BA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type Sandbox } from "@sixb/core";
|
|
2
|
+
import { type AgentSandboxHandle } from "./sandbox-handle";
|
|
3
|
+
/** Where the commands' files go, in the run's context directory. */
|
|
4
|
+
export declare const BACKGROUND_DIRECTORY = "background";
|
|
5
|
+
export type BackgroundCommandStatus = "running" | "exited" | "stopped";
|
|
6
|
+
/** A background command as its tools report it, and as a chat can show it. */
|
|
7
|
+
export interface BackgroundCommandState {
|
|
8
|
+
/** `bg_<hex>`: the id `bash_output` and `bash_stop` take, never the same in two runs. */
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly command: string;
|
|
11
|
+
readonly status: BackgroundCommandStatus;
|
|
12
|
+
/**
|
|
13
|
+
* Its exit code once it ended. A stopped command's is the signal's (143 for SIGTERM, 137 for
|
|
14
|
+
* SIGKILL), or absent when its sandbox went away under it.
|
|
15
|
+
*/
|
|
16
|
+
readonly exitCode?: number;
|
|
17
|
+
/** ISO timestamps. */
|
|
18
|
+
readonly startedAt: string;
|
|
19
|
+
readonly endedAt?: string;
|
|
20
|
+
/** The file holding everything it wrote, stdout and stderr together, as the agent names it. */
|
|
21
|
+
readonly outputPath: string;
|
|
22
|
+
}
|
|
23
|
+
/** What `bash_output` and `bash_stop` return: its state, and what it wrote since the last read. */
|
|
24
|
+
export interface BackgroundCommandOutput extends BackgroundCommandState {
|
|
25
|
+
/** What it wrote since the last read: its newest 20,000 bytes at most. */
|
|
26
|
+
readonly output: string;
|
|
27
|
+
/** What it wrote since the last read that `output` leaves out, ahead of it: in the file. */
|
|
28
|
+
readonly skippedBytes?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The background commands of a run, or of a thread on the user's computer, where they outlive
|
|
32
|
+
* the turn that started them. Their state is in memory; their output, pid and exit code are files
|
|
33
|
+
* in the sandbox.
|
|
34
|
+
*/
|
|
35
|
+
export declare class BackgroundCommands {
|
|
36
|
+
#private;
|
|
37
|
+
private readonly options;
|
|
38
|
+
constructor(options?: {
|
|
39
|
+
/** Called as a command starts or ends: a computer reports its commands then. */
|
|
40
|
+
readonly onChange?: () => void;
|
|
41
|
+
});
|
|
42
|
+
/** Whether it ever started one: their files are then worth keeping for a later turn. */
|
|
43
|
+
get hasCommands(): boolean;
|
|
44
|
+
/** Whether one of them runs now. */
|
|
45
|
+
get running(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Start `command` in the background and return once it runs, its output going to its file. One
|
|
48
|
+
* the sandbox could not start, as in a directory that does not exist, throws what it said. A
|
|
49
|
+
* `signal` that aborts before then stops it.
|
|
50
|
+
*/
|
|
51
|
+
start(input: {
|
|
52
|
+
readonly handle: AgentSandboxHandle;
|
|
53
|
+
readonly command: string;
|
|
54
|
+
readonly cwd?: string;
|
|
55
|
+
readonly signal?: AbortSignal;
|
|
56
|
+
}): Promise<BackgroundCommandState>;
|
|
57
|
+
/** Whether it knows a command by this id. */
|
|
58
|
+
has(id: string): boolean;
|
|
59
|
+
/** A command by id, or a public error the model can act on. */
|
|
60
|
+
get(id: string): BackgroundCommandState;
|
|
61
|
+
/** Every command, oldest first. */
|
|
62
|
+
list(): readonly BackgroundCommandState[];
|
|
63
|
+
/**
|
|
64
|
+
* Wait until the command ends, `timeoutMs` elapses or `signal` aborts, which rejects with its
|
|
65
|
+
* reason.
|
|
66
|
+
*/
|
|
67
|
+
wait(id: string, timeoutMs: number, signal: AbortSignal): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Its state and what it wrote since the last read, read through `handle`: the sandbox of the run
|
|
70
|
+
* that asks. Once it reports the command ended, no notice repeats it.
|
|
71
|
+
*/
|
|
72
|
+
read(id: string, handle: AgentSandboxHandle, signal: AbortSignal): Promise<BackgroundCommandOutput>;
|
|
73
|
+
/**
|
|
74
|
+
* Stop the command and everything it started: SIGTERM to its process group, SIGKILL after a
|
|
75
|
+
* grace period or where the sandbox cannot reach it, then the held call's abort. Resolves once
|
|
76
|
+
* it ended.
|
|
77
|
+
*/
|
|
78
|
+
stop(id: string): Promise<BackgroundCommandState>;
|
|
79
|
+
/** Stop every command still running. */
|
|
80
|
+
stopAll(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Settles once no command started in `sandbox` runs; undefined when none does now. A computer
|
|
83
|
+
* keeps a turn's sandbox until then.
|
|
84
|
+
*/
|
|
85
|
+
endOf(sandbox: Sandbox): Promise<void> | undefined;
|
|
86
|
+
/** The commands that ended and the model has not heard of: each is reported once. */
|
|
87
|
+
takeEnded(): readonly BackgroundCommandState[];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Stop the commands a `sixb` that ended without stopping them left running: one killed, or that
|
|
91
|
+
* crashed. Their pid files are all that is left of them. Each group still running its command
|
|
92
|
+
* gets SIGTERM, then SIGKILL after the grace period `bash_stop` gives, in one call.
|
|
93
|
+
*/
|
|
94
|
+
export declare function stopLeftRunning(sandbox: Sandbox, pidFiles: readonly string[], signal: AbortSignal): Promise<void>;
|
|
95
|
+
//# sourceMappingURL=background-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background-commands.d.ts","sourceRoot":"","sources":["../src/background-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4C,KAAK,OAAO,EAAE,MAAM,YAAY,CAAA;AAGnF,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,kBAAkB,CAAA;AASvE,oEAAoE;AACpE,eAAO,MAAM,oBAAoB,eAAe,CAAA;AAoBhD,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;AAEtE,8EAA8E;AAC9E,MAAM,WAAW,sBAAsB;IACrC,yFAAyF;IACzF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAA;IACxC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,sBAAsB;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,+FAA+F;IAC/F,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAED,mGAAmG;AACnG,MAAM,WAAW,uBAAwB,SAAQ,sBAAsB;IACrE,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,4FAA4F;IAC5F,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAC/B;AA8BD;;;;GAIG;AACH,qBAAa,kBAAkB;;IAI3B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,G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eAAe,CACnC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,IAAI,CAAC,CASf"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type AgentMessage } from "@sixb/core";
|
|
2
|
+
import type { ModelTool } from "@sixb/core/models";
|
|
3
|
+
import type { BackgroundCommandState, BackgroundCommands } from "./background-commands";
|
|
4
|
+
/**
|
|
5
|
+
* How a run hears of its background commands without polling: a short notice closing the result
|
|
6
|
+
* of the first tool that returns after one ended, and, on its first, those of an earlier turn
|
|
7
|
+
* still running and those its history left running that ended with their run. A tool's result is
|
|
8
|
+
* what its message part keeps (`modelOutput`), so a later turn replays the notice where the model
|
|
9
|
+
* read it, byte for byte; no other request is touched.
|
|
10
|
+
*/
|
|
11
|
+
export declare class BackgroundNotices {
|
|
12
|
+
#private;
|
|
13
|
+
private readonly commands;
|
|
14
|
+
constructor(commands: BackgroundCommands, options?: {
|
|
15
|
+
/** The commands the history last read as running ({@link backgroundCommandsLeftRunning}). */
|
|
16
|
+
readonly leftRunning?: readonly BackgroundCommandState[];
|
|
17
|
+
/** What ended those this run's commands do not know: the run, or the `sixb`, that ran them. */
|
|
18
|
+
readonly endedWith?: string;
|
|
19
|
+
});
|
|
20
|
+
/** The notice due now, once: undefined when nothing is new. */
|
|
21
|
+
take(now?: Date): string | undefined;
|
|
22
|
+
/** The run's tools, each result closed by the notice due as it returns. */
|
|
23
|
+
wrap(tools: readonly ModelTool[]): ModelTool[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The background commands a history last read as running: their tools reported them so, and no
|
|
27
|
+
* later result or notice said they ended. A run whose own commands do not know them is told they
|
|
28
|
+
* ended with the run, or the `sixb`, that ran them.
|
|
29
|
+
*/
|
|
30
|
+
export declare function backgroundCommandsLeftRunning(messages: readonly Pick<AgentMessage, "parts">[]): readonly BackgroundCommandState[];
|
|
31
|
+
//# sourceMappingURL=background-notices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background-notices.d.ts","sourceRoot":"","sources":["../src/background-notices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,YAAY,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAiBvF;;;;;;GAMG;AACH,qBAAa,iBAAiB;;IAa1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,kBAAkB,EAC7C,OAAO,GAAE;QACP,6FAA6F;QAC7F,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAA;QACxD,+FAA+F;QAC/F,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KACvB;IAYR,+DAA+D;IAC/D,IAAI,CAAC,GAAG,OAAa,GAAG,MAAM,GAAG,SAAS;IAmB1C,2EAA2E;IAC3E,IAAI,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,EAAE;CAsB/C;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,SAAS,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,GAC/C,SAAS,sBAAsB,EAAE,CAkBnC"}
|