agent-afk 5.355.0 → 5.357.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/dist/agent/auth/credential-resolver.d.ts +2 -1
  2. package/dist/agent/background-registry.d.ts +1 -0
  3. package/dist/agent/background-registry.types.d.ts +1 -0
  4. package/dist/agent/daemon/builtin-task.d.ts +1 -0
  5. package/dist/agent/daemon/github-webhook-receiver.d.ts +36 -0
  6. package/dist/agent/daemon/shell-task.d.ts +1 -0
  7. package/dist/agent/daemon/tool-health-task.d.ts +1 -0
  8. package/dist/agent/daemon/triggers.d.ts +1 -0
  9. package/dist/agent/daemon/worktree-prune-task.d.ts +1 -0
  10. package/dist/agent/dag-subagent.d.ts +1 -0
  11. package/dist/agent/facets/schema.d.ts +1 -1
  12. package/dist/agent/lsp/client-handlers.d.ts +4 -0
  13. package/dist/agent/lsp/client.d.ts +9 -0
  14. package/dist/agent/lsp/diagnostics-store.d.ts +1 -0
  15. package/dist/agent/lsp/document-sync.d.ts +3 -1
  16. package/dist/agent/lsp/install.d.ts +10 -0
  17. package/dist/agent/lsp/pool.d.ts +1 -0
  18. package/dist/agent/lsp/query.d.ts +1 -0
  19. package/dist/agent/prompt-experiment.d.ts +2 -0
  20. package/dist/agent/provider.d.ts +2 -0
  21. package/dist/agent/providers/anthropic-direct/build-dispatcher.d.ts +2 -0
  22. package/dist/agent/providers/anthropic-direct/overage-tracker.d.ts +29 -0
  23. package/dist/agent/providers/anthropic-direct/provider-options.d.ts +1 -0
  24. package/dist/agent/providers/anthropic-direct/provider-query-setup.d.ts +1 -0
  25. package/dist/agent/providers/anthropic-direct/provider-runtime.d.ts +1 -0
  26. package/dist/agent/providers/anthropic-direct/query/client-setup.d.ts +2 -0
  27. package/dist/agent/providers/anthropic-direct/query/compact-handler.d.ts +1 -1
  28. package/dist/agent/providers/anthropic-direct/query/turn-request.d.ts +1 -0
  29. package/dist/agent/providers/anthropic-direct/query-maintenance.d.ts +1 -1
  30. package/dist/agent/providers/anthropic-direct/query-options.d.ts +1 -0
  31. package/dist/agent/providers/anthropic-direct/query-runtime.d.ts +2 -1
  32. package/dist/agent/providers/anthropic-direct/query-turn-driver.d.ts +2 -1
  33. package/dist/agent/providers/anthropic-direct/request-types.d.ts +1 -0
  34. package/dist/agent/providers/index.d.ts +1 -0
  35. package/dist/agent/providers/openai-compatible/compact.d.ts +1 -1
  36. package/dist/agent/providers/openai-compatible/index.dispatcher-opts.d.ts +4 -2
  37. package/dist/agent/providers/openai-compatible/index.options.d.ts +1 -0
  38. package/dist/agent/providers/openai-compatible/query/compact-handler.d.ts +1 -1
  39. package/dist/agent/providers/openai-compatible/query/context-pressure.arguments.d.ts +2 -0
  40. package/dist/agent/providers/openai-compatible/query/context-pressure.d.ts +3 -2
  41. package/dist/agent/providers/openai-compatible/query/turn-iteration.d.ts +1 -1
  42. package/dist/agent/providers/shared/compaction.d.ts +1 -0
  43. package/dist/agent/providers/shared/compaction.summarizer-input.d.ts +4 -1
  44. package/dist/agent/providers/shared/lsp-install-eligibility.d.ts +2 -0
  45. package/dist/agent/session/accounting-accumulator.d.ts +6 -0
  46. package/dist/agent/session/closure-emitter.d.ts +4 -0
  47. package/dist/agent/session/ledger-lifecycle.d.ts +2 -0
  48. package/dist/agent/session/provider-lifecycle.d.ts +2 -1
  49. package/dist/agent/session/turn-stream-runner.fatal-done.d.ts +4 -0
  50. package/dist/agent/session/wire-executors.d.ts +3 -0
  51. package/dist/agent/subagent/continuation-dispose.d.ts +9 -0
  52. package/dist/agent/subagent/continuation-registry.d.ts +12 -0
  53. package/dist/agent/subagent/identity-preamble.d.ts +1 -1
  54. package/dist/agent/subagent/identity-preamble.worktree.d.ts +3 -0
  55. package/dist/agent/tool-category.d.ts +2 -1
  56. package/dist/agent/tools/compose-input-parse.d.ts +1 -0
  57. package/dist/agent/tools/dispatcher.d.ts +4 -2
  58. package/dist/agent/tools/dispatcher.handler-context.d.ts +4 -0
  59. package/dist/agent/tools/dispatcher.ledger.d.ts +6 -1
  60. package/dist/agent/tools/dispatcher.options.d.ts +2 -0
  61. package/dist/agent/tools/dispatcher.pre-dispatch-gates.bash.d.ts +6 -0
  62. package/dist/agent/tools/dispatcher.pre-dispatch-gates.d.ts +1 -0
  63. package/dist/agent/tools/handlers/grep.pipe-retry.d.ts +2 -2
  64. package/dist/agent/tools/handlers/lsp-diagnostics.d.ts +2 -2
  65. package/dist/agent/tools/handlers/lsp-install-consent.d.ts +3 -0
  66. package/dist/agent/tools/handlers/lsp-refactor-actions.d.ts +21 -0
  67. package/dist/agent/tools/handlers/lsp-refactor-input.d.ts +16 -0
  68. package/dist/agent/tools/handlers/lsp-refactor-symbols.d.ts +10 -0
  69. package/dist/agent/tools/handlers/lsp-refactor.d.ts +4 -0
  70. package/dist/agent/tools/handlers/lsp-server.d.ts +15 -0
  71. package/dist/agent/tools/handlers/lsp-symbols.d.ts +2 -1
  72. package/dist/agent/tools/handlers/lsp-workspace-edit-parse.d.ts +19 -0
  73. package/dist/agent/tools/handlers/lsp-workspace-edit.d.ts +18 -0
  74. package/dist/agent/tools/handlers/patch-apply-engine.d.ts +1 -1
  75. package/dist/agent/tools/handlers/patch-apply-guard.d.ts +2 -0
  76. package/dist/agent/tools/handlers/worktree.create-note.d.ts +1 -0
  77. package/dist/agent/tools/nesting.d.ts +1 -0
  78. package/dist/agent/tools/readonly-bash.destructive-git.d.ts +8 -0
  79. package/dist/agent/tools/readonly-bash.destructive-git.heredoc.d.ts +7 -0
  80. package/dist/agent/tools/readonly-bash.destructive-git.nested.d.ts +5 -0
  81. package/dist/agent/tools/readonly-bash.tokenizer.d.ts +5 -0
  82. package/dist/agent/tools/subagent/background-branch.d.ts +1 -0
  83. package/dist/agent/tools/subagent/continuation-dispatch.d.ts +8 -0
  84. package/dist/agent/tools/subagent/continuation-run.d.ts +1 -0
  85. package/dist/agent/tools/subagent/continuation-worktree.d.ts +21 -0
  86. package/dist/agent/tools/subagent/foreground-handoff.d.ts +1 -1
  87. package/dist/agent/tools/subagent/foreground-promotion.d.ts +5 -0
  88. package/dist/agent/tools/subagent/input-parse.d.ts +1 -0
  89. package/dist/agent/tools/subagent-executor.execute-once.helpers.d.ts +2 -1
  90. package/dist/agent/tools/types.d.ts +1 -0
  91. package/dist/agent/trace/cost.d.ts +17 -0
  92. package/dist/agent/trace/emit.d.ts +2 -1
  93. package/dist/agent/trace/events.compaction.d.ts +2 -0
  94. package/dist/agent/trace/events.d.ts +10 -0
  95. package/dist/agent/trace/events.session-phase.d.ts +2 -0
  96. package/dist/agent/trace/receipt.types.d.ts +3 -0
  97. package/dist/agent/trace/types.compaction.d.ts +36 -0
  98. package/dist/agent/trace/types.d.ts +4 -34
  99. package/dist/agent/trace/types.session-phase.d.ts +1 -1
  100. package/dist/agent/trace/writer.d.ts +2 -1
  101. package/dist/agent/types/config-types.d.ts +1 -0
  102. package/dist/agent/types/message-types.d.ts +2 -0
  103. package/dist/agent/worktree/isolated-slug.d.ts +11 -0
  104. package/dist/agent/worktree/worktree-scratch.d.ts +13 -0
  105. package/dist/agent/worktree/worktree-sweep.classify.d.ts +1 -0
  106. package/dist/bundled-plugins/awa-bundled/skills/diagnose/SKILL.md +1 -1
  107. package/dist/bundled-plugins/awa-bundled/skills/refactor/SKILL.md +1 -1
  108. package/dist/bundled-plugins/awa-bundled/skills/ship/SKILL.md +17 -8
  109. package/dist/cli/commands/events.d.ts +2 -0
  110. package/dist/cli/commands/interactive/bootstrap-infra.d.ts +2 -0
  111. package/dist/cli/session-autosave.d.ts +1 -0
  112. package/dist/cli/session-store.d.ts +1 -1
  113. package/dist/cli/slash/plugin-skills/state.d.ts +1 -0
  114. package/dist/cli/tty-trace.d.ts +8 -0
  115. package/dist/cli.mjs +690 -661
  116. package/dist/config/env.d.ts +44 -0
  117. package/dist/config/env.daemon.d.ts +23 -0
  118. package/dist/config/env.prompt-experiment.d.ts +15 -0
  119. package/dist/config/env.tty-trace.d.ts +8 -0
  120. package/dist/index.mjs +493 -475
  121. package/dist/insights/aggregators/session-prescreen.d.ts +1 -0
  122. package/dist/remote/remote-subagent-handle.d.ts +5 -2
  123. package/dist/telegram/session-lifecycle.d.ts +1 -1
  124. package/dist/telegram/session-provider.d.ts +5 -0
  125. package/dist/telegram.mjs +538 -521
  126. package/dist/web-ui-assets/assets/{angular-html-BuB3Xwa-.js → angular-html-D3r_OvVu.js} +1 -1
  127. package/dist/web-ui-assets/assets/{angular-ts-DrWtBiBz.js → angular-ts-CYYKmYCY.js} +1 -1
  128. package/dist/web-ui-assets/assets/{apl-BfbHb7D4.js → apl-Qebclc6H.js} +1 -1
  129. package/dist/web-ui-assets/assets/{astro-Be6fp2Al.js → astro-EC7rA9tr.js} +1 -1
  130. package/dist/web-ui-assets/assets/{blade-DzrBc1Ik.js → blade-3LEHciyw.js} +1 -1
  131. package/dist/web-ui-assets/assets/{c-BmOCcIKK.js → c-BMHvDp3M.js} +1 -1
  132. package/dist/web-ui-assets/assets/{chapel-DqoMRDYP.js → chapel-DIdY1czS.js} +1 -1
  133. package/dist/web-ui-assets/assets/{cobol-BWcFjXux.js → cobol-B4veGjea.js} +1 -1
  134. package/dist/web-ui-assets/assets/{coffee-fgm8QvPo.js → coffee-CTW65drd.js} +1 -1
  135. package/dist/web-ui-assets/assets/{cpp-Bm53UCRY.js → cpp-UFv8IcpT.js} +1 -1
  136. package/dist/web-ui-assets/assets/{crystal-BOM_4uHZ.js → crystal-CAl2astP.js} +1 -1
  137. package/dist/web-ui-assets/assets/{css-NyBy1rdj.js → css-W4FP-8b5.js} +1 -1
  138. package/dist/web-ui-assets/assets/{dist-BwLOGCJM.js → dist-CL6azZY0.js} +2 -2
  139. package/dist/web-ui-assets/assets/{edge-DVJOwB-r.js → edge-BHV7W1lD.js} +1 -1
  140. package/dist/web-ui-assets/assets/{elixir-22WcAtSb.js → elixir-BSeMK1dJ.js} +1 -1
  141. package/dist/web-ui-assets/assets/{elm-Ddhj6iO2.js → elm-DBbEnhG_.js} +1 -1
  142. package/dist/web-ui-assets/assets/{erb-BBnnDLnf.js → erb-prErkLIh.js} +1 -1
  143. package/dist/web-ui-assets/assets/{git-rebase-C1maaghc.js → git-rebase-C2YnmdYZ.js} +1 -1
  144. package/dist/web-ui-assets/assets/{glimmer-js-CnZUZaVl.js → glimmer-js-UE5yPqqs.js} +1 -1
  145. package/dist/web-ui-assets/assets/{glimmer-ts-D8dEoCFG.js → glimmer-ts-CHUC7ee4.js} +1 -1
  146. package/dist/web-ui-assets/assets/{glsl-Bk477m8m.js → glsl-BP7hWcQl.js} +1 -1
  147. package/dist/web-ui-assets/assets/{graphql-DT_lK-LX.js → graphql-B2mDXSlF.js} +1 -1
  148. package/dist/web-ui-assets/assets/{hack-MX1qmO45.js → hack-CYmItAIT.js} +1 -1
  149. package/dist/web-ui-assets/assets/{haml-Dl9ZsNh1.js → haml-BE55kcBt.js} +1 -1
  150. package/dist/web-ui-assets/assets/{handlebars-Dfku37Fg.js → handlebars-HqWAfmn0.js} +1 -1
  151. package/dist/web-ui-assets/assets/{html-rBV1hv39.js → html-DQqmUNra.js} +1 -1
  152. package/dist/web-ui-assets/assets/{html-derivative-BugeKd9d.js → html-derivative-DHtOwb02.js} +1 -1
  153. package/dist/web-ui-assets/assets/{http-C1FdJQoT.js → http-qsOPQWSh.js} +1 -1
  154. package/dist/web-ui-assets/assets/{hurl-B8Tqv--n.js → hurl-CLG0zR7e.js} +1 -1
  155. package/dist/web-ui-assets/assets/{index-jxN_375F.css → index-7_rxjzbt.css} +1 -1
  156. package/dist/web-ui-assets/assets/index-CrFMdDLW.js +94 -0
  157. package/dist/web-ui-assets/assets/{java-i9tQYiUJ.js → java-CIoYCZPE.js} +1 -1
  158. package/dist/web-ui-assets/assets/{javascript-DHkYQPBV.js → javascript-BiSgC3HH.js} +1 -1
  159. package/dist/web-ui-assets/assets/{jinja-BsYyycs0.js → jinja-uoMhNXH1.js} +1 -1
  160. package/dist/web-ui-assets/assets/{jison-B4utk3Rp.js → jison-62dtSwty.js} +1 -1
  161. package/dist/web-ui-assets/assets/{json-CkQJ6hZ6.js → json-Cxps7Vp_.js} +1 -1
  162. package/dist/web-ui-assets/assets/{jsx-BxpqLhaw.js → jsx-i4FhzmZ3.js} +1 -1
  163. package/dist/web-ui-assets/assets/{julia-Bz0RIEKk.js → julia-4eQbL51O.js} +1 -1
  164. package/dist/web-ui-assets/assets/{just-CKJs0D30.js → just-DuzaqAD6.js} +1 -1
  165. package/dist/web-ui-assets/assets/{latex-Dkxnor6C.js → latex-DR1YiBEA.js} +1 -1
  166. package/dist/web-ui-assets/assets/{liquid-CYklfeLg.js → liquid-BCJgC6HS.js} +1 -1
  167. package/dist/web-ui-assets/assets/{lua-BMXYDhjN.js → lua-BC4drQZp.js} +1 -1
  168. package/dist/web-ui-assets/assets/{marko-DDcpjyDA.js → marko-DtJIqB68.js} +1 -1
  169. package/dist/web-ui-assets/assets/{mdc-DCfW6SUk.js → mdc-CYBfAC3q.js} +1 -1
  170. package/dist/web-ui-assets/assets/{nginx-HhjkSdae.js → nginx-CMR593MB.js} +1 -1
  171. package/dist/web-ui-assets/assets/{nim-DzYITBYm.js → nim-BbUeXd8c.js} +1 -1
  172. package/dist/web-ui-assets/assets/{org-OV0shxVF.js → org-oHqhaY5K.js} +1 -1
  173. package/dist/web-ui-assets/assets/{perl-CNHoCLMx.js → perl-DE4Fx5iS.js} +1 -1
  174. package/dist/web-ui-assets/assets/{php-D3UW9YmA.js → php-rh-d5On6.js} +1 -1
  175. package/dist/web-ui-assets/assets/{pug-gZURAtyY.js → pug-8Ni7Ix1b.js} +1 -1
  176. package/dist/web-ui-assets/assets/{qml-CxczNQrj.js → qml-CrGNXQfX.js} +1 -1
  177. package/dist/web-ui-assets/assets/{r-CYSQmhYh.js → r-BiZL36Lf.js} +1 -1
  178. package/dist/web-ui-assets/assets/{razor-C8RkL8GY.js → razor-DnQFAjmg.js} +1 -1
  179. package/dist/web-ui-assets/assets/{regexp-BROA9FZ9.js → regexp-ZehcoqOu.js} +1 -1
  180. package/dist/web-ui-assets/assets/{rst-6_5wei2F.js → rst-BHnIys2E.js} +1 -1
  181. package/dist/web-ui-assets/assets/{ruby-CGSkRBuk.js → ruby-CQjEBqXf.js} +1 -1
  182. package/dist/web-ui-assets/assets/{sas-BHzPKY9p.js → sas-DDw_qWwd.js} +1 -1
  183. package/dist/web-ui-assets/assets/{scss-BhdrfutF.js → scss-Buc-D2q0.js} +1 -1
  184. package/dist/web-ui-assets/assets/{shellscript-2oBOuRcG.js → shellscript-DSdjoUZi.js} +1 -1
  185. package/dist/web-ui-assets/assets/{shellsession-_NizP2ZG.js → shellsession-Dlf5ZOd7.js} +1 -1
  186. package/dist/web-ui-assets/assets/{soy-Cq1Cl1Y_.js → soy-BtqthtDI.js} +1 -1
  187. package/dist/web-ui-assets/assets/{sql-DCk2ZvIR.js → sql-Wbs3a-2M.js} +1 -1
  188. package/dist/web-ui-assets/assets/{stata-CY0XEIjf.js → stata-CZQadxtE.js} +1 -1
  189. package/dist/web-ui-assets/assets/{surrealql-DPCIj4-R.js → surrealql-BHX1_keB.js} +1 -1
  190. package/dist/web-ui-assets/assets/{svelte-mNYrrLYc.js → svelte-5Gzb7jP2.js} +1 -1
  191. package/dist/web-ui-assets/assets/{templ-CjaWoGHC.js → templ-6-2sxD2t.js} +1 -1
  192. package/dist/web-ui-assets/assets/{tex-D3ao8VCf.js → tex-s7OSL_QU.js} +1 -1
  193. package/dist/web-ui-assets/assets/{ts-tags-lFkQdLml.js → ts-tags-ILSDF7eF.js} +1 -1
  194. package/dist/web-ui-assets/assets/{tsx-CsdWmMpE.js → tsx-Ba3RCOh1.js} +1 -1
  195. package/dist/web-ui-assets/assets/{twig-CSGU10iK.js → twig-B5Q27p1D.js} +1 -1
  196. package/dist/web-ui-assets/assets/{typescript-CEegO1My.js → typescript-BGZwH6By.js} +1 -1
  197. package/dist/web-ui-assets/assets/{typst-DzDXDNft.js → typst-BNUBq5yx.js} +1 -1
  198. package/dist/web-ui-assets/assets/{vue-DWAhaqej.js → vue-BWxalE-A.js} +1 -1
  199. package/dist/web-ui-assets/assets/{vue-html-DF5GPB7J.js → vue-html-Czl3_Xc-.js} +1 -1
  200. package/dist/web-ui-assets/assets/{vue-vine-DXYE3l-Q.js → vue-vine-DbFJFkgw.js} +1 -1
  201. package/dist/web-ui-assets/assets/{xml-D6s8ylbB.js → xml-_-I97g00.js} +1 -1
  202. package/dist/web-ui-assets/assets/{xsl-C1cpADN5.js → xsl-BS-NWXy1.js} +1 -1
  203. package/dist/web-ui-assets/assets/{yaml-BxT2kUBY.js → yaml-Dru6aRB_.js} +1 -1
  204. package/dist/web-ui-assets/index.html +2 -2
  205. package/package.json +6 -3
  206. package/dist/web-ui-assets/assets/index-Fk5hxG58.js +0 -94
