@yanlinglabs/winter-agent-runtime 0.0.27

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 (311) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +41 -0
  3. package/README.md +64 -0
  4. package/dist/checkpoint/file-history.d.ts +81 -0
  5. package/dist/checkpoint/rewind.d.ts +55 -0
  6. package/dist/checkpoint/seam.d.ts +47 -0
  7. package/dist/checkpoint/sink.d.ts +66 -0
  8. package/dist/commands/builtins-listing.d.ts +40 -0
  9. package/dist/commands/resolver.d.ts +103 -0
  10. package/dist/commands/seam.d.ts +53 -0
  11. package/dist/compaction/controller.d.ts +23 -0
  12. package/dist/compaction/retention.d.ts +35 -0
  13. package/dist/compaction/seam.d.ts +115 -0
  14. package/dist/compaction/summarizer.d.ts +79 -0
  15. package/dist/context/agent-listing.d.ts +39 -0
  16. package/dist/context/assembler.d.ts +46 -0
  17. package/dist/context/attachments.d.ts +104 -0
  18. package/dist/context/dynamic-sections.d.ts +31 -0
  19. package/dist/context/git-fixture.d.ts +18 -0
  20. package/dist/context/git-status.d.ts +16 -0
  21. package/dist/context/imports.d.ts +22 -0
  22. package/dist/context/injection.d.ts +53 -0
  23. package/dist/context/memory-key.d.ts +46 -0
  24. package/dist/context/memory.d.ts +28 -0
  25. package/dist/context/minimal-prompt.d.ts +5 -0
  26. package/dist/context/output-styles.d.ts +68 -0
  27. package/dist/context/plan-mode.d.ts +29 -0
  28. package/dist/context/request-layout.d.ts +138 -0
  29. package/dist/context/rules.d.ts +63 -0
  30. package/dist/context/seam.d.ts +136 -0
  31. package/dist/context/tool-epoch.d.ts +118 -0
  32. package/dist/context/winter-code-preset.d.ts +39 -0
  33. package/dist/context/winter-md.d.ts +81 -0
  34. package/dist/embedded-host.d.ts +48 -0
  35. package/dist/embedded-host.js +155 -0
  36. package/dist/embedded-protocol.d.ts +44 -0
  37. package/dist/embedded-worker.d.ts +1 -0
  38. package/dist/embedded-worker.js +74 -0
  39. package/dist/embedded.d.ts +34 -0
  40. package/dist/embedded.js +9 -0
  41. package/dist/engine.d.ts +1298 -0
  42. package/dist/hooks/additional-context.d.ts +21 -0
  43. package/dist/hooks/bounds.d.ts +6 -0
  44. package/dist/hooks/bridge-invoker.d.ts +3 -0
  45. package/dist/hooks/command-invoker.d.ts +52 -0
  46. package/dist/hooks/from-config.d.ts +31 -0
  47. package/dist/hooks/hook-stage.d.ts +25 -0
  48. package/dist/hooks/input-validator.d.ts +6 -0
  49. package/dist/hooks/reducer.d.ts +74 -0
  50. package/dist/hooks/registry.d.ts +33 -0
  51. package/dist/hooks/runner.d.ts +105 -0
  52. package/dist/index-584yahed.js +6037 -0
  53. package/dist/index-97t2rmtf.js +42 -0
  54. package/dist/index-9qgkpv56.js +27183 -0
  55. package/dist/index-bef62z3r.js +437 -0
  56. package/dist/index-rkhh0457.js +187 -0
  57. package/dist/index.d.ts +37 -0
  58. package/dist/index.js +353 -0
  59. package/dist/main.d.ts +1 -0
  60. package/dist/mcp/client.d.ts +105 -0
  61. package/dist/mcp/control-seam.d.ts +25 -0
  62. package/dist/mcp/control.d.ts +5 -0
  63. package/dist/mcp/elicitation.d.ts +35 -0
  64. package/dist/mcp/env.d.ts +12 -0
  65. package/dist/mcp/lifecycle.d.ts +142 -0
  66. package/dist/mcp/output-cap.d.ts +15 -0
  67. package/dist/mcp/state.d.ts +24 -0
  68. package/dist/mcp/test-fixtures.d.ts +88 -0
  69. package/dist/mcp/transports/__fixtures__/stdio-server.d.ts +1 -0
  70. package/dist/mcp/transports/http.d.ts +5 -0
  71. package/dist/mcp/transports/sdk.d.ts +5 -0
  72. package/dist/mcp/transports/sse.d.ts +3 -0
  73. package/dist/mcp/transports/stdio.d.ts +35 -0
  74. package/dist/mcp/winter-server.d.ts +2 -0
  75. package/dist/messaging/reference-adapter.d.ts +88 -0
  76. package/dist/messaging/router.d.ts +8 -0
  77. package/dist/paths/project-dir-name.d.ts +2 -0
  78. package/dist/paths/temp.d.ts +25 -0
  79. package/dist/permissions/approvals.d.ts +107 -0
  80. package/dist/permissions/auto/caches.d.ts +53 -0
  81. package/dist/permissions/auto/config.d.ts +37 -0
  82. package/dist/permissions/auto/engine.d.ts +74 -0
  83. package/dist/permissions/auto/envelope.d.ts +45 -0
  84. package/dist/permissions/auto/inheritance.d.ts +27 -0
  85. package/dist/permissions/edit-recognition.d.ts +30 -0
  86. package/dist/permissions/evaluator.d.ts +284 -0
  87. package/dist/permissions/file-rules.d.ts +384 -0
  88. package/dist/permissions/grammar.d.ts +113 -0
  89. package/dist/permissions/paths.d.ts +32 -0
  90. package/dist/permissions/policy-state.d.ts +64 -0
  91. package/dist/permissions/prompt-stage.d.ts +3 -0
  92. package/dist/permissions/protected.d.ts +54 -0
  93. package/dist/permissions/ruleset.d.ts +134 -0
  94. package/dist/permissions/shell-structure.d.ts +41 -0
  95. package/dist/plugins/bundle.d.ts +100 -0
  96. package/dist/plugins/installed.d.ts +30 -0
  97. package/dist/plugins/loader.d.ts +56 -0
  98. package/dist/plugins/manifest.d.ts +115 -0
  99. package/dist/production-wiring.d.ts +340 -0
  100. package/dist/protocol/channel.d.ts +22 -0
  101. package/dist/provider/advisor-route.d.ts +47 -0
  102. package/dist/provider/bridge.d.ts +124 -0
  103. package/dist/provider/classifier/model-classifier.d.ts +82 -0
  104. package/dist/provider/classifier/prompt.d.ts +62 -0
  105. package/dist/provider/classifier/verdict-schema.d.ts +83 -0
  106. package/dist/provider/credential-api.d.ts +160 -0
  107. package/dist/provider/family-listing.d.ts +27 -0
  108. package/dist/provider/first-party.d.ts +4 -0
  109. package/dist/provider/keychain-store.d.ts +59 -0
  110. package/dist/provider/lean-prompt.d.ts +7 -0
  111. package/dist/provider/mock.d.ts +55 -0
  112. package/dist/provider/scenario-fake.d.ts +96 -0
  113. package/dist/provider/selection.d.ts +115 -0
  114. package/dist/provider/session-provider.d.ts +426 -0
  115. package/dist/provider/slots.d.ts +120 -0
  116. package/dist/provider/stream-frames.d.ts +25 -0
  117. package/dist/provider/tool-secret.d.ts +57 -0
  118. package/dist/rpc/bridge.d.ts +14 -0
  119. package/dist/rpc/mcp-control.d.ts +26 -0
  120. package/dist/runtime.d.ts +14 -0
  121. package/dist/sandbox/profile.d.ts +249 -0
  122. package/dist/sandbox/spawn.d.ts +139 -0
  123. package/dist/settings/env-filter.d.ts +52 -0
  124. package/dist/settings/loaders/hooks.d.ts +44 -0
  125. package/dist/settings/loaders/mcp-config.d.ts +83 -0
  126. package/dist/settings/loaders/plugin-mcp.d.ts +3 -0
  127. package/dist/settings/loaders/strict-plugin-only.d.ts +13 -0
  128. package/dist/settings/resolve.d.ts +2 -0
  129. package/dist/settings/sources.d.ts +2 -0
  130. package/dist/settings/trust.d.ts +36 -0
  131. package/dist/skills/attachment.d.ts +25 -0
  132. package/dist/skills/frontmatter.d.ts +64 -0
  133. package/dist/skills/index.d.ts +16 -0
  134. package/dist/skills/listing.d.ts +89 -0
  135. package/dist/skills/loader.d.ts +104 -0
  136. package/dist/skills/option.d.ts +68 -0
  137. package/dist/skills/permission-rules.d.ts +21 -0
  138. package/dist/skills/runtime.d.ts +21 -0
  139. package/dist/skills/store.d.ts +163 -0
  140. package/dist/store/continuation-attach.d.ts +44 -0
  141. package/dist/store/dialect.d.ts +526 -0
  142. package/dist/store/provider-state.d.ts +188 -0
  143. package/dist/store/resume.d.ts +92 -0
  144. package/dist/structured/ajv-seam.d.ts +7 -0
  145. package/dist/structured/descriptor.d.ts +9 -0
  146. package/dist/structured/seam.d.ts +51 -0
  147. package/dist/structured/validator.d.ts +22 -0
  148. package/dist/subagents/activity.d.ts +13 -0
  149. package/dist/subagents/availability.d.ts +30 -0
  150. package/dist/subagents/builtin-agents.d.ts +37 -0
  151. package/dist/subagents/child-engine.d.ts +198 -0
  152. package/dist/subagents/child-handle.d.ts +344 -0
  153. package/dist/subagents/definitions.d.ts +189 -0
  154. package/dist/subagents/fork.d.ts +55 -0
  155. package/dist/subagents/git-root.d.ts +1 -0
  156. package/dist/subagents/limits.d.ts +28 -0
  157. package/dist/subagents/notification-queue.d.ts +233 -0
  158. package/dist/subagents/plugin-agents.d.ts +5 -0
  159. package/dist/subagents/policy.d.ts +46 -0
  160. package/dist/subagents/register-default-factory.d.ts +66 -0
  161. package/dist/subagents/resolution.d.ts +56 -0
  162. package/dist/subagents/restore.d.ts +9 -0
  163. package/dist/subagents/roster.d.ts +17 -0
  164. package/dist/subagents/test-fakes.d.ts +12 -0
  165. package/dist/subagents/tool-pools.d.ts +69 -0
  166. package/dist/subagents/watchdog.d.ts +13 -0
  167. package/dist/subagents/workspace.d.ts +27 -0
  168. package/dist/testing.d.ts +5 -0
  169. package/dist/testing.js +194 -0
  170. package/dist/tools/background-tasks.d.ts +10 -0
  171. package/dist/tools/descriptors/_shared.d.ts +34 -0
  172. package/dist/tools/descriptors/advisor.d.ts +1 -0
  173. package/dist/tools/descriptors/agent.d.ts +47 -0
  174. package/dist/tools/descriptors/artifact.d.ts +1 -0
  175. package/dist/tools/descriptors/ask-user-question.d.ts +1 -0
  176. package/dist/tools/descriptors/bash.d.ts +20 -0
  177. package/dist/tools/descriptors/claude-design.d.ts +1 -0
  178. package/dist/tools/descriptors/cron-create.d.ts +1 -0
  179. package/dist/tools/descriptors/cron-delete.d.ts +1 -0
  180. package/dist/tools/descriptors/cron-list.d.ts +1 -0
  181. package/dist/tools/descriptors/edit.d.ts +1 -0
  182. package/dist/tools/descriptors/end-conversation.d.ts +1 -0
  183. package/dist/tools/descriptors/enter-plan-mode.d.ts +1 -0
  184. package/dist/tools/descriptors/enter-worktree.d.ts +1 -0
  185. package/dist/tools/descriptors/exit-plan-mode.d.ts +1 -0
  186. package/dist/tools/descriptors/exit-worktree.d.ts +1 -0
  187. package/dist/tools/descriptors/glob.d.ts +1 -0
  188. package/dist/tools/descriptors/grep.d.ts +1 -0
  189. package/dist/tools/descriptors/index.d.ts +59 -0
  190. package/dist/tools/descriptors/list-agents.d.ts +1 -0
  191. package/dist/tools/descriptors/list-mcp-resources-tool.d.ts +1 -0
  192. package/dist/tools/descriptors/lsp.d.ts +1 -0
  193. package/dist/tools/descriptors/monitor.d.ts +1 -0
  194. package/dist/tools/descriptors/notebook-edit.d.ts +1 -0
  195. package/dist/tools/descriptors/powershell.d.ts +1 -0
  196. package/dist/tools/descriptors/projects.d.ts +1 -0
  197. package/dist/tools/descriptors/propose-goal.d.ts +1 -0
  198. package/dist/tools/descriptors/propose-skills.d.ts +1 -0
  199. package/dist/tools/descriptors/push-notification.d.ts +1 -0
  200. package/dist/tools/descriptors/read-mcp-resource-dir-tool.d.ts +1 -0
  201. package/dist/tools/descriptors/read-mcp-resource-tool.d.ts +1 -0
  202. package/dist/tools/descriptors/read-notifications.d.ts +1 -0
  203. package/dist/tools/descriptors/read.d.ts +1 -0
  204. package/dist/tools/descriptors/refresh-mcp-tools.d.ts +1 -0
  205. package/dist/tools/descriptors/remote-trigger.d.ts +1 -0
  206. package/dist/tools/descriptors/repl.d.ts +1 -0
  207. package/dist/tools/descriptors/report-findings.d.ts +1 -0
  208. package/dist/tools/descriptors/schedule-wakeup.d.ts +1 -0
  209. package/dist/tools/descriptors/send-feedback.d.ts +1 -0
  210. package/dist/tools/descriptors/send-message.d.ts +1 -0
  211. package/dist/tools/descriptors/send-user-file.d.ts +1 -0
  212. package/dist/tools/descriptors/share-onboarding-guide.d.ts +1 -0
  213. package/dist/tools/descriptors/show-onboarding-role-picker.d.ts +1 -0
  214. package/dist/tools/descriptors/skill.d.ts +1 -0
  215. package/dist/tools/descriptors/structured-output.d.ts +1 -0
  216. package/dist/tools/descriptors/task-create.d.ts +1 -0
  217. package/dist/tools/descriptors/task-get.d.ts +1 -0
  218. package/dist/tools/descriptors/task-list.d.ts +1 -0
  219. package/dist/tools/descriptors/task-output.d.ts +1 -0
  220. package/dist/tools/descriptors/task-stop.d.ts +1 -0
  221. package/dist/tools/descriptors/task-update.d.ts +1 -0
  222. package/dist/tools/descriptors/todo-write.d.ts +1 -0
  223. package/dist/tools/descriptors/tool-search.d.ts +1 -0
  224. package/dist/tools/descriptors/wait-for-mcp-servers.d.ts +1 -0
  225. package/dist/tools/descriptors/web-fetch.d.ts +8 -0
  226. package/dist/tools/descriptors/web-search.d.ts +15 -0
  227. package/dist/tools/descriptors/winter-list-agents.d.ts +1 -0
  228. package/dist/tools/descriptors/winter-send-message.d.ts +1 -0
  229. package/dist/tools/descriptors/workflow.d.ts +1 -0
  230. package/dist/tools/descriptors/write.d.ts +1 -0
  231. package/dist/tools/impl/_caller.d.ts +14 -0
  232. package/dist/tools/impl/_domains.d.ts +25 -0
  233. package/dist/tools/impl/_exa-client.d.ts +122 -0
  234. package/dist/tools/impl/_exa-session-client.d.ts +23 -0
  235. package/dist/tools/impl/_inner-model.d.ts +135 -0
  236. package/dist/tools/impl/_search-budget.d.ts +36 -0
  237. package/dist/tools/impl/_web-fetch-cache.d.ts +37 -0
  238. package/dist/tools/impl/_web-fetch-html.d.ts +26 -0
  239. package/dist/tools/impl/_web-fetch-net.d.ts +99 -0
  240. package/dist/tools/impl/_web-search-assembler.d.ts +57 -0
  241. package/dist/tools/impl/advisor.d.ts +37 -0
  242. package/dist/tools/impl/agent.d.ts +10 -0
  243. package/dist/tools/impl/ask-user-question.d.ts +5 -0
  244. package/dist/tools/impl/background-task-runtime.d.ts +272 -0
  245. package/dist/tools/impl/bash.d.ts +78 -0
  246. package/dist/tools/impl/cron.d.ts +11 -0
  247. package/dist/tools/impl/edit.d.ts +1 -0
  248. package/dist/tools/impl/enter-plan-mode.d.ts +4 -0
  249. package/dist/tools/impl/enter-worktree.d.ts +25 -0
  250. package/dist/tools/impl/exit-plan-mode.d.ts +4 -0
  251. package/dist/tools/impl/exit-worktree.d.ts +4 -0
  252. package/dist/tools/impl/glob.d.ts +1 -0
  253. package/dist/tools/impl/grep.d.ts +19 -0
  254. package/dist/tools/impl/index.d.ts +37 -0
  255. package/dist/tools/impl/list-agents.d.ts +7 -0
  256. package/dist/tools/impl/list-mcp-resources-tool.d.ts +9 -0
  257. package/dist/tools/impl/monitor.d.ts +66 -0
  258. package/dist/tools/impl/notebook-edit.d.ts +1 -0
  259. package/dist/tools/impl/push-notification.d.ts +4 -0
  260. package/dist/tools/impl/read-ladder.d.ts +25 -0
  261. package/dist/tools/impl/read-mcp-resource-dir-tool.d.ts +9 -0
  262. package/dist/tools/impl/read-mcp-resource-tool.d.ts +9 -0
  263. package/dist/tools/impl/read-notifications.d.ts +5 -0
  264. package/dist/tools/impl/read.d.ts +44 -0
  265. package/dist/tools/impl/refresh-mcp-tools.d.ts +8 -0
  266. package/dist/tools/impl/report-findings.d.ts +1 -0
  267. package/dist/tools/impl/schedule-wakeup.d.ts +2 -0
  268. package/dist/tools/impl/send-message.d.ts +7 -0
  269. package/dist/tools/impl/skill.d.ts +5 -0
  270. package/dist/tools/impl/task-graph.d.ts +1 -0
  271. package/dist/tools/impl/task-output.d.ts +16 -0
  272. package/dist/tools/impl/task-stop.d.ts +11 -0
  273. package/dist/tools/impl/todo-write.d.ts +8 -0
  274. package/dist/tools/impl/tool-search.d.ts +4 -0
  275. package/dist/tools/impl/wait-for-mcp-servers.d.ts +29 -0
  276. package/dist/tools/impl/web-fetch.d.ts +36 -0
  277. package/dist/tools/impl/web-search.d.ts +30 -0
  278. package/dist/tools/impl/workflow.d.ts +5 -0
  279. package/dist/tools/impl/write.d.ts +8 -0
  280. package/dist/tools/paths-seam.d.ts +6 -0
  281. package/dist/tools/read-state.d.ts +12 -0
  282. package/dist/tools/registry.d.ts +423 -0
  283. package/dist/tools/task-graph-store.d.ts +61 -0
  284. package/dist/toolsearch/aliases.d.ts +26 -0
  285. package/dist/toolsearch/exposure.d.ts +30 -0
  286. package/dist/toolsearch/ranking.d.ts +6 -0
  287. package/dist/toolsearch/search.d.ts +45 -0
  288. package/dist/version.d.ts +1 -0
  289. package/dist/version.js +5 -0
  290. package/dist/web/fetchable-url.d.ts +28 -0
  291. package/dist/web/preapproved-hosts.d.ts +52 -0
  292. package/dist/web/private-address.d.ts +55 -0
  293. package/dist/web/session-runtime.d.ts +86 -0
  294. package/dist/workflows/bridge.d.ts +87 -0
  295. package/dist/workflows/budget.d.ts +24 -0
  296. package/dist/workflows/host-registry.d.ts +142 -0
  297. package/dist/workflows/journal.d.ts +29 -0
  298. package/dist/workflows/meta.d.ts +45 -0
  299. package/dist/workflows/registry.d.ts +24 -0
  300. package/dist/workflows/runtime.d.ts +254 -0
  301. package/dist/workflows/sandbox.d.ts +49 -0
  302. package/dist/workflows/script-api.d.ts +58 -0
  303. package/dist/workflows/seam.d.ts +92 -0
  304. package/dist/workflows/semaphore.d.ts +16 -0
  305. package/dist/workflows/store.d.ts +177 -0
  306. package/dist/workflows/subprocess-entry.d.ts +38 -0
  307. package/dist/workflows/subprocess-entry.js +14 -0
  308. package/dist/workflows/transcript.d.ts +56 -0
  309. package/dist/workflows/types.d.ts +84 -0
  310. package/dist/workflows/worker-harness.d.ts +45 -0
  311. package/package.json +76 -0
