@try-works/dsh-model-as-tool 0.1.3 → 0.4.0

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 (260) hide show
  1. package/bin/dsh-tool-mode-credentials.mjs +20 -0
  2. package/bin/dsh-tool-mode.mjs +202 -0
  3. package/catalog/desert-ant-models.json +693 -693
  4. package/client/client.model-tools.js +614 -0
  5. package/client/index.js +1717 -0
  6. package/lib/adapters/index.d.ts.map +1 -1
  7. package/lib/adapters/index.js +4 -4
  8. package/lib/bindings.d.ts.map +1 -1
  9. package/lib/bindings.js +26 -25
  10. package/lib/capability.d.ts.map +1 -1
  11. package/lib/capability.js +17 -0
  12. package/lib/capture-path.d.ts +97 -0
  13. package/lib/capture-path.d.ts.map +1 -0
  14. package/lib/capture-path.js +152 -0
  15. package/lib/diagnostics.d.ts +166 -0
  16. package/lib/diagnostics.d.ts.map +1 -0
  17. package/lib/diagnostics.js +135 -0
  18. package/lib/extension-dependencies.d.ts +325 -0
  19. package/lib/extension-dependencies.d.ts.map +1 -0
  20. package/lib/extension-dependencies.js +858 -0
  21. package/lib/extension-dispatch.d.ts +117 -0
  22. package/lib/extension-dispatch.d.ts.map +1 -0
  23. package/lib/extension-dispatch.js +124 -0
  24. package/lib/extension-registrar.d.ts +100 -0
  25. package/lib/extension-registrar.d.ts.map +1 -0
  26. package/lib/extension-registrar.js +134 -0
  27. package/lib/extensions-api.d.ts +221 -0
  28. package/lib/extensions-api.d.ts.map +1 -0
  29. package/lib/extensions-api.js +17 -0
  30. package/lib/extensions-remote.d.ts +54 -0
  31. package/lib/extensions-remote.d.ts.map +1 -0
  32. package/lib/extensions-remote.js +66 -0
  33. package/lib/extensions-service.d.ts +367 -0
  34. package/lib/extensions-service.d.ts.map +1 -0
  35. package/lib/extensions-service.js +1527 -0
  36. package/lib/harness-llm.d.ts +138 -0
  37. package/lib/harness-llm.d.ts.map +1 -0
  38. package/lib/harness-llm.js +218 -0
  39. package/lib/harness-serving.d.ts +95 -0
  40. package/lib/harness-serving.d.ts.map +1 -0
  41. package/lib/harness-serving.js +157 -0
  42. package/lib/headless.d.ts +97 -0
  43. package/lib/headless.d.ts.map +1 -0
  44. package/lib/headless.js +349 -0
  45. package/lib/http-acquisition.d.ts +27 -0
  46. package/lib/http-acquisition.d.ts.map +1 -0
  47. package/lib/http-acquisition.js +136 -0
  48. package/lib/index.d.ts +271 -7
  49. package/lib/index.d.ts.map +1 -1
  50. package/lib/index.js +2644 -70
  51. package/lib/invocation-accounting.d.ts +169 -0
  52. package/lib/invocation-accounting.d.ts.map +1 -0
  53. package/lib/invocation-accounting.js +148 -0
  54. package/lib/legacy-migration.d.ts +95 -0
  55. package/lib/legacy-migration.d.ts.map +1 -0
  56. package/lib/legacy-migration.js +429 -0
  57. package/lib/managed-workers.d.ts +151 -0
  58. package/lib/managed-workers.d.ts.map +1 -0
  59. package/lib/managed-workers.js +249 -0
  60. package/lib/mcp/client-grant.d.ts +74 -0
  61. package/lib/mcp/client-grant.d.ts.map +1 -0
  62. package/lib/mcp/client-grant.js +60 -0
  63. package/lib/mcp/credential-cli.d.ts +38 -0
  64. package/lib/mcp/credential-cli.d.ts.map +1 -0
  65. package/lib/mcp/credential-cli.js +148 -0
  66. package/lib/mcp/credential-store.d.ts +143 -0
  67. package/lib/mcp/credential-store.d.ts.map +1 -0
  68. package/lib/mcp/credential-store.js +454 -0
  69. package/lib/mcp/host-binding.d.ts +25 -0
  70. package/lib/mcp/host-binding.d.ts.map +1 -1
  71. package/lib/mcp/host-binding.js +107 -14
  72. package/lib/mcp/http.d.ts +68 -18
  73. package/lib/mcp/http.d.ts.map +1 -1
  74. package/lib/mcp/http.js +390 -62
  75. package/lib/mcp/oauth.d.ts +149 -0
  76. package/lib/mcp/oauth.d.ts.map +1 -0
  77. package/lib/mcp/oauth.js +396 -0
  78. package/lib/mcp/protocol.d.ts +46 -7
  79. package/lib/mcp/protocol.d.ts.map +1 -1
  80. package/lib/mcp/protocol.js +63 -16
  81. package/lib/mcp/rate-limit.d.ts +68 -0
  82. package/lib/mcp/rate-limit.d.ts.map +1 -0
  83. package/lib/mcp/rate-limit.js +114 -0
  84. package/lib/mcp/sdk-v2.d.ts +17 -0
  85. package/lib/mcp/sdk-v2.d.ts.map +1 -0
  86. package/lib/mcp/sdk-v2.js +181 -0
  87. package/lib/mcp/server.d.ts +11 -1
  88. package/lib/mcp/server.d.ts.map +1 -1
  89. package/lib/mcp/server.js +80 -13
  90. package/lib/mcp/stdio.d.ts.map +1 -1
  91. package/lib/mcp/stdio.js +9 -1
  92. package/lib/mcp/subscriptions.d.ts +43 -1
  93. package/lib/mcp/subscriptions.d.ts.map +1 -1
  94. package/lib/mcp/subscriptions.js +90 -9
  95. package/lib/model-qualification.d.ts +192 -0
  96. package/lib/model-qualification.d.ts.map +1 -0
  97. package/lib/model-qualification.js +178 -0
  98. package/lib/planning.d.ts +246 -0
  99. package/lib/planning.d.ts.map +1 -0
  100. package/lib/planning.js +457 -0
  101. package/lib/prepared-assets.d.ts +178 -0
  102. package/lib/prepared-assets.d.ts.map +1 -0
  103. package/lib/prepared-assets.js +286 -0
  104. package/lib/provider-bridge.d.ts +37 -0
  105. package/lib/provider-bridge.d.ts.map +1 -1
  106. package/lib/provider-bridge.js +189 -12
  107. package/lib/ptc-authority.d.ts +140 -0
  108. package/lib/ptc-authority.d.ts.map +1 -0
  109. package/lib/ptc-authority.js +216 -0
  110. package/lib/ptc-runtime.d.ts +156 -0
  111. package/lib/ptc-runtime.d.ts.map +1 -0
  112. package/lib/ptc-runtime.js +191 -0
  113. package/lib/publication.d.ts +2 -1
  114. package/lib/publication.d.ts.map +1 -1
  115. package/lib/publication.js +13 -5
  116. package/lib/receipt.d.ts.map +1 -1
  117. package/lib/receipt.js +8 -0
  118. package/lib/title-proposal.d.ts +194 -0
  119. package/lib/title-proposal.d.ts.map +1 -0
  120. package/lib/title-proposal.js +244 -0
  121. package/lib/tool-mode-run.d.ts +235 -0
  122. package/lib/tool-mode-run.d.ts.map +1 -0
  123. package/lib/tool-mode-run.js +283 -0
  124. package/lib/types.d.ts +3 -1
  125. package/lib/types.d.ts.map +1 -1
  126. package/lib/update-surface.d.ts +79 -0
  127. package/lib/update-surface.d.ts.map +1 -0
  128. package/lib/update-surface.js +224 -0
  129. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.d.ts +38 -0
  130. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.d.ts.map +1 -0
  131. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.js +445 -0
  132. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.d.ts +14 -0
  133. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.d.ts.map +1 -0
  134. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.js +63 -0
  135. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.d.ts +14 -0
  136. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.d.ts.map +1 -0
  137. package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.js +76 -0
  138. package/node_modules/@try-works/tool-mode-contracts/lib/dsh.d.ts.map +1 -1
  139. package/node_modules/@try-works/tool-mode-contracts/lib/dsh.js +69 -55
  140. package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts +4 -1
  141. package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts.map +1 -1
  142. package/node_modules/@try-works/tool-mode-contracts/lib/index.js +26 -2
  143. package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts +28 -2
  144. package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts.map +1 -1
  145. package/node_modules/@try-works/tool-mode-contracts/lib/registry.js +93 -10
  146. package/node_modules/@try-works/tool-mode-contracts/package.json +0 -1
  147. package/node_modules/@try-works/tool-mode-extension-sdk/bin/dsh-tool-mode.mjs +20 -0
  148. package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.d.ts +80 -0
  149. package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.d.ts.map +1 -0
  150. package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.js +533 -0
  151. package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.d.ts +83 -0
  152. package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.d.ts.map +1 -0
  153. package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.js +125 -0
  154. package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.d.ts +70 -0
  155. package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.d.ts.map +1 -0
  156. package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.js +201 -0
  157. package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.d.ts +57 -0
  158. package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.d.ts.map +1 -0
  159. package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.js +83 -0
  160. package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.d.ts +32 -0
  161. package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.d.ts.map +1 -0
  162. package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.js +32 -0
  163. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.d.ts +86 -0
  164. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.d.ts.map +1 -0
  165. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.js +191 -0
  166. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.d.ts +126 -0
  167. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.d.ts.map +1 -0
  168. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.js +297 -0
  169. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts +216 -0
  170. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts.map +1 -0
  171. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.js +800 -0
  172. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.d.ts +210 -0
  173. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.d.ts.map +1 -0
  174. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.js +368 -0
  175. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.d.ts +63 -0
  176. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.d.ts.map +1 -0
  177. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.js +149 -0
  178. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.d.ts +35 -0
  179. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.d.ts.map +1 -0
  180. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.js +179 -0
  181. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.d.ts +179 -0
  182. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.d.ts.map +1 -0
  183. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.js +235 -0
  184. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts +367 -0
  185. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts.map +1 -0
  186. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.js +807 -0
  187. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.d.ts +44 -0
  188. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.d.ts.map +1 -0
  189. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.js +243 -0
  190. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.d.ts +185 -0
  191. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.d.ts.map +1 -0
  192. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.js +504 -0
  193. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.d.ts +17 -0
  194. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.d.ts.map +1 -0
  195. package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.js +80 -0
  196. package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.d.ts +52 -0
  197. package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.d.ts.map +1 -0
  198. package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.js +102 -0
  199. package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.d.ts +171 -0
  200. package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.d.ts.map +1 -0
  201. package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.js +271 -0
  202. package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.d.ts +242 -0
  203. package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.d.ts.map +1 -0
  204. package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.js +58 -0
  205. package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.d.ts +118 -0
  206. package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.d.ts.map +1 -0
  207. package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.js +113 -0
  208. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.d.ts +2 -0
  209. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.d.ts.map +1 -0
  210. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.js +351 -0
  211. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.d.ts +150 -0
  212. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.d.ts.map +1 -0
  213. package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.js +670 -0
  214. package/node_modules/@try-works/tool-mode-extension-sdk/package.json +53 -0
  215. package/node_modules/@try-works/tool-mode-extension-sdk/schema/extension-manifest-1.1.0.schema.json +253 -0
  216. package/node_modules/@try-works/tool-mode-recipes/bin/tool-mode-recipe.mjs +15 -0
  217. package/node_modules/@try-works/tool-mode-recipes/lib/broker.d.ts +427 -0
  218. package/node_modules/@try-works/tool-mode-recipes/lib/broker.d.ts.map +1 -0
  219. package/node_modules/@try-works/tool-mode-recipes/lib/broker.js +592 -0
  220. package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts +60 -0
  221. package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts.map +1 -0
  222. package/node_modules/@try-works/tool-mode-recipes/lib/cli.js +936 -0
  223. package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.d.ts +237 -0
  224. package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.d.ts.map +1 -0
  225. package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.js +200 -0
  226. package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.d.ts +85 -0
  227. package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.d.ts.map +1 -0
  228. package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.js +176 -0
  229. package/node_modules/@try-works/tool-mode-recipes/lib/images.d.ts +105 -0
  230. package/node_modules/@try-works/tool-mode-recipes/lib/images.d.ts.map +1 -0
  231. package/node_modules/@try-works/tool-mode-recipes/lib/images.js +129 -0
  232. package/node_modules/@try-works/tool-mode-recipes/lib/index.d.ts +25 -0
  233. package/node_modules/@try-works/tool-mode-recipes/lib/index.d.ts.map +1 -0
  234. package/node_modules/@try-works/tool-mode-recipes/lib/index.js +25 -0
  235. package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.d.ts +325 -0
  236. package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.d.ts.map +1 -0
  237. package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.js +1310 -0
  238. package/node_modules/@try-works/tool-mode-recipes/lib/templates.d.ts +51 -0
  239. package/node_modules/@try-works/tool-mode-recipes/lib/templates.d.ts.map +1 -0
  240. package/node_modules/@try-works/tool-mode-recipes/lib/templates.js +310 -0
  241. package/node_modules/@try-works/tool-mode-recipes/lib/titles.d.ts +227 -0
  242. package/node_modules/@try-works/tool-mode-recipes/lib/titles.d.ts.map +1 -0
  243. package/node_modules/@try-works/tool-mode-recipes/lib/titles.js +407 -0
  244. package/node_modules/@try-works/tool-mode-recipes/package.json +56 -0
  245. package/node_modules/@try-works/tool-mode-recipes/recipes/describe-image.json +38 -0
  246. package/node_modules/@try-works/tool-mode-recipes/recipes/text-title.json +45 -0
  247. package/node_modules/@try-works/tool-mode-recipes/schema/harness-model-recipe.schema.json +273 -0
  248. package/package.json +43 -15
  249. package/remote/spec.mjs +462 -0
  250. package/remote/typert.host.mjs +14 -0
  251. package/remote/typert.remote-client.mjs +16 -0
  252. package/lib/adapters/tongue.d.ts +0 -31
  253. package/lib/adapters/tongue.d.ts.map +0 -1
  254. package/lib/adapters/tongue.js +0 -93
  255. package/lib/adapters/voz.d.ts +0 -28
  256. package/lib/adapters/voz.d.ts.map +0 -1
  257. package/lib/adapters/voz.js +0 -102
  258. /package/{lib → node_modules/@try-works/tool-mode-extension-sdk/lib}/licensing.d.ts +0 -0
  259. /package/{lib → node_modules/@try-works/tool-mode-extension-sdk/lib}/licensing.d.ts.map +0 -0
  260. /package/{lib → node_modules/@try-works/tool-mode-extension-sdk/lib}/licensing.js +0 -0
