@camstack/system 1.2.423 → 1.2.425
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/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-databases.d.ts +51 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +13 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +248 -17
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +248 -17
- package/dist/builtins/backup-orchestrator/manifest-store.d.ts +23 -3
- package/dist/builtins/backup-orchestrator/run-queue.d.ts +3 -0
- package/dist/builtins/backup-orchestrator/schedule-store.d.ts +7 -1
- package/dist/builtins/backup-orchestrator/seed-marker-store.d.ts +34 -0
- 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.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-manager/device-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- 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 +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- 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/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/database-snapshot-provider.d.ts +18 -0
- package/dist/builtins/sqlite-storage/file-host-client.d.ts +59 -0
- package/dist/builtins/sqlite-storage/file-host-handlers.d.ts +23 -0
- package/dist/builtins/sqlite-storage/file-host-protocol.d.ts +151 -0
- package/dist/builtins/sqlite-storage/file-host-worker.d.ts +1 -0
- 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 +21 -20
- package/dist/builtins/sqlite-storage/index.mjs +2 -1
- package/dist/builtins/sqlite-storage/owned-sqlite-file.d.ts +136 -0
- package/dist/builtins/sqlite-storage/placement-errors.d.ts +60 -0
- package/dist/builtins/sqlite-storage/placement-router.d.ts +80 -0
- package/dist/builtins/sqlite-storage/retired-collections.d.ts +7 -0
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +68 -8
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +23 -26
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/sqlite-storage/vector-provider.d.ts +24 -0
- package/dist/builtins/sqlite-storage/wal-maintenance.d.ts +17 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +3 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +3 -1
- package/dist/builtins/system-backup/system-backup.service.d.ts +48 -15
- package/dist/builtins/system-config/system-config.addon.js +2 -2
- package/dist/builtins/system-config/system-config.addon.mjs +2 -2
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-CgiAeG-2.js → composition-sources-197keifF.js} +1 -1
- package/dist/{composition-sources-BXDchWFn.mjs → composition-sources-DmzTSy26.mjs} +1 -1
- package/dist/{constants-1_7QtPNo.js → constants-B5Jd8Zch.js} +1 -1
- package/dist/{constants-C2dhkIuF.mjs → constants-CkNLi-XW.mjs} +1 -1
- package/dist/{dist-DimotS8e.mjs → dist-DMWeqeTF.mjs} +863 -750
- package/dist/{dist-VIIxVsBW.js → dist-DnALrQF-.js} +866 -747
- package/dist/file-host-worker.js +144 -0
- package/dist/file-host-worker.mjs +144 -0
- package/dist/index.js +9 -8
- package/dist/index.mjs +6 -5
- package/dist/{jwt-signing-key-C8nMdNYW.mjs → jwt-signing-key-CCHXAtrs.mjs} +1 -1
- package/dist/{jwt-signing-key-C8s9syVg.js → jwt-signing-key-DeqG7LD9.js} +1 -1
- package/dist/{restore-archive-DjppfrIB.js → restore-archive-C4UhQOsg.js} +156 -65
- package/dist/{restore-archive-bOMZwY0D.mjs → restore-archive-GevpOHw8.mjs} +151 -66
- package/dist/{retired-settings-keys-_muTvNyh.js → retired-settings-keys-0FOsnzIE.js} +1 -1
- package/dist/{retired-settings-keys-BYnjMBE-.mjs → retired-settings-keys-CdVFl7m2.mjs} +1 -1
- package/dist/sqlite-snapshot-worker.js +1 -1
- package/dist/sqlite-snapshot-worker.mjs +1 -1
- package/dist/wal-checkpoint-worker.js +1 -1
- package/dist/wal-checkpoint-worker.mjs +1 -1
- package/dist/wal-maintenance-BtfyfuT5.mjs +0 -0
- package/dist/wal-maintenance-DJV1rde2.js +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
require("./chunk-Cek0wNdY.js");
|
|
2
|
+
const require_wal_maintenance = require("./wal-maintenance-DJV1rde2.js");
|
|
3
|
+
let node_worker_threads = require("node:worker_threads");
|
|
4
|
+
//#region src/builtins/sqlite-storage/file-host-worker.ts
|
|
5
|
+
/**
|
|
6
|
+
* The thread that serves ONE database file of the engine (D851): its own
|
|
7
|
+
* `better-sqlite3` connection hosting the same {@link SqliteSettingsBackend}
|
|
8
|
+
* class `camstack.db` runs on the main thread, plus — for `events` — the
|
|
9
|
+
* sqlite-vec index over that connection.
|
|
10
|
+
*
|
|
11
|
+
* A worker entry is a separate bundle (`dist/file-host-worker.js`, wired in
|
|
12
|
+
* `vite.config.ts` next to the checkpoint and snapshot workers). It imports no
|
|
13
|
+
* kernel code: the backend, the protocol and `@camstack/types`, nothing else.
|
|
14
|
+
*
|
|
15
|
+
* What it does NOT own: the WAL checkpoint, the `-shm` canary and the snapshot
|
|
16
|
+
* of this file run in their own threads, started by the main thread's
|
|
17
|
+
* `OwnedSqliteFile` exactly as for `camstack.db`. What it DOES own and the main
|
|
18
|
+
* thread cannot reach: the connection itself — so the statement profiler and
|
|
19
|
+
* the idle-gated `wal_checkpoint(TRUNCATE)` / `incremental_vacuum` live here.
|
|
20
|
+
*
|
|
21
|
+
* Logging: this thread has no logger of its own. Every line is posted to the
|
|
22
|
+
* main thread, which writes it through the runner's `Db/<databaseId>` logger
|
|
23
|
+
* with `tags: { database }`.
|
|
24
|
+
*/
|
|
25
|
+
/** Pages handed back per idle tick on a file in incremental auto-vacuum mode. */
|
|
26
|
+
var INCREMENTAL_VACUUM_PAGES = 256;
|
|
27
|
+
/** A logger whose every line is a message to the main thread. */
|
|
28
|
+
function forwardingLogger(post, scope, bound) {
|
|
29
|
+
const send = (level) => (message, extras) => {
|
|
30
|
+
post({
|
|
31
|
+
kind: "log",
|
|
32
|
+
level,
|
|
33
|
+
message,
|
|
34
|
+
scope,
|
|
35
|
+
tags: {
|
|
36
|
+
...bound,
|
|
37
|
+
...extras?.tags
|
|
38
|
+
},
|
|
39
|
+
...extras?.meta !== void 0 ? { meta: extras.meta } : {}
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
debug: send("debug"),
|
|
44
|
+
info: send("info"),
|
|
45
|
+
warn: send("warn"),
|
|
46
|
+
error: send("error"),
|
|
47
|
+
child: (childScope) => forwardingLogger(post, childScope, bound),
|
|
48
|
+
withTags: (tags) => forwardingLogger(post, scope, {
|
|
49
|
+
...bound,
|
|
50
|
+
...tags
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
async function main() {
|
|
55
|
+
const port = node_worker_threads.parentPort;
|
|
56
|
+
if (port === null) throw new Error("file-host-worker: no parent port");
|
|
57
|
+
if (!require_wal_maintenance.isFileHostWorkerData(node_worker_threads.workerData)) throw new Error("file-host-worker: bad workerData");
|
|
58
|
+
const spec = node_worker_threads.workerData.spec;
|
|
59
|
+
const post = (message, transfer = []) => port.postMessage(message, [...transfer]);
|
|
60
|
+
const logger = forwardingLogger(post, "", { database: spec.databaseId });
|
|
61
|
+
let backend;
|
|
62
|
+
let vectorIndex = null;
|
|
63
|
+
let maintenance = null;
|
|
64
|
+
try {
|
|
65
|
+
backend = new require_wal_maintenance.SqliteSettingsBackend(spec.livePath, {}, logger.child("Query"), {
|
|
66
|
+
databaseId: spec.databaseId,
|
|
67
|
+
autoVacuum: spec.autoVacuum,
|
|
68
|
+
canonicalKv: false
|
|
69
|
+
});
|
|
70
|
+
await backend.initialize();
|
|
71
|
+
if (spec.loadVectorExtension) {
|
|
72
|
+
vectorIndex = require_wal_maintenance.createVectorIndex(backend, logger.child("VectorIndex"));
|
|
73
|
+
await vectorIndex.loadIndexRegistry();
|
|
74
|
+
}
|
|
75
|
+
const db = backend.getDatabase();
|
|
76
|
+
if (db !== null) {
|
|
77
|
+
maintenance = new require_wal_maintenance.WalMaintenance({
|
|
78
|
+
db,
|
|
79
|
+
dbPath: spec.livePath,
|
|
80
|
+
logger: logger.child("WalMaintenance"),
|
|
81
|
+
incrementalVacuumPages: INCREMENTAL_VACUUM_PAGES
|
|
82
|
+
});
|
|
83
|
+
maintenance.start();
|
|
84
|
+
}
|
|
85
|
+
} catch (err) {
|
|
86
|
+
post({
|
|
87
|
+
kind: "boot-failed",
|
|
88
|
+
error: require_wal_maintenance.serializeError(err)
|
|
89
|
+
});
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const dataTarget = backend;
|
|
93
|
+
const vectorTarget = vectorIndex === null ? null : require_wal_maintenance.vectorProviderOf(vectorIndex);
|
|
94
|
+
const control = require_wal_maintenance.controlTargetOf(backend, node_worker_threads.threadId);
|
|
95
|
+
const answer = (id, result, transfer = false) => post({
|
|
96
|
+
kind: "result",
|
|
97
|
+
id,
|
|
98
|
+
ok: true,
|
|
99
|
+
result
|
|
100
|
+
}, transfer ? require_wal_maintenance.collectTransferables(result) : []);
|
|
101
|
+
const refuse = (id, err) => {
|
|
102
|
+
post({
|
|
103
|
+
kind: "result",
|
|
104
|
+
id,
|
|
105
|
+
ok: false,
|
|
106
|
+
error: require_wal_maintenance.serializeError(err)
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
const serve = async (request) => {
|
|
110
|
+
try {
|
|
111
|
+
if (request.kind === "stop") {
|
|
112
|
+
maintenance?.stop();
|
|
113
|
+
await backend.shutdown();
|
|
114
|
+
answer(request.id, void 0);
|
|
115
|
+
port.close();
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (request.kind === "data") {
|
|
119
|
+
answer(request.id, await require_wal_maintenance.callData(dataTarget, request.op, require_wal_maintenance.trustInput(request.input)));
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (request.kind === "vector") {
|
|
123
|
+
if (vectorTarget === null) throw new Error(`database "${spec.databaseId}" does not serve vector calls`);
|
|
124
|
+
answer(request.id, await require_wal_maintenance.callVector(vectorTarget, request.op, require_wal_maintenance.trustInput(request.input)), true);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
answer(request.id, require_wal_maintenance.callControl(control, request.op, require_wal_maintenance.trustInput(request.input)));
|
|
128
|
+
} catch (err) {
|
|
129
|
+
refuse(request.id, err);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
port.on("message", (message) => {
|
|
133
|
+
if (!require_wal_maintenance.isFileHostRequest(message)) return;
|
|
134
|
+
serve(message);
|
|
135
|
+
});
|
|
136
|
+
post({
|
|
137
|
+
kind: "ready",
|
|
138
|
+
declared: [...backend.declaredCollectionNames()]
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
main().catch((err) => {
|
|
142
|
+
throw err;
|
|
143
|
+
});
|
|
144
|
+
//#endregion
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { C as callControl, E as controlTargetOf, T as callVector, _ as collectTransferables, a as WalMaintenance, b as isFileHostWorkerData, c as SqliteSettingsBackend, h as serializeError, o as createVectorIndex, s as vectorProviderOf, w as callData, x as trustInput, y as isFileHostRequest } from "./wal-maintenance-BtfyfuT5.mjs";
|
|
2
|
+
import { parentPort, threadId, workerData } from "node:worker_threads";
|
|
3
|
+
//#region src/builtins/sqlite-storage/file-host-worker.ts
|
|
4
|
+
/**
|
|
5
|
+
* The thread that serves ONE database file of the engine (D851): its own
|
|
6
|
+
* `better-sqlite3` connection hosting the same {@link SqliteSettingsBackend}
|
|
7
|
+
* class `camstack.db` runs on the main thread, plus — for `events` — the
|
|
8
|
+
* sqlite-vec index over that connection.
|
|
9
|
+
*
|
|
10
|
+
* A worker entry is a separate bundle (`dist/file-host-worker.js`, wired in
|
|
11
|
+
* `vite.config.ts` next to the checkpoint and snapshot workers). It imports no
|
|
12
|
+
* kernel code: the backend, the protocol and `@camstack/types`, nothing else.
|
|
13
|
+
*
|
|
14
|
+
* What it does NOT own: the WAL checkpoint, the `-shm` canary and the snapshot
|
|
15
|
+
* of this file run in their own threads, started by the main thread's
|
|
16
|
+
* `OwnedSqliteFile` exactly as for `camstack.db`. What it DOES own and the main
|
|
17
|
+
* thread cannot reach: the connection itself — so the statement profiler and
|
|
18
|
+
* the idle-gated `wal_checkpoint(TRUNCATE)` / `incremental_vacuum` live here.
|
|
19
|
+
*
|
|
20
|
+
* Logging: this thread has no logger of its own. Every line is posted to the
|
|
21
|
+
* main thread, which writes it through the runner's `Db/<databaseId>` logger
|
|
22
|
+
* with `tags: { database }`.
|
|
23
|
+
*/
|
|
24
|
+
/** Pages handed back per idle tick on a file in incremental auto-vacuum mode. */
|
|
25
|
+
var INCREMENTAL_VACUUM_PAGES = 256;
|
|
26
|
+
/** A logger whose every line is a message to the main thread. */
|
|
27
|
+
function forwardingLogger(post, scope, bound) {
|
|
28
|
+
const send = (level) => (message, extras) => {
|
|
29
|
+
post({
|
|
30
|
+
kind: "log",
|
|
31
|
+
level,
|
|
32
|
+
message,
|
|
33
|
+
scope,
|
|
34
|
+
tags: {
|
|
35
|
+
...bound,
|
|
36
|
+
...extras?.tags
|
|
37
|
+
},
|
|
38
|
+
...extras?.meta !== void 0 ? { meta: extras.meta } : {}
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
debug: send("debug"),
|
|
43
|
+
info: send("info"),
|
|
44
|
+
warn: send("warn"),
|
|
45
|
+
error: send("error"),
|
|
46
|
+
child: (childScope) => forwardingLogger(post, childScope, bound),
|
|
47
|
+
withTags: (tags) => forwardingLogger(post, scope, {
|
|
48
|
+
...bound,
|
|
49
|
+
...tags
|
|
50
|
+
})
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
async function main() {
|
|
54
|
+
const port = parentPort;
|
|
55
|
+
if (port === null) throw new Error("file-host-worker: no parent port");
|
|
56
|
+
if (!isFileHostWorkerData(workerData)) throw new Error("file-host-worker: bad workerData");
|
|
57
|
+
const spec = workerData.spec;
|
|
58
|
+
const post = (message, transfer = []) => port.postMessage(message, [...transfer]);
|
|
59
|
+
const logger = forwardingLogger(post, "", { database: spec.databaseId });
|
|
60
|
+
let backend;
|
|
61
|
+
let vectorIndex = null;
|
|
62
|
+
let maintenance = null;
|
|
63
|
+
try {
|
|
64
|
+
backend = new SqliteSettingsBackend(spec.livePath, {}, logger.child("Query"), {
|
|
65
|
+
databaseId: spec.databaseId,
|
|
66
|
+
autoVacuum: spec.autoVacuum,
|
|
67
|
+
canonicalKv: false
|
|
68
|
+
});
|
|
69
|
+
await backend.initialize();
|
|
70
|
+
if (spec.loadVectorExtension) {
|
|
71
|
+
vectorIndex = createVectorIndex(backend, logger.child("VectorIndex"));
|
|
72
|
+
await vectorIndex.loadIndexRegistry();
|
|
73
|
+
}
|
|
74
|
+
const db = backend.getDatabase();
|
|
75
|
+
if (db !== null) {
|
|
76
|
+
maintenance = new WalMaintenance({
|
|
77
|
+
db,
|
|
78
|
+
dbPath: spec.livePath,
|
|
79
|
+
logger: logger.child("WalMaintenance"),
|
|
80
|
+
incrementalVacuumPages: INCREMENTAL_VACUUM_PAGES
|
|
81
|
+
});
|
|
82
|
+
maintenance.start();
|
|
83
|
+
}
|
|
84
|
+
} catch (err) {
|
|
85
|
+
post({
|
|
86
|
+
kind: "boot-failed",
|
|
87
|
+
error: serializeError(err)
|
|
88
|
+
});
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const dataTarget = backend;
|
|
92
|
+
const vectorTarget = vectorIndex === null ? null : vectorProviderOf(vectorIndex);
|
|
93
|
+
const control = controlTargetOf(backend, threadId);
|
|
94
|
+
const answer = (id, result, transfer = false) => post({
|
|
95
|
+
kind: "result",
|
|
96
|
+
id,
|
|
97
|
+
ok: true,
|
|
98
|
+
result
|
|
99
|
+
}, transfer ? collectTransferables(result) : []);
|
|
100
|
+
const refuse = (id, err) => {
|
|
101
|
+
post({
|
|
102
|
+
kind: "result",
|
|
103
|
+
id,
|
|
104
|
+
ok: false,
|
|
105
|
+
error: serializeError(err)
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
const serve = async (request) => {
|
|
109
|
+
try {
|
|
110
|
+
if (request.kind === "stop") {
|
|
111
|
+
maintenance?.stop();
|
|
112
|
+
await backend.shutdown();
|
|
113
|
+
answer(request.id, void 0);
|
|
114
|
+
port.close();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (request.kind === "data") {
|
|
118
|
+
answer(request.id, await callData(dataTarget, request.op, trustInput(request.input)));
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (request.kind === "vector") {
|
|
122
|
+
if (vectorTarget === null) throw new Error(`database "${spec.databaseId}" does not serve vector calls`);
|
|
123
|
+
answer(request.id, await callVector(vectorTarget, request.op, trustInput(request.input)), true);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
answer(request.id, callControl(control, request.op, trustInput(request.input)));
|
|
127
|
+
} catch (err) {
|
|
128
|
+
refuse(request.id, err);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
port.on("message", (message) => {
|
|
132
|
+
if (!isFileHostRequest(message)) return;
|
|
133
|
+
serve(message);
|
|
134
|
+
});
|
|
135
|
+
post({
|
|
136
|
+
kind: "ready",
|
|
137
|
+
declared: [...backend.declaredCollectionNames()]
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
main().catch((err) => {
|
|
141
|
+
throw err;
|
|
142
|
+
});
|
|
143
|
+
//#endregion
|
|
144
|
+
export {};
|
package/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_jwt_signing_key = require("./jwt-signing-key-
|
|
3
|
+
const require_dist = require("./dist-DnALrQF-.js");
|
|
4
|
+
const require_jwt_signing_key = require("./jwt-signing-key-DeqG7LD9.js");
|
|
5
5
|
const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
|
|
6
6
|
require("./builtins/alerts/index.js");
|
|
7
7
|
const require_builtins_calendars_calendars_addon = require("./builtins/calendars/calendars.addon.js");
|
|
@@ -22,11 +22,12 @@ require("./builtins/local-auth/index.js");
|
|
|
22
22
|
const require_builtins_loki_logging_index = require("./builtins/loki-logging/index.js");
|
|
23
23
|
const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
|
|
24
24
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
|
|
25
|
+
const require_wal_maintenance = require("./wal-maintenance-DJV1rde2.js");
|
|
25
26
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
|
|
26
27
|
const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
|
|
27
28
|
const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
|
|
28
29
|
require("./builtins/storage-orchestrator/index.js");
|
|
29
|
-
const require_constants = require("./constants-
|
|
30
|
+
const require_constants = require("./constants-B5Jd8Zch.js");
|
|
30
31
|
const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
|
|
31
32
|
require("./builtins/system-config/index.js");
|
|
32
33
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
@@ -34,7 +35,7 @@ const require_custom_action_registry = require("./custom-action-registry-Bf_Ynag
|
|
|
34
35
|
const require_tls = require("./tls-BgImdxCO.js");
|
|
35
36
|
const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
|
|
36
37
|
const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
|
|
37
|
-
const require_restore_archive = require("./restore-archive-
|
|
38
|
+
const require_restore_archive = require("./restore-archive-C4UhQOsg.js");
|
|
38
39
|
let zod = require("zod");
|
|
39
40
|
let node_crypto = require("node:crypto");
|
|
40
41
|
node_crypto = require_chunk.__toESM(node_crypto);
|
|
@@ -11472,7 +11473,7 @@ var PREFIX_PAGE_BUDGET = 512;
|
|
|
11472
11473
|
* be handed something that looks like a complete answer.
|
|
11473
11474
|
*/
|
|
11474
11475
|
async function loadPrefixed(door, collection, prefix, decode = unwrapValue) {
|
|
11475
|
-
const range =
|
|
11476
|
+
const range = require_wal_maintenance.prefixRange(prefix);
|
|
11476
11477
|
const result = {};
|
|
11477
11478
|
let cursor = range?.lo ?? null;
|
|
11478
11479
|
for (let page = 0;; page++) {
|
|
@@ -11528,7 +11529,7 @@ async function loadSystemSettingsPrefix(door, prefix, mayRead = () => true) {
|
|
|
11528
11529
|
return result;
|
|
11529
11530
|
}
|
|
11530
11531
|
async function replacePrefixed(door, collection, prefix, values, wrap) {
|
|
11531
|
-
const range =
|
|
11532
|
+
const range = require_wal_maintenance.prefixRange(prefix);
|
|
11532
11533
|
if (range !== null) await door.deleteWhere({
|
|
11533
11534
|
collection,
|
|
11534
11535
|
filter: { whereBetween: { id: [range.lo, range.hi] } }
|
|
@@ -11609,7 +11610,7 @@ function createDoorSettingsView(addonId, door, sections) {
|
|
|
11609
11610
|
}));
|
|
11610
11611
|
},
|
|
11611
11612
|
async clearDeviceStore(deviceId) {
|
|
11612
|
-
const range =
|
|
11613
|
+
const range = require_wal_maintenance.prefixRange(`${addonId}:${String(deviceId)}.`);
|
|
11613
11614
|
if (range === null) return;
|
|
11614
11615
|
await door.deleteWhere({
|
|
11615
11616
|
collection: "addon-device-settings",
|
|
@@ -27002,7 +27003,7 @@ exports.ScopedTokenManager = require_builtins_local_auth_local_auth_addon.Scoped
|
|
|
27002
27003
|
exports.SettingsReadUnavailableError = require_builtins_local_auth_local_auth_addon.SettingsReadUnavailableError;
|
|
27003
27004
|
exports.SocketChannel = SocketChannel;
|
|
27004
27005
|
exports.SqliteSettingsAddon = require_builtins_sqlite_storage_sqlite_settings_addon.SqliteSettingsAddon;
|
|
27005
|
-
exports.SqliteSettingsBackend =
|
|
27006
|
+
exports.SqliteSettingsBackend = require_wal_maintenance.SqliteSettingsBackend;
|
|
27006
27007
|
exports.StagingArea = StagingArea;
|
|
27007
27008
|
exports.StorageLocationManager = StorageLocationManager;
|
|
27008
27009
|
exports.StorageManager = StorageManager;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __require } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { c as staticJwtSigningKey, i as getProcessJwtSigningKeyState, n as JwtSigningKeyUnavailableError, o as processJwtSigningKey, r as SYSTEM_SECRET_OWNER, t as JWT_SIGNING_KEY_REF } from "./jwt-signing-key-
|
|
2
|
+
import { $t as looseSchema, Ar as expandCapMethods, Dn as scopesAllowAddon, Gr as readinessKey, Hr as parseJsonObject, Ht as isVoidInput, Jr as scopeKey, Jt as lifecycleJobSchema, K as addonSettingsCapability, Kr as resolveCapMount, Lt as isArrayOutputSchema, M as METHOD_ACCESS_MAP, On as scopesAllowDeviceCap, Or as emitDownForOwnedCaps, Qt as logLevelAtMost, Rt as isCollectionArrayMethod, Tr as createEvent$1, Ur as parseJsonUnknown, Ut as kebabToCamel$1, Vt as isObjectInput, br as asNumber, cn as objectInputDeclaresAddonId, cr as errMsg$1, dr as DEVICE_SETTINGS_CONTRIBUTION_METHODS, fr as DEVICE_STATUS_METHOD, gr as ReadinessTimeoutError, hr as ReadinessRegistry, jt as extractNestedAddonId, k as LOG_LEVEL_RANK, ln as objectInputDeclaresRequiredDeviceId, mn as procedureAuthKey, mr as RUNTIME_DEFAULTS, t as ALL_CAPABILITY_DEFINITIONS, ti as EventCategory$1, ur as DATAPLANE_SECRET_HEADER$1, wn as resolveMethodAuth, xr as asString$1, yr as asJsonObject$1, zn as supportedRuntimes } from "./dist-DMWeqeTF.mjs";
|
|
3
|
+
import { c as staticJwtSigningKey, i as getProcessJwtSigningKeyState, n as JwtSigningKeyUnavailableError, o as processJwtSigningKey, r as SYSTEM_SECRET_OWNER, t as JWT_SIGNING_KEY_REF } from "./jwt-signing-key-CCHXAtrs.mjs";
|
|
4
4
|
import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
|
|
5
5
|
import "./builtins/alerts/index.mjs";
|
|
6
6
|
import { CalendarsAddon } from "./builtins/calendars/calendars.addon.mjs";
|
|
@@ -21,11 +21,12 @@ import "./builtins/local-auth/index.mjs";
|
|
|
21
21
|
import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index.mjs";
|
|
22
22
|
import NativeMetricsAddon, { a as NativeMetricsProvider, n as nodeProcReader, r as parseProcStat } from "./builtins/native-metrics/native-metrics.addon.mjs";
|
|
23
23
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
|
|
24
|
-
import {
|
|
24
|
+
import { c as SqliteSettingsBackend, l as prefixRange } from "./wal-maintenance-BtfyfuT5.mjs";
|
|
25
|
+
import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
25
26
|
import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
26
27
|
import { StorageOrchestratorAddon, a as stripForwardedCaller, i as createHubCapForwardService, n as HUB_CAP_FWD_ACTION, o as buildStorageLocationRegistry, r as HUB_CAP_FWD_SERVICE, t as StorageOrchestratorService } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
27
28
|
import "./builtins/storage-orchestrator/index.mjs";
|
|
28
|
-
import { _ as getProcessClusterSecretGate, a as MESH_CA_KEY_REF, b as setProcessClusterSecretGate, d as CLUSTER_SECRET_REF, f as CLUSTER_SECRET_REJECTED_EXIT_CODE, g as clusterSecretMatches, h as checkClusterSecret, i as MESH_CA_FIELD, m as CLUSTER_SECRET_UNAVAILABLE_TYPE, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, p as CLUSTER_SECRET_SETTINGS_KEY, u as CLUSTER_SECRET_MISMATCH_TYPE, v as hashClusterSecret, y as isClusterSecretMismatchError } from "./constants-
|
|
29
|
+
import { _ as getProcessClusterSecretGate, a as MESH_CA_KEY_REF, b as setProcessClusterSecretGate, d as CLUSTER_SECRET_REF, f as CLUSTER_SECRET_REJECTED_EXIT_CODE, g as clusterSecretMatches, h as checkClusterSecret, i as MESH_CA_FIELD, m as CLUSTER_SECRET_UNAVAILABLE_TYPE, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, p as CLUSTER_SECRET_SETTINGS_KEY, u as CLUSTER_SECRET_MISMATCH_TYPE, v as hashClusterSecret, y as isClusterSecretMismatchError } from "./constants-CkNLi-XW.mjs";
|
|
29
30
|
import { A as AGENT_UI_UNLOCK_TTL_MS, B as isMeshAuthMode, C as generateMeshCa, D as loadMeshCa, E as issueMeshLeafFromCsr, F as parseAgentDashboardOrigins, G as setProcessMeshEnforcer, H as requestProcessMeshEnforcement, I as verifyAgentUiUnlockTicket, J as parseCidrList, K as createCidrMatcher, L as MESH_AUTH_MODE_FIELD, M as UnlockTicketJtiStore, N as isAllowedAgentDashboardReturnTo, O as AGENT_DASHBOARD_ORIGINS_FIELD, P as mintAgentUiUnlockTicket, R as getProcessMeshAuthMode, S as exportMeshPrivateKeyPem, SystemConfigAddon, T as issueMeshLeafForNode, U as setProcessMeshAuthMode, V as parseMeshAuthMode, W as setProcessMeshAuthStatusSource, Y as readCidrSetting, _ as getProcessMeshCaState, a as ServiceBroker, b as caFingerprintCompact, c as JoinTokenJtiStore, d as verifyMeshJoinToken, f as getProcessNodeMeshTransport, g as MeshCaKeeper, h as processMeshCrl, i as Errors, j as AGENT_UI_UNLOCK_VERSION, k as AGENT_UI_UNLOCK_DOMAIN, l as mintMeshJoinToken, m as MeshCrl, n as MESH_TLS_PORT_HELLO_FIELD, o as setProcessMeshTlsEnabler, p as setProcessMeshPeerTransportLookup, q as normalizeIp, r as TlsTcpTransporter, s as enrollMeshNode, u as processJoinTokenJtiStore, v as requireProcessMeshCa, w as generateMeshKeyPair, x as createMeshCsrPem, y as caFingerprint, z as getProcessMeshAuthStatus } from "./builtins/system-config/system-config.addon.mjs";
|
|
30
31
|
import "./builtins/system-config/index.mjs";
|
|
31
32
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
@@ -33,7 +34,7 @@ import { C as isModelDownloaded, T as revisionWeightUrl, _ as downloadFile, a as
|
|
|
33
34
|
import { A as allFamiliesListenHost, C as collectCertIdentity, D as SERVER_AUTH_OID, E as MAX_LEAF_VALIDITY_DAYS, F as registerLanHttpHandler, M as bindPendingLanHttp, N as closeLanHttp, O as evaluateExistingCert, P as readLanHttpState, S as CA_COMMON_NAME, T as LEAF_RENEWAL_WINDOW_DAYS, _ as writeExtraSans, a as validateUploadedTls, b as loadTlsCert, c as registerHttpsListener, d as prepareBootTls, f as UPLOADED_CA_FILE, g as splitPemCertificates, h as readTlsMode, i as storeUploadedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, l as reloadHttpsListener, m as readTlsAccessStatus, n as regenerateCertificate, o as clearHttpsListener, p as readExtraSans, r as revertToGeneratedCertificate, s as leafFingerprintOf, t as applyCertificateToListener, u as servedHttpsLeafFingerprint, v as writeTlsMode, w as CA_VALIDITY_DAYS, x as reissueTlsLeaf, y as ensureTlsCert } from "./tls-CaOLZ09W.mjs";
|
|
34
35
|
import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
|
|
35
36
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
|
|
36
|
-
import { c as
|
|
37
|
+
import { c as BackupDecryptError, f as generateBackupKeyPair, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-GevpOHw8.mjs";
|
|
37
38
|
import { z } from "zod";
|
|
38
39
|
import * as crypto$1 from "node:crypto";
|
|
39
40
|
import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|