@camstack/system 1.2.475 → 1.2.476
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-https-BsqT0qni.js → agent-https-DkXBXEvz.js} +1 -1
- package/dist/{agent-https-wA8gGLc1.mjs → agent-https-vpf_D97z.mjs} +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer-live-set.d.ts +9 -1
- package/dist/builtins/composer/composer.addon.js +130 -11
- package/dist/builtins/composer/composer.addon.mjs +130 -11
- package/dist/builtins/composer/composer.d.ts +8 -1
- package/dist/builtins/composer/composition-runtime.d.ts +2 -0
- package/dist/builtins/composer/composition-target.d.ts +6 -0
- package/dist/builtins/composer/owned-fields-target.d.ts +9 -0
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/block-supervisor.d.ts +19 -1
- package/dist/builtins/core-blocks/composition-api.d.ts +7 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +108 -10
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +108 -10
- package/dist/builtins/device-history/device-history.addon.js +1 -1
- package/dist/builtins/device-history/device-history.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +3 -3
- package/dist/builtins/keychain/index.mjs +3 -3
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/dist/builtins/local-network/local-network.addon.js +2 -2
- package/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/record-entries/index.js +1 -1
- package/dist/builtins/record-entries/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +3 -3
- package/dist/builtins/system-config/system-config.addon.mjs +3 -3
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-CiFkyAcf.mjs → composition-sources-B5nK7pHt.mjs} +1 -1
- package/dist/{composition-sources-DeUSUid6.js → composition-sources-BNOP9mFp.js} +1 -1
- package/dist/{constants-3Wj5OyEk.js → constants-D4VigrMM.js} +1 -1
- package/dist/{constants-DZJAkne8.mjs → constants-jbhoFV7w.mjs} +1 -1
- package/dist/{device-ca-DiV5xcMz.mjs → device-ca-CvBZeyVX.mjs} +1 -1
- package/dist/{device-ca-ftrfVdc0.js → device-ca-DhyQeXsa.js} +1 -1
- package/dist/{dist-DygMs3Qc.mjs → dist-B_V9r61Z.mjs} +21 -2
- package/dist/{dist-BtDdPdZ7.js → dist-CNU7cdFf.js} +21 -2
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-Bc9PnWu3.mjs → hub-mdns-ciao-BuUg0gpI.mjs} +2 -2
- package/dist/{hub-mdns-ciao-B1VcdfT1.js → hub-mdns-ciao-DFidf52M.js} +2 -2
- package/dist/index.js +7 -7
- package/dist/index.mjs +7 -7
- package/dist/{restore-archive-TDkQfmLO.js → restore-archive-BtCheeWu.js} +1 -1
- package/dist/{restore-archive-D_Pwryre.mjs → restore-archive-CDo4Zlmx.mjs} +1 -1
- package/dist/{wal-maintenance-D3UwIKX5.js → wal-maintenance-B7xBeIFi.js} +0 -0
- package/dist/{wal-maintenance-rLv4uOmp.mjs → wal-maintenance-DItlr0Yu.mjs} +0 -0
- package/package.json +1 -1
|
@@ -19,7 +19,11 @@
|
|
|
19
19
|
* filter in `composer.addon.ts` stays load-bearing. Its fields are CLAIMED on
|
|
20
20
|
* the hub under the block id (`OwnedFieldsTarget`), and released through the
|
|
21
21
|
* `ClaimGate` — two applies must agree, seeded at boot from the claims index —
|
|
22
|
-
* when the block
|
|
22
|
+
* when the block merely vanished from one snapshot. An operator delete
|
|
23
|
+
* (`retiredBlockIds`) or an edit that drops a cap releases those claims on
|
|
24
|
+
* THIS apply, after the old runtime has quiesced and before any replacement
|
|
25
|
+
* claims; a release that does not land is logged with `tags: { deviceId }` and
|
|
26
|
+
* returned on the apply. Its own replaced
|
|
23
27
|
* fields are read in the NATIVE view (rule 6). Its target row gone on two
|
|
24
28
|
* agreeing index reads fails the block by name and ungrafts what it added —
|
|
25
29
|
* whether the loss was seen on `device.unregistered` or on a later plan; its
|
|
@@ -139,6 +143,9 @@ export declare class Composer {
|
|
|
139
143
|
private syncTracker;
|
|
140
144
|
/** Rule 3: release what no live customization wants, once two applies agree (`wantedClaims`). */
|
|
141
145
|
private reconcileClaims;
|
|
146
|
+
/** Confirmed releases, awaited. A failure is the string the hub gave; the gate retries it later. */
|
|
147
|
+
private releaseConfirmed;
|
|
148
|
+
/** Null when the hub confirmed the release (or held nothing of ours). */
|
|
142
149
|
private release;
|
|
143
150
|
/**
|
|
144
151
|
* Rule 5: a customization whose target row is gone — the tracker's two
|
|
@@ -115,6 +115,8 @@ export declare class CompositionRuntime {
|
|
|
115
115
|
disable(reason: string): void;
|
|
116
116
|
/** Terminal: no write, no evaluation and no timer after this. */
|
|
117
117
|
stop(): void;
|
|
118
|
+
/** `stop`, then wait until the target has sent nothing further. */
|
|
119
|
+
quiesce(): Promise<void>;
|
|
118
120
|
state(): CompositionRuntimeState;
|
|
119
121
|
/**
|
|
120
122
|
* The target's enqueued write of `cap` did not land: the cap is write-pending
|
|
@@ -44,6 +44,12 @@ export interface ComposedWriteTarget {
|
|
|
44
44
|
* existing targets.
|
|
45
45
|
*/
|
|
46
46
|
withhold?(cap: string, fields: readonly string[]): WriteOutcome;
|
|
47
|
+
/**
|
|
48
|
+
* Drop writes not yet sent and resolve once the one in flight has settled.
|
|
49
|
+
* A stopped block calls this before its claims are released, so that claim
|
|
50
|
+
* cannot land afterwards.
|
|
51
|
+
*/
|
|
52
|
+
quiesce?(): Promise<void>;
|
|
47
53
|
}
|
|
48
54
|
export interface DeadlineTimer {
|
|
49
55
|
arm(at: number, fire: () => void): void;
|
|
@@ -64,11 +64,20 @@ export declare class OwnedFieldsTarget implements ComposedWriteTarget {
|
|
|
64
64
|
private listeners;
|
|
65
65
|
/** Per cap, bumped by every `withhold`: a claim that settles under another epoch claimed a stale field set and does not land (I-2). */
|
|
66
66
|
private epoch;
|
|
67
|
+
/** Set by `quiesce`: nothing further is sent. */
|
|
68
|
+
private closed;
|
|
69
|
+
private idle;
|
|
70
|
+
private markIdle;
|
|
67
71
|
constructor(deps: OwnedFieldsTargetDeps);
|
|
68
72
|
seed(cap: string, slice: SlicePatch): WriteOutcome;
|
|
69
73
|
patch(cap: string, patch: SlicePatch): WriteOutcome;
|
|
70
74
|
/** `device-status` belongs to the native device; availability lives in the block report only. */
|
|
71
75
|
setAvailable(_available: boolean): void;
|
|
76
|
+
/**
|
|
77
|
+
* The block has stopped. Writes still queued are dropped; the call in flight
|
|
78
|
+
* is allowed to finish, and then nothing else is sent.
|
|
79
|
+
*/
|
|
80
|
+
quiesce(): Promise<void>;
|
|
72
81
|
onAsyncFailure(listener: AsyncFailureListener): void;
|
|
73
82
|
withhold(cap: string, fields: readonly string[]): WriteOutcome;
|
|
74
83
|
private claimableFields;
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CNU7cdFf.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
//#region src/builtins/console-logging/console-destination.ts
|
|
9
9
|
var LEVEL_RANK = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ln as logDestinationCapability, ti as BaseAddon } from "../../dist-
|
|
1
|
+
import { Ln as logDestinationCapability, ti as BaseAddon } from "../../dist-B_V9r61Z.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
//#region src/builtins/console-logging/console-destination.ts
|
|
4
4
|
var LEVEL_RANK = {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* status the operator can see, with the reason attached. A block that is
|
|
20
20
|
* silently absent is the failure mode this whole feature has to avoid.
|
|
21
21
|
*/
|
|
22
|
-
import { type ComposerApplyInput, type ComposerApplyResult, type ComposerUnreadableBlock, type CoreBlock, type IScopedLogger } from "@camstack/types";
|
|
22
|
+
import { type ComposerApplyInput, type ComposerApplyResult, type ComposerUnreadableBlock, type CoreBlock, type IScopedLogger, type UnreleasedClaim } from "@camstack/types";
|
|
23
23
|
/** The runner lifecycle states `$process.list` reports. `stopping`/`stopped`
|
|
24
24
|
* are transient states of a runner on its way out and are treated as absent. */
|
|
25
25
|
export type BlockRunnerState = "starting" | "running" | "stopping" | "stopped" | "crashed" | "failed";
|
|
@@ -107,6 +107,10 @@ export declare class BlockSupervisor {
|
|
|
107
107
|
private emptyAppliesOwed;
|
|
108
108
|
/** Consecutive applies that could not reach the composer: warned once per run. */
|
|
109
109
|
private failedApplies;
|
|
110
|
+
/** Composition ids the operator deleted. Passed until their claims are released. */
|
|
111
|
+
private retiredBlockIds;
|
|
112
|
+
/** What the last composition apply said about claim releases. */
|
|
113
|
+
private releaseReport;
|
|
110
114
|
constructor(deps: BlockSupervisorDeps);
|
|
111
115
|
/** Start the reconcile timer. The first pass runs immediately. */
|
|
112
116
|
start(intervalMs: number): void;
|
|
@@ -128,6 +132,17 @@ export declare class BlockSupervisor {
|
|
|
128
132
|
* timer tick could stop a runner the tick had just decided was healthy and
|
|
129
133
|
* then never re-launch it.
|
|
130
134
|
*/
|
|
135
|
+
/**
|
|
136
|
+
* The block row is already gone. The next apply names it retired so its
|
|
137
|
+
* claims are released before this resolves. A release that does not land is
|
|
138
|
+
* returned; the id stays retired so the following pass tries again.
|
|
139
|
+
*/
|
|
140
|
+
retireComposition(blockId: string): Promise<readonly UnreleasedClaim[]>;
|
|
141
|
+
/**
|
|
142
|
+
* One apply, awaited. Used when an edit replaced a block's caps: the
|
|
143
|
+
* composer releases what the new plan dropped before this resolves.
|
|
144
|
+
*/
|
|
145
|
+
convergeForClaims(): Promise<readonly UnreleasedClaim[]>;
|
|
131
146
|
restart(blockId: string): Promise<void>;
|
|
132
147
|
private runRestart;
|
|
133
148
|
private runPass;
|
|
@@ -139,6 +154,9 @@ export declare class BlockSupervisor {
|
|
|
139
154
|
* pass of this same converge is the retry — no timer of its own (D3).
|
|
140
155
|
*/
|
|
141
156
|
private convergeCompositions;
|
|
157
|
+
private claimsOf;
|
|
158
|
+
/** Remember which retired ids still hold a claim. An apply that did not act keeps every id. */
|
|
159
|
+
private noteRelease;
|
|
142
160
|
/** Compile, write the package, spawn. Each failure is reported ON the block
|
|
143
161
|
* — the author asked for this to run, so they are owed the reason it does
|
|
144
162
|
* not. */
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* server derives it (`customizationBlockName`), refuses one the client sends,
|
|
13
13
|
* and never lets it move to another device. One per device, by block id (S2).
|
|
14
14
|
*/
|
|
15
|
-
import { type CapabilityDefinition, type CapabilityLookup, type CompositionBlockPatch, type CompositionBlockState, type CompositionSourceRef, type CoreBlock, type ICoreBlocksProvider, type IScopedLogger } from "@camstack/types";
|
|
15
|
+
import { type CapabilityDefinition, type CapabilityLookup, type CompositionBlockPatch, type CompositionBlockState, type CompositionSourceRef, type CoreBlock, type ICoreBlocksProvider, type IScopedLogger, type UnreleasedClaim } from "@camstack/types";
|
|
16
16
|
import type { NamedCompositionInput } from "./core-block-store.js";
|
|
17
17
|
import type { CompositionDescriptions } from "./composition-sources.js";
|
|
18
18
|
export interface CompositionStoreView {
|
|
@@ -30,6 +30,12 @@ export interface CompositionApiDeps {
|
|
|
30
30
|
readonly lookupCap: CapabilityLookup;
|
|
31
31
|
readonly composerStates: (blockIds: readonly string[]) => Promise<readonly CompositionBlockState[]>;
|
|
32
32
|
readonly convergeSoon: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* One composer apply, awaited. An edit that replaces caps does not return
|
|
35
|
+
* until the caps it dropped have been released, or the release has failed
|
|
36
|
+
* and is in the list.
|
|
37
|
+
*/
|
|
38
|
+
readonly convergeForClaims: () => Promise<readonly UnreleasedClaim[]>;
|
|
33
39
|
readonly logger: IScopedLogger;
|
|
34
40
|
/** Every capability definition — the listing is derived from them, never from the registry's live state. */
|
|
35
41
|
readonly capabilityDefinitions: readonly CapabilityDefinition[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("../../dist-
|
|
3
|
+
const require_dist = require("../../dist-CNU7cdFf.js");
|
|
4
4
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
5
|
-
const require_composition_sources = require("../../composition-sources-
|
|
5
|
+
const require_composition_sources = require("../../composition-sources-BNOP9mFp.js");
|
|
6
6
|
const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
|
|
7
7
|
const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
|
|
8
8
|
let zod = require("zod");
|
|
@@ -246,6 +246,13 @@ var BlockSupervisor = class {
|
|
|
246
246
|
emptyAppliesOwed = 2;
|
|
247
247
|
/** Consecutive applies that could not reach the composer: warned once per run. */
|
|
248
248
|
failedApplies = 0;
|
|
249
|
+
/** Composition ids the operator deleted. Passed until their claims are released. */
|
|
250
|
+
retiredBlockIds = /* @__PURE__ */ new Set();
|
|
251
|
+
/** What the last composition apply said about claim releases. */
|
|
252
|
+
releaseReport = {
|
|
253
|
+
error: null,
|
|
254
|
+
unreleased: []
|
|
255
|
+
};
|
|
249
256
|
constructor(deps) {
|
|
250
257
|
this.deps = deps;
|
|
251
258
|
}
|
|
@@ -281,6 +288,26 @@ var BlockSupervisor = class {
|
|
|
281
288
|
* timer tick could stop a runner the tick had just decided was healthy and
|
|
282
289
|
* then never re-launch it.
|
|
283
290
|
*/
|
|
291
|
+
/**
|
|
292
|
+
* The block row is already gone. The next apply names it retired so its
|
|
293
|
+
* claims are released before this resolves. A release that does not land is
|
|
294
|
+
* returned; the id stays retired so the following pass tries again.
|
|
295
|
+
*/
|
|
296
|
+
retireComposition(blockId) {
|
|
297
|
+
this.retiredBlockIds = new Set([...this.retiredBlockIds, blockId]);
|
|
298
|
+
return this.converge().then(() => this.claimsOf(blockId));
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* One apply, awaited. Used when an edit replaced a block's caps: the
|
|
302
|
+
* composer releases what the new plan dropped before this resolves.
|
|
303
|
+
*/
|
|
304
|
+
convergeForClaims() {
|
|
305
|
+
if (this.deps.composer === null) return Promise.reject(/* @__PURE__ */ new Error("core-blocks: no composer is available — a replaced claim cannot be released"));
|
|
306
|
+
return this.converge().then(() => {
|
|
307
|
+
if (this.releaseReport.error !== null) throw new Error(`core-blocks: a replaced claim was not released — ${this.releaseReport.error}`);
|
|
308
|
+
return this.releaseReport.unreleased;
|
|
309
|
+
});
|
|
310
|
+
}
|
|
284
311
|
restart(blockId) {
|
|
285
312
|
const block = this.deps.store.get(blockId);
|
|
286
313
|
if (block !== null && require_dist.coreBlockSourceKind(block) === "composition") {
|
|
@@ -369,9 +396,13 @@ var BlockSupervisor = class {
|
|
|
369
396
|
});
|
|
370
397
|
const unreadable = this.deps.store.unreadableCompositions();
|
|
371
398
|
const nothingToSay = compositions.length === 0 && unreadable.length === 0;
|
|
372
|
-
if (nothingToSay && this.emptyAppliesOwed === 0) return;
|
|
399
|
+
if (nothingToSay && this.emptyAppliesOwed === 0 && this.retiredBlockIds.size === 0) return;
|
|
373
400
|
const composer = this.deps.composer;
|
|
374
401
|
if (composer === null) {
|
|
402
|
+
if (this.retiredBlockIds.size > 0) this.releaseReport = {
|
|
403
|
+
error: "no composer is available on this node — claims cannot be released",
|
|
404
|
+
unreleased: []
|
|
405
|
+
};
|
|
375
406
|
for (const { block } of compositions) await this.report(block.id, "failed", "no composer is available on this node — a composition cannot run here");
|
|
376
407
|
return;
|
|
377
408
|
}
|
|
@@ -394,7 +425,8 @@ var BlockSupervisor = class {
|
|
|
394
425
|
composition
|
|
395
426
|
})),
|
|
396
427
|
restartBlockIds: [...restart],
|
|
397
|
-
unreadableBlocks: [...unreadable]
|
|
428
|
+
unreadableBlocks: [...unreadable],
|
|
429
|
+
retiredBlockIds: [...this.retiredBlockIds]
|
|
398
430
|
});
|
|
399
431
|
if (this.failedApplies > 0) {
|
|
400
432
|
this.deps.logger.info("the composer answered again", { meta: { failedApplies: this.failedApplies } });
|
|
@@ -402,6 +434,7 @@ var BlockSupervisor = class {
|
|
|
402
434
|
}
|
|
403
435
|
this.pendingCompositionRestarts = new Set([...this.pendingCompositionRestarts].filter((id) => !restart.has(id)));
|
|
404
436
|
this.emptyAppliesOwed = !nothingToSay || !result.acted ? 2 : Math.max(0, this.emptyAppliesOwed - 1);
|
|
437
|
+
this.noteRelease(result);
|
|
405
438
|
const verdicts = new Map(result.blocks.map((v) => [v.blockId, v]));
|
|
406
439
|
for (const { block } of compositions) {
|
|
407
440
|
const verdict = verdicts.get(block.id);
|
|
@@ -409,13 +442,39 @@ var BlockSupervisor = class {
|
|
|
409
442
|
else await this.report(block.id, verdict.status, verdict.reason);
|
|
410
443
|
}
|
|
411
444
|
} catch (err) {
|
|
445
|
+
const error = require_dist.errMsg(err);
|
|
446
|
+
this.releaseReport = {
|
|
447
|
+
error,
|
|
448
|
+
unreleased: []
|
|
449
|
+
};
|
|
412
450
|
this.failedApplies += 1;
|
|
413
451
|
if (this.failedApplies === 1) this.deps.logger.warn("the composer could not be reached — compositions keep their last status", { meta: {
|
|
414
|
-
error
|
|
452
|
+
error,
|
|
415
453
|
compositions: compositions.length
|
|
416
454
|
} });
|
|
417
|
-
for (const { block } of compositions) if (block.status === "stopped" && block.enabled) await this.report(block.id, "starting", `the composer is not reachable yet: ${
|
|
455
|
+
for (const { block } of compositions) if (block.status === "stopped" && block.enabled) await this.report(block.id, "starting", `the composer is not reachable yet: ${error}`);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
claimsOf(blockId) {
|
|
459
|
+
if (this.releaseReport.error !== null) throw new Error(`core-blocks: claims of "${blockId}" were not released — ${this.releaseReport.error}`);
|
|
460
|
+
return this.releaseReport.unreleased.filter((claim) => claim.owner === blockId);
|
|
461
|
+
}
|
|
462
|
+
/** Remember which retired ids still hold a claim. An apply that did not act keeps every id. */
|
|
463
|
+
noteRelease(result) {
|
|
464
|
+
const unreleased = result.unreleasedClaims ?? [];
|
|
465
|
+
if (!result.acted) {
|
|
466
|
+
this.releaseReport = {
|
|
467
|
+
error: "the composer did not apply — claims stay until it does",
|
|
468
|
+
unreleased
|
|
469
|
+
};
|
|
470
|
+
return;
|
|
418
471
|
}
|
|
472
|
+
this.releaseReport = {
|
|
473
|
+
error: null,
|
|
474
|
+
unreleased
|
|
475
|
+
};
|
|
476
|
+
const failed = new Set(unreleased.map((claim) => claim.owner));
|
|
477
|
+
this.retiredBlockIds = new Set([...this.retiredBlockIds].filter((id) => failed.has(id)));
|
|
419
478
|
}
|
|
420
479
|
/** Compile, write the package, spawn. Each failure is reported ON the block
|
|
421
480
|
* — the author asked for this to run, so they are owed the reason it does
|
|
@@ -2082,7 +2141,21 @@ function buildCompositionApi(deps) {
|
|
|
2082
2141
|
blockId,
|
|
2083
2142
|
by: caller.userId
|
|
2084
2143
|
} });
|
|
2085
|
-
|
|
2144
|
+
if (block.composition !== void 0) {
|
|
2145
|
+
const unreleased = (await deps.convergeForClaims()).filter((claim) => claim.owner === blockId);
|
|
2146
|
+
if (unreleased.length > 0) {
|
|
2147
|
+
for (const claim of unreleased) deps.logger.error("composition saved but a replaced claim was not released", {
|
|
2148
|
+
tags: { deviceId: claim.deviceId },
|
|
2149
|
+
meta: {
|
|
2150
|
+
blockId,
|
|
2151
|
+
cap: claim.capName,
|
|
2152
|
+
error: claim.error
|
|
2153
|
+
}
|
|
2154
|
+
});
|
|
2155
|
+
const detail = unreleased.map((claim) => `${claim.capName} on device ${claim.deviceId}: ${claim.error}`).join("; ");
|
|
2156
|
+
throw new Error(`core-blocks: "${blockId}" was saved but a replaced claim was not released — ${detail}`);
|
|
2157
|
+
}
|
|
2158
|
+
} else deps.convergeSoon();
|
|
2086
2159
|
return { block: updated };
|
|
2087
2160
|
}),
|
|
2088
2161
|
getComposition: async ({ blockId }) => {
|
|
@@ -2458,9 +2531,30 @@ var CoreBlocksAddon = class extends require_dist.BaseAddon {
|
|
|
2458
2531
|
return { block: updated };
|
|
2459
2532
|
},
|
|
2460
2533
|
delete: async ({ blockId }) => {
|
|
2534
|
+
const existing = this.requireStore().get(blockId);
|
|
2535
|
+
const composition = existing !== null && require_dist.coreBlockComposition(existing) !== null;
|
|
2461
2536
|
await this.requireStore().delete(blockId);
|
|
2462
2537
|
await this.requirePrefs().delete(blockId);
|
|
2463
|
-
this.
|
|
2538
|
+
if (composition && this.supervisor === null) {
|
|
2539
|
+
this.ctx.logger.error("composition deleted but no supervisor can release its claims", { meta: { blockId } });
|
|
2540
|
+
throw new Error(`core-blocks: "${blockId}" was deleted but no supervisor runs here — its claims were not released`);
|
|
2541
|
+
}
|
|
2542
|
+
if (composition && this.supervisor !== null) {
|
|
2543
|
+
const unreleased = await this.supervisor.retireComposition(blockId);
|
|
2544
|
+
if (unreleased.length > 0) {
|
|
2545
|
+
for (const claim of unreleased) this.ctx.logger.error("composition deleted but its claim was not released", {
|
|
2546
|
+
tags: { deviceId: claim.deviceId },
|
|
2547
|
+
meta: {
|
|
2548
|
+
blockId,
|
|
2549
|
+
cap: claim.capName,
|
|
2550
|
+
owner: claim.owner,
|
|
2551
|
+
error: claim.error
|
|
2552
|
+
}
|
|
2553
|
+
});
|
|
2554
|
+
const detail = unreleased.map((claim) => `${claim.capName} on device ${claim.deviceId}: ${claim.error}`).join("; ");
|
|
2555
|
+
throw new Error(`core-blocks: "${blockId}" was deleted but its claims were not released — ${detail}`);
|
|
2556
|
+
}
|
|
2557
|
+
} else this.convergeSoon();
|
|
2464
2558
|
return { success: true };
|
|
2465
2559
|
},
|
|
2466
2560
|
setEnabled: async ({ blockId, enabled }) => {
|
|
@@ -2469,9 +2563,9 @@ var CoreBlocksAddon = class extends require_dist.BaseAddon {
|
|
|
2469
2563
|
return { block: updated };
|
|
2470
2564
|
},
|
|
2471
2565
|
/**
|
|
2472
|
-
* Awaited,
|
|
2566
|
+
* Awaited, like a composition delete.
|
|
2473
2567
|
*
|
|
2474
|
-
* `create`/`update` deliberately do not wait — the write is already
|
|
2568
|
+
* `create`/`update` of a code block deliberately do not wait — the write is already
|
|
2475
2569
|
* durable and converging forks a process. A restart has no durable half:
|
|
2476
2570
|
* the whole thing IS the converge, so returning before it ran would hand
|
|
2477
2571
|
* the operator the old status and read as "nothing happened".
|
|
@@ -2552,6 +2646,10 @@ var CoreBlocksAddon = class extends require_dist.BaseAddon {
|
|
|
2552
2646
|
lookupCap: require_dist.buildCapabilityLookup(require_dist.ALL_CAPABILITY_DEFINITIONS),
|
|
2553
2647
|
composerStates: async (blockIds) => (await requireApi().composer.getStates.query({ blockIds: [...blockIds] })).states,
|
|
2554
2648
|
convergeSoon: () => this.convergeSoon(),
|
|
2649
|
+
convergeForClaims: () => {
|
|
2650
|
+
if (this.supervisor === null) return Promise.reject(/* @__PURE__ */ new Error("core-blocks: no block supervisor runs on this node — claims cannot be released"));
|
|
2651
|
+
return this.supervisor.convergeForClaims();
|
|
2652
|
+
},
|
|
2555
2653
|
logger: this.ctx.logger.child("compositions"),
|
|
2556
2654
|
capabilityDefinitions: require_dist.ALL_CAPABILITY_DEFINITIONS
|
|
2557
2655
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $i as hydrateSchema, $n as planComposition, Bt as coreBlockComposition, Hi as collectSecretMarkerRefs, Hr as composedDeviceRef, Ht as coreBlockSourceKind, Kn as normalizeCoreBlockWrite, N as DeclaredDevices, Nr as validateComposition, Ot as buildCapabilityLookup, Rt as compositionSourceRefs, Ta as transformSecretWrite, Ut as coreBlocksCapability, Vt as coreBlockIdFromAddonId, Zt as describeComposableCaps, ei as errMsg, f as COMPOSER_RUNNER_ID, ia as isSecretMarker, lr as resolveCoreBlockEntry, m as CORE_BLOCK_ADDON_PREFIX, oa as isSecretRefOwnedBy, or as replacedFieldKeys, p as CORE_BLOCKS_ADDON_ID, qi as defineRecordKinds, qr as compositionSourceKey, r as ALL_CAPABILITY_DEFINITIONS, ti as BaseAddon, ur as resolveCoreBlockFiles, v as CoreBlockSchema, va as resolveSecretMarkers, xa as secretTreeFromSchema, zt as coreBlockAddonId } from "../../dist-
|
|
1
|
+
import { $i as hydrateSchema, $n as planComposition, Bt as coreBlockComposition, Hi as collectSecretMarkerRefs, Hr as composedDeviceRef, Ht as coreBlockSourceKind, Kn as normalizeCoreBlockWrite, N as DeclaredDevices, Nr as validateComposition, Ot as buildCapabilityLookup, Rt as compositionSourceRefs, Ta as transformSecretWrite, Ut as coreBlocksCapability, Vt as coreBlockIdFromAddonId, Zt as describeComposableCaps, ei as errMsg, f as COMPOSER_RUNNER_ID, ia as isSecretMarker, lr as resolveCoreBlockEntry, m as CORE_BLOCK_ADDON_PREFIX, oa as isSecretRefOwnedBy, or as replacedFieldKeys, p as CORE_BLOCKS_ADDON_ID, qi as defineRecordKinds, qr as compositionSourceKey, r as ALL_CAPABILITY_DEFINITIONS, ti as BaseAddon, ur as resolveCoreBlockFiles, v as CoreBlockSchema, va as resolveSecretMarkers, xa as secretTreeFromSchema, zt as coreBlockAddonId } from "../../dist-B_V9r61Z.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
|
-
import { t as describeCompositionSources } from "../../composition-sources-
|
|
3
|
+
import { t as describeCompositionSources } from "../../composition-sources-B5nK7pHt.mjs";
|
|
4
4
|
import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
|
|
5
5
|
import { n as unwrapStoredValue, t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
@@ -241,6 +241,13 @@ var BlockSupervisor = class {
|
|
|
241
241
|
emptyAppliesOwed = 2;
|
|
242
242
|
/** Consecutive applies that could not reach the composer: warned once per run. */
|
|
243
243
|
failedApplies = 0;
|
|
244
|
+
/** Composition ids the operator deleted. Passed until their claims are released. */
|
|
245
|
+
retiredBlockIds = /* @__PURE__ */ new Set();
|
|
246
|
+
/** What the last composition apply said about claim releases. */
|
|
247
|
+
releaseReport = {
|
|
248
|
+
error: null,
|
|
249
|
+
unreleased: []
|
|
250
|
+
};
|
|
244
251
|
constructor(deps) {
|
|
245
252
|
this.deps = deps;
|
|
246
253
|
}
|
|
@@ -276,6 +283,26 @@ var BlockSupervisor = class {
|
|
|
276
283
|
* timer tick could stop a runner the tick had just decided was healthy and
|
|
277
284
|
* then never re-launch it.
|
|
278
285
|
*/
|
|
286
|
+
/**
|
|
287
|
+
* The block row is already gone. The next apply names it retired so its
|
|
288
|
+
* claims are released before this resolves. A release that does not land is
|
|
289
|
+
* returned; the id stays retired so the following pass tries again.
|
|
290
|
+
*/
|
|
291
|
+
retireComposition(blockId) {
|
|
292
|
+
this.retiredBlockIds = new Set([...this.retiredBlockIds, blockId]);
|
|
293
|
+
return this.converge().then(() => this.claimsOf(blockId));
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* One apply, awaited. Used when an edit replaced a block's caps: the
|
|
297
|
+
* composer releases what the new plan dropped before this resolves.
|
|
298
|
+
*/
|
|
299
|
+
convergeForClaims() {
|
|
300
|
+
if (this.deps.composer === null) return Promise.reject(/* @__PURE__ */ new Error("core-blocks: no composer is available — a replaced claim cannot be released"));
|
|
301
|
+
return this.converge().then(() => {
|
|
302
|
+
if (this.releaseReport.error !== null) throw new Error(`core-blocks: a replaced claim was not released — ${this.releaseReport.error}`);
|
|
303
|
+
return this.releaseReport.unreleased;
|
|
304
|
+
});
|
|
305
|
+
}
|
|
279
306
|
restart(blockId) {
|
|
280
307
|
const block = this.deps.store.get(blockId);
|
|
281
308
|
if (block !== null && coreBlockSourceKind(block) === "composition") {
|
|
@@ -364,9 +391,13 @@ var BlockSupervisor = class {
|
|
|
364
391
|
});
|
|
365
392
|
const unreadable = this.deps.store.unreadableCompositions();
|
|
366
393
|
const nothingToSay = compositions.length === 0 && unreadable.length === 0;
|
|
367
|
-
if (nothingToSay && this.emptyAppliesOwed === 0) return;
|
|
394
|
+
if (nothingToSay && this.emptyAppliesOwed === 0 && this.retiredBlockIds.size === 0) return;
|
|
368
395
|
const composer = this.deps.composer;
|
|
369
396
|
if (composer === null) {
|
|
397
|
+
if (this.retiredBlockIds.size > 0) this.releaseReport = {
|
|
398
|
+
error: "no composer is available on this node — claims cannot be released",
|
|
399
|
+
unreleased: []
|
|
400
|
+
};
|
|
370
401
|
for (const { block } of compositions) await this.report(block.id, "failed", "no composer is available on this node — a composition cannot run here");
|
|
371
402
|
return;
|
|
372
403
|
}
|
|
@@ -389,7 +420,8 @@ var BlockSupervisor = class {
|
|
|
389
420
|
composition
|
|
390
421
|
})),
|
|
391
422
|
restartBlockIds: [...restart],
|
|
392
|
-
unreadableBlocks: [...unreadable]
|
|
423
|
+
unreadableBlocks: [...unreadable],
|
|
424
|
+
retiredBlockIds: [...this.retiredBlockIds]
|
|
393
425
|
});
|
|
394
426
|
if (this.failedApplies > 0) {
|
|
395
427
|
this.deps.logger.info("the composer answered again", { meta: { failedApplies: this.failedApplies } });
|
|
@@ -397,6 +429,7 @@ var BlockSupervisor = class {
|
|
|
397
429
|
}
|
|
398
430
|
this.pendingCompositionRestarts = new Set([...this.pendingCompositionRestarts].filter((id) => !restart.has(id)));
|
|
399
431
|
this.emptyAppliesOwed = !nothingToSay || !result.acted ? 2 : Math.max(0, this.emptyAppliesOwed - 1);
|
|
432
|
+
this.noteRelease(result);
|
|
400
433
|
const verdicts = new Map(result.blocks.map((v) => [v.blockId, v]));
|
|
401
434
|
for (const { block } of compositions) {
|
|
402
435
|
const verdict = verdicts.get(block.id);
|
|
@@ -404,13 +437,39 @@ var BlockSupervisor = class {
|
|
|
404
437
|
else await this.report(block.id, verdict.status, verdict.reason);
|
|
405
438
|
}
|
|
406
439
|
} catch (err) {
|
|
440
|
+
const error = errMsg(err);
|
|
441
|
+
this.releaseReport = {
|
|
442
|
+
error,
|
|
443
|
+
unreleased: []
|
|
444
|
+
};
|
|
407
445
|
this.failedApplies += 1;
|
|
408
446
|
if (this.failedApplies === 1) this.deps.logger.warn("the composer could not be reached — compositions keep their last status", { meta: {
|
|
409
|
-
error
|
|
447
|
+
error,
|
|
410
448
|
compositions: compositions.length
|
|
411
449
|
} });
|
|
412
|
-
for (const { block } of compositions) if (block.status === "stopped" && block.enabled) await this.report(block.id, "starting", `the composer is not reachable yet: ${
|
|
450
|
+
for (const { block } of compositions) if (block.status === "stopped" && block.enabled) await this.report(block.id, "starting", `the composer is not reachable yet: ${error}`);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
claimsOf(blockId) {
|
|
454
|
+
if (this.releaseReport.error !== null) throw new Error(`core-blocks: claims of "${blockId}" were not released — ${this.releaseReport.error}`);
|
|
455
|
+
return this.releaseReport.unreleased.filter((claim) => claim.owner === blockId);
|
|
456
|
+
}
|
|
457
|
+
/** Remember which retired ids still hold a claim. An apply that did not act keeps every id. */
|
|
458
|
+
noteRelease(result) {
|
|
459
|
+
const unreleased = result.unreleasedClaims ?? [];
|
|
460
|
+
if (!result.acted) {
|
|
461
|
+
this.releaseReport = {
|
|
462
|
+
error: "the composer did not apply — claims stay until it does",
|
|
463
|
+
unreleased
|
|
464
|
+
};
|
|
465
|
+
return;
|
|
413
466
|
}
|
|
467
|
+
this.releaseReport = {
|
|
468
|
+
error: null,
|
|
469
|
+
unreleased
|
|
470
|
+
};
|
|
471
|
+
const failed = new Set(unreleased.map((claim) => claim.owner));
|
|
472
|
+
this.retiredBlockIds = new Set([...this.retiredBlockIds].filter((id) => failed.has(id)));
|
|
414
473
|
}
|
|
415
474
|
/** Compile, write the package, spawn. Each failure is reported ON the block
|
|
416
475
|
* — the author asked for this to run, so they are owed the reason it does
|
|
@@ -2077,7 +2136,21 @@ function buildCompositionApi(deps) {
|
|
|
2077
2136
|
blockId,
|
|
2078
2137
|
by: caller.userId
|
|
2079
2138
|
} });
|
|
2080
|
-
|
|
2139
|
+
if (block.composition !== void 0) {
|
|
2140
|
+
const unreleased = (await deps.convergeForClaims()).filter((claim) => claim.owner === blockId);
|
|
2141
|
+
if (unreleased.length > 0) {
|
|
2142
|
+
for (const claim of unreleased) deps.logger.error("composition saved but a replaced claim was not released", {
|
|
2143
|
+
tags: { deviceId: claim.deviceId },
|
|
2144
|
+
meta: {
|
|
2145
|
+
blockId,
|
|
2146
|
+
cap: claim.capName,
|
|
2147
|
+
error: claim.error
|
|
2148
|
+
}
|
|
2149
|
+
});
|
|
2150
|
+
const detail = unreleased.map((claim) => `${claim.capName} on device ${claim.deviceId}: ${claim.error}`).join("; ");
|
|
2151
|
+
throw new Error(`core-blocks: "${blockId}" was saved but a replaced claim was not released — ${detail}`);
|
|
2152
|
+
}
|
|
2153
|
+
} else deps.convergeSoon();
|
|
2081
2154
|
return { block: updated };
|
|
2082
2155
|
}),
|
|
2083
2156
|
getComposition: async ({ blockId }) => {
|
|
@@ -2453,9 +2526,30 @@ var CoreBlocksAddon = class extends BaseAddon {
|
|
|
2453
2526
|
return { block: updated };
|
|
2454
2527
|
},
|
|
2455
2528
|
delete: async ({ blockId }) => {
|
|
2529
|
+
const existing = this.requireStore().get(blockId);
|
|
2530
|
+
const composition = existing !== null && coreBlockComposition(existing) !== null;
|
|
2456
2531
|
await this.requireStore().delete(blockId);
|
|
2457
2532
|
await this.requirePrefs().delete(blockId);
|
|
2458
|
-
this.
|
|
2533
|
+
if (composition && this.supervisor === null) {
|
|
2534
|
+
this.ctx.logger.error("composition deleted but no supervisor can release its claims", { meta: { blockId } });
|
|
2535
|
+
throw new Error(`core-blocks: "${blockId}" was deleted but no supervisor runs here — its claims were not released`);
|
|
2536
|
+
}
|
|
2537
|
+
if (composition && this.supervisor !== null) {
|
|
2538
|
+
const unreleased = await this.supervisor.retireComposition(blockId);
|
|
2539
|
+
if (unreleased.length > 0) {
|
|
2540
|
+
for (const claim of unreleased) this.ctx.logger.error("composition deleted but its claim was not released", {
|
|
2541
|
+
tags: { deviceId: claim.deviceId },
|
|
2542
|
+
meta: {
|
|
2543
|
+
blockId,
|
|
2544
|
+
cap: claim.capName,
|
|
2545
|
+
owner: claim.owner,
|
|
2546
|
+
error: claim.error
|
|
2547
|
+
}
|
|
2548
|
+
});
|
|
2549
|
+
const detail = unreleased.map((claim) => `${claim.capName} on device ${claim.deviceId}: ${claim.error}`).join("; ");
|
|
2550
|
+
throw new Error(`core-blocks: "${blockId}" was deleted but its claims were not released — ${detail}`);
|
|
2551
|
+
}
|
|
2552
|
+
} else this.convergeSoon();
|
|
2459
2553
|
return { success: true };
|
|
2460
2554
|
},
|
|
2461
2555
|
setEnabled: async ({ blockId, enabled }) => {
|
|
@@ -2464,9 +2558,9 @@ var CoreBlocksAddon = class extends BaseAddon {
|
|
|
2464
2558
|
return { block: updated };
|
|
2465
2559
|
},
|
|
2466
2560
|
/**
|
|
2467
|
-
* Awaited,
|
|
2561
|
+
* Awaited, like a composition delete.
|
|
2468
2562
|
*
|
|
2469
|
-
* `create`/`update` deliberately do not wait — the write is already
|
|
2563
|
+
* `create`/`update` of a code block deliberately do not wait — the write is already
|
|
2470
2564
|
* durable and converging forks a process. A restart has no durable half:
|
|
2471
2565
|
* the whole thing IS the converge, so returning before it ran would hand
|
|
2472
2566
|
* the operator the old status and read as "nothing happened".
|
|
@@ -2547,6 +2641,10 @@ var CoreBlocksAddon = class extends BaseAddon {
|
|
|
2547
2641
|
lookupCap: buildCapabilityLookup(ALL_CAPABILITY_DEFINITIONS),
|
|
2548
2642
|
composerStates: async (blockIds) => (await requireApi().composer.getStates.query({ blockIds: [...blockIds] })).states,
|
|
2549
2643
|
convergeSoon: () => this.convergeSoon(),
|
|
2644
|
+
convergeForClaims: () => {
|
|
2645
|
+
if (this.supervisor === null) return Promise.reject(/* @__PURE__ */ new Error("core-blocks: no block supervisor runs on this node — claims cannot be released"));
|
|
2646
|
+
return this.supervisor.convergeForClaims();
|
|
2647
|
+
},
|
|
2550
2648
|
logger: this.ctx.logger.child("compositions"),
|
|
2551
2649
|
capabilityDefinitions: ALL_CAPABILITY_DEFINITIONS
|
|
2552
2650
|
});
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CNU7cdFf.js");
|
|
7
7
|
//#region src/builtins/device-history/time/bucket-time.ts
|
|
8
8
|
/**
|
|
9
9
|
* Bucket arithmetic for the three rollup tiers (D850, plan §4/§5.5).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $r as DeviceType, B as HISTORY_ITEM_CATALOG, Ct as armRemovalReconcile, D as DEVICE_HISTORY_ENERGY_KEY, Oa as EventCategory, Qi as historyItemFieldPath, Yi as emitReadiness, en as deviceHistoryCapability, nn as deviceRemovalHookCapability, ti as BaseAddon, ui as HISTORY_DEFAULT_MIN_INTERVAL_MS, z as HISTORY_CATALOG } from "../../dist-
|
|
1
|
+
import { $r as DeviceType, B as HISTORY_ITEM_CATALOG, Ct as armRemovalReconcile, D as DEVICE_HISTORY_ENERGY_KEY, Oa as EventCategory, Qi as historyItemFieldPath, Yi as emitReadiness, en as deviceHistoryCapability, nn as deviceRemovalHookCapability, ti as BaseAddon, ui as HISTORY_DEFAULT_MIN_INTERVAL_MS, z as HISTORY_CATALOG } from "../../dist-B_V9r61Z.mjs";
|
|
2
2
|
//#region src/builtins/device-history/time/bucket-time.ts
|
|
3
3
|
/**
|
|
4
4
|
* Bucket arithmetic for the three rollup tiers (D850, plan §4/§5.5).
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CNU7cdFf.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
8
|
const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
|
|
9
9
|
const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $r as DeviceType, $t as deviceExtensionCapability, Ea as userError, F as DeviceTombstoneSchema, In as locationIconKey, L as FieldClaimModeSchema, Mn as legacyAutoLinkIds, Ni as WELL_KNOWN_TAB_MAP, Oa as EventCategory, Oi as SECRET_CLEAR, P as DeviceStatusSchema, Pt as canonicalIconKey, Qr as DeviceRole, R as FieldClaimSchema, Sa as sleep$1, Ta as transformSecretWrite, Ui as collectZodSecretPaths, Wt as createDeviceExtensionProvider, Y as MINUTES_PER_DAY, Yt as defineExtensionSlotProvider, Zn as parseStreamParamsFormPatch, Zr as DeviceFeature, aa as isSecretMarkerLike, ba as secretTreeFromPaths, ea as isDeviceConfigCap, ei as errMsg, gn as formatMinutes, hr as runtimeStatePolicyFor, ia as isSecretMarker, in as deviceStatusCapability, jt as buildStreamParamsConfigSchema, l as CAP_NAMES_WITH_STATUS, na as isKeychainStoredField, on as enumerateItemArrayFields, ot as STREAM_PROFILE_META, qi as defineRecordKinds, qn as normalizeUnit, r as ALL_CAPABILITY_DEFINITIONS, ra as isSecretClear, rn as deviceStateCapability, s as CAMERA_SWITCH_ORDER, sn as enumerateSchemaFields, ti as BaseAddon, tn as deviceManagerCapability, un as expandContainer, va as resolveSecretMarkers, w as DAY_NAMES, wa as toSecretFieldView, xr as siteZoneKey } from "../../dist-
|
|
1
|
+
import { $r as DeviceType, $t as deviceExtensionCapability, Ea as userError, F as DeviceTombstoneSchema, In as locationIconKey, L as FieldClaimModeSchema, Mn as legacyAutoLinkIds, Ni as WELL_KNOWN_TAB_MAP, Oa as EventCategory, Oi as SECRET_CLEAR, P as DeviceStatusSchema, Pt as canonicalIconKey, Qr as DeviceRole, R as FieldClaimSchema, Sa as sleep$1, Ta as transformSecretWrite, Ui as collectZodSecretPaths, Wt as createDeviceExtensionProvider, Y as MINUTES_PER_DAY, Yt as defineExtensionSlotProvider, Zn as parseStreamParamsFormPatch, Zr as DeviceFeature, aa as isSecretMarkerLike, ba as secretTreeFromPaths, ea as isDeviceConfigCap, ei as errMsg, gn as formatMinutes, hr as runtimeStatePolicyFor, ia as isSecretMarker, in as deviceStatusCapability, jt as buildStreamParamsConfigSchema, l as CAP_NAMES_WITH_STATUS, na as isKeychainStoredField, on as enumerateItemArrayFields, ot as STREAM_PROFILE_META, qi as defineRecordKinds, qn as normalizeUnit, r as ALL_CAPABILITY_DEFINITIONS, ra as isSecretClear, rn as deviceStateCapability, s as CAMERA_SWITCH_ORDER, sn as enumerateSchemaFields, ti as BaseAddon, tn as deviceManagerCapability, un as expandContainer, va as resolveSecretMarkers, w as DAY_NAMES, wa as toSecretFieldView, xr as siteZoneKey } from "../../dist-B_V9r61Z.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
3
|
import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
|
|
4
4
|
import { t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-CNU7cdFf.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
//#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
|
|
9
9
|
var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ln as logDestinationCapability, ti as BaseAddon } from "../../dist-
|
|
1
|
+
import { Ln as logDestinationCapability, ti as BaseAddon } from "../../dist-B_V9r61Z.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
//#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
|
|
4
4
|
var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
|
|
@@ -3,10 +3,10 @@ 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-
|
|
7
|
-
const require_device_ca = require("../../device-ca-
|
|
6
|
+
const require_dist = require("../../dist-CNU7cdFf.js");
|
|
7
|
+
const require_device_ca = require("../../device-ca-DhyQeXsa.js");
|
|
8
8
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
9
|
-
const require_constants = require("../../constants-
|
|
9
|
+
const require_constants = require("../../constants-D4VigrMM.js");
|
|
10
10
|
const require_platform_key_source = require("../../platform-key-source-Di7HrlGR.js");
|
|
11
11
|
let node_crypto = require("node:crypto");
|
|
12
12
|
let _camstack_types_node = require("@camstack/types/node");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { An as keychainAdminCapability, G as KeychainResetRecordSchema, Oa as EventCategory, U as KEYCHAIN_RESET_TRIGGER_ACTOR, W as KeychainAuditEntrySchema, Zi as formatSecretScope, da as normalizeSecretOwner, jn as keychainCapability, ma as parseSecretRef, qi as defineRecordKinds, ti as BaseAddon } from "../../dist-
|
|
2
|
-
import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-
|
|
1
|
+
import { An as keychainAdminCapability, G as KeychainResetRecordSchema, Oa as EventCategory, U as KEYCHAIN_RESET_TRIGGER_ACTOR, W as KeychainAuditEntrySchema, Zi as formatSecretScope, da as normalizeSecretOwner, jn as keychainCapability, ma as parseSecretRef, qi as defineRecordKinds, ti as BaseAddon } from "../../dist-B_V9r61Z.mjs";
|
|
2
|
+
import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-CvBZeyVX.mjs";
|
|
3
3
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
4
|
-
import { a as MESH_CA_KEY_REF } from "../../constants-
|
|
4
|
+
import { a as MESH_CA_KEY_REF } from "../../constants-jbhoFV7w.mjs";
|
|
5
5
|
import { n as getPlatformKeychainKey } from "../../platform-key-source-BWlq0jjn.mjs";
|
|
6
6
|
import { createCipheriv, createDecipheriv, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
7
7
|
import { restrictDirToOwnerSync, restrictFileToOwnerSync, writeOwnerOnlyFileSync } from "@camstack/types/node";
|