@camstack/server 1.2.742 → 1.2.744
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 +12 -0
- package/dist/agent/main.js +4 -2
- package/package.json +6 -14
- package/system/dist/addon-runner.js +145 -76
- package/system/dist/addon-runner.mjs +145 -76
- package/system/dist/{agent-https-CsDhLoui.js → agent-https-BcxBTl03.js} +1 -1
- package/system/dist/{agent-https-lgka7y2l.mjs → agent-https-zLZqE2uf.mjs} +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 +2 -2
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- 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 +3 -3
- package/system/dist/builtins/keychain/index.mjs +3 -3
- 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 +2 -2
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
- 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/{composition-sources-ny5MCbhd.js → composition-sources-B8hXkZdd.js} +1 -1
- package/system/dist/{composition-sources-BE6yrVCB.mjs → composition-sources-Bc_D8LR5.mjs} +1 -1
- package/system/dist/{constants-DiDTdj26.mjs → constants-CBAenEIc.mjs} +1 -1
- package/system/dist/{constants-BbgVaoOX.js → constants-oztBWIpa.js} +1 -1
- package/system/dist/{device-ca-BdgE_3J6.js → device-ca-C5TjvqyB.js} +1 -1
- package/system/dist/{device-ca-CVcZIfhA.mjs → device-ca-DgEn-SoG.mjs} +1 -1
- package/system/dist/{dist-DdlfeOQx.js → dist-B0zmp3zn.js} +38 -3
- package/system/dist/{dist-BqlGZK-1.mjs → dist-Cdz0_zxq.mjs} +38 -3
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-D3ZQMWjg.js → hub-mdns-ciao-DM_nVIFe.js} +2 -2
- package/system/dist/{hub-mdns-ciao-BZsVTXQ7.mjs → hub-mdns-ciao-nWSv_w8h.mjs} +2 -2
- package/system/dist/index.js +73 -11
- package/system/dist/index.mjs +73 -12
- package/system/dist/kernel/moleculer/runner-init-loop.d.ts +25 -0
- package/system/dist/kernel/transport/acting-addon.d.ts +17 -0
- package/system/dist/kernel/transport/child-cap-protocol.d.ts +12 -0
- package/system/dist/kernel/transport/index.d.ts +1 -0
- package/system/dist/kernel/transport/local-child-client.d.ts +2 -2
- package/system/dist/kernel/transport/local-child-registry.d.ts +7 -0
- package/system/dist/kernel/transport/runner-of-addon.d.ts +11 -0
- package/system/dist/migrations/hub/2026-11-02-records-owner-group-to-addon.d.ts +11 -0
- package/system/dist/{restore-archive-Ch76C3VQ.js → restore-archive-CS-DPZ3U.js} +1 -1
- package/system/dist/{restore-archive-BFem7ZuS.mjs → restore-archive-gAzBMq-y.mjs} +1 -1
- package/system/dist/{retention-DWsfcaKe.js → retention-CJ47t_51.js} +1 -1
- package/system/dist/{retention-D5Vk8FXc.mjs → retention-Cfw9Jeyz.mjs} +1 -1
- package/system/dist/{wal-maintenance-DcVdVWDD.js → wal-maintenance-BqyLi3Ko.js} +0 -0
- package/system/dist/{wal-maintenance-CS-Wtg9w.mjs → wal-maintenance-D8QmKPOV.mjs} +0 -0
- package/system/package.json +1 -1
|
@@ -3,11 +3,11 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-B0zmp3zn.js");
|
|
7
7
|
const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
|
|
8
8
|
const require_x509_es = require("../../x509.es-WtnRNyYS.js");
|
|
9
|
-
const require_agent_https = require("../../agent-https-
|
|
10
|
-
const require_constants$8 = require("../../constants-
|
|
9
|
+
const require_agent_https = require("../../agent-https-BcxBTl03.js");
|
|
10
|
+
const require_constants$8 = require("../../constants-oztBWIpa.js");
|
|
11
11
|
const require_src$1 = require("../../src-CnAqG6EF.js");
|
|
12
12
|
let zod = require("zod");
|
|
13
13
|
let node_crypto = require("node:crypto");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { Wt as ServerNameSchema, ca as shortHostname, cs as defineCustomActions, ho as BaseAddon, os as customAction, tc as errMsg, vs as hydrateSchema } from "../../dist-
|
|
2
|
+
import { Wt as ServerNameSchema, ca as shortHostname, cs as defineCustomActions, ho as BaseAddon, os as customAction, tc as errMsg, vs as hydrateSchema } from "../../dist-Cdz0_zxq.mjs";
|
|
3
3
|
import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
|
|
4
4
|
import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension } from "../../x509.es-BRiJgOvu.mjs";
|
|
5
|
-
import { B as setProcessAgentHttpsNames, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, R as AgentHttpsNames, V as systemConfigRecordKinds, u as isPrivateAddress, z as getProcessAgentHttpsNames } from "../../agent-https-
|
|
6
|
-
import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-
|
|
5
|
+
import { B as setProcessAgentHttpsNames, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, R as AgentHttpsNames, V as systemConfigRecordKinds, u as isPrivateAddress, z as getProcessAgentHttpsNames } from "../../agent-https-zLZqE2uf.mjs";
|
|
6
|
+
import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-CBAenEIc.mjs";
|
|
7
7
|
import { t as require_src } from "../../src-hG4grMU4.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { X509Certificate, createHash, createPrivateKey, randomBytes, randomInt, sign, timingSafeEqual, verify, webcrypto } from "node:crypto";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-B0zmp3zn.js");
|
|
7
7
|
const require_formatter = require("../../formatter-xbxeV4GD.js");
|
|
8
8
|
const require_log_file_read_protocol = require("../../log-file-read-protocol-D0WcLbIV.js");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $r as logDestinationCapability, ho as BaseAddon } from "../../dist-
|
|
1
|
+
import { $r as logDestinationCapability, ho as BaseAddon } from "../../dist-Cdz0_zxq.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
|
|
3
3
|
import { a as LogFileIndexStore, i as serveRead, n as isFromReader, t as CancelBook } from "../../log-file-read-protocol-B7M3X3bT.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Qa as compositionSourceKey, tc as errMsg } from "./dist-
|
|
1
|
+
import { Qa as compositionSourceKey, tc as errMsg } from "./dist-Cdz0_zxq.mjs";
|
|
2
2
|
//#region src/builtins/shared/device-state-changed.ts
|
|
3
3
|
/** Structural narrowing helper for untrusted bus payloads. */
|
|
4
4
|
function isRecord(value) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
|
|
2
|
-
var MESH_CA_KEY_REF = require("./dist-
|
|
2
|
+
var MESH_CA_KEY_REF = require("./dist-B0zmp3zn.js").buildSecretRef({
|
|
3
3
|
owner: "system",
|
|
4
4
|
scope: { kind: "global" },
|
|
5
5
|
fieldPath: "meshCaKey"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as DEVICE_SAN_CREDENTIAL_PREFIX, U as DEVICE_SAN_USER_PREFIX, es as buildSecretRef } from "./dist-
|
|
1
|
+
import { H as DEVICE_SAN_CREDENTIAL_PREFIX, U as DEVICE_SAN_USER_PREFIX, es as buildSecretRef } from "./dist-Cdz0_zxq.mjs";
|
|
2
2
|
import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-BRiJgOvu.mjs";
|
|
3
3
|
import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
|
|
4
4
|
//#region src/auth/jwt-signing-key.ts
|
|
@@ -1165,7 +1165,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1165
1165
|
return DeviceRole;
|
|
1166
1166
|
}({});
|
|
1167
1167
|
//#endregion
|
|
1168
|
-
//#region ../types/dist/sleep-
|
|
1168
|
+
//#region ../types/dist/sleep-C6LqREpb.mjs
|
|
1169
1169
|
/**
|
|
1170
1170
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
1171
1171
|
* window to float samples (D455).
|
|
@@ -1245,6 +1245,22 @@ function buildAlawTable() {
|
|
|
1245
1245
|
buildUlawTable();
|
|
1246
1246
|
buildAlawTable();
|
|
1247
1247
|
/**
|
|
1248
|
+
* An addon whose own migrations did not apply refuses to initialise (D987). The error is typed
|
|
1249
|
+
* so a runner hosting several addons can tell "this addon is blocked" from a crash and keep its
|
|
1250
|
+
* co-located siblings running. Recognised by NAME and shape, never `instanceof`: a forked addon
|
|
1251
|
+
* bundles its own copy of this module, so the class the runner sees is not the one that threw.
|
|
1252
|
+
*/
|
|
1253
|
+
var MIGRATIONS_BLOCKED_ERROR_NAME = "AddonMigrationsBlockedError";
|
|
1254
|
+
var AddonMigrationsBlockedError = class extends Error {
|
|
1255
|
+
/** The ledger ids that did not apply and block the owner. */
|
|
1256
|
+
migrationIds;
|
|
1257
|
+
constructor(migrationIds) {
|
|
1258
|
+
super(`migration(s) ${migrationIds.join(", ")} did not apply and block this addon — fix or retry them (migrations.retry), then restart it`);
|
|
1259
|
+
this.name = MIGRATIONS_BLOCKED_ERROR_NAME;
|
|
1260
|
+
this.migrationIds = migrationIds;
|
|
1261
|
+
}
|
|
1262
|
+
};
|
|
1263
|
+
/**
|
|
1248
1264
|
* The value a redacted secret is replaced with on every read surface.
|
|
1249
1265
|
*
|
|
1250
1266
|
* It is also the WRITE-BACK token: an `upsertLocation` that sends this value
|
|
@@ -3023,7 +3039,7 @@ var BaseAddon = class {
|
|
|
3023
3039
|
startMigration: (input) => api.startMigration.mutate(input),
|
|
3024
3040
|
finishMigration: (input) => api.finishMigration.mutate(input)
|
|
3025
3041
|
}, migrations, this.ctx.logger);
|
|
3026
|
-
if (report.blockOwner.length > 0) throw new
|
|
3042
|
+
if (report.blockOwner.length > 0) throw new AddonMigrationsBlockedError(report.blockOwner);
|
|
3027
3043
|
return report;
|
|
3028
3044
|
}
|
|
3029
3045
|
/**
|
|
@@ -75600,6 +75616,21 @@ var NcTemplateVarKindSchema = zod.z.enum([
|
|
|
75600
75616
|
"sound",
|
|
75601
75617
|
"system"
|
|
75602
75618
|
]);
|
|
75619
|
+
/**
|
|
75620
|
+
* The default title/body a rule of one SITUATION is delivered with when the
|
|
75621
|
+
* operator wrote no template — served so an editor can pre-fill it (and the
|
|
75622
|
+
* operator can rebuild it from placeholders) instead of starting from a blank
|
|
75623
|
+
* box that, once saved, silently replaces it. `id` names the situation inside
|
|
75624
|
+
* a rule `kind`: `appliance-cycle` is a `sensor` rule whose device is an
|
|
75625
|
+
* appliance finishing a cycle. Texts are raw templates (`{{var}}` intact), in
|
|
75626
|
+
* the hub's current language and with its overrides applied.
|
|
75627
|
+
*/
|
|
75628
|
+
var NcTemplateDefaultSchema = zod.z.object({
|
|
75629
|
+
id: zod.z.enum(["appliance-cycle"]),
|
|
75630
|
+
kind: NcRuleKindSchema,
|
|
75631
|
+
title: zod.z.string(),
|
|
75632
|
+
body: zod.z.string()
|
|
75633
|
+
});
|
|
75603
75634
|
/** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
|
|
75604
75635
|
var NcTemplateFamilySchema = zod.z.enum([
|
|
75605
75636
|
"rule",
|
|
@@ -76562,7 +76593,11 @@ var notificationRulesCapability = {
|
|
|
76562
76593
|
taxonomy: NcTaxonomySchema.optional()
|
|
76563
76594
|
})),
|
|
76564
76595
|
/** The declared `{{var}}` vocabulary; editors filter it with `templateVarsFor`. */
|
|
76565
|
-
getTemplateCatalog: method(zod.z.object({}), zod.z.object({
|
|
76596
|
+
getTemplateCatalog: method(zod.z.object({}), zod.z.object({
|
|
76597
|
+
vars: zod.z.array(NcTemplateVarDescriptorSchema),
|
|
76598
|
+
/** Per-situation default texts; absent on a hub that predates them. */
|
|
76599
|
+
defaults: zod.z.array(NcTemplateDefaultSchema)
|
|
76600
|
+
})),
|
|
76566
76601
|
/**
|
|
76567
76602
|
* Render a template with example values, through the hub's text catalog.
|
|
76568
76603
|
* Pure: sends nothing. A MUTATION only for transport — a 2.5k-char draft in
|
|
@@ -1165,7 +1165,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1165
1165
|
return DeviceRole;
|
|
1166
1166
|
}({});
|
|
1167
1167
|
//#endregion
|
|
1168
|
-
//#region ../types/dist/sleep-
|
|
1168
|
+
//#region ../types/dist/sleep-C6LqREpb.mjs
|
|
1169
1169
|
/**
|
|
1170
1170
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
1171
1171
|
* window to float samples (D455).
|
|
@@ -1245,6 +1245,22 @@ function buildAlawTable() {
|
|
|
1245
1245
|
buildUlawTable();
|
|
1246
1246
|
buildAlawTable();
|
|
1247
1247
|
/**
|
|
1248
|
+
* An addon whose own migrations did not apply refuses to initialise (D987). The error is typed
|
|
1249
|
+
* so a runner hosting several addons can tell "this addon is blocked" from a crash and keep its
|
|
1250
|
+
* co-located siblings running. Recognised by NAME and shape, never `instanceof`: a forked addon
|
|
1251
|
+
* bundles its own copy of this module, so the class the runner sees is not the one that threw.
|
|
1252
|
+
*/
|
|
1253
|
+
var MIGRATIONS_BLOCKED_ERROR_NAME = "AddonMigrationsBlockedError";
|
|
1254
|
+
var AddonMigrationsBlockedError = class extends Error {
|
|
1255
|
+
/** The ledger ids that did not apply and block the owner. */
|
|
1256
|
+
migrationIds;
|
|
1257
|
+
constructor(migrationIds) {
|
|
1258
|
+
super(`migration(s) ${migrationIds.join(", ")} did not apply and block this addon — fix or retry them (migrations.retry), then restart it`);
|
|
1259
|
+
this.name = MIGRATIONS_BLOCKED_ERROR_NAME;
|
|
1260
|
+
this.migrationIds = migrationIds;
|
|
1261
|
+
}
|
|
1262
|
+
};
|
|
1263
|
+
/**
|
|
1248
1264
|
* The value a redacted secret is replaced with on every read surface.
|
|
1249
1265
|
*
|
|
1250
1266
|
* It is also the WRITE-BACK token: an `upsertLocation` that sends this value
|
|
@@ -3023,7 +3039,7 @@ var BaseAddon = class {
|
|
|
3023
3039
|
startMigration: (input) => api.startMigration.mutate(input),
|
|
3024
3040
|
finishMigration: (input) => api.finishMigration.mutate(input)
|
|
3025
3041
|
}, migrations, this.ctx.logger);
|
|
3026
|
-
if (report.blockOwner.length > 0) throw new
|
|
3042
|
+
if (report.blockOwner.length > 0) throw new AddonMigrationsBlockedError(report.blockOwner);
|
|
3027
3043
|
return report;
|
|
3028
3044
|
}
|
|
3029
3045
|
/**
|
|
@@ -75600,6 +75616,21 @@ var NcTemplateVarKindSchema = z.enum([
|
|
|
75600
75616
|
"sound",
|
|
75601
75617
|
"system"
|
|
75602
75618
|
]);
|
|
75619
|
+
/**
|
|
75620
|
+
* The default title/body a rule of one SITUATION is delivered with when the
|
|
75621
|
+
* operator wrote no template — served so an editor can pre-fill it (and the
|
|
75622
|
+
* operator can rebuild it from placeholders) instead of starting from a blank
|
|
75623
|
+
* box that, once saved, silently replaces it. `id` names the situation inside
|
|
75624
|
+
* a rule `kind`: `appliance-cycle` is a `sensor` rule whose device is an
|
|
75625
|
+
* appliance finishing a cycle. Texts are raw templates (`{{var}}` intact), in
|
|
75626
|
+
* the hub's current language and with its overrides applied.
|
|
75627
|
+
*/
|
|
75628
|
+
var NcTemplateDefaultSchema = z.object({
|
|
75629
|
+
id: z.enum(["appliance-cycle"]),
|
|
75630
|
+
kind: NcRuleKindSchema,
|
|
75631
|
+
title: z.string(),
|
|
75632
|
+
body: z.string()
|
|
75633
|
+
});
|
|
75603
75634
|
/** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
|
|
75604
75635
|
var NcTemplateFamilySchema = z.enum([
|
|
75605
75636
|
"rule",
|
|
@@ -76562,7 +76593,11 @@ var notificationRulesCapability = {
|
|
|
76562
76593
|
taxonomy: NcTaxonomySchema.optional()
|
|
76563
76594
|
})),
|
|
76564
76595
|
/** The declared `{{var}}` vocabulary; editors filter it with `templateVarsFor`. */
|
|
76565
|
-
getTemplateCatalog: method(z.object({}), z.object({
|
|
76596
|
+
getTemplateCatalog: method(z.object({}), z.object({
|
|
76597
|
+
vars: z.array(NcTemplateVarDescriptorSchema),
|
|
76598
|
+
/** Per-situation default texts; absent on a hub that predates them. */
|
|
76599
|
+
defaults: z.array(NcTemplateDefaultSchema)
|
|
76600
|
+
})),
|
|
76566
76601
|
/**
|
|
76567
76602
|
* Render a template with example values, through the hub's text catalog.
|
|
76568
76603
|
* Pure: sends nothing. A MUTATION only for transport — a 2.5k-char draft in
|
|
@@ -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-BqyLi3Ko.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-D8QmKPOV.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-B0zmp3zn.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-BcxBTl03.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 { Xs as userError } from "./dist-
|
|
2
|
+
import { Xs as userError } from "./dist-Cdz0_zxq.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-zLZqE2uf.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-B0zmp3zn.js");
|
|
4
|
+
const require_device_ca = require("./device-ca-C5TjvqyB.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,21 +26,21 @@ 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-
|
|
29
|
+
const require_wal_maintenance = require("./wal-maintenance-BqyLi3Ko.js");
|
|
30
30
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
|
|
31
31
|
const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
|
|
32
32
|
const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
|
|
33
33
|
require("./builtins/storage-orchestrator/index.js");
|
|
34
|
-
const require_agent_https = require("./agent-https-
|
|
35
|
-
const require_constants = require("./constants-
|
|
34
|
+
const require_agent_https = require("./agent-https-BcxBTl03.js");
|
|
35
|
+
const require_constants = require("./constants-oztBWIpa.js");
|
|
36
36
|
const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
|
|
37
37
|
require("./builtins/system-config/index.js");
|
|
38
38
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
39
39
|
const require_custom_action_registry = require("./custom-action-registry-JuMHGKEc.js");
|
|
40
|
-
const require_hub_mdns_ciao = require("./hub-mdns-ciao-
|
|
40
|
+
const require_hub_mdns_ciao = require("./hub-mdns-ciao-DM_nVIFe.js");
|
|
41
41
|
const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
|
|
42
42
|
const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
|
|
43
|
-
const require_restore_archive = require("./restore-archive-
|
|
43
|
+
const require_restore_archive = require("./restore-archive-CS-DPZ3U.js");
|
|
44
44
|
const require_coral_accelerators = require("./coral-accelerators-BSVsBVzt.js");
|
|
45
45
|
let zod = require("zod");
|
|
46
46
|
let node_crypto = require("node:crypto");
|
|
@@ -19665,6 +19665,22 @@ function createLocalTransport() {
|
|
|
19665
19665
|
};
|
|
19666
19666
|
}
|
|
19667
19667
|
//#endregion
|
|
19668
|
+
//#region src/kernel/transport/runner-of-addon.ts
|
|
19669
|
+
/**
|
|
19670
|
+
* The agent's runner -> addons map, filled where a spawn plan computes each addon's runner id
|
|
19671
|
+
* (`resolveRunnerId`) and read by the agent's `LocalChildRegistry` to verify which addon a grouped
|
|
19672
|
+
* runner acts for. An addon never planned here resolves to itself, as on the hub.
|
|
19673
|
+
*/
|
|
19674
|
+
var RunnerOfAddon = class {
|
|
19675
|
+
byAddon = /* @__PURE__ */ new Map();
|
|
19676
|
+
/** Remember the plan and hand the runner id back, so the call site stays one expression. */
|
|
19677
|
+
record(addonId, runnerId) {
|
|
19678
|
+
this.byAddon.set(addonId, runnerId);
|
|
19679
|
+
return runnerId;
|
|
19680
|
+
}
|
|
19681
|
+
resolve = (addonId) => this.byAddon.get(addonId) ?? addonId;
|
|
19682
|
+
};
|
|
19683
|
+
//#endregion
|
|
19668
19684
|
//#region src/kernel/moleculer/cap-usage-registry.ts
|
|
19669
19685
|
/**
|
|
19670
19686
|
* In-memory observation of tRPC cap calls between addons — the store behind
|
|
@@ -20343,6 +20359,30 @@ async function answerDeviceCallRedirect(hook, call) {
|
|
|
20343
20359
|
});
|
|
20344
20360
|
return answer.kind === "redirected" ? { result: answer.result } : null;
|
|
20345
20361
|
}
|
|
20362
|
+
//#endregion
|
|
20363
|
+
//#region src/kernel/transport/acting-addon.ts
|
|
20364
|
+
/**
|
|
20365
|
+
* The addon a grouped child acts for (the records owner).
|
|
20366
|
+
*
|
|
20367
|
+
* A grouped runner is stamped with its GROUP id by the transport, and the group can change when
|
|
20368
|
+
* the grouping does; the data of the caps below is keyed by the ADDON, which never changes. The
|
|
20369
|
+
* child therefore claims the addon it acts for, and the parent checks the claim against its own
|
|
20370
|
+
* runner map before it stamps the call with it.
|
|
20371
|
+
*/
|
|
20372
|
+
/** The caps whose rows and secret refs are keyed by the calling ADDON, not by its runner. */
|
|
20373
|
+
var ADDON_KEYED_CAPS = ["records"];
|
|
20374
|
+
/** A child claimed an addon its runner does not host. Typed so a caller can tell it from a crash. */
|
|
20375
|
+
var ActingAddonRefusedError = class extends Error {
|
|
20376
|
+
runnerId;
|
|
20377
|
+
claimedAddonId;
|
|
20378
|
+
code = "acting-addon-not-hosted";
|
|
20379
|
+
constructor(runnerId, claimedAddonId) {
|
|
20380
|
+
super(`acting-addon-not-hosted: runner "${runnerId}" does not host addon "${claimedAddonId}"; the call is refused`);
|
|
20381
|
+
this.runnerId = runnerId;
|
|
20382
|
+
this.claimedAddonId = claimedAddonId;
|
|
20383
|
+
this.name = "ActingAddonRefusedError";
|
|
20384
|
+
}
|
|
20385
|
+
};
|
|
20346
20386
|
/** The source every runner lifecycle event this registry emits carries. */
|
|
20347
20387
|
var LIFECYCLE_SOURCE = {
|
|
20348
20388
|
type: "core",
|
|
@@ -21011,6 +21051,22 @@ var LocalChildRegistry = class {
|
|
|
21011
21051
|
});
|
|
21012
21052
|
}
|
|
21013
21053
|
}
|
|
21054
|
+
/**
|
|
21055
|
+
* The caller stamp of a `cap-call-out`. A claim (`actingAddonId`) is checked against the
|
|
21056
|
+
* runner map the parent built at spawn (`resolveChildIdForAddon`, identity for a solo runner):
|
|
21057
|
+
* a runner that does not host the addon is refused. Only the caps keyed by the ADDON
|
|
21058
|
+
* (`ADDON_KEYED_CAPS`) use the verified addon id; every other cap keeps the runner stamp.
|
|
21059
|
+
*/
|
|
21060
|
+
callerStampOf(childId, out) {
|
|
21061
|
+
const claimed = out.actingAddonId;
|
|
21062
|
+
if (claimed === void 0 || childId === null) return childId;
|
|
21063
|
+
if (this.resolveChildIdForAddon === void 0) {
|
|
21064
|
+
if (claimed !== childId && ADDON_KEYED_CAPS.includes(out.capName)) throw new ActingAddonRefusedError(childId, claimed);
|
|
21065
|
+
return childId;
|
|
21066
|
+
}
|
|
21067
|
+
if ((this.resolveChildIdForAddon(claimed) ?? claimed) !== childId) throw new ActingAddonRefusedError(childId, claimed);
|
|
21068
|
+
return ADDON_KEYED_CAPS.includes(out.capName) ? claimed : childId;
|
|
21069
|
+
}
|
|
21014
21070
|
onConnection(channel) {
|
|
21015
21071
|
let childId = null;
|
|
21016
21072
|
const incarnation = this.nextIncarnation++;
|
|
@@ -21084,6 +21140,7 @@ var LocalChildRegistry = class {
|
|
|
21084
21140
|
}
|
|
21085
21141
|
if (msg.kind === "cap-call-out") {
|
|
21086
21142
|
const out = msg;
|
|
21143
|
+
const callerStamp = this.callerStampOf(childId, out);
|
|
21087
21144
|
const hints = out.hints ?? liftRoutingHints(out.args);
|
|
21088
21145
|
const materialise = () => payload !== void 0 ? unpackPayload(payload) : out.args;
|
|
21089
21146
|
const buildInput = () => ({
|
|
@@ -21093,7 +21150,7 @@ var LocalChildRegistry = class {
|
|
|
21093
21150
|
...out.deviceId !== void 0 ? { deviceId: out.deviceId } : {},
|
|
21094
21151
|
...out.nodeId !== void 0 ? { nodeId: out.nodeId } : {},
|
|
21095
21152
|
...out.native === true ? { native: true } : {},
|
|
21096
|
-
...
|
|
21153
|
+
...callerStamp !== null ? { callerAddonId: callerStamp } : {}
|
|
21097
21154
|
});
|
|
21098
21155
|
if (this.claimedStatus !== void 0 && out.method === "getStatus") {
|
|
21099
21156
|
const claimed = await answerClaimedGetStatus(this.claimedStatus, {
|
|
@@ -21139,7 +21196,7 @@ var LocalChildRegistry = class {
|
|
|
21139
21196
|
method: out.method,
|
|
21140
21197
|
args: void 0,
|
|
21141
21198
|
...out.deviceId !== void 0 ? { deviceId: out.deviceId } : {},
|
|
21142
|
-
...
|
|
21199
|
+
...callerStamp !== null ? { callerAddonId: callerStamp } : {}
|
|
21143
21200
|
};
|
|
21144
21201
|
const declared = this.capTimeoutMs?.(out.capName, out.method);
|
|
21145
21202
|
return entry.channel.request(forward, {
|
|
@@ -21512,7 +21569,8 @@ var LocalChildClient = class {
|
|
|
21512
21569
|
const routing = {
|
|
21513
21570
|
...input.deviceId !== void 0 ? { deviceId: input.deviceId } : {},
|
|
21514
21571
|
...input.nodeId !== void 0 ? { nodeId: input.nodeId } : {},
|
|
21515
|
-
...input.native === true ? { native: true } : {}
|
|
21572
|
+
...input.native === true ? { native: true } : {},
|
|
21573
|
+
...input.actingAddonId !== void 0 ? { actingAddonId: input.actingAddonId } : {}
|
|
21516
21574
|
};
|
|
21517
21575
|
if (this.parentRawForward && input.args !== void 0) {
|
|
21518
21576
|
const hints = liftRoutingHints(input.args);
|
|
@@ -24002,7 +24060,10 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
24002
24060
|
const links = [localProviderLink(workerResolver, observerOpts)];
|
|
24003
24061
|
if (runtime.mode === "uds") {
|
|
24004
24062
|
const udsClient = runtime.client;
|
|
24005
|
-
links.push(ipcParentLink(() => (input) => udsClient.callOut(
|
|
24063
|
+
links.push(ipcParentLink(() => (input) => udsClient.callOut({
|
|
24064
|
+
...input,
|
|
24065
|
+
actingAddonId: addonId
|
|
24066
|
+
})));
|
|
24006
24067
|
} else {
|
|
24007
24068
|
const parentCallOutGetter = options?.getParentCallOut;
|
|
24008
24069
|
if (parentCallOutGetter !== void 0) links.push(ipcParentLink(parentCallOutGetter));
|
|
@@ -28265,6 +28326,7 @@ exports.ReadinessTimeoutError = require_dist.ReadinessTimeoutError;
|
|
|
28265
28326
|
exports.RecordsEngine = require_wal_maintenance.RecordsEngine;
|
|
28266
28327
|
exports.ReplEngine = ReplEngine;
|
|
28267
28328
|
exports.RingBuffer = RingBuffer;
|
|
28329
|
+
exports.RunnerOfAddon = RunnerOfAddon;
|
|
28268
28330
|
exports.SERVER_AUTH_OID = require_agent_https.SERVER_AUTH_OID;
|
|
28269
28331
|
exports.SERVER_NAMESPACE = SERVER_NAMESPACE;
|
|
28270
28332
|
exports.SOCKET_PLANE_TOP_N = SOCKET_PLANE_TOP_N;
|