@@ -240,6 +240,8 @@ export declare const ClosurePayloadSchema: z.ZodObject<{
240
240
  }>;
241
241
  finalTurnCount: z.ZodNumber;
242
242
  finalCostUsd: z.ZodNumber;
243
+ overageCostUsd: z.ZodOptional<z.ZodNumber>;
244
+ overageRequests: z.ZodOptional<z.ZodNumber>;
243
245
  finalTokens: z.ZodObject<{
244
246
  input: z.ZodOptional<z.ZodNumber>;
245
247
  output: z.ZodOptional<z.ZodNumber>;
@@ -587,6 +589,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
587
589
  messagesBefore: z.ZodNumber;
588
590
  messagesAfter: z.ZodNumber;
589
591
  tokensSavedEstimate: z.ZodOptional<z.ZodNumber>;
592
+ summarizerInputCharsDropped: z.ZodOptional<z.ZodNumber>;
590
593
  summarizationTokens: z.ZodOptional<z.ZodObject<{
591
594
  input: z.ZodNumber;
592
595
  output: z.ZodNumber;
@@ -607,6 +610,8 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
607
610
  }>;
608
611
  finalTurnCount: z.ZodNumber;
609
612
  finalCostUsd: z.ZodNumber;
613
+ overageCostUsd: z.ZodOptional<z.ZodNumber>;
614
+ overageRequests: z.ZodOptional<z.ZodNumber>;
610
615
  finalTokens: z.ZodObject<{
611
616
  input: z.ZodOptional<z.ZodNumber>;
612
617
  output: z.ZodOptional<z.ZodNumber>;
@@ -765,6 +770,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
765
770
  round_cap_notice_dropped: "round_cap_notice_dropped";
766
771
  continuation_settle_degraded: "continuation_settle_degraded";
767
772
  prompt_fragment_sizes: "prompt_fragment_sizes";
773
+ ratelimit_unified_state: "ratelimit_unified_state";
768
774
  }>;
769
775
  durationMs: z.ZodOptional<z.ZodNumber>;
770
776
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -1066,6 +1072,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1066
1072
  messagesBefore: z.ZodNumber;
1067
1073
  messagesAfter: z.ZodNumber;
1068
1074
  tokensSavedEstimate: z.ZodOptional<z.ZodNumber>;
1075
+ summarizerInputCharsDropped: z.ZodOptional<z.ZodNumber>;
1069
1076
  summarizationTokens: z.ZodOptional<z.ZodObject<{
1070
1077
  input: z.ZodNumber;
1071
1078
  output: z.ZodNumber;
@@ -1088,6 +1095,8 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1088
1095
  }>;
1089
1096
  finalTurnCount: z.ZodNumber;
1090
1097
  finalCostUsd: z.ZodNumber;
1098
+ overageCostUsd: z.ZodOptional<z.ZodNumber>;
1099
+ overageRequests: z.ZodOptional<z.ZodNumber>;
1091
1100
  finalTokens: z.ZodObject<{
1092
1101
  input: z.ZodOptional<z.ZodNumber>;
1093
1102
  output: z.ZodOptional<z.ZodNumber>;
@@ -1256,6 +1265,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1256
1265
  round_cap_notice_dropped: "round_cap_notice_dropped";
1257
1266
  continuation_settle_degraded: "continuation_settle_degraded";
1258
1267
  prompt_fragment_sizes: "prompt_fragment_sizes";
1268
+ ratelimit_unified_state: "ratelimit_unified_state";
1259
1269
  }>;
1260
1270
  durationMs: z.ZodOptional<z.ZodNumber>;
1261
1271
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -56,6 +56,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
56
56
  round_cap_notice_dropped: "round_cap_notice_dropped";
57
57
  continuation_settle_degraded: "continuation_settle_degraded";
58
58
  prompt_fragment_sizes: "prompt_fragment_sizes";
59
+ ratelimit_unified_state: "ratelimit_unified_state";
59
60
  }>;
