@try-works/dsh-tool-mode 0.0.0-stage → 0.5.45

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 (432) hide show
  1. package/LICENSE +205 -0
  2. package/README.md +303 -2
  3. package/bin/dsh-tool-mode-credentials.mjs +20 -0
  4. package/bin/dsh-tool-mode-mcp-stdio.mjs +80 -0
  5. package/bin/dsh-tool-mode.mjs +211 -0
  6. package/builtins.lock.json +26 -0
  7. package/catalog/desert-ant-models.json +693 -0
  8. package/catalog/playbooks.json +531 -0
  9. package/client/client.model-tools.js +1910 -0
  10. package/client/index.js +4158 -0
  11. package/cordis.patch.yml +39 -0
  12. package/lib/adapters/index.d.ts +61 -0
  13. package/lib/adapters/index.d.ts.map +1 -0
  14. package/lib/adapters/index.js +82 -0
  15. package/lib/adapters/types.d.ts +106 -0
  16. package/lib/adapters/types.d.ts.map +1 -0
  17. package/lib/adapters/types.js +85 -0
  18. package/lib/approval.d.ts +189 -0
  19. package/lib/approval.d.ts.map +1 -0
  20. package/lib/approval.js +510 -0
  21. package/lib/asset-acquisition.d.ts +149 -0
  22. package/lib/asset-acquisition.d.ts.map +1 -0
  23. package/lib/asset-acquisition.js +175 -0
  24. package/lib/authority.d.ts +185 -0
  25. package/lib/authority.d.ts.map +1 -0
  26. package/lib/authority.js +223 -0
  27. package/lib/bindings.d.ts +144 -0
  28. package/lib/bindings.d.ts.map +1 -0
  29. package/lib/bindings.js +314 -0
  30. package/lib/builtins.d.ts +27 -0
  31. package/lib/builtins.d.ts.map +1 -0
  32. package/lib/builtins.js +37 -0
  33. package/lib/capability.d.ts +58 -0
  34. package/lib/capability.d.ts.map +1 -0
  35. package/lib/capability.js +192 -0
  36. package/lib/capture-path.d.ts +97 -0
  37. package/lib/capture-path.d.ts.map +1 -0
  38. package/lib/capture-path.js +152 -0
  39. package/lib/catalog.d.ts +37 -0
  40. package/lib/catalog.d.ts.map +1 -0
  41. package/lib/catalog.js +274 -0
  42. package/lib/contract-payload.d.ts +39 -0
  43. package/lib/contract-payload.d.ts.map +1 -0
  44. package/lib/contract-payload.js +56 -0
  45. package/lib/custom-tools/compile.d.ts +25 -0
  46. package/lib/custom-tools/compile.d.ts.map +1 -0
  47. package/lib/custom-tools/compile.js +61 -0
  48. package/lib/custom-tools/composite-executor.d.ts +42 -0
  49. package/lib/custom-tools/composite-executor.d.ts.map +1 -0
  50. package/lib/custom-tools/composite-executor.js +113 -0
  51. package/lib/custom-tools/dispatch.d.ts +28 -0
  52. package/lib/custom-tools/dispatch.d.ts.map +1 -0
  53. package/lib/custom-tools/dispatch.js +34 -0
  54. package/lib/custom-tools/http-executor.d.ts +48 -0
  55. package/lib/custom-tools/http-executor.d.ts.map +1 -0
  56. package/lib/custom-tools/http-executor.js +241 -0
  57. package/lib/custom-tools/index.d.ts +12 -0
  58. package/lib/custom-tools/index.d.ts.map +1 -0
  59. package/lib/custom-tools/index.js +12 -0
  60. package/lib/custom-tools/mcp-surface.d.ts +14 -0
  61. package/lib/custom-tools/mcp-surface.d.ts.map +1 -0
  62. package/lib/custom-tools/mcp-surface.js +41 -0
  63. package/lib/custom-tools/prompt-executor.d.ts +39 -0
  64. package/lib/custom-tools/prompt-executor.d.ts.map +1 -0
  65. package/lib/custom-tools/prompt-executor.js +59 -0
  66. package/lib/custom-tools/registry.d.ts +69 -0
  67. package/lib/custom-tools/registry.d.ts.map +1 -0
  68. package/lib/custom-tools/registry.js +130 -0
  69. package/lib/custom-tools/schema.d.ts +26 -0
  70. package/lib/custom-tools/schema.d.ts.map +1 -0
  71. package/lib/custom-tools/schema.js +375 -0
  72. package/lib/custom-tools/service.d.ts +90 -0
  73. package/lib/custom-tools/service.d.ts.map +1 -0
  74. package/lib/custom-tools/service.js +203 -0
  75. package/lib/custom-tools/store.d.ts +61 -0
  76. package/lib/custom-tools/store.d.ts.map +1 -0
  77. package/lib/custom-tools/store.js +240 -0
  78. package/lib/custom-tools/types.d.ts +131 -0
  79. package/lib/custom-tools/types.d.ts.map +1 -0
  80. package/lib/custom-tools/types.js +11 -0
  81. package/lib/decision-combine.d.ts +113 -0
  82. package/lib/decision-combine.d.ts.map +1 -0
  83. package/lib/decision-combine.js +156 -0
  84. package/lib/decision-evaluate.d.ts +185 -0
  85. package/lib/decision-evaluate.d.ts.map +1 -0
  86. package/lib/decision-evaluate.js +227 -0
  87. package/lib/deployment-coordinator.d.ts +213 -0
  88. package/lib/deployment-coordinator.d.ts.map +1 -0
  89. package/lib/deployment-coordinator.js +274 -0
  90. package/lib/diagnostics.d.ts +169 -0
  91. package/lib/diagnostics.d.ts.map +1 -0
  92. package/lib/diagnostics.js +136 -0
  93. package/lib/discovery-contracts.d.ts +14 -0
  94. package/lib/discovery-contracts.d.ts.map +1 -0
  95. package/lib/discovery-contracts.js +90 -0
  96. package/lib/discovery-describe.d.ts +35 -0
  97. package/lib/discovery-describe.d.ts.map +1 -0
  98. package/lib/discovery-describe.js +99 -0
  99. package/lib/embedding-index.d.ts +55 -0
  100. package/lib/embedding-index.d.ts.map +1 -0
  101. package/lib/embedding-index.js +126 -0
  102. package/lib/extension-dependencies.d.ts +355 -0
  103. package/lib/extension-dependencies.d.ts.map +1 -0
  104. package/lib/extension-dependencies.js +987 -0
  105. package/lib/extension-dispatch.d.ts +150 -0
  106. package/lib/extension-dispatch.d.ts.map +1 -0
  107. package/lib/extension-dispatch.js +178 -0
  108. package/lib/extension-page-state.d.ts +69 -0
  109. package/lib/extension-page-state.d.ts.map +1 -0
  110. package/lib/extension-page-state.js +82 -0
  111. package/lib/extension-registrar.d.ts +116 -0
  112. package/lib/extension-registrar.d.ts.map +1 -0
  113. package/lib/extension-registrar.js +144 -0
  114. package/lib/extensions-api.d.ts +346 -0
  115. package/lib/extensions-api.d.ts.map +1 -0
  116. package/lib/extensions-api.js +17 -0
  117. package/lib/extensions-remote.d.ts +57 -0
  118. package/lib/extensions-remote.d.ts.map +1 -0
  119. package/lib/extensions-remote.js +69 -0
  120. package/lib/extensions-service.d.ts +568 -0
  121. package/lib/extensions-service.d.ts.map +1 -0
  122. package/lib/extensions-service.js +2552 -0
  123. package/lib/harness-budgets.d.ts +158 -0
  124. package/lib/harness-budgets.d.ts.map +1 -0
  125. package/lib/harness-budgets.js +152 -0
  126. package/lib/harness-llm.d.ts +138 -0
  127. package/lib/harness-llm.d.ts.map +1 -0
  128. package/lib/harness-llm.js +218 -0
  129. package/lib/harness-serving.d.ts +115 -0
  130. package/lib/harness-serving.d.ts.map +1 -0
  131. package/lib/harness-serving.js +176 -0
  132. package/lib/headless.d.ts +97 -0
  133. package/lib/headless.d.ts.map +1 -0
  134. package/lib/headless.js +407 -0
  135. package/lib/http-acquisition.d.ts +27 -0
  136. package/lib/http-acquisition.d.ts.map +1 -0
  137. package/lib/http-acquisition.js +140 -0
  138. package/lib/index.d.ts +546 -0
  139. package/lib/index.d.ts.map +1 -0
  140. package/lib/index.js +5273 -0
  141. package/lib/invocation-accounting.d.ts +169 -0
  142. package/lib/invocation-accounting.d.ts.map +1 -0
  143. package/lib/invocation-accounting.js +148 -0
  144. package/lib/jev.d.ts +218 -0
  145. package/lib/jev.d.ts.map +1 -0
  146. package/lib/jev.js +366 -0
  147. package/lib/legacy-migration.d.ts +95 -0
  148. package/lib/legacy-migration.d.ts.map +1 -0
  149. package/lib/legacy-migration.js +429 -0
  150. package/lib/license-basis.d.ts +29 -0
  151. package/lib/license-basis.d.ts.map +1 -0
  152. package/lib/license-basis.js +58 -0
  153. package/lib/managed-workers.d.ts +158 -0
  154. package/lib/managed-workers.d.ts.map +1 -0
  155. package/lib/managed-workers.js +269 -0
  156. package/lib/mcp/auth-selection.d.ts +35 -0
  157. package/lib/mcp/auth-selection.d.ts.map +1 -0
  158. package/lib/mcp/auth-selection.js +64 -0
  159. package/lib/mcp/client-grant.d.ts +89 -0
  160. package/lib/mcp/client-grant.d.ts.map +1 -0
  161. package/lib/mcp/client-grant.js +63 -0
  162. package/lib/mcp/credential-cli.d.ts +38 -0
  163. package/lib/mcp/credential-cli.d.ts.map +1 -0
  164. package/lib/mcp/credential-cli.js +148 -0
  165. package/lib/mcp/credential-store.d.ts +143 -0
  166. package/lib/mcp/credential-store.d.ts.map +1 -0
  167. package/lib/mcp/credential-store.js +461 -0
  168. package/lib/mcp/export-policy.d.ts +25 -0
  169. package/lib/mcp/export-policy.d.ts.map +1 -0
  170. package/lib/mcp/export-policy.js +31 -0
  171. package/lib/mcp/host-binding.d.ts +144 -0
  172. package/lib/mcp/host-binding.d.ts.map +1 -0
  173. package/lib/mcp/host-binding.js +280 -0
  174. package/lib/mcp/http.d.ts +180 -0
  175. package/lib/mcp/http.d.ts.map +1 -0
  176. package/lib/mcp/http.js +602 -0
  177. package/lib/mcp/oauth.d.ts +149 -0
  178. package/lib/mcp/oauth.d.ts.map +1 -0
  179. package/lib/mcp/oauth.js +396 -0
  180. package/lib/mcp/protocol.d.ts +329 -0
  181. package/lib/mcp/protocol.d.ts.map +1 -0
  182. package/lib/mcp/protocol.js +459 -0
  183. package/lib/mcp/rate-limit.d.ts +68 -0
  184. package/lib/mcp/rate-limit.d.ts.map +1 -0
  185. package/lib/mcp/rate-limit.js +114 -0
  186. package/lib/mcp/sdk-v2.d.ts +17 -0
  187. package/lib/mcp/sdk-v2.d.ts.map +1 -0
  188. package/lib/mcp/sdk-v2.js +204 -0
  189. package/lib/mcp/server.d.ts +149 -0
  190. package/lib/mcp/server.d.ts.map +1 -0
  191. package/lib/mcp/server.js +302 -0
  192. package/lib/mcp/stdio.d.ts +80 -0
  193. package/lib/mcp/stdio.d.ts.map +1 -0
  194. package/lib/mcp/stdio.js +184 -0
  195. package/lib/mcp/subscriptions.d.ts +177 -0
  196. package/lib/mcp/subscriptions.d.ts.map +1 -0
  197. package/lib/mcp/subscriptions.js +288 -0
  198. package/lib/mcp-status.d.ts +96 -0
  199. package/lib/mcp-status.d.ts.map +1 -0
  200. package/lib/mcp-status.js +70 -0
  201. package/lib/mcp-usage.d.ts +110 -0
  202. package/lib/mcp-usage.d.ts.map +1 -0
  203. package/lib/mcp-usage.js +189 -0
  204. package/lib/model-qualification.d.ts +192 -0
  205. package/lib/model-qualification.d.ts.map +1 -0
  206. package/lib/model-qualification.js +178 -0
  207. package/lib/model-runtime-lane.d.ts +69 -0
  208. package/lib/model-runtime-lane.d.ts.map +1 -0
  209. package/lib/model-runtime-lane.js +122 -0
  210. package/lib/model-runtime-recipe.d.ts +132 -0
  211. package/lib/model-runtime-recipe.d.ts.map +1 -0
  212. package/lib/model-runtime-recipe.js +291 -0
  213. package/lib/planning.d.ts +256 -0
  214. package/lib/planning.d.ts.map +1 -0
  215. package/lib/planning.js +471 -0
  216. package/lib/playbook.d.ts +42 -0
  217. package/lib/playbook.d.ts.map +1 -0
  218. package/lib/playbook.js +65 -0
  219. package/lib/prepared-assets.d.ts +269 -0
  220. package/lib/prepared-assets.d.ts.map +1 -0
  221. package/lib/prepared-assets.js +471 -0
  222. package/lib/provider-bridge.d.ts +107 -0
  223. package/lib/provider-bridge.d.ts.map +1 -0
  224. package/lib/provider-bridge.js +423 -0
  225. package/lib/ptc-authority.d.ts +154 -0
  226. package/lib/ptc-authority.d.ts.map +1 -0
  227. package/lib/ptc-authority.js +242 -0
  228. package/lib/ptc-confinement.d.ts +60 -0
  229. package/lib/ptc-confinement.d.ts.map +1 -0
  230. package/lib/ptc-confinement.js +212 -0
  231. package/lib/ptc-runtime.d.ts +166 -0
  232. package/lib/ptc-runtime.d.ts.map +1 -0
  233. package/lib/ptc-runtime.js +231 -0
  234. package/lib/publication.d.ts +161 -0
  235. package/lib/publication.d.ts.map +1 -0
  236. package/lib/publication.js +181 -0
  237. package/lib/receipt-store.d.ts +57 -0
  238. package/lib/receipt-store.d.ts.map +1 -0
  239. package/lib/receipt-store.js +143 -0
  240. package/lib/receipt.d.ts +231 -0
  241. package/lib/receipt.d.ts.map +1 -0
  242. package/lib/receipt.js +165 -0
  243. package/lib/registrar.d.ts +75 -0
  244. package/lib/registrar.d.ts.map +1 -0
  245. package/lib/registrar.js +152 -0
  246. package/lib/resource-governance.d.ts +204 -0
  247. package/lib/resource-governance.d.ts.map +1 -0
  248. package/lib/resource-governance.js +213 -0
  249. package/lib/server-lifecycle.d.ts +175 -0
  250. package/lib/server-lifecycle.d.ts.map +1 -0
  251. package/lib/server-lifecycle.js +269 -0
  252. package/lib/skills.d.ts +31 -0
  253. package/lib/skills.d.ts.map +1 -0
  254. package/lib/skills.js +170 -0
  255. package/lib/speech-bridge.d.ts +74 -0
  256. package/lib/speech-bridge.d.ts.map +1 -0
  257. package/lib/speech-bridge.js +115 -0
  258. package/lib/state.d.ts +100 -0
  259. package/lib/state.d.ts.map +1 -0
  260. package/lib/state.js +160 -0
  261. package/lib/title-proposal.d.ts +194 -0
  262. package/lib/title-proposal.d.ts.map +1 -0
  263. package/lib/title-proposal.js +244 -0
  264. package/lib/tool-inventory.d.ts +90 -0
  265. package/lib/tool-inventory.d.ts.map +1 -0
  266. package/lib/tool-inventory.js +102 -0
  267. package/lib/tool-mode-run.d.ts +310 -0
  268. package/lib/tool-mode-run.d.ts.map +1 -0
  269. package/lib/tool-mode-run.js +411 -0
  270. package/lib/tool-sources.d.ts +80 -0
  271. package/lib/tool-sources.d.ts.map +1 -0
  272. package/lib/tool-sources.js +123 -0
  273. package/lib/tool-usage-projection.d.ts +390 -0
  274. package/lib/tool-usage-projection.d.ts.map +1 -0
  275. package/lib/tool-usage-projection.js +1038 -0
  276. package/lib/tool-usage-report.d.ts +153 -0
  277. package/lib/tool-usage-report.d.ts.map +1 -0
  278. package/lib/tool-usage-report.js +274 -0
  279. package/lib/transport.d.ts +158 -0
  280. package/lib/transport.d.ts.map +1 -0
  281. package/lib/transport.js +332 -0
  282. package/lib/types.d.ts +134 -0
  283. package/lib/types.d.ts.map +1 -0
  284. package/lib/types.js +8 -0
  285. package/lib/update-surface.d.ts +79 -0
  286. package/lib/update-surface.d.ts.map +1 -0
  287. package/lib/update-surface.js +224 -0
  288. package/lib/version.d.ts +3 -0
  289. package/lib/version.d.ts.map +1 -0
  290. package/lib/version.js +27 -0
  291. package/node_modules/@try-works/tool-mode-contracts/lib/contract-metadata.d.ts +13 -0
  292. package/node_modules/@try-works/tool-mode-contracts/lib/contract-metadata.d.ts.map +1 -0
  293. package/node_modules/@try-works/tool-mode-contracts/lib/contract-metadata.js +85 -0
  294. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/lang-detect.d.ts +16 -0
  295. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/lang-detect.d.ts.map +1 -0
  296. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/lang-detect.js +87 -0
  297. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.d.ts +38 -0
  298. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.d.ts.map +1 -0
  299. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.js +445 -0
  300. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/stt-transcribe.d.ts +20 -0
  301. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/stt-transcribe.d.ts.map +1 -0
  302. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/stt-transcribe.js +112 -0
  303. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.d.ts +14 -0
  304. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.d.ts.map +1 -0
  305. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.js +63 -0
  306. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.d.ts +14 -0
  307. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.d.ts.map +1 -0
  308. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.js +76 -0
  309. package/node_modules/@try-works/tool-mode-contracts/lib/dsh.d.ts +82 -0
  310. package/node_modules/@try-works/tool-mode-contracts/lib/dsh.d.ts.map +1 -0
  311. package/node_modules/@try-works/tool-mode-contracts/lib/dsh.js +274 -0
  312. package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts +26 -0
  313. package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts.map +1 -0
  314. package/node_modules/@try-works/tool-mode-contracts/lib/index.js +53 -0
  315. package/node_modules/@try-works/tool-mode-contracts/lib/meta.d.ts +133 -0
  316. package/node_modules/@try-works/tool-mode-contracts/lib/meta.d.ts.map +1 -0
  317. package/node_modules/@try-works/tool-mode-contracts/lib/meta.js +64 -0
  318. package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts +121 -0
  319. package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts.map +1 -0
  320. package/node_modules/@try-works/tool-mode-contracts/lib/registry.js +246 -0
  321. package/node_modules/@try-works/tool-mode-contracts/package.json +35 -0
  322. package/node_modules/@try-works/tool-mode-extension-sdk/bin/dsh-tool-mode.mjs +20 -0
  323. package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.d.ts +80 -0
  324. package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.d.ts.map +1 -0
  325. package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.js +533 -0
  326. package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.d.ts +86 -0
  327. package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.d.ts.map +1 -0
  328. package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.js +145 -0
  329. package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.d.ts +70 -0
  330. package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.d.ts.map +1 -0
  331. package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.js +201 -0
  332. package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.d.ts +57 -0
  333. package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.d.ts.map +1 -0
  334. package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.js +83 -0
  335. package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.d.ts +33 -0
  336. package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.d.ts.map +1 -0
  337. package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.js +33 -0
  338. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.d.ts +86 -0
  339. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.d.ts.map +1 -0
  340. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.js +191 -0
  341. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.d.ts +137 -0
  342. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.d.ts.map +1 -0
  343. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.js +349 -0
  344. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts +274 -0
  345. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts.map +1 -0
  346. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.js +932 -0
  347. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.d.ts +210 -0
  348. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.d.ts.map +1 -0
  349. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.js +368 -0
  350. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.d.ts +63 -0
  351. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.d.ts.map +1 -0
  352. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.js +149 -0
  353. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.d.ts +35 -0
  354. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.d.ts.map +1 -0
  355. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.js +179 -0
  356. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.d.ts +179 -0
  357. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.d.ts.map +1 -0
  358. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.js +299 -0
  359. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts +395 -0
  360. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts.map +1 -0
  361. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.js +839 -0
  362. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.d.ts +44 -0
  363. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.d.ts.map +1 -0
  364. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.js +255 -0
  365. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.d.ts +185 -0
  366. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.d.ts.map +1 -0
  367. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.js +504 -0
  368. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.d.ts +17 -0
  369. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.d.ts.map +1 -0
  370. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.js +80 -0
  371. package/node_modules/@try-works/tool-mode-extension-sdk/lib/licensing.d.ts +221 -0
  372. package/node_modules/@try-works/tool-mode-extension-sdk/lib/licensing.d.ts.map +1 -0
  373. package/node_modules/@try-works/tool-mode-extension-sdk/lib/licensing.js +188 -0
  374. package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.d.ts +52 -0
  375. package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.d.ts.map +1 -0
  376. package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.js +102 -0
  377. package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.d.ts +171 -0
  378. package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.d.ts.map +1 -0
  379. package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.js +271 -0
  380. package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.d.ts +242 -0
  381. package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.d.ts.map +1 -0
  382. package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.js +58 -0
  383. package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.d.ts +128 -0
  384. package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.d.ts.map +1 -0
  385. package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.js +113 -0
  386. package/node_modules/@try-works/tool-mode-extension-sdk/lib/test-host.d.ts +41 -0
  387. package/node_modules/@try-works/tool-mode-extension-sdk/lib/test-host.d.ts.map +1 -0
  388. package/node_modules/@try-works/tool-mode-extension-sdk/lib/test-host.js +52 -0
  389. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.d.ts +2 -0
  390. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.d.ts.map +1 -0
  391. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.js +351 -0
  392. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.d.ts +157 -0
  393. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.d.ts.map +1 -0
  394. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.js +688 -0
  395. package/node_modules/@try-works/tool-mode-extension-sdk/package.json +54 -0
  396. package/node_modules/@try-works/tool-mode-extension-sdk/schema/extension-manifest-1.1.0.schema.json +253 -0
  397. package/node_modules/@try-works/tool-mode-recipes/bin/tool-mode-recipe.mjs +15 -0
  398. package/node_modules/@try-works/tool-mode-recipes/lib/broker.d.ts +460 -0
  399. package/node_modules/@try-works/tool-mode-recipes/lib/broker.d.ts.map +1 -0
  400. package/node_modules/@try-works/tool-mode-recipes/lib/broker.js +647 -0
  401. package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts +61 -0
  402. package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts.map +1 -0
  403. package/node_modules/@try-works/tool-mode-recipes/lib/cli.js +1106 -0
  404. package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.d.ts +237 -0
  405. package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.d.ts.map +1 -0
  406. package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.js +205 -0
  407. package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.d.ts +85 -0
  408. package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.d.ts.map +1 -0
  409. package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.js +176 -0
  410. package/node_modules/@try-works/tool-mode-recipes/lib/images.d.ts +119 -0
  411. package/node_modules/@try-works/tool-mode-recipes/lib/images.d.ts.map +1 -0
  412. package/node_modules/@try-works/tool-mode-recipes/lib/images.js +201 -0
  413. package/node_modules/@try-works/tool-mode-recipes/lib/index.d.ts +25 -0
  414. package/node_modules/@try-works/tool-mode-recipes/lib/index.d.ts.map +1 -0
  415. package/node_modules/@try-works/tool-mode-recipes/lib/index.js +25 -0
  416. package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.d.ts +345 -0
  417. package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.d.ts.map +1 -0
  418. package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.js +1465 -0
  419. package/node_modules/@try-works/tool-mode-recipes/lib/templates.d.ts +51 -0
  420. package/node_modules/@try-works/tool-mode-recipes/lib/templates.d.ts.map +1 -0
  421. package/node_modules/@try-works/tool-mode-recipes/lib/templates.js +310 -0
  422. package/node_modules/@try-works/tool-mode-recipes/lib/titles.d.ts +231 -0
  423. package/node_modules/@try-works/tool-mode-recipes/lib/titles.d.ts.map +1 -0
  424. package/node_modules/@try-works/tool-mode-recipes/lib/titles.js +435 -0
  425. package/node_modules/@try-works/tool-mode-recipes/package.json +56 -0
  426. package/node_modules/@try-works/tool-mode-recipes/recipes/describe-image.json +38 -0
  427. package/node_modules/@try-works/tool-mode-recipes/recipes/text-title.json +45 -0
  428. package/node_modules/@try-works/tool-mode-recipes/schema/harness-model-recipe.schema.json +273 -0
  429. package/package.json +127 -4
  430. package/remote/spec.mjs +993 -0
  431. package/remote/typert.host.mjs +14 -0
  432. package/remote/typert.remote-client.mjs +16 -0
