@camstack/types 1.2.137 → 1.2.139
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/dist/capabilities/ai-cap-timeouts.d.ts +29 -0
- package/dist/capabilities/llm-runtime.cap.d.ts +0 -11
- package/dist/capabilities/metrics-provider.cap.d.ts +1 -26
- package/dist/capabilities/pipeline-analytics.cap.d.ts +21 -0
- package/dist/generated/addon-api.d.ts +0 -7
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.js +51 -39
- package/dist/index.mjs +51 -39
- package/dist/interfaces/metrics-provider.d.ts +1 -3
- package/package.json +1 -1
|
@@ -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
|
/**
|
|
@@ -235,15 +235,6 @@ declare const ContainerMemoryPointSchema: z.ZodObject<{
|
|
|
235
235
|
gpuShmemBytes: z.ZodNullable<z.ZodNumber>;
|
|
236
236
|
atMs: z.ZodNumber;
|
|
237
237
|
}, z.core.$strip>;
|
|
238
|
-
declare const DumpHeapSnapshotInputSchema: z.ZodObject<{
|
|
239
|
-
addonId: z.ZodString;
|
|
240
|
-
}, z.core.$strip>;
|
|
241
|
-
declare const DumpHeapSnapshotResultSchema: z.ZodObject<{
|
|
242
|
-
success: z.ZodBoolean;
|
|
243
|
-
path: z.ZodOptional<z.ZodString>;
|
|
244
|
-
pid: z.ZodOptional<z.ZodNumber>;
|
|
245
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
246
|
-
}, z.core.$strip>;
|
|
247
238
|
/**
|
|
248
239
|
* One point of one function's series.
|
|
249
240
|
*
|
|
@@ -714,23 +705,7 @@ export declare const metricsProviderCapability: {
|
|
|
714
705
|
cadenceMs: z.ZodNumber;
|
|
715
706
|
durable: z.ZodBoolean;
|
|
716
707
|
}, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
717
|
-
/**
|
|
718
|
-
* Tell the addon's forked runner to write a V8 heap snapshot to disk (via
|
|
719
|
-
* SIGUSR2 — the runner's diagnostic handler). Also logs its
|
|
720
|
-
* `process.memoryUsage()` + heap-space breakdown. Resolves the pid from
|
|
721
|
-
* `$process.list`, so it can only reach a runner this node spawned. Use
|
|
722
|
-
* for deep per-addon memory attribution; copy the returned path off the
|
|
723
|
-
* node to analyze.
|
|
724
|
-
*/
|
|
725
|
-
readonly dumpHeapSnapshot: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
726
|
-
addonId: z.ZodString;
|
|
727
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
728
|
-
success: z.ZodBoolean;
|
|
729
|
-
path: z.ZodOptional<z.ZodString>;
|
|
730
|
-
pid: z.ZodOptional<z.ZodNumber>;
|
|
731
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
732
|
-
}, z.core.$strip>, "mutation">;
|
|
733
708
|
};
|
|
734
709
|
};
|
|
735
710
|
export type IMetricsProvider = InferProvider<typeof metricsProviderCapability>;
|
|
736
|
-
export { SystemMetricsSchema, SystemResourceSnapshotSchema, DiskSpaceInfoSchema, MetricsGpuInfoSchema, PidResourceStatsSchema, AddonInstanceSchema, NodeProcessSchema,
|
|
711
|
+
export { SystemMetricsSchema, SystemResourceSnapshotSchema, DiskSpaceInfoSchema, MetricsGpuInfoSchema, PidResourceStatsSchema, AddonInstanceSchema, NodeProcessSchema, LoadPointSchema, LoadFunctionSeriesSchema, ContainerMemorySnapshotSchema, ContainerMemoryPointSchema, NodeLoadSeriesSchema, GetLoadSeriesInputSchema, CpuBreakdownSchema, MemoryInfoSchema, DiskIoSnapshotSchema, NetworkIoSnapshotSchema, ProcessResourceInfoSchema, PressureInfoSchema, };
|
|
@@ -617,6 +617,7 @@ declare const MediaFileKindEnum: z.ZodEnum<{
|
|
|
617
617
|
plateCrop: "plateCrop";
|
|
618
618
|
keyFrameSmall: "keyFrameSmall";
|
|
619
619
|
thumbnailSmall: "thumbnailSmall";
|
|
620
|
+
sceneFrame: "sceneFrame";
|
|
620
621
|
}>;
|
|
621
622
|
export type MediaFileKind = z.infer<typeof MediaFileKindEnum>;
|
|
622
623
|
/**
|
|
@@ -643,6 +644,7 @@ declare const MediaFileRefSchema: z.ZodObject<{
|
|
|
643
644
|
plateCrop: "plateCrop";
|
|
644
645
|
keyFrameSmall: "keyFrameSmall";
|
|
645
646
|
thumbnailSmall: "thumbnailSmall";
|
|
647
|
+
sceneFrame: "sceneFrame";
|
|
646
648
|
}>;
|
|
647
649
|
sizeBytes: z.ZodNumber;
|
|
648
650
|
timestamp: z.ZodNumber;
|
|
@@ -713,6 +715,7 @@ declare const MediaFileSchema: z.ZodObject<{
|
|
|
713
715
|
plateCrop: "plateCrop";
|
|
714
716
|
keyFrameSmall: "keyFrameSmall";
|
|
715
717
|
thumbnailSmall: "thumbnailSmall";
|
|
718
|
+
sceneFrame: "sceneFrame";
|
|
716
719
|
}>;
|
|
717
720
|
sizeBytes: z.ZodNumber;
|
|
718
721
|
timestamp: z.ZodNumber;
|
|
@@ -750,6 +753,7 @@ declare const MediaFileInfoSchema: z.ZodObject<{
|
|
|
750
753
|
plateCrop: "plateCrop";
|
|
751
754
|
keyFrameSmall: "keyFrameSmall";
|
|
752
755
|
thumbnailSmall: "thumbnailSmall";
|
|
756
|
+
sceneFrame: "sceneFrame";
|
|
753
757
|
}>;
|
|
754
758
|
url: z.ZodString;
|
|
755
759
|
sizeBytes: z.ZodNumber;
|
|
@@ -888,6 +892,7 @@ export declare const RetrainFrameCandidateSchema: z.ZodObject<{
|
|
|
888
892
|
plateCrop: "plateCrop";
|
|
889
893
|
keyFrameSmall: "keyFrameSmall";
|
|
890
894
|
thumbnailSmall: "thumbnailSmall";
|
|
895
|
+
sceneFrame: "sceneFrame";
|
|
891
896
|
}>;
|
|
892
897
|
timestamp: z.ZodNumber;
|
|
893
898
|
sizeBytes: z.ZodNumber;
|
|
@@ -913,6 +918,7 @@ export declare const RetrainFrameSchema: z.ZodObject<{
|
|
|
913
918
|
plateCrop: "plateCrop";
|
|
914
919
|
keyFrameSmall: "keyFrameSmall";
|
|
915
920
|
thumbnailSmall: "thumbnailSmall";
|
|
921
|
+
sceneFrame: "sceneFrame";
|
|
916
922
|
}>;
|
|
917
923
|
sizeBytes: z.ZodNumber;
|
|
918
924
|
width: z.ZodNumber;
|
|
@@ -945,6 +951,7 @@ export declare const RetrainFrameSelectionSchema: z.ZodObject<{
|
|
|
945
951
|
plateCrop: "plateCrop";
|
|
946
952
|
keyFrameSmall: "keyFrameSmall";
|
|
947
953
|
thumbnailSmall: "thumbnailSmall";
|
|
954
|
+
sceneFrame: "sceneFrame";
|
|
948
955
|
}>;
|
|
949
956
|
sizeBytes: z.ZodNumber;
|
|
950
957
|
width: z.ZodNumber;
|
|
@@ -977,6 +984,7 @@ export declare const RetrainFrameListSchema: z.ZodObject<{
|
|
|
977
984
|
plateCrop: "plateCrop";
|
|
978
985
|
keyFrameSmall: "keyFrameSmall";
|
|
979
986
|
thumbnailSmall: "thumbnailSmall";
|
|
987
|
+
sceneFrame: "sceneFrame";
|
|
980
988
|
}>;
|
|
981
989
|
timestamp: z.ZodNumber;
|
|
982
990
|
sizeBytes: z.ZodNumber;
|
|
@@ -1000,6 +1008,7 @@ export declare const RetrainFrameListSchema: z.ZodObject<{
|
|
|
1000
1008
|
plateCrop: "plateCrop";
|
|
1001
1009
|
keyFrameSmall: "keyFrameSmall";
|
|
1002
1010
|
thumbnailSmall: "thumbnailSmall";
|
|
1011
|
+
sceneFrame: "sceneFrame";
|
|
1003
1012
|
}>;
|
|
1004
1013
|
sizeBytes: z.ZodNumber;
|
|
1005
1014
|
width: z.ZodNumber;
|
|
@@ -1460,6 +1469,7 @@ declare const EventMediaKindFootprintSchema: z.ZodObject<{
|
|
|
1460
1469
|
plateCrop: "plateCrop";
|
|
1461
1470
|
keyFrameSmall: "keyFrameSmall";
|
|
1462
1471
|
thumbnailSmall: "thumbnailSmall";
|
|
1472
|
+
sceneFrame: "sceneFrame";
|
|
1463
1473
|
}>;
|
|
1464
1474
|
rows: z.ZodNumber;
|
|
1465
1475
|
bytes: z.ZodNumber;
|
|
@@ -1506,6 +1516,7 @@ declare const EventMediaKindBreakdownSchema: z.ZodObject<{
|
|
|
1506
1516
|
plateCrop: "plateCrop";
|
|
1507
1517
|
keyFrameSmall: "keyFrameSmall";
|
|
1508
1518
|
thumbnailSmall: "thumbnailSmall";
|
|
1519
|
+
sceneFrame: "sceneFrame";
|
|
1509
1520
|
}>;
|
|
1510
1521
|
rows: z.ZodNumber;
|
|
1511
1522
|
bytes: z.ZodNumber;
|
|
@@ -2589,6 +2600,7 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
2589
2600
|
plateCrop: "plateCrop";
|
|
2590
2601
|
keyFrameSmall: "keyFrameSmall";
|
|
2591
2602
|
thumbnailSmall: "thumbnailSmall";
|
|
2603
|
+
sceneFrame: "sceneFrame";
|
|
2592
2604
|
}>;
|
|
2593
2605
|
rows: z.ZodNumber;
|
|
2594
2606
|
bytes: z.ZodNumber;
|
|
@@ -2980,6 +2992,7 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
2980
2992
|
plateCrop: "plateCrop";
|
|
2981
2993
|
keyFrameSmall: "keyFrameSmall";
|
|
2982
2994
|
thumbnailSmall: "thumbnailSmall";
|
|
2995
|
+
sceneFrame: "sceneFrame";
|
|
2983
2996
|
}>;
|
|
2984
2997
|
timestamp: z.ZodNumber;
|
|
2985
2998
|
sizeBytes: z.ZodNumber;
|
|
@@ -3003,6 +3016,7 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
3003
3016
|
plateCrop: "plateCrop";
|
|
3004
3017
|
keyFrameSmall: "keyFrameSmall";
|
|
3005
3018
|
thumbnailSmall: "thumbnailSmall";
|
|
3019
|
+
sceneFrame: "sceneFrame";
|
|
3006
3020
|
}>;
|
|
3007
3021
|
sizeBytes: z.ZodNumber;
|
|
3008
3022
|
width: z.ZodNumber;
|
|
@@ -3048,6 +3062,7 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
3048
3062
|
plateCrop: "plateCrop";
|
|
3049
3063
|
keyFrameSmall: "keyFrameSmall";
|
|
3050
3064
|
thumbnailSmall: "thumbnailSmall";
|
|
3065
|
+
sceneFrame: "sceneFrame";
|
|
3051
3066
|
}>;
|
|
3052
3067
|
sizeBytes: z.ZodNumber;
|
|
3053
3068
|
width: z.ZodNumber;
|
|
@@ -3434,6 +3449,7 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
3434
3449
|
plateCrop: "plateCrop";
|
|
3435
3450
|
keyFrameSmall: "keyFrameSmall";
|
|
3436
3451
|
thumbnailSmall: "thumbnailSmall";
|
|
3452
|
+
sceneFrame: "sceneFrame";
|
|
3437
3453
|
}>>;
|
|
3438
3454
|
deviceId: z.ZodNumber;
|
|
3439
3455
|
}, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -3451,6 +3467,7 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
3451
3467
|
plateCrop: "plateCrop";
|
|
3452
3468
|
keyFrameSmall: "keyFrameSmall";
|
|
3453
3469
|
thumbnailSmall: "thumbnailSmall";
|
|
3470
|
+
sceneFrame: "sceneFrame";
|
|
3454
3471
|
}>;
|
|
3455
3472
|
sizeBytes: z.ZodNumber;
|
|
3456
3473
|
timestamp: z.ZodNumber;
|
|
@@ -3476,6 +3493,7 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
3476
3493
|
plateCrop: "plateCrop";
|
|
3477
3494
|
keyFrameSmall: "keyFrameSmall";
|
|
3478
3495
|
thumbnailSmall: "thumbnailSmall";
|
|
3496
|
+
sceneFrame: "sceneFrame";
|
|
3479
3497
|
}>>>;
|
|
3480
3498
|
deviceId: z.ZodNumber;
|
|
3481
3499
|
}, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
@@ -3493,6 +3511,7 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
3493
3511
|
plateCrop: "plateCrop";
|
|
3494
3512
|
keyFrameSmall: "keyFrameSmall";
|
|
3495
3513
|
thumbnailSmall: "thumbnailSmall";
|
|
3514
|
+
sceneFrame: "sceneFrame";
|
|
3496
3515
|
}>;
|
|
3497
3516
|
sizeBytes: z.ZodNumber;
|
|
3498
3517
|
timestamp: z.ZodNumber;
|
|
@@ -3533,6 +3552,7 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
3533
3552
|
plateCrop: "plateCrop";
|
|
3534
3553
|
keyFrameSmall: "keyFrameSmall";
|
|
3535
3554
|
thumbnailSmall: "thumbnailSmall";
|
|
3555
|
+
sceneFrame: "sceneFrame";
|
|
3536
3556
|
}>;
|
|
3537
3557
|
url: z.ZodString;
|
|
3538
3558
|
sizeBytes: z.ZodNumber;
|
|
@@ -3572,6 +3592,7 @@ export declare const pipelineAnalyticsCapability: {
|
|
|
3572
3592
|
plateCrop: "plateCrop";
|
|
3573
3593
|
keyFrameSmall: "keyFrameSmall";
|
|
3574
3594
|
thumbnailSmall: "thumbnailSmall";
|
|
3595
|
+
sceneFrame: "sceneFrame";
|
|
3575
3596
|
}>;
|
|
3576
3597
|
url: z.ZodString;
|
|
3577
3598
|
sizeBytes: z.ZodNumber;
|
|
@@ -4063,13 +4063,6 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
4063
4063
|
output: z.infer<typeof metricsProviderCapability.methods.getLoadSeries.output>;
|
|
4064
4064
|
meta: object;
|
|
4065
4065
|
}>;
|
|
4066
|
-
dumpHeapSnapshot: TRPCMutationProcedure<{
|
|
4067
|
-
input: {
|
|
4068
|
-
[x: string]: unknown;
|
|
4069
|
-
} & z.input<typeof metricsProviderCapability.methods.dumpHeapSnapshot.input>;
|
|
4070
|
-
output: z.infer<typeof metricsProviderCapability.methods.dumpHeapSnapshot.output>;
|
|
4071
|
-
meta: object;
|
|
4072
|
-
}>;
|
|
4073
4066
|
}>>;
|
|
4074
4067
|
modelConvert: TRPCBuiltRouter<{
|
|
4075
4068
|
ctx: TrpcContext;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* scope+access check inside `protectedProcedure` (see
|
|
7
7
|
* `server/backend/src/api/trpc/trpc.middleware.ts`).
|
|
8
8
|
*
|
|
9
|
-
* Coverage:
|
|
9
|
+
* Coverage: 1002 method paths across 126 capabilities.
|
|
10
10
|
*/
|
|
11
11
|
import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
|
|
12
12
|
export interface MethodAccessRecord {
|
|
@@ -76,7 +76,7 @@ export interface SystemProxy {
|
|
|
76
76
|
readonly llm: Pick<InferProvider<typeof llmCapability>, 'generate' | 'generateVision' | 'cancel' | 'listProfileKinds' | 'listProfiles' | 'upsertProfile' | 'deleteProfile' | 'testProfile' | 'listModels' | 'getDefaults' | 'setDefault' | 'getUsage' | 'listModelCatalog' | 'listRuntimeNodes' | 'listNodeModels' | 'resolveModelRef' | 'installModel' | 'deleteModel' | 'getRuntimeStatus' | 'startRuntime' | 'stopRuntime'>;
|
|
77
77
|
readonly localNetwork: Pick<InferProvider<typeof localNetworkCapability>, 'list' | 'getPreferred' | 'getConnectionEndpoints' | 'getNotificationEndpoint' | 'setNotificationEndpoint' | 'getViewerEndpoints' | 'setViewerEndpoints' | 'getAllowedAddresses' | 'setAllowedAddresses' | 'resetAllowlistToBestMatch' | 'getTlsStatus' | 'regenerateCertificate' | 'uploadCertificate' | 'downloadCa' | 'revertToGeneratedCertificate'>;
|
|
78
78
|
readonly meshNetwork: Pick<InferProvider<typeof meshNetworkCapability>, 'getStatus' | 'join' | 'startLogin' | 'leave' | 'logout' | 'listPeers' | 'testConnection'>;
|
|
79
|
-
readonly metricsProvider: Pick<InferProvider<typeof metricsProviderCapability>, 'collectSnapshot' | 'getCached' | 'getCurrent' | 'getDiskSpace' | 'getGpuInfo' | 'getCpuTemperature' | 'getProcessStats' | 'listAddonInstances' | 'getAddonStats' | 'listNodeProcesses' | 'getLoadSeries'
|
|
79
|
+
readonly metricsProvider: Pick<InferProvider<typeof metricsProviderCapability>, 'collectSnapshot' | 'getCached' | 'getCurrent' | 'getDiskSpace' | 'getGpuInfo' | 'getCpuTemperature' | 'getProcessStats' | 'listAddonInstances' | 'getAddonStats' | 'listNodeProcesses' | 'getLoadSeries'>;
|
|
80
80
|
readonly mqttBroker: Pick<InferProvider<typeof mqttBrokerCapability>, 'listBrokers' | 'getBrokerConfig' | 'addBroker' | 'removeBroker' | 'testConnection' | 'startEmbeddedBroker' | 'stopEmbeddedBroker' | 'getStatus'>;
|
|
81
81
|
readonly networkAccess: Pick<InferProvider<typeof networkAccessCapability>, 'start' | 'stop' | 'getEndpoint' | 'getStatus' | 'listEndpoints'>;
|
|
82
82
|
readonly networkQuality: Pick<InferProvider<typeof networkQualityCapability>, 'getAllStats'>;
|
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())),
|
|
@@ -12608,17 +12649,6 @@ var ContainerMemoryPointSchema = zod.z.object({
|
|
|
12608
12649
|
*/
|
|
12609
12650
|
gpuShmemBytes: zod.z.number().nullable()
|
|
12610
12651
|
}).extend({ atMs: zod.z.number() });
|
|
12611
|
-
var DumpHeapSnapshotInputSchema = zod.z.object({
|
|
12612
|
-
/** The addon whose runner should dump a heap snapshot. */
|
|
12613
|
-
addonId: zod.z.string() });
|
|
12614
|
-
var DumpHeapSnapshotResultSchema = zod.z.object({
|
|
12615
|
-
success: zod.z.boolean(),
|
|
12616
|
-
/** Path of the written .heapsnapshot inside the runner's container/host. */
|
|
12617
|
-
path: zod.z.string().optional(),
|
|
12618
|
-
/** Process pid that was signalled. */
|
|
12619
|
-
pid: zod.z.number().optional(),
|
|
12620
|
-
reason: zod.z.string().optional()
|
|
12621
|
-
});
|
|
12622
12652
|
/**
|
|
12623
12653
|
* One point of one function's series.
|
|
12624
12654
|
*
|
|
@@ -12807,19 +12837,7 @@ var metricsProviderCapability = {
|
|
|
12807
12837
|
* agent's ring alone (`durable: false`). Empty is a legitimate answer: a
|
|
12808
12838
|
* node nobody has heard from has no series, and saying so is the truth.
|
|
12809
12839
|
*/
|
|
12810
|
-
getLoadSeries: require_sleep.method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema)
|
|
12811
|
-
/**
|
|
12812
|
-
* Tell the addon's forked runner to write a V8 heap snapshot to disk (via
|
|
12813
|
-
* SIGUSR2 — the runner's diagnostic handler). Also logs its
|
|
12814
|
-
* `process.memoryUsage()` + heap-space breakdown. Resolves the pid from
|
|
12815
|
-
* `$process.list`, so it can only reach a runner this node spawned. Use
|
|
12816
|
-
* for deep per-addon memory attribution; copy the returned path off the
|
|
12817
|
-
* node to analyze.
|
|
12818
|
-
*/
|
|
12819
|
-
dumpHeapSnapshot: require_sleep.method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
|
|
12820
|
-
kind: "mutation",
|
|
12821
|
-
auth: "admin"
|
|
12822
|
-
})
|
|
12840
|
+
getLoadSeries: require_sleep.method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema)
|
|
12823
12841
|
}
|
|
12824
12842
|
};
|
|
12825
12843
|
//#endregion
|
|
@@ -18492,7 +18510,8 @@ var MediaFileKindEnum = zod.z.enum([
|
|
|
18492
18510
|
"plateCrop",
|
|
18493
18511
|
"keyFrame",
|
|
18494
18512
|
"keyFrameSmall",
|
|
18495
|
-
"thumbnailSmall"
|
|
18513
|
+
"thumbnailSmall",
|
|
18514
|
+
"sceneFrame"
|
|
18496
18515
|
]);
|
|
18497
18516
|
/**
|
|
18498
18517
|
* One media row's IDENTITY and shape, with no representation of its bytes.
|
|
@@ -41541,12 +41560,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
41541
41560
|
addonId: null,
|
|
41542
41561
|
access: "view"
|
|
41543
41562
|
},
|
|
41544
|
-
"metricsProvider.dumpHeapSnapshot": {
|
|
41545
|
-
capName: "metrics-provider",
|
|
41546
|
-
capScope: "system",
|
|
41547
|
-
addonId: null,
|
|
41548
|
-
access: "create"
|
|
41549
|
-
},
|
|
41550
41563
|
"metricsProvider.getAddonStats": {
|
|
41551
41564
|
capName: "metrics-provider",
|
|
41552
41565
|
capScope: "system",
|
|
@@ -47963,8 +47976,7 @@ function createSystemProxy(api) {
|
|
|
47963
47976
|
listAddonInstances: (input) => dispatch("metricsProvider", "listAddonInstances", "query", input),
|
|
47964
47977
|
getAddonStats: (input) => dispatch("metricsProvider", "getAddonStats", "query", input),
|
|
47965
47978
|
listNodeProcesses: (input) => dispatch("metricsProvider", "listNodeProcesses", "query", input),
|
|
47966
|
-
getLoadSeries: (input) => dispatch("metricsProvider", "getLoadSeries", "query", input)
|
|
47967
|
-
dumpHeapSnapshot: (input) => dispatch("metricsProvider", "dumpHeapSnapshot", "mutation", input)
|
|
47979
|
+
getLoadSeries: (input) => dispatch("metricsProvider", "getLoadSeries", "query", input)
|
|
47968
47980
|
},
|
|
47969
47981
|
mqttBroker: {
|
|
47970
47982
|
listBrokers: (input) => dispatch("mqttBroker", "listBrokers", "query", input),
|
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())),
|
|
@@ -12607,17 +12648,6 @@ var ContainerMemoryPointSchema = z.object({
|
|
|
12607
12648
|
*/
|
|
12608
12649
|
gpuShmemBytes: z.number().nullable()
|
|
12609
12650
|
}).extend({ atMs: z.number() });
|
|
12610
|
-
var DumpHeapSnapshotInputSchema = z.object({
|
|
12611
|
-
/** The addon whose runner should dump a heap snapshot. */
|
|
12612
|
-
addonId: z.string() });
|
|
12613
|
-
var DumpHeapSnapshotResultSchema = z.object({
|
|
12614
|
-
success: z.boolean(),
|
|
12615
|
-
/** Path of the written .heapsnapshot inside the runner's container/host. */
|
|
12616
|
-
path: z.string().optional(),
|
|
12617
|
-
/** Process pid that was signalled. */
|
|
12618
|
-
pid: z.number().optional(),
|
|
12619
|
-
reason: z.string().optional()
|
|
12620
|
-
});
|
|
12621
12651
|
/**
|
|
12622
12652
|
* One point of one function's series.
|
|
12623
12653
|
*
|
|
@@ -12806,19 +12836,7 @@ var metricsProviderCapability = {
|
|
|
12806
12836
|
* agent's ring alone (`durable: false`). Empty is a legitimate answer: a
|
|
12807
12837
|
* node nobody has heard from has no series, and saying so is the truth.
|
|
12808
12838
|
*/
|
|
12809
|
-
getLoadSeries: method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema)
|
|
12810
|
-
/**
|
|
12811
|
-
* Tell the addon's forked runner to write a V8 heap snapshot to disk (via
|
|
12812
|
-
* SIGUSR2 — the runner's diagnostic handler). Also logs its
|
|
12813
|
-
* `process.memoryUsage()` + heap-space breakdown. Resolves the pid from
|
|
12814
|
-
* `$process.list`, so it can only reach a runner this node spawned. Use
|
|
12815
|
-
* for deep per-addon memory attribution; copy the returned path off the
|
|
12816
|
-
* node to analyze.
|
|
12817
|
-
*/
|
|
12818
|
-
dumpHeapSnapshot: method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
|
|
12819
|
-
kind: "mutation",
|
|
12820
|
-
auth: "admin"
|
|
12821
|
-
})
|
|
12839
|
+
getLoadSeries: method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema)
|
|
12822
12840
|
}
|
|
12823
12841
|
};
|
|
12824
12842
|
//#endregion
|
|
@@ -18491,7 +18509,8 @@ var MediaFileKindEnum = z.enum([
|
|
|
18491
18509
|
"plateCrop",
|
|
18492
18510
|
"keyFrame",
|
|
18493
18511
|
"keyFrameSmall",
|
|
18494
|
-
"thumbnailSmall"
|
|
18512
|
+
"thumbnailSmall",
|
|
18513
|
+
"sceneFrame"
|
|
18495
18514
|
]);
|
|
18496
18515
|
/**
|
|
18497
18516
|
* One media row's IDENTITY and shape, with no representation of its bytes.
|
|
@@ -41533,12 +41552,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
41533
41552
|
addonId: null,
|
|
41534
41553
|
access: "view"
|
|
41535
41554
|
},
|
|
41536
|
-
"metricsProvider.dumpHeapSnapshot": {
|
|
41537
|
-
capName: "metrics-provider",
|
|
41538
|
-
capScope: "system",
|
|
41539
|
-
addonId: null,
|
|
41540
|
-
access: "create"
|
|
41541
|
-
},
|
|
41542
41555
|
"metricsProvider.getAddonStats": {
|
|
41543
41556
|
capName: "metrics-provider",
|
|
41544
41557
|
capScope: "system",
|
|
@@ -47955,8 +47968,7 @@ function createSystemProxy(api) {
|
|
|
47955
47968
|
listAddonInstances: (input) => dispatch("metricsProvider", "listAddonInstances", "query", input),
|
|
47956
47969
|
getAddonStats: (input) => dispatch("metricsProvider", "getAddonStats", "query", input),
|
|
47957
47970
|
listNodeProcesses: (input) => dispatch("metricsProvider", "listNodeProcesses", "query", input),
|
|
47958
|
-
getLoadSeries: (input) => dispatch("metricsProvider", "getLoadSeries", "query", input)
|
|
47959
|
-
dumpHeapSnapshot: (input) => dispatch("metricsProvider", "dumpHeapSnapshot", "mutation", input)
|
|
47971
|
+
getLoadSeries: (input) => dispatch("metricsProvider", "getLoadSeries", "query", input)
|
|
47960
47972
|
},
|
|
47961
47973
|
mqttBroker: {
|
|
47962
47974
|
listBrokers: (input) => dispatch("mqttBroker", "listBrokers", "query", input),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import type { CpuBreakdownSchema, MemoryInfoSchema, DiskIoSnapshotSchema, NetworkIoSnapshotSchema, MetricsGpuInfoSchema, ProcessResourceInfoSchema, PressureInfoSchema, SystemResourceSnapshotSchema, DiskSpaceInfoSchema, PidResourceStatsSchema, AddonInstanceSchema, NodeProcessSchema,
|
|
2
|
+
import type { CpuBreakdownSchema, MemoryInfoSchema, DiskIoSnapshotSchema, NetworkIoSnapshotSchema, MetricsGpuInfoSchema, ProcessResourceInfoSchema, PressureInfoSchema, SystemResourceSnapshotSchema, DiskSpaceInfoSchema, PidResourceStatsSchema, AddonInstanceSchema, NodeProcessSchema, LoadPointSchema, LoadFunctionSeriesSchema, ContainerMemorySnapshotSchema, ContainerMemoryPointSchema, NodeLoadSeriesSchema, GetLoadSeriesInputSchema } from '../capabilities/metrics-provider.cap.js';
|
|
3
3
|
export type CpuBreakdown = z.infer<typeof CpuBreakdownSchema>;
|
|
4
4
|
export type MemoryInfo = z.infer<typeof MemoryInfoSchema>;
|
|
5
5
|
export type DiskIoSnapshot = z.infer<typeof DiskIoSnapshotSchema>;
|
|
@@ -12,8 +12,6 @@ export type DiskSpaceInfo = z.infer<typeof DiskSpaceInfoSchema>;
|
|
|
12
12
|
export type PidResourceStats = z.infer<typeof PidResourceStatsSchema>;
|
|
13
13
|
export type AddonInstance = z.infer<typeof AddonInstanceSchema>;
|
|
14
14
|
export type NodeProcess = z.infer<typeof NodeProcessSchema>;
|
|
15
|
-
export type DumpHeapSnapshotInput = z.infer<typeof DumpHeapSnapshotInputSchema>;
|
|
16
|
-
export type DumpHeapSnapshotResult = z.infer<typeof DumpHeapSnapshotResultSchema>;
|
|
17
15
|
export type LoadSeriesPoint = z.infer<typeof LoadPointSchema>;
|
|
18
16
|
export type LoadFunctionSeries = z.infer<typeof LoadFunctionSeriesSchema>;
|
|
19
17
|
export type ContainerMemorySnapshot = z.infer<typeof ContainerMemorySnapshotSchema>;
|