@dominevo/types 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/addon/base-addon.d.ts +2 -16
- package/dist/addon.d.ts +4 -4
- package/dist/addon.js +2 -2
- package/dist/addon.mjs +2 -2
- package/dist/app-bridge.d.ts +16 -16
- package/dist/auth/app-callback.d.ts +2 -3
- package/dist/auth/credential-scope.d.ts +1 -1
- package/dist/auth/device-certificate.d.ts +5 -5
- package/dist/auth/sso-state.d.ts +1 -1
- package/dist/brokers/smtp-inbound.d.ts +1 -1
- package/dist/cap-call-context.d.ts +2 -2
- package/dist/capabilities/backup.cap.d.ts +1 -1
- package/dist/capabilities/capability-definition.d.ts +1 -1
- package/dist/capabilities/custom-model-registry.cap.d.ts +8 -8
- package/dist/capabilities/display-palette.cap.d.ts +2 -2
- package/dist/capabilities/hub-address.d.ts +5 -5
- package/dist/capabilities/index.d.ts +2 -2
- package/dist/capabilities/keychain-admin.cap.d.ts +2 -2
- package/dist/capabilities/load-contribution.cap.d.ts +1 -1
- package/dist/capabilities/local-network.cap.d.ts +1 -1
- package/dist/capabilities/metrics-provider.cap.d.ts +1 -1
- package/dist/capabilities/migrations.cap.d.ts +1 -1
- package/dist/capabilities/model-convert.cap.d.ts +2 -2
- package/dist/capabilities/model-distributor.cap.d.ts +4 -4
- package/dist/capabilities/notification-rules.cap.d.ts +1 -1
- package/dist/capabilities/oauth-integration.cap.d.ts +1 -1
- package/dist/capabilities/pipeline-executor.cap.d.ts +5 -5
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +1 -1
- package/dist/capabilities/pipeline-runner.cap.d.ts +1 -1
- package/dist/capabilities/recording.cap.d.ts +5 -5
- package/dist/capabilities/reserved-collection-sources.d.ts +1 -1
- package/dist/capabilities/server-management.cap.d.ts +4 -4
- package/dist/capabilities/settings-store.cap.d.ts +1 -1
- package/dist/capabilities/training.cap.d.ts +1 -1
- package/dist/capabilities/videoclips.cap.d.ts +5 -5
- package/dist/capabilities/viewer-link-url.d.ts +4 -4
- package/dist/catalogs/display-palette-tables.d.ts +2 -2
- package/dist/catalogs/display-palette.d.ts +3 -3
- package/dist/catalogs/palette-entries.d.ts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +19 -27
- package/dist/client.mjs +19 -27
- package/dist/constants.d.ts +2 -2
- package/dist/deps/edgetpu-delegate.d.ts +4 -4
- package/dist/deps/ffmpeg-binary-source.d.ts +2 -2
- package/dist/deps/ffmpeg-downloader.d.ts +1 -1
- package/dist/device/icon-catalog.generated.d.ts +2 -5
- package/dist/enums/event-category.d.ts +2 -2
- package/dist/enums.js +1 -1
- package/dist/enums.mjs +1 -1
- package/dist/esm/addon/base-addon.mjs +2 -22
- package/dist/esm/addon/notification-targets.mjs +1 -1
- package/dist/esm/addon/record-integration-instances.mjs +2 -2
- package/dist/esm/addon.mjs +1 -1
- package/dist/esm/app-bridge.mjs +2 -2
- package/dist/esm/auth/app-callback.mjs +3 -9
- package/dist/esm/auth/credential-scope.mjs +2 -2
- package/dist/esm/auth/device-certificate.mjs +6 -11
- package/dist/esm/auth/sso-state.mjs +1 -1
- package/dist/esm/brokers/smtp-inbound.mjs +1 -1
- package/dist/esm/cap-call-context.mjs +2 -2
- package/dist/esm/capabilities/backup.cap.mjs +1 -1
- package/dist/esm/capabilities/custom-model-registry.cap.mjs +1 -1
- package/dist/esm/capabilities/device-export.cap.mjs +1 -1
- package/dist/esm/capabilities/face-gallery.cap.mjs +1 -1
- package/dist/esm/capabilities/hub-address.mjs +8 -8
- package/dist/esm/capabilities/ir-transmitter.cap.mjs +1 -1
- package/dist/esm/capabilities/keychain-admin.cap.mjs +2 -2
- package/dist/esm/capabilities/load-contribution.cap.mjs +1 -1
- package/dist/esm/capabilities/local-network.cap.mjs +1 -1
- package/dist/esm/capabilities/mesh-network.cap.mjs +2 -2
- package/dist/esm/capabilities/metrics-provider.cap.mjs +2 -2
- package/dist/esm/capabilities/migrations.cap.mjs +1 -1
- package/dist/esm/capabilities/notification-rules.cap.mjs +1 -1
- package/dist/esm/capabilities/oauth-integration.cap.mjs +1 -1
- package/dist/esm/capabilities/pipeline-orchestrator.cap.mjs +2 -2
- package/dist/esm/capabilities/pipeline-runner.cap.mjs +2 -2
- package/dist/esm/capabilities/recording.cap.mjs +7 -7
- package/dist/esm/capabilities/reserved-collection-sources.mjs +1 -1
- package/dist/esm/capabilities/server-management.cap.mjs +4 -4
- package/dist/esm/capabilities/settings-store.cap.mjs +1 -1
- package/dist/esm/capabilities/sso-bridge.cap.mjs +1 -1
- package/dist/esm/capabilities/training-provider.cap.mjs +1 -1
- package/dist/esm/capabilities/videoclips.cap.mjs +6 -6
- package/dist/esm/capabilities/viewer-link-url.mjs +5 -5
- package/dist/esm/catalogs/display-palette-tables.mjs +3 -3
- package/dist/esm/catalogs/display-palette.mjs +6 -6
- package/dist/esm/catalogs/event-taxonomy.mjs +2 -2
- package/dist/esm/catalogs/palette-entries.mjs +1 -1
- package/dist/esm/constants.mjs +1 -1
- package/dist/esm/deps/binary-downloader.mjs +1 -1
- package/dist/esm/deps/edgetpu-delegate.mjs +6 -6
- package/dist/esm/deps/ffmpeg-artifacts.mjs +1 -1
- package/dist/esm/deps/ffmpeg-binary-source.mjs +2 -2
- package/dist/esm/deps/ffmpeg-downloader.mjs +1 -1
- package/dist/esm/deps/python-downloader.mjs +1 -1
- package/dist/esm/device/icon-catalog.generated.mjs +2 -5
- package/dist/esm/enums/event-category.mjs +2 -2
- package/dist/esm/ffmpeg/egress-sharing-key.mjs +19 -0
- package/dist/esm/ffmpeg/sharing-key.mjs +1 -35
- package/dist/esm/generated/method-descriptions.mjs +3 -3
- package/dist/esm/generated/scope-presets.mjs +1 -1
- package/dist/esm/i18n/{camstack-error.mjs → dominevo-error.mjs} +5 -5
- package/dist/esm/index.mjs +7 -8
- package/dist/esm/interfaces/addon-data-plane.mjs +2 -2
- package/dist/esm/interfaces/config-ui-secrets.mjs +1 -1
- package/dist/esm/interfaces/storage-location-declaration.mjs +4 -4
- package/dist/esm/keychain/known-secrets.mjs +1 -1
- package/dist/esm/keychain/secret-marker.mjs +1 -1
- package/dist/esm/node.mjs +5 -2
- package/dist/esm/notification/email-mime.mjs +2 -2
- package/dist/esm/notification/scope-picker-items.mjs +3 -3
- package/dist/esm/pipeline/native-lease.mjs +1 -1
- package/dist/esm/pipeline/node-benchmark/schemas.mjs +1 -1
- package/dist/esm/records/errors.mjs +1 -1
- package/dist/esm/records/in-memory-records-rows.mjs +1 -1
- package/dist/esm/records/secret-views.mjs +1 -1
- package/dist/esm/storage/atomic-write.mjs +1 -1
- package/dist/esm/storage/filesystem-storage-provider.mjs +3 -3
- package/dist/esm/template/automation-template.mjs +1 -1
- package/dist/esm/training/trainer-contract.mjs +10 -10
- package/dist/esm/treeshake-canary.mjs +1 -1
- package/dist/esm/types/models.mjs +7 -7
- package/dist/esm/util/models-dir.mjs +19 -0
- package/dist/esm/utils/pool-memory-watchdog.mjs +8 -8
- package/dist/esm/vendor-login-proxy/login-proxy.mjs +1 -1
- package/dist/esm/vendor-login-proxy/url-rewrite.mjs +1 -1
- package/dist/{event-category-7IiGF_Ui.mjs → event-category-CwprdwEL.mjs} +2 -2
- package/dist/{event-category-BJe9O5KZ.js → event-category-DhlUHlM5.js} +2 -2
- package/dist/ffmpeg/egress-sharing-key.d.ts +19 -0
- package/dist/ffmpeg/sharing-key.d.ts +19 -12
- package/dist/generated/addon-api.d.ts +2 -2
- package/dist/i18n/{camstack-error.d.ts → dominevo-error.d.ts} +2 -2
- package/dist/index.d.ts +3 -4
- package/dist/index.js +133 -326
- package/dist/index.mjs +126 -316
- package/dist/interfaces/addon-data-plane.d.ts +4 -4
- package/dist/interfaces/addon.d.ts +11 -11
- package/dist/interfaces/analysis.d.ts +2 -2
- package/dist/interfaces/capability.d.ts +1 -1
- package/dist/interfaces/config-ui-secrets.d.ts +1 -1
- package/dist/interfaces/context.d.ts +2 -2
- package/dist/interfaces/detection-addon.d.ts +2 -2
- package/dist/interfaces/device-provider.d.ts +2 -2
- package/dist/interfaces/event-bus.d.ts +1 -1
- package/dist/interfaces/kernel-abstractions.d.ts +1 -1
- package/dist/interfaces/storage-location-declaration.d.ts +1 -1
- package/dist/node.d.ts +3 -0
- package/dist/node.js +168 -13
- package/dist/node.mjs +164 -13
- package/dist/notification/scope-picker-items.d.ts +2 -2
- package/dist/{runtime-capabilities-B9CE8DzI.js → runtime-capabilities-Db29ELdy.js} +26 -46
- package/dist/{runtime-capabilities-CAGwQ-Ec.mjs → runtime-capabilities-Dg5DXZkO.mjs} +21 -41
- package/dist/storage/filesystem-storage-provider.d.ts +1 -1
- package/dist/template/automation-template.d.ts +2 -2
- package/dist/training/trainer-contract.d.ts +9 -9
- package/dist/treeshake-canary.d.ts +3 -3
- package/dist/types/agent-pipeline-settings.d.ts +1 -1
- package/dist/types/models.d.ts +11 -11
- package/dist/util/models-dir.d.ts +10 -0
- package/dist/utils/pool-memory-watchdog.d.ts +1 -1
- package/dist/{wake-on-lan-BocEJPCO.js → wake-on-lan-CAbNKvo9.js} +62 -34
- package/dist/{wake-on-lan-Dm-fxZ7N.mjs → wake-on-lan-DqbzeHhm.mjs} +57 -35
- package/package.json +4 -4
package/dist/node.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { s as errMsg } from "./composed-stable-id-C7b2bPOX.mjs";
|
|
2
|
-
import { Cr as
|
|
3
|
-
import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
2
|
+
import { Cr as egressTransportFromRequest, Nr as isSoftwareDecode, Sr as canonicalEgressPlan, X as compositionSourceKey, _r as chooseFfmpegBinary, a as directedBroadcastOf, br as getFfmpegArtifact, c as implementedMethodsOf, gr as FFMPEG_PATH_ENV, i as buildMagicPacket, kr as buildFfmpegArgs, o as ipv4ToUint32, p as CUSTOMIZATION_BLOCK_NAME_PREFIX, s as parseMacAddress, vr as ffmpegBinaryName, wr as Fmp4BoxSplitter, xr as getFfmpegDownloadUrl, yr as FFMPEG_RELEASE } from "./wake-on-lan-DqbzeHhm.mjs";
|
|
4
3
|
import * as fs from "node:fs";
|
|
5
|
-
import { chmodSync, copyFileSync, createWriteStream, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { chmodSync, copyFileSync, createWriteStream, existsSync, mkdirSync, promises, readFileSync, readdirSync, realpathSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
6
5
|
import * as path$1 from "node:path";
|
|
7
6
|
import path, { basename, dirname, join, resolve, sep } from "node:path";
|
|
8
7
|
import { pipeline } from "node:stream/promises";
|
|
9
8
|
import { Readable } from "node:stream";
|
|
10
9
|
import { execFile, execFileSync, spawn } from "node:child_process";
|
|
10
|
+
import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
11
11
|
import { crc32, gunzipSync, inflateRawSync, zstdDecompressSync } from "node:zlib";
|
|
12
12
|
import { networkInterfaces, userInfo } from "node:os";
|
|
13
13
|
import { readFile } from "node:fs/promises";
|
|
@@ -434,7 +434,7 @@ async function probeFfmpegBinary(path) {
|
|
|
434
434
|
* The ffmpeg this node runs, downloading the pinned build if it is not here
|
|
435
435
|
* yet, and reporting what it got.
|
|
436
436
|
*
|
|
437
|
-
* Order: the operator's `
|
|
437
|
+
* Order: the operator's `DOMINEVO_FFMPEG_PATH` → the pinned build already on
|
|
438
438
|
* disk → download it. No PATH, no image copy, no per-platform special case —
|
|
439
439
|
* see `ffmpeg-binary-source.ts` for why the image stopped being special after
|
|
440
440
|
* exactly one day.
|
|
@@ -1029,14 +1029,14 @@ function installLibraryFromDeb(debPath, memberName, targetPath, workDir, extract
|
|
|
1029
1029
|
* Windows delegate is built for a TFLite ai-edge-litert 2.1.6 cannot load.
|
|
1030
1030
|
*
|
|
1031
1031
|
* Resolution order, mirrored by `edgetpu_device.edgetpu_library_path` in the
|
|
1032
|
-
* Python pool: the `
|
|
1033
|
-
* under `<
|
|
1032
|
+
* Python pool: the `DOMINEVO_EDGETPU_LIB` path override → the copy staged
|
|
1033
|
+
* under `<DOMINEVO_DATA>/deps/edgetpu/lib/` → the hub's historical
|
|
1034
1034
|
* `/data/deps/edgetpu/lib/libedgetpu.so.1`. On the hub image
|
|
1035
|
-
* `
|
|
1035
|
+
* `DOMINEVO_DATA=/data`, so the staged path and the historical one are the
|
|
1036
1036
|
* same file and nothing moves.
|
|
1037
1037
|
*/
|
|
1038
1038
|
/** The path override (a library PATH, never a secret). */
|
|
1039
|
-
var EDGETPU_LIB_ENV = "
|
|
1039
|
+
var EDGETPU_LIB_ENV = "DOMINEVO_EDGETPU_LIB";
|
|
1040
1040
|
/** The pinned feranick release. Changing it is the delegate version change. */
|
|
1041
1041
|
var EDGETPU_DELEGATE_RELEASE = "16.0TF2.17.1-1";
|
|
1042
1042
|
/** Where the hub image's installer has always put the delegate. */
|
|
@@ -1124,7 +1124,7 @@ function chooseEdgetpuDelegate(lookup) {
|
|
|
1124
1124
|
}
|
|
1125
1125
|
/** The node data root the way every node process names it. */
|
|
1126
1126
|
function nodeDataRootFromEnv(env) {
|
|
1127
|
-
return env["
|
|
1127
|
+
return env["DOMINEVO_DATA"] ?? env["DOMINEVO_DATA_DIR"];
|
|
1128
1128
|
}
|
|
1129
1129
|
/** Under 1 MB each: held whole, written once, hashed from disk before use. */
|
|
1130
1130
|
async function download(url, target) {
|
|
@@ -1170,7 +1170,7 @@ async function stageFile(file, libDir, workRoot) {
|
|
|
1170
1170
|
* without on this line; `installPythonRequirements` stages it after pip.
|
|
1171
1171
|
* (`ai-edge-litert` imports without the delegate and is useless without it.)
|
|
1172
1172
|
*/
|
|
1173
|
-
var EDGETPU_DELEGATE_DIRECTIVE = "#
|
|
1173
|
+
var EDGETPU_DELEGATE_DIRECTIVE = "# dominevo-native-dep: edgetpu-delegate";
|
|
1174
1174
|
function declaresEdgetpuDelegate(requirementsText) {
|
|
1175
1175
|
return requirementsText.split(/\r?\n/).some((line) => line.trim() === EDGETPU_DELEGATE_DIRECTIVE);
|
|
1176
1176
|
}
|
|
@@ -2337,7 +2337,7 @@ var DEFAULT_LOCATION_SUBDIRS = {
|
|
|
2337
2337
|
"event-images": "event-images",
|
|
2338
2338
|
models: "models",
|
|
2339
2339
|
"addons-data": "addons-data",
|
|
2340
|
-
cache: "/tmp/
|
|
2340
|
+
cache: "/tmp/dominevo-cache",
|
|
2341
2341
|
logs: "logs",
|
|
2342
2342
|
backups: "backups"
|
|
2343
2343
|
};
|
|
@@ -2352,7 +2352,7 @@ var DEFAULT_LOCATION_SUBDIRS = {
|
|
|
2352
2352
|
* {rootPath}/models/
|
|
2353
2353
|
* {rootPath}/addons-data/
|
|
2354
2354
|
* {rootPath}/logs/
|
|
2355
|
-
* /tmp/
|
|
2355
|
+
* /tmp/dominevo-cache/ (cache is always local)
|
|
2356
2356
|
*
|
|
2357
2357
|
* Individual location paths can be overridden.
|
|
2358
2358
|
*/
|
|
@@ -2515,6 +2515,39 @@ function containsOrEquals(outer, inner) {
|
|
|
2515
2515
|
return relative !== "" && !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
2516
2516
|
}
|
|
2517
2517
|
//#endregion
|
|
2518
|
+
//#region src/utils/canonical-hash.ts
|
|
2519
|
+
/**
|
|
2520
|
+
* Deterministic SHA-256 hash of an arbitrary serialisable value. The
|
|
2521
|
+
* canonical form sorts object keys alphabetically at every depth so two
|
|
2522
|
+
* structurally-equal inputs with different key insertion orders produce
|
|
2523
|
+
* the same hash. Returns a 64-char lowercase hex digest.
|
|
2524
|
+
*
|
|
2525
|
+
* Used by export adapters (Alexa, HAP) to short-circuit re-discovery /
|
|
2526
|
+
* accessory-rebuild work when the upstream shape is byte-identical to
|
|
2527
|
+
* the last applied state — preventing user-visible "re-discovery"
|
|
2528
|
+
* notifications on every addon-runner respawn. Each respawn re-fires
|
|
2529
|
+
* `DeviceBindingsChanged` for every cap registration, which without
|
|
2530
|
+
* this guard would propagate redundant pushes.
|
|
2531
|
+
*
|
|
2532
|
+
* Note: this is a SYMPTOMATIC fix layered on top of the binding-change
|
|
2533
|
+
* subscription. The proper fix is a single "device ready" lifecycle
|
|
2534
|
+
* barrier so exports react only when the full cap set has landed —
|
|
2535
|
+
* tracked separately for post-HA-integration work.
|
|
2536
|
+
*/
|
|
2537
|
+
function canonicalHash(value) {
|
|
2538
|
+
const canonical = JSON.stringify(value, replaceWithSortedKeys);
|
|
2539
|
+
return createHash("sha256").update(canonical ?? "").digest("hex");
|
|
2540
|
+
}
|
|
2541
|
+
function replaceWithSortedKeys(_key, value) {
|
|
2542
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
2543
|
+
const obj = value;
|
|
2544
|
+
const out = {};
|
|
2545
|
+
for (const k of Object.keys(obj).toSorted()) out[k] = obj[k];
|
|
2546
|
+
return out;
|
|
2547
|
+
}
|
|
2548
|
+
return value;
|
|
2549
|
+
}
|
|
2550
|
+
//#endregion
|
|
2518
2551
|
//#region src/composition/customization-name.ts
|
|
2519
2552
|
/**
|
|
2520
2553
|
* The stored name of the implicit block that customizes an existing device
|
|
@@ -2792,4 +2825,122 @@ async function sendWakeOnLan(request, deps = REAL_DEPS) {
|
|
|
2792
2825
|
};
|
|
2793
2826
|
}
|
|
2794
2827
|
//#endregion
|
|
2795
|
-
|
|
2828
|
+
//#region src/ffmpeg/egress-sharing-key.ts
|
|
2829
|
+
/**
|
|
2830
|
+
* The refcount / dedup key. `canonicalHash` sorts object keys at every depth,
|
|
2831
|
+
* so a request built with a different field order produces the same digest.
|
|
2832
|
+
*
|
|
2833
|
+
* The handle this keys is IMMUTABLE: there is no `reconfigure`. A consumer
|
|
2834
|
+
* whose requirements change RELEASES and re-acquires; the refcount does the
|
|
2835
|
+
* rest. That is what stops co-tenants disturbing each other — the co-tenant
|
|
2836
|
+
* hazard that made Alexa's shared `derived:alexa-<id>` stream a hazard was
|
|
2837
|
+
* exactly a mutable shared object, where one consumer's downgrade dragged
|
|
2838
|
+
* every other consumer to 360p.
|
|
2839
|
+
*/
|
|
2840
|
+
function egressTranscodeSharingKey(request, delivery = egressTransportFromRequest(request)) {
|
|
2841
|
+
return `egress:${canonicalHash(canonicalEgressPlan(request, delivery))}`;
|
|
2842
|
+
}
|
|
2843
|
+
//#endregion
|
|
2844
|
+
//#region src/migrations/calendar-ids-to-records.ts
|
|
2845
|
+
/**
|
|
2846
|
+
* The calendars an account imports leave the account (D1013). An account record used to carry a
|
|
2847
|
+
* `calendarIds` array; each calendar is now a record of its own that LINKS to the account
|
|
2848
|
+
* (`calendars`, one per account and calendar). For every account row with an array:
|
|
2849
|
+
*
|
|
2850
|
+
* 1. each entry becomes a calendar record under a deterministic id (an existing one is kept);
|
|
2851
|
+
* 2. each record is read back and must name this account and calendar;
|
|
2852
|
+
* 3. only then is the array cleared (a patch: nothing else on the account is touched).
|
|
2853
|
+
*
|
|
2854
|
+
* An entry that names another account, or is not a calendar id at all, selected nothing before
|
|
2855
|
+
* (the reader only matched its own account's ids): it is counted, named in a warning and goes with
|
|
2856
|
+
* the array. An array that is not a list of strings is left where it is. A failure on one account
|
|
2857
|
+
* does not stop the others; the run then throws, and the accounts that failed keep their array.
|
|
2858
|
+
* Accounts are never created or deleted. Idempotent: with the arrays cleared nothing is left to do.
|
|
2859
|
+
*/
|
|
2860
|
+
/** The id of the calendar record of one (account, calendar): the same pair is always the same row. */
|
|
2861
|
+
function calendarRecordId(accountId, calendarId) {
|
|
2862
|
+
return `cal_${createHash("sha1").update(`${accountId}\0${calendarId}`).digest("hex").slice(0, 16)}`;
|
|
2863
|
+
}
|
|
2864
|
+
function entriesOf(value) {
|
|
2865
|
+
if (!Array.isArray(value)) return null;
|
|
2866
|
+
const out = [];
|
|
2867
|
+
for (const item of value) {
|
|
2868
|
+
if (typeof item !== "string") return null;
|
|
2869
|
+
out.push(item);
|
|
2870
|
+
}
|
|
2871
|
+
return out;
|
|
2872
|
+
}
|
|
2873
|
+
async function moveCalendarIdsToRecords(ports, spec) {
|
|
2874
|
+
let created = 0;
|
|
2875
|
+
let cleared = 0;
|
|
2876
|
+
let dropped = 0;
|
|
2877
|
+
const failed = [];
|
|
2878
|
+
for (const account of await ports.listAccounts()) {
|
|
2879
|
+
if (account.calendarIds === void 0 || account.calendarIds === null) continue;
|
|
2880
|
+
const entries = entriesOf(account.calendarIds);
|
|
2881
|
+
if (entries === null) {
|
|
2882
|
+
ports.warn(`account '${account.id}': calendarIds is not a list of ids and stays as it is`);
|
|
2883
|
+
failed.push(account.id);
|
|
2884
|
+
continue;
|
|
2885
|
+
}
|
|
2886
|
+
try {
|
|
2887
|
+
const own = /* @__PURE__ */ new Set();
|
|
2888
|
+
const inert = [];
|
|
2889
|
+
for (const entry of entries) {
|
|
2890
|
+
const calendarId = spec.calendarIdOf(account.id, entry);
|
|
2891
|
+
if (calendarId === null || calendarId === "") inert.push(entry);
|
|
2892
|
+
else own.add(calendarId);
|
|
2893
|
+
}
|
|
2894
|
+
for (const calendarId of own) {
|
|
2895
|
+
const recordId = calendarRecordId(account.id, calendarId);
|
|
2896
|
+
const body = {
|
|
2897
|
+
name: calendarId,
|
|
2898
|
+
accountId: account.id,
|
|
2899
|
+
calendarId
|
|
2900
|
+
};
|
|
2901
|
+
if (await ports.readCalendar(recordId) === null) {
|
|
2902
|
+
await ports.putCalendar(recordId, body);
|
|
2903
|
+
created += 1;
|
|
2904
|
+
}
|
|
2905
|
+
const back = await ports.readCalendar(recordId);
|
|
2906
|
+
if (back?.accountId !== account.id || back.calendarId !== calendarId) throw new Error(`account '${account.id}': the calendar record '${recordId}' did not read back; the array stays`);
|
|
2907
|
+
}
|
|
2908
|
+
if (inert.length > 0) {
|
|
2909
|
+
ports.warn(`account '${account.id}': ${inert.length} entr${inert.length === 1 ? "y" : "ies"} of calendarIds named another account or no calendar and selected nothing: ${inert.join(", ")}`);
|
|
2910
|
+
dropped += inert.length;
|
|
2911
|
+
}
|
|
2912
|
+
await ports.clearCalendarIds(account.id);
|
|
2913
|
+
cleared += 1;
|
|
2914
|
+
} catch (error) {
|
|
2915
|
+
ports.warn(error instanceof Error ? error.message : String(error));
|
|
2916
|
+
failed.push(account.id);
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
if (failed.length > 0) throw new Error(`calendarIds kept on ${failed.length} account(s) (${failed.join(", ")}); ${created} calendar record(s) written, ${cleared} account(s) cleared`);
|
|
2920
|
+
return {
|
|
2921
|
+
outcome: created === 0 && cleared === 0 ? "already-done" : "done",
|
|
2922
|
+
summary: {
|
|
2923
|
+
created,
|
|
2924
|
+
cleared,
|
|
2925
|
+
dropped
|
|
2926
|
+
}
|
|
2927
|
+
};
|
|
2928
|
+
}
|
|
2929
|
+
//#endregion
|
|
2930
|
+
//#region src/util/models-dir.ts
|
|
2931
|
+
/**
|
|
2932
|
+
* The shared, node-local models directory: `<nodeDataDir>/models`, created when missing.
|
|
2933
|
+
*
|
|
2934
|
+
* The SINGLE resolver for every inference addon (detection-pipeline, audio-analyzer,
|
|
2935
|
+
* embedding-encoder, model-studio, ai). It is anchored at the node's own writable data root
|
|
2936
|
+
* (`ctx.nodeDataDir`) — never the hub-singleton `storage` cap, which returns the hub's
|
|
2937
|
+
* `/data/models` to every node and breaks a node whose real data dir differs (the macOS agent).
|
|
2938
|
+
* Node-only, hence `@dominevo/types/node`, off the browser-facing root entry.
|
|
2939
|
+
*/
|
|
2940
|
+
async function resolveModelsDir(nodeDataDir) {
|
|
2941
|
+
const dir = join(nodeDataDir, "models");
|
|
2942
|
+
await promises.mkdir(dir, { recursive: true });
|
|
2943
|
+
return dir;
|
|
2944
|
+
}
|
|
2945
|
+
//#endregion
|
|
2946
|
+
export { ChildCostRegistry, EDGETPU_DELEGATE_DIRECTIVE, EDGETPU_DELEGATE_RELEASE, EDGETPU_LIB_ENV, FFMPEG_RELEASE, FfmpegProcess, FilesystemStorageProvider, Fmp4FragmentChild, Fmp4FragmentPlane, LEGACY_EDGETPU_LIB, NO_COST_CLAIM, NO_PINNED_FFMPEG_DETAIL, OwnerOnlyError, PYTHON_VERSION, WOL_REFUSAL_REASONS, buildBinaryPath, calendarRecordId, canonicalDeviceFingerprint, canonicalHash, chooseEdgetpuDelegate, containsOrEquals, customizationBlockName, debDataMember, declaresEdgetpuDelegate, defaultFfmpegSpawn, diffExportTargets, downloadBinary, edgetpuDelegateFileName, edgetpuLibDir, egressTranscodeSharingKey, ensureBinary, ensureEdgetpuDelegate, ensureFfmpeg, ensurePython, extractDebPayload, findInPath, getEdgetpuDelegateArtifact, getFfmpegArtifact, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, icaclsArgs, implementedMethodsOf, installLibraryFromDeb, installPythonPackages, installPythonRequirements, mkdirOwnerOnlySync, moveCalendarIdsToRecords, nodeDataRootFromEnv, nodeProcStatReader, parseFfmpegCapabilities, parseProcCpuSeconds, parseProcRssBytes, physicalRootOf, pinnedFfmpegSpawner, probeFfmpegBinary, readArMembers, readProcessCost, resolveExportFingerprint, resolveModelsDir, resolvePinnedFfmpegSpawner, restrictDirToOwnerSync, restrictFileToOwnerSync, sendWakeOnLan, signExpiringUrl, verifyExpiringUrl, writeFileAtomic, writeOwnerOnlyFileSync };
|
|
@@ -28,14 +28,14 @@ export declare const NC_SERVER_PACKAGE_NAME = "@dominevo/server";
|
|
|
28
28
|
* The kernel and builtins ship inside it, so there is no separate framework
|
|
29
29
|
* package to announce. `@dominevo/types` / `@dominevo/sdk` are framework
|
|
30
30
|
* packages for upload routing but are never announced, so they are NOT here.
|
|
31
|
-
* - `
|
|
31
|
+
* - `dominevo-wrapper` — `wrapper-update-available` (`WRAPPER_PACKAGE_NAME`,
|
|
32
32
|
* `wrapper-update-checker.ts`).
|
|
33
33
|
*
|
|
34
34
|
* Types cannot import those producers; the backend spec
|
|
35
35
|
* `core/updates/__tests__/update-event-package-names.spec.ts` pins each literal
|
|
36
36
|
* to its producer constant. This is a picker list, never a routing list.
|
|
37
37
|
*/
|
|
38
|
-
export declare const NC_UPDATE_EVENT_PACKAGE_NAMES: readonly ["@dominevo/server", '
|
|
38
|
+
export declare const NC_UPDATE_EVENT_PACKAGE_NAMES: readonly ["@dominevo/server", 'dominevo-wrapper'];
|
|
39
39
|
export interface NcInstalledPackageLike {
|
|
40
40
|
readonly name: string;
|
|
41
41
|
readonly version: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_event_category = require("./event-category-
|
|
1
|
+
const require_event_category = require("./event-category-DhlUHlM5.js");
|
|
2
2
|
const require_composed_stable_id = require("./composed-stable-id-C9Vwl-Qd.js");
|
|
3
3
|
let zod = require("zod");
|
|
4
4
|
//#region src/audio/audio-chunk-format.ts
|
|
@@ -278,7 +278,7 @@ function servedInstanceKindsOf(ownerId) {
|
|
|
278
278
|
* plausibly choose as a real password would turn that convenience into a way
|
|
279
279
|
* to lock yourself out, hence the sentinel shape.
|
|
280
280
|
*/
|
|
281
|
-
var REDACTED_SECRET = "
|
|
281
|
+
var REDACTED_SECRET = "__dominevo_redacted__";
|
|
282
282
|
/** Is this field's stored value a credential? */
|
|
283
283
|
function isSecretConfigField(field) {
|
|
284
284
|
if (field.type === "password") return true;
|
|
@@ -484,7 +484,7 @@ function classifySecretWrite(incoming) {
|
|
|
484
484
|
if (isSecretClear(incoming)) return { kind: "clear" };
|
|
485
485
|
if (typeof incoming !== "string") return { kind: "keep" };
|
|
486
486
|
if (incoming.length === 0) return { kind: "keep" };
|
|
487
|
-
if (incoming === "
|
|
487
|
+
if (incoming === "__dominevo_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
|
|
488
488
|
return {
|
|
489
489
|
kind: "set",
|
|
490
490
|
value: incoming
|
|
@@ -1335,7 +1335,7 @@ var PREFIX = "records/";
|
|
|
1335
1335
|
* instance of the host's classes, not of the addon's. The brand plus the code
|
|
1336
1336
|
* make `instanceof` answer by identity of the failure, not of the copy.
|
|
1337
1337
|
*/
|
|
1338
|
-
var RECORDS_ERROR_BRAND = /* @__PURE__ */ Symbol.for("
|
|
1338
|
+
var RECORDS_ERROR_BRAND = /* @__PURE__ */ Symbol.for("dominevo.records-error");
|
|
1339
1339
|
function carriesBrand(value) {
|
|
1340
1340
|
return typeof value === "object" && value !== null && Reflect.get(value, RECORDS_ERROR_BRAND) === true;
|
|
1341
1341
|
}
|
|
@@ -1905,7 +1905,7 @@ function isRecord$5(value) {
|
|
|
1905
1905
|
function secretViewsOf(owner, kind, id, decl, data) {
|
|
1906
1906
|
if (decl.secretPaths.length === 0) return data;
|
|
1907
1907
|
const shown = mapSecretLeaves(data, decl.secretPaths, decl.secretArrayKeys, (leaf) => {
|
|
1908
|
-
if (leaf.value !== "
|
|
1908
|
+
if (leaf.value !== "__dominevo_redacted__") return leaf.value;
|
|
1909
1909
|
return {
|
|
1910
1910
|
$secret: recordSecretRef(owner, kind, id, leaf.concrete),
|
|
1911
1911
|
v: 1,
|
|
@@ -1952,7 +1952,7 @@ function secretMapPatch(value) {
|
|
|
1952
1952
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
|
|
1953
1953
|
const out = {};
|
|
1954
1954
|
for (const [key, entry] of Object.entries(value)) if (entry === null || isSecretClear(entry)) out[key] = null;
|
|
1955
|
-
else if (typeof entry === "string" && entry !== "" && entry !== "
|
|
1955
|
+
else if (typeof entry === "string" && entry !== "" && entry !== "__dominevo_redacted__" && !isSecretFieldView(entry)) out[key] = entry;
|
|
1956
1956
|
return Object.keys(out).length > 0 ? out : null;
|
|
1957
1957
|
}
|
|
1958
1958
|
var RecordIntegrationInstances = class {
|
|
@@ -2143,7 +2143,7 @@ var RecordIntegrationInstances = class {
|
|
|
2143
2143
|
if (entries !== null) patch[key] = entries;
|
|
2144
2144
|
} else if (!this.secretKeys.has(key)) patch[key] = value;
|
|
2145
2145
|
else if (isSecretClear(value)) patch[key] = null;
|
|
2146
|
-
else if (typeof value === "string" && value !== "" && value !== "
|
|
2146
|
+
else if (typeof value === "string" && value !== "" && value !== "__dominevo_redacted__" && !isSecretFieldView(value)) patch[key] = value;
|
|
2147
2147
|
}
|
|
2148
2148
|
return patch;
|
|
2149
2149
|
}
|
|
@@ -4452,26 +4452,6 @@ var BaseAddon = class {
|
|
|
4452
4452
|
} catch {}
|
|
4453
4453
|
}
|
|
4454
4454
|
/**
|
|
4455
|
-
* Resolve the shared, node-local models directory: `<nodeDataDir>/models`.
|
|
4456
|
-
*
|
|
4457
|
-
* This is the SINGLE centralized models-dir resolver for every inference addon
|
|
4458
|
-
* (detection-pipeline, audio-analyzer, embedding-encoder, model-studio). It is
|
|
4459
|
-
* anchored at the node's own writable data root (`ctx.nodeDataDir`, i.e.
|
|
4460
|
-
* `CAMSTACK_DATA` ?? the kernel boot dir) — never the hub-singleton `storage`
|
|
4461
|
-
* cap, which returns the hub's `/data/models` to every node and breaks any node
|
|
4462
|
-
* whose real data dir differs (e.g. the macOS electron agent).
|
|
4463
|
-
*
|
|
4464
|
-
* `node:path`/`node:fs` are imported dynamically so the `@dominevo/types` root
|
|
4465
|
-
* barrel (re-exported into browser bundles) stays free of node builtins.
|
|
4466
|
-
*/
|
|
4467
|
-
async resolveModelsDir() {
|
|
4468
|
-
const { join } = await import("node:path");
|
|
4469
|
-
const { promises: fsp } = await import("node:fs");
|
|
4470
|
-
const dir = join(this.ctx.nodeDataDir, "models");
|
|
4471
|
-
await fsp.mkdir(dir, { recursive: true });
|
|
4472
|
-
return dir;
|
|
4473
|
-
}
|
|
4474
|
-
/**
|
|
4475
4455
|
* Access the runtime capability registry for in-process provider lookups.
|
|
4476
4456
|
* Returns null if the registry is not available (e.g. on agents).
|
|
4477
4457
|
* Used by addons that consume other capabilities directly (snapshot, stream-broker, enrichment).
|
|
@@ -4886,14 +4866,14 @@ function collectFieldKeys(fields) {
|
|
|
4886
4866
|
return collected;
|
|
4887
4867
|
}
|
|
4888
4868
|
/**
|
|
4889
|
-
* Normalize an `
|
|
4869
|
+
* Normalize an `IDominevoAddon.initialize()` return value into the
|
|
4890
4870
|
* `AddonInitResult` envelope. Arrays are wrapped into `{ providers }`;
|
|
4891
4871
|
* envelopes pass through; void stays void.
|
|
4892
4872
|
*
|
|
4893
4873
|
* Exported so the kernel boot path and the backend addon registry can
|
|
4894
4874
|
* share the same normalizer instead of duplicating the shim. Addons that
|
|
4895
4875
|
* extend `BaseAddon` already emit the envelope, so this helper is only a
|
|
4896
|
-
* safety net for direct `
|
|
4876
|
+
* safety net for direct `IDominevoAddon` implementations (mostly tests).
|
|
4897
4877
|
*/
|
|
4898
4878
|
function normalizeAddonInitResult(result) {
|
|
4899
4879
|
if (result == null) return;
|
|
@@ -4901,7 +4881,7 @@ function normalizeAddonInitResult(result) {
|
|
|
4901
4881
|
return result;
|
|
4902
4882
|
}
|
|
4903
4883
|
//#endregion
|
|
4904
|
-
//#region src/i18n/
|
|
4884
|
+
//#region src/i18n/dominevo-error.ts
|
|
4905
4885
|
/**
|
|
4906
4886
|
* A user-facing error with a STABLE code (D863).
|
|
4907
4887
|
*
|
|
@@ -4918,19 +4898,19 @@ var ErrorI18nPayloadSchema = /* @__PURE__ */ zod.z.object({
|
|
|
4918
4898
|
code: ErrorCodeSchema,
|
|
4919
4899
|
params: /* @__PURE__ */ zod.z.record(/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.union([/* @__PURE__ */ zod.z.string(), /* @__PURE__ */ zod.z.number()])).optional()
|
|
4920
4900
|
});
|
|
4921
|
-
var
|
|
4901
|
+
var DominevoError = class extends Error {
|
|
4922
4902
|
i18nCode;
|
|
4923
4903
|
i18nParams;
|
|
4924
4904
|
constructor(code, params, englishMessage) {
|
|
4925
4905
|
super(englishMessage);
|
|
4926
|
-
this.name = "
|
|
4906
|
+
this.name = "DominevoError";
|
|
4927
4907
|
this.i18nCode = code;
|
|
4928
4908
|
this.i18nParams = params;
|
|
4929
4909
|
}
|
|
4930
4910
|
};
|
|
4931
4911
|
/** `throw userError('device.not-found', { id }, 'Device 12 not found')` */
|
|
4932
4912
|
function userError(code, params, englishFallback) {
|
|
4933
|
-
return new
|
|
4913
|
+
return new DominevoError(code, params, englishFallback);
|
|
4934
4914
|
}
|
|
4935
4915
|
/**
|
|
4936
4916
|
* Finds a code on `err` or anywhere down its `.cause` chain. Duck-typed on
|
|
@@ -5577,7 +5557,7 @@ var DisposerChain = class {
|
|
|
5577
5557
|
* hub can reach the addon's `127.0.0.1` listener. Defined here (shared by the
|
|
5578
5558
|
* core proxy and the kernel listener) to keep both off a kernel↔core import.
|
|
5579
5559
|
*/
|
|
5580
|
-
var DATAPLANE_SECRET_HEADER = "x-
|
|
5560
|
+
var DATAPLANE_SECRET_HEADER = "x-dominevo-dataplane-secret";
|
|
5581
5561
|
/**
|
|
5582
5562
|
* The authenticated caller's username, written by the HUB gate on every
|
|
5583
5563
|
* non-public data-plane request AFTER it verified the credential. Whatever the
|
|
@@ -5585,7 +5565,7 @@ var DATAPLANE_SECRET_HEADER = "x-camstack-dataplane-secret";
|
|
|
5585
5565
|
* identity of the request, percent-encoded (a viewer's log batch is attributed with it, never
|
|
5586
5566
|
* with a field of its own body).
|
|
5587
5567
|
*/
|
|
5588
|
-
var CALLER_USERNAME_HEADER = "x-
|
|
5568
|
+
var CALLER_USERNAME_HEADER = "x-dominevo-user";
|
|
5589
5569
|
/**
|
|
5590
5570
|
* The share-view scope kinds a share-link token can carry. The hub mints
|
|
5591
5571
|
* and validates them (`ShareViewGrantSchema` builds its
|
|
@@ -5667,7 +5647,7 @@ var MIN_SCRUBBED_LENGTH = 8;
|
|
|
5667
5647
|
* One store per PROCESS, even when two copies of this module are loaded (an
|
|
5668
5648
|
* addon bundle next to the framework's): keyed on a registered symbol.
|
|
5669
5649
|
*/
|
|
5670
|
-
var STORE_KEY = /* @__PURE__ */ Symbol.for("
|
|
5650
|
+
var STORE_KEY = /* @__PURE__ */ Symbol.for("dominevo.keychain.known-secrets");
|
|
5671
5651
|
function store() {
|
|
5672
5652
|
const existing = Reflect.get(globalThis, STORE_KEY);
|
|
5673
5653
|
if (existing !== void 0 && existing !== null) return existing;
|
|
@@ -6601,7 +6581,7 @@ function enforceSecrets(owner, kind, decl, id, body, stored, mode) {
|
|
|
6601
6581
|
if (leaf.value.$secret !== expected) throw new ForeignSecretMarkerError(`${kind}/${id.slice(0, 64)} field "${leaf.concrete}": the marker is not this row's own ref`);
|
|
6602
6582
|
return leaf.value;
|
|
6603
6583
|
}
|
|
6604
|
-
if (leaf.value === "
|
|
6584
|
+
if (leaf.value === "__dominevo_redacted__") {
|
|
6605
6585
|
const keep = storedMarkers.get(leaf.concrete);
|
|
6606
6586
|
if (keep === void 0) return REMOVE_LEAF;
|
|
6607
6587
|
if (mode === "patch" && !leaf.concrete.includes("[")) return REMOVE_LEAF;
|
|
@@ -19263,7 +19243,7 @@ var viewerUiCapability = {
|
|
|
19263
19243
|
* await api.platformProbe.getCapabilities.query(undefined, nodePin(nodeId))
|
|
19264
19244
|
*/
|
|
19265
19245
|
/** tRPC `op.context` key carrying a per-call node pin. */
|
|
19266
|
-
var CAP_NODE_PIN_CONTEXT_KEY = "
|
|
19246
|
+
var CAP_NODE_PIN_CONTEXT_KEY = "__dominevoNodePin";
|
|
19267
19247
|
/**
|
|
19268
19248
|
* Build the tRPC request options that pin a single capability call to `nodeId`.
|
|
19269
19249
|
* Pass as the second argument to `.query(input, …)` / `.mutate(input, …)`.
|
|
@@ -19310,7 +19290,7 @@ function readNodePin(context) {
|
|
|
19310
19290
|
return typeof value === "string" ? value : void 0;
|
|
19311
19291
|
}
|
|
19312
19292
|
/** tRPC `op.context` key carrying a per-call command origin claim (D1022). */
|
|
19313
|
-
var CAP_COMMAND_ORIGIN_CONTEXT_KEY = "
|
|
19293
|
+
var CAP_COMMAND_ORIGIN_CONTEXT_KEY = "__dominevoCommandOrigin";
|
|
19314
19294
|
/**
|
|
19315
19295
|
* Build the tRPC request options that state WHY a device command is being issued
|
|
19316
19296
|
* (an action run, a scheduler). Pass as the second argument to `.mutate(input, …)`;
|
|
@@ -22869,7 +22849,7 @@ var CAP_METHOD_TIMEOUTS_MS = /* @__PURE__ */ Object.freeze({
|
|
|
22869
22849
|
});
|
|
22870
22850
|
//#endregion
|
|
22871
22851
|
//#region src/constants.ts
|
|
22872
|
-
var HF_REPO = "
|
|
22852
|
+
var HF_REPO = "Dominevo/dominevo-models";
|
|
22873
22853
|
var HF_BASE_URL = `https://huggingface.co/${HF_REPO}/resolve/main`;
|
|
22874
22854
|
/**
|
|
22875
22855
|
* The ONE default session-JWT lifetime.
|
|
@@ -25598,12 +25578,6 @@ Object.defineProperty(exports, "CameraStreamSchema", {
|
|
|
25598
25578
|
return CameraStreamSchema;
|
|
25599
25579
|
}
|
|
25600
25580
|
});
|
|
25601
|
-
Object.defineProperty(exports, "CamstackError", {
|
|
25602
|
-
enumerable: true,
|
|
25603
|
-
get: function() {
|
|
25604
|
-
return CamstackError;
|
|
25605
|
-
}
|
|
25606
|
-
});
|
|
25607
25581
|
Object.defineProperty(exports, "CommandOriginClaimSchema", {
|
|
25608
25582
|
enumerable: true,
|
|
25609
25583
|
get: function() {
|
|
@@ -25778,6 +25752,12 @@ Object.defineProperty(exports, "DisposerChain", {
|
|
|
25778
25752
|
return DisposerChain;
|
|
25779
25753
|
}
|
|
25780
25754
|
});
|
|
25755
|
+
Object.defineProperty(exports, "DominevoError", {
|
|
25756
|
+
enumerable: true,
|
|
25757
|
+
get: function() {
|
|
25758
|
+
return DominevoError;
|
|
25759
|
+
}
|
|
25760
|
+
});
|
|
25781
25761
|
Object.defineProperty(exports, "EntryDescriptorSchema", {
|
|
25782
25762
|
enumerable: true,
|
|
25783
25763
|
get: function() {
|