@camstack/types 1.2.137 → 1.2.138
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.
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transport bounds for AI capability methods.
|
|
3
|
+
*
|
|
4
|
+
* Its own module because `llm.cap.ts` and `llm-runtime.cap.ts` already import
|
|
5
|
+
* each other: declaring the constant in either one hands the other `undefined`
|
|
6
|
+
* at module-init time, and an undefined `timeoutMs` silently falls back to the
|
|
7
|
+
* kernel's 60 s default — the exact failure this constant exists to prevent,
|
|
8
|
+
* reintroduced invisibly. Found by the guard, not by review.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Ceiling for a cap method that runs inference or loads a model.
|
|
12
|
+
*
|
|
13
|
+
* Deliberately far above anything the AI layer itself may wait for (a summary
|
|
14
|
+
* asks 180 s by default, a rule may ask 600 s), because the TRANSPORT must
|
|
15
|
+
* never be the layer that gives up first: when it does, the failure is
|
|
16
|
+
* reported as a transport error for a model that was still thinking, naming
|
|
17
|
+
* the wrong layer and hiding the real one.
|
|
18
|
+
*
|
|
19
|
+
* Measured 2026-09-03: a 6-image vision request needs 44.8 s warm and ~20 s
|
|
20
|
+
* more on a cold model load. With no declaration every digest failed at
|
|
21
|
+
* exactly 60 s and shipped without its text.
|
|
22
|
+
*
|
|
23
|
+
* A ceiling, not a budget. The AI layer's own timeouts (the rule's `timeoutMs`,
|
|
24
|
+
* the profile's `timeoutMs` / `firstTokenTimeoutMs`) remain the things that
|
|
25
|
+
* decide when to stop, because only they can say WHY.
|
|
26
|
+
*/
|
|
27
|
+
export declare const AI_CAP_TRANSPORT_TIMEOUT_MS = 600000;
|
|
28
|
+
/** A multi-gigabyte download. An hour is not generous, it is honest. */
|
|
29
|
+
export declare const AI_MODEL_INSTALL_TIMEOUT_MS: number;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `llm-runtime` — node-side managed llama.cpp executor (spec §4). Registered
|
|
3
|
-
* on EVERY node where `addon-ai` is installed; the hub `llm` provider reaches
|
|
4
|
-
* a specific node's runtime with `nodePin(profile.runtime.nodeId)` — normal
|
|
5
|
-
* cap routing, zero bespoke plumbing. `internal: true`: the operator reaches
|
|
6
|
-
* this only through the `llm` cap's methods.
|
|
7
|
-
*
|
|
8
|
-
* One running llama-server child per node in v1 (models are RAM-heavy).
|
|
9
|
-
* Resource ceiling = llama-server flags + idleStopMinutes ONLY (no RSS
|
|
10
|
-
* watchdog — operator decision #3).
|
|
11
|
-
*/
|
|
12
1
|
import { z } from 'zod';
|
|
13
2
|
import { type InferProvider } from './capability-definition.js';
|
|
14
3
|
/**
|
package/dist/index.js
CHANGED
|
@@ -11414,6 +11414,37 @@ var filesystemBrowseCapability = {
|
|
|
11414
11414
|
}
|
|
11415
11415
|
};
|
|
11416
11416
|
//#endregion
|
|
11417
|
+
//#region src/capabilities/ai-cap-timeouts.ts
|
|
11418
|
+
/**
|
|
11419
|
+
* Transport bounds for AI capability methods.
|
|
11420
|
+
*
|
|
11421
|
+
* Its own module because `llm.cap.ts` and `llm-runtime.cap.ts` already import
|
|
11422
|
+
* each other: declaring the constant in either one hands the other `undefined`
|
|
11423
|
+
* at module-init time, and an undefined `timeoutMs` silently falls back to the
|
|
11424
|
+
* kernel's 60 s default — the exact failure this constant exists to prevent,
|
|
11425
|
+
* reintroduced invisibly. Found by the guard, not by review.
|
|
11426
|
+
*/
|
|
11427
|
+
/**
|
|
11428
|
+
* Ceiling for a cap method that runs inference or loads a model.
|
|
11429
|
+
*
|
|
11430
|
+
* Deliberately far above anything the AI layer itself may wait for (a summary
|
|
11431
|
+
* asks 180 s by default, a rule may ask 600 s), because the TRANSPORT must
|
|
11432
|
+
* never be the layer that gives up first: when it does, the failure is
|
|
11433
|
+
* reported as a transport error for a model that was still thinking, naming
|
|
11434
|
+
* the wrong layer and hiding the real one.
|
|
11435
|
+
*
|
|
11436
|
+
* Measured 2026-09-03: a 6-image vision request needs 44.8 s warm and ~20 s
|
|
11437
|
+
* more on a cold model load. With no declaration every digest failed at
|
|
11438
|
+
* exactly 60 s and shipped without its text.
|
|
11439
|
+
*
|
|
11440
|
+
* A ceiling, not a budget. The AI layer's own timeouts (the rule's `timeoutMs`,
|
|
11441
|
+
* the profile's `timeoutMs` / `firstTokenTimeoutMs`) remain the things that
|
|
11442
|
+
* decide when to stop, because only they can say WHY.
|
|
11443
|
+
*/
|
|
11444
|
+
var AI_CAP_TRANSPORT_TIMEOUT_MS = 6e5;
|
|
11445
|
+
/** A multi-gigabyte download. An hour is not generous, it is honest. */
|
|
11446
|
+
var AI_MODEL_INSTALL_TIMEOUT_MS = 60 * 6e4;
|
|
11447
|
+
//#endregion
|
|
11417
11448
|
//#region src/capabilities/llm-shared.ts
|
|
11418
11449
|
/**
|
|
11419
11450
|
* Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
|
|
@@ -11729,11 +11760,13 @@ var llmRuntimeCapability = {
|
|
|
11729
11760
|
*/
|
|
11730
11761
|
complete: require_sleep.method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
|
|
11731
11762
|
kind: "mutation",
|
|
11732
|
-
auth: "admin"
|
|
11763
|
+
auth: "admin",
|
|
11764
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
11733
11765
|
}),
|
|
11734
11766
|
ensureStarted: require_sleep.method(zod.z.object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
|
|
11735
11767
|
kind: "mutation",
|
|
11736
|
-
auth: "admin"
|
|
11768
|
+
auth: "admin",
|
|
11769
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
11737
11770
|
}),
|
|
11738
11771
|
stop: require_sleep.method(zod.z.object({}), zod.z.void(), {
|
|
11739
11772
|
kind: "mutation",
|
|
@@ -11742,7 +11775,8 @@ var llmRuntimeCapability = {
|
|
|
11742
11775
|
status: require_sleep.method(zod.z.object({}), LlmRuntimeStatusSchema, { auth: "admin" }),
|
|
11743
11776
|
installModel: require_sleep.method(zod.z.object({ model: ManagedModelRefSchema }), zod.z.void(), {
|
|
11744
11777
|
kind: "mutation",
|
|
11745
|
-
auth: "admin"
|
|
11778
|
+
auth: "admin",
|
|
11779
|
+
timeoutMs: AI_MODEL_INSTALL_TIMEOUT_MS
|
|
11746
11780
|
}),
|
|
11747
11781
|
deleteModel: require_sleep.method(zod.z.object({ file: zod.z.string() }), zod.z.void(), {
|
|
11748
11782
|
kind: "mutation",
|
|
@@ -11926,8 +11960,14 @@ var llmCapability = {
|
|
|
11926
11960
|
/** `nodeId` inputs below are DATA (the hub provider pins itself), never routing. */
|
|
11927
11961
|
nodeIdMode: "data",
|
|
11928
11962
|
methods: {
|
|
11929
|
-
generate: require_sleep.method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
11930
|
-
|
|
11963
|
+
generate: require_sleep.method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
11964
|
+
kind: "mutation",
|
|
11965
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
11966
|
+
}),
|
|
11967
|
+
generateVision: require_sleep.method(GenerateVisionInputSchema, LlmGenerateResultSchema, {
|
|
11968
|
+
kind: "mutation",
|
|
11969
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
11970
|
+
}),
|
|
11931
11971
|
/**
|
|
11932
11972
|
* Stop a generation started with a `requestId`.
|
|
11933
11973
|
*
|
|
@@ -11951,7 +11991,8 @@ var llmCapability = {
|
|
|
11951
11991
|
}),
|
|
11952
11992
|
testProfile: require_sleep.method(ProfileRefInputSchema, LlmGenerateResultSchema, {
|
|
11953
11993
|
kind: "mutation",
|
|
11954
|
-
auth: "admin"
|
|
11994
|
+
auth: "admin",
|
|
11995
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
11955
11996
|
}),
|
|
11956
11997
|
/** Live vendor enumeration (GET /models etc.). */
|
|
11957
11998
|
listModels: require_sleep.method(ProfileRefInputSchema, zod.z.array(zod.z.string())),
|
package/dist/index.mjs
CHANGED
|
@@ -11413,6 +11413,37 @@ var filesystemBrowseCapability = {
|
|
|
11413
11413
|
}
|
|
11414
11414
|
};
|
|
11415
11415
|
//#endregion
|
|
11416
|
+
//#region src/capabilities/ai-cap-timeouts.ts
|
|
11417
|
+
/**
|
|
11418
|
+
* Transport bounds for AI capability methods.
|
|
11419
|
+
*
|
|
11420
|
+
* Its own module because `llm.cap.ts` and `llm-runtime.cap.ts` already import
|
|
11421
|
+
* each other: declaring the constant in either one hands the other `undefined`
|
|
11422
|
+
* at module-init time, and an undefined `timeoutMs` silently falls back to the
|
|
11423
|
+
* kernel's 60 s default — the exact failure this constant exists to prevent,
|
|
11424
|
+
* reintroduced invisibly. Found by the guard, not by review.
|
|
11425
|
+
*/
|
|
11426
|
+
/**
|
|
11427
|
+
* Ceiling for a cap method that runs inference or loads a model.
|
|
11428
|
+
*
|
|
11429
|
+
* Deliberately far above anything the AI layer itself may wait for (a summary
|
|
11430
|
+
* asks 180 s by default, a rule may ask 600 s), because the TRANSPORT must
|
|
11431
|
+
* never be the layer that gives up first: when it does, the failure is
|
|
11432
|
+
* reported as a transport error for a model that was still thinking, naming
|
|
11433
|
+
* the wrong layer and hiding the real one.
|
|
11434
|
+
*
|
|
11435
|
+
* Measured 2026-09-03: a 6-image vision request needs 44.8 s warm and ~20 s
|
|
11436
|
+
* more on a cold model load. With no declaration every digest failed at
|
|
11437
|
+
* exactly 60 s and shipped without its text.
|
|
11438
|
+
*
|
|
11439
|
+
* A ceiling, not a budget. The AI layer's own timeouts (the rule's `timeoutMs`,
|
|
11440
|
+
* the profile's `timeoutMs` / `firstTokenTimeoutMs`) remain the things that
|
|
11441
|
+
* decide when to stop, because only they can say WHY.
|
|
11442
|
+
*/
|
|
11443
|
+
var AI_CAP_TRANSPORT_TIMEOUT_MS = 6e5;
|
|
11444
|
+
/** A multi-gigabyte download. An hour is not generous, it is honest. */
|
|
11445
|
+
var AI_MODEL_INSTALL_TIMEOUT_MS = 60 * 6e4;
|
|
11446
|
+
//#endregion
|
|
11416
11447
|
//#region src/capabilities/llm-shared.ts
|
|
11417
11448
|
/**
|
|
11418
11449
|
* Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
|
|
@@ -11728,11 +11759,13 @@ var llmRuntimeCapability = {
|
|
|
11728
11759
|
*/
|
|
11729
11760
|
complete: method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
|
|
11730
11761
|
kind: "mutation",
|
|
11731
|
-
auth: "admin"
|
|
11762
|
+
auth: "admin",
|
|
11763
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
11732
11764
|
}),
|
|
11733
11765
|
ensureStarted: method(z.object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
|
|
11734
11766
|
kind: "mutation",
|
|
11735
|
-
auth: "admin"
|
|
11767
|
+
auth: "admin",
|
|
11768
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
11736
11769
|
}),
|
|
11737
11770
|
stop: method(z.object({}), z.void(), {
|
|
11738
11771
|
kind: "mutation",
|
|
@@ -11741,7 +11774,8 @@ var llmRuntimeCapability = {
|
|
|
11741
11774
|
status: method(z.object({}), LlmRuntimeStatusSchema, { auth: "admin" }),
|
|
11742
11775
|
installModel: method(z.object({ model: ManagedModelRefSchema }), z.void(), {
|
|
11743
11776
|
kind: "mutation",
|
|
11744
|
-
auth: "admin"
|
|
11777
|
+
auth: "admin",
|
|
11778
|
+
timeoutMs: AI_MODEL_INSTALL_TIMEOUT_MS
|
|
11745
11779
|
}),
|
|
11746
11780
|
deleteModel: method(z.object({ file: z.string() }), z.void(), {
|
|
11747
11781
|
kind: "mutation",
|
|
@@ -11925,8 +11959,14 @@ var llmCapability = {
|
|
|
11925
11959
|
/** `nodeId` inputs below are DATA (the hub provider pins itself), never routing. */
|
|
11926
11960
|
nodeIdMode: "data",
|
|
11927
11961
|
methods: {
|
|
11928
|
-
generate: method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
11929
|
-
|
|
11962
|
+
generate: method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
|
|
11963
|
+
kind: "mutation",
|
|
11964
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
11965
|
+
}),
|
|
11966
|
+
generateVision: method(GenerateVisionInputSchema, LlmGenerateResultSchema, {
|
|
11967
|
+
kind: "mutation",
|
|
11968
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
11969
|
+
}),
|
|
11930
11970
|
/**
|
|
11931
11971
|
* Stop a generation started with a `requestId`.
|
|
11932
11972
|
*
|
|
@@ -11950,7 +11990,8 @@ var llmCapability = {
|
|
|
11950
11990
|
}),
|
|
11951
11991
|
testProfile: method(ProfileRefInputSchema, LlmGenerateResultSchema, {
|
|
11952
11992
|
kind: "mutation",
|
|
11953
|
-
auth: "admin"
|
|
11993
|
+
auth: "admin",
|
|
11994
|
+
timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
|
|
11954
11995
|
}),
|
|
11955
11996
|
/** Live vendor enumeration (GET /models etc.). */
|
|
11956
11997
|
listModels: method(ProfileRefInputSchema, z.array(z.string())),
|