@@ -0,0 +1,244 @@
1
+ /**
2
+ * Title and description proposal (TOOL-06), with the language-evidence rule from
3
+ * TOOL-03.
4
+ *
5
+ * TOOL-06 is mostly a list of things a title generator must NOT do, and the sharpest of
6
+ * them is this: **a refusal or an incomplete generation must not become a valid empty
7
+ * title.** That failure is easy to ship and hard to notice, because the shape of the
8
+ * response is correct — `{ title: "" }` looks like a result — and a caller writing it
9
+ * into a document produces an empty heading rather than an error.
10
+ *
11
+ * The other rules here are enforced rather than described:
12
+ *
13
+ * - **No invented facts.** A number in a proposed title that does not appear in the
14
+ * source is a claim the source does not support. This is checkable, so it is checked.
15
+ * - **No changed source meaning.** Enforced through the same provenance check plus a
16
+ * refusal to accept a title with no overlap with the source.
17
+ * - **No calling another tool.** Structural: the response shape carries no tool-call
18
+ * field, so there is nothing to dispatch.
19
+ * - **Maximum lengths in the schema**, which the contract states and this enforces.
20
+ *
21
+ * @module @try-works/dsh-model-as-tool/title-proposal
22
+ */
23
+ /**
24
+ * The evaluated defaults for a section title (TOOL-06).
25
+ *
26
+ * Stated in the contract rather than chosen per call, because "define maximum
27
+ * title/description lengths in the schema and evaluated recipe" means a caller cannot
28
+ * widen them by asking.
29
+ */
30
+ export const SECTION_TITLE_LIMITS = {
31
+ // A heading is scanned, not read; beyond this it wraps and stops being a heading.
32
+ maxTitleChars: 80,
33
+ maxDescriptionChars: 240,
34
+ maxRepairs: 1,
35
+ };
36
+ /**
37
+ * The contract limits for one configuration's CODE-11 repair ceiling.
38
+ *
39
+ * The title/description lengths stay contract-stated; the repair ceiling is
40
+ * the operator's configured number (an integer 0..8, default 1). An invalid
41
+ * ceiling is a REFUSAL, never a silent clamp — the recorded lineage must show
42
+ * the budget the operator actually approved.
43
+ * @param repairCeiling - the configured ceiling; absent means the default 1.
44
+ * @returns the limits the repair decision and lineage honor.
45
+ */
46
+ export function titleLimitsFor(repairCeiling) {
47
+ const ceiling = repairCeiling ?? SECTION_TITLE_LIMITS.maxRepairs;
48
+ if (!Number.isInteger(ceiling) || ceiling < 0 || ceiling > 8) {
49
+ throw new Error(`the repair ceiling must be an integer between 0 and 8 (CODE-11); received ${JSON.stringify(ceiling)}`);
50
+ }
51
+ return {
52
+ maxTitleChars: SECTION_TITLE_LIMITS.maxTitleChars,
53
+ maxDescriptionChars: SECTION_TITLE_LIMITS.maxDescriptionChars,
54
+ maxRepairs: ceiling,
55
+ };
56
+ }
57
+ /** Every number appearing in a string, as written. */
58
+ function numbersIn(text) {
59
+ return text.match(/\d+(?:[.,]\d+)*/g) ?? [];
60
+ }
61
+ /** Content words, lowercased, for the overlap check. */
62
+ function contentWords(text) {
63
+ const stop = new Set([
64
+ 'a', 'an', 'the', 'and', 'or', 'of', 'to', 'in', 'on', 'for', 'with', 'your', 'you',
65
+ 'this', 'that', 'is', 'are', 'be', 'it', 'at', 'by', 'as', 'how', 'what', 'why',
66
+ ]);
67
+ return new Set(text.toLowerCase().match(/[a-z][a-z'-]{2,}/g)?.filter(word => !stop.has(word)) ?? []);
68
+ }
69
+ /**
70
+ * Accept or refuse a title proposal (TOOL-06).
71
+ *
72
+ * @param response - the model's raw response.
73
+ * @param source - the text the title was proposed for, used for provenance.
74
+ * @param limits - the lengths the contract states.
75
+ * @returns the outcome, which is an error rather than an empty title whenever the
76
+ * response was not a usable one.
77
+ */
78
+ export function acceptTitle(response, source, limits = SECTION_TITLE_LIMITS) {
79
+ // A REFUSAL IS AN ERROR. This is the rule the requirement states most sharply, and it
80
+ // is checked first so a refusal can never fall through to the empty-title path.
81
+ if (response.refused === true) {
82
+ return {
83
+ kind: 'refused',
84
+ reason: response.refusalReason ?? 'the model declined to propose a title',
85
+ };
86
+ }
87
+ if (response.incomplete === true) {
88
+ return { kind: 'incomplete', reason: 'the generation was cut short, so no title was completed' };
89
+ }
90
+ const title = response.title;
91
+ if (typeof title !== 'string') {
92
+ return { kind: 'invalid', reason: 'the response carried no title field' };
93
+ }
94
+ // AN EMPTY TITLE IS NOT A VALID EMPTY TITLE. A caller writing one into a document
95
+ // produces a blank heading rather than an error, which is why this is refused.
96
+ if (title.trim().length === 0) {
97
+ return {
98
+ kind: 'rejected',
99
+ reason: 'the title is empty; an empty title is an error, not a valid empty result',
100
+ };
101
+ }
102
+ if (title.length > limits.maxTitleChars) {
103
+ return {
104
+ kind: 'rejected',
105
+ reason: `the title is ${title.length} characters, over the ${limits.maxTitleChars} the contract states`,
106
+ };
107
+ }
108
+ const description = response.description ?? '';
109
+ if (description.length > limits.maxDescriptionChars) {
110
+ return {
111
+ kind: 'rejected',
112
+ reason: `the description is ${description.length} characters, over the ${limits.maxDescriptionChars} the contract states`,
113
+ };
114
+ }
115
+ /**
116
+ * NO INVENTED FACTS: a number in the title must appear in the source.
117
+ *
118
+ * "10 Ways to Improve Performance" over a source that never says ten is a claim the
119
+ * source does not support, and it is exactly the kind of plausible embellishment a
120
+ * summariser adds. This is checkable, so it is checked rather than requested.
121
+ */
122
+ const sourceNumbers = new Set(numbersIn(source));
123
+ for (const number of numbersIn(title)) {
124
+ if (!sourceNumbers.has(number)) {
125
+ return {
126
+ kind: 'rejected',
127
+ reason: `the title states "${number}", which does not appear in the source`,
128
+ };
129
+ }
130
+ }
131
+ for (const number of numbersIn(description)) {
132
+ if (!sourceNumbers.has(number)) {
133
+ return {
134
+ kind: 'rejected',
135
+ reason: `the description states "${number}", which does not appear in the source`,
136
+ };
137
+ }
138
+ }
139
+ /**
140
+ * NO CHANGED SOURCE MEANING, approximated as a real overlap requirement.
141
+ *
142
+ * A title sharing no content word with its source is not a title FOR that source; it
143
+ * is a different claim wearing the shape of one.
144
+ */
145
+ const sourceWords = contentWords(source);
146
+ const titleWords = contentWords(title);
147
+ if (sourceWords.size > 0 && titleWords.size > 0) {
148
+ const overlap = [...titleWords].some(word => sourceWords.has(word));
149
+ if (!overlap) {
150
+ return {
151
+ kind: 'rejected',
152
+ reason: 'the title shares no content word with the source, so it is not a title for it',
153
+ };
154
+ }
155
+ }
156
+ return { kind: 'proposed', title: title.trim(), description: description.trim(), repairs: 0 };
157
+ }
158
+ /**
159
+ * Whether a repair attempt may run (TOOL-06).
160
+ *
161
+ * The requirement says to COUNT repair attempts when they are enabled, so the count is
162
+ * returned rather than kept internally — an uncounted retry is how a budget silently
163
+ * becomes unbounded.
164
+ * @param limits - the contract's limits.
165
+ * @param repairsSoFar - repairs already consumed.
166
+ * @param previous - what the previous attempt produced.
167
+ * @returns whether to repair, and how many repairs would then be consumed.
168
+ */
169
+ export function mayRepairTitle(limits, repairsSoFar, previous) {
170
+ if (previous.kind === 'proposed') {
171
+ return { repair: false, repairs: repairsSoFar };
172
+ }
173
+ if (repairsSoFar >= limits.maxRepairs) {
174
+ // Reported as an exhausted budget rather than as a failure to produce a title, so
175
+ // the caller can tell the two apart.
176
+ return {
177
+ repair: false,
178
+ repairs: repairsSoFar,
179
+ reason: `the repair budget of ${limits.maxRepairs} is exhausted; the last outcome was ${previous.kind}`,
180
+ };
181
+ }
182
+ return { repair: true, repairs: repairsSoFar + 1 };
183
+ }
184
+ /**
185
+ * Record one repair decision into the lineage (CODE-11, pure and testable).
186
+ * @param lineage - the lineage so far (mutated in place, then returned).
187
+ * @param decision - the `mayRepairTitle` decision for this attempt.
188
+ * @param previousKind - the previous outcome kind.
189
+ * @param budgetBefore - the budget the decision was made against.
190
+ * @returns the updated lineage.
191
+ */
192
+ export function recordRepairLineage(lineage, decision, previousKind, budgetBefore) {
193
+ const outcome = decision.repair
194
+ ? 'repaired'
195
+ : decision.repairs >= budgetBefore && previousKind !== 'proposed'
196
+ ? 'exhausted'
197
+ : 'not-needed';
198
+ lineage.push({
199
+ repairIndex: lineage.length + 1,
200
+ budgetBefore,
201
+ // The budget AFTER the decision is the budget before minus the one
202
+ // attempt a repair consumed — the lineage's own contract ("one lower
203
+ // when a repair ran"), never the consumed count relabelled.
204
+ budgetAfter: budgetBefore - (decision.repair ? 1 : 0),
205
+ previousKind,
206
+ outcome,
207
+ });
208
+ return lineage;
209
+ }
210
+ /**
211
+ * Whether a tool may call another tool to fulfil this contract (TOOL-06).
212
+ *
213
+ * It may not: "do not call another tool". Returns false so the prohibition is asserted,
214
+ * and the response shape carries no tool-call field for one to be dispatched from.
215
+ * @returns always false.
216
+ */
217
+ export function mayCallAnotherTool() {
218
+ return false;
219
+ }
220
+ /**
221
+ * Whether a language result may be cited as evidence for a medium (TOOL-03).
222
+ *
223
+ * A text detector's result is evidence about the TEXT it processed and nothing else.
224
+ * The requirement forbids using it as evidence of the language SPOKEN in audio it has
225
+ * not processed, and the refusal is per-medium rather than per-result because the result
226
+ * itself is sound — only its use as audio evidence is not.
227
+ * @param examined - what the result examined.
228
+ * @param claimed - the medium being claimed.
229
+ * @returns whether the claim is supported.
230
+ */
231
+ export function supportsLanguageClaim(examined, claimed) {
232
+ return examined === claimed;
233
+ }
234
+ /**
235
+ * Describe what a language result is evidence for (TOOL-03).
236
+ * @param examined - what the result examined.
237
+ * @returns a description that does not overstate the result.
238
+ */
239
+ export function describeLanguageEvidence(examined) {
240
+ return examined === 'text'
241
+ ? 'the language of the supplied text; this is not evidence of the language spoken in audio'
242
+ : 'the language of the supplied audio';
243
+ }
244
+ //# sourceMappingURL=title-proposal.js.map
@@ -0,0 +1,235 @@
1
+ /**
2
+ * The ONE authorized program-execution pipeline (CODE-02, CODE-03, CODE-08, ARCH-05).
3
+ *
4
+ * THE DEFECT THIS FIXES, found by adversarial review rather than by a test:
5
+ * `ptc-authority.ts` and `ptc-runtime.ts` had **zero callers outside tests**. Everything in
6
+ * them was correct and thoroughly covered — `buildToolBindings`, the guarded mount,
7
+ * `mayExposeToClients()` — and none of it ran in production. `tool_mode_run` did not exist,
8
+ * the mount guard never executed, and the exposure gate guarded nothing because there was
9
+ * no caller to refuse.
10
+ *
11
+ * A security control with no callers is not a control; it is a symbol. This module is the
12
+ * caller.
13
+ *
14
+ * The wiring enforces three things the directive requires and nothing else did:
15
+ *
16
+ * 1. **ONE pipeline.** Native PTC and any external `tool_mode_run` reach tools through the
17
+ * SAME `buildToolBindings` call, so authorization cannot differ between the two doors.
18
+ * 2. **The grant is the grant.** The requested names are intersected with the host's own
19
+ * `allowedTools` and the live registry, and the whole request is refused if anything is
20
+ * unattainable.
21
+ * 3. **The exposure gate has a caller.** `mayExposeToClients()` returning false now
22
+ * actually refuses something, with the reason attached.
23
+ *
24
+ * @module @try-works/dsh-model-as-tool/tool-mode-run
25
+ */
26
+ import { PTC_SERVICE, type PtcHostContext } from './ptc-runtime.ts';
27
+ import type { ToolBinding } from './ptc-authority.ts';
28
+ /** The runtime surface this module needs, narrowed so it is testable. */
29
+ export interface ProgramRuntime {
30
+ resolve(request: Record<string, unknown>): unknown;
31
+ run(spec: unknown): Promise<{
32
+ readonly value?: unknown;
33
+ readonly logs?: readonly string[];
34
+ readonly error?: {
35
+ readonly kind?: string;
36
+ readonly message?: string;
37
+ };
38
+ }>;
39
+ }
40
+ /** How to reach the tools a program may call. */
41
+ export interface RunnerEnvironment {
42
+ /** The host's context, for the guarded mount. */
43
+ readonly context: PtcHostContext;
44
+ /**
45
+ * The backend plugin, or undefined when it could not be resolved. May be a
46
+ * thunk: the host resolves the backend LAZILY so a deployment without the
47
+ * package still loads the plugin, and `prepare()` materializes it at most once.
48
+ */
49
+ readonly backend: unknown | (() => Promise<unknown>);
50
+ /**
51
+ * The grant a program's sub-calls authorize against, READ PER RUN.
52
+ *
53
+ * A FUNCTION rather than a value because of SEC-04's composition rule: an
54
+ * external client's `tool_mode_run` call must compose under the CLIENT's grant,
55
+ * not the host's — otherwise a client granted only `tool_mode_run` could reach
56
+ * every host-granted tool through a program. The host wires this to an
57
+ * {@link ExternalGrantContext}, which returns the caller's grant when the run
58
+ * happens inside an external call and the host's own grant otherwise.
59
+ */
60
+ readonly grant: () => readonly string[];
61
+ /** The tool names currently registered, read at RUN time so late registrations are visible. */
62
+ readonly visible: () => readonly string[];
63
+ /** Resolves one authorized name to its implementation. */
64
+ readonly resolve: (name: string) => ToolBinding | undefined;
65
+ /** The runtime, once mounted. */
66
+ readonly runtime: () => ProgramRuntime | undefined;
67
+ /** Whether the OPERATOR granted hosted code execution (CODE-10), read at check time. */
68
+ readonly operatorGranted: () => boolean;
69
+ }
70
+ /**
71
+ * The per-call external grant carrier (SEC-04, composition).
72
+ *
73
+ * `AsyncLocalStorage` rather than a module global: the context travels with the
74
+ * async chain of ONE call, so two concurrent external clients cannot see each
75
+ * other's grants, and the native/interactive path (no context) reads the host's
76
+ * own grant — unchanged behavior.
77
+ */
78
+ export interface ExternalGrantContext {
79
+ /** Run work with an external client's grant in force. */
80
+ run<T>(grant: readonly string[], work: () => Promise<T>): Promise<T>;
81
+ /** The grant in force, or undefined on the host/interactive path. */
82
+ current(): readonly string[] | undefined;
83
+ }
84
+ /** Create the per-call external grant carrier. */
85
+ export declare function createExternalGrantContext(): ExternalGrantContext;
86
+ /** A request to run a program. */
87
+ export interface ProgramRequest {
88
+ /** The program source. */
89
+ readonly program: string;
90
+ /** The tool names the program declares it will call. */
91
+ readonly requested: readonly string[];
92
+ /** Cancellation, propagated to the runtime. */
93
+ readonly signal?: AbortSignal;
94
+ /** A requested budget, CLAMPED rather than honoured. */
95
+ readonly timeoutMs?: number | null;
96
+ readonly cwd?: string;
97
+ }
98
+ /** The outcome of a run. */
99
+ export type ProgramOutcome = {
100
+ readonly ok: true;
101
+ readonly value: unknown;
102
+ readonly logs: readonly string[];
103
+ readonly toolCalls: number;
104
+ } | {
105
+ readonly ok: false;
106
+ readonly code: 'unavailable' | 'unauthorized' | 'cancelled' | 'failed';
107
+ readonly message: string;
108
+ };
109
+ /** The runner the host uses. */
110
+ export interface ProgramRunner {
111
+ /** Mount the backend at most once, through the guard. */
112
+ prepare(): Promise<{
113
+ readonly mounted: boolean;
114
+ readonly reason?: string;
115
+ }>;
116
+ /** Run one program through the authorized pipeline. */
117
+ run(request: ProgramRequest): Promise<ProgramOutcome>;
118
+ /** Whether an EXTERNAL caller may be served generated-code execution (CODE-08). */
119
+ externalExposurePermitted(): boolean;
120
+ /** Why not, when it is not. */
121
+ externalExposureReason(): string;
122
+ }
123
+ /**
124
+ * Create the runner.
125
+ *
126
+ * @param environment - how to reach tools and the runtime.
127
+ * @returns the runner.
128
+ */
129
+ export declare function createProgramRunner(environment: RunnerEnvironment): ProgramRunner;
130
+ /**
131
+ * The refusal an EXTERNAL caller receives (CODE-08).
132
+ *
133
+ * A separate function so the gate has a single enforcement point rather than a condition
134
+ * repeated at each call site — the shape that let the original gate go unused.
135
+ * @param runner - the runner.
136
+ * @returns the refusal, or undefined when exposure is permitted.
137
+ */
138
+ export declare function externalRefusal(runner: ProgramRunner): {
139
+ readonly message: string;
140
+ } | undefined;
141
+ /** The service key the runner depends on, re-exported so a caller need not import both. */
142
+ export { PTC_SERVICE };
143
+ /** What the CODE-02 tool returns for one run. */
144
+ export interface RunReport {
145
+ readonly result: unknown;
146
+ readonly logs: readonly string[];
147
+ readonly meta: {
148
+ readonly receiptId: string;
149
+ readonly elapsedMs: number;
150
+ readonly toolCalls: number;
151
+ readonly catalogRevision: string;
152
+ readonly warnings: readonly string[];
153
+ };
154
+ }
155
+ /**
156
+ * The `tool_mode_run` MCP contract, in the ToolContract shape (CODE-02).
157
+ *
158
+ * ONE definition serves the MCP export surface and the conformance test, so the
159
+ * two cannot drift the way an inline object at the export site would: the test
160
+ * validates this shape's MCP projection against the pinned schema before it ever
161
+ * ships on a live tools/list.
162
+ */
163
+ export declare const TOOL_MODE_RUN_CONTRACT: {
164
+ readonly contract: "hosted.tool_mode_run";
165
+ readonly version: "1.0.0";
166
+ readonly toolName: "tool_mode_run";
167
+ readonly description: "Run a program that calls Tool Mode tools (CODE-02).";
168
+ readonly inputSchema: {
169
+ readonly type: "object";
170
+ readonly additionalProperties: false;
171
+ readonly required: readonly ["description", "code", "tools"];
172
+ readonly properties: {
173
+ readonly description: {
174
+ readonly type: "string";
175
+ };
176
+ readonly code: {
177
+ readonly type: "string";
178
+ };
179
+ readonly input: {};
180
+ readonly tools: {
181
+ readonly type: "array";
182
+ readonly items: {
183
+ readonly type: "string";
184
+ };
185
+ };
186
+ readonly timeout_ms: {
187
+ readonly type: "integer";
188
+ };
189
+ };
190
+ };
191
+ readonly outputSchema: {
192
+ readonly type: "object";
193
+ readonly additionalProperties: false;
194
+ readonly properties: {
195
+ readonly result: {};
196
+ readonly logs: {
197
+ readonly type: "array";
198
+ readonly items: {
199
+ readonly type: "string";
200
+ };
201
+ };
202
+ readonly meta: {
203
+ readonly type: "object";
204
+ };
205
+ };
206
+ };
207
+ readonly semantics: {
208
+ readonly deterministic: false;
209
+ readonly readsInputs: true;
210
+ };
211
+ readonly limits: {};
212
+ readonly unsupported: readonly ["no access to management or installer bindings"];
213
+ };
214
+ /**
215
+ * Serve one CODE-02 request through the authorized pipeline (CODE-02/04).
216
+ *
217
+ * This is the `tool_mode_run` served path: the caller's arguments are validated
218
+ * into the CODE-02 shape, the program runs through the SAME runner native PTC
219
+ * uses, and the report carries the receipt, elapsed time, call count, catalog
220
+ * revision and warnings the interface promises.
221
+ *
222
+ * `input` is refused when the pinned runtime cannot bind it structurally: CODE-04
223
+ * forbids string interpolation into source, and the current PTC runtime has no
224
+ * data-global path, so an input-bearing program gets a precise refusal naming
225
+ * that limitation rather than a silently interpolated program.
226
+ * @param args - the caller's arguments.
227
+ * @param runner - the prepared runner.
228
+ * @param report - the report-shaped facts the host owns (receipt id, revision).
229
+ * @returns the report.
230
+ */
231
+ export declare function serveProgram(args: Record<string, unknown>, runner: ProgramRunner, report: {
232
+ readonly receiptId: string;
233
+ readonly catalogRevision: string;
234
+ }): Promise<RunReport>;
235
+ //# sourceMappingURL=tool-mode-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-mode-run.d.ts","sourceRoot":"","sources":["../src/tool-mode-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAML,WAAW,EACX,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGrD,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAA;IAClD,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;QAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;QACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;QACjC,QAAQ,CAAC,KAAK,CAAC,EAAE;YAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,QAA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