zidane 5.13.13 → 5.13.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/{acp-CqXcM2Km.js → acp-X9NvSC7i.js} +8 -8
  2. package/dist/{acp-CqXcM2Km.js.map → acp-X9NvSC7i.js.map} +1 -1
  3. package/dist/acp-cli.js +8 -7
  4. package/dist/acp-cli.js.map +1 -1
  5. package/dist/acp.d.ts +2 -2
  6. package/dist/acp.js +1 -1
  7. package/dist/{agent-NkKgz5Dh.d.ts → agent-CNIOsTUg.d.ts} +44 -2
  8. package/dist/agent-CNIOsTUg.d.ts.map +1 -0
  9. package/dist/{auth-CGTf8v1_.js → auth-D9rP8khI.js} +2 -2
  10. package/dist/{auth-CGTf8v1_.js.map → auth-D9rP8khI.js.map} +1 -1
  11. package/dist/chat/pure.d.ts +3 -3
  12. package/dist/chat.d.ts +6 -6
  13. package/dist/chat.js +3 -3
  14. package/dist/contexts/daytona.d.ts +22 -4
  15. package/dist/contexts/daytona.d.ts.map +1 -1
  16. package/dist/contexts/daytona.js +6 -5
  17. package/dist/contexts/daytona.js.map +1 -1
  18. package/dist/contexts/docker.js +2 -1
  19. package/dist/contexts/docker.js.map +1 -1
  20. package/dist/contexts/e2b.d.ts +2 -2
  21. package/dist/contexts/sandbox.d.ts +2 -0
  22. package/dist/contexts/sandbox.js +55 -0
  23. package/dist/contexts/sandbox.js.map +1 -0
  24. package/dist/{contexts-DHi8LPCp.js → contexts-BebciJyQ.js} +3 -53
  25. package/dist/contexts-BebciJyQ.js.map +1 -0
  26. package/dist/contexts.d.ts +2 -1
  27. package/dist/contexts.js +2 -1
  28. package/dist/{errors-BpPfMo_4.js → errors-DJUxZg9b.js} +3 -2
  29. package/dist/{errors-BpPfMo_4.js.map → errors-DJUxZg9b.js.map} +1 -1
  30. package/dist/eval.d.ts +1 -1
  31. package/dist/eval.js +3 -3
  32. package/dist/{fetch-url-Cgbq-HYx.js → fetch-url-CWE8X5OD.js} +2 -2
  33. package/dist/{fetch-url-Cgbq-HYx.js.map → fetch-url-CWE8X5OD.js.map} +1 -1
  34. package/dist/{glob-DCWXy_tr.js → glob-D56-KpBp.js} +2 -12
  35. package/dist/glob-D56-KpBp.js.map +1 -0
  36. package/dist/glob-shell-rJMoCIGb.js +21 -0
  37. package/dist/glob-shell-rJMoCIGb.js.map +1 -0
  38. package/dist/{headless-C6Idunwh.js → headless-Dtd24J6l.js} +6 -6
  39. package/dist/{headless-C6Idunwh.js.map → headless-Dtd24J6l.js.map} +1 -1
  40. package/dist/headless.d.ts +1 -1
  41. package/dist/headless.js +1 -1
  42. package/dist/{index-BgB_425D.d.ts → index-DXwsHr4o.d.ts} +8 -6
  43. package/dist/{index-BgB_425D.d.ts.map → index-DXwsHr4o.d.ts.map} +1 -1
  44. package/dist/{index-BFY7mcar.d.ts → index-DuB7Cf02.d.ts} +2 -2
  45. package/dist/{index-BFY7mcar.d.ts.map → index-DuB7Cf02.d.ts.map} +1 -1
  46. package/dist/index-HQJDOWvo.d.ts +7 -0
  47. package/dist/index-HQJDOWvo.d.ts.map +1 -0
  48. package/dist/index.d.ts +6 -5
  49. package/dist/index.js +12 -11
  50. package/dist/index.js.map +1 -1
  51. package/dist/{interpolate-ConAiXGy.js → interpolate-BtIgcCuz.js} +2 -2
  52. package/dist/{interpolate-ConAiXGy.js.map → interpolate-BtIgcCuz.js.map} +1 -1
  53. package/dist/{logger-LQmSBfD_.d.ts → logger-HOG4EGv6.d.ts} +2 -2
  54. package/dist/{logger-LQmSBfD_.d.ts.map → logger-HOG4EGv6.d.ts.map} +1 -1
  55. package/dist/{login-DE-_d045.js → login-CCA-1lgK.js} +2 -2
  56. package/dist/{login-DE-_d045.js.map → login-CCA-1lgK.js.map} +1 -1
  57. package/dist/{mcp-2OGi_NQu.js → mcp-Dn5W65Lv.js} +2 -2
  58. package/dist/{mcp-2OGi_NQu.js.map → mcp-Dn5W65Lv.js.map} +1 -1
  59. package/dist/mcp.d.ts +1 -1
  60. package/dist/mcp.js +1 -1
  61. package/dist/{messages-U_87Z7GH.js → messages-FUqY3pci.js} +2 -2
  62. package/dist/{messages-U_87Z7GH.js.map → messages-FUqY3pci.js.map} +1 -1
  63. package/dist/output/stream-json.d.ts +2 -2
  64. package/dist/output/stream-json.js +1 -1
  65. package/dist/output/terminal.d.ts +2 -2
  66. package/dist/{presets-eC4VwuHh.js → presets-OeSUjTtC.js} +2 -2
  67. package/dist/{presets-eC4VwuHh.js.map → presets-OeSUjTtC.js.map} +1 -1
  68. package/dist/presets.d.ts +2 -2
  69. package/dist/presets.js +1 -1
  70. package/dist/{providers-DyMPTo51.js → providers-BPVOGmde.js} +13 -5
  71. package/dist/providers-BPVOGmde.js.map +1 -0
  72. package/dist/providers.d.ts +1 -1
  73. package/dist/providers.js +2 -2
  74. package/dist/restate.d.ts +38 -2
  75. package/dist/restate.d.ts.map +1 -1
  76. package/dist/restate.js +22 -0
  77. package/dist/restate.js.map +1 -1
  78. package/dist/{index-CF15aqlk.d.ts → sandbox-B-bMq3K6.d.ts} +2 -5
  79. package/dist/sandbox-B-bMq3K6.d.ts.map +1 -0
  80. package/dist/session/sqlite.d.ts +1 -1
  81. package/dist/session/sqlite.js +1 -1
  82. package/dist/{session-DQ4bEncf.js → session-C0D4p0Gy.js} +2 -2
  83. package/dist/{session-DQ4bEncf.js.map → session-C0D4p0Gy.js.map} +1 -1
  84. package/dist/session.d.ts +1 -1
  85. package/dist/session.js +2 -2
  86. package/dist/skills.d.ts +2 -2
  87. package/dist/skills.js +1 -1
  88. package/dist/{tool-formatters-DvtGhbJN.d.ts → tool-formatters-B4Ll4Xpz.d.ts} +2 -2
  89. package/dist/{tool-formatters-DvtGhbJN.d.ts.map → tool-formatters-B4Ll4Xpz.d.ts.map} +1 -1
  90. package/dist/tools/fetch-url.d.ts +1 -1
  91. package/dist/tools/fetch-url.js +1 -1
  92. package/dist/tools/web-search.d.ts +1 -1
  93. package/dist/tools/web-search.js +2 -2
  94. package/dist/{tools-BvATiiCO.js → tools-DnWOJcSK.js} +72 -19
  95. package/dist/tools-DnWOJcSK.js.map +1 -0
  96. package/dist/tools.d.ts +2 -2
  97. package/dist/tools.js +1 -1
  98. package/dist/{transcript-anchors-DFmfOesU.d.ts → transcript-anchors-B4noYwKl.d.ts} +4 -4
  99. package/dist/{transcript-anchors-DFmfOesU.d.ts.map → transcript-anchors-B4noYwKl.d.ts.map} +1 -1
  100. package/dist/{transcript-anchors-Cn1Unhn-.js → transcript-anchors-CfKFkE5T.js} +9 -9
  101. package/dist/{transcript-anchors-Cn1Unhn-.js.map → transcript-anchors-CfKFkE5T.js.map} +1 -1
  102. package/dist/tui.d.ts +3 -3
  103. package/dist/tui.js +10 -10
  104. package/dist/tui.js.map +1 -1
  105. package/dist/{turn-operations-DWUN8cHo.d.ts → turn-operations-DYbhKmSu.d.ts} +3 -3
  106. package/dist/{turn-operations-DWUN8cHo.d.ts.map → turn-operations-DYbhKmSu.d.ts.map} +1 -1
  107. package/dist/types.d.ts +3 -3
  108. package/dist/types.js +1 -1
  109. package/docs/ARCHITECTURE.md +2 -0
  110. package/docs/CHAT.md +3 -3
  111. package/docs/RESTATE.md +58 -0
  112. package/docs/SKILL.md +1 -0
  113. package/docs/TUI.md +1 -1
  114. package/package.json +6 -1
  115. package/dist/agent-NkKgz5Dh.d.ts.map +0 -1
  116. package/dist/contexts-DHi8LPCp.js.map +0 -1
  117. package/dist/glob-DCWXy_tr.js.map +0 -1
  118. package/dist/index-CF15aqlk.d.ts.map +0 -1
  119. package/dist/providers-DyMPTo51.js.map +0 -1
  120. package/dist/tools-BvATiiCO.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { P as SkillConfig, qn as ToolResultContent, tr as TurnUsage, zn as SessionTurn } from "./agent-NkKgz5Dh.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-DvtGhbJN.js";
