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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (432) hide show
  1. package/LICENSE +205 -0
  2. package/README.md +303 -2
  3. package/bin/dsh-tool-mode-credentials.mjs +20 -0
  4. package/bin/dsh-tool-mode-mcp-stdio.mjs +80 -0
  5. package/bin/dsh-tool-mode.mjs +211 -0
  6. package/builtins.lock.json +26 -0
  7. package/catalog/desert-ant-models.json +693 -0
  8. package/catalog/playbooks.json +531 -0
  9. package/client/client.model-tools.js +1910 -0
  10. package/client/index.js +4158 -0
  11. package/cordis.patch.yml +39 -0
  12. package/lib/adapters/index.d.ts +61 -0
  13. package/lib/adapters/index.d.ts.map +1 -0
  14. package/lib/adapters/index.js +82 -0
  15. package/lib/adapters/types.d.ts +106 -0
  16. package/lib/adapters/types.d.ts.map +1 -0
  17. package/lib/adapters/types.js +85 -0
  18. package/lib/approval.d.ts +189 -0
  19. package/lib/approval.d.ts.map +1 -0
  20. package/lib/approval.js +510 -0
  21. package/lib/asset-acquisition.d.ts +149 -0
  22. package/lib/asset-acquisition.d.ts.map +1 -0
  23. package/lib/asset-acquisition.js +175 -0
  24. package/lib/authority.d.ts +185 -0
  25. package/lib/authority.d.ts.map +1 -0
  26. package/lib/authority.js +223 -0
  27. package/lib/bindings.d.ts +144 -0
  28. package/lib/bindings.d.ts.map +1 -0
  29. package/lib/bindings.js +314 -0
  30. package/lib/builtins.d.ts +27 -0
  31. package/lib/builtins.d.ts.map +1 -0
  32. package/lib/builtins.js +37 -0
  33. package/lib/capability.d.ts +58 -0
  34. package/lib/capability.d.ts.map +1 -0
  35. package/lib/capability.js +192 -0
  36. package/lib/capture-path.d.ts +97 -0
  37. package/lib/capture-path.d.ts.map +1 -0
  38. package/lib/capture-path.js +152 -0
  39. package/lib/catalog.d.ts +37 -0
  40. package/lib/catalog.d.ts.map +1 -0
  41. package/lib/catalog.js +274 -0
  42. package/lib/contract-payload.d.ts +39 -0
  43. package/lib/contract-payload.d.ts.map +1 -0
  44. package/lib/contract-payload.js +56 -0
  45. package/lib/custom-tools/compile.d.ts +25 -0
  46. package/lib/custom-tools/compile.d.ts.map +1 -0
  47. package/lib/custom-tools/compile.js +61 -0
  48. package/lib/custom-tools/composite-executor.d.ts +42 -0
  49. package/lib/custom-tools/composite-executor.d.ts.map +1 -0
  50. package/lib/custom-tools/composite-executor.js +113 -0
  51. package/lib/custom-tools/dispatch.d.ts +28 -0
  52. package/lib/custom-tools/dispatch.d.ts.map +1 -0
  53. package/lib/custom-tools/dispatch.js +34 -0
  54. package/lib/custom-tools/http-executor.d.ts +48 -0
  55. package/lib/custom-tools/http-executor.d.ts.map +1 -0
  56. package/lib/custom-tools/http-executor.js +241 -0
  57. package/lib/custom-tools/index.d.ts +12 -0
  58. package/lib/custom-tools/index.d.ts.map +1 -0
  59. package/lib/custom-tools/index.js +12 -0
  60. package/lib/custom-tools/mcp-surface.d.ts +14 -0
  61. package/lib/custom-tools/mcp-surface.d.ts.map +1 -0
  62. package/lib/custom-tools/mcp-surface.js +41 -0
  63. package/lib/custom-tools/prompt-executor.d.ts +39 -0
  64. package/lib/custom-tools/prompt-executor.d.ts.map +1 -0
  65. package/lib/custom-tools/prompt-executor.js +59 -0
  66. package/lib/custom-tools/registry.d.ts +69 -0
  67. package/lib/custom-tools/registry.d.ts.map +1 -0
  68. package/lib/custom-tools/registry.js +130 -0
  69. package/lib/custom-tools/schema.d.ts +26 -0
  70. package/lib/custom-tools/schema.d.ts.map +1 -0
  71. package/lib/custom-tools/schema.js +375 -0
  72. package/lib/custom-tools/service.d.ts +90 -0
  73. package/lib/custom-tools/service.d.ts.map +1 -0
  74. package/lib/custom-tools/service.js +203 -0
  75. package/lib/custom-tools/store.d.ts +61 -0
  76. package/lib/custom-tools/store.d.ts.map +1 -0
  77. package/lib/custom-tools/store.js +240 -0
  78. package/lib/custom-tools/types.d.ts +131 -0
  79. package/lib/custom-tools/types.d.ts.map +1 -0
  80. package/lib/custom-tools/types.js +11 -0
  81. package/lib/decision-combine.d.ts +113 -0
  82. package/lib/decision-combine.d.ts.map +1 -0
  83. package/lib/decision-combine.js +156 -0
  84. package/lib/decision-evaluate.d.ts +185 -0
  85. package/lib/decision-evaluate.d.ts.map +1 -0
  86. package/lib/decision-evaluate.js +227 -0
  87. package/lib/deployment-coordinator.d.ts +213 -0
  88. package/lib/deployment-coordinator.d.ts.map +1 -0
  89. package/lib/deployment-coordinator.js +274 -0
  90. package/lib/diagnostics.d.ts +169 -0
  91. package/lib/diagnostics.d.ts.map +1 -0
  92. package/lib/diagnostics.js +136 -0
  93. package/lib/discovery-contracts.d.ts +14 -0
  94. package/lib/discovery-contracts.d.ts.map +1 -0
  95. package/lib/discovery-contracts.js +90 -0
  96. package/lib/discovery-describe.d.ts +35 -0
  97. package/lib/discovery-describe.d.ts.map +1 -0
  98. package/lib/discovery-describe.js +99 -0
  99. package/lib/embedding-index.d.ts +55 -0
  100. package/lib/embedding-index.d.ts.map +1 -0
  101. package/lib/embedding-index.js +126 -0
  102. package/lib/extension-dependencies.d.ts +355 -0
  103. package/lib/extension-dependencies.d.ts.map +1 -0
  104. package/lib/extension-dependencies.js +987 -0
  105. package/lib/extension-dispatch.d.ts +150 -0
  106. package/lib/extension-dispatch.d.ts.map +1 -0
  107. package/lib/extension-dispatch.js +178 -0
  108. package/lib/extension-page-state.d.ts +69 -0
  109. package/lib/extension-page-state.d.ts.map +1 -0
  110. package/lib/extension-page-state.js +82 -0
  111. package/lib/extension-registrar.d.ts +116 -0
  112. package/lib/extension-registrar.d.ts.map +1 -0
  113. package/lib/extension-registrar.js +144 -0
  114. package/lib/extensions-api.d.ts +346 -0
  115. package/lib/extensions-api.d.ts.map +1 -0
  116. package/lib/extensions-api.js +17 -0
  117. package/lib/extensions-remote.d.ts +57 -0
  118. package/lib/extensions-remote.d.ts.map +1 -0
  119. package/lib/extensions-remote.js +69 -0
  120. package/lib/extensions-service.d.ts +568 -0
  121. package/lib/extensions-service.d.ts.map +1 -0
  122. package/lib/extensions-service.js +2552 -0
  123. package/lib/harness-budgets.d.ts +158 -0
  124. package/lib/harness-budgets.d.ts.map +1 -0
  125. package/lib/harness-budgets.js +152 -0
  126. package/lib/harness-llm.d.ts +138 -0
  127. package/lib/harness-llm.d.ts.map +1 -0
  128. package/lib/harness-llm.js +218 -0
  129. package/lib/harness-serving.d.ts +115 -0
  130. package/lib/harness-serving.d.ts.map +1 -0
  131. package/lib/harness-serving.js +176 -0
  132. package/lib/headless.d.ts +97 -0
  133. package/lib/headless.d.ts.map +1 -0
  134. package/lib/headless.js +407 -0
  135. package/lib/http-acquisition.d.ts +27 -0
  136. package/lib/http-acquisition.d.ts.map +1 -0
  137. package/lib/http-acquisition.js +140 -0
  138. package/lib/index.d.ts +546 -0
  139. package/lib/index.d.ts.map +1 -0
  140. package/lib/index.js +5273 -0
  141. package/lib/invocation-accounting.d.ts +169 -0
  142. package/lib/invocation-accounting.d.ts.map +1 -0
  143. package/lib/invocation-accounting.js +148 -0
  144. package/lib/jev.d.ts +218 -0
  145. package/lib/jev.d.ts.map +1 -0
  146. package/lib/jev.js +366 -0
  147. package/lib/legacy-migration.d.ts +95 -0
  148. package/lib/legacy-migration.d.ts.map +1 -0
  149. package/lib/legacy-migration.js +429 -0
  150. package/lib/license-basis.d.ts +29 -0
  151. package/lib/license-basis.d.ts.map +1 -0
  152. package/lib/license-basis.js +58 -0
  153. package/lib/managed-workers.d.ts +158 -0
  154. package/lib/managed-workers.d.ts.map +1 -0
  155. package/lib/managed-workers.js +269 -0
  156. package/lib/mcp/auth-selection.d.ts +35 -0
  157. package/lib/mcp/auth-selection.d.ts.map +1 -0
  158. package/lib/mcp/auth-selection.js +64 -0
  159. package/lib/mcp/client-grant.d.ts +89 -0
  160. package/lib/mcp/client-grant.d.ts.map +1 -0
  161. package/lib/mcp/client-grant.js +63 -0
  162. package/lib/mcp/credential-cli.d.ts +38 -0
  163. package/lib/mcp/credential-cli.d.ts.map +1 -0
  164. package/lib/mcp/credential-cli.js +148 -0
  165. package/lib/mcp/credential-store.d.ts +143 -0
  166. package/lib/mcp/credential-store.d.ts.map +1 -0
  167. package/lib/mcp/credential-store.js +461 -0
  168. package/lib/mcp/export-policy.d.ts +25 -0
  169. package/lib/mcp/export-policy.d.ts.map +1 -0
  170. package/lib/mcp/export-policy.js +31 -0
  171. package/lib/mcp/host-binding.d.ts +144 -0
  172. package/lib/mcp/host-binding.d.ts.map +1 -0
  173. package/lib/mcp/host-binding.js +280 -0
  174. package/lib/mcp/http.d.ts +180 -0
  175. package/lib/mcp/http.d.ts.map +1 -0
  176. package/lib/mcp/http.js +602 -0
  177. package/lib/mcp/oauth.d.ts +149 -0
  178. package/lib/mcp/oauth.d.ts.map +1 -0
  179. package/lib/mcp/oauth.js +396 -0
  180. package/lib/mcp/protocol.d.ts +329 -0
  181. package/lib/mcp/protocol.d.ts.map +1 -0
  182. package/lib/mcp/protocol.js +459 -0
  183. package/lib/mcp/rate-limit.d.ts +68 -0
  184. package/lib/mcp/rate-limit.d.ts.map +1 -0
  185. package/lib/mcp/rate-limit.js +114 -0
  186. package/lib/mcp/sdk-v2.d.ts +17 -0
  187. package/lib/mcp/sdk-v2.d.ts.map +1 -0
  188. package/lib/mcp/sdk-v2.js +204 -0
  189. package/lib/mcp/server.d.ts +149 -0
  190. package/lib/mcp/server.d.ts.map +1 -0
  191. package/lib/mcp/server.js +302 -0
  192. package/lib/mcp/stdio.d.ts +80 -0
  193. package/lib/mcp/stdio.d.ts.map +1 -0
  194. package/lib/mcp/stdio.js +184 -0
  195. package/lib/mcp/subscriptions.d.ts +177 -0
  196. package/lib/mcp/subscriptions.d.ts.map +1 -0
  197. package/lib/mcp/subscriptions.js +288 -0
  198. package/lib/mcp-status.d.ts +96 -0
  199. package/lib/mcp-status.d.ts.map +1 -0
  200. package/lib/mcp-status.js +70 -0
  201. package/lib/mcp-usage.d.ts +110 -0
  202. package/lib/mcp-usage.d.ts.map +1 -0
  203. package/lib/mcp-usage.js +189 -0
  204. package/lib/model-qualification.d.ts +192 -0
  205. package/lib/model-qualification.d.ts.map +1 -0
  206. package/lib/model-qualification.js +178 -0
  207. package/lib/model-runtime-lane.d.ts +69 -0
  208. package/lib/model-runtime-lane.d.ts.map +1 -0
  209. package/lib/model-runtime-lane.js +122 -0
  210. package/lib/model-runtime-recipe.d.ts +132 -0
  211. package/lib/model-runtime-recipe.d.ts.map +1 -0
  212. package/lib/model-runtime-recipe.js +291 -0
  213. package/lib/planning.d.ts +256 -0
  214. package/lib/planning.d.ts.map +1 -0
  215. package/lib/planning.js +471 -0
  216. package/lib/playbook.d.ts +42 -0
  217. package/lib/playbook.d.ts.map +1 -0
  218. package/lib/playbook.js +65 -0
  219. package/lib/prepared-assets.d.ts +269 -0
  220. package/lib/prepared-assets.d.ts.map +1 -0
  221. package/lib/prepared-assets.js +471 -0
  222. package/lib/provider-bridge.d.ts +107 -0
  223. package/lib/provider-bridge.d.ts.map +1 -0
  224. package/lib/provider-bridge.js +423 -0
  225. package/lib/ptc-authority.d.ts +154 -0
  226. package/lib/ptc-authority.d.ts.map +1 -0
  227. package/lib/ptc-authority.js +242 -0
  228. package/lib/ptc-confinement.d.ts +60 -0
  229. package/lib/ptc-confinement.d.ts.map +1 -0
  230. package/lib/ptc-confinement.js +212 -0
  231. package/lib/ptc-runtime.d.ts +166 -0
  232. package/lib/ptc-runtime.d.ts.map +1 -0
  233. package/lib/ptc-runtime.js +231 -0
  234. package/lib/publication.d.ts +161 -0
  235. package/lib/publication.d.ts.map +1 -0
  236. package/lib/publication.js +181 -0
  237. package/lib/receipt-store.d.ts +57 -0
  238. package/lib/receipt-store.d.ts.map +1 -0
  239. package/lib/receipt-store.js +143 -0
  240. package/lib/receipt.d.ts +231 -0
  241. package/lib/receipt.d.ts.map +1 -0
  242. package/lib/receipt.js +165 -0
  243. package/lib/registrar.d.ts +75 -0
  244. package/lib/registrar.d.ts.map +1 -0
  245. package/lib/registrar.js +152 -0
  246. package/lib/resource-governance.d.ts +204 -0
  247. package/lib/resource-governance.d.ts.map +1 -0
  248. package/lib/resource-governance.js +213 -0
  249. package/lib/server-lifecycle.d.ts +175 -0
  250. package/lib/server-lifecycle.d.ts.map +1 -0
  251. package/lib/server-lifecycle.js +269 -0
  252. package/lib/skills.d.ts +31 -0
  253. package/lib/skills.d.ts.map +1 -0
  254. package/lib/skills.js +170 -0
  255. package/lib/speech-bridge.d.ts +74 -0
  256. package/lib/speech-bridge.d.ts.map +1 -0
  257. package/lib/speech-bridge.js +115 -0
  258. package/lib/state.d.ts +100 -0
  259. package/lib/state.d.ts.map +1 -0
  260. package/lib/state.js +160 -0
  261. package/lib/title-proposal.d.ts +194 -0
  262. package/lib/title-proposal.d.ts.map +1 -0
  263. package/lib/title-proposal.js +244 -0
  264. package/lib/tool-inventory.d.ts +90 -0
  265. package/lib/tool-inventory.d.ts.map +1 -0
  266. package/lib/tool-inventory.js +102 -0
  267. package/lib/tool-mode-run.d.ts +310 -0
  268. package/lib/tool-mode-run.d.ts.map +1 -0
  269. package/lib/tool-mode-run.js +411 -0
  270. package/lib/tool-sources.d.ts +80 -0
  271. package/lib/tool-sources.d.ts.map +1 -0
  272. package/lib/tool-sources.js +123 -0
  273. package/lib/tool-usage-projection.d.ts +390 -0
  274. package/lib/tool-usage-projection.d.ts.map +1 -0
  275. package/lib/tool-usage-projection.js +1038 -0
  276. package/lib/tool-usage-report.d.ts +153 -0
  277. package/lib/tool-usage-report.d.ts.map +1 -0
  278. package/lib/tool-usage-report.js +274 -0
  279. package/lib/transport.d.ts +158 -0
  280. package/lib/transport.d.ts.map +1 -0
  281. package/lib/transport.js +332 -0
  282. package/lib/types.d.ts +134 -0
  283. package/lib/types.d.ts.map +1 -0
  284. package/lib/types.js +8 -0
  285. package/lib/update-surface.d.ts +79 -0
  286. package/lib/update-surface.d.ts.map +1 -0
  287. package/lib/update-surface.js +224 -0
  288. package/lib/version.d.ts +3 -0
  289. package/lib/version.d.ts.map +1 -0
  290. package/lib/version.js +27 -0
  291. package/node_modules/@try-works/tool-mode-contracts/lib/contract-metadata.d.ts +13 -0
  292. package/node_modules/@try-works/tool-mode-contracts/lib/contract-metadata.d.ts.map +1 -0
  293. package/node_modules/@try-works/tool-mode-contracts/lib/contract-metadata.js +85 -0
  294. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/lang-detect.d.ts +16 -0
  295. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/lang-detect.d.ts.map +1 -0
  296. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/lang-detect.js +87 -0
  297. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.d.ts +38 -0
  298. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.d.ts.map +1 -0
  299. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.js +445 -0
  300. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/stt-transcribe.d.ts +20 -0
  301. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/stt-transcribe.d.ts.map +1 -0
  302. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/stt-transcribe.js +112 -0
  303. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.d.ts +14 -0
  304. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.d.ts.map +1 -0
  305. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.js +63 -0
  306. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.d.ts +14 -0
  307. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.d.ts.map +1 -0
  308. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.js +76 -0
  309. package/node_modules/@try-works/tool-mode-contracts/lib/dsh.d.ts +82 -0
  310. package/node_modules/@try-works/tool-mode-contracts/lib/dsh.d.ts.map +1 -0
  311. package/node_modules/@try-works/tool-mode-contracts/lib/dsh.js +274 -0
  312. package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts +26 -0
  313. package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts.map +1 -0
  314. package/node_modules/@try-works/tool-mode-contracts/lib/index.js +53 -0
  315. package/node_modules/@try-works/tool-mode-contracts/lib/meta.d.ts +133 -0
  316. package/node_modules/@try-works/tool-mode-contracts/lib/meta.d.ts.map +1 -0
  317. package/node_modules/@try-works/tool-mode-contracts/lib/meta.js +64 -0
  318. package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts +121 -0
  319. package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts.map +1 -0
  320. package/node_modules/@try-works/tool-mode-contracts/lib/registry.js +246 -0
  321. package/node_modules/@try-works/tool-mode-contracts/package.json +35 -0
  322. package/node_modules/@try-works/tool-mode-extension-sdk/bin/dsh-tool-mode.mjs +20 -0
  323. package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.d.ts +80 -0
  324. package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.d.ts.map +1 -0
  325. package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.js +533 -0
  326. package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.d.ts +86 -0
  327. package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.d.ts.map +1 -0
  328. package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.js +145 -0
  329. package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.d.ts +70 -0
  330. package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.d.ts.map +1 -0
  331. package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.js +201 -0
  332. package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.d.ts +57 -0
  333. package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.d.ts.map +1 -0
  334. package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.js +83 -0
  335. package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.d.ts +33 -0
  336. package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.d.ts.map +1 -0
  337. package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.js +33 -0
  338. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.d.ts +86 -0
  339. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.d.ts.map +1 -0
  340. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.js +191 -0
  341. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.d.ts +137 -0
  342. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.d.ts.map +1 -0
  343. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.js +349 -0
  344. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts +274 -0
  345. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts.map +1 -0
  346. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.js +932 -0
  347. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.d.ts +210 -0
  348. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.d.ts.map +1 -0
  349. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.js +368 -0
  350. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.d.ts +63 -0
  351. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.d.ts.map +1 -0
  352. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.js +149 -0
  353. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.d.ts +35 -0
  354. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.d.ts.map +1 -0
  355. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.js +179 -0
  356. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.d.ts +179 -0
  357. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.d.ts.map +1 -0
  358. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.js +299 -0
  359. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts +395 -0
  360. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts.map +1 -0
  361. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.js +839 -0
  362. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.d.ts +44 -0
  363. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.d.ts.map +1 -0
  364. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.js +255 -0
  365. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.d.ts +185 -0
  366. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.d.ts.map +1 -0
  367. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.js +504 -0
  368. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.d.ts +17 -0
  369. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.d.ts.map +1 -0
  370. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.js +80 -0
  371. package/node_modules/@try-works/tool-mode-extension-sdk/lib/licensing.d.ts +221 -0
  372. package/node_modules/@try-works/tool-mode-extension-sdk/lib/licensing.d.ts.map +1 -0
  373. package/node_modules/@try-works/tool-mode-extension-sdk/lib/licensing.js +188 -0
  374. package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.d.ts +52 -0
  375. package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.d.ts.map +1 -0
  376. package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.js +102 -0
  377. package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.d.ts +171 -0
  378. package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.d.ts.map +1 -0
  379. package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.js +271 -0
  380. package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.d.ts +242 -0
  381. package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.d.ts.map +1 -0
  382. package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.js +58 -0
  383. package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.d.ts +128 -0
  384. package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.d.ts.map +1 -0
  385. package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.js +113 -0
  386. package/node_modules/@try-works/tool-mode-extension-sdk/lib/test-host.d.ts +41 -0
  387. package/node_modules/@try-works/tool-mode-extension-sdk/lib/test-host.d.ts.map +1 -0
  388. package/node_modules/@try-works/tool-mode-extension-sdk/lib/test-host.js +52 -0
  389. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.d.ts +2 -0
  390. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.d.ts.map +1 -0
  391. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.js +351 -0
  392. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.d.ts +157 -0
  393. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.d.ts.map +1 -0
  394. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.js +688 -0
  395. package/node_modules/@try-works/tool-mode-extension-sdk/package.json +54 -0
  396. package/node_modules/@try-works/tool-mode-extension-sdk/schema/extension-manifest-1.1.0.schema.json +253 -0
  397. package/node_modules/@try-works/tool-mode-recipes/bin/tool-mode-recipe.mjs +15 -0
  398. package/node_modules/@try-works/tool-mode-recipes/lib/broker.d.ts +460 -0
  399. package/node_modules/@try-works/tool-mode-recipes/lib/broker.d.ts.map +1 -0
  400. package/node_modules/@try-works/tool-mode-recipes/lib/broker.js +647 -0
  401. package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts +61 -0
  402. package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts.map +1 -0
  403. package/node_modules/@try-works/tool-mode-recipes/lib/cli.js +1106 -0
  404. package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.d.ts +237 -0
  405. package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.d.ts.map +1 -0
  406. package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.js +205 -0
  407. package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.d.ts +85 -0
  408. package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.d.ts.map +1 -0
  409. package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.js +176 -0
  410. package/node_modules/@try-works/tool-mode-recipes/lib/images.d.ts +119 -0
  411. package/node_modules/@try-works/tool-mode-recipes/lib/images.d.ts.map +1 -0
  412. package/node_modules/@try-works/tool-mode-recipes/lib/images.js +201 -0
  413. package/node_modules/@try-works/tool-mode-recipes/lib/index.d.ts +25 -0
  414. package/node_modules/@try-works/tool-mode-recipes/lib/index.d.ts.map +1 -0
  415. package/node_modules/@try-works/tool-mode-recipes/lib/index.js +25 -0
  416. package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.d.ts +345 -0
  417. package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.d.ts.map +1 -0
  418. package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.js +1465 -0
  419. package/node_modules/@try-works/tool-mode-recipes/lib/templates.d.ts +51 -0
  420. package/node_modules/@try-works/tool-mode-recipes/lib/templates.d.ts.map +1 -0
  421. package/node_modules/@try-works/tool-mode-recipes/lib/templates.js +310 -0
  422. package/node_modules/@try-works/tool-mode-recipes/lib/titles.d.ts +231 -0
  423. package/node_modules/@try-works/tool-mode-recipes/lib/titles.d.ts.map +1 -0
  424. package/node_modules/@try-works/tool-mode-recipes/lib/titles.js +435 -0
  425. package/node_modules/@try-works/tool-mode-recipes/package.json +56 -0
  426. package/node_modules/@try-works/tool-mode-recipes/recipes/describe-image.json +38 -0
  427. package/node_modules/@try-works/tool-mode-recipes/recipes/text-title.json +45 -0
  428. package/node_modules/@try-works/tool-mode-recipes/schema/harness-model-recipe.schema.json +273 -0
  429. package/package.json +127 -4
  430. package/remote/spec.mjs +993 -0
  431. package/remote/typert.host.mjs +14 -0
  432. package/remote/typert.remote-client.mjs +16 -0
