@camstack/system 1.2.464 → 1.2.466
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/addon-runner.js +1 -0
- package/dist/addon-runner.mjs +1 -0
- package/dist/addon-utils.mjs +1 -1
- package/dist/{agent-https-B9gbXoJI.mjs → agent-https-DDzIuZY_.mjs} +1 -1
- package/dist/{agent-https-DhFIbEwN.js → agent-https-OIvfjiTx.js} +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 +4 -4
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
- package/dist/builtins/alerts/alerts.addon.d.ts +7 -0
- package/dist/builtins/alerts/alerts.addon.js +65 -2
- package/dist/builtins/alerts/alerts.addon.mjs +65 -2
- 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 +5 -5
- 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-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/auth-schema.d.ts +0 -2
- package/dist/builtins/local-auth/local-auth.addon.d.ts +0 -1
- package/dist/builtins/local-auth/local-auth.addon.js +23 -178
- package/dist/builtins/local-auth/local-auth.addon.mjs +27 -181
- package/dist/builtins/local-auth/record-kinds.d.ts +1 -6
- 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 +10 -10
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +8 -8
- 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 +20 -20
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/records/records-engine.d.ts +11 -0
- package/dist/builtins/sqlite-storage/records/records-provider.d.ts +7 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +25 -15
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +25 -15
- 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 +115 -115
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-oXvmbMHX.js → composition-sources-DqHwltDV.js} +1 -1
- package/dist/{composition-sources-CGtooHSL.mjs → composition-sources-f74jlgRO.mjs} +1 -1
- package/dist/{constants-5mrGZxwS.js → constants-CdgJF4V6.js} +1 -1
- package/dist/{constants-CdutnpL9.mjs → constants-Dknv37yZ.mjs} +1 -1
- package/dist/{coral-accelerators-D_S1Fo5h.mjs → coral-accelerators-Qhn5TOYZ.mjs} +5 -5
- package/dist/{custom-action-registry-BGYDjTqY.mjs → custom-action-registry-DZSCLBuT.mjs} +37 -37
- package/dist/{device-ca-DZHKlZlD.mjs → device-ca-B16Mr3EY.mjs} +1 -1
- package/dist/{device-ca-B3xUzps7.js → device-ca-DpvQ5wrb.js} +1 -1
- package/dist/{dist-C2OBCa-A.mjs → dist-CfjkLTZV.mjs} +281 -66
- package/dist/{dist-D9aw_d0G.js → dist-QyW9hVO2.js} +298 -71
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-CFlhVKK6.js → hub-mdns-ciao-CWkX17zX.js} +2 -2
- package/dist/{hub-mdns-ciao-Bm09NrMS.mjs → hub-mdns-ciao-CtHQEnb3.mjs} +2 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +8 -8
- package/dist/index.mjs +228 -227
- package/dist/{restore-archive-D6sS7Gt2.mjs → restore-archive-BmHNBgte.mjs} +94 -94
- package/dist/{restore-archive-6zkRREHO.js → restore-archive-DMgpNgX5.js} +1 -1
- package/dist/{wal-maintenance-jXcOxm2T.js → wal-maintenance-BIpPCYDi.js} +0 -0
- package/dist/{wal-maintenance-Dg6IzSgz.mjs → wal-maintenance-Bs_X-di6.mjs} +0 -0
- package/package.json +1 -1
- package/dist/auth/api-key-manager.d.ts +0 -19
|
@@ -1,96 +1,15 @@
|
|
|
1
1
|
import { i as __require, o as __toESM, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
2
|
+
import { $ as PreferenceNamespaceSchema, $r as BaseAddon, Ar as userManagementCapability, Ca as userError, Cn as isCredentialTokenPayload, Ct as authProviderCapability, E as DEVICE_ENROLLMENT_TTL_MS, Gi as defineRecordKinds, O as DEVICE_NONCE_TTL_MS, Ot as buildDeviceEnrollmentLink, Q as PreferenceDeviceIdSchema, Z as PREFERENCES_MAX_VALUE_BYTES, Zt as deviceCredentialsCapability, ct as SsoBridgeClaimsSchema, et as PreferenceValueSchema, h as CREDENTIAL_TOKEN_AUDIENCE, ht as UserRecordSchema, ia as makeSecretMarker, kt as buildDeviceSignatureMessage, mn as formatDeviceRevoker, ot as ScopedTokenSchema, pt as TokenScopeSchema, ta as isSecretMarker, y as CredentialTokenClaimsSchema } from "../../dist-CfjkLTZV.mjs";
|
|
4
3
|
import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
|
|
5
4
|
import { t as require_ms } from "../../ms-CgH2OFlD.mjs";
|
|
6
|
-
import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-
|
|
5
|
+
import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-B16Mr3EY.mjs";
|
|
6
|
+
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import * as crypto$1 from "node:crypto";
|
|
9
9
|
import { X509Certificate, createHash, randomUUID, timingSafeEqual } from "node:crypto";
|
|
10
10
|
import nodeCrypto from "crypto";
|
|
11
11
|
import * as path$1 from "node:path";
|
|
12
|
-
import * as fs from "node:fs";
|
|
13
|
-
//#region src/auth/parse-record.ts
|
|
14
|
-
function parseRecord$2(kind, schema, data) {
|
|
15
|
-
try {
|
|
16
|
-
return schema.parse(data);
|
|
17
|
-
} catch (err) {
|
|
18
|
-
const topKeys = data && typeof data === "object" && !Array.isArray(data) ? Object.keys(data).join(", ") || "(empty)" : `(non-object: ${typeof data})`;
|
|
19
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
20
|
-
const hint = data && typeof data === "object" && !Array.isArray(data) && Object.keys(data).length === 1 && "data" in data ? " This shape is the legacy double-wrap from a stale settings-store query path. Restart the server with the latest @camstack/system build." : "";
|
|
21
|
-
throw new Error(`Failed to parse ${kind} from settings store. Top-level keys=[${topKeys}].${hint} Underlying: ${detail}`, { cause: err });
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/auth/api-key-manager.ts
|
|
26
|
-
/**
|
|
27
|
-
* Legacy API keys — LIST and REVOKE only.
|
|
28
|
-
*
|
|
29
|
-
* No boundary accepts one (the tRPC context has no branch for them) and
|
|
30
|
-
* nothing creates them any more: what is left is the rows a hub may still
|
|
31
|
-
* hold, so an operator can see and delete them. Tokens (`auth.mintToken`) are
|
|
32
|
-
* the credential for scripts and integrations.
|
|
33
|
-
*/
|
|
34
|
-
var import_read_all_rows = require_read_all_rows();
|
|
35
|
-
var API_KEYS_COLLECTION$1 = "api_keys";
|
|
36
|
-
function parseApiKey(data) {
|
|
37
|
-
return parseRecord$2("api-key", ApiKeyRecordSchema, data);
|
|
38
|
-
}
|
|
39
|
-
function rowToApiKey(id, body) {
|
|
40
|
-
return parseApiKey({
|
|
41
|
-
id,
|
|
42
|
-
...body
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
var ApiKeyManager = class {
|
|
46
|
-
kind;
|
|
47
|
-
legacyStore;
|
|
48
|
-
constructor(deps) {
|
|
49
|
-
if ("apiKeysKind" in deps) {
|
|
50
|
-
this.kind = deps.apiKeysKind;
|
|
51
|
-
this.legacyStore = deps.legacyStore ?? null;
|
|
52
|
-
} else {
|
|
53
|
-
this.kind = null;
|
|
54
|
-
this.legacyStore = deps.getStore();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
get store() {
|
|
58
|
-
if (this.legacyStore === null) throw new Error("ApiKeyManager: legacy store unavailable on records-only path");
|
|
59
|
-
return this.legacyStore;
|
|
60
|
-
}
|
|
61
|
-
async listAll() {
|
|
62
|
-
const kind = this.kind;
|
|
63
|
-
return (kind !== null ? (await (0, import_read_all_rows.readAllRows)(kind)).map((row) => rowToApiKey(row.id, row.data)) : (await this.store.query.query({ collection: API_KEYS_COLLECTION$1 })).map((r) => parseApiKey(r.data))).map((parsed) => {
|
|
64
|
-
const { tokenHash: _th, ...rest } = parsed;
|
|
65
|
-
return rest;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
async revoke(id) {
|
|
69
|
-
const kind = this.kind;
|
|
70
|
-
if (kind !== null) {
|
|
71
|
-
await kind.delete(id);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
await this.store.delete.mutate({
|
|
75
|
-
collection: API_KEYS_COLLECTION$1,
|
|
76
|
-
key: id
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
async findById(id) {
|
|
80
|
-
const kind = this.kind;
|
|
81
|
-
if (kind !== null) {
|
|
82
|
-
const row = await kind.get(id);
|
|
83
|
-
return row === null ? null : rowToApiKey(row.id, row.data);
|
|
84
|
-
}
|
|
85
|
-
const results = await this.store.query.query({
|
|
86
|
-
collection: API_KEYS_COLLECTION$1,
|
|
87
|
-
filter: { where: { id } }
|
|
88
|
-
});
|
|
89
|
-
if (results.length === 0) return null;
|
|
90
|
-
return parseApiKey(results[0].data);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
//#endregion
|
|
12
|
+
import * as fs$1 from "node:fs";
|
|
94
13
|
//#region ../../node_modules/bcryptjs/index.js
|
|
95
14
|
/**
|
|
96
15
|
* The random implementation to use as a fallback.
|
|
@@ -6335,6 +6254,7 @@ var AuthManager = class {
|
|
|
6335
6254
|
* cannot be stored is logged loudly instead, and never blocks the action
|
|
6336
6255
|
* (a login must not fail because the audit table is busy).
|
|
6337
6256
|
*/
|
|
6257
|
+
var import_read_all_rows = require_read_all_rows();
|
|
6338
6258
|
/**
|
|
6339
6259
|
* @durable class=ledger owner=local-auth
|
|
6340
6260
|
* write="one row per audited auth event: a second factor skipped from a trusted
|
|
@@ -6389,7 +6309,7 @@ var AUTH_AUDIT_ACTIONS = [
|
|
|
6389
6309
|
];
|
|
6390
6310
|
var RETENTION_MS = 90 * 864e5;
|
|
6391
6311
|
var MAX_LIST = 500;
|
|
6392
|
-
function parseRecord$
|
|
6312
|
+
function parseRecord$2(data) {
|
|
6393
6313
|
const id = data["id"];
|
|
6394
6314
|
const rawAt = data["at"];
|
|
6395
6315
|
const at = typeof rawAt === "number" ? rawAt : typeof rawAt === "string" && rawAt.trim() !== "" && Number.isFinite(Number(rawAt)) ? Number(rawAt) : null;
|
|
@@ -6482,7 +6402,7 @@ var AuthAuditLog = class {
|
|
|
6482
6402
|
order: "at",
|
|
6483
6403
|
desc: true,
|
|
6484
6404
|
limit
|
|
6485
|
-
})).records.map((row) => parseRecord$
|
|
6405
|
+
})).records.map((row) => parseRecord$2({
|
|
6486
6406
|
id: row.id,
|
|
6487
6407
|
at: row.at,
|
|
6488
6408
|
action: row.data.action,
|
|
@@ -6493,7 +6413,7 @@ var AuthAuditLog = class {
|
|
|
6493
6413
|
return (await this.store.query.query({
|
|
6494
6414
|
collection: AUTH_AUDIT_COLLECTION,
|
|
6495
6415
|
...input.userId !== void 0 ? { filter: { where: { userId: input.userId } } } : {}
|
|
6496
|
-
})).map((row) => parseRecord$
|
|
6416
|
+
})).map((row) => parseRecord$2(row.data)).filter((r) => r !== null).toSorted((a, b) => b.at - a.at).slice(0, limit);
|
|
6497
6417
|
}
|
|
6498
6418
|
/** Delete rows older than 90 days. Returns how many. */
|
|
6499
6419
|
async reap() {
|
|
@@ -6709,7 +6629,7 @@ var PLATFORMS = [
|
|
|
6709
6629
|
"web",
|
|
6710
6630
|
"other"
|
|
6711
6631
|
];
|
|
6712
|
-
function parseRecord(data) {
|
|
6632
|
+
function parseRecord$1(data) {
|
|
6713
6633
|
const id = str$1(data, "id");
|
|
6714
6634
|
const userId = str$1(data, "userId");
|
|
6715
6635
|
const deviceName = str$1(data, "deviceName");
|
|
@@ -6774,7 +6694,7 @@ var DeviceCredentialManager = class {
|
|
|
6774
6694
|
const kind = this.deps.deviceCredentialsKind ?? null;
|
|
6775
6695
|
if (kind !== null) {
|
|
6776
6696
|
for (const row of await (0, import_read_all_rows.readAllRows)(kind)) {
|
|
6777
|
-
const record = parseRecord({
|
|
6697
|
+
const record = parseRecord$1({
|
|
6778
6698
|
id: row.id,
|
|
6779
6699
|
...row.data
|
|
6780
6700
|
});
|
|
@@ -6784,7 +6704,7 @@ var DeviceCredentialManager = class {
|
|
|
6784
6704
|
}
|
|
6785
6705
|
const rows = await this.store.query.query({ collection: DEVICE_CREDENTIALS_COLLECTION });
|
|
6786
6706
|
for (const row of rows) {
|
|
6787
|
-
const record = parseRecord(row.data);
|
|
6707
|
+
const record = parseRecord$1(row.data);
|
|
6788
6708
|
if (record !== null) this.records.set(record.id, record);
|
|
6789
6709
|
}
|
|
6790
6710
|
}
|
|
@@ -7205,7 +7125,6 @@ var USERS_COLLECTION$1 = "users";
|
|
|
7205
7125
|
* expiry column and no sweep, so a key lives until someone removes it (or the
|
|
7206
7126
|
* destructive `declareCollection` rebuild takes the table)."
|
|
7207
7127
|
*/
|
|
7208
|
-
var API_KEYS_COLLECTION = "api_keys";
|
|
7209
7128
|
/**
|
|
7210
7129
|
* @durable class=config owner=local-auth
|
|
7211
7130
|
* write="none since D895 — the pre-D892 scoped-token rows are kept on disk,
|
|
@@ -7294,52 +7213,6 @@ var USERS_COLUMNS = [
|
|
|
7294
7213
|
notNull: true
|
|
7295
7214
|
}
|
|
7296
7215
|
];
|
|
7297
|
-
var API_KEYS_COLUMNS = [
|
|
7298
|
-
{
|
|
7299
|
-
name: "id",
|
|
7300
|
-
type: "TEXT",
|
|
7301
|
-
primaryKey: true,
|
|
7302
|
-
notNull: true
|
|
7303
|
-
},
|
|
7304
|
-
{
|
|
7305
|
-
name: "label",
|
|
7306
|
-
type: "TEXT",
|
|
7307
|
-
notNull: true
|
|
7308
|
-
},
|
|
7309
|
-
{
|
|
7310
|
-
name: "isAdmin",
|
|
7311
|
-
type: "BOOLEAN",
|
|
7312
|
-
notNull: true
|
|
7313
|
-
},
|
|
7314
|
-
{
|
|
7315
|
-
name: "tokenHash",
|
|
7316
|
-
type: "TEXT",
|
|
7317
|
-
notNull: true,
|
|
7318
|
-
unique: true
|
|
7319
|
-
},
|
|
7320
|
-
{
|
|
7321
|
-
name: "tokenPrefix",
|
|
7322
|
-
type: "TEXT",
|
|
7323
|
-
notNull: true
|
|
7324
|
-
},
|
|
7325
|
-
{
|
|
7326
|
-
name: "allowedProviders",
|
|
7327
|
-
type: "JSON"
|
|
7328
|
-
},
|
|
7329
|
-
{
|
|
7330
|
-
name: "allowedDevices",
|
|
7331
|
-
type: "JSON"
|
|
7332
|
-
},
|
|
7333
|
-
{
|
|
7334
|
-
name: "createdAt",
|
|
7335
|
-
type: "INTEGER",
|
|
7336
|
-
notNull: true
|
|
7337
|
-
},
|
|
7338
|
-
{
|
|
7339
|
-
name: "lastUsedAt",
|
|
7340
|
-
type: "INTEGER"
|
|
7341
|
-
}
|
|
7342
|
-
];
|
|
7343
7216
|
var USER_TOTP_COLUMNS = [
|
|
7344
7217
|
{
|
|
7345
7218
|
name: "userId",
|
|
@@ -7457,14 +7330,6 @@ async function declareAuthSchema(store, options) {
|
|
|
7457
7330
|
collection: USERS_COLLECTION$1,
|
|
7458
7331
|
columns: USERS_COLUMNS
|
|
7459
7332
|
});
|
|
7460
|
-
if (!skip.has("api_keys")) await store.declareCollection.mutate({
|
|
7461
|
-
collection: API_KEYS_COLLECTION,
|
|
7462
|
-
columns: API_KEYS_COLUMNS,
|
|
7463
|
-
indexes: [{
|
|
7464
|
-
name: "idx_api_keys_token_prefix",
|
|
7465
|
-
columns: ["tokenPrefix"]
|
|
7466
|
-
}]
|
|
7467
|
-
});
|
|
7468
7333
|
if (!skip.has("scoped_tokens")) await store.declareCollection.mutate({
|
|
7469
7334
|
collection: SCOPED_TOKENS_COLLECTION,
|
|
7470
7335
|
columns: SCOPED_TOKENS_COLUMNS,
|
|
@@ -7538,7 +7403,6 @@ async function declareAuthSchema(store, options) {
|
|
|
7538
7403
|
*/
|
|
7539
7404
|
var DAY_MS = 864e5;
|
|
7540
7405
|
var UserBodySchema = UserRecordSchema.omit({ id: true });
|
|
7541
|
-
var ApiKeyBodySchema = ApiKeyRecordSchema.omit({ id: true });
|
|
7542
7406
|
var ScopedTokenBodySchema = ScopedTokenSchema.omit({ id: true });
|
|
7543
7407
|
var AdminTokenBodySchema = z.object({
|
|
7544
7408
|
createdBy: z.string(),
|
|
@@ -7626,18 +7490,6 @@ var _localAuthRecordKinds = defineRecordKinds({
|
|
|
7626
7490
|
}],
|
|
7627
7491
|
retention: { none: "row goes only when an operator deletes the user; destructive declareCollection rebuild wipes all accounts" }
|
|
7628
7492
|
},
|
|
7629
|
-
"api-keys": {
|
|
7630
|
-
schema: ApiKeyBodySchema,
|
|
7631
|
-
class: "config",
|
|
7632
|
-
writeTrigger: "legacy list/revoke only — nothing creates new API keys",
|
|
7633
|
-
device: "none",
|
|
7634
|
-
at: "none",
|
|
7635
|
-
indexes: [{
|
|
7636
|
-
name: "prefix",
|
|
7637
|
-
fields: ["tokenPrefix"]
|
|
7638
|
-
}],
|
|
7639
|
-
retention: { none: "explicit revoke only" }
|
|
7640
|
-
},
|
|
7641
7493
|
"scoped-tokens": {
|
|
7642
7494
|
schema: ScopedTokenBodySchema,
|
|
7643
7495
|
class: "config",
|
|
@@ -7774,7 +7626,6 @@ var _localAuthRecordKinds = defineRecordKinds({
|
|
|
7774
7626
|
});
|
|
7775
7627
|
var localAuthRecordKinds = _localAuthRecordKinds;
|
|
7776
7628
|
var localAuthUsersRecordKind = _localAuthRecordKinds.users;
|
|
7777
|
-
var localAuthApiKeysRecordKind = _localAuthRecordKinds["api-keys"];
|
|
7778
7629
|
_localAuthRecordKinds["scoped-tokens"];
|
|
7779
7630
|
_localAuthRecordKinds["admin-tokens"];
|
|
7780
7631
|
var localAuthLoginSessionsRecordKind = _localAuthRecordKinds["login-sessions"];
|
|
@@ -7787,7 +7638,6 @@ var localAuthAuthAuditRecordKind = _localAuthRecordKinds["auth-audit"];
|
|
|
7787
7638
|
/** Legacy collections that must not be `declareCollection` once these kinds are live. */
|
|
7788
7639
|
var LOCAL_AUTH_RECORDS_LEGACY_COLLECTIONS = [
|
|
7789
7640
|
USERS_COLLECTION$1,
|
|
7790
|
-
API_KEYS_COLLECTION,
|
|
7791
7641
|
SCOPED_TOKENS_COLLECTION,
|
|
7792
7642
|
ADMIN_TOKENS_COLLECTION,
|
|
7793
7643
|
LOGIN_SESSIONS_COLLECTION,
|
|
@@ -7800,7 +7650,6 @@ var LOCAL_AUTH_RECORDS_LEGACY_COLLECTIONS = [
|
|
|
7800
7650
|
function localAuthRecordStoresOf(records) {
|
|
7801
7651
|
return {
|
|
7802
7652
|
users: records.kind(localAuthUsersRecordKind),
|
|
7803
|
-
apiKeys: records.kind(localAuthApiKeysRecordKind),
|
|
7804
7653
|
loginSessions: records.kind(localAuthLoginSessionsRecordKind),
|
|
7805
7654
|
loginSessionCutoffs: records.kind(localAuthLoginSessionCutoffsRecordKind),
|
|
7806
7655
|
oauthSessions: records.kind(localAuthOauthSessionsRecordKind),
|
|
@@ -8720,6 +8569,18 @@ function getUserManagementInternal(provider) {
|
|
|
8720
8569
|
return internal;
|
|
8721
8570
|
}
|
|
8722
8571
|
//#endregion
|
|
8572
|
+
//#region src/auth/parse-record.ts
|
|
8573
|
+
function parseRecord(kind, schema, data) {
|
|
8574
|
+
try {
|
|
8575
|
+
return schema.parse(data);
|
|
8576
|
+
} catch (err) {
|
|
8577
|
+
const topKeys = data && typeof data === "object" && !Array.isArray(data) ? Object.keys(data).join(", ") || "(empty)" : `(non-object: ${typeof data})`;
|
|
8578
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
8579
|
+
const hint = data && typeof data === "object" && !Array.isArray(data) && Object.keys(data).length === 1 && "data" in data ? " This shape is the legacy double-wrap from a stale settings-store query path. Restart the server with the latest @camstack/system build." : "";
|
|
8580
|
+
throw new Error(`Failed to parse ${kind} from settings store. Top-level keys=[${topKeys}].${hint} Underlying: ${detail}`, { cause: err });
|
|
8581
|
+
}
|
|
8582
|
+
}
|
|
8583
|
+
//#endregion
|
|
8723
8584
|
//#region src/auth/user-manager.ts
|
|
8724
8585
|
var USERS_COLLECTION = "users";
|
|
8725
8586
|
/**
|
|
@@ -8731,7 +8592,7 @@ var USERS_COLLECTION = "users";
|
|
|
8731
8592
|
var FIRST_BOOT_ADMIN_USERNAME = "admin";
|
|
8732
8593
|
var FIRST_BOOT_ADMIN_PASSWORD = "changeme";
|
|
8733
8594
|
function parseUser(data) {
|
|
8734
|
-
return parseRecord
|
|
8595
|
+
return parseRecord("user", UserRecordSchema, data);
|
|
8735
8596
|
}
|
|
8736
8597
|
function userToBody(user) {
|
|
8737
8598
|
const { id: _id, ...body } = user;
|
|
@@ -12121,7 +11982,6 @@ function toAuthResult(user) {
|
|
|
12121
11982
|
var LocalAuthAddon = class extends BaseAddon {
|
|
12122
11983
|
authManager = null;
|
|
12123
11984
|
userManager = null;
|
|
12124
|
-
apiKeyManager = null;
|
|
12125
11985
|
oauthSessionManager = null;
|
|
12126
11986
|
reapTimer = null;
|
|
12127
11987
|
totpManager = null;
|
|
@@ -12157,10 +12017,6 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
12157
12017
|
usersKind: authStores.users,
|
|
12158
12018
|
legacyStore: store
|
|
12159
12019
|
}, this.authManager);
|
|
12160
|
-
this.apiKeyManager = new ApiKeyManager({
|
|
12161
|
-
apiKeysKind: authStores.apiKeys,
|
|
12162
|
-
legacyStore: store
|
|
12163
|
-
});
|
|
12164
12020
|
this.oauthSessionManager = new OauthSessionManager({ oauthSessionsKind: authStores.oauthSessions });
|
|
12165
12021
|
this.totpManager = new TotpManager({
|
|
12166
12022
|
userTotpKind: authStores.userTotp,
|
|
@@ -12208,8 +12064,8 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
12208
12064
|
users: this.userManager,
|
|
12209
12065
|
dataDir: this.ctx.nodeDataDir,
|
|
12210
12066
|
fs: {
|
|
12211
|
-
exists: (filePath) => fs.existsSync(filePath),
|
|
12212
|
-
remove: (filePath) => fs.rmSync(filePath, { force: true })
|
|
12067
|
+
exists: (filePath) => fs$1.existsSync(filePath),
|
|
12068
|
+
remove: (filePath) => fs$1.rmSync(filePath, { force: true })
|
|
12213
12069
|
},
|
|
12214
12070
|
logger: this.ctx.logger
|
|
12215
12071
|
});
|
|
@@ -12325,15 +12181,6 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
12325
12181
|
totpEnabled
|
|
12326
12182
|
};
|
|
12327
12183
|
},
|
|
12328
|
-
listApiKeys: async () => {
|
|
12329
|
-
if (!this.apiKeyManager) return [];
|
|
12330
|
-
return this.apiKeyManager.listAll();
|
|
12331
|
-
},
|
|
12332
|
-
revokeApiKey: async (input) => {
|
|
12333
|
-
if (!this.apiKeyManager) throw new Error("API key management not available");
|
|
12334
|
-
await this.apiKeyManager.revoke(input.id);
|
|
12335
|
-
return { success: true };
|
|
12336
|
-
},
|
|
12337
12184
|
oauthIssueCode: async (input) => {
|
|
12338
12185
|
return lazyOauthGrants().oauthIssueCode(input);
|
|
12339
12186
|
},
|
|
@@ -12694,7 +12541,6 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
12694
12541
|
}
|
|
12695
12542
|
this.authManager = null;
|
|
12696
12543
|
this.userManager = null;
|
|
12697
|
-
this.apiKeyManager = null;
|
|
12698
12544
|
this.oauthSessionManager = null;
|
|
12699
12545
|
this.externalIdentities = null;
|
|
12700
12546
|
this.loginSessions = null;
|
|
@@ -12704,4 +12550,4 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
12704
12550
|
}
|
|
12705
12551
|
};
|
|
12706
12552
|
//#endregion
|
|
12707
|
-
export { LocalAuthAddon, LocalAuthAddon as default, SettingsReadUnavailableError as _, attachUserManagementInternal as a, DeviceCaStore as c, onSessionsRevoked as d, DeviceCredentialManager as f, parseTokenExpiry as g, AuthManager as h, USER_MANAGEMENT_INTERNAL as i, LoginSessionManager as l, AuthAuditLog as m, FIRST_BOOT_ADMIN_USERNAME as n, getUserManagementInternal as o, PREVIOUS_LEAF_GRACE_MS as p, UserManager as r, preferencesLimitReasonOf as s, FIRST_BOOT_ADMIN_PASSWORD as t, REFRESH_TOKEN_PREFIX as u, isSettingsReadUnavailable as v
|
|
12553
|
+
export { LocalAuthAddon, LocalAuthAddon as default, SettingsReadUnavailableError as _, attachUserManagementInternal as a, DeviceCaStore as c, onSessionsRevoked as d, DeviceCredentialManager as f, parseTokenExpiry as g, AuthManager as h, USER_MANAGEMENT_INTERNAL as i, LoginSessionManager as l, AuthAuditLog as m, FIRST_BOOT_ADMIN_USERNAME as n, getUserManagementInternal as o, PREVIOUS_LEAF_GRACE_MS as p, UserManager as r, preferencesLimitReasonOf as s, FIRST_BOOT_ADMIN_PASSWORD as t, REFRESH_TOKEN_PREFIX as u, isSettingsReadUnavailable as v };
|
|
@@ -10,12 +10,10 @@
|
|
|
10
10
|
* `scoped-tokens` and `admin-tokens` hold pre-D892 rows read by nothing since
|
|
11
11
|
* D895; they stay declared so the layout is unchanged.
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { type DefinedRecordKind, type RecordKindHandle, type RecordsAccess, ScopedTokenSchema, TokenScopeSchema, UserRecordSchema } from "@camstack/types";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
export type UserBody = Omit<z.infer<typeof UserRecordSchema>, "id">;
|
|
16
16
|
export declare const UserBodySchema: z.ZodType<UserBody>;
|
|
17
|
-
export type ApiKeyBody = Omit<z.infer<typeof ApiKeyRecordSchema>, "id">;
|
|
18
|
-
export declare const ApiKeyBodySchema: z.ZodType<ApiKeyBody>;
|
|
19
17
|
export type ScopedTokenBody = Omit<z.infer<typeof ScopedTokenSchema>, "id">;
|
|
20
18
|
export declare const ScopedTokenBodySchema: z.ZodType<ScopedTokenBody>;
|
|
21
19
|
export type AdminTokenBody = {
|
|
@@ -103,7 +101,6 @@ export type AuthAuditBody = {
|
|
|
103
101
|
export declare const AuthAuditBodySchema: z.ZodType<AuthAuditBody>;
|
|
104
102
|
export type LocalAuthRecordKindsMap = {
|
|
105
103
|
readonly users: DefinedRecordKind<z.ZodType<UserBody>>;
|
|
106
|
-
readonly "api-keys": DefinedRecordKind<z.ZodType<ApiKeyBody>>;
|
|
107
104
|
readonly "scoped-tokens": DefinedRecordKind<z.ZodType<ScopedTokenBody>>;
|
|
108
105
|
readonly "admin-tokens": DefinedRecordKind<z.ZodType<AdminTokenBody>>;
|
|
109
106
|
readonly "login-sessions": DefinedRecordKind<z.ZodType<LoginSessionBody>>;
|
|
@@ -116,7 +113,6 @@ export type LocalAuthRecordKindsMap = {
|
|
|
116
113
|
};
|
|
117
114
|
export declare const localAuthRecordKinds: LocalAuthRecordKindsMap;
|
|
118
115
|
export declare const localAuthUsersRecordKind: DefinedRecordKind<z.ZodType<UserBody>>;
|
|
119
|
-
export declare const localAuthApiKeysRecordKind: DefinedRecordKind<z.ZodType<ApiKeyBody>>;
|
|
120
116
|
export declare const localAuthScopedTokensRecordKind: DefinedRecordKind<z.ZodType<ScopedTokenBody>>;
|
|
121
117
|
export declare const localAuthAdminTokensRecordKind: DefinedRecordKind<z.ZodType<AdminTokenBody>>;
|
|
122
118
|
export declare const localAuthLoginSessionsRecordKind: DefinedRecordKind<z.ZodType<LoginSessionBody>>;
|
|
@@ -130,7 +126,6 @@ export declare const localAuthAuthAuditRecordKind: DefinedRecordKind<z.ZodType<A
|
|
|
130
126
|
export declare const LOCAL_AUTH_RECORDS_LEGACY_COLLECTIONS: readonly string[];
|
|
131
127
|
export interface LocalAuthRecordStores {
|
|
132
128
|
readonly users: RecordKindHandle<UserBody>;
|
|
133
|
-
readonly apiKeys: RecordKindHandle<ApiKeyBody>;
|
|
134
129
|
readonly loginSessions: RecordKindHandle<LoginSessionBody>;
|
|
135
130
|
readonly loginSessionCutoffs: RecordKindHandle<LoginSessionCutoffBody>;
|
|
136
131
|
readonly oauthSessions: RecordKindHandle<OauthSessionBody>;
|
|
@@ -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_hub_mdns_ciao = require("../../hub-mdns-ciao-
|
|
3
|
+
const require_dist = require("../../dist-QyW9hVO2.js");
|
|
4
|
+
const require_hub_mdns_ciao = require("../../hub-mdns-ciao-CWkX17zX.js");
|
|
5
5
|
let zod = require("zod");
|
|
6
6
|
let node_net = require("node:net");
|
|
7
7
|
let node_os = require("node:os");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $r as
|
|
2
|
-
import { P as readLanHttpState, a as storeUploadedCertificate, d as servedHttpsLeafFingerprint, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, v as writeExtraSans, w as ensureTlsCert } from "../../hub-mdns-ciao-
|
|
1
|
+
import { $r as BaseAddon, B as HUB_MDNS_SERVICE_TYPE, Mr as validateCustomAddress, Pn as localNetworkCapability, Pt as checkRoleAddress, Qr as errMsg, Ta as EventCategory, V as HUB_MDNS_TXT_KEYS, X as NetworkTunnelStartedDataSchema, Xn as pickAppLinkHub, ar as resolveAppConnections, bn as isAppLinkBase, c as CAMSTACK_APP_LINK_ORIGIN, fr as resolveNotificationTapAddress, lr as resolveHubAddressRoles, vr as shortHostname, wn as isDefaultAppConnectionEndpoint } from "../../dist-CfjkLTZV.mjs";
|
|
2
|
+
import { P as readLanHttpState, a as storeUploadedCertificate, d as servedHttpsLeafFingerprint, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, v as writeExtraSans, w as ensureTlsCert } from "../../hub-mdns-ciao-CtHQEnb3.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { isIP } from "node:net";
|
|
5
5
|
import * as os$1 from "node:os";
|
|
@@ -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-QyW9hVO2.js");
|
|
7
7
|
const require_log_read_filter = require("../../log-read-filter-Bi066jwU.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $r as BaseAddon, In as logDestinationCapability } from "../../dist-CfjkLTZV.mjs";
|
|
2
2
|
import { n as compileLogFilter, o as lineMatches } from "../../log-read-filter-D7Ev3zm-.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-QyW9hVO2.js");
|
|
7
7
|
let node_fs_promises = require("node:fs/promises");
|
|
8
8
|
let node_util = require("node:util");
|
|
9
9
|
let node_os = require("node:os");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { $r as
|
|
1
|
+
import { $r as BaseAddon, Hi as createEvent, Hn as metricsProviderCapability, Qr as errMsg, Ta as EventCategory, mt as UNATTRIBUTED_BUCKET_KEY, nt as ROOT_BUCKET_KEY, or as resolveBucketMs, pn as foldSnapshotByFunction, rr as reducePoints } from "../../dist-CfjkLTZV.mjs";
|
|
2
2
|
import { access, readFile, readdir } from "node:fs/promises";
|
|
3
3
|
import { promisify } from "node:util";
|
|
4
4
|
import * as os$1 from "node:os";
|
|
5
5
|
import { platform } from "node:os";
|
|
6
|
-
import * as fs from "node:fs";
|
|
6
|
+
import * as fs$1 from "node:fs";
|
|
7
7
|
import { constants, readFileSync } from "node:fs";
|
|
8
8
|
import { execFile, execFileSync } from "node:child_process";
|
|
9
9
|
//#region src/builtins/native-metrics/cgroup-memory.ts
|
|
@@ -1642,7 +1642,7 @@ var NativeMetricsProvider = class {
|
|
|
1642
1642
|
let swapUsedBytes = 0;
|
|
1643
1643
|
let swapTotalBytes = 0;
|
|
1644
1644
|
if (IS_LINUX) try {
|
|
1645
|
-
const meminfo = fs.readFileSync("/proc/meminfo", "utf-8");
|
|
1645
|
+
const meminfo = fs$1.readFileSync("/proc/meminfo", "utf-8");
|
|
1646
1646
|
const swapTotal = parseInt(meminfo.match(/SwapTotal:\s+(\d+)/)?.[1] ?? "0", 10) * 1024;
|
|
1647
1647
|
const swapFree = parseInt(meminfo.match(/SwapFree:\s+(\d+)/)?.[1] ?? "0", 10) * 1024;
|
|
1648
1648
|
swapTotalBytes = swapTotal;
|
|
@@ -1720,7 +1720,7 @@ function sampleMacMemory(provider) {
|
|
|
1720
1720
|
}
|
|
1721
1721
|
function getDiskSpaceInternal(dirPath) {
|
|
1722
1722
|
return new Promise((resolve, reject) => {
|
|
1723
|
-
fs.statfs(dirPath, (err, stats) => {
|
|
1723
|
+
fs$1.statfs(dirPath, (err, stats) => {
|
|
1724
1724
|
if (err) return reject(err);
|
|
1725
1725
|
const totalBytes = stats.blocks * stats.bsize;
|
|
1726
1726
|
const availableBytes = stats.bavail * stats.bsize;
|
|
@@ -1738,7 +1738,7 @@ function getDiskSpaceInternal(dirPath) {
|
|
|
1738
1738
|
async function takeDiskIoSnapshot() {
|
|
1739
1739
|
const now = Date.now();
|
|
1740
1740
|
if (IS_LINUX) try {
|
|
1741
|
-
const data = fs.readFileSync("/proc/diskstats", "utf-8");
|
|
1741
|
+
const data = fs$1.readFileSync("/proc/diskstats", "utf-8");
|
|
1742
1742
|
let readOps = 0, readBytes = 0, writeOps = 0, writeBytes = 0;
|
|
1743
1743
|
for (const line of data.split("\n")) {
|
|
1744
1744
|
const parts = line.trim().split(/\s+/);
|
|
@@ -1769,7 +1769,7 @@ async function takeDiskIoSnapshot() {
|
|
|
1769
1769
|
async function takeNetworkIoSnapshot() {
|
|
1770
1770
|
const now = Date.now();
|
|
1771
1771
|
if (IS_LINUX) try {
|
|
1772
|
-
const data = fs.readFileSync("/proc/net/dev", "utf-8");
|
|
1772
|
+
const data = fs$1.readFileSync("/proc/net/dev", "utf-8");
|
|
1773
1773
|
let rxBytes = 0, txBytes = 0, rxPackets = 0, txPackets = 0, rxErrors = 0, txErrors = 0;
|
|
1774
1774
|
for (const line of data.split("\n")) {
|
|
1775
1775
|
const match = line.match(/^\s*(\w+):\s+(.+)$/);
|
|
@@ -1830,7 +1830,7 @@ async function takeNetworkIoSnapshot() {
|
|
|
1830
1830
|
}
|
|
1831
1831
|
async function getCpuTemperatureInternal() {
|
|
1832
1832
|
if (IS_LINUX) for (const p of ["/sys/class/thermal/thermal_zone0/temp", "/sys/class/hwmon/hwmon0/temp1_input"]) try {
|
|
1833
|
-
const raw = fs.readFileSync(p, "utf-8").trim();
|
|
1833
|
+
const raw = fs$1.readFileSync(p, "utf-8").trim();
|
|
1834
1834
|
const millideg = parseInt(raw, 10);
|
|
1835
1835
|
if (!isNaN(millideg)) return Math.round(millideg / 100) / 10;
|
|
1836
1836
|
} catch {
|
|
@@ -1881,10 +1881,10 @@ function getProcessResources() {
|
|
|
1881
1881
|
let threadCount = 0;
|
|
1882
1882
|
if (IS_LINUX) {
|
|
1883
1883
|
try {
|
|
1884
|
-
openFds = fs.readdirSync(`/proc/${process.pid}/fd`).length;
|
|
1884
|
+
openFds = fs$1.readdirSync(`/proc/${process.pid}/fd`).length;
|
|
1885
1885
|
} catch {}
|
|
1886
1886
|
try {
|
|
1887
|
-
const match = fs.readFileSync(`/proc/${process.pid}/status`, "utf-8").match(/Threads:\s+(\d+)/);
|
|
1887
|
+
const match = fs$1.readFileSync(`/proc/${process.pid}/status`, "utf-8").match(/Threads:\s+(\d+)/);
|
|
1888
1888
|
if (match) threadCount = parseInt(match[1], 10);
|
|
1889
1889
|
} catch {}
|
|
1890
1890
|
}
|
|
@@ -1899,7 +1899,7 @@ function getProcessResources() {
|
|
|
1899
1899
|
function getPressure(resource) {
|
|
1900
1900
|
if (!IS_LINUX) return null;
|
|
1901
1901
|
try {
|
|
1902
|
-
const data = fs.readFileSync(`/proc/pressure/${resource}`, "utf-8");
|
|
1902
|
+
const data = fs$1.readFileSync(`/proc/pressure/${resource}`, "utf-8");
|
|
1903
1903
|
const parseLine = (prefix) => {
|
|
1904
1904
|
const match = data.match(new RegExp(`${prefix} avg10=(\\d+\\.\\d+) avg60=(\\d+\\.\\d+) avg300=(\\d+\\.\\d+)`));
|
|
1905
1905
|
if (!match) return null;
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-QyW9hVO2.js");
|
|
7
7
|
const require_coral_accelerators = require("../../coral-accelerators-oUXmmbc2.js");
|
|
8
8
|
let node_util = require("node:util");
|
|
9
9
|
let node_os = require("node:os");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { o as __toESM, r as __exportAll } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $
|
|
3
|
-
import { n as nodeCoralFs, t as classifyCoralAccelerator } from "../../coral-accelerators-
|
|
2
|
+
import { $r as BaseAddon, Qn as platformProbeCapability, Qr as errMsg, Ta as EventCategory, gr as scoreRuntimes, in as enumerateInferenceDevices, qi as emitReadiness } from "../../dist-CfjkLTZV.mjs";
|
|
3
|
+
import { n as nodeCoralFs, t as classifyCoralAccelerator } from "../../coral-accelerators-Qhn5TOYZ.mjs";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
5
|
import * as os$1 from "node:os";
|
|
6
|
-
import * as fs from "node:fs";
|
|
6
|
+
import * as fs$1 from "node:fs";
|
|
7
7
|
import { execFile } from "node:child_process";
|
|
8
8
|
//#region src/builtins/platform-probe/amd-npu.ts
|
|
9
9
|
var amd_npu_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -448,14 +448,14 @@ var PlatformScorer = class {
|
|
|
448
448
|
if (nvidia) gpu = nvidia;
|
|
449
449
|
const listRenderNodes = () => {
|
|
450
450
|
try {
|
|
451
|
-
return fs.readdirSync("/dev/dri").filter((n) => n.startsWith("renderD")).map((n) => `/dev/dri/${n}`);
|
|
451
|
+
return fs$1.readdirSync("/dev/dri").filter((n) => n.startsWith("renderD")).map((n) => `/dev/dri/${n}`);
|
|
452
452
|
} catch {
|
|
453
453
|
return [];
|
|
454
454
|
}
|
|
455
455
|
};
|
|
456
456
|
const readDrmAttr = (node, attr) => {
|
|
457
457
|
try {
|
|
458
|
-
return fs.readFileSync(`/sys/class/drm/${node.split("/").pop()}/device/${attr}`, "utf8");
|
|
458
|
+
return fs$1.readFileSync(`/sys/class/drm/${node.split("/").pop()}/device/${attr}`, "utf8");
|
|
459
459
|
} catch {
|
|
460
460
|
return "";
|
|
461
461
|
}
|
|
@@ -481,12 +481,12 @@ var PlatformScorer = class {
|
|
|
481
481
|
}
|
|
482
482
|
const listDir = (p) => {
|
|
483
483
|
try {
|
|
484
|
-
return fs.readdirSync(p);
|
|
484
|
+
return fs$1.readdirSync(p);
|
|
485
485
|
} catch {
|
|
486
486
|
return [];
|
|
487
487
|
}
|
|
488
488
|
};
|
|
489
|
-
const exists = (p) => fs.existsSync(p);
|
|
489
|
+
const exists = (p) => fs$1.existsSync(p);
|
|
490
490
|
if (!npu) {
|
|
491
491
|
const { classifyIntelNpu } = await import("../../intel-npu-C8HKvRQF.mjs");
|
|
492
492
|
npu = classifyIntelNpu({
|
|
@@ -514,7 +514,7 @@ var PlatformScorer = class {
|
|
|
514
514
|
exists,
|
|
515
515
|
readFile: (p) => {
|
|
516
516
|
try {
|
|
517
|
-
return fs.readFileSync(p, "utf8");
|
|
517
|
+
return fs$1.readFileSync(p, "utf8");
|
|
518
518
|
} catch {
|
|
519
519
|
return "";
|
|
520
520
|
}
|
|
@@ -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-QyW9hVO2.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
//#region src/builtins/record-entries/entries-service.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $r as BaseAddon, Ai as UnknownRecordKindError, aa as mapSecretLeaves, li as InvalidRecordError, pa as recordSecretRef, tr as recordEntriesCapability } from "../../dist-CfjkLTZV.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
//#region src/builtins/record-entries/entries-service.ts
|
|
@@ -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-QyW9hVO2.js");
|
|
7
7
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
8
8
|
/**
|
|
9
9
|
* Reconcile the durable `enabledProviders` set against authoritative
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $r as BaseAddon, Ta as EventCategory } from "../../dist-CfjkLTZV.mjs";
|
|
2
2
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
3
3
|
/**
|
|
4
4
|
* Reconcile the durable `enabledProviders` set against authoritative
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-QyW9hVO2.js");
|
|
7
7
|
const require_snapshot_courtesy = require("../../snapshot-courtesy-D_C5-nC0.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
let node_crypto = require("node:crypto");
|