@@ -0,0 +1,395 @@
1
+ /**
2
+ * The operator-owned extension store (EXT-33).
3
+ *
4
+ * Three properties this module exists to guarantee:
5
+ *
6
+ * 1. **Identity survives restart.** Every installation is recorded in
7
+ * `extensions.lock.json` with its resolved source and a CONTENT digest, so the
8
+ * host can tell on a later boot whether the bytes it is about to activate are
9
+ * still the bytes it installed.
10
+ * 2. **Corruption fails closed.** A state file that cannot be read yields NO
11
+ * active extensions and a diagnostic. The tempting alternative — falling back
12
+ * to "everything installed is active" — is precisely the failure EXT-33 names,
13
+ * because a corrupted file would silently enable every package on the machine.
14
+ * 3. **A write that did not land is never reported as landed.** Every write goes
15
+ * through a temporary file and a rename, and a failure throws rather than
16
+ * leaving the caller believing a preference was stored.
17
+ *
18
+ * @module @try-works/tool-mode-extension-sdk/install/store
19
+ */
20
+ import type { ExtensionState } from './../state.ts';
21
+ import { STATE_VERSION, type MigratedAssetRecord, type MigrationReport } from './migration.ts';
22
+ import type { LockedDependency } from './dependencies.ts';
23
+ /** The lock document name, as EXT-33 specifies. */
24
+ export declare const LOCK_FILE = "extensions.lock.json";
25
+ /** One installed extension, as recorded at install time. */
26
+ export interface InstalledRecord {
27
+ /** Extension identity, which equals the package name. */
28
+ readonly extensionId: string;
29
+ /** Installed version. */
30
+ readonly version: string;
31
+ /** Absolute installation directory. */
32
+ readonly installPath: string;
33
+ /** SHA-512 of the archive the package was installed from (EXT-12). */
34
+ readonly archiveDigest: string;
35
+ /**
36
+ * Digest over the installed files. Re-checked before activation so a package
37
+ * edited on disk after installation is detected rather than trusted.
38
+ */
39
+ readonly contentDigest: string;
40
+ /** Where the archive came from, recorded verbatim. */
41
+ readonly source: {
42
+ readonly kind: string;
43
+ readonly requested: string;
44
+ };
45
+ /** The resolved acquisition identity (EXT-12), when the caller resolved one. */
46
+ readonly resolvedSource?: string;
47
+ /** SHA-256 over the installed manifest bytes (EXT-12). */
48
+ readonly manifestDigest?: string;
49
+ /** SHA-256 over the resolved dependency graph (EXT-12); empty graph included. */
50
+ readonly dependencyLockDigest?: string;
51
+ /** SHA-256 over the canonical declared permissions object (EXT-12). */
52
+ readonly permissionsDigest?: string;
53
+ /** Whether the install required/was shown an operator preview (EXT-12). */
54
+ readonly approval?: {
55
+ readonly required: boolean;
56
+ readonly previewed: boolean;
57
+ };
58
+ /** Resolved per-layer licence record + notices (LIC-01). */
59
+ readonly licenses?: unknown;
60
+ /** When it was installed, ISO 8601. */
61
+ readonly installedAt: string;
62
+ /**
63
+ * The installer-owned dependency graph (EXT-09, EXT-12): every runtime
64
+ * dependency at its EXACT resolved version with its verified integrity.
65
+ * Absent when the package declares no runtime dependencies.
66
+ */
67
+ readonly dependencies?: readonly LockedDependency[];
68
+ /**
69
+ * Provenance fields recorded AS DATA, NEVER AS TRUST (EXT-12): registry
70
+ * integrity/provenance flags travel with the record for audit; verification
71
+ * is always against the operator-supplied digest.
72
+ */
73
+ readonly provenance?: {
74
+ readonly registryIntegrity?: string;
75
+ readonly provenance?: boolean;
76
+ readonly attestations?: readonly string[];
77
+ readonly signatures?: readonly string[];
78
+ };
79
+ }
80
+ /** The lock document. */
81
+ export interface StoreLock {
82
+ readonly lockVersion: 1;
83
+ readonly extensions: readonly InstalledRecord[];
84
+ /**
85
+ * Append-only records of completed store transactions (EXT-33). A transaction
86
+ * record says WHAT changed and WHEN; it is not a rollback log.
87
+ */
88
+ readonly transactions?: readonly TransactionRecord[];
89
+ }
90
+ /** One completed store transaction (EXT-33). */
91
+ export interface TransactionRecord {
92
+ readonly transactionId: string;
93
+ readonly operation: 'install' | 'uninstall';
94
+ readonly extensionId: string;
95
+ readonly version: string;
96
+ readonly at: string;
97
+ }
98
+ /**
99
+ * A profile's persisted activation state (EXT-25, dimensions 2-6).
100
+ *
101
+ * The two version keys are BASE-09's: `stateVersion` is the migration-table era
102
+ * (a document with a higher number was written by a newer SDK and is refused,
103
+ * never rewritten), and `schemaVersion` identifies the schema dialect. Documents
104
+ * written before `schemaVersion` existed (stateVersion 1, no schemaVersion key)
105
+ * still read: the key was added without a data change, so there is no migration
106
+ * step between them.
107
+ */
108
+ export interface ProfileStateFile {
109
+ readonly stateVersion: typeof STATE_VERSION;
110
+ readonly schemaVersion: string;
111
+ readonly profile: string;
112
+ readonly extensions: readonly ExtensionState[];
113
+ /** Legacy prepared-asset mappings recorded by the BASE-09 migration. */
114
+ readonly migratedAssets?: readonly MigratedAssetRecord[];
115
+ /** EXT-30: the active version per extension, the update flow's pointer. */
116
+ readonly activeVersions?: Readonly<Record<string, string>>;
117
+ /** EXT-30: the previous active version per extension, the rollback target. */
118
+ readonly previousVersions?: Readonly<Record<string, string>>;
119
+ }
120
+ /**
121
+ * One EXT-30 approval decision for a staged update.
122
+ *
123
+ * Retained for the store's lifetime (audit trail, no expiry) and write-once per
124
+ * staged version: a decision is a human act, and a later one never silently
125
+ * overwrites it.
126
+ */
127
+ export interface UpdateApprovalRecord {
128
+ readonly extensionId: string;
129
+ readonly version: string;
130
+ readonly approved: boolean;
131
+ readonly deniedReason?: string;
132
+ readonly decidedAt: string;
133
+ }
134
+ /** The outcome of reading state, which never throws on corruption. */
135
+ export interface StateReadResult<T> {
136
+ readonly value: T;
137
+ /** Set when the file existed but could not be trusted. */
138
+ readonly diagnostic?: string;
139
+ /** True when the file existed but could not be read or parsed. */
140
+ readonly corrupt: boolean;
141
+ }
142
+ /**
143
+ * Digest the files inside an installed package.
144
+ *
145
+ * Identity is `relative path` plus size plus a per-file digest, over a sorted
146
+ * walk, so a renamed file, an edited file, an added file and a removed file all
147
+ * change the result. The install receipt is excluded: it is store metadata, not
148
+ * package content, and including it would make the digest depend on itself.
149
+ * @param directory - the installed package directory.
150
+ * @returns the content digest, lowercase hex.
151
+ */
152
+ export declare function digestInstalledContent(directory: string): string;
153
+ /**
154
+ * Whether a process with this pid exists. `process.kill(pid, 0)` is the probe.
155
+ *
156
+ * Exported because surface ownership is recorded as a PID: telling a GONE owner (a
157
+ * crashed or restarted host, whose in-memory handles died with it) from a LIVE one
158
+ * (another host still serving) is the same question the store lock asks.
159
+ * @param pid - the process id to probe.
160
+ * @returns whether the process exists.
161
+ */
162
+ export declare function isProcessAlive(pid: number): boolean;
163
+ /** The operator-owned extension store. */
164
+ export declare class ExtensionStore {
165
+ /** Absolute path of the store root. */
166
+ readonly rootDir: string;
167
+ constructor(rootDir: string);
168
+ /** Path of the lock document. */
169
+ get lockPath(): string;
170
+ /** Path of one profile's state file. */
171
+ profileStatePath(profile: string): string;
172
+ /**
173
+ * Take exclusive ownership of the store for offline edits (EXT-31).
174
+ *
175
+ * EXT-31 requires offline edits to hold exclusive store ownership, because an
176
+ * offline writer and a running host editing the same store would each be working
177
+ * from a state the other cannot see. The lock records the owning process so a
178
+ * stale lock from a crashed run can be reported as stale rather than blocking
179
+ * forever.
180
+ * @returns a release function.
181
+ * @throws ManagementError with `EXTENSION_IN_USE` when another process holds it.
182
+ */
183
+ acquireExclusive(): () => void;
184
+ /**
185
+ * Run a state-mutating operation under the store lock (EXT-31).
186
+ *
187
+ * The HOST LIFECYCLE takes this around every state write, and the offline CLI
188
+ * takes it around its edits; each side refuses while the other's process is
189
+ * alive. Reentrancy is keyed by the RESOLVED STORE ROOT, not the instance:
190
+ * the CLI creates fresh ExtensionStore objects around one directory, so
191
+ * per-instance counting would let an inner acquisition overwrite the outer's
192
+ * lock record (the round-49 review's hole 3). The depth is recorded only
193
+ * AFTER the file lock is taken, so a refusal throws WITHOUT poisoning the
194
+ * count (hole 1), and the lock file is removed only when the depth returns to
195
+ * zero (hole 2: a concurrent section still holds it).
196
+ * @param work - the mutating work.
197
+ * @returns the work's result.
198
+ */
199
+ exclusive<T>(work: () => Promise<T>): Promise<T>;
200
+ /**
201
+ * Read the lock document.
202
+ *
203
+ * A corrupt lock fails closed with a diagnostic and NO records, rather than
204
+ * reporting the store as empty-without-explanation or trusting a partial read.
205
+ * @returns the lock and a diagnostic when it could not be trusted.
206
+ */
207
+ readLock(): StateReadResult<StoreLock>;
208
+ /** List installed extensions. */
209
+ listInstalled(): StateReadResult<readonly InstalledRecord[]>;
210
+ /**
211
+ * Record an installation.
212
+ *
213
+ * Throws when the write fails, so a caller never treats a lost record as a
214
+ * completed install.
215
+ * @param record - the installation to record.
216
+ * @throws ManagementError when the same identity and version is already recorded.
217
+ */
218
+ recordInstall(record: InstalledRecord): void;
219
+ /**
220
+ * Remove an installation record.
221
+ *
222
+ * Removing a record does NOT delete the installed bytes: deletion is a separate,
223
+ * operator-driven step with its own failure modes (EXT-29), and conflating the
224
+ * two would make a failed deletion look like a failed uninstall.
225
+ * @param extensionId - the extension to forget.
226
+ */
227
+ removeRecord(extensionId: string): void;
228
+ /**
229
+ * Check whether an installation still matches what was recorded (EXT-33).
230
+ *
231
+ * Run before activation: a package edited on disk after installation is a
232
+ * different package, and activating it would execute bytes nobody approved.
233
+ * @param record - the recorded installation.
234
+ * @returns whether the content is unchanged, plus the current digest.
235
+ */
236
+ verifyUnchanged(record: InstalledRecord): {
237
+ unchanged: boolean;
238
+ contentDigest?: string;
239
+ diagnostic?: string;
240
+ };
241
+ /**
242
+ * Read one profile's activation state.
243
+ *
244
+ * A corrupt file yields NO states and a diagnostic. Returning the installed set
245
+ * instead would be the failure EXT-33 names: corruption would enable everything.
246
+ *
247
+ * Versioning (BASE-09): a document with a HIGHER `stateVersion` was written by
248
+ * a newer SDK and is refused, not read half-understood. A document with NO
249
+ * `stateVersion` is either a legacy model-id era document (enabled/disabled
250
+ * arrays, migrated via {@link ExtensionStore.migrateLegacyProfileState}) or
251
+ * something this store never wrote — both fail closed with a diagnostic.
252
+ * @param profile - the profile name.
253
+ * @returns the states and any diagnostic.
254
+ */
255
+ readProfileState(profile: string): StateReadResult<readonly ExtensionState[]>;
256
+ /**
257
+ * Persist one profile's activation state.
258
+ *
259
+ * The document carries both BASE-09 version keys: `stateVersion` (the
260
+ * migration era) and `schemaVersion` (the schema dialect), so a later reader
261
+ * can tell an up-to-date document from a legacy one without guessing.
262
+ *
263
+ * MIGRATED-ASSET DURABILITY (BASE-09): when the caller does not pass
264
+ * `migratedAssets`, the mappings already recorded in the file are PRESERVED
265
+ * verbatim instead of dropped. Every lifecycle write and CLI edit calls this
266
+ * method without the parameter, so requiring every caller to carry the
267
+ * mappings through would mean the first forgetful writer silently loses the
268
+ * migration's prepared-asset record; preserving by default makes the store
269
+ * itself the keeper of them. Pass an empty array to clear them deliberately.
270
+ * @param profile - the profile name.
271
+ * @param extensions - the complete state set for that profile.
272
+ * @param migratedAssets - durable legacy prepared-asset mappings. Omitted:
273
+ * preserve the existing ones. `[]`: clear them.
274
+ * @throws ManagementError when the write fails.
275
+ */
276
+ writeProfileState(profile: string, extensions: readonly ExtensionState[], migratedAssets?: readonly MigratedAssetRecord[], activeVersions?: Readonly<Record<string, string>>, previousVersions?: Readonly<Record<string, string>>): void;
277
+ /**
278
+ * Read the EXT-30 active-version pointers from one profile's state document.
279
+ *
280
+ * The maps are OPTIONAL document keys written only by the update flow: an
281
+ * older document simply has no pointers, and a corrupt map fails closed
282
+ * rather than being half-read. The read is separate from
283
+ * {@link ExtensionStore.readProfileState} so the existing per-extension state
284
+ * contract is untouched.
285
+ * @param profile - the profile name.
286
+ * @returns the pointer maps and any diagnostic.
287
+ */
288
+ readProfilePointers(profile: string): StateReadResult<{
289
+ readonly activeVersions: Readonly<Record<string, string>>;
290
+ readonly previousVersions: Readonly<Record<string, string>>;
291
+ }>;
292
+ /** The approval-record path for one staged version (EXT-30, lifetime audit). */
293
+ approvalPath(extensionId: string, version: string): string;
294
+ /**
295
+ * Read the approval record for one staged version.
296
+ *
297
+ * A corrupt record fails closed with the diagnostic: an update whose approval
298
+ * cannot be read must NOT proceed as if it were approved.
299
+ * @param extensionId - the extension.
300
+ * @param version - the staged version.
301
+ * @returns the record (or undefined when none was written) and any diagnostic.
302
+ */
303
+ readApproval(extensionId: string, version: string): StateReadResult<UpdateApprovalRecord | undefined>;
304
+ /**
305
+ * Record ONE approval decision for one staged version (EXT-30).
306
+ *
307
+ * The record is retained for the store's LIFETIME (audit trail, no expiry)
308
+ * and is WRITE-ONCE per staged version: a later decision never silently
309
+ * overwrites an earlier one. A denied record stays as the audit entry.
310
+ * @param extensionId - the extension.
311
+ * @param version - the staged version.
312
+ * @param decision - the operator's decision.
313
+ * @throws ManagementError when an earlier decision exists.
314
+ */
315
+ recordApproval(extensionId: string, version: string, decision: {
316
+ approved: true;
317
+ } | {
318
+ approved: false;
319
+ reason: string;
320
+ }): void;
321
+ /**
322
+ * Remove ONE version's installation record (EXT-30 admission rollback).
323
+ *
324
+ * The per-version removal exists for the update flow's failure cleanup: when
325
+ * a commit fails after the new version was admitted, the new version's record
326
+ * is removed while every OTHER version's record survives.
327
+ * @param extensionId - the extension.
328
+ * @param version - the version to forget.
329
+ */
330
+ removeVersionRecord(extensionId: string, version: string): void;
331
+ /** The cleanup-pending tombstone directory. */
332
+ cleanupPendingDir(): string;
333
+ /**
334
+ * Record an owned deletion that could not complete (EXT-29).
335
+ *
336
+ * A tombstone keeps the CLEANUP_PENDING truth durable: the retry loop
337
+ * ({@link ExtensionStore.retryCleanupPending}) re-attempts the deletion on
338
+ * later runs, bounded, and the directory is never silently forgotten.
339
+ * @param targetPath - the path the deletion could not remove.
340
+ * @param reason - why the deletion failed.
341
+ */
342
+ writeCleanupTombstone(targetPath: string, reason: string): void;
343
+ /**
344
+ * Retry owned deletions recorded by tombstones (EXT-29), bounded.
345
+ *
346
+ * Every tombstone under the attempts cap gets ONE retry attempt per call;
347
+ * a still-failing deletion increments the counter and keeps the truthful
348
+ * CLEANUP_PENDING record. A path that no longer exists counts as deleted.
349
+ * @param maxAttempts - the attempts cap (default 5).
350
+ * @returns the per-run counts.
351
+ */
352
+ retryCleanupPending(maxAttempts?: number): {
353
+ retried: number;
354
+ deleted: number;
355
+ kept: number;
356
+ };
357
+ /**
358
+ * Read the durable legacy prepared-asset mappings a migration recorded.
359
+ *
360
+ * Kept on the store rather than folded into `readProfileState` because the
361
+ * state array is the lifecycle's working surface: changing its shape for the
362
+ * asset record would make every writer a silent dropper of the record, which
363
+ * is exactly the failure BASE-09's preservation clause names. The version
364
+ * gate matches {@link ExtensionStore.readProfileState}.
365
+ * @param profile - the profile name.
366
+ * @returns the recorded mappings and any diagnostic.
367
+ */
368
+ readMigratedAssets(profile: string): StateReadResult<readonly MigratedAssetRecord[]>;
369
+ /**
370
+ * Migrate a legacy model-id era document into this profile (BASE-09, BASE-10).
371
+ *
372
+ * The old world's `<DSH_HOME>/model-as-tool/state.json` held unversioned
373
+ * `enabled`/`disabled` MODEL-ID arrays. The host reads that document and hands
374
+ * its content here; this method runs it through the explicit migration table
375
+ * and writes the versioned profile state atomically under the store lock.
376
+ *
377
+ * Guarantees, per BASE-10:
378
+ * - Disabled choices are preserved as tool-level disables; nothing is
379
+ * installed, activated or prepared by the migration.
380
+ * - Legacy enables are STAGED in the report, never granted.
381
+ * - Unresolved mappings are reported, never silently enabled.
382
+ * - A profile that already holds current-version state is left untouched
383
+ * (double migration is idempotent); a document this SDK cannot interpret is
384
+ * refused rather than overwritten.
385
+ * @param profile - the profile to migrate into.
386
+ * @param legacyJson - the legacy document's text. Omit it to migrate a
387
+ * legacy-shaped document found at the profile state path itself.
388
+ * @param legacySource - description of the origin, for the report.
389
+ * @returns the migration report.
390
+ * @throws ManagementError when the input is not a usable legacy document or
391
+ * the profile already holds a document this SDK refuses to overwrite.
392
+ */
393
+ migrateLegacyProfileState(profile: string, legacyJson?: string, legacySource?: string): Promise<MigrationReport>;
394
+ }
395
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/install/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EA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