@camstack/server 1.2.780 → 1.2.782
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/CHANGELOG.md +13 -0
- package/dist/api/trpc/cap-router-runtime.js +18 -9
- package/dist/core/addon/addon-registry.service.js +3 -1
- package/dist/core/addon/instance-links.service.js +101 -0
- package/dist/core/moleculer/moleculer.service.js +3 -1
- package/package.json +7 -32
- package/system/dist/addon-runner.js +9 -1
- package/system/dist/addon-runner.mjs +10 -2
- package/system/dist/{agent-https-DuxDC67S.mjs → agent-https-CEBLv9BA.mjs} +1 -1
- package/system/dist/{agent-https-A9wsxVGn.js → agent-https-kG6BvwKf.js} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-CEChNpAD.mjs → capture-engine-7_Barr9F.mjs} +1 -1
- package/system/dist/{capture-engine-D6mXfLFQ.js → capture-engine-cNrHuwWH.js} +1 -1
- package/system/dist/{composition-sources-cVWKVph4.js → composition-sources-7wEQtB6b.js} +1 -1
- package/system/dist/{composition-sources-6XYW86Kw.mjs → composition-sources-QUbTSbQL.mjs} +1 -1
- package/system/dist/{constants-DqwDEYfb.mjs → constants-BmX7aeHq.mjs} +1 -1
- package/system/dist/{constants-B5Yg02ii.js → constants-_Zq5aGIs.js} +1 -1
- package/system/dist/{device-ca-BVz14dRd.js → device-ca-D9nNDHW_.js} +1 -1
- package/system/dist/{device-ca-oY4Xqd7s.mjs → device-ca-DqNfUZx4.mjs} +1 -1
- package/system/dist/{dist-B4wrqheM.js → dist-CA672buZ.js} +52 -4
- package/system/dist/{dist-BX8nZeXV.mjs → dist-W0Eyg7Fm.mjs} +52 -4
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-CiMMA0rT.js → hub-mdns-ciao-DHlokCDH.js} +2 -2
- package/system/dist/{hub-mdns-ciao-BDPMfOgq.mjs → hub-mdns-ciao-DWzAoaKF.mjs} +2 -2
- package/system/dist/index.js +33 -25
- package/system/dist/index.mjs +34 -26
- package/system/dist/kernel/moleculer/trpc-links.d.ts +8 -0
- package/system/dist/{legacy-integration-rows-door-YuWqHZW4.js → legacy-integration-rows-door-BzVepX_e.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-DDA3YOxL.mjs → legacy-integration-rows-door-CF_0_-U9.mjs} +1 -1
- package/system/dist/{restore-archive-BrtpgNCt.mjs → restore-archive-CfET1ups.mjs} +1 -1
- package/system/dist/{restore-archive-Cn9OShm4.js → restore-archive-ChBlqNSj.js} +1 -1
- package/system/dist/{wal-maintenance-jgyV9NbL.mjs → wal-maintenance-Bg3rwpny.mjs} +0 -0
- package/system/dist/{wal-maintenance-BTzu3s-6.js → wal-maintenance-CNSrfmr8.js} +0 -0
- package/system/package.json +1 -1
|
@@ -11316,6 +11316,30 @@ var IntegrationInstanceRefSchema = z.object({
|
|
|
11316
11316
|
]),
|
|
11317
11317
|
candidateStableId: z.string().optional()
|
|
11318
11318
|
});
|
|
11319
|
+
function linkTargetOf(meta) {
|
|
11320
|
+
if (typeof meta !== "object" || meta === null) return void 0;
|
|
11321
|
+
const link = Reflect.get(meta, "link");
|
|
11322
|
+
const parsed = LinkTargetSchema.safeParse(link);
|
|
11323
|
+
return parsed.success ? parsed.data : void 0;
|
|
11324
|
+
}
|
|
11325
|
+
var LinkTargetSchema = z.object({
|
|
11326
|
+
cap: z.string().min(1),
|
|
11327
|
+
kind: z.string().min(1).optional()
|
|
11328
|
+
});
|
|
11329
|
+
/** The links a kind declares, read from the meta of its body fields. */
|
|
11330
|
+
function linksOfKind(kind) {
|
|
11331
|
+
const schema = kind.schema;
|
|
11332
|
+
if (!(schema instanceof z.ZodObject)) return [];
|
|
11333
|
+
const links = [];
|
|
11334
|
+
for (const [field, fieldSchema] of Object.entries(schema.shape)) {
|
|
11335
|
+
const to = linkTargetOf(z.globalRegistry.get(fieldSchema));
|
|
11336
|
+
if (to !== void 0) links.push({
|
|
11337
|
+
field,
|
|
11338
|
+
to
|
|
11339
|
+
});
|
|
11340
|
+
}
|
|
11341
|
+
return links;
|
|
11342
|
+
}
|
|
11319
11343
|
/**
|
|
11320
11344
|
* `RecordIntegrationInstances` - the `integration-instances` provider over ONE
|
|
11321
11345
|
* entry kind, so an addon that holds a connection serves it in ~30 lines.
|
|
@@ -11437,9 +11461,18 @@ var RecordIntegrationInstances = class {
|
|
|
11437
11461
|
...health?.lastCheckedAt !== void 0 ? { lastCheckedAt: health.lastCheckedAt } : {}
|
|
11438
11462
|
};
|
|
11439
11463
|
}
|
|
11440
|
-
describe = async () =>
|
|
11441
|
-
|
|
11442
|
-
|
|
11464
|
+
describe = async () => {
|
|
11465
|
+
const declared = linksOfKind(this.kind);
|
|
11466
|
+
const links = this.hooks.description.links !== void 0 || declared.length === 0 ? {} : { links: declared.map((link) => ({
|
|
11467
|
+
kind: this.kind.name,
|
|
11468
|
+
field: link.field,
|
|
11469
|
+
to: link.to
|
|
11470
|
+
})) };
|
|
11471
|
+
return {
|
|
11472
|
+
...this.hooks.description,
|
|
11473
|
+
...links,
|
|
11474
|
+
...this.hooks.mintId === void 0 ? {} : { mintsId: true }
|
|
11475
|
+
};
|
|
11443
11476
|
};
|
|
11444
11477
|
instanceFormSchema = async ({ id }) => this.hooks.formSchema(id);
|
|
11445
11478
|
listInstances = async () => {
|
|
@@ -62349,6 +62382,19 @@ var IntegrationInstanceDiscoverySchema = z.object({
|
|
|
62349
62382
|
]),
|
|
62350
62383
|
scopedToInstance: z.boolean()
|
|
62351
62384
|
});
|
|
62385
|
+
/**
|
|
62386
|
+
* One link a kind of this provider declares (D1013 rule 5): the body `field` of an instance of
|
|
62387
|
+
* `kind` holds the id of an instance of the function cap `to.cap` (of kind `to.kind`, when set).
|
|
62388
|
+
* The hub indexes these so the target's delete is refused while a link names it.
|
|
62389
|
+
*/
|
|
62390
|
+
var IntegrationInstanceLinkSchema = z.object({
|
|
62391
|
+
kind: z.string().min(1),
|
|
62392
|
+
field: z.string().min(1),
|
|
62393
|
+
to: z.object({
|
|
62394
|
+
cap: z.string().min(1),
|
|
62395
|
+
kind: z.string().min(1).optional()
|
|
62396
|
+
})
|
|
62397
|
+
});
|
|
62352
62398
|
var IntegrationInstanceDescriptionSchema = z.object({
|
|
62353
62399
|
/** What the instances are for the Integrations page; see {@link IntegrationInstanceRoleSchema}. */
|
|
62354
62400
|
role: IntegrationInstanceRoleSchema,
|
|
@@ -62374,7 +62420,9 @@ var IntegrationInstanceDescriptionSchema = z.object({
|
|
|
62374
62420
|
* `createInstance` without an `id` works: the provider mints it. Absent means the caller must
|
|
62375
62421
|
* send an id (the UI then mints an opaque one).
|
|
62376
62422
|
*/
|
|
62377
|
-
mintsId: z.boolean().optional()
|
|
62423
|
+
mintsId: z.boolean().optional(),
|
|
62424
|
+
/** The links to other instances the provider's kinds declare; absent means none. */
|
|
62425
|
+
links: z.array(IntegrationInstanceLinkSchema).optional()
|
|
62378
62426
|
});
|
|
62379
62427
|
var IntegrationInstanceStatusSchema = z.object({
|
|
62380
62428
|
state: z.enum([
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_wal_maintenance = require("./wal-maintenance-
|
|
2
|
+
const require_wal_maintenance = require("./wal-maintenance-CNSrfmr8.js");
|
|
3
3
|
let node_worker_threads = require("node:worker_threads");
|
|
4
4
|
//#region src/builtins/sqlite-storage/file-host-worker.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-
|
|
1
|
+
import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-Bg3rwpny.mjs";
|
|
2
2
|
import { parentPort, threadId, workerData } from "node:worker_threads";
|
|
3
3
|
//#region src/builtins/sqlite-storage/file-host-worker.ts
|
|
4
4
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-CA672buZ.js");
|
|
3
3
|
const require_x509_es = require("./x509.es-WtnRNyYS.js");
|
|
4
|
-
const require_agent_https = require("./agent-https-
|
|
4
|
+
const require_agent_https = require("./agent-https-kG6BvwKf.js");
|
|
5
5
|
let node_crypto = require("node:crypto");
|
|
6
6
|
let _camstack_types_node = require("@camstack/types/node");
|
|
7
7
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as __toESM } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { dc as userError } from "./dist-
|
|
2
|
+
import { dc as userError } from "./dist-W0Eyg7Fm.mjs";
|
|
3
3
|
import { f as X509Certificate$1 } from "./x509.es-BRiJgOvu.mjs";
|
|
4
|
-
import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-
|
|
4
|
+
import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-CEBLv9BA.mjs";
|
|
5
5
|
import { X509Certificate, createPrivateKey } from "node:crypto";
|
|
6
6
|
import { writeOwnerOnlyFileSync } from "@camstack/types/node";
|
|
7
7
|
import { mkdir, writeFile } from "node:fs/promises";
|
package/system/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("./dist-
|
|
4
|
-
const require_device_ca = require("./device-ca-
|
|
3
|
+
const require_dist = require("./dist-CA672buZ.js");
|
|
4
|
+
const require_device_ca = require("./device-ca-D9nNDHW_.js");
|
|
5
5
|
const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
|
|
6
6
|
const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
|
|
7
7
|
require("./builtins/alerts/index.js");
|
|
@@ -26,22 +26,22 @@ const require_builtins_loki_logging_index = require("./builtins/loki-logging/ind
|
|
|
26
26
|
const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
|
|
27
27
|
const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
|
|
28
28
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
|
|
29
|
-
const require_wal_maintenance = require("./wal-maintenance-
|
|
30
|
-
const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-
|
|
29
|
+
const require_wal_maintenance = require("./wal-maintenance-CNSrfmr8.js");
|
|
30
|
+
const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-BzVepX_e.js");
|
|
31
31
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
|
|
32
32
|
const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
|
|
33
33
|
const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
|
|
34
34
|
require("./builtins/storage-orchestrator/index.js");
|
|
35
|
-
const require_agent_https = require("./agent-https-
|
|
36
|
-
const require_constants = require("./constants-
|
|
35
|
+
const require_agent_https = require("./agent-https-kG6BvwKf.js");
|
|
36
|
+
const require_constants = require("./constants-_Zq5aGIs.js");
|
|
37
37
|
const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
|
|
38
38
|
require("./builtins/system-config/index.js");
|
|
39
39
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
40
40
|
const require_custom_action_registry = require("./custom-action-registry-JuMHGKEc.js");
|
|
41
|
-
const require_hub_mdns_ciao = require("./hub-mdns-ciao-
|
|
41
|
+
const require_hub_mdns_ciao = require("./hub-mdns-ciao-DHlokCDH.js");
|
|
42
42
|
const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
|
|
43
43
|
const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
|
|
44
|
-
const require_restore_archive = require("./restore-archive-
|
|
44
|
+
const require_restore_archive = require("./restore-archive-ChBlqNSj.js");
|
|
45
45
|
const require_coral_accelerators = require("./coral-accelerators-BSVsBVzt.js");
|
|
46
46
|
let zod = require("zod");
|
|
47
47
|
let node_crypto = require("node:crypto");
|
|
@@ -17571,6 +17571,22 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
17571
17571
|
return deviceApi;
|
|
17572
17572
|
}
|
|
17573
17573
|
//#endregion
|
|
17574
|
+
//#region src/kernel/transport/cap-routing-hints.ts
|
|
17575
|
+
/** Lift {@link CapRoutingHints} from a call's args. Never throws. */
|
|
17576
|
+
function liftRoutingHints(args) {
|
|
17577
|
+
if (args === null || typeof args !== "object" || Array.isArray(args)) return {};
|
|
17578
|
+
const nodeId = Reflect.get(args, "nodeId");
|
|
17579
|
+
const addonId = Reflect.get(args, "addonId");
|
|
17580
|
+
const provider = Reflect.get(args, "provider");
|
|
17581
|
+
const deviceId = Reflect.get(args, "deviceId");
|
|
17582
|
+
return {
|
|
17583
|
+
...typeof nodeId === "string" && nodeId.length > 0 ? { nodeId } : {},
|
|
17584
|
+
...typeof addonId === "string" && addonId.length > 0 ? { addonId } : {},
|
|
17585
|
+
...typeof provider === "string" && provider.length > 0 ? { provider } : {},
|
|
17586
|
+
...typeof deviceId === "number" && Number.isFinite(deviceId) ? { deviceId } : {}
|
|
17587
|
+
};
|
|
17588
|
+
}
|
|
17589
|
+
//#endregion
|
|
17574
17590
|
//#region src/kernel/moleculer/resilient-cap-call.ts
|
|
17575
17591
|
/** Moleculer error `type` values meaning "the service is not (yet) routable". */
|
|
17576
17592
|
var DISCOVERY_ERROR_TYPES = new Set(["SERVICE_NOT_FOUND", "SERVICE_NOT_AVAILABLE"]);
|
|
@@ -20606,22 +20622,6 @@ function buildCapChildIndex(entries) {
|
|
|
20606
20622
|
return new MapCapChildIndex(deviceOwners, singletons);
|
|
20607
20623
|
}
|
|
20608
20624
|
//#endregion
|
|
20609
|
-
//#region src/kernel/transport/cap-routing-hints.ts
|
|
20610
|
-
/** Lift {@link CapRoutingHints} from a call's args. Never throws. */
|
|
20611
|
-
function liftRoutingHints(args) {
|
|
20612
|
-
if (args === null || typeof args !== "object" || Array.isArray(args)) return {};
|
|
20613
|
-
const nodeId = Reflect.get(args, "nodeId");
|
|
20614
|
-
const addonId = Reflect.get(args, "addonId");
|
|
20615
|
-
const provider = Reflect.get(args, "provider");
|
|
20616
|
-
const deviceId = Reflect.get(args, "deviceId");
|
|
20617
|
-
return {
|
|
20618
|
-
...typeof nodeId === "string" && nodeId.length > 0 ? { nodeId } : {},
|
|
20619
|
-
...typeof addonId === "string" && addonId.length > 0 ? { addonId } : {},
|
|
20620
|
-
...typeof provider === "string" && provider.length > 0 ? { provider } : {},
|
|
20621
|
-
...typeof deviceId === "number" && Number.isFinite(deviceId) ? { deviceId } : {}
|
|
20622
|
-
};
|
|
20623
|
-
}
|
|
20624
|
-
//#endregion
|
|
20625
20625
|
//#region src/kernel/transport/claimed-get-status.ts
|
|
20626
20626
|
var GET_STATUS_METHOD = "getStatus";
|
|
20627
20627
|
/** The device a `getStatus` is about, or `undefined` when the call is not one. */
|
|
@@ -22348,7 +22348,12 @@ function localProviderLink(resolver, observerOpts) {
|
|
|
22348
22348
|
const pinnedNodeId = (0, _camstack_types_addon.readNodePin)(op.context);
|
|
22349
22349
|
if (pinnedNodeId !== void 0 && pinnedNodeId !== localBase) return next(opWithDefaults);
|
|
22350
22350
|
}
|
|
22351
|
-
|
|
22351
|
+
let provider;
|
|
22352
|
+
const pinnedAddonId = liftRoutingHints(op.input).addonId;
|
|
22353
|
+
if (pinnedAddonId !== void 0 && resolver.getByAddonId !== void 0 && Object.hasOwn(_camstack_types_addon.COLLECTION_ARRAY_METHODS, parsed.capName)) {
|
|
22354
|
+
provider = resolver.getByAddonId(parsed.capName, pinnedAddonId);
|
|
22355
|
+
if (!provider) return next(opWithDefaults);
|
|
22356
|
+
} else provider = resolver.getByName(parsed.capName);
|
|
22352
22357
|
if (!provider || typeof provider !== "object") return next(opWithDefaults);
|
|
22353
22358
|
const fn = Reflect.get(provider, parsed.method);
|
|
22354
22359
|
if (typeof fn !== "function") return next(opWithDefaults);
|
|
@@ -24328,6 +24333,9 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
24328
24333
|
const regs = getRegistries(nodeId);
|
|
24329
24334
|
const workerResolver = {
|
|
24330
24335
|
localNodeId: nodeId,
|
|
24336
|
+
getByAddonId(capabilityName, pinnedAddonId) {
|
|
24337
|
+
return regs.byAddonId.get(capabilityName)?.get(pinnedAddonId) ?? null;
|
|
24338
|
+
},
|
|
24331
24339
|
getByName(capabilityName) {
|
|
24332
24340
|
const preferred = regs.preferred.get(capabilityName);
|
|
24333
24341
|
if (preferred) {
|
package/system/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __require } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $s as readinessKey, As as getDebugInterest, At as PackageRequiresSchema, Bi as procedureAuthKey, Ca as splitTranslationRef, Cr as extractNestedAddonId, Di as objectInputDeclaresRequiredDeviceId, E as CatalogFileSchema, Ei as objectInputDeclaresAddonId, Es as emitDownForOwnedCaps, Fo as DEVICE_STATUS_METHOD, Hr as isCollectionArrayMethod, La as unmetRequirements, Lr as interpolate, Mo as CALLER_STAMPED_CAPABILITIES$1, No as DATAPLANE_SECRET_HEADER$1, Os as expandCapMethods, Po as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Ps as isDebugChannelName, Qo as ReadinessTimeoutError, Rn as compareVersions, Ts as defineRecordKinds, Vr as isArrayOutputSchema, Xo as RUNTIME_DEFAULTS, Xr as kebabToCamel$1, Xs as parseJsonObject, Yr as isVoidInput, Zo as ReadinessRegistry, Zs as parseJsonUnknown, _c as EventCategory$1, a as AGENT_MDNS_TXT_KEYS, bn as bareAddonId, bs as createEvent$1, bt as METHOD_ACCESS_MAP, ci as logLevelAtMost, dc as userError, dn as addonSettingsCapability, ds as asNumber, fa as scopesAllowAddon, fc as withoutCallerStamp, fs as asString$1, gc as errMsg$1, i as AGENT_MDNS_SERVICE_TYPE, ja as supportedRuntimes, li as looseSchema, o as ALL_CAPABILITY_DEFINITIONS, or as describeUnmet, pa as scopesAllowDeviceCap, qr as isObjectInput, ra as resolveMethodAuth, rc as scopeKey, tc as resolveCapMount, ti as lifecycleJobSchema, us as asJsonObject$1, vs as collectSecretMarkerRefs, vt as LOG_LEVEL_RANK, y as CATALOG_LANGS } from "./dist-
|
|
3
|
-
import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-
|
|
2
|
+
import { $s as readinessKey, As as getDebugInterest, At as PackageRequiresSchema, Bi as procedureAuthKey, Ca as splitTranslationRef, Cr as extractNestedAddonId, Di as objectInputDeclaresRequiredDeviceId, E as CatalogFileSchema, Ei as objectInputDeclaresAddonId, Es as emitDownForOwnedCaps, Fo as DEVICE_STATUS_METHOD, Hr as isCollectionArrayMethod, La as unmetRequirements, Lr as interpolate, Mo as CALLER_STAMPED_CAPABILITIES$1, No as DATAPLANE_SECRET_HEADER$1, Os as expandCapMethods, Po as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Ps as isDebugChannelName, Qo as ReadinessTimeoutError, Rn as compareVersions, Ts as defineRecordKinds, Vr as isArrayOutputSchema, Xo as RUNTIME_DEFAULTS, Xr as kebabToCamel$1, Xs as parseJsonObject, Yr as isVoidInput, Zo as ReadinessRegistry, Zs as parseJsonUnknown, _c as EventCategory$1, a as AGENT_MDNS_TXT_KEYS, bn as bareAddonId, bs as createEvent$1, bt as METHOD_ACCESS_MAP, ci as logLevelAtMost, dc as userError, dn as addonSettingsCapability, ds as asNumber, fa as scopesAllowAddon, fc as withoutCallerStamp, fs as asString$1, gc as errMsg$1, i as AGENT_MDNS_SERVICE_TYPE, ja as supportedRuntimes, li as looseSchema, o as ALL_CAPABILITY_DEFINITIONS, or as describeUnmet, pa as scopesAllowDeviceCap, qr as isObjectInput, ra as resolveMethodAuth, rc as scopeKey, tc as resolveCapMount, ti as lifecycleJobSchema, us as asJsonObject$1, vs as collectSecretMarkerRefs, vt as LOG_LEVEL_RANK, y as CATALOG_LANGS } from "./dist-W0Eyg7Fm.mjs";
|
|
3
|
+
import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-DqNfUZx4.mjs";
|
|
4
4
|
import { t as require_read_all_rows } from "./read-all-rows-TaPqdWNF.mjs";
|
|
5
5
|
import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
|
|
6
6
|
import "./builtins/alerts/index.mjs";
|
|
@@ -25,22 +25,22 @@ import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index
|
|
|
25
25
|
import NativeMetricsAddon, { a as NativeMetricsProvider, i as parseProcStatusRss, n as nodeProcReader, r as parseProcStat } from "./builtins/native-metrics/native-metrics.addon.mjs";
|
|
26
26
|
import { DeviceHistoryAddon } from "./builtins/device-history/device-history.addon.mjs";
|
|
27
27
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
|
|
28
|
-
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-
|
|
29
|
-
import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-
|
|
28
|
+
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-Bg3rwpny.mjs";
|
|
29
|
+
import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-CF_0_-U9.mjs";
|
|
30
30
|
import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
31
31
|
import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
32
32
|
import { StorageOrchestratorAddon, a as stripForwardedCaller, i as createHubCapForwardService, l as STORAGE_DRAIN_STATE_LEGACY, n as HUB_CAP_FWD_ACTION, o as buildStorageLocationRegistry, r as HUB_CAP_FWD_SERVICE, t as StorageOrchestratorService, u as storageOrchestratorRecordKinds } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
33
33
|
import "./builtins/storage-orchestrator/index.mjs";
|
|
34
|
-
import { A as buildNameConstraintSet, B as setProcessAgentHttpsNames, C as LEAF_RENEWAL_WINDOW_DAYS, E as evaluateExistingCert, F as readNameConstraints, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, N as permitsIdentity, O as PERMITTED_DNS_SUFFIXES, P as permitsName, R as AgentHttpsNames, S as CA_VALIDITY_DAYS, T as SERVER_AUTH_OID, a as collectAgentNames, b as collectCertIdentity, c as installAgentHttps, d as issueAgentHttpsLeaf, f as loadAgentHttps, h as CA_COMMON_NAME, i as certificateNames, j as isConstrainedCa, k as PERMITTED_IP_RANGES, l as isContainerBridgeAddress, m as pinnedHttpsCaFingerprint, n as acceptAgentSans, o as createAgentHttpsRequest, p as pemDigest, r as agentHttpsPaths, s as describeHttpsLeaf, t as AgentHttpsInstallError, u as isPrivateAddress, w as MAX_LEAF_VALIDITY_DAYS, x as systemHostFacts, y as localCaCommonName, z as getProcessAgentHttpsNames } from "./agent-https-
|
|
35
|
-
import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-
|
|
34
|
+
import { A as buildNameConstraintSet, B as setProcessAgentHttpsNames, C as LEAF_RENEWAL_WINDOW_DAYS, E as evaluateExistingCert, F as readNameConstraints, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, N as permitsIdentity, O as PERMITTED_DNS_SUFFIXES, P as permitsName, R as AgentHttpsNames, S as CA_VALIDITY_DAYS, T as SERVER_AUTH_OID, a as collectAgentNames, b as collectCertIdentity, c as installAgentHttps, d as issueAgentHttpsLeaf, f as loadAgentHttps, h as CA_COMMON_NAME, i as certificateNames, j as isConstrainedCa, k as PERMITTED_IP_RANGES, l as isContainerBridgeAddress, m as pinnedHttpsCaFingerprint, n as acceptAgentSans, o as createAgentHttpsRequest, p as pemDigest, r as agentHttpsPaths, s as describeHttpsLeaf, t as AgentHttpsInstallError, u as isPrivateAddress, w as MAX_LEAF_VALIDITY_DAYS, x as systemHostFacts, y as localCaCommonName, z as getProcessAgentHttpsNames } from "./agent-https-CEBLv9BA.mjs";
|
|
35
|
+
import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-BmX7aeHq.mjs";
|
|
36
36
|
import { $ as caFingerprintCompact, A as getProcessNodeMeshTransport, B as MESH_NODE_CERTIFICATES_COLLECTION, C as MESH_TLS_PORT_HELLO_FIELD, Ct as readOriginSetting, D as setProcessMeshTlsEnabler, Dt as readCidrSetting, E as ServiceBroker, Et as parseCidrList, F as renewMeshCertificate, G as getProcessMeshCertificateRegistry, H as MeshCertificateRegistry, I as revokeMeshCertificate, J as processMeshCrl, K as setProcessMeshCertificateRegistry, L as getProcessMeshTlsListenerState, M as isProcessVerifiedMeshPeer, N as onProcessNodeRegistered, O as dropProcessPeer, P as setProcessMeshPeerTransportLookup, Q as caFingerprint, R as openMeshTlsWhenRevocationsLoaded, S as verifyMembershipAnswer, St as parseOriginList, SystemConfigAddon, T as Errors, Tt as normalizeIp, U as RENEWAL_ABANDONED, V as MESH_NODE_CERTIFICATES_COLUMNS, W as describeMeshLeaf, X as getProcessMeshCaState, Y as MeshCaKeeper, Z as requireProcessMeshCa, _ as signPairingProof, _t as verifyAgentUiUnlockTicket, a as hubHostFromMeshAddress, at as issueMeshLeafForNode, b as MembershipResponder, bt as isInsecureOrigin, c as PAIRING_MAX_SESSIONS, ct as AGENT_DASHBOARD_ORIGINS_FIELD, d as PAIRING_PROTOCOL, dt as AGENT_UI_UNLOCK_USE, et as createMeshCsrPem, f as PAIRING_TTL_MS, ft as AGENT_UI_UNLOCK_VERSION, g as keyFingerprintShort, gt as parseAgentDashboardOrigins, h as describeCsr, ht as mintAgentUiUnlockTicket, i as AgentPairing, it as isValidAgentNodeId, j as getProcessPeerLeaf, k as emitProcessNodeRegistered, l as PAIRING_PATHS, lt as AGENT_UI_UNLOCK_TTL_MS, m as computePairingSas, mt as isAllowedAgentDashboardReturnTo, n as HubPairing, nt as generateMeshCa, o as PAIRING_CODE_DIGITS, ot as issueMeshLeafFromCsr, p as computePairingCommitment, pt as UnlockTicketJtiStore, q as MeshCrl, r as PairingHttpError, rt as generateMeshKeyPair, s as PAIRING_MAX_CODE_ATTEMPTS, st as loadMeshCa, tt as exportMeshPrivateKeyPem, u as PAIRING_PIN_DIGITS, ut as AGENT_UI_UNLOCK_TYP, v as verifyPairingProof, vt as InvalidCorsOriginError, w as TlsTcpTransporter, wt as createCidrMatcher, x as signMembershipProof, xt as normalizeOrigin, y as MEMBERSHIP_PATHS, yt as OPAQUE_ORIGIN, z as setProcessMeshTlsListenerState } from "./builtins/system-config/system-config.addon.mjs";
|
|
37
37
|
import "./builtins/system-config/index.mjs";
|
|
38
38
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
39
39
|
import { C as isModelDownloaded, E as setHuggingFaceReachabilityObserver, T as revisionWeightUrl, _ as downloadFile, a as startEventLoopStallMonitor, b as fetchJson, c as createAuthenticatedFileServer, d as resolveFilePath, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, u as parseTokenizedUrl, v as downloadModel, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-oHl1xltx.mjs";
|
|
40
|
-
import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-
|
|
40
|
+
import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-DWzAoaKF.mjs";
|
|
41
41
|
import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
|
|
42
42
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
|
|
43
|
-
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-
|
|
43
|
+
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-CfET1ups.mjs";
|
|
44
44
|
import { r as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-DBlgWB8k.mjs";
|
|
45
45
|
import { z } from "zod";
|
|
46
46
|
import * as crypto$1 from "node:crypto";
|
|
@@ -52,7 +52,7 @@ import * as path$1 from "node:path";
|
|
|
52
52
|
import { basename, dirname, isAbsolute, join, resolve } from "node:path";
|
|
53
53
|
import * as util from "node:util";
|
|
54
54
|
import { promisify } from "node:util";
|
|
55
|
-
import { BOOT_RECOVERY_BACKOFF_MS, CALLER_STAMPED_CAPABILITIES, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, ErrorI18nPayloadSchema, EventCategory, MIGRATION_API_VERSION, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, ReadinessRegistry as ReadinessRegistry$1, addonSliceHandleApi, asJsonObject, asString, collectZodSecretPaths, createDebugEmitter, createDeviceProxy, createEvent, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods as expandCapMethods$1, maskUrlCredentials, readErrorI18n, readNodePin, resolveDeviceSettings, scopeKey as scopeKey$1, scrubKnownSecrets, sleep, withCapInputDefaults } from "@camstack/types/addon";
|
|
55
|
+
import { BOOT_RECOVERY_BACKOFF_MS, CALLER_STAMPED_CAPABILITIES, COLLECTION_ARRAY_METHODS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, ErrorI18nPayloadSchema, EventCategory, MIGRATION_API_VERSION, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, ReadinessRegistry as ReadinessRegistry$1, addonSliceHandleApi, asJsonObject, asString, collectZodSecretPaths, createDebugEmitter, createDeviceProxy, createEvent, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods as expandCapMethods$1, maskUrlCredentials, readErrorI18n, readNodePin, resolveDeviceSettings, scopeKey as scopeKey$1, scrubKnownSecrets, sleep, withCapInputDefaults } from "@camstack/types/addon";
|
|
56
56
|
import * as os$1 from "node:os";
|
|
57
57
|
import { tmpdir } from "node:os";
|
|
58
58
|
import { pathToFileURL } from "node:url";
|
|
@@ -17567,6 +17567,22 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
17567
17567
|
return deviceApi;
|
|
17568
17568
|
}
|
|
17569
17569
|
//#endregion
|
|
17570
|
+
//#region src/kernel/transport/cap-routing-hints.ts
|
|
17571
|
+
/** Lift {@link CapRoutingHints} from a call's args. Never throws. */
|
|
17572
|
+
function liftRoutingHints(args) {
|
|
17573
|
+
if (args === null || typeof args !== "object" || Array.isArray(args)) return {};
|
|
17574
|
+
const nodeId = Reflect.get(args, "nodeId");
|
|
17575
|
+
const addonId = Reflect.get(args, "addonId");
|
|
17576
|
+
const provider = Reflect.get(args, "provider");
|
|
17577
|
+
const deviceId = Reflect.get(args, "deviceId");
|
|
17578
|
+
return {
|
|
17579
|
+
...typeof nodeId === "string" && nodeId.length > 0 ? { nodeId } : {},
|
|
17580
|
+
...typeof addonId === "string" && addonId.length > 0 ? { addonId } : {},
|
|
17581
|
+
...typeof provider === "string" && provider.length > 0 ? { provider } : {},
|
|
17582
|
+
...typeof deviceId === "number" && Number.isFinite(deviceId) ? { deviceId } : {}
|
|
17583
|
+
};
|
|
17584
|
+
}
|
|
17585
|
+
//#endregion
|
|
17570
17586
|
//#region src/kernel/moleculer/resilient-cap-call.ts
|
|
17571
17587
|
/** Moleculer error `type` values meaning "the service is not (yet) routable". */
|
|
17572
17588
|
var DISCOVERY_ERROR_TYPES = new Set(["SERVICE_NOT_FOUND", "SERVICE_NOT_AVAILABLE"]);
|
|
@@ -20602,22 +20618,6 @@ function buildCapChildIndex(entries) {
|
|
|
20602
20618
|
return new MapCapChildIndex(deviceOwners, singletons);
|
|
20603
20619
|
}
|
|
20604
20620
|
//#endregion
|
|
20605
|
-
//#region src/kernel/transport/cap-routing-hints.ts
|
|
20606
|
-
/** Lift {@link CapRoutingHints} from a call's args. Never throws. */
|
|
20607
|
-
function liftRoutingHints(args) {
|
|
20608
|
-
if (args === null || typeof args !== "object" || Array.isArray(args)) return {};
|
|
20609
|
-
const nodeId = Reflect.get(args, "nodeId");
|
|
20610
|
-
const addonId = Reflect.get(args, "addonId");
|
|
20611
|
-
const provider = Reflect.get(args, "provider");
|
|
20612
|
-
const deviceId = Reflect.get(args, "deviceId");
|
|
20613
|
-
return {
|
|
20614
|
-
...typeof nodeId === "string" && nodeId.length > 0 ? { nodeId } : {},
|
|
20615
|
-
...typeof addonId === "string" && addonId.length > 0 ? { addonId } : {},
|
|
20616
|
-
...typeof provider === "string" && provider.length > 0 ? { provider } : {},
|
|
20617
|
-
...typeof deviceId === "number" && Number.isFinite(deviceId) ? { deviceId } : {}
|
|
20618
|
-
};
|
|
20619
|
-
}
|
|
20620
|
-
//#endregion
|
|
20621
20621
|
//#region src/kernel/transport/claimed-get-status.ts
|
|
20622
20622
|
var GET_STATUS_METHOD = "getStatus";
|
|
20623
20623
|
/** The device a `getStatus` is about, or `undefined` when the call is not one. */
|
|
@@ -22344,7 +22344,12 @@ function localProviderLink(resolver, observerOpts) {
|
|
|
22344
22344
|
const pinnedNodeId = readNodePin(op.context);
|
|
22345
22345
|
if (pinnedNodeId !== void 0 && pinnedNodeId !== localBase) return next(opWithDefaults);
|
|
22346
22346
|
}
|
|
22347
|
-
|
|
22347
|
+
let provider;
|
|
22348
|
+
const pinnedAddonId = liftRoutingHints(op.input).addonId;
|
|
22349
|
+
if (pinnedAddonId !== void 0 && resolver.getByAddonId !== void 0 && Object.hasOwn(COLLECTION_ARRAY_METHODS, parsed.capName)) {
|
|
22350
|
+
provider = resolver.getByAddonId(parsed.capName, pinnedAddonId);
|
|
22351
|
+
if (!provider) return next(opWithDefaults);
|
|
22352
|
+
} else provider = resolver.getByName(parsed.capName);
|
|
22348
22353
|
if (!provider || typeof provider !== "object") return next(opWithDefaults);
|
|
22349
22354
|
const fn = Reflect.get(provider, parsed.method);
|
|
22350
22355
|
if (typeof fn !== "function") return next(opWithDefaults);
|
|
@@ -24324,6 +24329,9 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
24324
24329
|
const regs = getRegistries(nodeId);
|
|
24325
24330
|
const workerResolver = {
|
|
24326
24331
|
localNodeId: nodeId,
|
|
24332
|
+
getByAddonId(capabilityName, pinnedAddonId) {
|
|
24333
|
+
return regs.byAddonId.get(capabilityName)?.get(pinnedAddonId) ?? null;
|
|
24334
|
+
},
|
|
24327
24335
|
getByName(capabilityName) {
|
|
24328
24336
|
const preferred = regs.preferred.get(capabilityName);
|
|
24329
24337
|
if (preferred) {
|
|
@@ -30,6 +30,14 @@ export interface LocalProviderResolver {
|
|
|
30
30
|
* never pin a cap they themselves host.
|
|
31
31
|
*/
|
|
32
32
|
localNodeId?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The provider of `capabilityName` that THIS process registered for `addonId`,
|
|
35
|
+
* or `null` when that addon has none here. Lets {@link localProviderLink}
|
|
36
|
+
* honour the `{ addonId }` pin of a global collection cap: a runner that
|
|
37
|
+
* co-hosts its own provider must not answer a call pinned to another addon.
|
|
38
|
+
* Omit for resolvers that never host a collection provider (pin ignored).
|
|
39
|
+
*/
|
|
40
|
+
getByAddonId?(capabilityName: string, addonId: string): unknown | null;
|
|
33
41
|
}
|
|
34
42
|
/**
|
|
35
43
|
* A single tRPC cap call observation. Recorded by `localProviderLink`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { vs as collectSecretMarkerRefs } from "./dist-
|
|
1
|
+
import { vs as collectSecretMarkerRefs } from "./dist-W0Eyg7Fm.mjs";
|
|
2
2
|
//#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
|
|
3
3
|
/**
|
|
4
4
|
* Migration-only door for the leftover integration rows (planning#416).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as DataStoreDatabaseSchema, M as DATABASE_SNAPSHOT_SUFFIX, Ts as defineRecordKinds } from "./dist-
|
|
1
|
+
import { G as DataStoreDatabaseSchema, M as DATABASE_SNAPSHOT_SUFFIX, Ts as defineRecordKinds } from "./dist-W0Eyg7Fm.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createCipheriv, createDecipheriv, createHash, createPrivateKey, createPublicKey, diffieHellman, generateKeyPairSync, hkdfSync, randomBytes } from "node:crypto";
|
|
4
4
|
import { Buffer as Buffer$1 } from "buffer";
|
|
Binary file
|
|
Binary file
|