@@ -0,0 +1,188 @@
1
+ import type { MessageOrigin, ProviderNativeState } from "@yanlinglabs/winter-provider-runtime";
2
+ import { PROVIDER_STATE_FILE_SUFFIX } from "@yanlinglabs/winter-agent-sdk";
3
+ /** The `SessionStoreEntry.type` discriminant every record carries. One string, one place. */
4
+ export declare const PROVIDER_STATE_ENTRY_TYPE: "winter_provider_state";
5
+ /**
6
+ * R6-7a: the subpath a NON-filesystem `SessionStore` receives these records under.
7
+ *
8
+ * Resume `load()`s this key DIRECTLY and never relies on `listSubkeys` -- that method is optional on
9
+ * the pinned `SessionStore` (`sdk.d.ts:5353-5356`) and, when a host's adapter omits it, "resume only
10
+ * materializes the main transcript". A provider-state subpath discovered by enumeration would be
11
+ * written and then never found, silently.
12
+ */
13
+ export declare const PROVIDER_STATE_SUBPATH: "provider-state";
14
+ /**
15
+ * The filename suffix of the neighbour file, RE-EXPORTED from the sdk store.
16
+ *
17
+ * ONE DECLARATION (re-review round 2). The sdk's `delete()` must name this file to remove it and
18
+ * cannot import the runtime (WS-02 §3), so the string is declared there and imported here -- the same
19
+ * direction every other shared store constant takes. This package still owns the record SEMANTICS;
20
+ * only the literal moved. The P4-M read deny and the sidecar path builder both read it from here, so
21
+ * they cannot drift from what the deletion transaction actually removes.
22
+ */
23
+ export { PROVIDER_STATE_FILE_SUFFIX };
24
+ export type ProviderStateKind = "origin" | "native-state" | "summary" | "handoff" | "reasoning-blocks" | "effort" | "tool-epoch" | "tool-changes" | "decoration";
25
+ /**
26
+ * One sidecar record. The envelope (`type`/`uuid`/`timestamp`) plus R6-7's own payload fields.
27
+ *
28
+ * `anchorUuid` names the ASSISTANT ENTRY this record belongs to -- the uuid the engine pre-allocated
29
+ * and passed through `recordAssistantEntry(content, { uuid })`. `itemIndex` orders multiple records
30
+ * sharing one anchor. `payload` is opaque BY TYPE: `unknown`, so nothing is tempted to inspect it.
31
+ */
32
+ export interface ProviderStateRecord {
33
+ [k: string]: unknown;
34
+ type: typeof PROVIDER_STATE_ENTRY_TYPE;
35
+ uuid: string;
36
+ timestamp: string;
37
+ sessionId: string;
38
+ anchorUuid: string;
39
+ provider: string;
40
+ model: string;
41
+ family: string;
42
+ continuationDomain?: string;
43
+ itemIndex: number;
44
+ kind: ProviderStateKind;
45
+ payload: unknown;
46
+ }
47
+ /**
48
+ * What a CALLER supplies. The three envelope fields are stamped here when omitted, so a producer
49
+ * cannot forget the `type` discriminant or accidentally reuse the anchor as the record uuid -- the
50
+ * two mistakes item (h) identifies as fatal to an external store. A fully-formed `ProviderStateRecord`
51
+ * also satisfies this type, so a caller that has one (a replay, a test fixture) passes it unchanged.
52
+ */
53
+ export interface ProviderStateRecordInput {
54
+ type?: typeof PROVIDER_STATE_ENTRY_TYPE;
55
+ uuid?: string;
56
+ timestamp?: string;
57
+ sessionId: string;
58
+ anchorUuid: string;
59
+ provider: string;
60
+ model: string;
61
+ family: string;
62
+ continuationDomain?: string;
63
+ itemIndex: number;
64
+ kind: ProviderStateKind;
65
+ payload: unknown;
66
+ }
67
+ /** Stamps the envelope. Separated from the append so the external-store door (which never touches a file) produces byte-identical records. */
68
+ export declare function toProviderStateRecord(input: ProviderStateRecordInput): ProviderStateRecord;
69
+ /**
70
+ * `<dir>/<sessionId>.provider-state.jsonl` -- the neighbour of `<dir>/<sessionId>.jsonl`.
71
+ *
72
+ * DERIVED FROM THE TRANSCRIPT PATH rather than rebuilt from (winterHome, projectKey, sessionId),
73
+ * which is what makes the CHILD case fall out for free: a child transcript at
74
+ * `<sessionId>/subagents/agent-<id>.jsonl` yields `<sessionId>/subagents/agent-<id>.provider-state.jsonl`
75
+ * with no second path-shaping rule to keep in step. R6-7 words the child path as
76
+ * `<sessionId>/subagents/<agentId>.provider-state.jsonl`; the real child transcript basename is
77
+ * `agent-<agentId>` (dialect.ts's `childTranscriptSubpath`), and matching the actual neighbour is what
78
+ * "beside the child transcript" means -- recorded as a deliberate reading of the brief, not a drift.
79
+ */
80
+ export declare function providerStateSidecarPath(transcriptPath: string): string;
81
+ /**
82
+ * Appends ONE record: 0600, `O_APPEND`, one `fsync` per record.
83
+ *
84
+ * `fsync` per record and not per batch, deliberately: the whole point of write-ahead ordering is that
85
+ * the record is DURABLE before its entry is appended. A batched flush would make the ordering true in
86
+ * memory and false on disk, which is the only place it matters.
87
+ *
88
+ * Returns the stamped record (a deviation from the brief's `void`, recorded): the caller needs the
89
+ * minted `uuid` to write the identical envelope through an external store, and a producer that had to
90
+ * re-derive it would be a second minting site.
91
+ */
92
+ export declare function appendProviderState(path: string, input: ProviderStateRecordInput): ProviderStateRecord;
93
+ /**
94
+ * The most record bytes one read KEEPS. A sidecar is a few small records per assistant entry, so 64 MiB
95
+ * is orders of magnitude above any ordinary session; the bound exists because this file is read on
96
+ * EVERY resume and a file grown without limit (a very long session, a corrupt or attacker-grown file)
97
+ * must not be read into memory without limit.
98
+ *
99
+ * WS-23 (reasoning-state, defect c): a bound on what is KEPT, not a refusal of the file. The read used
100
+ * to throw past 64 MiB, and every caller turned the throw into an EMPTY chain -- one byte over the
101
+ * limit and a session lost the native state of every turn it had, including the ones it was about to
102
+ * continue from. Since the move of Anthropic thinking into the sidecar that is a session's whole
103
+ * reasoning. Now the file is streamed and, once the kept records pass the bound, the OLDEST are let go:
104
+ * the turns nearest the current work keep their state, and the oldest degrade to summary level (which
105
+ * `buildContinuationChain` already handles, record by record).
106
+ */
107
+ export declare const PROVIDER_STATE_MAX_READ_BYTES: number;
108
+ /** One line longer than this is not a record Winter wrote (a single turn's state is far smaller); it is skipped unread. */
109
+ export declare const PROVIDER_STATE_MAX_LINE_BYTES: number;
110
+ /**
111
+ * Reads a sidecar with BOUNDED REPAIR: a truncated final line is dropped and every earlier record is
112
+ * kept.
113
+ *
114
+ * That is the crash the write-ahead ordering makes likely -- the process died mid-`writeSync` -- and
115
+ * refusing the whole file for it would discard a session's entire continuation chain over one partial
116
+ * line. A malformed line ANYWHERE (not just the last) is skipped for the same reason; the chain
117
+ * degrades record by record rather than all at once, and `buildContinuationChain` already treats a
118
+ * missing record as "degrade this message to summary-level".
119
+ *
120
+ * BOUNDED MEMORY (WS-23, review r1 I-4): streamed in 1 MiB chunks, a line past
121
+ * `PROVIDER_STATE_MAX_LINE_BYTES` is skipped without being buffered, and the records RETAINED never exceed
122
+ * `PROVIDER_STATE_MAX_READ_BYTES` (plus one compaction step's slack) -- the oldest are released AS THE
123
+ * READ GOES, and the released entries are cut out of the working list every time they pass half of it, so
124
+ * memory stays proportional to the bound, never to the file. `limits` exists for tests (`stats` reports
125
+ * the peak number of entries the list ever held).
126
+ *
127
+ * A missing file is an EMPTY chain, never a throw: "no sidecar" and "sidecar emptied" are
128
+ * indistinguishable by design in the pinned store contract (`load()` may return `null` for both,
129
+ * `sdk.d.ts:5302-5314`), so the filesystem path answers the same way its store-backed twin must.
130
+ */
131
+ export declare function readProviderState(path: string, limits?: {
132
+ maxKeptBytes?: number;
133
+ maxLineBytes?: number;
134
+ stats?: {
135
+ peakRetained: number;
136
+ };
137
+ }): ProviderStateRecord[];
138
+ /**
139
+ * One line -> one record, or `undefined`.
140
+ *
141
+ * VALIDATES STRUCTURALLY rather than casting: these bytes come off disk (or out of a host's own
142
+ * `SessionStore`), and a cast would let a malformed `origin` payload surface as an incomprehensible
143
+ * failure inside an adapter three layers away. Exported because the external-store door validates the
144
+ * identical way -- one parser, two transports.
145
+ */
146
+ export declare function parseProviderStateLine(line: string): ProviderStateRecord | undefined;
147
+ export declare function coerceProviderStateRecord(value: unknown): ProviderStateRecord | undefined;
148
+ /** What one assistant entry's records fold into. `origin` is mandatory in a healthy chain; its ABSENCE is what degrades that message to summary-level. */
149
+ export interface ContinuationLink {
150
+ origin?: MessageOrigin;
151
+ nativeState?: ProviderNativeState;
152
+ summary?: string;
153
+ material?: "exposed";
154
+ complete?: boolean;
155
+ /** WS-23: when the `origin` record was written -- the time the reply landed, which the tool epoch's cache-TTL rule reads. */
156
+ recordedAt?: string;
157
+ /** WS-23 (layer 2): the entry's effort annotations, from an `effort` record. */
158
+ effort?: {
159
+ effort?: string;
160
+ perTurnEffort?: string;
161
+ };
162
+ /** Review r1, M-1: per TARGET model key, the decoration that target was sent for this entry (`null`: none). */
163
+ decorations?: Record<string, {
164
+ text: string;
165
+ door: "tag" | "thinking-channel";
166
+ } | null>;
167
+ /** WS-23 (layer 2): the tool-epoch bookkeeping that PRECEDED this entry, in write order (attachment payloads). */
168
+ bookkeeping?: Array<{
169
+ type: string;
170
+ [key: string]: unknown;
171
+ }>;
172
+ }
173
+ /**
174
+ * Folds the records into a per-entry chain, keyed by `anchorUuid`.
175
+ *
176
+ * A RECORD WHOSE ANCHOR IS MISSING IS IGNORED, not an error: the write-ahead ordering makes exactly
177
+ * that pair the likely crash (the record was fsync'd, the process died before its entry appended), so
178
+ * it is garbage-collectable state rather than corruption. The OTHER crash pair -- an entry with no
179
+ * record -- is not visible here at all: it shows up as an anchor the returned map has no key for, and
180
+ * the caller degrades that message to summary-level and warns. Both halves are asserted in
181
+ * provider-state.test.ts's crash-pair fixture.
182
+ *
183
+ * Records are folded in ARRAY ORDER (which is append order), so a later record of the same kind for
184
+ * the same anchor wins -- a re-recorded `native-state` supersedes the one before it.
185
+ */
186
+ export declare function buildContinuationChain(records: readonly ProviderStateRecord[], entryUuids: ReadonlySet<string>): Map<string, ContinuationLink>;
187
+ /** The ledger's pinned alias: every lane types its renderer against `ReturnType<typeof buildContinuationChain>`, so the chain's shape has exactly one definition. */
188
+ export type ContinuationChain = ReturnType<typeof buildContinuationChain>;
@@ -0,0 +1,92 @@
1
+ import type { ProviderMessage } from "../engine.js";
2
+ import type { SessionStore, SessionStoreEntry } from "@yanlinglabs/winter-agent-sdk";
3
+ export declare class ResumeTargetError extends Error {
4
+ readonly reason: "not_found" | "ambiguous" | "locked";
5
+ constructor(reason: "not_found" | "ambiguous" | "locked", message: string);
6
+ }
7
+ export declare class ResumeTruncationError extends Error {
8
+ constructor(message: string);
9
+ }
10
+ /** `continue: true` — the newest session in exactly one directory (WS-05 §7: no cross-project fallback). */
11
+ export declare function findContinueTarget(store: SessionStore, cwdKey: string): Promise<string | null>;
12
+ /**
13
+ * `resume: <uuid>` — current project first (an unconditional win, never subject to the ambiguity
14
+ * check below, even if the same id ALSO happens to exist elsewhere); then every other project,
15
+ * resolving only on a unique foreign match.
16
+ *
17
+ * Deferred scope (documented, not silently dropped): WS-05 §7 also says to search "the current
18
+ * project + its git worktrees" before falling through to every other project. P1 has no
19
+ * worktree-aware transcriptProjectKey (compatibilityKeys' worktree-awareness is memoryProjectKey
20
+ * only, WS-05 §3.2) and the outer task brief's own restatement of this rule omits worktrees
21
+ * entirely — a worktree session resolves via the ordinary "every other project" fallback today
22
+ * (correct, just not distinguished from any other foreign project), until a later task adds
23
+ * worktree identity to the search's first phase.
24
+ */
25
+ export declare function findResumeTarget(store: SessionStore, opts: {
26
+ sessionId: string;
27
+ cwdKey: string;
28
+ }): Promise<{
29
+ projectKey: string;
30
+ }>;
31
+ export interface DialectEntry {
32
+ type: string;
33
+ uuid: string;
34
+ parentUuid: string | null;
35
+ message?: {
36
+ role: string;
37
+ content: unknown;
38
+ model?: string;
39
+ };
40
+ compact_metadata?: unknown;
41
+ subtype?: string;
42
+ compactMetadata?: unknown;
43
+ logicalParentUuid?: string;
44
+ isCompactSummary?: boolean;
45
+ isApiErrorMessage?: boolean;
46
+ attachment?: {
47
+ type: string;
48
+ [key: string]: unknown;
49
+ };
50
+ effort?: string;
51
+ perTurnEffort?: string;
52
+ }
53
+ /** Narrows a loaded SessionStoreEntry[] to the entries that actually carry a chain identity (WS-05
54
+ * §5.2's chain guarantee applies to entries with a uuid; mirrors dialect.ts's own validateChain
55
+ * narrowing) — an entry with no uuid at all is simply not part of the resumable chain. */
56
+ export declare function toDialectEntries(raw: SessionStoreEntry[]): DialectEntry[];
57
+ /**
58
+ * `chain` (root-first) with each parallel batch's off-chain call entries and results spliced in
59
+ * right after the batch's last chain entry. `pool` is where they are looked for (the loaded file, or
60
+ * what of it a truncation keeps in play), in file (append) order. Returns a copy of `chain` when
61
+ * nothing was recovered.
62
+ */
63
+ export declare function recoverParallelToolResults(chain: readonly DialectEntry[], pool: readonly DialectEntry[]): DialectEntry[];
64
+ /**
65
+ * `resumeSessionAt` — keep only `atUuid`'s own ancestry; `resumeDropsTurn` confirms the caller
66
+ * intends to discard whatever DESCENDS from it. This NEVER mutates or deletes stored entries — the
67
+ * store is append-only (WS-05 §6): whatever is excluded stays on disk untouched, and continuing
68
+ * from `atUuid` grows a new branch alongside it.
69
+ *
70
+ * Ruling P1-R (fix-round 1 — settles this function's originally-provisional interpretation; see
71
+ * resume.test.ts for the two scenarios that pin it): both "kept" and "dropped" are graph-defined,
72
+ * never positional.
73
+ * - kept = atUuid's own ancestry (`ancestryChain` above), root to atUuid — independent of where
74
+ * atUuid sits in file order, and independent of anything else in the file.
75
+ * - dropped = every entry that DESCENDS from atUuid (its ancestry passes through atUuid),
76
+ * EXCLUDING atUuid itself. "Every dropped entry descends from the target" (the brief's
77
+ * original phrasing) IS the definition of "dropped" here — not a validation performed after
78
+ * computing "dropped" some other (positional) way.
79
+ * - an entry that is NEITHER an ancestor NOR a descendant of atUuid — an off-lineage sibling
80
+ * branch, e.g. one abandoned by an earlier, unrelated resumeSessionAt — is simply not on the
81
+ * lineage this operation concerns: it needs NO confirmation and triggers NO error regardless of
82
+ * dropsTurn, because resuming at atUuid neither keeps nor discards it; it was never part of
83
+ * this operation to begin with. Concretely: resuming at an already-abandoned tip (nothing
84
+ * downstream of it survives to be dropped) succeeds with `dropsTurn:false`.
85
+ * - dropsTurn:false + real descendants exist -> typed error (silently discarding real turn
86
+ * content without acknowledgment is refused); dropsTurn:true -> allowed.
87
+ */
88
+ export declare function truncateAt(entries: DialectEntry[], opts: {
89
+ atUuid: string;
90
+ dropsTurn: boolean;
91
+ }): DialectEntry[];
92
+ export declare function rebuildProviderMessages(entries: DialectEntry[]): ProviderMessage[];
@@ -0,0 +1,7 @@
1
+ import type { StructuredOutputSeam } from "./seam.js";
2
+ /**
3
+ * One seam per session (or per workflow host). The ajv instances and the compiled-validator cache
4
+ * live inside the closure, so two concurrent sessions never share compile state and a finished one
5
+ * releases it.
6
+ */
7
+ export declare function createStructuredOutputSeam(): StructuredOutputSeam;
@@ -0,0 +1,9 @@
1
+ import type { ToolDescriptor } from "../tools/registry.js";
2
+ import { type JsonSchema } from "./seam.js";
3
+ /**
4
+ * Winter's own description of the tool. It is what the model reads to know HOW to return, so it says
5
+ * that calling it ends the turn -- the engine's turn-ending rule is otherwise invisible to the model,
6
+ * which would keep working after it had already answered.
7
+ */
8
+ export declare const STRUCTURED_OUTPUT_TOOL_DESCRIPTION: string;
9
+ export declare function buildStructuredOutputDescriptor(schema: JsonSchema): ToolDescriptor;
@@ -0,0 +1,51 @@
1
+ import type { JSONSchema, ToolDescriptor } from "../tools/registry.js";
2
+ /** The caller's `outputFormat.schema`. Aliased to the registry's own JSONSchema so the descriptor's `inputSchema` can be assigned the value VERBATIM, with no re-shaping step in between. */
3
+ export type JsonSchema = JSONSchema;
4
+ /** The tool name, one constant. Never hand-written at a call site -- an advertised-set assertion and a dispatch check that disagreed by a letter would be invisible. */
5
+ export declare const STRUCTURED_OUTPUT_TOOL_NAME = "StructuredOutput";
6
+ /**
7
+ * The ONLY names a host-generated registration may claim (fix round 1, M1). Re-exported here for
8
+ * Lane K's convenience; it is DEFINED in `tools/registry.ts`, which is what enforces it -- the
9
+ * registry must not depend on this module, and a second copy of the set is exactly the drift the
10
+ * allowlist exists to prevent.
11
+ */
12
+ export { HOST_GENERATABLE_TOOL_NAMES } from "../tools/registry.js";
13
+ /**
14
+ * The default number of ATTEMPTS, not retries. Capture (6) is explicit and was run both ways: with
15
+ * the env unset the pinned runtime produced FIVE validation-failure tool results and terminated with
16
+ * "after 5 attempts"; with `MAX_STRUCTURED_OUTPUT_RETRIES=2` it produced TWO. Reading the name as
17
+ * "retries after the first attempt" would give six calls where the pin gives five.
18
+ */
19
+ export declare const DEFAULT_MAX_STRUCTURED_OUTPUT_ATTEMPTS = 5;
20
+ /** The unbranded env spelling, verbatim (Global Constraints: this family is NOT Winter-branded). */
21
+ export declare const MAX_STRUCTURED_OUTPUT_RETRIES_ENV = "MAX_STRUCTURED_OUTPUT_RETRIES";
22
+ /** Resolves the attempt budget from an environment snapshot. A non-numeric or non-positive value is ignored (the default stands) rather than producing a budget no run could ever satisfy. */
23
+ export declare function resolveMaxStructuredOutputAttempts(env: Record<string, string | undefined>): number;
24
+ export interface StructuredOutputSeam {
25
+ /**
26
+ * Builds the host-generated descriptor. The implementation MUST put `schema` on `inputSchema`
27
+ * unchanged -- not merged into a wrapper, not normalized, not re-serialized. The engine registers
28
+ * whatever comes back and advertises it only while `outputFormat` is set.
29
+ */
30
+ buildDescriptor(schema: JsonSchema): ToolDescriptor;
31
+ /**
32
+ * Validates a model-supplied value against the caller's schema. `errors` are model-facing: capture
33
+ * (6) observed the pinned runtime returning text naming the JSON-Pointer path and the expected
34
+ * type (ajv's own rendering), which is the target shape.
35
+ */
36
+ validate(schema: JsonSchema, value: unknown): {
37
+ ok: true;
38
+ value: unknown;
39
+ } | {
40
+ ok: false;
41
+ errors: string[];
42
+ };
43
+ }
44
+ /**
45
+ * The spine's test double. Validation is deliberately CRUDE (required-key presence and a `type`
46
+ * check on primitives) -- it exists to drive the engine's accept/retry/exhaust branches, never to
47
+ * stand in for ajv. Lane K replaces it wholesale.
48
+ */
49
+ export declare function fakeStructuredOutputSeam(opts?: {
50
+ calls?: unknown[];
51
+ }): StructuredOutputSeam;
@@ -0,0 +1,22 @@
1
+ import { type ErrorObject, type ValidateFunction } from "ajv";
2
+ import type { JsonSchema } from "./seam.js";
3
+ /** A caller schema that ajv cannot compile at all. Distinct from a validation failure -- see below. */
4
+ export declare class StructuredSchemaError extends Error {
5
+ }
6
+ /**
7
+ * Renders ajv's errors as model-facing text. Capture (6) observed the pinned runtime returning text
8
+ * naming the JSON-Pointer path and the expected type -- ajv's own rendering -- which is the target
9
+ * shape, so this stays a thin projection of `instancePath` + `message` rather than a bespoke prose
10
+ * layer that would drift from it.
11
+ *
12
+ * A root-level failure is reported at `/`, never at the empty string ajv uses: `": must be object"`
13
+ * reads as a typo, and the pointer is the thing the model navigates by.
14
+ */
15
+ export declare function formatValidationErrors(errors: ErrorObject[] | null | undefined): string[];
16
+ /**
17
+ * Compiles per SCHEMA OBJECT and caches by identity. The engine hands the same `outputFormat.schema`
18
+ * object to `validate` on every attempt of every turn, so a per-call compile would re-parse the
19
+ * schema up to five times per turn for the life of the session. A `WeakMap` rather than a `Map` so a
20
+ * finished session's schema is collectable.
21
+ */
22
+ export declare function createSchemaValidatorCache(): (schema: JsonSchema) => ValidateFunction;
@@ -0,0 +1,13 @@
1
+ /** `trunc(s)`: collapse whitespace runs (newlines included) to one space, trim, and keep the first 50 chars + `…` when longer. */
2
+ export declare function truncActivity(s: string): string;
3
+ /** `path(p)`: relative to the session cwd when inside it (no leading `..`), else `~/…` under the home dir, else absolute. */
4
+ export declare function displayActivityPath(p: string, cwd: string, home: string | undefined): string;
5
+ export interface ActivityContext {
6
+ cwd: string;
7
+ home?: string;
8
+ }
9
+ /**
10
+ * The activity text for one recorded tool call, or `undefined` when the tool has none (any tool not in
11
+ * the contract's table). A missing field takes the table's own fallback text.
12
+ */
13
+ export declare function toolActivityDescription(toolName: string, rawInput: unknown, ctx: ActivityContext): string | undefined;
@@ -0,0 +1,30 @@
1
+ import type { SourcedAgentDefinition } from "./definitions.js";
2
+ export interface AgentAvailabilityInputs {
3
+ /** R3b §4: a per-type `Agent(<type>)` DENY rule -- `findAgentDenyRule(rules, type) !== undefined`, injected so this module takes no dependency on evaluator.ts/ruleset.ts's own rule types. */
4
+ isDenied: (agentType: string) => boolean;
5
+ /** R3b §4: the running agent's (or the session's) own `tools: ["Agent(a,b)"]` restriction -- `allowedAgentTypesFromTools`'s own result. `undefined` = unrestricted. */
6
+ allowedAgentTypes?: readonly string[];
7
+ /** R3b §4 `zFn`: is EVERY tool this definition may use itself denied right now? See `isBuiltinAllToolsDenied` below for the one production implementation. */
8
+ isAllToolsDenied: (def: SourcedAgentDefinition) => boolean;
9
+ }
10
+ /**
11
+ * claude's `l8n`, composed: the filtered set of `subagent_type` names a session may list/resolve
12
+ * right now. Order-preserving over `defs`' own iteration order (a `Map`'s insertion order) -- the
13
+ * caller sorts if it wants a sorted list, exactly as `sessionAgentDefinitions()`'s existing
14
+ * consumers already do for the unfiltered set.
15
+ */
16
+ export declare function availableAgentNames(defs: ReadonlyMap<string, SourcedAgentDefinition>, inputs: AgentAvailabilityInputs): string[];
17
+ /**
18
+ * claude's `zFn`: a built-in with an EXPLICIT `tools` list, every one of whose (concrete) tools is
19
+ * itself denied right now, is unavailable -- "Agent type '<x>' is unavailable because every tool it
20
+ * may use is denied by the current permission settings." Winter's own Explore/Plan built-ins use
21
+ * `disallowedTools` (an ADDITIVE restriction over "all tools"), never an explicit `tools` list, so
22
+ * they are EXEMPT from this filter by construction (`def.tools === undefined` always reads false
23
+ * here) -- exactly R3b §4's own "built-ins with explicit tools list only."
24
+ *
25
+ * `advertised` is the session's own currently-advertised canonical tool-name set (engine.ts's
26
+ * `currentAdvertisedCanonicalNames`) -- the SAME ground truth the pre-existing "bare-denied" check
27
+ * (engine.ts, disallowedTools:["t"] -> t absent from that set) already uses, not a second,
28
+ * independently-derived notion of "denied."
29
+ */
30
+ export declare function isBuiltinAllToolsDenied(def: Pick<SourcedAgentDefinition, "tools">, advertised: readonly string[]): boolean;
@@ -0,0 +1,37 @@
1
+ import { type BrandProfile, type RuntimeAgentDefinition } from "@yanlinglabs/winter-agent-sdk";
2
+ /** The one brand slice every reader/prompt-builder in this module needs. */
3
+ type BuiltinAgentBrand = Pick<BrandProfile, "envPrefix" | "productName">;
4
+ export interface BuiltinAgentGates {
5
+ /** `<PREFIX>AGENT_SDK_DISABLE_BUILTIN_AGENTS` -- mirrors `CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS`. When true, EVERY built-in (gated or not) is withheld, matching claude's own non-interactive-SDK branch (research §A1: "if ... && non-interactive → []" -- Winter's whole runtime is the non-interactive SDK shape, so the qualifier is unconditional here). */
6
+ allBuiltinsDisabled: boolean;
7
+ /** `<PREFIX>DISABLE_EXPLORE_PLAN_AGENTS` -- withholds `Explore` and `Plan` together (claude withholds them together too). */
8
+ explorePlanDisabled: boolean;
9
+ /** `<PREFIX>DISABLE_AGENT_VIEW` -- withholds the `claude` catch-all built-in (claude's own `CLAUDE_CODE_DISABLE_AGENT_VIEW` / `settings.disableAgentView`). */
10
+ agentViewDisabled: boolean;
11
+ /** `<PREFIX>WEB_FETCH_AGENT` -- OPT-IN: `web-fetch` is withheld unless this is truthy (claude's own default is `false` too). */
12
+ webFetchAgentEnabled: boolean;
13
+ /** `<PREFIX>FORK_SUBAGENT` (R-S5, mirrors `CLAUDE_CODE_FORK_SUBAGENT`) -- OPT-IN: `fork` is withheld unless this is truthy. `false` and absent both mean off (Winter sessions are non-interactive, like an SDK session -- there is no "interactive default: on" branch here, unlike claude's own CLI). */
14
+ forkSubagentEnabled: boolean;
15
+ }
16
+ /**
17
+ * R-S5: the fork gate alone, exported separately -- `tools/descriptors/agent.ts`'s own schema/
18
+ * description functions (item 5) and `tools/impl/agent.ts` (lane L2b) both need "is fork on" without
19
+ * pulling in the rest of `BuiltinAgentGates` or re-deriving the env read.
20
+ */
21
+ export declare function resolveForkSubagentEnabled(env?: Record<string, string | undefined>, brand?: BuiltinAgentBrand): boolean;
22
+ export declare function resolveBuiltinAgentGates(env?: Record<string, string | undefined>, brand?: BuiltinAgentBrand): BuiltinAgentGates;
23
+ export declare const BUILTIN_AGENT_NAMES: readonly ["general-purpose", "Explore", "Plan", "claude", "web-fetch", "fork"];
24
+ export type BuiltinAgentName = (typeof BUILTIN_AGENT_NAMES)[number];
25
+ /**
26
+ * The resolved built-in set for THIS session, gated per `BuiltinAgentGates` (R-S6) and the fork gate
27
+ * (R-S5). Keys are IDENTICAL to claude's own (R-S2) so a model's own prior training transfers, and a
28
+ * same-named user/project/plugin/programmatic definition overrides one of these entries at MERGE time
29
+ * (`definitions.ts`'s own precedence chain, lowest tier -- this function does not know about, and
30
+ * never needs to know about, the other three sources).
31
+ */
32
+ export declare function resolveBuiltinAgents(opts?: {
33
+ env?: Record<string, string | undefined>;
34
+ brand?: BuiltinAgentBrand;
35
+ gates?: BuiltinAgentGates;
36
+ }): Record<string, RuntimeAgentDefinition>;
37
+ export {};