@sixb/agent 0.2.2 → 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.
Files changed (45) hide show
  1. package/dist/artifacts/board-previews.d.ts +41 -0
  2. package/dist/artifacts/board-previews.d.ts.map +1 -0
  3. package/dist/artifacts/layout-check/layout-check.d.ts +38 -6
  4. package/dist/artifacts/layout-check/layout-check.d.ts.map +1 -1
  5. package/dist/artifacts/layout-check/overview.d.ts +17 -0
  6. package/dist/artifacts/layout-check/overview.d.ts.map +1 -0
  7. package/dist/artifacts/materialize.d.ts +56 -24
  8. package/dist/artifacts/materialize.d.ts.map +1 -1
  9. package/dist/artifacts/publish-tool.d.ts +35 -9
  10. package/dist/artifacts/publish-tool.d.ts.map +1 -1
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +11195 -10160
  14. package/dist/index.js.map +19 -17
  15. package/dist/sandbox-files.d.ts +19 -0
  16. package/dist/sandbox-files.d.ts.map +1 -1
  17. package/dist/subagent-tools.d.ts +3 -1
  18. package/dist/subagent-tools.d.ts.map +1 -1
  19. package/dist/tools/model-spec.d.ts.map +1 -1
  20. package/dist/tools/tool-files.d.ts.map +1 -1
  21. package/dist/types.d.ts +5 -4
  22. package/dist/types.d.ts.map +1 -1
  23. package/package.json +6 -5
  24. package/src/agent-prompt.ts +4 -4
  25. package/src/artifacts/board-previews.ts +218 -0
  26. package/src/artifacts/layout-check/check.cjs +304 -80
  27. package/src/artifacts/layout-check/layout-check.ts +119 -9
  28. package/src/artifacts/layout-check/overview.ts +291 -0
  29. package/src/artifacts/materialize.ts +181 -55
  30. package/src/artifacts/publish-tool.ts +459 -129
  31. package/src/index.ts +1 -0
  32. package/src/run-environment.ts +4 -5
  33. package/src/sandbox-api-context.ts +1 -1
  34. package/src/sandbox-files.ts +86 -0
  35. package/src/skills/sixb-artifacts/SKILL.md +48 -25
  36. package/src/skills/sixb-artifacts/canvas.md +140 -18
  37. package/src/skills/sixb-artifacts/examples/canvas/onboarding-flow/canvas.json +1 -1
  38. package/src/skills/sixb-artifacts/page.md +1 -1
  39. package/src/skills/sixb-artifacts/references.md +15 -12
  40. package/src/skills/sixb-artifacts/sheet.md +1 -1
  41. package/src/skills/sixb-artifacts/slides.md +1 -1
  42. package/src/subagent-tools.ts +19 -7
  43. package/src/tools/model-spec.ts +3 -2
  44. package/src/tools/tool-files.ts +3 -1
  45. package/src/types.ts +5 -4
@@ -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;AACzD,OAAO,EAGL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAGnB,MAAM,sCAAsC,CAAA;AAE7C,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,sBAAsB,CAAA;AAc3E,sFAAsF;AACtF,MAAM,MAAM,WAAW,GACnB;IACE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAA;IAC3C,yEAAyE;IACzE,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CACxC,GACD;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,oFAAoF;IACpF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,kGAAkG;AAClG,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAA;AAEhD,+CAA+C;AAC/C,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,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AQ,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
- /** The same at this version, which never changes: a reply shows what its words describe. */
22
- readonly pinned: string;
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: string;
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 published outside this conversation: a person's edit in the app,
37
- * another conversation, or the project's code. The next version starts from it and keeps its
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 version for the rest of the run: revising from the copy never
46
- * starts from the version before. A publish refused because the artifact moved on installs the
47
- * version it moved to.
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 version the manifest lists for an artifact: the one its copy holds. */
61
- versionOf(artifactId: string): number | undefined;
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 the version just published in place of the artifact's copy, and list it first. One
64
- * update runs at a time, so parallel publishes never write an older manifest over a newer one.
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
- }): Promise<void>;
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" | "listVersions">;
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 version of each thread artifact one of `runIds` published a version of, in
98
- * place of the copy the run holds: a parent turn sees what its children published like its own,
99
- * whoever published since. One that cannot be installed does not stop the others; the error at the
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 installArtifactsPublishedBy(input: {
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<void>;
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,EAAmB,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAQhG,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,CAAA;IACxB,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS;QACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;QACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;QACvB,QAAQ,CAAC,IAAI,EA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AAS,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 publish_artifact_version. Returns the artifact's id and version; a refusal says what to fix.";
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 PUBLISH_ARTIFACT_VERSION_TOOL_SPEC: {
32
- readonly name: "publish_artifact_version";
33
- readonly description: "Publish the next version of an artifact you published, from a file or directory in the sandbox. It keeps its kind, and its earlier versions stay readable. $SIXB_ARTIFACTS lists this conversation's artifacts, each with its latest version under $SIXB_ARTIFACTS_DIR/<id>/. Returns the new version; a refusal says what to fix.";
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 PublishArtifactVersionToolInput {
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 `publish_artifact_version`: each reads a file or a directory from the
80
- * sandbox, stores its bytes, and publishes them through the run's session, which applies a run's
81
- * rules (see `AgentRunArtifacts.publish`). The version exists when the tool returns, so the
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 [ModelTool<PublishArtifactToolInput>, ModelTool<PublishArtifactVersionToolInput>];
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,EAKjB,KAAK,SAAS,EAEf,MAAM,YAAY,CAAA;AAEnB,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM,4BAA4B,CAAA;AASnC,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;AAO1D,OAAO,EACL,KAAK,kBAAkB,EAGxB,MAAM,eAAe,CAAA;AAQtB,KAAK,eAAe,GAAG,YAAY,CAAA;AAenC,eAAO,MAAM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,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"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { waitForAbort } from "./abort";
2
2
  export type { AgentWorkspacePromptContext } from "./agent-prompt";
3
+ export { renderBoardPreviews } from "./artifacts/board-previews";
3
4
  export { createAskParentTool } from "./ask-parent-tool";
4
5
  export type { BackgroundCommandStatus } from "./background-commands";
5
6
  export { type ComputerBackgroundCommand, type ComputerBackgroundCommandRef, ComputerRunner, type ComputerRunnerOptions, type OpenComputerSandbox, } from "./computer-runner";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,YAAY,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,YAAY,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,eAAe,GAChB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,KAAK,0BAA0B,EAAE,cAAc,EAA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