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

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 (425) hide show
  1. package/README.md +299 -2
  2. package/bin/dsh-tool-mode-credentials.mjs +20 -0
  3. package/bin/dsh-tool-mode-mcp-stdio.mjs +80 -0
  4. package/bin/dsh-tool-mode.mjs +211 -0
  5. package/builtins.lock.json +26 -0
  6. package/catalog/desert-ant-models.json +693 -0
  7. package/catalog/playbooks.json +531 -0
  8. package/client/client.model-tools.js +1910 -0
  9. package/client/index.js +4039 -0
  10. package/cordis.patch.yml +39 -0
  11. package/lib/adapters/index.d.ts +61 -0
  12. package/lib/adapters/index.d.ts.map +1 -0
  13. package/lib/adapters/index.js +82 -0
  14. package/lib/adapters/types.d.ts +106 -0
  15. package/lib/adapters/types.d.ts.map +1 -0
  16. package/lib/adapters/types.js +85 -0
  17. package/lib/approval.d.ts +189 -0
  18. package/lib/approval.d.ts.map +1 -0
  19. package/lib/approval.js +510 -0
  20. package/lib/asset-acquisition.d.ts +149 -0
  21. package/lib/asset-acquisition.d.ts.map +1 -0
  22. package/lib/asset-acquisition.js +175 -0
  23. package/lib/authority.d.ts +185 -0
  24. package/lib/authority.d.ts.map +1 -0
  25. package/lib/authority.js +223 -0
  26. package/lib/bindings.d.ts +144 -0
  27. package/lib/bindings.d.ts.map +1 -0
  28. package/lib/bindings.js +314 -0
  29. package/lib/builtins.d.ts +27 -0
  30. package/lib/builtins.d.ts.map +1 -0
  31. package/lib/builtins.js +37 -0
  32. package/lib/capability.d.ts +58 -0
  33. package/lib/capability.d.ts.map +1 -0
  34. package/lib/capability.js +192 -0
  35. package/lib/capture-path.d.ts +97 -0
  36. package/lib/capture-path.d.ts.map +1 -0
  37. package/lib/capture-path.js +152 -0
  38. package/lib/catalog.d.ts +37 -0
  39. package/lib/catalog.d.ts.map +1 -0
  40. package/lib/catalog.js +274 -0
  41. package/lib/contract-payload.d.ts +39 -0
  42. package/lib/contract-payload.d.ts.map +1 -0
  43. package/lib/contract-payload.js +56 -0
  44. package/lib/custom-tools/compile.d.ts +25 -0
  45. package/lib/custom-tools/compile.d.ts.map +1 -0
  46. package/lib/custom-tools/compile.js +61 -0
  47. package/lib/custom-tools/composite-executor.d.ts +42 -0
  48. package/lib/custom-tools/composite-executor.d.ts.map +1 -0
  49. package/lib/custom-tools/composite-executor.js +113 -0
  50. package/lib/custom-tools/dispatch.d.ts +28 -0
  51. package/lib/custom-tools/dispatch.d.ts.map +1 -0
  52. package/lib/custom-tools/dispatch.js +34 -0
  53. package/lib/custom-tools/http-executor.d.ts +48 -0
  54. package/lib/custom-tools/http-executor.d.ts.map +1 -0
  55. package/lib/custom-tools/http-executor.js +241 -0
  56. package/lib/custom-tools/index.d.ts +12 -0
  57. package/lib/custom-tools/index.d.ts.map +1 -0
  58. package/lib/custom-tools/index.js +12 -0
  59. package/lib/custom-tools/mcp-surface.d.ts +14 -0
  60. package/lib/custom-tools/mcp-surface.d.ts.map +1 -0
  61. package/lib/custom-tools/mcp-surface.js +41 -0
  62. package/lib/custom-tools/prompt-executor.d.ts +39 -0
  63. package/lib/custom-tools/prompt-executor.d.ts.map +1 -0
  64. package/lib/custom-tools/prompt-executor.js +59 -0
  65. package/lib/custom-tools/registry.d.ts +69 -0
  66. package/lib/custom-tools/registry.d.ts.map +1 -0
  67. package/lib/custom-tools/registry.js +130 -0
  68. package/lib/custom-tools/schema.d.ts +26 -0
  69. package/lib/custom-tools/schema.d.ts.map +1 -0
  70. package/lib/custom-tools/schema.js +375 -0
  71. package/lib/custom-tools/service.d.ts +90 -0
  72. package/lib/custom-tools/service.d.ts.map +1 -0
  73. package/lib/custom-tools/service.js +203 -0
  74. package/lib/custom-tools/store.d.ts +61 -0
  75. package/lib/custom-tools/store.d.ts.map +1 -0
  76. package/lib/custom-tools/store.js +240 -0
  77. package/lib/custom-tools/types.d.ts +131 -0
  78. package/lib/custom-tools/types.d.ts.map +1 -0
  79. package/lib/custom-tools/types.js +11 -0
  80. package/lib/decision-combine.d.ts +113 -0
  81. package/lib/decision-combine.d.ts.map +1 -0
  82. package/lib/decision-combine.js +156 -0
  83. package/lib/decision-evaluate.d.ts +185 -0
  84. package/lib/decision-evaluate.d.ts.map +1 -0
  85. package/lib/decision-evaluate.js +227 -0
  86. package/lib/deployment-coordinator.d.ts +213 -0
  87. package/lib/deployment-coordinator.d.ts.map +1 -0
  88. package/lib/deployment-coordinator.js +274 -0
  89. package/lib/diagnostics.d.ts +169 -0
  90. package/lib/diagnostics.d.ts.map +1 -0
  91. package/lib/diagnostics.js +136 -0
  92. package/lib/discovery-contracts.d.ts +14 -0
  93. package/lib/discovery-contracts.d.ts.map +1 -0
  94. package/lib/discovery-contracts.js +90 -0
  95. package/lib/discovery-describe.d.ts +35 -0
  96. package/lib/discovery-describe.d.ts.map +1 -0
  97. package/lib/discovery-describe.js +99 -0
  98. package/lib/embedding-index.d.ts +55 -0
  99. package/lib/embedding-index.d.ts.map +1 -0
  100. package/lib/embedding-index.js +126 -0
  101. package/lib/extension-dependencies.d.ts +355 -0
  102. package/lib/extension-dependencies.d.ts.map +1 -0
  103. package/lib/extension-dependencies.js +987 -0
  104. package/lib/extension-dispatch.d.ts +150 -0
  105. package/lib/extension-dispatch.d.ts.map +1 -0
  106. package/lib/extension-dispatch.js +178 -0
  107. package/lib/extension-page-state.d.ts +69 -0
  108. package/lib/extension-page-state.d.ts.map +1 -0
  109. package/lib/extension-page-state.js +82 -0
  110. package/lib/extension-registrar.d.ts +116 -0
  111. package/lib/extension-registrar.d.ts.map +1 -0
  112. package/lib/extension-registrar.js +144 -0
  113. package/lib/extensions-api.d.ts +346 -0
  114. package/lib/extensions-api.d.ts.map +1 -0
  115. package/lib/extensions-api.js +17 -0
  116. package/lib/extensions-remote.d.ts +57 -0
  117. package/lib/extensions-remote.d.ts.map +1 -0
  118. package/lib/extensions-remote.js +69 -0
  119. package/lib/extensions-service.d.ts +568 -0
  120. package/lib/extensions-service.d.ts.map +1 -0
  121. package/lib/extensions-service.js +2507 -0
  122. package/lib/harness-budgets.d.ts +158 -0
  123. package/lib/harness-budgets.d.ts.map +1 -0
  124. package/lib/harness-budgets.js +152 -0
  125. package/lib/harness-llm.d.ts +138 -0
  126. package/lib/harness-llm.d.ts.map +1 -0
  127. package/lib/harness-llm.js +218 -0
  128. package/lib/harness-serving.d.ts +115 -0
  129. package/lib/harness-serving.d.ts.map +1 -0
  130. package/lib/harness-serving.js +176 -0
  131. package/lib/headless.d.ts +97 -0
  132. package/lib/headless.d.ts.map +1 -0
  133. package/lib/headless.js +407 -0
  134. package/lib/http-acquisition.d.ts +27 -0
  135. package/lib/http-acquisition.d.ts.map +1 -0
  136. package/lib/http-acquisition.js +140 -0
  137. package/lib/index.d.ts +546 -0
  138. package/lib/index.d.ts.map +1 -0
  139. package/lib/index.js +5197 -0
  140. package/lib/invocation-accounting.d.ts +169 -0
  141. package/lib/invocation-accounting.d.ts.map +1 -0
  142. package/lib/invocation-accounting.js +148 -0
  143. package/lib/jev.d.ts +218 -0
  144. package/lib/jev.d.ts.map +1 -0
  145. package/lib/jev.js +366 -0
  146. package/lib/legacy-migration.d.ts +95 -0
  147. package/lib/legacy-migration.d.ts.map +1 -0
  148. package/lib/legacy-migration.js +429 -0
  149. package/lib/license-basis.d.ts +29 -0
  150. package/lib/license-basis.d.ts.map +1 -0
  151. package/lib/license-basis.js +58 -0
  152. package/lib/managed-workers.d.ts +158 -0
  153. package/lib/managed-workers.d.ts.map +1 -0
  154. package/lib/managed-workers.js +269 -0
  155. package/lib/mcp/auth-selection.d.ts +35 -0
  156. package/lib/mcp/auth-selection.d.ts.map +1 -0
  157. package/lib/mcp/auth-selection.js +64 -0
  158. package/lib/mcp/client-grant.d.ts +89 -0
  159. package/lib/mcp/client-grant.d.ts.map +1 -0
  160. package/lib/mcp/client-grant.js +63 -0
  161. package/lib/mcp/credential-cli.d.ts +38 -0
  162. package/lib/mcp/credential-cli.d.ts.map +1 -0
  163. package/lib/mcp/credential-cli.js +148 -0
  164. package/lib/mcp/credential-store.d.ts +143 -0
  165. package/lib/mcp/credential-store.d.ts.map +1 -0
  166. package/lib/mcp/credential-store.js +461 -0
  167. package/lib/mcp/export-policy.d.ts +25 -0
  168. package/lib/mcp/export-policy.d.ts.map +1 -0
  169. package/lib/mcp/export-policy.js +31 -0
  170. package/lib/mcp/host-binding.d.ts +144 -0
  171. package/lib/mcp/host-binding.d.ts.map +1 -0
  172. package/lib/mcp/host-binding.js +280 -0
  173. package/lib/mcp/http.d.ts +180 -0
  174. package/lib/mcp/http.d.ts.map +1 -0
  175. package/lib/mcp/http.js +602 -0
  176. package/lib/mcp/oauth.d.ts +149 -0
  177. package/lib/mcp/oauth.d.ts.map +1 -0
  178. package/lib/mcp/oauth.js +396 -0
  179. package/lib/mcp/protocol.d.ts +329 -0
  180. package/lib/mcp/protocol.d.ts.map +1 -0
  181. package/lib/mcp/protocol.js +459 -0
  182. package/lib/mcp/rate-limit.d.ts +68 -0
  183. package/lib/mcp/rate-limit.d.ts.map +1 -0
  184. package/lib/mcp/rate-limit.js +114 -0
  185. package/lib/mcp/sdk-v2.d.ts +17 -0
  186. package/lib/mcp/sdk-v2.d.ts.map +1 -0
  187. package/lib/mcp/sdk-v2.js +204 -0
  188. package/lib/mcp/server.d.ts +149 -0
  189. package/lib/mcp/server.d.ts.map +1 -0
  190. package/lib/mcp/server.js +302 -0
  191. package/lib/mcp/stdio.d.ts +80 -0
  192. package/lib/mcp/stdio.d.ts.map +1 -0
  193. package/lib/mcp/stdio.js +184 -0
  194. package/lib/mcp/subscriptions.d.ts +177 -0
  195. package/lib/mcp/subscriptions.d.ts.map +1 -0
  196. package/lib/mcp/subscriptions.js +288 -0
  197. package/lib/mcp-status.d.ts +96 -0
  198. package/lib/mcp-status.d.ts.map +1 -0
  199. package/lib/mcp-status.js +70 -0
  200. package/lib/mcp-usage.d.ts +110 -0
  201. package/lib/mcp-usage.d.ts.map +1 -0
  202. package/lib/mcp-usage.js +189 -0
  203. package/lib/model-qualification.d.ts +192 -0
  204. package/lib/model-qualification.d.ts.map +1 -0
  205. package/lib/model-qualification.js +178 -0
  206. package/lib/planning.d.ts +256 -0
  207. package/lib/planning.d.ts.map +1 -0
  208. package/lib/planning.js +471 -0
  209. package/lib/playbook.d.ts +42 -0
  210. package/lib/playbook.d.ts.map +1 -0
  211. package/lib/playbook.js +65 -0
  212. package/lib/prepared-assets.d.ts +269 -0
  213. package/lib/prepared-assets.d.ts.map +1 -0
  214. package/lib/prepared-assets.js +471 -0
  215. package/lib/provider-bridge.d.ts +107 -0
  216. package/lib/provider-bridge.d.ts.map +1 -0
  217. package/lib/provider-bridge.js +423 -0
  218. package/lib/ptc-authority.d.ts +154 -0
  219. package/lib/ptc-authority.d.ts.map +1 -0
  220. package/lib/ptc-authority.js +242 -0
  221. package/lib/ptc-confinement.d.ts +60 -0
  222. package/lib/ptc-confinement.d.ts.map +1 -0
  223. package/lib/ptc-confinement.js +212 -0
  224. package/lib/ptc-runtime.d.ts +166 -0
  225. package/lib/ptc-runtime.d.ts.map +1 -0
  226. package/lib/ptc-runtime.js +231 -0
  227. package/lib/publication.d.ts +161 -0
  228. package/lib/publication.d.ts.map +1 -0
  229. package/lib/publication.js +181 -0
  230. package/lib/receipt-store.d.ts +57 -0
  231. package/lib/receipt-store.d.ts.map +1 -0
  232. package/lib/receipt-store.js +143 -0
  233. package/lib/receipt.d.ts +231 -0
  234. package/lib/receipt.d.ts.map +1 -0
  235. package/lib/receipt.js +165 -0
  236. package/lib/registrar.d.ts +75 -0
  237. package/lib/registrar.d.ts.map +1 -0
  238. package/lib/registrar.js +152 -0
  239. package/lib/resource-governance.d.ts +204 -0
  240. package/lib/resource-governance.d.ts.map +1 -0
  241. package/lib/resource-governance.js +213 -0
  242. package/lib/server-lifecycle.d.ts +175 -0
  243. package/lib/server-lifecycle.d.ts.map +1 -0
  244. package/lib/server-lifecycle.js +269 -0
  245. package/lib/skills.d.ts +31 -0
  246. package/lib/skills.d.ts.map +1 -0
  247. package/lib/skills.js +170 -0
  248. package/lib/speech-bridge.d.ts +74 -0
  249. package/lib/speech-bridge.d.ts.map +1 -0
  250. package/lib/speech-bridge.js +115 -0
  251. package/lib/state.d.ts +100 -0
  252. package/lib/state.d.ts.map +1 -0
  253. package/lib/state.js +160 -0
  254. package/lib/title-proposal.d.ts +194 -0
  255. package/lib/title-proposal.d.ts.map +1 -0
  256. package/lib/title-proposal.js +244 -0
  257. package/lib/tool-inventory.d.ts +90 -0
  258. package/lib/tool-inventory.d.ts.map +1 -0
  259. package/lib/tool-inventory.js +102 -0
  260. package/lib/tool-mode-run.d.ts +310 -0
  261. package/lib/tool-mode-run.d.ts.map +1 -0
  262. package/lib/tool-mode-run.js +411 -0
  263. package/lib/tool-sources.d.ts +80 -0
  264. package/lib/tool-sources.d.ts.map +1 -0
  265. package/lib/tool-sources.js +123 -0
  266. package/lib/tool-usage-projection.d.ts +390 -0
  267. package/lib/tool-usage-projection.d.ts.map +1 -0
  268. package/lib/tool-usage-projection.js +1038 -0
  269. package/lib/tool-usage-report.d.ts +153 -0
  270. package/lib/tool-usage-report.d.ts.map +1 -0
  271. package/lib/tool-usage-report.js +274 -0
  272. package/lib/transport.d.ts +158 -0
  273. package/lib/transport.d.ts.map +1 -0
  274. package/lib/transport.js +332 -0
  275. package/lib/types.d.ts +134 -0
  276. package/lib/types.d.ts.map +1 -0
  277. package/lib/types.js +8 -0
  278. package/lib/update-surface.d.ts +79 -0
  279. package/lib/update-surface.d.ts.map +1 -0
  280. package/lib/update-surface.js +224 -0
  281. package/lib/version.d.ts +3 -0
  282. package/lib/version.d.ts.map +1 -0
  283. package/lib/version.js +27 -0
  284. package/node_modules/@try-works/tool-mode-contracts/lib/contract-metadata.d.ts +13 -0
  285. package/node_modules/@try-works/tool-mode-contracts/lib/contract-metadata.d.ts.map +1 -0
  286. package/node_modules/@try-works/tool-mode-contracts/lib/contract-metadata.js +85 -0
  287. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/lang-detect.d.ts +16 -0
  288. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/lang-detect.d.ts.map +1 -0
  289. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/lang-detect.js +87 -0
  290. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.d.ts +38 -0
  291. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.d.ts.map +1 -0
  292. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.js +445 -0
  293. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/stt-transcribe.d.ts +20 -0
  294. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/stt-transcribe.d.ts.map +1 -0
  295. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/stt-transcribe.js +112 -0
  296. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.d.ts +14 -0
  297. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.d.ts.map +1 -0
  298. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.js +63 -0
  299. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.d.ts +14 -0
  300. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.d.ts.map +1 -0
  301. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.js +76 -0
  302. package/node_modules/@try-works/tool-mode-contracts/lib/dsh.d.ts +82 -0
  303. package/node_modules/@try-works/tool-mode-contracts/lib/dsh.d.ts.map +1 -0
  304. package/node_modules/@try-works/tool-mode-contracts/lib/dsh.js +274 -0
  305. package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts +26 -0
  306. package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts.map +1 -0
  307. package/node_modules/@try-works/tool-mode-contracts/lib/index.js +53 -0
  308. package/node_modules/@try-works/tool-mode-contracts/lib/meta.d.ts +133 -0
  309. package/node_modules/@try-works/tool-mode-contracts/lib/meta.d.ts.map +1 -0
  310. package/node_modules/@try-works/tool-mode-contracts/lib/meta.js +64 -0
  311. package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts +121 -0
  312. package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts.map +1 -0
  313. package/node_modules/@try-works/tool-mode-contracts/lib/registry.js +246 -0
  314. package/node_modules/@try-works/tool-mode-contracts/package.json +35 -0
  315. package/node_modules/@try-works/tool-mode-extension-sdk/bin/dsh-tool-mode.mjs +20 -0
  316. package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.d.ts +80 -0
  317. package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.d.ts.map +1 -0
  318. package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.js +533 -0
  319. package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.d.ts +86 -0
  320. package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.d.ts.map +1 -0
  321. package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.js +145 -0
  322. package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.d.ts +70 -0
  323. package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.d.ts.map +1 -0
  324. package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.js +201 -0
  325. package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.d.ts +57 -0
  326. package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.d.ts.map +1 -0
  327. package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.js +83 -0
  328. package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.d.ts +33 -0
  329. package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.d.ts.map +1 -0
  330. package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.js +33 -0
  331. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.d.ts +86 -0
  332. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.d.ts.map +1 -0
  333. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.js +191 -0
  334. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.d.ts +137 -0
  335. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.d.ts.map +1 -0
  336. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.js +349 -0
  337. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts +274 -0
  338. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts.map +1 -0
  339. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.js +932 -0
  340. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.d.ts +210 -0
  341. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.d.ts.map +1 -0
  342. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.js +368 -0
  343. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.d.ts +63 -0
  344. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.d.ts.map +1 -0
  345. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.js +149 -0
  346. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.d.ts +35 -0
  347. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.d.ts.map +1 -0
  348. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.js +179 -0
  349. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.d.ts +179 -0
  350. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.d.ts.map +1 -0
  351. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.js +299 -0
  352. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts +395 -0
  353. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts.map +1 -0
  354. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.js +839 -0
  355. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.d.ts +44 -0
  356. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.d.ts.map +1 -0
  357. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.js +255 -0
  358. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.d.ts +185 -0
  359. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.d.ts.map +1 -0
  360. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.js +504 -0
  361. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.d.ts +17 -0
  362. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.d.ts.map +1 -0
  363. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.js +80 -0
  364. package/node_modules/@try-works/tool-mode-extension-sdk/lib/licensing.d.ts +221 -0
  365. package/node_modules/@try-works/tool-mode-extension-sdk/lib/licensing.d.ts.map +1 -0
  366. package/node_modules/@try-works/tool-mode-extension-sdk/lib/licensing.js +188 -0
  367. package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.d.ts +52 -0
  368. package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.d.ts.map +1 -0
  369. package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.js +102 -0
  370. package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.d.ts +171 -0
  371. package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.d.ts.map +1 -0
  372. package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.js +271 -0
  373. package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.d.ts +242 -0
  374. package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.d.ts.map +1 -0
  375. package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.js +58 -0
  376. package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.d.ts +128 -0
  377. package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.d.ts.map +1 -0
  378. package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.js +113 -0
  379. package/node_modules/@try-works/tool-mode-extension-sdk/lib/test-host.d.ts +41 -0
  380. package/node_modules/@try-works/tool-mode-extension-sdk/lib/test-host.d.ts.map +1 -0
  381. package/node_modules/@try-works/tool-mode-extension-sdk/lib/test-host.js +52 -0
  382. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.d.ts +2 -0
  383. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.d.ts.map +1 -0
  384. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.js +351 -0
  385. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.d.ts +157 -0
  386. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.d.ts.map +1 -0
  387. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.js +688 -0
  388. package/node_modules/@try-works/tool-mode-extension-sdk/package.json +54 -0
  389. package/node_modules/@try-works/tool-mode-extension-sdk/schema/extension-manifest-1.1.0.schema.json +253 -0
  390. package/node_modules/@try-works/tool-mode-recipes/bin/tool-mode-recipe.mjs +15 -0
  391. package/node_modules/@try-works/tool-mode-recipes/lib/broker.d.ts +460 -0
  392. package/node_modules/@try-works/tool-mode-recipes/lib/broker.d.ts.map +1 -0
  393. package/node_modules/@try-works/tool-mode-recipes/lib/broker.js +647 -0
  394. package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts +61 -0
  395. package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts.map +1 -0
  396. package/node_modules/@try-works/tool-mode-recipes/lib/cli.js +1106 -0
  397. package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.d.ts +237 -0
  398. package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.d.ts.map +1 -0
  399. package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.js +205 -0
  400. package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.d.ts +85 -0
  401. package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.d.ts.map +1 -0
  402. package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.js +176 -0
  403. package/node_modules/@try-works/tool-mode-recipes/lib/images.d.ts +119 -0
  404. package/node_modules/@try-works/tool-mode-recipes/lib/images.d.ts.map +1 -0
  405. package/node_modules/@try-works/tool-mode-recipes/lib/images.js +201 -0
  406. package/node_modules/@try-works/tool-mode-recipes/lib/index.d.ts +25 -0
  407. package/node_modules/@try-works/tool-mode-recipes/lib/index.d.ts.map +1 -0
  408. package/node_modules/@try-works/tool-mode-recipes/lib/index.js +25 -0
  409. package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.d.ts +345 -0
  410. package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.d.ts.map +1 -0
  411. package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.js +1465 -0
  412. package/node_modules/@try-works/tool-mode-recipes/lib/templates.d.ts +51 -0
  413. package/node_modules/@try-works/tool-mode-recipes/lib/templates.d.ts.map +1 -0
  414. package/node_modules/@try-works/tool-mode-recipes/lib/templates.js +310 -0
  415. package/node_modules/@try-works/tool-mode-recipes/lib/titles.d.ts +231 -0
  416. package/node_modules/@try-works/tool-mode-recipes/lib/titles.d.ts.map +1 -0
  417. package/node_modules/@try-works/tool-mode-recipes/lib/titles.js +435 -0
  418. package/node_modules/@try-works/tool-mode-recipes/package.json +56 -0
  419. package/node_modules/@try-works/tool-mode-recipes/recipes/describe-image.json +38 -0
  420. package/node_modules/@try-works/tool-mode-recipes/recipes/text-title.json +45 -0
  421. package/node_modules/@try-works/tool-mode-recipes/schema/harness-model-recipe.schema.json +273 -0
  422. package/package.json +127 -4
  423. package/remote/spec.mjs +993 -0
  424. package/remote/typert.host.mjs +14 -0
  425. package/remote/typert.remote-client.mjs +16 -0
