@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.
- package/README.md +299 -2
- package/bin/dsh-tool-mode-credentials.mjs +20 -0
- package/bin/dsh-tool-mode-mcp-stdio.mjs +80 -0
- package/bin/dsh-tool-mode.mjs +211 -0
- package/builtins.lock.json +26 -0
- package/catalog/desert-ant-models.json +693 -0
- package/catalog/playbooks.json +531 -0
- package/client/client.model-tools.js +1910 -0
- package/client/index.js +4039 -0
- package/cordis.patch.yml +39 -0
- package/lib/adapters/index.d.ts +61 -0
- package/lib/adapters/index.d.ts.map +1 -0
- package/lib/adapters/index.js +82 -0
- package/lib/adapters/types.d.ts +106 -0
- package/lib/adapters/types.d.ts.map +1 -0
- package/lib/adapters/types.js +85 -0
- package/lib/approval.d.ts +189 -0
- package/lib/approval.d.ts.map +1 -0
- package/lib/approval.js +510 -0
- package/lib/asset-acquisition.d.ts +149 -0
- package/lib/asset-acquisition.d.ts.map +1 -0
- package/lib/asset-acquisition.js +175 -0
- package/lib/authority.d.ts +185 -0
- package/lib/authority.d.ts.map +1 -0
- package/lib/authority.js +223 -0
- package/lib/bindings.d.ts +144 -0
- package/lib/bindings.d.ts.map +1 -0
- package/lib/bindings.js +314 -0
- package/lib/builtins.d.ts +27 -0
- package/lib/builtins.d.ts.map +1 -0
- package/lib/builtins.js +37 -0
- package/lib/capability.d.ts +58 -0
- package/lib/capability.d.ts.map +1 -0
- package/lib/capability.js +192 -0
- package/lib/capture-path.d.ts +97 -0
- package/lib/capture-path.d.ts.map +1 -0
- package/lib/capture-path.js +152 -0
- package/lib/catalog.d.ts +37 -0
- package/lib/catalog.d.ts.map +1 -0
- package/lib/catalog.js +274 -0
- package/lib/contract-payload.d.ts +39 -0
- package/lib/contract-payload.d.ts.map +1 -0
- package/lib/contract-payload.js +56 -0
- package/lib/custom-tools/compile.d.ts +25 -0
- package/lib/custom-tools/compile.d.ts.map +1 -0
- package/lib/custom-tools/compile.js +61 -0
- package/lib/custom-tools/composite-executor.d.ts +42 -0
- package/lib/custom-tools/composite-executor.d.ts.map +1 -0
- package/lib/custom-tools/composite-executor.js +113 -0
- package/lib/custom-tools/dispatch.d.ts +28 -0
- package/lib/custom-tools/dispatch.d.ts.map +1 -0
- package/lib/custom-tools/dispatch.js +34 -0
- package/lib/custom-tools/http-executor.d.ts +48 -0
- package/lib/custom-tools/http-executor.d.ts.map +1 -0
- package/lib/custom-tools/http-executor.js +241 -0
- package/lib/custom-tools/index.d.ts +12 -0
- package/lib/custom-tools/index.d.ts.map +1 -0
- package/lib/custom-tools/index.js +12 -0
- package/lib/custom-tools/mcp-surface.d.ts +14 -0
- package/lib/custom-tools/mcp-surface.d.ts.map +1 -0
- package/lib/custom-tools/mcp-surface.js +41 -0
- package/lib/custom-tools/prompt-executor.d.ts +39 -0
- package/lib/custom-tools/prompt-executor.d.ts.map +1 -0
- package/lib/custom-tools/prompt-executor.js +59 -0
- package/lib/custom-tools/registry.d.ts +69 -0
- package/lib/custom-tools/registry.d.ts.map +1 -0
- package/lib/custom-tools/registry.js +130 -0
- package/lib/custom-tools/schema.d.ts +26 -0
- package/lib/custom-tools/schema.d.ts.map +1 -0
- package/lib/custom-tools/schema.js +375 -0
- package/lib/custom-tools/service.d.ts +90 -0
- package/lib/custom-tools/service.d.ts.map +1 -0
- package/lib/custom-tools/service.js +203 -0
- package/lib/custom-tools/store.d.ts +61 -0
- package/lib/custom-tools/store.d.ts.map +1 -0
- package/lib/custom-tools/store.js +240 -0
- package/lib/custom-tools/types.d.ts +131 -0
- package/lib/custom-tools/types.d.ts.map +1 -0
- package/lib/custom-tools/types.js +11 -0
- package/lib/decision-combine.d.ts +113 -0
- package/lib/decision-combine.d.ts.map +1 -0
- package/lib/decision-combine.js +156 -0
- package/lib/decision-evaluate.d.ts +185 -0
- package/lib/decision-evaluate.d.ts.map +1 -0
- package/lib/decision-evaluate.js +227 -0
- package/lib/deployment-coordinator.d.ts +213 -0
- package/lib/deployment-coordinator.d.ts.map +1 -0
- package/lib/deployment-coordinator.js +274 -0
- package/lib/diagnostics.d.ts +169 -0
- package/lib/diagnostics.d.ts.map +1 -0
- package/lib/diagnostics.js +136 -0
- package/lib/discovery-contracts.d.ts +14 -0
- package/lib/discovery-contracts.d.ts.map +1 -0
- package/lib/discovery-contracts.js +90 -0
- package/lib/discovery-describe.d.ts +35 -0
- package/lib/discovery-describe.d.ts.map +1 -0
- package/lib/discovery-describe.js +99 -0
- package/lib/embedding-index.d.ts +55 -0
- package/lib/embedding-index.d.ts.map +1 -0
- package/lib/embedding-index.js +126 -0
- package/lib/extension-dependencies.d.ts +355 -0
- package/lib/extension-dependencies.d.ts.map +1 -0
- package/lib/extension-dependencies.js +987 -0
- package/lib/extension-dispatch.d.ts +150 -0
- package/lib/extension-dispatch.d.ts.map +1 -0
- package/lib/extension-dispatch.js +178 -0
- package/lib/extension-page-state.d.ts +69 -0
- package/lib/extension-page-state.d.ts.map +1 -0
- package/lib/extension-page-state.js +82 -0
- package/lib/extension-registrar.d.ts +116 -0
- package/lib/extension-registrar.d.ts.map +1 -0
- package/lib/extension-registrar.js +144 -0
- package/lib/extensions-api.d.ts +346 -0
- package/lib/extensions-api.d.ts.map +1 -0
- package/lib/extensions-api.js +17 -0
- package/lib/extensions-remote.d.ts +57 -0
- package/lib/extensions-remote.d.ts.map +1 -0
- package/lib/extensions-remote.js +69 -0
- package/lib/extensions-service.d.ts +568 -0
- package/lib/extensions-service.d.ts.map +1 -0
- package/lib/extensions-service.js +2507 -0
- package/lib/harness-budgets.d.ts +158 -0
- package/lib/harness-budgets.d.ts.map +1 -0
- package/lib/harness-budgets.js +152 -0
- package/lib/harness-llm.d.ts +138 -0
- package/lib/harness-llm.d.ts.map +1 -0
- package/lib/harness-llm.js +218 -0
- package/lib/harness-serving.d.ts +115 -0
- package/lib/harness-serving.d.ts.map +1 -0
- package/lib/harness-serving.js +176 -0
- package/lib/headless.d.ts +97 -0
- package/lib/headless.d.ts.map +1 -0
- package/lib/headless.js +407 -0
- package/lib/http-acquisition.d.ts +27 -0
- package/lib/http-acquisition.d.ts.map +1 -0
- package/lib/http-acquisition.js +140 -0
- package/lib/index.d.ts +546 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5197 -0
- package/lib/invocation-accounting.d.ts +169 -0
- package/lib/invocation-accounting.d.ts.map +1 -0
- package/lib/invocation-accounting.js +148 -0
- package/lib/jev.d.ts +218 -0
- package/lib/jev.d.ts.map +1 -0
- package/lib/jev.js +366 -0
- package/lib/legacy-migration.d.ts +95 -0
- package/lib/legacy-migration.d.ts.map +1 -0
- package/lib/legacy-migration.js +429 -0
- package/lib/license-basis.d.ts +29 -0
- package/lib/license-basis.d.ts.map +1 -0
- package/lib/license-basis.js +58 -0
- package/lib/managed-workers.d.ts +158 -0
- package/lib/managed-workers.d.ts.map +1 -0
- package/lib/managed-workers.js +269 -0
- package/lib/mcp/auth-selection.d.ts +35 -0
- package/lib/mcp/auth-selection.d.ts.map +1 -0
- package/lib/mcp/auth-selection.js +64 -0
- package/lib/mcp/client-grant.d.ts +89 -0
- package/lib/mcp/client-grant.d.ts.map +1 -0
- package/lib/mcp/client-grant.js +63 -0
- package/lib/mcp/credential-cli.d.ts +38 -0
- package/lib/mcp/credential-cli.d.ts.map +1 -0
- package/lib/mcp/credential-cli.js +148 -0
- package/lib/mcp/credential-store.d.ts +143 -0
- package/lib/mcp/credential-store.d.ts.map +1 -0
- package/lib/mcp/credential-store.js +461 -0
- package/lib/mcp/export-policy.d.ts +25 -0
- package/lib/mcp/export-policy.d.ts.map +1 -0
- package/lib/mcp/export-policy.js +31 -0
- package/lib/mcp/host-binding.d.ts +144 -0
- package/lib/mcp/host-binding.d.ts.map +1 -0
- package/lib/mcp/host-binding.js +280 -0
- package/lib/mcp/http.d.ts +180 -0
- package/lib/mcp/http.d.ts.map +1 -0
- package/lib/mcp/http.js +602 -0
- package/lib/mcp/oauth.d.ts +149 -0
- package/lib/mcp/oauth.d.ts.map +1 -0
- package/lib/mcp/oauth.js +396 -0
- package/lib/mcp/protocol.d.ts +329 -0
- package/lib/mcp/protocol.d.ts.map +1 -0
- package/lib/mcp/protocol.js +459 -0
- package/lib/mcp/rate-limit.d.ts +68 -0
- package/lib/mcp/rate-limit.d.ts.map +1 -0
- package/lib/mcp/rate-limit.js +114 -0
- package/lib/mcp/sdk-v2.d.ts +17 -0
- package/lib/mcp/sdk-v2.d.ts.map +1 -0
- package/lib/mcp/sdk-v2.js +204 -0
- package/lib/mcp/server.d.ts +149 -0
- package/lib/mcp/server.d.ts.map +1 -0
- package/lib/mcp/server.js +302 -0
- package/lib/mcp/stdio.d.ts +80 -0
- package/lib/mcp/stdio.d.ts.map +1 -0
- package/lib/mcp/stdio.js +184 -0
- package/lib/mcp/subscriptions.d.ts +177 -0
- package/lib/mcp/subscriptions.d.ts.map +1 -0
- package/lib/mcp/subscriptions.js +288 -0
- package/lib/mcp-status.d.ts +96 -0
- package/lib/mcp-status.d.ts.map +1 -0
- package/lib/mcp-status.js +70 -0
- package/lib/mcp-usage.d.ts +110 -0
- package/lib/mcp-usage.d.ts.map +1 -0
- package/lib/mcp-usage.js +189 -0
- package/lib/model-qualification.d.ts +192 -0
- package/lib/model-qualification.d.ts.map +1 -0
- package/lib/model-qualification.js +178 -0
- package/lib/planning.d.ts +256 -0
- package/lib/planning.d.ts.map +1 -0
- package/lib/planning.js +471 -0
- package/lib/playbook.d.ts +42 -0
- package/lib/playbook.d.ts.map +1 -0
- package/lib/playbook.js +65 -0
- package/lib/prepared-assets.d.ts +269 -0
- package/lib/prepared-assets.d.ts.map +1 -0
- package/lib/prepared-assets.js +471 -0
- package/lib/provider-bridge.d.ts +107 -0
- package/lib/provider-bridge.d.ts.map +1 -0
- package/lib/provider-bridge.js +423 -0
- package/lib/ptc-authority.d.ts +154 -0
- package/lib/ptc-authority.d.ts.map +1 -0
- package/lib/ptc-authority.js +242 -0
- package/lib/ptc-confinement.d.ts +60 -0
- package/lib/ptc-confinement.d.ts.map +1 -0
- package/lib/ptc-confinement.js +212 -0
- package/lib/ptc-runtime.d.ts +166 -0
- package/lib/ptc-runtime.d.ts.map +1 -0
- package/lib/ptc-runtime.js +231 -0
- package/lib/publication.d.ts +161 -0
- package/lib/publication.d.ts.map +1 -0
- package/lib/publication.js +181 -0
- package/lib/receipt-store.d.ts +57 -0
- package/lib/receipt-store.d.ts.map +1 -0
- package/lib/receipt-store.js +143 -0
- package/lib/receipt.d.ts +231 -0
- package/lib/receipt.d.ts.map +1 -0
- package/lib/receipt.js +165 -0
- package/lib/registrar.d.ts +75 -0
- package/lib/registrar.d.ts.map +1 -0
- package/lib/registrar.js +152 -0
- package/lib/resource-governance.d.ts +204 -0
- package/lib/resource-governance.d.ts.map +1 -0
- package/lib/resource-governance.js +213 -0
- package/lib/server-lifecycle.d.ts +175 -0
- package/lib/server-lifecycle.d.ts.map +1 -0
- package/lib/server-lifecycle.js +269 -0
- package/lib/skills.d.ts +31 -0
- package/lib/skills.d.ts.map +1 -0
- package/lib/skills.js +170 -0
- package/lib/speech-bridge.d.ts +74 -0
- package/lib/speech-bridge.d.ts.map +1 -0
- package/lib/speech-bridge.js +115 -0
- package/lib/state.d.ts +100 -0
- package/lib/state.d.ts.map +1 -0
- package/lib/state.js +160 -0
- package/lib/title-proposal.d.ts +194 -0
- package/lib/title-proposal.d.ts.map +1 -0
- package/lib/title-proposal.js +244 -0
- package/lib/tool-inventory.d.ts +90 -0
- package/lib/tool-inventory.d.ts.map +1 -0
- package/lib/tool-inventory.js +102 -0
- package/lib/tool-mode-run.d.ts +310 -0
- package/lib/tool-mode-run.d.ts.map +1 -0
- package/lib/tool-mode-run.js +411 -0
- package/lib/tool-sources.d.ts +80 -0
- package/lib/tool-sources.d.ts.map +1 -0
- package/lib/tool-sources.js +123 -0
- package/lib/tool-usage-projection.d.ts +390 -0
- package/lib/tool-usage-projection.d.ts.map +1 -0
- package/lib/tool-usage-projection.js +1038 -0
- package/lib/tool-usage-report.d.ts +153 -0
- package/lib/tool-usage-report.d.ts.map +1 -0
- package/lib/tool-usage-report.js +274 -0
- package/lib/transport.d.ts +158 -0
- package/lib/transport.d.ts.map +1 -0
- package/lib/transport.js +332 -0
- package/lib/types.d.ts +134 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +8 -0
- package/lib/update-surface.d.ts +79 -0
- package/lib/update-surface.d.ts.map +1 -0
- package/lib/update-surface.js +224 -0
- package/lib/version.d.ts +3 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/version.js +27 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contract-metadata.d.ts +13 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contract-metadata.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contract-metadata.js +85 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/lang-detect.d.ts +16 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/lang-detect.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/lang-detect.js +87 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.d.ts +38 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.js +445 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/stt-transcribe.d.ts +20 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/stt-transcribe.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/stt-transcribe.js +112 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.d.ts +14 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.js +63 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.d.ts +14 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.js +76 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/dsh.d.ts +82 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/dsh.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/dsh.js +274 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts +26 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/index.js +53 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/meta.d.ts +133 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/meta.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/meta.js +64 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts +121 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/registry.js +246 -0
- package/node_modules/@try-works/tool-mode-contracts/package.json +35 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/bin/dsh-tool-mode.mjs +20 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.d.ts +80 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.js +533 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.d.ts +86 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.js +145 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.d.ts +70 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.js +201 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.d.ts +57 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.js +83 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.d.ts +33 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.js +33 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.d.ts +86 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.js +191 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.d.ts +137 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.js +349 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts +274 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.js +932 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.d.ts +210 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.js +368 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.d.ts +63 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.js +149 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.d.ts +35 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.js +179 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.d.ts +179 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.js +299 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts +395 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.js +839 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.d.ts +44 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/tar-gzip-source.js +255 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.d.ts +185 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.js +504 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.d.ts +17 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.js +80 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/licensing.d.ts +221 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/licensing.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/licensing.js +188 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.d.ts +52 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.js +102 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.d.ts +171 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.js +271 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.d.ts +242 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.js +58 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.d.ts +128 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.js +113 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/test-host.d.ts +41 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/test-host.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/test-host.js +52 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.d.ts +2 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.js +351 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.d.ts +157 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.js +688 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/package.json +54 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/schema/extension-manifest-1.1.0.schema.json +253 -0
- package/node_modules/@try-works/tool-mode-recipes/bin/tool-mode-recipe.mjs +15 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/broker.d.ts +460 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/broker.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/broker.js +647 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts +61 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/cli.js +1106 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.d.ts +237 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.js +205 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.d.ts +85 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.js +176 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/images.d.ts +119 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/images.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/images.js +201 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/index.d.ts +25 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/index.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/index.js +25 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.d.ts +345 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.js +1465 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/templates.d.ts +51 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/templates.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/templates.js +310 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/titles.d.ts +231 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/titles.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/titles.js +435 -0
- package/node_modules/@try-works/tool-mode-recipes/package.json +56 -0
- package/node_modules/@try-works/tool-mode-recipes/recipes/describe-image.json +38 -0
- package/node_modules/@try-works/tool-mode-recipes/recipes/text-title.json +45 -0
- package/node_modules/@try-works/tool-mode-recipes/schema/harness-model-recipe.schema.json +273 -0
- package/package.json +127 -4
- package/remote/spec.mjs +993 -0
- package/remote/typert.host.mjs +14 -0
- package/remote/typert.remote-client.mjs +16 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `text.rerank` — the cross-encoder reranking contract (TOOL-05).
|
|
3
|
+
*
|
|
4
|
+
* Model-free: any conforming implementation binds to it. The scores are
|
|
5
|
+
* RANKING LOGITS from a cross-encoder — not embedding cosines, and the two
|
|
6
|
+
* score kinds are never interchangeable (the semantic_rank tool's
|
|
7
|
+
* cosine_similarity is a different quantity).
|
|
8
|
+
*
|
|
9
|
+
* @module @try-works/tool-mode-contracts/contracts/text-rerank
|
|
10
|
+
*/
|
|
11
|
+
import { withMeta } from "../meta.js";
|
|
12
|
+
/** The `text.rerank` contract at version 1.0.0. */
|
|
13
|
+
export const textRerank = {
|
|
14
|
+
contract: 'text.rerank',
|
|
15
|
+
version: '1.0.0',
|
|
16
|
+
toolName: 'text_rerank',
|
|
17
|
+
description: 'Score query/document pairs with a cross-encoder and return the caller\'s own ids in descending '
|
|
18
|
+
+ 'ranking-logit order with exact ties broken by input order. The scores are cross-encoder '
|
|
19
|
+
+ 'logits (scoreKind "ranking_logit"), NOT embedding cosines: the two are not interchangeable. '
|
|
20
|
+
+ 'A positive top_k within the candidate count is required when supplied.',
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
additionalProperties: false,
|
|
24
|
+
required: ['query', 'documents'],
|
|
25
|
+
properties: {
|
|
26
|
+
query: { type: 'string', minLength: 1, maxLength: 32768 },
|
|
27
|
+
documents: {
|
|
28
|
+
type: 'array',
|
|
29
|
+
minItems: 1,
|
|
30
|
+
maxItems: 256,
|
|
31
|
+
items: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
additionalProperties: false,
|
|
34
|
+
required: ['id', 'text'],
|
|
35
|
+
properties: {
|
|
36
|
+
id: { type: 'string', minLength: 1, maxLength: 128 },
|
|
37
|
+
text: { type: 'string', minLength: 1, maxLength: 32768 },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
description: 'The documents in the caller\'s order; that order breaks exact score ties (TOOL-05).',
|
|
41
|
+
},
|
|
42
|
+
top_k: { type: 'integer', minimum: 1, maximum: 256 },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
outputSchema: withMeta({
|
|
46
|
+
results: {
|
|
47
|
+
type: 'array',
|
|
48
|
+
items: {
|
|
49
|
+
type: 'object',
|
|
50
|
+
additionalProperties: false,
|
|
51
|
+
required: ['id', 'score'],
|
|
52
|
+
properties: {
|
|
53
|
+
id: { type: 'string' },
|
|
54
|
+
score: { type: 'number' },
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
scoreKind: { const: 'ranking_logit' },
|
|
59
|
+
}, ['results', 'scoreKind']),
|
|
60
|
+
semantics: {
|
|
61
|
+
scoreKind: 'ranking-logit',
|
|
62
|
+
calibrated: false,
|
|
63
|
+
emptyInputMeaning: 'binding-error',
|
|
64
|
+
appliesTo: 'written-text-only',
|
|
65
|
+
},
|
|
66
|
+
limits: {
|
|
67
|
+
maxDocuments: 256,
|
|
68
|
+
maxInputCharacters: 32768,
|
|
69
|
+
maxTopK: 256,
|
|
70
|
+
},
|
|
71
|
+
unsupported: [
|
|
72
|
+
'Treating ranking logits as embedding cosines.',
|
|
73
|
+
'Negative or zero top_k when supplied.',
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=text-rerank.js.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projection of a contract into DSH's parameter DSL (DECL-01).
|
|
3
|
+
*
|
|
4
|
+
* DECL-01 requires that DSH registration, MCP projection and Code Mode types all
|
|
5
|
+
* come from one source. The contract's JSON Schema is that source; this module is
|
|
6
|
+
* the DSH-specific projection of it.
|
|
7
|
+
*
|
|
8
|
+
* It replaces the old registrar behaviour that inferred the required input from
|
|
9
|
+
* parameter ORDER (BASE-04). Requiredness now comes from the schema's `required`
|
|
10
|
+
* array, so a contract cannot silently change meaning when a property is
|
|
11
|
+
* reordered.
|
|
12
|
+
*
|
|
13
|
+
* @module @try-works/tool-mode-contracts/dsh
|
|
14
|
+
*/
|
|
15
|
+
import type { ToolContract } from './registry.ts';
|
|
16
|
+
/** One DSH parameter property: a JSON-Schema subset plus `required`. */
|
|
17
|
+
type DshProperty = Record<string, unknown> & {
|
|
18
|
+
required?: true;
|
|
19
|
+
};
|
|
20
|
+
/** The implicit-open-object parameter map DSH expects. */
|
|
21
|
+
export type DshParameters = Record<string, DshProperty>;
|
|
22
|
+
/** The result of projecting a contract into DSH's narrower DSL. */
|
|
23
|
+
export interface DshProjection {
|
|
24
|
+
/** What the model-facing parameter schema advertises. */
|
|
25
|
+
readonly parameters: DshParameters;
|
|
26
|
+
/**
|
|
27
|
+
* Contract keywords the parameter schema cannot advertise, in `path.keyword`
|
|
28
|
+
* form. They remain enforced at runtime against the full contract schema.
|
|
29
|
+
*/
|
|
30
|
+
readonly runtimeEnforced: readonly string[];
|
|
31
|
+
}
|
|
32
|
+
/** Raised when a contract uses a schema shape the DSH DSL cannot express. */
|
|
33
|
+
export declare class ProjectionError extends Error {
|
|
34
|
+
readonly name = "ProjectionError";
|
|
35
|
+
readonly unsupported: readonly string[];
|
|
36
|
+
constructor(contract: string, unsupported: readonly string[]);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Project a contract's input schema into DSH parameters.
|
|
40
|
+
*
|
|
41
|
+
* DSH's DSL is narrower than JSON Schema — it has no `minLength`, `minimum` or
|
|
42
|
+
* `pattern` at any nesting level — so the projection is deliberately lossy in what
|
|
43
|
+
* it ADVERTISES while remaining complete in what it ENFORCES. BASE-04 forbids
|
|
44
|
+
* silently discarding a constraint, so every keyword left out is returned in
|
|
45
|
+
* {@link DshProjection.runtimeEnforced} and is checked by `assertValidInput`
|
|
46
|
+
* against the untouched contract.
|
|
47
|
+
* @param contract - the contract to project.
|
|
48
|
+
* @returns the parameter map plus the keywords enforced only at runtime.
|
|
49
|
+
*/
|
|
50
|
+
export declare function projectToDsh(contract: ToolContract): DshProjection;
|
|
51
|
+
/**
|
|
52
|
+
* Project a contract's input schema into DSH parameters.
|
|
53
|
+
* @param contract - the contract to project.
|
|
54
|
+
* @returns the parameter map.
|
|
55
|
+
* @throws ProjectionError when the schema is internally inconsistent.
|
|
56
|
+
*/
|
|
57
|
+
export declare function toDshParameters(contract: ToolContract): DshParameters;
|
|
58
|
+
/**
|
|
59
|
+
* Cross-field constraints the DSH parameter DSL cannot express (BASE-04).
|
|
60
|
+
*
|
|
61
|
+
* Each returns a violation message, or undefined when the arguments are
|
|
62
|
+
* acceptable. They run after schema validation, so each may assume its fields
|
|
63
|
+
* are present and correctly typed.
|
|
64
|
+
*/
|
|
65
|
+
export type CrossFieldRule = (args: Record<string, unknown>) => string | undefined;
|
|
66
|
+
/** The cross-field rules that apply to a given contract. */
|
|
67
|
+
export declare function crossFieldRules(contract: ToolContract): CrossFieldRule[];
|
|
68
|
+
/**
|
|
69
|
+
* Project an arbitrary JSON Schema into the subset DSH can advertise (DECL-02).
|
|
70
|
+
*
|
|
71
|
+
* Written for the OUTPUT schema, which needs the same treatment the input schema
|
|
72
|
+
* already gets. Using the contract's raw output schema would crash registration on the
|
|
73
|
+
* first keyword the DSL cannot express — the failure that produced `runtimeEnforced` in
|
|
74
|
+
* the first place — and using an unconstrained `{type: "object", additionalProperties:
|
|
75
|
+
* true}` instead, which is what this replaced, publishes a tool whose result shape is
|
|
76
|
+
* declared to be anything at all.
|
|
77
|
+
* @param schema - the schema to project.
|
|
78
|
+
* @returns the projected schema plus the keywords left to runtime enforcement.
|
|
79
|
+
*/
|
|
80
|
+
export declare function projectSchemaToDsh(schema: Readonly<Record<string, unknown>>): DshProjection;
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=dsh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dsh.d.ts","sourceRoot":"","sources":["../src/dsh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,wEAAwE;AACxE,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,IAAI,CAAA;CAAE,CAAA;AAEhE,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;AAEvD,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAA;IAClC;;;OAGG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAA;CAC5C;AAED,6EAA6E;AAC7E,qBAAa,eAAgB,SAAQ,KAAK;IACxC,SAAkB,IAAI,qBAAoB;IAC1C,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;gBAC3B,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE;CAO7D;AAuHD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,aAAa,CAuBlE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,YAAY,GAAG,aAAa,CAErE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,GAAG,SAAS,CAAA;AAElF,4DAA4D;AAC5D,wBAAgB,eAAe,CAAC,QAAQ,EAAE,YAAY,GAAG,cAAc,EAAE,CAqCxE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,aAAa,CAiB3F"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projection of a contract into DSH's parameter DSL (DECL-01).
|
|
3
|
+
*
|
|
4
|
+
* DECL-01 requires that DSH registration, MCP projection and Code Mode types all
|
|
5
|
+
* come from one source. The contract's JSON Schema is that source; this module is
|
|
6
|
+
* the DSH-specific projection of it.
|
|
7
|
+
*
|
|
8
|
+
* It replaces the old registrar behaviour that inferred the required input from
|
|
9
|
+
* parameter ORDER (BASE-04). Requiredness now comes from the schema's `required`
|
|
10
|
+
* array, so a contract cannot silently change meaning when a property is
|
|
11
|
+
* reordered.
|
|
12
|
+
*
|
|
13
|
+
* @module @try-works/tool-mode-contracts/dsh
|
|
14
|
+
*/
|
|
15
|
+
/** Raised when a contract uses a schema shape the DSH DSL cannot express. */
|
|
16
|
+
export class ProjectionError extends Error {
|
|
17
|
+
name = 'ProjectionError';
|
|
18
|
+
unsupported;
|
|
19
|
+
constructor(contract, unsupported) {
|
|
20
|
+
super(`${contract} cannot be projected into the DSH parameter DSL: ${unsupported.join('; ')}. `
|
|
21
|
+
+ 'Weakening the schema silently is not permitted (BASE-04), so the contract must be reshaped.');
|
|
22
|
+
this.unsupported = unsupported;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* JSON-Schema keywords the DSH value-schema DSL can carry.
|
|
27
|
+
*
|
|
28
|
+
* Anything outside this set is not DISCARDED: it stays in the contract and is
|
|
29
|
+
* enforced at runtime by {@link assertValidInput}, which validates arguments
|
|
30
|
+
* against the full contract schema before the implementation runs. This module
|
|
31
|
+
* only decides what the model-facing parameter schema advertises.
|
|
32
|
+
*/
|
|
33
|
+
const DSH_SUPPORTED = new Set([
|
|
34
|
+
'type', 'enum', 'const', 'description', 'default', 'examples',
|
|
35
|
+
'items', 'properties', 'additionalProperties', 'required',
|
|
36
|
+
]);
|
|
37
|
+
/**
|
|
38
|
+
* Project one JSON-Schema node into the subset DSH can carry.
|
|
39
|
+
*
|
|
40
|
+
* Recursive because DSH validates nested object properties too, so a constraint
|
|
41
|
+
* on `audio.path` reaches the same DSL limit as one on a top-level property.
|
|
42
|
+
* @param node - the schema node to project.
|
|
43
|
+
* @param path - dotted path for reporting what was left out.
|
|
44
|
+
* @param runtimeEnforced - accumulates `path.keyword` entries.
|
|
45
|
+
* @returns the projected node.
|
|
46
|
+
*/
|
|
47
|
+
function projectNode(node, path, runtimeEnforced) {
|
|
48
|
+
const out = {};
|
|
49
|
+
/**
|
|
50
|
+
* Requiredness is expressed PER PROPERTY, at every nesting level.
|
|
51
|
+
*
|
|
52
|
+
* DSH's value schema DSL does not admit a `required` array anywhere — it rejected
|
|
53
|
+
* `schema.required` at the root and `items.required` inside an array — so the list is
|
|
54
|
+
* folded into `required: true` on each named property, which the DSL does understand.
|
|
55
|
+
* Doing it here rather than at the root is what makes it work at depth: an output
|
|
56
|
+
* schema's array items have required fields of their own.
|
|
57
|
+
*/
|
|
58
|
+
const requiredNames = new Set(node.required ?? []);
|
|
59
|
+
for (const [keyword, value] of Object.entries(node)) {
|
|
60
|
+
if (!DSH_SUPPORTED.has(keyword)) {
|
|
61
|
+
runtimeEnforced.push(`${path}.${keyword}`);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
// Handled through `properties` above; the DSL has no array form.
|
|
65
|
+
if (keyword === 'required')
|
|
66
|
+
continue;
|
|
67
|
+
if (keyword === 'properties' && typeof value === 'object' && value !== null) {
|
|
68
|
+
const nested = {};
|
|
69
|
+
for (const [name, child] of Object.entries(value)) {
|
|
70
|
+
const projected = typeof child === 'object' && child !== null
|
|
71
|
+
? projectNode(child, `${path}.${name}`, runtimeEnforced)
|
|
72
|
+
: child;
|
|
73
|
+
nested[name] = requiredNames.has(name) && typeof projected === 'object' && projected !== null
|
|
74
|
+
? { ...projected, required: true }
|
|
75
|
+
: projected;
|
|
76
|
+
}
|
|
77
|
+
out[keyword] = nested;
|
|
78
|
+
}
|
|
79
|
+
else if (keyword === 'items' && typeof value === 'object' && value !== null) {
|
|
80
|
+
out[keyword] = projectNode(value, `${path}[]`, runtimeEnforced);
|
|
81
|
+
}
|
|
82
|
+
else if (keyword === 'type' && Array.isArray(value)) {
|
|
83
|
+
/**
|
|
84
|
+
* A union `type` array is advertised as `type: 'json'` (unconstrained), NOT
|
|
85
|
+
* narrowed to one member.
|
|
86
|
+
*
|
|
87
|
+
* An earlier version advertised the concrete non-null member, which made the
|
|
88
|
+
* advertised schema STRICTER than the contract: `{ type: ['string','null'] }`
|
|
89
|
+
* was projected to `type: 'string'`, and the registry VALIDATES success values
|
|
90
|
+
* against the advertised schema, so a legitimate null result was rejected.
|
|
91
|
+
* Dropping the type entirely also fails: the DSL requires every property to
|
|
92
|
+
* have a type or oneOf. `type: 'json'` is the loosest the DSL accepts, it is
|
|
93
|
+
* strictly looser than any union, and the runtime contract check still enforces
|
|
94
|
+
* the union itself.
|
|
95
|
+
*/
|
|
96
|
+
runtimeEnforced.push(`${path}.type(union -> json)`);
|
|
97
|
+
out.type = 'json';
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
out[keyword] = value;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Post-pass the DSL rejects but projectNode would otherwise emit:
|
|
105
|
+
*
|
|
106
|
+
* - `type: 'json'` cannot carry `items`/`enum`/`const` siblings, so a union-typed
|
|
107
|
+
* array whose element schema (or scalar constraints) survived the pass is
|
|
108
|
+
* stripped HERE, with the keyword recorded rather than silently lost.
|
|
109
|
+
* - A NON-SCALAR `enum` is dropped everywhere: the DSL requires "a non-empty array
|
|
110
|
+
* of scalar values", and the confidence contract (DECL-04) enumerates OBJECT
|
|
111
|
+
* members to distinguish vendor-reported from calibrated from unavailable.
|
|
112
|
+
* Membership is still enforced at runtime against the untouched contract.
|
|
113
|
+
* - An annotation-only node (every keyword dropped to runtimeEnforced) has no
|
|
114
|
+
* `type`/`oneOf`, which the DSL rejects; advertising `type: 'json'` keeps it
|
|
115
|
+
* strictly looser than the original instead of crashing registration.
|
|
116
|
+
*/
|
|
117
|
+
if (out.type === undefined && out.oneOf === undefined) {
|
|
118
|
+
runtimeEnforced.push(`${path}.type(annotation-only -> json)`);
|
|
119
|
+
out.type = 'json';
|
|
120
|
+
}
|
|
121
|
+
if (out.type === 'json') {
|
|
122
|
+
for (const sibling of ['items', 'enum', 'const']) {
|
|
123
|
+
if (sibling in out) {
|
|
124
|
+
runtimeEnforced.push(`${path}.${sibling}`);
|
|
125
|
+
delete out[sibling];
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (out.type !== 'json' && Array.isArray(out.enum) && !out.enum.every(member => isScalar(member))) {
|
|
130
|
+
runtimeEnforced.push(`${path}.enum`);
|
|
131
|
+
delete out.enum;
|
|
132
|
+
}
|
|
133
|
+
return out;
|
|
134
|
+
}
|
|
135
|
+
/** A scalar the DSL's `enum` admits. */
|
|
136
|
+
function isScalar(member) {
|
|
137
|
+
return typeof member === 'string' || typeof member === 'number' || typeof member === 'boolean';
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Project a contract's input schema into DSH parameters.
|
|
141
|
+
*
|
|
142
|
+
* DSH's DSL is narrower than JSON Schema — it has no `minLength`, `minimum` or
|
|
143
|
+
* `pattern` at any nesting level — so the projection is deliberately lossy in what
|
|
144
|
+
* it ADVERTISES while remaining complete in what it ENFORCES. BASE-04 forbids
|
|
145
|
+
* silently discarding a constraint, so every keyword left out is returned in
|
|
146
|
+
* {@link DshProjection.runtimeEnforced} and is checked by `assertValidInput`
|
|
147
|
+
* against the untouched contract.
|
|
148
|
+
* @param contract - the contract to project.
|
|
149
|
+
* @returns the parameter map plus the keywords enforced only at runtime.
|
|
150
|
+
*/
|
|
151
|
+
export function projectToDsh(contract) {
|
|
152
|
+
const schema = contract.inputSchema;
|
|
153
|
+
const properties = schema.properties ?? {};
|
|
154
|
+
const required = new Set(schema.required ?? []);
|
|
155
|
+
const runtimeEnforced = [];
|
|
156
|
+
const out = {};
|
|
157
|
+
for (const [name, property] of Object.entries(properties)) {
|
|
158
|
+
const projected = projectNode(property, name, runtimeEnforced);
|
|
159
|
+
if (required.has(name))
|
|
160
|
+
projected.required = true;
|
|
161
|
+
out[name] = projected;
|
|
162
|
+
}
|
|
163
|
+
// A required property that is not declared cannot be satisfied by any caller.
|
|
164
|
+
const undeclared = [...required].filter(name => !(name in properties));
|
|
165
|
+
if (undeclared.length > 0) {
|
|
166
|
+
throw new ProjectionError(contract.contract, undeclared.map(name => `required property "${name}" is not declared`));
|
|
167
|
+
}
|
|
168
|
+
return { parameters: out, runtimeEnforced };
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Project a contract's input schema into DSH parameters.
|
|
172
|
+
* @param contract - the contract to project.
|
|
173
|
+
* @returns the parameter map.
|
|
174
|
+
* @throws ProjectionError when the schema is internally inconsistent.
|
|
175
|
+
*/
|
|
176
|
+
export function toDshParameters(contract) {
|
|
177
|
+
return projectToDsh(contract).parameters;
|
|
178
|
+
}
|
|
179
|
+
/** The cross-field rules that apply to a given contract. */
|
|
180
|
+
export function crossFieldRules(contract) {
|
|
181
|
+
switch (contract.contract) {
|
|
182
|
+
case 'stt.transcribe':
|
|
183
|
+
return [
|
|
184
|
+
(args) => {
|
|
185
|
+
const timestamps = args.timestamps;
|
|
186
|
+
if (timestamps === 'word' && args.language === undefined) {
|
|
187
|
+
// Not a hard error, but a caller asking for word timing without
|
|
188
|
+
// declaring a language gets worse results on code-switched audio.
|
|
189
|
+
return undefined;
|
|
190
|
+
}
|
|
191
|
+
return undefined;
|
|
192
|
+
},
|
|
193
|
+
(args) => {
|
|
194
|
+
const audio = args.audio;
|
|
195
|
+
if (audio?.channels !== undefined && audio.channels !== 1) {
|
|
196
|
+
return 'audio.channels must be 1: the admitted input is 16 kHz mono';
|
|
197
|
+
}
|
|
198
|
+
if (audio?.sampleRateHz !== undefined && audio.sampleRateHz !== 16000) {
|
|
199
|
+
return 'audio.sampleRateHz must be 16000: resampling is not part of this contract';
|
|
200
|
+
}
|
|
201
|
+
return undefined;
|
|
202
|
+
},
|
|
203
|
+
];
|
|
204
|
+
case 'text.language_detect':
|
|
205
|
+
return [
|
|
206
|
+
(args) => {
|
|
207
|
+
const text = args.text;
|
|
208
|
+
if (typeof text === 'string' && text.trim().length === 0) {
|
|
209
|
+
return 'text must contain at least one non-whitespace character';
|
|
210
|
+
}
|
|
211
|
+
return undefined;
|
|
212
|
+
},
|
|
213
|
+
];
|
|
214
|
+
default:
|
|
215
|
+
return [];
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Project an arbitrary JSON Schema into the subset DSH can advertise (DECL-02).
|
|
220
|
+
*
|
|
221
|
+
* Written for the OUTPUT schema, which needs the same treatment the input schema
|
|
222
|
+
* already gets. Using the contract's raw output schema would crash registration on the
|
|
223
|
+
* first keyword the DSL cannot express — the failure that produced `runtimeEnforced` in
|
|
224
|
+
* the first place — and using an unconstrained `{type: "object", additionalProperties:
|
|
225
|
+
* true}` instead, which is what this replaced, publishes a tool whose result shape is
|
|
226
|
+
* declared to be anything at all.
|
|
227
|
+
* @param schema - the schema to project.
|
|
228
|
+
* @returns the projected schema plus the keywords left to runtime enforcement.
|
|
229
|
+
*/
|
|
230
|
+
export function projectSchemaToDsh(schema) {
|
|
231
|
+
const runtimeEnforced = [];
|
|
232
|
+
const projected = projectNode(schema, '', runtimeEnforced);
|
|
233
|
+
/**
|
|
234
|
+
* Nested array `items` are RETAINED, not stripped.
|
|
235
|
+
*
|
|
236
|
+
* An earlier version stripped every `items` at depth, on evidence that the registry
|
|
237
|
+
* rejected `schema.properties.words.items`. That evidence is stale against the pinned
|
|
238
|
+
* `dsh-tools@0.2.0-rc.2`, which compiles nested array items (probed: a `words` schema
|
|
239
|
+
* with a full item schema registers and validates). Stripping by key name was also a
|
|
240
|
+
* stricter-than-contract bug in waiting: a payload field legitimately NAMED `items`
|
|
241
|
+
* would lose its advertisement. Union-typed arrays (`type: ['array','null']`) become
|
|
242
|
+
* `type: 'json'` in projectNode, which already removes the `items` sibling with the
|
|
243
|
+
* keyword recorded, so nothing here needs to strip it again.
|
|
244
|
+
*/
|
|
245
|
+
const parameters = stripItems(projected.properties ?? {}, '', runtimeEnforced);
|
|
246
|
+
return { parameters: parameters, runtimeEnforced };
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Deep-clone a projected schema while preserving ARRAYS as arrays (DECL-02).
|
|
250
|
+
*
|
|
251
|
+
* The post-pass in projectNode removed every keyword the DSL rejects, so this
|
|
252
|
+
* function no longer edits keywords — it exists so no recursion turns a scalar
|
|
253
|
+
* `enum` array like ['host','device'] into a record {0:'host',1:'device'}, which
|
|
254
|
+
* is an invalid schema the registry rejects.
|
|
255
|
+
* @param node - the projected node.
|
|
256
|
+
* @param path - the path, for diagnostics.
|
|
257
|
+
* @param runtimeEnforced - collected keyword paths (unused; kept for the signature).
|
|
258
|
+
* @returns the node, arrays intact.
|
|
259
|
+
*/
|
|
260
|
+
function stripItems(node, path, runtimeEnforced) {
|
|
261
|
+
void path;
|
|
262
|
+
void runtimeEnforced;
|
|
263
|
+
if (typeof node !== 'object' || node === null)
|
|
264
|
+
return node;
|
|
265
|
+
if (Array.isArray(node)) {
|
|
266
|
+
return node.map((child, index) => stripItems(child, `${path}[${index}]`, runtimeEnforced));
|
|
267
|
+
}
|
|
268
|
+
const out = {};
|
|
269
|
+
for (const [key, value] of Object.entries(node)) {
|
|
270
|
+
out[key] = stripItems(value, `${path}.${key}`, runtimeEnforced);
|
|
271
|
+
}
|
|
272
|
+
return out;
|
|
273
|
+
}
|
|
274
|
+
//# sourceMappingURL=dsh.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@try-works/tool-mode-contracts` — model-free standard tool contracts.
|
|
3
|
+
*
|
|
4
|
+
* This package contains no model bindings, no weights and no host code. It is the
|
|
5
|
+
* shared vocabulary that the Tool Mode host registers, that MCP clients read, and
|
|
6
|
+
* that extension packages implement against (DECL-01).
|
|
7
|
+
*
|
|
8
|
+
* @module @try-works/tool-mode-contracts
|
|
9
|
+
*/
|
|
10
|
+
export { assertValidContract, assertValidInput, assertValidOutput, assertAgainstSchema, compileSchema, ContractError, ContractViolationError, TOOL_META_SCHEMA, type ToolContract, } from './registry.ts';
|
|
11
|
+
export { withMeta, type ConfidenceKind, type ConfidenceMetadata, type ExecutionLocation, type ToolMeta, } from './meta.ts';
|
|
12
|
+
export { crossFieldRules, ProjectionError, projectSchemaToDsh, projectToDsh, toDshParameters, type CrossFieldRule, type DshParameters, type DshProjection, } from './dsh.ts';
|
|
13
|
+
export { sttTranscribe, STT_ADMITTED_FORMATS } from './contracts/stt-transcribe.ts';
|
|
14
|
+
export { langDetect } from './contracts/lang-detect.ts';
|
|
15
|
+
export { textEmbed } from './contracts/text-embed.ts';
|
|
16
|
+
export { textRerank } from './contracts/text-rerank.ts';
|
|
17
|
+
export { textTitle, imageDescribe, multimodalEmbed, semanticSimilarity, semanticRank, semanticClassify, semanticDeduplicate, mediaFindMoments, decisionChoose, decisionTest, decisionScore, structuredExtract, toolsPlan, } from './contracts/standard.ts';
|
|
18
|
+
import type { ToolContract } from './registry.ts';
|
|
19
|
+
/**
|
|
20
|
+
* The standard contracts every Tool Mode host knows how to register.
|
|
21
|
+
*
|
|
22
|
+
* A host iterates this list; it does not switch on model names, which is what
|
|
23
|
+
* ARCH-02 and EXT-01 require of model-independent code.
|
|
24
|
+
*/
|
|
25
|
+
export declare const STANDARD_CONTRACTS: readonly ToolContract[];
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,QAAQ,EACR,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,GACd,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EACL,SAAS,EACT,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,SAAS,GACV,MAAM,yBAAyB,CAAA;AAqBhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,YAAY,EAsBnD,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@try-works/tool-mode-contracts` — model-free standard tool contracts.
|
|
3
|
+
*
|
|
4
|
+
* This package contains no model bindings, no weights and no host code. It is the
|
|
5
|
+
* shared vocabulary that the Tool Mode host registers, that MCP clients read, and
|
|
6
|
+
* that extension packages implement against (DECL-01).
|
|
7
|
+
*
|
|
8
|
+
* @module @try-works/tool-mode-contracts
|
|
9
|
+
*/
|
|
10
|
+
export { assertValidContract, assertValidInput, assertValidOutput, assertAgainstSchema, compileSchema, ContractError, ContractViolationError, TOOL_META_SCHEMA, } from "./registry.js";
|
|
11
|
+
export { withMeta, } from "./meta.js";
|
|
12
|
+
export { crossFieldRules, ProjectionError, projectSchemaToDsh, projectToDsh, toDshParameters, } from "./dsh.js";
|
|
13
|
+
export { sttTranscribe, STT_ADMITTED_FORMATS } from "./contracts/stt-transcribe.js";
|
|
14
|
+
export { langDetect } from "./contracts/lang-detect.js";
|
|
15
|
+
export { textEmbed } from "./contracts/text-embed.js";
|
|
16
|
+
export { textRerank } from "./contracts/text-rerank.js";
|
|
17
|
+
export { textTitle, imageDescribe, multimodalEmbed, semanticSimilarity, semanticRank, semanticClassify, semanticDeduplicate, mediaFindMoments, decisionChoose, decisionTest, decisionScore, structuredExtract, toolsPlan, } from "./contracts/standard.js";
|
|
18
|
+
import { sttTranscribe } from "./contracts/stt-transcribe.js";
|
|
19
|
+
import { langDetect } from "./contracts/lang-detect.js";
|
|
20
|
+
import { textEmbed } from "./contracts/text-embed.js";
|
|
21
|
+
import { textRerank } from "./contracts/text-rerank.js";
|
|
22
|
+
import { textTitle, imageDescribe, multimodalEmbed, semanticSimilarity, semanticRank, semanticClassify, semanticDeduplicate, mediaFindMoments, decisionChoose, decisionTest, decisionScore, structuredExtract, toolsPlan, } from "./contracts/standard.js";
|
|
23
|
+
import { CONTRACT_EXAMPLES, CONTRACT_POLICIES } from "./contract-metadata.js";
|
|
24
|
+
/**
|
|
25
|
+
* The standard contracts every Tool Mode host knows how to register.
|
|
26
|
+
*
|
|
27
|
+
* A host iterates this list; it does not switch on model names, which is what
|
|
28
|
+
* ARCH-02 and EXT-01 require of model-independent code.
|
|
29
|
+
*/
|
|
30
|
+
export const STANDARD_CONTRACTS = [
|
|
31
|
+
sttTranscribe,
|
|
32
|
+
langDetect,
|
|
33
|
+
textEmbed,
|
|
34
|
+
textRerank,
|
|
35
|
+
textTitle,
|
|
36
|
+
imageDescribe,
|
|
37
|
+
multimodalEmbed,
|
|
38
|
+
semanticSimilarity,
|
|
39
|
+
semanticRank,
|
|
40
|
+
semanticClassify,
|
|
41
|
+
semanticDeduplicate,
|
|
42
|
+
mediaFindMoments,
|
|
43
|
+
decisionChoose,
|
|
44
|
+
decisionTest,
|
|
45
|
+
decisionScore,
|
|
46
|
+
structuredExtract,
|
|
47
|
+
toolsPlan,
|
|
48
|
+
].map(contract => ({
|
|
49
|
+
...contract,
|
|
50
|
+
examples: CONTRACT_EXAMPLES[contract.contract] ?? [],
|
|
51
|
+
policy: CONTRACT_POLICIES[contract.contract] ?? { recording: 'required', remote: 'allowed' },
|
|
52
|
+
}));
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared result envelope every Tool Mode tool returns (DECL-03).
|
|
3
|
+
*
|
|
4
|
+
* The envelope is what makes a result self-describing: a caller can tell which
|
|
5
|
+
* contract and version produced it, which implementation actually ran, where it
|
|
6
|
+
* ran, and whether the host attached any warnings. The host stamps the
|
|
7
|
+
* authoritative provenance fields; an implementation cannot forge another
|
|
8
|
+
* package's identity.
|
|
9
|
+
*
|
|
10
|
+
* DECL-04 is the reason `warnings` exists but a universal `confidence` does not:
|
|
11
|
+
* a successful call means a valid result was produced, not that it is correct,
|
|
12
|
+
* and a fabricated confidence number would claim more than the model supplied.
|
|
13
|
+
*
|
|
14
|
+
* @module @try-works/tool-mode-contracts/meta
|
|
15
|
+
*/
|
|
16
|
+
/** Where an implementation executed, relative to the caller (SPEC §6). */
|
|
17
|
+
export type ExecutionLocation =
|
|
18
|
+
/** The harness host process itself. */
|
|
19
|
+
'host'
|
|
20
|
+
/** The user's own device. */
|
|
21
|
+
| 'device'
|
|
22
|
+
/** A user-controlled server on the local network. */
|
|
23
|
+
| 'team-server'
|
|
24
|
+
/** A remote service outside the user's control. */
|
|
25
|
+
| 'remote';
|
|
26
|
+
/** The four confidence categories a result may honestly claim (DECL-04). */
|
|
27
|
+
export type ConfidenceKind = 'vendor-reported' | 'calibrated' | 'ranking-logits' | 'unavailable';
|
|
28
|
+
/** Confidence metadata carried in the envelope; never a fabricated universal number. */
|
|
29
|
+
export interface ConfidenceMetadata {
|
|
30
|
+
readonly kind: ConfidenceKind;
|
|
31
|
+
/** Where the claim comes from (the vendor field, calibration report, or host). */
|
|
32
|
+
readonly source: string;
|
|
33
|
+
}
|
|
34
|
+
/** Provenance and status metadata shared by every tool result. */
|
|
35
|
+
export interface ToolMeta {
|
|
36
|
+
/** Contract identity, e.g. `stt.transcribe`. */
|
|
37
|
+
readonly contract: string;
|
|
38
|
+
/** Semantic version of the CONTRACT, independent of the host release. */
|
|
39
|
+
readonly contractVersion: string;
|
|
40
|
+
/** The implementation that actually executed, e.g. `voz-onnx`. */
|
|
41
|
+
readonly implementationId: string;
|
|
42
|
+
/** Owning extension package identity. */
|
|
43
|
+
readonly extension: string;
|
|
44
|
+
/** Extension version, stamped by the host. */
|
|
45
|
+
readonly extensionVersion: string;
|
|
46
|
+
/** Which activation generation produced this result (DECL-08). */
|
|
47
|
+
readonly activationGeneration: number;
|
|
48
|
+
/** Where the work happened. */
|
|
49
|
+
readonly executionLocation: ExecutionLocation;
|
|
50
|
+
/** Host-issued receipt identity, for correlation and audit. */
|
|
51
|
+
readonly receiptId: string;
|
|
52
|
+
/** Non-fatal conditions the caller should know about. */
|
|
53
|
+
readonly warnings: readonly string[];
|
|
54
|
+
/**
|
|
55
|
+
* Optional confidence descriptor. Its presence names the CATEGORY and source;
|
|
56
|
+
* absence means no confidence claim was made. A calibrated value is only
|
|
57
|
+
* reported here when a calibration report exists (DECL-04).
|
|
58
|
+
*/
|
|
59
|
+
readonly confidence?: ConfidenceMetadata;
|
|
60
|
+
}
|
|
61
|
+
/** The JSON Schema for {@link ToolMeta}, used to validate every result. */
|
|
62
|
+
export declare const TOOL_META_SCHEMA: {
|
|
63
|
+
readonly type: "object";
|
|
64
|
+
readonly additionalProperties: false;
|
|
65
|
+
readonly required: readonly ["contract", "contractVersion", "implementationId", "extension", "extensionVersion", "activationGeneration", "executionLocation", "receiptId", "warnings"];
|
|
66
|
+
readonly properties: {
|
|
67
|
+
readonly contract: {
|
|
68
|
+
readonly type: "string";
|
|
69
|
+
readonly minLength: 1;
|
|
70
|
+
};
|
|
71
|
+
readonly contractVersion: {
|
|
72
|
+
readonly type: "string";
|
|
73
|
+
readonly pattern: "^\\d+\\.\\d+\\.\\d+$";
|
|
74
|
+
};
|
|
75
|
+
readonly implementationId: {
|
|
76
|
+
readonly type: "string";
|
|
77
|
+
readonly minLength: 1;
|
|
78
|
+
};
|
|
79
|
+
readonly extension: {
|
|
80
|
+
readonly type: "string";
|
|
81
|
+
readonly minLength: 1;
|
|
82
|
+
};
|
|
83
|
+
readonly extensionVersion: {
|
|
84
|
+
readonly type: "string";
|
|
85
|
+
readonly pattern: "^\\d+\\.\\d+\\.\\d+";
|
|
86
|
+
};
|
|
87
|
+
readonly activationGeneration: {
|
|
88
|
+
readonly type: "integer";
|
|
89
|
+
readonly minimum: 0;
|
|
90
|
+
};
|
|
91
|
+
readonly executionLocation: {
|
|
92
|
+
readonly type: "string";
|
|
93
|
+
readonly enum: readonly ["host", "device", "team-server", "remote"];
|
|
94
|
+
};
|
|
95
|
+
readonly receiptId: {
|
|
96
|
+
readonly type: "string";
|
|
97
|
+
readonly minLength: 1;
|
|
98
|
+
};
|
|
99
|
+
readonly warnings: {
|
|
100
|
+
readonly type: "array";
|
|
101
|
+
readonly items: {
|
|
102
|
+
readonly type: "string";
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
readonly confidence: {
|
|
106
|
+
readonly type: "object";
|
|
107
|
+
readonly additionalProperties: false;
|
|
108
|
+
readonly required: readonly ["kind", "source"];
|
|
109
|
+
readonly properties: {
|
|
110
|
+
readonly kind: {
|
|
111
|
+
readonly type: "string";
|
|
112
|
+
readonly enum: readonly ["vendor-reported", "calibrated", "ranking-logits", "unavailable"];
|
|
113
|
+
};
|
|
114
|
+
readonly source: {
|
|
115
|
+
readonly type: "string";
|
|
116
|
+
readonly minLength: 1;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Attach a `meta` property to a result schema.
|
|
124
|
+
*
|
|
125
|
+
* Contracts declare their own payload; the envelope is identical everywhere, so
|
|
126
|
+
* it is composed here rather than retyped in each contract — retyping it is how
|
|
127
|
+
* the shapes drift apart.
|
|
128
|
+
* @param payload - the contract's payload schema properties.
|
|
129
|
+
* @param requiredPayload - payload property names that are required.
|
|
130
|
+
* @returns a closed object schema containing the payload plus `meta`.
|
|
131
|
+
*/
|
|
132
|
+
export declare function withMeta(payload: Record<string, unknown>, requiredPayload?: readonly string[]): Record<string, unknown>;
|
|
133
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,0EAA0E;AAC1E,MAAM,MAAM,iBAAiB;AAC3B,uCAAuC;AACrC,MAAM;AACR,6BAA6B;GAC3B,QAAQ;AACV,qDAAqD;GACnD,aAAa;AACf,mDAAmD;GACjD,QAAQ,CAAA;AAEZ,4EAA4E;AAC5E,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,YAAY,GAAG,gBAAgB,GAAG,aAAa,CAAA;AAEhG,wFAAwF;AACxF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,kEAAkE;AAClE,MAAM,WAAW,QAAQ;IACvB,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,yEAAyE;IACzE,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,kEAAkE;IAClE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,8CAA8C;IAC9C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,kEAAkE;IAClE,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAA;IACrC,+BAA+B;IAC/B,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAA;IAC7C,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAA;CACzC;AAED,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BnB,CAAA;AAEV;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,eAAe,GAAE,SAAS,MAAM,EAAO,GACtC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAOzB"}
|