@intentic/sandbox-contract 1.345.0 → 1.346.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 +26 -14
- package/dist/contracts/accounts.contract.d.ts +0 -80
- package/dist/contracts/accounts.contract.d.ts.map +1 -1
- package/dist/contracts/agent.contract.d.ts +33 -2
- package/dist/contracts/agent.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.d.ts +910 -29
- package/dist/contracts/agents.contract.d.ts.map +1 -1
- package/dist/contracts/agents.contract.js +43 -2
- package/dist/contracts/agents.contract.js.map +1 -1
- package/dist/contracts/device.contract.d.ts +2 -1
- package/dist/contracts/device.contract.d.ts.map +1 -1
- package/dist/contracts/endpoints.contract.d.ts +0 -1
- package/dist/contracts/endpoints.contract.d.ts.map +1 -1
- package/dist/contracts/providers.contract.d.ts +0 -1
- package/dist/contracts/providers.contract.d.ts.map +1 -1
- package/dist/contracts/runner.contract.d.ts +134 -123
- package/dist/contracts/runner.contract.d.ts.map +1 -1
- package/dist/contracts/settings.contract.d.ts +4 -0
- package/dist/contracts/settings.contract.d.ts.map +1 -1
- package/dist/contracts/system.contract.d.ts +102 -1
- package/dist/contracts/system.contract.d.ts.map +1 -1
- package/dist/contracts/translator.contract.d.ts +0 -80
- package/dist/contracts/translator.contract.d.ts.map +1 -1
- package/dist/events/agent-events.d.ts +43 -0
- package/dist/events/agent-events.d.ts.map +1 -1
- package/dist/events/agent-events.js +42 -37
- package/dist/events/agent-events.js.map +1 -1
- package/dist/events/failure-rows.d.ts +14 -0
- package/dist/events/failure-rows.d.ts.map +1 -0
- package/dist/events/failure-rows.js +109 -0
- package/dist/events/failure-rows.js.map +1 -0
- package/dist/events/sandbox-notice.d.ts +16 -0
- package/dist/events/sandbox-notice.d.ts.map +1 -1
- package/dist/events/sandbox-notice.js +1 -0
- package/dist/events/sandbox-notice.js.map +1 -1
- package/dist/events/system-events.d.ts +68 -0
- package/dist/events/system-events.d.ts.map +1 -1
- package/dist/events/system-events.js +7 -1
- package/dist/events/system-events.js.map +1 -1
- package/dist/index.d.ts +1158 -303
- package/dist/index.d.ts.map +1 -1
- package/dist/models/agent-lanes.d.ts.map +1 -1
- package/dist/models/agent-lanes.js +3 -5
- package/dist/models/agent-lanes.js.map +1 -1
- package/dist/models/agent-standing.d.ts +3 -20
- package/dist/models/agent-standing.d.ts.map +1 -1
- package/dist/models/agent-standing.js +12 -37
- package/dist/models/agent-standing.js.map +1 -1
- package/dist/models/model-pins.d.ts +3 -0
- package/dist/models/model-pins.d.ts.map +1 -1
- package/dist/models/model-pins.js +2 -0
- package/dist/models/model-pins.js.map +1 -1
- package/dist/models/plan-pools.d.ts +23 -5
- package/dist/models/plan-pools.d.ts.map +1 -1
- package/dist/models/plan-pools.js +116 -33
- package/dist/models/plan-pools.js.map +1 -1
- package/dist/protocol/doors/runner-protocol.d.ts +1 -0
- package/dist/protocol/doors/runner-protocol.d.ts.map +1 -1
- package/dist/protocol/doors/runner-protocol.js +1 -0
- package/dist/protocol/doors/runner-protocol.js.map +1 -1
- package/dist/protocol/raw/raw-json-routes.d.ts +3 -1
- package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-routes.d.ts +4 -0
- package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
- package/dist/protocol/raw/raw-routes.js +1 -0
- package/dist/protocol/raw/raw-routes.js.map +1 -1
- package/dist/schemas/agent-next.d.ts +21 -0
- package/dist/schemas/agent-next.d.ts.map +1 -0
- package/dist/schemas/agent-next.js +21 -0
- package/dist/schemas/agent-next.js.map +1 -0
- package/dist/schemas/agent-search.d.ts +45 -0
- package/dist/schemas/agent-search.d.ts.map +1 -0
- package/dist/schemas/agent-search.js +28 -0
- package/dist/schemas/agent-search.js.map +1 -0
- package/dist/schemas/agent.d.ts +9 -0
- package/dist/schemas/agent.d.ts.map +1 -1
- package/dist/schemas/agent.js +14 -10
- package/dist/schemas/agent.js.map +1 -1
- package/dist/schemas/agents-list.d.ts +16 -0
- package/dist/schemas/agents-list.d.ts.map +1 -1
- package/dist/schemas/agents.d.ts +48 -43
- package/dist/schemas/agents.d.ts.map +1 -1
- package/dist/schemas/agents.js +10 -33
- package/dist/schemas/agents.js.map +1 -1
- package/dist/schemas/compose-overlay.d.ts +9 -0
- package/dist/schemas/compose-overlay.d.ts.map +1 -0
- package/dist/schemas/compose-overlay.js +11 -0
- package/dist/schemas/compose-overlay.js.map +1 -0
- package/dist/schemas/composer-drafts.d.ts +169 -0
- package/dist/schemas/composer-drafts.d.ts.map +1 -0
- package/dist/schemas/composer-drafts.js +60 -0
- package/dist/schemas/composer-drafts.js.map +1 -0
- package/dist/schemas/device-commands.d.ts +63 -0
- package/dist/schemas/device-commands.d.ts.map +1 -0
- package/dist/schemas/device-commands.js +42 -0
- package/dist/schemas/device-commands.js.map +1 -0
- package/dist/schemas/device-folder.d.ts +11 -0
- package/dist/schemas/device-folder.d.ts.map +1 -1
- package/dist/schemas/device-folder.js +1 -0
- package/dist/schemas/device-folder.js.map +1 -1
- package/dist/schemas/devices.d.ts +14 -67
- package/dist/schemas/devices.d.ts.map +1 -1
- package/dist/schemas/devices.js +7 -45
- package/dist/schemas/devices.js.map +1 -1
- package/dist/schemas/environment.d.ts.map +1 -1
- package/dist/schemas/environment.js.map +1 -1
- package/dist/schemas/hosts.d.ts +27 -0
- package/dist/schemas/hosts.d.ts.map +1 -1
- package/dist/schemas/hosts.js +21 -0
- package/dist/schemas/hosts.js.map +1 -1
- package/dist/schemas/privacy-egress.d.ts +41 -0
- package/dist/schemas/privacy-egress.d.ts.map +1 -0
- package/dist/schemas/privacy-egress.js +30 -0
- package/dist/schemas/privacy-egress.js.map +1 -0
- package/dist/schemas/privacy.d.ts +1 -0
- package/dist/schemas/privacy.d.ts.map +1 -1
- package/dist/schemas/privacy.js +1 -0
- package/dist/schemas/privacy.js.map +1 -1
- package/dist/schemas/providers/plan-limits.d.ts +2 -130
- package/dist/schemas/providers/plan-limits.d.ts.map +1 -1
- package/dist/schemas/providers/plan-limits.js +5 -23
- package/dist/schemas/providers/plan-limits.js.map +1 -1
- package/dist/schemas/providers/provider-oauth.d.ts +0 -82
- package/dist/schemas/providers/provider-oauth.d.ts.map +1 -1
- package/dist/schemas/providers/provider-oauth.js +1 -6
- package/dist/schemas/providers/provider-oauth.js.map +1 -1
- package/dist/schemas/providers/refusals.d.ts +64 -0
- package/dist/schemas/providers/refusals.d.ts.map +1 -0
- package/dist/schemas/providers/refusals.js +33 -0
- package/dist/schemas/providers/refusals.js.map +1 -0
- package/dist/schemas/sessions.js +1 -1
- package/dist/schemas/sessions.js.map +1 -1
- package/dist/schemas/settings.d.ts +4 -0
- package/dist/schemas/settings.d.ts.map +1 -1
- package/dist/schemas/settings.js +2 -0
- package/dist/schemas/settings.js.map +1 -1
- package/dist/schemas/system.d.ts +16 -0
- package/dist/schemas/system.d.ts.map +1 -1
- package/dist/schemas/system.js +11 -0
- package/dist/schemas/system.js.map +1 -1
- package/dist/state/definition.d.ts +8 -0
- package/dist/state/definition.d.ts.map +1 -1
- package/dist/state/runtime-state.d.ts +3 -0
- package/dist/state/runtime-state.d.ts.map +1 -1
- package/dist/state/runtime-state.js +1 -0
- package/dist/state/runtime-state.js.map +1 -1
- package/dist/state/sandbox-build.d.ts +20 -0
- package/dist/state/sandbox-build.d.ts.map +1 -0
- package/dist/state/sandbox-build.js +43 -0
- package/dist/state/sandbox-build.js.map +1 -0
- package/dist/state/ways-back.d.ts +4 -0
- package/dist/state/ways-back.d.ts.map +1 -0
- package/dist/state/ways-back.js +8 -0
- package/dist/state/ways-back.js.map +1 -0
- package/dist/text/land-rows.d.ts +14 -0
- package/dist/text/land-rows.d.ts.map +1 -0
- package/dist/text/land-rows.js +86 -0
- package/dist/text/land-rows.js.map +1 -0
- package/dist/text/transcript-fold.d.ts +4 -2
- package/dist/text/transcript-fold.d.ts.map +1 -1
- package/dist/text/transcript-fold.js +21 -187
- package/dist/text/transcript-fold.js.map +1 -1
- package/package.json +6 -6
- package/src/contracts/agents.contract.ts +49 -25
- package/src/events/agent-events.ts +95 -78
- package/src/events/failure-rows.ts +148 -0
- package/src/events/sandbox-notice.ts +11 -2
- package/src/events/system-events.ts +14 -4
- package/src/ids/project-dir.test.ts +2 -2
- package/src/ids/project-dir.ts +4 -4
- package/src/models/agent-lanes.ts +7 -21
- package/src/models/agent-runtimes.ts +2 -2
- package/src/models/agent-standing.ts +31 -96
- package/src/models/model-pins.test.ts +31 -1
- package/src/models/model-pins.ts +17 -0
- package/src/models/plan-pools.test.ts +159 -24
- package/src/models/plan-pools.ts +215 -83
- package/src/protocol/doors/runner-protocol.ts +4 -1
- package/src/protocol/raw/raw-routes.ts +1 -0
- package/src/schemas/agent-next.ts +34 -0
- package/src/schemas/agent-search.ts +51 -0
- package/src/schemas/agent.ts +21 -12
- package/src/schemas/agents.ts +24 -63
- package/src/schemas/compose-overlay.test.ts +35 -0
- package/src/schemas/compose-overlay.ts +19 -0
- package/src/schemas/composer-drafts.ts +86 -0
- package/src/schemas/device-commands.ts +89 -0
- package/src/schemas/device-folder.ts +9 -0
- package/src/schemas/devices.ts +24 -106
- package/src/schemas/environment.ts +8 -9
- package/src/schemas/hosts.ts +56 -0
- package/src/schemas/machine-presence.test.ts +33 -0
- package/src/schemas/privacy-egress.test.ts +83 -0
- package/src/schemas/privacy-egress.ts +86 -0
- package/src/schemas/privacy.ts +4 -0
- package/src/schemas/project-delivery.ts +1 -1
- package/src/schemas/providers/plan-limits.test.ts +16 -0
- package/src/schemas/providers/plan-limits.ts +8 -49
- package/src/schemas/providers/provider-oauth.ts +1 -13
- package/src/schemas/providers/refusals.ts +62 -0
- package/src/schemas/sessions.ts +1 -1
- package/src/schemas/settings.ts +2 -0
- package/src/schemas/system.ts +15 -0
- package/src/state/runtime-state.ts +5 -0
- package/src/state/sandbox-build.test.ts +95 -0
- package/src/state/sandbox-build.ts +96 -0
- package/src/state/ways-back.test.ts +36 -0
- package/src/state/ways-back.ts +19 -0
- package/src/state/workspace-state.ts +1 -1
- package/src/text/land-rows.ts +111 -0
- package/src/text/transcript-fold.test.ts +38 -9
- package/src/text/transcript-fold.ts +30 -232
- package/dist/events/undelivered.d.ts +0 -10
- package/dist/events/undelivered.d.ts.map +0 -1
- package/dist/events/undelivered.js +0 -22
- package/dist/events/undelivered.js.map +0 -1
- package/dist/state/history-state.d.ts +0 -3
- package/dist/state/history-state.d.ts.map +0 -1
- package/dist/state/history-state.js +0 -153
- package/dist/state/history-state.js.map +0 -1
- package/src/events/undelivered.ts +0 -33
- package/src/state/history-state.ts +0 -313
|
@@ -15,12 +15,13 @@ import { contextTrimLine, contextTrimNotice } from "../schemas/context-trim.js";
|
|
|
15
15
|
import { keptWarmLine, keptWarmNotice } from "../schemas/keep-warm.js";
|
|
16
16
|
import { handedOffLine, handedOffNotice } from "../schemas/providers/handoff.js";
|
|
17
17
|
import { isLandConflict } from "../events/land-conflict.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { turnedAwayCode } from "../policy/turned-away.js";
|
|
19
|
+
import { errorRow, RENEWAL_WITHDRAWN, RENEWING } from "../events/failure-rows.js";
|
|
20
20
|
import { mentionedPathTokens } from "./mentions.js";
|
|
21
21
|
import { unspokenPromptRow } from "../events/agent-words.js";
|
|
22
22
|
import { needRowText } from "../events/need-wake.js";
|
|
23
23
|
import { noticeCode, sandboxNoticeOf } from "../events/sandbox-notice.js";
|
|
24
|
+
import { installRow, landedRow, syncLine } from "./land-rows.js";
|
|
24
25
|
|
|
25
26
|
// Folds a turn's frames into rows once, live and for the settled record alike, so a reopened chat matches what was on
|
|
26
27
|
// screen. The main turn's frames are its rows; a frame a subagent produced (tagged with the call that spawned it) nests
|
|
@@ -89,222 +90,6 @@ const empty = (row: TranscriptRow): boolean =>
|
|
|
89
90
|
row.usage === undefined &&
|
|
90
91
|
!holdsRequest(row);
|
|
91
92
|
|
|
92
|
-
// Clause appended to the landed notice for a workspace dependency change, or empty when there is none. Reports the
|
|
93
|
-
// install as already started, or as on its way: the daemon starts it within seconds, in the install lane, behind any
|
|
94
|
-
// install already running; never as a request.
|
|
95
|
-
const dependencyLine = (deps: { missing: number; started: string[]; deferred: boolean } | undefined): string => {
|
|
96
|
-
if (deps === undefined || deps.missing === 0) {
|
|
97
|
-
return ``;
|
|
98
|
-
}
|
|
99
|
-
// `missing` counts versions the turn bumped as well as names it added, so the sentence names both.
|
|
100
|
-
const what = `${deps.missing} ${deps.missing === 1 ? `dependency` : `dependencies`} it added or changed`;
|
|
101
|
-
return deps.deferred
|
|
102
|
-
? ` ${what} ${deps.missing === 1 ? `is` : `are`} being installed in your tree: the install waits for any other install to finish, appears in Work terminals, and its outcome lands in Activity.`
|
|
103
|
-
: ` Installing ${what}; the project's checks run when that finishes, and the outcome lands in Activity.`;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
// Said as an agent's own install starts: where it writes and what outlasts it. Names up to three projects, the workspace
|
|
107
|
-
// root first; an install the gate could not place in a project says only where it writes. Coded like every sandbox
|
|
108
|
-
// notice (sandbox-notice.ts `installing`), so the chat can say it in the reader's language.
|
|
109
|
-
const INSTALL_NAMED = 3;
|
|
110
|
-
const installRow = (event: { readonly reach: "own-copy" | "main-tree"; readonly projects: readonly string[] }): TranscriptRow => {
|
|
111
|
-
const root = event.projects.includes(``);
|
|
112
|
-
const dirs = event.projects.filter((dir) => dir !== ``).map((dir) => `${dir}/`);
|
|
113
|
-
const shownDirs = dirs.slice(0, INSTALL_NAMED - (root ? 1 : 0));
|
|
114
|
-
const more = dirs.length - shownDirs.length;
|
|
115
|
-
const named = [...(root ? [`the workspace root`] : []), ...shownDirs].join(`, `);
|
|
116
|
-
const list = more > 0 ? `${named} and ${more} more` : named;
|
|
117
|
-
const where = list === `` ? `` : ` in ${list}`;
|
|
118
|
-
const ownCopy = event.reach === `own-copy`;
|
|
119
|
-
return {
|
|
120
|
-
role: "notice",
|
|
121
|
-
text: ownCopy
|
|
122
|
-
? `Installing packages${where} into this conversation's own copy. The manifest and lockfile land with the work, and the review lists what it adds.`
|
|
123
|
-
: `Installing packages${where} in the main tree, one install at a time.`,
|
|
124
|
-
noticeCode: noticeCode({
|
|
125
|
-
code: "installing",
|
|
126
|
-
params: {
|
|
127
|
-
ownCopy,
|
|
128
|
-
root: root || undefined,
|
|
129
|
-
projects: shownDirs.length === 0 ? undefined : shownDirs.join(`, `),
|
|
130
|
-
more: more > 0 ? more : undefined,
|
|
131
|
-
},
|
|
132
|
-
}),
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
// One line reporting the daemon's rebase of this agent's branch onto the current workspace; `blocked` names repos it
|
|
137
|
-
// couldn't rebase, where the turn ran from an older base.
|
|
138
|
-
const syncLine = (sync: { commits: number; blocked: readonly string[] }): string => {
|
|
139
|
-
const moved =
|
|
140
|
-
sync.commits > 0
|
|
141
|
-
? `Your workspace moved on while this agent waited, its branch was rebased onto your latest ${sync.commits} commit${sync.commits === 1 ? `` : `s`}.`
|
|
142
|
-
: undefined;
|
|
143
|
-
const blocked =
|
|
144
|
-
sync.blocked.length > 0
|
|
145
|
-
? `Couldn't rebase onto your workspace in ${sync.blocked.join(`, `)}: the turn is running from the older base, so its land may need a resolve.`
|
|
146
|
-
: undefined;
|
|
147
|
-
return [moved, blocked].filter((line) => line !== undefined).join(` `);
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
// Row for a spawned child's work gone into its parent's checkout, or held off it by a clash with the parent's edits.
|
|
151
|
-
const intoParentRow = (event: Extract<AgentEvent, { kind: "landed" }>): TranscriptRow => {
|
|
152
|
-
if (event.landed) {
|
|
153
|
-
return {
|
|
154
|
-
role: "notice",
|
|
155
|
-
text: `Changes went into the parent agent's checkout, as its in-process subagents' edits do: they reach your workspace with its land.`,
|
|
156
|
-
noticeCode: noticeCode({ code: "intoParent" }),
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
const files = (event.conflicts ?? []).flatMap((conflict) => conflict.paths).length;
|
|
160
|
-
return {
|
|
161
|
-
role: "notice",
|
|
162
|
-
text: `${files} file(s) clash with the parent agent's own edits, so nothing was written into its checkout. The parent was told, and can bring the changes in to resolve.`,
|
|
163
|
-
noticeCode: noticeCode({ code: "intoParentClash", params: { files } }),
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// Row for a finished turn: held on its branch, landed automatically, or conflicted. A landed turn that changed
|
|
168
|
-
// dependencies appends dependencyLine, since the Changes diff can't show that.
|
|
169
|
-
const landedRow = (event: Extract<AgentEvent, { kind: "landed" }>): TranscriptRow => {
|
|
170
|
-
if (event.into !== undefined) {
|
|
171
|
-
return intoParentRow(event);
|
|
172
|
-
}
|
|
173
|
-
if (event.held === true) {
|
|
174
|
-
return { role: "notice", text: `Finished: the work is on this agent's branch, ready to land from its review.`, noticeCode: noticeCode({ code: "landHeld" }) };
|
|
175
|
-
}
|
|
176
|
-
if (!event.landed) {
|
|
177
|
-
// Per-file cause (your edits, a moved main line, a binary) is spelled out in the review, not named here.
|
|
178
|
-
const conflicts = event.conflicts ?? [];
|
|
179
|
-
const files = conflicts.flatMap((conflict) => conflict.paths).length;
|
|
180
|
-
const repos = conflicts.map((conflict) => conflict.repo).join(`, `);
|
|
181
|
-
return {
|
|
182
|
-
role: "notice",
|
|
183
|
-
text: `${files} file(s) couldn't land automatically in ${repos}. Open the agent's review to see what blocked them and land from there.`,
|
|
184
|
-
noticeCode: noticeCode({ code: "landConflict", params: { files, repos } }),
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
// noticeAction fires only here, right as the auto-behavior ran; an active install takes the slot instead.
|
|
188
|
-
const deps = event.deps === undefined || event.deps.missing === 0 ? undefined : event.deps;
|
|
189
|
-
return {
|
|
190
|
-
role: "notice",
|
|
191
|
-
text: `Changes landed in your workspace: review them in the Changes panel.${dependencyLine(event.deps)}`,
|
|
192
|
-
noticeAction: (event.deps?.started.length ?? 0) > 0 ? "depsInstall" : "landHold",
|
|
193
|
-
noticeCode: noticeCode({ code: "landed", params: deps === undefined ? undefined : { deps: deps.missing, queued: deps.deferred || undefined } }),
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
// A failure's own sentence and code, which every coded error row carries ahead of what it adds.
|
|
198
|
-
const failureOf = (event: Extract<AgentEvent, { kind: "error" }>): { message: string; error?: string } =>
|
|
199
|
-
event.code === undefined ? { message: event.message } : { message: event.message, error: event.code };
|
|
200
|
-
|
|
201
|
-
// The press a memory hold offers: the raise rides along only when the hold carried a ceiling to size it by, since a
|
|
202
|
-
// stall names none and raising one would not clear it.
|
|
203
|
-
const memoryPress = (event: Extract<AgentEvent, { kind: "error" }>): "sendAnyway" | "sandboxMemory" =>
|
|
204
|
-
event.memory === undefined ? "sendAnyway" : "sandboxMemory";
|
|
205
|
-
|
|
206
|
-
// A memory hold is asked once and never again that spell (resource-budget.ts), so the next send always runs. A turn the
|
|
207
|
-
// sandbox started itself (a fix press, a peer's message, a re-run) was never in a composer: its message stays above, and
|
|
208
|
-
// the press asks the sandbox to run the turn it kept rather than sending a queue that holds nothing.
|
|
209
|
-
const heldRow = (event: Extract<AgentEvent, { kind: "error" }>): TranscriptRow => {
|
|
210
|
-
const unattended = event.unattended === true;
|
|
211
|
-
const memory = event.code === "sandbox-memory-low";
|
|
212
|
-
const said = failureOf(event);
|
|
213
|
-
if (event.held !== undefined && !unattended) {
|
|
214
|
-
return {
|
|
215
|
-
role: "notice",
|
|
216
|
-
text: memory
|
|
217
|
-
? `${event.message} Nothing has run yet: the message above is kept here, and sending it anyway starts it.`
|
|
218
|
-
: `${event.message} Nothing has run yet: the message above is kept here to send again once that is sorted.`,
|
|
219
|
-
noticeAction: memory ? memoryPress(event) : "sendAgain",
|
|
220
|
-
sandboxHeld: true,
|
|
221
|
-
noticeCode: noticeCode({ code: "kept", params: { ...said, memory: memory || undefined } }),
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
if (!memory || unattended) {
|
|
225
|
-
return undeliveredRow(said, unattended);
|
|
226
|
-
}
|
|
227
|
-
return {
|
|
228
|
-
role: "notice",
|
|
229
|
-
text: `${event.message} Your message is held: send it again to start anyway.`,
|
|
230
|
-
noticeAction: memoryPress(event),
|
|
231
|
-
noticeCode: noticeCode({ code: "memoryHeld", params: said }),
|
|
232
|
-
};
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
// What an armed credential renewal promises, and what its row says instead once a later failure in the same run took
|
|
236
|
-
// that promise back (TranscriptFold.withdrawRenewal).
|
|
237
|
-
const RENEWING = "The credential is being renewed and this turn continues automatically.";
|
|
238
|
-
const RENEWAL_WITHDRAWN =
|
|
239
|
-
"The credential was being renewed, but the turn stopped before it could continue: it will not carry on by itself, so press Continue to pick it back up.";
|
|
240
|
-
|
|
241
|
-
// Row for a turn-ending error: the provider's own message plus one clause on what happens next. The live wait itself is
|
|
242
|
-
// drawn by the chat, not stored here. `ran`: an assistant row stands, so a door refusal stopped the turn partway.
|
|
243
|
-
const errorRow = (event: Extract<AgentEvent, { kind: "error" }>, ran: boolean): TranscriptRow => {
|
|
244
|
-
const { message, code } = event;
|
|
245
|
-
const said = failureOf(event);
|
|
246
|
-
switch (code) {
|
|
247
|
-
case "provider-outage": {
|
|
248
|
-
const retry = retryClause(event);
|
|
249
|
-
return retry === undefined
|
|
250
|
-
? {
|
|
251
|
-
role: "notice",
|
|
252
|
-
text: `${message} Nothing is retrying it, so the turn is waiting here.`,
|
|
253
|
-
noticeCode: noticeCode({ code: "outageWaiting", params: said }),
|
|
254
|
-
}
|
|
255
|
-
: { role: "notice", text: `${message} ${retry.text}`, noticeCode: retry.code };
|
|
256
|
-
}
|
|
257
|
-
case "claude-token-refused":
|
|
258
|
-
return event.autoResume === "scheduled"
|
|
259
|
-
? {
|
|
260
|
-
role: "notice",
|
|
261
|
-
text: `${message} ${RENEWING}`,
|
|
262
|
-
noticeWait: "credentialRenewal",
|
|
263
|
-
noticeCode: noticeCode({ code: "renewing", params: said }),
|
|
264
|
-
}
|
|
265
|
-
: {
|
|
266
|
-
role: "notice",
|
|
267
|
-
text: `${message} Reconnect the account to pick this conversation back up.`,
|
|
268
|
-
noticeCode: noticeCode({ code: "reconnect", params: said }),
|
|
269
|
-
};
|
|
270
|
-
case "rate_limit":
|
|
271
|
-
return { role: "notice", text: message };
|
|
272
|
-
default:
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
if (!turnedAwayCode(code)) {
|
|
276
|
-
const retry = retryClause(event);
|
|
277
|
-
if (retry !== undefined) {
|
|
278
|
-
return { role: "notice", text: `${message} ${retry.text}`, noticeCode: retry.code };
|
|
279
|
-
}
|
|
280
|
-
// A failure the sandbox names by code is coded too, so a reader that words that failure itself can; the
|
|
281
|
-
// provider's own uncoded words are only ever themselves.
|
|
282
|
-
return code === undefined ? { role: "notice", text: message } : { role: "notice", text: message, noticeCode: noticeCode({ code: "failed", params: said }) };
|
|
283
|
-
}
|
|
284
|
-
return ran && event.held === undefined ? stoppedPartwayRow(said, anotherModelClears(code)) : heldRow(event);
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
// What a laddered wall's automatic re-runs are doing, said on the failure's own row so the count stays in the record.
|
|
288
|
-
const retryClause = (event: Extract<AgentEvent, { kind: "error" }>): { text: string; code: NonNullable<TranscriptRow["noticeCode"]> } | undefined => {
|
|
289
|
-
const { retries } = event;
|
|
290
|
-
if (retries === undefined) {
|
|
291
|
-
return undefined;
|
|
292
|
-
}
|
|
293
|
-
const said = failureOf(event);
|
|
294
|
-
if (event.autoResume === "scheduled") {
|
|
295
|
-
return {
|
|
296
|
-
text: `Retrying by itself: attempt ${retries.made + 1} of ${retries.max}.`,
|
|
297
|
-
code: noticeCode({ code: "retrying", params: { ...said, attempt: retries.made + 1, of: retries.max } }),
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
return retries.made >= retries.max
|
|
301
|
-
? {
|
|
302
|
-
text: `Retried ${retries.made} of ${retries.max} times by itself; nothing more is sent automatically.`,
|
|
303
|
-
code: noticeCode({ code: "retried", params: { ...said, made: retries.made, of: retries.max } }),
|
|
304
|
-
}
|
|
305
|
-
: undefined;
|
|
306
|
-
};
|
|
307
|
-
|
|
308
93
|
// The turn's opening user row: text, timestamp, attachments, the message's id, and whatever the daemon later stamps onto
|
|
309
94
|
// it (checkpoint, notes).
|
|
310
95
|
export const userRow = (text: string, sentAt: number, attachments: readonly string[], messageId?: string): TranscriptRow => {
|
|
@@ -926,36 +711,49 @@ export const foldTurn = (opening: readonly TranscriptRow[], events: readonly Age
|
|
|
926
711
|
return fold.rows;
|
|
927
712
|
};
|
|
928
713
|
|
|
714
|
+
// A patch that changes the row it names, rather than adding one or taking one away.
|
|
715
|
+
export type RowPatch = Exclude<TranscriptPatch, { op: "append" | "drop" }>;
|
|
716
|
+
|
|
929
717
|
/**
|
|
930
|
-
*
|
|
931
|
-
*
|
|
718
|
+
* What one patch makes of the row it names: the one rule every copy of a run's rows follows (a window drawing the run,
|
|
719
|
+
* the run log a restart folds back, this module's own replay), so no copy can draw a change its own way. `tool` upserts
|
|
720
|
+
* by id anywhere in the tree, top-level or nested alike. Every field the patch does not name is kept, a window's own
|
|
721
|
+
* marks on the row included; `replace` is the row whole.
|
|
932
722
|
*/
|
|
933
|
-
export const
|
|
723
|
+
export const patchedRow = <R extends TranscriptRow>(row: R, patch: RowPatch): R | TranscriptRow => {
|
|
934
724
|
switch (patch.op) {
|
|
935
|
-
case "append":
|
|
936
|
-
return [...rows, patch.row];
|
|
937
725
|
case "replace":
|
|
938
|
-
return
|
|
939
|
-
case "drop":
|
|
940
|
-
return rows.filter((_row, index) => index !== patch.index);
|
|
726
|
+
return patch.row;
|
|
941
727
|
case "text":
|
|
942
|
-
return
|
|
728
|
+
return { ...row, text: `${row.text}${patch.text}` };
|
|
943
729
|
case "thinking":
|
|
944
|
-
return
|
|
730
|
+
return { ...row, thinking: `${row.thinking ?? ""}${patch.text}` };
|
|
945
731
|
case "toolThinking":
|
|
946
|
-
return
|
|
732
|
+
return { ...row, tools: [...appendToolThinking(row.tools ?? [], patch.id, patch.text)] };
|
|
947
733
|
case "tool":
|
|
948
|
-
return
|
|
734
|
+
return { ...row, tools: upsertTool(row.tools ?? [], patch.tool, patch.parent) };
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
/** Applies one patch to a row list; only what the patch names moves (patchedRow). */
|
|
739
|
+
export const applyTranscriptPatch = (rows: readonly TranscriptRow[], patch: TranscriptPatch): TranscriptRow[] => {
|
|
740
|
+
switch (patch.op) {
|
|
741
|
+
case "append":
|
|
742
|
+
return [...rows, patch.row];
|
|
743
|
+
case "drop":
|
|
744
|
+
return rows.filter((_row, index) => index !== patch.index);
|
|
745
|
+
default:
|
|
746
|
+
return rows.map((row, index) => (index === patch.index ? patchedRow(row, patch) : row));
|
|
949
747
|
}
|
|
950
748
|
};
|
|
951
749
|
|
|
952
750
|
// Appends a delegated subagent's reasoning onto the card with this id, wherever it nests.
|
|
953
|
-
|
|
751
|
+
const appendToolThinking = (tools: readonly TranscriptTool[], id: string, text: string): readonly TranscriptTool[] =>
|
|
954
752
|
mapTool(tools, id, (card) => ({ ...card, thinking: `${card.thinking ?? ""}${text}` }));
|
|
955
753
|
|
|
956
754
|
// Replaces the tool with this id anywhere in the tree, keeping the nested calls and thinking it already holds, or appends
|
|
957
755
|
// it under `parent`, or at top level with no parent or no match.
|
|
958
|
-
|
|
756
|
+
const upsertTool = (tools: readonly TranscriptTool[], tool: TranscriptTool, parent: string | undefined): TranscriptTool[] => {
|
|
959
757
|
const replaced = mapTool(tools, tool.id, (current) => ({
|
|
960
758
|
...tool,
|
|
961
759
|
...(current.children === undefined ? {} : { children: current.children }),
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { TranscriptRow } from "./transcript.js";
|
|
2
|
-
export declare const stoppedPartwayRow: (said: {
|
|
3
|
-
readonly message: string;
|
|
4
|
-
readonly error?: string;
|
|
5
|
-
}, switchModel: boolean) => TranscriptRow;
|
|
6
|
-
export declare const undeliveredRow: (said: {
|
|
7
|
-
readonly message: string;
|
|
8
|
-
readonly error?: string;
|
|
9
|
-
}, unattended: boolean) => TranscriptRow;
|
|
10
|
-
//# sourceMappingURL=undelivered.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"undelivered.d.ts","sourceRoot":"","sources":["../../src/events/undelivered.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAWrD,eAAO,MAAM,iBAAiB,SAAU;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,eAAe,OAAO,KAAG,aAYrH,CAAC;AAEF,eAAO,MAAM,cAAc,SAAU;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,cAAc,OAAO,KAAG,aAMhH,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { noticeCode } from "./sandbox-notice.js";
|
|
2
|
-
export const stoppedPartwayRow = (said, switchModel) => {
|
|
3
|
-
const row = {
|
|
4
|
-
role: "notice",
|
|
5
|
-
text: switchModel
|
|
6
|
-
? `${said.message} The run stopped partway. The changes it made so far are kept: continue with another model to pick up from here.`
|
|
7
|
-
: `${said.message} The run stopped partway. The changes it made so far are kept: send a message to pick up from here.`,
|
|
8
|
-
noticeCode: noticeCode({ code: "stoppedPartway", params: { ...said, switchModel: switchModel || undefined } }),
|
|
9
|
-
};
|
|
10
|
-
if (switchModel) {
|
|
11
|
-
row.noticeAction = "switchModel";
|
|
12
|
-
}
|
|
13
|
-
return row;
|
|
14
|
-
};
|
|
15
|
-
export const undeliveredRow = (said, unattended) => ({
|
|
16
|
-
role: "notice",
|
|
17
|
-
text: unattended
|
|
18
|
-
? `${said.message} Nothing ran, and nothing is held: this run started on its own, so there is no message waiting to be sent again.`
|
|
19
|
-
: `${said.message} Your message was not delivered: it is held for you to send again.`,
|
|
20
|
-
noticeCode: noticeCode({ code: "undelivered", params: { ...said, unattended: unattended || undefined } }),
|
|
21
|
-
});
|
|
22
|
-
//# sourceMappingURL=undelivered.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"undelivered.js","sourceRoot":"","sources":["../../src/events/undelivered.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAYjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAA2D,EAAE,WAAoB,EAAiB,EAAE;IAClI,MAAM,GAAG,GAAkB;QACvB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,WAAW;YACb,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,kHAAkH;YACnI,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,qGAAqG;QAC1H,UAAU,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE,WAAW,IAAI,SAAS,EAAE,EAAE,CAAC;KACjH,CAAC;IACF,IAAI,WAAW,EAAE,CAAC;QACd,GAAG,CAAC,YAAY,GAAG,aAAa,CAAC;IACrC,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAA2D,EAAE,UAAmB,EAAiB,EAAE,CAAC,CAAC;IAChI,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,UAAU;QACZ,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,kHAAkH;QACnI,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,oEAAoE;IACzF,UAAU,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,IAAI,SAAS,EAAE,EAAE,CAAC;CAC5G,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"history-state.d.ts","sourceRoot":"","sources":["../../src/state/history-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAQxD,eAAO,MAAM,mBAAmB,EAAE,SAAS,SAAS,EAgTnD,CAAC"}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
export const HISTORY_STATE_FILES = [
|
|
2
|
-
{ path: "gits/", portability: "carry" },
|
|
3
|
-
{ path: "scopes/", portability: "carry" },
|
|
4
|
-
{ path: "conversations.db", portability: "carry" },
|
|
5
|
-
{ path: "conversations/", portability: "carry" },
|
|
6
|
-
{ path: "links/linked-children.json", portability: "carry" },
|
|
7
|
-
{ path: "spawned-children/", portability: "carry" },
|
|
8
|
-
{ path: "script-runs/", portability: "carry" },
|
|
9
|
-
{ path: "blobs/", portability: "carry" },
|
|
10
|
-
{ path: "shares.json", portability: "carry" },
|
|
11
|
-
{ path: "member-audience.json", portability: "carry" },
|
|
12
|
-
{ path: "member-getting-started.json", portability: "carry" },
|
|
13
|
-
{ path: "member-ai-literacy.json", portability: "carry" },
|
|
14
|
-
{ path: "activity.jsonl", portability: "carry" },
|
|
15
|
-
{ path: "audit/", portability: "carry" },
|
|
16
|
-
{ path: "usage.jsonl", portability: "carry" },
|
|
17
|
-
{ path: "account-usage.json", portability: "carry" },
|
|
18
|
-
{ path: "provider-answers.json", portability: "carry" },
|
|
19
|
-
{ path: "usage-parks.json", portability: "carry" },
|
|
20
|
-
{ path: "provider-refusals.json", portability: "carry" },
|
|
21
|
-
{ path: "model-refusals.json", portability: "carry" },
|
|
22
|
-
{ path: "model-cooldowns.json", portability: "carry" },
|
|
23
|
-
{ path: "observed-limits.json", portability: "carry" },
|
|
24
|
-
{ path: "run-outs.json", portability: "carry" },
|
|
25
|
-
{ path: "dependency-requests.json", portability: "carry" },
|
|
26
|
-
{ path: "host-setup-seeded.json", portability: "carry" },
|
|
27
|
-
{ path: "apply-events.ndjson", portability: "carry" },
|
|
28
|
-
{ path: "check-events/", portability: "carry" },
|
|
29
|
-
{ path: "panels.json", portability: "derived" },
|
|
30
|
-
{ path: "kept-jobs/", portability: "derived" },
|
|
31
|
-
{ path: "turn-starts.json", portability: "derived" },
|
|
32
|
-
{
|
|
33
|
-
path: "worktrees/",
|
|
34
|
-
portability: "derived",
|
|
35
|
-
note: "Each conversation re-attaches its checkout from its branch on its next turn.",
|
|
36
|
-
},
|
|
37
|
-
{ path: "said-index/", portability: "derived", note: "Rebuilt from the carried transcripts by the first boot's backfill." },
|
|
38
|
-
{ path: "peer-tools.json", portability: "derived" },
|
|
39
|
-
{ path: "overlays/", portability: "derived" },
|
|
40
|
-
{ path: "logs/", portability: "derived" },
|
|
41
|
-
{ path: "trash/", portability: "derived" },
|
|
42
|
-
{ path: ".isolation-probe", portability: "derived" },
|
|
43
|
-
{ path: "exports/", portability: "derived" },
|
|
44
|
-
{ path: "backups/", portability: "derived" },
|
|
45
|
-
{ path: "arrivals/", portability: "derived" },
|
|
46
|
-
{ path: "engines/", portability: "derived" },
|
|
47
|
-
{ path: "update-staged.json", portability: "derived" },
|
|
48
|
-
{ path: "update-preparing.json", portability: "derived" },
|
|
49
|
-
{ path: "update-outcome.json", portability: "derived" },
|
|
50
|
-
{ path: "update-skipped.json", portability: "derived" },
|
|
51
|
-
{ path: "update-policy.json", portability: "derived" },
|
|
52
|
-
{ path: "boot-failure.json", portability: "derived" },
|
|
53
|
-
{ path: "restart-resume.json", portability: "derived" },
|
|
54
|
-
{ path: "paused-children.json", portability: "derived" },
|
|
55
|
-
{ path: "boot-history.json", portability: "derived" },
|
|
56
|
-
{ path: "chore-clock.json", portability: "derived" },
|
|
57
|
-
{ path: "storage-scan.json", portability: "derived" },
|
|
58
|
-
{
|
|
59
|
-
path: "agent-home/",
|
|
60
|
-
portability: "secret",
|
|
61
|
-
note: "Sign the agent's own command-line tools in again where it used them.",
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
path: "agent-homes/",
|
|
65
|
-
portability: "secret",
|
|
66
|
-
note: "Sign the agent's own command-line tools in again where it used them.",
|
|
67
|
-
},
|
|
68
|
-
{ path: "agent-containers/", portability: "derived" },
|
|
69
|
-
{ path: "agent-domain-", portability: "derived" },
|
|
70
|
-
{
|
|
71
|
-
path: "ssh-hosts/",
|
|
72
|
-
portability: "secret",
|
|
73
|
-
note: "Re-add each ssh host on the Capabilities view, its key does not travel.",
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
path: "ssh-host-keys/",
|
|
77
|
-
portability: "secret",
|
|
78
|
-
note: "Clear this sandbox's old host key from your computer's known_hosts before syncing it again.",
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
path: "translator/",
|
|
82
|
-
portability: "secret",
|
|
83
|
-
note: "Sign the routed AI subscriptions in again on the Agent tab.",
|
|
84
|
-
},
|
|
85
|
-
{ path: "session-secret", portability: "identity", note: "Sign in again, the target signs its own sessions." },
|
|
86
|
-
{ path: "platform-row.json", portability: "identity", note: "The target learns its own platform id when it first announces." },
|
|
87
|
-
{ path: "identity/owner.json", portability: "identity", note: "The target is bound by its own owner's first sign-in." },
|
|
88
|
-
{
|
|
89
|
-
path: "identity/members.json",
|
|
90
|
-
portability: "identity",
|
|
91
|
-
note: "Re-invite collaborators from the Access tab, a grant is the platform's record, and the target enforces its own copy.",
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
path: "identity/control-tokens.json",
|
|
95
|
-
portability: "identity",
|
|
96
|
-
note: "Mint fresh control tokens, the old ones authenticate against the source sandbox.",
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
path: "identity/links.json",
|
|
100
|
-
portability: "identity",
|
|
101
|
-
note: "Pair the sandboxes that hand this one tasks again from its Access tab: their links name the source sandbox.",
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
path: "identity/passkeys.json",
|
|
105
|
-
portability: "identity",
|
|
106
|
-
note: "Passkeys are bound to the sandbox they were registered with: add them again on the new one from its Access tab.",
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
path: "browser-access-disabled",
|
|
110
|
-
portability: "identity",
|
|
111
|
-
note: "Account-deletion retirement belongs to the source sandbox; the imported copy starts with fresh browser access.",
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
path: "push.json",
|
|
115
|
-
portability: "identity",
|
|
116
|
-
note: "Re-enable notifications in the browsers you use, a push subscription is bound to the sandbox that minted it.",
|
|
117
|
-
},
|
|
118
|
-
{ path: "sync-enrollments.json", portability: "identity", note: "Re-pair desktop sync from the Sync tab." },
|
|
119
|
-
{ path: "sync-pair-consumed.json", portability: "identity" },
|
|
120
|
-
{ path: "host-enrollments.json", portability: "identity" },
|
|
121
|
-
{ path: "webext-enrollments.json", portability: "identity", note: "Pair your browser again from its card: the extension is still installed." },
|
|
122
|
-
{ path: "webext-pair-consumed.json", portability: "identity" },
|
|
123
|
-
{ path: "phone-enrollments.json", portability: "identity", note: "Pair your phone again from its card: the app is still installed." },
|
|
124
|
-
{ path: "phone-pair-consumed.json", portability: "identity" },
|
|
125
|
-
{ path: "phone-wake.json", portability: "identity" },
|
|
126
|
-
{ path: "phone-pairings.json", portability: "identity" },
|
|
127
|
-
{ path: "host-pair-consumed.json", portability: "identity" },
|
|
128
|
-
{ path: "project-deliveries.json", portability: "identity" },
|
|
129
|
-
{ path: "projects.json", portability: "identity", note: "Attach the folders again from the desktop app on the computer that holds them." },
|
|
130
|
-
{ path: "runner-enrollments.json", portability: "identity" },
|
|
131
|
-
{ path: "runner-pair-consumed.json", portability: "identity" },
|
|
132
|
-
{ path: "runner-identity.json", portability: "identity" },
|
|
133
|
-
{ path: "hook-approvals.json", portability: "identity", note: "Approve the workspace's Claude Code hooks again from Approvals." },
|
|
134
|
-
{ path: "hook-requests.json", portability: "derived" },
|
|
135
|
-
{ path: "extension-approvals.json", portability: "identity", note: "Approve the extensions written in this workspace again from Extensions." },
|
|
136
|
-
{
|
|
137
|
-
path: "approval-decisions.json",
|
|
138
|
-
portability: "identity",
|
|
139
|
-
note: "Approve again from Approvals anything that was approved and had not run yet.",
|
|
140
|
-
},
|
|
141
|
-
{ path: "automation-holds/", portability: "carry" },
|
|
142
|
-
{ path: "automation-holds.key", portability: "identity", note: "A held wake that was counting down arrives waiting for your yes instead." },
|
|
143
|
-
{ path: "automation-listener-inbox.json", portability: "carry" },
|
|
144
|
-
{ path: "automation-workspace-inbox.json", portability: "carry" },
|
|
145
|
-
{ path: "local-cert/", portability: "identity" },
|
|
146
|
-
{ path: "converting/", portability: "secret", note: "An update's undo record stays with the sandbox it happened on." },
|
|
147
|
-
{ path: "state-journal.json", portability: "derived" },
|
|
148
|
-
{ path: "pre-1308-import.json", portability: "derived" },
|
|
149
|
-
{ path: "shell/", portability: "secret" },
|
|
150
|
-
{ path: ".ic/", portability: "identity" },
|
|
151
|
-
{ path: ".pnpm-store/", portability: "derived" },
|
|
152
|
-
];
|
|
153
|
-
//# sourceMappingURL=history-state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"history-state.js","sourceRoot":"","sources":["../../src/state/history-state.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,mBAAmB,GAAyB;IAIrD,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE;IAEvC,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE;IAKzC,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,OAAO,EAAE;IAIlD,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,OAAO,EAAE;IAGhD,EAAE,IAAI,EAAE,4BAA4B,EAAE,WAAW,EAAE,OAAO,EAAE;IAI5D,EAAE,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,OAAO,EAAE;IAInD,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE;IAG9C,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AMxD,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE;IAGzC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE;IAEzC,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE;CACnD,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { noticeCode } from "./sandbox-notice.js";
|
|
2
|
-
import type { TranscriptRow } from "./transcript.js";
|
|
3
|
-
|
|
4
|
-
// The row a refusal that ran nothing leaves when the conversation's queue holds the words (transcript-fold's heldRow).
|
|
5
|
-
// A turn somebody typed is held in its conversation's queue for another press; a turn that started itself (an
|
|
6
|
-
// automation, a loop, a watch wake) has no typed message and nobody watching, so promising a resend there names a
|
|
7
|
-
// composer the reader is not looking at. Neither version promises a retry: whether one comes is the scheduler's
|
|
8
|
-
// decision, not this row's to state. The code carries the same fact, so the editor's localized line agrees.
|
|
9
|
-
// The row the same refusal leaves once the turn had already run: a trial spent, or a model refused, on a later step. The
|
|
10
|
-
// message was read and acted on, so it is neither undelivered nor held (turn-runs keeps only a turn turned away at the
|
|
11
|
-
// door), and saying so invited a resend of something that had already changed files (onboarding review 2026-10-18,
|
|
12
|
-
// F07). What it did stays in the conversation's copy; the press, when another model gets past the refusal, carries on there.
|
|
13
|
-
export const stoppedPartwayRow = (said: { readonly message: string; readonly error?: string }, switchModel: boolean): TranscriptRow => {
|
|
14
|
-
const row: TranscriptRow = {
|
|
15
|
-
role: "notice",
|
|
16
|
-
text: switchModel
|
|
17
|
-
? `${said.message} The run stopped partway. The changes it made so far are kept: continue with another model to pick up from here.`
|
|
18
|
-
: `${said.message} The run stopped partway. The changes it made so far are kept: send a message to pick up from here.`,
|
|
19
|
-
noticeCode: noticeCode({ code: "stoppedPartway", params: { ...said, switchModel: switchModel || undefined } }),
|
|
20
|
-
};
|
|
21
|
-
if (switchModel) {
|
|
22
|
-
row.noticeAction = "switchModel";
|
|
23
|
-
}
|
|
24
|
-
return row;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const undeliveredRow = (said: { readonly message: string; readonly error?: string }, unattended: boolean): TranscriptRow => ({
|
|
28
|
-
role: "notice",
|
|
29
|
-
text: unattended
|
|
30
|
-
? `${said.message} Nothing ran, and nothing is held: this run started on its own, so there is no message waiting to be sent again.`
|
|
31
|
-
: `${said.message} Your message was not delivered: it is held for you to send again.`,
|
|
32
|
-
noticeCode: noticeCode({ code: "undelivered", params: { ...said, unattended: unattended || undefined } }),
|
|
33
|
-
});
|