1
+ import { P as SkillConfig, qn as ToolResultContent, tr as TurnUsage, zn as SessionTurn } from "./agent-CNIOsTUg.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-B4Ll4Xpz.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-DWUN8cHo.d.ts.map
663
+ //# sourceMappingURL=turn-operations-DYbhKmSu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"turn-operations-DWUN8cHo.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;;;;;;;;AAvB1D;;;;;;;;AAA4D;AAAA,UC9D3C,SAAA;EDqFc;ECnF7B,IAAA;EDmF6B;ECjF7B,IAAA;EDiF4C;EC/E5C,MAAA;AAAA;AD+EiE;AAAA,UClClD,uBAAA;;EAEf,GAAA;EArDe;EAuDf,QAAA;;EAEA,MAAA,GAAS,WAAW;AAAA;;;;AAnDd;AA6CR;;;;;iBAkBsB,gBAAA,CAAiB,IAAA,GAAM,uBAAA,GAA+B,OAAA,CAAQ,SAAA;;;;cCrEvE,aAAA;AFqFb;;;;;;;;AAAmE;;;;ACrFnE;;;ADqFA,iBE8BgB,6BAAA,CAA8B,IAAA;EDjH5C,qFCmHA,UAAA,iBAA2B,SAAA;ED/G3B;;AAAM;AA6CR;;;;;;;;;EC+EE,aAAA,SAAsB,OAAA,UAAiB,SAAA,KD7DnB;EC+DpB,KAAA;;;;;;;;;;;;EAYA,UAAA,IAAc,KAAA,EAAO,SAAA;AAAA,IACnB,kBAAA,CAAmB,SAAA;;;AAjJvB;;;iBA0OgB,yBAAA,CACd,UAAA,WAAqB,mBAAA,cACpB,SAAS;;;AF9KgD;AAAA,cG7D/C,cAAA;;;;;;;;AHoFsD;iBGVnD,8BAAA,CAA+B,IAAA;gFAE7C,UAAA,iBAA2B,WAAA,IF7EZ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,MAAA,EAAQ,WAAA,KAAgB,WAAW;AT+DjB;AAAA,iBSlD5C,iCAAA,CAAkC,MAAA,EAAQ,WAAA,IAAe,KAAA,EAAO,KAAA,GAAQ,WAAA;;;;;;;;ATyErB;;;;ACrFnE;iBQwCgB,eAAA,CAAgB,KAA4B,EAArB,SAAS;;;AT6ChD;;;;;;;;AAAmE;;;;ACrFnE;;;;;ADqFA,iBUzEgB,eAAA,CAAgB,KAAA,WAAgB,WAAA,IAAe,MAAA,WAAiB,WAAW;;;ATNnF;AA6CR;;;;;;;;;AAMsB;AAYtB;;;;iBShCgB,gBAAA,CAAiB,KAAA,WAAgB,WAAA,IAAe,MAAA,WAAiB,WAAW;;;;;;;;;iBAwD5E,UAAA,CAAW,IAAiB,EAAX,WAAW;;;;AR7F5C;;iBQ4HgB,cAAA,CACd,OAAA,qBACA,MAAA;EACG,MAAA;EAAgB,KAAA;AAAA"}
1
+ {"version":3,"file":"turn-operations-DYbhKmSu.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;;;;;;;;AAvB1D;;;;;;;;AAA4D;AAAA,UC9D3C,SAAA;EDqFc;ECnF7B,IAAA;EDmF6B;ECjF7B,IAAA;EDiF4C;EC/E5C,MAAA;AAAA;AD+EiE;AAAA,UClClD,uBAAA;;EAEf,GAAA;EArDe;EAuDf,QAAA;;EAEA,MAAA,GAAS,WAAW;AAAA;;;;AAnDd;AA6CR;;;;;iBAkBsB,gBAAA,CAAiB,IAAA,GAAM,uBAAA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EAAa,WAAA;EACb,aAAA;EACA,KAAA,EAAO,SAAS;ERuFc;;;;AAAmC;;;EQ/EjE,YAAA;AAAA;;;;;;;;APAM;AA6CR;;;;;iBO7BgB,iBAAA,CAAkB,IAAA;EAChC,SAAA,WAAoB,YAAA;EACpB,SAAA,GAAY,GAAA,EAAK,WAAA,cAAyB,SAAA,IPiCtB;EO/BpB,OAAA;IAAY,WAAA,EAAa,WAAA;IAAa,OAAA;EAAA;AAAA,IACpC,YAAA;;;;;;;;;;AP0CyF;iBOD7E,kBAAA,CACd,OAAA,WAAkB,YAAA,IAClB,KAAA,WACC,YAAY;;;ANvEf;;;iBMoFgB,YAAA,CACd,OAAA,WAAkB,YAAA,IAClB,MAAA;EAAU,WAAA,EAAa,WAAW;EAAE,OAAA;AAAA;;;;iBCvFtB,yBAAA,CAA0B,MAAA,EAAQ,WAAA,KAAgB,WAAW;AT+DjB;AAAA,iBSlD5C,iCAAA,CAAkC,MAAA,EAAQ,WAAA,IAAe,KAAA,EAAO,KAAA,GAAQ,WAAA;;;;;;;;ATyErB;;;;ACrFnE;iBQwCgB,eAAA,CAAgB,KAA4B,EAArB,SAAS;;;AT6ChD;;;;;;;;AAAmE;;;;ACrFnE;;;;;ADqFA,iBUzEgB,eAAA,CAAgB,KAAA,WAAgB,WAAA,IAAe,MAAA,WAAiB,WAAW;;;ATNnF;AA6CR;;;;;;;;;AAMsB;AAYtB;;;;iBShCgB,gBAAA,CAAiB,KAAA,WAAgB,WAAA,IAAe,MAAA,WAAiB,WAAW;;;;;;;;;iBAwD5E,UAAA,CAAW,IAAiB,EAAX,WAAW;;;;AR7F5C;;iBQ4HgB,cAAA,CACd,OAAA,qBACA,MAAA;EACG,MAAA;EAAgB,KAAA;AAAA"}
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { $n as ToolResultVideoContent, An as RepeatGuardToolMatcher, B as Session, Bn as SpawnHookContext, Cn as PromptAudioPart, D as ReadStateEntry, Dn as PromptTextPart, Dt as TurnResult, E as ToolMap, En as PromptPart, Et as ToolSpec, Fn as SessionContentBlock, Ft as OpenRouterParams, Gn as ToolOutcome, H as SessionRun, Hn as ThinkingLevel, I as SkillResource, In as SessionEndStatus, Jn as ToolResultDocumentContent, Kn as ToolResultAudioContent, Ln as SessionHookContext, Mn as ResolveContentRefBlock, Nn as RetryConfig, O as ReadStateMap, On as PromptVideoPart, P as SkillConfig, Pn as RunHookMap, Qn as ToolResultTextContent, R as SkillsConfig, Rn as SessionMessage, Sn as OAuthRefreshHookContext, St as StreamOptions, T as ToolDef, Tn as PromptImagePart, Tt as ToolResult, U as SessionStore, Ut as OpenAIParams, V as SessionData, Vn as StreamHookContext, Wn as ToolHookContext, Xn as ToolResultImageContent, Yn as ToolResultDocumentRefContent, Yt as CerebrasParams, Zn as ToolResultImageRefContent, an as AgentBehavior, ar as AgentAbortedError, bn as McpToolHookContext, bt as ProviderCapabilities, cn as AgentStats, cr as AgentProviderError, dn as ChildRunStats, dr as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, er as TurnFinishReason, fr as ClassifiedError, g as McpConnection, gn as DEFAULT_AGENT_CLOCK, hr as matchesContextExceeded, i as AgentOptions, ir as toolResultToText, jn as ResolveContentRef, kn as RepeatGuardConfig, lr as AgentToolNotAllowedError, n as AgentHookMap, nn as AnthropicParams, nr as toolOutputBudgetByteLength, on as AgentClock, or as AgentBudgetExceededError, pr as ClassifiedErrorKind, q as RemoteStoreOptions, qn as ToolResultContent, r as AgentHooks, rr as toolOutputByteLength, sn as AgentRunOptions, sr as AgentContextExceededError, t as Agent, tr as TurnUsage, w as ToolContext, wn as PromptDocumentPart, wt as ToolCall, xt as StreamCallbacks, yn as McpServerConfig, yt as Provider, z as CreateSessionOptions, zn as SessionTurn } from "./agent-NkKgz5Dh.js";
1
+ import { $n as ToolResultVideoContent, An as RepeatGuardToolMatcher, B as Session, Bn as SpawnHookContext, Cn as PromptAudioPart, D as ReadStateEntry, Dn as PromptTextPart, Dt as TurnResult, E as ToolMap, En as PromptPart, Et as ToolSpec, Fn as SessionContentBlock, Ft as OpenRouterParams, Gn as ToolOutcome, H as SessionRun, Hn as ThinkingLevel, I as SkillResource, In as SessionEndStatus, Jn as ToolResultDocumentContent, Kn as ToolResultAudioContent, Ln as SessionHookContext, Mn as ResolveContentRefBlock, Nn as RetryConfig, O as ReadStateMap, On as PromptVideoPart, P as SkillConfig, Pn as RunHookMap, Qn as ToolResultTextContent, R as SkillsConfig, Rn as SessionMessage, Sn as OAuthRefreshHookContext, St as StreamOptions, T as ToolDef, Tn as PromptImagePart, Tt as ToolResult, U as SessionStore, Ut as OpenAIParams, V as SessionData, Vn as StreamHookContext, Wn as ToolHookContext, Xn as ToolResultImageContent, Yn as ToolResultDocumentRefContent, Yt as CerebrasParams, Zn as ToolResultImageRefContent, an as AgentBehavior, ar as AgentAbortedError, bn as McpToolHookContext, bt as ProviderCapabilities, cn as AgentStats, cr as AgentProviderError, dn as ChildRunStats, dr as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, er as TurnFinishReason, fr as ClassifiedError, g as McpConnection, gn as DEFAULT_AGENT_CLOCK, hr as matchesContextExceeded, i as AgentOptions, ir as toolResultToText, jn as ResolveContentRef, kn as RepeatGuardConfig, lr as AgentToolNotAllowedError, n as AgentHookMap, nn as AnthropicParams, nr as toolOutputBudgetByteLength, on as AgentClock, or as AgentBudgetExceededError, pr as ClassifiedErrorKind, q as RemoteStoreOptions, qn as ToolResultContent, r as AgentHooks, rr as toolOutputByteLength, sn as AgentRunOptions, sr as AgentContextExceededError, t as Agent, tr as TurnUsage, w as ToolContext, wn as PromptDocumentPart, wt as ToolCall, xt as StreamCallbacks, yn as McpServerConfig, yt as Provider, z as CreateSessionOptions, zn as SessionTurn } from "./agent-CNIOsTUg.js";
2
2
  import { _ as TaskStallInfo, a as ContextType, c as ExecutionContext, g as TaskHandle, h as TaskExitInfo, l as ExecutionHandle, m as TaskEntry, n as ContextCapabilities, o as DetachedTasksCapability, p as SpawnConfig, r as ContextHardening, s as ExecResult, t as BackgroundTaskStatus } from "./types-Bs2oY7Ux.js";
3
- import { t as SandboxProvider } from "./index-CF15aqlk.js";
4
- import { Cr as InteractionToolOptions, E as statsByModel, T as flattenTurns, Zn as ValidationResult, ar as SpawnToolOptions, ir as ChildAgent, or as SpawnToolState, t as Preset, w as ModelUsage } from "./index-BgB_425D.js";
3
+ import { t as SandboxProvider } from "./sandbox-B-bMq3K6.js";
4
+ import { Cr as InteractionToolOptions, E as statsByModel, T as flattenTurns, Zn as ValidationResult, ar as SpawnToolOptions, ir as ChildAgent, or as SpawnToolState, t as Preset, w as ModelUsage } from "./index-DXwsHr4o.js";
5
5
  export { type Agent, AgentAbortedError, type AgentBehavior, AgentBudgetExceededError, type AgentClock, AgentContextExceededError, type AgentHookMap, type AgentHooks, type AgentOptions, AgentProviderError, type AgentRunOptions, type AgentStats, AgentToolNotAllowedError, type AnthropicParams, type BackgroundTaskStatus, CONTEXT_EXCEEDED_MESSAGE_PATTERNS, type CerebrasParams, type ChildAgent, type ChildRunStats, type ClassifiedError, type ClassifiedErrorKind, type ContextCapabilities, type ContextHardening, type ContextType, type CreateSessionOptions, DEFAULT_AGENT_CLOCK, type DetachedTasksCapability, type ExecResult, type ExecutionContext, type ExecutionHandle, type InteractionToolOptions, type McpConnection, type McpServerConfig, type McpToolHookContext, type ModelUsage, type OAuthRefreshHookContext, type OpenAIParams, type OpenRouterParams, type Preset, type PromptAudioPart, type PromptDocumentPart, type PromptImagePart, type PromptPart, type PromptTextPart, type PromptVideoPart, type Provider, type ProviderCapabilities, type ReadStateEntry, type ReadStateMap, type RemoteStoreOptions, type RepeatGuardConfig, type RepeatGuardToolMatcher, type ResolveContentRef, type ResolveContentRefBlock, type RetryConfig, type RunHookMap, type SandboxProvider, type Session, type SessionContentBlock, type SessionData, type SessionEndStatus, type SessionHookContext, type SessionMessage, type SessionRun, type SessionStore, type SessionTurn, type SkillConfig, type SkillResource, type SkillsConfig, type SpawnConfig, type SpawnHookContext, type SpawnToolOptions, type SpawnToolState, type StreamCallbacks, type StreamHookContext, type StreamOptions, type TaskEntry, type TaskExitInfo, type TaskHandle, type TaskStallInfo, type ThinkingLevel, type ToolCall, type ToolContext, type ToolDef, type ToolHookContext, type ToolMap, type ToolOutcome, type ToolResult, type ToolResultAudioContent, type ToolResultContent, type ToolResultDocumentContent, type ToolResultDocumentRefContent, type ToolResultImageContent, type ToolResultImageRefContent, type ToolResultTextContent, type ToolResultVideoContent, type ToolSpec, type TurnFinishReason, type TurnResult, type TurnUsage, type ValidationResult, flattenTurns, matchesContextExceeded, statsByModel, toolOutputBudgetByteLength, toolOutputByteLength, toolResultToText };
package/dist/types.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { a as toolOutputBudgetByteLength, o as toolOutputByteLength, s as toolResultToText, t as DEFAULT_AGENT_CLOCK } from "./types-CyVGdbia.js";
2
- import { a as AgentToolNotAllowedError, f as matchesContextExceeded, i as AgentProviderError, n as AgentBudgetExceededError, r as AgentContextExceededError, s as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, t as AgentAbortedError } from "./errors-BpPfMo_4.js";
2
+ import { a as AgentToolNotAllowedError, f as matchesContextExceeded, i as AgentProviderError, n as AgentBudgetExceededError, r as AgentContextExceededError, s as CONTEXT_EXCEEDED_MESSAGE_PATTERNS, t as AgentAbortedError } from "./errors-DJUxZg9b.js";
3
3
  import { i as statsByModel, n as flattenTurns } from "./stats-DAKBEKjc.js";
4
4
  export { AgentAbortedError, AgentBudgetExceededError, AgentContextExceededError, AgentProviderError, AgentToolNotAllowedError, CONTEXT_EXCEEDED_MESSAGE_PATTERNS, DEFAULT_AGENT_CLOCK, flattenTurns, matchesContextExceeded, statsByModel, toolOutputBudgetByteLength, toolOutputByteLength, toolResultToText };
