@camstack/system 1.2.139 → 1.2.140
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/addon-runner.js +1 -1
- package/dist/addon-runner.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +3 -3
- package/dist/builtins/device-manager/device-manager.addon.mjs +3 -3
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-D595vzqY.mjs → dist-Clses4Bs.mjs} +71 -5
- package/dist/{dist-MqjCyx1E.js → dist-D5Jhh8Vk.js} +71 -5
- package/dist/index.js +28 -17
- package/dist/index.mjs +29 -17
- package/dist/kernel/cap-router-builder.d.ts +13 -0
- package/dist/kernel/index.d.ts +1 -1
- package/dist/kernel/moleculer/trpc-links.d.ts +1 -12
- package/dist/kernel/transport/cap-route-resolver.d.ts +25 -1
- package/dist/{manifest-python-deps-C9x9vrqt.js → manifest-python-deps-Bu8H1_rg.js} +16 -49
- package/dist/{manifest-python-deps-08rqn6xN.mjs → manifest-python-deps-Dxifi-o0.mjs} +17 -44
- package/dist/{retired-settings-keys-BvxgnDT1.mjs → retired-settings-keys-Cr8N6C6X.mjs} +1 -1
- package/dist/{retired-settings-keys-IVq6xR9i.js → retired-settings-keys-Dflres-F.js} +1 -1
- package/package.json +1 -1
|
@@ -3838,10 +3838,11 @@ var RelocateFootageInputSchema = zod.z.object({
|
|
|
3838
3838
|
* `RecordingConfig.enabled` or camera wrapper bindings. */
|
|
3839
3839
|
var StorageMigrationLeaseInputSchema = zod.z.object({ leaseId: zod.z.string().min(1) });
|
|
3840
3840
|
var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: zod.z.string().min(1) });
|
|
3841
|
-
var
|
|
3841
|
+
var RelocateMediaInputSchema = zod.z.object({
|
|
3842
3842
|
toLocationId: zod.z.string(),
|
|
3843
3843
|
throttleMbps: zod.z.number().min(1).max(1e3).optional()
|
|
3844
|
-
})
|
|
3844
|
+
});
|
|
3845
|
+
var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: zod.z.string().min(1) });
|
|
3845
3846
|
/** The independently selectable logical storage classes. `recordings`
|
|
3846
3847
|
* encompasses the high and mid segment profiles; `recordingsLow` is low
|
|
3847
3848
|
* segments; `eventMedia` is post-analysis blobs. */
|
|
@@ -4136,7 +4137,26 @@ var LabelDefinitionSchema = zod.z.object({
|
|
|
4136
4137
|
description: zod.z.string().optional(),
|
|
4137
4138
|
icon: zod.z.string().optional()
|
|
4138
4139
|
});
|
|
4139
|
-
|
|
4140
|
+
/**
|
|
4141
|
+
* Wire schema for a per-model CATALOG classMap override
|
|
4142
|
+
* (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
|
|
4143
|
+
* restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
|
|
4144
|
+
* detection pipeline executor actually routes.
|
|
4145
|
+
*
|
|
4146
|
+
* This is deliberately a DIFFERENT, narrower shape than the general-purpose
|
|
4147
|
+
* `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
|
|
4148
|
+
* and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
|
|
4149
|
+
* enum) — the two used to share the name `ClassMapDefinition`/
|
|
4150
|
+
* `ClassMapDefinitionSchema`, which made the schema-type-twin guard
|
|
4151
|
+
* (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
|
|
4152
|
+
* are not: it is two different concepts colliding on a name. Keep this type
|
|
4153
|
+
* under its own name rather than reusing `ClassMapDefinition` — reusing it
|
|
4154
|
+
* would either narrow every `ClassMapDefinition` consumer to the four
|
|
4155
|
+
* detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
|
|
4156
|
+
* schema exists for (see the "rejects a classMap whose target is not a
|
|
4157
|
+
* detection macro" test in `model-catalog-schema.test.ts`).
|
|
4158
|
+
*/
|
|
4159
|
+
var DetectionCatalogClassMapSchema = zod.z.object({
|
|
4140
4160
|
mapping: zod.z.record(zod.z.string(), zod.z.enum([
|
|
4141
4161
|
"person",
|
|
4142
4162
|
"vehicle",
|
|
@@ -4341,7 +4361,7 @@ var ModelCatalogEntrySchema = zod.z.object({
|
|
|
4341
4361
|
* applies (Frigate / COCO public catalog). Set on a custom model whose raw
|
|
4342
4362
|
* labels already ARE the CamStack macros (Scrypted identity map).
|
|
4343
4363
|
*/
|
|
4344
|
-
classMap:
|
|
4364
|
+
classMap: DetectionCatalogClassMapSchema.optional()
|
|
4345
4365
|
});
|
|
4346
4366
|
var ConvertTargetSchema = zod.z.discriminatedUnion("format", [zod.z.object({
|
|
4347
4367
|
format: zod.z.literal("openvino"),
|
|
@@ -4371,7 +4391,7 @@ var ModelConvertMetadataSchema = zod.z.object({
|
|
|
4371
4391
|
"segmentation"
|
|
4372
4392
|
]),
|
|
4373
4393
|
faceAlignment: zod.z.boolean().optional(),
|
|
4374
|
-
classMap:
|
|
4394
|
+
classMap: DetectionCatalogClassMapSchema.optional()
|
|
4375
4395
|
});
|
|
4376
4396
|
var ConvertArtifactSchema = zod.z.object({
|
|
4377
4397
|
format: zod.z.enum(MODEL_FORMATS),
|
|
@@ -15918,6 +15938,29 @@ var pipelineAnalyticsCapability = {
|
|
|
15918
15938
|
kind: "mutation",
|
|
15919
15939
|
auth: "admin"
|
|
15920
15940
|
}),
|
|
15941
|
+
/**
|
|
15942
|
+
* Moves event media between locations — the OPERATOR's mover, without the
|
|
15943
|
+
* coordinator's lease. Twin of `recording.relocateFootage`: the same
|
|
15944
|
+
* engine the lease-gated coordinated migration uses
|
|
15945
|
+
* (`startStorageMigrationMove`), armable in the background and WITHOUT
|
|
15946
|
+
* pausing anything. Exists because `eventMedia` was the only storage
|
|
15947
|
+
* class whose only move path went through the recorder's global pause.
|
|
15948
|
+
*/
|
|
15949
|
+
relocateMedia: method(RelocateMediaInputSchema, zod.z.object({ jobId: zod.z.string() }), {
|
|
15950
|
+
kind: "mutation",
|
|
15951
|
+
auth: "admin"
|
|
15952
|
+
}),
|
|
15953
|
+
/** Every relocate job this addon knows about, newest first (in RAM: the
|
|
15954
|
+
* move is resumable, so a lost list costs nothing but the display). */
|
|
15955
|
+
listRelocateMediaJobs: method(zod.z.object({}), zod.z.array(RelocateJobSchema).readonly(), {
|
|
15956
|
+
kind: "query",
|
|
15957
|
+
auth: "admin"
|
|
15958
|
+
}),
|
|
15959
|
+
/** Cancel a running or queued relocate job. */
|
|
15960
|
+
cancelRelocateMedia: method(zod.z.object({ jobId: zod.z.string() }), zod.z.object({ cancelled: zod.z.boolean() }), {
|
|
15961
|
+
kind: "mutation",
|
|
15962
|
+
auth: "admin"
|
|
15963
|
+
}),
|
|
15921
15964
|
listOpsLog: method(OpsLogQueryInputSchema, zod.z.array(OpsLogEntrySchema).readonly(), {
|
|
15922
15965
|
kind: "query",
|
|
15923
15966
|
auth: "admin"
|
|
@@ -16277,6 +16320,11 @@ zod.z.object({
|
|
|
16277
16320
|
"jpeg"
|
|
16278
16321
|
])
|
|
16279
16322
|
});
|
|
16323
|
+
/**
|
|
16324
|
+
* Process-local frame identity. It is serializable so it can ride an in-process
|
|
16325
|
+
* capability call, but `registryId` deliberately prevents resolution in any
|
|
16326
|
+
* other process or execution group.
|
|
16327
|
+
*/
|
|
16280
16328
|
var FrameRefSchema = zod.z.object({
|
|
16281
16329
|
registryId: zod.z.string().min(1),
|
|
16282
16330
|
id: zod.z.string().min(1),
|
|
@@ -33972,6 +34020,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
33972
34020
|
addonId: null,
|
|
33973
34021
|
access: "create"
|
|
33974
34022
|
},
|
|
34023
|
+
"pipelineAnalytics.cancelRelocateMedia": {
|
|
34024
|
+
capName: "pipeline-analytics",
|
|
34025
|
+
capScope: "device",
|
|
34026
|
+
addonId: null,
|
|
34027
|
+
access: "create"
|
|
34028
|
+
},
|
|
33975
34029
|
"pipelineAnalytics.cancelStorageMigrationMove": {
|
|
33976
34030
|
capName: "pipeline-analytics",
|
|
33977
34031
|
capScope: "device",
|
|
@@ -34146,6 +34200,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
34146
34200
|
addonId: null,
|
|
34147
34201
|
access: "view"
|
|
34148
34202
|
},
|
|
34203
|
+
"pipelineAnalytics.listRelocateMediaJobs": {
|
|
34204
|
+
capName: "pipeline-analytics",
|
|
34205
|
+
capScope: "device",
|
|
34206
|
+
addonId: null,
|
|
34207
|
+
access: "view"
|
|
34208
|
+
},
|
|
34149
34209
|
"pipelineAnalytics.listRetrainAnnotations": {
|
|
34150
34210
|
capName: "pipeline-analytics",
|
|
34151
34211
|
capScope: "device",
|
|
@@ -34224,6 +34284,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
34224
34284
|
addonId: null,
|
|
34225
34285
|
access: "create"
|
|
34226
34286
|
},
|
|
34287
|
+
"pipelineAnalytics.relocateMedia": {
|
|
34288
|
+
capName: "pipeline-analytics",
|
|
34289
|
+
capScope: "device",
|
|
34290
|
+
addonId: null,
|
|
34291
|
+
access: "create"
|
|
34292
|
+
},
|
|
34227
34293
|
"pipelineAnalytics.restageRetrainTrack": {
|
|
34228
34294
|
capName: "pipeline-analytics",
|
|
34229
34295
|
capScope: "device",
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("./dist-
|
|
3
|
+
const require_dist = require("./dist-D5Jhh8Vk.js");
|
|
4
4
|
const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
|
|
5
5
|
require("./builtins/alerts/index.js");
|
|
6
6
|
const require_formatter = require("./formatter-DqAKDlvN.js");
|
|
@@ -26,7 +26,7 @@ require("./builtins/system-config/index.js");
|
|
|
26
26
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
27
27
|
const require_file_data_plane = require("./file-data-plane-DO8KbxCe.js");
|
|
28
28
|
const require_tls$1 = require("./tls-u8QCJCFE.js");
|
|
29
|
-
const require_manifest_python_deps = require("./manifest-python-deps-
|
|
29
|
+
const require_manifest_python_deps = require("./manifest-python-deps-Bu8H1_rg.js");
|
|
30
30
|
const require_resource_monitor = require("./resource-monitor-CdnzxBLP.js");
|
|
31
31
|
const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
|
|
32
32
|
let zod = require("zod");
|
|
@@ -6410,11 +6410,31 @@ function methodsFor(def) {
|
|
|
6410
6410
|
schema: m,
|
|
6411
6411
|
isVoid: require_dist.isVoidInput(m.input),
|
|
6412
6412
|
isObject: require_dist.isObjectInput(m.input),
|
|
6413
|
-
callerRequired: m.caller === "required"
|
|
6413
|
+
callerRequired: m.caller === "required",
|
|
6414
|
+
isArrayOutput: m.kind !== "subscription" && require_dist.isArrayOutputSchema(m.output)
|
|
6414
6415
|
};
|
|
6415
6416
|
});
|
|
6416
6417
|
}
|
|
6417
6418
|
/**
|
|
6419
|
+
* Invoke `method.name` on a resolved provider, raising the canonical
|
|
6420
|
+
* "method not found" error (Task 7.5d) when the provider does not implement
|
|
6421
|
+
* it — the naive `provider[method.name]?.(payload)` optional call let a
|
|
6422
|
+
* missing method answer `undefined` (200 to the caller). EXCEPTION, mirrored
|
|
6423
|
+
* from `child-cap-dispatch.ts`'s `isCollectionListMethod` graceful skip: a
|
|
6424
|
+
* COLLECTION cap's array-output method degrades to `[]` — the hub fans that
|
|
6425
|
+
* method across every registered provider
|
|
6426
|
+
* (`resolveCollectionProvider`/`concatArrayMethod`), so ONE provider not
|
|
6427
|
+
* implementing it is a graceful skip, not an error. Every other missing
|
|
6428
|
+
* method (singleton, device-native, or a collection's SCALAR method) is a
|
|
6429
|
+
* real implementation gap and fails loud.
|
|
6430
|
+
*/
|
|
6431
|
+
function invokeCapMethod(provider, method, payload, capName, isCollection, services) {
|
|
6432
|
+
const fn = provider[method.name];
|
|
6433
|
+
if (typeof fn === "function") return fn(payload);
|
|
6434
|
+
if (isCollection && method.isArrayOutput) return [];
|
|
6435
|
+
return (services.methodNotFound ?? ((cap, m) => services.badRequest(`Capability "${cap}" has no method "${m}"`)))(capName, method.name);
|
|
6436
|
+
}
|
|
6437
|
+
/**
|
|
6418
6438
|
* Extract the authenticated caller identity from the (structurally
|
|
6419
6439
|
* unknown) tRPC context. The builder cannot import the server's
|
|
6420
6440
|
* `TrpcContext`, so the read is narrowing-based: `ctx.user.id` (string)
|
|
@@ -6534,37 +6554,29 @@ function buildOneCapRouter(def, primitives, services) {
|
|
|
6534
6554
|
}).optional() : zod.z.object({ nodeId: zod.z.string().optional() }).optional();
|
|
6535
6555
|
procedures[method.name] = base.input(voidSelector)[procKind](({ input, ctx }) => {
|
|
6536
6556
|
const sel = input ?? {};
|
|
6537
|
-
return (nodeIdData ? requireLocal(capName, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services) : resolveProviderForCall(capName, sel.nodeId, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services, isCollection ? sel.addonId : void 0)
|
|
6557
|
+
return invokeCapMethod(nodeIdData ? requireLocal(capName, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services) : resolveProviderForCall(capName, sel.nodeId, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services, isCollection ? sel.addonId : void 0), method, void 0, capName, isCollection, services);
|
|
6538
6558
|
});
|
|
6539
6559
|
continue;
|
|
6540
6560
|
}
|
|
6541
6561
|
if (method.isObject) {
|
|
6542
6562
|
const schema = nodeIdData ? inputSchema : require_dist.looseSchema(inputSchema);
|
|
6543
6563
|
procedures[method.name] = base.input(schema)[procKind](({ input, ctx }) => {
|
|
6544
|
-
if (nodeIdData)
|
|
6545
|
-
const provider = requireLocal(capName, () => getLocal(ctx), services);
|
|
6546
|
-
const payload = method.callerRequired ? injectCaller(stripKeys(input, []).rest, ctx, capName, method.name, services) : input;
|
|
6547
|
-
return provider[method.name]?.(payload);
|
|
6548
|
-
}
|
|
6564
|
+
if (nodeIdData) return invokeCapMethod(requireLocal(capName, () => getLocal(ctx), services), method, method.callerRequired ? injectCaller(stripKeys(input, []).rest, ctx, capName, method.name, services) : input, capName, isCollection, services);
|
|
6549
6565
|
if (isCollection) {
|
|
6550
6566
|
const { rest, picked } = stripKeys(input, ["nodeId", "addonId"]);
|
|
6551
6567
|
const nodeId = typeof picked.nodeId === "string" ? picked.nodeId : void 0;
|
|
6552
6568
|
const topLevelAddonId = typeof picked.addonId === "string" ? picked.addonId : void 0;
|
|
6553
6569
|
const canRecoverNestedAddonId = !require_dist.isArrayOutputSchema(method.schema.output) && !require_dist.objectInputDeclaresAddonId(method.schema.input);
|
|
6554
6570
|
const addonId = topLevelAddonId ?? (canRecoverNestedAddonId ? require_dist.extractNestedAddonId(rest) : void 0);
|
|
6555
|
-
|
|
6556
|
-
const payload = method.callerRequired ? injectCaller(rest, ctx, capName, method.name, services) : rest;
|
|
6557
|
-
return provider[method.name]?.(payload);
|
|
6571
|
+
return invokeCapMethod(resolveProviderForCall(capName, nodeId, () => getLocal(ctx, addonId), services, topLevelAddonId), method, method.callerRequired ? injectCaller(rest, ctx, capName, method.name, services) : rest, capName, isCollection, services);
|
|
6558
6572
|
}
|
|
6559
6573
|
const { rest, picked } = stripKeys(input, ["nodeId"]);
|
|
6560
|
-
|
|
6561
|
-
const payload = method.callerRequired ? injectCaller(rest, ctx, capName, method.name, services) : rest;
|
|
6562
|
-
return provider[method.name]?.(payload);
|
|
6574
|
+
return invokeCapMethod(resolveProviderForCall(capName, typeof picked.nodeId === "string" ? picked.nodeId : void 0, () => getLocal(ctx), services), method, method.callerRequired ? injectCaller(rest, ctx, capName, method.name, services) : rest, capName, isCollection, services);
|
|
6563
6575
|
});
|
|
6564
6576
|
continue;
|
|
6565
6577
|
}
|
|
6566
6578
|
procedures[method.name] = base.input(inputSchema)[procKind](({ input, ctx }) => {
|
|
6567
|
-
return requireLocal(capName, () => getLocal(ctx), services)
|
|
6579
|
+
return invokeCapMethod(requireLocal(capName, () => getLocal(ctx), services), method, input, capName, isCollection, services);
|
|
6568
6580
|
});
|
|
6569
6581
|
}
|
|
6570
6582
|
return primitives.router(procedures);
|
|
@@ -95389,7 +95401,6 @@ Object.defineProperty(exports, "installPythonRequirements", {
|
|
|
95389
95401
|
return _camstack_types_node.installPythonRequirements;
|
|
95390
95402
|
}
|
|
95391
95403
|
});
|
|
95392
|
-
exports.ipcChildLink = require_manifest_python_deps.ipcChildLink;
|
|
95393
95404
|
exports.ipcParentLink = require_manifest_python_deps.ipcParentLink;
|
|
95394
95405
|
exports.isAddonDeploySource = isAddonDeploySource;
|
|
95395
95406
|
exports.isArrayOutputSchema = require_dist.isArrayOutputSchema;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { At as asJsonObject$1, B as extractNestedAddonId, Bt as parseJsonObject, Ct as DEVICE_STATUS_METHOD, Dt as ReadinessRegistry, H as isArrayOutputSchema, Ht as readinessKey, It as expandCapMethods, J as lifecycleJobSchema, K as isVoidInput, Kt as EventCategory$1, Mt as asString$1, Nt as createEvent, Ot as ReadinessTimeoutError, Pt as emitDownForOwnedCaps, Q as looseSchema, St as DEVICE_SETTINGS_CONTRIBUTION_METHODS, U as isCollectionArrayMethod, Ut as resolveCapMount, Vt as parseJsonUnknown$1, W as isObjectInput, Wt as scopeKey, Z as logLevelAtMost, at as resolveMethodAuth, ct as scopesAllowDeviceCap, d as METHOD_ACCESS_MAP, f as RUNTIME_DEFAULTS, it as procedureAuthKey, jt as asNumber, q as kebabToCamel, st as scopesAllowAddon, t as ALL_CAPABILITY_DEFINITIONS, tt as objectInputDeclaresAddonId, xt as DATAPLANE_SECRET_HEADER$1, y as addonSettingsCapability, yt as errMsg$1 } from "./dist-
|
|
2
|
+
import { At as asJsonObject$1, B as extractNestedAddonId, Bt as parseJsonObject, Ct as DEVICE_STATUS_METHOD, Dt as ReadinessRegistry, H as isArrayOutputSchema, Ht as readinessKey, It as expandCapMethods, J as lifecycleJobSchema, K as isVoidInput, Kt as EventCategory$1, Mt as asString$1, Nt as createEvent, Ot as ReadinessTimeoutError, Pt as emitDownForOwnedCaps, Q as looseSchema, St as DEVICE_SETTINGS_CONTRIBUTION_METHODS, U as isCollectionArrayMethod, Ut as resolveCapMount, Vt as parseJsonUnknown$1, W as isObjectInput, Wt as scopeKey, Z as logLevelAtMost, at as resolveMethodAuth, ct as scopesAllowDeviceCap, d as METHOD_ACCESS_MAP, f as RUNTIME_DEFAULTS, it as procedureAuthKey, jt as asNumber, q as kebabToCamel, st as scopesAllowAddon, t as ALL_CAPABILITY_DEFINITIONS, tt as objectInputDeclaresAddonId, xt as DATAPLANE_SECRET_HEADER$1, y as addonSettingsCapability, yt as errMsg$1 } from "./dist-Clses4Bs.mjs";
|
|
3
3
|
import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
|
|
4
4
|
import "./builtins/alerts/index.mjs";
|
|
5
5
|
import { t as formatLogLine } from "./formatter-B7qW8bPJ.mjs";
|
|
@@ -25,7 +25,7 @@ import "./builtins/system-config/index.mjs";
|
|
|
25
25
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
26
26
|
import { a as parseTokenizedUrl, c as collectModelFiles, d as downloadModel, f as ensureModel, h as isModelDownloaded, i as parseRangeHeader, l as deleteModelFromDisk, m as getModelFilePath, n as contentTypeFor, o as resolveFilePath, p as fetchJson, r as createAuthenticatedFileServer, s as ModelDownloadService, t as createFileDataPlaneHandler, u as downloadFile } from "./file-data-plane-BhKdxJgf.mjs";
|
|
27
27
|
import { C as registerLanHttpHandler, S as readLanHttpState, _ as DEFAULT_LAN_HTTP_PORT, a as writeTlsMode, b as bindPendingLanHttp, c as loadTlsCert, d as collectCertIdentity, f as CA_VALIDITY_DAYS, g as evaluateExistingCert, h as SERVER_AUTH_OID, i as writeExtraSans, l as reissueTlsLeaf, m as MAX_LEAF_VALIDITY_DAYS, n as readTlsAccessStatus, o as validateUploadedTls, p as LEAF_RENEWAL_WINDOW_DAYS, r as readTlsMode, s as ensureTlsCert, t as readExtraSans, u as CA_COMMON_NAME, v as allFamiliesListenHost, x as closeLanHttp, y as applyLanHttp } from "./tls-CQhPGSJm.mjs";
|
|
28
|
-
import { $ as
|
|
28
|
+
import { $ as buildUdsNativeCapProxy, A as createParentUnownedCallHandler, At as createV8Reclaimer, B as AGENT_CAP_FWD_SERVICE, C as brokerTransportLink, Ct as createAddonDataPlaneFacility, D as HUB_CAP_FWD_ACTION, Dt as HEAP_WATCH_WARN_RATIO, E as localProviderLink, Et as HEAP_WATCH_INTERVAL_MS, F as createUdsLoggerWithControl, G as createLocalTransport, H as CapRouteError, I as LocalChildClient, J as SocketChannel, K as UdsLocalTransportClient, L as LocalChildRegistry, M as createUdsEventBus, Mt as startHeapWatch, N as udsChildLogToWorkerEntry, Nt as startRunnerHeapWatch, O as HUB_CAP_FWD_SERVICE, Ot as RUNNER_HEAP_WATCH_INTERVAL_MS, P as createUdsLogger, Pt as strandedMb, Q as buildNativeCapProxy, R as UDS_NO_ROUTE_PREFIX, S as brokerCallForCap, St as runNpm, T as ipcParentLink, Tt as HEAP_RECLAIM_TRIGGER_MB, U as classifyCapRoute, V as CapRouteResolver, W as callWithServiceDiscovery, X as FrameDecoder, Y as localEndpointPath, Z as encodeFrame, _ as createKernelHwAccel, _t as CapabilityUnavailableError, a as getWorkerDeviceRegistry, at as createAddonService, b as __resetCapUsageRegistryForTests, bt as resolveAddonClass, c as setHubConnected, ct as capActionName, d as getBrokerEventBus, dt as capServiceName, et as createBrokerDeviceManagerApi, f as getMoleculerEventStats, ft as parseCapAction, g as AddonDepsManager, gt as CapabilityHandle, h as subscribePassthrough, ht as DeviceRegistry, i as createUdsAddonContext, j as createUdsEventBridge, jt as shouldReclaim, k as createHubCapForwardService, kt as buildHeapSample, l as EVENT_TOPIC_PREFIX, lt as capActionSuffix, m as setNodeEventInterest, mt as serializeTypedArrays, n as adaptBrokerToCluster, o as getOrInitReadinessRegistry, ot as validateProviderRegistrations, p as registerEventBusService, pt as deserializeTypedArrays, q as UdsLocalTransportServer, r as createAddonContext, rt as mountNativeCapService, s as getOrInitReadinessRegistryForClient, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestPythonDeps, u as clusterEventTopic, ut as capBareAction, v as resolveHwAccel, vt as copyBundledNativeModules, w as buildLinkChain, wt as HEAP_RECLAIM_MIN_INTERVAL_MS, x as getCapUsageRegistry, xt as resolveNpmInvocation, y as CapUsageRegistry, yt as installManifestNativeDeps, z as AGENT_CAP_FWD_ACTION } from "./manifest-python-deps-Dxifi-o0.mjs";
|
|
29
29
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-BWmQ5i-o.mjs";
|
|
30
30
|
import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
|
|
31
31
|
import { z } from "zod";
|
|
@@ -6403,11 +6403,31 @@ function methodsFor(def) {
|
|
|
6403
6403
|
schema: m,
|
|
6404
6404
|
isVoid: isVoidInput(m.input),
|
|
6405
6405
|
isObject: isObjectInput(m.input),
|
|
6406
|
-
callerRequired: m.caller === "required"
|
|
6406
|
+
callerRequired: m.caller === "required",
|
|
6407
|
+
isArrayOutput: m.kind !== "subscription" && isArrayOutputSchema(m.output)
|
|
6407
6408
|
};
|
|
6408
6409
|
});
|
|
6409
6410
|
}
|
|
6410
6411
|
/**
|
|
6412
|
+
* Invoke `method.name` on a resolved provider, raising the canonical
|
|
6413
|
+
* "method not found" error (Task 7.5d) when the provider does not implement
|
|
6414
|
+
* it — the naive `provider[method.name]?.(payload)` optional call let a
|
|
6415
|
+
* missing method answer `undefined` (200 to the caller). EXCEPTION, mirrored
|
|
6416
|
+
* from `child-cap-dispatch.ts`'s `isCollectionListMethod` graceful skip: a
|
|
6417
|
+
* COLLECTION cap's array-output method degrades to `[]` — the hub fans that
|
|
6418
|
+
* method across every registered provider
|
|
6419
|
+
* (`resolveCollectionProvider`/`concatArrayMethod`), so ONE provider not
|
|
6420
|
+
* implementing it is a graceful skip, not an error. Every other missing
|
|
6421
|
+
* method (singleton, device-native, or a collection's SCALAR method) is a
|
|
6422
|
+
* real implementation gap and fails loud.
|
|
6423
|
+
*/
|
|
6424
|
+
function invokeCapMethod(provider, method, payload, capName, isCollection, services) {
|
|
6425
|
+
const fn = provider[method.name];
|
|
6426
|
+
if (typeof fn === "function") return fn(payload);
|
|
6427
|
+
if (isCollection && method.isArrayOutput) return [];
|
|
6428
|
+
return (services.methodNotFound ?? ((cap, m) => services.badRequest(`Capability "${cap}" has no method "${m}"`)))(capName, method.name);
|
|
6429
|
+
}
|
|
6430
|
+
/**
|
|
6411
6431
|
* Extract the authenticated caller identity from the (structurally
|
|
6412
6432
|
* unknown) tRPC context. The builder cannot import the server's
|
|
6413
6433
|
* `TrpcContext`, so the read is narrowing-based: `ctx.user.id` (string)
|
|
@@ -6527,37 +6547,29 @@ function buildOneCapRouter(def, primitives, services) {
|
|
|
6527
6547
|
}).optional() : z.object({ nodeId: z.string().optional() }).optional();
|
|
6528
6548
|
procedures[method.name] = base.input(voidSelector)[procKind](({ input, ctx }) => {
|
|
6529
6549
|
const sel = input ?? {};
|
|
6530
|
-
return (nodeIdData ? requireLocal(capName, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services) : resolveProviderForCall(capName, sel.nodeId, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services, isCollection ? sel.addonId : void 0)
|
|
6550
|
+
return invokeCapMethod(nodeIdData ? requireLocal(capName, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services) : resolveProviderForCall(capName, sel.nodeId, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services, isCollection ? sel.addonId : void 0), method, void 0, capName, isCollection, services);
|
|
6531
6551
|
});
|
|
6532
6552
|
continue;
|
|
6533
6553
|
}
|
|
6534
6554
|
if (method.isObject) {
|
|
6535
6555
|
const schema = nodeIdData ? inputSchema : looseSchema(inputSchema);
|
|
6536
6556
|
procedures[method.name] = base.input(schema)[procKind](({ input, ctx }) => {
|
|
6537
|
-
if (nodeIdData)
|
|
6538
|
-
const provider = requireLocal(capName, () => getLocal(ctx), services);
|
|
6539
|
-
const payload = method.callerRequired ? injectCaller(stripKeys(input, []).rest, ctx, capName, method.name, services) : input;
|
|
6540
|
-
return provider[method.name]?.(payload);
|
|
6541
|
-
}
|
|
6557
|
+
if (nodeIdData) return invokeCapMethod(requireLocal(capName, () => getLocal(ctx), services), method, method.callerRequired ? injectCaller(stripKeys(input, []).rest, ctx, capName, method.name, services) : input, capName, isCollection, services);
|
|
6542
6558
|
if (isCollection) {
|
|
6543
6559
|
const { rest, picked } = stripKeys(input, ["nodeId", "addonId"]);
|
|
6544
6560
|
const nodeId = typeof picked.nodeId === "string" ? picked.nodeId : void 0;
|
|
6545
6561
|
const topLevelAddonId = typeof picked.addonId === "string" ? picked.addonId : void 0;
|
|
6546
6562
|
const canRecoverNestedAddonId = !isArrayOutputSchema(method.schema.output) && !objectInputDeclaresAddonId(method.schema.input);
|
|
6547
6563
|
const addonId = topLevelAddonId ?? (canRecoverNestedAddonId ? extractNestedAddonId(rest) : void 0);
|
|
6548
|
-
|
|
6549
|
-
const payload = method.callerRequired ? injectCaller(rest, ctx, capName, method.name, services) : rest;
|
|
6550
|
-
return provider[method.name]?.(payload);
|
|
6564
|
+
return invokeCapMethod(resolveProviderForCall(capName, nodeId, () => getLocal(ctx, addonId), services, topLevelAddonId), method, method.callerRequired ? injectCaller(rest, ctx, capName, method.name, services) : rest, capName, isCollection, services);
|
|
6551
6565
|
}
|
|
6552
6566
|
const { rest, picked } = stripKeys(input, ["nodeId"]);
|
|
6553
|
-
|
|
6554
|
-
const payload = method.callerRequired ? injectCaller(rest, ctx, capName, method.name, services) : rest;
|
|
6555
|
-
return provider[method.name]?.(payload);
|
|
6567
|
+
return invokeCapMethod(resolveProviderForCall(capName, typeof picked.nodeId === "string" ? picked.nodeId : void 0, () => getLocal(ctx), services), method, method.callerRequired ? injectCaller(rest, ctx, capName, method.name, services) : rest, capName, isCollection, services);
|
|
6556
6568
|
});
|
|
6557
6569
|
continue;
|
|
6558
6570
|
}
|
|
6559
6571
|
procedures[method.name] = base.input(inputSchema)[procKind](({ input, ctx }) => {
|
|
6560
|
-
return requireLocal(capName, () => getLocal(ctx), services)
|
|
6572
|
+
return invokeCapMethod(requireLocal(capName, () => getLocal(ctx), services), method, input, capName, isCollection, services);
|
|
6561
6573
|
});
|
|
6562
6574
|
}
|
|
6563
6575
|
return primitives.router(procedures);
|
|
@@ -95101,4 +95113,4 @@ var LifecycleJobEngine = class {
|
|
|
95101
95113
|
}
|
|
95102
95114
|
};
|
|
95103
95115
|
//#endregion
|
|
95104
|
-
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LokiDestination, LokiLoggingAddon, MAX_LEAF_VALIDITY_DAYS, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, __resetCapUsageRegistryForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createDoorSettingsView, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, detectWorkspacePackagesDir, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatLogLine, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, installManifestNativeDeps, installManifestPythonDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements,
|
|
95116
|
+
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LokiDestination, LokiLoggingAddon, MAX_LEAF_VALIDITY_DAYS, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, __resetCapUsageRegistryForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createDoorSettingsView, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, detectWorkspacePackagesDir, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatLogLine, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, installManifestNativeDeps, installManifestPythonDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, parseCapAction, parseRangeHeader, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readLanHttpState, readPendingRestart, readTlsAccessStatus, readTlsMode, readinessKey, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runHubAddonBoot, runNpm, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
|
@@ -91,6 +91,19 @@ export interface CapRouterServices {
|
|
|
91
91
|
* fallthrough rather than crashing.
|
|
92
92
|
*/
|
|
93
93
|
readonly rejectUnresolvedAddonPin?: (capName: string, addonId: string) => void;
|
|
94
|
+
/**
|
|
95
|
+
* Raise the canonical error for a resolved provider that does NOT
|
|
96
|
+
* implement `method` (Task 7.5d). Before this existed the router called
|
|
97
|
+
* `provider[method.name]?.(payload)` — an optional call that let a missing
|
|
98
|
+
* method answer `undefined`, which tRPC serializes as a 200. The UDS child
|
|
99
|
+
* dispatcher (`child-cap-dispatch.ts`) hits the SAME condition (a provider
|
|
100
|
+
* missing a method) and THROWS; two authorities disagreeing about the same
|
|
101
|
+
* defect is worse than either alone, and the hub's silence is the one a
|
|
102
|
+
* caller cannot detect. OPTIONAL for framework-live-update version skew: an
|
|
103
|
+
* older server hands a services object without it; the builder falls back
|
|
104
|
+
* to `badRequest` so the call still fails closed instead of answering 200.
|
|
105
|
+
*/
|
|
106
|
+
readonly methodNotFound?: (capName: string, method: string) => never;
|
|
94
107
|
}
|
|
95
108
|
/**
|
|
96
109
|
* Build a single capability's router (the runtime equivalent of one
|
package/dist/kernel/index.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ export type { HubServiceDeps } from './moleculer/hub-service.js';
|
|
|
65
65
|
export { createBrokerDeviceManagerApi, buildNativeCapProxy, buildUdsNativeCapProxy, mountNativeCapService, NATIVE_PROVIDER_SERVICE_INFIX, } from './moleculer/device-cap-proxy.js';
|
|
66
66
|
export type { WorkerDeviceManagerOptions } from './moleculer/device-cap-proxy.js';
|
|
67
67
|
export { getWorkerDeviceRegistry } from './moleculer/addon-context-factory.js';
|
|
68
|
-
export { localProviderLink, brokerTransportLink,
|
|
68
|
+
export { localProviderLink, brokerTransportLink, ipcParentLink, buildLinkChain, brokerCallForCap, } from './moleculer/trpc-links.js';
|
|
69
69
|
export type { LocalProviderResolver, BrokerCapCallOpts } from './moleculer/trpc-links.js';
|
|
70
70
|
export { createProcessService } from './moleculer/process-service.js';
|
|
71
71
|
export type { ProcessInfo } from './moleculer/process-service.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TRPCLink } from '@trpc/client';
|
|
2
2
|
import { AnyRouter } from '@trpc/server';
|
|
3
3
|
import { ServiceBroker } from 'moleculer';
|
|
4
|
-
import { CapCallInput
|
|
4
|
+
import { CapCallInput } from '../transport/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Resolver for in-process capability providers.
|
|
7
7
|
*
|
|
@@ -171,17 +171,6 @@ export interface BrokerTransportLinkOptions {
|
|
|
171
171
|
readonly discoveryTimeoutMs?: number;
|
|
172
172
|
}
|
|
173
173
|
export declare function brokerTransportLink<TRouter extends AnyRouter>(broker: ServiceBroker, serviceMap?: Readonly<Record<string, string>>, observerOpts?: CapUsageObserverOptions, linkOptions?: BrokerTransportLinkOptions): TRPCLink<TRouter>;
|
|
174
|
-
/**
|
|
175
|
-
* Middle link that routes a cap op to a LOCAL addon-runner over UDS via the
|
|
176
|
-
* `LocalChildRegistry`. If no local child owns `(capName, deviceId?)`, the op
|
|
177
|
-
* passes through to `next(op)` (e.g. `brokerTransportLink` for remote agents),
|
|
178
|
-
* so this link is transparent for everything it does not own.
|
|
179
|
-
*
|
|
180
|
-
* `deviceId` for device-scoped caps is read from `op.input` (the same place
|
|
181
|
-
* the codegen'd device-scoped routers carry it); the full `op.input` is
|
|
182
|
-
* forwarded as the child method's argument.
|
|
183
|
-
*/
|
|
184
|
-
export declare function ipcChildLink<TRouter extends AnyRouter>(registry: LocalChildRegistry): TRPCLink<TRouter>;
|
|
185
174
|
/**
|
|
186
175
|
* Middle link that routes a child addon's outbound `ctx.api` cap call to the
|
|
187
176
|
* parent hub over UDS via `callOut` (obtained at call-time so the child can
|
|
@@ -114,6 +114,19 @@ export interface AgentCapForwardParams {
|
|
|
114
114
|
*/
|
|
115
115
|
readonly childId?: string;
|
|
116
116
|
readonly deviceId?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Out-of-band PROVIDER-selection hint — the twin of `CapCallMessage.addonId`
|
|
119
|
+
* (Task 7.5a). A GROUPED runner (`execution.group`) on an AGENT can host two
|
|
120
|
+
* co-located addons registering the SAME collection cap, exactly like the
|
|
121
|
+
* hub-local-uds case (`LocalChildRegistry.toCapCall`'s `addonId`, threaded by
|
|
122
|
+
* `buildCapCallFn`'s hub-local branch). Before this field existed, the hub had
|
|
123
|
+
* no channel to carry the selector across the hub→agent envelope — grouped-
|
|
124
|
+
* runner provider selection worked on the hub and silently fell back to
|
|
125
|
+
* "whichever provider is first" on an agent. Absent → the agent dispatch falls
|
|
126
|
+
* back to its sole provider for the cap (same fallback `child-cap-dispatch.ts`
|
|
127
|
+
* already has for a call that never carried the hint).
|
|
128
|
+
*/
|
|
129
|
+
readonly addonId?: string;
|
|
117
130
|
}
|
|
118
131
|
/** The Moleculer service name that Task 6's agent registers. */
|
|
119
132
|
export declare const AGENT_CAP_FWD_SERVICE: "$agent-cap-fwd";
|
|
@@ -170,7 +183,18 @@ export declare class CapRouteResolver {
|
|
|
170
183
|
* caller then falls through to its remote-resolution branch.
|
|
171
184
|
*/
|
|
172
185
|
resolveHubLocalUdsRoute(capName: string, deviceId?: number): HubLocalUdsRoute | null;
|
|
173
|
-
|
|
186
|
+
/**
|
|
187
|
+
* @param addonId Optional out-of-band PROVIDER-selection hint (Task 7.5a):
|
|
188
|
+
* the addonId of the provider the CALLER already resolved (e.g.
|
|
189
|
+
* `buildCapCallFn`'s `deps.addonId` for a registered grouped-runner
|
|
190
|
+
* provider). Only meaningful for `agent-child-forward` — a `remote-moleculer`
|
|
191
|
+
* route already encodes the provider in its action name
|
|
192
|
+
* (`${addonId}.${cap}.${method}`, via `NodeCapAuthority.getAddonId`), and a
|
|
193
|
+
* `hub-local-uds` caller that already knows the addonId (`buildCapCallFn`)
|
|
194
|
+
* talks to `LocalChildRegistry.callCapOnChild` directly rather than through
|
|
195
|
+
* `dispatch`.
|
|
196
|
+
*/
|
|
197
|
+
dispatch(route: CapRoute, method: string, args: unknown, addonId?: string): Promise<unknown>;
|
|
174
198
|
/**
|
|
175
199
|
* Inner dispatch: may throw CapRouteError (validation failures) or arbitrary
|
|
176
200
|
* transport errors. The outer `dispatch` wraps non-CapRouteErrors.
|
|
@@ -4796,9 +4796,20 @@ var CapRouteResolver = class {
|
|
|
4796
4796
|
childId
|
|
4797
4797
|
};
|
|
4798
4798
|
}
|
|
4799
|
-
|
|
4799
|
+
/**
|
|
4800
|
+
* @param addonId Optional out-of-band PROVIDER-selection hint (Task 7.5a):
|
|
4801
|
+
* the addonId of the provider the CALLER already resolved (e.g.
|
|
4802
|
+
* `buildCapCallFn`'s `deps.addonId` for a registered grouped-runner
|
|
4803
|
+
* provider). Only meaningful for `agent-child-forward` — a `remote-moleculer`
|
|
4804
|
+
* route already encodes the provider in its action name
|
|
4805
|
+
* (`${addonId}.${cap}.${method}`, via `NodeCapAuthority.getAddonId`), and a
|
|
4806
|
+
* `hub-local-uds` caller that already knows the addonId (`buildCapCallFn`)
|
|
4807
|
+
* talks to `LocalChildRegistry.callCapOnChild` directly rather than through
|
|
4808
|
+
* `dispatch`.
|
|
4809
|
+
*/
|
|
4810
|
+
async dispatch(route, method, args, addonId) {
|
|
4800
4811
|
try {
|
|
4801
|
-
return await this.dispatchInner(route, method, args);
|
|
4812
|
+
return await this.dispatchInner(route, method, args, addonId);
|
|
4802
4813
|
} catch (err) {
|
|
4803
4814
|
if (err instanceof CapRouteError) throw err;
|
|
4804
4815
|
const nodeId = this.routeNodeId(route);
|
|
@@ -4817,7 +4828,7 @@ var CapRouteResolver = class {
|
|
|
4817
4828
|
* Inner dispatch: may throw CapRouteError (validation failures) or arbitrary
|
|
4818
4829
|
* transport errors. The outer `dispatch` wraps non-CapRouteErrors.
|
|
4819
4830
|
*/
|
|
4820
|
-
async dispatchInner(route, method, args) {
|
|
4831
|
+
async dispatchInner(route, method, args, addonId) {
|
|
4821
4832
|
switch (route.kind) {
|
|
4822
4833
|
case "hub-in-process": return route.ref.invoke(method, args);
|
|
4823
4834
|
case "hub-local-uds": {
|
|
@@ -4863,7 +4874,8 @@ var CapRouteResolver = class {
|
|
|
4863
4874
|
method,
|
|
4864
4875
|
args,
|
|
4865
4876
|
...route.childId !== void 0 ? { childId: route.childId } : {},
|
|
4866
|
-
...deviceId !== void 0 ? { deviceId } : {}
|
|
4877
|
+
...deviceId !== void 0 ? { deviceId } : {},
|
|
4878
|
+
...addonId !== void 0 ? { addonId } : {}
|
|
4867
4879
|
};
|
|
4868
4880
|
return callWithServiceDiscovery(this.broker, AGENT_CAP_FWD_SERVICE, AGENT_CAP_FWD_ACTION, params, {
|
|
4869
4881
|
nodeID: route.agentNodeId,
|
|
@@ -6448,45 +6460,6 @@ function brokerTransportLink(broker, serviceMap, observerOpts, linkOptions) {
|
|
|
6448
6460
|
};
|
|
6449
6461
|
}
|
|
6450
6462
|
/**
|
|
6451
|
-
* Middle link that routes a cap op to a LOCAL addon-runner over UDS via the
|
|
6452
|
-
* `LocalChildRegistry`. If no local child owns `(capName, deviceId?)`, the op
|
|
6453
|
-
* passes through to `next(op)` (e.g. `brokerTransportLink` for remote agents),
|
|
6454
|
-
* so this link is transparent for everything it does not own.
|
|
6455
|
-
*
|
|
6456
|
-
* `deviceId` for device-scoped caps is read from `op.input` (the same place
|
|
6457
|
-
* the codegen'd device-scoped routers carry it); the full `op.input` is
|
|
6458
|
-
* forwarded as the child method's argument.
|
|
6459
|
-
*/
|
|
6460
|
-
function ipcChildLink(registry) {
|
|
6461
|
-
return () => {
|
|
6462
|
-
return ({ op, next }) => {
|
|
6463
|
-
const parsed = parsePath(op.path);
|
|
6464
|
-
if (!parsed) return next(op);
|
|
6465
|
-
const input = op.input;
|
|
6466
|
-
const inputObj = input && typeof input === "object" && !Array.isArray(input) ? input : null;
|
|
6467
|
-
const deviceId = inputObj && typeof inputObj.deviceId === "number" ? inputObj.deviceId : void 0;
|
|
6468
|
-
if (registry.resolveChildId(parsed.capName, deviceId) === null) return next(op);
|
|
6469
|
-
return observable((observer) => {
|
|
6470
|
-
registry.callCap({
|
|
6471
|
-
capName: parsed.capName,
|
|
6472
|
-
method: parsed.method,
|
|
6473
|
-
args: op.input,
|
|
6474
|
-
deviceId
|
|
6475
|
-
}).then((data) => {
|
|
6476
|
-
observer.next({ result: {
|
|
6477
|
-
type: "data",
|
|
6478
|
-
data
|
|
6479
|
-
} });
|
|
6480
|
-
observer.complete();
|
|
6481
|
-
}).catch((cause) => {
|
|
6482
|
-
observer.error(_trpc_client.TRPCClientError.from(cause instanceof Error ? cause : new Error(String(cause))));
|
|
6483
|
-
});
|
|
6484
|
-
return () => {};
|
|
6485
|
-
});
|
|
6486
|
-
};
|
|
6487
|
-
};
|
|
6488
|
-
}
|
|
6489
|
-
/**
|
|
6490
6463
|
* Middle link that routes a child addon's outbound `ctx.api` cap call to the
|
|
6491
6464
|
* parent hub over UDS via `callOut` (obtained at call-time so the child can
|
|
6492
6465
|
* reconnect without rebuilding its tRPC client).
|
|
@@ -8581,12 +8554,6 @@ Object.defineProperty(exports, "installManifestPythonDeps", {
|
|
|
8581
8554
|
return installManifestPythonDeps;
|
|
8582
8555
|
}
|
|
8583
8556
|
});
|
|
8584
|
-
Object.defineProperty(exports, "ipcChildLink", {
|
|
8585
|
-
enumerable: true,
|
|
8586
|
-
get: function() {
|
|
8587
|
-
return ipcChildLink;
|
|
8588
|
-
}
|
|
8589
|
-
});
|
|
8590
8557
|
Object.defineProperty(exports, "ipcParentLink", {
|
|
8591
8558
|
enumerable: true,
|
|
8592
8559
|
get: function() {
|