@@ -0,0 +1,349 @@
1
+ /**
2
+ * Installer-owned dependency graphs (EXT-09).
3
+ *
4
+ * An extension's runtime dependencies are resolved through the operator's
5
+ * registry EXACTLY ONCE (ranges lock to exact versions), fetched, verified
6
+ * against their registry-recorded SHA-512, and materialized into the
7
+ * extension's OWN immutable installation directory — never the host's
8
+ * node_modules, never the user's workspace. Lifecycle scripts are refused,
9
+ * never silently skipped or run: a dependency whose package declares
10
+ * `prepare`/`preinstall`/`install`/`postinstall` refuses the install with a
11
+ * named error. The resolved graph (name, exact version, integrity, requested
12
+ * spec) is recorded in the install record (EXT-12).
13
+ *
14
+ * The registry half is INJECTED, like the archive source: the SDK owns the
15
+ * graph discipline, the host supplies the configured registry and the tarball
16
+ * transport. An extension's runtime can only import what this installer
17
+ * materialized — undeclared resolution attempts fail at module load, because
18
+ * the runtime SDK link is the only bridge into the host tree.
19
+ *
20
+ * @module @try-works/tool-mode-extension-sdk/install/dependencies
21
+ */
22
+ import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync } from 'node:fs';
23
+ import { createHash } from 'node:crypto';
24
+ import { isAbsolute, join, relative, resolve, sep } from 'node:path';
25
+ import { ManagementError } from "./../errors.js";
26
+ import { verifyIntegrity } from "./archive.js";
27
+ /** The defaults for one preinstalled-content copy. */
28
+ const DEFAULT_PREINSTALLED_BYTES = 512 * 1024 * 1024;
29
+ const DEFAULT_PREINSTALLED_FILES = 10_000;
30
+ /** The install-time lifecycle scripts whose presence is a refusal, never a skip. */
31
+ const REFUSED_SCRIPTS = ['prepare', 'preinstall', 'install', 'postinstall'];
32
+ /** Packages that are compile-time- or browser-only and never loaded by the Node host. */
33
+ const NON_RUNTIME_PACKAGES = new Set([
34
+ 'onnxruntime-web',
35
+ ]);
36
+ /** Read a package.json's runtime dependencies as name→spec pairs. */
37
+ function declaredDependencies(packageDir, field = 'dependencies') {
38
+ let parsed;
39
+ try {
40
+ parsed = JSON.parse(readFileSync(join(packageDir, 'package.json'), 'utf8'));
41
+ }
42
+ catch (error) {
43
+ throw new ManagementError('INVALID_EXTENSION', 'install', `the package.json could not be read: ${error instanceof Error ? error.message : String(error)}`, 'The archive must ship a parseable package.json.');
44
+ }
45
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
46
+ throw new ManagementError('INVALID_EXTENSION', 'install', 'the package.json is not an object', 'Ship a valid package.json.');
47
+ }
48
+ const dependencies = parsed[field];
49
+ if (dependencies === undefined)
50
+ return {};
51
+ if (typeof dependencies !== 'object' || dependencies === null || Array.isArray(dependencies)) {
52
+ throw new ManagementError('INVALID_EXTENSION', 'install', 'the package.json dependencies field is not a name→version object', 'Declare runtime dependencies as a plain object of exact versions or ranges.');
53
+ }
54
+ const result = {};
55
+ for (const [name, spec] of Object.entries(dependencies)) {
56
+ /**
57
+ * `@types/*` packages are compile-time declarations: nothing imports them at
58
+ * runtime and they ship no executable code. Materializing them made a real
59
+ * install fail when two dependencies legitimately needed different type
60
+ * versions (`mediabunny` → 0.1.13, another package → 0.1.19), which npm
61
+ * resolves by nesting. Drop them from the runtime graph instead.
62
+ */
63
+ if (name.startsWith('@types/'))
64
+ continue;
65
+ /**
66
+ * `onnxruntime-web` is the browser backend of the transformers dependency.
67
+ * The Node host loads `onnxruntime-node`; materializing both made their
68
+ * `onnxruntime-common` versions conflict even though the web tree is never
69
+ * imported at runtime.
70
+ */
71
+ if (NON_RUNTIME_PACKAGES.has(name))
72
+ continue;
73
+ if (typeof spec !== 'string' || spec.length === 0) {
74
+ throw new ManagementError('INVALID_EXTENSION', 'install', `the dependency ${JSON.stringify(name)} declares a non-string spec`, 'Declare a version string for every runtime dependency.');
75
+ }
76
+ result[name] = spec;
77
+ }
78
+ return result;
79
+ }
80
+ /** Refuse a dependency whose package declares install-time lifecycle scripts. */
81
+ export function refuseInstallScripts(packageDir, name, version, trustedPrebuilt = []) {
82
+ if (trustedPrebuilt.includes(`${name}@${version}`))
83
+ return;
84
+ let parsed;
85
+ try {
86
+ parsed = JSON.parse(readFileSync(join(packageDir, 'package.json'), 'utf8'));
87
+ }
88
+ catch (error) {
89
+ throw new ManagementError('INVALID_EXTENSION', 'install', `the dependency ${name}@${version} ships an unparseable package.json: ${error instanceof Error ? error.message : String(error)}`, 'The dependency tarball must ship a parseable package.json.');
90
+ }
91
+ if (typeof parsed !== 'object' || parsed === null)
92
+ return;
93
+ const scripts = parsed['scripts'];
94
+ if (typeof scripts !== 'object' || scripts === null)
95
+ return;
96
+ for (const key of REFUSED_SCRIPTS) {
97
+ if (key in scripts) {
98
+ throw new ManagementError('DEPENDENCY_UNSATISFIED', 'install', `${name}@${version} declares a "${key}" lifecycle script; the installer never runs or silently skips install-time scripts (EXT-10)`, 'Publish a version of the dependency that needs no install-time script (prebuilt artifacts only), or pin a different version.');
99
+ }
100
+ }
101
+ }
102
+ /** The content digest of one materialized tree (the digestInstalledContent algorithm). */
103
+ function digestContentOf(directory) {
104
+ const hash = createHash('sha256');
105
+ const files = [];
106
+ const walk = (current) => {
107
+ for (const entry of readdirSync(current, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
108
+ const absolute = join(current, entry.name);
109
+ if (entry.isDirectory())
110
+ walk(absolute);
111
+ else if (entry.isFile())
112
+ files.push(absolute);
113
+ }
114
+ };
115
+ walk(directory);
116
+ for (const file of files.sort()) {
117
+ const name = relative(directory, file).split(sep).join('/');
118
+ if (name === '.tool-mode-install.json')
119
+ continue;
120
+ const bytes = readFileSync(file);
121
+ hash.update(name);
122
+ hash.update('\0');
123
+ hash.update(String(bytes.byteLength));
124
+ hash.update('\0');
125
+ hash.update(createHash('sha256').update(bytes).digest());
126
+ hash.update('\0');
127
+ }
128
+ return hash.digest('hex');
129
+ }
130
+ /**
131
+ * Copy one preinstalled directory tree into the extension's own install dir.
132
+ *
133
+ * A COPY, never a link: the operator's host tree stays untouched and the
134
+ * extension owns its bytes. Reparse points inside the tree are refused (the
135
+ * same junction defense the archive path gets), and the copy is bounded.
136
+ */
137
+ function copyPreinstalledTree(source, destination, limits) {
138
+ mkdirSync(destination, { recursive: true });
139
+ let files = 0;
140
+ let bytes = 0;
141
+ const walk = (from, to) => {
142
+ for (const entry of readdirSync(from, { withFileTypes: true })) {
143
+ const fromPath = join(from, entry.name);
144
+ const toPath = join(to, entry.name);
145
+ if (entry.isSymbolicLink() || (entry.isFile() === false && entry.isDirectory() === false)) {
146
+ throw new ManagementError('DEPENDENCY_UNSATISFIED', 'install', `${fromPath} is a reparse point; preinstalled content must not smuggle links into the installation`, 'Point at a real directory tree, or resolve the dependency from registry bytes.');
147
+ }
148
+ if (entry.isDirectory()) {
149
+ // The parent directory for this subtree must EXIST before any nested
150
+ // file is copied into it: copyFileSync does not create parents, and on
151
+ // Windows a missing parent raises ENOENT on the destination side
152
+ // (task-88: the live MiniLM install failed copying dist/… before this).
153
+ mkdirSync(toPath, { recursive: true });
154
+ walk(fromPath, toPath);
155
+ continue;
156
+ }
157
+ files += 1;
158
+ bytes += statSync(fromPath).size;
159
+ if (files > limits.files || bytes > limits.bytes) {
160
+ throw new ManagementError('DEPENDENCY_UNSATISFIED', 'install', `the preinstalled content exceeds the copy bounds (${limits.files} files / ${limits.bytes} bytes)`, 'Raise the operator bounds deliberately, or resolve the dependency from registry bytes.');
161
+ }
162
+ copyFileSync(fromPath, toPath);
163
+ }
164
+ };
165
+ walk(source, destination);
166
+ }
167
+ /**
168
+ * Resolve, fetch, verify and materialize one extension's dependency graph.
169
+ *
170
+ * Bounded BFS: ranges resolve exactly once, registry tarballs verify against
171
+ * their registry integrity, scripts are refused on the registry arm, and the
172
+ * graph is flattened into the extension's own `node_modules` (a private root —
173
+ * no hoisting into any other tree). Version conflicts within one graph are
174
+ * REFUSED rather than silently duplicated; the count and depth caps refuse
175
+ * runaway graphs by name.
176
+ *
177
+ * The PREINSTALLED arm is operator-gated: only when `allowPreinstalled` is set
178
+ * does a resolver-supplied directory get copied (bounded, path-escape-checked
179
+ * against `preinstalledRoot`, reparse-point-refused) into the extension's own
180
+ * tree, with the record's provenance stating that the installer ran no
181
+ * lifecycle script on it.
182
+ *
183
+ * @param packageDir - the extracted extension package directory.
184
+ * @param graph - the injected resolver/archive plus the bounds and the gate.
185
+ * @returns the locked dependency records, in materialization order.
186
+ */
187
+ export async function installDependencyGraph(packageDir, graph) {
188
+ const maxDepth = graph.maxDepth ?? 3;
189
+ const maxPackages = graph.maxPackages ?? 64;
190
+ const declared = declaredDependencies(packageDir);
191
+ if (Object.keys(declared).length === 0)
192
+ return [];
193
+ const nodeModules = join(packageDir, 'node_modules');
194
+ const locked = [];
195
+ const visited = new Set();
196
+ const hoisted = new Map(); // name -> exact version already materialized
197
+ const queue = Object.entries(declared)
198
+ .map(([name, range]) => ({ name, range, depth: 0, optional: false }));
199
+ while (queue.length > 0) {
200
+ const entry = queue.shift();
201
+ if (visited.has(`${entry.name}@${entry.range}`))
202
+ continue;
203
+ visited.add(`${entry.name}@${entry.range}`);
204
+ if (entry.depth > maxDepth) {
205
+ // An OPTIONAL child that sits too deep is skipped, not refused: optional
206
+ // means the package must still work without it (sharp's platform binaries
207
+ // are optional at every depth). A required child still refuses by name.
208
+ if (entry.optional)
209
+ continue;
210
+ throw new ManagementError('DEPENDENCY_UNSATISFIED', 'install', `the dependency graph exceeds the ${maxDepth}-level depth bound at ${entry.name}`, 'Flatten the dependency tree or raise the operator bound deliberately.');
211
+ }
212
+ if (locked.length >= maxPackages && !hoisted.has(entry.name)) {
213
+ if (entry.optional)
214
+ continue;
215
+ throw new ManagementError('DEPENDENCY_UNSATISFIED', 'install', `the dependency graph exceeds the ${maxPackages}-package bound`, 'Reduce the graph or raise the operator bound deliberately.');
216
+ }
217
+ let resolvedEntry;
218
+ try {
219
+ resolvedEntry = await graph.resolver.resolve(entry.name, entry.range);
220
+ }
221
+ catch (error) {
222
+ // An unresolvable OPTIONAL dependency is recorded as absent by omission and
223
+ // the install continues; only a REQUIRED dependency refuses the graph.
224
+ if (entry.optional)
225
+ continue;
226
+ throw error;
227
+ }
228
+ const existing = hoisted.get(resolvedEntry.name);
229
+ if (existing !== undefined && existing !== resolvedEntry.version) {
230
+ throw new ManagementError('DEPENDENCY_UNSATISFIED', 'install', `the dependency graph needs both ${resolvedEntry.name}@${existing} and ${resolvedEntry.name}@${resolvedEntry.version}; `
231
+ + 'conflicting versions inside one extension are refused rather than silently duplicated', 'Pin the two requesters to one version, or publish a compatible version.');
232
+ }
233
+ if (existing !== undefined) {
234
+ // Already materialized at the same exact version: nothing more to fetch.
235
+ const transitive = declaredDependencies(join(nodeModules, resolvedEntry.name));
236
+ for (const [childName, childRange] of Object.entries(transitive)) {
237
+ if (!visited.has(`${childName}@${childRange}`))
238
+ queue.push({ name: childName, range: childRange, depth: entry.depth + 1, optional: false });
239
+ }
240
+ for (const [childName, childRange] of Object.entries(declaredDependencies(join(nodeModules, resolvedEntry.name), 'optionalDependencies'))) {
241
+ if (!visited.has(`${childName}@${childRange}`))
242
+ queue.push({ name: childName, range: childRange, depth: entry.depth + 1, optional: true });
243
+ }
244
+ continue;
245
+ }
246
+ if (resolvedEntry.provenance === 'preinstalled') {
247
+ // The preinstalled arm: operator-gated, boundary-checked, copied (never
248
+ // linked), digested from the copied bytes, and recorded truthfully.
249
+ if (graph.allowPreinstalled !== true) {
250
+ throw new ManagementError('DEPENDENCY_UNSATISFIED', 'install', `${resolvedEntry.name}@${resolvedEntry.version} resolved to preinstalled content, but the preinstalled source is not enabled by the operator (allowPreinstalled)`, 'Enable the preinstalled source deliberately for this install, or resolve the dependency from registry bytes.');
251
+ }
252
+ if (graph.preinstalledRoot === undefined) {
253
+ throw new ManagementError('DEPENDENCY_UNSATISFIED', 'install', 'preinstalled content requires an operator-configured preinstalledRoot so the source boundary can be enforced', 'Set preinstalledRoot to the directory that holds the host-tree packages.');
254
+ }
255
+ const root = resolve(graph.preinstalledRoot);
256
+ const dir = resolve(resolvedEntry.dir);
257
+ const rel = relative(root, dir);
258
+ if (rel === '' || rel.startsWith('..') || isAbsolute(rel) || !existsSync(dir)) {
259
+ throw new ManagementError('DEPENDENCY_UNSATISFIED', 'install', `the preinstalled directory ${dir} is outside the operator-configured root ${root} (path-escape refused)`, 'Only preinstalled directories inside preinstalledRoot may be copied.');
260
+ }
261
+ // Honesty check: the content must BE the package the resolver claims.
262
+ let dirPackage;
263
+ try {
264
+ const parsed = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'));
265
+ dirPackage = parsed;
266
+ }
267
+ catch (error) {
268
+ throw new ManagementError('DEPENDENCY_UNSATISFIED', 'install', `the preinstalled content at ${dir} ships an unreadable package.json: ${error instanceof Error ? error.message : String(error)}`, 'Preinstalled content must ship a parseable package.json.');
269
+ }
270
+ if (dirPackage.name !== resolvedEntry.name || dirPackage.version !== resolvedEntry.version) {
271
+ throw new ManagementError('DEPENDENCY_UNSATISFIED', 'install', `the preinstalled content at ${dir} is ${String(dirPackage.name)}@${String(dirPackage.version)}, not the resolved ${resolvedEntry.name}@${resolvedEntry.version}`, 'Point at the directory that actually holds the resolved package.');
272
+ }
273
+ const attempt = join(nodeModules, `.dep-${process.pid}-${Date.now().toString(36)}`);
274
+ mkdirSync(attempt, { recursive: true });
275
+ try {
276
+ // The scripts field is left UNTOUCHED and NO lifecycle script is run:
277
+ // the content arrived already materialized by a completed host install,
278
+ // and provenance:'preinstalled' records exactly that.
279
+ copyPreinstalledTree(dir, attempt, {
280
+ files: graph.maxPreinstalledFiles ?? DEFAULT_PREINSTALLED_FILES,
281
+ bytes: graph.maxPreinstalledBytes ?? DEFAULT_PREINSTALLED_BYTES,
282
+ });
283
+ const digest = digestContentOf(attempt);
284
+ const destination = join(nodeModules, resolvedEntry.name);
285
+ mkdirSync(join(destination, '..'), { recursive: true });
286
+ renameSync(attempt, destination);
287
+ hoisted.set(resolvedEntry.name, resolvedEntry.version);
288
+ locked.push({
289
+ name: resolvedEntry.name,
290
+ version: resolvedEntry.version,
291
+ integrity: digest,
292
+ resolvedFrom: entry.range,
293
+ provenance: 'preinstalled',
294
+ preinstalledFrom: resolvedEntry.dir,
295
+ });
296
+ const transitive = declaredDependencies(destination);
297
+ for (const [childName, childRange] of Object.entries(transitive)) {
298
+ if (!visited.has(`${childName}@${childRange}`))
299
+ queue.push({ name: childName, range: childRange, depth: entry.depth + 1, optional: false });
300
+ }
301
+ for (const [childName, childRange] of Object.entries(declaredDependencies(destination, 'optionalDependencies'))) {
302
+ if (!visited.has(`${childName}@${childRange}`))
303
+ queue.push({ name: childName, range: childRange, depth: entry.depth + 1, optional: true });
304
+ }
305
+ }
306
+ finally {
307
+ rmSync(attempt, { recursive: true, force: true });
308
+ }
309
+ continue;
310
+ }
311
+ const bytes = await graph.archive.fetch(resolvedEntry.tarball, {
312
+ maxBytes: 256 * 1024 * 1024,
313
+ timeoutMs: 120_000,
314
+ });
315
+ const digest = verifyIntegrity(bytes, resolvedEntry.integrity);
316
+ const attempt = join(nodeModules, `.dep-${process.pid}-${Date.now().toString(36)}`);
317
+ mkdirSync(attempt, { recursive: true });
318
+ try {
319
+ // The archive source strips the package root itself (the same contract
320
+ // stagedInstall relies on), so the extracted content IS the package.
321
+ graph.archive.extract(bytes, attempt, '');
322
+ refuseInstallScripts(attempt, resolvedEntry.name, resolvedEntry.version, graph.trustedPrebuiltDependencies);
323
+ const destination = join(nodeModules, resolvedEntry.name);
324
+ mkdirSync(join(destination, '..'), { recursive: true });
325
+ renameSync(attempt, destination);
326
+ hoisted.set(resolvedEntry.name, resolvedEntry.version);
327
+ locked.push({
328
+ name: resolvedEntry.name,
329
+ version: resolvedEntry.version,
330
+ integrity: digest,
331
+ resolvedFrom: entry.range,
332
+ });
333
+ const transitive = declaredDependencies(destination);
334
+ for (const [childName, childRange] of Object.entries(transitive)) {
335
+ if (!visited.has(`${childName}@${childRange}`))
336
+ queue.push({ name: childName, range: childRange, depth: entry.depth + 1, optional: false });
337
+ }
338
+ for (const [childName, childRange] of Object.entries(declaredDependencies(destination, 'optionalDependencies'))) {
339
+ if (!visited.has(`${childName}@${childRange}`))
340
+ queue.push({ name: childName, range: childRange, depth: entry.depth + 1, optional: true });
341
+ }
342
+ }
343
+ finally {
344
+ rmSync(attempt, { recursive: true, force: true });
345
+ }
346
+ }
347
+ return locked;
348
+ }
349
+ //# sourceMappingURL=dependencies.js.map
@@ -0,0 +1,274 @@
1
+ /**
2
+ * Activation and deactivation (EXT-04, EXT-26, EXT-27, EXT-28).
3
+ *
4
+ * The two orderings this module exists to enforce:
5
+ *
6
+ * - **Activate commits last.** Contributions are published to a candidate set,
7
+ * and the catalog generation advances only once EVERY required contribution has
8
+ * been accepted. A half-activated package is worse than an inactive one,
9
+ * because tools would appear that nothing can serve.
10
+ * - **Deactivate persists intent first.** The inactive preference is made durable
11
+ * BEFORE anything is withdrawn. If withdrawal then fails or the process dies,
12
+ * the durable answer is still "inactive", so a restart cannot resurrect a
13
+ * package the operator switched off.
14
+ *
15
+ * Rollback is deliberately NARROW: a failed activation withdraws only the handles
16
+ * it published itself. Touching another extension's contributions would turn one
17
+ * bad package into an outage of every package.
18
+ *
19
+ * @module @try-works/tool-mode-extension-sdk/install/lifecycle
20
+ */
21
+ import { ExtensionStore } from './store.ts';
22
+ import { summarize, type ExtensionState, type ModelReadiness } from './../state.ts';
23
+ /** One contribution a registrar can publish. */
24
+ export interface Contribution {
25
+ /** The extension that owns it. */
26
+ readonly extensionId: string;
27
+ /** What kind of contribution it is. */
28
+ readonly kind: 'tool' | 'skill' | 'implementation';
29
+ /** The caller-facing name for a tool or skill; the local id otherwise. */
30
+ readonly name: string;
31
+ /** The contract this contribution implements, for tools and implementations. */
32
+ readonly contractId?: string;
33
+ }
34
+ /** What can publish and withdraw contributions. Injected, so the SDK stays host-free. */
35
+ export interface ContributionRegistrar {
36
+ /**
37
+ * Publish one contribution.
38
+ * @param contribution - what to publish.
39
+ * @returns an opaque handle used to withdraw it.
40
+ */
41
+ publish(contribution: Contribution): Promise<string> | string;
42
+ /**
43
+ * Withdraw a published contribution.
44
+ * @param handle - the handle returned by {@link ContributionRegistrar.publish}.
45
+ */
46
+ withdraw(handle: string): Promise<void> | void;
47
+ }
48
+ /** A diagnostic about an activation that succeeded with caveats. */
49
+ export interface ActivationDiagnostic {
50
+ /** Stable code, e.g. `needs-preparation`. */
51
+ readonly code: 'needs-preparation' | 'not-registerable';
52
+ /** Human-readable detail. */
53
+ readonly message: string;
54
+ /** The contribution or deployment the diagnostic concerns. */
55
+ readonly subject?: string;
56
+ }
57
+ /** Options for an activation attempt. */
58
+ export interface ActivationOptions {
59
+ /**
60
+ * Whether a failed attempt records its cause in `activationError`.
61
+ *
62
+ * The prepare probe deliberately performs the operator's failed activation to
63
+ * create a profile row. Its publish refusal is an artifact of the probe host,
64
+ * not an operator-facing cause, so it must not overwrite the durable reason.
65
+ */
66
+ readonly recordFailure?: boolean;
67
+ }
68
+ /** The outcome of an activation. */
69
+ export interface ActivationResult {
70
+ readonly extensionId: string;
71
+ readonly version: string;
72
+ /** The state as observed after the attempt. */
73
+ readonly state: ExtensionState;
74
+ /** Caveats that do not block activation (EXT-26). */
75
+ readonly diagnostics: readonly ActivationDiagnostic[];
76
+ /** The catalog generation after the attempt; unchanged when it failed. */
77
+ readonly generation: number;
78
+ }
79
+ /** The outcome of a deactivation. */
80
+ export interface DeactivationResult {
81
+ readonly extensionId: string;
82
+ readonly state: ExtensionState;
83
+ /**
84
+ * True only when every contribution was withdrawn AND every owned resource
85
+ * reported stopped. EXT-27 forbids reporting a package as fully stopped while
86
+ * an uncontrolled worker continues.
87
+ */
88
+ readonly fullyStopped: boolean;
89
+ /** Why it is not fully stopped, when it is not. */
90
+ readonly cleanupFailure?: string;
91
+ /**
92
+ * The onWithdrawal hook's own failure, when it threw or rejected. The hook is
93
+ * a TEARDOWN observer: its error is surfaced here, never thrown — the
94
+ * deactivation's state write has already committed and must not be lost to a
95
+ * disposal callback that failed.
96
+ */
97
+ readonly hookFailure?: string;
98
+ readonly generation: number;
99
+ }
100
+ /**
101
+ * A teardown observer, invoked exactly once per withdrawn extension.
102
+ *
103
+ * `onWithdrawal` runs AFTER the lifecycle has finished withdrawing the
104
+ * extension's contribution handles and BEFORE the deactivation's final state
105
+ * write settles. A host uses it to dispose out-of-process resources (managed
106
+ * workers, native handles) at the one moment where the durable answer is
107
+ * already "inactive" and the registry surface is gone.
108
+ */
109
+ export type OnWithdrawal = (extensionId: string) => void | Promise<void>;
110
+ /** Default grace period for a contribution to finish stopping, in milliseconds. */
111
+ export declare const DEFAULT_STOP_GRACE_MS = 5000;
112
+ /**
113
+ * Whether an extension's readiness should block activation.
114
+ *
115
+ * EXT-26 is explicit that a valid package with merely UNPREPARED model assets may
116
+ * be active with `needs-preparation` diagnostics: the tools exist and can be
117
+ * described, and preparation happens on first use. A FAILED model is different —
118
+ * it will not become ready by waiting.
119
+ * @param readiness - per-deployment readiness.
120
+ * @returns diagnostics, and whether activation may proceed.
121
+ */
122
+ export declare function assessReadiness(readiness: Readonly<Record<string, ModelReadiness>>): {
123
+ readonly proceed: boolean;
124
+ readonly diagnostics: readonly ActivationDiagnostic[];
125
+ };
126
+ /** One lifecycle operation outcome (EXT-35), emitted apart from invocation receipts. */
127
+ export interface LifecycleAuditEvent {
128
+ /** What was attempted. */
129
+ readonly operation: 'install' | 'prepare' | 'activate' | 'deactivate' | 'update' | 'uninstall';
130
+ /** The extension concerned. */
131
+ readonly extensionId: string;
132
+ /** The version, when the operation concerned one. */
133
+ readonly version: string | null;
134
+ /** Whether it succeeded. */
135
+ readonly outcome: 'succeeded' | 'failed';
136
+ /** The failure reason, when it failed. */
137
+ readonly reason?: string;
138
+ }
139
+ /** The extension lifecycle for one profile. */
140
+ export declare class ExtensionLifecycle {
141
+ #private;
142
+ constructor(options: {
143
+ readonly store: ExtensionStore;
144
+ readonly profile: string;
145
+ readonly registrar: ContributionRegistrar;
146
+ /** Starting catalog generation; defaults to 1. */
147
+ readonly generation?: number;
148
+ /**
149
+ * A teardown observer for host-managed out-of-process resources, invoked
150
+ * once per withdrawn extension AFTER handle teardown and BEFORE the final
151
+ * deactivation state write settles (see {@link OnWithdrawal}).
152
+ */
153
+ readonly onWithdrawal?: OnWithdrawal;
154
+ /**
155
+ * Protected built-in extension ids from the HOST RELEASE's trusted lock (EXT-03).
156
+ * Never populated from a package manifest; an extension cannot grant itself this
157
+ * status. Protected ids refuse uninstall with `BUILTIN_PROTECTED`.
158
+ */
159
+ readonly protectedBuiltins?: readonly string[];
160
+ /**
161
+ * LIC-04: a strict no-network deployment admits only implementations whose
162
+ * DECLARED behaviour allows it. Ineligible extensions are refused at activation;
163
+ * their telemetry is never silently suppressed.
164
+ */
165
+ readonly networkPolicy?: 'any' | 'no-network';
166
+ /**
167
+ * EXT-35: receive lifecycle operation outcomes, separate from invocation
168
+ * receipts. The host decides retention/principal; the SDK only reports.
169
+ */
170
+ readonly onAudit?: (event: LifecycleAuditEvent) => void;
171
+ });
172
+ /** The current catalog generation. */
173
+ get generation(): number;
174
+ /** Read the persisted states for this profile. */
175
+ states(): readonly ExtensionState[];
176
+ /** Read one extension's persisted state. */
177
+ stateOf(extensionId: string): ExtensionState | undefined;
178
+ /**
179
+ * Activate an installed extension (EXT-26).
180
+ *
181
+ * Verifies the installed bytes and locks, checks readiness, publishes every
182
+ * required contribution, and advances the generation only if all of that
183
+ * succeeded. On any failure the contributions THIS call published are withdrawn
184
+ * and the generation is left where it was.
185
+ * @param extensionId - the extension to activate.
186
+ * @param version - the installed version to activate.
187
+ * @param options - failure-recording policy for probe activations.
188
+ * @returns the activation outcome.
189
+ * @throws ManagementError when the extension is not installed, its content changed, or a contribution cannot be registered.
190
+ */
191
+ activate(extensionId: string, version: string, options?: ActivationOptions): Promise<ActivationResult>;
192
+ /**
193
+ * Retry owned deletion left pending by a previous uninstall (EXT-29).
194
+ *
195
+ * An uninstall that could not delete its private installation keeps the record and
196
+ * leaves the installation absent in the profile state. On restart this finds only
197
+ * those records, deletes exactly the recorded path, and removes the record only
198
+ * after the deletion succeeds.
199
+ * @returns the cleaned ids and the failures with reasons.
200
+ */
201
+ retryCleanupPending(): Promise<{
202
+ readonly cleaned: readonly string[];
203
+ readonly failed: readonly {
204
+ readonly extensionId: string;
205
+ readonly reason: string;
206
+ }[];
207
+ }>;
208
+ /**
209
+ * Deactivate an extension (EXT-27).
210
+ *
211
+ * The inactive intent is made durable FIRST, so a failure or crash during
212
+ * withdrawal cannot resurrect the package on the next start.
213
+ * @param extensionId - the extension to deactivate.
214
+ * @returns the deactivation outcome, which reports honestly when it is not fully stopped.
215
+ */
216
+ deactivate(extensionId: string): Promise<DeactivationResult>;
217
+ /**
218
+ * Enable or disable ONE tool inside an active extension (EXT-04).
219
+ *
220
+ * Independent of activation: the package stays active while a single tool is
221
+ * hidden from callers.
222
+ *
223
+ * ASYNC because the toggle also reconciles the PUBLISHED surface: a disabled
224
+ * tool is withdrawn from the registrar rather than merely remembered as off,
225
+ * and a re-enabled one is published again. When this instance does not own the
226
+ * surface — a CLI with no host attached — only the durable choice is recorded,
227
+ * because it cannot manage a registry another process owns.
228
+ * @param extensionId - the owning extension.
229
+ * @param toolName - the tool to toggle.
230
+ * @param enabled - the new visibility.
231
+ * @throws ManagementError when the extension or tool is unknown.
232
+ * @returns the state after the change.
233
+ */
234
+ setToolEnabled(extensionId: string, toolName: string, enabled: boolean): Promise<ExtensionState>;
235
+ /**
236
+ * Whether a tool may be invoked right now.
237
+ * @param extensionId - the owning extension.
238
+ * @param toolName - the tool being invoked.
239
+ */
240
+ admits(extensionId: string, toolName: string): boolean;
241
+ /**
242
+ * Uninstall an installed extension (EXT-04, EXT-28).
243
+ * @param extensionId - the extension to remove.
244
+ * @param options - `deactivate` must be set to remove an active package.
245
+ * @throws ManagementError `EXTENSION_IN_USE`, `BUILTIN_PROTECTED`, or `EXTENSION_INACTIVE`.
246
+ */
247
+ uninstall(extensionId: string, options?: {
248
+ readonly deactivate?: boolean;
249
+ }): Promise<void>;
250
+ /**
251
+ * Record host-inspected readiness for an extension's declared deployments.
252
+ *
253
+ * This is the production writer `#readinessOf` reads: without it, every declared
254
+ * model stays `needs-preparation` forever and a model-backed package can never
255
+ * publish a callable tool. Inspection is the host's read-only EXT-18 surface, so
256
+ * recording it here is how "prepared" becomes a durable fact rather than a guess.
257
+ *
258
+ * Only values for deployments the CURRENT manifest declares are kept, matching the
259
+ * projection `#readinessOf` already applies, and `failed` is recorded so a failed
260
+ * deployment refuses activation instead of staying silent.
261
+ *
262
+ * ASYNC because a readiness CHANGE also moves the surface: a deployment that just
263
+ * became `failed` must have its tool withdrawn, and one that just became callable
264
+ * must be published. Recording without reconciling would leave the published
265
+ * snapshot stale, which is exactly the divergence admission exists to prevent.
266
+ * @param extensionId - the extension whose deployments were inspected.
267
+ * @param inspected - readiness keyed by deployment id.
268
+ * @returns the state after recording.
269
+ * @throws ManagementError when the extension is not installed.
270
+ */
271
+ recordReadiness(extensionId: string, inspected: Readonly<Record<string, ModelReadiness>>): Promise<ExtensionState>;
272
+ }
273
+ export { summarize };
274
+ //# sourceMappingURL=lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/install/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,EAAE,cAAc,EAAwC,MAAM,YAAY,CAAA;AACjF,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAA;AAUnF,gDAAgD;AAChD,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,gBAAgB,CAAA;IAClD,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,gFAAgF;IAChF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,yFAAyF;AACzF,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,OAAO,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAA;IAC7D;;;OAGG;IACH,QAAQ,CAAC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