@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
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource governance (RES-01, RES-04, RES-06, RES-09).
|
|
3
|
+
*
|
|
4
|
+
* Three distinctions here are easy to collapse and expensive to get wrong.
|
|
5
|
+
*
|
|
6
|
+
* **Readiness is not residency** (RES-04). The state vocabulary has eight members,
|
|
7
|
+
* and they answer two DIFFERENT questions: `unavailable` and `needs-preparation` say
|
|
8
|
+
* a call is not possible at all, while `prepared-cold`, `loading`, `ready` and `busy`
|
|
9
|
+
* say it is possible and merely describe how the call will be admitted. Treating
|
|
10
|
+
* `prepared-cold` as uncallable withdraws a tool that works, and — worse — makes the
|
|
11
|
+
* tool surface change on every warm/cold transition, which RES-04 explicitly forbids
|
|
12
|
+
* because an agent's view of its tools must not flicker with a cache.
|
|
13
|
+
*
|
|
14
|
+
* **A budget is a rejection, not a truncation** (RES-01, RES-09). Over-budget input
|
|
15
|
+
* is refused WITH THE ACTUAL LIMITS, because a caller that cannot see the limit
|
|
16
|
+
* cannot choose a smaller input. Silently trimming source data is the failure both
|
|
17
|
+
* requirements name.
|
|
18
|
+
*
|
|
19
|
+
* **Cancellation is a claim about behaviour** (RES-06). Where a backend cannot be
|
|
20
|
+
* interrupted, saying "cancelled" while its work continues is worse than admitting
|
|
21
|
+
* the work is still running, so the outcome says which of the two happened.
|
|
22
|
+
*
|
|
23
|
+
* @module @try-works/dsh-model-as-tool/resource-governance
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* The eight readiness/residency states (RES-04).
|
|
27
|
+
*
|
|
28
|
+
* Named `Readiness` rather than `Residency` because it holds both dimensions; the
|
|
29
|
+
* two derived functions below are what separate them.
|
|
30
|
+
*/
|
|
31
|
+
export type Readiness =
|
|
32
|
+
/** No compatible implementation exists on this host. */
|
|
33
|
+
'unavailable'
|
|
34
|
+
/** Compatible, but its assets have not been prepared. */
|
|
35
|
+
| 'needs-preparation'
|
|
36
|
+
/** Preparation is under way. */
|
|
37
|
+
| 'preparing'
|
|
38
|
+
/** Prepared and not loaded: a call will load first. */
|
|
39
|
+
| 'prepared-cold'
|
|
40
|
+
/** Currently loading. */
|
|
41
|
+
| 'loading'
|
|
42
|
+
/** Loaded and idle. */
|
|
43
|
+
| 'ready'
|
|
44
|
+
/** Loaded and serving; further calls queue. */
|
|
45
|
+
| 'busy'
|
|
46
|
+
/** Preparation or loading failed. */
|
|
47
|
+
| 'failed';
|
|
48
|
+
/**
|
|
49
|
+
* Whether a call is possible in this state (RES-04).
|
|
50
|
+
*
|
|
51
|
+
* Determined by compatibility, authorization and PREPARATION — never by residency.
|
|
52
|
+
* @param state - the current state.
|
|
53
|
+
* @returns whether the tool can be called.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isCallable(state: Readiness): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether assets are prepared (RES-04).
|
|
58
|
+
* @param state - the current state.
|
|
59
|
+
* @returns whether preparation has completed.
|
|
60
|
+
*/
|
|
61
|
+
export declare function isPrepared(state: Readiness): boolean;
|
|
62
|
+
/** How a call is admitted in a given state (RES-04). */
|
|
63
|
+
export type Admission =
|
|
64
|
+
/** Runs now. */
|
|
65
|
+
'immediate'
|
|
66
|
+
/** Will load first, so it takes longer. */
|
|
67
|
+
| 'loads-first'
|
|
68
|
+
/** Waits for the current call to finish. */
|
|
69
|
+
| 'queued';
|
|
70
|
+
/**
|
|
71
|
+
* How residency affects admission (RES-04).
|
|
72
|
+
*
|
|
73
|
+
* This is the half that residency legitimately controls: not WHETHER a tool exists,
|
|
74
|
+
* but what a call to it costs.
|
|
75
|
+
* @param state - the current state.
|
|
76
|
+
* @returns the admission behaviour, or undefined when no call is possible.
|
|
77
|
+
*/
|
|
78
|
+
export declare function admissionOf(state: Readiness): Admission | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Whether a tool DESCRIPTION may vary with this state (RES-04).
|
|
81
|
+
*
|
|
82
|
+
* Always false. RES-04 forbids changing agent tool descriptions on every warm/cold
|
|
83
|
+
* transition, so this exists to be asserted rather than to be consulted: a caller
|
|
84
|
+
* that branches on residency when building a description has found a bug.
|
|
85
|
+
* @returns always false.
|
|
86
|
+
*/
|
|
87
|
+
export declare function descriptionMayVaryWithResidency(): boolean;
|
|
88
|
+
/** A budgeted resource (RES-09). */
|
|
89
|
+
export type BudgetKind = 'sourceBytes' | 'decodedPixels' | 'audioSamples' | 'videoSeconds' | 'videoFrames' | 'processorTokens' | 'batch' | 'outputVectors';
|
|
90
|
+
/** Limits for one input class. `null` means the constraint does not apply. */
|
|
91
|
+
export type Budget = Partial<Record<BudgetKind, number | null>>;
|
|
92
|
+
/**
|
|
93
|
+
* The product defaults the requirement names verbatim (RES-09).
|
|
94
|
+
*
|
|
95
|
+
* These are PRODUCT limits, not guarantees that every input within them fits: the
|
|
96
|
+
* requirement says model context limits may force lower admission, so a successful
|
|
97
|
+
* check here is necessary and not sufficient.
|
|
98
|
+
*/
|
|
99
|
+
export declare const DEFAULT_BUDGETS: Readonly<Record<'image' | 'video' | 'audio' | 'text', Budget>>;
|
|
100
|
+
/** A measured input. */
|
|
101
|
+
export type Measurement = Partial<Record<BudgetKind, number>>;
|
|
102
|
+
/** The outcome of admitting an input. */
|
|
103
|
+
export type AdmissionDecision = {
|
|
104
|
+
readonly admitted: true;
|
|
105
|
+
} | {
|
|
106
|
+
readonly admitted: false;
|
|
107
|
+
/** Every exceeded budget, with the actual limit. */
|
|
108
|
+
readonly exceeded: readonly {
|
|
109
|
+
readonly kind: BudgetKind;
|
|
110
|
+
readonly measured: number;
|
|
111
|
+
readonly limit: number;
|
|
112
|
+
}[];
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Decide whether an input fits its budget (RES-01, RES-09).
|
|
116
|
+
*
|
|
117
|
+
* Over-budget input is REJECTED with the actual limits. It is never truncated and
|
|
118
|
+
* never sampled down, because the caller cannot otherwise tell that what it supplied
|
|
119
|
+
* is not what was processed.
|
|
120
|
+
* @param measurement - what the input actually is.
|
|
121
|
+
* @param budget - the limits in force.
|
|
122
|
+
* @returns the decision, naming every exceeded budget.
|
|
123
|
+
*/
|
|
124
|
+
export declare function admit(measurement: Measurement, budget: Budget): AdmissionDecision;
|
|
125
|
+
/**
|
|
126
|
+
* Render a rejection the caller can act on (RES-01).
|
|
127
|
+
*
|
|
128
|
+
* The requirement says to reject with ACTUAL LIMITS: a caller told only "too large"
|
|
129
|
+
* cannot choose a smaller input.
|
|
130
|
+
* @param decision - a rejection.
|
|
131
|
+
* @returns the message.
|
|
132
|
+
*/
|
|
133
|
+
export declare function describeRejection(decision: Extract<AdmissionDecision, {
|
|
134
|
+
admitted: false;
|
|
135
|
+
}>): string;
|
|
136
|
+
/** An explicit sampling instruction (RES-09). */
|
|
137
|
+
export interface SamplingPlan {
|
|
138
|
+
/** What was sampled, in the caller's terms. */
|
|
139
|
+
readonly instruction: string;
|
|
140
|
+
/** The budget that forced sampling, when one did. */
|
|
141
|
+
readonly forcedBy: BudgetKind | null;
|
|
142
|
+
}
|
|
143
|
+
/** What was actually processed, returned so coverage is never implied. */
|
|
144
|
+
export interface Coverage {
|
|
145
|
+
/** Whether every unit of the source was processed. */
|
|
146
|
+
readonly complete: boolean;
|
|
147
|
+
/** Units processed. */
|
|
148
|
+
readonly processed: number;
|
|
149
|
+
/** Units in the source. */
|
|
150
|
+
readonly total: number;
|
|
151
|
+
/** The sampling that was applied, when any was. */
|
|
152
|
+
readonly sampling: SamplingPlan | null;
|
|
153
|
+
/** Why coverage is incomplete. */
|
|
154
|
+
readonly reason: string | null;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Build the coverage report for an input that had to be sampled (RES-09).
|
|
158
|
+
*
|
|
159
|
+
* Sampling is only legitimate when it is EXPLICIT and its coverage is REPORTED. An
|
|
160
|
+
* implementation that quietly processed 32 of 900 frames and reported success has
|
|
161
|
+
* told the caller something false about the input it supplied.
|
|
162
|
+
* @param processed - units processed.
|
|
163
|
+
* @param total - units in the source.
|
|
164
|
+
* @param sampling - the instruction applied, when one was.
|
|
165
|
+
* @returns the coverage report.
|
|
166
|
+
*/
|
|
167
|
+
export declare function coverageOf(processed: number, total: number, sampling: SamplingPlan | null): Coverage;
|
|
168
|
+
/** How a cancellation actually ended (RES-06). */
|
|
169
|
+
export type CancellationOutcome =
|
|
170
|
+
/** The work stopped and released its resources. */
|
|
171
|
+
{
|
|
172
|
+
readonly stopped: true;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* The work could not be interrupted. It continues to completion, and its result
|
|
176
|
+
* is discarded rather than delivered.
|
|
177
|
+
*/
|
|
178
|
+
| {
|
|
179
|
+
readonly stopped: false;
|
|
180
|
+
readonly reason: string;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Describe a cancellation honestly (RES-06).
|
|
184
|
+
*
|
|
185
|
+
* RES-06 forbids claiming cancellation while uncontrolled work continues
|
|
186
|
+
* indefinitely. Where a backend cannot be interrupted safely, the honest report is
|
|
187
|
+
* that it is still running and its result will be discarded — which is also why the
|
|
188
|
+
* requirement prefers isolating such a backend in an owned worker.
|
|
189
|
+
* @param interruptible - whether the backend can be interrupted safely.
|
|
190
|
+
* @param subject - what is being cancelled, for the message.
|
|
191
|
+
* @returns the outcome to report.
|
|
192
|
+
*/
|
|
193
|
+
export declare function cancellationOutcome(interruptible: boolean, subject: string): CancellationOutcome;
|
|
194
|
+
/**
|
|
195
|
+
* Whether a decompression bomb must be rejected before allocation (RES-09).
|
|
196
|
+
*
|
|
197
|
+
* The check is on the DECLARED expanded size, before any allocation: a check that
|
|
198
|
+
* runs after decompression has already lost.
|
|
199
|
+
* @param declaredBytes - the expansion the container declares.
|
|
200
|
+
* @param limit - the budget for this input class.
|
|
201
|
+
* @returns whether to reject.
|
|
202
|
+
*/
|
|
203
|
+
export declare function isExpansionBomb(declaredBytes: number, limit: number): boolean;
|
|
204
|
+
//# sourceMappingURL=resource-governance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-governance.d.ts","sourceRoot":"","sources":["../src/resource-governance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,SAAS;AACnB,wDAAwD;AACtD,aAAa;AACf,yDAAyD;GACvD,mBAAmB;AACrB,gCAAgC;GAC9B,WAAW;AACb,uDAAuD;GACrD,eAAe;AACjB,yBAAyB;GACvB,SAAS;AACX,uBAAuB;GACrB,OAAO;AACT,+CAA+C;GAC7C,MAAM;AACR,qCAAqC;GACnC,QAAQ,CAAA;AAoBZ;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAEpD;AAED,wDAAwD;AACxD,MAAM,MAAM,SAAS;AACnB,gBAAgB;AACd,WAAW;AACb,2CAA2C;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"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource governance (RES-01, RES-04, RES-06, RES-09).
|
|
3
|
+
*
|
|
4
|
+
* Three distinctions here are easy to collapse and expensive to get wrong.
|
|
5
|
+
*
|
|
6
|
+
* **Readiness is not residency** (RES-04). The state vocabulary has eight members,
|
|
7
|
+
* and they answer two DIFFERENT questions: `unavailable` and `needs-preparation` say
|
|
8
|
+
* a call is not possible at all, while `prepared-cold`, `loading`, `ready` and `busy`
|
|
9
|
+
* say it is possible and merely describe how the call will be admitted. Treating
|
|
10
|
+
* `prepared-cold` as uncallable withdraws a tool that works, and — worse — makes the
|
|
11
|
+
* tool surface change on every warm/cold transition, which RES-04 explicitly forbids
|
|
12
|
+
* because an agent's view of its tools must not flicker with a cache.
|
|
13
|
+
*
|
|
14
|
+
* **A budget is a rejection, not a truncation** (RES-01, RES-09). Over-budget input
|
|
15
|
+
* is refused WITH THE ACTUAL LIMITS, because a caller that cannot see the limit
|
|
16
|
+
* cannot choose a smaller input. Silently trimming source data is the failure both
|
|
17
|
+
* requirements name.
|
|
18
|
+
*
|
|
19
|
+
* **Cancellation is a claim about behaviour** (RES-06). Where a backend cannot be
|
|
20
|
+
* interrupted, saying "cancelled" while its work continues is worse than admitting
|
|
21
|
+
* the work is still running, so the outcome says which of the two happened.
|
|
22
|
+
*
|
|
23
|
+
* @module @try-works/dsh-model-as-tool/resource-governance
|
|
24
|
+
*/
|
|
25
|
+
/** The states in which a call is possible at all (RES-04). */
|
|
26
|
+
const CALLABLE = new Set([
|
|
27
|
+
// A cold but PREPARED deployment is callable: preparation, not residency, is what
|
|
28
|
+
// makes a call possible.
|
|
29
|
+
'prepared-cold',
|
|
30
|
+
'loading',
|
|
31
|
+
'ready',
|
|
32
|
+
'busy',
|
|
33
|
+
]);
|
|
34
|
+
/** The states that imply assets are on disk (RES-04). */
|
|
35
|
+
const PREPARED = new Set([
|
|
36
|
+
'prepared-cold',
|
|
37
|
+
'loading',
|
|
38
|
+
'ready',
|
|
39
|
+
'busy',
|
|
40
|
+
]);
|
|
41
|
+
/**
|
|
42
|
+
* Whether a call is possible in this state (RES-04).
|
|
43
|
+
*
|
|
44
|
+
* Determined by compatibility, authorization and PREPARATION — never by residency.
|
|
45
|
+
* @param state - the current state.
|
|
46
|
+
* @returns whether the tool can be called.
|
|
47
|
+
*/
|
|
48
|
+
export function isCallable(state) {
|
|
49
|
+
return CALLABLE.has(state);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Whether assets are prepared (RES-04).
|
|
53
|
+
* @param state - the current state.
|
|
54
|
+
* @returns whether preparation has completed.
|
|
55
|
+
*/
|
|
56
|
+
export function isPrepared(state) {
|
|
57
|
+
return PREPARED.has(state);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* How residency affects admission (RES-04).
|
|
61
|
+
*
|
|
62
|
+
* This is the half that residency legitimately controls: not WHETHER a tool exists,
|
|
63
|
+
* but what a call to it costs.
|
|
64
|
+
* @param state - the current state.
|
|
65
|
+
* @returns the admission behaviour, or undefined when no call is possible.
|
|
66
|
+
*/
|
|
67
|
+
export function admissionOf(state) {
|
|
68
|
+
switch (state) {
|
|
69
|
+
case 'ready': return 'immediate';
|
|
70
|
+
case 'prepared-cold': return 'loads-first';
|
|
71
|
+
// `loading` and `busy` both mean work is in progress, so a new call waits for it
|
|
72
|
+
// rather than starting a second load of the same deployment.
|
|
73
|
+
case 'loading':
|
|
74
|
+
case 'busy': return 'queued';
|
|
75
|
+
default: return undefined;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Whether a tool DESCRIPTION may vary with this state (RES-04).
|
|
80
|
+
*
|
|
81
|
+
* Always false. RES-04 forbids changing agent tool descriptions on every warm/cold
|
|
82
|
+
* transition, so this exists to be asserted rather than to be consulted: a caller
|
|
83
|
+
* that branches on residency when building a description has found a bug.
|
|
84
|
+
* @returns always false.
|
|
85
|
+
*/
|
|
86
|
+
export function descriptionMayVaryWithResidency() {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The product defaults the requirement names verbatim (RES-09).
|
|
91
|
+
*
|
|
92
|
+
* These are PRODUCT limits, not guarantees that every input within them fits: the
|
|
93
|
+
* requirement says model context limits may force lower admission, so a successful
|
|
94
|
+
* check here is necessary and not sufficient.
|
|
95
|
+
*/
|
|
96
|
+
export const DEFAULT_BUDGETS = {
|
|
97
|
+
image: {
|
|
98
|
+
sourceBytes: 8 * 1024 * 1024,
|
|
99
|
+
decodedPixels: 16_000_000,
|
|
100
|
+
},
|
|
101
|
+
video: {
|
|
102
|
+
sourceBytes: 128 * 1024 * 1024,
|
|
103
|
+
videoSeconds: 120,
|
|
104
|
+
videoFrames: 32,
|
|
105
|
+
},
|
|
106
|
+
audio: {
|
|
107
|
+
// 16 kHz mono for an hour, matching the transcription contract's admission.
|
|
108
|
+
audioSamples: 16_000 * 3600,
|
|
109
|
+
},
|
|
110
|
+
text: {
|
|
111
|
+
sourceBytes: 1024 * 1024,
|
|
112
|
+
processorTokens: 8192,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Decide whether an input fits its budget (RES-01, RES-09).
|
|
117
|
+
*
|
|
118
|
+
* Over-budget input is REJECTED with the actual limits. It is never truncated and
|
|
119
|
+
* never sampled down, because the caller cannot otherwise tell that what it supplied
|
|
120
|
+
* is not what was processed.
|
|
121
|
+
* @param measurement - what the input actually is.
|
|
122
|
+
* @param budget - the limits in force.
|
|
123
|
+
* @returns the decision, naming every exceeded budget.
|
|
124
|
+
*/
|
|
125
|
+
export function admit(measurement, budget) {
|
|
126
|
+
const exceeded = [];
|
|
127
|
+
for (const [kind, limit] of Object.entries(budget)) {
|
|
128
|
+
if (limit === null || limit === undefined)
|
|
129
|
+
continue;
|
|
130
|
+
const measured = measurement[kind];
|
|
131
|
+
// An unmeasured budget cannot be enforced, and pretending it passed would be a
|
|
132
|
+
// silent acceptance. It is reported as exceeded by zero only if actually over, so
|
|
133
|
+
// an absent measurement is treated as "not applicable" rather than as "fits".
|
|
134
|
+
if (measured === undefined)
|
|
135
|
+
continue;
|
|
136
|
+
if (measured > limit)
|
|
137
|
+
exceeded.push({ kind, measured, limit });
|
|
138
|
+
}
|
|
139
|
+
return exceeded.length === 0 ? { admitted: true } : { admitted: false, exceeded };
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Render a rejection the caller can act on (RES-01).
|
|
143
|
+
*
|
|
144
|
+
* The requirement says to reject with ACTUAL LIMITS: a caller told only "too large"
|
|
145
|
+
* cannot choose a smaller input.
|
|
146
|
+
* @param decision - a rejection.
|
|
147
|
+
* @returns the message.
|
|
148
|
+
*/
|
|
149
|
+
export function describeRejection(decision) {
|
|
150
|
+
return decision.exceeded
|
|
151
|
+
.map(entry => `${entry.kind} is ${entry.measured}, over the limit of ${entry.limit}`)
|
|
152
|
+
.join('; ');
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Build the coverage report for an input that had to be sampled (RES-09).
|
|
156
|
+
*
|
|
157
|
+
* Sampling is only legitimate when it is EXPLICIT and its coverage is REPORTED. An
|
|
158
|
+
* implementation that quietly processed 32 of 900 frames and reported success has
|
|
159
|
+
* told the caller something false about the input it supplied.
|
|
160
|
+
* @param processed - units processed.
|
|
161
|
+
* @param total - units in the source.
|
|
162
|
+
* @param sampling - the instruction applied, when one was.
|
|
163
|
+
* @returns the coverage report.
|
|
164
|
+
*/
|
|
165
|
+
export function coverageOf(processed, total, sampling) {
|
|
166
|
+
const complete = processed >= total;
|
|
167
|
+
return {
|
|
168
|
+
complete,
|
|
169
|
+
processed,
|
|
170
|
+
total,
|
|
171
|
+
sampling,
|
|
172
|
+
reason: complete
|
|
173
|
+
? null
|
|
174
|
+
: sampling === null
|
|
175
|
+
// Incomplete WITHOUT a sampling instruction is a defect, not a policy: the
|
|
176
|
+
// requirement forbids silent sampling, so this case is named rather than
|
|
177
|
+
// dressed up as intentional.
|
|
178
|
+
? 'the source was not fully processed and no sampling instruction was recorded'
|
|
179
|
+
: `sampled by instruction: ${sampling.instruction}`,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Describe a cancellation honestly (RES-06).
|
|
184
|
+
*
|
|
185
|
+
* RES-06 forbids claiming cancellation while uncontrolled work continues
|
|
186
|
+
* indefinitely. Where a backend cannot be interrupted safely, the honest report is
|
|
187
|
+
* that it is still running and its result will be discarded — which is also why the
|
|
188
|
+
* requirement prefers isolating such a backend in an owned worker.
|
|
189
|
+
* @param interruptible - whether the backend can be interrupted safely.
|
|
190
|
+
* @param subject - what is being cancelled, for the message.
|
|
191
|
+
* @returns the outcome to report.
|
|
192
|
+
*/
|
|
193
|
+
export function cancellationOutcome(interruptible, subject) {
|
|
194
|
+
return interruptible
|
|
195
|
+
? { stopped: true }
|
|
196
|
+
: {
|
|
197
|
+
stopped: false,
|
|
198
|
+
reason: `${subject} cannot be interrupted safely; it will run to completion and its result discarded`,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Whether a decompression bomb must be rejected before allocation (RES-09).
|
|
203
|
+
*
|
|
204
|
+
* The check is on the DECLARED expanded size, before any allocation: a check that
|
|
205
|
+
* runs after decompression has already lost.
|
|
206
|
+
* @param declaredBytes - the expansion the container declares.
|
|
207
|
+
* @param limit - the budget for this input class.
|
|
208
|
+
* @returns whether to reject.
|
|
209
|
+
*/
|
|
210
|
+
export function isExpansionBomb(declaredBytes, limit) {
|
|
211
|
+
return declaredBytes > limit;
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=resource-governance.js.map
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server and plugin lifecycle (RUN-01, RUN-02, RUN-05, RUN-06, RUN-07).
|
|
3
|
+
*
|
|
4
|
+
* Almost every rule here is about what must NOT happen:
|
|
5
|
+
*
|
|
6
|
+
* - **Do not announce readiness before it is true** (RUN-06). A listener that reports
|
|
7
|
+
* ready before its bind or its initialisation succeeded sends a client to a port
|
|
8
|
+
* that is not answering. Readiness is therefore a STATE derived from both, not a flag
|
|
9
|
+
* set by whoever got there first.
|
|
10
|
+
* - **Do not resolve a port conflict by force or by stealth** (RUN-06). Taking the port
|
|
11
|
+
* from another process, or silently moving to a different one, both break a client
|
|
12
|
+
* that was told where to connect. The conflict is reported.
|
|
13
|
+
* - **Do not let a failed start take the host with it** (RUN-06). The MCP endpoint is
|
|
14
|
+
* one feature of a much larger host; a port clash must leave the rest running.
|
|
15
|
+
* - **Do not kill work you do not own** (RUN-07). A model process serving another
|
|
16
|
+
* still-authorized owner is not this lifecycle's to terminate.
|
|
17
|
+
* - **Do not prepare anything at startup** (RUN-05). Nothing downloads because a plugin
|
|
18
|
+
* loaded or a client listed tools.
|
|
19
|
+
*
|
|
20
|
+
* @module @try-works/dsh-model-as-tool/server-lifecycle
|
|
21
|
+
*/
|
|
22
|
+
/** Where the server is in its lifecycle. */
|
|
23
|
+
export type ServerState = 'stopped' | 'starting' | 'ready' | 'stopping' | 'failed';
|
|
24
|
+
/** Why a start failed. */
|
|
25
|
+
export interface StartFailure {
|
|
26
|
+
/** A stable code, so a caller can branch without matching a message. */
|
|
27
|
+
readonly code: 'PORT_IN_USE' | 'BIND_FAILED' | 'INIT_FAILED' | 'ALREADY_STARTED';
|
|
28
|
+
readonly message: string;
|
|
29
|
+
/** What to do about it, because a bare failure leaves an operator stuck. */
|
|
30
|
+
readonly remedy: string;
|
|
31
|
+
}
|
|
32
|
+
/** One piece of work the server owns (RUN-07). */
|
|
33
|
+
export interface OwnedWork {
|
|
34
|
+
/** An identity for diagnostics. */
|
|
35
|
+
readonly id: string;
|
|
36
|
+
/**
|
|
37
|
+
* The owner this work serves.
|
|
38
|
+
*
|
|
39
|
+
* Shutdown cancels work THIS lifecycle owns, and the owner is recorded so a model
|
|
40
|
+
* process serving another still-authorized owner is never terminated by mistake.
|
|
41
|
+
*/
|
|
42
|
+
readonly owner: string;
|
|
43
|
+
/** Ask the work to stop. */
|
|
44
|
+
cancel(): Promise<void> | void;
|
|
45
|
+
/** Force it to stop after the grace period. */
|
|
46
|
+
terminate?(): void;
|
|
47
|
+
}
|
|
48
|
+
/** What the lifecycle needs from its environment. */
|
|
49
|
+
export interface LifecycleHost {
|
|
50
|
+
/**
|
|
51
|
+
* Bind the listener.
|
|
52
|
+
*
|
|
53
|
+
* Implementations throw with a `code` of `EADDRINUSE` for a port conflict; the
|
|
54
|
+
* lifecycle reports it rather than trying to resolve it.
|
|
55
|
+
*/
|
|
56
|
+
bind(): Promise<{
|
|
57
|
+
readonly port: number;
|
|
58
|
+
readonly close: () => Promise<void>;
|
|
59
|
+
}>;
|
|
60
|
+
/** Initialise whatever must be ready before the endpoint serves. */
|
|
61
|
+
initialise(): Promise<void>;
|
|
62
|
+
/** Called once, and only once, when both bind and initialise have succeeded. */
|
|
63
|
+
onReady(port: number): void;
|
|
64
|
+
/** Log a non-fatal diagnostic. */
|
|
65
|
+
log(message: string): void;
|
|
66
|
+
}
|
|
67
|
+
/** The documented grace period for cleanup (RUN-07). */
|
|
68
|
+
export declare const DEFAULT_GRACE_MS = 5000;
|
|
69
|
+
/** How a shutdown ended. */
|
|
70
|
+
export interface ShutdownReport {
|
|
71
|
+
/** Work that stopped within the grace period. */
|
|
72
|
+
readonly cancelled: readonly string[];
|
|
73
|
+
/** Work that had to be terminated after it. */
|
|
74
|
+
readonly terminated: readonly string[];
|
|
75
|
+
/** Work that was NOT touched because this lifecycle does not own it. */
|
|
76
|
+
readonly untouched: readonly string[];
|
|
77
|
+
/** Whether the port was released. */
|
|
78
|
+
readonly portReleased: boolean;
|
|
79
|
+
/** Whether cleanup finished inside the grace period. */
|
|
80
|
+
readonly withinGrace: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Manages one MCP listener's lifecycle.
|
|
84
|
+
*
|
|
85
|
+
* Deliberately separate from the DSH plugin's own lifecycle: RUN-01 requires disabling
|
|
86
|
+
* the SERVER to stop its listener and owned work without disabling unrelated DSH tools,
|
|
87
|
+
* so the two must be independently stoppable.
|
|
88
|
+
*/
|
|
89
|
+
export declare class ServerLifecycle {
|
|
90
|
+
#private;
|
|
91
|
+
constructor(host: LifecycleHost, options?: {
|
|
92
|
+
readonly graceMs?: number;
|
|
93
|
+
});
|
|
94
|
+
/** The current state. */
|
|
95
|
+
get state(): ServerState;
|
|
96
|
+
/** The bound port, once one exists. */
|
|
97
|
+
get port(): number | null;
|
|
98
|
+
/**
|
|
99
|
+
* Whether the endpoint is serving (RUN-06).
|
|
100
|
+
*
|
|
101
|
+
* True only after BOTH bind and initialise succeeded. A caller asking "can I connect"
|
|
102
|
+
* gets one answer, and it is not derived from a flag somebody set early.
|
|
103
|
+
*/
|
|
104
|
+
get ready(): boolean;
|
|
105
|
+
/** Work currently owned, for diagnostics. */
|
|
106
|
+
get owned(): readonly OwnedWork[];
|
|
107
|
+
/**
|
|
108
|
+
* Start the listener.
|
|
109
|
+
*
|
|
110
|
+
* @returns nothing on success, or the failure — never a thrown exception, because
|
|
111
|
+
* RUN-06 requires a failed start not to crash the unrelated host.
|
|
112
|
+
*/
|
|
113
|
+
start(): Promise<{
|
|
114
|
+
readonly ok: true;
|
|
115
|
+
readonly port: number;
|
|
116
|
+
} | {
|
|
117
|
+
readonly ok: false;
|
|
118
|
+
readonly failure: StartFailure;
|
|
119
|
+
}>;
|
|
120
|
+
/**
|
|
121
|
+
* Register work this lifecycle owns (RUN-07).
|
|
122
|
+
*
|
|
123
|
+
* Refused once shutdown has begun, so a call racing a stop cannot slip into the
|
|
124
|
+
* cleanup window and be left running.
|
|
125
|
+
* @param work - the work to own.
|
|
126
|
+
* @returns whether it was accepted.
|
|
127
|
+
*/
|
|
128
|
+
adopt(work: OwnedWork): boolean;
|
|
129
|
+
/** Release work that finished on its own. */
|
|
130
|
+
release(id: string): void;
|
|
131
|
+
/**
|
|
132
|
+
* Stop the listener and everything it owns (RUN-07).
|
|
133
|
+
*
|
|
134
|
+
* The order is the requirement's: refuse new work, cancel owned foreground
|
|
135
|
+
* invocations, wait within the grace period, terminate what remains, close the
|
|
136
|
+
* transport and release the port. Work belonging to another owner is LEFT ALONE.
|
|
137
|
+
* @param options - `ownedBy` selects the owner whose work may be stopped.
|
|
138
|
+
* @returns the report.
|
|
139
|
+
*/
|
|
140
|
+
stop(options?: {
|
|
141
|
+
readonly ownedBy?: string;
|
|
142
|
+
}): Promise<ShutdownReport>;
|
|
143
|
+
}
|
|
144
|
+
/** What startup may and may not do (RUN-05). */
|
|
145
|
+
export interface StartupPolicy {
|
|
146
|
+
/**
|
|
147
|
+
* Whether model preparation may run at startup.
|
|
148
|
+
*
|
|
149
|
+
* Always false. The type carries it so the prohibition is visible at the call site
|
|
150
|
+
* rather than only in the requirement.
|
|
151
|
+
*/
|
|
152
|
+
readonly preparesModels: false;
|
|
153
|
+
/** Whether package resolution may run at startup. Always false. */
|
|
154
|
+
readonly resolvesPackages: false;
|
|
155
|
+
/** Whether discovery is read-only. Always true. */
|
|
156
|
+
readonly discoveryIsReadOnly: true;
|
|
157
|
+
}
|
|
158
|
+
/** The only startup policy this implementation permits (RUN-05). */
|
|
159
|
+
export declare const READ_ONLY_STARTUP: StartupPolicy;
|
|
160
|
+
/**
|
|
161
|
+
* Whether a startup action is permitted (RUN-05).
|
|
162
|
+
*
|
|
163
|
+
* @param action - what the startup wants to do.
|
|
164
|
+
* @returns whether it may.
|
|
165
|
+
*/
|
|
166
|
+
export declare function startupPermits(action: 'restore-active' | 'inspect-assets' | 'read-manifests' | 'prepare-model' | 'resolve-package' | 'download-weights'): boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Whether disabling the MCP server must also disable unrelated DSH tools (RUN-01).
|
|
169
|
+
*
|
|
170
|
+
* It must not. The server and the plugin are independently stoppable, which is why the
|
|
171
|
+
* lifecycle is a separate object from the plugin's own registration state.
|
|
172
|
+
* @returns always false.
|
|
173
|
+
*/
|
|
174
|
+
export declare function disablingServerDisablesOtherTools(): boolean;
|
|
175
|
+
//# sourceMappingURL=server-lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-lifecycle.d.ts","sourceRoot":"","sources":["../src/server-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,4CAA4C;AAC5C,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAA;AAElF,0BAA0B;AAC1B,MAAM,WAAW,YAAY;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,aAAa,GAAG,iBAAiB,CAAA;IAChF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,kDAAkD;AAClD,MAAM,WAAW,SAAS;IACxB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,4BAA4B;IAC5B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IAC9B,+CAA+C;IAC/C,SAAS,CAAC,IAAI,IAAI,CAAA;CACnB;AAED,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,IAAI,IAAI,OAAO,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC,CAAA;IAC/E,oEAAoE;IACpE,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,gFAAgF;IAChF,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,kCAAkC;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