@camstack/system 1.2.344 → 1.2.346

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.
@@ -0,0 +1,110 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ require("../../chunk-Cek0wNdY.js");
6
+ const require_dist = require("../../dist-CqafgUSr.js");
7
+ const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
+ //#region src/builtins/calendars/calendars.addon.ts
9
+ /**
10
+ * Hub calendars aggregator — walks `calendar-source` providers and stamps
11
+ * cluster-stable ids (`<providerAddonId>:<localId>`).
12
+ */
13
+ var PER_SOURCE_TIMEOUT_MS = 2500;
14
+ var HA_ADDON_ID = "provider-homeassistant";
15
+ function stampId(providerAddonId, localId) {
16
+ return `${providerAddonId}:${localId}`;
17
+ }
18
+ function localIdOf(stamped, providerAddonId) {
19
+ const prefix = `${providerAddonId}:`;
20
+ if (!stamped.startsWith(prefix)) return null;
21
+ return stamped.slice(prefix.length);
22
+ }
23
+ var CalendarsAddon = class extends require_dist.BaseAddon {
24
+ id = "calendars";
25
+ constructor() {
26
+ super({});
27
+ }
28
+ async onInitialize() {
29
+ const provider = {
30
+ listCalendars: async () => this.listCalendars(),
31
+ listEvents: async (input) => this.listEvents(input),
32
+ importFromHomeAssistant: async () => this.importFromHomeAssistant()
33
+ };
34
+ this.ctx.logger.info("Initialized — aggregating calendar-source providers");
35
+ return [{
36
+ capability: require_dist.calendarsCapability,
37
+ provider
38
+ }];
39
+ }
40
+ sources() {
41
+ return (this.capabilities?.getCollectionEntries("calendar-source") ?? []).map(([id, provider]) => ({
42
+ id,
43
+ provider
44
+ }));
45
+ }
46
+ async listCalendars() {
47
+ const settled = await require_settle_sources.settleSourcesWithTimeout(this.sources().map((s) => [s.id, async () => {
48
+ return (await s.provider.listCalendars()).map((cal) => ({
49
+ ...cal,
50
+ id: stampId(s.id, cal.id),
51
+ providerAddonId: s.id
52
+ }));
53
+ }]), PER_SOURCE_TIMEOUT_MS);
54
+ const out = [];
55
+ for (const [sourceId, result] of settled) if (result.ok) for (const entry of result.value) out.push(entry);
56
+ else this.ctx.logger.warn("calendar-source provider failed", { meta: {
57
+ sourceId,
58
+ error: result.error.message
59
+ } });
60
+ return out;
61
+ }
62
+ async listEvents(input) {
63
+ const sources = this.sources();
64
+ const wanted = input.calendarIds !== void 0 ? new Set(input.calendarIds) : null;
65
+ const settled = await require_settle_sources.settleSourcesWithTimeout(sources.map((s) => {
66
+ const localIds = wanted === null ? void 0 : [...wanted].map((id) => localIdOf(id, s.id)).filter((id) => id !== null);
67
+ return [s.id, async () => {
68
+ if (wanted !== null && localIds !== void 0 && localIds.length === 0) return [];
69
+ return (await s.provider.listEvents({
70
+ startMs: input.startMs,
71
+ endMs: input.endMs,
72
+ ...localIds !== void 0 ? { calendarIds: [...localIds] } : {}
73
+ })).map((ev) => ({
74
+ ...ev,
75
+ calendarId: stampId(s.id, ev.calendarId),
76
+ id: stampId(s.id, ev.id)
77
+ }));
78
+ }];
79
+ }), PER_SOURCE_TIMEOUT_MS);
80
+ const out = [];
81
+ for (const [sourceId, result] of settled) if (result.ok) for (const ev of result.value) out.push(ev);
82
+ else this.ctx.logger.warn("calendar-source listEvents failed", { meta: {
83
+ sourceId,
84
+ error: result.error.message
85
+ } });
86
+ return out.toSorted((a, b) => a.startMs - b.startMs);
87
+ }
88
+ async importFromHomeAssistant() {
89
+ const ha = this.sources().find((s) => s.id === HA_ADDON_ID || s.id.includes("homeassistant"));
90
+ if (ha === void 0) return {
91
+ imported: 0,
92
+ error: "No Home Assistant calendar-source provider is registered"
93
+ };
94
+ try {
95
+ return {
96
+ imported: (await ha.provider.listCalendars()).length,
97
+ providerAddonId: ha.id
98
+ };
99
+ } catch (err) {
100
+ return {
101
+ imported: 0,
102
+ providerAddonId: ha.id,
103
+ error: require_dist.errMsg(err)
104
+ };
105
+ }
106
+ }
107
+ };
108
+ //#endregion
109
+ exports.CalendarsAddon = CalendarsAddon;
110
+ exports.default = CalendarsAddon;
@@ -0,0 +1,104 @@
1
+ import { Gn as BaseAddon, Wn as errMsg, Z as calendarsCapability } from "../../dist-0zO6jHkf.mjs";
2
+ import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
+ //#region src/builtins/calendars/calendars.addon.ts
4
+ /**
5
+ * Hub calendars aggregator — walks `calendar-source` providers and stamps
6
+ * cluster-stable ids (`<providerAddonId>:<localId>`).
7
+ */
8
+ var PER_SOURCE_TIMEOUT_MS = 2500;
9
+ var HA_ADDON_ID = "provider-homeassistant";
10
+ function stampId(providerAddonId, localId) {
11
+ return `${providerAddonId}:${localId}`;
12
+ }
13
+ function localIdOf(stamped, providerAddonId) {
14
+ const prefix = `${providerAddonId}:`;
15
+ if (!stamped.startsWith(prefix)) return null;
16
+ return stamped.slice(prefix.length);
17
+ }
18
+ var CalendarsAddon = class extends BaseAddon {
19
+ id = "calendars";
20
+ constructor() {
21
+ super({});
22
+ }
23
+ async onInitialize() {
24
+ const provider = {
25
+ listCalendars: async () => this.listCalendars(),
26
+ listEvents: async (input) => this.listEvents(input),
27
+ importFromHomeAssistant: async () => this.importFromHomeAssistant()
28
+ };
29
+ this.ctx.logger.info("Initialized — aggregating calendar-source providers");
30
+ return [{
31
+ capability: calendarsCapability,
32
+ provider
33
+ }];
34
+ }
35
+ sources() {
36
+ return (this.capabilities?.getCollectionEntries("calendar-source") ?? []).map(([id, provider]) => ({
37
+ id,
38
+ provider
39
+ }));
40
+ }
41
+ async listCalendars() {
42
+ const settled = await settleSourcesWithTimeout(this.sources().map((s) => [s.id, async () => {
43
+ return (await s.provider.listCalendars()).map((cal) => ({
44
+ ...cal,
45
+ id: stampId(s.id, cal.id),
46
+ providerAddonId: s.id
47
+ }));
48
+ }]), PER_SOURCE_TIMEOUT_MS);
49
+ const out = [];
50
+ for (const [sourceId, result] of settled) if (result.ok) for (const entry of result.value) out.push(entry);
51
+ else this.ctx.logger.warn("calendar-source provider failed", { meta: {
52
+ sourceId,
53
+ error: result.error.message
54
+ } });
55
+ return out;
56
+ }
57
+ async listEvents(input) {
58
+ const sources = this.sources();
59
+ const wanted = input.calendarIds !== void 0 ? new Set(input.calendarIds) : null;
60
+ const settled = await settleSourcesWithTimeout(sources.map((s) => {
61
+ const localIds = wanted === null ? void 0 : [...wanted].map((id) => localIdOf(id, s.id)).filter((id) => id !== null);
62
+ return [s.id, async () => {
63
+ if (wanted !== null && localIds !== void 0 && localIds.length === 0) return [];
64
+ return (await s.provider.listEvents({
65
+ startMs: input.startMs,
66
+ endMs: input.endMs,
67
+ ...localIds !== void 0 ? { calendarIds: [...localIds] } : {}
68
+ })).map((ev) => ({
69
+ ...ev,
70
+ calendarId: stampId(s.id, ev.calendarId),
71
+ id: stampId(s.id, ev.id)
72
+ }));
73
+ }];
74
+ }), PER_SOURCE_TIMEOUT_MS);
75
+ const out = [];
76
+ for (const [sourceId, result] of settled) if (result.ok) for (const ev of result.value) out.push(ev);
77
+ else this.ctx.logger.warn("calendar-source listEvents failed", { meta: {
78
+ sourceId,
79
+ error: result.error.message
80
+ } });
81
+ return out.toSorted((a, b) => a.startMs - b.startMs);
82
+ }
83
+ async importFromHomeAssistant() {
84
+ const ha = this.sources().find((s) => s.id === HA_ADDON_ID || s.id.includes("homeassistant"));
85
+ if (ha === void 0) return {
86
+ imported: 0,
87
+ error: "No Home Assistant calendar-source provider is registered"
88
+ };
89
+ try {
90
+ return {
91
+ imported: (await ha.provider.listCalendars()).length,
92
+ providerAddonId: ha.id
93
+ };
94
+ } catch (err) {
95
+ return {
96
+ imported: 0,
97
+ providerAddonId: ha.id,
98
+ error: errMsg(err)
99
+ };
100
+ }
101
+ }
102
+ };
103
+ //#endregion
104
+ export { CalendarsAddon, CalendarsAddon as default };
@@ -0,0 +1,8 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ require("../../chunk-Cek0wNdY.js");
6
+ const require_builtins_calendars_calendars_addon = require("./calendars.addon.js");
7
+ exports.CalendarsAddon = require_builtins_calendars_calendars_addon.CalendarsAddon;
8
+ exports.default = require_builtins_calendars_calendars_addon.CalendarsAddon;
@@ -0,0 +1,2 @@
1
+ import { CalendarsAddon } from "./calendars.addon.mjs";
2
+ export { CalendarsAddon, CalendarsAddon as default };
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("../../chunk-Cek0wNdY.js");
3
3
  const require_dist = require("../../dist-CqafgUSr.js");
