@camstack/system 1.2.255 → 1.2.257
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/autotrack/autotrack-cameras.d.ts +31 -5
- package/dist/builtins/autotrack/index.js +40 -3
- package/dist/builtins/autotrack/index.mjs +40 -3
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -2
- package/dist/kernel/index.d.ts +1 -1
- package/dist/kernel/moleculer/trpc-links.d.ts +27 -0
- package/dist/{manifest-system-deps-CfR7Z90J.mjs → manifest-system-deps-BXf-Ouqx.mjs} +44 -1
- package/dist/{manifest-system-deps-CzyjTMcO.js → manifest-system-deps-CfVyUKLU.js} +49 -0
- package/package.json +2 -2
package/dist/addon-runner.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_manifest_system_deps = require("./manifest-system-deps-
|
|
2
|
+
const require_manifest_system_deps = require("./manifest-system-deps-CfVyUKLU.js");
|
|
3
3
|
const require_custom_action_registry = require("./custom-action-registry-acBY3mHA.js");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_chunk.__toESM(node_path);
|
package/dist/addon-runner.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Lt as RUNNER_RSS_BUDGET_ENV, R as LocalChildClient, Xt as startRunnerHeapWatch, a as createUdsAddonContext, at as setWorkerNativeCapsChangeListener, bt as installManifestNativeDeps, cn as emitHeapDiagnosticReport, j as createUdsLoggerWithControl, n as installManifestPythonDeps, nt as getWorkerNativeCapProvider, rt as getWorkerNativeCapSnapshot, st as validateProviderRegistrations, t as installManifestSystemDeps, xt as resolveAddonClass } from "./manifest-system-deps-BXf-Ouqx.mjs";
|
|
2
2
|
import { t as CustomActionRegistry } from "./custom-action-registry-B4Cf4O_X.mjs";
|
|
3
3
|
import { register } from "node:module";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -1,9 +1,33 @@
|
|
|
1
1
|
import { FirstLevelMacroClass, PtzAutotrackSettings, PtzAutotrackStatus } from '@camstack/types';
|
|
2
2
|
import { AutotrackLoopConfig } from './autotrack-config.js';
|
|
3
|
+
/**
|
|
4
|
+
* How much of the frame the subject SHOULD occupy, and nothing else about zoom.
|
|
5
|
+
*
|
|
6
|
+
* Hidden on purpose (operator, 2026-09-18: *"rendiamo lo zoom configurabile,
|
|
7
|
+
* nascosto per ora, ci lavoriamo poi quando ne vedo il bisogno"*). It is not in
|
|
8
|
+
* `PtzAutotrackSettings` — that schema is the cross-vendor surface the device
|
|
9
|
+
* page renders, and putting it there would SHOW a control nothing implements.
|
|
10
|
+
* It lives in this addon's own record instead: settable, persisted, invisible.
|
|
11
|
+
*
|
|
12
|
+
* `null` means the loop does not touch zoom at all, which is what every camera
|
|
13
|
+
* gets until somebody decides otherwise.
|
|
14
|
+
*/
|
|
15
|
+
export interface AutotrackZoomSetting {
|
|
16
|
+
/**
|
|
17
|
+
* Target share of the frame for the tracked subject's box, `0..1`.
|
|
18
|
+
*
|
|
19
|
+
* The operator's original ask was "keep the target at about 50% of frame",
|
|
20
|
+
* so 0.5 is the number this exists to hold. It is a FRACTION OF AREA on the
|
|
21
|
+
* frame the loop measures in, not a zoom level: the loop is declaredly
|
|
22
|
+
* visual and never learns where the optics are (D520).
|
|
23
|
+
*/
|
|
24
|
+
readonly targetSubjectFraction: number | null;
|
|
25
|
+
}
|
|
3
26
|
/** One camera's record. */
|
|
4
27
|
export interface AutotrackCameraRecord {
|
|
5
28
|
readonly enabled: boolean;
|
|
6
29
|
readonly settings: PtzAutotrackSettings;
|
|
30
|
+
readonly zoom: AutotrackZoomSetting;
|
|
7
31
|
}
|
|
8
32
|
/** deviceId → record. */
|
|
9
33
|
export type AutotrackCameraRecords = Readonly<Record<number, AutotrackCameraRecord>>;
|
|
@@ -25,18 +49,20 @@ export declare const DEFAULT_CAMERA_RECORD: AutotrackCameraRecord;
|
|
|
25
49
|
*/
|
|
26
50
|
export declare const EMULATED_TARGET_OPTIONS: PtzAutotrackStatus['supportedTargetTypes'];
|
|
27
51
|
/**
|
|
28
|
-
*
|
|
52
|
+
* Why this camera's zoom request is not being honoured, or `null` when it asked
|
|
53
|
+
* for nothing.
|
|
29
54
|
*
|
|
30
|
-
* A
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* the blob at all is simply a camera nobody has switched on.
|
|
55
|
+
* A setting that is read and ignored in silence is indistinguishable from a
|
|
56
|
+
* broken one, and this one WILL be read by a loop that cannot act on it yet.
|
|
57
|
+
* So asking for it produces a sentence naming the number and what is missing.
|
|
34
58
|
*/
|
|
59
|
+
export declare function zoomRefusalFor(record: AutotrackCameraRecord): string | null;
|
|
35
60
|
export declare function parseCameraRecords(raw: unknown): AutotrackCameraRecords;
|
|
36
61
|
/** Immutable per-camera patch — a NEW map, the previous one untouched. */
|
|
37
62
|
export declare function withCameraPatch(records: AutotrackCameraRecords, deviceId: number, patch: {
|
|
38
63
|
enabled?: boolean;
|
|
39
64
|
settings?: Partial<PtzAutotrackSettings>;
|
|
65
|
+
zoom?: Partial<AutotrackZoomSetting>;
|
|
40
66
|
}): AutotrackCameraRecords;
|
|
41
67
|
/**
|
|
42
68
|
* The detection macro class this camera follows.
|
|
@@ -52,7 +52,8 @@ var DEFAULT_CAMERA_RECORD = {
|
|
|
52
52
|
targetType: "",
|
|
53
53
|
stopDelaySeconds: 30,
|
|
54
54
|
disappearDelaySeconds: DEFAULT_AUTOTRACK_LOOP_CONFIG.disappearDelayMs / 1e3
|
|
55
|
-
}
|
|
55
|
+
},
|
|
56
|
+
zoom: { targetSubjectFraction: null }
|
|
56
57
|
};
|
|
57
58
|
/**
|
|
58
59
|
* What this implementation can follow, as the cap's target options.
|
|
@@ -88,6 +89,32 @@ function parseSettings(raw) {
|
|
|
88
89
|
* which is the one direction this must not fail in; a camera that is not in
|
|
89
90
|
* the blob at all is simply a camera nobody has switched on.
|
|
90
91
|
*/
|
|
92
|
+
/**
|
|
93
|
+
* Read the hidden zoom setting.
|
|
94
|
+
*
|
|
95
|
+
* Out-of-range is CLAMPED into the unit interval rather than carried: a control
|
|
96
|
+
* loop that eventually reads this must never be handed a 4, and a silently
|
|
97
|
+
* dropped value would look like "the operator never set it".
|
|
98
|
+
*/
|
|
99
|
+
function parseZoom(raw) {
|
|
100
|
+
if (!isRecordObject(raw)) return { targetSubjectFraction: null };
|
|
101
|
+
const value = raw["targetSubjectFraction"];
|
|
102
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return { targetSubjectFraction: null };
|
|
103
|
+
return { targetSubjectFraction: Math.min(1, value) };
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Why this camera's zoom request is not being honoured, or `null` when it asked
|
|
107
|
+
* for nothing.
|
|
108
|
+
*
|
|
109
|
+
* A setting that is read and ignored in silence is indistinguishable from a
|
|
110
|
+
* broken one, and this one WILL be read by a loop that cannot act on it yet.
|
|
111
|
+
* So asking for it produces a sentence naming the number and what is missing.
|
|
112
|
+
*/
|
|
113
|
+
function zoomRefusalFor(record) {
|
|
114
|
+
const target = record.zoom.targetSubjectFraction;
|
|
115
|
+
if (target === null) return null;
|
|
116
|
+
return `autotrack zoom is configured (target subject fraction ${String(target)}) but NOT IMPLEMENTED: the loop drives pan and tilt only. Subject-size control needs a third axis with its own dead band, a rule that it may act only while pan/tilt are settled, and the two D520 measurements first — a stale error costs more the further the optics are zoomed in.`;
|
|
117
|
+
}
|
|
91
118
|
function parseCameraRecords(raw) {
|
|
92
119
|
if (!isRecordObject(raw)) return {};
|
|
93
120
|
const out = {};
|
|
@@ -97,7 +124,8 @@ function parseCameraRecords(raw) {
|
|
|
97
124
|
if (!isRecordObject(value)) continue;
|
|
98
125
|
out[deviceId] = {
|
|
99
126
|
enabled: value["enabled"] === true,
|
|
100
|
-
settings: parseSettings(value["settings"])
|
|
127
|
+
settings: parseSettings(value["settings"]),
|
|
128
|
+
zoom: parseZoom(value["zoom"])
|
|
101
129
|
};
|
|
102
130
|
}
|
|
103
131
|
return out;
|
|
@@ -112,6 +140,10 @@ function withCameraPatch(records, deviceId, patch) {
|
|
|
112
140
|
settings: {
|
|
113
141
|
...current.settings,
|
|
114
142
|
...patch.settings
|
|
143
|
+
},
|
|
144
|
+
zoom: {
|
|
145
|
+
...current.zoom,
|
|
146
|
+
...patch.zoom
|
|
115
147
|
}
|
|
116
148
|
}
|
|
117
149
|
};
|
|
@@ -816,7 +848,7 @@ var AutotrackAddon = class extends require_dist.BaseAddon {
|
|
|
816
848
|
this.records = withCameraPatch(this.records, deviceId, patch);
|
|
817
849
|
if (before !== this.recordOf(deviceId).enabled) this.lastChangedAt.set(deviceId, Date.now());
|
|
818
850
|
await this.updateGlobalSettings({ cameras: this.serialiseRecords() });
|
|
819
|
-
await this.
|
|
851
|
+
await this.refreshEverything();
|
|
820
852
|
}
|
|
821
853
|
serialiseRecords() {
|
|
822
854
|
const out = {};
|
|
@@ -921,6 +953,11 @@ var AutotrackAddon = class extends require_dist.BaseAddon {
|
|
|
921
953
|
}
|
|
922
954
|
});
|
|
923
955
|
this.ctx.logger.warn("autotrack ON: this camera must not be driven by anyone else", { tags: { deviceId } });
|
|
956
|
+
const zoomRefusal = zoomRefusalFor(record);
|
|
957
|
+
if (zoomRefusal !== null) this.ctx.logger.warn(zoomRefusal, {
|
|
958
|
+
tags: { deviceId },
|
|
959
|
+
meta: { targetSubjectFraction: record.zoom.targetSubjectFraction }
|
|
960
|
+
});
|
|
924
961
|
}
|
|
925
962
|
stopSession(deviceId, reason) {
|
|
926
963
|
const session = this.sessions.get(deviceId);
|
|
@@ -47,7 +47,8 @@ var DEFAULT_CAMERA_RECORD = {
|
|
|
47
47
|
targetType: "",
|
|
48
48
|
stopDelaySeconds: 30,
|
|
49
49
|
disappearDelaySeconds: DEFAULT_AUTOTRACK_LOOP_CONFIG.disappearDelayMs / 1e3
|
|
50
|
-
}
|
|
50
|
+
},
|
|
51
|
+
zoom: { targetSubjectFraction: null }
|
|
51
52
|
};
|
|
52
53
|
/**
|
|
53
54
|
* What this implementation can follow, as the cap's target options.
|
|
@@ -83,6 +84,32 @@ function parseSettings(raw) {
|
|
|
83
84
|
* which is the one direction this must not fail in; a camera that is not in
|
|
84
85
|
* the blob at all is simply a camera nobody has switched on.
|
|
85
86
|
*/
|
|
87
|
+
/**
|
|
88
|
+
* Read the hidden zoom setting.
|
|
89
|
+
*
|
|
90
|
+
* Out-of-range is CLAMPED into the unit interval rather than carried: a control
|
|
91
|
+
* loop that eventually reads this must never be handed a 4, and a silently
|
|
92
|
+
* dropped value would look like "the operator never set it".
|
|
93
|
+
*/
|
|
94
|
+
function parseZoom(raw) {
|
|
95
|
+
if (!isRecordObject(raw)) return { targetSubjectFraction: null };
|
|
96
|
+
const value = raw["targetSubjectFraction"];
|
|
97
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return { targetSubjectFraction: null };
|
|
98
|
+
return { targetSubjectFraction: Math.min(1, value) };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Why this camera's zoom request is not being honoured, or `null` when it asked
|
|
102
|
+
* for nothing.
|
|
103
|
+
*
|
|
104
|
+
* A setting that is read and ignored in silence is indistinguishable from a
|
|
105
|
+
* broken one, and this one WILL be read by a loop that cannot act on it yet.
|
|
106
|
+
* So asking for it produces a sentence naming the number and what is missing.
|
|
107
|
+
*/
|
|
108
|
+
function zoomRefusalFor(record) {
|
|
109
|
+
const target = record.zoom.targetSubjectFraction;
|
|
110
|
+
if (target === null) return null;
|
|
111
|
+
return `autotrack zoom is configured (target subject fraction ${String(target)}) but NOT IMPLEMENTED: the loop drives pan and tilt only. Subject-size control needs a third axis with its own dead band, a rule that it may act only while pan/tilt are settled, and the two D520 measurements first — a stale error costs more the further the optics are zoomed in.`;
|
|
112
|
+
}
|
|
86
113
|
function parseCameraRecords(raw) {
|
|
87
114
|
if (!isRecordObject(raw)) return {};
|
|
88
115
|
const out = {};
|
|
@@ -92,7 +119,8 @@ function parseCameraRecords(raw) {
|
|
|
92
119
|
if (!isRecordObject(value)) continue;
|
|
93
120
|
out[deviceId] = {
|
|
94
121
|
enabled: value["enabled"] === true,
|
|
95
|
-
settings: parseSettings(value["settings"])
|
|
122
|
+
settings: parseSettings(value["settings"]),
|
|
123
|
+
zoom: parseZoom(value["zoom"])
|
|
96
124
|
};
|
|
97
125
|
}
|
|
98
126
|
return out;
|
|
@@ -107,6 +135,10 @@ function withCameraPatch(records, deviceId, patch) {
|
|
|
107
135
|
settings: {
|
|
108
136
|
...current.settings,
|
|
109
137
|
...patch.settings
|
|
138
|
+
},
|
|
139
|
+
zoom: {
|
|
140
|
+
...current.zoom,
|
|
141
|
+
...patch.zoom
|
|
110
142
|
}
|
|
111
143
|
}
|
|
112
144
|
};
|
|
@@ -811,7 +843,7 @@ var AutotrackAddon = class extends BaseAddon {
|
|
|
811
843
|
this.records = withCameraPatch(this.records, deviceId, patch);
|
|
812
844
|
if (before !== this.recordOf(deviceId).enabled) this.lastChangedAt.set(deviceId, Date.now());
|
|
813
845
|
await this.updateGlobalSettings({ cameras: this.serialiseRecords() });
|
|
814
|
-
await this.
|
|
846
|
+
await this.refreshEverything();
|
|
815
847
|
}
|
|
816
848
|
serialiseRecords() {
|
|
817
849
|
const out = {};
|
|
@@ -916,6 +948,11 @@ var AutotrackAddon = class extends BaseAddon {
|
|
|
916
948
|
}
|
|
917
949
|
});
|
|
918
950
|
this.ctx.logger.warn("autotrack ON: this camera must not be driven by anyone else", { tags: { deviceId } });
|
|
951
|
+
const zoomRefusal = zoomRefusalFor(record);
|
|
952
|
+
if (zoomRefusal !== null) this.ctx.logger.warn(zoomRefusal, {
|
|
953
|
+
tags: { deviceId },
|
|
954
|
+
meta: { targetSubjectFraction: record.zoom.targetSubjectFraction }
|
|
955
|
+
});
|
|
919
956
|
}
|
|
920
957
|
stopSession(deviceId, reason) {
|
|
921
958
|
const session = this.sessions.get(deviceId);
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ require("./builtins/system-config/index.js");
|
|
|
27
27
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
28
28
|
const require_event_loop_stall_monitor = require("./event-loop-stall-monitor-CAsHdMwP.js");
|
|
29
29
|
const require_tls$1 = require("./tls-BFs4PzoW.js");
|
|
30
|
-
const require_manifest_system_deps = require("./manifest-system-deps-
|
|
30
|
+
const require_manifest_system_deps = require("./manifest-system-deps-CfVyUKLU.js");
|
|
31
31
|
const require_resource_monitor = require("./resource-monitor-LVE1BoLs.js");
|
|
32
32
|
const require_custom_action_registry = require("./custom-action-registry-acBY3mHA.js");
|
|
33
33
|
let zod = require("zod");
|
|
@@ -96058,6 +96058,7 @@ exports.deriveAgentListenPort = deriveAgentListenPort;
|
|
|
96058
96058
|
exports.describeProviderKindDrift = describeProviderKindDrift;
|
|
96059
96059
|
exports.describeRss = require_manifest_system_deps.describeRss;
|
|
96060
96060
|
exports.detectWorkspacePackagesDir = detectWorkspacePackagesDir;
|
|
96061
|
+
exports.deviceCapResolverLink = require_manifest_system_deps.deviceCapResolverLink;
|
|
96061
96062
|
exports.diffCapActionCensus = require_manifest_system_deps.diffCapActionCensus;
|
|
96062
96063
|
exports.diffEventPlane = require_manifest_system_deps.diffEventPlane;
|
|
96063
96064
|
exports.diffSocketPlane = require_manifest_system_deps.diffSocketPlane;
|
package/dist/index.mjs
CHANGED
|
@@ -26,7 +26,7 @@ import "./builtins/system-config/index.mjs";
|
|
|
26
26
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
27
27
|
import { _ as fetchJson, a as createFileDataPlaneHandler, c as parseRangeHeader, d as ModelDownloadService, f as collectModelFiles, g as ensureModel, h as downloadModel, i as startEventLoopStallMonitor, l as parseTokenizedUrl, m as downloadFile, n as STALL_TICK_MS, o as contentTypeFor, p as deleteModelFromDisk, r as attributeStall, s as createAuthenticatedFileServer, t as STALL_REPORT_MS, u as resolveFilePath, v as getModelFilePath, y as isModelDownloaded } from "./event-loop-stall-monitor-GPrVvx14.mjs";
|
|
28
28
|
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-2xbgg78V.mjs";
|
|
29
|
-
import { $ as
|
|
29
|
+
import { $ as buildNativeCapProxy, $t as ARRAY_BUFFER_CENSUS_SUSTAIN_MS, A as createUdsLogger, An as createSocketDirectionCounters, At as HEAP_WATCH_WARN_RATIO, B as UDS_NO_ROUTE_PREFIX, Bn as createCapActionCensus, Bt as createDeferredHeapWatchSink, C as deviceCapResolverLink, Cn as SOCKET_QUEUE_TOP_N, Ct as resolveNpmInvocation, D as createUdsEventBridge, Dn as formatSocketPlane, Dt as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, E as createParentUnownedCallHandler, En as diffSocketPlane, Et as HEAP_RECLAIM_MIN_INTERVAL_MS, F as callWithServiceDiscovery, Fn as CAP_ACTION_OVERFLOW_LABEL, Ft as RSS_BUDGET_RELEASE_RATIO, G as getCapUsageRegistry, Gn as diffEventPlane, Gt as nextRssBudgetState, H as CapUsageRegistry, Hn as EVENT_PLANE_TOP_N, Ht as createV8Reclaimer, I as CapRouteError, In as CAP_ACTION_UNLABELLED, It as RUNNER_HEAP_WATCH_INTERVAL_MS, J as UdsLocalTransportServer, Jt as shouldReclaim, K as createLocalTransport, Kn as formatEventPlane, Kt as parseRssBudgetMb, L as classifyCapRoute, Ln as EMPTY_CAP_ACTION_READING, Lt as RUNNER_RSS_BUDGET_ENV, M as AGENT_CAP_FWD_ACTION, Mn as sampleSocketDirection, Mt as HUB_MAIN_RSS_BUDGET_MB, N as AGENT_CAP_FWD_SERVICE, Nn as socketDirectionBytes, Nt as HUB_RSS_BUDGET_ENV, O as createUdsEventBus, On as readSocketQueues, Ot as HEAP_RECLAIM_TRIGGER_MB, P as CapRouteResolver, Pn as socketDirectionMessages, Pt as RSS_BUDGET_REANNOUNCE_MIN_MS, Q as encodeFrame, Qt as ARRAY_BUFFER_CENSUS_COOLDOWN_MS, R as LocalChildClient, Rn as MAX_CAP_ACTIONS_PER_PEER, Rt as ZERO_LOOP_DELAY, S as buildLinkChain, Sn as SOCKET_PLANE_TOP_N, St as buildNpmChildEnv, T as localProviderLink, Tn as createSocketPlaneReader, Tt as createAddonDataPlaneFacility, U as PARENT_ROUTED_PROVIDER_ADDON_ID, Un as createEventPlaneMeter, Ut as describeRss, V as readMoleculerFanoutMode, Vn as diffCapActionCensus, Vt as createLoopDelayMeter, W as __resetCapUsageRegistryForTests, Wn as createEventPlaneReader, Wt as hubMainRssBudget, X as localEndpointPath, Xt as startRunnerHeapWatch, Y as SocketChannel, Yt as startHeapWatch, Z as FrameDecoder, Zt as strandedMb, _ as AddonDepsManager, _n as formatOutboundQueueVerdict, _t as CapabilityHandle, a as createUdsAddonContext, an as isArrayBufferCensusReport, b as brokerCallForCap, bn as formatMeshQueue, bt as installManifestNativeDeps, c as getOrInitReadinessRegistryForClient, cn as emitHeapDiagnosticReport, ct as NATIVE_PROVIDER_SERVICE_INFIX, d as clusterEventTopic, dn as readHeapSpaces, dt as capBareAction, en as ARRAY_BUFFER_CENSUS_THRESHOLD_MB, et as buildUdsNativeCapProxy, f as getBrokerEventBus, fn as selectReportedSpaces, ft as capServiceName, g as subscribePassthrough, gn as createOutboundQueueGate, gt as DeviceRegistry, h as setNodeEventInterest, hn as OUTBOUND_QUEUE_THRESHOLD_BYTES, ht as serializeTypedArrays, i as createAddonContext, in as formatArrayBufferCensus, it as mountNativeCapService, j as createUdsLoggerWithControl, jn as recordSocketFrame, jt as HUB_MAIN_HEAP_WATCH_LABEL, k as udsChildLogToWorkerEntry, kn as EMPTY_SOCKET_DIRECTION, kt as HEAP_WATCH_INTERVAL_MS, l as setHubConnected, ln as formatHeapSpaces, lt as capActionName, m as registerEventBusService, mn as OUTBOUND_QUEUE_SUSTAIN_MS, mt as deserializeTypedArrays, n as installManifestPythonDeps, nn as createArrayBufferCensusGate, o as getWorkerDeviceRegistry, on as DECISIVE_HEAP_SPACES, ot as createAddonService, p as getMoleculerEventStats, pn as OUTBOUND_QUEUE_COOLDOWN_MS, pt as parseCapAction, q as UdsLocalTransportClient, qt as reclaimIntervalMs, r as adaptBrokerToCluster, rn as createInspectorArrayBufferCensus, s as getOrInitReadinessRegistry, sn as HEAP_SPACE_REPORT_MIN_MB, st as validateProviderRegistrations, t as installManifestSystemDeps, tn as ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, tt as createBrokerDeviceManagerApi, u as EVENT_TOPIC_PREFIX, un as heapSpaceField, ut as capActionSuffix, v as createKernelHwAccel, vn as MESH_QUEUE_TOP_N, vt as CapabilityUnavailableError, w as ipcParentLink, wn as createSocketPlaneMeter, wt as runNpm, x as brokerTransportLink, xn as EMPTY_SOCKET_PLANE_BASELINE, xt as resolveAddonClass, y as resolveHwAccel, yn as createMeshQueueReader, yt as copyBundledNativeModules, z as LocalChildRegistry, zn as capActionLabel, zt as buildHeapSample } from "./manifest-system-deps-BXf-Ouqx.mjs";
|
|
30
30
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Vp0bPV3U.mjs";
|
|
31
31
|
import { t as CustomActionRegistry } from "./custom-action-registry-B4Cf4O_X.mjs";
|
|
32
32
|
import { z } from "zod";
|
|
@@ -95810,4 +95810,4 @@ var LifecycleJobEngine = class {
|
|
|
95810
95810
|
}
|
|
95811
95811
|
};
|
|
95812
95812
|
//#endregion
|
|
95813
|
-
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, ARRAY_BUFFER_CENSUS_COOLDOWN_MS, ARRAY_BUFFER_CENSUS_SUSTAIN_MS, ARRAY_BUFFER_CENSUS_THRESHOLD_MB, ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, 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, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, 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_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LokiDestination, LokiLoggingAddon, MAX_CAP_ACTIONS_PER_PEER, MAX_LEAF_VALIDITY_DAYS, MESH_QUEUE_TOP_N, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PARENT_ROUTED_PROVIDER_ADDON_ID, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, 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, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, attributeStall, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createLocalTransport, createLoopDelayMeter, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, diffCapActionCensus, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isArrayBufferCensusReport, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, nextRssBudgetState, parseCapAction, parseRangeHeader, parseRssBudgetMb, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readHeapSpaces, readLanHttpState, readMoleculerFanoutMode, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, socketDirectionBytes, socketDirectionMessages, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
|
95813
|
+
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, ARRAY_BUFFER_CENSUS_COOLDOWN_MS, ARRAY_BUFFER_CENSUS_SUSTAIN_MS, ARRAY_BUFFER_CENSUS_THRESHOLD_MB, ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, 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, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, 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_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LokiDestination, LokiLoggingAddon, MAX_CAP_ACTIONS_PER_PEER, MAX_LEAF_VALIDITY_DAYS, MESH_QUEUE_TOP_N, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PARENT_ROUTED_PROVIDER_ADDON_ID, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, 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, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, attributeStall, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createLocalTransport, createLoopDelayMeter, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, deviceCapResolverLink, diffCapActionCensus, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isArrayBufferCensusReport, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, nextRssBudgetState, parseCapAction, parseRangeHeader, parseRssBudgetMb, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readHeapSpaces, readLanHttpState, readMoleculerFanoutMode, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, socketDirectionBytes, socketDirectionMessages, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
package/dist/kernel/index.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export type { HubServiceDeps } from './moleculer/hub-service.js';
|
|
|
69
69
|
export { createBrokerDeviceManagerApi, buildNativeCapProxy, buildUdsNativeCapProxy, mountNativeCapService, NATIVE_PROVIDER_SERVICE_INFIX, } from './moleculer/device-cap-proxy.js';
|
|
70
70
|
export type { WorkerDeviceManagerOptions } from './moleculer/device-cap-proxy.js';
|
|
71
71
|
export { getWorkerDeviceRegistry } from './moleculer/addon-context-factory.js';
|
|
72
|
-
export { localProviderLink, brokerTransportLink, ipcParentLink, buildLinkChain, brokerCallForCap, } from './moleculer/trpc-links.js';
|
|
72
|
+
export { localProviderLink, brokerTransportLink, deviceCapResolverLink, ipcParentLink, buildLinkChain, brokerCallForCap, } from './moleculer/trpc-links.js';
|
|
73
73
|
export type { LocalProviderResolver, BrokerCapCallOpts } from './moleculer/trpc-links.js';
|
|
74
74
|
export { createProcessService } from './moleculer/process-service.js';
|
|
75
75
|
export type { ProcessInfo } from './moleculer/process-service.js';
|
|
@@ -170,6 +170,33 @@ export declare function brokerCallForCap(broker: ServiceBroker, capName: string,
|
|
|
170
170
|
export interface BrokerTransportLinkOptions {
|
|
171
171
|
readonly discoveryTimeoutMs?: number;
|
|
172
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* Dispatch a call to a device-scoped capability. Supplied by the hub, where it
|
|
175
|
+
* is `callCapabilityOnNode` — the entry the codegen cap routers already use,
|
|
176
|
+
* which extracts the `deviceId` from the input and asks the `CapRouteResolver`.
|
|
177
|
+
*/
|
|
178
|
+
export type DeviceCapDispatcher = (capName: string, method: string, input: unknown) => Promise<unknown>;
|
|
179
|
+
/**
|
|
180
|
+
* The link that lets an IN-PROCESS addon call a device-scoped cap.
|
|
181
|
+
*
|
|
182
|
+
* Without it the hub's own `ctx.api` chain is `localProviderLink →
|
|
183
|
+
* brokerTransportLink`: a provider in this process, then the Moleculer
|
|
184
|
+
* registry. Forked addon children are BROKER-LESS (UDS), so a device provider
|
|
185
|
+
* such as hikvision's `ptz` advertises nothing on the bus, no service candidate
|
|
186
|
+
* matches, and the call falls back to the `<cap>.<cap>.<method>` shape
|
|
187
|
+
* documented above as the broken one. A forked addon never hits this because
|
|
188
|
+
* its chain ends at `ipcParentLink` → the parent's `CapRouteResolver`; an
|
|
189
|
+
* in-process one had no way to reach that authority at all.
|
|
190
|
+
*
|
|
191
|
+
* Deliberately narrow: it intercepts ONLY a cap whose definition says
|
|
192
|
+
* `scope: 'device'`, and only when the call actually carries a numeric
|
|
193
|
+
* `deviceId` to route on. A system cap that happens to take a `deviceId`
|
|
194
|
+
* argument (`deviceManager.getBindings`, `deviceState.getCapSlice`) is left
|
|
195
|
+
* exactly where it was. There is no fallback to the broker after a resolver
|
|
196
|
+
* failure, on purpose: the resolver's error names the node and the reason,
|
|
197
|
+
* and replacing it with "service not found" is how this class of bug hides.
|
|
198
|
+
*/
|
|
199
|
+
export declare function deviceCapResolverLink<TRouter extends AnyRouter>(dispatch: DeviceCapDispatcher, isDeviceScoped: (capName: string) => boolean): TRPCLink<TRouter>;
|
|
173
200
|
export declare function brokerTransportLink<TRouter extends AnyRouter>(broker: ServiceBroker, serviceMap?: Readonly<Record<string, string>>, observerOpts?: CapUsageObserverOptions, linkOptions?: BrokerTransportLinkOptions): TRPCLink<TRouter>;
|
|
174
201
|
/**
|
|
175
202
|
* Middle link that routes a child addon's outbound `ctx.api` cap call to the
|
|
@@ -9556,6 +9556,49 @@ async function brokerCallForCap(broker, capName, method, args, opts) {
|
|
|
9556
9556
|
if (abort.aborted) throw new Error(`brokerCallForCap: aborted while awaiting "${capName}.${method}" discovery`);
|
|
9557
9557
|
return broker.call(action, callInput, callOpts);
|
|
9558
9558
|
}
|
|
9559
|
+
/**
|
|
9560
|
+
* The link that lets an IN-PROCESS addon call a device-scoped cap.
|
|
9561
|
+
*
|
|
9562
|
+
* Without it the hub's own `ctx.api` chain is `localProviderLink →
|
|
9563
|
+
* brokerTransportLink`: a provider in this process, then the Moleculer
|
|
9564
|
+
* registry. Forked addon children are BROKER-LESS (UDS), so a device provider
|
|
9565
|
+
* such as hikvision's `ptz` advertises nothing on the bus, no service candidate
|
|
9566
|
+
* matches, and the call falls back to the `<cap>.<cap>.<method>` shape
|
|
9567
|
+
* documented above as the broken one. A forked addon never hits this because
|
|
9568
|
+
* its chain ends at `ipcParentLink` → the parent's `CapRouteResolver`; an
|
|
9569
|
+
* in-process one had no way to reach that authority at all.
|
|
9570
|
+
*
|
|
9571
|
+
* Deliberately narrow: it intercepts ONLY a cap whose definition says
|
|
9572
|
+
* `scope: 'device'`, and only when the call actually carries a numeric
|
|
9573
|
+
* `deviceId` to route on. A system cap that happens to take a `deviceId`
|
|
9574
|
+
* argument (`deviceManager.getBindings`, `deviceState.getCapSlice`) is left
|
|
9575
|
+
* exactly where it was. There is no fallback to the broker after a resolver
|
|
9576
|
+
* failure, on purpose: the resolver's error names the node and the reason,
|
|
9577
|
+
* and replacing it with "service not found" is how this class of bug hides.
|
|
9578
|
+
*/
|
|
9579
|
+
function deviceCapResolverLink(dispatch, isDeviceScoped) {
|
|
9580
|
+
return () => {
|
|
9581
|
+
return ({ op, next }) => {
|
|
9582
|
+
const parsed = parsePath(op.path);
|
|
9583
|
+
if (!parsed || !isDeviceScoped(parsed.capName)) return next(op);
|
|
9584
|
+
const input = op.input;
|
|
9585
|
+
const deviceId = input !== null && typeof input === "object" ? Reflect.get(input, "deviceId") : void 0;
|
|
9586
|
+
if (typeof deviceId !== "number" || !Number.isFinite(deviceId)) return next(op);
|
|
9587
|
+
return observable((observer) => {
|
|
9588
|
+
dispatch(parsed.capName, parsed.method, input).then((data) => {
|
|
9589
|
+
observer.next({ result: {
|
|
9590
|
+
type: "data",
|
|
9591
|
+
data
|
|
9592
|
+
} });
|
|
9593
|
+
observer.complete();
|
|
9594
|
+
}).catch((cause) => {
|
|
9595
|
+
observer.error(TRPCClientError.from(cause instanceof Error ? cause : new Error(String(cause))));
|
|
9596
|
+
});
|
|
9597
|
+
return () => {};
|
|
9598
|
+
});
|
|
9599
|
+
};
|
|
9600
|
+
};
|
|
9601
|
+
}
|
|
9559
9602
|
function brokerTransportLink(broker, serviceMap, observerOpts, linkOptions) {
|
|
9560
9603
|
const map = serviceMap ?? {};
|
|
9561
9604
|
const discoveryTimeoutMs = linkOptions?.discoveryTimeoutMs;
|
|
@@ -11583,4 +11626,4 @@ async function defaultRun(command, args) {
|
|
|
11583
11626
|
await execFileAsync(command, [...args], { timeout: INSTALL_TIMEOUT_MS });
|
|
11584
11627
|
}
|
|
11585
11628
|
//#endregion
|
|
11586
|
-
export {
|
|
11629
|
+
export { buildNativeCapProxy as $, ARRAY_BUFFER_CENSUS_SUSTAIN_MS as $t, createUdsLogger as A, createSocketDirectionCounters as An, HEAP_WATCH_WARN_RATIO as At, UDS_NO_ROUTE_PREFIX as B, createCapActionCensus as Bn, createDeferredHeapWatchSink as Bt, deviceCapResolverLink as C, SOCKET_QUEUE_TOP_N as Cn, resolveNpmInvocation as Ct, createUdsEventBridge as D, formatSocketPlane as Dn, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS as Dt, createParentUnownedCallHandler as E, diffSocketPlane as En, HEAP_RECLAIM_MIN_INTERVAL_MS as Et, callWithServiceDiscovery as F, CAP_ACTION_OVERFLOW_LABEL as Fn, RSS_BUDGET_RELEASE_RATIO as Ft, getCapUsageRegistry as G, diffEventPlane as Gn, nextRssBudgetState as Gt, CapUsageRegistry as H, EVENT_PLANE_TOP_N as Hn, createV8Reclaimer as Ht, CapRouteError as I, CAP_ACTION_UNLABELLED as In, RUNNER_HEAP_WATCH_INTERVAL_MS as It, UdsLocalTransportServer as J, shouldReclaim as Jt, createLocalTransport as K, formatEventPlane as Kn, parseRssBudgetMb as Kt, classifyCapRoute as L, EMPTY_CAP_ACTION_READING as Ln, RUNNER_RSS_BUDGET_ENV as Lt, AGENT_CAP_FWD_ACTION as M, sampleSocketDirection as Mn, HUB_MAIN_RSS_BUDGET_MB as Mt, AGENT_CAP_FWD_SERVICE as N, socketDirectionBytes as Nn, HUB_RSS_BUDGET_ENV as Nt, createUdsEventBus as O, readSocketQueues as On, HEAP_RECLAIM_TRIGGER_MB as Ot, CapRouteResolver as P, socketDirectionMessages as Pn, RSS_BUDGET_REANNOUNCE_MIN_MS as Pt, encodeFrame as Q, ARRAY_BUFFER_CENSUS_COOLDOWN_MS as Qt, LocalChildClient as R, MAX_CAP_ACTIONS_PER_PEER as Rn, ZERO_LOOP_DELAY as Rt, buildLinkChain as S, SOCKET_PLANE_TOP_N as Sn, buildNpmChildEnv as St, localProviderLink as T, createSocketPlaneReader as Tn, createAddonDataPlaneFacility as Tt, PARENT_ROUTED_PROVIDER_ADDON_ID as U, createEventPlaneMeter as Un, describeRss as Ut, readMoleculerFanoutMode as V, diffCapActionCensus as Vn, createLoopDelayMeter as Vt, __resetCapUsageRegistryForTests as W, createEventPlaneReader as Wn, hubMainRssBudget as Wt, localEndpointPath as X, startRunnerHeapWatch as Xt, SocketChannel as Y, startHeapWatch as Yt, FrameDecoder as Z, strandedMb as Zt, AddonDepsManager as _, formatOutboundQueueVerdict as _n, CapabilityHandle as _t, createUdsAddonContext as a, isArrayBufferCensusReport as an, setWorkerNativeCapsChangeListener as at, brokerCallForCap as b, formatMeshQueue as bn, installManifestNativeDeps as bt, getOrInitReadinessRegistryForClient as c, emitHeapDiagnosticReport as cn, NATIVE_PROVIDER_SERVICE_INFIX as ct, clusterEventTopic as d, readHeapSpaces as dn, capBareAction as dt, ARRAY_BUFFER_CENSUS_THRESHOLD_MB as en, buildUdsNativeCapProxy as et, getBrokerEventBus as f, selectReportedSpaces as fn, capServiceName as ft, subscribePassthrough as g, createOutboundQueueGate as gn, DeviceRegistry as gt, setNodeEventInterest as h, OUTBOUND_QUEUE_THRESHOLD_BYTES as hn, serializeTypedArrays as ht, createAddonContext as i, formatArrayBufferCensus as in, mountNativeCapService as it, createUdsLoggerWithControl as j, recordSocketFrame as jn, HUB_MAIN_HEAP_WATCH_LABEL as jt, udsChildLogToWorkerEntry as k, EMPTY_SOCKET_DIRECTION as kn, HEAP_WATCH_INTERVAL_MS as kt, setHubConnected as l, formatHeapSpaces as ln, capActionName as lt, registerEventBusService as m, OUTBOUND_QUEUE_SUSTAIN_MS as mn, deserializeTypedArrays as mt, installManifestPythonDeps as n, createArrayBufferCensusGate as nn, getWorkerNativeCapProvider as nt, getWorkerDeviceRegistry as o, DECISIVE_HEAP_SPACES as on, createAddonService as ot, getMoleculerEventStats as p, OUTBOUND_QUEUE_COOLDOWN_MS as pn, parseCapAction as pt, UdsLocalTransportClient as q, reclaimIntervalMs as qt, adaptBrokerToCluster as r, createInspectorArrayBufferCensus as rn, getWorkerNativeCapSnapshot as rt, getOrInitReadinessRegistry as s, HEAP_SPACE_REPORT_MIN_MB as sn, validateProviderRegistrations as st, installManifestSystemDeps as t, ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO as tn, createBrokerDeviceManagerApi as tt, EVENT_TOPIC_PREFIX as u, heapSpaceField as un, capActionSuffix as ut, createKernelHwAccel as v, MESH_QUEUE_TOP_N as vn, CapabilityUnavailableError as vt, ipcParentLink as w, createSocketPlaneMeter as wn, runNpm as wt, brokerTransportLink as x, EMPTY_SOCKET_PLANE_BASELINE as xn, resolveAddonClass as xt, resolveHwAccel as y, createMeshQueueReader as yn, copyBundledNativeModules as yt, LocalChildRegistry as z, capActionLabel as zn, buildHeapSample as zt };
|
|
@@ -9559,6 +9559,49 @@ async function brokerCallForCap(broker, capName, method, args, opts) {
|
|
|
9559
9559
|
if (abort.aborted) throw new Error(`brokerCallForCap: aborted while awaiting "${capName}.${method}" discovery`);
|
|
9560
9560
|
return broker.call(action, callInput, callOpts);
|
|
9561
9561
|
}
|
|
9562
|
+
/**
|
|
9563
|
+
* The link that lets an IN-PROCESS addon call a device-scoped cap.
|
|
9564
|
+
*
|
|
9565
|
+
* Without it the hub's own `ctx.api` chain is `localProviderLink →
|
|
9566
|
+
* brokerTransportLink`: a provider in this process, then the Moleculer
|
|
9567
|
+
* registry. Forked addon children are BROKER-LESS (UDS), so a device provider
|
|
9568
|
+
* such as hikvision's `ptz` advertises nothing on the bus, no service candidate
|
|
9569
|
+
* matches, and the call falls back to the `<cap>.<cap>.<method>` shape
|
|
9570
|
+
* documented above as the broken one. A forked addon never hits this because
|
|
9571
|
+
* its chain ends at `ipcParentLink` → the parent's `CapRouteResolver`; an
|
|
9572
|
+
* in-process one had no way to reach that authority at all.
|
|
9573
|
+
*
|
|
9574
|
+
* Deliberately narrow: it intercepts ONLY a cap whose definition says
|
|
9575
|
+
* `scope: 'device'`, and only when the call actually carries a numeric
|
|
9576
|
+
* `deviceId` to route on. A system cap that happens to take a `deviceId`
|
|
9577
|
+
* argument (`deviceManager.getBindings`, `deviceState.getCapSlice`) is left
|
|
9578
|
+
* exactly where it was. There is no fallback to the broker after a resolver
|
|
9579
|
+
* failure, on purpose: the resolver's error names the node and the reason,
|
|
9580
|
+
* and replacing it with "service not found" is how this class of bug hides.
|
|
9581
|
+
*/
|
|
9582
|
+
function deviceCapResolverLink(dispatch, isDeviceScoped) {
|
|
9583
|
+
return () => {
|
|
9584
|
+
return ({ op, next }) => {
|
|
9585
|
+
const parsed = parsePath(op.path);
|
|
9586
|
+
if (!parsed || !isDeviceScoped(parsed.capName)) return next(op);
|
|
9587
|
+
const input = op.input;
|
|
9588
|
+
const deviceId = input !== null && typeof input === "object" ? Reflect.get(input, "deviceId") : void 0;
|
|
9589
|
+
if (typeof deviceId !== "number" || !Number.isFinite(deviceId)) return next(op);
|
|
9590
|
+
return observable((observer) => {
|
|
9591
|
+
dispatch(parsed.capName, parsed.method, input).then((data) => {
|
|
9592
|
+
observer.next({ result: {
|
|
9593
|
+
type: "data",
|
|
9594
|
+
data
|
|
9595
|
+
} });
|
|
9596
|
+
observer.complete();
|
|
9597
|
+
}).catch((cause) => {
|
|
9598
|
+
observer.error(_trpc_client.TRPCClientError.from(cause instanceof Error ? cause : new Error(String(cause))));
|
|
9599
|
+
});
|
|
9600
|
+
return () => {};
|
|
9601
|
+
});
|
|
9602
|
+
};
|
|
9603
|
+
};
|
|
9604
|
+
}
|
|
9562
9605
|
function brokerTransportLink(broker, serviceMap, observerOpts, linkOptions) {
|
|
9563
9606
|
const map = serviceMap ?? {};
|
|
9564
9607
|
const discoveryTimeoutMs = linkOptions?.discoveryTimeoutMs;
|
|
@@ -12162,6 +12205,12 @@ Object.defineProperty(exports, "deserializeTypedArrays", {
|
|
|
12162
12205
|
return deserializeTypedArrays;
|
|
12163
12206
|
}
|
|
12164
12207
|
});
|
|
12208
|
+
Object.defineProperty(exports, "deviceCapResolverLink", {
|
|
12209
|
+
enumerable: true,
|
|
12210
|
+
get: function() {
|
|
12211
|
+
return deviceCapResolverLink;
|
|
12212
|
+
}
|
|
12213
|
+
});
|
|
12165
12214
|
Object.defineProperty(exports, "diffCapActionCensus", {
|
|
12166
12215
|
enumerable: true,
|
|
12167
12216
|
get: function() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/system",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.257",
|
|
4
4
|
"description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
"id": "autotrack",
|
|
204
204
|
"category": "system",
|
|
205
205
|
"name": "PTZ Autotrack (emulated)",
|
|
206
|
-
"description": "Wrapper over the `ptz-autotrack` cap — follows a subject with self-terminating `ptz.move` pulses on cameras whose firmware has no autotrack, driven by the detection pipeline's tracked boxes. The operator binds it per camera, then uses the SAME autotrack switch a native camera has: the binding chooses the implementation, never a second toggle. It refuses to move without a readable `moveImpulseMs`, and while a firmware autotrack on the same camera reports armed.",
|
|
206
|
+
"description": "Wrapper over the `ptz-autotrack` cap — follows a subject with self-terminating `ptz.move` pulses on cameras whose firmware has no autotrack, driven by the detection pipeline's tracked boxes. The operator binds it per camera, then uses the SAME autotrack switch a native camera has: the binding chooses the implementation, never a second toggle. It refuses to move without a readable `moveImpulseMs`, and while a firmware autotrack on the same camera reports armed. Runs IN-PROCESS: it spawns nothing, carries no frames and issues a command every few seconds at most.",
|
|
207
207
|
"entry": "./dist/builtins/autotrack/index.js",
|
|
208
208
|
"capabilities": [
|
|
209
209
|
{
|