@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,163 @@
1
+ import { type BrandProfile, type SettingSource } from "@yanlinglabs/winter-agent-sdk";
2
+ import { type DiscoveredSkill, type SkillScanError, type SkillTier } from "./loader.js";
3
+ import { type StrictPluginOnlyCustomization } from "../settings/loaders/strict-plugin-only.js";
4
+ /**
5
+ * WS-01 §2.4 / WS-11 §4: the PROJECT DOT-DIRECTORY (`brand.projectDirName`) is the canonical plugin
6
+ * name for itself. The official branch loads `<project>/<projectDir>` as a local plugin, so ITS
7
+ * skills are `<projectDir>:<skill>`; native discovery reads the same tree directly as the `project`
8
+ * tier.
9
+ *
10
+ * DISCLOSED JUDGMENT CALL (report): a project skill is therefore given TWO names -- its bare name
11
+ * (its primary identity, what the listing shows and what `/name` uses) and `<projectDir>:<name>` as
12
+ * an ALIAS. Both resolve through `get()`/`load()` and both are matched by a permission rule
13
+ * (permission-rules.ts), which is what WS-11 §4's "permission rules match identically across
14
+ * branches" requires operationally. The alternative readings each break something: bare-only makes
15
+ * a qualified rule written against the official branch inert here, and qualified-only makes
16
+ * `/review` and `Skill("review")` stop working for every project skill.
17
+ *
18
+ * P7a (D19): Winter's OWN value, derived rather than spelled. A session's is
19
+ * `SkillIndexOptions.brand.projectDirName`.
20
+ */
21
+ export declare const PROJECT_PLUGIN_NAME: string;
22
+ export interface SkillMeta {
23
+ name: string;
24
+ description: string;
25
+ source: SkillTier;
26
+ path: string;
27
+ author?: string;
28
+ plugin?: string;
29
+ /** Every OTHER name this skill answers to (see PROJECT_PLUGIN_NAME). Never includes `name`. */
30
+ aliases?: string[];
31
+ }
32
+ /** One plugin's contribution, pre-parsed by plugins/loader.ts -- this file never reads a plugin manifest. */
33
+ export interface PluginSkillContribution {
34
+ plugin: string;
35
+ skills: Array<{
36
+ name: string;
37
+ description: string;
38
+ path: string;
39
+ author?: string;
40
+ }>;
41
+ }
42
+ export interface SkillIndexOptions {
43
+ cwd: string;
44
+ /**
45
+ * The RESOLVED winter root -- i.e. what `resolveWinterHome(env, brand)` /
46
+ * `resolveProductionWinterHome` return, which is `<PREFIX>HOME` when set and
47
+ * `<os home>/<brand.homeDirName>` otherwise.
48
+ *
49
+ * NAMED `winterHome`, NOT `home`, DELIBERATELY. Two conventions exist side by side in this
50
+ * codebase and they are not interchangeable: `ResolveSettingsDetailedOptions.winterHome` is the
51
+ * resolved root itself, while `LoadAgentDefinitionsOptions.home` is the OS home directory and
52
+ * appends the dot-dir internally. Only the first can honour `<PREFIX>HOME` -- an override may
53
+ * point anywhere and need not be named after the brand at all -- and WS-01 §2.5 makes
54
+ * `<PREFIX>HOME` the user tier's address. A field called `home` here would be handed
55
+ * `resolveProductionWinterHome(...)` by a caller reading the settings convention and
56
+ * `ctx.home`/`homedir()` by one reading the agents convention; one of the two silently finds an
57
+ * empty user tier. The name is the only thing that stops that.
58
+ *
59
+ * ALWAYS explicit -- this module never reads `process.env` (a shared-process `bun test` would race).
60
+ */
61
+ winterHome: string;
62
+ /** P7a (D19): the session's brand -- the project dot-dir and its qualified-skill prefix. Omitted = `WINTER_BRAND`. */
63
+ brand?: Pick<BrandProfile, "projectDirName"> | undefined;
64
+ /** Omitted = all three tiers; `[]` = filesystem discovery disabled. */
65
+ settingSources?: SettingSource[] | undefined;
66
+ plugins?: readonly PluginSkillContribution[] | undefined;
67
+ /**
68
+ * The BUILTIN registry seam. Winter ships no bundled skills at P5 -- this is deliberately an empty
69
+ * default rather than a directory scan, so the tier EXISTS (listing, precedence, the
70
+ * `disableBundledSkills` gate) without inventing content. Disclosed in the report.
71
+ */
72
+ builtinSkills?: readonly DiscoveredSkill[] | undefined;
73
+ /**
74
+ * `Settings.disableBundledSkills` (`sdk.d.ts:5657`). Removes the builtin tier and nothing else.
75
+ *
76
+ * Like every other settings-derived option on this interface, it arrives from `Settings`' INDEX
77
+ * SIGNATURE as `unknown` and must be narrowed by the caller -- see
78
+ * `settings/loaders/strict-plugin-only.ts`'s header for the full list and why.
79
+ */
80
+ disableBundledSkills?: boolean | undefined;
81
+ /**
82
+ * `Settings.strictPluginOnlyCustomization` (`sdk.d.ts:5988`). When it covers `"skills"`, ONLY
83
+ * plugin-contributed skills load -- project, user, self and builtin are all excluded. Distinct
84
+ * from source gating: `settingSources` says which settings FILES load, this says which
85
+ * customization SOURCES may customize at all.
86
+ */
87
+ strictPluginOnlyCustomization?: StrictPluginOnlyCustomization | undefined;
88
+ bodyBytes?: number | undefined;
89
+ /**
90
+ * Fix round 4 (I-E, the router same-view test): a workflow, registered as a SYNTHETIC skill so
91
+ * `Skill("<name>")` and the slash-command surface both run it -- claude's own `m()` turns every
92
+ * discovered workflow into exactly this shape (dump-confirmed: `{type:"prompt", kind:"workflow",
93
+ * ...}`). Unlike every other entry `discover()` finds, a synthetic entry carries its own BODY
94
+ * directly (`load()` returns it as-is, never reading `path` from disk -- there is no SKILL.md a
95
+ * workflow script's own identity could point `load()` at). `path` is still required on the
96
+ * resulting `SkillMeta` (a synthetic, non-filesystem marker -- `workflows/store.ts`'s own
97
+ * `WorkflowListingEntry.path`, the REAL `.js` script path, doubles as it: informative for a
98
+ * listing/debug consumer, never read from by `load()` for a synthetic entry).
99
+ */
100
+ syntheticSkills?: readonly {
101
+ name: string;
102
+ description: string;
103
+ body: string;
104
+ source: SkillTier;
105
+ path: string;
106
+ plugin?: string;
107
+ }[];
108
+ }
109
+ /**
110
+ * The startup index. Immutable once built: a session's skill surface is resolved at start, never
111
+ * re-scanned mid-turn (the pinned branch reloads on an explicit control request, never on a watcher
112
+ * -- derived-shapes-p5 item (b); Winter's own "no watchers inside the SDK" rule agrees).
113
+ */
114
+ export declare class SkillIndex {
115
+ private readonly entries;
116
+ private readonly byName;
117
+ private readonly bodyBytes;
118
+ private readonly scanErrors;
119
+ /** Fix round 4 (I-E): a synthetic entry's own body, keyed by its PRIMARY name -- `load()` checks this before ever touching disk. */
120
+ private readonly syntheticBodies;
121
+ private constructor();
122
+ static build(opts: SkillIndexOptions): SkillIndex;
123
+ /**
124
+ * Every SKILL.md that could NOT become an entry, with the reason (A-11).
125
+ *
126
+ * The listing is built from `list()`; this is the parallel channel that stops a broken or oversized
127
+ * skill from simply not existing. A host that surfaces `wiring.warnings` should include these --
128
+ * that wiring is another lane's file in this wave and is named in the report as NEEDS_CONTEXT.
129
+ */
130
+ errors(): SkillScanError[];
131
+ /** Every skill, in precedence order, by PRIMARY name. Aliases are not separate entries. */
132
+ list(): SkillMeta[];
133
+ /** Primary names only, in precedence order -- the `system/init.skills` producer's input. */
134
+ names(): string[];
135
+ /** Resolve a name OR an alias to its metadata. */
136
+ get(name: string): SkillMeta | undefined;
137
+ /** Every name a skill answers to (primary first) -- what a permission rule is matched against. */
138
+ identities(name: string): string[];
139
+ /**
140
+ * Read a skill's body FROM DISK, byte-capped. `null` for an unknown name and for a skill whose
141
+ * file has since been deleted, moved or made unparseable -- an invocation must degrade to a typed
142
+ * tool error, never crash the turn.
143
+ *
144
+ * Fix round 4 (I-E): a SYNTHETIC entry (a workflow registered as a skill) returns its own
145
+ * pre-built body directly, keyed by the RESOLVED meta's primary name (so an alias lookup still
146
+ * finds it) -- never touching disk at all, since there is no SKILL.md a workflow script's identity
147
+ * could point this at.
148
+ *
149
+ * Fix round 7 (a same-day follow-up to round 6): `isSynthetic` lets a caller (`commands/
150
+ * resolver.ts`'s `resolve()`) tell a synthetic (workflow-backed) body apart from an ordinary,
151
+ * on-disk one -- round 6 put `$ARGUMENTS_JSON` into the SHARED `substituteArguments`, making it a
152
+ * recognised token in EVERY skill/command body; this is the seam that lets the fix scope the JSON
153
+ * substitution to synthetic bodies only, without the resolver having to re-derive "is this a
154
+ * workflow" from the name or path.
155
+ */
156
+ load(name: string): {
157
+ name: string;
158
+ body: string;
159
+ source: SkillTier;
160
+ path: string;
161
+ isSynthetic: boolean;
162
+ } | null;
163
+ }
@@ -0,0 +1,44 @@
1
+ import type { SdkMessage } from "@yanlinglabs/winter-agent-sdk";
2
+ import { type ContinuationChain, type ProviderStateRecord } from "./provider-state.js";
3
+ /** The half of `SessionPersistence` this needs. Narrowed so a caller can hand it a two-method double. */
4
+ export interface ContinuationChainSource {
5
+ loadProviderState?(): Promise<ProviderStateRecord[]>;
6
+ loadProviderIdentity?(): Promise<{
7
+ providerId: string;
8
+ modelKey: string;
9
+ } | undefined>;
10
+ }
11
+ /** The shape this mutates. Deliberately structural rather than importing `ProviderMessage` from `engine.ts` -- that direction is the circular one `store/` must not take. */
12
+ export interface AttachableMessage {
13
+ role: "user" | "assistant" | "tool" | "system";
14
+ uuid?: string;
15
+ origin?: unknown;
16
+ nativeState?: unknown;
17
+ }
18
+ export interface AttachContinuationChainOptions {
19
+ messages: AttachableMessage[];
20
+ store: ContinuationChainSource;
21
+ sessionId: string;
22
+ /** Emits one Winter-only `system/continuity_warning`. Called at most once. */
23
+ warn: (message: SdkMessage) => void;
24
+ /** Injected so a fixture's warning uuid is deterministic. */
25
+ newUuid: () => string;
26
+ /**
27
+ * P6 fix wave (T10 r1 Minor): the persisted identity, ALREADY LOADED by the caller. The engine reads
28
+ * it once for the resume-time switch comparison; without this the zero-records branch below re-read
29
+ * it -- one extra summary I/O per resumed run. Absent -> `store.loadProviderIdentity` as before.
30
+ */
31
+ identity?: () => Promise<{
32
+ providerId: string;
33
+ modelKey: string;
34
+ } | undefined>;
35
+ }
36
+ /**
37
+ * Folds the sidecar chain back onto a resumed history, and REPORTS a gap.
38
+ *
39
+ * An assistant message with no `origin` record degrades to summary-level and the session says so.
40
+ * That is R6-7's own rule, and the reason it cannot be silent is that the degradation is observable
41
+ * to the model: it will not get its exact native replay, so a user who sees a worse continuation than
42
+ * they expected deserves to know why.
43
+ */
44
+ export declare function attachContinuationChain(opts: AttachContinuationChainOptions): Promise<ContinuationChain>;