4
- const require_tls = require("../../tls-D_wUeOTD.js");
4
+ const require_tls = require("../../tls-DEjOOARt.js");
5
5
  let node_fs_promises = require("node:fs/promises");
6
6
  let node_path = require("node:path");
7
7
  let node_fs = require("node:fs");
@@ -1,5 +1,5 @@
1
1
  import { Bt as localNetworkCapability, Gn as BaseAddon, gr as EventCategory } from "../../dist-0zO6jHkf.mjs";
2
- import { S as readLanHttpState, _ as DEFAULT_LAN_HTTP_PORT, a as writeTlsMode, i as writeExtraSans, l as reissueTlsLeaf, n as readTlsAccessStatus, o as validateUploadedTls, r as readTlsMode, s as ensureTlsCert, t as readExtraSans, y as applyLanHttp } from "../../tls-IM-v7JV4.mjs";
2
+ import { S as readLanHttpState, _ as DEFAULT_LAN_HTTP_PORT, a as writeTlsMode, i as writeExtraSans, l as reissueTlsLeaf, n as readTlsAccessStatus, o as validateUploadedTls, r as readTlsMode, s as ensureTlsCert, t as readExtraSans, y as applyLanHttp } from "../../tls-DAtaKVUT.mjs";
3
3
  import { mkdir, writeFile } from "node:fs/promises";
