@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,224 @@
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 { commitUpdate, recordApproval, rollback, ExtensionStore } from '@try-works/tool-mode-extension-sdk';
25
+ import { existsSync, readFileSync, readdirSync } from 'node:fs';
26
+ import { join } from 'node:path';
27
+ /** The current pointer for one extension, read from the profile pointers. */
28
+ function currentPointer(store, profile, extensionId) {
29
+ const pointers = store.readProfilePointers(profile);
30
+ if (pointers.corrupt) {
31
+ throw new Error(`the profile pointers are unreadable: ${pointers.diagnostic ?? 'unknown reason'}`);
32
+ }
33
+ return pointers.value.activeVersions[extensionId];
34
+ }
35
+ /** The staged-update metadata file for one staged directory. */
36
+ const stageMetadataPath = (stagedDir) => join(stagedDir, 'update-stage.json');
37
+ /**
38
+ * A rebind failure whose PREVIOUS surface the wrapper already restored.
39
+ *
40
+ * The commit catch would otherwise restore the previous surface a second time
41
+ * (the REBIND-REVERT contract: the wrapper owns the revert; the catch owns the
42
+ * post-quiesce-failure restore, which is a different situation).
43
+ */
44
+ class RebindRestoredFailure extends Error {
45
+ constructor(message, cause) {
46
+ super(message, { cause });
47
+ this.name = 'RebindRestoredFailure';
48
+ }
49
+ }
50
+ /** Bound one promise host-side: the caller stops waiting, the work may continue. */
51
+ async function withTimeout(promise, timeoutMs, label) {
52
+ let timer;
53
+ const bound = new Promise((_resolve, reject) => {
54
+ timer = setTimeout(() => reject(new Error(`${label} timed out after ${timeoutMs} ms (host-side bound)`)), timeoutMs);
55
+ if (typeof timer === 'object' && timer !== null && 'unref' in timer && typeof timer.unref === 'function') {
56
+ // Kept REFERENCED deliberately: a hanging rebind must not let the process
57
+ // exit mid-update; the timeout is what bounds it.
58
+ }
59
+ });
60
+ try {
61
+ return await Promise.race([promise, bound]);
62
+ }
63
+ finally {
64
+ if (timer !== undefined)
65
+ clearTimeout(timer);
66
+ }
67
+ }
68
+ /**
69
+ * Create the host update surface.
70
+ * @param options - the store location, profile, lifecycle hooks and the timeout bound.
71
+ * @returns the surface.
72
+ */
73
+ export function createUpdateHostSurface(options) {
74
+ const store = new ExtensionStore(options.storeDir);
75
+ const timeoutMs = options.rebindTimeoutMs ?? 30_000;
76
+ const { profile, hooks } = options;
77
+ /**
78
+ * The surfaces the rebind wrapper ALREADY restored. The SDK wraps a failed
79
+ * rebind into its own ManagementError, so the commit catch cannot see the
80
+ * marker on the error itself; this in-surface set carries it instead (the
81
+ * REBIND-REVERT contract: the wrapper's revert is never duplicated).
82
+ */
83
+ const wrapperRestored = new Set();
84
+ return {
85
+ listPendingUpdates() {
86
+ const staging = join(options.storeDir, 'staging');
87
+ if (!existsSync(staging))
88
+ return [];
89
+ const entries = [];
90
+ for (const name of readdirSync(staging)) {
91
+ if (!name.endsWith('.staged'))
92
+ continue;
93
+ const stagedDir = join(staging, name);
94
+ const metadataPath = stageMetadataPath(stagedDir);
95
+ if (!existsSync(metadataPath))
96
+ continue; // an aborted stage attempt; never listed
97
+ let metadata;
98
+ try {
99
+ metadata = JSON.parse(readFileSync(metadataPath, 'utf8'));
100
+ }
101
+ catch {
102
+ continue; // a corrupt metadata record fails closed: not listed, never committed
103
+ }
104
+ if (typeof metadata.extensionId !== 'string' || typeof metadata.stagedVersion !== 'string'
105
+ || typeof metadata.report !== 'object' || metadata.report === null) {
106
+ continue;
107
+ }
108
+ const approval = store.readApproval(metadata.extensionId, metadata.stagedVersion);
109
+ if (approval.corrupt) {
110
+ entries.push({ ...metadata, approval: { approved: false, reason: `the approval record is unreadable: ${approval.diagnostic ?? 'unknown reason'}` } });
111
+ continue;
112
+ }
113
+ entries.push({
114
+ extensionId: metadata.extensionId,
115
+ stagedVersion: metadata.stagedVersion,
116
+ currentVersion: metadata.currentVersion,
117
+ stagedAt: metadata.stagedAt,
118
+ report: metadata.report,
119
+ ...approval.value === undefined ? {} : {
120
+ approval: {
121
+ approved: approval.value.approved,
122
+ ...('reason' in approval.value && typeof approval.value.reason === 'string'
123
+ ? { reason: approval.value.reason }
124
+ : {}),
125
+ },
126
+ },
127
+ });
128
+ }
129
+ return entries;
130
+ },
131
+ decide(extensionId, stagedVersion, decision) {
132
+ recordApproval({ storeDir: options.storeDir, extensionId, stagedVersion, decision });
133
+ },
134
+ async commit(extensionId, stagedVersion) {
135
+ // The pointer BEFORE the commit: the restore target when a post-quiesce
136
+ // failure withdraws the old surface.
137
+ const previous = currentPointer(store, profile, extensionId);
138
+ /** True once the quiesce hook was INVOKED: after that a failure owes a restore. */
139
+ let quiesced = false;
140
+ const quiescePrevious = async () => {
141
+ // Set BEFORE the hook runs: a quiesce that threw may have withdrawn the
142
+ // surface partially, and the restore is the safe recovery either way.
143
+ quiesced = true;
144
+ await hooks.quiesce(extensionId);
145
+ };
146
+ /**
147
+ * ALL-OR-NOTHING with the revert INSIDE the wrapper (the REBIND-REVERT
148
+ * contract): the SDK's auto-rollback re-runs no hooks, so a rebind that
149
+ * partially published must restore the previous surface itself before
150
+ * rethrowing. The previous pointer is still recorded under the rolled-back
151
+ * value after the SDK's auto-rollback, so re-activating it lands on the
152
+ * version the pointer will name.
153
+ */
154
+ const rebindNext = async (nextVersion) => {
155
+ try {
156
+ await withTimeout(hooks.rebind(extensionId, nextVersion), timeoutMs, `rebind ${extensionId}@${nextVersion}`);
157
+ }
158
+ catch (error) {
159
+ if (previous !== undefined) {
160
+ try {
161
+ await withTimeout(hooks.rebind(extensionId, previous), timeoutMs, `rebind-restore ${extensionId}@${previous}`);
162
+ wrapperRestored.add(`${extensionId}@${previous}`);
163
+ }
164
+ catch (restoreError) {
165
+ // The restore failure rides along: the primary rebind error is the
166
+ // named reason; the restore failure is recorded in the message.
167
+ throw new Error(`${error instanceof Error ? error.message : String(error)} (and restoring ${extensionId}@${previous} also failed: `
168
+ + `${restoreError instanceof Error ? restoreError.message : String(restoreError)})`);
169
+ }
170
+ }
171
+ // The previous surface is restored; the commit catch must NOT restore
172
+ // it again — the marker distinguishes this path.
173
+ throw new RebindRestoredFailure(error instanceof Error ? error.message : String(error), error);
174
+ }
175
+ };
176
+ try {
177
+ return await commitUpdate({
178
+ storeDir: options.storeDir,
179
+ profile,
180
+ extensionId,
181
+ stagedVersion,
182
+ hooks: { quiescePrevious, rebindNext },
183
+ });
184
+ }
185
+ catch (error) {
186
+ /**
187
+ * A failure AFTER the quiesce (pointer write failure, an integrity
188
+ * refusal after the quiesce, or the auto-rollback after a rebind the
189
+ * wrapper could NOT restore) left the old surface withdrawn while the
190
+ * pointer names a version nothing republished. Restore the recorded
191
+ * pointer's surface here; when the restore itself fails, name BOTH
192
+ * failures. A rebind the wrapper ALREADY restored is skipped — it was
193
+ * the wrapper's own revert (the REBIND-REVERT contract).
194
+ */
195
+ if (quiesced && !(error instanceof RebindRestoredFailure)) {
196
+ const restored = currentPointer(store, profile, extensionId);
197
+ if (restored !== undefined && !wrapperRestored.delete(`${extensionId}@${restored}`)) {
198
+ try {
199
+ await withTimeout(hooks.rebind(extensionId, restored), timeoutMs, `commit-restore ${extensionId}@${restored}`);
200
+ }
201
+ catch (restoreError) {
202
+ throw new Error(`${error instanceof Error ? error.message : String(error)} (and restoring ${extensionId}@${restored} also failed: `
203
+ + `${restoreError instanceof Error ? restoreError.message : String(restoreError)})`);
204
+ }
205
+ }
206
+ }
207
+ throw error;
208
+ }
209
+ },
210
+ async rollback(extensionId) {
211
+ // rebindRestored is bound HOST-side (the SDK awaits it unbounded after the
212
+ // restore is durable); a timeout surfaces as the SDK's hookFailure.
213
+ return await rollback({
214
+ storeDir: options.storeDir,
215
+ profile,
216
+ extensionId,
217
+ rebindRestored: async (restoredVersion) => {
218
+ await withTimeout(hooks.rebind(extensionId, restoredVersion), timeoutMs, `rebind-restored ${extensionId}@${restoredVersion}`);
219
+ },
220
+ });
221
+ },
222
+ };
223
+ }
224
+ //# sourceMappingURL=update-surface.js.map
@@ -0,0 +1,3 @@
1
+ /** The version this build reports. */
2
+ export declare const PACKAGE_VERSION: string;
3
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAaA,sCAAsC;AACtC,eAAO,MAAM,eAAe,EAAE,MAa1B,CAAA"}
package/lib/version.js ADDED
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The package version, read from the shipped `package.json`.
3
+ *
4
+ * The host identity and the confinement evidence both need the REAL version. The host
5
+ * previously carried a hard-coded `'0.1.1'` while the package shipped 0.5.x, so every
6
+ * receipt and MCP `serverInfo` reported a version nobody could match to a release, and
7
+ * evidence validation had no trustworthy version to bind to.
8
+ *
9
+ * The read is relative to this module, so it works from `src/` (tests, tsx) and from
10
+ * `lib/` (the published package): both are one directory below `package.json`.
11
+ */
12
+ import { readFileSync } from 'node:fs';
13
+ /** The version this build reports. */
14
+ export const PACKAGE_VERSION = (() => {
15
+ try {
16
+ const manifest = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
17
+ return typeof manifest.version === 'string' && manifest.version.length > 0
18
+ ? manifest.version
19
+ : '0.0.0';
20
+ }
21
+ catch {
22
+ // A build whose manifest cannot be read still runs; an unidentifiable version is
23
+ // reported as such rather than guessed.
24
+ return '0.0.0';
25
+ }
26
+ })();
27
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Contract examples and policy metadata (DECL-01).
3
+ *
4
+ * One source for every standard descriptor's worked example and explicit policy.
5
+ * The examples are documentation: the authoritative validation remains each
6
+ * contract's input/output schema.
7
+ */
8
+ import type { ContractExample, ContractPolicy } from './registry.ts';
9
+ /** One example per standard contract identity. */
10
+ export declare const CONTRACT_EXAMPLES: Readonly<Record<string, readonly ContractExample[]>>;
11
+ /** Policy metadata; recording is required by default in every standard contract. */
12
+ export declare const CONTRACT_POLICIES: Readonly<Record<string, ContractPolicy>>;
13
+ //# sourceMappingURL=contract-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-metadata.d.ts","sourceRoot":"","sources":["../src/contract-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEpE,kDAAkD;AAClD,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC,CAyElF,CAAA;AAED,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAEtE,CAAA"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Contract examples and policy metadata (DECL-01).
3
+ *
4
+ * One source for every standard descriptor's worked example and explicit policy.
5
+ * The examples are documentation: the authoritative validation remains each
6
+ * contract's input/output schema.
7
+ */
8
+ /** One example per standard contract identity. */
9
+ export const CONTRACT_EXAMPLES = {
10
+ 'stt.transcribe': [{
11
+ input: { audio: { path: 'recording.wav' }, timestamps: 'none' },
12
+ output: {
13
+ text: 'Hello from the recording.',
14
+ coverage: { complete: true, processedSeconds: 1.2, samplingInstruction: null },
15
+ meta: {},
16
+ },
17
+ }],
18
+ 'text.language_detect': [{
19
+ input: { text: 'Hello, how are you?' },
20
+ output: { language: 'en', reliability: 'confident', candidates: [{ language: 'en', probability: 0.99 }], meta: {} },
21
+ }],
22
+ 'text.embed': [{
23
+ input: { text: 'A short passage.' },
24
+ output: { embedding: [0.01, 0.02], dimensions: 2, meta: {} },
25
+ }],
26
+ 'text.rerank': [{
27
+ input: { query: 'deployment', documents: ['Deploy the service.', 'Unrelated.'] },
28
+ output: { scores: [1.2, -0.4], meta: {} },
29
+ }],
30
+ 'text.title': [{
31
+ input: { text: 'How to configure the deployment pipeline for staging and production.' },
32
+ output: { title: 'Deployment pipeline configuration', description: 'How to configure staging and production.', meta: {} },
33
+ }],
34
+ 'image.describe': [{
35
+ input: { image: { mediaType: 'image/png', bytes: [137, 80, 78, 71] }, prompt: 'Describe the interface.' },
36
+ output: { description: 'A settings panel with a save button.', meta: {} },
37
+ }],
38
+ 'embed.multimodal': [{
39
+ input: { items: [{ id: 'a', parts: [{ kind: 'text', text: 'Hello' }] }], purpose: 'retrieval', role: 'query', dimensions: 2 },
40
+ output: { embeddings: [{ id: 'a', vector: [0.1, 0.2] }], meta: {} },
41
+ }],
42
+ 'semantic.similarity': [{
43
+ input: { left: 'Deploy the service.', right: 'Ship the service.', dimensions: 2 },
44
+ output: { similarity: 0.92, meta: {} },
45
+ }],
46
+ 'semantic.rank': [{
47
+ input: { query: 'deploy', candidates: ['ship it', 'unrelated'], topK: 1 },
48
+ output: { ranking: [{ id: '0', score: 0.9 }], meta: {} },
49
+ }],
50
+ 'semantic.classify': [{
51
+ input: { item: 'The server is down.', labels: [{ id: 'outage', description: 'An outage.' }] },
52
+ output: { label: 'outage', scores: [{ id: 'outage', score: 0.96 }], meta: {} },
53
+ }],
54
+ 'semantic.deduplicate': [{
55
+ input: { items: ['Deploy the service.', 'Ship the service.'], threshold: 0.9 },
56
+ output: { groups: [{ representative: 0, members: [1] }], meta: {} },
57
+ }],
58
+ 'media.find_moments': [{
59
+ input: { query: 'a dog barking', media: { mediaType: 'audio/wav', bytes: [] }, windowSeconds: 2, strideSeconds: 1, topK: 1 },
60
+ output: { moments: [{ startSeconds: 1, endSeconds: 3, score: 0.9 }], meta: {} },
61
+ }],
62
+ 'decision.choose': [{
63
+ input: { decision: 'Choose a deployment strategy.', options: ['blue-green', 'rolling'] },
64
+ output: { chosen: 1, reason: 'Lower risk.', confidence: 0.7, calibrated: false, probabilities: { '0': 0.3, '1': 0.7 }, abstained: false, meta: {} },
65
+ }],
66
+ 'decision.test': [{
67
+ input: { claim: 'The service is healthy.', evidence: 'All probes pass.' },
68
+ output: { verdict: 'true', confidence: 0.8, calibrated: false, meta: {} },
69
+ }],
70
+ 'decision.score': [{
71
+ input: { text: 'The deployment is stable.', levels: ['low', 'medium', 'high'] },
72
+ output: { level: 'high', confidence: 0.75, calibrated: false, scores: [0.1, 0.15, 0.75], meta: {} },
73
+ }],
74
+ 'structured.extract': [{
75
+ input: { text: 'Ada Lovelace was born in 1815.', instruction: 'Extract the person name and year.', schema: { type: 'object', properties: { name: { type: 'string' }, year: { type: 'integer' } } } },
76
+ output: { record: { name: 'Ada Lovelace', year: 1815 }, meta: {} },
77
+ }],
78
+ 'plan.tools': [{
79
+ input: { request: 'Find the language of this text.', tools: [{ name: 'lang_detect', description: 'Detect language.', parameters: { type: 'object' } }] },
80
+ output: { proposals: [{ name: 'lang_detect', arguments: { text: 'hello' }, reasoning: 'Language detection is requested.', confidence: 0.9 }], meta: {} },
81
+ }],
82
+ };
83
+ /** Policy metadata; recording is required by default in every standard contract. */
84
+ export const CONTRACT_POLICIES = Object.fromEntries(Object.keys(CONTRACT_EXAMPLES).map(contract => [contract, { recording: 'required', remote: 'allowed' }]));
85
+ //# sourceMappingURL=contract-metadata.js.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `text.language_detect` — the language-identification contract (TOOL-03).
3
+ *
4
+ * TOOL-03 requires three things a naive wrapper loses: ambiguity must survive to
5
+ * the caller, empty input has a defined answer rather than an exception, and the
6
+ * score's MEANING is declared. It also forbids a specific mistake worth naming in
7
+ * the schema: a text language detector is not evidence about the language spoken
8
+ * in audio it never processed, so the contract says so instead of leaving a
9
+ * caller to infer capability from a similar-looking tool.
10
+ *
11
+ * @module @try-works/tool-mode-contracts/contracts/lang-detect
12
+ */
13
+ import type { ToolContract } from '../registry.ts';
14
+ /** The `text.language_detect` contract at version 1.0.0. */
15
+ export declare const langDetect: ToolContract;
16
+ //# sourceMappingURL=lang-detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lang-detect.d.ts","sourceRoot":"","sources":["../../src/contracts/lang-detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,4DAA4D;AAC5D,eAAO,MAAM,UAAU,EAAE,YAgFxB,CAAA"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * `text.language_detect` — the language-identification contract (TOOL-03).
3
+ *
4
+ * TOOL-03 requires three things a naive wrapper loses: ambiguity must survive to
5
+ * the caller, empty input has a defined answer rather than an exception, and the
6
+ * score's MEANING is declared. It also forbids a specific mistake worth naming in
7
+ * the schema: a text language detector is not evidence about the language spoken
8
+ * in audio it never processed, so the contract says so instead of leaving a
9
+ * caller to infer capability from a similar-looking tool.
10
+ *
11
+ * @module @try-works/tool-mode-contracts/contracts/lang-detect
12
+ */
13
+ import { withMeta } from "../meta.js";
14
+ /** The `text.language_detect` contract at version 1.0.0. */
15
+ export const langDetect = {
16
+ contract: 'text.language_detect',
17
+ version: '1.0.0',
18
+ toolName: 'lang_detect',
19
+ description: 'Identify the language of a short piece of text. Returns the best language, a reliability '
20
+ + 'verdict and ranked alternatives, because short text is often genuinely ambiguous between '
21
+ + 'related languages and collapsing that to one answer would overstate the result. The '
22
+ + 'reliability is vendor-reported, not a calibrated probability, and this reads written text '
23
+ + 'only: it is not evidence about the language spoken in audio it has not processed.',
24
+ inputSchema: {
25
+ type: 'object',
26
+ additionalProperties: false,
27
+ required: ['text'],
28
+ properties: {
29
+ text: {
30
+ type: 'string',
31
+ minLength: 1,
32
+ maxLength: 4096,
33
+ description: 'The text to identify. Only the leading portion is examined.',
34
+ },
35
+ top: {
36
+ type: 'integer',
37
+ minimum: 1,
38
+ maximum: 20,
39
+ default: 3,
40
+ description: 'How many ranked alternatives to return.',
41
+ },
42
+ },
43
+ },
44
+ outputSchema: withMeta({
45
+ language: { type: ['string', 'null'], description: 'Best candidate, or null when input had no language signal.' },
46
+ reliability: {
47
+ type: 'string',
48
+ enum: ['confident', 'likely', 'tentative', 'unknown'],
49
+ description: 'Vendor-reported verdict. Not a calibrated probability.',
50
+ },
51
+ tooCloseToCall: {
52
+ type: 'boolean',
53
+ description: 'True when the leading candidates are within the implementation\'s declared tie margin.',
54
+ },
55
+ candidates: {
56
+ type: 'array',
57
+ items: {
58
+ type: 'object',
59
+ additionalProperties: false,
60
+ required: ['language', 'probability'],
61
+ properties: {
62
+ language: { type: 'string' },
63
+ probability: { type: 'number', minimum: 0, maximum: 1 },
64
+ },
65
+ },
66
+ },
67
+ }, ['reliability', 'tooCloseToCall', 'candidates']),
68
+ semantics: {
69
+ scoreKind: 'vendor-reported-probability',
70
+ calibrated: false,
71
+ ambiguityPreserved: true,
72
+ emptyInputMeaning: 'null-language-with-empty-candidates',
73
+ appliesTo: 'written-text-only',
74
+ },
75
+ limits: {
76
+ maxInputCharacters: 4096,
77
+ examinedCharacters: 512,
78
+ maxCandidates: 20,
79
+ },
80
+ unsupported: [
81
+ 'Spoken language: this reads written text only. It is not evidence about the language spoken in audio it has not processed (TOOL-03).',
82
+ 'Translation or transliteration.',
83
+ 'Confident single answers for one or two words: those are frequently ambiguous and are reported as such.',
84
+ 'Documents beyond the examined prefix: only the leading characters are considered.',
85
+ ],
86
+ };
87
+ //# sourceMappingURL=lang-detect.js.map
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The remaining standard tool contracts (EXT-21, task-69).
3
+ *
4
+ * These descriptors are SCHEMAS AND SEMANTICS ONLY — no model bindings, no
5
+ * weights, no host code (EXT-17). Each is a closed schema with honest
6
+ * `semantics`, `limits` and `unsupported` records, matching the vocabulary the
7
+ * host registers and the extension packages implement against.
8
+ *
9
+ * @module @try-works/tool-mode-contracts/contracts/standard
10
+ */
11
+ import type { ToolContract } from '../registry.ts';
12
+ /** The `text.title` contract at version 1.0.0 (RCP-12). */
13
+ export declare const textTitle: ToolContract;
14
+ /** The `image.describe` contract at version 1.0.0 (HLM-12). */
15
+ export declare const imageDescribe: ToolContract;
16
+ /** The `embed.multimodal` contract at version 1.0.0 (EmbeddingGemma family). */
17
+ export declare const multimodalEmbed: ToolContract;
18
+ /** The `semantic.similarity` contract at version 1.0.0. */
19
+ export declare const semanticSimilarity: ToolContract;
20
+ /** The `semantic.rank` contract at version 1.0.0. */
21
+ export declare const semanticRank: ToolContract;
22
+ /** The `semantic.classify` contract at version 1.0.0. */
23
+ export declare const semanticClassify: ToolContract;
24
+ /** The `semantic.deduplicate` contract at version 1.0.0. */
25
+ export declare const semanticDeduplicate: ToolContract;
26
+ /** The `media.find_moments` contract at version 1.0.0. */
27
+ export declare const mediaFindMoments: ToolContract;
28
+ /** The `decision.choose` contract at version 1.0.0 (Laya family). */
29
+ export declare const decisionChoose: ToolContract;
30
+ /** The `decision.test` contract at version 1.0.0. */
31
+ export declare const decisionTest: ToolContract;
32
+ /** The `decision.score` contract at version 1.0.0. */
33
+ export declare const decisionScore: ToolContract;
34
+ /** The `structured.extract` contract at version 1.0.0 (Needle family). */
35
+ export declare const structuredExtract: ToolContract;
36
+ /** The `plan.tools` contract at version 1.0.0 (Needle family). */
37
+ export declare const toolsPlan: ToolContract;
38
+ //# sourceMappingURL=standard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard.d.ts","sourceRoot":"","sources":["../../src/contracts/standard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,2DAA2D;AAC3D,eAAO,MAAM,SAAS,EAAE,YAuCvB,CAAA;AAED,+DAA+D;AAC/D,eAAO,MAAM,aAAa,EAAE,YAmC3B,CAAA;AAGD,gFAAgF;AAChF,eAAO,MAAM,eAAe,EAAE,YAwC7B,CAAA;AAED,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB,EAAE,YA0BhC,CAAA;AAED,qDAAqD;AACrD,eAAO,MAAM,YAAY,EAAE,YAuC1B,CAAA;AAED,yDAAyD;AACzD,eAAO,MAAM,gBAAgB,EAAE,YA8B9B,CAAA;AAED,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB,EAAE,YAmCjC,CAAA;AAED,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,EAAE,YAwC9B,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,cAAc,EAAE,YA8B5B,CAAA;AAED,qDAAqD;AACrD,eAAO,MAAM,YAAY,EAAE,YA8B1B,CAAA;AAED,sDAAsD;AACtD,eAAO,MAAM,aAAa,EAAE,YAoC3B,CAAA;AAED,0EAA0E;AAC1E,eAAO,MAAM,iBAAiB,EAAE,YA4B/B,CAAA;AAED,kEAAkE;AAClE,eAAO,MAAM,SAAS,EAAE,YAwCvB,CAAA"}