@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,332 @@
1
+ /**
2
+ * Command transports: reaching a model that is not an in-process npm package.
3
+ *
4
+ * Two transports share one shape:
5
+ *
6
+ * - **cli** — runs the Desert Ant CLI (`desertant`/`da`), which exposes every
7
+ * shipping model as `desertant <verb> … --json` and runs on macOS and Linux.
8
+ * - **remote** — POSTs to a bridge the user runs on a machine that can execute
9
+ * the model. This is what makes an Apple-only model such as Title reachable
10
+ * from a Windows host.
11
+ *
12
+ * Both are injected with their side-effecting primitive (`CommandRunner`,
13
+ * `HttpPost`) so behaviour is testable without spawning a process or opening a
14
+ * socket, and so a deployment can substitute its own runner.
15
+ *
16
+ * @module @try-works/dsh-tool-mode/transport
17
+ */
18
+ import { spawn } from 'node:child_process';
19
+ import { accessSync, constants } from 'node:fs';
20
+ import { delimiter, join } from 'node:path';
21
+ import { throwIfAborted } from "./adapters/types.js";
22
+ /** The Desert Ant CLI's exit codes, as documented for agents. */
23
+ export const CLI_EXIT_RUNTIME_ERROR = 1;
24
+ export const CLI_EXIT_USAGE_ERROR = 64;
25
+ /**
26
+ * Default command name. `da` is the short alias the CLI installs.
27
+ */
28
+ export const DEFAULT_CLI_COMMAND = 'desertant';
29
+ /** The path every bridge must serve. */
30
+ export const BRIDGE_PATH = '/invoke';
31
+ /**
32
+ * Whether a command is on PATH.
33
+ *
34
+ * Probed by scanning PATH rather than by running the command, because this runs
35
+ * at plugin load and a capability probe must not start a process (or pay a
36
+ * CLI's startup cost) just to decide what to advertise.
37
+ * @param command - command name or an absolute path.
38
+ * @param pathValue - the PATH to search; defaults to the process environment.
39
+ * @returns whether an executable file of that name exists.
40
+ */
41
+ export function commandExists(command, pathValue) {
42
+ // An explicit path is checked directly; a bare name is searched on PATH.
43
+ if (command.includes('/') || command.includes('\\')) {
44
+ return isExecutable(command);
45
+ }
46
+ const searchPath = pathValue ?? process.env.PATH ?? '';
47
+ const extensions = process.platform === 'win32'
48
+ ? (process.env.PATHEXT ?? '.COM;.EXE;.BAT;.CMD').split(';')
49
+ : [''];
50
+ for (const directory of searchPath.split(delimiter)) {
51
+ if (directory.length === 0)
52
+ continue;
53
+ for (const extension of extensions) {
54
+ if (isExecutable(join(directory, command + extension)))
55
+ return true;
56
+ }
57
+ }
58
+ return false;
59
+ }
60
+ /** Whether a path is an existing executable file. */
61
+ function isExecutable(candidate) {
62
+ try {
63
+ accessSync(candidate, constants.X_OK);
64
+ return true;
65
+ }
66
+ catch {
67
+ return false;
68
+ }
69
+ }
70
+ /**
71
+ * Split the tool arguments into the CLI's positional inputs and its
72
+ * `--option key=value` flags.
73
+ *
74
+ * The first declared catalog parameter is the primary input, matching how the
75
+ * registrar marks it required. A file model accepts several paths positionally
76
+ * (the CLI loads the model once for all of them), so a primary declared as a
77
+ * string list becomes several positionals. Everything else becomes an option,
78
+ * with lists comma-joined because the CLI's option syntax is `key=value`.
79
+ * @param entry - the catalog entry being invoked.
80
+ * @param args - validated tool arguments.
81
+ * @returns the positional inputs and the option list.
82
+ */
83
+ export function splitArguments(entry, args) {
84
+ const names = Object.keys(entry.tool.params);
85
+ const primaryName = names[0];
86
+ if (primaryName === undefined) {
87
+ throw new Error(`${entry.name} declares no parameters, so its input cannot be addressed`);
88
+ }
89
+ const primaryValue = args[primaryName];
90
+ let positionals;
91
+ if (typeof primaryValue === 'string' && primaryValue.length > 0) {
92
+ positionals = [primaryValue];
93
+ }
94
+ else if (Array.isArray(primaryValue) && primaryValue.length > 0
95
+ && primaryValue.every(item => typeof item === 'string' && item.length > 0)) {
96
+ positionals = primaryValue;
97
+ }
98
+ else {
99
+ throw new Error(`argument "${primaryName}" must be a non-empty string or list of paths`);
100
+ }
101
+ const options = [];
102
+ for (const name of names.slice(1)) {
103
+ const value = args[name];
104
+ if (value === undefined)
105
+ continue;
106
+ if (Array.isArray(value)) {
107
+ options.push([name.replaceAll('_', '-'), value.map(String).join(',')]);
108
+ }
109
+ else if (typeof value === 'boolean' || typeof value === 'number') {
110
+ options.push([name.replaceAll('_', '-'), String(value)]);
111
+ }
112
+ else if (typeof value === 'string') {
113
+ options.push([name.replaceAll('_', '-'), value]);
114
+ }
115
+ else {
116
+ throw new Error(`argument "${name}" must be a string, number, boolean or string list`);
117
+ }
118
+ }
119
+ return { positionals, options };
120
+ }
121
+ /**
122
+ * Build the CLI argv for one invocation.
123
+ *
124
+ * `--json` is what makes stdout a single JSON value, and it also implies
125
+ * `--no-color`, so no escape sequences have to be stripped.
126
+ * @param entry - the catalog entry being invoked.
127
+ * @param args - validated tool arguments.
128
+ * @returns the argv to run, after the command itself.
129
+ */
130
+ export function buildArgv(entry, args) {
131
+ const verb = entry.cliVerb;
132
+ if (verb === null)
133
+ throw new Error(`${entry.name} has no CLI verb, so the CLI cannot run it`);
134
+ const { positionals, options } = splitArguments(entry, args);
135
+ const argv = [verb, ...positionals, '--json'];
136
+ for (const [key, value] of options)
137
+ argv.push('--option', `${key}=${value}`);
138
+ return argv;
139
+ }
140
+ /**
141
+ * Parse the CLI's stdout into a canonical value.
142
+ *
143
+ * The CLI writes exactly one JSON value to stdout under `--json` and keeps every
144
+ * diagnostic on stderr, so a parse failure means the command did not behave as
145
+ * documented rather than that output needs cleaning.
146
+ * @param entry - the model, for error messages.
147
+ * @param outcome - the completed command.
148
+ * @returns the parsed value.
149
+ * @throws when the exit code is non-zero or stdout is not a single JSON value.
150
+ */
151
+ export function parseCliOutcome(entry, outcome) {
152
+ if (outcome.code === CLI_EXIT_USAGE_ERROR) {
153
+ throw new Error(`${entry.name}: the CLI rejected the call (exit 64). ${outcome.stderr.trim() || 'usage error'}`);
154
+ }
155
+ if (outcome.code === CLI_EXIT_RUNTIME_ERROR) {
156
+ throw new Error(`${entry.name} failed (exit 1). ${outcome.stderr.trim() || 'runtime error'}`);
157
+ }
158
+ if (outcome.code !== 0) {
159
+ throw new Error(`${entry.name}: the CLI exited ${outcome.code}. ${outcome.stderr.trim() || 'unknown failure'}`);
160
+ }
161
+ const text = outcome.stdout.trim();
162
+ if (text.length === 0) {
163
+ throw new Error(`${entry.name}: the CLI produced no JSON on stdout`);
164
+ }
165
+ let parsed;
166
+ try {
167
+ parsed = JSON.parse(text);
168
+ }
169
+ catch (error) {
170
+ throw new Error(`${entry.name}: the CLI stdout was not JSON: ${error instanceof Error ? error.message : String(error)}`);
171
+ }
172
+ return asRecord(entry, parsed);
173
+ }
174
+ /**
175
+ * Wrap a JSON value as the object a tool output schema requires.
176
+ * @param entry - the model, for error messages.
177
+ * @param value - the parsed value.
178
+ * @returns the value as a record; a non-object is wrapped under `result`.
179
+ */
180
+ function asRecord(entry, value) {
181
+ if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
182
+ return value;
183
+ }
184
+ if (Array.isArray(value))
185
+ return { result: value };
186
+ // A scalar result is still a result; naming it keeps the output contract
187
+ // stable instead of failing a call that actually succeeded.
188
+ void entry;
189
+ return { result: value };
190
+ }
191
+ /** Spawn a command and capture its output. */
192
+ export const spawnRunner = (command, argv, signal) => new Promise((resolve, reject) => {
193
+ // `shell: false` keeps argv elements from being re-interpreted by a shell,
194
+ // so a model input containing quotes or `&` cannot become a second command.
195
+ const child = spawn(command, [...argv], { shell: false, windowsHide: true });
196
+ let stdout = '';
197
+ let stderr = '';
198
+ let settled = false;
199
+ const onAbort = () => {
200
+ if (settled)
201
+ return;
202
+ settled = true;
203
+ child.kill();
204
+ reject(signal.reason instanceof Error ? signal.reason : new Error('aborted'));
205
+ };
206
+ if (signal.aborted) {
207
+ onAbort();
208
+ return;
209
+ }
210
+ signal.addEventListener('abort', onAbort, { once: true });
211
+ child.stdout.setEncoding('utf8');
212
+ child.stderr.setEncoding('utf8');
213
+ child.stdout.on('data', (chunk) => { stdout += chunk; });
214
+ child.stderr.on('data', (chunk) => { stderr += chunk; });
215
+ child.on('error', (error) => {
216
+ if (settled)
217
+ return;
218
+ settled = true;
219
+ signal.removeEventListener('abort', onAbort);
220
+ reject(new Error(`cannot run "${command}": ${error.message}`));
221
+ });
222
+ child.on('close', (code) => {
223
+ if (settled)
224
+ return;
225
+ settled = true;
226
+ signal.removeEventListener('abort', onAbort);
227
+ resolve({ code: code ?? -1, stdout, stderr });
228
+ });
229
+ });
230
+ /** POST JSON with the global fetch and read the response as text. */
231
+ export const fetchPost = async (url, body, headers, signal) => {
232
+ const response = await fetch(url, {
233
+ method: 'POST',
234
+ headers: { 'content-type': 'application/json', ...headers },
235
+ body: JSON.stringify(body),
236
+ signal,
237
+ });
238
+ return { status: response.status, body: await response.text() };
239
+ };
240
+ /**
241
+ * Build the CLI transport for one model.
242
+ * @param entry - the catalog entry, which must declare a CLI verb.
243
+ * @param options - command name and injected runner.
244
+ * @returns the transport.
245
+ */
246
+ export function createCliTransport(entry, options = {}) {
247
+ const command = options.cliCommand ?? DEFAULT_CLI_COMMAND;
248
+ const run = options.run ?? spawnRunner;
249
+ return {
250
+ kind: 'cli',
251
+ async invoke({ args, signal }) {
252
+ throwIfAborted(signal);
253
+ const argv = buildArgv(entry, args);
254
+ const outcome = await run(command, argv, signal);
255
+ throwIfAborted(signal);
256
+ return parseCliOutcome(entry, outcome);
257
+ },
258
+ };
259
+ }
260
+ /**
261
+ * Build the remote transport for one model.
262
+ *
263
+ * The bridge contract is deliberately small so a user can implement it in a few
264
+ * lines on a machine that can run the model:
265
+ *
266
+ * ```
267
+ * POST <endpoint>/invoke
268
+ * { "model": "title", "verb": "title", "input": "<primary>", "options": { "max-tokens": "96" } }
269
+ * → 200 { "ok": true, "result": <the model's JSON> }
270
+ * → 4xx { "ok": false, "error": "<message>" }
271
+ * ```
272
+ * @param entry - the catalog entry to reach.
273
+ * @param options - endpoint, optional token, injected poster.
274
+ * @returns the transport.
275
+ */
276
+ export function createRemoteTransport(entry, options = {}) {
277
+ const endpoint = options.endpoint;
278
+ if (endpoint === undefined || endpoint.length === 0) {
279
+ throw new Error('the remote transport requires an endpoint');
280
+ }
281
+ const post = options.post ?? fetchPost;
282
+ const url = `${endpoint.replace(/\/+$/, '')}${BRIDGE_PATH}`;
283
+ const headers = options.token === undefined
284
+ ? {}
285
+ : { authorization: `Bearer ${options.token}` };
286
+ return {
287
+ kind: 'remote',
288
+ async invoke({ args, signal }) {
289
+ throwIfAborted(signal);
290
+ const verb = entry.cliVerb;
291
+ if (verb === null)
292
+ throw new Error(`${entry.name} declares no verb for the bridge to run`);
293
+ const { positionals, options: flags } = splitArguments(entry, args);
294
+ const response = await post(url, {
295
+ model: entry.id,
296
+ verb,
297
+ // A file model may pass several paths; `input` carries them all so the
298
+ // bridge does not have to know which models take more than one.
299
+ input: positionals.length === 1 ? positionals[0] : positionals,
300
+ options: Object.fromEntries(flags),
301
+ }, headers, signal);
302
+ throwIfAborted(signal);
303
+ return parseBridgeResponse(entry, response);
304
+ },
305
+ };
306
+ }
307
+ /**
308
+ * Interpret one bridge response.
309
+ * @param entry - the model, for error messages.
310
+ * @param response - the HTTP status and body.
311
+ * @returns the model's result as a canonical value.
312
+ * @throws when the bridge reports a failure or an unreadable body.
313
+ */
314
+ export function parseBridgeResponse(entry, response) {
315
+ let parsed;
316
+ try {
317
+ parsed = JSON.parse(response.body);
318
+ }
319
+ catch {
320
+ throw new Error(`${entry.name}: the bridge returned a non-JSON body (HTTP ${response.status})`);
321
+ }
322
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
323
+ throw new Error(`${entry.name}: the bridge returned an unexpected body shape`);
324
+ }
325
+ const envelope = parsed;
326
+ if (envelope.ok !== true) {
327
+ const detail = typeof envelope.error === 'string' ? envelope.error : `HTTP ${response.status}`;
328
+ throw new Error(`${entry.name}: the bridge could not run the model. ${detail}`);
329
+ }
330
+ return asRecord(entry, envelope.result);
331
+ }
332
+ //# sourceMappingURL=transport.js.map
package/lib/types.d.ts ADDED
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Data model for the Desert Ant Labs model catalog and the capability layer
3
+ * that decides whether a model can actually run in the current DSH process.
4
+ *
5
+ * @module @try-works/dsh-tool-mode/types
6
+ */
7
+ /** The kind of value a model consumes. */
8
+ export type ModelInput = 'text' | 'audio' | 'image' | 'video' | 'stroke' | 'transcript';
9
+ /**
10
+ * How the model's weights are reachable from a Node process on each platform.
11
+ * This is the field the capability resolver keys off, because it encodes the
12
+ * upstream packaging reality rather than an aspiration.
13
+ */
14
+ export type WindowsSupport =
15
+ /** Ships a prebuilt native core for this platform and works in plain Node. */
16
+ 'native-node'
17
+ /** Needs a caller-supplied ONNX Runtime module (e.g. `onnxruntime-node`). */
18
+ | 'onnxruntime-node'
19
+ /** No Node runtime anywhere: Apple platforms only, through the Swift SDK. */
20
+ | 'apple-only'
21
+ /** Prebuilt native core exists, but not for this platform/arch. */
22
+ | 'browser-only'
23
+ /** Weights exist but no SDK ships them at all. */
24
+ | 'no-sdk';
25
+ /** The JSON-level type of one tool parameter. */
26
+ export type ModelParamType = 'string' | 'number' | 'integer' | 'boolean' | 'string[]';
27
+ /**
28
+ * One declared tool parameter.
29
+ *
30
+ * A bare string is shorthand for `{ type: 'string', description }`, which is
31
+ * what most of the catalog's parameters are; the object form exists for the
32
+ * parameters that are genuinely numbers, booleans or string lists.
33
+ */
34
+ export interface ModelParam {
35
+ /** Model-facing description of the parameter. */
36
+ readonly description: string;
37
+ /** Declared type; defaults to `string`. */
38
+ readonly type?: ModelParamType;
39
+ }
40
+ /** One parameter as written in the catalog document. */
41
+ export type ModelParamSpec = string | ModelParam;
42
+ /** The model-facing tool a catalog entry installs. */
43
+ export interface ModelToolSpec {
44
+ /** DSH tool name (lower snake_case). */
45
+ readonly name: string;
46
+ /** Model-facing description of the tool. */
47
+ readonly description: string;
48
+ /** Parameter name -> declaration, in documentation order; the first is the primary input. */
49
+ readonly params: Readonly<Record<string, ModelParam>>;
50
+ /** What the tool returns. */
51
+ readonly returns: string;
52
+ }
53
+ /** The skill a catalog entry publishes alongside its tool. */
54
+ export interface ModelSkillSpec {
55
+ /** Kebab-case skill name. */
56
+ readonly name: string;
57
+ /** Short routing description for the skill catalog. */
58
+ readonly description: string;
59
+ /** Optional extra routing guidance. */
60
+ readonly whenToUse?: string;
61
+ }
62
+ /** One model in the Desert Ant Labs catalog. */
63
+ export interface ModelCatalogEntry {
64
+ readonly id: string;
65
+ readonly name: string;
66
+ readonly summary: string;
67
+ readonly capability: string;
68
+ /**
69
+ * The standard contract this model implements, or null when none exists yet.
70
+ *
71
+ * This is what makes tool identity independent of model identity (BASE-02): the
72
+ * contract decides the tool name a caller sees, so a second model implementing
73
+ * the same contract joins the existing tool instead of creating a duplicate. A
74
+ * model with no contract keeps a per-model tool under its own name.
75
+ */
76
+ readonly contract: string | null;
77
+ /**
78
+ * The extension package that implements this model (BASE-09).
79
+ *
80
+ * A binding held as DATA, not a switch on the model name. The host loads
81
+ * whatever package this names through the PUBLIC extension API, so a first-party
82
+ * package takes the same route as a third-party one and adding a vendor means
83
+ * publishing a package plus adding this field — with no host change.
84
+ */
85
+ readonly provider?: {
86
+ readonly extension: string;
87
+ readonly modelId: string;
88
+ };
89
+ readonly input: ModelInput;
90
+ readonly output: string;
91
+ readonly languages: number | null;
92
+ readonly modelSizeMB: number | null;
93
+ readonly appleOnly: boolean;
94
+ readonly closedBeta: boolean;
95
+ /** True only where this repository verified a real inference on Windows x64. */
96
+ readonly verifiedRunnableOnWindows: boolean;
97
+ readonly windowsSupport: WindowsSupport;
98
+ readonly npmPackage: string | null;
99
+ readonly npmSubpath: string | null;
100
+ readonly requiresRuntime: readonly string[];
101
+ readonly cliVerb: string | null;
102
+ readonly license: string;
103
+ readonly docsUrl: string;
104
+ readonly hfRepo: string;
105
+ readonly tool: ModelToolSpec;
106
+ readonly skill: ModelSkillSpec;
107
+ }
108
+ /** How an adapter reaches a model at run time. */
109
+ export type ModelRoute =
110
+ /** A Tool Mode extension package loaded in this process. */
111
+ 'extension'
112
+ /** An npm package loaded in this process. */
113
+ | 'npm-native'
114
+ /** An npm package plus a caller-supplied ONNX Runtime module. */
115
+ | 'npm-onnxruntime'
116
+ /** The Desert Ant CLI, run as a child process (macOS and Linux). */
117
+ | 'cli'
118
+ /** A user-hosted bridge, reached over HTTP. */
119
+ | 'remote'
120
+ /** No route available in this process. */
121
+ | 'unavailable';
122
+ /** The capability resolver's verdict for one model in the current process. */
123
+ export interface CapabilityVerdict {
124
+ /** Whether an adapter can actually produce a working tool for this model. */
125
+ readonly runnable: boolean;
126
+ readonly route: ModelRoute;
127
+ /** Why the model is or is not runnable, always populated for a negative verdict. */
128
+ readonly reason: string;
129
+ /** Resolved package specifiers this verdict depended on, for diagnostics. */
130
+ readonly resolved?: readonly string[];
131
+ /** Resolved package specifiers that were required but missing. */
132
+ readonly missing?: readonly string[];
133
+ }
134
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
package/lib/types.js ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Data model for the Desert Ant Labs model catalog and the capability layer
3
+ * that decides whether a model can actually run in the current DSH process.
4
+ *
5
+ * @module @try-works/dsh-tool-mode/types
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,79 @@
1
+ /**
2
+ * The host's UpdateHostSurface (EXT-30, slice 3): the operator approval
3
+ * surface, the two-phase commit with quiesce/rebind hooks, and the standalone
4
+ * rollback with a bounded rebindRestored.
5
+ *
6
+ * The SDK owns the durable mechanics (staging, validation reports, approval
7
+ * RECORDS, the atomic pointer, the auto-rollback); this module owns the HOST
8
+ * decisions the SDK refuses to invent (design doc §6):
9
+ *
10
+ * - the pending listing + approve/deny over the SDK's approval records;
11
+ * - the quiesce (stop old-generation admissions) and the rebind (republish the
12
+ * new generation) — supplied as closures so the index wiring passes the
13
+ * lifecycle/registrar pair and tests can pass recorded fakes;
14
+ * - the ALL-OR-NOTHING rebind wrapper: the SDK's auto-rollback re-runs NO
15
+ * hooks (the REBIND-REVERT contract), so a rebind failure restores the
16
+ * previous surface HERE, before the pointer rollback lands;
17
+ * - the host-side timeout bound on rebindRestored (the SDK awaits it with no
18
+ * bound; only the management caller must not hang).
19
+ *
20
+ * The management channel stays the ONLY caller of this surface (AT-39).
21
+ *
22
+ * @module @dsh-tool-mode/update-surface
23
+ */
24
+ import type { UpdateCommitResult, UpdateRollbackResult, UpdateValidationReport } from '@try-works/tool-mode-extension-sdk';
25
+ /** One pending staged update, from the staging directory + the approval record. */
26
+ export interface PendingUpdateEntry {
27
+ readonly extensionId: string;
28
+ readonly stagedVersion: string;
29
+ /** The version the report was computed against. */
30
+ readonly currentVersion: string;
31
+ readonly stagedAt: string;
32
+ readonly report: UpdateValidationReport;
33
+ /** The persisted approval, when one was recorded. */
34
+ readonly approval?: {
35
+ readonly approved: boolean;
36
+ readonly reason?: string;
37
+ };
38
+ }
39
+ /** The host-side lifecycle closures the surface drives. */
40
+ export interface UpdateHostHooks {
41
+ /** Stop old-generation admissions (withdraw handles, stop admitting). */
42
+ readonly quiesce: (extensionId: string) => Promise<void>;
43
+ /** Publish the new generation's surface (must be all-or-nothing per the SDK contract). */
44
+ readonly rebind: (extensionId: string, version: string) => Promise<void>;
45
+ }
46
+ /** The operator approval surface + commit/rollback. */
47
+ export interface UpdateHostSurface {
48
+ /** The pending staged updates with their reports and approval records. */
49
+ listPendingUpdates(): PendingUpdateEntry[];
50
+ /** Record ONE approval decision (write-once per staged version). */
51
+ decide(extensionId: string, stagedVersion: string, decision: {
52
+ approved: true;
53
+ } | {
54
+ approved: false;
55
+ reason: string;
56
+ }): void;
57
+ /**
58
+ * Commit a staged update through the two-phase seam.
59
+ * @throws when the SDK refuses (no approved record, integrity, quiesce, rebind).
60
+ */
61
+ commit(extensionId: string, stagedVersion: string): Promise<UpdateCommitResult>;
62
+ /** Roll the pointer back with a TIME-BOUNDED rebindRestored. */
63
+ rollback(extensionId: string): Promise<UpdateRollbackResult>;
64
+ }
65
+ /** The surface options. */
66
+ export interface UpdateHostSurfaceOptions {
67
+ readonly storeDir: string;
68
+ readonly profile: string;
69
+ readonly hooks: UpdateHostHooks;
70
+ /** The host-side bound on rebindRestored; default 30 s. */
71
+ readonly rebindTimeoutMs?: number;
72
+ }
73
+ /**
74
+ * Create the host update surface.
75
+ * @param options - the store location, profile, lifecycle hooks and the timeout bound.
76
+ * @returns the surface.
77
+ */
78
+ export declare function createUpdateHostSurface(options: UpdateHostSurfaceOptions): UpdateHostSurface;
79
+ //# sourceMappingURL=update-surface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-surface.d.ts","sourceRoot":"","sources":["../src/update-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,oCAAoC,CAAA;AAI3C,mFAAmF;AACnF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAA;IACvC,qDAAqD;IACrD,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC7E;AAED,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACxD,0FAA0F;IAC1F,QAAQ,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACzE;AAED,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,kBAAkB,IAAI,kBAAkB,EAAE,CAAA;IAC1C,oEAAoE;IACpE,MAAM,CACJ,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE;QAAE,QAAQ,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,QAAQ,EAAE,KAAK,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GACjE,IAAI,CAAA;IACP;;;OAGG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;IAC/E,gEAAgE;IAChE,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;CAC7D;AAED,2BAA2B;AAC3B,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAA;IAC/B,2DAA2D;IAC3D,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAClC;AA6CD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB,GAAG,iBAAiB,CAsJ5F"}