@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,113 @@
1
+ /**
2
+ * Code makes decisions (TypeSafe "Don't Call It a Decision Model", 2026-11-03).
3
+ *
4
+ * The model returns ATOMIC JUDGMENTS; this module combines facts and judgments
5
+ * with explicit rules and returns the exit plus the evaluated trace. It calls no
6
+ * model. A missing value is a failed check with `actual: null`, never a silent
7
+ * truthy default, and the trace names every rule and condition examined.
8
+ */
9
+ export type DecisionSource = 'fact' | 'judgment';
10
+ export type DecisionOperator = 'eq' | 'neq' | 'gte' | 'gt' | 'lte' | 'lt' | 'truthy' | 'falsy';
11
+ export interface DecisionCondition {
12
+ readonly source: DecisionSource;
13
+ readonly key: string;
14
+ readonly op: DecisionOperator;
15
+ readonly value?: string | number | boolean;
16
+ }
17
+ export interface DecisionRule {
18
+ readonly id: string;
19
+ readonly when: readonly DecisionCondition[];
20
+ readonly exit: string;
21
+ }
22
+ export interface DecisionCheck {
23
+ readonly source: DecisionSource;
24
+ readonly key: string;
25
+ readonly op: DecisionOperator;
26
+ readonly expected: string | number | boolean | null;
27
+ readonly actual: unknown;
28
+ readonly passed: boolean;
29
+ }
30
+ export interface DecisionTraceEntry {
31
+ readonly rule: string;
32
+ readonly matched: boolean;
33
+ readonly checks: readonly DecisionCheck[];
34
+ }
35
+ export interface DecisionResult {
36
+ readonly exit: string;
37
+ readonly trace: readonly DecisionTraceEntry[];
38
+ readonly fallback: boolean;
39
+ }
40
+ /** Validate and normalize a policy before evaluation. */
41
+ export declare function parseDecisionPolicy(facts: unknown, judgments: unknown, rules: unknown): {
42
+ readonly facts: Record<string, unknown>;
43
+ readonly judgments: Record<string, number>;
44
+ readonly rules: readonly DecisionRule[];
45
+ };
46
+ /**
47
+ * Evaluate the first matching rule; otherwise return the caller's explicit fallback.
48
+ * @param facts - code-computed facts (booleans, numbers or strings).
49
+ * @param judgments - model probabilities keyed by atomic judgment.
50
+ * @param rules - first-match policy rules.
51
+ * @param fallback - exit when no rule matches.
52
+ * @returns exit, full trace, and whether the fallback was used.
53
+ */
54
+ export declare function combineDecision(facts: unknown, judgments: unknown, rules: unknown, fallback: string): DecisionResult;
55
+ /** The MCP contract for the pure combiner. */
56
+ export declare const DECISION_COMBINE_CONTRACT: {
57
+ readonly contract: "decision.combine";
58
+ readonly version: "1.0.0";
59
+ readonly toolName: "decision_combine";
60
+ readonly description: "Combine code-computed facts and atomic model judgment probabilities through explicit first-match rules; returns the exit and full trace.";
61
+ readonly inputSchema: {
62
+ readonly type: "object";
63
+ readonly additionalProperties: false;
64
+ readonly required: readonly ["facts", "judgments", "rules", "fallback"];
65
+ readonly properties: {
66
+ readonly facts: {
67
+ readonly type: "object";
68
+ readonly additionalProperties: true;
69
+ };
70
+ readonly judgments: {
71
+ readonly type: "object";
72
+ readonly additionalProperties: true;
73
+ };
74
+ readonly rules: {
75
+ readonly type: "array";
76
+ readonly items: {
77
+ readonly type: "object";
78
+ readonly additionalProperties: true;
79
+ };
80
+ };
81
+ readonly fallback: {
82
+ readonly type: "string";
83
+ };
84
+ };
85
+ };
86
+ readonly outputSchema: {
87
+ readonly type: "object";
88
+ readonly additionalProperties: false;
89
+ readonly required: readonly ["exit", "fallback", "trace"];
90
+ readonly properties: {
91
+ readonly exit: {
92
+ readonly type: "string";
93
+ };
94
+ readonly fallback: {
95
+ readonly type: "boolean";
96
+ };
97
+ readonly trace: {
98
+ readonly type: "array";
99
+ readonly items: {
100
+ readonly type: "object";
101
+ readonly additionalProperties: true;
102
+ };
103
+ };
104
+ };
105
+ };
106
+ readonly semantics: {
107
+ readonly deterministic: true;
108
+ readonly readsInputs: true;
109
+ };
110
+ readonly limits: {};
111
+ readonly unsupported: readonly ["no model call", "no tool dispatch"];
112
+ };
113
+ //# sourceMappingURL=decision-combine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision-combine.d.ts","sourceRoot":"","sources":["../src/decision-combine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,CAAA;AAChD,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAA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B,KAAK,EAAE,OAAO,GACb;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;CAAE,CAwBlI;AAkBD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,GACf,cAAc,CAuBhB;AAED,8CAA8C;AAC9C,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B5B,CAAA"}
@@ -0,0 +1,156 @@
1
+ /**
2
+ * Code makes decisions (TypeSafe "Don't Call It a Decision Model", 2026-11-03).
3
+ *
4
+ * The model returns ATOMIC JUDGMENTS; this module combines facts and judgments
5
+ * with explicit rules and returns the exit plus the evaluated trace. It calls no
6
+ * model. A missing value is a failed check with `actual: null`, never a silent
7
+ * truthy default, and the trace names every rule and condition examined.
8
+ */
9
+ const OPERATORS = new Set(['eq', 'neq', 'gte', 'gt', 'lte', 'lt', 'truthy', 'falsy']);
10
+ function isRecord(value) {
11
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
12
+ }
13
+ function isScalar(value) {
14
+ return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';
15
+ }
16
+ function readCondition(raw, label) {
17
+ if (!isRecord(raw))
18
+ throw new Error(`${label} must be an object`);
19
+ if (raw.source !== 'fact' && raw.source !== 'judgment')
20
+ throw new Error(`${label}.source must be fact or judgment`);
21
+ if (typeof raw.key !== 'string' || raw.key.length === 0 || raw.key.length > 128)
22
+ throw new Error(`${label}.key must be a non-empty string`);
23
+ const op = raw.op;
24
+ if (typeof op !== 'string' || !OPERATORS.has(op))
25
+ throw new Error(`${label}.op is not supported`);
26
+ if (raw.value !== undefined && !isScalar(raw.value))
27
+ throw new Error(`${label}.value must be a string, number or boolean`);
28
+ if ((op === 'truthy' || op === 'falsy') && raw.value !== undefined)
29
+ throw new Error(`${label}.value is not used by ${op}`);
30
+ return {
31
+ source: raw.source,
32
+ key: raw.key,
33
+ op: op,
34
+ ...raw.value === undefined ? {} : { value: raw.value },
35
+ };
36
+ }
37
+ /** Validate and normalize a policy before evaluation. */
38
+ export function parseDecisionPolicy(facts, judgments, rules) {
39
+ if (!isRecord(facts))
40
+ throw new Error('facts must be an object');
41
+ if (!isRecord(judgments))
42
+ throw new Error('judgments must be an object of probabilities');
43
+ const normalizedJudgments = {};
44
+ for (const [key, value] of Object.entries(judgments)) {
45
+ if (typeof value !== 'number' || !Number.isFinite(value) || value < 0 || value > 1) {
46
+ throw new Error(`judgment ${JSON.stringify(key)} must be a finite probability in [0,1]`);
47
+ }
48
+ normalizedJudgments[key] = value;
49
+ }
50
+ if (!Array.isArray(rules) || rules.length === 0 || rules.length > 64)
51
+ throw new Error('rules must be 1–64 entries');
52
+ const ids = new Set();
53
+ const parsed = rules.map((raw, index) => {
54
+ const label = `rules[${index}]`;
55
+ if (!isRecord(raw))
56
+ throw new Error(`${label} must be an object`);
57
+ if (typeof raw.id !== 'string' || raw.id.length === 0 || raw.id.length > 64)
58
+ throw new Error(`${label}.id must be a non-empty string`);
59
+ if (ids.has(raw.id))
60
+ throw new Error(`rule id ${JSON.stringify(raw.id)} is duplicated`);
61
+ ids.add(raw.id);
62
+ if (!Array.isArray(raw.when) || raw.when.length === 0 || raw.when.length > 16)
63
+ throw new Error(`${label}.when must be 1–16 conditions`);
64
+ const when = raw.when.map((condition, conditionIndex) => readCondition(condition, `${label}.when[${conditionIndex}]`));
65
+ if (typeof raw.exit !== 'string' || raw.exit.length === 0 || raw.exit.length > 256)
66
+ throw new Error(`${label}.exit must be a non-empty string`);
67
+ return { id: raw.id, when, exit: raw.exit };
68
+ });
69
+ return { facts, judgments: normalizedJudgments, rules: parsed };
70
+ }
71
+ function compare(actual, op, expected) {
72
+ if (actual === undefined || actual === null)
73
+ return false;
74
+ if (op === 'truthy')
75
+ return Boolean(actual);
76
+ if (op === 'falsy')
77
+ return !actual;
78
+ if (op === 'eq')
79
+ return actual === expected;
80
+ if (op === 'neq')
81
+ return actual !== expected;
82
+ if (typeof actual !== 'number' || typeof expected !== 'number' || !Number.isFinite(actual) || !Number.isFinite(expected))
83
+ return false;
84
+ switch (op) {
85
+ case 'gte': return actual >= expected;
86
+ case 'gt': return actual > expected;
87
+ case 'lte': return actual <= expected;
88
+ case 'lt': return actual < expected;
89
+ default: return false;
90
+ }
91
+ }
92
+ /**
93
+ * Evaluate the first matching rule; otherwise return the caller's explicit fallback.
94
+ * @param facts - code-computed facts (booleans, numbers or strings).
95
+ * @param judgments - model probabilities keyed by atomic judgment.
96
+ * @param rules - first-match policy rules.
97
+ * @param fallback - exit when no rule matches.
98
+ * @returns exit, full trace, and whether the fallback was used.
99
+ */
100
+ export function combineDecision(facts, judgments, rules, fallback) {
101
+ const parsed = parseDecisionPolicy(facts, judgments, rules);
102
+ if (typeof fallback !== 'string' || fallback.length === 0 || fallback.length > 256) {
103
+ throw new Error('fallback must be a non-empty string');
104
+ }
105
+ const trace = [];
106
+ for (const rule of parsed.rules) {
107
+ const checks = rule.when.map((condition) => {
108
+ const actual = condition.source === 'fact' ? parsed.facts[condition.key] : parsed.judgments[condition.key];
109
+ return {
110
+ source: condition.source,
111
+ key: condition.key,
112
+ op: condition.op,
113
+ expected: condition.value ?? null,
114
+ actual: actual ?? null,
115
+ passed: compare(actual, condition.op, condition.value),
116
+ };
117
+ });
118
+ const matched = checks.every(check => check.passed);
119
+ trace.push({ rule: rule.id, matched, checks });
120
+ if (matched)
121
+ return { exit: rule.exit, trace, fallback: false };
122
+ }
123
+ return { exit: fallback, trace, fallback: true };
124
+ }
125
+ /** The MCP contract for the pure combiner. */
126
+ export const DECISION_COMBINE_CONTRACT = {
127
+ contract: 'decision.combine',
128
+ version: '1.0.0',
129
+ toolName: 'decision_combine',
130
+ description: 'Combine code-computed facts and atomic model judgment probabilities through explicit first-match rules; returns the exit and full trace.',
131
+ inputSchema: {
132
+ type: 'object',
133
+ additionalProperties: false,
134
+ required: ['facts', 'judgments', 'rules', 'fallback'],
135
+ properties: {
136
+ facts: { type: 'object', additionalProperties: true },
137
+ judgments: { type: 'object', additionalProperties: true },
138
+ rules: { type: 'array', items: { type: 'object', additionalProperties: true } },
139
+ fallback: { type: 'string' },
140
+ },
141
+ },
142
+ outputSchema: {
143
+ type: 'object',
144
+ additionalProperties: false,
145
+ required: ['exit', 'fallback', 'trace'],
146
+ properties: {
147
+ exit: { type: 'string' },
148
+ fallback: { type: 'boolean' },
149
+ trace: { type: 'array', items: { type: 'object', additionalProperties: true } },
150
+ },
151
+ },
152
+ semantics: { deterministic: true, readsInputs: true },
153
+ limits: {},
154
+ unsupported: ['no model call', 'no tool dispatch'],
155
+ };
156
+ //# sourceMappingURL=decision-combine.js.map
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Domain-neutral confidence routing and evaluation for judgment tools.
3
+ *
4
+ * Two general lessons are drawn from a published identity-resolution evaluation
5
+ * (Hightouch, 2026-11-04); that domain is provenance, not scope:
6
+ * - a fixed 50% cutoff is arbitrary; thresholds trade false positives for false negatives;
7
+ * - a well-calibrated cheap judge can escalate only its uncertain band to an expensive
8
+ * evaluator and approach frontier accuracy at much lower cost.
9
+ *
10
+ * These functions are pure. They never call a model; the caller supplies the primary
11
+ * probability (and, when escalations happen, the secondary one).
12
+ */
13
+ /** A routing policy over one probability. */
14
+ export interface ConfidenceRoute {
15
+ /** `accept` true, `reject` false, or `escalate` to the secondary judge. */
16
+ readonly route: 'accept' | 'reject' | 'escalate';
17
+ /** The decision when `route` is not escalate; null when a second opinion is needed. */
18
+ readonly decision: boolean | null;
19
+ /** Which part of the band the probability fell in. */
20
+ readonly band: 'high' | 'middle' | 'low';
21
+ readonly reason: string;
22
+ }
23
+ /**
24
+ * Route a primary judgment by a two-sided confidence band.
25
+ *
26
+ * The defaults are the article's shape (middle band escalated), but NOT a claim
27
+ * that these thresholds are calibrated for our models: pass reviewed thresholds.
28
+ * @param probability - the primary judge's probability that the condition is true.
29
+ * @param acceptAt - at or above this, accept true (default 0.9).
30
+ * @param rejectAt - at or below this, accept false (default 0.1).
31
+ * @returns the route, decision and band.
32
+ */
33
+ export declare function routeConfidence(probability: number, acceptAt?: number, rejectAt?: number): ConfidenceRoute;
34
+ /** One labeled observation for evaluation. */
35
+ export interface DecisionCase {
36
+ readonly id?: string;
37
+ readonly expected: boolean;
38
+ /** Primary judge's P(true). */
39
+ readonly probability: number;
40
+ /** Optional secondary judge's P(true), used only inside the escalation band. */
41
+ readonly escalatedProbability?: number;
42
+ /** Optional observed cost of the primary call, in USD. */
43
+ readonly costUsd?: number;
44
+ /** Optional observed latency of the primary call, in ms. */
45
+ readonly latencyMs?: number;
46
+ }
47
+ /** Metrics for one decision rule over the cases. */
48
+ export interface DecisionMetrics {
49
+ readonly count: number;
50
+ readonly correct: number;
51
+ readonly accuracy: number;
52
+ readonly truePositives: number;
53
+ readonly trueNegatives: number;
54
+ readonly falsePositives: number;
55
+ readonly falseNegatives: number;
56
+ readonly falsePositiveRate: number;
57
+ readonly falseNegativeRate: number;
58
+ readonly brier: number;
59
+ readonly expectedCalibrationError: number;
60
+ }
61
+ /** The full evaluation, with an optional hybrid escalation arm. */
62
+ export interface DecisionEvaluation {
63
+ readonly threshold: number;
64
+ readonly base: DecisionMetrics;
65
+ readonly bestThreshold: number;
66
+ readonly bestAccuracy: number;
67
+ readonly sweep: readonly {
68
+ readonly threshold: number;
69
+ readonly accuracy: number;
70
+ }[];
71
+ readonly calibration: readonly {
72
+ readonly low: number;
73
+ readonly high: number;
74
+ readonly count: number;
75
+ readonly meanPredicted: number | null;
76
+ readonly observedRate: number | null;
77
+ }[];
78
+ readonly hybrid?: {
79
+ readonly rejectAt: number;
80
+ readonly acceptAt: number;
81
+ readonly escalated: number;
82
+ readonly escalationRate: number;
83
+ readonly accuracy: number;
84
+ readonly truePositives: number;
85
+ readonly trueNegatives: number;
86
+ readonly falsePositives: number;
87
+ readonly falseNegatives: number;
88
+ readonly falsePositiveRate: number;
89
+ readonly falseNegativeRate: number;
90
+ readonly escalatedCostUsd: number;
91
+ readonly escalatedLatencyMs: number;
92
+ };
93
+ }
94
+ /**
95
+ * Evaluate a labeled set: fixed threshold, best observed threshold, calibration bins,
96
+ * and an optional hybrid arm that sends the middle band to the secondary probability.
97
+ * @param rawCases - labeled observations.
98
+ * @param threshold - the primary cutoff (default 0.5).
99
+ * @param escalation - optional `{rejectAt, acceptAt}` hybrid band.
100
+ * @returns metrics, sweep and optional hybrid metrics.
101
+ */
102
+ export declare function evaluateDecisions(rawCases: unknown, threshold?: number, escalation?: {
103
+ readonly rejectAt: number;
104
+ readonly acceptAt: number;
105
+ }): DecisionEvaluation;
106
+ /** The MCP contract for confidence routing. */
107
+ export declare const DECISION_ROUTE_CONTRACT: {
108
+ readonly contract: "decision.route";
109
+ readonly version: "1.0.0";
110
+ readonly toolName: "decision_route";
111
+ readonly description: "Route a primary judgment probability into accept, reject or the escalate band.";
112
+ readonly inputSchema: {
113
+ readonly type: "object";
114
+ readonly additionalProperties: false;
115
+ readonly required: readonly ["probability"];
116
+ readonly properties: {
117
+ readonly probability: {
118
+ readonly type: "number";
119
+ };
120
+ readonly acceptAt: {
121
+ readonly type: "number";
122
+ };
123
+ readonly rejectAt: {
124
+ readonly type: "number";
125
+ };
126
+ };
127
+ };
128
+ readonly outputSchema: {
129
+ readonly type: "object";
130
+ readonly additionalProperties: false;
131
+ readonly required: readonly ["route", "decision", "band", "reason"];
132
+ readonly properties: {
133
+ readonly route: {
134
+ readonly type: "string";
135
+ };
136
+ readonly decision: {
137
+ readonly type: readonly ["boolean", "null"];
138
+ };
139
+ readonly band: {
140
+ readonly type: "string";
141
+ };
142
+ readonly reason: {
143
+ readonly type: "string";
144
+ };
145
+ };
146
+ };
147
+ readonly semantics: {
148
+ readonly deterministic: true;
149
+ readonly readsInputs: true;
150
+ };
151
+ readonly limits: {};
152
+ };
153
+ /** The MCP contract for decision evaluation. */
154
+ export declare const DECISION_EVALUATE_CONTRACT: {
155
+ readonly contract: "decision.evaluate";
156
+ readonly version: "1.0.0";
157
+ readonly toolName: "decision_evaluate";
158
+ readonly description: "Evaluate labeled decision probabilities: accuracy, FPR/FNR, Brier, calibration and an optional escalation arm.";
159
+ readonly inputSchema: {
160
+ readonly type: "object";
161
+ readonly additionalProperties: false;
162
+ readonly required: readonly ["cases"];
163
+ readonly properties: {
164
+ readonly cases: {
165
+ readonly type: "array";
166
+ };
167
+ readonly threshold: {
168
+ readonly type: "number";
169
+ };
170
+ readonly escalation: {
171
+ readonly type: "object";
172
+ };
173
+ };
174
+ };
175
+ readonly outputSchema: {
176
+ readonly type: "object";
177
+ readonly additionalProperties: true;
178
+ };
179
+ readonly semantics: {
180
+ readonly deterministic: true;
181
+ readonly readsInputs: true;
182
+ };
183
+ readonly limits: {};
184
+ };
185
+ //# sourceMappingURL=decision-evaluate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision-evaluate.d.ts","sourceRoot":"","sources":["../src/decision-evaluate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAA;IAChD,uFAAuF;IACvF,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAA;IACjC,sDAAsD;IACtD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,SAA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