4
4
  import { join } from "node:path";
5
5
  import { readFileSync } from "node:fs";
package/dist/index.js CHANGED
@@ -3,7 +3,8 @@ const require_chunk = require("./chunk-Cek0wNdY.js");
3
3
  const require_dist = require("./dist-CqafgUSr.js");
4
4
  const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
5
5
  require("./builtins/alerts/index.js");
6
- const require_settle_sources = require("./settle-sources-Bhsy57y-.js");
6
+ const require_builtins_calendars_calendars_addon = require("./builtins/calendars/calendars.addon.js");
7
+ require("./builtins/calendars/index.js");
7
8
  const require_builtins_composer_composer_addon = require("./builtins/composer/composer.addon.js");
8
9
  require("./builtins/composer/index.js");
9
10
  const require_formatter = require("./formatter-DqAKDlvN.js");
@@ -29,7 +30,7 @@ const require_builtins_system_config_system_config_addon = require("./builtins/s
29
30
  require("./builtins/system-config/index.js");
30
31
  const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
31
32
  const require_event_loop_stall_monitor = require("./event-loop-stall-monitor-ey4mbofz.js");
32
- const require_tls$1 = require("./tls-D_wUeOTD.js");
33
+ const require_tls$1 = require("./tls-DEjOOARt.js");
33
34
  const require_child_cap_dispatch = require("./child-cap-dispatch-Bm4Kpo7v.js");
34
35
  const require_resource_monitor = require("./resource-monitor-DzNn_IZK.js");
35
36
  const require_custom_action_registry = require("./custom-action-registry-acBY3mHA.js");
@@ -186,107 +187,6 @@ function matchPath(pattern, path) {
186
187
  return params;
187
188
  }
188
189
  //#endregion
189
- //#region src/builtins/calendars/calendars.addon.ts
190
- /**
191
- * Hub calendars aggregator — walks `calendar-source` providers and stamps
192
- * cluster-stable ids (`<providerAddonId>:<localId>`).
193
- */
194
- var PER_SOURCE_TIMEOUT_MS = 2500;
195
- var HA_ADDON_ID = "provider-homeassistant";
196
- function stampId(providerAddonId, localId) {
197
- return `${providerAddonId}:${localId}`;
198
- }
199
- function localIdOf(stamped, providerAddonId) {
200
- const prefix = `${providerAddonId}:`;
201
- if (!stamped.startsWith(prefix)) return null;
202
- return stamped.slice(prefix.length);
203
- }
204
- var CalendarsAddon = class extends require_dist.BaseAddon {
205
- id = "calendars";
206
- constructor() {
207
- super({});
208
- }
209
- async onInitialize() {
210
- const provider = {
211
- listCalendars: async () => this.listCalendars(),
212
- listEvents: async (input) => this.listEvents(input),
213
- importFromHomeAssistant: async () => this.importFromHomeAssistant()
214
- };
215
- this.ctx.logger.info("Initialized — aggregating calendar-source providers");
216
- return [{
217
- capability: require_dist.calendarsCapability,
218
- provider
219
- }];
220
- }
221
- sources() {
222
- return (this.capabilities?.getCollectionEntries("calendar-source") ?? []).map(([id, provider]) => ({
223
- id,
224
- provider
225
- }));
226
- }
227
- async listCalendars() {
228
- const settled = await require_settle_sources.settleSourcesWithTimeout(this.sources().map((s) => [s.id, async () => {
229
- return (await s.provider.listCalendars()).map((cal) => ({
230
- ...cal,
231
- id: stampId(s.id, cal.id),
232
- providerAddonId: s.id
233
- }));
234
- }]), PER_SOURCE_TIMEOUT_MS);
235
- const out = [];
236
- for (const [sourceId, result] of settled) if (result.ok) for (const entry of result.value) out.push(entry);
237
- else this.ctx.logger.warn("calendar-source provider failed", { meta: {
238
- sourceId,
239
- error: result.error.message
240
- } });
241
- return out;
242
- }
243
- async listEvents(input) {
244
- const sources = this.sources();
245
- const wanted = input.calendarIds !== void 0 ? new Set(input.calendarIds) : null;
246
- const settled = await require_settle_sources.settleSourcesWithTimeout(sources.map((s) => {
247
- const localIds = wanted === null ? void 0 : [...wanted].map((id) => localIdOf(id, s.id)).filter((id) => id !== null);
248
- return [s.id, async () => {
249
- if (wanted !== null && localIds !== void 0 && localIds.length === 0) return [];
250
- return (await s.provider.listEvents({
251
- startMs: input.startMs,
252
- endMs: input.endMs,
253
- ...localIds !== void 0 ? { calendarIds: [...localIds] } : {}
254
- })).map((ev) => ({
255
- ...ev,
256
- calendarId: stampId(s.id, ev.calendarId),
257
- id: stampId(s.id, ev.id)
258
- }));
259
- }];
260
- }), PER_SOURCE_TIMEOUT_MS);
261
- const out = [];
262
- for (const [sourceId, result] of settled) if (result.ok) for (const ev of result.value) out.push(ev);
263
- else this.ctx.logger.warn("calendar-source listEvents failed", { meta: {
264
- sourceId,
265
- error: result.error.message
266
- } });
267
- return out.toSorted((a, b) => a.startMs - b.startMs);
268
- }
269
- async importFromHomeAssistant() {
270
- const ha = this.sources().find((s) => s.id === HA_ADDON_ID || s.id.includes("homeassistant"));
271
- if (ha === void 0) return {
272
- imported: 0,
273
- error: "No Home Assistant calendar-source provider is registered"
274
- };
275
- try {
276
- return {
277
- imported: (await ha.provider.listCalendars()).length,
278
- providerAddonId: ha.id
279
- };
280
- } catch (err) {
281
- return {
282
- imported: 0,
283
- providerAddonId: ha.id,
284
- error: require_dist.errMsg(err)
285
- };
286
- }
287
- }
288
- };
289
- //#endregion
290
190
  //#region src/events/event-bus.ts
291
191
  var EventBus = class {
292
192
  listeners = /* @__PURE__ */ new Map();
@@ -96564,7 +96464,7 @@ exports.CA_VALIDITY_DAYS = require_tls$1.CA_VALIDITY_DAYS;
96564
96464
  exports.CLUSTER_SECRET_MISMATCH_TYPE = CLUSTER_SECRET_MISMATCH_TYPE;
96565
96465
  exports.CLUSTER_SECRET_REJECTED_EXIT_CODE = CLUSTER_SECRET_REJECTED_EXIT_CODE;
96566
96466
  exports.CORE_CAP_SERVICE_NAME = CORE_CAP_SERVICE_NAME;
96567
- exports.CalendarsAddon = CalendarsAddon;
96467
+ exports.CalendarsAddon = require_builtins_calendars_calendars_addon.CalendarsAddon;
96568
96468
  exports.CapRouteError = require_child_cap_dispatch.CapRouteError;
96569
96469
  exports.CapRouteResolver = require_child_cap_dispatch.CapRouteResolver;
96570
96470
  exports.CapUsageRegistry = require_child_cap_dispatch.CapUsageRegistry;
package/dist/index.mjs CHANGED
@@ -1,8 +1,9 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
2
- import { $n as asNumber, $t as objectInputDeclaresRequiredDeviceId, C as LOG_LEVEL_RANK, E as METHOD_ACCESS_MAP, Et as extractNestedAddonId, Ft as isVoidInput, Gn as BaseAddon, H as addonSettingsCapability, It as kebabToCamel, Jn as DEVICE_STATUS_METHOD, Kn as DATAPLANE_SECRET_HEADER$1, Mt as isCollectionArrayMethod, Pt as isObjectInput, Qn as asJsonObject$1, Qt as objectInputDeclaresAddonId, Ut as logLevelAtMost, Wn as errMsg$1, Wt as looseSchema, Xn as ReadinessTimeoutError, Yn as ReadinessRegistry, Z as calendarsCapability, dn as scopesAllowAddon, dr as readinessKey, er as asString$1, fn as scopesAllowDeviceCap, fr as resolveCapMount, gr as EventCategory$1, ir as expandCapMethods, j as RUNTIME_DEFAULTS, jt as isArrayOutputSchema, ln as resolveMethodAuth, lr as parseJsonObject, nr as emitDownForOwnedCaps, pr as scopeKey, qn as DEVICE_SETTINGS_CONTRIBUTION_METHODS, rn as procedureAuthKey, t as ALL_CAPABILITY_DEFINITIONS, tr as createEvent, ur as parseJsonUnknown, zt as lifecycleJobSchema } from "./dist-0zO6jHkf.mjs";
2
+ import { $n as asNumber, $t as objectInputDeclaresRequiredDeviceId, C as LOG_LEVEL_RANK, E as METHOD_ACCESS_MAP, Et as extractNestedAddonId, Ft as isVoidInput, H as addonSettingsCapability, It as kebabToCamel, Jn as DEVICE_STATUS_METHOD, Kn as DATAPLANE_SECRET_HEADER$1, Mt as isCollectionArrayMethod, Pt as isObjectInput, Qn as asJsonObject$1, Qt as objectInputDeclaresAddonId, Ut as logLevelAtMost, Wn as errMsg$1, Wt as looseSchema, Xn as ReadinessTimeoutError, Yn as ReadinessRegistry, dn as scopesAllowAddon, dr as readinessKey, er as asString$1, fn as scopesAllowDeviceCap, fr as resolveCapMount, gr as EventCategory$1, ir as expandCapMethods, j as RUNTIME_DEFAULTS, jt as isArrayOutputSchema, ln as resolveMethodAuth, lr as parseJsonObject, nr as emitDownForOwnedCaps, pr as scopeKey, qn as DEVICE_SETTINGS_CONTRIBUTION_METHODS, rn as procedureAuthKey, t as ALL_CAPABILITY_DEFINITIONS, tr as createEvent, ur as parseJsonUnknown, zt as lifecycleJobSchema } from "./dist-0zO6jHkf.mjs";
3
3
  import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
4
4
  import "./builtins/alerts/index.mjs";
5
- import { t as settleSourcesWithTimeout } from "./settle-sources-CDtNC8ub.mjs";
5
+ import { CalendarsAddon } from "./builtins/calendars/calendars.addon.mjs";
6
+ import "./builtins/calendars/index.mjs";
6
7
  import { ComposerAddon } from "./builtins/composer/composer.addon.mjs";
7
8
  import "./builtins/composer/index.mjs";
8
9
  import { t as formatLogLine } from "./formatter-B7qW8bPJ.mjs";
@@ -28,7 +29,7 @@ import { SystemConfigAddon } from "./builtins/system-config/system-config.addon.
28
29
  import "./builtins/system-config/index.mjs";
29
30
  import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
30
31
  import { _ as ensureModel, a as createFileDataPlaneHandler, c as parseRangeHeader, d as ModelDownloadService, g as downloadModel, h as downloadFile, i as startEventLoopStallMonitor, l as parseTokenizedUrl, m as deleteModelFromDisk, n as STALL_TICK_MS, o as contentTypeFor, p as collectModelFiles, r as attributeStall, s as createAuthenticatedFileServer, t as STALL_REPORT_MS, u as resolveFilePath, v as fetchJson, x as isModelDownloaded, y as getModelFilePath } from "./event-loop-stall-monitor-EXjzIxDz.mjs";
31
- 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-IM-v7JV4.mjs";
32
+ 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-DAtaKVUT.mjs";
32
33
  import { $ as CapRouteError, $n as CAP_ACTION_UNLABELLED, $t as RUNNER_HEAP_WATCH_INTERVAL_MS, A as resolveHwAccel, An as OUTBOUND_QUEUE_COOLDOWN_MS, At as serializeTypedArrays, B as udsChildLogToWorkerEntry, Bn as SOCKET_QUEUE_TOP_N, Bt as createAddonPeerBytesFacility, C as getBrokerEventBus, Cn as DECISIVE_HEAP_SPACES, Ct as NATIVE_PROVIDER_SERVICE_INFIX, D as subscribePassthrough, Dn as heapSpaceField, Dt as capServiceName, E as setNodeEventInterest, En as formatHeapSpaces, Et as capBareAction, F as ipcParentLink, Fn as MESH_QUEUE_TOP_N, Ft as installManifestNativeDeps, G as UDS_NO_ROUTE_PREFIX, Gn as readSocketQueues, Gt as HEAP_RECLAIM_TRIGGER_MB, H as createUdsLoggerWithControl, Hn as createSocketPlaneReader, Ht as createAddonDataPlaneFacility, I as localProviderLink, In as createMeshQueueReader, It as resolveAddonClass, J as answerClaimedGetStatus, Jn as recordSocketFrame, Jt as HUB_MAIN_HEAP_WATCH_LABEL, K as afterWorkerOnlineAnnounce, Kn as EMPTY_SOCKET_DIRECTION, Kt as HEAP_WATCH_INTERVAL_MS, L as createParentUnownedCallHandler, Ln as formatMeshQueue, Lt as buildNpmChildEnv, M as brokerTransportLink, Mn as OUTBOUND_QUEUE_THRESHOLD_BYTES, Mt as CapabilityHandle, N as buildLinkChain, Nn as createOutboundQueueGate, Nt as CapabilityUnavailableError, O as AddonDepsManager, On as readHeapSpaces, Ot as parseCapAction, P as deviceCapResolverLink, Pn as formatOutboundQueueVerdict, Pt as copyBundledNativeModules, Q as CapRouteResolver, Qn as CAP_ACTION_OVERFLOW_LABEL, Qt as RSS_BUDGET_RELEASE_RATIO, R as createUdsEventBridge, Rn as EMPTY_SOCKET_PLANE_BASELINE, Rt as resolveNpmInvocation, S as clusterEventTopic, Sn as isArrayBufferCensusReport, St as validateProviderRegistrations, T as registerEventBusService, Tn as emitHeapDiagnosticReport, Tt as capActionSuffix, U as LocalChildClient, Un as diffSocketPlane, Ut as HEAP_RECLAIM_MIN_INTERVAL_MS, V as createUdsLogger, Vn as createSocketPlaneMeter, Vt as hostNodeIdOf, W as LocalChildRegistry, Wn as formatSocketPlane, Wt as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, X as AGENT_CAP_FWD_ACTION, Xn as socketDirectionBytes, Xt as HUB_RSS_BUDGET_ENV, Y as deviceOfGetStatus, Yn as sampleSocketDirection, Yt as HUB_MAIN_RSS_BUDGET_MB, Z as AGENT_CAP_FWD_SERVICE, Zn as socketDirectionMessages, Zt as RSS_BUDGET_REANNOUNCE_MIN_MS, _ as getWorkerDeviceRegistry, _n as ARRAY_BUFFER_CENSUS_THRESHOLD_MB, a as reapProcessGroup, an as createV8Reclaimer, ar as EVENT_PLANE_TOP_N, at as __resetCapUsageRegistryForTests, b as setHubConnected, bn as createInspectorArrayBufferCensus, c as runnerOwnsProcessGroup, cn as nextRssBudgetState, cr as diffEventPlane, ct as UdsLocalTransportClient, d as summarizeMembers, dn as shouldReclaim, dt as PeerAnsweredError, en as RUNNER_RSS_BUDGET_ENV, er as EMPTY_CAP_ACTION_READING, et as classifyCapRoute, f as installManifestSystemDeps, fn as startHeapWatch, ft as localEndpointPath, g as createUdsAddonContext, gn as ARRAY_BUFFER_CENSUS_SUSTAIN_MS, gt as createBrokerDeviceManagerApi, h as createAddonContext, hn as ARRAY_BUFFER_CENSUS_COOLDOWN_MS, ht as buildNativeCapProxy, in as createLoopDelayMeter, ir as diffCapActionCensus, it as PARENT_ROUTED_PROVIDER_ADDON_ID, j as brokerCallForCap, jn as OUTBOUND_QUEUE_SUSTAIN_MS, jt as DeviceRegistry, k as createKernelHwAccel, kn as selectReportedSpaces, kt as deserializeTypedArrays, l as signalAllRunnerGroups, ln as parseRssBudgetMb, lr as formatEventPlane, lt as UdsLocalTransportServer, m as adaptBrokerToCluster, mn as strandedMb, mt as encodeFrame, nn as buildHeapSample, nr as capActionLabel, nt as readMoleculerFanoutMode, o as registerRunnerGroup, on as describeRss, or as createEventPlaneMeter, ot as getCapUsageRegistry, p as installManifestPythonDeps, pn as startRunnerHeapWatch, pt as FrameDecoder, q as GET_STATUS_METHOD, qn as createSocketDirectionCounters, qt as HEAP_WATCH_WARN_RATIO, r as defaultProcessGroupOps, rn as createDeferredHeapWatchSink, rr as createCapActionCensus, rt as CapUsageRegistry, s as releaseRunnerGroup, sn as hubMainRssBudget, sr as createEventPlaneReader, st as createLocalTransport, t as CAP_METHOD_NOT_IMPLEMENTED, tn as ZERO_LOOP_DELAY, tr as MAX_CAP_ACTIONS_PER_PEER, tt as callWithServiceDiscovery, un as reclaimIntervalMs, ut as SocketChannel, v as getOrInitReadinessRegistry, vn as ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, w as getMoleculerEventStats, wn as HEAP_SPACE_REPORT_MIN_MB, wt as capActionName, x as EVENT_TOPIC_PREFIX, xn as formatArrayBufferCensus, xt as createAddonService, y as getOrInitReadinessRegistryForClient, yn as createArrayBufferCensusGate, yt as mountNativeCapService, z as createUdsEventBus, zn as SOCKET_PLANE_TOP_N, zt as runNpm } from "./child-cap-dispatch-B52e2Bcw.mjs";
33
34
  import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-B1v6E07R.mjs";
34
35
  import { t as CustomActionRegistry } from "./custom-action-registry-B4Cf4O_X.mjs";
@@ -179,107 +180,6 @@ function matchPath(pattern, path) {
179
180
  return params;
180
181
  }
181
182
  //#endregion
182
- //#region src/builtins/calendars/calendars.addon.ts
183
- /**
184
- * Hub calendars aggregator — walks `calendar-source` providers and stamps
185
- * cluster-stable ids (`<providerAddonId>:<localId>`).
186
- */
187
- var PER_SOURCE_TIMEOUT_MS = 2500;
188
- var HA_ADDON_ID = "provider-homeassistant";
189
- function stampId(providerAddonId, localId) {
190
- return `${providerAddonId}:${localId}`;
191
- }
192
- function localIdOf(stamped, providerAddonId) {
193
- const prefix = `${providerAddonId}:`;
194
- if (!stamped.startsWith(prefix)) return null;
195
- return stamped.slice(prefix.length);
196
- }
197
- var CalendarsAddon = class extends BaseAddon {
198
- id = "calendars";
199
- constructor() {
200
- super({});
201
- }
202
- async onInitialize() {
203
- const provider = {
204
- listCalendars: async () => this.listCalendars(),
205
- listEvents: async (input) => this.listEvents(input),
206
- importFromHomeAssistant: async () => this.importFromHomeAssistant()
207
- };
208
- this.ctx.logger.info("Initialized — aggregating calendar-source providers");
209
- return [{
210
- capability: calendarsCapability,
211
- provider
212
- }];
213
- }
214
- sources() {
215
- return (this.capabilities?.getCollectionEntries("calendar-source") ?? []).map(([id, provider]) => ({
216
- id,
217
- provider
218
- }));
219
- }
220
- async listCalendars() {
221
- const settled = await settleSourcesWithTimeout(this.sources().map((s) => [s.id, async () => {
222
- return (await s.provider.listCalendars()).map((cal) => ({
223
- ...cal,
224
- id: stampId(s.id, cal.id),
225
- providerAddonId: s.id
226
- }));
227
- }]), PER_SOURCE_TIMEOUT_MS);
228
- const out = [];
229
- for (const [sourceId, result] of settled) if (result.ok) for (const entry of result.value) out.push(entry);
230
- else this.ctx.logger.warn("calendar-source provider failed", { meta: {
231
- sourceId,
232
- error: result.error.message
233
- } });
234
- return out;
235
- }
236
- async listEvents(input) {
237
- const sources = this.sources();
238
- const wanted = input.calendarIds !== void 0 ? new Set(input.calendarIds) : null;
239
- const settled = await settleSourcesWithTimeout(sources.map((s) => {
240
- const localIds = wanted === null ? void 0 : [...wanted].map((id) => localIdOf(id, s.id)).filter((id) => id !== null);
241
- return [s.id, async () => {
242
- if (wanted !== null && localIds !== void 0 && localIds.length === 0) return [];
243
- return (await s.provider.listEvents({
244
- startMs: input.startMs,
245
- endMs: input.endMs,
246
- ...localIds !== void 0 ? { calendarIds: [...localIds] } : {}
247
- })).map((ev) => ({
248
- ...ev,
249
- calendarId: stampId(s.id, ev.calendarId),
250
- id: stampId(s.id, ev.id)
251
- }));
252
- }];
253
- }), PER_SOURCE_TIMEOUT_MS);
254
- const out = [];
255
- for (const [sourceId, result] of settled) if (result.ok) for (const ev of result.value) out.push(ev);
256
- else this.ctx.logger.warn("calendar-source listEvents failed", { meta: {
257
- sourceId,
258
- error: result.error.message
259
- } });
260
- return out.toSorted((a, b) => a.startMs - b.startMs);
261
- }
262
- async importFromHomeAssistant() {
263
- const ha = this.sources().find((s) => s.id === HA_ADDON_ID || s.id.includes("homeassistant"));
264
- if (ha === void 0) return {
265
- imported: 0,
266
- error: "No Home Assistant calendar-source provider is registered"
267
- };
268
- try {
269
- return {
270
- imported: (await ha.provider.listCalendars()).length,
271
- providerAddonId: ha.id
272
- };
273
- } catch (err) {
274
- return {
275
- imported: 0,
276
- providerAddonId: ha.id,
277
- error: errMsg$1(err)
278
- };
279
- }
280
- }
281
- };
282
- //#endregion
283
183
  //#region src/events/event-bus.ts
284
184
  var EventBus = class {
285
185
  listeners = /* @__PURE__ */ new Map();
@@ -24,9 +24,10 @@ export declare function systemHostFacts(): HostFacts;
24
24
  *
25
25
  * The two are deliberately different sizes. Everything plausible is
26
26
  * certified — costs nothing. Only a **stable** identity gates
27
- * regeneration, because a gate that fires on a rotating address rewrites
28
- * the certificate on every boot, which is a worse bug than the one the
29
- * gate exists to fix.
27
+ * regeneration (IPv4 + DNS + operator `extraSans`), because a gate that
28
+ * fires on a rotating address rewrites the certificate on every boot,
29
+ * which is a worse bug than the one the gate exists to fix. IPv6 never
30
+ * gates — ULA proved as unstable as global SLAAC on the live hub.
30
31
  */
31
32
  export interface CertIdentity {
32
33
  readonly dnsNames: readonly string[];
@@ -68,8 +68,9 @@ export interface CertOptions {
68
68
  *
69
69
  * And explicitly NOT when: the certificate names an address the machine
70
70
  * no longer has (a superset still works — the check is one-directional),
71
- * a volatile interface (docker/VPN/mesh) or a global-scope IPv6 address
72
- * changed (SLAAC privacy addresses rotate daily), or a new build shipped.
71
+ * a volatile interface (docker/VPN/mesh) or **any** IPv6 address changed
72
+ * (global and ULA both rotate under privacy extensions / interface-id
73
+ * churn — `os` cannot tell temporary from permanent), or a new build shipped.
73
74
  *
74
75
  * Every trigger is derived from the files plus the machine, so once a
75
76
  * reissue clears them it clears them for good: the next boot returns
@@ -277,27 +277,21 @@ function isLinkLocal(value) {
277
277
  const parsed = Number.parseInt(firstGroup, 16);
278
278
  return Number.isFinite(parsed) && (parsed & 65472) === 65152;
279
279
  }
280
- /** `fc00::/7` — the IPv6 range that behaves like RFC 1918 does for v4. */
281
- function isUniqueLocalIpv6(value) {
282
- if (!isIpv6(value)) return false;
283
- const firstGroup = value.split(":")[0] ?? "";
284
- const parsed = Number.parseInt(firstGroup, 16);
285
- return Number.isFinite(parsed) && (parsed & 65024) === 64512;
286
- }
287
280
  function isVolatileInterface(name) {
288
281
  const lower = name.toLowerCase();
289
282
  return VOLATILE_INTERFACE_PREFIXES.some((prefix) => lower.startsWith(prefix));
290
283
  }
291
284
  /**
292
- * A global-scope IPv6 address is NOT a stable identity: SLAAC privacy
293
- * extensions rotate temporary addresses roughly daily, and `os` gives us
294
- * no way to tell a temporary address from a permanent one. Gating on
295
- * one would reissue the certificate every day.
285
+ * Only IPv4 gates a reissue. Every IPv6 address we see — global **or**
286
+ * ULA — is certified but never required: `os` cannot tell a temporary
287
+ * address from a permanent one, and the live hub's ULA interface-id
288
+ * rotated on every restart (eight leaf reissues in one day under
289
+ * `san-coverage-gap`). Gating on ULA reproduced the churn D227 exists
290
+ * to prevent. Operators who need a fixed IPv6 declare it via `extraSans`.
296
291
  */
297
292
  function isStableGateAddress(address) {
298
293
  if (isLinkLocal(address)) return false;
299
- if (isIpv4(address)) return true;
300
- return isUniqueLocalIpv6(address);
294
+ return isIpv4(address);
301
295
  }
302
296
  function addSan(dns, ips, value) {
303
297
  const trimmed = value.trim();
@@ -11711,8 +11705,9 @@ var DEFAULT_COMMON_NAME = "camstack.local";
11711
11705
  *
11712
11706
  * And explicitly NOT when: the certificate names an address the machine
11713
11707
  * no longer has (a superset still works — the check is one-directional),
11714
- * a volatile interface (docker/VPN/mesh) or a global-scope IPv6 address
11715
- * changed (SLAAC privacy addresses rotate daily), or a new build shipped.
11708
+ * a volatile interface (docker/VPN/mesh) or **any** IPv6 address changed
11709
+ * (global and ULA both rotate under privacy extensions / interface-id
11710
+ * churn — `os` cannot tell temporary from permanent), or a new build shipped.
11716
11711
  *
11717
11712
  * Every trigger is derived from the files plus the machine, so once a
11718
11713
  * reissue clears them it clears them for good: the next boot returns
@@ -278,27 +278,21 @@ function isLinkLocal(value) {
278
278
  const parsed = Number.parseInt(firstGroup, 16);
279
279
  return Number.isFinite(parsed) && (parsed & 65472) === 65152;
280
280
  }
281
- /** `fc00::/7` — the IPv6 range that behaves like RFC 1918 does for v4. */
282
- function isUniqueLocalIpv6(value) {
283
- if (!isIpv6(value)) return false;
284
- const firstGroup = value.split(":")[0] ?? "";
285
- const parsed = Number.parseInt(firstGroup, 16);
286
- return Number.isFinite(parsed) && (parsed & 65024) === 64512;
287
- }
288
281
  function isVolatileInterface(name) {
289
282
  const lower = name.toLowerCase();
290
283
  return VOLATILE_INTERFACE_PREFIXES.some((prefix) => lower.startsWith(prefix));
291
284
  }
292
285
  /**
293
- * A global-scope IPv6 address is NOT a stable identity: SLAAC privacy
294
- * extensions rotate temporary addresses roughly daily, and `os` gives us
295
- * no way to tell a temporary address from a permanent one. Gating on
296
- * one would reissue the certificate every day.
286
+ * Only IPv4 gates a reissue. Every IPv6 address we see — global **or**
287
+ * ULA — is certified but never required: `os` cannot tell a temporary
288
+ * address from a permanent one, and the live hub's ULA interface-id
289
+ * rotated on every restart (eight leaf reissues in one day under
290
+ * `san-coverage-gap`). Gating on ULA reproduced the churn D227 exists
291
+ * to prevent. Operators who need a fixed IPv6 declare it via `extraSans`.
297
292
  */
298
293
  function isStableGateAddress(address) {
299
294
  if (isLinkLocal(address)) return false;
300
- if (isIpv4(address)) return true;
301
- return isUniqueLocalIpv6(address);
295
+ return isIpv4(address);
302
296
  }
303
297
  function addSan(dns, ips, value) {
304
298
  const trimmed = value.trim();
@@ -11712,8 +11706,9 @@ var DEFAULT_COMMON_NAME = "camstack.local";
11712
11706
  *
11713
11707
  * And explicitly NOT when: the certificate names an address the machine
11714
11708
  * no longer has (a superset still works — the check is one-directional),
11715
- * a volatile interface (docker/VPN/mesh) or a global-scope IPv6 address
11716
- * changed (SLAAC privacy addresses rotate daily), or a new build shipped.
11709
+ * a volatile interface (docker/VPN/mesh) or **any** IPv6 address changed
11710
+ * (global and ULA both rotate under privacy extensions / interface-id
11711
+ * churn — `os` cannot tell temporary from permanent), or a new build shipped.
11717
11712
  *
11718
11713
  * Every trigger is derived from the files plus the machine, so once a
11719
11714
  * reissue clears them it clears them for good: the next boot returns
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/system",
3
- "version": "1.2.344",
3
+ "version": "1.2.346",
4
4
  "description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
5
5
  "keywords": [
6
6
  "camstack",