@try-works/dsh-model-as-tool 0.1.1 → 0.1.3
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 +51 -0
- package/bin/dsh-tool-mode-mcp-stdio.mjs +80 -0
- package/catalog/desert-ant-models.json +77 -13
- package/lib/adapters/index.d.ts +19 -6
- package/lib/adapters/index.d.ts.map +1 -1
- package/lib/adapters/index.js +28 -13
- package/lib/adapters/tongue.d.ts +11 -3
- package/lib/adapters/tongue.d.ts.map +1 -1
- package/lib/adapters/tongue.js +12 -4
- package/lib/adapters/types.d.ts +11 -0
- package/lib/adapters/types.d.ts.map +1 -1
- package/lib/adapters/voz.d.ts +7 -1
- package/lib/adapters/voz.d.ts.map +1 -1
- package/lib/adapters/voz.js +16 -4
- package/lib/asset-acquisition.d.ts +137 -0
- package/lib/asset-acquisition.d.ts.map +1 -0
- package/lib/asset-acquisition.js +161 -0
- package/lib/authority.d.ts +153 -0
- package/lib/authority.d.ts.map +1 -0
- package/lib/authority.js +194 -0
- package/lib/bindings.d.ts +115 -0
- package/lib/bindings.d.ts.map +1 -0
- package/lib/bindings.js +239 -0
- package/lib/catalog.d.ts.map +1 -1
- package/lib/catalog.js +57 -0
- package/lib/contract-payload.d.ts +47 -0
- package/lib/contract-payload.d.ts.map +1 -0
- package/lib/contract-payload.js +137 -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/harness-budgets.d.ts +158 -0
- package/lib/harness-budgets.d.ts.map +1 -0
- package/lib/harness-budgets.js +152 -0
- package/lib/index.d.ts +41 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +424 -16
- package/lib/licensing.d.ts +221 -0
- package/lib/licensing.d.ts.map +1 -0
- package/lib/licensing.js +188 -0
- package/lib/mcp/host-binding.d.ts +91 -0
- package/lib/mcp/host-binding.d.ts.map +1 -0
- package/lib/mcp/host-binding.js +133 -0
- package/lib/mcp/http.d.ts +130 -0
- package/lib/mcp/http.d.ts.map +1 -0
- package/lib/mcp/http.js +274 -0
- package/lib/mcp/protocol.d.ts +261 -0
- package/lib/mcp/protocol.d.ts.map +1 -0
- package/lib/mcp/protocol.js +387 -0
- package/lib/mcp/server.d.ts +115 -0
- package/lib/mcp/server.d.ts.map +1 -0
- package/lib/mcp/server.js +200 -0
- package/lib/mcp/stdio.d.ts +80 -0
- package/lib/mcp/stdio.d.ts.map +1 -0
- package/lib/mcp/stdio.js +176 -0
- package/lib/mcp/subscriptions.d.ts +135 -0
- package/lib/mcp/subscriptions.d.ts.map +1 -0
- package/lib/mcp/subscriptions.js +207 -0
- package/lib/provider-bridge.d.ts +69 -0
- package/lib/provider-bridge.d.ts.map +1 -0
- package/lib/provider-bridge.js +218 -0
- package/lib/publication.d.ts +160 -0
- package/lib/publication.d.ts.map +1 -0
- package/lib/publication.js +173 -0
- package/lib/receipt.d.ts +208 -0
- package/lib/receipt.d.ts.map +1 -0
- package/lib/receipt.js +150 -0
- package/lib/registrar.d.ts +13 -0
- package/lib/registrar.d.ts.map +1 -1
- package/lib/registrar.js +20 -3
- 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/types.d.ts +21 -0
- package/lib/types.d.ts.map +1 -1
- 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 +85 -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/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 +260 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts +23 -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 +24 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/meta.d.ts +104 -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 +55 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts +81 -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 +163 -0
- package/node_modules/@try-works/tool-mode-contracts/package.json +35 -0
- package/package.json +17 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/adapters/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/adapters/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAE1D,oEAAoE;AACpE,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAA;AAErG,8BAA8B;AA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gB,cAAc,CAC5B,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACvC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACtD,MAAM,GAAG,SAAS,CAOpB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACvC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,OAAO,GAChB,OAAO,CAKT"}
|
package/lib/adapters/voz.d.ts
CHANGED
|
@@ -13,10 +13,16 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { ModelCatalogEntry } from '../types.ts';
|
|
15
15
|
import { type ModelAdapter } from './types.ts';
|
|
16
|
+
/** The npm package this adapter knows how to call. */
|
|
17
|
+
export declare const VOZ_PACKAGE = "@desert-ant-labs/voz";
|
|
16
18
|
/**
|
|
17
19
|
* Build the Voz adapter.
|
|
20
|
+
*
|
|
21
|
+
* Keyed on the package rather than the catalog id, for the same reason as the
|
|
22
|
+
* Tongue adapter: the adapter knows an SDK, so any catalog row bound to it can be
|
|
23
|
+
* served, which is what lets a second implementation join the contract.
|
|
18
24
|
* @param entry - the catalog entry this adapter serves.
|
|
19
|
-
* @returns the adapter, or undefined if the entry
|
|
25
|
+
* @returns the adapter, or undefined if the entry does not use this SDK.
|
|
20
26
|
*/
|
|
21
27
|
export declare function createVozAdapter(entry: ModelCatalogEntry): ModelAdapter | undefined;
|
|
22
28
|
//# sourceMappingURL=voz.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voz.d.ts","sourceRoot":"","sources":["../../src/adapters/voz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"voz.d.ts","sourceRoot":"","sources":["../../src/adapters/voz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAA;AAgCnB,sDAAsD;AACtD,eAAO,MAAM,WAAW,yBAAyB,CAAA;AAKjD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,GAAG,SAAS,CAsEnF"}
|
package/lib/adapters/voz.js
CHANGED
|
@@ -20,15 +20,21 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
20
20
|
return path;
|
|
21
21
|
};
|
|
22
22
|
import { optionalBoolean, requireString, throwIfAborted, } from "./types.js";
|
|
23
|
+
/** The npm package this adapter knows how to call. */
|
|
24
|
+
export const VOZ_PACKAGE = '@desert-ant-labs/voz';
|
|
23
25
|
/** Cap on the words returned inline, so a long recording cannot flood the context. */
|
|
24
26
|
const MAX_WORDS = 2000;
|
|
25
27
|
/**
|
|
26
28
|
* Build the Voz adapter.
|
|
29
|
+
*
|
|
30
|
+
* Keyed on the package rather than the catalog id, for the same reason as the
|
|
31
|
+
* Tongue adapter: the adapter knows an SDK, so any catalog row bound to it can be
|
|
32
|
+
* served, which is what lets a second implementation join the contract.
|
|
27
33
|
* @param entry - the catalog entry this adapter serves.
|
|
28
|
-
* @returns the adapter, or undefined if the entry
|
|
34
|
+
* @returns the adapter, or undefined if the entry does not use this SDK.
|
|
29
35
|
*/
|
|
30
36
|
export function createVozAdapter(entry) {
|
|
31
|
-
if (entry.
|
|
37
|
+
if (entry.npmPackage !== VOZ_PACKAGE)
|
|
32
38
|
return undefined;
|
|
33
39
|
let loaded;
|
|
34
40
|
const load = async () => {
|
|
@@ -51,10 +57,16 @@ export function createVozAdapter(entry) {
|
|
|
51
57
|
};
|
|
52
58
|
return {
|
|
53
59
|
modelId: entry.id,
|
|
54
|
-
async invoke({ args, signal }) {
|
|
60
|
+
async invoke({ args, signal, authority }) {
|
|
55
61
|
throwIfAborted(signal);
|
|
56
|
-
const
|
|
62
|
+
const requested = requireString(args, 'audio_path');
|
|
57
63
|
const includeWords = optionalBoolean(args, 'include_words', true);
|
|
64
|
+
// SEC-06: a caller-supplied path is authorized before it is opened, and the
|
|
65
|
+
// CANONICAL path is what gets opened. Validating the string and then opening
|
|
66
|
+
// it would leave a check-then-open window a symlink could win.
|
|
67
|
+
const audioPath = authority === undefined
|
|
68
|
+
? requested
|
|
69
|
+
: authority.resolvePath(requested);
|
|
58
70
|
const voz = await load();
|
|
59
71
|
throwIfAborted(signal);
|
|
60
72
|
const result = await voz.transcribe(audioPath);
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verified atomic asset acquisition (RES-03, RES-07).
|
|
3
|
+
*
|
|
4
|
+
* The requirement's rules are all about what must NOT be observable:
|
|
5
|
+
*
|
|
6
|
+
* - **A partial download must never be usable.** Bytes are written to a temporary
|
|
7
|
+
* sibling, verified against the expected digest, and only then renamed into place.
|
|
8
|
+
* A file at the final path is therefore either absent or complete and correct —
|
|
9
|
+
* which is why the temp file is a sibling rather than somewhere else: a rename
|
|
10
|
+
* within one directory is atomic, and one across filesystems is not.
|
|
11
|
+
* - **A failed or interrupted preparation cannot become ready.** A digest mismatch
|
|
12
|
+
* deletes the partial rather than keeping it for a retry that would resume from
|
|
13
|
+
* bytes already known to be wrong.
|
|
14
|
+
* - **Uninstall and purge are separate** (RES-03). Acquisition records ownership; it
|
|
15
|
+
* never deletes. Deletion is `purgeCandidates`, which refuses to remove an asset
|
|
16
|
+
* another owner still holds.
|
|
17
|
+
* - **No source changes or binary builds on the end-user machine.** This acquires
|
|
18
|
+
* pinned bytes; there is no compile step here to disable.
|
|
19
|
+
*
|
|
20
|
+
* Everything that touches the network or the filesystem is INJECTED, so the failure
|
|
21
|
+
* paths — which are the ones that matter and the ones a real download makes hard to
|
|
22
|
+
* reach — are exercised by test.
|
|
23
|
+
*
|
|
24
|
+
* @module @try-works/dsh-model-as-tool/asset-acquisition
|
|
25
|
+
*/
|
|
26
|
+
import type { PlannedAsset } from './deployment-coordinator.ts';
|
|
27
|
+
/** Where an asset's bytes come from. */
|
|
28
|
+
export interface AcquisitionSource {
|
|
29
|
+
/**
|
|
30
|
+
* Fetch a byte range.
|
|
31
|
+
*
|
|
32
|
+
* `from` is the offset to resume from; `to` is inclusive. A source that cannot
|
|
33
|
+
* serve ranges reports `supportsRanges: false`, and the caller then restarts rather
|
|
34
|
+
* than assuming a partial is resumable.
|
|
35
|
+
* @param asset - the asset to fetch.
|
|
36
|
+
* @param from - the first byte to fetch.
|
|
37
|
+
* @param to - the last byte to fetch, inclusive.
|
|
38
|
+
* @param signal - cancellation.
|
|
39
|
+
* @returns the bytes.
|
|
40
|
+
*/
|
|
41
|
+
fetchRange(asset: PlannedAsset, from: number, to: number, signal: AbortSignal): Promise<Uint8Array>;
|
|
42
|
+
/** Whether this source can serve byte ranges, which resumability depends on. */
|
|
43
|
+
readonly supportsRanges: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** The filesystem operations acquisition needs. */
|
|
46
|
+
export interface AcquisitionStore {
|
|
47
|
+
/** Write bytes to a path, creating it if absent. */
|
|
48
|
+
write(path: string, bytes: Uint8Array): void;
|
|
49
|
+
/** Read a path's bytes, or undefined when absent. */
|
|
50
|
+
read(path: string): Uint8Array | undefined;
|
|
51
|
+
/** The size of a path in bytes, or 0 when absent. */
|
|
52
|
+
sizeOf(path: string): number;
|
|
53
|
+
/** Rename, which must be atomic within a directory. */
|
|
54
|
+
rename(from: string, to: string): void;
|
|
55
|
+
/** Remove a path, ignoring its absence. */
|
|
56
|
+
remove(path: string): void;
|
|
57
|
+
/** Whether a path exists. */
|
|
58
|
+
exists(path: string): boolean;
|
|
59
|
+
}
|
|
60
|
+
/** The outcome of an acquisition. */
|
|
61
|
+
export type AcquisitionResult = {
|
|
62
|
+
readonly acquired: true;
|
|
63
|
+
/** The content-addressed path the bytes now occupy. */
|
|
64
|
+
readonly path: string;
|
|
65
|
+
/** The verified digest. */
|
|
66
|
+
readonly digest: string;
|
|
67
|
+
/** How many bytes were transferred, which is less than the size after a resume. */
|
|
68
|
+
readonly transferredBytes: number;
|
|
69
|
+
/** Whether an existing partial was resumed. */
|
|
70
|
+
readonly resumed: boolean;
|
|
71
|
+
} | {
|
|
72
|
+
readonly acquired: false;
|
|
73
|
+
/** The reason, naming whether the bytes were wrong or the transfer failed. */
|
|
74
|
+
readonly reason: string;
|
|
75
|
+
/** Whether a retry could succeed. */
|
|
76
|
+
readonly retryable: boolean;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Acquire one asset, atomically and verified (RES-03).
|
|
80
|
+
*
|
|
81
|
+
* @param asset - the planned asset.
|
|
82
|
+
* @param options - the store, the source, the root and a cancellation signal.
|
|
83
|
+
* @returns the result, which never leaves a partial at the final path.
|
|
84
|
+
*/
|
|
85
|
+
export declare function acquireAsset(asset: PlannedAsset, options: {
|
|
86
|
+
readonly store: AcquisitionStore;
|
|
87
|
+
readonly source: AcquisitionSource;
|
|
88
|
+
/** The directory assets are content-addressed under. */
|
|
89
|
+
readonly root: string;
|
|
90
|
+
readonly signal: AbortSignal;
|
|
91
|
+
/** Transfer chunk size; bounded so a large asset does not need one huge buffer. */
|
|
92
|
+
readonly chunkBytes?: number;
|
|
93
|
+
}): Promise<AcquisitionResult>;
|
|
94
|
+
/**
|
|
95
|
+
* A declared memory admission estimate (RES-07).
|
|
96
|
+
*
|
|
97
|
+
* RES-07 requires ENFORCED and ESTIMATED limits to be reported SEPARATELY, because
|
|
98
|
+
* conflating them is how a V8 heap cap gets mistaken for a process-tree cap: the heap
|
|
99
|
+
* cap bounds JavaScript objects and says nothing about the native memory an inference
|
|
100
|
+
* engine allocates outside it.
|
|
101
|
+
*/
|
|
102
|
+
export interface MemoryEstimate {
|
|
103
|
+
/** Bytes the host will refuse to exceed, as far as it can enforce. */
|
|
104
|
+
readonly enforcedBytes: number | null;
|
|
105
|
+
/** What the deployment is expected to use, which is an estimate and not a bound. */
|
|
106
|
+
readonly estimatedBytes: number;
|
|
107
|
+
/**
|
|
108
|
+
* What the enforced figure actually covers.
|
|
109
|
+
*
|
|
110
|
+
* Named rather than implied, so a reader can tell a heap cap from a process-tree cap
|
|
111
|
+
* without reading the implementation.
|
|
112
|
+
*/
|
|
113
|
+
readonly enforcedScope: 'process-tree' | 'worker' | 'v8-heap-only' | 'none';
|
|
114
|
+
/** Whether the estimate has been measured rather than predicted. */
|
|
115
|
+
readonly measured: boolean;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Describe a memory admission, without overstating what is enforced (RES-07).
|
|
119
|
+
* @param input - the enforced and estimated figures.
|
|
120
|
+
* @returns the estimate, with the scope stated.
|
|
121
|
+
*/
|
|
122
|
+
export declare function describeMemory(input: {
|
|
123
|
+
readonly enforcedBytes: number | null;
|
|
124
|
+
readonly estimatedBytes: number;
|
|
125
|
+
readonly enforcedScope: MemoryEstimate['enforcedScope'];
|
|
126
|
+
readonly measured?: boolean;
|
|
127
|
+
}): MemoryEstimate;
|
|
128
|
+
/**
|
|
129
|
+
* Whether an enforced limit actually bounds the whole process tree (RES-07).
|
|
130
|
+
*
|
|
131
|
+
* A V8 heap cap does NOT, and treating it as though it did is the specific mistake the
|
|
132
|
+
* requirement names.
|
|
133
|
+
* @param estimate - the estimate.
|
|
134
|
+
* @returns whether the enforcement covers the process tree.
|
|
135
|
+
*/
|
|
136
|
+
export declare function boundsProcessTree(estimate: MemoryEstimate): boolean;
|
|
137
|
+
//# sourceMappingURL=asset-acquisition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-acquisition.d.ts","sourceRoot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;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAEnE"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verified atomic asset acquisition (RES-03, RES-07).
|
|
3
|
+
*
|
|
4
|
+
* The requirement's rules are all about what must NOT be observable:
|
|
5
|
+
*
|
|
6
|
+
* - **A partial download must never be usable.** Bytes are written to a temporary
|
|
7
|
+
* sibling, verified against the expected digest, and only then renamed into place.
|
|
8
|
+
* A file at the final path is therefore either absent or complete and correct —
|
|
9
|
+
* which is why the temp file is a sibling rather than somewhere else: a rename
|
|
10
|
+
* within one directory is atomic, and one across filesystems is not.
|
|
11
|
+
* - **A failed or interrupted preparation cannot become ready.** A digest mismatch
|
|
12
|
+
* deletes the partial rather than keeping it for a retry that would resume from
|
|
13
|
+
* bytes already known to be wrong.
|
|
14
|
+
* - **Uninstall and purge are separate** (RES-03). Acquisition records ownership; it
|
|
15
|
+
* never deletes. Deletion is `purgeCandidates`, which refuses to remove an asset
|
|
16
|
+
* another owner still holds.
|
|
17
|
+
* - **No source changes or binary builds on the end-user machine.** This acquires
|
|
18
|
+
* pinned bytes; there is no compile step here to disable.
|
|
19
|
+
*
|
|
20
|
+
* Everything that touches the network or the filesystem is INJECTED, so the failure
|
|
21
|
+
* paths — which are the ones that matter and the ones a real download makes hard to
|
|
22
|
+
* reach — are exercised by test.
|
|
23
|
+
*
|
|
24
|
+
* @module @try-works/dsh-model-as-tool/asset-acquisition
|
|
25
|
+
*/
|
|
26
|
+
import { createHash } from 'node:crypto';
|
|
27
|
+
/** Where an asset lives once acquired. */
|
|
28
|
+
function contentPath(root, digest) {
|
|
29
|
+
return `${root}/${digest}`;
|
|
30
|
+
}
|
|
31
|
+
/** The temporary sibling a transfer lands in before verification. */
|
|
32
|
+
function partialPath(root, digest) {
|
|
33
|
+
// A SIBLING of the final path, so the rename is within one directory and therefore
|
|
34
|
+
// atomic. A temp directory elsewhere would make the final rename a copy.
|
|
35
|
+
return `${root}/.partial-${digest}`;
|
|
36
|
+
}
|
|
37
|
+
/** Hash bytes with the algorithm the digest length implies. */
|
|
38
|
+
function digestOf(bytes, expectedLength) {
|
|
39
|
+
// SHA-512 is 128 hex characters, SHA-256 is 64. Inferring from the expected length
|
|
40
|
+
// means a lock written in either is verified with the right algorithm rather than a
|
|
41
|
+
// mismatch that looks like corruption.
|
|
42
|
+
return createHash(expectedLength > 64 ? 'sha512' : 'sha256').update(bytes).digest('hex');
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Acquire one asset, atomically and verified (RES-03).
|
|
46
|
+
*
|
|
47
|
+
* @param asset - the planned asset.
|
|
48
|
+
* @param options - the store, the source, the root and a cancellation signal.
|
|
49
|
+
* @returns the result, which never leaves a partial at the final path.
|
|
50
|
+
*/
|
|
51
|
+
export async function acquireAsset(asset, options) {
|
|
52
|
+
const { store, source, root, signal } = options;
|
|
53
|
+
const finalPath = contentPath(root, asset.digest);
|
|
54
|
+
const partial = partialPath(root, asset.digest);
|
|
55
|
+
// Already acquired and verified by a previous run: nothing to do, and nothing to
|
|
56
|
+
// re-download. This is also what makes two owners share one set of bytes.
|
|
57
|
+
if (store.exists(finalPath) && digestOf(store.read(finalPath) ?? new Uint8Array(), asset.digest.length) === asset.digest) {
|
|
58
|
+
return { acquired: true, path: finalPath, digest: asset.digest, transferredBytes: 0, resumed: false };
|
|
59
|
+
}
|
|
60
|
+
const chunkBytes = options.chunkBytes ?? 4 * 1024 * 1024;
|
|
61
|
+
// Resumption is only attempted when the source can serve ranges. Assuming a partial
|
|
62
|
+
// is resumable against a source that cannot would append a full response to a
|
|
63
|
+
// partial and produce bytes that hash wrong for a reason that looks like corruption.
|
|
64
|
+
let offset = source.supportsRanges ? store.sizeOf(partial) : 0;
|
|
65
|
+
const resumed = offset > 0;
|
|
66
|
+
if (!source.supportsRanges && store.exists(partial))
|
|
67
|
+
store.remove(partial);
|
|
68
|
+
let transferred = 0;
|
|
69
|
+
try {
|
|
70
|
+
while (offset < asset.bytes) {
|
|
71
|
+
if (signal.aborted) {
|
|
72
|
+
// The partial is LEFT in place, because it is verifiable bytes and a later
|
|
73
|
+
// attempt can resume from it; it is not at the final path, so nothing can use
|
|
74
|
+
// it as though it were complete.
|
|
75
|
+
return { acquired: false, reason: 'the transfer was cancelled', retryable: true };
|
|
76
|
+
}
|
|
77
|
+
const to = Math.min(offset + chunkBytes, asset.bytes) - 1;
|
|
78
|
+
const chunk = await source.fetchRange(asset, offset, to, signal);
|
|
79
|
+
if (chunk.byteLength === 0) {
|
|
80
|
+
// A zero-length chunk before the declared size means the source ended early.
|
|
81
|
+
return {
|
|
82
|
+
acquired: false,
|
|
83
|
+
reason: `the source ended at ${offset} of ${asset.bytes} bytes`,
|
|
84
|
+
retryable: true,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
// Appended rather than accumulated in memory: a 349 MB asset must not need a
|
|
88
|
+
// 349 MB buffer to be resumed.
|
|
89
|
+
store.write(partial, appendTo(store.read(partial), chunk));
|
|
90
|
+
offset += chunk.byteLength;
|
|
91
|
+
transferred += chunk.byteLength;
|
|
92
|
+
}
|
|
93
|
+
const completed = store.read(partial) ?? new Uint8Array();
|
|
94
|
+
if (completed.byteLength !== asset.bytes) {
|
|
95
|
+
store.remove(partial);
|
|
96
|
+
return {
|
|
97
|
+
acquired: false,
|
|
98
|
+
reason: `received ${completed.byteLength} bytes, expected ${asset.bytes}`,
|
|
99
|
+
retryable: true,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const actual = digestOf(completed, asset.digest.length);
|
|
103
|
+
if (actual !== asset.digest) {
|
|
104
|
+
// RES-03: a failed preparation cannot become ready, and bytes already known to
|
|
105
|
+
// be wrong must not be kept for a retry that would resume from them.
|
|
106
|
+
store.remove(partial);
|
|
107
|
+
return {
|
|
108
|
+
acquired: false,
|
|
109
|
+
reason: `the asset digest is ${actual}, not the pinned ${asset.digest}`,
|
|
110
|
+
retryable: false,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
// The whole point: verified bytes move into place in one atomic step, so the final
|
|
114
|
+
// path is never a partial file.
|
|
115
|
+
store.rename(partial, finalPath);
|
|
116
|
+
return { acquired: true, path: finalPath, digest: asset.digest, transferredBytes: transferred, resumed };
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
// A transport failure leaves the partial for a resume and reports retryable, so a
|
|
120
|
+
// caller can tell a flaky network from a corrupt asset.
|
|
121
|
+
return {
|
|
122
|
+
acquired: false,
|
|
123
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
124
|
+
retryable: true,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/** Concatenate a previous buffer with a new chunk. */
|
|
129
|
+
function appendTo(previous, chunk) {
|
|
130
|
+
if (previous === undefined)
|
|
131
|
+
return chunk;
|
|
132
|
+
const out = new Uint8Array(previous.byteLength + chunk.byteLength);
|
|
133
|
+
out.set(previous, 0);
|
|
134
|
+
out.set(chunk, previous.byteLength);
|
|
135
|
+
return out;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Describe a memory admission, without overstating what is enforced (RES-07).
|
|
139
|
+
* @param input - the enforced and estimated figures.
|
|
140
|
+
* @returns the estimate, with the scope stated.
|
|
141
|
+
*/
|
|
142
|
+
export function describeMemory(input) {
|
|
143
|
+
return {
|
|
144
|
+
enforcedBytes: input.enforcedBytes,
|
|
145
|
+
estimatedBytes: input.estimatedBytes,
|
|
146
|
+
enforcedScope: input.enforcedScope,
|
|
147
|
+
measured: input.measured ?? false,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Whether an enforced limit actually bounds the whole process tree (RES-07).
|
|
152
|
+
*
|
|
153
|
+
* A V8 heap cap does NOT, and treating it as though it did is the specific mistake the
|
|
154
|
+
* requirement names.
|
|
155
|
+
* @param estimate - the estimate.
|
|
156
|
+
* @returns whether the enforcement covers the process tree.
|
|
157
|
+
*/
|
|
158
|
+
export function boundsProcessTree(estimate) {
|
|
159
|
+
return estimate.enforcedScope === 'process-tree';
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=asset-acquisition.js.map
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Caller authority: the grant a tool invocation runs under (SEC-03, SEC-06).
|
|
3
|
+
*
|
|
4
|
+
* The governing rule is BASE-05: an external request cannot supply or forge these
|
|
5
|
+
* authorities. Everything here is constructed by the HOST from operator
|
|
6
|
+
* configuration, never from a request body, a `clientInfo.name`, a requested tool
|
|
7
|
+
* list, or a path a caller supplied. A caller's arguments are then checked
|
|
8
|
+
* AGAINST the grant; they never expand it.
|
|
9
|
+
*
|
|
10
|
+
* Path handling is deliberately paranoid. SEC-06 requires resolving Windows drive
|
|
11
|
+
* letters, separators, Unicode, junctions and symlinks safely, rejecting escapes,
|
|
12
|
+
* unsupported UNC/device paths and unauthorized roots, and refusing when
|
|
13
|
+
* authorization cannot be established. The resolver therefore returns the
|
|
14
|
+
* CANONICAL path for the caller to open, rather than validating a string and
|
|
15
|
+
* letting a later open re-resolve it — that gap is the classic check-then-open
|
|
16
|
+
* race, and a symlink swapped between the two steps would win it.
|
|
17
|
+
*
|
|
18
|
+
* @module @try-works/dsh-model-as-tool/authority
|
|
19
|
+
*/
|
|
20
|
+
/** The stable error codes a denied request reports (SPEC §4 error vocabulary). */
|
|
21
|
+
export type AuthorityErrorCode =
|
|
22
|
+
/** The path was not absolute; SEC-06 admits absolute paths only. */
|
|
23
|
+
'PATH_NOT_ABSOLUTE'
|
|
24
|
+
/** A UNC or Windows device path, which v1 refuses outright. */
|
|
25
|
+
| 'PATH_UNSUPPORTED'
|
|
26
|
+
/** The path does not exist, so it cannot be authorized. */
|
|
27
|
+
| 'PATH_NOT_FOUND'
|
|
28
|
+
/** The path resolves outside every approved root. */
|
|
29
|
+
| 'PATH_OUTSIDE_GRANT'
|
|
30
|
+
/** The tool is not in the grant's allowed set. */
|
|
31
|
+
| 'TOOL_NOT_GRANTED'
|
|
32
|
+
/** The grant does not exist or was revoked. */
|
|
33
|
+
| 'GRANT_REVOKED';
|
|
34
|
+
/** A refused invocation. Carries a recovery hint, not just a refusal. */
|
|
35
|
+
export declare class AuthorityError extends Error {
|
|
36
|
+
readonly name = "AuthorityError";
|
|
37
|
+
readonly code: AuthorityErrorCode;
|
|
38
|
+
/** Actionable next step for the caller or operator. */
|
|
39
|
+
readonly hint: string;
|
|
40
|
+
constructor(code: AuthorityErrorCode, message: string, hint: string);
|
|
41
|
+
}
|
|
42
|
+
/** Absolute resource limits applied to every invocation under a grant. */
|
|
43
|
+
export interface GrantLimits {
|
|
44
|
+
/** Largest admitted input, in bytes. */
|
|
45
|
+
readonly maxInputBytes: number;
|
|
46
|
+
/** Largest admitted audio duration, in seconds. */
|
|
47
|
+
readonly maxAudioSeconds: number;
|
|
48
|
+
/** Largest admitted inline result, in bytes. */
|
|
49
|
+
readonly maxResultBytes: number;
|
|
50
|
+
}
|
|
51
|
+
/** What a caller is permitted to do (SEC-03). */
|
|
52
|
+
export interface ToolGrant {
|
|
53
|
+
/** Stable grant identity, recorded in receipts. */
|
|
54
|
+
readonly grantId: string;
|
|
55
|
+
/** Tool names this caller may invoke. A requested list never extends it. */
|
|
56
|
+
readonly allowedTools: readonly string[];
|
|
57
|
+
/**
|
|
58
|
+
* Filesystem roots the caller may read from, as absolute paths.
|
|
59
|
+
* Canonicalized when the grant is built, so a symlinked root cannot be declared
|
|
60
|
+
* one way and resolve another.
|
|
61
|
+
*/
|
|
62
|
+
readonly approvedRoots: readonly string[];
|
|
63
|
+
/** Remote destinations this caller may reach. Empty means none. */
|
|
64
|
+
readonly remoteDestinations: readonly string[];
|
|
65
|
+
/** Whether hosted code execution is permitted. */
|
|
66
|
+
readonly hostedCode: boolean;
|
|
67
|
+
/** Whether receipts may be recorded. */
|
|
68
|
+
readonly recordingPolicy: 'none' | 'receipts';
|
|
69
|
+
/** Hard resource limits. */
|
|
70
|
+
readonly limits: GrantLimits;
|
|
71
|
+
}
|
|
72
|
+
/** Build a grant, canonicalizing its roots. */
|
|
73
|
+
export interface GrantInput {
|
|
74
|
+
readonly grantId: string;
|
|
75
|
+
readonly allowedTools: readonly string[];
|
|
76
|
+
readonly approvedRoots: readonly string[];
|
|
77
|
+
readonly remoteDestinations?: readonly string[];
|
|
78
|
+
readonly hostedCode?: boolean;
|
|
79
|
+
readonly recordingPolicy?: 'none' | 'receipts';
|
|
80
|
+
readonly limits?: Partial<GrantLimits>;
|
|
81
|
+
}
|
|
82
|
+
/** Conservative defaults: a grant that declares nothing permits almost nothing. */
|
|
83
|
+
export declare const DEFAULT_LIMITS: GrantLimits;
|
|
84
|
+
/**
|
|
85
|
+
* Build a grant from operator configuration.
|
|
86
|
+
*
|
|
87
|
+
* This is the only constructor: a request cannot reach it, and an approved root
|
|
88
|
+
* that is not absolute or not resolvable is dropped rather than trusted.
|
|
89
|
+
* @param input - the operator's declaration.
|
|
90
|
+
* @returns the canonicalized grant.
|
|
91
|
+
*/
|
|
92
|
+
export declare function createGrant(input: GrantInput): ToolGrant;
|
|
93
|
+
/**
|
|
94
|
+
* Authorize one caller-supplied path against a grant (SEC-06).
|
|
95
|
+
*
|
|
96
|
+
* Returns the CANONICAL path, which the caller must open. Validating the original
|
|
97
|
+
* string and opening it later would leave a window in which a symlink could be
|
|
98
|
+
* swapped; resolving once and returning the result closes it.
|
|
99
|
+
* @param grant - the caller's grant.
|
|
100
|
+
* @param candidate - the caller-supplied path.
|
|
101
|
+
* @returns the canonical, authorized path.
|
|
102
|
+
* @throws AuthorityError when the path is inadmissible, missing, or outside the grant.
|
|
103
|
+
*/
|
|
104
|
+
export declare function authorizePath(grant: ToolGrant, candidate: string): string;
|
|
105
|
+
/**
|
|
106
|
+
* Authorize a tool name against a grant (SEC-03).
|
|
107
|
+
* @param grant - the caller's grant.
|
|
108
|
+
* @param toolName - the requested tool.
|
|
109
|
+
* @throws AuthorityError with `TOOL_NOT_GRANTED`.
|
|
110
|
+
*/
|
|
111
|
+
export declare function authorizeTool(grant: ToolGrant, toolName: string): void;
|
|
112
|
+
/**
|
|
113
|
+
* Authorize a remote destination against a grant (SEC-10).
|
|
114
|
+
*
|
|
115
|
+
* No silent local-to-remote fallback: if a destination was not explicitly
|
|
116
|
+
* approved, the call is refused rather than downgraded or upgraded.
|
|
117
|
+
* @param grant - the caller's grant.
|
|
118
|
+
* @param destination - the destination origin.
|
|
119
|
+
* @throws AuthorityError with `TOOL_NOT_GRANTED`.
|
|
120
|
+
*/
|
|
121
|
+
export declare function authorizeDestination(grant: ToolGrant, destination: string): void;
|
|
122
|
+
/**
|
|
123
|
+
* The trusted execution context handed to an implementation.
|
|
124
|
+
*
|
|
125
|
+
* An implementation receives resolved authority, never a raw path it must
|
|
126
|
+
* re-check, and never anything a caller could have constructed.
|
|
127
|
+
*/
|
|
128
|
+
export interface InvocationAuthority {
|
|
129
|
+
/** Grant identity, for the receipt. */
|
|
130
|
+
readonly grantId: string;
|
|
131
|
+
/** Who is calling, as the host resolved it. */
|
|
132
|
+
readonly callerKind: 'interactive' | 'external' | 'system';
|
|
133
|
+
/** Resource limits in force. */
|
|
134
|
+
readonly limits: GrantLimits;
|
|
135
|
+
/** Whether receipts may be recorded. */
|
|
136
|
+
readonly recordingPolicy: 'none' | 'receipts';
|
|
137
|
+
/**
|
|
138
|
+
* Resolve a caller-supplied path to a canonical authorized path.
|
|
139
|
+
* @param candidate - the caller-supplied path.
|
|
140
|
+
* @returns the canonical path to open.
|
|
141
|
+
*/
|
|
142
|
+
resolvePath(candidate: string): string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Build the invocation authority for one call.
|
|
146
|
+
*
|
|
147
|
+
* The result is constructed by the host; a request body has no path to it.
|
|
148
|
+
* @param grant - the caller's grant.
|
|
149
|
+
* @param callerKind - how the host classified the caller.
|
|
150
|
+
* @returns the authority handed to the implementation.
|
|
151
|
+
*/
|
|
152
|
+
export declare function createInvocationAuthority(grant: ToolGrant, callerKind: InvocationAuthority['callerKind']): InvocationAuthority;
|
|
153
|
+
//# sourceMappingURL=authority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authority.d.ts","sourceRoot":"","sources":["../src/authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,kFAAkF;AAClF,MAAM,MAAM,kBAAkB;AAC5B,oEAAoE;AAClE,mBAAmB;AACrB,+DAA+D;GAC7D,kBAAkB;AACpB,2DAA2D;GACzD,gBAAgB;AAClB,qDAAqD;GACnD,oBAAoB;AACtB,kDAAkD;GAChD,kBAAkB;AACpB,+CAA+C;GAC7C,eAAe,CAAA;AAEnB,yEAAyE;AACzE,qBAAa,cAAe,SAAQ,KAAK;IACvC,SAAkB,IAAI,oBAAmB;IACzC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;IACjC,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;gBACT,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAKpE;AAED,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,gDAAgD;IAChD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;CAChC;AAED,iDAAiD;AACjD,MAAM,WAAW,SAAS;IACxB,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,4EAA4E;IAC5E,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IACxC;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAA;IACzC,mEAAmE;IACnE,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM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