@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,150 @@
1
+ /**
2
+ * Provider-backed dispatch for extension-declared tools (EXT-19, EXT-21, EXT-22, ARCH-05).
3
+ *
4
+ * The TMX runtime API has **no tool-invocation surface**. `ExtensionInstanceV1` exposes
5
+ * exactly `createProvider` and `dispose` — nothing else. So an extension's tool is not
6
+ * something the host calls directly; the tool is a caller-facing NAME whose contract is
7
+ * bound to an IMPLEMENTATION, and the implementation is a model PROVIDER.
8
+ *
9
+ * manifest.tools[] -> the caller-facing name and its contract
10
+ * manifest.implementations[] -> which contract, served by which model
11
+ * instance.createProvider() -> the thing that actually runs
12
+ *
13
+ * That chain is what this module walks. An earlier version of the host registrar
14
+ * registered a tool whose `execute` simply REFUSED, which was honest about there being no
15
+ * implementation bound but left the bridge functionally incomplete: the name appeared in
16
+ * the registry and could never be called.
17
+ *
18
+ * The context is INJECTED so the chain is testable without a real extension on disk.
19
+ *
20
+ * @module @try-works/dsh-tool-mode/extension-dispatch
21
+ */
22
+ import type { PreparedAssetMap } from './prepared-assets.ts';
23
+ /** What a manifest declares about one tool. */
24
+ export interface DeclaredTool {
25
+ readonly name: string;
26
+ readonly contractId: string;
27
+ readonly contractVersion: string;
28
+ }
29
+ /** What a manifest declares about one implementation. */
30
+ export interface DeclaredImplementation {
31
+ readonly id: string;
32
+ readonly contractId: string;
33
+ readonly contractVersion: string;
34
+ /** The model that serves the contract. */
35
+ readonly modelId: string;
36
+ }
37
+ /** The parts of a manifest this module needs. */
38
+ export interface DispatchManifest {
39
+ readonly tools: readonly DeclaredTool[];
40
+ readonly implementations: readonly DeclaredImplementation[];
41
+ }
42
+ /** A provider, narrowed to what dispatch needs. */
43
+ export interface DispatchProvider {
44
+ load(request: {
45
+ readonly assets: unknown;
46
+ readonly signal: AbortSignal;
47
+ /** The manifest model id; the managed worker's load keys by it. */
48
+ readonly modelId?: string;
49
+ }): Promise<void>;
50
+ invoke(request: {
51
+ readonly implementationId: string;
52
+ readonly input: Readonly<Record<string, unknown>>;
53
+ readonly context: unknown;
54
+ }): Promise<Record<string, unknown>>;
55
+ }
56
+ /** What dispatch needs from the host to reach an extension. */
57
+ export interface DispatchEnvironment {
58
+ /** The manifest of the activated extension that declared the tool. */
59
+ getManifest(): DispatchManifest;
60
+ /** Create (or return a cached) provider for a model deployment. */
61
+ providerFor(modelId: string): Promise<DispatchProvider>;
62
+ /** Build the invocation context, which carries host-issued identity. */
63
+ contextFor(implementationId: string, signal: AbortSignal): unknown;
64
+ /**
65
+ * The host's verified prepared-asset map for THIS extension, or undefined
66
+ * when nothing was prepared (the load then receives the EMPTY map — an
67
+ * extension needing assets refuses by name inside its own load, which is the
68
+ * honest MOD-02 behavior rather than an invented verification). Closes over
69
+ * the extension the environment was built for.
70
+ */
71
+ assetsFor?(): PreparedAssetMap | undefined;
72
+ }
73
+ /** Why a tool could not be dispatched. */
74
+ export interface DispatchFailure {
75
+ readonly code: 'not-declared' | 'no-implementation' | 'unsupported';
76
+ readonly message: string;
77
+ readonly remedy: string;
78
+ }
79
+ /**
80
+ * Resolve the implementation chain for a declared tool.
81
+ *
82
+ * @param manifest - the activated extension's manifest.
83
+ * @param toolName - the caller-facing name.
84
+ * @returns the tool, its implementation, or why the chain is incomplete.
85
+ */
86
+ export declare function resolveImplementation(manifest: DispatchManifest, toolName: string): {
87
+ readonly ok: true;
88
+ readonly tool: DeclaredTool;
89
+ readonly implementation: DeclaredImplementation;
90
+ } | {
91
+ readonly ok: false;
92
+ readonly failure: DispatchFailure;
93
+ };
94
+ /**
95
+ * Build an `execute` for one declared tool.
96
+ *
97
+ * The provider is created lazily on first call, so ACTIVATION stays lightweight as EXT-19
98
+ * requires: nothing is loaded until a caller actually invokes the tool.
99
+ *
100
+ * @param environment - how to reach the extension.
101
+ * @param toolName - the caller-facing name.
102
+ * @returns the execute function, or the failure that prevents one.
103
+ */
104
+ export declare function createDispatch(environment: DispatchEnvironment, toolName: string): Promise<{
105
+ readonly ok: true;
106
+ readonly execute: (args: Record<string, unknown>, signal: AbortSignal) => Promise<Record<string, unknown>>;
107
+ } | {
108
+ readonly ok: false;
109
+ readonly failure: DispatchFailure;
110
+ }>;
111
+ /**
112
+ * Resolve the implementation chain for a declared CONTRACT id (TASK-121).
113
+ *
114
+ * An extension whose manifest declares ONLY implementations (no `tools[]` —
115
+ * the MiniLM pair's shape) still serves a caller-facing standard tool: the
116
+ * contract id maps to the standard tool name the host knows, and this
117
+ * resolution finds the implementation by the contract id alone.
118
+ * @param manifest - the activated extension's manifest.
119
+ * @param contractId - the contract identity.
120
+ * @returns the implementation, or why the chain is incomplete.
121
+ */
122
+ export declare function resolveImplementationByContract(manifest: DispatchManifest, contractId: string): {
123
+ readonly ok: true;
124
+ readonly implementation: DeclaredImplementation;
125
+ } | {
126
+ readonly ok: false;
127
+ readonly failure: DispatchFailure;
128
+ };
129
+ /**
130
+ * Build an `execute` for a standard-named contract tool served by an
131
+ * IMPLEMENTATION-ONLY extension (TASK-121). The provider is created lazily on
132
+ * first call, exactly like the declared-tool path.
133
+ * @param environment - how to reach the extension.
134
+ * @param contractId - the contract identity to dispatch.
135
+ * @returns the execute function, or the failure that prevents one.
136
+ */
137
+ export declare function createDispatchForContract(environment: DispatchEnvironment, contractId: string): Promise<{
138
+ readonly ok: true;
139
+ readonly execute: (args: Record<string, unknown>, signal: AbortSignal) => Promise<Record<string, unknown>>;
140
+ } | {
141
+ readonly ok: false;
142
+ readonly failure: DispatchFailure;
143
+ }>;
144
+ /**
145
+ * Describe a dispatch failure for a caller (EXT-30).
146
+ * @param failure - the failure.
147
+ * @returns a readable message naming what to do.
148
+ */
149
+ export declare function describeDispatchFailure(failure: DispatchFailure): string;
150
+ //# sourceMappingURL=extension-dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension-dispatch.d.ts","sourceRoot":"","sources":["../src/extension-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE5D,+CAA+C;AAC/C,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;CACjC;AAED,yDAAyD;AACzD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;IACvC,QAAQ,CAAC,eAAe,EAAE,SAAS,sBAAsB,EAAE,CAAA;CAC5D;AAED,mDAAmD;AACnD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,OAAO,EAAE;QACZ,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;QACxB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;QAC5B,mEAAmE;QACnE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAC1B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACjB,MAAM,CAAC,OAAO,EAAE;QACd,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;QACjC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;QACjD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAC1B,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACrC;AAED,+DAA+D;AAC/D,MAAM,WAAW,mBAAmB;IAClC,sEAAsE;IACtE,WAAW,IAAI,gBAAgB,CAAA;IAC/B,mEAAmE;IACnE,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;IACvD,wEAAwE;IACxE,UAAU,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAA;IAClE;;;;;;OAMG;IACH,SAAS,CAAC,IAAI,gBAAgB,GAAG,SAAS,CAAA;CAC3C;AAED,0CAA0C;AAC1C,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,mBAAmB,GAAG,aAAa,CAAA;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,MAAM,GACf;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,cAAc,EAAE,sBAAsB,CAAA;CAAE,GAClG;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAiC5D;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,mBAAmB,EAChC,QAAQ,EAAE,MAAM,GACf,OAAO,CACN;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,GACjI;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAC5D,CA0CA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,MAAM,GACjB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,cAAc,EAAE,sBAAsB,CAAA;CAAE,GACrE;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAa5D;AAED;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,mBAAmB,EAChC,UAAU,EAAE,MAAM,GACjB,OAAO,CACN;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,GACjI;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAC5D,CAmBA;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAExE"}
@@ -0,0 +1,178 @@
1
+ /**
2
+ * Provider-backed dispatch for extension-declared tools (EXT-19, EXT-21, EXT-22, ARCH-05).
3
+ *
4
+ * The TMX runtime API has **no tool-invocation surface**. `ExtensionInstanceV1` exposes
5
+ * exactly `createProvider` and `dispose` — nothing else. So an extension's tool is not
6
+ * something the host calls directly; the tool is a caller-facing NAME whose contract is
7
+ * bound to an IMPLEMENTATION, and the implementation is a model PROVIDER.
8
+ *
9
+ * manifest.tools[] -> the caller-facing name and its contract
10
+ * manifest.implementations[] -> which contract, served by which model
11
+ * instance.createProvider() -> the thing that actually runs
12
+ *
13
+ * That chain is what this module walks. An earlier version of the host registrar
14
+ * registered a tool whose `execute` simply REFUSED, which was honest about there being no
15
+ * implementation bound but left the bridge functionally incomplete: the name appeared in
16
+ * the registry and could never be called.
17
+ *
18
+ * The context is INJECTED so the chain is testable without a real extension on disk.
19
+ *
20
+ * @module @try-works/dsh-tool-mode/extension-dispatch
21
+ */
22
+ import { assertNoReservedMeta } from '@try-works/tool-mode-extension-sdk';
23
+ /**
24
+ * Resolve the implementation chain for a declared tool.
25
+ *
26
+ * @param manifest - the activated extension's manifest.
27
+ * @param toolName - the caller-facing name.
28
+ * @returns the tool, its implementation, or why the chain is incomplete.
29
+ */
30
+ export function resolveImplementation(manifest, toolName) {
31
+ const tool = manifest.tools.find(candidate => candidate.name === toolName);
32
+ if (tool === undefined) {
33
+ return {
34
+ ok: false,
35
+ failure: {
36
+ code: 'not-declared',
37
+ message: `${toolName} is not declared by this extension's manifest`,
38
+ remedy: 'A registered tool must be declared in the manifest it was published from.',
39
+ },
40
+ };
41
+ }
42
+ const implementation = manifest.implementations.find(candidate => candidate.contractId === tool.contractId && candidate.contractVersion === tool.contractVersion);
43
+ if (implementation === undefined) {
44
+ /**
45
+ * THE HONEST REFUSAL, and the case the earlier stub conflated with every other.
46
+ *
47
+ * An extension may DECLARE a tool it does not yet serve — EmbeddingGemma does exactly
48
+ * this, listing contracts whose ONNX path is not wired. The name is legitimately
49
+ * registered and legitimately uncallable, and the caller must be told WHICH of those
50
+ * two situations they are in.
51
+ */
52
+ return {
53
+ ok: false,
54
+ failure: {
55
+ code: 'no-implementation',
56
+ message: `${toolName} declares contract ${tool.contractId}, which no implementation serves`,
57
+ remedy: 'The extension declares this tool but binds no model to it yet; it is not callable in this build.',
58
+ },
59
+ };
60
+ }
61
+ return { ok: true, tool, implementation };
62
+ }
63
+ /**
64
+ * Build an `execute` for one declared tool.
65
+ *
66
+ * The provider is created lazily on first call, so ACTIVATION stays lightweight as EXT-19
67
+ * requires: nothing is loaded until a caller actually invokes the tool.
68
+ *
69
+ * @param environment - how to reach the extension.
70
+ * @param toolName - the caller-facing name.
71
+ * @returns the execute function, or the failure that prevents one.
72
+ */
73
+ export async function createDispatch(environment, toolName) {
74
+ const resolved = resolveImplementation(environment.getManifest(), toolName);
75
+ if (!resolved.ok)
76
+ return resolved;
77
+ const { implementation } = resolved;
78
+ return {
79
+ ok: true,
80
+ async execute(args, signal) {
81
+ // Resolved per call rather than captured, so a provider that was unloaded — or an
82
+ // extension that was deactivated and reactivated — is not served from a stale handle.
83
+ const provider = await environment.providerFor(implementation.modelId);
84
+ /**
85
+ * The HOST-VERIFIED prepared-asset map, when a preparation completed.
86
+ * An absent map means the empty map — the extension's own load refuses a
87
+ * missing group by name (MOD-02), which is the honest outcome rather than
88
+ * a host that invents a verification that never happened. The same map
89
+ * reaches BOTH provider routes here: the in-process module provider and
90
+ * the managed worker (its load forwards the assets to the child).
91
+ */
92
+ const prepared = environment.assetsFor?.();
93
+ await provider.load({ assets: prepared ?? { get: () => undefined, assetIds: [] }, signal, modelId: implementation.modelId });
94
+ const value = await provider.invoke({
95
+ implementationId: implementation.id,
96
+ input: args,
97
+ context: environment.contextFor(implementation.id, signal),
98
+ });
99
+ /**
100
+ * THE EXT-17 META RESERVATION IS ENFORCED HERE, AT THE DISPATCH BOUNDARY.
101
+ *
102
+ * The reserved root `meta` is HOST-authored provenance; an extension supplying one
103
+ * is asserting who ran it and under what receipt, which it does not get to do. The
104
+ * ProviderBridge asserts this on the CATALOG path, but the contribution path
105
+ * (module and declarative providers alike) went unasserted — so a provider that
106
+ * smuggled a `meta` key reached callers whenever its declared output schema did not
107
+ * require the envelope. Asserting at the boundary the two provider routes share
108
+ * closes the gap for both, and it runs BEFORE any host stamping, so a forged
109
+ * envelope is refused rather than overwritten.
110
+ */
111
+ assertNoReservedMeta(value, implementation.id);
112
+ return value;
113
+ },
114
+ };
115
+ }
116
+ /**
117
+ * Resolve the implementation chain for a declared CONTRACT id (TASK-121).
118
+ *
119
+ * An extension whose manifest declares ONLY implementations (no `tools[]` —
120
+ * the MiniLM pair's shape) still serves a caller-facing standard tool: the
121
+ * contract id maps to the standard tool name the host knows, and this
122
+ * resolution finds the implementation by the contract id alone.
123
+ * @param manifest - the activated extension's manifest.
124
+ * @param contractId - the contract identity.
125
+ * @returns the implementation, or why the chain is incomplete.
126
+ */
127
+ export function resolveImplementationByContract(manifest, contractId) {
128
+ const implementation = manifest.implementations.find(candidate => candidate.contractId === contractId);
129
+ if (implementation === undefined) {
130
+ return {
131
+ ok: false,
132
+ failure: {
133
+ code: 'no-implementation',
134
+ message: `contract ${contractId} has no implementation in this extension's manifest`,
135
+ remedy: 'The extension declares the contract but binds no model to it.',
136
+ },
137
+ };
138
+ }
139
+ return { ok: true, implementation };
140
+ }
141
+ /**
142
+ * Build an `execute` for a standard-named contract tool served by an
143
+ * IMPLEMENTATION-ONLY extension (TASK-121). The provider is created lazily on
144
+ * first call, exactly like the declared-tool path.
145
+ * @param environment - how to reach the extension.
146
+ * @param contractId - the contract identity to dispatch.
147
+ * @returns the execute function, or the failure that prevents one.
148
+ */
149
+ export async function createDispatchForContract(environment, contractId) {
150
+ const resolved = resolveImplementationByContract(environment.getManifest(), contractId);
151
+ if (!resolved.ok)
152
+ return resolved;
153
+ const { implementation } = resolved;
154
+ return {
155
+ ok: true,
156
+ async execute(args, signal) {
157
+ const provider = await environment.providerFor(implementation.modelId);
158
+ const prepared = environment.assetsFor?.();
159
+ await provider.load({ assets: prepared ?? { get: () => undefined, assetIds: [] }, signal, modelId: implementation.modelId });
160
+ const value = await provider.invoke({
161
+ implementationId: implementation.id,
162
+ input: args,
163
+ context: environment.contextFor(implementation.id, signal),
164
+ });
165
+ assertNoReservedMeta(value, implementation.id);
166
+ return value;
167
+ },
168
+ };
169
+ }
170
+ /**
171
+ * Describe a dispatch failure for a caller (EXT-30).
172
+ * @param failure - the failure.
173
+ * @returns a readable message naming what to do.
174
+ */
175
+ export function describeDispatchFailure(failure) {
176
+ return `${failure.message}. ${failure.remedy}`;
177
+ }
178
+ //# sourceMappingURL=extension-dispatch.js.map
@@ -0,0 +1,69 @@
1
+ /**
2
+ * The Extensions-page row state derivation (RC3).
3
+ *
4
+ * ONE source of truth for how a describe() row renders. The host payload is
5
+ * unchanged: `{ installed, active, blocked, reason, requirements[] }` — the
6
+ * contradiction the RC3 audit found was purely a RENDERING one: the client
7
+ * drew the lifecycle's `active: true` as a plain "active" badge and an ON
8
+ * toggle even when the same row's `blocked` flag and an unmet requirement
9
+ * said activation is refused.
10
+ *
11
+ * THE RULE (one sentence): a row that the host reports `blocked` — or that
12
+ * carries any unmet requirement which blocks this row — is never rendered as
13
+ * plainly "active"/ON; it renders the blocked badge and an OFF visual toggle
14
+ * whose enabled/disabled state and title are unchanged.
15
+ *
16
+ * This module is dependency-free and pure so the SAME classification is
17
+ * testable in Node and documented as the contract the client bundle
18
+ * implements (the bundle inlines the identical rule; the test pins this
19
+ * module, and the client's rule is kept verbatim-adjacent).
20
+ *
21
+ * @module @try-works/dsh-tool-mode/extension-page-state
22
+ */
23
+ /** One requirement as the describe() payload carries it. */
24
+ export interface PageRequirement {
25
+ readonly kind: string;
26
+ readonly satisfied: boolean;
27
+ readonly reason: string;
28
+ }
29
+ /** The fields of the describe() row this derivation reads. */
30
+ export interface ExtensionPageRow {
31
+ readonly installed: boolean;
32
+ readonly active: boolean;
33
+ readonly blocked: boolean;
34
+ readonly reason: string | null;
35
+ readonly requirements: readonly PageRequirement[];
36
+ }
37
+ /**
38
+ * Whether one UNMET requirement blocks THIS row.
39
+ * @param installed - whether the store holds an installed copy.
40
+ * @param requirement - the requirement to classify.
41
+ */
42
+ export declare function requirementBlocksRow(installed: boolean, requirement: PageRequirement): boolean;
43
+ /** The badge a row renders: the lifecycle fact, qualified by the block. */
44
+ export type PageBadge = 'not-installed' | 'active' | 'active-blocked' | 'inactive';
45
+ /** The derived rendering state for one describe() row. */
46
+ export interface ExtensionPageState {
47
+ /** The badge text class: 'active' ONLY when active and not blocked. */
48
+ readonly badge: PageBadge;
49
+ /** The visual toggle: ON only when active and not blocked (blocked rows render OFF). */
50
+ readonly toggleOn: boolean;
51
+ /**
52
+ * The lifecycle fact behind the badge/toggle, preserved so the aria state
53
+ * and the action title can still say what the store observes.
54
+ */
55
+ readonly active: boolean;
56
+ /** The host's blocked flag, verbatim. */
57
+ readonly blocked: boolean;
58
+ /** The unmet requirements that block this row (in host order). */
59
+ readonly blockingReasons: readonly string[];
60
+ /** The unmet requirements that are post-install notes for this row. */
61
+ readonly noteReasons: readonly string[];
62
+ }
63
+ /**
64
+ * Derive the page state for one describe() row.
65
+ * @param row - the describe() payload.
66
+ * @returns the badge/toggle/note derivation.
67
+ */
68
+ export declare function extensionPageState(row: ExtensionPageRow): ExtensionPageState;
69
+ //# sourceMappingURL=extension-page-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension-page-state.d.ts","sourceRoot":"","sources":["../src/extension-page-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,4DAA4D;AAC5D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,QAAQ,CAAC,YAAY,EAAE,SAAS,eAAe,EAAE,CAAA;CAClD;AAoBD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe,GAAG,OAAO,CAI9F;AAED,2EAA2E;AAC3E,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,QAAQ,GAAG,gBAAgB,GAAG,UAAU,CAAA;AAElF,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,yCAAyC;IACzC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,kEAAkE;IAClE,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3C,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CACxC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,GAAG,kBAAkB,CAuB5E"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * The Extensions-page row state derivation (RC3).
3
+ *
4
+ * ONE source of truth for how a describe() row renders. The host payload is
5
+ * unchanged: `{ installed, active, blocked, reason, requirements[] }` — the
6
+ * contradiction the RC3 audit found was purely a RENDERING one: the client
7
+ * drew the lifecycle's `active: true` as a plain "active" badge and an ON
8
+ * toggle even when the same row's `blocked` flag and an unmet requirement
9
+ * said activation is refused.
10
+ *
11
+ * THE RULE (one sentence): a row that the host reports `blocked` — or that
12
+ * carries any unmet requirement which blocks this row — is never rendered as
13
+ * plainly "active"/ON; it renders the blocked badge and an OFF visual toggle
14
+ * whose enabled/disabled state and title are unchanged.
15
+ *
16
+ * This module is dependency-free and pure so the SAME classification is
17
+ * testable in Node and documented as the contract the client bundle
18
+ * implements (the bundle inlines the identical rule; the test pins this
19
+ * module, and the client's rule is kept verbatim-adjacent).
20
+ *
21
+ * @module @try-works/dsh-tool-mode/extension-page-state
22
+ */
23
+ /**
24
+ * The requirement kinds that block a NOT-installed row.
25
+ *
26
+ * Mirrors the host service's classification (extensions-service.ts
27
+ * `blocksRow`): store/source, dependencies, platform, harness-model and
28
+ * runtime stop the INSTALL or make the eventual activation impossible.
29
+ * Readiness/executable/integrity/activation/assets describe installed bytes
30
+ * and are post-install facts, never pre-install blockers.
31
+ */
32
+ const NOT_INSTALLED_BLOCKING_KINDS = new Set([
33
+ 'store',
34
+ 'source',
35
+ 'dependencies',
36
+ 'platform',
37
+ 'harness-model',
38
+ 'runtime',
39
+ ]);
40
+ /**
41
+ * Whether one UNMET requirement blocks THIS row.
42
+ * @param installed - whether the store holds an installed copy.
43
+ * @param requirement - the requirement to classify.
44
+ */
45
+ export function requirementBlocksRow(installed, requirement) {
46
+ if (requirement.satisfied)
47
+ return false;
48
+ if (installed)
49
+ return true;
50
+ return NOT_INSTALLED_BLOCKING_KINDS.has(requirement.kind);
51
+ }
52
+ /**
53
+ * Derive the page state for one describe() row.
54
+ * @param row - the describe() payload.
55
+ * @returns the badge/toggle/note derivation.
56
+ */
57
+ export function extensionPageState(row) {
58
+ const blocking = [];
59
+ const notes = [];
60
+ for (const requirement of row.requirements) {
61
+ if (requirement.satisfied)
62
+ continue;
63
+ (requirementBlocksRow(row.installed, requirement) ? blocking : notes).push(requirement.reason);
64
+ }
65
+ const blocked = row.blocked || blocking.length > 0;
66
+ const badge = !row.installed
67
+ ? 'not-installed'
68
+ : row.active && blocked
69
+ ? 'active-blocked'
70
+ : row.active
71
+ ? 'active'
72
+ : 'inactive';
73
+ return {
74
+ badge,
75
+ toggleOn: row.active && !blocked,
76
+ active: row.active,
77
+ blocked,
78
+ blockingReasons: blocking,
79
+ noteReasons: notes,
80
+ };
81
+ }
82
+ //# sourceMappingURL=extension-page-state.js.map
@@ -0,0 +1,116 @@
1
+ /**
2
+ * The host-side contribution registrar (EXT-21..EXT-30, ARCH-06).
3
+ *
4
+ * This is the bridge that was MISSING: `ExtensionLifecycle` could install, activate and
5
+ * publish contributions, and the SDK was fully tested doing so — but the HOST never
6
+ * mounted the lifecycle, so **no extension's tools ever reached the DSH registry**. An
7
+ * extension could be installed, activated and reported `observedActivation: 'active'` with
8
+ * its tool listed, and a caller still could not invoke it.
9
+ *
10
+ * The registrar is the other half: it turns a published contribution into a real registry
11
+ * entry, and withdraws it again on deactivation.
12
+ *
13
+ * Four rules, each of which has been a real defect somewhere:
14
+ *
15
+ * - **Handles are opaque and unguessable.** An extension must not be able to construct a
16
+ * handle and withdraw a contribution it does not own. A sequence number is guessable;
17
+ * the handle is a branded object the caller never sees the inside of.
18
+ * - **Withdrawing is idempotent.** A deactivation that runs twice must not throw the
19
+ * second time, and must not withdraw a DIFFERENT contribution that reused the handle.
20
+ * - **A name collision is refused, not silently overwritten.** Two extensions contributing
21
+ * `transcribe` is a configuration error; letting the second win would silently change
22
+ * what an existing caller reaches.
23
+ * - **The host stamps identity.** The contribution carries an extension id, but the HOST
24
+ * decides what that means; a package claiming another's id is refused rather than
25
+ * trusted.
26
+ *
27
+ * @module @try-works/dsh-tool-mode/extension-registrar
28
+ */
29
+ import type { Contribution, ContributionRegistrar } from '@try-works/tool-mode-extension-sdk';
30
+ /** One thing the registrar can put into the DSH registry. */
31
+ export interface RegistrableTool {
32
+ /** The caller-facing tool name. */
33
+ readonly name: string;
34
+ /** The extension that owns it, as the HOST resolved it. */
35
+ readonly ownerExtension: string;
36
+ /** The contract it implements, when it declares one. */
37
+ readonly contractId?: string;
38
+ }
39
+ /** What the registrar needs from the host registry. */
40
+ export interface HostRegistrySurface {
41
+ /**
42
+ * Register one tool.
43
+ * @param tool - the tool, with identity already stamped by the host.
44
+ * @returns a disposer that removes it.
45
+ */
46
+ registerTool(tool: RegistrableTool): () => void;
47
+ /** Register one skill, returning a disposer. */
48
+ registerSkill?(skill: {
49
+ readonly name: string;
50
+ readonly ownerExtension: string;
51
+ }): () => void;
52
+ /**
53
+ * Register the CALLER-FACING tools of one declarative implementation (RCP-01).
54
+ *
55
+ * A declarative package declares implementations only — its manifest has no
56
+ * `tools` array — so the tool names and schemas come from the RESOLVED RECIPES,
57
+ * which only the host can turn into registry entries (the recipes need the
58
+ * deployment's harness provider to be served at all). The contribution arrives
59
+ * per implementation; the host resolves the package's recipes and registers the
60
+ * matching tool, returning its disposer. Absent (or a non-declarative package)
61
+ * keeps the earlier behavior: implementations publish nothing.
62
+ */
63
+ registerDeclarative?(contribution: {
64
+ readonly extensionId: string;
65
+ readonly name: string;
66
+ readonly contractId?: string;
67
+ }): () => void;
68
+ /**
69
+ * Register the STANDARD-named contract tool for a MODULE implementation
70
+ * whose contract the host knows a standard name for (TASK-121).
71
+ *
72
+ * A module package that declares ONLY implementations (no `tools[]` — the
73
+ * MiniLM pair's shape) serves the standard contract directly: the host maps
74
+ * the contract id to its standard tool name (text.embed -> text_embed) and
75
+ * registers the tool with the contract's own schemas. Returns a disposer
76
+ * when it registered, or undefined when the contract is not a standard one
77
+ * (the declarative branch below then handles it).
78
+ */
79
+ registerContractImplementation?(contribution: {
80
+ readonly extensionId: string;
81
+ readonly contractId: string;
82
+ readonly implementationId: string;
83
+ }): (() => void) | undefined;
84
+ }
85
+ /** Raised when a contribution cannot be published. */
86
+ export declare class ContributionError extends Error {
87
+ readonly name = "ContributionError";
88
+ readonly code: 'name-collision' | 'unsupported-kind' | 'unknown-extension';
89
+ constructor(code: ContributionError['code'], message: string);
90
+ }
91
+ /**
92
+ * The published contributions, keyed by handle id.
93
+ *
94
+ * A Map rather than a field on the handle, so an extension that receives a handle cannot
95
+ * reach the disposer or another extension's entry through it.
96
+ */
97
+ export interface RegistrarOptions {
98
+ readonly registry: HostRegistrySurface;
99
+ /**
100
+ * The extensions the host has ACTIVATED.
101
+ *
102
+ * A contribution from an extension not in this set is refused: publishing is a privilege
103
+ * of activation, and without this check any code holding the registrar could register a
104
+ * tool under an extension that was never installed.
105
+ */
106
+ readonly activated: ReadonlySet<string>;
107
+ /** Called when a contribution is refused, so the reason is recorded rather than lost. */
108
+ readonly onRefused?: (contribution: Contribution, error: ContributionError) => void;
109
+ }
110
+ /**
111
+ * Create the registrar the lifecycle publishes through.
112
+ * @param options - the registry surface and the activated set.
113
+ * @returns the registrar.
114
+ */
115
+ export declare function createContributionRegistrar(options: RegistrarOptions): ContributionRegistrar;
116
+ //# sourceMappingURL=extension-registrar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension-registrar.d.ts","sourceRoot":"","sources":["../src/extension-registrar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAE7F,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,mCAAmC;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,2DAA2D;IAC3D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,uDAAuD;AACvD,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,IAAI,CAAA;IAC/C,gDAAgD;IAChD,aAAa,CAAC,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,IAAI,CAAA;IAC7F;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,CAAC,YAAY,EAAE;QACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;QAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAC7B,GAAG,MAAM,IAAI,CAAA;IACd;;;;;;;;;;OAUG;IACH,8BAA8B,CAAC,CAAC,YAAY,EAAE;QAC5C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;QAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;QAC3B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;KAClC,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;CAC7B;AAED,sDAAsD;AACtD,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,SAAkB,IAAI,uBAAsB;IAC5C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,kBAAkB,GAAG,mBAAmB,CAAA;gBAC9D,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM;CAI7D;AAUD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAA;IACtC;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACvC,yFAAyF;IACzF,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;CACpF;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,gBAAgB,GAAG,qBAAqB,CA2G5F"}