@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.
- 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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11195 -10160
- package/dist/index.js.map +19 -17
- 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/model-spec.d.ts.map +1 -1
- package/dist/tools/tool-files.d.ts.map +1 -1
- package/dist/types.d.ts +5 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/agent-prompt.ts +4 -4
- 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 +119 -9
- 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/index.ts +1 -0
- package/src/run-environment.ts +4 -5
- package/src/sandbox-api-context.ts +1 -1
- package/src/sandbox-files.ts +86 -0
- 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/model-spec.ts +3 -2
- package/src/tools/tool-files.ts +3 -1
- package/src/types.ts +5 -4
package/src/subagent-tools.ts
CHANGED
|
@@ -189,6 +189,8 @@ export interface WaitForSubagentsOutput {
|
|
|
189
189
|
readonly files: readonly InstalledChildFile[]
|
|
190
190
|
/** Why what the children published is not all in `$SIXB_ARTIFACTS`. */
|
|
191
191
|
readonly artifactsError?: string
|
|
192
|
+
/** The folders the Agent published from that took what the children wrote. */
|
|
193
|
+
readonly artifactsNote?: string
|
|
192
194
|
}
|
|
193
195
|
|
|
194
196
|
/** What a turn offers the children it spawns. */
|
|
@@ -997,6 +999,9 @@ export class SubagentCoordinator {
|
|
|
997
999
|
...(delivered.artifactsError === undefined
|
|
998
1000
|
? {}
|
|
999
1001
|
: { artifactsError: delivered.artifactsError }),
|
|
1002
|
+
...(delivered.artifactsNote === undefined
|
|
1003
|
+
? {}
|
|
1004
|
+
: { artifactsNote: delivered.artifactsNote }),
|
|
1000
1005
|
}
|
|
1001
1006
|
}
|
|
1002
1007
|
// A child of an earlier turn ends into that turn's mailbox, which this one does not hear.
|
|
@@ -1093,7 +1098,7 @@ export class SubagentCoordinator {
|
|
|
1093
1098
|
|
|
1094
1099
|
/**
|
|
1095
1100
|
* Copy what each finished child wrote under `out/` into the parent's sandbox, once, and install
|
|
1096
|
-
*
|
|
1101
|
+
* the artifacts the children wrote in its `$SIXB_ARTIFACTS`, as the parent's own. A result holds at
|
|
1097
1102
|
* most the attachment limits of new files, a child's whole or not at all; a child that does not
|
|
1098
1103
|
* fit, or whose files cannot be copied, says so, and its files come with a later wait.
|
|
1099
1104
|
*/
|
|
@@ -1104,6 +1109,7 @@ export class SubagentCoordinator {
|
|
|
1104
1109
|
readonly byChild: ReadonlyMap<string, ChildFiles>
|
|
1105
1110
|
readonly attached: readonly InstalledChildFile[]
|
|
1106
1111
|
readonly artifactsError?: string
|
|
1112
|
+
readonly artifactsNote?: string
|
|
1107
1113
|
}> {
|
|
1108
1114
|
const byChild = new Map<string, ChildFiles>()
|
|
1109
1115
|
const attached: InstalledChildFile[] = []
|
|
@@ -1166,16 +1172,22 @@ export class SubagentCoordinator {
|
|
|
1166
1172
|
}
|
|
1167
1173
|
|
|
1168
1174
|
let artifactsError: string | undefined
|
|
1175
|
+
let artifactsNote: string | undefined
|
|
1169
1176
|
try {
|
|
1170
|
-
await this.#runFiles?.
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1177
|
+
const folders = (await this.#runFiles?.installTurnArtifacts(signal)) ?? []
|
|
1178
|
+
if (folders.length > 0) {
|
|
1179
|
+
artifactsNote = `What these children wrote is installed in $SIXB_ARTIFACTS and written into the folders you published those artifacts from: ${folders.join(", ")}. Update from them as they are now.`
|
|
1180
|
+
}
|
|
1174
1181
|
} catch (error) {
|
|
1175
1182
|
if (signal.aborted) throw error
|
|
1176
|
-
artifactsError = `What these children
|
|
1183
|
+
artifactsError = `What these children wrote could not all be installed in $SIXB_ARTIFACTS (${errorMessage(error)}). The addresses in their answers still work.`
|
|
1184
|
+
}
|
|
1185
|
+
return {
|
|
1186
|
+
byChild,
|
|
1187
|
+
attached,
|
|
1188
|
+
...(artifactsError === undefined ? {} : { artifactsError }),
|
|
1189
|
+
...(artifactsNote === undefined ? {} : { artifactsNote }),
|
|
1177
1190
|
}
|
|
1178
|
-
return { byChild, attached, ...(artifactsError === undefined ? {} : { artifactsError }) }
|
|
1179
1191
|
}
|
|
1180
1192
|
|
|
1181
1193
|
private runFiles(): AgentRunFiles {
|
package/src/tools/model-spec.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { AgentRunWebPlan, AgentToolSpec } from "@sixb/core/internal/agents"
|
|
2
2
|
import type { SandboxNetworkPolicy } from "@sixb/core/sandboxes"
|
|
3
3
|
import {
|
|
4
|
+
OPEN_ARTIFACT_TOOL_SPEC,
|
|
4
5
|
PUBLISH_ARTIFACT_TOOL_SPEC,
|
|
5
|
-
|
|
6
|
+
UPDATE_ARTIFACT_TOOL_SPEC,
|
|
6
7
|
} from "../artifacts/publish-tool"
|
|
7
8
|
import { BASH_OUTPUT_TOOL_SPEC, BASH_STOP_TOOL_SPEC } from "./background"
|
|
8
9
|
import { BASH_TOOL_SPEC } from "./bash"
|
|
@@ -36,7 +37,7 @@ export function agentModelToolSpecs(
|
|
|
36
37
|
...(fetchesWeb(options.web, options.networkPolicy) ? [WEB_FETCH_TOOL_SPEC] : []),
|
|
37
38
|
...(options.publishes === false
|
|
38
39
|
? []
|
|
39
|
-
: [PUBLISH_ARTIFACT_TOOL_SPEC,
|
|
40
|
+
: [PUBLISH_ARTIFACT_TOOL_SPEC, UPDATE_ARTIFACT_TOOL_SPEC, OPEN_ARTIFACT_TOOL_SPEC]),
|
|
40
41
|
]
|
|
41
42
|
}
|
|
42
43
|
|
package/src/tools/tool-files.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { posix } from "node:path"
|
|
2
2
|
import type { AgentToolFile, AgentToolFilePutInput, AgentToolFiles } from "@sixb/core"
|
|
3
3
|
import { AgentToolPublicError } from "@sixb/core"
|
|
4
|
+
import { ARTIFACT_LIMITS } from "@sixb/core/artifacts"
|
|
4
5
|
import {
|
|
5
6
|
AGENT_FILE_MAX_BYTES,
|
|
6
7
|
type AgentRunFileStore,
|
|
@@ -10,7 +11,8 @@ import {
|
|
|
10
11
|
import type { AgentSandboxHandle } from "../sandbox-handle"
|
|
11
12
|
|
|
12
13
|
export { AGENT_FILE_MAX_BYTES }
|
|
13
|
-
|
|
14
|
+
/** What a run stores in all: at least an artifact's version as large as one may be. */
|
|
15
|
+
const DEFAULT_RUN_MAX_BYTES = ARTIFACT_LIMITS.maxVersionBytes
|
|
14
16
|
|
|
15
17
|
interface CreateAgentToolFilesInput {
|
|
16
18
|
readonly toolName: string
|
package/src/types.ts
CHANGED
|
@@ -83,9 +83,10 @@ export interface AgentRunFiles {
|
|
|
83
83
|
/** Shared with every other file the run stores. */
|
|
84
84
|
readonly budget: AgentFileBudget
|
|
85
85
|
/**
|
|
86
|
-
* Install the latest
|
|
87
|
-
*
|
|
88
|
-
*
|
|
86
|
+
* Install the latest revision of each thread artifact the run's turn wrote, its children's
|
|
87
|
+
* writes among them, in the run's `$SIXB_ARTIFACTS`, and in the folder the Agent last published
|
|
88
|
+
* each from; nothing for a run that installs no artifacts. Resolves to the folders it wrote.
|
|
89
|
+
* Throws, naming them, when some could not be installed.
|
|
89
90
|
*/
|
|
90
|
-
|
|
91
|
+
installTurnArtifacts(signal: AbortSignal): Promise<readonly string[]>
|
|
91
92
|
}
|