@@ -568,6 +568,8 @@ background:start ← spawn succeeded; payload carries taskId + pid + outputP
568
568
  (observational; tools don't wait on listeners)
569
569
  background:exit ← at-most-once per task; the context's settle latch
570
570
  guarantees no duplicate fires (close-or-error race-safe)
571
+ execution:ready ← once per agent when the execution handle binds
572
+ (spawned or host-injected via AgentOptions.handle)
571
573
  ```
572
574
 
573
575
  **Notification queue.** The agent owns a `Map<taskId, TaskExitInfo>` populated by the `background:exit` listener. At the start of every `agent.run()`, the queue drains and each entry becomes a leading `text` block on the seeded user turn (`<task-notification>…</task-notification>` XML — see `renderTaskNotificationXml` in `src/agent.ts`). The same agent listens to `tool:after` for `shell_kill` (deletes by `task_id` from input) and `read_file` / `read` (deletes by matching the `path` argument against any pending entry's `outputPath`) so the model never receives a redundant signal when it already learned about the exit through other means. The drain happens once per entry — `Map.set` overwrites by id, so a defensive double-enqueue can't multiply notifications.
package/docs/CHAT.md CHANGED
@@ -1422,9 +1422,9 @@ const eff = effectiveContextWindow(raw) // 180_000 = raw - OUTPUT_RE
1422
1422
 
1423
1423
  The agent loop can replace oversize `tool_result` outputs with a `<persisted-output tool="…" bytes="…" path="…">` stub carrying a 2 KiB head preview. Imports from `zidane`:
1424
1424
 
1425
- - `resolvePersistDir({ userDir, sessionId })` → `<userDir>/persisted-tool-results/<sessionId>/`. Always pin to the user dir.
1426
- - `buildPersistedStub({ tool, callId, persistDir, content })` → the stub string.
1427
- - `maybePersistToolResult(input)` → returns the stub when the input crosses the threshold, otherwise `null`.
1425
+ - `resolvePersistDir({ userDir, sessionId })` → `<userDir>/tool-results/<sessionId>/`. Always pin to the user dir.
1426
+ - `buildPersistedStub({ toolName, originalBytes, persistedPath, output })` → the stub string.
1427
+ - `maybePersistToolResult(input)` → returns a tagged outcome: `persisted`, `skip`, or a bounded `error` stub when persistence was required but the blob write failed.
1428
1428
  - `PERSISTED_STUB_PREFIX` (`'<persisted-output tool="'`) — recognize a stub for tail compaction / future stale-output elision.
1429
1429
  - `PERSISTENCE_PREVIEW_BYTES = 2048` — bytes of head content included in the inline preview.
1430
1430
  - `cleanupPersistedSession(persistDir)` — wipe on session delete.
package/docs/RESTATE.md CHANGED
@@ -410,6 +410,64 @@ createAgent({
410
410
 
411
411
  `baseDir` / `location` on each catalog entry must point to paths resolvable on the runner (where `skills_read` / `skills_run_script` ultimately execute). Catalog entries seed resolution first and shadow disk-discovered skills on name collision — useful if a project still wants to layer `.zidane/skills/*` on top of a host-provided catalog.
412
412
 
413
+ ## Edge & long-lived deployments
414
+
415
+ The journal makes the *loop* durable; these seams make the rest of the runtime durable on a long-lived / edge host (a Restate worker, Cloudflare Workers, etc.).
416
+
417
+ ### Re-attach to the execution context across invocations
418
+
419
+ The agent spawns its execution context lazily on the first run (`execution.spawn()`), which is fine for a single invocation — but that spawn is NOT a journaled side effect, so on a crash mid-run the replay would mint a *fresh* sandbox/container and orphan the first. For a context the host owns across invocations, drive the spawn yourself (so it's journaled) and hand the agent the handle:
420
+
421
+ ```ts
422
+ import { createSandboxContext } from 'zidane/contexts/sandbox'
423
+ import { createDaytonaProvider } from 'zidane/contexts/daytona'
424
+
425
+ // Journal the spawn → replay returns the same sandbox id, no re-mint.
426
+ const handle = await ctx.run('spawn-sandbox', () => execution.spawn())
427
+
428
+ const agent = createAgent({
429
+ provider: restateProvider(inner, ctx),
430
+ execution,
431
+ handle, // used verbatim — agent does NOT spawn, and does NOT destroy it
432
+ clock: restateClock(ctx),
433
+ behavior: restateBehavior(),
434
+ })
435
+ ```
436
+
437
+ - **`AgentOptions.handle`** — when set, the agent skips its internal `spawn()` and never `destroy()`s the handle on teardown (the host owns that lifecycle).
438
+ - **`execution:ready` hook** — if you'd rather let the agent spawn and just *observe* the minted id (to journal it for the next invocation's re-attach), this fires once with `{ handle, spawned }`.
439
+ - **`createSandboxContext`** re-attaches by handle id: its handle id IS the sandbox id, so a handle from a prior invocation routes operations to the same sandbox even though this instance never ran `spawn()`. Pair with the provider's reconnect option (`createDaytonaProvider({ sandboxId })`).
440
+ - **`createDaytonaProvider({ ownAttached: true })`** — by default an attached (`sandboxId`) sandbox is treated as externally owned and left running on `destroy()`. Set `ownAttached` when the *host* owns it across invocations so `destroy()` applies `onDestroy` (stop / archive / delete). Spawn-time failures still never delete a pre-existing attached sandbox.
441
+ - **`zidane/contexts/sandbox` subpath** — import `createSandboxContext` from here (not the `zidane/contexts` barrel) on workerd/edge: this entry's graph is node-free, so it doesn't drag `createProcessContext` → `node:child_process` into the bundle.
442
+
443
+ ### Streaming on fresh vs resumed invocations
444
+
445
+ `createReplayTracker().isReplaying()` is conservatively `true` until the first journaled closure executes — correct for deferred abort, but on a *fresh* run it would briefly suppress opening output for a streamer that gates on it. Pass `resuming` (the host knows whether this invocation is a crash-recovery replay — e.g. the bound object already has persisted turns) and gate live streaming on `isResuming()` instead: `false` from the start of a fresh run, `true` only while replaying a resumed journal.
446
+
447
+ ```ts
448
+ const tracker = createReplayTracker({ hooks: agent.hooks, resuming: hasPriorTurns })
449
+ // stream:text consumer: emit when `!tracker.isResuming()`
450
+ ```
451
+
452
+ ### Auth on long / suspended runs
453
+
454
+ A durable run can outlive a short-lived provider token (a gateway minting signed, expiring work tokens). `anthropic({ extraHeaders })` accepts a **function** resolved per request, so each turn (and each replay-time live call) can carry a freshly-minted token without rebuilding the provider:
455
+
456
+ ```ts
457
+ anthropic({
458
+ baseURL: gatewayUrl,
459
+ extraHeaders: async () => ({ authorization: `Bearer ${await mintWorkToken()}` }),
460
+ })
461
+ ```
462
+
463
+ ### Large tool outputs & media
464
+
465
+ Large tool-output elision is NOT local-disk-bound: with `behavior.persistDir` set, the loop routes the blob through `ctx.execution.writeFile` (and the model reads it back via `read_file` → `ctx.execution.readFile`), so on a remote/sandbox context the blob lands on that context's filesystem — workerd-safe, no host disk required. Point `persistDir` at a path valid inside the execution context. For media kept *out* of the journal, persist `{ type: 'image' | 'document', ref }` blocks and resolve them at wire time via the **real** `content-ref:resolve` hook (see [Content refs](#content-refs)). There is no separate R2/KV blob backend distinct from the execution filesystem — if you need one, resolve refs through it in the hook.
466
+
467
+ ### Unbounded runs on CPU-capped runtimes
468
+
469
+ A runtime with a hard per-invocation CPU/wall cap (Cloudflare's ~5-minute limit) can't host an arbitrarily long *continuous* run — replay CPU accumulates with no built-in tail-call. Use the budget breakers to checkpoint at a turn boundary and re-invoke (Restate's delayed-tail-call / continue-as-new pattern): cap the invocation with `behavior.maxTurns` / `maxWallMs`, persist via `restateSessionStore`, and when a run returns without finishing, schedule a fresh invocation of the same object key that resumes from the persisted turns. The session store is the checkpoint; no dedicated zidane helper is required (and a generic one would have to own the host's re-invocation contract).
470
+
413
471
  ## Failure modes
414
472
 
415
473
  | Scenario | What happens |
package/docs/SKILL.md CHANGED
@@ -341,6 +341,7 @@ Hooks fire at every lifecycle point via [hookable](https://github.com/unjs/hooka
341
341
  | `tool:cancelled` | Per-call cancel via `agent.cancelTool(callId, reason?)` (typically a TUI "cancel this tool" affordance) | — | `+ reason: string, runToolCounts` — wire result is the canonical `TOOL_USE_CANCELLED_MESSAGE` with `isError: true`; `tool:transform` + `tool:after` do **not** fire for the cancelled call |
342
342
  | `background:start` | Background task spawned via `shell({ run_in_background: true })` | — | `taskId, pid, command, cwd, outputPath, startedAt` — observational; subscribe for telemetry / "task started" toasts |
343
343
  | `background:exit` | Background task terminated (natural exit, `shell_kill`, or `agent.destroy()` teardown) | — | `taskId, status: 'exited' \| 'killed', exitCode, signal?, outputPath, durationMs, command` — fires at-most-once per task; the agent's internal listener queues a `<task-notification>` for injection on the next user-turn |
344
+ | `execution:ready` | Execution handle bound (first run's lazy `spawn()`, or immediately when `AgentOptions.handle` was injected) | — | `handle, spawned` — fires once per agent; `spawned: false` for an injected handle. Durable hosts journal the minted handle id here for re-attach on the next invocation |
344
345
  | `usage` | Per-turn usage | — | `turn, turnId, usage, totalIn, totalOut` |
345
346
  | `output` | Structured output extracted | — | `output, schema` |
346
347
  | `budget:exceeded` | Per-turn tool-output bytes over `behavior.toolOutputBudget` | — | `turn, turnId, bytes, budget` |
package/docs/TUI.md CHANGED
@@ -470,7 +470,7 @@ The `'compact-summary'` `StreamEvent` (carrying `compact: { replacedCount, model
470
470
 
471
471
  - `behavior.persistThreshold` defaults to 8 KiB on the built-in profiles; the TUI overrides to 0 when the user toggles persistence off.
472
472
  - `behavior.persistExcludeTools` = `DEFAULT_PERSIST_EXCLUDE_TOOLS` from `zidane/chat` (`read_file`, `tool_search`, `skills_use`, `skills_read`, `present_plan`, `ask_user`, `spawn`).
473
- - `behavior.persistDir` is `<userDir>/persisted-tool-results/<sessionId>/` (always pinned to user dir, never the project dir) — `resolvePersistDir` from `zidane`.
473
+ - `behavior.persistDir` is `<userDir>/tool-results/<sessionId>/` (always pinned to user dir, never the project dir) — `resolvePersistDir` from `zidane`.
474
474
  - Flipping the toggle takes effect on the **next** session activation; in-flight streams aren't torn down. Persisted blobs already on disk stay readable via `read_file` on the stub's `path` attribute.
475
475
 
476
476
  ## MCP servers + OAuth login
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zidane",
3
- "version": "5.13.13",
3
+ "version": "5.13.15",
4
4
  "description": "an agent that goes straight to the goal",
5
5
  "type": "module",
6
6
  "private": false,
@@ -70,6 +70,11 @@
70
70
  "import": "./dist/contexts.js",
71
71
  "default": "./dist/contexts.js"
72
72
  },
73
+ "./contexts/sandbox": {
74
+ "types": "./dist/contexts/sandbox.d.ts",
75
+ "import": "./dist/contexts/sandbox.js",
76
+ "default": "./dist/contexts/sandbox.js"
77
+ },
73
78
  "./contexts/docker": {
74
79
  "types": "./dist/contexts/docker.d.ts",
75
80
  "import": "./dist/contexts/docker.js",
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-NkKgz5Dh.d.ts","names":[],"sources":["../src/chat/context-breakdown.ts","../src/errors.ts","../src/types.ts","../src/providers/oauth.ts","../src/providers/anthropic.ts","../src/providers/arcee.ts","../src/providers/baseten.ts","../src/providers/cerebras.ts","../src/providers/cursor.ts","../src/providers/local.ts","../src/providers/openai.ts","../src/providers/openai-compat.ts","../src/providers/openrouter.ts","../src/providers/schema-sanitize.ts","../src/providers/xai.ts","../src/providers/index.ts","../src/session/messages.ts","../src/session/file-map.ts","../src/session/memory.ts","../src/session/remote.ts","../src/session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A;EAAW,UAAA;EAAY,OAAA;EAAS,SAAA,EAAW,cAAA;EAAgB,MAAA,EAAQ,WAAA;EAAa,YAAA;EAAc,WAAA;EAAa,KAAA;EAAO,KAAA,EAAO,YAAA;EAAc,KAAA,EAAO,UAAA;EAAY;AAAA,GAAY,YAAA,GAAe,KAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"contexts-DHi8LPCp.js","names":[],"sources":["../src/contexts/process.ts","../src/contexts/sandbox.ts","../src/contexts/types.ts"],"sourcesContent":["/**\n * In-process execution context.\n *\n * Runs everything in the current Node/Bun process.\n * No isolation — fastest, used as the default.\n */\n\nimport type { Buffer } from 'node:buffer'\nimport type { ChildProcess } from 'node:child_process'\nimport type { WriteStream } from 'node:fs'\nimport type { ContextCapabilities, ExecResult, ExecutionContext, ExecutionHandle, ListFilesEntry, SpawnConfig, TaskEntry, TaskExitInfo, TaskHandle, TaskStallInfo } from './types'\nimport { createWriteStream } from 'node:fs'\nimport { mkdir, readdir, readFile, realpath, stat, writeFile } from 'node:fs/promises'\nimport { dirname, isAbsolute, relative, resolve } from 'node:path'\nimport { lazyAsync } from '../lazy'\nimport { globFilesLocal, globLiteralPrefix } from './glob'\n\n/**\n * Lazily load `node:child_process`'s `spawn` (memoized after first use).\n *\n * Deliberately NOT a static top-level import. `createAgent` pulls this module\n * into the graph as the default execution context, so a static\n * `import … from 'node:child_process'` would make merely importing zidane\n * depend on subprocess support. Runtimes that gate that builtin at import time\n * — Supabase Edge Functions, Cloudflare `nodejs_compat`, other shell-less V8\n * isolates — would then fail to load the package at all. Deferring the import\n * to the first `exec` keeps `import 'zidane'` + the provider loop runnable\n * there; only actually invoking a shell command touches subprocess, which is\n * exactly where an unsupported host should fail (the agent loop turns that\n * throw into a clean tool-result error).\n */\nconst loadSpawn = lazyAsync(async () => (await import('node:child_process')).spawn)\n\n/**\n * Whether the host supports POSIX process groups (the `detached: true` +\n * `process.kill(-pid)` combination). Windows doesn't — its job-object\n * model is shaped differently — so on win32 we fall back to killing the\n * shell wrapper alone (matches pre-fix behavior; better than nothing).\n */\nconst SUPPORTS_PROCESS_GROUPS = process.platform !== 'win32'\n\n/**\n * Default cap on captured stdout / stderr per child. Matches the\n * pre-fix `child_process.exec` setting so existing callers see the\n * same buffer envelope. Output beyond this is truncated and a\n * marker is appended to stderr.\n */\nconst DEFAULT_MAX_BUFFER = 10 * 1024 * 1024\n\n/**\n * How long `destroy()` waits for a SIGTERM'd background task to settle\n * before escalating to SIGKILL and abandoning the wait. Matches the MCP\n * connection's default `closeTimeout` so `agent.destroy()` stays bounded\n * by a single grace period regardless of which leg is slowest.\n */\nconst DESTROY_SIGTERM_GRACE_MS = 5_000\n\n/**\n * How long after the child's `exit` event we keep waiting for `close`\n * before settling with the output collected so far.\n *\n * `close` fires only once every stdio pipe has closed — and a\n * daemonized grandchild that inherited stdout/stderr (a dev server\n * started with `&`, `nohup` without redirection, simulator helpers, …)\n * keeps those pipes open indefinitely. Pre-fix, a foreground `exec`\n * whose command finished in milliseconds would hang until its timeout,\n * then `killProcessGroup` took the intentionally-backgrounded daemon\n * down with it. The process itself is done at `exit`; this grace only\n * exists to let normally-closing pipes flush their tail bytes.\n */\nconst EXIT_PIPE_DRAIN_GRACE_MS = 1_500\n\n/**\n * Sanitize a task id before it's joined into a filesystem path.\n *\n * We mint `bash_<n>` ids ourselves (no user input flows into the path\n * for `ProcessContext`), so this is defensive — but third-party contexts\n * MAY accept caller-provided ids, so the helper exists for them too.\n * Anything that doesn't match the expected shape is rejected — never\n * coerced — so the call site sees a clear error rather than a\n * traversal-shaped path.\n */\nconst TASK_ID_RE = /^[a-z][\\w-]*$/i\n\nfunction assertSafeTaskId(taskId: string): void {\n if (!TASK_ID_RE.test(taskId))\n throw new Error(`Invalid task id \"${taskId}\" — must match ${TASK_ID_RE}.`)\n}\n\n/**\n * Format `date` as `YYYYMMDD-HHMMSS-mmm` in UTC.\n *\n * Pinned to UTC so the lexical sort of two timestamps always matches\n * their chronological order (local time + DST does not). Used as the\n * per-context suffix on background-task log filenames; see the field\n * doc on `contextTimestamp` for the why.\n */\nexport function formatContextTimestamp(date: Date): string {\n const pad2 = (n: number): string => n.toString().padStart(2, '0')\n const pad3 = (n: number): string => n.toString().padStart(3, '0')\n const y = date.getUTCFullYear()\n const M = pad2(date.getUTCMonth() + 1)\n const d = pad2(date.getUTCDate())\n const h = pad2(date.getUTCHours())\n const m = pad2(date.getUTCMinutes())\n const s = pad2(date.getUTCSeconds())\n const ms = pad3(date.getUTCMilliseconds())\n return `${y}${M}${d}-${h}${m}${s}-${ms}`\n}\n\n/** Pattern of a background-task log filename. Used by tests + tooling. */\nexport const TASK_LOG_FILENAME_RE = /^(bash_\\d+)\\.(\\d{8}-\\d{6}-\\d{3})\\.log$/\n\n/** Copy only the named keys (when present) from an env object. */\nfunction pickEnv(env: NodeJS.ProcessEnv, keys: string[]): NodeJS.ProcessEnv {\n const out: NodeJS.ProcessEnv = {}\n for (const key of keys) {\n if (env[key] !== undefined)\n out[key] = env[key]\n }\n return out\n}\n\nexport function createProcessContext(config?: SpawnConfig): ExecutionContext {\n let counter = 0\n const handles = new Map<string, ExecutionHandle>()\n const defaultCwd = config?.cwd ?? process.cwd()\n const defaultEnv = config?.env\n const destroyGraceMs = config?.destroyGraceMs ?? DESTROY_SIGTERM_GRACE_MS\n\n // Base environment children inherit. Defaults to the full parent env\n // (back-compat); when `inheritEnv: false`, only a minimal allow-list is\n // forwarded so parent secrets (e.g. API keys Bun loaded from `.env`) aren't\n // exposed to tool commands. Explicit `env` / per-call env always apply on top.\n const baseEnv: NodeJS.ProcessEnv = config?.inheritEnv === false\n ? pickEnv(process.env, ['PATH', 'HOME', 'SHELL', 'LANG', 'LC_ALL', 'USER', 'TERM', 'TMPDIR'])\n : process.env\n\n // Optional workspace containment for the file methods. Unset = no checks.\n const workspaceRoot = config?.workspaceRoot !== undefined\n ? resolve(defaultCwd, config.workspaceRoot)\n : undefined\n\n /** True when `target` is the root itself or lives under it. */\n function isWithinRoot(root: string, target: string): boolean {\n const rel = relative(root, target)\n return rel === '' || (!rel.startsWith('..') && !isAbsolute(rel))\n }\n\n /**\n * Resolve `path` against the handle cwd and, when a `workspaceRoot` is\n * configured, reject anything that escapes it. Uses `realpath` on the\n * nearest existing ancestor so symlink escapes (and `..`) are caught for\n * both existing and not-yet-created targets.\n */\n async function resolveContained(handle: ExecutionHandle, path: string): Promise<string> {\n const full = resolve(handle.cwd, path)\n if (workspaceRoot === undefined)\n return full\n\n // Canonicalize the deepest existing ancestor to defeat symlink escapes;\n // the non-existent tail (for writes) is appended back verbatim.\n let existing = full\n const tail: string[] = []\n while (true) {\n try {\n existing = await realpath(existing)\n break\n }\n catch {\n const parent = dirname(existing)\n if (parent === existing) {\n // Reached the filesystem root without an existing ancestor.\n existing = parent\n break\n }\n // `relative` (not slice) so the segment is correct even on Windows\n // drive roots where `dirname('C:\\\\foo')` is `C:\\\\` (no 1-char sep).\n tail.unshift(relative(parent, existing))\n existing = parent\n }\n }\n const canonical = tail.length ? resolve(existing, ...tail) : existing\n const canonicalRoot = await realpath(workspaceRoot).catch(() => workspaceRoot)\n if (!isWithinRoot(canonicalRoot, canonical)) {\n throw new Error(\n `Path escapes the workspace root: ${path} (resolved outside ${canonicalRoot})`,\n )\n }\n return full\n }\n\n /**\n * Per-context background-task registry. Entries live for the context's\n * lifetime — even after the child exits — so the model can read output\n * of completed tasks until `destroy()` tears everything down. Kept as\n * a plain Map (not a class) per code-quality checklist #7: no premature\n * abstraction. The state and the operations on it live inline.\n */\n const tasks = new Map<string, TaskState>()\n let taskCounter = 0\n\n /**\n * Per-context UTC timestamp segment baked into every background task's\n * log filename. Same `taskCounter` value across two contexts (e.g. a\n * TUI restart) would otherwise re-open the SAME `bash_<n>.log` file —\n * we open with `flags: 'a'` so the new task would APPEND into the old\n * log, producing scrambled output. The timestamp guarantees each\n * context owns a distinct log filename without forcing the\n * model-facing task id (`bash_<n>`) to grow longer.\n *\n * Format: `YYYYMMDD-HHMMSS-mmm` in UTC.\n * - Sortable (lexical sort = chronological sort).\n * - Unambiguous (UTC sidesteps DST / locale shifts).\n * - Filesystem-safe (digits + hyphens only).\n * - Millisecond precision avoids same-second-restart collisions.\n *\n * The timestamp is computed once per context, NOT per task — all of a\n * context's tasks share the same suffix so a directory listing groups\n * cleanly by \"which run produced these\".\n */\n const contextTimestamp = formatContextTimestamp(new Date())\n\n /**\n * Last-resort orphan reaper. With `detached: true`, background tasks\n * are in their OWN process group — when the parent (zidane TUI) dies,\n * the OS does NOT send them SIGHUP and they keep running indefinitely.\n * The user's \"Ctrl+C the TUI\" intent is \"stop everything I started\",\n * not \"leak a `sleep 60` into the background\".\n *\n * `process.on('exit')` fires SYNCHRONOUSLY on `process.exit()` AND on\n * natural shutdown — exactly the seam we need. The handler can only\n * do synchronous work (Node ignores async), but `process.kill` IS\n * synchronous, so a SIGTERM-the-group sweep lands cleanly. The kill\n * is best-effort: already-dead children throw ESRCH (swallowed).\n *\n * Registered lazily on first `execBackground` so contexts that never\n * background a task don't pay the listener cost. Deregistered in\n * `destroy()` so reconstructed contexts don't accumulate listeners\n * (Node warns past 10 — a long-running session that switches sessions\n * frequently would otherwise hit that).\n */\n let exitHandlerRegistered = false\n const exitHandler = (): void => {\n for (const task of tasks.values()) {\n if (task.status !== 'running')\n continue\n const pid = task.child.pid\n if (pid === undefined)\n continue\n try {\n if (SUPPORTS_PROCESS_GROUPS)\n process.kill(-pid, 'SIGTERM')\n else\n process.kill(pid, 'SIGTERM')\n }\n catch {\n // ESRCH (already dead) / EPERM (lost ownership). Swallow —\n // the process either won't kill cleanly OR is already gone,\n // both acceptable at shutdown.\n }\n }\n }\n\n return {\n type: 'process',\n\n capabilities: {\n shell: true,\n filesystem: true,\n glob: true,\n network: true,\n gpu: false,\n // Background tasks are OS children of this process's machine —\n // they survive `agent.destroy()` reassignment games but NOT a\n // host machine reboot, and the orphan reaper kills them on\n // process exit. That's the 'process-lifetime' tier.\n detachedTasks: 'process-lifetime',\n } satisfies ContextCapabilities,\n\n async spawn(overrides?: SpawnConfig): Promise<ExecutionHandle> {\n const id = `process-${++counter}`\n const cwd = overrides?.cwd ?? defaultCwd\n\n // Only create `cwd` when it is genuinely missing. An unconditional\n // `mkdir(cwd, { recursive: true })` on an already-existing directory is a\n // wasted write that needlessly demands FS-write permission — which breaks\n // read-only / no-write runtimes (Supabase Edge Functions write only to\n // `/tmp`; Deno edge isolates) where the cwd already exists. `stat` is a\n // read (permitted there); the write is attempted only on a confirmed\n // ENOENT. Any other stat failure (e.g. EACCES on a sandbox-restricted\n // path) must NOT escalate to a mkdir we'd also be denied — assume present\n // and let a later file op surface a precise error if it truly isn't.\n let needsCreate = false\n try {\n await stat(cwd)\n }\n catch (err) {\n needsCreate = (err as NodeJS.ErrnoException)?.code === 'ENOENT'\n }\n if (needsCreate)\n await mkdir(cwd, { recursive: true })\n\n const handle: ExecutionHandle = { id, type: 'process', cwd }\n handles.set(id, handle)\n return handle\n },\n\n async exec(\n handle: ExecutionHandle,\n command: string,\n options?: { cwd?: string, env?: Record<string, string>, timeout?: number, signal?: AbortSignal },\n ): Promise<ExecResult> {\n const cwd = options?.cwd ? resolve(handle.cwd, options.cwd) : handle.cwd\n\n // Pre-aborted fast path: skip the spawn entirely and synthesize a\n // killed-by-signal result. Saves a spawn round-trip + dodges Node\n // emitting an immediate `AbortError`.\n if (options?.signal?.aborted) {\n return { stdout: '', stderr: 'aborted by signal before spawn', exitCode: 143 }\n }\n\n const timeoutMs = (options?.timeout ?? config?.limits?.timeout ?? 30) * 1000\n const maxBuffer = DEFAULT_MAX_BUFFER\n\n // Lazy subprocess load (see `loadSpawn`) — awaited before the Promise\n // executor so the spawn primitive is ready synchronously inside it.\n const spawnChild = await loadSpawn()\n\n return new Promise<ExecResult>((resolveP) => {\n // Spawn as a NEW process group leader so we can kill the whole\n // subtree on abort. Without `detached: true`, sending SIGTERM to\n // the shell's pid only kills the shell wrapper — its child\n // processes (the actual `sleep`, `npm`, `python`, …) get\n // reparented to init and keep running. `process.kill(-pid, …)`\n // with a NEGATIVE pid targets the whole process group; that's\n // the POSIX idiom for \"shut down everything I started\".\n //\n // On Windows there are no process groups in the POSIX sense, so\n // we leave `detached` off and accept the shell-only kill — the\n // platform's job-object machinery is the path forward there if\n // we ever need it, but it's not the bug zidane's users are\n // hitting today.\n const child = spawnChild('/bin/sh', ['-c', command], {\n cwd,\n env: { ...baseEnv, ...defaultEnv, ...options?.env },\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: SUPPORTS_PROCESS_GROUPS,\n })\n\n let stdout = ''\n let stderr = ''\n // Byte accounting per slot. `maxBuffer` is a BYTE budget — comparing\n // it against the accumulated string's UTF-16 `.length` undercounts\n // multi-byte UTF-8 (overshooting the budget) and slicing the Buffer\n // at a char-derived offset can split a codepoint mid-sequence.\n let stdoutBytes = 0\n let stderrBytes = 0\n let bufferTruncated = false\n let timedOut = false\n let killedByAbort = false\n let settled = false\n\n const appendCapped = (slot: 'stdout' | 'stderr', chunk: Buffer): void => {\n const used = slot === 'stdout' ? stdoutBytes : stderrBytes\n if (used >= maxBuffer) {\n // Buffer filled exactly on a prior chunk boundary — this chunk\n // is data we're dropping, so it still counts as truncation.\n if (!bufferTruncated) {\n bufferTruncated = true\n killProcessGroup(child, 'SIGTERM')\n }\n return\n }\n const room = maxBuffer - used\n let piece = chunk\n if (chunk.length > room) {\n // Cut on a UTF-8 codepoint boundary: if the byte right after the\n // cut is a continuation byte (0b10xxxxxx), the cut would land\n // mid-codepoint — back off until it doesn't.\n let end = room\n while (end > 0 && (chunk[end] & 0xC0) === 0x80)\n end--\n piece = chunk.subarray(0, end)\n }\n if (slot === 'stdout') {\n stdout += piece.toString('utf8')\n stdoutBytes += piece.length\n }\n else {\n stderr += piece.toString('utf8')\n stderrBytes += piece.length\n }\n if (chunk.length > room) {\n bufferTruncated = true\n // Kill on overflow — matches `execAsync`'s `maxBuffer`\n // behavior (which kills the child and surfaces an error).\n killProcessGroup(child, 'SIGTERM')\n }\n }\n\n child.stdout?.on('data', chunk => appendCapped('stdout', chunk as Buffer))\n child.stderr?.on('data', chunk => appendCapped('stderr', chunk as Buffer))\n\n const timeoutTimer = timeoutMs > 0\n ? setTimeout(() => {\n timedOut = true\n killProcessGroup(child, 'SIGTERM')\n }, timeoutMs)\n : undefined\n\n const onAbort = (): void => {\n killedByAbort = true\n killProcessGroup(child, 'SIGTERM')\n }\n const userSignal = options?.signal\n if (userSignal)\n userSignal.addEventListener('abort', onAbort, { once: true })\n\n let exitGraceTimer: NodeJS.Timeout | undefined\n\n const settle = (exitCode: number, extraStderr?: string): void => {\n if (settled)\n return\n settled = true\n if (timeoutTimer)\n clearTimeout(timeoutTimer)\n if (exitGraceTimer)\n clearTimeout(exitGraceTimer)\n if (userSignal)\n userSignal.removeEventListener('abort', onAbort)\n const finalStderr = extraStderr\n ? (stderr ? `${stderr}\\n${extraStderr}` : extraStderr)\n : stderr\n resolveP({ stdout, stderr: finalStderr, exitCode })\n }\n\n // Shared classification ladder for `close` (fast path: pipes\n // drained normally) and the post-`exit` grace (pipes held open\n // by a daemonized grandchild). Order matters: killed-by-our-\n // abort wins over timeout wins over natural exit, because the\n // abort listener fires first when the user cancels mid-\n // timeout-window.\n const settleFromStatus = (code: number | null, signal: NodeJS.Signals | null): void => {\n if (killedByAbort) {\n settle(143, 'aborted by signal')\n return\n }\n if (timedOut) {\n settle(124, `command timed out after ${timeoutMs}ms`)\n return\n }\n if (bufferTruncated) {\n settle(143, `output exceeded ${maxBuffer}-byte buffer; process killed`)\n return\n }\n if (signal) {\n // Killed by some other signal we didn't issue. Treat as\n // signal-killed for consumer compat.\n settle(128 + 15, `terminated by signal ${signal}`)\n return\n }\n settle(typeof code === 'number' ? code : 1)\n }\n\n child.on('error', (err) => {\n // Spawn failure (ENOENT on `/bin/sh`, EACCES, …). Mirror\n // `execAsync`'s \"rejects with an Error\" shape by surfacing\n // the message on stderr and a non-zero exit.\n settle(1, err.message)\n })\n\n child.on('close', (code, signal) => settleFromStatus(code, signal))\n\n child.on('exit', (code, signal) => {\n // The command is DONE here — `close` only adds \"every stdio\n // pipe closed\", which a daemonized grandchild can block\n // forever (see EXIT_PIPE_DRAIN_GRACE_MS). Give the pipes a\n // short drain grace, then settle with what we have and\n // release them. The daemon keeps running — that was the\n // command's intent; killing the group here would be wrong.\n exitGraceTimer = setTimeout(() => {\n if (settled)\n return\n child.stdout?.destroy()\n child.stderr?.destroy()\n settleFromStatus(code, signal)\n }, EXIT_PIPE_DRAIN_GRACE_MS)\n exitGraceTimer.unref?.()\n })\n })\n },\n\n async readFile(handle: ExecutionHandle, path: string): Promise<string> {\n return readFile(await resolveContained(handle, path), 'utf-8')\n },\n\n async readFileBinary(handle: ExecutionHandle, path: string): Promise<Uint8Array> {\n // No encoding → returns a Buffer (which is a Uint8Array). Used by\n // read_file to ferry image / binary content into the multimodal route.\n const buf = await readFile(await resolveContained(handle, path))\n return new Uint8Array(buf)\n },\n\n async writeFile(handle: ExecutionHandle, path: string, content: string): Promise<void> {\n const fullPath = await resolveContained(handle, path)\n await mkdir(dirname(fullPath), { recursive: true })\n await writeFile(fullPath, content, 'utf-8')\n },\n\n async listFiles(handle: ExecutionHandle, path: string, options): Promise<ListFilesEntry[]> {\n if (options?.glob) {\n await resolveContained(handle, globLiteralPrefix(path) || '.')\n const entries = await globFilesLocal(path, handle.cwd, {\n limit: options?.limit ?? 1000,\n metadata: options?.metadata,\n })\n if (workspaceRoot === undefined)\n return entries\n const contained: ListFilesEntry[] = []\n for (const entry of entries) {\n try {\n await resolveContained(handle, entry.path)\n contained.push(entry)\n }\n catch {\n // Symlink escapes can be discovered by broad globs like `**/*`.\n // Keep the process context's workspaceRoot invariant by filtering\n // them exactly as read/write paths are filtered.\n }\n }\n return contained\n }\n return readdir(await resolveContained(handle, path))\n },\n\n async execBackground(\n handle: ExecutionHandle,\n command: string,\n options: {\n cwd?: string\n env?: Record<string, string>\n outputDir: string\n onExit?: (info: TaskExitInfo) => void\n maxOutputBytes?: number\n stallTimeoutMs?: number\n onStall?: (info: TaskStallInfo) => void\n },\n ): Promise<TaskHandle> {\n const cwd = options.cwd ? resolve(handle.cwd, options.cwd) : handle.cwd\n\n // Resolve the subprocess primitive up front (see `loadSpawn`) so a runtime\n // without `node:child_process` fails BEFORE we allocate the log dir +\n // output stream — no orphaned fd / log file on an unsupported host.\n const spawnChild = await loadSpawn()\n\n await mkdir(options.outputDir, { recursive: true })\n\n // Mint id + path. The id is sequential per context (model-facing,\n // short, ergonomic for `shell_kill`). The log FILENAME embeds the\n // context's start timestamp so two contexts sharing an `outputDir`\n // (TUI restart on the same session, concurrent zidane instances,\n // …) never resolve to the same file — we open with `flags: 'a'`\n // and a name collision would interleave their output. Path\n // validation is defensive — we mint our own ids so it never trips\n // today, but it pins the invariant for forks / third parties.\n const taskId = `bash_${++taskCounter}`\n assertSafeTaskId(taskId)\n const outputPath = resolve(options.outputDir, `${taskId}.${contextTimestamp}.log`)\n\n // Install the orphan reaper on first task. See `exitHandler`'s\n // JSDoc for the kill-on-shutdown rationale.\n if (!exitHandlerRegistered) {\n process.on('exit', exitHandler)\n exitHandlerRegistered = true\n }\n\n // Open the output file. The timestamped path is unique per context\n // so a brand-new file is the expected outcome; `flags: 'a'` is kept\n // as the safe default (preserves bytes if the path collides for any\n // reason — same-millisecond context creation, manual pre-population,\n // etc.) rather than blindly truncating. Streams are opened BEFORE\n // the spawn to avoid a race where the child writes before the stream\n // is ready — `child_process` buffers stdio until the consumer\n // attaches, but the FS handle has to exist either way for our pipe.\n const outputStream: WriteStream = createWriteStream(outputPath, { flags: 'a' })\n // Surface FS errors (ENOSPC, EACCES on a remounted FS, etc.)\n // under ZIDANE_DEBUG instead of crashing the host via an\n // unhandled 'error' event. Without a listener Node escalates\n // any stream-level error to an uncaughtException and the whole\n // process exits — the model and the user would lose every\n // unrelated in-flight piece of work to one bad task's disk\n // hiccup. Swallow + log is the safer default for a fire-and-\n // forget log writer; the task's exit code still reports.\n outputStream.on('error', (err) => {\n if (process.env.ZIDANE_DEBUG)\n process.stderr.write(`[zidane/contexts] task ${taskId} log stream error: ${err.message}\\n`)\n })\n\n // Spawn as a NEW process group leader so we can kill the whole\n // subtree on demand. Same primitive `exec` uses for foreground\n // shells — see the long comment in that method for the\n // process-group rationale.\n const child = spawnChild('/bin/sh', ['-c', command], {\n cwd,\n env: { ...baseEnv, ...defaultEnv, ...options.env },\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: SUPPORTS_PROCESS_GROUPS,\n })\n\n const state: TaskState = {\n taskId,\n handleId: handle.id,\n pid: child.pid ?? -1,\n command,\n cwd,\n startedAt: Date.now(),\n outputPath,\n outputStream,\n child,\n status: 'running',\n bytesWritten: 0,\n settled: false,\n onExit: options.onExit,\n }\n tasks.set(taskId, state)\n\n // Output cap (optional). Beyond the cap the process keeps\n // running — head-priority retention: bytes already on disk stay,\n // subsequent bytes are counted but dropped, and a structured\n // truncation marker is appended at settle so the model can\n // pattern-match the loss. Killing on overflow (what the\n // foreground `exec` does) would be wrong here: long-running\n // servers legitimately log forever.\n const maxOutputBytes = typeof options.maxOutputBytes === 'number' && options.maxOutputBytes > 0\n ? options.maxOutputBytes\n : undefined\n let droppedBytes = 0\n // Latched on the first overflowing chunk. Without it, a codepoint-\n // boundary backoff (below) leaves a few bytes of \"room\" that later\n // chunks would dribble into — appending disjoint fragments from\n // much-later output right after the cut point.\n let capExhausted = false\n\n // Stall watchdog (optional). One-shot per quiet period: fires\n // `onStall` after `stallTimeoutMs` of no output, then stays quiet\n // until fresh output re-arms it. `unref()` so a pending timer\n // never holds the host process open.\n const stallTimeoutMs = typeof options.stallTimeoutMs === 'number' && options.stallTimeoutMs > 0\n ? options.stallTimeoutMs\n : undefined\n const onStall = options.onStall\n let stallTimer: NodeJS.Timeout | undefined\n let lastOutputAt = Date.now()\n const armStallTimer = (): void => {\n if (!stallTimeoutMs || !onStall)\n return\n if (stallTimer)\n clearTimeout(stallTimer)\n stallTimer = setTimeout(() => {\n stallTimer = undefined\n if (state.settled)\n return\n try {\n onStall({\n taskId,\n command,\n outputPath,\n stalledForMs: Date.now() - lastOutputAt,\n bytesWritten: state.bytesWritten,\n })\n }\n catch (err) {\n if (process.env.ZIDANE_DEBUG)\n process.stderr.write(`[zidane/contexts] task ${taskId} onStall threw: ${err instanceof Error ? err.message : String(err)}\\n`)\n }\n }, stallTimeoutMs)\n stallTimer.unref?.()\n }\n const clearStallTimer = (): void => {\n if (stallTimer) {\n clearTimeout(stallTimer)\n stallTimer = undefined\n }\n }\n armStallTimer()\n\n // Pipe both streams into the same file. Order between stdout and\n // stderr is preserved per-stream; cross-stream ordering depends on\n // Node's event loop — acceptable interleaving for log-shaped\n // output. Tracked-bytes is updated on every chunk for the\n // listBackground UX (counted even past the cap, so the UX shows\n // the task's TRUE output volume).\n const appendChunk = (chunk: Buffer): void => {\n state.bytesWritten += chunk.length\n lastOutputAt = Date.now()\n armStallTimer()\n if (maxOutputBytes !== undefined) {\n const onDisk = state.bytesWritten - droppedBytes - chunk.length\n if (capExhausted || onDisk >= maxOutputBytes) {\n capExhausted = true\n droppedBytes += chunk.length\n return\n }\n const room = maxOutputBytes - onDisk\n if (chunk.length > room) {\n capExhausted = true\n // Cut on a UTF-8 codepoint boundary, same as the foreground\n // exec cap: back off while the byte after the cut is a\n // continuation byte (0b10xxxxxx) so the log never ends in a\n // mangled half-codepoint right before the truncation marker.\n let end = room\n while (end > 0 && (chunk[end] & 0xC0) === 0x80)\n end--\n droppedBytes += chunk.length - end\n if (end > 0)\n outputStream.write(chunk.subarray(0, end))\n return\n }\n }\n outputStream.write(chunk)\n }\n child.stdout?.on('data', chunk => appendChunk(chunk as Buffer))\n child.stderr?.on('data', chunk => appendChunk(chunk as Buffer))\n\n // Settle path — at-most-once via `settled` flag (checklist #14).\n // Three trigger sources: `close` (natural OR signal-killed),\n // `error` (spawn failure), explicit `killBackground` (which\n // routes through `close` itself after the SIGTERM lands).\n const settle = (cause: 'close' | 'error', code: number | null, signal: NodeJS.Signals | null, errMessage?: string): void => {\n if (state.settled)\n return\n state.settled = true\n clearStallTimer()\n state.endedAt = Date.now()\n\n // Determine final status from cause + signal.\n const status: TaskExitInfo['status']\n = signal === 'SIGTERM' || state.killRequested\n ? 'killed'\n : 'exited'\n // Signal-killed children report null `code` from Node; map back\n // to the POSIX `128 + signum` convention so consumers can read\n // an integer either way.\n const exitCode = code !== null\n ? code\n : signal === 'SIGTERM'\n ? 143\n : signal\n ? 128\n : 1\n state.status = status\n state.exitCode = exitCode\n if (signal)\n state.signal = signal\n\n // Flush + close the WriteStream BEFORE firing onExit — model\n // may read the file in the same turn it receives the\n // notification, and a still-open stream can hold tail bytes\n // back from disk. `stream.end(callback)` is the documented\n // \"all queued writes are flushed when this fires\" idiom.\n //\n // ORDER MATTERS: any error preamble we want in the log file\n // (spawn failures with no stdout, buffer overflows) MUST be\n // written BEFORE `end()` — once `end()` is called the stream\n // is closed for writing and subsequent `.write()` calls are\n // dropped. Earlier revisions had this reversed and silently\n // lost ENOENT-on-`/bin/sh` messages.\n if (errMessage) {\n try {\n outputStream.write(`\\n${errMessage}\\n`)\n }\n catch {\n // Stream may have errored before this — best-effort only.\n }\n }\n if (droppedBytes > 0) {\n try {\n // Structured + loud — the model can pattern-match the tag\n // rather than misread a truncated log as the full output.\n outputStream.write(`\\n<output-truncated bytes-dropped=\"${droppedBytes}\"/>\\n`)\n }\n catch {\n // Best-effort only, same as the error preamble above.\n }\n }\n outputStream.end(() => {\n // `stateToTaskExitInfo` reads the same fields we just set\n // on `state`, so the snapshot the consumer gets matches the\n // post-settle state exactly. `onExit` is optional — pull-based\n // consumers reconcile via `listBackground` instead.\n try {\n state.onExit?.(stateToTaskExitInfo(state))\n }\n catch (err) {\n // Defensive — a buggy onExit callback shouldn't crash the\n // host. Surface via stderr under ZIDANE_DEBUG; otherwise\n // swallow. Matches the spawn-tool's bubbleError pattern.\n if (process.env.ZIDANE_DEBUG)\n process.stderr.write(`[zidane/contexts] task ${taskId} onExit threw: ${err instanceof Error ? err.message : String(err)}\\n`)\n }\n })\n }\n\n child.on('close', (code, signal) => settle('close', code, signal))\n child.on('error', err => settle('error', null, null, `[spawn error] ${err.message}`))\n\n child.on('exit', (code, signal) => {\n // Same pipe-hostage hazard as foreground `exec`: a grandchild\n // that inherited the pipes blocks `close` forever, leaving the\n // task `running` (and any waiter parked) long after the\n // command exited. Settle after a short drain grace; `settle`'s\n // latch makes this a no-op when `close` already fired.\n const exitGraceTimer = setTimeout(() => {\n if (state.settled)\n return\n child.stdout?.destroy()\n child.stderr?.destroy()\n settle('close', code, signal)\n }, EXIT_PIPE_DRAIN_GRACE_MS)\n exitGraceTimer.unref?.()\n })\n\n return { taskId, pid: state.pid, outputPath }\n },\n\n async killBackground(handle: ExecutionHandle, taskId: string): Promise<TaskExitInfo | null> {\n const state = tasks.get(taskId)\n // Two miss cases collapse into one `null` return: unknown id, AND\n // known-id-but-not-owned-by-this-handle. The second case is the\n // subagent-can't-kill-parent-tasks defense; surfacing it as a\n // distinct error would leak the existence of the parent's task\n // to the subagent's model, which violates the per-handle\n // isolation contract.\n if (!state || state.handleId !== handle.id)\n return null\n // Already exited — return the cached info. We don't keep a\n // separate cached exit; the state itself carries every field\n // `TaskExitInfo` needs and `stateToTaskExitInfo` projects it.\n if (state.status !== 'running')\n return stateToTaskExitInfo(state)\n\n // Mark the intent BEFORE issuing the kill so the close handler\n // classifies the exit as `'killed'` even on platforms where the\n // SIGTERM-via-group lands faster than the close event drains.\n // (Checklist #14: at-most-once settle, plus correct status\n // classification regardless of event ordering.)\n state.killRequested = true\n\n // Wait for the existing close listener to fire — `settle()` does\n // all the flushing + onExit work. We just sit on a one-shot\n // promise tied to the `child.on('close')` we already registered\n // at spawn time.\n const closed = new Promise<void>((resolveP) => {\n if (state.settled) {\n resolveP()\n return\n }\n const originalOnExit = state.onExit\n state.onExit = (info) => {\n originalOnExit?.(info)\n resolveP()\n }\n })\n\n killProcessGroup(state.child, 'SIGTERM')\n await closed\n return stateToTaskExitInfo(state)\n },\n\n async waitBackground(\n handle: ExecutionHandle,\n taskId: string,\n options?: { timeoutMs?: number, signal?: AbortSignal },\n ): Promise<TaskExitInfo | null> {\n const state = tasks.get(taskId)\n // Same two-misses-collapse-to-null contract as `killBackground`:\n // unknown id AND known-but-other-handle both return `null` so a\n // subagent can't observe the parent's tasks through the wait seam.\n if (!state || state.handleId !== handle.id)\n return null\n if (state.settled)\n return stateToTaskExitInfo(state)\n\n return new Promise<TaskExitInfo | null>((resolveP) => {\n let done = false\n let timer: NodeJS.Timeout | undefined\n const signal = options?.signal\n const finish = (value: TaskExitInfo | null): void => {\n if (done)\n return\n done = true\n if (timer)\n clearTimeout(timer)\n signal?.removeEventListener('abort', onAbort)\n resolveP(value)\n }\n function onAbort(): void {\n finish(null)\n }\n\n // Chain onto the live exit callback rather than replacing it —\n // the original (notification enqueue, kill-waiter, a sibling\n // waiter) must keep firing. The `done` latch makes a late exit\n // after timeout a no-op for THIS waiter.\n const originalOnExit = state.onExit\n state.onExit = (info) => {\n originalOnExit?.(info)\n finish(stateToTaskExitInfo(state))\n }\n\n if (signal) {\n if (signal.aborted) {\n finish(null)\n return\n }\n signal.addEventListener('abort', onAbort, { once: true })\n }\n const timeoutMs = options?.timeoutMs\n if (typeof timeoutMs === 'number' && Number.isFinite(timeoutMs) && timeoutMs > 0) {\n timer = setTimeout(finish, timeoutMs, null)\n timer.unref?.()\n }\n })\n },\n\n async reassignBackgroundTasks(\n fromHandle: ExecutionHandle,\n toHandle: ExecutionHandle,\n newOnExit?: (info: TaskExitInfo) => void,\n ): Promise<readonly TaskEntry[]> {\n // No-op when source = destination — keeps the spawn.ts call site\n // unconditional without forcing it to dedupe.\n if (fromHandle.id === toHandle.id)\n return []\n const promoted: TaskEntry[] = []\n for (const state of tasks.values()) {\n if (state.handleId !== fromHandle.id || state.status !== 'running')\n continue\n state.handleId = toHandle.id\n // Replace the natural-exit callback. The original closed over\n // the spawning agent's hook bus, which is about to be destroyed\n // — without rewiring, the task's eventual `background:exit`\n // fires into a torn-down hookable and the parent never learns.\n if (newOnExit)\n state.onExit = newOnExit\n promoted.push(stateToTaskEntry(state))\n }\n return promoted\n },\n\n async listBackground(handle: ExecutionHandle): Promise<readonly TaskEntry[]> {\n // Snapshot — callers must not assume the returned array stays\n // in sync with the live registry. Sorted by startedAt so the\n // model / UI sees consistent ordering across calls. Scoped to\n // the calling handle so subagents don't see the parent's tasks\n // (and vice versa) in their listing.\n return [...tasks.values()]\n .filter(s => s.handleId === handle.id)\n .sort((a, b) => a.startedAt - b.startedAt)\n .map(stateToTaskEntry)\n },\n\n async destroy(handle: ExecutionHandle): Promise<void> {\n // Kill every still-running background task SPAWNED THROUGH THIS\n // HANDLE before tearing the handle down. SIGTERM the groups,\n // await the close + flush, THEN drop the registry entries.\n // Sequential — destroy is one-shot teardown, the few ms of extra\n // latency aren't worth the synchronization complexity.\n //\n // The handle scope matters when the same `ExecutionContext` is\n // shared across a parent agent and its `spawn`-ed subagents (the\n // default — `spawn.ts` passes `execution: ctx.execution`). Each\n // agent mints its own `ExecutionHandle` and registers its\n // background tasks under that handle's id. Without the filter,\n // a child agent's `destroy()` (fired by `spawn.ts`'s `finally`\n // when the subagent finishes / is cancelled) would walk the\n // shared registry and SIGTERM the parent's tasks too. So\n // cancelling a subagent that has its own background shells now\n // correctly kills JUST those subagent shells, leaving the\n // parent's intact.\n const survivors = [...tasks.values()].filter(s => s.handleId === handle.id && !s.settled)\n await Promise.all(survivors.map(async (state) => {\n state.killRequested = true\n await new Promise<void>((resolveP) => {\n let graceTimer: NodeJS.Timeout | undefined\n const originalOnExit = state.onExit\n state.onExit = (info) => {\n originalOnExit?.(info)\n if (graceTimer)\n clearTimeout(graceTimer)\n resolveP()\n }\n killProcessGroup(state.child, 'SIGTERM')\n // Bounded drain: a task that traps/ignores SIGTERM — or whose\n // `close` event is held back by an escaped grandchild (setsid'd\n // out of the process group) keeping the inherited stdio pipe\n // open — must not wedge `agent.destroy()` forever. After the\n // grace period, SIGKILL the group and stop waiting: `close`\n // may STILL never fire (the pipe holder isn't in the group),\n // so resolving here is the only way destroy() stays bounded.\n graceTimer = setTimeout(() => {\n killProcessGroup(state.child, 'SIGKILL')\n // settle() normally flushes + ends the log stream, but it\n // only runs off `close` — which we just gave up on. Tear the\n // stream down so the fd doesn't leak into a long-lived host.\n state.outputStream.destroy()\n resolveP()\n }, destroyGraceMs)\n graceTimer.unref?.()\n })\n }))\n // Drop only this handle's tasks from the registry. Other handles\n // (siblings, parent) keep their entries.\n for (const [taskId, state] of tasks) {\n if (state.handleId === handle.id)\n tasks.delete(taskId)\n }\n handles.delete(handle.id)\n // Drop the orphan reaper ONLY when no handles remain — otherwise\n // a child's `destroy()` would strip the parent's safety net. The\n // reaper protects every still-tracked task in the context, so it\n // sticks around until the LAST handle is gone.\n //\n // Without this guard, the spawn-tool sequence\n // parent.spawn(child) → child.run() → child.destroy() (auto)\n // would deregister the handler mid-parent-lifetime. The parent's\n // own subsequent Ctrl+C orphan-kill safety would silently degrade.\n if (exitHandlerRegistered && handles.size === 0) {\n process.off('exit', exitHandler)\n exitHandlerRegistered = false\n }\n },\n }\n}\n\n/**\n * Per-task state. Lives in the context's `tasks` registry. Fields are\n * mutated in place by the spawn / close / kill / destroy code paths —\n * the registry isn't immutable. Treat the type as a record-of-cells,\n * not a value.\n */\ninterface TaskState {\n taskId: string\n /**\n * `ExecutionHandle.id` of the spawning agent. The registry is\n * context-scoped (one Map shared across all handles a context minted),\n * so a per-task owner tag is what scopes `listBackground` /\n * `killBackground` / `destroy` to the calling handle's slice.\n *\n * Without this, a subagent spawned via `spawn` tool — which inherits\n * the parent's `ExecutionContext` but mints its OWN handle — would\n * see (and accidentally kill on `destroy()`) every task the parent\n * had running. Came up the first time the model spawned a subagent\n * that ran a background task: the subagent's run-end `destroy()`\n * SIGTERMed the parent's `npm run dev` mid-flight.\n */\n handleId: string\n pid: number\n command: string\n cwd: string\n startedAt: number\n outputPath: string\n outputStream: WriteStream\n child: ChildProcess\n status: 'running' | 'exited' | 'killed'\n exitCode?: number\n signal?: NodeJS.Signals\n bytesWritten: number\n /**\n * `at-most-once` settle latch. Multiple trigger sources (`close`,\n * `error`, `kill`) can race; the flag dedupes so `onExit` fires\n * exactly once per task (checklist #14).\n */\n settled: boolean\n /**\n * Set by `killBackground` / `destroy` before issuing SIGTERM so the\n * close handler classifies the exit as `'killed'` even when the\n * platform delivers the close event ahead of our intent record.\n */\n killRequested?: boolean\n /**\n * `Date.now()` at settle time. Lets `durationMs` (and pull-based\n * reconcile consumers reading `TaskEntry.endedAt`) report the task's\n * real lifetime instead of a projection-time delta.\n */\n endedAt?: number\n /**\n * Optional push-style exit callback. Undefined for pull-based\n * consumers (remote / durable hosts reconcile via `listBackground`).\n * Mutated in place by the kill / destroy / wait chains.\n */\n onExit?: (info: TaskExitInfo) => void\n}\n\n/**\n * Send `signal` to the child's whole process group. Falls back to a\n * single-process kill on Windows (no POSIX process groups). Shared\n * across the foreground `exec` path, the background spawn / kill\n * paths, and the shutdown-time orphan reaper — keeping one definition\n * so the kill semantics can't drift between them.\n */\nfunction killProcessGroup(child: ChildProcess, signal: NodeJS.Signals): void {\n const pid = child.pid\n if (pid === undefined)\n return\n try {\n if (SUPPORTS_PROCESS_GROUPS)\n process.kill(-pid, signal)\n else\n process.kill(pid, signal)\n }\n catch {\n // ESRCH / EPERM — process is already gone (race with natural exit)\n // or we lost the right to kill it. Both are safe to swallow.\n }\n}\n\n/**\n * Project a `TaskState` to the `TaskEntry` shape `listBackground` and\n * `reassignBackgroundTasks` return. Single helper keeps the shape\n * consistent across both call sites (and a future addition of fields\n * to `TaskEntry` only needs to land here).\n */\nfunction stateToTaskEntry(state: TaskState): TaskEntry {\n return {\n taskId: state.taskId,\n pid: state.pid,\n command: state.command,\n cwd: state.cwd,\n startedAt: state.startedAt,\n ...(state.endedAt !== undefined ? { endedAt: state.endedAt } : {}),\n outputPath: state.outputPath,\n status: state.status,\n ...(state.exitCode !== undefined ? { exitCode: state.exitCode } : {}),\n ...(state.signal ? { signal: state.signal } : {}),\n bytesWritten: state.bytesWritten,\n }\n}\n\n/**\n * Project a settled `TaskState` to the `TaskExitInfo` shape `settle()`\n * fires from `onExit` and `killBackground` returns on the\n * cached-exit path. Pre-condition: `state.status !== 'running'`\n * (callers gate on this).\n */\nfunction stateToTaskExitInfo(state: TaskState): TaskExitInfo {\n return {\n taskId: state.taskId,\n status: state.status as Exclude<TaskState['status'], 'running'>,\n exitCode: state.exitCode ?? 0,\n ...(state.signal ? { signal: state.signal } : {}),\n outputPath: state.outputPath,\n // Settle-time delta when available (always set since `endedAt` was\n // introduced); the `Date.now()` fallback covers defensive callers\n // projecting an unsettled state.\n durationMs: (state.endedAt ?? Date.now()) - state.startedAt,\n command: state.command,\n }\n}\n","/**\n * Remote sandbox execution context.\n *\n * Offloads execution to a remote sandbox API (e.g. Rivet, E2B).\n * Specific providers implement the SandboxProvider interface.\n */\n\nimport type { ContextCapabilities, ExecResult, ExecutionContext, ExecutionHandle, ListFilesOptions, SpawnConfig } from './types'\nimport { globFilesViaShell } from './glob'\n\n// ---------------------------------------------------------------------------\n// Sandbox provider interface\n// ---------------------------------------------------------------------------\n\nexport interface SandboxProvider {\n name: string\n spawn: (config: SpawnConfig) => Promise<{ id: string, cwd: string }>\n exec: (sandboxId: string, command: string, options?: { cwd?: string, env?: Record<string, string>, timeout?: number }) => Promise<ExecResult>\n readFile: (sandboxId: string, path: string) => Promise<string>\n writeFile: (sandboxId: string, path: string, content: string) => Promise<void>\n listFiles: (sandboxId: string, path: string, options?: ListFilesOptions) => Promise<string[]>\n destroy: (sandboxId: string) => Promise<void>\n}\n\n// ---------------------------------------------------------------------------\n// Sandbox execution context\n// ---------------------------------------------------------------------------\n\nexport function createSandboxContext(provider: SandboxProvider): ExecutionContext {\n const sandboxes = new Map<string, string>()\n\n function getSandboxId(handle: ExecutionHandle): string {\n const id = sandboxes.get(handle.id)\n if (!id)\n throw new Error(`Sandbox ${handle.id} not found`)\n return id\n }\n\n return {\n type: 'sandbox',\n\n capabilities: {\n shell: true,\n filesystem: true,\n glob: true,\n network: true,\n gpu: false,\n } satisfies ContextCapabilities,\n\n async spawn(config?: SpawnConfig): Promise<ExecutionHandle> {\n const result = await provider.spawn(config ?? {})\n const handle: ExecutionHandle = { id: result.id, type: 'sandbox', cwd: result.cwd }\n sandboxes.set(handle.id, result.id)\n return handle\n },\n\n async exec(handle: ExecutionHandle, command: string, options?): Promise<ExecResult> {\n return provider.exec(getSandboxId(handle), command, options)\n },\n\n async readFile(handle: ExecutionHandle, path: string): Promise<string> {\n return provider.readFile(getSandboxId(handle), path)\n },\n\n async writeFile(handle: ExecutionHandle, path: string, content: string): Promise<void> {\n return provider.writeFile(getSandboxId(handle), path, content)\n },\n\n async listFiles(handle: ExecutionHandle, path: string, options?: ListFilesOptions): Promise<string[]> {\n const sandboxId = getSandboxId(handle)\n if (options?.glob) {\n return globFilesViaShell(\n path,\n command => provider.exec(sandboxId, command, { cwd: handle.cwd }),\n options?.limit ?? 1000,\n )\n }\n return provider.listFiles(sandboxId, path, options)\n },\n\n async destroy(handle: ExecutionHandle): Promise<void> {\n const id = sandboxes.get(handle.id)\n if (!id)\n return\n await provider.destroy(id)\n sandboxes.delete(handle.id)\n },\n }\n}\n","/**\n * Execution context types.\n *\n * An execution context defines *where* and *how* an agent's tools run.\n * The agent loop and tools interact through this interface without knowing\n * whether they're running in-process, in a Docker container, or in a\n * remote sandbox.\n */\n\n// ---------------------------------------------------------------------------\n// Capabilities\n// ---------------------------------------------------------------------------\n\n/**\n * Lifetime guarantee of background tasks started through\n * {@link ExecutionContext.execBackground}.\n *\n * - `'none'` — the context cannot detach tasks at all.\n * - `'process-lifetime'` — tasks live as long as the HOST process; a\n * crash/restart of the host orphans or kills them (`ProcessContext`).\n * - `'durable'` — tasks live on a remote runner and survive host process\n * death (remote execution contexts driven by durable runtimes).\n *\n * Durable-execution adapters (e.g. `zidane/restate`) consult this to\n * decide whether backgrounding is safe to expose: a `'durable'` context\n * keeps its tasks across worker crashes, so there is no reason to strip\n * the capability from the model.\n */\nexport type DetachedTasksCapability = 'none' | 'process-lifetime' | 'durable'\n\nexport interface ContextCapabilities {\n /** Can execute shell commands */\n shell: boolean\n /** Can read/write files in a workspace */\n filesystem: boolean\n /** Can enumerate glob matches through `ExecutionContext.listFiles(..., { glob: true })`. */\n glob?: boolean\n /** Can make outbound network requests */\n network: boolean\n /** Has GPU access */\n gpu: boolean\n /**\n * Background-task lifetime guarantee. Optional for backward\n * compatibility — when absent, callers infer `'process-lifetime'`\n * if the context implements `execBackground`, `'none'` otherwise\n * (see {@link resolveDetachedTasksCapability}).\n */\n detachedTasks?: DetachedTasksCapability\n}\n\n/**\n * Effective {@link DetachedTasksCapability} of a context, with the\n * backward-compatible inference for contexts that predate the field.\n */\nexport function resolveDetachedTasksCapability(context: ExecutionContext): DetachedTasksCapability {\n return context.capabilities.detachedTasks\n ?? (context.execBackground ? 'process-lifetime' : 'none')\n}\n\n// ---------------------------------------------------------------------------\n// Execution handle\n// ---------------------------------------------------------------------------\n\n/** Opaque handle to a running execution context instance */\nexport interface ExecutionHandle {\n id: string\n type: ContextType\n /** Working directory within the context */\n cwd: string\n}\n\n// ---------------------------------------------------------------------------\n// Exec result\n// ---------------------------------------------------------------------------\n\nexport interface ExecResult {\n stdout: string\n stderr: string\n exitCode: number\n}\n\nexport interface ListFileMetadata {\n path: string\n size?: number\n mtimeMs?: number\n}\n\nexport type ListFilesEntry = string | ListFileMetadata\n\nexport interface ListFilesOptions {\n /** Treat `path` as a glob match pattern instead of a literal directory path. */\n glob?: boolean\n limit?: number\n metadata?: boolean\n}\n\n// ---------------------------------------------------------------------------\n// Spawn config\n// ---------------------------------------------------------------------------\n\nexport interface SpawnConfig {\n /** Working directory (created if it doesn't exist) */\n cwd?: string\n /**\n * Optional workspace-containment root for the file methods (`readFile`,\n * `writeFile`, `listFiles`) of the process context.\n *\n * When set, a resolved path that escapes this root (via absolute path,\n * `..`, or a symlink pointing outside) is rejected before any I/O. Default\n * unset = no containment (back-compat; the agent can read/write anywhere\n * the host process can). Set this for untrusted workloads to confine file\n * tools to a directory. Shell commands are not covered — use a sandbox /\n * docker context for full isolation.\n */\n workspaceRoot?: string\n /** Environment variables */\n env?: Record<string, string>\n /**\n * Whether spawned shells inherit the parent `process.env` (process context).\n *\n * Default `true` (preserves existing behavior — children see the parent\n * environment including anything Bun auto-loaded from `.env`). Set `false`\n * for untrusted workloads so secrets in the parent environment aren't\n * readable by tool commands; only `env` / per-call env plus a minimal base\n * (`PATH`, `HOME`, `SHELL`, `LANG`, `LC_ALL`, `USER`, `TERM`, `TMPDIR`) are\n * passed through.\n */\n inheritEnv?: boolean\n /** Docker image (only for 'docker' context) */\n image?: string\n /** Docker container name prefix (only for 'docker' context) */\n name?: string\n /** Host paths mounted into the context (only for 'docker' context today) */\n mounts?: ContextMount[]\n /** Resource limits */\n limits?: {\n /** Memory limit in MB */\n memory?: number\n /** CPU limit (e.g. '1.0' = 1 core) */\n cpu?: string\n /** Timeout in seconds for the entire context lifetime */\n timeout?: number\n }\n /** Sandbox provider config (only for 'sandbox' context) */\n sandbox?: {\n provider: string\n apiKey?: string\n /**\n * Attach to a pre-existing sandbox by id rather than creating one\n * (provider-specific; E2B maps it to `Sandbox.connect`). The provider\n * leaves a connected sandbox running on teardown.\n */\n sandboxId?: string\n [key: string]: unknown\n }\n\n /**\n * How long `destroy()` waits for a SIGTERM'd background task to settle\n * before escalating to SIGKILL and abandoning the wait (process context\n * only). Bounds `agent.destroy()` against tasks that trap SIGTERM or\n * whose stdio pipes are held open by escaped grandchildren.\n *\n * Default: `5000`.\n */\n destroyGraceMs?: number\n\n /**\n * Publish container ports on the host (docker context only).\n *\n * Each entry maps a container port to either an explicit host port or\n * (when `host` is omitted) a Docker-assigned random port. Retrieve the\n * actual host port at runtime via `getMappedPort(container)` on the\n * docker context.\n */\n ports?: Array<{ container: number, host?: number, proto?: 'tcp' | 'udp' }>\n\n /**\n * UID/GID the container should run as (docker context only).\n *\n * Accepts the same forms Docker's `--user` does: `uid`, `uid:gid`, or a\n * named user that exists in the image. Default is the image's default\n * user (typically root). Setting this to the host user's `uid:gid`\n * avoids the EACCES-on-cleanup problem when sharing a workspace via\n * a `shared` mount.\n */\n user?: string\n\n /**\n * User-defined Docker network to join (docker context only).\n *\n * Defaults to Docker's default bridge. Use a user network when you\n * need multiple sibling containers (e.g. agent + database + dev\n * server) to discover each other by name.\n */\n network?: string\n\n /**\n * Docker labels to attach to the container (docker context only).\n *\n * Useful for ownership tracking — callers can sweep abandoned\n * containers (e.g. from a crashed parent process) by filtering on\n * a label they own: `docker ps -aq --filter label=my-app=true`.\n */\n labels?: Record<string, string>\n\n /**\n * Container hardening options (docker context only).\n *\n * All fields are opt-in and OFF by default to preserve existing behavior\n * (containers run with the image's default user/capabilities). Enable them\n * for untrusted workloads. `dropAllCapabilities` and a non-root `user`\n * (see {@link SpawnConfig.user}) can break images that expect root or\n * specific capabilities, so they are not applied unless requested.\n */\n hardening?: ContextHardening\n}\n\n/**\n * Opt-in container hardening for the docker context. Every field defaults to\n * \"unset\" so an omitted `hardening` (or omitted field) reproduces the prior,\n * unrestricted behavior — this keeps the option purely additive.\n */\nexport interface ContextHardening {\n /**\n * Drop all Linux capabilities (`CapDrop: ['ALL']`). Strong isolation, but\n * breaks images needing capabilities (e.g. binding low ports, `ping`).\n * Default: `false`.\n */\n dropAllCapabilities?: boolean\n /**\n * Set `no-new-privileges` so processes can't gain privileges via setuid\n * binaries. Low blast radius; safe for most workloads. Default: `false`.\n */\n noNewPrivileges?: boolean\n /**\n * Mount the container root filesystem read-only. Pair with writable mounts\n * for scratch space. Default: `false`.\n */\n readonlyRootfs?: boolean\n /**\n * Max number of processes (`PidsLimit`) — caps fork-bombs. Default: unset\n * (no limit). A few hundred is usually plenty for an agent sandbox.\n */\n pidsLimit?: number\n}\n\nexport interface ContextMount {\n /** Absolute host path to mount. */\n source: string\n /** Absolute path inside the execution context. */\n target: string\n /** Mount read-only. Defaults to false for Docker's native bind behavior. */\n readonly?: boolean\n /**\n * Apply the SELinux shared label (`:z`) so the host user and the container\n * user can both read/write the mount (docker context only). No-op on\n * non-SELinux hosts. Combine with `SpawnConfig.user` to avoid root-owned\n * files leaking onto the host. Mutually exclusive with `readonly`.\n */\n shared?: boolean\n}\n\n// ---------------------------------------------------------------------------\n// Execution context interface\n// ---------------------------------------------------------------------------\n\nexport type ContextType = 'process' | 'docker' | 'sandbox'\n\nexport interface ExecutionContext {\n /** Context type identifier */\n readonly type: ContextType\n\n /** What this context supports */\n readonly capabilities: ContextCapabilities\n\n /** Spawn a new execution environment */\n spawn: (config?: SpawnConfig) => Promise<ExecutionHandle>\n\n /**\n * Execute a shell command in the context.\n *\n * `signal` propagates abort all the way down to the underlying child\n * process — the implementation is expected to wire it into whatever\n * spawn primitive it uses so the OS receives a SIGTERM (or equivalent)\n * when the caller aborts. Without it, a cancelled tool returns its\n * cancellation marker to the model but the underlying process keeps\n * running in the background, orphaning compute / locks / IO. Pass\n * `ctx.signal` from a tool body to inherit the per-call + run-level\n * abort union; pass a freshly-built one for a host-driven kill.\n *\n * Implementations are free to ignore `signal` (the contract degrades\n * gracefully — the process simply won't be killed), but the in-process\n * default DOES honor it via `child_process.exec`'s native `signal`\n * option.\n */\n exec: (handle: ExecutionHandle, command: string, options?: { cwd?: string, env?: Record<string, string>, timeout?: number, signal?: AbortSignal }) => Promise<ExecResult>\n\n /**\n * Start a process in the background. Settles as soon as `spawn` returns\n * — does NOT wait for the child to exit. Stdout + stderr stream\n * interleaved to the file at the returned `outputPath`. The caller\n * (typically the agent) reads incremental output via the regular\n * {@link ExecutionContext.readFile} seam.\n *\n * Optional — contexts without background support (some remote sandboxes)\n * just don't implement it. The shell tool surfaces a clean\n * \"background mode is not supported in this execution context\" error\n * when this is undefined.\n *\n * `onExit` is called once when the child terminates (natural, killed,\n * or error). The same instance that called `execBackground` is the\n * exclusive owner of the callback — it's not a multi-cast bus. Hosts\n * wire this to the agent's pending-notification queue so the model\n * gets a `<task-notification>` on its next turn.\n *\n * `onExit` is OPTIONAL: remote / durable contexts may have no legal\n * way to push a callback from a timer back into the host (a Restate\n * journal, for instance, forbids out-of-band writes). Such contexts\n * simply record the exit in their registry; the agent loop reconciles\n * by polling {@link ExecutionContext.listBackground} at run\n * boundaries, where a host journal wrapper is legal (the\n * `background:reconcile` hook is the journalable seam).\n *\n * See `docs/RUN_IN_BACKGROUND.md` for the broader design contract\n * (file location, replay semantics, suppression rules).\n */\n execBackground?: (\n handle: ExecutionHandle,\n command: string,\n options: {\n cwd?: string\n env?: Record<string, string>\n /**\n * Absolute directory the context appends `<task-id>.log` to. The\n * agent owns this path because it carries session-shaped knowledge\n * (`<userDir>/<sessionId>/tasks/`) the context can't synthesize.\n * Must already exist OR be creatable by the context — the\n * implementation handles `mkdir -p` defensively.\n */\n outputDir: string\n /** Push-style exit callback. Optional — see the method doc. */\n onExit?: (info: TaskExitInfo) => void\n /**\n * Cap on bytes written to the output file. Beyond the cap the\n * process KEEPS RUNNING; further output is counted but dropped,\n * and a `<output-truncated bytes-dropped=\"N\"/>` marker is\n * appended when the task settles. Unset / non-positive = no cap.\n */\n maxOutputBytes?: number\n /**\n * Stall watchdog: when the task produces no output for this many\n * milliseconds, `onStall` fires ONCE (one-shot — re-arms only\n * after fresh output arrives). The process is NOT killed; the\n * consumer decides (typically by telling the model the task may\n * be stuck at an interactive prompt). Unset = no watchdog.\n */\n stallTimeoutMs?: number\n /** One-shot stall callback — see `stallTimeoutMs`. */\n onStall?: (info: TaskStallInfo) => void\n },\n ) => Promise<TaskHandle>\n\n /**\n * SIGTERM the whole process group of a running background task.\n * Idempotent — second call returns `null` (or the cached exit info).\n * Resolves once the process has exited AND its output stream has\n * been flushed + closed.\n *\n * `null` return on miss (unknown id, already cleaned up) so the\n * shell_kill tool can surface a clean \"no such task\" message\n * without throwing.\n */\n killBackground?: (\n handle: ExecutionHandle,\n taskId: string,\n ) => Promise<TaskExitInfo | null>\n\n /**\n * Snapshot of every task in the context's registry — running AND\n * terminated (entries remain until the next context destroy, so\n * the model can still read output of exited tasks).\n */\n listBackground?: (\n handle: ExecutionHandle,\n ) => Promise<readonly TaskEntry[]>\n\n /**\n * Block until a background task terminates, then resolve with its\n * exit info. Resolves immediately for already-terminated tasks.\n *\n * Returns `null` when:\n * - the task id is unknown (or owned by another handle — same\n * isolation contract as `killBackground`), OR\n * - `timeoutMs` elapsed / `signal` aborted before the task exited.\n *\n * Callers that need to distinguish \"unknown\" from \"still running\"\n * should consult `listBackground` first (the `wait_task` tool does).\n *\n * This is the injectable wait seam for the `wait_task` tool:\n * in-process contexts implement it on the existing `onExit`\n * machinery; durable hosts implement it as an awakeable park\n * (runner fires task-exit over their bridge → resolveAwakeable).\n */\n waitBackground?: (\n handle: ExecutionHandle,\n taskId: string,\n options?: { timeoutMs?: number, signal?: AbortSignal },\n ) => Promise<TaskExitInfo | null>\n\n /**\n * Transfer ownership of every still-running task from `fromHandle`\n * to `toHandle`. Used by the spawn tool to \"promote\" a subagent's\n * background tasks up to the parent's handle so they outlive the\n * subagent's destroy() — matching shell semantics, where a `&`-ed\n * command outlives the parent process.\n *\n * Side effects:\n * - The task's `handleId` is rewritten, so subsequent\n * `listBackground(toHandle)` / `killBackground(toHandle, …)` /\n * `destroy(toHandle)` see it (and `fromHandle`-scoped operations\n * don't).\n * - When `newOnExit` is provided, the original `onExit` is\n * REPLACED with it. Critical: the task's natural exit callback\n * was captured against the spawning agent's hook bus, which is\n * about to be destroyed; without rewiring, the parent never\n * learns when the task terminates. Pass a closure that fires\n * the parent agent's `background:exit` hook.\n *\n * Returns the entries that were actually reassigned (running tasks\n * only; terminated ones stay where they are). Implementations that\n * don't support reassignment can leave this undefined; the caller\n * (spawn.ts) falls back to the current behavior of killing child\n * tasks at subagent shutdown.\n */\n reassignBackgroundTasks?: (\n fromHandle: ExecutionHandle,\n toHandle: ExecutionHandle,\n newOnExit?: (info: TaskExitInfo) => void,\n ) => Promise<readonly TaskEntry[]>\n\n /** Read a file from the context's filesystem */\n readFile: (handle: ExecutionHandle, path: string) => Promise<string>\n\n /**\n * Read a file from the context's filesystem as raw bytes.\n *\n * Used by `read_file` to dispatch image / binary files into the multimodal\n * `ToolResultContent[]` route. Optional — when not implemented, the tool\n * falls back to `base64 < path` via the `exec` seam, which works in any\n * shell-capable context. Implementations that already have a native\n * binary read (in-process `fs.readFile` without encoding, container API,\n * sandbox SDK) should override for the latency win.\n */\n readFileBinary?: (handle: ExecutionHandle, path: string) => Promise<Uint8Array>\n\n /** Write a file to the context's filesystem */\n writeFile: (handle: ExecutionHandle, path: string, content: string) => Promise<void>\n\n /**\n * List files in the context filesystem.\n *\n * Plain paths list immediate directory entries (legacy behavior). Paths that\n * contain glob metacharacters (`*`, `?`, `[]`, `{}`) request matched file\n * enumeration inside the target context. Contexts that cannot support\n * globbing should throw a clear error rather than silently returning no\n * matches. `metadata` is best-effort and only required when the context can\n * provide it without expensive per-file shell calls.\n */\n listFiles: (handle: ExecutionHandle, path: string, options?: ListFilesOptions) => Promise<ListFilesEntry[]>\n\n /**\n * Resolve the host-side port that a container port was published on\n * (docker context only, and only when the matching entry was created\n * with `host` omitted in `SpawnConfig.ports`).\n *\n * Resolves to `null` if the container port isn't published. Other\n * contexts (process, sandbox) don't implement this; they don't have\n * a port-mapping concept.\n */\n getMappedPort?: (handle: ExecutionHandle, containerPort: number) => Promise<number | null>\n\n /** Destroy the execution environment and clean up resources */\n destroy: (handle: ExecutionHandle) => Promise<void>\n}\n\n// ---------------------------------------------------------------------------\n// Background task types\n// ---------------------------------------------------------------------------\n\n/**\n * Lifecycle status of a background task.\n *\n * - `'running'` — process is still live; `exitCode` / `signal` unset.\n * - `'exited'` — process terminated on its own (clean or non-zero exit).\n * - `'killed'` — the host issued `killBackground` (SIGTERM to the group).\n *\n * The status is a coarse-grained signal; the exit code carries the\n * fine-grained detail (e.g. `143 = SIGTERM` for `'killed'`).\n */\nexport type BackgroundTaskStatus = 'running' | 'exited' | 'killed'\n\n/**\n * Returned synchronously by `execBackground` — the handle the model and\n * the framework use to refer to the task until it terminates.\n *\n * `outputPath` is an absolute path to the log file the context is\n * appending stdout + stderr to (interleaved by emit order). The model\n * reads it via the normal `read_file` tool; no special tool is required.\n */\nexport interface TaskHandle {\n /**\n * Stable id minted by the context — typically `bash_<n>` for\n * `ProcessContext`. Sequential within a single context instance,\n * resets when a new context is constructed. Forwarded to `killBackground` /\n * `listBackground` and stamped into every `<task-notification>` block.\n */\n taskId: string\n /** OS pid of the spawned shell wrapper (process-group leader on POSIX). */\n pid: number\n /** Absolute path to the log file the context is streaming output into. */\n outputPath: string\n}\n\n/**\n * Fired exactly once per task when the child process terminates, via\n * `execBackground`'s `onExit` callback. The agent layer translates this\n * into a queued `<task-notification>` for the next turn.\n *\n * `signal` is set when the child was terminated by a signal (e.g.\n * SIGTERM from our own kill-tree, SIGKILL from oom-killer); absent on\n * natural exit. `exitCode` is `128 + signal-number` on signal-killed\n * children, matching POSIX shell conventions — `143` for SIGTERM, etc.\n */\nexport interface TaskExitInfo {\n taskId: string\n status: Exclude<BackgroundTaskStatus, 'running'>\n exitCode: number\n signal?: NodeJS.Signals\n outputPath: string\n /** `Date.now()` delta between spawn and exit. */\n durationMs: number\n /** The original command string the model invoked — useful for telemetry / banner summary. */\n command: string\n}\n\n/**\n * One row in `listBackground`'s snapshot. Living entries (status `'running'`)\n * have `exitCode` / `signal` / `endedAt` unset; terminated entries carry the\n * same data `TaskExitInfo` returned at exit time.\n */\nexport interface TaskEntry {\n taskId: string\n pid: number\n command: string\n cwd: string\n startedAt: number\n /**\n * Set when the task terminated. Lets pull-based consumers (the agent's\n * run-boundary reconcile) derive `durationMs = endedAt - startedAt`\n * without depending on when the snapshot was taken.\n */\n endedAt?: number\n outputPath: string\n status: BackgroundTaskStatus\n exitCode?: number\n signal?: NodeJS.Signals\n /** Total bytes written to the output file so far — useful for \"task X has produced N KB\" UX hints. */\n bytesWritten: number\n}\n\n/**\n * Fired by the optional stall watchdog (see `execBackground`'s\n * `stallTimeoutMs`) when a running task has produced no output for the\n * configured window. The process is still alive — this is a signal, not\n * a state transition.\n */\nexport interface TaskStallInfo {\n taskId: string\n command: string\n outputPath: string\n /** Milliseconds since the last output chunk (>= the configured window). */\n stalledForMs: number\n /** Total bytes the task has written so far. */\n bytesWritten: number\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,YAAY,UAAU,aAAa,MAAM,OAAO,uBAAuB,KAAK;;;;;;;AAQlF,MAAM,0BAA0B,QAAQ,aAAa;;;;;;;AAQrD,MAAM,qBAAqB,KAAK,OAAO;;;;;;;AAQvC,MAAM,2BAA2B;;;;;;;;;;;;;;AAejC,MAAM,2BAA2B;;;;;;;;;;;AAYjC,MAAM,aAAa;AAEnB,SAAS,iBAAiB,QAAsB;CAC9C,IAAI,CAAC,WAAW,KAAK,MAAM,GACzB,MAAM,IAAI,MAAM,oBAAoB,OAAO,iBAAiB,WAAW,EAAE;AAC7E;;;;;;;;;AAUA,SAAgB,uBAAuB,MAAoB;CACzD,MAAM,QAAQ,MAAsB,EAAE,SAAS,EAAE,SAAS,GAAG,GAAG;CAChE,MAAM,QAAQ,MAAsB,EAAE,SAAS,EAAE,SAAS,GAAG,GAAG;CAQhE,OAAO,GAPG,KAAK,eAOL,IANA,KAAK,KAAK,YAAY,IAAI,CAMtB,IALJ,KAAK,KAAK,WAAW,CAKb,EAAE,GAJV,KAAK,KAAK,YAAY,CAIT,IAHb,KAAK,KAAK,cAAc,CAGP,IAFjB,KAAK,KAAK,cAAc,CAEH,EAAE,GADtB,KAAK,KAAK,mBAAmB,CACH;AACvC;;AAMA,SAAS,QAAQ,KAAwB,MAAmC;CAC1E,MAAM,MAAyB,CAAC;CAChC,KAAK,MAAM,OAAO,MAChB,IAAI,IAAI,SAAS,KAAA,GACf,IAAI,OAAO,IAAI;CAEnB,OAAO;AACT;AAEA,SAAgB,qBAAqB,QAAwC;CAC3E,IAAI,UAAU;CACd,MAAM,0BAAU,IAAI,IAA6B;CACjD,MAAM,aAAa,QAAQ,OAAO,QAAQ,I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MAAM,OAAO;EACpD;EAEA,MAAM,QAAQ,QAAwC;GACpD,MAAM,KAAK,UAAU,IAAI,OAAO,EAAE;GAClC,IAAI,CAAC,IACH;GACF,MAAM,SAAS,QAAQ,EAAE;GACzB,UAAU,OAAO,OAAO,EAAE;EAC5B;CACF;AACF;;;;;;;AClCA,SAAgB,+BAA+B,SAAoD;CACjG,OAAO,QAAQ,aAAa,kBACtB,QAAQ,iBAAiB,qBAAqB;AACtD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"glob-DCWXy_tr.js","names":[],"sources":["../src/contexts/glob.ts"],"sourcesContent":["import type { ExecResult, ListFileMetadata } from './types'\nimport { readdir, stat } from 'node:fs/promises'\nimport { dirname, resolve, sep } from 'node:path'\nimport { lazyAsync } from '../lazy'\n\ntype NodeGlob = (pattern: string, options: { cwd: string }) => AsyncIterable<string>\n\nconst loadNativeNodeGlob = lazyAsync(async (): Promise<NodeGlob | undefined> => {\n const candidate = (await import('node:fs/promises') as { glob?: unknown }).glob\n return typeof candidate === 'function' ? candidate as NodeGlob : undefined\n})\n\nasync function loadNodeGlob(): Promise<NodeGlob | undefined> {\n if ((globalThis as { __zidaneForcePortableGlobForTests?: boolean }).__zidaneForcePortableGlobForTests)\n return undefined\n return loadNativeNodeGlob()\n}\n\nfunction escapeRegexChar(char: string): string {\n return /[\\\\^$.*+?()[\\]{}|]/.test(char) ? `\\\\${char}` : char\n}\n\nfunction expandBraces(pattern: string): string[] {\n const start = pattern.indexOf('{')\n if (start === -1)\n return [pattern]\n const end = pattern.indexOf('}', start + 1)\n if (end === -1)\n return [pattern]\n const body = pattern.slice(start + 1, end)\n if (!body || !body.includes(','))\n return [pattern]\n return body\n .split(',')\n .flatMap(part => expandBraces(`${pattern.slice(0, start)}${part}${pattern.slice(end + 1)}`))\n}\n\nfunction globPatternToRegex(pattern: string): RegExp {\n let out = '^'\n for (let i = 0; i < pattern.length; i++) {\n const char = pattern[i]\n const next = pattern[i + 1]\n if (char === '*') {\n if (next === '*') {\n const after = pattern[i + 2]\n if (after === '/') {\n out += '(?:[^/]+/)*'\n i += 2\n }\n else {\n out += '.*'\n i += 1\n }\n }\n else {\n out += '[^/]*'\n }\n }\n else if (char === '?') {\n out += '[^/]'\n }\n else if (char === '[') {\n const end = pattern.indexOf(']', i + 1)\n if (end === -1) {\n out += '\\\\['\n }\n else {\n let cls = pattern.slice(i + 1, end)\n if (cls.startsWith('!'))\n cls = `^${cls.slice(1)}`\n out += `[${cls}]`\n i = end\n }\n }\n else {\n out += escapeRegexChar(char)\n }\n }\n return new RegExp(`${out}$`)\n}\n\nexport function globLiteralPrefix(pattern: string): string {\n const firstMeta = pattern.search(/[*?[\\]{}]/)\n const prefix = firstMeta === -1 ? dirname(pattern) : pattern.slice(0, firstMeta)\n const slash = prefix.lastIndexOf('/')\n if (slash === -1)\n return ''\n return prefix.slice(0, slash)\n}\n\nexport function hasGlobPattern(path: string): boolean {\n return /[*?[\\]{}]/.test(path)\n}\n\nasync function walkFiles(root: string, prefix = ''): Promise<string[]> {\n const out: string[] = []\n let entries: Array<{ name: string, isDirectory: () => boolean, isFile: () => boolean }>\n try {\n entries = await readdir(resolve(root, prefix), { encoding: 'utf8', withFileTypes: true })\n }\n catch {\n return out\n }\n for (const entry of entries) {\n const rel = prefix ? `${prefix}/${entry.name}` : entry.name\n if (entry.isDirectory()) {\n out.push(...await walkFiles(root, rel))\n }\n else if (entry.isFile()) {\n out.push(rel)\n }\n }\n return out\n}\n\nasync function addMetadata(cwd: string, rel: string, includeMetadata: boolean): Promise<ListFileMetadata | null> {\n try {\n const s = await stat(resolve(cwd, rel))\n if (!s.isFile())\n return null\n return includeMetadata ? { path: rel, size: s.size, mtimeMs: s.mtimeMs } : { path: rel }\n }\n catch {\n return null\n }\n}\n\nasync function globPortable(pattern: string, cwd: string, limit: number, includeMetadata: boolean): Promise<ListFileMetadata[]> {\n const normalized = pattern.split(sep).join('/')\n const startPrefix = globLiteralPrefix(normalized)\n const regexes = expandBraces(normalized).map(globPatternToRegex)\n const out: ListFileMetadata[] = []\n for (const rel of await walkFiles(cwd, startPrefix)) {\n if (!regexes.some(regex => regex.test(rel)))\n continue\n out.push(includeMetadata ? await addMetadata(cwd, rel, true) ?? { path: rel } : { path: rel })\n if (out.length >= limit)\n break\n }\n return out.sort((a, b) => a.path.localeCompare(b.path))\n}\n\nexport async function globFilesLocal(\n pattern: string,\n cwd: string,\n options: { limit: number, metadata?: boolean },\n): Promise<ListFileMetadata[]> {\n const includeMetadata = options.metadata === true\n const nodeGlob = await loadNodeGlob()\n if (!nodeGlob)\n return globPortable(pattern, cwd, options.limit, includeMetadata)\n\n const results: ListFileMetadata[] = []\n for await (const rel of nodeGlob(pattern, { cwd })) {\n const entry = await addMetadata(cwd, rel, includeMetadata)\n if (!entry)\n continue\n results.push(entry)\n if (results.length >= options.limit)\n break\n }\n return results.sort((a, b) => a.path.localeCompare(b.path))\n}\n\nconst SAFE_GLOB_PATTERN_RE = /^[\\w./*?[\\]{}!,^@+-]+$/\n\nexport async function globFilesViaShell(\n pattern: string,\n exec: (command: string) => Promise<ExecResult>,\n limit: number,\n): Promise<string[]> {\n if (!SAFE_GLOB_PATTERN_RE.test(pattern))\n throw new Error('Glob pattern contains unsupported characters (shell fallback only allows path/glob metacharacters)')\n\n const useBasename = !pattern.includes('/')\n const finder = useBasename\n ? `find . -type f -name '${pattern}'`\n : `find . -type f -path './${pattern}'`\n const result = await exec(finder)\n if (result.exitCode !== 0 && !result.stdout.trim()) {\n const detail = result.stderr.trim() || `find exited with code ${result.exitCode}`\n throw new Error(`file matching requires \\`find\\` in the execution context (${detail}). Use the \\`shell\\` tool, or \\`list_files\\` for a single directory.`)\n }\n\n return result.stdout\n .split('\\n')\n .map(line => line.replace(/^\\.\\//, ''))\n .filter(line => line.length > 0)\n .sort()\n .slice(0, limit)\n}\n"],"mappings":";;;;AAOA,MAAM,qBAAqB,UAAU,YAA2C;CAC9E,MAAM,aAAa,MAAM,OAAO,qBAA2C;CAC3E,OAAO,O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