zidane 5.10.0 → 5.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-AnumGPWj.d.ts → agent-Bt123Fdy.d.ts} +103 -3
- package/dist/agent-Bt123Fdy.d.ts.map +1 -0
- package/dist/chat/pure.d.ts +3 -3
- package/dist/chat/pure.js +1 -1
- package/dist/chat.d.ts +6 -6
- package/dist/chat.js +3 -3
- package/dist/contexts/docker.d.ts +1 -1
- package/dist/{contexts-CbI8dRfI.js → contexts-GKAWYq07.js} +113 -7
- package/dist/contexts-GKAWYq07.js.map +1 -0
- package/dist/contexts.d.ts +3 -3
- package/dist/contexts.js +2 -2
- package/dist/eval.d.ts +1 -1
- package/dist/eval.js +3 -3
- package/dist/{headless-D0qfvzG9.js → headless-Cn6XXmr3.js} +4 -4
- package/dist/{headless-D0qfvzG9.js.map → headless-Cn6XXmr3.js.map} +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/{index-B65HjjKZ.d.ts → index-4pQUnr2W.d.ts} +2 -2
- package/dist/{index-B65HjjKZ.d.ts.map → index-4pQUnr2W.d.ts.map} +1 -1
- package/dist/{index-DsvHiyYU.d.ts → index-BodGKXBV.d.ts} +3 -3
- package/dist/{index-DsvHiyYU.d.ts.map → index-BodGKXBV.d.ts.map} +1 -1
- package/dist/{index-LX8KCBXU.d.ts → index-C7BvI1Hi.d.ts} +14 -4
- package/dist/index-C7BvI1Hi.d.ts.map +1 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +7 -7
- package/dist/{login-DocBwMVo.js → login-DoGslmKC.js} +2 -2
- package/dist/{login-DocBwMVo.js.map → login-DoGslmKC.js.map} +1 -1
- package/dist/{mcp-DzuTfq-I.js → mcp-BdN9UjTO.js} +32 -7
- package/dist/mcp-BdN9UjTO.js.map +1 -0
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/output/stream-json.d.ts +2 -2
- package/dist/output/stream-json.js +1 -1
- package/dist/output/terminal.d.ts +2 -2
- package/dist/{presets-CTNbWXWz.js → presets-DCrQmY3b.js} +3 -2
- package/dist/presets-DCrQmY3b.js.map +1 -0
- package/dist/presets.d.ts +2 -2
- package/dist/presets.js +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/restate.d.ts +192 -16
- package/dist/restate.d.ts.map +1 -1
- package/dist/restate.js +133 -5
- package/dist/restate.js.map +1 -1
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/skills.d.ts +2 -2
- package/dist/{tool-formatters-5nr1eXPn.d.ts → tool-formatters-BuB31L-c.d.ts} +2 -2
- package/dist/{tool-formatters-5nr1eXPn.d.ts.map → tool-formatters-BuB31L-c.d.ts.map} +1 -1
- package/dist/tools/fetch-url.d.ts +1 -1
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/{tools-ycHDeHBZ.js → tools-Bk9TqmCV.js} +225 -18
- package/dist/tools-Bk9TqmCV.js.map +1 -0
- package/dist/tools.d.ts +3 -3
- package/dist/tools.js +2 -2
- package/dist/{transcript-anchors-D6Sw-Gzk.js → transcript-anchors-Bkuspqgn.js} +5 -5
- package/dist/{transcript-anchors-D6Sw-Gzk.js.map → transcript-anchors-Bkuspqgn.js.map} +1 -1
- package/dist/{transcript-anchors-DezrH1sp.d.ts → transcript-anchors-DhVgKmEl.d.ts} +4 -4
- package/dist/{transcript-anchors-DezrH1sp.d.ts.map → transcript-anchors-DhVgKmEl.d.ts.map} +1 -1
- package/dist/tui.d.ts +3 -3
- package/dist/tui.js +7 -7
- package/dist/{turn-operations-C70p-7Nn.js → turn-operations-DLWN2J7f.js} +13 -1
- package/dist/{turn-operations-C70p-7Nn.js.map → turn-operations-DLWN2J7f.js.map} +1 -1
- package/dist/{turn-operations-CICEEhrU.d.ts → turn-operations-DYKtoVd9.d.ts} +3 -3
- package/dist/{turn-operations-CICEEhrU.d.ts.map → turn-operations-DYKtoVd9.d.ts.map} +1 -1
- package/dist/{types-CRf_uTpK.d.ts → types-BMwiYRIJ.d.ts} +100 -6
- package/dist/types-BMwiYRIJ.d.ts.map +1 -0
- package/dist/types-BiobHM1D.js.map +1 -1
- package/dist/types.d.ts +5 -5
- package/docs/RESTATE.md +79 -5
- package/docs/RUN_IN_BACKGROUND.md +10 -1
- package/docs/SKILL.md +11 -4
- package/package.json +1 -1
- package/dist/agent-AnumGPWj.d.ts.map +0 -1
- package/dist/contexts-CbI8dRfI.js.map +0 -1
- package/dist/index-LX8KCBXU.d.ts.map +0 -1
- package/dist/mcp-DzuTfq-I.js.map +0 -1
- package/dist/presets-CTNbWXWz.js.map +0 -1
- package/dist/tools-ycHDeHBZ.js.map +0 -1
- package/dist/types-CRf_uTpK.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Cn as ToolResultContent, O as SkillConfig, On as TurnUsage, gn as SessionTurn } from "./agent-
|
|
2
|
-
import { D as Owner, E as EditPayload, G as ProviderKey, L as CompletionProvider, M as StreamEvent, R as CompletionReference, W as ProviderAuth, Y as ModelInfo, l as ApprovalDecision, w as EditOutcome } from "./tool-formatters-
|
|
1
|
+
import { Cn as ToolResultContent, O as SkillConfig, On as TurnUsage, gn as SessionTurn } from "./agent-Bt123Fdy.js";
|
|
2
|
+
import { D as Owner, E as EditPayload, G as ProviderKey, L as CompletionProvider, M as StreamEvent, R as CompletionReference, W as ProviderAuth, Y as ModelInfo, l as ApprovalDecision, w as EditOutcome } from "./tool-formatters-BuB31L-c.js";
|
|
3
3
|
|
|
4
4
|
//#region src/chat/color-gradient.d.ts
|
|
5
5
|
/**
|
|
@@ -660,4 +660,4 @@ declare function countNeighbors(turnIds: readonly string[], turnId: string): {
|
|
|
660
660
|
} | null;
|
|
661
661
|
//#endregion
|
|
662
662
|
export { uniqueFilesFromReferences as $, buildUnifiedDiff as A, buildEditOutcomesAnnotation as B, EditSummary as C, PreviewResult as D, InlineSegment as E, previewEditPayload as F, rewriteMultiEditHeader as G, mergeApprovalAndBodyOutcomes as H, splitLines as I, SKILLS_TRIGGER as J, stripEditOutcomesAnnotation as K, summarizeEditPayload as L, computeLineDiff as M, extractEditPayload as N, applyEditPayload as O, filetypeFromPath as P, createFilesCompletionProvider as Q, tokenize as R, EditHunkSummary as S, InlineDiff as T, parseEditOutcomesFromResult as U, maskToOutcomeKinds as V, resolveApprovalForPayload as W, uniqueSkillNamesFromReferences as X, createSkillsCompletionProvider as Y, FILES_TRIGGER as Z, formatTaskSummary as _, finalizeStreamingMarkdown as a, DiffLine as b, CatalogEntry as c, indexOfEntry as d, FileEntry as et, ageString as f, formatTaskStatus as g, formatDuration as h, turnAsText as i, buildLinearRamp as it, computeInlineDiff as j, buildContextualDiff as k, buildModelCatalog as l, fmtTokens as m, deleteTurnSafely as n, listProjectFiles as nt, finalizeStreamingMarkdownForOwner as o, compactPath as p, summarizeOutcomes as q, truncateTurnsAt as r, blendHsl as rt, turnContextSize as s, countNeighbors as t, ListProjectFilesOptions as tt, filterModelCatalog as u, previewLine as v, HunkResolution as w, DiffOp as x, shortId as y, ResolvedApproval as z };
|
|
663
|
-
//# sourceMappingURL=turn-operations-
|
|
663
|
+
//# sourceMappingURL=turn-operations-DYKtoVd9.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn-operations-
|
|
1
|
+
{"version":3,"file":"turn-operations-DYKtoVd9.d.ts","names":[],"sources":["../src/chat/color-gradient.ts","../src/chat/files-discovery.ts","../src/chat/completion-files.ts","../src/chat/completion-skills.ts","../src/chat/edit-approval.ts","../src/tools/edit-utils.ts","../src/chat/edit-diff.ts","../src/chat/format.ts","../src/chat/model-catalog.ts","../src/chat/streaming-pure.ts","../src/chat/turn-operations.ts"],"mappings":";;;;;;;;iBAmFgB,QAAA,CAAS,IAAA,UAAc,EAAA,UAAY,CAAA;AAAnD;;;;;AAAA,iBAuBgB,eAAA,CAAgB,IAAA,UAAc,EAAA,UAAY,CAAA;;;;;;;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wD5E,UAAA,CAAW,IAAiB,EAAX,WAAW;;;;AR7F5C;;iBQ4HgB,cAAA,CACd,OAAA,qBACA,MAAA;EACG,MAAA;EAAgB,KAAA;AAAA"}
|
|
@@ -7,6 +7,22 @@
|
|
|
7
7
|
* whether they're running in-process, in a Docker container, or in a
|
|
8
8
|
* remote sandbox.
|
|
9
9
|
*/
|
|
10
|
+
/**
|
|
11
|
+
* Lifetime guarantee of background tasks started through
|
|
12
|
+
* {@link ExecutionContext.execBackground}.
|
|
13
|
+
*
|
|
14
|
+
* - `'none'` — the context cannot detach tasks at all.
|
|
15
|
+
* - `'process-lifetime'` — tasks live as long as the HOST process; a
|
|
16
|
+
* crash/restart of the host orphans or kills them (`ProcessContext`).
|
|
17
|
+
* - `'durable'` — tasks live on a remote runner and survive host process
|
|
18
|
+
* death (remote execution contexts driven by durable runtimes).
|
|
19
|
+
*
|
|
20
|
+
* Durable-execution adapters (e.g. `zidane/restate`) consult this to
|
|
21
|
+
* decide whether backgrounding is safe to expose: a `'durable'` context
|
|
22
|
+
* keeps its tasks across worker crashes, so there is no reason to strip
|
|
23
|
+
* the capability from the model.
|
|
24
|
+
*/
|
|
25
|
+
type DetachedTasksCapability = 'none' | 'process-lifetime' | 'durable';
|
|
10
26
|
interface ContextCapabilities {
|
|
11
27
|
/** Can execute shell commands */
|
|
12
28
|
shell: boolean;
|
|
@@ -16,7 +32,19 @@ interface ContextCapabilities {
|
|
|
16
32
|
network: boolean;
|
|
17
33
|
/** Has GPU access */
|
|
18
34
|
gpu: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Background-task lifetime guarantee. Optional for backward
|
|
37
|
+
* compatibility — when absent, callers infer `'process-lifetime'`
|
|
38
|
+
* if the context implements `execBackground`, `'none'` otherwise
|
|
39
|
+
* (see {@link resolveDetachedTasksCapability}).
|
|
40
|
+
*/
|
|
41
|
+
detachedTasks?: DetachedTasksCapability;
|
|
19
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Effective {@link DetachedTasksCapability} of a context, with the
|
|
45
|
+
* backward-compatible inference for contexts that predate the field.
|
|
46
|
+
*/
|
|
47
|
+
declare function resolveDetachedTasksCapability(context: ExecutionContext): DetachedTasksCapability;
|
|
20
48
|
/** Opaque handle to a running execution context instance */
|
|
21
49
|
interface ExecutionHandle {
|
|
22
50
|
id: string;
|
|
@@ -156,6 +184,14 @@ interface ExecutionContext {
|
|
|
156
184
|
* wire this to the agent's pending-notification queue so the model
|
|
157
185
|
* gets a `<task-notification>` on its next turn.
|
|
158
186
|
*
|
|
187
|
+
* `onExit` is OPTIONAL: remote / durable contexts may have no legal
|
|
188
|
+
* way to push a callback from a timer back into the host (a Restate
|
|
189
|
+
* journal, for instance, forbids out-of-band writes). Such contexts
|
|
190
|
+
* simply record the exit in their registry; the agent loop reconciles
|
|
191
|
+
* by polling {@link ExecutionContext.listBackground} at run
|
|
192
|
+
* boundaries, where a host journal wrapper is legal (the
|
|
193
|
+
* `background:reconcile` hook is the journalable seam).
|
|
194
|
+
*
|
|
159
195
|
* See `docs/RUN_IN_BACKGROUND.md` for the broader design contract
|
|
160
196
|
* (file location, replay semantics, suppression rules).
|
|
161
197
|
*/
|
|
@@ -169,8 +205,24 @@ interface ExecutionContext {
|
|
|
169
205
|
* Must already exist OR be creatable by the context — the
|
|
170
206
|
* implementation handles `mkdir -p` defensively.
|
|
171
207
|
*/
|
|
172
|
-
outputDir: string;
|
|
173
|
-
onExit
|
|
208
|
+
outputDir: string; /** Push-style exit callback. Optional — see the method doc. */
|
|
209
|
+
onExit?: (info: TaskExitInfo) => void;
|
|
210
|
+
/**
|
|
211
|
+
* Cap on bytes written to the output file. Beyond the cap the
|
|
212
|
+
* process KEEPS RUNNING; further output is counted but dropped,
|
|
213
|
+
* and a `<output-truncated bytes-dropped="N"/>` marker is
|
|
214
|
+
* appended when the task settles. Unset / non-positive = no cap.
|
|
215
|
+
*/
|
|
216
|
+
maxOutputBytes?: number;
|
|
217
|
+
/**
|
|
218
|
+
* Stall watchdog: when the task produces no output for this many
|
|
219
|
+
* milliseconds, `onStall` fires ONCE (one-shot — re-arms only
|
|
220
|
+
* after fresh output arrives). The process is NOT killed; the
|
|
221
|
+
* consumer decides (typically by telling the model the task may
|
|
222
|
+
* be stuck at an interactive prompt). Unset = no watchdog.
|
|
223
|
+
*/
|
|
224
|
+
stallTimeoutMs?: number; /** One-shot stall callback — see `stallTimeoutMs`. */
|
|
225
|
+
onStall?: (info: TaskStallInfo) => void;
|
|
174
226
|
}) => Promise<TaskHandle>;
|
|
175
227
|
/**
|
|
176
228
|
* SIGTERM the whole process group of a running background task.
|
|
@@ -189,6 +241,27 @@ interface ExecutionContext {
|
|
|
189
241
|
* the model can still read output of exited tasks).
|
|
190
242
|
*/
|
|
191
243
|
listBackground?: (handle: ExecutionHandle) => Promise<readonly TaskEntry[]>;
|
|
244
|
+
/**
|
|
245
|
+
* Block until a background task terminates, then resolve with its
|
|
246
|
+
* exit info. Resolves immediately for already-terminated tasks.
|
|
247
|
+
*
|
|
248
|
+
* Returns `null` when:
|
|
249
|
+
* - the task id is unknown (or owned by another handle — same
|
|
250
|
+
* isolation contract as `killBackground`), OR
|
|
251
|
+
* - `timeoutMs` elapsed / `signal` aborted before the task exited.
|
|
252
|
+
*
|
|
253
|
+
* Callers that need to distinguish "unknown" from "still running"
|
|
254
|
+
* should consult `listBackground` first (the `wait_task` tool does).
|
|
255
|
+
*
|
|
256
|
+
* This is the injectable wait seam for the `wait_task` tool:
|
|
257
|
+
* in-process contexts implement it on the existing `onExit`
|
|
258
|
+
* machinery; durable hosts implement it as an awakeable park
|
|
259
|
+
* (runner fires task-exit over their bridge → resolveAwakeable).
|
|
260
|
+
*/
|
|
261
|
+
waitBackground?: (handle: ExecutionHandle, taskId: string, options?: {
|
|
262
|
+
timeoutMs?: number;
|
|
263
|
+
signal?: AbortSignal;
|
|
264
|
+
}) => Promise<TaskExitInfo | null>;
|
|
192
265
|
/**
|
|
193
266
|
* Transfer ownership of every still-running task from `fromHandle`
|
|
194
267
|
* to `toHandle`. Used by the spawn tool to "promote" a subagent's
|
|
@@ -300,8 +373,8 @@ interface TaskExitInfo {
|
|
|
300
373
|
}
|
|
301
374
|
/**
|
|
302
375
|
* One row in `listBackground`'s snapshot. Living entries (status `'running'`)
|
|
303
|
-
* have `exitCode` / `signal` unset; terminated entries carry the
|
|
304
|
-
* `TaskExitInfo` returned at exit time.
|
|
376
|
+
* have `exitCode` / `signal` / `endedAt` unset; terminated entries carry the
|
|
377
|
+
* same data `TaskExitInfo` returned at exit time.
|
|
305
378
|
*/
|
|
306
379
|
interface TaskEntry {
|
|
307
380
|
taskId: string;
|
|
@@ -309,6 +382,12 @@ interface TaskEntry {
|
|
|
309
382
|
command: string;
|
|
310
383
|
cwd: string;
|
|
311
384
|
startedAt: number;
|
|
385
|
+
/**
|
|
386
|
+
* Set when the task terminated. Lets pull-based consumers (the agent's
|
|
387
|
+
* run-boundary reconcile) derive `durationMs = endedAt - startedAt`
|
|
388
|
+
* without depending on when the snapshot was taken.
|
|
389
|
+
*/
|
|
390
|
+
endedAt?: number;
|
|
312
391
|
outputPath: string;
|
|
313
392
|
status: BackgroundTaskStatus;
|
|
314
393
|
exitCode?: number;
|
|
@@ -316,6 +395,21 @@ interface TaskEntry {
|
|
|
316
395
|
/** Total bytes written to the output file so far — useful for "task X has produced N KB" UX hints. */
|
|
317
396
|
bytesWritten: number;
|
|
318
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* Fired by the optional stall watchdog (see `execBackground`'s
|
|
400
|
+
* `stallTimeoutMs`) when a running task has produced no output for the
|
|
401
|
+
* configured window. The process is still alive — this is a signal, not
|
|
402
|
+
* a state transition.
|
|
403
|
+
*/
|
|
404
|
+
interface TaskStallInfo {
|
|
405
|
+
taskId: string;
|
|
406
|
+
command: string;
|
|
407
|
+
outputPath: string;
|
|
408
|
+
/** Milliseconds since the last output chunk (>= the configured window). */
|
|
409
|
+
stalledForMs: number;
|
|
410
|
+
/** Total bytes the task has written so far. */
|
|
411
|
+
bytesWritten: number;
|
|
412
|
+
}
|
|
319
413
|
//#endregion
|
|
320
|
-
export {
|
|
321
|
-
//# sourceMappingURL=types-
|
|
414
|
+
export { DetachedTasksCapability as a, ExecutionHandle as c, TaskExitInfo as d, TaskHandle as f, ContextType as i, SpawnConfig as l, resolveDetachedTasksCapability as m, ContextCapabilities as n, ExecResult as o, TaskStallInfo as p, ContextMount as r, ExecutionContext as s, BackgroundTaskStatus as t, TaskEntry as u };
|
|
415
|
+
//# sourceMappingURL=types-BMwiYRIJ.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-BMwiYRIJ.d.ts","names":[],"sources":["../src/contexts/types.ts"],"mappings":";;AA4BA;;;;AAAmC;AAEnC;;;;;;;;;;;AAeyC;AAOzC;;;;;KAxBY,uBAAA;AAAA,UAEK,mBAAA;EAsBiF;EApBhG,KAAA;EA8Be;EA5Bf,UAAA;;EAEA,OAAA;EA2BA;EAzBA,GAAA;EA0BM;;;AAEH;AAOL;;EA5BE,aAAA,GAAgB,uBAAuB;AAAA;;;;;iBAOzB,8BAAA,CAA+B,OAAA,EAAS,gBAAA,GAAmB,uBAAuB;AA+BlG;AAAA,UArBiB,eAAA;EACf,EAAA;EACA,IAAA,EAAM,WAAW;EA6BR;EA3BT,GAAA;AAAA;AAAA,UAOe,UAAA;EACf,MAAA;EACA,MAAA;EACA,QAAA;AAAA;AAAA,UAOe,WAAA;EAQf;EANA,GAAA;EAQS;EANT,GAAA,GAAM,MAAA;EAUJ;EARF,KAAA;EAYE;EAVF,IAAA;EAcE;EAZF,MAAA,GAAS,YAAA;EAcN;EAZH,MAAA;IAuBQ,yBArBN,MAAA,WAqBiC;IAnBjC,GAAA,WA8BF;IA5BE,OAAA;EAAA;EA8CO;EA3CT,OAAA;IACE,QAAA;IACA,MAAA;IAAA,CACC,GAAA;EAAA;EA2CwB;;;;;;AAarB;AAOR;EApDE,KAAA,GAAQ,KAAA;IAAQ,SAAA;IAAmB,IAAA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