@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.
- package/bin/dsh-tool-mode-credentials.mjs +20 -0
- package/bin/dsh-tool-mode.mjs +202 -0
- package/catalog/desert-ant-models.json +693 -693
- package/client/client.model-tools.js +614 -0
- package/client/index.js +1717 -0
- package/lib/adapters/index.d.ts.map +1 -1
- package/lib/adapters/index.js +4 -4
- package/lib/bindings.d.ts.map +1 -1
- package/lib/bindings.js +26 -25
- package/lib/capability.d.ts.map +1 -1
- package/lib/capability.js +17 -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/diagnostics.d.ts +166 -0
- package/lib/diagnostics.d.ts.map +1 -0
- package/lib/diagnostics.js +135 -0
- package/lib/extension-dependencies.d.ts +325 -0
- package/lib/extension-dependencies.d.ts.map +1 -0
- package/lib/extension-dependencies.js +858 -0
- package/lib/extension-dispatch.d.ts +117 -0
- package/lib/extension-dispatch.d.ts.map +1 -0
- package/lib/extension-dispatch.js +124 -0
- package/lib/extension-registrar.d.ts +100 -0
- package/lib/extension-registrar.d.ts.map +1 -0
- package/lib/extension-registrar.js +134 -0
- package/lib/extensions-api.d.ts +221 -0
- package/lib/extensions-api.d.ts.map +1 -0
- package/lib/extensions-api.js +17 -0
- package/lib/extensions-remote.d.ts +54 -0
- package/lib/extensions-remote.d.ts.map +1 -0
- package/lib/extensions-remote.js +66 -0
- package/lib/extensions-service.d.ts +367 -0
- package/lib/extensions-service.d.ts.map +1 -0
- package/lib/extensions-service.js +1527 -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 +95 -0
- package/lib/harness-serving.d.ts.map +1 -0
- package/lib/harness-serving.js +157 -0
- package/lib/headless.d.ts +97 -0
- package/lib/headless.d.ts.map +1 -0
- package/lib/headless.js +349 -0
- package/lib/http-acquisition.d.ts +27 -0
- package/lib/http-acquisition.d.ts.map +1 -0
- package/lib/http-acquisition.js +136 -0
- package/lib/index.d.ts +271 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2644 -70
- 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/legacy-migration.d.ts +95 -0
- package/lib/legacy-migration.d.ts.map +1 -0
- package/lib/legacy-migration.js +429 -0
- package/lib/managed-workers.d.ts +151 -0
- package/lib/managed-workers.d.ts.map +1 -0
- package/lib/managed-workers.js +249 -0
- package/lib/mcp/client-grant.d.ts +74 -0
- package/lib/mcp/client-grant.d.ts.map +1 -0
- package/lib/mcp/client-grant.js +60 -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 +454 -0
- package/lib/mcp/host-binding.d.ts +25 -0
- package/lib/mcp/host-binding.d.ts.map +1 -1
- package/lib/mcp/host-binding.js +107 -14
- package/lib/mcp/http.d.ts +68 -18
- package/lib/mcp/http.d.ts.map +1 -1
- package/lib/mcp/http.js +390 -62
- 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 +46 -7
- package/lib/mcp/protocol.d.ts.map +1 -1
- package/lib/mcp/protocol.js +63 -16
- 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 +181 -0
- package/lib/mcp/server.d.ts +11 -1
- package/lib/mcp/server.d.ts.map +1 -1
- package/lib/mcp/server.js +80 -13
- package/lib/mcp/stdio.d.ts.map +1 -1
- package/lib/mcp/stdio.js +9 -1
- package/lib/mcp/subscriptions.d.ts +43 -1
- package/lib/mcp/subscriptions.d.ts.map +1 -1
- package/lib/mcp/subscriptions.js +90 -9
- 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 +246 -0
- package/lib/planning.d.ts.map +1 -0
- package/lib/planning.js +457 -0
- package/lib/prepared-assets.d.ts +178 -0
- package/lib/prepared-assets.d.ts.map +1 -0
- package/lib/prepared-assets.js +286 -0
- package/lib/provider-bridge.d.ts +37 -0
- package/lib/provider-bridge.d.ts.map +1 -1
- package/lib/provider-bridge.js +189 -12
- package/lib/ptc-authority.d.ts +140 -0
- package/lib/ptc-authority.d.ts.map +1 -0
- package/lib/ptc-authority.js +216 -0
- package/lib/ptc-runtime.d.ts +156 -0
- package/lib/ptc-runtime.d.ts.map +1 -0
- package/lib/ptc-runtime.js +191 -0
- package/lib/publication.d.ts +2 -1
- package/lib/publication.d.ts.map +1 -1
- package/lib/publication.js +13 -5
- package/lib/receipt.d.ts.map +1 -1
- package/lib/receipt.js +8 -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-mode-run.d.ts +235 -0
- package/lib/tool-mode-run.d.ts.map +1 -0
- package/lib/tool-mode-run.js +283 -0
- package/lib/types.d.ts +3 -1
- package/lib/types.d.ts.map +1 -1
- 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/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/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.map +1 -1
- package/node_modules/@try-works/tool-mode-contracts/lib/dsh.js +69 -55
- package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts +4 -1
- package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts.map +1 -1
- package/node_modules/@try-works/tool-mode-contracts/lib/index.js +26 -2
- package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts +28 -2
- package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts.map +1 -1
- package/node_modules/@try-works/tool-mode-contracts/lib/registry.js +93 -10
- package/node_modules/@try-works/tool-mode-contracts/package.json +0 -1
- 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 +83 -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 +125 -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 +32 -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 +32 -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 +126 -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 +297 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts +216 -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 +800 -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 +235 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts +367 -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 +807 -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 +243 -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/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 +118 -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/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 +150 -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 +670 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/package.json +53 -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 +427 -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 +592 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts +60 -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 +936 -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 +200 -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 +105 -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 +129 -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 +325 -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 +1310 -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 +227 -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 +407 -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 +43 -15
- package/remote/spec.mjs +462 -0
- package/remote/typert.host.mjs +14 -0
- package/remote/typert.remote-client.mjs +16 -0
- package/lib/adapters/tongue.d.ts +0 -31
- package/lib/adapters/tongue.d.ts.map +0 -1
- package/lib/adapters/tongue.js +0 -93
- package/lib/adapters/voz.d.ts +0 -28
- package/lib/adapters/voz.d.ts.map +0 -1
- package/lib/adapters/voz.js +0 -102
- /package/{lib → node_modules/@try-works/tool-mode-extension-sdk/lib}/licensing.d.ts +0 -0
- /package/{lib → node_modules/@try-works/tool-mode-extension-sdk/lib}/licensing.d.ts.map +0 -0
- /package/{lib → node_modules/@try-works/tool-mode-extension-sdk/lib}/licensing.js +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The settings/diagnostic surface (OBS-04).
|
|
3
|
+
*
|
|
4
|
+
* OBS-04 names, item by item, what an operator must be able to SEE. A surface that answers
|
|
5
|
+
* "is it on?" but not "which client may call what, and exactly why is this not supported here?"
|
|
6
|
+
* leaves an operator guessing, so each item below is reported with the fact that makes it
|
|
7
|
+
* actionable rather than a bare boolean.
|
|
8
|
+
*
|
|
9
|
+
* DESIGN CONSTRAINTS, because a diagnostic surface is unusually easy to get wrong:
|
|
10
|
+
*
|
|
11
|
+
* - **It reports STATE, never credentials.** It names authorized clients and grants; it
|
|
12
|
+
* never echoes a token. A diagnostic surface is the single most likely place for a secret
|
|
13
|
+
* to leak, because its whole purpose is to be displayed.
|
|
14
|
+
* - **Unsupported is always paired with WHY.** OBS-04 asks for "exact unsupported-platform
|
|
15
|
+
* reasons", and a bare `supported: false` sends an operator to the source to find out.
|
|
16
|
+
* - **Unknown is its own state.** A fact that cannot be determined is reported as unknown
|
|
17
|
+
* rather than defaulted to false, because "not supported" and "not checked" call for
|
|
18
|
+
* different actions.
|
|
19
|
+
*
|
|
20
|
+
* @module @try-works/dsh-model-as-tool/diagnostics
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Build the diagnostic report.
|
|
24
|
+
*
|
|
25
|
+
* @param inputs - the observed state.
|
|
26
|
+
* @returns everything OBS-04 names, with a reason wherever something is not available.
|
|
27
|
+
*/
|
|
28
|
+
export function buildDiagnostics(inputs) {
|
|
29
|
+
const capabilities = [
|
|
30
|
+
inputs.mcpMounted
|
|
31
|
+
? { capability: 'mcp', state: 'available' }
|
|
32
|
+
: {
|
|
33
|
+
capability: 'mcp',
|
|
34
|
+
state: 'unavailable',
|
|
35
|
+
reason: 'no MCP surface is mounted in this deployment, so no client can call these tools',
|
|
36
|
+
},
|
|
37
|
+
/*
|
|
38
|
+
* The endpoint is reported separately from `mcp` because a mounted surface with no
|
|
39
|
+
* endpoint is a real state: the host composes tools for its own agent and serves nothing.
|
|
40
|
+
*/
|
|
41
|
+
inputs.mcpEndpoint === undefined
|
|
42
|
+
? { capability: 'mcp-endpoint', state: 'unavailable', reason: 'the mounted MCP surface exposes no network endpoint' }
|
|
43
|
+
: { capability: 'mcp-endpoint', state: 'available' },
|
|
44
|
+
inputs.mcpRequiresCredential === true
|
|
45
|
+
? { capability: 'mcp-authorization', state: 'available' }
|
|
46
|
+
: inputs.mcpRequiresCredential === false
|
|
47
|
+
? {
|
|
48
|
+
capability: 'mcp-authorization',
|
|
49
|
+
state: 'unavailable',
|
|
50
|
+
reason: 'the endpoint accepts unauthenticated requests, so any local caller may invoke these tools',
|
|
51
|
+
}
|
|
52
|
+
// `unknown` rather than `false`: a fact that was not determined is not a fact that is
|
|
53
|
+
// absent, and the two call for different actions.
|
|
54
|
+
: { capability: 'mcp-authorization', state: 'unknown', reason: 'the deployment did not report whether a credential is required' },
|
|
55
|
+
];
|
|
56
|
+
if (inputs.codeMode !== undefined) {
|
|
57
|
+
capabilities.push(inputs.codeMode.permitted && inputs.codeMode.backendReady
|
|
58
|
+
? { capability: 'code-mode', state: 'available' }
|
|
59
|
+
: {
|
|
60
|
+
capability: 'code-mode',
|
|
61
|
+
state: 'unavailable',
|
|
62
|
+
reason: inputs.codeMode.reason
|
|
63
|
+
?? (inputs.codeMode.permitted
|
|
64
|
+
? 'generated-code execution is permitted but no backend is ready to run it'
|
|
65
|
+
: 'generated-code execution is not permitted in this deployment'),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
platform: inputs.platform,
|
|
70
|
+
mcp: {
|
|
71
|
+
mounted: inputs.mcpMounted,
|
|
72
|
+
endpoint: inputs.mcpEndpoint ?? null,
|
|
73
|
+
requiresCredential: inputs.mcpRequiresCredential ?? null,
|
|
74
|
+
authorizedClients: [...(inputs.authorizedClients ?? [])],
|
|
75
|
+
exportedTools: [...inputs.exportedTools],
|
|
76
|
+
withheldTools: [...(inputs.withheldTools ?? [])],
|
|
77
|
+
},
|
|
78
|
+
preparation: (inputs.preparation ?? []).map(entry => ({
|
|
79
|
+
modelId: entry.modelId,
|
|
80
|
+
prepared: entry.prepared,
|
|
81
|
+
// A prepared model has nothing to explain; an unprepared one must say what is missing.
|
|
82
|
+
reason: entry.prepared ? null : entry.reason ?? 'no reason was reported, which is itself a defect in the caller',
|
|
83
|
+
})),
|
|
84
|
+
implementations: [...(inputs.selectedImplementations ?? [])],
|
|
85
|
+
extensions: [...(inputs.extensions ?? [])],
|
|
86
|
+
capabilities,
|
|
87
|
+
uninstall: inputs.uninstall ?? null,
|
|
88
|
+
requirements: inputs.requirements ?? null,
|
|
89
|
+
codeMode: inputs.codeMode ?? null,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The exact reason something is unsupported on THIS platform.
|
|
94
|
+
*
|
|
95
|
+
* Exists as a function because OBS-04 asks for the reason to be EXACT, and an exact reason has
|
|
96
|
+
* to name the platform it is about — "unsupported" against an unnamed platform sends an
|
|
97
|
+
* operator to compare their machine against a document.
|
|
98
|
+
*
|
|
99
|
+
* @param subject - what is unsupported.
|
|
100
|
+
* @param supportedOn - the platforms it does work on.
|
|
101
|
+
* @param platform - the platform being reported.
|
|
102
|
+
* @returns a reason naming both sides of the mismatch.
|
|
103
|
+
*/
|
|
104
|
+
export function unsupportedReason(subject, supportedOn, platform) {
|
|
105
|
+
const supported = supportedOn.map(entry => `${entry.os}/${entry.arch}`);
|
|
106
|
+
if (supported.length === 0) {
|
|
107
|
+
// A different sentence, because "no platform supports this" is not a mismatch.
|
|
108
|
+
return `${subject} declares no supported platform, so it cannot run anywhere`;
|
|
109
|
+
}
|
|
110
|
+
return `${subject} supports ${supported.join(', ')} but this host is ${platform.os}/${platform.arch}`;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Whether the deployment may retain request and response BODIES (OBS-03).
|
|
114
|
+
*
|
|
115
|
+
* OBS-03's operative sentence is a refusal, not a preference: where an operator's no-retention
|
|
116
|
+
* policy cannot be honoured together with DSH's requirement that model-visible inputs be
|
|
117
|
+
* reconstructable, harness-backed execution must be REFUSED rather than bodies silently
|
|
118
|
+
* logged or DSH bypassed. This returns the decision so the caller cannot soften it into a
|
|
119
|
+
* warning.
|
|
120
|
+
*
|
|
121
|
+
* @param policy - the deployment's retention policy.
|
|
122
|
+
* @returns whether harness-backed execution is permitted.
|
|
123
|
+
*/
|
|
124
|
+
export function harnessExecutionDecision(policy) {
|
|
125
|
+
if (!policy.retainsBodies && policy.requiresReconstructableInputs) {
|
|
126
|
+
return {
|
|
127
|
+
permitted: false,
|
|
128
|
+
reason: 'the deployment does not retain bodies while DSH requires model-visible inputs to be '
|
|
129
|
+
+ 'reconstructable, so harness-backed execution is refused here rather than logging '
|
|
130
|
+
+ 'bodies against the policy or bypassing DSH',
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return { permitted: true };
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* First-party dependency graphs for developer-mode extension installs (EXT-09).
|
|
3
|
+
*
|
|
4
|
+
* Installing a first-party package from its checkout must satisfy the SAME
|
|
5
|
+
* discipline the SDK applies to a registry install: every declared runtime
|
|
6
|
+
* dependency is resolved to an exact version, verified by content, and
|
|
7
|
+
* materialized INSIDE the extension's own immutable installation directory. The
|
|
8
|
+
* SDK owns that discipline (`installDependencyGraph`); this module supplies the
|
|
9
|
+
* host half it deliberately leaves injected:
|
|
10
|
+
*
|
|
11
|
+
* - the RESOLVER: the exact version of a declared dependency is the one already
|
|
12
|
+
* installed in the host's own tree, found by walking `node_modules` upward from
|
|
13
|
+
* the source checkout exactly the way Node would. No registry request is made,
|
|
14
|
+
* no version is guessed, and a dependency that is not installed refuses the
|
|
15
|
+
* install instead of being skipped.
|
|
16
|
+
* - the ARCHIVE: the resolved package directory is turned into a deterministic
|
|
17
|
+
* zip whose SHA-512 is the integrity the SDK verifies before extraction. The
|
|
18
|
+
* archive is an ordinary package archive — `node_modules` is excluded because
|
|
19
|
+
* the SDK resolves the transitive graph itself, and the package's declared
|
|
20
|
+
* install-time scripts are left in place so the SDK's own refusal (EXT-10)
|
|
21
|
+
* decides whether the dependency is admissible.
|
|
22
|
+
*
|
|
23
|
+
* Two properties matter for truthfulness:
|
|
24
|
+
*
|
|
25
|
+
* - **The host's node_modules is READ, never written.** The only write target is
|
|
26
|
+
* the SDK's staging directory, which becomes the extension's private
|
|
27
|
+
* `node_modules`; the resolver asserts this by construction (it has no write
|
|
28
|
+
* path outside the archive bytes).
|
|
29
|
+
* - **A declaration is never silently dropped.** Every name the extension
|
|
30
|
+
* declares is either materialized or the whole install fails with a named
|
|
31
|
+
* `DEPENDENCY_UNSATISFIED` reason.
|
|
32
|
+
*
|
|
33
|
+
* INTEGRITY NOTE. The SDK's dependency lock records the SHA-512 of the archive
|
|
34
|
+
* bytes it verified (`verifyIntegrity`), which is what this module computes. The
|
|
35
|
+
* directory's own identity is additionally checked with the SDK's
|
|
36
|
+
* `digestInstalledContent` before and after the archive is built, so a checkout
|
|
37
|
+
* that changes while it is being archived refuses rather than shipping bytes that
|
|
38
|
+
* no longer match what was resolved.
|
|
39
|
+
*
|
|
40
|
+
* @module @try-works/dsh-model-as-tool/extension-dependencies
|
|
41
|
+
*/
|
|
42
|
+
import { DEFAULT_ARCHIVE_LIMITS, type ArchiveSource, type DependencyResolver, type InstallDependencyGraph, type InstallSource } from '@try-works/tool-mode-extension-sdk';
|
|
43
|
+
/**
|
|
44
|
+
* The dependency archive byte cap.
|
|
45
|
+
*
|
|
46
|
+
* The SDK's `installDependencyGraph` calls `fetch` with a 256 MiB bound and
|
|
47
|
+
* requires the source to enforce it, so this module refuses an archive it could
|
|
48
|
+
* not truthfully hand over under that contract.
|
|
49
|
+
*/
|
|
50
|
+
export declare const MAX_DEPENDENCY_ARCHIVE_BYTES: number;
|
|
51
|
+
/** One dependency resolved from the host's own installed tree. */
|
|
52
|
+
export interface FirstPartyDependency {
|
|
53
|
+
/** The package name, as declared. */
|
|
54
|
+
readonly name: string;
|
|
55
|
+
/** The EXACT version recorded by the installed copy. */
|
|
56
|
+
readonly version: string;
|
|
57
|
+
/** The absolute directory the installed copy occupies. */
|
|
58
|
+
readonly directory: string;
|
|
59
|
+
}
|
|
60
|
+
/** Where to look for installed dependencies. */
|
|
61
|
+
export interface DependencySearch {
|
|
62
|
+
/** The checkout whose declared dependency is being installed. */
|
|
63
|
+
readonly sourcePackageDir: string;
|
|
64
|
+
/**
|
|
65
|
+
* Additional package roots searched after the source checkout's own ancestors.
|
|
66
|
+
*
|
|
67
|
+
* The host's own module directory is always searched, so a dependency installed
|
|
68
|
+
* for the host (rather than for the extension checkout) is still found.
|
|
69
|
+
*/
|
|
70
|
+
readonly extraSearchRoots?: readonly string[];
|
|
71
|
+
}
|
|
72
|
+
/** Bounds and seams for one first-party dependency graph. */
|
|
73
|
+
export interface FirstPartyDependencyGraphOptions extends DependencySearch {
|
|
74
|
+
/** Total source bytes accepted per dependency; defaults to the SDK archive total bound. */
|
|
75
|
+
readonly maxSourceBytes?: number;
|
|
76
|
+
/** Per-file bytes accepted; defaults to the SDK archive per-entry bound. */
|
|
77
|
+
readonly maxEntryBytes?: number;
|
|
78
|
+
/** Archive bytes accepted per dependency; defaults to {@link MAX_DEPENDENCY_ARCHIVE_BYTES}. */
|
|
79
|
+
readonly maxArchiveBytes?: number;
|
|
80
|
+
/** Forwarded to the SDK graph: maximum dependency depth. */
|
|
81
|
+
readonly maxDepth?: number;
|
|
82
|
+
/** Forwarded to the SDK graph: maximum number of dependency packages. */
|
|
83
|
+
readonly maxPackages?: number;
|
|
84
|
+
/**
|
|
85
|
+
* The operator gate for PREINSTALLED dependency content (task-84).
|
|
86
|
+
*
|
|
87
|
+
* When true, a dependency resolved from the host's installed tree is supplied as
|
|
88
|
+
* the already-materialized directory instead of being re-archived as bytes: the
|
|
89
|
+
* SDK copies it into the extension's own install directory and records
|
|
90
|
+
* `provenance: 'preinstalled'`, which states that the content arrived from an
|
|
91
|
+
* operator-completed install and that this installer ran no lifecycle script.
|
|
92
|
+
* DEFAULT OFF: without the gate, the bytes arm applies and a dependency whose
|
|
93
|
+
* package.json declares an install-time script refuses exactly as before.
|
|
94
|
+
*/
|
|
95
|
+
readonly allowPreinstalled?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* The operator-configured root every preinstalled directory must live under.
|
|
98
|
+
* REQUIRED when {@link FirstPartyDependencyGraphOptions.allowPreinstalled} is true;
|
|
99
|
+
* the SDK enforces the containment, this factory refuses a gate with no root.
|
|
100
|
+
*/
|
|
101
|
+
readonly preinstalledRoot?: string;
|
|
102
|
+
}
|
|
103
|
+
/** The pieces, exposed so tests and diagnostics can inspect resolution without materializing. */
|
|
104
|
+
export interface FirstPartyDependencyGraph {
|
|
105
|
+
/** The graph the SDK's directory installer consumes. */
|
|
106
|
+
readonly graph: InstallDependencyGraph;
|
|
107
|
+
/** The resolver half, callable on its own. */
|
|
108
|
+
readonly resolver: DependencyResolver;
|
|
109
|
+
/** The archive half, callable on its own. */
|
|
110
|
+
readonly archive: ArchiveSource;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Resolve one declared dependency from the host's installed tree.
|
|
114
|
+
*
|
|
115
|
+
* The source checkout's own ancestor chain is searched first (the tree whose
|
|
116
|
+
* `package.json` declared the dependency), then the host's own module chain, then
|
|
117
|
+
* any explicitly configured roots. The first installed package whose own
|
|
118
|
+
* `package.json` name matches wins; nothing is downloaded and no version is
|
|
119
|
+
* inferred.
|
|
120
|
+
* @param search - where to look.
|
|
121
|
+
* @param name - the declared dependency name.
|
|
122
|
+
* @param range - the declared spec, used only in the refusal message.
|
|
123
|
+
* @returns the installed dependency.
|
|
124
|
+
* @throws ManagementError `DEPENDENCY_UNSATISFIED` when it is not installed.
|
|
125
|
+
*/
|
|
126
|
+
export declare function resolveFirstPartyDependency(search: DependencySearch, name: string, range: string): FirstPartyDependency;
|
|
127
|
+
/** The archive built for one resolved dependency. */
|
|
128
|
+
interface BuiltDependencyArchive {
|
|
129
|
+
/** The exact bytes the graph's archive source will serve. */
|
|
130
|
+
readonly bytes: Uint8Array;
|
|
131
|
+
/** SHA-512 of those bytes: the integrity the SDK verifies before extraction. */
|
|
132
|
+
readonly integrity: string;
|
|
133
|
+
/** The installed tree's own content digest, checked around the build. */
|
|
134
|
+
readonly contentDigest: string;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Build a deterministic zip of one installed dependency directory.
|
|
138
|
+
*
|
|
139
|
+
* The result is the archive the SDK's dependency graph fetches and verifies. Its
|
|
140
|
+
* SHA-512 is the integrity handed to the graph; the directory's own
|
|
141
|
+
* `digestInstalledContent` is checked before and after the build so a concurrent
|
|
142
|
+
* change refuses.
|
|
143
|
+
* @param dependency - the resolved installed dependency.
|
|
144
|
+
* @param limits - the byte bounds.
|
|
145
|
+
* @returns the archive bytes, their integrity, and the directory digest.
|
|
146
|
+
* @throws ManagementError `DEPENDENCY_UNSATISFIED` for any refusal.
|
|
147
|
+
*/
|
|
148
|
+
export declare function buildDependencyArchive(dependency: FirstPartyDependency, limits: {
|
|
149
|
+
readonly maxSourceBytes: number;
|
|
150
|
+
readonly maxEntryBytes: number;
|
|
151
|
+
readonly maxArchiveBytes: number;
|
|
152
|
+
}): BuiltDependencyArchive;
|
|
153
|
+
/**
|
|
154
|
+
* How this host can supply one declared dependency.
|
|
155
|
+
*
|
|
156
|
+
* This is the narrow seam between the host's resolution policy and the SDK's
|
|
157
|
+
* dependency graph: `registry-bytes` is the verified-archive path (the SDK verifies
|
|
158
|
+
* the SHA-512 and extracts the bytes), and `preinstalled` is the operator-gated
|
|
159
|
+
* path (the SDK copies an already-materialized directory and records
|
|
160
|
+
* `provenance: 'preinstalled'`, never running a lifecycle script).
|
|
161
|
+
*/
|
|
162
|
+
export type DependencySupply = {
|
|
163
|
+
/** The host built verified archive bytes for this dependency. */
|
|
164
|
+
readonly kind: 'registry-bytes';
|
|
165
|
+
readonly dependency: FirstPartyDependency;
|
|
166
|
+
/** SHA-512 of exactly the bytes `archive.fetch` will serve. */
|
|
167
|
+
readonly integrity: string;
|
|
168
|
+
readonly bytes: Uint8Array;
|
|
169
|
+
} | {
|
|
170
|
+
/** The host has an already-materialized installation for this dependency. */
|
|
171
|
+
readonly kind: 'preinstalled';
|
|
172
|
+
readonly dependency: FirstPartyDependency;
|
|
173
|
+
/** Documented by the SDK to mean: no lifecycle script was run by this installer. */
|
|
174
|
+
readonly provenance: 'preinstalled';
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Create the first-party dependency graph supplied to the SDK's directory installer.
|
|
178
|
+
*
|
|
179
|
+
* Resolution and archiving happen lazily, one dependency at a time: `resolve`
|
|
180
|
+
* builds the exact bytes the SDK will verify and `fetch` hands back those same
|
|
181
|
+
* bytes, so the integrity the lock records is the integrity of the served archive
|
|
182
|
+
* rather than a value guessed from metadata. Only the most recently built archive
|
|
183
|
+
* is retained, which matches the SDK's resolve-then-fetch sequence and bounds
|
|
184
|
+
* memory to one dependency.
|
|
185
|
+
*
|
|
186
|
+
* The preinstalled-content gate is OPT-IN and OFF by default, matching the SDK:
|
|
187
|
+
* without it every dependency is served as verified bytes and EXT-10 applies. With
|
|
188
|
+
* it, the SDK requires `preinstalledRoot`, copies the resolved directory into the
|
|
189
|
+
* extension's own `node_modules`, and records `provenance: 'preinstalled'`.
|
|
190
|
+
* @param options - the search tree, bounds, gate and forwarded graph limits.
|
|
191
|
+
* @returns the install-dependency graph plus its resolver and archive halves.
|
|
192
|
+
* @throws ManagementError `DEPENDENCY_UNSATISFIED` when the gate has no root.
|
|
193
|
+
*/
|
|
194
|
+
export declare function createFirstPartyDependencyGraph(options: FirstPartyDependencyGraphOptions): FirstPartyDependencyGraph;
|
|
195
|
+
/** Re-export for callers that want the size bound wording. */
|
|
196
|
+
export { DEFAULT_ARCHIVE_LIMITS };
|
|
197
|
+
/** The default npm registry. */
|
|
198
|
+
export declare const DEFAULT_REGISTRY_URL = "https://registry.npmjs.org/";
|
|
199
|
+
/** How a registry operation failed. Every code is host-facing and stable. */
|
|
200
|
+
export type RegistryErrorCode =
|
|
201
|
+
/** No registry URL is configured. */
|
|
202
|
+
'registry-not-configured'
|
|
203
|
+
/** The registry has no such package, version, or dist-tag. */
|
|
204
|
+
| 'registry-not-found'
|
|
205
|
+
/** Transport failure or 5xx: the registry did not answer usefully. This is the ONLY fallback-eligible failure. */
|
|
206
|
+
| 'registry-unavailable'
|
|
207
|
+
/** The metadata did not have the npm shape this client can verify. */
|
|
208
|
+
| 'registry-invalid-metadata'
|
|
209
|
+
/** `dist.integrity` is absent or not a sha512 SRI string: installs are refused, never unverified. */
|
|
210
|
+
| 'registry-integrity-missing'
|
|
211
|
+
/** The tarball did not download (non-2xx, truncated, aborted). */
|
|
212
|
+
| 'registry-tarball-fetch-failed'
|
|
213
|
+
/** The tarball is over the configured byte cap. */
|
|
214
|
+
| 'registry-tarball-too-large'
|
|
215
|
+
/** No published version satisfies the requested range. */
|
|
216
|
+
| 'registry-no-matching-version';
|
|
217
|
+
/** A named registry failure. */
|
|
218
|
+
export declare class RegistryError extends Error {
|
|
219
|
+
readonly name = "RegistryError";
|
|
220
|
+
readonly code: RegistryErrorCode;
|
|
221
|
+
/** Whether a directory fallback may be considered under `auto`. */
|
|
222
|
+
readonly transport: boolean;
|
|
223
|
+
constructor(code: RegistryErrorCode, message: string, options?: {
|
|
224
|
+
readonly cause?: unknown;
|
|
225
|
+
readonly transport?: boolean;
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/** One package version resolved from the registry. */
|
|
229
|
+
export interface RegistryPackageResolution {
|
|
230
|
+
/** The package name, exactly as requested. */
|
|
231
|
+
readonly name: string;
|
|
232
|
+
/** The EXACT published version selected. */
|
|
233
|
+
readonly version: string;
|
|
234
|
+
/** The tarball URL from `dist.tarball`. */
|
|
235
|
+
readonly tarball: string;
|
|
236
|
+
/** The registry's sha512 SRI string from `dist.integrity` (verified before extraction). */
|
|
237
|
+
readonly integrity: string;
|
|
238
|
+
/** The dist-tag that selected this version, when the request named one. */
|
|
239
|
+
readonly distTag?: string;
|
|
240
|
+
}
|
|
241
|
+
/** What a registry session needs. */
|
|
242
|
+
export interface RegistrySessionOptions {
|
|
243
|
+
/** Registry base URL, e.g. `https://registry.npmjs.org/`. Empty is allowed and refuses at resolve time. */
|
|
244
|
+
readonly registryUrl: string;
|
|
245
|
+
/**
|
|
246
|
+
* The container decoder for the bytes the registry serves.
|
|
247
|
+
*
|
|
248
|
+
* npm serves `.tgz`; the host passes the SDK's tar-gzip ArchiveSource factory.
|
|
249
|
+
* Injectable so the session (resolution, bounds, integrity plumbing) can be
|
|
250
|
+
* tested independently of the container implementation.
|
|
251
|
+
*/
|
|
252
|
+
readonly archiveFactory: (fetcher: (source: InstallSource) => Promise<Uint8Array>) => ArchiveSource;
|
|
253
|
+
/** Hard cap on one downloaded package tarball; defaults to the SDK archive bound. */
|
|
254
|
+
readonly maxTarballBytes?: number;
|
|
255
|
+
/** Request timeout; default 30 s. */
|
|
256
|
+
readonly timeoutMs?: number;
|
|
257
|
+
/** Injected fetch, for tests. Defaults to the global fetch. */
|
|
258
|
+
readonly fetchImpl?: typeof fetch;
|
|
259
|
+
}
|
|
260
|
+
/** A registry session: version resolution plus the tarball archive over the SAME registry. */
|
|
261
|
+
export interface RegistrySession {
|
|
262
|
+
/** The normalized registry base URL ('' when unconfigured). */
|
|
263
|
+
readonly registryUrl: string;
|
|
264
|
+
/** The ArchiveSource the install/dependency pipelines fetch through. */
|
|
265
|
+
readonly archive: ArchiveSource;
|
|
266
|
+
/**
|
|
267
|
+
* Resolve `<name>@<spec>` to one exact published version.
|
|
268
|
+
* @param name - the package name.
|
|
269
|
+
* @param spec - a dist-tag (`latest`), an exact version, or a semver range.
|
|
270
|
+
* @param signal - cancellation.
|
|
271
|
+
* @returns the exact version, tarball URL and sha512 integrity.
|
|
272
|
+
*/
|
|
273
|
+
resolve(name: string, spec: string, signal?: AbortSignal): Promise<RegistryPackageResolution>;
|
|
274
|
+
/**
|
|
275
|
+
* Download the bytes registered for one archive source, bounded.
|
|
276
|
+
* @param source - the source returned by a previous resolve.
|
|
277
|
+
* @param signal - cancellation.
|
|
278
|
+
* @returns the tarball bytes (NOT yet digest-verified; the caller verifies).
|
|
279
|
+
*/
|
|
280
|
+
download(source: InstallSource, signal?: AbortSignal): Promise<Uint8Array>;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Whether one published version satisfies a semver range.
|
|
284
|
+
*
|
|
285
|
+
* Supported: exact versions, `^`, `~`, x-ranges (`1.x`, `1.2`), comparison
|
|
286
|
+
* operators (`>=`, `>`, `<=`, `<`, `=`), hyphen ranges, `||`, and `*`. NOT
|
|
287
|
+
* supported (refused rather than guessed): prerelease-only ranges and npm's
|
|
288
|
+
* `tag:` protocol. A prerelease version only matches a range that itself names a
|
|
289
|
+
* prerelease.
|
|
290
|
+
* @param versionText - the published version.
|
|
291
|
+
* @param rangeText - the requested range.
|
|
292
|
+
* @returns whether the version satisfies the range.
|
|
293
|
+
*/
|
|
294
|
+
export declare function satisfiesRegistryRange(versionText: string, rangeText: string): boolean;
|
|
295
|
+
/**
|
|
296
|
+
* The highest published version satisfying a range.
|
|
297
|
+
* @param versions - the published version strings.
|
|
298
|
+
* @param rangeText - the requested range.
|
|
299
|
+
* @returns the highest satisfying version exactly as published, or undefined.
|
|
300
|
+
*/
|
|
301
|
+
export declare function highestSatisfyingVersion(versions: readonly string[], rangeText: string): string | undefined;
|
|
302
|
+
/**
|
|
303
|
+
* Create a registry session over one npm registry.
|
|
304
|
+
*
|
|
305
|
+
* The same session serves the extension package and every runtime dependency, so
|
|
306
|
+
* the tarball map (key → URL) the resolver registers is the map the archive
|
|
307
|
+
* fetches through. Nothing is downloaded until a caller fetches; nothing is
|
|
308
|
+
* verified here (the SDK verifies the sha512 before extraction, and this module
|
|
309
|
+
* refuses metadata without one).
|
|
310
|
+
* @param options - registry URL, archive factory, bounds and fetch seam.
|
|
311
|
+
* @returns the session.
|
|
312
|
+
*/
|
|
313
|
+
export declare function createRegistrySession(options: RegistrySessionOptions): RegistrySession;
|
|
314
|
+
/**
|
|
315
|
+
* Wire a registry session into the SDK dependency-graph contract.
|
|
316
|
+
*
|
|
317
|
+
* Every declared dependency is resolved to one exact published version with its
|
|
318
|
+
* sha512 integrity; the SAME session archive fetches the bytes, so the manifest
|
|
319
|
+
* the graph verifies is the manifest that was resolved. EXT-10's script refusal is
|
|
320
|
+
* the SDK's own, unchanged.
|
|
321
|
+
* @param session - the registry session.
|
|
322
|
+
* @returns the install-dependency graph.
|
|
323
|
+
*/
|
|
324
|
+
export declare function createRegistryDependencyGraph(session: RegistrySession): InstallDependencyGraph;
|
|
325
|
+
//# sourceMappingURL=extension-dependencies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-dependencies.d.ts","sourceRoot":"","sources":["../src/extension-dependencies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAOH,OAAO,EAEL,sBAAsB,EAItB,KAAK,aAAa,EAElB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EACnB,MAAM,oCAAoC,CAAA;AAU3C;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,QAAoB,CAAA;AAE7D,kEAAkE;AAClE,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,wDAAwD;IAC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