@camstack/system 1.2.459 → 1.2.461
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 +26 -11
- package/dist/addon-runner.mjs +26 -11
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +3 -3
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +4 -4
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +4 -4
- package/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
- package/dist/builtins/native-metrics/native-metrics.addon.js +38 -3
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +47 -12
- package/dist/builtins/native-metrics/node-metrics-history-recorder.d.ts +15 -0
- package/dist/builtins/platform-probe/coral-accelerators.d.ts +10 -1
- package/dist/builtins/platform-probe/index.js +6 -3
- package/dist/builtins/platform-probe/index.mjs +12 -9
- package/dist/builtins/platform-probe/platform-scorer.d.ts +4 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +19 -19
- 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-plan.d.ts +9 -4
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +112 -112
- package/dist/{coral-accelerators-DcnZvctM.mjs → coral-accelerators-Qhn5TOYZ.mjs} +18 -15
- package/dist/{coral-accelerators-Bi_c3Rft.js → coral-accelerators-oUXmmbc2.js} +13 -10
- package/dist/{custom-action-registry-stpC3Zy-.mjs → custom-action-registry-DZSCLBuT.mjs} +39 -37
- package/dist/{custom-action-registry-COyb49zm.js → custom-action-registry-MRyes5j0.js} +2 -0
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +31 -3
- package/dist/index.mjs +248 -221
- package/dist/kernel/deps/addon-deps-manager.d.ts +9 -0
- package/dist/{restore-archive-CmP-iiG9.mjs → restore-archive-CM23Pq9B.mjs} +93 -93
- package/dist/{wal-maintenance-NKbwWovZ.mjs → wal-maintenance-Bj_MmDkr.mjs} +0 -0
- package/dist/{wal-maintenance-DUHEp_09.js → wal-maintenance-CaJjuLHq.js} +0 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -27,7 +27,7 @@ import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index
|
|
|
27
27
|
import NativeMetricsAddon, { a as NativeMetricsProvider, n as nodeProcReader, r as parseProcStat } from "./builtins/native-metrics/native-metrics.addon.mjs";
|
|
28
28
|
import { DeviceHistoryAddon } from "./builtins/device-history/device-history.addon.mjs";
|
|
29
29
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
|
|
30
|
-
import { l as SqliteSettingsBackend } from "./wal-maintenance-
|
|
30
|
+
import { C as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-Bj_MmDkr.mjs";
|
|
31
31
|
import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
32
32
|
import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
33
33
|
import { StorageOrchestratorAddon, a as stripForwardedCaller, i as createHubCapForwardService, l as STORAGE_DRAIN_STATE_LEGACY, n as HUB_CAP_FWD_ACTION, o as buildStorageLocationRegistry, r as HUB_CAP_FWD_SERVICE, t as StorageOrchestratorService, u as storageOrchestratorRecordKinds } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
@@ -37,16 +37,16 @@ import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT
|
|
|
37
37
|
import { $ as generateMeshKeyPair, A as setProcessMeshPeerTransportLookup, B as describeMeshLeaf, C as setProcessMeshTlsEnabler, D as getProcessPeerLeaf, E as getProcessNodeMeshTransport, F as setProcessMeshTlsListenerState, G as MeshCaKeeper, H as setProcessMeshCertificateRegistry, I as MESH_NODE_CERTIFICATES_COLLECTION, J as caFingerprint, K as getProcessMeshCaState, L as MESH_NODE_CERTIFICATES_COLUMNS, M as revokeMeshCertificate, N as getProcessMeshTlsListenerState, O as isProcessVerifiedMeshPeer, P as openMeshTlsWhenRevocationsLoaded, Q as generateMeshCa, R as MeshCertificateRegistry, S as ServiceBroker, SystemConfigAddon, T as emitProcessNodeRegistered, U as MeshCrl, V as getProcessMeshCertificateRegistry, W as processMeshCrl, X as createMeshCsrPem, Y as caFingerprintCompact, Z as exportMeshPrivateKeyPem, _ as signPairingProof, _t as readCidrSetting, a as hubHostFromMeshAddress, at as AGENT_UI_UNLOCK_TTL_MS, b as TlsTcpTransporter, c as PAIRING_MAX_SESSIONS, ct as AGENT_UI_UNLOCK_VERSION, d as PAIRING_PROTOCOL, dt as mintAgentUiUnlockTicket, et as isValidAgentNodeId, f as PAIRING_TTL_MS, ft as parseAgentDashboardOrigins, g as keyFingerprintShort, gt as parseCidrList, h as describeCsr, ht as normalizeIp, i as AgentPairing, it as AGENT_DASHBOARD_ORIGINS_FIELD, j as renewMeshCertificate, k as onProcessNodeRegistered, l as PAIRING_PATHS, lt as UnlockTicketJtiStore, m as computePairingSas, mt as createCidrMatcher, n as HubPairing, nt as issueMeshLeafFromCsr, o as PAIRING_CODE_DIGITS, ot as AGENT_UI_UNLOCK_TYP, p as computePairingCommitment, pt as verifyAgentUiUnlockTicket, q as requireProcessMeshCa, r as PairingHttpError, rt as loadMeshCa, s as PAIRING_MAX_CODE_ATTEMPTS, st as AGENT_UI_UNLOCK_USE, tt as issueMeshLeafForNode, u as PAIRING_PIN_DIGITS, ut as isAllowedAgentDashboardReturnTo, v as verifyPairingProof, w as dropProcessPeer, x as Errors, y as MESH_TLS_PORT_HELLO_FIELD, z as RENEWAL_ABANDONED } from "./builtins/system-config/system-config.addon.mjs";
|
|
38
38
|
import "./builtins/system-config/index.mjs";
|
|
39
39
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
40
|
-
import { C as isModelDownloaded, T as revisionWeightUrl, _ as downloadFile, a as startEventLoopStallMonitor, b as fetchJson, c as createAuthenticatedFileServer, d as resolveFilePath, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, u as parseTokenizedUrl, v as downloadModel, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-
|
|
40
|
+
import { C as isModelDownloaded, T as revisionWeightUrl, _ as downloadFile, a as startEventLoopStallMonitor, b as fetchJson, c as createAuthenticatedFileServer, d as resolveFilePath, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, u as parseTokenizedUrl, v as downloadModel, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-DZSCLBuT.mjs";
|
|
41
41
|
import { A as allFamiliesListenHost, C as caReplacementMarkerFile, D as replaceUnconstrainedLocalCa, E as reissueTlsLeaf, F as registerLanHttpHandler, M as bindPendingLanHttp, N as closeLanHttp, O as retirePreviousLocalCa, P as readLanHttpState, S as validateUploadedTls, T as loadTlsCert, _ as splitPemCertificates, a as storeUploadedCertificate, b as chainsToPublicRoot, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as writeExtraSans, w as ensureTlsCert, x as checkUploadedCa, y as writeTlsMode } from "./hub-mdns-ciao-CJu0nhla.mjs";
|
|
42
42
|
import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
|
|
43
43
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
|
|
44
|
-
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-
|
|
45
|
-
import { n as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-
|
|
44
|
+
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-CM23Pq9B.mjs";
|
|
45
|
+
import { n as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-Qhn5TOYZ.mjs";
|
|
46
46
|
import { z } from "zod";
|
|
47
47
|
import * as crypto$1 from "node:crypto";
|
|
48
48
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
49
|
-
import { PYTHON_VERSION, buildBinaryPath, downloadBinary, ensureBinary, ensureBinary as ensureBinary$1, ensureFfmpeg, ensureFfmpeg as ensureFfmpeg$1, ensurePython, ensurePython as ensurePython$1, findInPath, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, installPythonPackages, installPythonPackages as installPythonPackages$1, installPythonRequirements, installPythonRequirements as installPythonRequirements$1 } from "@camstack/types/node";
|
|
49
|
+
import { PYTHON_VERSION, buildBinaryPath, declaresEdgetpuDelegate, downloadBinary, ensureBinary, ensureBinary as ensureBinary$1, ensureEdgetpuDelegate, ensureFfmpeg, ensureFfmpeg as ensureFfmpeg$1, ensurePython, ensurePython as ensurePython$1, findInPath, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, installPythonPackages, installPythonPackages as installPythonPackages$1, installPythonRequirements, installPythonRequirements as installPythonRequirements$1 } from "@camstack/types/node";
|
|
50
50
|
import { connect, createConnection, createServer } from "node:net";
|
|
51
51
|
import { mkdir, rm, stat, unlink } from "node:fs/promises";
|
|
52
52
|
import * as path$1 from "node:path";
|
|
@@ -57,7 +57,7 @@ import * as os$1 from "node:os";
|
|
|
57
57
|
import { tmpdir } from "node:os";
|
|
58
58
|
import { pathToFileURL } from "node:url";
|
|
59
59
|
import { BOOT_RECOVERY_BACKOFF_MS, CALLER_STAMPED_CAPABILITIES, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, ErrorI18nPayloadSchema, EventCategory, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, ReadinessRegistry as ReadinessRegistry$1, addonSliceHandleApi, asJsonObject, asString, collectZodSecretPaths, createDeviceProxy, createEvent, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods as expandCapMethods$1, maskUrlCredentials, readErrorI18n, readNodePin, scopeKey as scopeKey$1, scrubKnownSecrets, sleep, withCapInputDefaults } from "@camstack/types/addon";
|
|
60
|
-
import * as fs from "node:fs";
|
|
60
|
+
import * as fs$1 from "node:fs";
|
|
61
61
|
import { accessSync, constants, createReadStream, createWriteStream, existsSync, readFileSync, readdirSync } from "node:fs";
|
|
62
62
|
import { execFile, spawn } from "node:child_process";
|
|
63
63
|
import { once } from "node:events";
|
|
@@ -5031,7 +5031,7 @@ var PythonEnvManager = class {
|
|
|
5031
5031
|
async ensure(options) {
|
|
5032
5032
|
const probe = await this.probe();
|
|
5033
5033
|
if (!probe.available || !probe.path) throw userError("system.python-required", void 0, "Python 3.10+ is required but not found on this system");
|
|
5034
|
-
if (!fs.existsSync(path$1.join(this.venvPath, "bin", "python"))) await execFileAsync$7(probe.path, [
|
|
5034
|
+
if (!fs$1.existsSync(path$1.join(this.venvPath, "bin", "python"))) await execFileAsync$7(probe.path, [
|
|
5035
5035
|
"-m",
|
|
5036
5036
|
"venv",
|
|
5037
5037
|
this.venvPath
|
|
@@ -5054,7 +5054,7 @@ var PythonEnvManager = class {
|
|
|
5054
5054
|
}
|
|
5055
5055
|
spawn(script, args) {
|
|
5056
5056
|
const venvPython = path$1.join(this.venvPath, "bin", "python");
|
|
5057
|
-
if (!fs.existsSync(venvPython)) throw new Error("Python venv not initialized. Call ensure() first.");
|
|
5057
|
+
if (!fs$1.existsSync(venvPython)) throw new Error("Python venv not initialized. Call ensure() first.");
|
|
5058
5058
|
return spawn(venvPython, [script, ...args]);
|
|
5059
5059
|
}
|
|
5060
5060
|
};
|
|
@@ -5406,20 +5406,20 @@ var StorageManager = class {
|
|
|
5406
5406
|
const basePath = this.locationManager.getBackend(mappedName).basePath;
|
|
5407
5407
|
location.files = {
|
|
5408
5408
|
async readFile(p) {
|
|
5409
|
-
return fs.promises.readFile(path$1.join(basePath, p));
|
|
5409
|
+
return fs$1.promises.readFile(path$1.join(basePath, p));
|
|
5410
5410
|
},
|
|
5411
5411
|
async writeFile(p, data) {
|
|
5412
5412
|
const full = path$1.join(basePath, p);
|
|
5413
|
-
await fs.promises.mkdir(path$1.dirname(full), { recursive: true });
|
|
5414
|
-
await fs.promises.writeFile(full, data);
|
|
5413
|
+
await fs$1.promises.mkdir(path$1.dirname(full), { recursive: true });
|
|
5414
|
+
await fs$1.promises.writeFile(full, data);
|
|
5415
5415
|
},
|
|
5416
5416
|
async deleteFile(p) {
|
|
5417
|
-
await fs.promises.rm(path$1.join(basePath, p), { force: true });
|
|
5417
|
+
await fs$1.promises.rm(path$1.join(basePath, p), { force: true });
|
|
5418
5418
|
},
|
|
5419
5419
|
async listFiles(prefix) {
|
|
5420
5420
|
const dir = prefix ? path$1.join(basePath, prefix) : basePath;
|
|
5421
5421
|
try {
|
|
5422
|
-
return (await fs.promises.readdir(dir)).map((f) => prefix ? `${prefix}/${f}` : f);
|
|
5422
|
+
return (await fs$1.promises.readdir(dir)).map((f) => prefix ? `${prefix}/${f}` : f);
|
|
5423
5423
|
} catch {
|
|
5424
5424
|
return [];
|
|
5425
5425
|
}
|
|
@@ -5429,7 +5429,7 @@ var StorageManager = class {
|
|
|
5429
5429
|
},
|
|
5430
5430
|
async exists(p) {
|
|
5431
5431
|
try {
|
|
5432
|
-
await fs.promises.access(path$1.join(basePath, p));
|
|
5432
|
+
await fs$1.promises.access(path$1.join(basePath, p));
|
|
5433
5433
|
return true;
|
|
5434
5434
|
} catch {
|
|
5435
5435
|
return false;
|
|
@@ -6172,7 +6172,7 @@ var TRADITIONAL_NATIVE_PACKAGES = ["better-sqlite3"];
|
|
|
6172
6172
|
function hasDotNode(dir, maxDepth) {
|
|
6173
6173
|
let entries;
|
|
6174
6174
|
try {
|
|
6175
|
-
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
6175
|
+
entries = fs$1.readdirSync(dir, { withFileTypes: true });
|
|
6176
6176
|
} catch {
|
|
6177
6177
|
return false;
|
|
6178
6178
|
}
|
|
@@ -6183,7 +6183,7 @@ function hasDotNode(dir, maxDepth) {
|
|
|
6183
6183
|
}
|
|
6184
6184
|
/** Locate the bundled `prebuild-install` bin.js inside the staged closure. */
|
|
6185
6185
|
function resolvePrebuildInstallBin(closureDir, moduleDir) {
|
|
6186
|
-
return [path$1.join(moduleDir, "node_modules", "prebuild-install", "bin.js"), path$1.join(closureDir, "node_modules", "prebuild-install", "bin.js")].find((c) => fs.existsSync(c)) ?? null;
|
|
6186
|
+
return [path$1.join(moduleDir, "node_modules", "prebuild-install", "bin.js"), path$1.join(closureDir, "node_modules", "prebuild-install", "bin.js")].find((c) => fs$1.existsSync(c)) ?? null;
|
|
6187
6187
|
}
|
|
6188
6188
|
/**
|
|
6189
6189
|
* Default fetcher: run the closure's own `prebuild-install` under the CURRENT
|
|
@@ -6236,7 +6236,7 @@ async function ensureNativePrebuilds(closureDir, options) {
|
|
|
6236
6236
|
const fetched = [];
|
|
6237
6237
|
for (const pkg of packages) {
|
|
6238
6238
|
const moduleDir = path$1.join(nm, pkg);
|
|
6239
|
-
if (!fs.existsSync(moduleDir)) continue;
|
|
6239
|
+
if (!fs$1.existsSync(moduleDir)) continue;
|
|
6240
6240
|
if (hasDotNode(moduleDir, 4)) continue;
|
|
6241
6241
|
options.logger.warn("staged closure native prebuild missing — fetching for running ABI", { meta: {
|
|
6242
6242
|
pkg,
|
|
@@ -6299,12 +6299,12 @@ async function ensureNativePrebuilds(closureDir, options) {
|
|
|
6299
6299
|
function replantFromBundled(srcModuleDir, dstModuleDir, hasNative) {
|
|
6300
6300
|
if (!hasNative(srcModuleDir)) return false;
|
|
6301
6301
|
try {
|
|
6302
|
-
fs.rmSync(dstModuleDir, {
|
|
6302
|
+
fs$1.rmSync(dstModuleDir, {
|
|
6303
6303
|
recursive: true,
|
|
6304
6304
|
force: true
|
|
6305
6305
|
});
|
|
6306
|
-
fs.mkdirSync(path$1.dirname(dstModuleDir), { recursive: true });
|
|
6307
|
-
fs.cpSync(srcModuleDir, dstModuleDir, {
|
|
6306
|
+
fs$1.mkdirSync(path$1.dirname(dstModuleDir), { recursive: true });
|
|
6307
|
+
fs$1.cpSync(srcModuleDir, dstModuleDir, {
|
|
6308
6308
|
recursive: true,
|
|
6309
6309
|
dereference: true
|
|
6310
6310
|
});
|
|
@@ -6333,7 +6333,7 @@ async function ensureAddonNativePrebuilds(addonDir, options) {
|
|
|
6333
6333
|
const missing = [];
|
|
6334
6334
|
for (const pkg of packages) {
|
|
6335
6335
|
const moduleDir = path$1.join(nm, pkg);
|
|
6336
|
-
if (!fs.existsSync(moduleDir)) continue;
|
|
6336
|
+
if (!fs$1.existsSync(moduleDir)) continue;
|
|
6337
6337
|
if (hasNative(moduleDir)) {
|
|
6338
6338
|
results.push({
|
|
6339
6339
|
pkg,
|
|
@@ -6432,7 +6432,7 @@ async function defaultDownloadTarball(url, destTgz) {
|
|
|
6432
6432
|
const res = await fetch(url);
|
|
6433
6433
|
if (!res.ok || !res.body) throw new Error(`HTTP ${res.status} downloading ${url}`);
|
|
6434
6434
|
const bytes = Buffer.from(await res.arrayBuffer());
|
|
6435
|
-
await fs.promises.writeFile(destTgz, bytes);
|
|
6435
|
+
await fs$1.promises.writeFile(destTgz, bytes);
|
|
6436
6436
|
}
|
|
6437
6437
|
async function defaultExtractTarball(tgzPath, destDir) {
|
|
6438
6438
|
await execFileAsync$5("tar", [
|
|
@@ -6518,7 +6518,7 @@ async function resolveUncached(options) {
|
|
|
6518
6518
|
argsPrefix: []
|
|
6519
6519
|
};
|
|
6520
6520
|
const cliPath = bootstrappedCliPath(options.cacheDir);
|
|
6521
|
-
if (fs.existsSync(cliPath)) {
|
|
6521
|
+
if (fs$1.existsSync(cliPath)) {
|
|
6522
6522
|
options.logger.info("system npm unavailable — using bootstrapped npm", { meta: { cliPath } });
|
|
6523
6523
|
return {
|
|
6524
6524
|
command: process.execPath,
|
|
@@ -6530,12 +6530,12 @@ async function resolveUncached(options) {
|
|
|
6530
6530
|
const registry = (options.registry ?? DEFAULT_REGISTRY).replace(/\/+$/, "");
|
|
6531
6531
|
const tarballUrl = tarballUrlOf(await (options.fetchJson ?? defaultFetchJson)(`${registry}/npm/latest`));
|
|
6532
6532
|
if (!tarballUrl) throw new Error(`registry metadata for 'npm' carries no dist.tarball (${registry})`);
|
|
6533
|
-
await fs.promises.mkdir(options.cacheDir, { recursive: true });
|
|
6533
|
+
await fs$1.promises.mkdir(options.cacheDir, { recursive: true });
|
|
6534
6534
|
const tgzPath = path$1.join(options.cacheDir, "npm-bootstrap.tgz");
|
|
6535
6535
|
await (options.downloadTarball ?? defaultDownloadTarball)(tarballUrl, tgzPath);
|
|
6536
6536
|
await (options.extractTarball ?? defaultExtractTarball)(tgzPath, options.cacheDir);
|
|
6537
|
-
await fs.promises.rm(tgzPath, { force: true });
|
|
6538
|
-
if (!fs.existsSync(cliPath)) throw new Error(`extracted npm tarball is missing ${cliPath}`);
|
|
6537
|
+
await fs$1.promises.rm(tgzPath, { force: true });
|
|
6538
|
+
if (!fs$1.existsSync(cliPath)) throw new Error(`extracted npm tarball is missing ${cliPath}`);
|
|
6539
6539
|
options.logger.info("npm bootstrapped", { meta: { cliPath } });
|
|
6540
6540
|
return {
|
|
6541
6541
|
command: process.execPath,
|
|
@@ -6601,7 +6601,7 @@ function readOwningPackageVersion(entryPath) {
|
|
|
6601
6601
|
let dir = path$1.dirname(entryPath);
|
|
6602
6602
|
for (let hop = 0; hop < PACKAGE_JSON_LOOKUP_DEPTH; hop++) {
|
|
6603
6603
|
try {
|
|
6604
|
-
const version = asJsonObject$1(parseJsonUnknown(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8")))?.["version"];
|
|
6604
|
+
const version = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8")))?.["version"];
|
|
6605
6605
|
if (typeof version === "string" && version.length > 0) return version;
|
|
6606
6606
|
} catch {}
|
|
6607
6607
|
const parent = path$1.dirname(dir);
|
|
@@ -6645,14 +6645,14 @@ function readOwningPackageVersion(entryPath) {
|
|
|
6645
6645
|
function addonModuleCacheKey(entryPath) {
|
|
6646
6646
|
let stat;
|
|
6647
6647
|
try {
|
|
6648
|
-
stat = fs.statSync(entryPath);
|
|
6648
|
+
stat = fs$1.statSync(entryPath);
|
|
6649
6649
|
} catch {
|
|
6650
6650
|
return null;
|
|
6651
6651
|
}
|
|
6652
6652
|
const version = readOwningPackageVersion(entryPath) ?? `m${stat.mtimeMs}`;
|
|
6653
6653
|
let content;
|
|
6654
6654
|
try {
|
|
6655
|
-
content = createHash("sha1").update(fs.readFileSync(entryPath)).digest("hex").slice(0, 16);
|
|
6655
|
+
content = createHash("sha1").update(fs$1.readFileSync(entryPath)).digest("hex").slice(0, 16);
|
|
6656
6656
|
} catch {
|
|
6657
6657
|
content = `m${stat.mtimeMs}s${stat.size}`;
|
|
6658
6658
|
}
|
|
@@ -6756,14 +6756,14 @@ var AddonLoader = class {
|
|
|
6756
6756
|
* BUILTINS from the active closure, not the (now-inert) addons-dir copy, so
|
|
6757
6757
|
* the addons-dir `@camstack/system` must NOT be double-loaded here. */
|
|
6758
6758
|
async loadFromDirectory(addonsDir, skipPackages = []) {
|
|
6759
|
-
if (!fs.existsSync(addonsDir)) return;
|
|
6759
|
+
if (!fs$1.existsSync(addonsDir)) return;
|
|
6760
6760
|
const skip = new Set(skipPackages);
|
|
6761
|
-
const entries = fs.readdirSync(addonsDir, { withFileTypes: true });
|
|
6761
|
+
const entries = fs$1.readdirSync(addonsDir, { withFileTypes: true });
|
|
6762
6762
|
for (const entry of entries) {
|
|
6763
6763
|
if (!isDirectoryEntry(entry, addonsDir)) continue;
|
|
6764
6764
|
if (entry.name.startsWith("@")) {
|
|
6765
6765
|
const scopeDir = path$1.join(addonsDir, entry.name);
|
|
6766
|
-
const scopeEntries = fs.readdirSync(scopeDir, { withFileTypes: true });
|
|
6766
|
+
const scopeEntries = fs$1.readdirSync(scopeDir, { withFileTypes: true });
|
|
6767
6767
|
for (const scopeEntry of scopeEntries) {
|
|
6768
6768
|
if (!isDirectoryEntry(scopeEntry, scopeDir)) continue;
|
|
6769
6769
|
if (skip.has(`${entry.name}/${scopeEntry.name}`)) continue;
|
|
@@ -6777,7 +6777,7 @@ var AddonLoader = class {
|
|
|
6777
6777
|
}
|
|
6778
6778
|
async tryLoadAddon(addonDir) {
|
|
6779
6779
|
const pkgJsonPath = path$1.join(addonDir, "package.json");
|
|
6780
|
-
if (!fs.existsSync(pkgJsonPath)) return;
|
|
6780
|
+
if (!fs$1.existsSync(pkgJsonPath)) return;
|
|
6781
6781
|
try {
|
|
6782
6782
|
await this.loadFromAddonDir(addonDir);
|
|
6783
6783
|
} catch (err) {
|
|
@@ -6795,7 +6795,7 @@ var AddonLoader = class {
|
|
|
6795
6795
|
/** Load addon from a specific directory (package.json + dist/) */
|
|
6796
6796
|
async loadFromAddonDir(addonDir) {
|
|
6797
6797
|
const pkgJsonPath = path$1.join(addonDir, "package.json");
|
|
6798
|
-
const pkgJson = asJsonObject$1(parseJsonUnknown(fs.readFileSync(pkgJsonPath, "utf-8"))) ?? {};
|
|
6798
|
+
const pkgJson = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(pkgJsonPath, "utf-8"))) ?? {};
|
|
6799
6799
|
const packageNameRaw = pkgJson["name"];
|
|
6800
6800
|
const packageName = typeof packageNameRaw === "string" ? packageNameRaw : "";
|
|
6801
6801
|
const packageVersionRaw = pkgJson["version"];
|
|
@@ -6826,9 +6826,23 @@ var AddonLoader = class {
|
|
|
6826
6826
|
}
|
|
6827
6827
|
async loadDeclaration(addonDir, declaration, packageName, packageVersion, packageDisplayName, bundle) {
|
|
6828
6828
|
if (!declaration.entry) throw new Error(`Addon "${declaration.id}" has no entry point in package.json`);
|
|
6829
|
+
const owner = this.addons.get(declaration.id);
|
|
6830
|
+
if (owner !== void 0 && owner.packageName !== packageName) {
|
|
6831
|
+
this.logger.warn(`Skipped addon "${declaration.id}" from ${packageName}: already provided by ${owner.packageName}`, {
|
|
6832
|
+
tags: { addonId: declaration.id },
|
|
6833
|
+
meta: {
|
|
6834
|
+
skippedPackage: packageName,
|
|
6835
|
+
skippedVersion: packageVersion,
|
|
6836
|
+
skippedDir: addonDir,
|
|
6837
|
+
ownerPackage: owner.packageName,
|
|
6838
|
+
ownerVersion: owner.packageVersion
|
|
6839
|
+
}
|
|
6840
|
+
});
|
|
6841
|
+
return;
|
|
6842
|
+
}
|
|
6829
6843
|
const entryFile = declaration.entry.replace(/^\.\//, "").replace(/^src\//, "dist/").replace(/\.ts$/, ".js");
|
|
6830
6844
|
let entryPath = path$1.resolve(addonDir, entryFile);
|
|
6831
|
-
if (!fs.existsSync(entryPath)) {
|
|
6845
|
+
if (!fs$1.existsSync(entryPath)) {
|
|
6832
6846
|
const base = entryPath.replace(/\.(js|cjs|mjs)$/, "");
|
|
6833
6847
|
entryPath = [
|
|
6834
6848
|
`${base}.cjs`,
|
|
@@ -6837,9 +6851,9 @@ var AddonLoader = class {
|
|
|
6837
6851
|
path$1.resolve(addonDir, "dist", "index.cjs"),
|
|
6838
6852
|
path$1.resolve(addonDir, "dist", "index.mjs"),
|
|
6839
6853
|
path$1.resolve(addonDir, declaration.entry)
|
|
6840
|
-
].find((p) => fs.existsSync(p)) ?? entryPath;
|
|
6854
|
+
].find((p) => fs$1.existsSync(p)) ?? entryPath;
|
|
6841
6855
|
}
|
|
6842
|
-
if (!fs.existsSync(entryPath)) throw new Error(`Entry not found: ${entryPath}`);
|
|
6856
|
+
if (!fs$1.existsSync(entryPath)) throw new Error(`Entry not found: ${entryPath}`);
|
|
6843
6857
|
const modUnknown = await importAddonModuleFresh(entryPath);
|
|
6844
6858
|
const mod = isRecord$5(modUnknown) ? modUnknown : {};
|
|
6845
6859
|
const AddonClass = resolveAddonClass(mod);
|
|
@@ -6924,7 +6938,7 @@ function isDirectoryEntry(entry, parentDir) {
|
|
|
6924
6938
|
if (entry.name.startsWith(".")) return false;
|
|
6925
6939
|
if (entry.isDirectory()) return true;
|
|
6926
6940
|
if (entry.isSymbolicLink()) try {
|
|
6927
|
-
return fs.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
6941
|
+
return fs$1.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
6928
6942
|
} catch {
|
|
6929
6943
|
return false;
|
|
6930
6944
|
}
|
|
@@ -7018,7 +7032,7 @@ var execFileAsync$4 = promisify(execFile);
|
|
|
7018
7032
|
* Single source of truth — replaces scattered mkdirSync calls.
|
|
7019
7033
|
*/
|
|
7020
7034
|
function ensureDir(dirPath) {
|
|
7021
|
-
fs.mkdirSync(dirPath, { recursive: true });
|
|
7035
|
+
fs$1.mkdirSync(dirPath, { recursive: true });
|
|
7022
7036
|
}
|
|
7023
7037
|
/**
|
|
7024
7038
|
* Copy a directory recursively — ASYNC so it never blocks the event loop.
|
|
@@ -7031,7 +7045,7 @@ function ensureDir(dirPath) {
|
|
|
7031
7045
|
* `fs.promises.cp` keeps the I/O off the event loop. (Node ≥18 stable.)
|
|
7032
7046
|
*/
|
|
7033
7047
|
async function copyDirRecursive(src, dest) {
|
|
7034
|
-
await fs.promises.cp(src, dest, {
|
|
7048
|
+
await fs$1.promises.cp(src, dest, {
|
|
7035
7049
|
recursive: true,
|
|
7036
7050
|
force: true
|
|
7037
7051
|
});
|
|
@@ -7136,13 +7150,13 @@ async function copyExtraFileDirs(pkgJson, sourceDir, destDir) {
|
|
|
7136
7150
|
if (typeof fileEntry !== "string") continue;
|
|
7137
7151
|
if (fileEntry === "dist" || fileEntry.includes("*")) continue;
|
|
7138
7152
|
const srcPath = path$1.join(sourceDir, fileEntry);
|
|
7139
|
-
if (!fs.existsSync(srcPath)) continue;
|
|
7153
|
+
if (!fs$1.existsSync(srcPath)) continue;
|
|
7140
7154
|
const destPath = path$1.join(destDir, fileEntry);
|
|
7141
|
-
const stat = await fs.promises.stat(srcPath);
|
|
7155
|
+
const stat = await fs$1.promises.stat(srcPath);
|
|
7142
7156
|
if (stat.isDirectory()) await copyDirRecursive(srcPath, destPath);
|
|
7143
7157
|
else if (stat.isFile()) {
|
|
7144
7158
|
ensureDir(path$1.dirname(destPath));
|
|
7145
|
-
await fs.promises.copyFile(srcPath, destPath);
|
|
7159
|
+
await fs$1.promises.copyFile(srcPath, destPath);
|
|
7146
7160
|
}
|
|
7147
7161
|
}
|
|
7148
7162
|
}
|
|
@@ -7153,10 +7167,10 @@ async function copyExtraFileDirs(pkgJson, sourceDir, destDir) {
|
|
|
7153
7167
|
function isSourceNewer(packageDir) {
|
|
7154
7168
|
const srcDir = path$1.join(packageDir, "src");
|
|
7155
7169
|
const distDir = path$1.join(packageDir, "dist");
|
|
7156
|
-
if (!fs.existsSync(srcDir) || !fs.existsSync(distDir)) return true;
|
|
7170
|
+
if (!fs$1.existsSync(srcDir) || !fs$1.existsSync(distDir)) return true;
|
|
7157
7171
|
try {
|
|
7158
|
-
const distMtime = fs.statSync(distDir).mtimeMs;
|
|
7159
|
-
const entries = fs.readdirSync(srcDir, {
|
|
7172
|
+
const distMtime = fs$1.statSync(distDir).mtimeMs;
|
|
7173
|
+
const entries = fs$1.readdirSync(srcDir, {
|
|
7160
7174
|
withFileTypes: true,
|
|
7161
7175
|
recursive: true
|
|
7162
7176
|
});
|
|
@@ -7164,7 +7178,7 @@ function isSourceNewer(packageDir) {
|
|
|
7164
7178
|
if (!entry.isFile()) continue;
|
|
7165
7179
|
const parentDir = entry.parentPath ?? String(Reflect.get(entry, "path") ?? "");
|
|
7166
7180
|
const filePath = path$1.join(parentDir, entry.name);
|
|
7167
|
-
if (fs.statSync(filePath).mtimeMs > distMtime) return true;
|
|
7181
|
+
if (fs$1.statSync(filePath).mtimeMs > distMtime) return true;
|
|
7168
7182
|
}
|
|
7169
7183
|
return false;
|
|
7170
7184
|
} catch {
|
|
@@ -7179,9 +7193,9 @@ function isSourceNewer(packageDir) {
|
|
|
7179
7193
|
function ensureLibraryBuilt(packageName, packagesDir) {
|
|
7180
7194
|
const dirName = packageName.replace("@camstack/", "");
|
|
7181
7195
|
const sourceDir = path$1.join(packagesDir, dirName);
|
|
7182
|
-
if (!fs.existsSync(sourceDir)) return;
|
|
7196
|
+
if (!fs$1.existsSync(sourceDir)) return;
|
|
7183
7197
|
const distDir = path$1.join(sourceDir, "dist");
|
|
7184
|
-
if (fs.existsSync(path$1.join(distDir, "index.js")) || fs.existsSync(path$1.join(distDir, "index.mjs"))) return;
|
|
7198
|
+
if (fs$1.existsSync(path$1.join(distDir, "index.js")) || fs$1.existsSync(path$1.join(distDir, "index.mjs"))) return;
|
|
7185
7199
|
console.warn(`[ensureLibraryBuilt] ${packageName} has no dist/ — run 'npm run build' first`);
|
|
7186
7200
|
}
|
|
7187
7201
|
/**
|
|
@@ -7194,7 +7208,7 @@ function ensureLibraryBuilt(packageName, packagesDir) {
|
|
|
7194
7208
|
* `copyDirRecursive` for the wedge this prevents.
|
|
7195
7209
|
*/
|
|
7196
7210
|
async function installPackageFromNpm(packageName, targetDir) {
|
|
7197
|
-
const tmpDir = await fs.promises.mkdtemp(path$1.join(os$1.tmpdir(), "camstack-install-"));
|
|
7211
|
+
const tmpDir = await fs$1.promises.mkdtemp(path$1.join(os$1.tmpdir(), "camstack-install-"));
|
|
7198
7212
|
try {
|
|
7199
7213
|
const { stdout } = await execFileAsync$4("npm", [
|
|
7200
7214
|
"pack",
|
|
@@ -7217,21 +7231,21 @@ async function installPackageFromNpm(packageName, targetDir) {
|
|
|
7217
7231
|
extractDir
|
|
7218
7232
|
], { timeout: 3e4 });
|
|
7219
7233
|
const packageSubDir = path$1.join(extractDir, "package");
|
|
7220
|
-
const srcPkgJsonDir = fs.existsSync(path$1.join(packageSubDir, "package.json")) ? packageSubDir : extractDir;
|
|
7221
|
-
await fs.promises.rm(targetDir, {
|
|
7234
|
+
const srcPkgJsonDir = fs$1.existsSync(path$1.join(packageSubDir, "package.json")) ? packageSubDir : extractDir;
|
|
7235
|
+
await fs$1.promises.rm(targetDir, {
|
|
7222
7236
|
recursive: true,
|
|
7223
7237
|
force: true
|
|
7224
7238
|
});
|
|
7225
7239
|
ensureDir(targetDir);
|
|
7226
|
-
await fs.promises.copyFile(path$1.join(srcPkgJsonDir, "package.json"), path$1.join(targetDir, "package.json"));
|
|
7240
|
+
await fs$1.promises.copyFile(path$1.join(srcPkgJsonDir, "package.json"), path$1.join(targetDir, "package.json"));
|
|
7227
7241
|
const distSrc = path$1.join(srcPkgJsonDir, "dist");
|
|
7228
|
-
if (fs.existsSync(distSrc)) await copyDirRecursive(distSrc, path$1.join(targetDir, "dist"));
|
|
7242
|
+
if (fs$1.existsSync(distSrc)) await copyDirRecursive(distSrc, path$1.join(targetDir, "dist"));
|
|
7229
7243
|
try {
|
|
7230
|
-
const npmPkg = asJsonObject$1(parseJsonUnknown(await fs.promises.readFile(path$1.join(srcPkgJsonDir, "package.json"), "utf-8")));
|
|
7244
|
+
const npmPkg = asJsonObject$1(parseJsonUnknown(await fs$1.promises.readFile(path$1.join(srcPkgJsonDir, "package.json"), "utf-8")));
|
|
7231
7245
|
if (npmPkg) await copyExtraFileDirs(npmPkg, srcPkgJsonDir, targetDir);
|
|
7232
7246
|
} catch {}
|
|
7233
7247
|
} finally {
|
|
7234
|
-
await fs.promises.rm(tmpDir, {
|
|
7248
|
+
await fs$1.promises.rm(tmpDir, {
|
|
7235
7249
|
recursive: true,
|
|
7236
7250
|
force: true
|
|
7237
7251
|
});
|
|
@@ -7256,7 +7270,7 @@ function packageDirName$1(declaredName) {
|
|
|
7256
7270
|
}
|
|
7257
7271
|
function isDirLike$1(p) {
|
|
7258
7272
|
try {
|
|
7259
|
-
return fs.statSync(p).isDirectory();
|
|
7273
|
+
return fs$1.statSync(p).isDirectory();
|
|
7260
7274
|
} catch {
|
|
7261
7275
|
return false;
|
|
7262
7276
|
}
|
|
@@ -7274,12 +7288,12 @@ var AddonManifest = class {
|
|
|
7274
7288
|
*/
|
|
7275
7289
|
read() {
|
|
7276
7290
|
if (this.cache != null) return this.cache;
|
|
7277
|
-
if (!fs.existsSync(this.manifestPath)) {
|
|
7291
|
+
if (!fs$1.existsSync(this.manifestPath)) {
|
|
7278
7292
|
this.cache = this.empty();
|
|
7279
7293
|
return this.cache;
|
|
7280
7294
|
}
|
|
7281
7295
|
try {
|
|
7282
|
-
const raw = fs.readFileSync(this.manifestPath, "utf-8");
|
|
7296
|
+
const raw = fs$1.readFileSync(this.manifestPath, "utf-8");
|
|
7283
7297
|
const parsed = JSON.parse(raw);
|
|
7284
7298
|
if (parsed.version !== MANIFEST_VERSION) {
|
|
7285
7299
|
process.stderr.write(`[AddonManifest] schema mismatch (file=${parsed.version} vs runtime=${MANIFEST_VERSION}); starting empty\n`);
|
|
@@ -7300,13 +7314,13 @@ var AddonManifest = class {
|
|
|
7300
7314
|
* a half-written file.
|
|
7301
7315
|
*/
|
|
7302
7316
|
write(manifest) {
|
|
7303
|
-
fs.mkdirSync(path$1.dirname(this.manifestPath), { recursive: true });
|
|
7317
|
+
fs$1.mkdirSync(path$1.dirname(this.manifestPath), { recursive: true });
|
|
7304
7318
|
const tmp = `${this.manifestPath}.tmp.${process.pid}.${Date.now()}`;
|
|
7305
|
-
fs.writeFileSync(tmp, JSON.stringify(manifest, null, 2), {
|
|
7319
|
+
fs$1.writeFileSync(tmp, JSON.stringify(manifest, null, 2), {
|
|
7306
7320
|
encoding: "utf-8",
|
|
7307
7321
|
mode: 384
|
|
7308
7322
|
});
|
|
7309
|
-
fs.renameSync(tmp, this.manifestPath);
|
|
7323
|
+
fs$1.renameSync(tmp, this.manifestPath);
|
|
7310
7324
|
this.cache = manifest;
|
|
7311
7325
|
}
|
|
7312
7326
|
/** Lookup a single addon's manifest entry, or `null` if not tracked. */
|
|
@@ -7381,22 +7395,22 @@ var AddonManifest = class {
|
|
|
7381
7395
|
* exactly what moved. Returns the total number of changes.
|
|
7382
7396
|
*/
|
|
7383
7397
|
reconcileFromDisk(addonsDir, onChange) {
|
|
7384
|
-
if (!fs.existsSync(addonsDir)) return 0;
|
|
7398
|
+
if (!fs$1.existsSync(addonsDir)) return 0;
|
|
7385
7399
|
const m = this.read();
|
|
7386
7400
|
let changes = 0;
|
|
7387
7401
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7388
7402
|
/** Package name → version, for every ADDON package actually installed. */
|
|
7389
7403
|
const onDisk = /* @__PURE__ */ new Map();
|
|
7390
|
-
for (const scope of fs.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7404
|
+
for (const scope of fs$1.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7391
7405
|
if (!scope.name.startsWith("@") || !isDirLike$1(path$1.join(addonsDir, scope.name))) continue;
|
|
7392
7406
|
const scopeDir = path$1.join(addonsDir, scope.name);
|
|
7393
|
-
for (const pkg of fs.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7407
|
+
for (const pkg of fs$1.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7394
7408
|
if (!isDirLike$1(path$1.join(scopeDir, pkg.name))) continue;
|
|
7395
7409
|
const pkgJsonPath = path$1.join(scopeDir, pkg.name, "package.json");
|
|
7396
|
-
if (!fs.existsSync(pkgJsonPath)) continue;
|
|
7410
|
+
if (!fs$1.existsSync(pkgJsonPath)) continue;
|
|
7397
7411
|
let pkgJson;
|
|
7398
7412
|
try {
|
|
7399
|
-
const parsed = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
7413
|
+
const parsed = JSON.parse(fs$1.readFileSync(pkgJsonPath, "utf-8"));
|
|
7400
7414
|
if (typeof parsed !== "object" || parsed == null) continue;
|
|
7401
7415
|
pkgJson = parsed;
|
|
7402
7416
|
} catch {
|
|
@@ -7467,28 +7481,28 @@ var AddonManifest = class {
|
|
|
7467
7481
|
migrateFromInstallSourceMarkers(addonsDir) {
|
|
7468
7482
|
const m = this.read();
|
|
7469
7483
|
if (Object.keys(m.addons).length > 0) return 0;
|
|
7470
|
-
if (!fs.existsSync(addonsDir)) return 0;
|
|
7484
|
+
if (!fs$1.existsSync(addonsDir)) return 0;
|
|
7471
7485
|
let migrated = 0;
|
|
7472
7486
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7473
|
-
for (const scope of fs.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7487
|
+
for (const scope of fs$1.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7474
7488
|
if (!scope.isDirectory() || !scope.name.startsWith("@")) continue;
|
|
7475
7489
|
const scopeDir = path$1.join(addonsDir, scope.name);
|
|
7476
|
-
for (const pkg of fs.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7490
|
+
for (const pkg of fs$1.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7477
7491
|
if (!pkg.isDirectory()) continue;
|
|
7478
7492
|
const pkgDir = path$1.join(scopeDir, pkg.name);
|
|
7479
7493
|
const markerPath = path$1.join(pkgDir, ".install-source");
|
|
7480
7494
|
const pkgJsonPath = path$1.join(pkgDir, "package.json");
|
|
7481
|
-
if (!fs.existsSync(pkgJsonPath)) continue;
|
|
7495
|
+
if (!fs$1.existsSync(pkgJsonPath)) continue;
|
|
7482
7496
|
let pkgJson;
|
|
7483
7497
|
try {
|
|
7484
|
-
const parsed = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
7498
|
+
const parsed = JSON.parse(fs$1.readFileSync(pkgJsonPath, "utf-8"));
|
|
7485
7499
|
if (typeof parsed !== "object" || parsed == null) continue;
|
|
7486
7500
|
pkgJson = parsed;
|
|
7487
7501
|
} catch {
|
|
7488
7502
|
continue;
|
|
7489
7503
|
}
|
|
7490
7504
|
if (!pkgJson.name || !pkgJson.version) continue;
|
|
7491
|
-
const source = fs.existsSync(markerPath) ? fs.readFileSync(markerPath, "utf-8").trim() : "bundled";
|
|
7505
|
+
const source = fs$1.existsSync(markerPath) ? fs$1.readFileSync(markerPath, "utf-8").trim() : "bundled";
|
|
7492
7506
|
m.addons[pkgJson.name] = {
|
|
7493
7507
|
name: pkgJson.name,
|
|
7494
7508
|
version: pkgJson.version,
|
|
@@ -7665,7 +7679,7 @@ function planClosureDedupe(input) {
|
|
|
7665
7679
|
function readTreeManifest(pkgJsonPath) {
|
|
7666
7680
|
let raw;
|
|
7667
7681
|
try {
|
|
7668
|
-
raw = asJsonObject$1(parseJsonUnknown(fs.readFileSync(pkgJsonPath, "utf-8")));
|
|
7682
|
+
raw = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(pkgJsonPath, "utf-8")));
|
|
7669
7683
|
} catch {
|
|
7670
7684
|
return null;
|
|
7671
7685
|
}
|
|
@@ -7690,7 +7704,7 @@ function readTreeManifest(pkgJsonPath) {
|
|
|
7690
7704
|
function listTopLevelEntries(nodeModulesDir) {
|
|
7691
7705
|
let entries;
|
|
7692
7706
|
try {
|
|
7693
|
-
entries = fs.readdirSync(nodeModulesDir, { withFileTypes: true });
|
|
7707
|
+
entries = fs$1.readdirSync(nodeModulesDir, { withFileTypes: true });
|
|
7694
7708
|
} catch {
|
|
7695
7709
|
return [];
|
|
7696
7710
|
}
|
|
@@ -7700,7 +7714,7 @@ function listTopLevelEntries(nodeModulesDir) {
|
|
|
7700
7714
|
if (entry.name.startsWith("@")) {
|
|
7701
7715
|
let inner;
|
|
7702
7716
|
try {
|
|
7703
|
-
inner = fs.readdirSync(path$1.join(nodeModulesDir, entry.name), { withFileTypes: true });
|
|
7717
|
+
inner = fs$1.readdirSync(path$1.join(nodeModulesDir, entry.name), { withFileTypes: true });
|
|
7704
7718
|
} catch {
|
|
7705
7719
|
continue;
|
|
7706
7720
|
}
|
|
@@ -7733,14 +7747,14 @@ function collectAddonTreeState(addonDir) {
|
|
|
7733
7747
|
const entryDir = path$1.join(nodeModulesDir, name);
|
|
7734
7748
|
let isLink = false;
|
|
7735
7749
|
try {
|
|
7736
|
-
isLink = fs.lstatSync(entryDir).isSymbolicLink();
|
|
7750
|
+
isLink = fs$1.lstatSync(entryDir).isSymbolicLink();
|
|
7737
7751
|
} catch {
|
|
7738
7752
|
continue;
|
|
7739
7753
|
}
|
|
7740
7754
|
if (isLink) {
|
|
7741
7755
|
let target = "";
|
|
7742
7756
|
try {
|
|
7743
|
-
target = fs.readlinkSync(entryDir);
|
|
7757
|
+
target = fs$1.readlinkSync(entryDir);
|
|
7744
7758
|
} catch {}
|
|
7745
7759
|
existingLinks.push({
|
|
7746
7760
|
name,
|
|
@@ -7754,7 +7768,7 @@ function collectAddonTreeState(addonDir) {
|
|
|
7754
7768
|
version: manifest.version
|
|
7755
7769
|
});
|
|
7756
7770
|
for (const [depName, range] of manifest.ranges) {
|
|
7757
|
-
if (fs.existsSync(path$1.join(entryDir, "node_modules", depName))) continue;
|
|
7771
|
+
if (fs$1.existsSync(path$1.join(entryDir, "node_modules", depName))) continue;
|
|
7758
7772
|
addRange(depName, range);
|
|
7759
7773
|
}
|
|
7760
7774
|
}
|
|
@@ -7784,7 +7798,7 @@ function resolveClosureNodeModulesDir(explicitDir) {
|
|
|
7784
7798
|
const frameworkDir = explicitDir ?? process.env["CAMSTACK_FRAMEWORK_DIR"];
|
|
7785
7799
|
if (frameworkDir === void 0 || frameworkDir.length === 0) return null;
|
|
7786
7800
|
const nodeModulesDir = explicitDir ?? path$1.join(frameworkDir, "node_modules");
|
|
7787
|
-
return fs.existsSync(nodeModulesDir) ? nodeModulesDir : null;
|
|
7801
|
+
return fs$1.existsSync(nodeModulesDir) ? nodeModulesDir : null;
|
|
7788
7802
|
}
|
|
7789
7803
|
function symlinkType() {
|
|
7790
7804
|
return process.platform === "win32" ? "junction" : "dir";
|
|
@@ -7803,10 +7817,10 @@ function executeClosureDedupe(addonDir, closureNodeModulesDir, plan, logger) {
|
|
|
7803
7817
|
const nodeModulesDir = path$1.join(addonDir, "node_modules");
|
|
7804
7818
|
const probePath = path$1.join(nodeModulesDir, ".closure-link-probe");
|
|
7805
7819
|
try {
|
|
7806
|
-
fs.mkdirSync(nodeModulesDir, { recursive: true });
|
|
7807
|
-
fs.rmSync(probePath, { force: true });
|
|
7808
|
-
fs.symlinkSync(closureNodeModulesDir, probePath, symlinkType());
|
|
7809
|
-
fs.rmSync(probePath, { force: true });
|
|
7820
|
+
fs$1.mkdirSync(nodeModulesDir, { recursive: true });
|
|
7821
|
+
fs$1.rmSync(probePath, { force: true });
|
|
7822
|
+
fs$1.symlinkSync(closureNodeModulesDir, probePath, symlinkType());
|
|
7823
|
+
fs$1.rmSync(probePath, { force: true });
|
|
7810
7824
|
} catch (err) {
|
|
7811
7825
|
logger.warn("closure dedupe skipped — symlinks unavailable on this volume", { meta: {
|
|
7812
7826
|
addonDir,
|
|
@@ -7828,12 +7842,12 @@ function executeClosureDedupe(addonDir, closureNodeModulesDir, plan, logger) {
|
|
|
7828
7842
|
}
|
|
7829
7843
|
const entryDir = path$1.join(nodeModulesDir, link.name);
|
|
7830
7844
|
try {
|
|
7831
|
-
fs.rmSync(entryDir, {
|
|
7845
|
+
fs$1.rmSync(entryDir, {
|
|
7832
7846
|
recursive: true,
|
|
7833
7847
|
force: true
|
|
7834
7848
|
});
|
|
7835
|
-
fs.mkdirSync(path$1.dirname(entryDir), { recursive: true });
|
|
7836
|
-
fs.symlinkSync(target, entryDir, symlinkType());
|
|
7849
|
+
fs$1.mkdirSync(path$1.dirname(entryDir), { recursive: true });
|
|
7850
|
+
fs$1.symlinkSync(target, entryDir, symlinkType());
|
|
7837
7851
|
linked.push(link.name);
|
|
7838
7852
|
} catch (err) {
|
|
7839
7853
|
logger.warn("closure dedupe — link failed; entry removed copy may need reinstall", { meta: {
|
|
@@ -7909,7 +7923,7 @@ async function installManifestNativeDeps(addonDir, pkgRaw, logger, registry, npm
|
|
|
7909
7923
|
count: Object.keys(native).length
|
|
7910
7924
|
} });
|
|
7911
7925
|
try {
|
|
7912
|
-
fs.writeFileSync(markerFile, markerHash);
|
|
7926
|
+
fs$1.writeFileSync(markerFile, markerHash);
|
|
7913
7927
|
} catch (err) {
|
|
7914
7928
|
logger.warn("Failed to write native deps marker", { meta: {
|
|
7915
7929
|
markerFile,
|
|
@@ -7947,7 +7961,7 @@ async function installManifestNativeDeps(addonDir, pkgRaw, logger, registry, npm
|
|
|
7947
7961
|
}
|
|
7948
7962
|
await rebuildNativeDeps(addonDir, pending.map(([name]) => name), logger, npmCacheDir ?? defaultNpmCacheDir(), registry);
|
|
7949
7963
|
try {
|
|
7950
|
-
fs.writeFileSync(markerFile, markerHash);
|
|
7964
|
+
fs$1.writeFileSync(markerFile, markerHash);
|
|
7951
7965
|
} catch (err) {
|
|
7952
7966
|
logger.warn("Failed to write native deps marker", { meta: {
|
|
7953
7967
|
markerFile,
|
|
@@ -7969,12 +7983,12 @@ function copyPrebuiltNativeDep(name, addonDir, logger) {
|
|
|
7969
7983
|
if (source === target) continue;
|
|
7970
7984
|
if (!hasBuiltBinary(source)) continue;
|
|
7971
7985
|
try {
|
|
7972
|
-
fs.rmSync(target, {
|
|
7986
|
+
fs$1.rmSync(target, {
|
|
7973
7987
|
recursive: true,
|
|
7974
7988
|
force: true
|
|
7975
7989
|
});
|
|
7976
|
-
fs.mkdirSync(path$1.dirname(target), { recursive: true });
|
|
7977
|
-
fs.cpSync(source, target, {
|
|
7990
|
+
fs$1.mkdirSync(path$1.dirname(target), { recursive: true });
|
|
7991
|
+
fs$1.cpSync(source, target, {
|
|
7978
7992
|
recursive: true,
|
|
7979
7993
|
dereference: true
|
|
7980
7994
|
});
|
|
@@ -8010,7 +8024,7 @@ var BUNDLED_NATIVE_SIBLING_SCOPES = {
|
|
|
8010
8024
|
function hasAnyDotNode(dir, maxDepth) {
|
|
8011
8025
|
let entries;
|
|
8012
8026
|
try {
|
|
8013
|
-
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
8027
|
+
entries = fs$1.readdirSync(dir, { withFileTypes: true });
|
|
8014
8028
|
} catch {
|
|
8015
8029
|
return false;
|
|
8016
8030
|
}
|
|
@@ -8024,12 +8038,12 @@ function copyPrebuiltModuleDir(src, dst, label, logger) {
|
|
|
8024
8038
|
if (!hasAnyDotNode(src, 5)) return;
|
|
8025
8039
|
if (hasAnyDotNode(dst, 5)) return;
|
|
8026
8040
|
try {
|
|
8027
|
-
fs.rmSync(dst, {
|
|
8041
|
+
fs$1.rmSync(dst, {
|
|
8028
8042
|
recursive: true,
|
|
8029
8043
|
force: true
|
|
8030
8044
|
});
|
|
8031
|
-
fs.mkdirSync(path$1.dirname(dst), { recursive: true });
|
|
8032
|
-
fs.cpSync(src, dst, {
|
|
8045
|
+
fs$1.mkdirSync(path$1.dirname(dst), { recursive: true });
|
|
8046
|
+
fs$1.cpSync(src, dst, {
|
|
8033
8047
|
recursive: true,
|
|
8034
8048
|
dereference: true
|
|
8035
8049
|
});
|
|
@@ -8064,7 +8078,7 @@ function copyPrebuiltModuleDir(src, dst, label, logger) {
|
|
|
8064
8078
|
*/
|
|
8065
8079
|
function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
8066
8080
|
const srcNm = path$1.join(sourceDir, "node_modules");
|
|
8067
|
-
if (!fs.existsSync(srcNm)) return;
|
|
8081
|
+
if (!fs$1.existsSync(srcNm)) return;
|
|
8068
8082
|
const dstNm = path$1.join(targetDir, "node_modules");
|
|
8069
8083
|
for (const [name, scopes] of Object.entries(BUNDLED_NATIVE_SIBLING_SCOPES)) {
|
|
8070
8084
|
copyPrebuiltModuleDir(path$1.join(srcNm, name), path$1.join(dstNm, name), name, logger);
|
|
@@ -8072,7 +8086,7 @@ function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
|
8072
8086
|
const scopeSrc = path$1.join(srcNm, scope);
|
|
8073
8087
|
let siblings;
|
|
8074
8088
|
try {
|
|
8075
|
-
siblings = fs.readdirSync(scopeSrc);
|
|
8089
|
+
siblings = fs$1.readdirSync(scopeSrc);
|
|
8076
8090
|
} catch {
|
|
8077
8091
|
continue;
|
|
8078
8092
|
}
|
|
@@ -8082,12 +8096,12 @@ function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
|
8082
8096
|
}
|
|
8083
8097
|
/** A package dir is "built" when it carries a compiled `.node` or a prebuilds tree. */
|
|
8084
8098
|
function hasBuiltBinary(pkgDir) {
|
|
8085
|
-
if (!fs.existsSync(path$1.join(pkgDir, "package.json"))) return false;
|
|
8099
|
+
if (!fs$1.existsSync(path$1.join(pkgDir, "package.json"))) return false;
|
|
8086
8100
|
const releaseDir = path$1.join(pkgDir, "build", "Release");
|
|
8087
8101
|
try {
|
|
8088
|
-
if (fs.existsSync(releaseDir) && fs.readdirSync(releaseDir).some((f) => f.endsWith(".node"))) return true;
|
|
8102
|
+
if (fs$1.existsSync(releaseDir) && fs$1.readdirSync(releaseDir).some((f) => f.endsWith(".node"))) return true;
|
|
8089
8103
|
} catch {}
|
|
8090
|
-
return fs.existsSync(path$1.join(pkgDir, "prebuilds"));
|
|
8104
|
+
return fs$1.existsSync(path$1.join(pkgDir, "prebuilds"));
|
|
8091
8105
|
}
|
|
8092
8106
|
/** Candidate hoisted locations for `<name>`: NODE_PATH entries + ancestors of `addonDir`. */
|
|
8093
8107
|
function candidateHoistedDirs(name, addonDir) {
|
|
@@ -8125,7 +8139,7 @@ function hashDeclaration(deps) {
|
|
|
8125
8139
|
}
|
|
8126
8140
|
function markerMatches(markerFile, expected) {
|
|
8127
8141
|
try {
|
|
8128
|
-
return fs.readFileSync(markerFile, "utf-8").trim() === expected;
|
|
8142
|
+
return fs$1.readFileSync(markerFile, "utf-8").trim() === expected;
|
|
8129
8143
|
} catch {
|
|
8130
8144
|
return false;
|
|
8131
8145
|
}
|
|
@@ -8232,7 +8246,7 @@ function parseInstallSource(value) {
|
|
|
8232
8246
|
function readPackageJson(pkgJsonPath) {
|
|
8233
8247
|
let raw;
|
|
8234
8248
|
try {
|
|
8235
|
-
raw = asJsonObject$1(parseJsonUnknown(fs.readFileSync(pkgJsonPath, "utf-8")));
|
|
8249
|
+
raw = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(pkgJsonPath, "utf-8")));
|
|
8236
8250
|
} catch {
|
|
8237
8251
|
return null;
|
|
8238
8252
|
}
|
|
@@ -8395,7 +8409,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8395
8409
|
} catch {
|
|
8396
8410
|
return Object.freeze([]);
|
|
8397
8411
|
}
|
|
8398
|
-
const raw = fs.readFileSync(pkgPath, "utf-8");
|
|
8412
|
+
const raw = fs$1.readFileSync(pkgPath, "utf-8");
|
|
8399
8413
|
const parsed = JSON.parse(raw);
|
|
8400
8414
|
const deps = Object.keys(parsed.dependencies ?? {});
|
|
8401
8415
|
const agentOnly = new Set(parsed.camstack?.agentOnlyBootstrapAddons ?? []);
|
|
@@ -8440,7 +8454,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8440
8454
|
} catch {
|
|
8441
8455
|
return Object.freeze([]);
|
|
8442
8456
|
}
|
|
8443
|
-
const raw = fs.readFileSync(pkgPath, "utf-8");
|
|
8457
|
+
const raw = fs$1.readFileSync(pkgPath, "utf-8");
|
|
8444
8458
|
const addons = JSON.parse(raw).camstack?.agentBootstrapAddons ?? [];
|
|
8445
8459
|
return Object.freeze(["@camstack/system", ...addons]);
|
|
8446
8460
|
}
|
|
@@ -8471,7 +8485,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8471
8485
|
}
|
|
8472
8486
|
for (const packageName of pkgList) {
|
|
8473
8487
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
8474
|
-
if (fs.existsSync(path$1.join(addonDir, "package.json"))) {
|
|
8488
|
+
if (fs$1.existsSync(path$1.join(addonDir, "package.json"))) {
|
|
8475
8489
|
this.logger.debug(`${packageName} — already installed, skipping`);
|
|
8476
8490
|
continue;
|
|
8477
8491
|
}
|
|
@@ -8556,7 +8570,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8556
8570
|
const installedPackages = this.listInstalled();
|
|
8557
8571
|
for (const pkg of installedPackages) {
|
|
8558
8572
|
try {
|
|
8559
|
-
if (fs.lstatSync(pkg.dir).isSymbolicLink()) continue;
|
|
8573
|
+
if (fs$1.lstatSync(pkg.dir).isSymbolicLink()) continue;
|
|
8560
8574
|
} catch {
|
|
8561
8575
|
continue;
|
|
8562
8576
|
}
|
|
@@ -8596,7 +8610,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8596
8610
|
if (closureNodeModules !== null) for (const link of state.existingLinks) {
|
|
8597
8611
|
if (!isClosureLinkTarget(link.target, closureNodeModules)) continue;
|
|
8598
8612
|
const linkDir = path$1.join(nodeModulesDir, link.name);
|
|
8599
|
-
const targetManifest = fs.existsSync(path$1.join(linkDir, "package.json"));
|
|
8613
|
+
const targetManifest = fs$1.existsSync(path$1.join(linkDir, "package.json"));
|
|
8600
8614
|
const ranges = state.requirements.get(link.name) ?? [];
|
|
8601
8615
|
let holds = targetManifest;
|
|
8602
8616
|
if (holds && ranges.length > 0) {
|
|
@@ -8605,14 +8619,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8605
8619
|
}
|
|
8606
8620
|
if (!holds) {
|
|
8607
8621
|
this.logger.warn(`${packageName} — closure link for ${link.name} no longer holds; reinstalling this addon's deps`, { meta: { target: link.target } });
|
|
8608
|
-
fs.rmSync(linkDir, { force: true });
|
|
8622
|
+
fs$1.rmSync(linkDir, { force: true });
|
|
8609
8623
|
needsInstall = true;
|
|
8610
8624
|
}
|
|
8611
8625
|
}
|
|
8612
8626
|
const linked = [];
|
|
8613
8627
|
for (const [depName, range] of declaredEntries) {
|
|
8614
8628
|
if (typeof range !== "string") continue;
|
|
8615
|
-
if (fs.existsSync(path$1.join(nodeModulesDir, depName, "package.json"))) continue;
|
|
8629
|
+
if (fs$1.existsSync(path$1.join(nodeModulesDir, depName, "package.json"))) continue;
|
|
8616
8630
|
const closureVersion = closureNodeModules === null ? void 0 : readClosureVersions(closureNodeModules, [depName]).get(depName);
|
|
8617
8631
|
if (closureNodeModules !== null && closureVersion !== void 0 && closureSatisfiesRange(range, closureVersion)) {
|
|
8618
8632
|
if (executeClosureDedupe(addonDir, closureNodeModules, {
|
|
@@ -8645,7 +8659,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8645
8659
|
const closureNodeModules = resolveClosureNodeModulesDir(this.closureNodeModulesDir);
|
|
8646
8660
|
if (closureNodeModules !== null) {
|
|
8647
8661
|
const state = collectAddonTreeState(addonDir);
|
|
8648
|
-
for (const link of state.existingLinks) if (isClosureLinkTarget(link.target, closureNodeModules)) fs.rmSync(path$1.join(addonDir, "node_modules", link.name), { force: true });
|
|
8662
|
+
for (const link of state.existingLinks) if (isClosureLinkTarget(link.target, closureNodeModules)) fs$1.rmSync(path$1.join(addonDir, "node_modules", link.name), { force: true });
|
|
8649
8663
|
}
|
|
8650
8664
|
this.logger.info(`${packageName} — reinstalling runtime dependencies`, { meta: { addonDir } });
|
|
8651
8665
|
await runNpm([
|
|
@@ -8704,7 +8718,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8704
8718
|
async realignFromClosure(packageName, closureDir) {
|
|
8705
8719
|
const targetDir = path$1.join(this.addonsDir, packageName);
|
|
8706
8720
|
const result = await this.installLocal(packageName, closureDir);
|
|
8707
|
-
await fs.promises.writeFile(path$1.join(targetDir, ".install-source"), "closure");
|
|
8721
|
+
await fs$1.promises.writeFile(path$1.join(targetDir, ".install-source"), "closure");
|
|
8708
8722
|
this.manifest.upsert(result.name, {
|
|
8709
8723
|
version: result.version,
|
|
8710
8724
|
source: "closure"
|
|
@@ -8739,12 +8753,12 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8739
8753
|
*/
|
|
8740
8754
|
async installSymlink(packageName, sourceDir, pkgData, targetDir) {
|
|
8741
8755
|
await this.ensureBuilt(packageName, sourceDir, pkgData);
|
|
8742
|
-
fs.rmSync(targetDir, {
|
|
8756
|
+
fs$1.rmSync(targetDir, {
|
|
8743
8757
|
recursive: true,
|
|
8744
8758
|
force: true
|
|
8745
8759
|
});
|
|
8746
8760
|
ensureDir(path$1.dirname(targetDir));
|
|
8747
|
-
fs.symlinkSync(sourceDir, targetDir, "dir");
|
|
8761
|
+
fs$1.symlinkSync(sourceDir, targetDir, "dir");
|
|
8748
8762
|
this.manifest.upsert(packageName, {
|
|
8749
8763
|
version: asString$1(pkgData.version, "0.0.0"),
|
|
8750
8764
|
source: "local"
|
|
@@ -8758,17 +8772,17 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8758
8772
|
async installCopy(packageName, sourceDir, pkgData, targetDir) {
|
|
8759
8773
|
await this.ensureBuilt(packageName, sourceDir, pkgData);
|
|
8760
8774
|
const distDir = path$1.join(sourceDir, "dist");
|
|
8761
|
-
if (!fs.existsSync(distDir)) throw new Error(`${packageName} has no dist/ after build`);
|
|
8762
|
-
await fs.promises.rm(targetDir, {
|
|
8775
|
+
if (!fs$1.existsSync(distDir)) throw new Error(`${packageName} has no dist/ after build`);
|
|
8776
|
+
await fs$1.promises.rm(targetDir, {
|
|
8763
8777
|
recursive: true,
|
|
8764
8778
|
force: true
|
|
8765
8779
|
});
|
|
8766
8780
|
ensureDir(targetDir);
|
|
8767
|
-
await fs.promises.writeFile(path$1.join(targetDir, "package.json"), JSON.stringify(stripBundledDeps(pkgData), null, 2));
|
|
8781
|
+
await fs$1.promises.writeFile(path$1.join(targetDir, "package.json"), JSON.stringify(stripBundledDeps(pkgData), null, 2));
|
|
8768
8782
|
await copyDirRecursive(distDir, path$1.join(targetDir, "dist"));
|
|
8769
8783
|
await copyExtraFileDirs(pkgData, sourceDir, targetDir);
|
|
8770
8784
|
copyBundledNativeModules(sourceDir, targetDir, this.logger);
|
|
8771
|
-
await fs.promises.writeFile(path$1.join(targetDir, ".install-source"), "local");
|
|
8785
|
+
await fs$1.promises.writeFile(path$1.join(targetDir, ".install-source"), "local");
|
|
8772
8786
|
const localPkgVersion = asString$1(pkgData.version, "0.0.0");
|
|
8773
8787
|
this.manifest.upsert(packageName, {
|
|
8774
8788
|
version: localPkgVersion,
|
|
@@ -8809,7 +8823,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8809
8823
|
* unusual auth, offline mode, etc).
|
|
8810
8824
|
*/
|
|
8811
8825
|
async installFromNpm(packageName, version) {
|
|
8812
|
-
const tmpDir = fs.mkdtempSync(path$1.join(os$1.tmpdir(), "camstack-addon-npm-"));
|
|
8826
|
+
const tmpDir = fs$1.mkdtempSync(path$1.join(os$1.tmpdir(), "camstack-addon-npm-"));
|
|
8813
8827
|
const packageSpec = version ? `${packageName}@${version}` : packageName;
|
|
8814
8828
|
this.logger.info(`${packageName} — installing from npm`);
|
|
8815
8829
|
try {
|
|
@@ -8823,19 +8837,19 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8823
8837
|
];
|
|
8824
8838
|
if (this.registry) args.push("--registry", this.registry);
|
|
8825
8839
|
const { stdout } = await runNpm(args, this.npmRunOptions(tmpDir, 12e4));
|
|
8826
|
-
const tgzFiles = fs.readdirSync(tmpDir).filter((f) => f.endsWith(".tgz"));
|
|
8840
|
+
const tgzFiles = fs$1.readdirSync(tmpDir).filter((f) => f.endsWith(".tgz"));
|
|
8827
8841
|
if (tgzFiles.length === 0) throw new Error(`npm pack produced no tgz. stdout: ${stdout.trim()}`);
|
|
8828
8842
|
return path$1.join(tmpDir, tgzFiles[0]);
|
|
8829
8843
|
});
|
|
8830
8844
|
const result = await this.installFromTgz(tgzPath);
|
|
8831
|
-
fs.writeFileSync(path$1.join(this.addonsDir, result.name, ".install-source"), "npm");
|
|
8845
|
+
fs$1.writeFileSync(path$1.join(this.addonsDir, result.name, ".install-source"), "npm");
|
|
8832
8846
|
this.manifest.upsert(result.name, {
|
|
8833
8847
|
version: result.version,
|
|
8834
8848
|
source: "npm"
|
|
8835
8849
|
});
|
|
8836
8850
|
return result;
|
|
8837
8851
|
} finally {
|
|
8838
|
-
fs.rmSync(tmpDir, {
|
|
8852
|
+
fs$1.rmSync(tmpDir, {
|
|
8839
8853
|
recursive: true,
|
|
8840
8854
|
force: true
|
|
8841
8855
|
});
|
|
@@ -8873,7 +8887,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8873
8887
|
if (!tarRes.ok) throw new Error(`tarball GET ${tarballUrl} → ${tarRes.status}`);
|
|
8874
8888
|
const tgzPath = path$1.join(tmpDir, `${packageName.replace(/[/@]/g, "-").replace(/^-+/, "")}-${resolvedVersion}.tgz`);
|
|
8875
8889
|
const buf = Buffer.from(await tarRes.arrayBuffer());
|
|
8876
|
-
fs.writeFileSync(tgzPath, buf);
|
|
8890
|
+
fs$1.writeFileSync(tgzPath, buf);
|
|
8877
8891
|
return tgzPath;
|
|
8878
8892
|
}
|
|
8879
8893
|
/**
|
|
@@ -8894,7 +8908,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8894
8908
|
* on the next deploy.
|
|
8895
8909
|
*/
|
|
8896
8910
|
async evictInstallDir(targetDir) {
|
|
8897
|
-
if (!fs.existsSync(targetDir)) return;
|
|
8911
|
+
if (!fs$1.existsSync(targetDir)) return;
|
|
8898
8912
|
const graveyard = path$1.join(this.addonsDir, ".evicting");
|
|
8899
8913
|
ensureDir(graveyard);
|
|
8900
8914
|
await this.sweepGraveyard(graveyard);
|
|
@@ -8902,10 +8916,10 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8902
8916
|
const flatName = path$1.relative(this.addonsDir, targetDir).replace(/[/\\]/g, "-");
|
|
8903
8917
|
const asideDir = path$1.join(graveyard, `${flatName}-${ts}`);
|
|
8904
8918
|
try {
|
|
8905
|
-
fs.renameSync(targetDir, asideDir);
|
|
8919
|
+
fs$1.renameSync(targetDir, asideDir);
|
|
8906
8920
|
} catch (renameErr) {
|
|
8907
8921
|
if (renameErr.code === "EXDEV") {
|
|
8908
|
-
await fs.promises.rm(targetDir, {
|
|
8922
|
+
await fs$1.promises.rm(targetDir, {
|
|
8909
8923
|
recursive: true,
|
|
8910
8924
|
force: true
|
|
8911
8925
|
});
|
|
@@ -8913,7 +8927,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8913
8927
|
}
|
|
8914
8928
|
throw renameErr;
|
|
8915
8929
|
}
|
|
8916
|
-
await fs.promises.rm(asideDir, {
|
|
8930
|
+
await fs$1.promises.rm(asideDir, {
|
|
8917
8931
|
recursive: true,
|
|
8918
8932
|
force: true
|
|
8919
8933
|
}).catch((cleanupErr) => {
|
|
@@ -8934,14 +8948,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8934
8948
|
async sweepStagingResidue(stagingRoot) {
|
|
8935
8949
|
let names;
|
|
8936
8950
|
try {
|
|
8937
|
-
names = fs.readdirSync(stagingRoot);
|
|
8951
|
+
names = fs$1.readdirSync(stagingRoot);
|
|
8938
8952
|
} catch {
|
|
8939
8953
|
return;
|
|
8940
8954
|
}
|
|
8941
8955
|
const now = Date.now();
|
|
8942
8956
|
const ages = [];
|
|
8943
8957
|
for (const name of names) try {
|
|
8944
|
-
const stat = fs.statSync(path$1.join(stagingRoot, name));
|
|
8958
|
+
const stat = fs$1.statSync(path$1.join(stagingRoot, name));
|
|
8945
8959
|
ages.push({
|
|
8946
8960
|
name,
|
|
8947
8961
|
ageMs: now - stat.mtimeMs
|
|
@@ -8952,7 +8966,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8952
8966
|
stagingRoot,
|
|
8953
8967
|
entries: sweepable
|
|
8954
8968
|
} });
|
|
8955
|
-
await Promise.all(sweepable.map((name) => fs.promises.rm(path$1.join(stagingRoot, name), {
|
|
8969
|
+
await Promise.all(sweepable.map((name) => fs$1.promises.rm(path$1.join(stagingRoot, name), {
|
|
8956
8970
|
recursive: true,
|
|
8957
8971
|
force: true
|
|
8958
8972
|
}).catch(() => void 0)));
|
|
@@ -8961,11 +8975,11 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8961
8975
|
async sweepGraveyard(graveyard) {
|
|
8962
8976
|
let entries;
|
|
8963
8977
|
try {
|
|
8964
|
-
entries = fs.readdirSync(graveyard);
|
|
8978
|
+
entries = fs$1.readdirSync(graveyard);
|
|
8965
8979
|
} catch {
|
|
8966
8980
|
return;
|
|
8967
8981
|
}
|
|
8968
|
-
await Promise.all(entries.map((name) => fs.promises.rm(path$1.join(graveyard, name), {
|
|
8982
|
+
await Promise.all(entries.map((name) => fs$1.promises.rm(path$1.join(graveyard, name), {
|
|
8969
8983
|
recursive: true,
|
|
8970
8984
|
force: true
|
|
8971
8985
|
}).catch(() => void 0)));
|
|
@@ -9016,7 +9030,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9016
9030
|
return;
|
|
9017
9031
|
}
|
|
9018
9032
|
const strippedManifest = stripBundledDeps(pkgView.raw);
|
|
9019
|
-
await fs.promises.writeFile(pkgJsonPath, JSON.stringify(strippedManifest, null, 2));
|
|
9033
|
+
await fs$1.promises.writeFile(pkgJsonPath, JSON.stringify(strippedManifest, null, 2));
|
|
9020
9034
|
const deps = asJsonObject$1(strippedManifest["dependencies"]);
|
|
9021
9035
|
const depNames = deps ? Object.keys(deps) : [];
|
|
9022
9036
|
if (depNames.length === 0) return;
|
|
@@ -9148,9 +9162,9 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9148
9162
|
"-C",
|
|
9149
9163
|
stagingDir
|
|
9150
9164
|
], { timeout: 12e4 });
|
|
9151
|
-
const pkgDir = fs.existsSync(path$1.join(stagingDir, "package", "package.json")) ? path$1.join(stagingDir, "package") : stagingDir;
|
|
9165
|
+
const pkgDir = fs$1.existsSync(path$1.join(stagingDir, "package", "package.json")) ? path$1.join(stagingDir, "package") : stagingDir;
|
|
9152
9166
|
const pkgJsonPath = path$1.join(pkgDir, "package.json");
|
|
9153
|
-
if (!fs.existsSync(pkgJsonPath)) throw new Error("No package.json found in tgz archive");
|
|
9167
|
+
if (!fs$1.existsSync(pkgJsonPath)) throw new Error("No package.json found in tgz archive");
|
|
9154
9168
|
const pkgView = readPackageJson(pkgJsonPath);
|
|
9155
9169
|
if (!pkgView) throw new Error(`Invalid package.json at ${pkgJsonPath}`);
|
|
9156
9170
|
if (!pkgView.camstackAddons) throw new Error(`Package ${pkgView.name} has no camstack.addons manifest`);
|
|
@@ -9160,7 +9174,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9160
9174
|
this.dedupeTreeAgainstClosure(pkgDir, pkgView.name);
|
|
9161
9175
|
await this.evictInstallDir(targetDir);
|
|
9162
9176
|
ensureDir(path$1.dirname(targetDir));
|
|
9163
|
-
await fs.promises.rename(pkgDir, targetDir);
|
|
9177
|
+
await fs$1.promises.rename(pkgDir, targetDir);
|
|
9164
9178
|
this.manifest.upsert(pkgView.name, {
|
|
9165
9179
|
version: pkgView.version,
|
|
9166
9180
|
source: "bundled"
|
|
@@ -9171,7 +9185,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9171
9185
|
};
|
|
9172
9186
|
} finally {
|
|
9173
9187
|
this.inFlightStaging.delete(stagingName);
|
|
9174
|
-
await fs.promises.rm(stagingDir, {
|
|
9188
|
+
await fs$1.promises.rm(stagingDir, {
|
|
9175
9189
|
recursive: true,
|
|
9176
9190
|
force: true
|
|
9177
9191
|
}).catch(() => void 0);
|
|
@@ -9201,13 +9215,13 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9201
9215
|
const current = this.manifest.get(packageName);
|
|
9202
9216
|
if (current == null) throw new Error(`Cannot update ${packageName}: not currently tracked in manifest`);
|
|
9203
9217
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9204
|
-
if (!fs.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9218
|
+
if (!fs$1.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9205
9219
|
const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
9206
9220
|
const backupRoot = path$1.join(this.addonsDir, ".backups", packageName);
|
|
9207
9221
|
ensureDir(backupRoot);
|
|
9208
9222
|
const backupDir = path$1.join(backupRoot, ts);
|
|
9209
9223
|
this.logger.info(`${packageName} — backing up v${current.version} → ${backupDir}`);
|
|
9210
|
-
fs.renameSync(addonDir, backupDir);
|
|
9224
|
+
fs$1.renameSync(addonDir, backupDir);
|
|
9211
9225
|
let result;
|
|
9212
9226
|
try {
|
|
9213
9227
|
if (this.installSource === "local" || this.installSource === "symlink") {
|
|
@@ -9222,11 +9236,11 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9222
9236
|
} catch (installErr) {
|
|
9223
9237
|
this.logger.error(`${packageName} — install failed, restoring backup`, { meta: { error: errMsg$1(installErr) } });
|
|
9224
9238
|
try {
|
|
9225
|
-
if (fs.existsSync(addonDir)) fs.rmSync(addonDir, {
|
|
9239
|
+
if (fs$1.existsSync(addonDir)) fs$1.rmSync(addonDir, {
|
|
9226
9240
|
recursive: true,
|
|
9227
9241
|
force: true
|
|
9228
9242
|
});
|
|
9229
|
-
fs.renameSync(backupDir, addonDir);
|
|
9243
|
+
fs$1.renameSync(backupDir, addonDir);
|
|
9230
9244
|
this.manifest.upsert(packageName, {
|
|
9231
9245
|
version: current.version,
|
|
9232
9246
|
source: current.source,
|
|
@@ -9287,7 +9301,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9287
9301
|
const current = this.manifest.get(packageName);
|
|
9288
9302
|
if (current == null) throw new Error(`Cannot update ${packageName}: not currently tracked in manifest`);
|
|
9289
9303
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9290
|
-
if (!fs.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9304
|
+
if (!fs$1.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9291
9305
|
await this.installRuntimeDependencies(stagedPath, packageName);
|
|
9292
9306
|
await this.installNativeDependencies(stagedPath, packageName);
|
|
9293
9307
|
this.dedupeTreeAgainstClosure(stagedPath, packageName);
|
|
@@ -9296,14 +9310,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9296
9310
|
ensureDir(backupRoot);
|
|
9297
9311
|
const backupDir = path$1.join(backupRoot, ts);
|
|
9298
9312
|
this.logger.info(`${packageName} — backing up v${current.version} → ${backupDir}`);
|
|
9299
|
-
fs.renameSync(addonDir, backupDir);
|
|
9313
|
+
fs$1.renameSync(addonDir, backupDir);
|
|
9300
9314
|
try {
|
|
9301
9315
|
try {
|
|
9302
|
-
fs.renameSync(stagedPath, addonDir);
|
|
9316
|
+
fs$1.renameSync(stagedPath, addonDir);
|
|
9303
9317
|
} catch (renameErr) {
|
|
9304
9318
|
if (renameErr.code === "EXDEV") {
|
|
9305
|
-
fs.cpSync(stagedPath, addonDir, { recursive: true });
|
|
9306
|
-
fs.rmSync(stagedPath, {
|
|
9319
|
+
fs$1.cpSync(stagedPath, addonDir, { recursive: true });
|
|
9320
|
+
fs$1.rmSync(stagedPath, {
|
|
9307
9321
|
recursive: true,
|
|
9308
9322
|
force: true
|
|
9309
9323
|
});
|
|
@@ -9312,11 +9326,11 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9312
9326
|
} catch (swapErr) {
|
|
9313
9327
|
this.logger.error(`${packageName} — staged swap failed, restoring backup`, { meta: { error: errMsg$1(swapErr) } });
|
|
9314
9328
|
try {
|
|
9315
|
-
if (fs.existsSync(addonDir)) fs.rmSync(addonDir, {
|
|
9329
|
+
if (fs$1.existsSync(addonDir)) fs$1.rmSync(addonDir, {
|
|
9316
9330
|
recursive: true,
|
|
9317
9331
|
force: true
|
|
9318
9332
|
});
|
|
9319
|
-
fs.renameSync(backupDir, addonDir);
|
|
9333
|
+
fs$1.renameSync(backupDir, addonDir);
|
|
9320
9334
|
this.manifest.upsert(packageName, {
|
|
9321
9335
|
version: current.version,
|
|
9322
9336
|
source: current.source,
|
|
@@ -9355,20 +9369,20 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9355
9369
|
this.logger.warn(`${packageName} — no backup to rollback to`);
|
|
9356
9370
|
return null;
|
|
9357
9371
|
}
|
|
9358
|
-
if (!fs.existsSync(entry.lastBackupDir)) {
|
|
9372
|
+
if (!fs$1.existsSync(entry.lastBackupDir)) {
|
|
9359
9373
|
this.logger.warn(`${packageName} — backup dir vanished: ${entry.lastBackupDir}`);
|
|
9360
9374
|
return null;
|
|
9361
9375
|
}
|
|
9362
9376
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9363
|
-
if (fs.existsSync(addonDir)) fs.rmSync(addonDir, {
|
|
9377
|
+
if (fs$1.existsSync(addonDir)) fs$1.rmSync(addonDir, {
|
|
9364
9378
|
recursive: true,
|
|
9365
9379
|
force: true
|
|
9366
9380
|
});
|
|
9367
|
-
fs.renameSync(entry.lastBackupDir, addonDir);
|
|
9381
|
+
fs$1.renameSync(entry.lastBackupDir, addonDir);
|
|
9368
9382
|
const pkgJsonPath = path$1.join(addonDir, "package.json");
|
|
9369
9383
|
let restoredVersion = entry.version;
|
|
9370
|
-
if (fs.existsSync(pkgJsonPath)) try {
|
|
9371
|
-
const parsed = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
9384
|
+
if (fs$1.existsSync(pkgJsonPath)) try {
|
|
9385
|
+
const parsed = JSON.parse(fs$1.readFileSync(pkgJsonPath, "utf-8"));
|
|
9372
9386
|
if (typeof parsed === "object" && parsed != null) {
|
|
9373
9387
|
const v = parsed.version;
|
|
9374
9388
|
if (typeof v === "string" && v.length > 0) restoredVersion = v;
|
|
@@ -9416,7 +9430,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9416
9430
|
return false;
|
|
9417
9431
|
}
|
|
9418
9432
|
try {
|
|
9419
|
-
await fs.promises.rm(target, {
|
|
9433
|
+
await fs$1.promises.rm(target, {
|
|
9420
9434
|
recursive: true,
|
|
9421
9435
|
force: true
|
|
9422
9436
|
});
|
|
@@ -9434,7 +9448,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9434
9448
|
listBackupsFor(packageName) {
|
|
9435
9449
|
const dir = path$1.join(this.backupsRoot, packageName);
|
|
9436
9450
|
try {
|
|
9437
|
-
return fs.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => path$1.join(dir, e.name)).sort();
|
|
9451
|
+
return fs$1.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => path$1.join(dir, e.name)).sort();
|
|
9438
9452
|
} catch {
|
|
9439
9453
|
return [];
|
|
9440
9454
|
}
|
|
@@ -9466,7 +9480,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9466
9480
|
for (const dir of [pkgDir, path$1.dirname(pkgDir)]) {
|
|
9467
9481
|
if (!this.isInsideBackups(dir)) continue;
|
|
9468
9482
|
try {
|
|
9469
|
-
await fs.promises.rmdir(dir);
|
|
9483
|
+
await fs$1.promises.rmdir(dir);
|
|
9470
9484
|
} catch {
|
|
9471
9485
|
return;
|
|
9472
9486
|
}
|
|
@@ -9548,7 +9562,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9548
9562
|
*/
|
|
9549
9563
|
resolveBackupToKeep(packageName, backups) {
|
|
9550
9564
|
const liveDir = path$1.join(this.addonsDir, packageName);
|
|
9551
|
-
if (!fs.existsSync(liveDir)) {
|
|
9565
|
+
if (!fs$1.existsSync(liveDir)) {
|
|
9552
9566
|
const newest = backups[backups.length - 1] ?? null;
|
|
9553
9567
|
if (newest != null) this.logger.warn(`${packageName} — live install dir missing; retaining its newest backup as the only surviving copy`, { meta: {
|
|
9554
9568
|
liveDir,
|
|
@@ -9565,7 +9579,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9565
9579
|
listBackedUpPackages() {
|
|
9566
9580
|
let entries;
|
|
9567
9581
|
try {
|
|
9568
|
-
entries = fs.readdirSync(this.backupsRoot, { withFileTypes: true });
|
|
9582
|
+
entries = fs$1.readdirSync(this.backupsRoot, { withFileTypes: true });
|
|
9569
9583
|
} catch {
|
|
9570
9584
|
return [];
|
|
9571
9585
|
}
|
|
@@ -9577,14 +9591,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9577
9591
|
continue;
|
|
9578
9592
|
}
|
|
9579
9593
|
const scopeDir = path$1.join(this.backupsRoot, entry.name);
|
|
9580
|
-
for (const inner of fs.readdirSync(scopeDir, { withFileTypes: true })) if (inner.isDirectory()) names.push(`${entry.name}/${inner.name}`);
|
|
9594
|
+
for (const inner of fs$1.readdirSync(scopeDir, { withFileTypes: true })) if (inner.isDirectory()) names.push(`${entry.name}/${inner.name}`);
|
|
9581
9595
|
}
|
|
9582
9596
|
return names;
|
|
9583
9597
|
}
|
|
9584
9598
|
async uninstall(packageName) {
|
|
9585
9599
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9586
|
-
if (fs.existsSync(addonDir)) {
|
|
9587
|
-
fs.rmSync(addonDir, {
|
|
9600
|
+
if (fs$1.existsSync(addonDir)) {
|
|
9601
|
+
fs$1.rmSync(addonDir, {
|
|
9588
9602
|
recursive: true,
|
|
9589
9603
|
force: true
|
|
9590
9604
|
});
|
|
@@ -9592,8 +9606,8 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9592
9606
|
return;
|
|
9593
9607
|
}
|
|
9594
9608
|
const legacyDir = path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""));
|
|
9595
|
-
if (fs.existsSync(legacyDir)) {
|
|
9596
|
-
fs.rmSync(legacyDir, {
|
|
9609
|
+
if (fs$1.existsSync(legacyDir)) {
|
|
9610
|
+
fs$1.rmSync(legacyDir, {
|
|
9597
9611
|
recursive: true,
|
|
9598
9612
|
force: true
|
|
9599
9613
|
});
|
|
@@ -9601,22 +9615,22 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9601
9615
|
}
|
|
9602
9616
|
}
|
|
9603
9617
|
listInstalled() {
|
|
9604
|
-
if (!fs.existsSync(this.addonsDir)) return [];
|
|
9618
|
+
if (!fs$1.existsSync(this.addonsDir)) return [];
|
|
9605
9619
|
const packageDirs = [];
|
|
9606
|
-
for (const entry of fs.readdirSync(this.addonsDir, { withFileTypes: true })) {
|
|
9620
|
+
for (const entry of fs$1.readdirSync(this.addonsDir, { withFileTypes: true })) {
|
|
9607
9621
|
if (!isDirEntry(entry, this.addonsDir)) continue;
|
|
9608
9622
|
if (entry.name.startsWith("@")) {
|
|
9609
9623
|
const scopeDir = path$1.join(this.addonsDir, entry.name);
|
|
9610
|
-
for (const inner of fs.readdirSync(scopeDir, { withFileTypes: true })) if (isDirEntry(inner, scopeDir)) packageDirs.push(path$1.join(scopeDir, inner.name));
|
|
9624
|
+
for (const inner of fs$1.readdirSync(scopeDir, { withFileTypes: true })) if (isDirEntry(inner, scopeDir)) packageDirs.push(path$1.join(scopeDir, inner.name));
|
|
9611
9625
|
} else packageDirs.push(path$1.join(this.addonsDir, entry.name));
|
|
9612
9626
|
}
|
|
9613
9627
|
return packageDirs.map((dir) => {
|
|
9614
9628
|
const pkgPath = path$1.join(dir, "package.json");
|
|
9615
|
-
if (!fs.existsSync(pkgPath)) return null;
|
|
9629
|
+
if (!fs$1.existsSync(pkgPath)) return null;
|
|
9616
9630
|
const pkg = readPackageJson(pkgPath);
|
|
9617
9631
|
if (!pkg || !pkg.camstackAddons) return null;
|
|
9618
9632
|
const sourceFile = path$1.join(dir, ".install-source");
|
|
9619
|
-
const installSource = fs.existsSync(sourceFile) ? parseInstallSource(fs.readFileSync(sourceFile, "utf-8").trim()) : void 0;
|
|
9633
|
+
const installSource = fs$1.existsSync(sourceFile) ? parseInstallSource(fs$1.readFileSync(sourceFile, "utf-8").trim()) : void 0;
|
|
9620
9634
|
return {
|
|
9621
9635
|
name: pkg.name,
|
|
9622
9636
|
version: pkg.version,
|
|
@@ -9626,13 +9640,13 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9626
9640
|
}).filter((item) => item !== null);
|
|
9627
9641
|
}
|
|
9628
9642
|
isInstalled(packageName) {
|
|
9629
|
-
if (fs.existsSync(path$1.join(this.addonsDir, packageName, "package.json"))) return true;
|
|
9630
|
-
return fs.existsSync(path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json"));
|
|
9643
|
+
if (fs$1.existsSync(path$1.join(this.addonsDir, packageName, "package.json"))) return true;
|
|
9644
|
+
return fs$1.existsSync(path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json"));
|
|
9631
9645
|
}
|
|
9632
9646
|
getInstalledPackage(packageName) {
|
|
9633
9647
|
let pkgPath = path$1.join(this.addonsDir, packageName, "package.json");
|
|
9634
|
-
if (!fs.existsSync(pkgPath)) pkgPath = path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json");
|
|
9635
|
-
if (!fs.existsSync(pkgPath)) return null;
|
|
9648
|
+
if (!fs$1.existsSync(pkgPath)) pkgPath = path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json");
|
|
9649
|
+
if (!fs$1.existsSync(pkgPath)) return null;
|
|
9636
9650
|
const pkg = readPackageJson(pkgPath);
|
|
9637
9651
|
if (!pkg) return null;
|
|
9638
9652
|
return {
|
|
@@ -9651,7 +9665,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9651
9665
|
]) {
|
|
9652
9666
|
const candidate = path$1.join(this.workspaceDir, dirName);
|
|
9653
9667
|
try {
|
|
9654
|
-
const pkg = asJsonObject$1(parseJsonUnknown(fs.readFileSync(path$1.join(candidate, "package.json"), "utf-8")));
|
|
9668
|
+
const pkg = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(path$1.join(candidate, "package.json"), "utf-8")));
|
|
9655
9669
|
if (pkg && asString$1(pkg["name"]) === packageName) return candidate;
|
|
9656
9670
|
} catch {}
|
|
9657
9671
|
}
|
|
@@ -9660,7 +9674,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9660
9674
|
/** Ensure a package is built (dist/ exists and page bundles present) */
|
|
9661
9675
|
async ensureBuilt(packageName, sourceDir, pkgData) {
|
|
9662
9676
|
const distDir = path$1.join(sourceDir, "dist");
|
|
9663
|
-
if (!(!fs.existsSync(distDir) || this.isDistIncomplete(pkgData, sourceDir))) return;
|
|
9677
|
+
if (!(!fs$1.existsSync(distDir) || this.isDistIncomplete(pkgData, sourceDir))) return;
|
|
9664
9678
|
this.logger.info(`${packageName} — building (dist/ missing or incomplete)`);
|
|
9665
9679
|
try {
|
|
9666
9680
|
await runNpm(["run", "build"], this.npmRunOptions(sourceDir, 18e4));
|
|
@@ -9675,7 +9689,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9675
9689
|
if (!camstack?.addons) return false;
|
|
9676
9690
|
for (const addon of camstack.addons) {
|
|
9677
9691
|
if (!addon.pages) continue;
|
|
9678
|
-
for (const page of addon.pages) if (page.bundle && !fs.existsSync(path$1.join(sourceDir, "dist", page.bundle))) return true;
|
|
9692
|
+
for (const page of addon.pages) if (page.bundle && !fs$1.existsSync(path$1.join(sourceDir, "dist", page.bundle))) return true;
|
|
9679
9693
|
}
|
|
9680
9694
|
return false;
|
|
9681
9695
|
}
|
|
@@ -9684,7 +9698,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9684
9698
|
function isDirEntry(entry, parentDir) {
|
|
9685
9699
|
if (entry.isDirectory()) return true;
|
|
9686
9700
|
if (entry.isSymbolicLink()) try {
|
|
9687
|
-
return fs.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
9701
|
+
return fs$1.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
9688
9702
|
} catch {
|
|
9689
9703
|
return false;
|
|
9690
9704
|
}
|
|
@@ -9783,7 +9797,7 @@ function selectAddonResidue(candidates) {
|
|
|
9783
9797
|
}
|
|
9784
9798
|
function readDeclaredName(dir) {
|
|
9785
9799
|
try {
|
|
9786
|
-
const parsed = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
9800
|
+
const parsed = JSON.parse(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
9787
9801
|
if (typeof parsed !== "object" || parsed === null) return null;
|
|
9788
9802
|
const name = parsed.name;
|
|
9789
9803
|
return typeof name === "string" ? name : null;
|
|
@@ -9793,7 +9807,7 @@ function readDeclaredName(dir) {
|
|
|
9793
9807
|
}
|
|
9794
9808
|
function readDeclaredVersion(dir) {
|
|
9795
9809
|
try {
|
|
9796
|
-
const parsed = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
9810
|
+
const parsed = JSON.parse(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
9797
9811
|
if (typeof parsed !== "object" || parsed === null) return null;
|
|
9798
9812
|
const version = parsed.version;
|
|
9799
9813
|
return typeof version === "string" ? version : null;
|
|
@@ -9803,7 +9817,7 @@ function readDeclaredVersion(dir) {
|
|
|
9803
9817
|
}
|
|
9804
9818
|
function isDirLike(p) {
|
|
9805
9819
|
try {
|
|
9806
|
-
return fs.statSync(p).isDirectory();
|
|
9820
|
+
return fs$1.statSync(p).isDirectory();
|
|
9807
9821
|
} catch {
|
|
9808
9822
|
return false;
|
|
9809
9823
|
}
|
|
@@ -9813,7 +9827,7 @@ function freeQuarantineTarget(store, scope, dirName) {
|
|
|
9813
9827
|
const base = scope === null ? dirName : `${scope.replace("@", "")}__${dirName}`;
|
|
9814
9828
|
let candidate = path$1.join(store, base);
|
|
9815
9829
|
let n = 1;
|
|
9816
|
-
while (fs.existsSync(candidate)) {
|
|
9830
|
+
while (fs$1.existsSync(candidate)) {
|
|
9817
9831
|
candidate = path$1.join(store, `${base}-${n}`);
|
|
9818
9832
|
n += 1;
|
|
9819
9833
|
}
|
|
@@ -9830,7 +9844,7 @@ function freeQuarantineTarget(store, scope, dirName) {
|
|
|
9830
9844
|
function quarantineAddonResidue(addonsDir, log) {
|
|
9831
9845
|
const quarantined = [];
|
|
9832
9846
|
const failed = [];
|
|
9833
|
-
if (!fs.existsSync(addonsDir)) return {
|
|
9847
|
+
if (!fs$1.existsSync(addonsDir)) return {
|
|
9834
9848
|
quarantined,
|
|
9835
9849
|
failed
|
|
9836
9850
|
};
|
|
@@ -9838,7 +9852,7 @@ function quarantineAddonResidue(addonsDir, log) {
|
|
|
9838
9852
|
const scan = (parent, scope) => {
|
|
9839
9853
|
let names;
|
|
9840
9854
|
try {
|
|
9841
|
-
names = fs.readdirSync(parent);
|
|
9855
|
+
names = fs$1.readdirSync(parent);
|
|
9842
9856
|
} catch {
|
|
9843
9857
|
return;
|
|
9844
9858
|
}
|
|
@@ -9857,8 +9871,8 @@ function quarantineAddonResidue(addonsDir, log) {
|
|
|
9857
9871
|
const version = readDeclaredVersion(full);
|
|
9858
9872
|
const to = freeQuarantineTarget(store, scope, dirName);
|
|
9859
9873
|
try {
|
|
9860
|
-
fs.mkdirSync(store, { recursive: true });
|
|
9861
|
-
fs.renameSync(full, to);
|
|
9874
|
+
fs$1.mkdirSync(store, { recursive: true });
|
|
9875
|
+
fs$1.renameSync(full, to);
|
|
9862
9876
|
} catch (err) {
|
|
9863
9877
|
const error = err instanceof Error ? err.message : String(err);
|
|
9864
9878
|
failed.push({
|
|
@@ -9899,8 +9913,8 @@ function detectWorkspacePackagesDir(startDir) {
|
|
|
9899
9913
|
current = path$1.dirname(current);
|
|
9900
9914
|
const packagesDir = path$1.join(current, "packages");
|
|
9901
9915
|
const rootPkgJson = path$1.join(current, "package.json");
|
|
9902
|
-
if (fs.existsSync(packagesDir) && fs.existsSync(rootPkgJson)) try {
|
|
9903
|
-
const rootPkg = JSON.parse(fs.readFileSync(rootPkgJson, "utf-8"));
|
|
9916
|
+
if (fs$1.existsSync(packagesDir) && fs$1.existsSync(rootPkgJson)) try {
|
|
9917
|
+
const rootPkg = JSON.parse(fs$1.readFileSync(rootPkgJson, "utf-8"));
|
|
9904
9918
|
if (rootPkg.workspaces || rootPkg.name === "camstack-server" || rootPkg.name === "camstack") return packagesDir;
|
|
9905
9919
|
} catch {}
|
|
9906
9920
|
}
|
|
@@ -9939,11 +9953,11 @@ function getRestartMarkerPath(dataDir) {
|
|
|
9939
9953
|
* intact or no marker at all (never a half-written file).
|
|
9940
9954
|
*/
|
|
9941
9955
|
function writePendingRestart(dataDir, marker) {
|
|
9942
|
-
fs.mkdirSync(dataDir, { recursive: true });
|
|
9956
|
+
fs$1.mkdirSync(dataDir, { recursive: true });
|
|
9943
9957
|
const markerPath = getRestartMarkerPath(dataDir);
|
|
9944
9958
|
const tmpPath = `${markerPath}.tmp`;
|
|
9945
|
-
fs.writeFileSync(tmpPath, JSON.stringify(marker, null, 2), "utf-8");
|
|
9946
|
-
fs.renameSync(tmpPath, markerPath);
|
|
9959
|
+
fs$1.writeFileSync(tmpPath, JSON.stringify(marker, null, 2), "utf-8");
|
|
9960
|
+
fs$1.renameSync(tmpPath, markerPath);
|
|
9947
9961
|
}
|
|
9948
9962
|
/**
|
|
9949
9963
|
* Read + consume the marker. Returns the parsed payload on success and
|
|
@@ -9968,10 +9982,10 @@ function writePendingRestart(dataDir, marker) {
|
|
|
9968
9982
|
*/
|
|
9969
9983
|
function readPendingRestart(dataDir) {
|
|
9970
9984
|
const markerPath = getRestartMarkerPath(dataDir);
|
|
9971
|
-
if (!fs.existsSync(markerPath)) return null;
|
|
9985
|
+
if (!fs$1.existsSync(markerPath)) return null;
|
|
9972
9986
|
let raw;
|
|
9973
9987
|
try {
|
|
9974
|
-
raw = fs.readFileSync(markerPath, "utf-8");
|
|
9988
|
+
raw = fs$1.readFileSync(markerPath, "utf-8");
|
|
9975
9989
|
} catch (err) {
|
|
9976
9990
|
console.error("[restart-coordinator] Marker unreadable — leaving in place:", err);
|
|
9977
9991
|
return null;
|
|
@@ -10010,7 +10024,7 @@ function readPendingRestart(dataDir) {
|
|
|
10010
10024
|
/** Remove the marker if present. No-op if missing. */
|
|
10011
10025
|
function clearPendingRestart(dataDir) {
|
|
10012
10026
|
const markerPath = getRestartMarkerPath(dataDir);
|
|
10013
|
-
fs.rmSync(markerPath, { force: true });
|
|
10027
|
+
fs$1.rmSync(markerPath, { force: true });
|
|
10014
10028
|
}
|
|
10015
10029
|
function isRestartKind(value) {
|
|
10016
10030
|
return value === "framework-update" || value === "manual" || value === "system";
|
|
@@ -10022,7 +10036,7 @@ function scheduleSelfRestart(options = {}) {
|
|
|
10022
10036
|
const touchTarget = process.env["CAMSTACK_RESTART_TOUCH_FILE"];
|
|
10023
10037
|
if (touchTarget !== void 0 && touchTarget.length > 0) try {
|
|
10024
10038
|
const now = /* @__PURE__ */ new Date();
|
|
10025
|
-
fs.utimesSync(touchTarget, now, now);
|
|
10039
|
+
fs$1.utimesSync(touchTarget, now, now);
|
|
10026
10040
|
return;
|
|
10027
10041
|
} catch (err) {
|
|
10028
10042
|
console.error("[restart-coordinator] dev touch-reload failed; falling through to process exit:", err);
|
|
@@ -14389,7 +14403,7 @@ function loadBootstrapConfig(configPath) {
|
|
|
14389
14403
|
function writeBootstrapSection(configPath, section, data) {
|
|
14390
14404
|
if (!BOOTSTRAP_SECTIONS.has(section)) throw new Error(`[ConfigManager] Section "${section}" is a runtime setting — use setSection() to persist via the settings-store, not update() which writes to config.yaml`);
|
|
14391
14405
|
let raw = {};
|
|
14392
|
-
if (fs.existsSync(configPath)) raw = asJsonObject(load(fs.readFileSync(configPath, "utf-8"))) ?? {};
|
|
14406
|
+
if (fs$1.existsSync(configPath)) raw = asJsonObject(load(fs$1.readFileSync(configPath, "utf-8"))) ?? {};
|
|
14393
14407
|
const existing = asJsonObject(raw[section]) ?? {};
|
|
14394
14408
|
raw[section] = {
|
|
14395
14409
|
...existing,
|
|
@@ -14398,12 +14412,12 @@ function writeBootstrapSection(configPath, section, data) {
|
|
|
14398
14412
|
const validation = bootstrapSchema.safeParse(raw);
|
|
14399
14413
|
if (!validation.success) throw new Error(`[ConfigManager] Invalid config update for section "${section}": ${validation.error.message}`);
|
|
14400
14414
|
const tmpPath = `${configPath}.tmp`;
|
|
14401
|
-
fs.writeFileSync(tmpPath, dump(raw, {
|
|
14415
|
+
fs$1.writeFileSync(tmpPath, dump(raw, {
|
|
14402
14416
|
lineWidth: 120,
|
|
14403
14417
|
indent: 2,
|
|
14404
14418
|
quotingType: "\""
|
|
14405
14419
|
}), "utf-8");
|
|
14406
|
-
fs.renameSync(tmpPath, configPath);
|
|
14420
|
+
fs$1.renameSync(tmpPath, configPath);
|
|
14407
14421
|
return validation.data;
|
|
14408
14422
|
}
|
|
14409
14423
|
/**
|
|
@@ -14474,11 +14488,11 @@ function applyEnvOverrides(raw) {
|
|
|
14474
14488
|
return result;
|
|
14475
14489
|
}
|
|
14476
14490
|
function loadYaml(configPath) {
|
|
14477
|
-
if (!fs.existsSync(configPath)) {
|
|
14491
|
+
if (!fs$1.existsSync(configPath)) {
|
|
14478
14492
|
console.warn(`[ConfigManager] Config file not found at: ${configPath}\n → Using built-in defaults. Set CONFIG_PATH env var or create the file.\n → Example path from project root: ./server/backend/data/config.yaml`);
|
|
14479
14493
|
return {};
|
|
14480
14494
|
}
|
|
14481
|
-
const parsed = load(fs.readFileSync(configPath, "utf-8")) ?? {};
|
|
14495
|
+
const parsed = load(fs$1.readFileSync(configPath, "utf-8")) ?? {};
|
|
14482
14496
|
console.log(`[ConfigManager] Loaded config from: ${configPath}`);
|
|
14483
14497
|
return parsed;
|
|
14484
14498
|
}
|
|
@@ -22303,7 +22317,7 @@ function buildLinkChain(target, localResolver, hookup) {
|
|
|
22303
22317
|
*/
|
|
22304
22318
|
function safeExistsSync(path) {
|
|
22305
22319
|
try {
|
|
22306
|
-
return fs.existsSync(path);
|
|
22320
|
+
return fs$1.existsSync(path);
|
|
22307
22321
|
} catch {
|
|
22308
22322
|
return false;
|
|
22309
22323
|
}
|
|
@@ -22322,11 +22336,11 @@ function probeLinuxGpus() {
|
|
|
22322
22336
|
if (safeExistsSync("/dev/nvidia0") || safeExistsSync("/proc/driver/nvidia/version")) signals.hasNvidiaGpu = true;
|
|
22323
22337
|
try {
|
|
22324
22338
|
const drmDir = "/sys/class/drm";
|
|
22325
|
-
if (fs.existsSync(drmDir)) for (const entry of fs.readdirSync(drmDir)) {
|
|
22339
|
+
if (fs$1.existsSync(drmDir)) for (const entry of fs$1.readdirSync(drmDir)) {
|
|
22326
22340
|
if (!entry.startsWith("card")) continue;
|
|
22327
22341
|
const vendorPath = `${drmDir}/${entry}/device/vendor`;
|
|
22328
22342
|
if (!safeExistsSync(vendorPath)) continue;
|
|
22329
|
-
const vendor = fs.readFileSync(vendorPath, "utf8").trim().toLowerCase();
|
|
22343
|
+
const vendor = fs$1.readFileSync(vendorPath, "utf8").trim().toLowerCase();
|
|
22330
22344
|
if (vendor === "0x10de") signals.hasNvidiaGpu = true;
|
|
22331
22345
|
else if (vendor === "0x1002") signals.hasAmdGpu = true;
|
|
22332
22346
|
else if (vendor === "0x8086") signals.hasIntelGpu = true;
|
|
@@ -22492,21 +22506,21 @@ function sleep$1(ms) {
|
|
|
22492
22506
|
* crashed holder) is stolen.
|
|
22493
22507
|
*/
|
|
22494
22508
|
async function withFileLock(lockPath, fn) {
|
|
22495
|
-
fs.mkdirSync(join(lockPath, ".."), { recursive: true });
|
|
22509
|
+
fs$1.mkdirSync(join(lockPath, ".."), { recursive: true });
|
|
22496
22510
|
for (;;) try {
|
|
22497
|
-
const fd = fs.openSync(lockPath, "wx");
|
|
22498
|
-
fs.closeSync(fd);
|
|
22511
|
+
const fd = fs$1.openSync(lockPath, "wx");
|
|
22512
|
+
fs$1.closeSync(fd);
|
|
22499
22513
|
break;
|
|
22500
22514
|
} catch {
|
|
22501
22515
|
try {
|
|
22502
|
-
if (Date.now() - fs.statSync(lockPath).mtimeMs > LOCK_STALE_MS) fs.rmSync(lockPath, { force: true });
|
|
22516
|
+
if (Date.now() - fs$1.statSync(lockPath).mtimeMs > LOCK_STALE_MS) fs$1.rmSync(lockPath, { force: true });
|
|
22503
22517
|
else await sleep$1(LOCK_POLL_MS);
|
|
22504
22518
|
} catch {}
|
|
22505
22519
|
}
|
|
22506
22520
|
try {
|
|
22507
22521
|
return await fn();
|
|
22508
22522
|
} finally {
|
|
22509
|
-
fs.rmSync(lockPath, { force: true });
|
|
22523
|
+
fs$1.rmSync(lockPath, { force: true });
|
|
22510
22524
|
}
|
|
22511
22525
|
}
|
|
22512
22526
|
/** Coalesce in-process + serialize cross-process for one binary id. */
|
|
@@ -22553,6 +22567,19 @@ var AddonDepsManager = class {
|
|
|
22553
22567
|
const pythonPath = await this.ensurePython();
|
|
22554
22568
|
if (!pythonPath) throw new Error("Cannot install Python requirements: Python is not available");
|
|
22555
22569
|
await singleFlight(this.depsDir, "python-pip", () => installPythonRequirements$1(pythonPath, requirementsFile, this.logger));
|
|
22570
|
+
await this.stageNativeDepsDeclaredBy(requirementsFile);
|
|
22571
|
+
}
|
|
22572
|
+
/**
|
|
22573
|
+
* The native library a requirements file says its packages need
|
|
22574
|
+
* (`# camstack-native-dep: edgetpu-delegate`), staged under this node's
|
|
22575
|
+
* deps dir. Runs on every call — not only the first pip install — so a
|
|
22576
|
+
* node whose pip marker predates the line still gets the library. A
|
|
22577
|
+
* platform without a build answers `unavailable` (logged, not thrown); a
|
|
22578
|
+
* failed or tampered download throws, and provisioning reports it.
|
|
22579
|
+
*/
|
|
22580
|
+
async stageNativeDepsDeclaredBy(requirementsFile) {
|
|
22581
|
+
if (!declaresEdgetpuDelegate(fs$1.readFileSync(requirementsFile, "utf8"))) return;
|
|
22582
|
+
await singleFlight(this.depsDir, "edgetpu-delegate", () => ensureEdgetpuDelegate(this.nodeRoot, this.logger));
|
|
22556
22583
|
}
|
|
22557
22584
|
getDepsDir() {
|
|
22558
22585
|
return this.depsDir;
|
|
@@ -23735,7 +23762,7 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
23735
23762
|
const addonId = declaration.id;
|
|
23736
23763
|
const nodeDataDir = process.env["CAMSTACK_DATA"] ?? dataDir;
|
|
23737
23764
|
const addonDataDir = path$1.resolve(nodeDataDir, "addons-data", addonId);
|
|
23738
|
-
fs.mkdirSync(addonDataDir, { recursive: true });
|
|
23765
|
+
fs$1.mkdirSync(addonDataDir, { recursive: true });
|
|
23739
23766
|
if (runtime.mode === "broker") ensureBindingSubscription(runtime.broker);
|
|
23740
23767
|
const regs = getRegistries(nodeId);
|
|
23741
23768
|
const workerResolver = {
|
|
@@ -25542,7 +25569,7 @@ function readAddonHeapDeclaration(spec) {
|
|
|
25542
25569
|
if (cached !== void 0) return cached;
|
|
25543
25570
|
let declaration = EMPTY_HEAP_DECLARATION;
|
|
25544
25571
|
for (const manifestPath of [path$1.join(spec.addonDir, "package.json"), path$1.join(path$1.dirname(spec.addonDir), "package.json")]) try {
|
|
25545
|
-
const raw = fs.readFileSync(manifestPath, "utf8");
|
|
25572
|
+
const raw = fs$1.readFileSync(manifestPath, "utf8");
|
|
25546
25573
|
const parsed = JSON.parse(raw);
|
|
25547
25574
|
const profile = extractHeapProfile(parsed, spec.addonId);
|
|
25548
25575
|
const maxOldSpaceMb = extractMaxOldSpaceMb(parsed, spec.addonId);
|
|
@@ -26676,17 +26703,17 @@ var JobJournal = class {
|
|
|
26676
26703
|
return path$1.join(this.jobsDir, `${id}.json`);
|
|
26677
26704
|
}
|
|
26678
26705
|
writeAtomic(filePath, data) {
|
|
26679
|
-
fs.mkdirSync(path$1.dirname(filePath), { recursive: true });
|
|
26706
|
+
fs$1.mkdirSync(path$1.dirname(filePath), { recursive: true });
|
|
26680
26707
|
const tmp = `${filePath}.tmp.${process.pid}.${Date.now()}`;
|
|
26681
|
-
fs.writeFileSync(tmp, JSON.stringify(data, null, 2), {
|
|
26708
|
+
fs$1.writeFileSync(tmp, JSON.stringify(data, null, 2), {
|
|
26682
26709
|
encoding: "utf-8",
|
|
26683
26710
|
mode: 384
|
|
26684
26711
|
});
|
|
26685
|
-
fs.renameSync(tmp, filePath);
|
|
26712
|
+
fs$1.renameSync(tmp, filePath);
|
|
26686
26713
|
}
|
|
26687
26714
|
readIndex() {
|
|
26688
26715
|
try {
|
|
26689
|
-
const raw = JSON.parse(fs.readFileSync(this.indexPath, "utf-8"));
|
|
26716
|
+
const raw = JSON.parse(fs$1.readFileSync(this.indexPath, "utf-8"));
|
|
26690
26717
|
if (raw && Array.isArray(raw.jobIds)) return {
|
|
26691
26718
|
version: 1,
|
|
26692
26719
|
jobIds: raw.jobIds
|
|
@@ -26711,7 +26738,7 @@ var JobJournal = class {
|
|
|
26711
26738
|
}
|
|
26712
26739
|
getJob(id) {
|
|
26713
26740
|
try {
|
|
26714
|
-
const parsed = lifecycleJobSchema.safeParse(JSON.parse(fs.readFileSync(this.jobPath(id), "utf-8")));
|
|
26741
|
+
const parsed = lifecycleJobSchema.safeParse(JSON.parse(fs$1.readFileSync(this.jobPath(id), "utf-8")));
|
|
26715
26742
|
return parsed.success ? parsed.data : null;
|
|
26716
26743
|
} catch {
|
|
26717
26744
|
return null;
|
|
@@ -26776,14 +26803,14 @@ var StagingArea = class {
|
|
|
26776
26803
|
}
|
|
26777
26804
|
async fetchAndStage(input) {
|
|
26778
26805
|
const destDir = path$1.join(this.stagingDir, input.jobId, safeSegment(input.name));
|
|
26779
|
-
fs.rmSync(destDir, {
|
|
26806
|
+
fs$1.rmSync(destDir, {
|
|
26780
26807
|
recursive: true,
|
|
26781
26808
|
force: true
|
|
26782
26809
|
});
|
|
26783
26810
|
const tgz = await this.deps.fetchTarball(input.name, input.version, input.signal);
|
|
26784
26811
|
if (input.signal.aborted) throw new Error("staging aborted after fetch");
|
|
26785
26812
|
await this.deps.extract(tgz, destDir);
|
|
26786
|
-
const raw = JSON.parse(fs.readFileSync(path$1.join(destDir, "package.json"), "utf-8"));
|
|
26813
|
+
const raw = JSON.parse(fs$1.readFileSync(path$1.join(destDir, "package.json"), "utf-8"));
|
|
26787
26814
|
if (typeof raw.version !== "string" || raw.version.length === 0) throw new Error(`staging validation failed: ${input.name} staged a package.json with no version`);
|
|
26788
26815
|
if (EXACT_SEMVER.test(input.version) && raw.version !== input.version) throw new Error(`staging validation failed: ${input.name} expected version ${input.version}, got ${raw.version}`);
|
|
26789
26816
|
return {
|
|
@@ -26792,7 +26819,7 @@ var StagingArea = class {
|
|
|
26792
26819
|
};
|
|
26793
26820
|
}
|
|
26794
26821
|
cleanup(jobId) {
|
|
26795
|
-
fs.rmSync(path$1.join(this.stagingDir, jobId), {
|
|
26822
|
+
fs$1.rmSync(path$1.join(this.stagingDir, jobId), {
|
|
26796
26823
|
recursive: true,
|
|
26797
26824
|
force: true
|
|
26798
26825
|
});
|
|
@@ -26807,13 +26834,13 @@ var StagingArea = class {
|
|
|
26807
26834
|
sweepOrphans() {
|
|
26808
26835
|
let entries;
|
|
26809
26836
|
try {
|
|
26810
|
-
entries = fs.readdirSync(this.stagingDir);
|
|
26837
|
+
entries = fs$1.readdirSync(this.stagingDir);
|
|
26811
26838
|
} catch {
|
|
26812
26839
|
return 0;
|
|
26813
26840
|
}
|
|
26814
26841
|
let removed = 0;
|
|
26815
26842
|
for (const name of entries) try {
|
|
26816
|
-
fs.rmSync(path$1.join(this.stagingDir, name), {
|
|
26843
|
+
fs$1.rmSync(path$1.join(this.stagingDir, name), {
|
|
26817
26844
|
recursive: true,
|
|
26818
26845
|
force: true
|
|
26819
26846
|
});
|
|
@@ -26991,7 +27018,7 @@ var LifecycleJobEngine = class {
|
|
|
26991
27018
|
* on failure → `failed`.
|
|
26992
27019
|
*/
|
|
26993
27020
|
async reconcileJob(job) {
|
|
26994
|
-
const exists = this.deps.stagedPathExists ?? ((p) => fs.existsSync(p));
|
|
27021
|
+
const exists = this.deps.stagedPathExists ?? ((p) => fs$1.existsSync(p));
|
|
26995
27022
|
for (const task of job.tasks) {
|
|
26996
27023
|
if (task.target === "framework") {
|
|
26997
27024
|
if (!this.isTerminal(task.phase)) this.skipFrameworkTask(job, task);
|
|
@@ -27604,7 +27631,7 @@ var CatalogRegistry = class {
|
|
|
27604
27631
|
const file = path$1.join(packageDir, "i18n", `${lang}.json`);
|
|
27605
27632
|
let text;
|
|
27606
27633
|
try {
|
|
27607
|
-
text = fs.readFileSync(file, "utf8");
|
|
27634
|
+
text = fs$1.readFileSync(file, "utf8");
|
|
27608
27635
|
} catch {
|
|
27609
27636
|
continue;
|
|
27610
27637
|
}
|
|
@@ -27660,4 +27687,4 @@ function resetCatalogRegistryForTests() {
|
|
|
27660
27687
|
}
|
|
27661
27688
|
//#endregion
|
|
27662
27689
|
var readAllRows = import_read_all_rows.readAllRows;
|
|
27663
|
-
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_DASHBOARD_ORIGINS_FIELD, AGENT_HTTPS_NAMES_COLLECTION, AGENT_HTTPS_NAMES_COLUMNS, AGENT_READINESS_SERVICE_NAME, AGENT_UI_UNLOCK_TTL_MS, AGENT_UI_UNLOCK_TYP, AGENT_UI_UNLOCK_USE, AGENT_UI_UNLOCK_VERSION, ALL_CAPABILITY_DEFINITIONS, ARRAY_BUFFER_CENSUS_COOLDOWN_MS, ARRAY_BUFFER_CENSUS_SUSTAIN_MS, ARRAY_BUFFER_CENSUS_THRESHOLD_MB, ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRefusedError, AddonRouteRegistry, AgentHttpsInstallError, AgentHttpsNames, AgentMdnsAdvertiser, AgentMeshIdentityGate, AgentPairing, AlertCenterAddon, ApiKeyManager, AuthAuditLog, AuthManager, BackupDecryptError, BackupKeyFormatError, BackupKeyMismatchError, BackupKeyRequiredError, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, CAP_METHOD_NOT_IMPLEMENTED, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_NODE_HISTORY_COLLECTION, CORE_CAP_SERVICE_NAME, CalendarsAddon, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, CatalogRegistry, ClusterNodeHistoryBodySchema, ComposerAddon, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_HUB_TLS_TCP_PORT, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_CA_KEY_REF, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceCaStore, DeviceCredentialManager, DeviceHistoryAddon, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FIRST_BOOT_ADMIN_PASSWORD, FIRST_BOOT_ADMIN_USERNAME, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, GET_STATUS_METHOD, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, HubPairing, INFRA_CAPABILITIES, INTEGRATIONS_LEGACY, INTEGRATION_SETTINGS_LEGACY, IntegrationRegistry, JWT_SIGNING_KEY_REF, JobJournal, JwtSigningKeyUnavailableError, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LoginSessionManager, LokiDestination, LokiLoggingAddon, MAX_CAP_ACTIONS_PER_PEER, MAX_LEAF_VALIDITY_DAYS, MESH_ACTION_FORBIDDEN_TYPE, MESH_CA_FIELD, MESH_CA_KEY_REF, MESH_CA_SETTINGS_KEY, MESH_NODE_CERTIFICATES_COLLECTION, MESH_NODE_CERTIFICATES_COLUMNS, MESH_NODE_UNAUTHENTICATED_TYPE, MESH_QUEUE_TOP_N, MESH_TLS_PORT_HELLO_FIELD, METHOD_ACCESS_MAP, MeshCaKeeper, MeshCertificateRegistry, MeshCrl, MeshIdentityGate, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PAIRING_CODE_DIGITS, PAIRING_MAX_CODE_ATTEMPTS, PAIRING_MAX_SESSIONS, PAIRING_PATHS, PAIRING_PIN_DIGITS, PAIRING_PROTOCOL, PAIRING_TTL_MS, PARENT_ROUTED_PROVIDER_ADDON_ID, PERMITTED_DNS_SUFFIXES, PERMITTED_IP_RANGES, PREVIOUS_LEAF_GRACE_MS, PYTHON_VERSION, PairingHttpError, PeerAnsweredError, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, REFRESH_TOKEN_PREFIX, RENEWAL_ABANDONED, RESTART_MARKER_FILE, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, SERVER_NAMESPACE, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, STORAGE_DRAIN_STATE_LEGACY, STORE_READABLE_BOOTSTRAP_KEYS, SYSTEM_SECRET_OWNER, ScopedLogger, SettingsReadUnavailableError, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemBackupService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, TlsTcpTransporter, ToastService, UDS_NO_ROUTE_PREFIX, UNCLAIMED, UNMIGRATED_SETTINGS_CODE, UNMIGRATED_SETTINGS_REMEDY, UPLOADED_CA_FILE, USER_MANAGEMENT_INTERNAL, UdsLocalTransportClient, UdsLocalTransportServer, UnlockTicketJtiStore, UnmigratedSettingsError, UserManager, WinstonDestination, WinstonLoggingAddon, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, acceptAgentSans, adaptBrokerToCluster, addonSettingsCapability, adoptModelRevisions, afterWorkerOnlineAnnounce, agentHttpsPaths, allFamiliesListenHost, answerClaimedGetStatus, applyCertificateToListener, applyLanHttp, asBrokerLike, assertLegacyBlobsMigrated, attachUserManagementInternal, attributeStall, backupOrchestratorRecordKinds, backupRecordStoresOf, bareAddonOf, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildAgentAnnouncement, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNameConstraintSet, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, buildTransporter, builderMountedCapNames, caFingerprint, caFingerprintCompact, caReplacementMarkerFile, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, catalogNamespaceOf, certificateNames, chainsToPublicRoot, checkUploadedCa, classifyAddonDir, classifyCapRoute, clearHttpsListener, clearPendingRestart, clearPlatformKeychainKey, closeLanHttp, clusterAgentRecordKinds, clusterEventTopic, clusterNodeHistoryRecordKind, collectAgentNames, collectCertIdentity, collectModelFiles, compileLogFilter, computePairingCommitment, computePairingSas, connectBrokerTransport, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonPeerBytesFacility, createAddonService, createAgentEventScope, createAgentHttpsRequest, createAgentTransport, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCiaoPublisher, createCidrMatcher, createCoreCapService, createCoreCatalogRegistry, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createKernelInferenceEngine, createLocalTransport, createLoopDelayMeter, createMeshAccessMiddleware, createMeshCsrPem, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, currentBrokerTransporter, deleteModelFromDisk, deriveAgentListenPort, describeCsr, describeHttpsLeaf, describeMeshLeaf, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, deviceCapResolverLink, deviceOfGetStatus, diffCapActionCensus, diffEventPlane, diffSocketPlane, disconnectBrokerTransport, downloadBinary, downloadFile, downloadModel, dropProcessPeer, emitDownForOwnedCaps, emitHeapDiagnosticReport, emitProcessNodeRegistered, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, exportMeshPrivateKeyPem, fetchJson, filterIsEmpty, findAddonRefusal, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, generateBackupKeyPair, generateDeviceCa, generateMeshCa, generateMeshKeyPair, getBrokerEventBus, getBrokerTlsTransporter, getCapUsageRegistry, getCatalogRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPlatformKeychainKey, getProcessAgentHttpsNames, getProcessJwtSigningKeyState, getProcessMeshCaState, getProcessMeshCertificateRegistry, getProcessMeshTlsListenerState, getProcessNodeMeshTransport, getProcessPeerLeaf, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getUserManagementInternal, getWorkerDeviceRegistry, hasDotNode, heapSpaceField, hostNodeIdOf, hubHostFromMeshAddress, hubMainRssBudget, installAgentHttps, installBrokerTransporter, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, integrationRegistryRecordKinds, ipcParentLink, isAddonDeploySource, isAllowedAgentDashboardReturnTo, isArrayBufferCensusReport, isArrayOutputSchema, isCollectionArrayMethod, isConstrainedCa, isContainerBridgeAddress, isCredentialKeyName, isInfraCapability, isInstalledTransporter, isLocalOnlyHostname, isModelDownloaded, isPeerEventPacket, isPrivateAddress, isProcessVerifiedMeshPeer, isRemoteForbiddenAction, isRemoteForbiddenOnAgent, isSettingsReadUnavailable, isSourceNewer, isValidAgentNodeId, isolatedBuiltinPhase, issueAgentHttpsLeaf, issueDeviceLeaf, issueMeshLeafForNode, issueMeshLeafFromCsr, keyFingerprintShort, leafFingerprintOf, levelRank, lineContainsText, lineMatches, loadAgentHttps, loadDeviceCa, loadMeshCa, loadTlsCert, localCaCommonName, localEndpointPath, localProviderLink, localSupportedPythonRuntimes, mapSignalsToInferenceHardware, meshErrorType, mintAgentUiUnlockTicket, mountNativeCapService, nextRssBudgetState, normalizeIp, onProcessNodeRegistered, onSessionsRevoked, openMeshTlsWhenRevocationsLoaded, originNodeOf, overlayGetStatus, parseAgentDashboardOrigins, parseCapAction, parseCidrList, parseRangeHeader, parseRssBudgetMb, parseTokenExpiry, parseTokenizedUrl, partitionIsolatedBuiltinIds, pemDigest, permitsIdentity, permitsName, pinnedHttpsCaFingerprint, preferencesLimitReasonOf, prepareBootTls, prepareRestoreArchive, probePlatform, processJwtSigningKey, processMeshCrl, proxyToUpstream, quarantineAddonResidue, readAllRows, readBackupEncryptionHeader, readCidrSetting, readExtraSans, readHeapSpaces, readLanHttpState, readNameConstraints, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, redactLogEntry, redactLogMeta, redactLogText, regenerateCertificate, registerEventBusService, registerHttpsListener, registerLanHttpHandler, reissueTlsLeaf, reloadHttpsListener, renewMeshCertificate, replaceUnconstrainedLocalCa, requireProcessMeshCa, resetCatalogRegistryForTests, resolveFilePath, resolveFormatRevision, resolveHwAccel, resolveNpmInvocation, retirePreviousLocalCa, revertToGeneratedCertificate, revisionWeightUrl, revokeMeshCertificate, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, servedHttpsLeafFingerprint, setHubConnected, setNodeEventInterest, setPlatformKeychainKey, setProcessAgentHttpsNames, setProcessMeshCertificateRegistry, setProcessMeshPeerTransportLookup, setProcessMeshTlsEnabler, setProcessMeshTlsListenerState, setWrapperActive, shouldReclaim, signPairingProof, signalAllRunnerGroups, socketDirectionBytes, socketDirectionMessages, splitPemCertificates, stampCallerAddonId, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, staticJwtSigningKey, storageOrchestratorRecordKinds, storeMayAnswer, storeUploadedCertificate, strandedMb, stripCamstackDeps, stripForgedIdentity, stripForwardedCaller, subscribePassthrough, systemHostFacts, udsChildLogToWorkerEntry, useStoredUploadedCertificate, validateProviderRegistrations, validateUploadedTls, verifyAgentUiUnlockTicket, verifyDeviceLeaf, verifyDeviceSignature, verifyPairingProof, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
|
27690
|
+
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_DASHBOARD_ORIGINS_FIELD, AGENT_HTTPS_NAMES_COLLECTION, AGENT_HTTPS_NAMES_COLUMNS, AGENT_READINESS_SERVICE_NAME, AGENT_UI_UNLOCK_TTL_MS, AGENT_UI_UNLOCK_TYP, AGENT_UI_UNLOCK_USE, AGENT_UI_UNLOCK_VERSION, ALL_CAPABILITY_DEFINITIONS, ARRAY_BUFFER_CENSUS_COOLDOWN_MS, ARRAY_BUFFER_CENSUS_SUSTAIN_MS, ARRAY_BUFFER_CENSUS_THRESHOLD_MB, ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRefusedError, AddonRouteRegistry, AgentHttpsInstallError, AgentHttpsNames, AgentMdnsAdvertiser, AgentMeshIdentityGate, AgentPairing, AlertCenterAddon, ApiKeyManager, AuthAuditLog, AuthManager, BackupDecryptError, BackupKeyFormatError, BackupKeyMismatchError, BackupKeyRequiredError, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, CAP_METHOD_NOT_IMPLEMENTED, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_NODE_HISTORY_COLLECTION, CORE_CAP_SERVICE_NAME, CalendarsAddon, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, CatalogRegistry, ClusterNodeHistoryBodySchema, ComposerAddon, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_HUB_TLS_TCP_PORT, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_CA_KEY_REF, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceCaStore, DeviceCredentialManager, DeviceHistoryAddon, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FIRST_BOOT_ADMIN_PASSWORD, FIRST_BOOT_ADMIN_USERNAME, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, GET_STATUS_METHOD, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, HubPairing, INFRA_CAPABILITIES, INTEGRATIONS_LEGACY, INTEGRATION_SETTINGS_LEGACY, IntegrationRegistry, JWT_SIGNING_KEY_REF, JobJournal, JwtSigningKeyUnavailableError, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LoginSessionManager, LokiDestination, LokiLoggingAddon, MAX_CAP_ACTIONS_PER_PEER, MAX_LEAF_VALIDITY_DAYS, MESH_ACTION_FORBIDDEN_TYPE, MESH_CA_FIELD, MESH_CA_KEY_REF, MESH_CA_SETTINGS_KEY, MESH_NODE_CERTIFICATES_COLLECTION, MESH_NODE_CERTIFICATES_COLUMNS, MESH_NODE_UNAUTHENTICATED_TYPE, MESH_QUEUE_TOP_N, MESH_TLS_PORT_HELLO_FIELD, METHOD_ACCESS_MAP, MeshCaKeeper, MeshCertificateRegistry, MeshCrl, MeshIdentityGate, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PAIRING_CODE_DIGITS, PAIRING_MAX_CODE_ATTEMPTS, PAIRING_MAX_SESSIONS, PAIRING_PATHS, PAIRING_PIN_DIGITS, PAIRING_PROTOCOL, PAIRING_TTL_MS, PARENT_ROUTED_PROVIDER_ADDON_ID, PERMITTED_DNS_SUFFIXES, PERMITTED_IP_RANGES, PREVIOUS_LEAF_GRACE_MS, PYTHON_VERSION, PairingHttpError, PeerAnsweredError, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, REFRESH_TOKEN_PREFIX, RENEWAL_ABANDONED, RESTART_MARKER_FILE, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, RecordsEngine, ReplEngine, RingBuffer, SERVER_AUTH_OID, SERVER_NAMESPACE, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, STORAGE_DRAIN_STATE_LEGACY, STORE_READABLE_BOOTSTRAP_KEYS, SYSTEM_SECRET_OWNER, ScopedLogger, SettingsReadUnavailableError, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemBackupService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, TlsTcpTransporter, ToastService, UDS_NO_ROUTE_PREFIX, UNCLAIMED, UNMIGRATED_SETTINGS_CODE, UNMIGRATED_SETTINGS_REMEDY, UPLOADED_CA_FILE, USER_MANAGEMENT_INTERNAL, UdsLocalTransportClient, UdsLocalTransportServer, UnlockTicketJtiStore, UnmigratedSettingsError, UserManager, WinstonDestination, WinstonLoggingAddon, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, acceptAgentSans, adaptBrokerToCluster, addonSettingsCapability, adoptModelRevisions, afterWorkerOnlineAnnounce, agentHttpsPaths, allFamiliesListenHost, answerClaimedGetStatus, applyCertificateToListener, applyLanHttp, asBrokerLike, assertLegacyBlobsMigrated, attachUserManagementInternal, attributeStall, backupOrchestratorRecordKinds, backupRecordStoresOf, bareAddonOf, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildAgentAnnouncement, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNameConstraintSet, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, buildTransporter, builderMountedCapNames, caFingerprint, caFingerprintCompact, caReplacementMarkerFile, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, catalogNamespaceOf, certificateNames, chainsToPublicRoot, checkUploadedCa, classifyAddonDir, classifyCapRoute, clearHttpsListener, clearPendingRestart, clearPlatformKeychainKey, closeLanHttp, clusterAgentRecordKinds, clusterEventTopic, clusterNodeHistoryRecordKind, collectAgentNames, collectCertIdentity, collectModelFiles, compileLogFilter, computePairingCommitment, computePairingSas, connectBrokerTransport, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonPeerBytesFacility, createAddonService, createAgentEventScope, createAgentHttpsRequest, createAgentTransport, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCiaoPublisher, createCidrMatcher, createCoreCapService, createCoreCatalogRegistry, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createKernelInferenceEngine, createLocalTransport, createLoopDelayMeter, createMeshAccessMiddleware, createMeshCsrPem, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, currentBrokerTransporter, deleteModelFromDisk, deriveAgentListenPort, describeCsr, describeHttpsLeaf, describeMeshLeaf, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, deviceCapResolverLink, deviceOfGetStatus, diffCapActionCensus, diffEventPlane, diffSocketPlane, disconnectBrokerTransport, downloadBinary, downloadFile, downloadModel, dropProcessPeer, emitDownForOwnedCaps, emitHeapDiagnosticReport, emitProcessNodeRegistered, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, exportMeshPrivateKeyPem, fetchJson, filterIsEmpty, findAddonRefusal, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, generateBackupKeyPair, generateDeviceCa, generateMeshCa, generateMeshKeyPair, getBrokerEventBus, getBrokerTlsTransporter, getCapUsageRegistry, getCatalogRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPlatformKeychainKey, getProcessAgentHttpsNames, getProcessJwtSigningKeyState, getProcessMeshCaState, getProcessMeshCertificateRegistry, getProcessMeshTlsListenerState, getProcessNodeMeshTransport, getProcessPeerLeaf, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getUserManagementInternal, getWorkerDeviceRegistry, hasDotNode, heapSpaceField, hostNodeIdOf, hubHostFromMeshAddress, hubMainRssBudget, installAgentHttps, installBrokerTransporter, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, integrationRegistryRecordKinds, ipcParentLink, isAddonDeploySource, isAllowedAgentDashboardReturnTo, isArrayBufferCensusReport, isArrayOutputSchema, isCollectionArrayMethod, isConstrainedCa, isContainerBridgeAddress, isCredentialKeyName, isInfraCapability, isInstalledTransporter, isLocalOnlyHostname, isModelDownloaded, isPeerEventPacket, isPrivateAddress, isProcessVerifiedMeshPeer, isRemoteForbiddenAction, isRemoteForbiddenOnAgent, isSettingsReadUnavailable, isSourceNewer, isValidAgentNodeId, isolatedBuiltinPhase, issueAgentHttpsLeaf, issueDeviceLeaf, issueMeshLeafForNode, issueMeshLeafFromCsr, keyFingerprintShort, leafFingerprintOf, levelRank, lineContainsText, lineMatches, loadAgentHttps, loadDeviceCa, loadMeshCa, loadTlsCert, localCaCommonName, localEndpointPath, localProviderLink, localSupportedPythonRuntimes, mapSignalsToInferenceHardware, meshErrorType, mintAgentUiUnlockTicket, mountNativeCapService, nextRssBudgetState, normalizeIp, onProcessNodeRegistered, onSessionsRevoked, openMeshTlsWhenRevocationsLoaded, originNodeOf, overlayGetStatus, parseAgentDashboardOrigins, parseCapAction, parseCidrList, parseRangeHeader, parseRssBudgetMb, parseTokenExpiry, parseTokenizedUrl, partitionIsolatedBuiltinIds, pemDigest, permitsIdentity, permitsName, pinnedHttpsCaFingerprint, preferencesLimitReasonOf, prepareBootTls, prepareRestoreArchive, probePlatform, processJwtSigningKey, processMeshCrl, proxyToUpstream, quarantineAddonResidue, readAllRows, readBackupEncryptionHeader, readCidrSetting, readExtraSans, readHeapSpaces, readLanHttpState, readNameConstraints, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, redactLogEntry, redactLogMeta, redactLogText, regenerateCertificate, registerEventBusService, registerHttpsListener, registerLanHttpHandler, reissueTlsLeaf, reloadHttpsListener, renewMeshCertificate, replaceUnconstrainedLocalCa, requireProcessMeshCa, resetCatalogRegistryForTests, resolveFilePath, resolveFormatRevision, resolveHwAccel, resolveNpmInvocation, retirePreviousLocalCa, revertToGeneratedCertificate, revisionWeightUrl, revokeMeshCertificate, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, servedHttpsLeafFingerprint, setHubConnected, setNodeEventInterest, setPlatformKeychainKey, setProcessAgentHttpsNames, setProcessMeshCertificateRegistry, setProcessMeshPeerTransportLookup, setProcessMeshTlsEnabler, setProcessMeshTlsListenerState, setWrapperActive, shouldReclaim, signPairingProof, signalAllRunnerGroups, socketDirectionBytes, socketDirectionMessages, splitPemCertificates, stampCallerAddonId, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, staticJwtSigningKey, storageOrchestratorRecordKinds, storeMayAnswer, storeUploadedCertificate, strandedMb, stripCamstackDeps, stripForgedIdentity, stripForwardedCaller, subscribePassthrough, systemHostFacts, udsChildLogToWorkerEntry, useStoredUploadedCertificate, validateProviderRegistrations, validateUploadedTls, verifyAgentUiUnlockTicket, verifyDeviceLeaf, verifyDeviceSignature, verifyPairingProof, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|