@@ -0,0 +1,192 @@
1
+ /**
2
+ * Capability resolution: decide whether a catalog model can actually run in
3
+ * this DSH process, and by which route.
4
+ *
5
+ * The rule this module enforces is that a model becomes a tool only when an
6
+ * adapter can really invoke it. Every other model stays catalogued and
7
+ * reportable, so `model_tools` can explain what is missing instead of the agent
8
+ * discovering a broken tool at call time.
9
+ *
10
+ * @module @try-works/dsh-tool-mode/capability
11
+ */
12
+ import { createRequire } from 'node:module';
13
+ import { DEFAULT_CLI_COMMAND } from "./transport.js";
14
+ /**
15
+ * Node resolution context for this plugin.
16
+ *
17
+ * The plugin must resolve model packages from the DSH installation that is
18
+ * hosting it, not from its own nested `node_modules`, so that an operator who
19
+ * installs `@desert-ant-labs/tongue` into the profile gets a working tool.
20
+ */
21
+ const requireFromHere = createRequire(import.meta.url);
22
+ /**
23
+ * Whether a package specifier resolves from this plugin's installation.
24
+ *
25
+ * Resolution deliberately does not load the module: importing a model package
26
+ * pulls in a WASM or native runtime, and capability probing must stay cheap
27
+ * enough to run at plugin load.
28
+ * @param specifier - package name, optionally with a subpath.
29
+ * @returns whether Node can resolve the specifier.
30
+ */
31
+ export function canResolve(specifier) {
32
+ try {
33
+ requireFromHere.resolve(specifier);
34
+ return true;
35
+ }
36
+ catch {
37
+ return false;
38
+ }
39
+ }
40
+ /** Join a package and its documented subpath into one specifier. */
41
+ export function packageSpecifier(pkg, subpath) {
42
+ return subpath === null ? pkg : `${pkg}${subpath}`;
43
+ }
44
+ /** Reason text for a model that has no runnable route on any platform. */
45
+ function unavailableReason(entry) {
46
+ if (entry.closedBeta) {
47
+ return `${entry.name} is in closed beta: the weights are published at ${entry.hfRepo} but no SDK ships them yet, so it cannot be installed as a tool.`;
48
+ }
49
+ if (entry.appleOnly) {
50
+ return `${entry.name} is Apple-only (Core ML/MLX through the Swift package); there is no JavaScript SDK, so it cannot run in a Node process. Point \`remote.endpoint\` at a bridge on an Apple machine to reach it.`;
51
+ }
52
+ if (entry.npmPackage === null && entry.cliVerb === null) {
53
+ return `${entry.name} has no npm package and no CLI verb, so no transport can reach it.`;
54
+ }
55
+ if (entry.npmPackage === null) {
56
+ return `${entry.name} has no npm package; run it through the Desert Ant CLI (macOS/Linux) with \`cli.enabled\`, or through a bridge with \`remote.endpoint\`.`;
57
+ }
58
+ return `${entry.name} has no runtime available to this process.`;
59
+ }
60
+ /** Whether the CLI can carry this model at all. */
61
+ function cliCapable(entry) {
62
+ return entry.cliVerb !== null && !entry.closedBeta;
63
+ }
64
+ /**
65
+ * Resolve how (and whether) one model can run here.
66
+ *
67
+ * Transport preference is deliberate: an in-process package is fastest and
68
+ * needs no external service, so it wins; the CLI is local but out-of-process;
69
+ * the bridge is last because it depends on another machine. A user who would
70
+ * rather route everything through a bridge can disable the other two.
71
+ * @param entry - the catalog entry to resolve.
72
+ * @param options - overrides for testing; `resolve`, `platform` and the transport switches replace the process facts.
73
+ * @returns the verdict, including the reason for every negative one.
74
+ */
75
+ export function resolveCapability(entry, options = {}) {
76
+ const resolve = options.resolve ?? canResolve;
77
+ const platform = options.platform ?? process.platform;
78
+ const allowNpm = options.allowNpm ?? true;
79
+ const remoteEndpoint = options.remoteEndpoint;
80
+ // A bridge is checked first among the fallbacks because it is the only route
81
+ // for Apple-only models, which have neither a package nor (for some) a verb.
82
+ const bridgeUsable = remoteEndpoint !== undefined && remoteEndpoint.length > 0 && !entry.closedBeta;
83
+ if (entry.provider !== undefined && !entry.closedBeta) {
84
+ const extensionManifest = `${entry.provider.extension}/package.json`;
85
+ if (resolve(extensionManifest)) {
86
+ return {
87
+ runnable: true,
88
+ route: 'extension',
89
+ reason: `${entry.name} is implemented by the Tool Mode extension ${entry.provider.extension}; provider readiness is checked through that extension before publication and again for discovery.`,
90
+ resolved: [extensionManifest],
91
+ };
92
+ }
93
+ return {
94
+ runnable: false,
95
+ route: 'unavailable',
96
+ reason: `${entry.name} declares the Tool Mode extension ${entry.provider.extension}, which is not installed or not resolvable from this host. Install and activate that extension, or correct the catalog binding.`,
97
+ missing: [extensionManifest],
98
+ };
99
+ }
100
+ const pkg = entry.npmPackage;
101
+ // Why the in-process route did not pan out. Kept so the final verdict can name
102
+ // the exact missing piece ("install onnxruntime-node") instead of falling back
103
+ // to a generic sentence once the CLI and bridge have also been ruled out.
104
+ let npmMiss;
105
+ if (pkg !== null && allowNpm) {
106
+ const missingRuntimes = entry.requiresRuntime.filter(name => !resolve(name));
107
+ if (missingRuntimes.length > 0) {
108
+ npmMiss = {
109
+ reason: `${entry.name} needs ${missingRuntimes.join(', ')} to run here; install it beside the plugin (npm i ${missingRuntimes.join(' ')}).`,
110
+ missing: missingRuntimes,
111
+ };
112
+ }
113
+ else {
114
+ const native = packageSpecifier(pkg, entry.npmSubpath);
115
+ const onnx = entry.requiresRuntime.length > 0;
116
+ // A declared ONNX runtime wins over the package's own default entry: for
117
+ // these packages the default import is the browser build, which refuses
118
+ // to initialize in Node.
119
+ if (onnx) {
120
+ if (resolve(pkg)) {
121
+ return {
122
+ runnable: true,
123
+ route: 'npm-onnxruntime',
124
+ reason: `${entry.name} runs through ${entry.requiresRuntime.join(', ')}.`,
125
+ resolved: [...entry.requiresRuntime, pkg],
126
+ };
127
+ }
128
+ npmMiss = {
129
+ reason: `${entry.name} requires the ${pkg} package, which is not installed.`,
130
+ missing: [pkg],
131
+ };
132
+ }
133
+ else if (platform === 'win32' && entry.windowsSupport === 'browser-only') {
134
+ npmMiss = {
135
+ reason: `${entry.name} has no prebuilt native build for win32-${process.arch}: ${native} supports linux-x64, linux-arm64 and darwin-arm64 only.`,
136
+ missing: [native],
137
+ };
138
+ }
139
+ else if (resolve(native)) {
140
+ return {
141
+ runnable: true,
142
+ route: 'npm-native',
143
+ reason: `${entry.name} resolves ${native} for this platform.`,
144
+ resolved: [native],
145
+ };
146
+ }
147
+ else {
148
+ npmMiss = {
149
+ reason: `${entry.name} requires the ${native} package, which is not installed.`,
150
+ missing: [native],
151
+ };
152
+ }
153
+ }
154
+ }
155
+ // The CLI runs every shipping model on macOS and Linux, so it is checked
156
+ // before giving up — including for models whose npm prebuild is missing here.
157
+ if (cliCapable(entry) && (options.cliAvailable ?? false)) {
158
+ return {
159
+ runnable: true,
160
+ route: 'cli',
161
+ reason: `${entry.name} runs through the Desert Ant CLI (\`${DEFAULT_CLI_COMMAND} ${entry.cliVerb}\`).`,
162
+ resolved: [DEFAULT_CLI_COMMAND],
163
+ };
164
+ }
165
+ if (bridgeUsable) {
166
+ return {
167
+ runnable: true,
168
+ route: 'remote',
169
+ reason: `${entry.name} is reached through the bridge at ${remoteEndpoint}.`,
170
+ resolved: [remoteEndpoint],
171
+ };
172
+ }
173
+ if (npmMiss !== undefined && !entry.closedBeta && !entry.appleOnly) {
174
+ return {
175
+ runnable: false,
176
+ route: 'unavailable',
177
+ reason: npmMiss.reason,
178
+ missing: npmMiss.missing,
179
+ };
180
+ }
181
+ return { runnable: false, route: 'unavailable', reason: unavailableReason(entry) };
182
+ }
183
+ /**
184
+ * Resolve every catalog entry.
185
+ * @param entries - validated catalog entries.
186
+ * @param options - resolution overrides, forwarded to {@link resolveCapability}.
187
+ * @returns one record per entry, in catalog order.
188
+ */
189
+ export function resolveCatalog(entries, options = {}) {
190
+ return entries.map(entry => ({ entry, verdict: resolveCapability(entry, options) }));
191
+ }
192
+ //# sourceMappingURL=capability.js.map
@@ -0,0 +1,97 @@
1
+ /**
2
+ * The full capture path, and the metadata-only profile (OBS-03).
3
+ *
4
+ * THE PREMISE OBS-03 STARTS FROM, and it is the uncomfortable one: **this plugin's defaults
5
+ * cannot guarantee privacy.** A body that is never written by us may still be captured by
6
+ * ANOTHER DSH logging plugin, because DSH's LLM service requires model-visible inputs to be
7
+ * reconstructable — so a harness call's prompt necessarily passes through a surface a sibling
8
+ * plugin can observe. Nothing this plugin does can close that.
9
+ *
10
+ * What this plugin CAN do is be honest about it, which is what the requirement asks for in three
11
+ * parts:
12
+ *
13
+ * 1. **Document the full capture path** — every place a body can come to rest, including the
14
+ * ones outside this plugin's control. A privacy claim that names only our own writes is
15
+ * misleading precisely because the reader will assume it is complete.
16
+ * 2. **Provide and TEST a metadata-only profile** for the headless local-specialist case, where
17
+ * an operator wants the tools without any body retention.
18
+ * 3. **REFUSE rather than silently log** where a no-retention policy cannot be honoured
19
+ * alongside DSH's reconstructability contract. `harnessExecutionDecision` in
20
+ * `diagnostics.ts` makes that decision; this module says which profile it applies to.
21
+ *
22
+ * @module @try-works/dsh-tool-mode/capture-path
23
+ */
24
+ /** Where a request or response body can come to rest. */
25
+ export interface CaptureSurface {
26
+ /** A stable name for the surface. */
27
+ readonly surface: string;
28
+ /**
29
+ * Whether THIS plugin writes bodies there.
30
+ *
31
+ * `false` does not mean the surface is safe — it means this plugin is not the author. That
32
+ * distinction is the whole reason the field exists: a reader must not mistake "we do not
33
+ * write here" for "nothing is written here".
34
+ */
35
+ readonly writtenByThisPlugin: boolean;
36
+ /** What actually lands there. */
37
+ readonly contents: string;
38
+ /** What an operator can do about it. */
39
+ readonly control: string;
40
+ }
41
+ /**
42
+ * The FULL capture path, including surfaces outside this plugin's control.
43
+ *
44
+ * Ordered from what this plugin owns to what it does not, so a reader sees the boundary
45
+ * explicitly rather than inferring it from a list of our own writes.
46
+ */
47
+ export declare const CAPTURE_PATH: readonly CaptureSurface[];
48
+ /** Which capture policy a deployment runs under (OBS-03). */
49
+ export type CaptureProfile =
50
+ /** Ordinary operation: receipts and accounting, bodies owned by the surfaces above. */
51
+ 'standard'
52
+ /**
53
+ * Headless local-specialist: METADATA ONLY.
54
+ *
55
+ * Composed by an operator who wants the tools without any body retention at all. Everything
56
+ * this plugin writes is metadata; the profile additionally forbids the one path where this
57
+ * plugin could be the author of a body, and refuses harness-backed execution when the
58
+ * deployment's policy cannot satisfy DSH's reconstructability contract.
59
+ */
60
+ | 'metadata-only';
61
+ /** What a profile permits. */
62
+ export interface ProfilePolicy {
63
+ readonly profile: CaptureProfile;
64
+ /** Whether this profile may serve harness-backed (model-calling) tools at all. */
65
+ readonly permitsHarnessExecution: boolean;
66
+ /** Whether this plugin writes any request or response BODY. */
67
+ readonly writesBodies: boolean;
68
+ /** Surfaces this profile does not close, so a reader sees the residual risk. */
69
+ readonly residualSurfaces: readonly string[];
70
+ }
71
+ /**
72
+ * Describe a profile's policy.
73
+ *
74
+ * @param profile - the profile to describe.
75
+ * @param policy - the deployment's retention facts.
76
+ * @returns what the profile permits, and what it does not close.
77
+ */
78
+ export declare function profilePolicy(profile: CaptureProfile, policy: {
79
+ readonly retainsBodies: boolean;
80
+ readonly requiresReconstructableInputs: boolean;
81
+ }): ProfilePolicy;
82
+ /**
83
+ * Whether a profile may serve one tool.
84
+ *
85
+ * @param profile - the active profile.
86
+ * @param policy - the deployment's retention facts.
87
+ * @param harnessBacked - whether the tool calls a model.
88
+ * @returns the decision, with the reason when it refuses.
89
+ */
90
+ export declare function admitsTool(profile: CaptureProfile, policy: {
91
+ readonly retainsBodies: boolean;
92
+ readonly requiresReconstructableInputs: boolean;
93
+ }, harnessBacked: boolean): {
94
+ readonly admitted: boolean;
95
+ readonly reason?: string;
96
+ };
97
+ //# sourceMappingURL=capture-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-path.d.ts","sourceRoot":"","sources":["../src/capture-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,yDAAyD;AACzD,MAAM,WAAW,cAAc;IAC7B,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB;;;;;;OAMG;IACH,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAA;IACrC,iCAAiC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,cAAc,EAuEjD,CAAA;AAED,6DAA6D;AAC7D,MAAM,MAAM,cAAc;AACxB,uFAAuF;AACrF,UAAU;AACZ;;;;;;;GAOG;GACD,eAAe,CAAA;AAEnB,8BAA8B;AAC9B,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;IAChC,kFAAkF;IAClF,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAA;IACzC,+DAA+D;IAC/D,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;IAC9B,gFAAgF;IAChF,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAA;CAC7C;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE;IAAE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,6BAA6B,EAAE,OAAO,CAAA;CAAE,GAC3F,aAAa,CA+Bf;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE;IAAE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,6BAA6B,EAAE,OAAO,CAAA;CAAE,EAC5F,aAAa,EAAE,OAAO,GACrB;IAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAiB1D"}
@@ -0,0 +1,152 @@
1
+ /**
2
+ * The full capture path, and the metadata-only profile (OBS-03).
3
+ *
4
+ * THE PREMISE OBS-03 STARTS FROM, and it is the uncomfortable one: **this plugin's defaults
5
+ * cannot guarantee privacy.** A body that is never written by us may still be captured by
6
+ * ANOTHER DSH logging plugin, because DSH's LLM service requires model-visible inputs to be
7
+ * reconstructable — so a harness call's prompt necessarily passes through a surface a sibling
8
+ * plugin can observe. Nothing this plugin does can close that.
9
+ *
10
+ * What this plugin CAN do is be honest about it, which is what the requirement asks for in three
11
+ * parts:
12
+ *
13
+ * 1. **Document the full capture path** — every place a body can come to rest, including the
14
+ * ones outside this plugin's control. A privacy claim that names only our own writes is
15
+ * misleading precisely because the reader will assume it is complete.
16
+ * 2. **Provide and TEST a metadata-only profile** for the headless local-specialist case, where
17
+ * an operator wants the tools without any body retention.
18
+ * 3. **REFUSE rather than silently log** where a no-retention policy cannot be honoured
19
+ * alongside DSH's reconstructability contract. `harnessExecutionDecision` in
20
+ * `diagnostics.ts` makes that decision; this module says which profile it applies to.
21
+ *
22
+ * @module @try-works/dsh-tool-mode/capture-path
23
+ */
24
+ /**
25
+ * The FULL capture path, including surfaces outside this plugin's control.
26
+ *
27
+ * Ordered from what this plugin owns to what it does not, so a reader sees the boundary
28
+ * explicitly rather than inferring it from a list of our own writes.
29
+ */
30
+ export const CAPTURE_PATH = [
31
+ {
32
+ surface: 'tool invocation arguments',
33
+ writtenByThisPlugin: false,
34
+ contents: 'The arguments a caller passes to a tool. They reach the implementation, and for a '
35
+ + 'harness-backed tool they become part of the rendered prompt.',
36
+ control: 'The caller decides what to pass. This plugin adds nothing to the arguments and copies '
37
+ + 'them nowhere.',
38
+ },
39
+ {
40
+ surface: 'managed-worker stdout/stderr',
41
+ writtenByThisPlugin: false,
42
+ contents: 'Whatever an extension process prints. An extension that logs its own inputs puts bodies '
43
+ + 'into a stream this plugin does not author or read.',
44
+ control: 'Extension authors control their own logging. The isolation mode is declared in the '
45
+ + 'manifest, and the diagnostics surface reports it.',
46
+ },
47
+ {
48
+ surface: 'DSH LLM service',
49
+ writtenByThisPlugin: false,
50
+ contents: 'THE SURFACE THIS PLUGIN CANNOT CLOSE. DSH requires model-visible inputs to be '
51
+ + 'reconstructable, so a harness call\'s prompt passes through the LLM service by design.',
52
+ control: 'An operator-level policy, not a plugin setting. Where no-retention conflicts with '
53
+ + 'reconstructability, the correct response is to REFUSE harness-backed execution — which '
54
+ + 'this plugin does rather than logging bodies or bypassing DSH.',
55
+ },
56
+ {
57
+ surface: 'another DSH logging plugin',
58
+ writtenByThisPlugin: false,
59
+ contents: 'Any body a sibling plugin observes through a DSH hook. This plugin neither knows what '
60
+ + 'they capture nor can it prevent them.',
61
+ control: 'Operator configuration of the OTHER plugin. This is the specific case OBS-03 names, and '
62
+ + 'it is why the plugin defaults cannot be presented as a privacy guarantee.',
63
+ },
64
+ {
65
+ surface: 'the auxiliary-call journal (section 19)',
66
+ writtenByThisPlugin: true,
67
+ contents: 'Harness-backed auxiliary calls, recorded under a SEPARATE authorization from ordinary '
68
+ + 'tool receipts. The broker refuses to construct without a journal sink, so a '
69
+ + 'harness-backed run that records nothing cannot exist.',
70
+ control: 'A deployment composes the sink or the broker refuses. The journal is the mechanism that '
71
+ + 'makes a harness call auditable without putting its body in an ordinary log.',
72
+ },
73
+ {
74
+ surface: 'invocation accounting',
75
+ writtenByThisPlugin: true,
76
+ contents: 'Timings, outcome class and byte SIZES. The record has no field that can hold a payload, '
77
+ + 'which is asserted structurally rather than promised.',
78
+ control: 'Always on. There is nothing to configure because there is nothing sensitive in it.',
79
+ },
80
+ {
81
+ surface: 'tool receipts',
82
+ writtenByThisPlugin: true,
83
+ contents: 'Identity and provenance — contract, implementation, extension version, content digest, '
84
+ + 'activation generation, caller scope. No credentials and no bodies.',
85
+ control: 'Disabled by an explicit configuration flag, which is visible on the diagnostics surface.',
86
+ },
87
+ ];
88
+ /**
89
+ * Describe a profile's policy.
90
+ *
91
+ * @param profile - the profile to describe.
92
+ * @param policy - the deployment's retention facts.
93
+ * @returns what the profile permits, and what it does not close.
94
+ */
95
+ export function profilePolicy(profile, policy) {
96
+ /**
97
+ * The surfaces no profile can close, listed for BOTH profiles because the difference between
98
+ * them is what THIS plugin writes — not what a sibling plugin does.
99
+ */
100
+ const residualSurfaces = CAPTURE_PATH
101
+ .filter(surface => !surface.writtenByThisPlugin)
102
+ .map(surface => surface.surface);
103
+ if (profile === 'standard') {
104
+ return {
105
+ profile,
106
+ permitsHarnessExecution: true,
107
+ writesBodies: false,
108
+ residualSurfaces,
109
+ };
110
+ }
111
+ /**
112
+ * METADATA ONLY. The plugin still writes no bodies — it never did — and the profile adds the
113
+ * REFUSAL: where a no-retention policy conflicts with DSH's reconstructability requirement,
114
+ * harness-backed execution is not served at all. Logging bodies against the policy and
115
+ * bypassing DSH are both forbidden, which leaves refusing.
116
+ */
117
+ const conflict = !policy.retainsBodies && policy.requiresReconstructableInputs;
118
+ return {
119
+ profile,
120
+ permitsHarnessExecution: !conflict,
121
+ writesBodies: false,
122
+ residualSurfaces,
123
+ };
124
+ }
125
+ /**
126
+ * Whether a profile may serve one tool.
127
+ *
128
+ * @param profile - the active profile.
129
+ * @param policy - the deployment's retention facts.
130
+ * @param harnessBacked - whether the tool calls a model.
131
+ * @returns the decision, with the reason when it refuses.
132
+ */
133
+ export function admitsTool(profile, policy, harnessBacked) {
134
+ const described = profilePolicy(profile, policy);
135
+ /**
136
+ * A NON-harness tool is admitted under every profile: it calls no model, so there is no body
137
+ * for the reconstructability contract to be about, and refusing it would remove working
138
+ * functionality for no privacy gain.
139
+ */
140
+ if (!harnessBacked)
141
+ return { admitted: true };
142
+ if (described.permitsHarnessExecution)
143
+ return { admitted: true };
144
+ return {
145
+ admitted: false,
146
+ reason: 'the metadata-only profile refuses harness-backed execution because the deployment does '
147
+ + 'not retain bodies while DSH requires model-visible inputs to be reconstructable. '
148
+ + 'Logging bodies against the policy and bypassing DSH are both forbidden, so the tool is '
149
+ + 'not served.',
150
+ };
151
+ }
152
+ //# sourceMappingURL=capture-path.js.map
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Loads and validates the Desert Ant Labs model catalog.
3
+ *
4
+ * The catalog is plain JSON shipped beside the plugin so that a deployment can
5
+ * inspect or override it without rebuilding: `catalogFile` points at another
6
+ * document with the same shape.
7
+ *
8
+ * @module @try-works/dsh-tool-mode/catalog
9
+ */
10
+ import type { ModelCatalogEntry } from './types.ts';
11
+ /** Absolute path of the catalog document shipped with this package. */
12
+ export declare const DEFAULT_CATALOG_FILE: string;
13
+ /** Raised when the catalog document is missing, unparseable, or malformed. */
14
+ export declare class CatalogError extends Error {
15
+ readonly name = "CatalogError";
16
+ }
17
+ /**
18
+ * Parse and validate one catalog entry. Validation is strict on purpose: every
19
+ * downstream decision (which tool to register, whether it can run, what the
20
+ * model sees) reads these fields, so a malformed entry must fail at load rather
21
+ * than become a silently missing tool.
22
+ * @param raw - one decoded JSON object.
23
+ * @param source - description of where the document came from, for messages.
24
+ * @param index - position in the array, for entries with no usable id.
25
+ * @returns the validated entry.
26
+ */
27
+ export declare function parseCatalogEntry(raw: unknown, source: string, index: number): ModelCatalogEntry;
28
+ /**
29
+ * Load the catalog from a JSON document.
30
+ * @param file - absolute path of the catalog document.
31
+ * @returns every validated entry, in document order.
32
+ * @throws CatalogError when the file cannot be read, is not valid JSON, is not an array, or holds a malformed entry.
33
+ */
34
+ export declare function loadCatalog(file?: string): ModelCatalogEntry[];
35
+ /** Index a catalog by model id. */
36
+ export declare function indexCatalog(entries: readonly ModelCatalogEntry[]): Map<string, ModelCatalogEntry>;
37
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAA0D,MAAM,YAAY,CAAA;AAE3G,uEAAuE;AACvE,eAAO,MAAM,oBAAoB,QAEhC,CAAA;AAWD,8EAA8E;AAC9E,qBAAa,YAAa,SAAQ,KAAK;IACrC,SAAkB,IAAI,kBAAiB;CACxC;AAyGD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAuGhG;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,GAAE,MAA6B,GAAG,iBAAiB,EAAE,CA6BpF;AAED,mCAAmC;AACnC,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAElG"}