@intentic/sandbox-contract 1.431.0 → 1.432.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/dist/briefs/agent-ask.d.ts +10 -0
- package/dist/briefs/agent-ask.d.ts.map +1 -0
- package/dist/briefs/agent-ask.js +2 -0
- package/dist/briefs/agent-ask.js.map +1 -0
- package/dist/{chores/extension-update.d.ts → briefs/extension-update-brief.d.ts} +1 -1
- package/dist/briefs/extension-update-brief.d.ts.map +1 -0
- package/dist/{chores/extension-update.js → briefs/extension-update-brief.js} +2 -2
- package/dist/briefs/extension-update-brief.js.map +1 -0
- package/dist/chores/digest.d.ts.map +1 -1
- package/dist/chores/digest.js.map +1 -1
- package/dist/chores/index.d.ts +2 -2
- package/dist/chores/index.d.ts.map +1 -1
- package/dist/chores/index.js +1 -1
- package/dist/chores/index.js.map +1 -1
- package/dist/chores/prompt.d.ts +1 -9
- package/dist/chores/prompt.d.ts.map +1 -1
- package/dist/chores/prompt.js +1 -1
- package/dist/chores/prompt.js.map +1 -1
- package/dist/chores/stack.d.ts.map +1 -1
- package/dist/chores/stack.js.map +1 -1
- package/dist/chores/verdict.d.ts.map +1 -1
- package/dist/chores/verdict.js.map +1 -1
- package/dist/chores/workspace-scope.d.ts +1 -3
- package/dist/chores/workspace-scope.d.ts.map +1 -1
- package/dist/chores/workspace-scope.js +1 -3
- package/dist/chores/workspace-scope.js.map +1 -1
- package/dist/contracts/agent.contract.d.ts +869 -12
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.d.ts +291 -4
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/automations.contract.d.ts +59 -8
- package/dist/contracts/automations.contract.d.ts.map +1 -1
- package/dist/contracts/capabilities.contract.d.ts +37 -0
- package/dist/contracts/capabilities.contract.d.ts.map +1 -1
- package/dist/contracts/capabilities.contract.js +21 -0
- package/dist/contracts/capabilities.contract.js.map +1 -1
- package/dist/contracts/ci.contract.d.ts +222 -95
- package/dist/contracts/ci.contract.d.ts.map +1 -1
- package/dist/contracts/ci.contract.js +87 -26
- package/dist/contracts/ci.contract.js.map +1 -1
- package/dist/contracts/device-stacks.contract.d.ts +129 -0
- package/dist/contracts/device-stacks.contract.d.ts.map +1 -0
- package/dist/contracts/device-stacks.contract.js +66 -0
- package/dist/contracts/device-stacks.contract.js.map +1 -0
- package/dist/contracts/device.contract.d.ts +47 -0
- package/dist/contracts/device.contract.d.ts.map +1 -1
- package/dist/contracts/extensions.contract.d.ts +603 -0
- package/dist/contracts/extensions.contract.d.ts.map +1 -1
- package/dist/contracts/extensions.contract.js +10 -1
- package/dist/contracts/extensions.contract.js.map +1 -1
- package/dist/contracts/needs.contract.d.ts +689 -18
- package/dist/contracts/needs.contract.d.ts.map +1 -1
- package/dist/contracts/offload.contract.d.ts +21 -0
- package/dist/contracts/offload.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +501 -8
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/seal.contract.d.ts +15 -0
- package/dist/contracts/seal.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.d.ts +15 -0
- package/dist/contracts/secrets.contract.d.ts.map +1 -1
- package/dist/contracts/secrets.contract.js +21 -1
- package/dist/contracts/secrets.contract.js.map +1 -1
- package/dist/contracts/sessions.contract.d.ts +111 -2
- package/dist/contracts/sessions.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.d.ts +57 -42
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.js +18 -0
- package/dist/contracts/settings.contract.js.map +1 -1
- package/dist/contracts/stack-grants.contract.d.ts +418 -0
- package/dist/contracts/stack-grants.contract.d.ts.map +1 -0
- package/dist/contracts/stack-grants.contract.js +46 -0
- package/dist/contracts/stack-grants.contract.js.map +1 -0
- package/dist/contracts/system.contract.d.ts +188 -69
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.js +12 -42
- package/dist/contracts/system.contract.js.map +1 -1
- package/dist/contracts/workspace.contract.d.ts +0 -55
- package/dist/contracts/workspace.contract.d.ts.map +1 -1
- package/dist/contracts/workspace.contract.js +0 -19
- package/dist/contracts/workspace.contract.js.map +1 -1
- package/dist/events/agent-events.d.ts +421 -8
- package/dist/events/agent-events.d.ts.map +1 -1
- package/dist/events/agent-transcript.d.ts +111 -2
- package/dist/events/agent-transcript.d.ts.map +1 -1
- package/dist/events/agent-words.d.ts.map +1 -1
- package/dist/events/agent-words.js +2 -1
- package/dist/events/agent-words.js.map +1 -1
- package/dist/events/child-news.d.ts +32 -0
- package/dist/events/child-news.d.ts.map +1 -0
- package/dist/events/child-news.js +171 -0
- package/dist/events/child-news.js.map +1 -0
- package/dist/events/prompt-origins.d.ts +42 -0
- package/dist/events/prompt-origins.d.ts.map +1 -1
- package/dist/events/prompt-origins.js +28 -0
- package/dist/events/prompt-origins.js.map +1 -1
- package/dist/events/requests.d.ts +14 -0
- package/dist/events/requests.d.ts.map +1 -1
- package/dist/events/requests.js +12 -0
- package/dist/events/requests.js.map +1 -1
- package/dist/events/system-events.d.ts +12 -0
- package/dist/events/system-events.d.ts.map +1 -1
- package/dist/events/transcript.d.ts +559 -10
- package/dist/events/transcript.d.ts.map +1 -1
- package/dist/events/transcript.js +2 -1
- package/dist/events/transcript.js.map +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/models/model-roles.d.ts +91 -37
- package/dist/models/model-roles.d.ts.map +1 -1
- package/dist/models/model-roles.js +106 -35
- package/dist/models/model-roles.js.map +1 -1
- package/dist/models/model-setups.d.ts +10 -8
- package/dist/models/model-setups.d.ts.map +1 -1
- package/dist/models/model-setups.js +15 -15
- package/dist/models/model-setups.js.map +1 -1
- package/dist/policy/approvals-execution.d.ts +5 -2
- package/dist/policy/approvals-execution.d.ts.map +1 -1
- package/dist/policy/approvals-execution.js +3 -4
- package/dist/policy/approvals-execution.js.map +1 -1
- package/dist/policy/batch-runs.d.ts +1 -1
- package/dist/policy/batch-runs.d.ts.map +1 -1
- package/dist/policy/batch-runs.js +2 -1
- package/dist/policy/batch-runs.js.map +1 -1
- package/dist/policy/message-limits.d.ts.map +1 -1
- package/dist/policy/message-limits.js.map +1 -1
- package/dist/policy/org-locks.d.ts +1 -1
- package/dist/policy/org-locks.d.ts.map +1 -1
- package/dist/policy/org-locks.js +1 -0
- package/dist/policy/org-locks.js.map +1 -1
- package/dist/policy/shell/workspace-root-exclude.d.ts +4 -0
- package/dist/policy/shell/workspace-root-exclude.d.ts.map +1 -0
- package/dist/policy/shell/workspace-root-exclude.js +4 -0
- package/dist/policy/shell/workspace-root-exclude.js.map +1 -0
- package/dist/protocol/doors/listener-protocol.d.ts +7 -0
- package/dist/protocol/doors/listener-protocol.d.ts.map +1 -1
- package/dist/protocol/doors/listener-protocol.js +1 -0
- package/dist/protocol/doors/listener-protocol.js.map +1 -1
- package/dist/protocol/doors/webext-links.d.ts.map +1 -1
- package/dist/protocol/doors/webext-links.js.map +1 -1
- package/dist/protocol/raw/extension-protocol.d.ts +518 -0
- package/dist/protocol/raw/extension-protocol.d.ts.map +1 -1
- package/dist/protocol/raw/extension-protocol.js +276 -0
- package/dist/protocol/raw/extension-protocol.js.map +1 -1
- package/dist/protocol/raw/raw-json-routes.d.ts +60 -0
- package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-routes.d.ts +81 -1
- package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-routes.js +16 -1
- package/dist/protocol/raw/raw-routes.js.map +1 -1
- package/dist/schemas/activity.d.ts.map +1 -1
- package/dist/schemas/activity.js.map +1 -1
- package/dist/schemas/agent.d.ts +4 -0
- package/dist/schemas/agent.d.ts.map +1 -1
- package/dist/schemas/agent.js +4 -2
- package/dist/schemas/agent.js.map +1 -1
- package/dist/schemas/agents-list.d.ts +6 -0
- package/dist/schemas/agents-list.d.ts.map +1 -1
- package/dist/schemas/agents.d.ts +12 -0
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/automations.d.ts +87 -27
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/automations.js +15 -33
- package/dist/schemas/automations.js.map +1 -1
- package/dist/schemas/ci-deployments.d.ts +30 -0
- package/dist/schemas/ci-deployments.d.ts.map +1 -0
- package/dist/schemas/ci-deployments.js +18 -0
- package/dist/schemas/ci-deployments.js.map +1 -0
- package/dist/schemas/ci.d.ts +348 -21
- package/dist/schemas/ci.d.ts.map +1 -1
- package/dist/schemas/ci.js +110 -19
- package/dist/schemas/ci.js.map +1 -1
- package/dist/schemas/command-run.d.ts +29 -0
- package/dist/schemas/command-run.d.ts.map +1 -0
- package/dist/schemas/command-run.js +20 -0
- package/dist/schemas/command-run.js.map +1 -0
- package/dist/schemas/data-protection.d.ts +15 -2
- package/dist/schemas/data-protection.d.ts.map +1 -1
- package/dist/schemas/data-protection.js +15 -23
- package/dist/schemas/data-protection.js.map +1 -1
- package/dist/schemas/device-stacks.d.ts +131 -0
- package/dist/schemas/device-stacks.d.ts.map +1 -1
- package/dist/schemas/device-stacks.js +81 -0
- package/dist/schemas/device-stacks.js.map +1 -1
- package/dist/schemas/devices.d.ts +73 -0
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +6 -2
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/extension-updates.d.ts +1184 -0
- package/dist/schemas/extension-updates.d.ts.map +1 -1
- package/dist/schemas/extension-updates.js +18 -4
- package/dist/schemas/extension-updates.js.map +1 -1
- package/dist/schemas/host-power.d.ts +22 -0
- package/dist/schemas/host-power.d.ts.map +1 -1
- package/dist/schemas/host-power.js +55 -0
- package/dist/schemas/host-power.js.map +1 -1
- package/dist/schemas/hosts.d.ts +226 -0
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +24 -0
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/issues.d.ts +35 -249
- package/dist/schemas/issues.d.ts.map +1 -1
- package/dist/schemas/issues.js +9 -43
- package/dist/schemas/issues.js.map +1 -1
- package/dist/schemas/maintenance.d.ts.map +1 -1
- package/dist/schemas/maintenance.js.map +1 -1
- package/dist/schemas/metrics.d.ts +25 -0
- package/dist/schemas/metrics.d.ts.map +1 -1
- package/dist/schemas/metrics.js +18 -0
- package/dist/schemas/metrics.js.map +1 -1
- package/dist/schemas/need-kinds.d.ts +19 -0
- package/dist/schemas/need-kinds.d.ts.map +1 -0
- package/dist/schemas/need-kinds.js +7 -0
- package/dist/schemas/need-kinds.js.map +1 -0
- package/dist/schemas/needs.d.ts +523 -30
- package/dist/schemas/needs.d.ts.map +1 -1
- package/dist/schemas/needs.js +36 -6
- package/dist/schemas/needs.js.map +1 -1
- package/dist/schemas/offload.d.ts +52 -0
- package/dist/schemas/offload.d.ts.map +1 -1
- package/dist/schemas/offload.js +12 -0
- package/dist/schemas/offload.js.map +1 -1
- package/dist/schemas/outward-action.d.ts +39 -0
- package/dist/schemas/outward-action.d.ts.map +1 -0
- package/dist/schemas/outward-action.js +40 -0
- package/dist/schemas/outward-action.js.map +1 -0
- package/dist/schemas/providers/plan-limits.d.ts +1 -0
- package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
- package/dist/schemas/providers/plan-limits.js +1 -0
- package/dist/schemas/providers/plan-limits.js.map +1 -1
- package/dist/schemas/secrets.d.ts +17 -0
- package/dist/schemas/secrets.d.ts.map +1 -1
- package/dist/schemas/secrets.js +12 -5
- package/dist/schemas/secrets.js.map +1 -1
- package/dist/schemas/settings-history.d.ts +1 -1
- package/dist/schemas/settings-history.d.ts.map +1 -1
- package/dist/schemas/settings-history.js +5 -4
- package/dist/schemas/settings-history.js.map +1 -1
- package/dist/schemas/settings-savings.d.ts +58 -0
- package/dist/schemas/settings-savings.d.ts.map +1 -1
- package/dist/schemas/settings-savings.js +22 -0
- package/dist/schemas/settings-savings.js.map +1 -1
- package/dist/schemas/settings.d.ts +2 -42
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +5 -6
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/stack-grants.d.ts +60 -0
- package/dist/schemas/stack-grants.d.ts.map +1 -0
- package/dist/schemas/stack-grants.js +33 -0
- package/dist/schemas/stack-grants.js.map +1 -0
- package/dist/schemas/watch-sources.d.ts +72 -0
- package/dist/schemas/watch-sources.d.ts.map +1 -0
- package/dist/schemas/watch-sources.js +88 -0
- package/dist/schemas/watch-sources.js.map +1 -0
- package/dist/schemas/workspace/workspace-search.d.ts.map +1 -1
- package/dist/schemas/workspace/workspace-search.js +1 -1
- package/dist/schemas/workspace/workspace-search.js.map +1 -1
- package/dist/schemas/wsl-memory.d.ts +76 -0
- package/dist/schemas/wsl-memory.d.ts.map +1 -0
- package/dist/schemas/wsl-memory.js +36 -0
- package/dist/schemas/wsl-memory.js.map +1 -0
- package/dist/state/auth-state.d.ts.map +1 -1
- package/dist/state/auth-state.js +2 -0
- package/dist/state/auth-state.js.map +1 -1
- package/dist/state/definition.d.ts +4 -8
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/state/workspace-state.d.ts +8 -3
- package/dist/state/workspace-state.d.ts.map +1 -1
- package/dist/state/workspace-state.js +8 -3
- package/dist/state/workspace-state.js.map +1 -1
- package/package.json +5 -5
- package/src/briefs/agent-ask.ts +23 -0
- package/src/{chores/extension-update.ts → briefs/extension-update-brief.ts} +3 -2
- package/src/chores/digest.ts +1 -0
- package/src/chores/index.ts +13 -2
- package/src/chores/prompt.ts +3 -18
- package/src/chores/stack.ts +1 -0
- package/src/chores/verdict.ts +1 -0
- package/src/chores/workspace-scope.ts +3 -8
- package/src/contracts/capabilities.contract.ts +24 -0
- package/src/contracts/ci.contract.ts +119 -37
- package/src/contracts/device-stacks.contract.ts +97 -0
- package/src/contracts/extensions.contract.ts +11 -0
- package/src/contracts/secrets.contract.ts +27 -0
- package/src/contracts/settings.contract.ts +24 -0
- package/src/contracts/stack-grants.contract.ts +51 -0
- package/src/contracts/system.contract.ts +16 -59
- package/src/contracts/workspace.contract.ts +0 -22
- package/src/events/agent-words.ts +3 -1
- package/src/events/child-news.test.ts +91 -0
- package/src/events/child-news.ts +269 -0
- package/src/events/prompt-origins.ts +35 -0
- package/src/events/requests.ts +18 -0
- package/src/events/transcript.ts +10 -1
- package/src/index.ts +3 -6
- package/src/models/model-roles.test.ts +61 -4
- package/src/models/model-roles.ts +153 -49
- package/src/models/model-setups.ts +49 -26
- package/src/policy/approvals-execution.ts +11 -6
- package/src/policy/batch-runs.ts +2 -2
- package/src/policy/message-limits.ts +8 -4
- package/src/policy/org-locks.ts +1 -0
- package/src/policy/shell/workspace-root-exclude.ts +11 -0
- package/src/protocol/doors/listener-protocol.ts +14 -0
- package/src/protocol/doors/webext-links.ts +3 -1
- package/src/protocol/raw/extension-protocol.ts +469 -2
- package/src/protocol/raw/raw-routes.ts +45 -4
- package/src/schemas/activity.ts +2 -1
- package/src/schemas/agent.test.ts +3 -0
- package/src/schemas/agent.ts +10 -4
- package/src/schemas/automations.ts +25 -41
- package/src/schemas/ci-deployments.ts +26 -0
- package/src/schemas/ci.ts +185 -45
- package/src/schemas/command-run.ts +44 -0
- package/src/schemas/data-protection.ts +28 -34
- package/src/schemas/device-stacks.ts +162 -3
- package/src/schemas/devices.ts +13 -2
- package/src/schemas/extension-updates.ts +27 -7
- package/src/schemas/host-power.test.ts +53 -0
- package/src/schemas/host-power.ts +96 -2
- package/src/schemas/hosts.test.ts +32 -0
- package/src/schemas/hosts.ts +62 -0
- package/src/schemas/issues.ts +29 -86
- package/src/schemas/maintenance.ts +4 -3
- package/src/schemas/metrics.ts +35 -0
- package/src/schemas/need-kinds.ts +13 -0
- package/src/schemas/needs.ts +57 -16
- package/src/schemas/offload.ts +31 -0
- package/src/schemas/outward-action.ts +47 -0
- package/src/schemas/providers/plan-limits.ts +1 -0
- package/src/schemas/secrets.ts +23 -5
- package/src/schemas/settings-history.ts +10 -5
- package/src/schemas/settings-savings.ts +29 -0
- package/src/schemas/settings.test.ts +23 -23
- package/src/schemas/settings.ts +10 -12
- package/src/schemas/stack-grants.ts +59 -0
- package/src/schemas/version-seam.test.ts +4 -1
- package/src/schemas/watch-sources.ts +127 -0
- package/src/schemas/workspace/workspace-search.ts +5 -2
- package/src/schemas/wsl-memory.ts +59 -0
- package/src/state/auth-state.ts +7 -0
- package/src/state/workspace-state.ts +18 -18
- package/src/text/embed.ts +2 -2
- package/dist/chores/extension-update.d.ts.map +0 -1
- package/dist/chores/extension-update.js.map +0 -1
- package/dist/contracts/chores.contract.d.ts +0 -213
- package/dist/contracts/chores.contract.d.ts.map +0 -1
- package/dist/contracts/chores.contract.js +0 -32
- package/dist/contracts/chores.contract.js.map +0 -1
- package/dist/contracts/issues.contract.d.ts +0 -106
- package/dist/contracts/issues.contract.d.ts.map +0 -1
- package/dist/contracts/issues.contract.js +0 -50
- package/dist/contracts/issues.contract.js.map +0 -1
- package/src/chores/chores.test.ts +0 -24
- package/src/chores/digest.test.ts +0 -27
- package/src/chores/probes.integration.test.ts +0 -494
- package/src/chores/stack.test.ts +0 -140
- package/src/chores/verdict.test.ts +0 -761
- package/src/contracts/chores.contract.ts +0 -39
- package/src/contracts/issues.contract.ts +0 -53
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { oneLine } from "@intentic/base/one-line";
|
|
2
|
+
import type { ChildNewsKind, TranscriptChildNews, TranscriptRow } from "./transcript.js";
|
|
3
|
+
|
|
4
|
+
// WHAT THE SANDBOX TELLS A PARENT ABOUT ONE OF ITS SUBAGENTS between its start and its report: it moved, it stays
|
|
5
|
+
// stopped, it starts again, a message to it did not go. The parent reads each as a prompt nobody typed; a reader draws
|
|
6
|
+
// it as news about that subagent, never as the owner's own words (2026-11-26: four of these, one cause, drew as four of
|
|
7
|
+
// the owner's bubbles and filled the screen). Composing and recognising stay one piece of knowledge here, so every
|
|
8
|
+
// sentence below is also what the parser anchors on: keep each one's opening and the words that follow the name
|
|
9
|
+
// unchanged across releases, or news already in a record reads as the owner's words again.
|
|
10
|
+
|
|
11
|
+
/** The subagent a piece of news is about: its id, and its title where the sentence names one. */
|
|
12
|
+
export interface NewsSubject {
|
|
13
|
+
readonly child: string;
|
|
14
|
+
readonly title?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// `sub-x7` or `sub-x7 ("Port the parser")`; a title is one line, since the parser reads the name off one.
|
|
18
|
+
const named = ({ child, title }: NewsSubject): string => {
|
|
19
|
+
const label = title === undefined ? "" : oneLine(title);
|
|
20
|
+
return label === "" ? `\`${child}\`` : `\`${child}\` ("${label}")`;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Paths and repos as a sentence names them: each in backticks, past `shown` the rest counted.
|
|
24
|
+
export const listed = (items: readonly string[], shown: number = items.length): string =>
|
|
25
|
+
[
|
|
26
|
+
items
|
|
27
|
+
.slice(0, shown)
|
|
28
|
+
.map((item) => `\`${item}\``)
|
|
29
|
+
.join(", "),
|
|
30
|
+
...(items.length > shown ? [`and ${items.length - shown} more`] : []),
|
|
31
|
+
].join(" ");
|
|
32
|
+
|
|
33
|
+
/** Its runner could not prepare its copy of the workspace, so it runs in this sandbox instead. */
|
|
34
|
+
export const movedHereWords = (who: NewsSubject, runner: string, failure: string): string =>
|
|
35
|
+
`Your subagent ${named(who)} could not start on the runner "${runner}": ${failure} It runs here, in this sandbox, instead, and its report reaches you when it ends.`;
|
|
36
|
+
|
|
37
|
+
/** It ended without running again, and nothing will run it again by itself. */
|
|
38
|
+
export const stoppedWords = (who: NewsSubject, why: string): string => `Your subagent ${named(who)} stays stopped: ${why}`;
|
|
39
|
+
|
|
40
|
+
/** A restart cut it before any model read its brief, so it starts again by itself. */
|
|
41
|
+
export const restartedWords = (who: NewsSubject): string =>
|
|
42
|
+
`Your subagent ${named(who)} had not started when the sandbox restarted, so it starts again by itself, from its task: its report reaches you when it ends.`;
|
|
43
|
+
|
|
44
|
+
/** Its turn opened on another model than it was spawned on. */
|
|
45
|
+
export const otherModelWords = (who: NewsSubject, served: string, asked: string): string =>
|
|
46
|
+
`Your subagent ${named(who)} runs this turn on ${served}, not on ${asked} as it was spawned: ${asked} was not offered when the turn started. Cancel it if that model will not do.`;
|
|
47
|
+
|
|
48
|
+
/** Refused where it ran, it moved itself to the next of its fallbacks (`provider/model` both). */
|
|
49
|
+
export const fellBackWords = (who: NewsSubject, from: string, to: string, refusal: string): string =>
|
|
50
|
+
`Your subagent ${named(who)} was refused on ${from} and moved itself to ${to}, the next of the fallbacks you gave it: it carries on in the same worktree, and its report comes when that turn ends. The refusal: ${refusal}`;
|
|
51
|
+
|
|
52
|
+
/** A turn started on it without its parent; `why` says what started it. */
|
|
53
|
+
export const workingWords = (who: NewsSubject, why: string): string =>
|
|
54
|
+
`Your subagent ${named(who)} is working: ${why}. Its report reaches you when it ends, like any turn of its: do not send it the task again or give the task to another agent meanwhile.`;
|
|
55
|
+
|
|
56
|
+
/** A start the owner had to allow never ran. */
|
|
57
|
+
export const notStartedWords = (child: string, why: string): string => `Your subagent \`${child}\` did not start: ${why}`;
|
|
58
|
+
|
|
59
|
+
/** The owner allowed a held start; `note` says what the start did beyond that. */
|
|
60
|
+
export const allowedWords = (child: string, note: string): string => `The owner allowed your subagent \`${child}\` to start. ${note}`;
|
|
61
|
+
|
|
62
|
+
/** A message the parent sent it never reached it. */
|
|
63
|
+
export const messageLostWords = (child: string, why: string): string => `Your message to subagent \`${child}\` did not go: ${why}`;
|
|
64
|
+
|
|
65
|
+
/** An answer the parent gave it never reached it. */
|
|
66
|
+
export const answerLostWords = (child: string, why: string): string => `Your answer to subagent \`${child}\` did not go: ${why}`;
|
|
67
|
+
|
|
68
|
+
/** One question a subagent stopped on, as its card asked it. */
|
|
69
|
+
export interface NewsQuestion {
|
|
70
|
+
readonly question: string;
|
|
71
|
+
readonly options: readonly { readonly label: string }[];
|
|
72
|
+
readonly multiSelect?: boolean | undefined;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const QUESTION_OPENS = "stopped on a question and is waiting for your answer";
|
|
76
|
+
|
|
77
|
+
/** It stopped on a question: the questions whole, options and all, and the door that answers them, since the parent may
|
|
78
|
+
* have no wait open to read them from. */
|
|
79
|
+
export const questionWords = (who: NewsSubject, questions: readonly NewsQuestion[]): string =>
|
|
80
|
+
[
|
|
81
|
+
`Your subagent ${named(who)} ${QUESTION_OPENS}; until you give one it does nothing and keeps its seat.`,
|
|
82
|
+
...questions.map((asked) => {
|
|
83
|
+
const options = asked.options.map((option) => option.label);
|
|
84
|
+
return `- ${asked.question}${options.length === 0 ? "" : ` (options: ${options.join(", ")}${asked.multiSelect === true ? "; pick any number" : ""})`}`;
|
|
85
|
+
}),
|
|
86
|
+
`Answer with answer(child: "${who.child}", answers: [{ question, picks }]), one entry per question in its own words. If it is not yours to decide, say so to the owner rather than guessing.`,
|
|
87
|
+
].join("\n");
|
|
88
|
+
|
|
89
|
+
/** A task handed to a linked sandbox stopped on a question over there. */
|
|
90
|
+
export const linkedQuestionWords = (child: string, sandbox: string, questions: readonly NewsQuestion[]): string =>
|
|
91
|
+
[
|
|
92
|
+
`Subagent \`${child}\`, the task you handed to the linked sandbox "${sandbox}", asks:`,
|
|
93
|
+
"",
|
|
94
|
+
...questions.map((entry) => {
|
|
95
|
+
const options = entry.options.map((option) => option.label).join(" / ");
|
|
96
|
+
return options === "" ? `- ${entry.question}` : `- ${entry.question} (${options})`;
|
|
97
|
+
}),
|
|
98
|
+
"",
|
|
99
|
+
`Answer it with answer(child: "${child}"), or send it words with send.`,
|
|
100
|
+
].join("\n");
|
|
101
|
+
|
|
102
|
+
/** Its work reached the main tree. */
|
|
103
|
+
export const landedWords = (who: NewsSubject, repos: readonly string[]): string =>
|
|
104
|
+
`Your subagent ${named(who)} landed in the main tree${repos.length === 0 ? "" : ` (${listed(repos)})`}.`;
|
|
105
|
+
|
|
106
|
+
// Paths a conflict sentence names before counting the rest.
|
|
107
|
+
const PATHS_NAMED = 5;
|
|
108
|
+
|
|
109
|
+
/** The owner's Land on it hit a merge conflict, so nothing of it reached the main tree. */
|
|
110
|
+
export const landConflictWords = (who: NewsSubject, paths: readonly string[]): string =>
|
|
111
|
+
[
|
|
112
|
+
`The owner pressed Land on your subagent ${named(who)}, and it hit a merge conflict${paths.length === 0 ? "" : ` on ${listed(paths, PATHS_NAMED)}`}: nothing of it reached the main tree.`,
|
|
113
|
+
"It lands once its branch is rebased onto the main line and the conflicts are resolved. The owner can have it do that from its card, or you can tell it to; a message you send while another turn runs on it waits for that turn to end.",
|
|
114
|
+
].join(" ");
|
|
115
|
+
|
|
116
|
+
/** Its finished work waits on its branch, and the parent's checkout moved under it; `line` says how. */
|
|
117
|
+
export const driftWords = (who: NewsSubject, line: string): string =>
|
|
118
|
+
`Your subagent ${named(who)} has finished work held on its branch, and your checkout moved under it: ${line} ` +
|
|
119
|
+
`Bring it in now while the clash is small (the merge tool, or \`agents merge ${who.child}\`, with conflict markers to resolve), or send it a message to rebase onto your checkout.`;
|
|
120
|
+
|
|
121
|
+
// THE PARSER. Each sentence is matched whole from its opening: the id, the title where it has one (lazy, so a title
|
|
122
|
+
// holding quotes or brackets still ends where the fixed words after it begin), then what each kind carries.
|
|
123
|
+
const NAME = "`([^`]+)`(?: \\(\"(.*?)\"\\))?";
|
|
124
|
+
const BARE = "`([^`]+)`";
|
|
125
|
+
|
|
126
|
+
interface Reading {
|
|
127
|
+
readonly kind: ChildNewsKind;
|
|
128
|
+
readonly pattern: RegExp;
|
|
129
|
+
// Whether the pattern reads a title after the id: then group 2 is the title and what the kind carries follows.
|
|
130
|
+
readonly titled: boolean;
|
|
131
|
+
readonly carries?: (rest: readonly (string | undefined)[]) => Carried;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
type Carried = Pick<TranscriptChildNews, "runner" | "model" | "cause">;
|
|
135
|
+
|
|
136
|
+
// What a kind carries, each field only where the sentence had it.
|
|
137
|
+
const carried = (fields: { readonly runner?: string | undefined; readonly model?: string | undefined; readonly cause?: string | undefined }): Carried => {
|
|
138
|
+
const kept: Carried = {};
|
|
139
|
+
if (fields.runner !== undefined) {
|
|
140
|
+
kept.runner = fields.runner;
|
|
141
|
+
}
|
|
142
|
+
if (fields.model !== undefined) {
|
|
143
|
+
kept.model = fields.model;
|
|
144
|
+
}
|
|
145
|
+
const cause = fields.cause?.trim();
|
|
146
|
+
if (cause !== undefined && cause !== "") {
|
|
147
|
+
kept.cause = cause;
|
|
148
|
+
}
|
|
149
|
+
return kept;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// The first question a subagent asks, without the options the sentence lists after it.
|
|
153
|
+
const firstQuestion = (prompt: string): Carried =>
|
|
154
|
+
carried({
|
|
155
|
+
cause: prompt
|
|
156
|
+
.split("\n")
|
|
157
|
+
.find((line) => line.startsWith("- "))
|
|
158
|
+
?.slice(2)
|
|
159
|
+
.replace(/ \(options: .*\)$/u, ""),
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const READINGS: readonly Reading[] = [
|
|
163
|
+
{
|
|
164
|
+
kind: "movedHere",
|
|
165
|
+
pattern: new RegExp(`^Your subagent ${NAME} could not start on the runner "([^"]+)": ([\\s\\S]*) It runs here, in this sandbox, instead, and its report reaches you when it ends\\.$`, "u"),
|
|
166
|
+
titled: true,
|
|
167
|
+
carries: ([runner, failure]) => carried({ runner, cause: failure }),
|
|
168
|
+
},
|
|
169
|
+
{ kind: "stopped", pattern: new RegExp(`^Your subagent ${NAME} stays stopped: ([\\s\\S]*)$`, "u"), titled: true, carries: ([why]) => carried({ cause: why }) },
|
|
170
|
+
{ kind: "restarted", pattern: new RegExp(`^Your subagent ${NAME} had not started when the sandbox restarted, so it starts again by itself`, "u"), titled: true },
|
|
171
|
+
{
|
|
172
|
+
kind: "otherModel",
|
|
173
|
+
pattern: new RegExp(`^Your subagent ${NAME} runs this turn on (\\S+), not on (\\S+) as it was spawned:`, "u"),
|
|
174
|
+
titled: true,
|
|
175
|
+
carries: ([served]) => carried({ model: served }),
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
kind: "fellBack",
|
|
179
|
+
pattern: new RegExp(`^Your subagent ${NAME} was refused on (\\S+) and moved itself to (\\S+), the next of the fallbacks you gave it:[\\s\\S]*? The refusal: ([\\s\\S]*)$`, "u"),
|
|
180
|
+
titled: true,
|
|
181
|
+
carries: ([, to, refusal]) => carried({ model: to, cause: refusal }),
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
kind: "working",
|
|
185
|
+
pattern: new RegExp(`^Your subagent ${NAME} is working: ([\\s\\S]*?)\\. Its report reaches you when it ends, like any turn of its`, "u"),
|
|
186
|
+
titled: true,
|
|
187
|
+
carries: ([why]) => carried({ cause: why }),
|
|
188
|
+
},
|
|
189
|
+
{ kind: "notStarted", pattern: new RegExp(`^Your subagent ${BARE} did not start: ([\\s\\S]*)$`, "u"), titled: false, carries: ([why]) => carried({ cause: why }) },
|
|
190
|
+
{ kind: "allowed", pattern: new RegExp(`^The owner allowed your subagent ${BARE} to start\\.`, "u"), titled: false },
|
|
191
|
+
{ kind: "messageLost", pattern: new RegExp(`^Your message to subagent ${BARE} did not go: ([\\s\\S]*)$`, "u"), titled: false, carries: ([why]) => carried({ cause: why }) },
|
|
192
|
+
{ kind: "answerLost", pattern: new RegExp(`^Your answer to subagent ${BARE} did not go: ([\\s\\S]*)$`, "u"), titled: false, carries: ([why]) => carried({ cause: why }) },
|
|
193
|
+
{ kind: "question", pattern: new RegExp(`^Your subagent ${NAME} ${QUESTION_OPENS};`, "u"), titled: true },
|
|
194
|
+
{ kind: "question", pattern: new RegExp(`^Subagent ${BARE}, the task you handed to the linked sandbox "[^"]*", asks:\\n`, "u"), titled: false },
|
|
195
|
+
{ kind: "landed", pattern: new RegExp(`^Your subagent ${NAME} landed in the main tree`, "u"), titled: true },
|
|
196
|
+
{ kind: "landConflict", pattern: new RegExp(`^The owner pressed Land on your subagent ${NAME}, and it hit a merge conflict`, "u"), titled: true },
|
|
197
|
+
{
|
|
198
|
+
kind: "drift",
|
|
199
|
+
pattern: new RegExp(`^Your subagent ${NAME} has finished work held on its branch, and your checkout moved under it: ([\\s\\S]*?) Bring it in now while the clash is small`, "u"),
|
|
200
|
+
titled: true,
|
|
201
|
+
carries: ([line]) => carried({ cause: line }),
|
|
202
|
+
},
|
|
203
|
+
];
|
|
204
|
+
|
|
205
|
+
/** Which subagent news a stored prompt is; undefined for every other prompt. */
|
|
206
|
+
export const childNewsOf = (prompt: string): TranscriptChildNews | undefined => {
|
|
207
|
+
for (const reading of READINGS) {
|
|
208
|
+
const match = reading.pattern.exec(prompt);
|
|
209
|
+
const from = match?.[1];
|
|
210
|
+
if (match === null || from === undefined) {
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
const title = reading.titled ? match[2] : undefined;
|
|
214
|
+
const rest = match.slice(reading.titled ? 3 : 2);
|
|
215
|
+
const news: TranscriptChildNews = { kind: reading.kind, from, sent: prompt };
|
|
216
|
+
if (title !== undefined && title !== "") {
|
|
217
|
+
news.title = title;
|
|
218
|
+
}
|
|
219
|
+
return Object.assign(news, reading.kind === "question" ? firstQuestion(prompt) : reading.carries?.(rest));
|
|
220
|
+
}
|
|
221
|
+
return undefined;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// The row's one line, for a reader with no words of its own for the kind; the prompt itself is disclosed under it.
|
|
225
|
+
const HEADLINE = {
|
|
226
|
+
movedHere: (news) => `could not start on the runner "${news.runner ?? ""}" and runs here instead`,
|
|
227
|
+
stopped: () => "stays stopped",
|
|
228
|
+
restarted: () => "starts again after a restart",
|
|
229
|
+
otherModel: (news) => `runs on ${news.model ?? "another model"}`,
|
|
230
|
+
fellBack: (news) => `moved to ${news.model ?? "its next fallback"}`,
|
|
231
|
+
working: () => "is working again",
|
|
232
|
+
notStarted: () => "did not start",
|
|
233
|
+
allowed: () => "was allowed to start",
|
|
234
|
+
messageLost: () => "did not get a message",
|
|
235
|
+
answerLost: () => "did not get an answer",
|
|
236
|
+
question: () => "asks a question",
|
|
237
|
+
landed: () => "landed",
|
|
238
|
+
landConflict: () => "hit a merge conflict on Land",
|
|
239
|
+
drift: () => "has held work your checkout moved under",
|
|
240
|
+
} as const satisfies Record<ChildNewsKind, (news: TranscriptChildNews) => string>;
|
|
241
|
+
|
|
242
|
+
const headline = (news: TranscriptChildNews): string => {
|
|
243
|
+
const sender = news.title === undefined ? news.from : `"${news.title}" (${news.from})`;
|
|
244
|
+
return `Subagent ${sender} ${HEADLINE[news.kind](news)}.`;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/** News about a subagent is a notice: it is neither this conversation's user nor its agent. */
|
|
248
|
+
export const childNewsRow = (prompt: string): TranscriptRow | undefined => {
|
|
249
|
+
const childNews = childNewsOf(prompt);
|
|
250
|
+
return childNews === undefined ? undefined : { role: "notice", text: headline(childNews), childNews };
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
/** A row recorded before news had a row of its own, as the user's: read as the news it is, keeping its place and its
|
|
254
|
+
* moment. Every other row comes back as it was, the same object. */
|
|
255
|
+
export const asChildNews = (row: TranscriptRow): TranscriptRow => {
|
|
256
|
+
if (row.role !== "user" || row.childNews !== undefined || row.speaker?.kind === "person" || row.speaker?.kind === "program") {
|
|
257
|
+
return row;
|
|
258
|
+
}
|
|
259
|
+
const news = childNewsRow(row.text);
|
|
260
|
+
if (news === undefined) {
|
|
261
|
+
return row;
|
|
262
|
+
}
|
|
263
|
+
const { sentAt, speaker: _speaker, errand: _errand, checkpointId: _checkpoint, rewindIndex: _rewind, ...kept } = row;
|
|
264
|
+
const read: TranscriptRow = { ...kept, ...news };
|
|
265
|
+
if (sentAt !== undefined) {
|
|
266
|
+
read.openedAt = sentAt;
|
|
267
|
+
}
|
|
268
|
+
return read;
|
|
269
|
+
};
|
|
@@ -43,6 +43,41 @@ export const TranscriptAgentWordsSchema = z.object({
|
|
|
43
43
|
});
|
|
44
44
|
export type TranscriptAgentWords = z.infer<typeof TranscriptAgentWordsSchema>;
|
|
45
45
|
|
|
46
|
+
// What the sandbox told a conversation about one of its subagents between the start and the report (child-news.ts): a
|
|
47
|
+
// move, a stop, a restart, a message that did not go. The parent reads it as a prompt; the row keeps that prompt and
|
|
48
|
+
// names the subagent, so a reader never draws it as the owner's own words.
|
|
49
|
+
export const ChildNewsKindSchema = z.enum([
|
|
50
|
+
"movedHere",
|
|
51
|
+
"stopped",
|
|
52
|
+
"restarted",
|
|
53
|
+
"otherModel",
|
|
54
|
+
"fellBack",
|
|
55
|
+
"working",
|
|
56
|
+
"notStarted",
|
|
57
|
+
"allowed",
|
|
58
|
+
"messageLost",
|
|
59
|
+
"answerLost",
|
|
60
|
+
"question",
|
|
61
|
+
"landed",
|
|
62
|
+
"landConflict",
|
|
63
|
+
"drift",
|
|
64
|
+
]);
|
|
65
|
+
export type ChildNewsKind = z.infer<typeof ChildNewsKindSchema>;
|
|
66
|
+
|
|
67
|
+
export const TranscriptChildNewsSchema = z.object({
|
|
68
|
+
kind: ChildNewsKindSchema.describe("What became of the subagent."),
|
|
69
|
+
from: z.string().describe("The subagent's id."),
|
|
70
|
+
title: z.string().optional().describe("The subagent's title, when the news named one."),
|
|
71
|
+
runner: z.string().optional().describe("The runner it could not start on (movedHere)."),
|
|
72
|
+
model: z.string().optional().describe("The model it runs on now, where that is the news (otherModel, fellBack)."),
|
|
73
|
+
cause: z
|
|
74
|
+
.string()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("Why, in the sandbox's own words, where the news says: the same words for every subagent one cause hit, so a reader says it once."),
|
|
77
|
+
sent: z.string().describe("The whole prompt the model received, disclosed under the row."),
|
|
78
|
+
});
|
|
79
|
+
export type TranscriptChildNews = z.infer<typeof TranscriptChildNewsSchema>;
|
|
80
|
+
|
|
46
81
|
// What a user row says the person was looking at when they sent it (the composer's "Viewing" chip): the file and the
|
|
47
82
|
// selected lines, never the selected text, which rode that one prompt and is not worth keeping on every copy of the row.
|
|
48
83
|
export const TranscriptEditorContextSchema = z.object({
|
package/src/events/requests.ts
CHANGED
|
@@ -90,6 +90,10 @@ export const ChildAgentAskSchema = ChildRunSchema.extend({
|
|
|
90
90
|
.describe(
|
|
91
91
|
"What the parent would say to it: the prompt a described start opens on, the message it sends, or the answers it gives. Clipped for the request, with an ellipsis where it was cut.",
|
|
92
92
|
),
|
|
93
|
+
headings: z
|
|
94
|
+
.array(z.string())
|
|
95
|
+
.optional()
|
|
96
|
+
.describe("The section names of the parent's whole words, in order, when they are a document of two sections or more: what the clipped message leaves out still shows by name."),
|
|
93
97
|
on: z.string().optional().describe('Which machine it runs on, when one is named: a runner, or "here" for this sandbox.'),
|
|
94
98
|
proposed: ChildRunSchema.optional().describe(
|
|
95
99
|
"What the agent asked to start it on, when the owner started it on something else instead. Present only once the request has settled that way.",
|
|
@@ -108,6 +112,12 @@ export const PermissionAskSchema = z.object({
|
|
|
108
112
|
description: z.string().optional().describe("More about what it is asking for."),
|
|
109
113
|
// Why the prompt fired ('rule' | 'mode' | 'classifier' | …), shown as the request's muted subline.
|
|
110
114
|
reason: z.string().optional().describe("Why it is asking at all: a rule, the current mode, something that looked risky."),
|
|
115
|
+
// Set where outside content in the turn is the whole reason it asks (the child-agent gate's taint floor), so the card
|
|
116
|
+
// can say that plainly to the owner instead of the agent-facing `reason`.
|
|
117
|
+
outside: z
|
|
118
|
+
.string()
|
|
119
|
+
.optional()
|
|
120
|
+
.describe("What brought outside content into the turn, in the words a person reads, when that alone is why it asks."),
|
|
111
121
|
// The file the request is about, when it is about one, workspace-root-relative.
|
|
112
122
|
path: z.string().optional().describe("Which file it concerns, when it concerns one."),
|
|
113
123
|
alwaysLabel: z
|
|
@@ -116,6 +126,14 @@ export const PermissionAskSchema = z.object({
|
|
|
116
126
|
.describe(
|
|
117
127
|
"The wording for an always-allow answer. Present only when there is something an always could actually remember; without it the only answers are once and no.",
|
|
118
128
|
),
|
|
129
|
+
// A second, lasting yes beside `alwaysLabel`, kept by the card's own gate past this conversation (a host added to a
|
|
130
|
+
// secret's host guard). Answered as `always` with `keep`; a runtime that knows nothing of it never offers it.
|
|
131
|
+
keepLabel: z
|
|
132
|
+
.string()
|
|
133
|
+
.optional()
|
|
134
|
+
.describe(
|
|
135
|
+
"The wording for a lasting answer the card's own gate keeps beyond this conversation, such as adding a host to a secret's host guard. Present only where there is one; only the owner's pick of it is kept, and anyone else's allows this once.",
|
|
136
|
+
),
|
|
119
137
|
alwaysAsks: z
|
|
120
138
|
.literal(true)
|
|
121
139
|
.optional()
|
package/src/events/transcript.ts
CHANGED
|
@@ -8,7 +8,13 @@ import { HeldEndingSchema, MemoryKillMarkSchema, RetryLadderSchema } from "../sc
|
|
|
8
8
|
import { HandoffOfferSchema } from "../schemas/providers/handoff.js";
|
|
9
9
|
import { NoticeCodeSchema } from "./sandbox-notice.js";
|
|
10
10
|
import { TranscriptAgentNoticeSchema } from "./agent-ui.js";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
TranscriptAgentWordsSchema,
|
|
13
|
+
TranscriptChildNewsSchema,
|
|
14
|
+
TranscriptEditorContextSchema,
|
|
15
|
+
TranscriptNeedWakeSchema,
|
|
16
|
+
TranscriptWatchWakeSchema,
|
|
17
|
+
} from "./prompt-origins.js";
|
|
12
18
|
import { ReviewFindingsSchema } from "./review.js";
|
|
13
19
|
import type { ToolCallContent, ToolCallLocation, ToolCallStatus, ToolKind } from "./requests.js";
|
|
14
20
|
import {
|
|
@@ -385,6 +391,9 @@ export const TranscriptRowSchema = z.object({
|
|
|
385
391
|
agentWords: TranscriptAgentWordsSchema.optional().describe(
|
|
386
392
|
"Another agent's words that reached this conversation, whose they are, and the prompt they came as.",
|
|
387
393
|
),
|
|
394
|
+
childNews: TranscriptChildNewsSchema.optional().describe(
|
|
395
|
+
"What the sandbox told this conversation about one of its subagents (a move, a stop, a message that did not go), and the prompt it came as.",
|
|
396
|
+
),
|
|
388
397
|
backgroundJob: TranscriptBackgroundJobSchema.optional().describe("The background job this row marks the start of."),
|
|
389
398
|
// Not a card: a page parks nothing, it is part of what the agent said. On the bubble whose tool call showed it.
|
|
390
399
|
page: PageSchema.optional().describe("A page the agent showed here, drawn inline."),
|
package/src/index.ts
CHANGED
|
@@ -16,7 +16,6 @@ import { basesContract } from "./contracts/bases.contract.js";
|
|
|
16
16
|
import { bookmarksContract } from "./contracts/bookmarks.contract.js";
|
|
17
17
|
import { browserContract } from "./contracts/browser.contract.js";
|
|
18
18
|
import { capabilitiesContract } from "./contracts/capabilities.contract.js";
|
|
19
|
-
import { choresContract } from "./contracts/chores.contract.js";
|
|
20
19
|
import { ciContract } from "./contracts/ci.contract.js";
|
|
21
20
|
import { complianceContract } from "./contracts/compliance.contract.js";
|
|
22
21
|
import { diffContract } from "./contracts/diff.contract.js";
|
|
@@ -26,7 +25,6 @@ import { extensionsContract } from "./contracts/extensions.contract.js";
|
|
|
26
25
|
import { gitContract } from "./contracts/git.contract.js";
|
|
27
26
|
import { historyContract } from "./contracts/history.contract.js";
|
|
28
27
|
import { hubContract } from "./contracts/hub.contract.js";
|
|
29
|
-
import { issuesContract } from "./contracts/issues.contract.js";
|
|
30
28
|
import { logsContract } from "./contracts/logs.contract.js";
|
|
31
29
|
import { loopsContract } from "./contracts/loops.contract.js";
|
|
32
30
|
import { needsContract } from "./contracts/needs.contract.js";
|
|
@@ -52,6 +50,7 @@ import { sessionsContract } from "./contracts/sessions.contract.js";
|
|
|
52
50
|
import { settingsContract } from "./contracts/settings.contract.js";
|
|
53
51
|
import { shareContract } from "./contracts/share.contract.js";
|
|
54
52
|
import { skillsContract } from "./contracts/skills.contract.js";
|
|
53
|
+
import { stackGrantsContract } from "./contracts/stack-grants.contract.js";
|
|
55
54
|
import { systemContract } from "./contracts/system.contract.js";
|
|
56
55
|
import { translatorContract } from "./contracts/translator.contract.js";
|
|
57
56
|
import { usageContract } from "./contracts/usage.contract.js";
|
|
@@ -78,7 +77,6 @@ export const sandboxContract: {
|
|
|
78
77
|
bookmarks: typeof bookmarksContract;
|
|
79
78
|
browser: typeof browserContract;
|
|
80
79
|
capabilities: typeof capabilitiesContract;
|
|
81
|
-
chores: typeof choresContract;
|
|
82
80
|
ci: typeof ciContract;
|
|
83
81
|
compliance: typeof complianceContract;
|
|
84
82
|
diff: typeof diffContract;
|
|
@@ -88,7 +86,6 @@ export const sandboxContract: {
|
|
|
88
86
|
git: typeof gitContract;
|
|
89
87
|
history: typeof historyContract;
|
|
90
88
|
hub: typeof hubContract;
|
|
91
|
-
issues: typeof issuesContract;
|
|
92
89
|
logs: typeof logsContract;
|
|
93
90
|
loops: typeof loopsContract;
|
|
94
91
|
needs: typeof needsContract;
|
|
@@ -114,6 +111,7 @@ export const sandboxContract: {
|
|
|
114
111
|
settings: typeof settingsContract;
|
|
115
112
|
share: typeof shareContract;
|
|
116
113
|
skills: typeof skillsContract;
|
|
114
|
+
stackGrants: typeof stackGrantsContract;
|
|
117
115
|
system: typeof systemContract;
|
|
118
116
|
translator: typeof translatorContract;
|
|
119
117
|
usage: typeof usageContract;
|
|
@@ -134,7 +132,6 @@ export const sandboxContract: {
|
|
|
134
132
|
bookmarks: bookmarksContract,
|
|
135
133
|
browser: browserContract,
|
|
136
134
|
capabilities: capabilitiesContract,
|
|
137
|
-
chores: choresContract,
|
|
138
135
|
ci: ciContract,
|
|
139
136
|
compliance: complianceContract,
|
|
140
137
|
diff: diffContract,
|
|
@@ -144,7 +141,6 @@ export const sandboxContract: {
|
|
|
144
141
|
git: gitContract,
|
|
145
142
|
history: historyContract,
|
|
146
143
|
hub: hubContract,
|
|
147
|
-
issues: issuesContract,
|
|
148
144
|
logs: logsContract,
|
|
149
145
|
loops: loopsContract,
|
|
150
146
|
needs: needsContract,
|
|
@@ -170,6 +166,7 @@ export const sandboxContract: {
|
|
|
170
166
|
settings: settingsContract,
|
|
171
167
|
share: shareContract,
|
|
172
168
|
skills: skillsContract,
|
|
169
|
+
stackGrants: stackGrantsContract,
|
|
173
170
|
system: systemContract,
|
|
174
171
|
translator: translatorContract,
|
|
175
172
|
usage: usageContract,
|
|
@@ -1,15 +1,72 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AgentTurnSchema } from "../schemas/agent.js";
|
|
2
|
+
import {
|
|
3
|
+
contributedModelRole,
|
|
4
|
+
jobFields,
|
|
5
|
+
CORE_MODEL_ROLES,
|
|
6
|
+
EXTENSION_ROLES_BEFORE_CONTRIBUTIONS,
|
|
7
|
+
ModelRoleSchema,
|
|
8
|
+
PRESET_SETUPS,
|
|
9
|
+
ROLES_BEFORE_CONTRIBUTIONS,
|
|
10
|
+
} from "./model-roles.js";
|
|
2
11
|
|
|
3
12
|
// The catalog draws the settings page directly, so its properties must hold of the table itself, not be remembered by
|
|
4
13
|
// whoever adds a row.
|
|
5
14
|
|
|
6
15
|
test("the page reads one-shots first, then whole sessions, in the table's own order", () => {
|
|
7
|
-
const kinds =
|
|
16
|
+
const kinds = CORE_MODEL_ROLES.map((role) => role.kind);
|
|
8
17
|
|
|
9
18
|
expect(kinds.indexOf(`run`)).toBe(kinds.lastIndexOf(`helper`) + 1);
|
|
10
19
|
});
|
|
11
20
|
|
|
12
21
|
test("every job is suggested a preset, and the cheap one is never suggested for a whole session", () => {
|
|
13
|
-
expect(
|
|
14
|
-
expect(new Set<string>(
|
|
22
|
+
expect(CORE_MODEL_ROLES.every((role) => PRESET_SETUPS.includes(role.setup))).toBe(true);
|
|
23
|
+
expect(new Set<string>(CORE_MODEL_ROLES.filter((role) => role.kind === `run`).map((role) => role.setup)).has(`low`)).toBe(false);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// (2026-11-26) Six jobs left the table for their extensions' manifests; what a daemon from before served stays readable.
|
|
27
|
+
describe(`jobs extensions declare`, () => {
|
|
28
|
+
test(`a job's id is any lowercase dashed word, so an extension's reads wherever a job is named`, () => {
|
|
29
|
+
expect(ModelRoleSchema.safeParse(`pipeline-fix`).success).toBe(true);
|
|
30
|
+
expect(ModelRoleSchema.safeParse(`saldeo-reconcile`).success).toBe(true);
|
|
31
|
+
expect(ModelRoleSchema.safeParse(`Pipeline fix`).success).toBe(false);
|
|
32
|
+
expect(ModelRoleSchema.safeParse(``).success).toBe(false);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test(`none of the six is the sandbox's own any more, and the table of before still lists every job in its order`, () => {
|
|
36
|
+
const moved: readonly string[] = EXTENSION_ROLES_BEFORE_CONTRIBUTIONS.map((role) => role.id);
|
|
37
|
+
expect(moved).toEqual([`pipeline-fix`, `deployment-fix`, `maintenance-chore`, `refactor-run`, `documentation-run`, `acceptance-run`]);
|
|
38
|
+
expect(CORE_MODEL_ROLES.filter((role) => moved.includes(role.id))).toEqual([]);
|
|
39
|
+
expect(ROLES_BEFORE_CONTRIBUTIONS.map((role) => role.id).toSorted()).toEqual([...CORE_MODEL_ROLES.map((role) => role.id), ...moved].toSorted());
|
|
40
|
+
expect(ROLES_BEFORE_CONTRIBUTIONS.slice(8, 11).map((role) => role.id)).toEqual([`pipeline-fix`, `deployment-fix`, `workflow-fix`]);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test(`a declaration is served as a whole session, suggested medium and drawn with a wrench unless it says otherwise`, () => {
|
|
44
|
+
expect(contributedModelRole({ id: `nightly-audit`, label: `Nightly audits`, explanation: `The audit run each night.` }, `acme.audit`, false)).toEqual({
|
|
45
|
+
id: `nightly-audit`,
|
|
46
|
+
label: `Nightly audits`,
|
|
47
|
+
blurb: `The audit run each night.`,
|
|
48
|
+
kind: `run`,
|
|
49
|
+
icon: `wrench`,
|
|
50
|
+
setup: `medium`,
|
|
51
|
+
extension: `acme.audit`,
|
|
52
|
+
enabled: false,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// `runRole` stays the closed list every daemon reads, so it never shrinks for a far end still reading it; an extension's
|
|
58
|
+
// job travels as `job`, which a daemon from before ignores.
|
|
59
|
+
describe(`how a turn names its job`, () => {
|
|
60
|
+
test(`one every daemon knows rides as runRole, any other as job`, () => {
|
|
61
|
+
expect(jobFields(`maintenance-chore`)).toEqual({ runRole: `maintenance-chore` });
|
|
62
|
+
expect(jobFields(`loop-iteration`)).toEqual({ runRole: `loop-iteration` });
|
|
63
|
+
expect(jobFields(`nightly-audit`)).toEqual({ job: `nightly-audit` });
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test(`runRole takes only the closed list, job any job's id`, () => {
|
|
67
|
+
expect(AgentTurnSchema.safeParse({ prompt: `go`, runRole: `pipeline-fix` }).success).toBe(true);
|
|
68
|
+
expect(AgentTurnSchema.safeParse({ prompt: `go`, runRole: `nightly-audit` }).success).toBe(false);
|
|
69
|
+
expect(AgentTurnSchema.parse({ prompt: `go`, job: `nightly-audit` }).job).toBe(`nightly-audit`);
|
|
70
|
+
expect(AgentTurnSchema.safeParse({ prompt: `go`, job: `Nightly audit` }).success).toBe(false);
|
|
71
|
+
});
|
|
15
72
|
});
|