60
61
  export declare const SessionPhasePayloadSchema: z.ZodObject<{
61
62
  phase: z.ZodEnum<{
@@ -115,6 +116,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
115
116
  round_cap_notice_dropped: "round_cap_notice_dropped";
116
117
  continuation_settle_degraded: "continuation_settle_degraded";
117
118
  prompt_fragment_sizes: "prompt_fragment_sizes";
119
+ ratelimit_unified_state: "ratelimit_unified_state";
118
120
  }>;
119
121
  durationMs: z.ZodOptional<z.ZodNumber>;
120
122
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -66,6 +66,9 @@ export interface RunReceipt {
66
66
  totalCostUsd?: number;
67
67
  totalTokens?: CostTokens;
68
68
  costSource?: SessionCostSource;
69
+ overageCostUsd?: number;
70
+ overageRequests?: number;
71
+ overageIncomplete?: true;
69
72
  };
70
73
  failures: ReceiptToolFailure[];
71
74
  humanReviewRequired: boolean;
@@ -0,0 +1,36 @@
1
+ export type CompactionTrigger = 'manual' | 'token_threshold' | 'turn_count';
2
+ export interface CompactionPayloadInput {
3
+ trigger: CompactionTrigger;
4
+ preCompactionMessages: unknown[];
5
+ summary: string;
6
+ keptTailCount: number;
7
+ keepLastNConfig: number;
8
+ messagesBefore: number;
9
+ messagesAfter: number;
10
+ tokensSavedEstimate?: number;
11
+ summarizationTokens?: {
12
+ input: number;
13
+ output: number;
14
+ };
15
+ summarizerInputCharsDropped?: number;
16
+ }
17
+ export interface CompactionSidecarRef {
18
+ path: string;
19
+ sizeBytes: number;
20
+ sha256: string;
21
+ }
22
+ export interface CompactionPayloadPersisted {
23
+ trigger: CompactionTrigger;
24
+ preCompactionMessagesRef: CompactionSidecarRef;
25
+ summary: string;
26
+ keptTailCount: number;
27
+ keepLastNConfig: number;
28
+ messagesBefore: number;
29
+ messagesAfter: number;
30
+ tokensSavedEstimate?: number;
31
+ summarizationTokens?: {
32
+ input: number;
33
+ output: number;
34
+ };
35
+ summarizerInputCharsDropped?: number;
36
+ }
@@ -110,45 +110,15 @@ export interface AbortPayload {
110
110
  cascadedTo: readonly string[];
111
111
  reason?: string;
112
112
  }
113
- export type CompactionTrigger = 'manual' | 'token_threshold' | 'turn_count';
114
- export interface CompactionPayloadInput {
115
- trigger: CompactionTrigger;
116
- preCompactionMessages: unknown[];
117
- summary: string;
118
- keptTailCount: number;
119
- keepLastNConfig: number;
120
- messagesBefore: number;
121
- messagesAfter: number;
122
- tokensSavedEstimate?: number;
123
- summarizationTokens?: {
124
- input: number;
125
- output: number;
126
- };
127
- }
128
- export interface CompactionSidecarRef {
129
- path: string;
130
- sizeBytes: number;
131
- sha256: string;
132
- }
133
- export interface CompactionPayloadPersisted {
134
- trigger: CompactionTrigger;
135
- preCompactionMessagesRef: CompactionSidecarRef;
136
- summary: string;
137
- keptTailCount: number;
138
- keepLastNConfig: number;
139
- messagesBefore: number;
140
- messagesAfter: number;
141
- tokensSavedEstimate?: number;
142
- summarizationTokens?: {
143
- input: number;
144
- output: number;
145
- };
146
- }
113
+ import type { CompactionPayloadInput, CompactionPayloadPersisted } from './types.compaction.js';
114
+ export type { CompactionTrigger, CompactionPayloadInput, CompactionPayloadPersisted, CompactionSidecarRef, } from './types.compaction.js';
147
115
  export type ClosureReason = 'model_end_turn' | 'truncated' | 'iteration_cap' | 'abort' | 'timeout' | 'budget_exceeded' | 'hook_blocked' | 'max_turns_exceeded';
148
116
  export interface ClosurePayload {
149
117
  reason: ClosureReason;
150
118
  finalTurnCount: number;
151
119
  finalCostUsd: number;
120
+ overageCostUsd?: number;
121
+ overageRequests?: number;
152
122
  finalTokens: {
153
123
  input?: number;
154
124
  output?: number;
@@ -1,4 +1,4 @@
1
- export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'context_pressure_wind_down' | 'catalog_model_upgrade' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'credential_swap' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery' | 'gate_shape' | 'session_id_assigned' | 'many_image_degraded' | 'stream_accepted_after_drop' | 'connection_retry' | 'connection_retry_exhausted' | 'connection_failure' | 'connection_recovered' | 'connection_budget_exhausted' | 'usage_notice' | 'tool_degraded' | 'strategy_nudge_fired' | 'stop_inject_dropped' | 'stop_hook_continuation' | 'stop_hook_cap_reached' | 'orphan_repair' | 'thinking_block_dropped' | 'background_process_started' | 'background_process_settled' | 'compose_recovery_decision' | 'compose_leaf_tools_stripped' | 'hook_block_repeat_tripped' | 'endpoint_semaphore_wait' | 'billing_settled' | 'subagent_model_fallback' | 'model_fallback' | 'round_cap_notice_dropped' | 'continuation_settle_degraded' | 'prompt_fragment_sizes';
1
+ export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'context_pressure_wind_down' | 'catalog_model_upgrade' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'credential_swap' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery' | 'gate_shape' | 'session_id_assigned' | 'many_image_degraded' | 'stream_accepted_after_drop' | 'connection_retry' | 'connection_retry_exhausted' | 'connection_failure' | 'connection_recovered' | 'connection_budget_exhausted' | 'usage_notice' | 'tool_degraded' | 'strategy_nudge_fired' | 'stop_inject_dropped' | 'stop_hook_continuation' | 'stop_hook_cap_reached' | 'orphan_repair' | 'thinking_block_dropped' | 'background_process_started' | 'background_process_settled' | 'compose_recovery_decision' | 'compose_leaf_tools_stripped' | 'hook_block_repeat_tripped' | 'endpoint_semaphore_wait' | 'billing_settled' | 'subagent_model_fallback' | 'model_fallback' | 'round_cap_notice_dropped' | 'continuation_settle_degraded' | 'prompt_fragment_sizes' | 'ratelimit_unified_state';
2
2
  export interface SessionPhasePayload {
3
3
  phase: SessionPhaseName;
4
4
  durationMs?: number;
@@ -1,4 +1,5 @@
1
- import type { CompactionPayloadInput, SessionSealedPayload, TraceEvent, TraceEventInput } from './types.js';
1
+ import type { CompactionPayloadInput } from './types.compaction.js';
2
+ import type { SessionSealedPayload, TraceEvent, TraceEventInput } from './types.js';
2
3
  export interface TraceSink {
3
4
  write(event: TraceEventInput): Promise<void>;
4
5
  getTracePath(): string;
@@ -117,6 +117,7 @@ export interface AgentConfig {
117
117
  skillDispatchName?: string;
118
118
  isUnnamedWorker?: boolean;
119
119
  isNonInteractive?: boolean;
120
+ lspInstallAllowed?: boolean;
120
121
  autoCompact?: boolean | {
121
122
  threshold: number;
122
123
  };
@@ -9,6 +9,8 @@ export interface ResponseMetadata extends Record<string, unknown> {
9
9
  durationMs?: number;
10
10
  durationApiMs?: number;
11
11
  totalCostUsd?: number;
12
+ overageCostUsd?: number;
13
+ overageRequests?: number;
12
14
  numTurns?: number;
13
15
  isError?: boolean;
14
16
  usage?: Record<string, unknown>;
@@ -0,0 +1,11 @@
1
+ export declare const ISOLATED_SLUG_SUFFIX_LENGTH = 6;
2
+ export declare const MAX_TASK_SLUG_LENGTH = 48;
3
+ export declare function randomSlugSuffix(bytes?: (n: number) => Buffer): string;
4
+ export declare function cleanTaskSlug(raw: string): string;
5
+ export interface BuildIsolatedSlugArgs {
6
+ taskSlug?: string | undefined;
7
+ idPrefix: string | undefined;
8
+ counter: number;
9
+ suffix?: string;
10
+ }
11
+ export declare function buildIsolatedSlug(args: BuildIsolatedSlugArgs): string;
@@ -0,0 +1,13 @@
1
+ export declare const AFK_SCRATCH_DIR = ".afk-scratch";
2
+ export declare const AFK_SCRATCH_EXCLUDE_PATTERN = "/.afk-scratch/";
3
+ export declare const AFK_META_FILE = ".afk-worktree-meta.json";
4
+ export declare const AFK_META_EXCLUDE_PATTERN = "/.afk-worktree-meta.json";
5
+ export type ScratchGitRunner = (file: string, args: string[]) => Promise<{
6
+ stdout: string;
7
+ stderr: string;
8
+ }>;
9
+ export declare function isScratchDisposable(worktreePath: string): Promise<boolean>;
10
+ export declare function missingAfkExcludes(content: string): string[];
11
+ export declare function excludeHasScratchEntry(content: string): boolean;
12
+ export declare function excludeHasMetaEntry(content: string): boolean;
13
+ export declare function ensureAfkExcludes(execFile: ScratchGitRunner, anyPath: string): Promise<boolean>;
@@ -6,6 +6,7 @@ export interface WorktreeMeta {
6
6
  createdAt: string;
7
7
  baseSha?: string;
8
8
  baseBranch?: string;
9
+ scratchDisposable?: boolean;
9
10
  preservedReason?: 'dirty' | 'commits-ahead' | 'ignored-local-state';
10
11
  preservedAt?: string;
11
12
  commitsAheadAtPreserve?: number;
@@ -14,6 +14,6 @@ Gather context: read the failing test or bug description, relevant error output,
14
14
  - Git history agent: `id_prefix: "git history"`
15
15
  - Each hypothesis-testing agent: `id_prefix: "hypothesis: <one-phrase cause>"` (e.g. `"hypothesis: null deref in parser"`)
16
16
 
17
- For each hypothesis, dispatch a sub-agent with `isolation: "worktree"` to apply a minimal speculative fix, run the test or verification command, and then run the broader related test suite to check for regressions. Run all hypothesis-testing agents in parallel. Collect results: which fixes passed, which didn't, and any regressions surfaced by the broader suite.
17
+ For each hypothesis, dispatch a sub-agent with `isolation: "worktree"` (and a `task_slug` naming the hypothesis, e.g. `hyp-null-deref-parser`, so its branch is readable) to apply a minimal speculative fix, run the test or verification command, and then run the broader related test suite to check for regressions. Run all hypothesis-testing agents in parallel. Collect results: which fixes passed, which didn't, and any regressions surfaced by the broader suite.
18
18
 
19
19
  Report the validated root cause (the hypothesis whose fix passed), the speculative fix diff, and regression status from the broader test run. If no hypothesis passes, synthesize what was learned and form a second round of hypotheses. If the user approves the fix, apply it to the main worktree.
@@ -90,7 +90,7 @@ Dispatch one sub-agent per site in this layer, all in parallel, each in a worktr
90
90
  - `test_output`: truncated stdout of the targeted test run (last 20 lines)
91
91
  - `failure_reason`: populated only if `status == "red"` — the first failing assertion + the file:line where it fired
92
92
  - non_goals: Do not change any file other than the one in your site descriptor. Do not run the full test suite.
93
- - IMPORTANT: this sub-agent MAY call `edit_file` and run bash commands; `isolation: "worktree"` is required.
93
+ - IMPORTANT: this sub-agent MAY call `edit_file` and run bash commands; `isolation: "worktree"` is required. Set `task_slug` to a short kebab name for the site (e.g. `refactor-l2-auth-client`) so the worktree branch is readable.
94
94
 
95
95
  **Layer gate — hard stop before proceeding to the next layer:**
96
96
  - All sites in this layer `status == "green"` → proceed to the next layer.
@@ -62,13 +62,21 @@ Before committing, review the **file list** to stage — don't sweep in untracke
62
62
  Stage only the confirmed files, then write the commit message to a temp file with your file-writing tool — **NOT** a shell heredoc — and commit with `-F`:
63
63
 
64
64
  ```
65
- # 1. Write the subject + body to a temp file (e.g. .git/COMMIT_BODY.txt) using
66
- # your file-writing tool. The content never passes through the shell.
67
- # 2. Commit from that file:
68
- git commit -F .git/COMMIT_BODY.txt
65
+ # 1. Pick the scratch dir <SCRATCH>. It must not be the working tree itself:
66
+ # - Your cwd is under `.afk-worktrees/` (an afk-managed worktree):
67
+ # <worktree-root>/.afk-scratch
68
+ # git ignores it, you can always write there, and it is deleted with
69
+ # the worktree.
70
+ # - Any other checkout: the path printed by
71
+ # git rev-parse --absolute-git-dir
72
+ # Do NOT assume `.git/`: in a linked worktree `.git` is a FILE.
73
+ # 2. Write the subject + body to <SCRATCH>/COMMIT_BODY.txt with your
74
+ # file-writing tool. The content never passes through the shell.
75
+ # 3. Commit from that file:
76
+ git commit -F <SCRATCH>/COMMIT_BODY.txt
69
77
  ```
70
78
 
71
- Going through a file keeps backticks, `$(...)`, and quotes in the message literal. **Never** assemble the message inline as `git commit -m "$(cat <<'EOF' … EOF)"` — a backtick or `$(` in the body is parsed by the shell *before* `git` runs, so the commit fails or records a mangled message. `.git/` is never staged, so the temp file can't sneak into the commit (in a linked worktree `.git` is a file, not a dir — write to the path printed by `git rev-parse --git-dir` instead).
79
+ Going through a file keeps backticks, `$(...)`, and quotes in the message literal. **Never** assemble the message inline as `git commit -m "$(cat <<'EOF' … EOF)"` — a backtick or `$(` in the body is parsed by the shell *before* `git` runs, so the commit fails or records a mangled message. Neither location is tracked or shown by `git status`, so the temp file can't sneak into the commit or leave the tree dirty. Never drop it anywhere else in an afk-managed worktree (for example `pr-body.txt` at the root): an untracked file there stops the worktree from being cleaned up.
72
80
 
73
81
  Never `--amend` (creates a new commit each time). Never bypass hooks (`--no-verify`).
74
82
 
@@ -146,12 +154,13 @@ Structure:
146
154
  Write the PR body (from Phase 7) to a temp file with your file-writing tool — **NOT** a shell heredoc — then pass it with `--body-file`:
147
155
 
148
156
  ```
149
- # 1. Write the Phase 7 PR body to a temp file (e.g. .git/PR_BODY.md) using your
150
- # file-writing tool. The body never passes through the shell.
157
+ # 1. Write the Phase 7 PR body to <SCRATCH>/PR_BODY.md (the same <SCRATCH>
158
+ # you picked in Phase 4) with your file-writing tool.
159
+ # The body never passes through the shell.
151
160
  # 2. Open the PR from that file:
152
161
  gh pr create \
153
162
  --title "<subject line of the commit>" \
154
- --body-file .git/PR_BODY.md \
163
+ --body-file <SCRATCH>/PR_BODY.md \
155
164
  --base <default-branch> \
156
165
  [--draft]
157
166
  ```
@@ -1,2 +1,4 @@
1
1
  import { Command } from 'commander';
2
+ import { type EnvVarName } from '../../config/env.js';
3
+ export declare function resolveSecretEnvName(name: string): EnvVarName | undefined;
2
4
  export declare function registerEventsCommand(program: Command): void;
@@ -5,6 +5,7 @@ import type { SkillExecutor } from '../../../agent/tools/skill-executor.js';
5
5
  import type { ComposeExecutor } from '../../../agent/tools/compose-executor.js';
6
6
  import type { SubagentManager } from '../../../agent/subagent.js';
7
7
  import { BackgroundAgentRegistry } from '../../../agent/background-registry.js';
8
+ import type { ContinuationRegistry } from '../../../agent/subagent/continuation-registry.js';
8
9
  import { BackgroundSummarizer } from '../../../agent/background-summarizer.js';
9
10
  import { DetachableToolRegistry } from '../../../agent/tools/detach-registry.js';
10
11
  import { ProcessJobRegistry } from '../../../agent/shell-jobs/process-jobs.js';
@@ -22,6 +23,7 @@ export interface BootstrapInfra {
22
23
  subagentExecutor: SubagentExecutor;
23
24
  skillExecutor: SkillExecutor;
24
25
  composeExecutor: ComposeExecutor;
26
+ continuationRegistry: ContinuationRegistry;
25
27
  }
26
28
  export declare function createBootstrapInfra(a: {
27
29
  sessionRef: SessionRef;
@@ -12,6 +12,7 @@ export interface SessionAutosaverOptions {
12
12
  export interface SessionAutosaver {
13
13
  readonly stats: SessionStats;
14
14
  saveTurn(userInput: string, assistantText: string, metadata: ResponseMetadata | undefined, toolEvents?: ToolEvent[]): void;
15
+ close(exitReason?: import('./session-store.js').StoredSession['exitReason']): void;
15
16
  }
16
17
  export declare function createSessionAutosaver(opts: SessionAutosaverOptions): SessionAutosaver;
17
18
  export interface CollectedTurn {
@@ -13,7 +13,7 @@ export interface StoredSession {
13
13
  startedAt: number;
14
14
  savedAt: number;
15
15
  endedAt?: number;
16
- exitReason?: 'sigint' | 'sigterm' | 'sighup' | 'exit-command' | 'eof';
16
+ exitReason?: 'sigint' | 'sigterm' | 'sighup' | 'exit-command' | 'eof' | 'task-complete';
17
17
  totalTurns: number;
18
18
  totalCostUsd: number;
19
19
  unpricedTurns?: number;
@@ -23,4 +23,5 @@ export declare function setState(next: PluginSkillsState): void;
23
23
  export declare function setInitBarrier(promise: Promise<void>): void;
24
24
  export declare function isPluginInitPending(): boolean;
25
25
  export declare function awaitPluginInit(timeoutMs: number): Promise<void>;
26
+ export declare function isRegistrySource(source: SkillManifestEntry['source'] | undefined): boolean;
26
27
  export declare function bareName(name: string): string;
@@ -0,0 +1,8 @@
1
+ export interface FsOps {
2
+ openSync(path: string, flags: string, mode?: number): number;
3
+ fchmodSync(fd: number, mode: number): void;
4
+ writeSync(fd: number, data: string): number;
5
+ closeSync(fd: number): void;
6
+ }
7
+ export declare function installTtyTrace(fsOps?: FsOps): void;
8
+ export declare function uninstallTtyTrace(): void;