@camstack/system 1.0.4 → 1.0.5
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 +27 -1
- package/dist/addon-runner.mjs +27 -1
- package/dist/builtins/local-auth/local-auth.addon.js +5 -1518
- package/dist/builtins/local-auth/local-auth.addon.mjs +2 -1503
- package/dist/framework-resolver-hook.mjs +48 -0
- package/dist/graceful-fs-BoR9GuPS.mjs +1423 -0
- package/dist/graceful-fs-lg19SZNz.js +1434 -0
- package/dist/index.js +635 -1751
- package/dist/index.mjs +745 -1854
- package/dist/kernel/addon-installer.d.ts +20 -0
- package/dist/kernel/host-externals.d.ts +12 -0
- package/dist/kernel/index.d.ts +7 -0
- package/dist/kernel/lifecycle/framework-staging.d.ts +15 -0
- package/dist/kernel/lifecycle/job-journal.d.ts +19 -0
- package/dist/kernel/lifecycle/lifecycle-job-engine.d.ts +98 -0
- package/dist/kernel/lifecycle/staging-area.d.ts +22 -0
- package/dist/kernel/moleculer/addon-context-factory.d.ts +13 -1
- package/dist/kernel/moleculer/register-framework-resolver.d.ts +8 -0
- package/dist/{main-rtjOwPBR.mjs → main-BOG1xxwD.mjs} +2 -2
- package/dist/{main-DNnMW7Z2.js → main-B_G1JH3Q.js} +31 -31
- package/dist/{manifest-python-deps-D1DbAQEv.js → manifest-python-deps-B4BmMoGT.js} +259 -0
- package/dist/{manifest-python-deps-DZsKTbs1.mjs → manifest-python-deps-CXbKrOdk.mjs} +256 -2
- package/dist/semver-BQBSy1FJ.mjs +1504 -0
- package/dist/semver-D3n3E_fi.js +1515 -0
- package/package.json +3 -2
package/dist/addon-runner.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_manifest_python_deps = require("./manifest-python-deps-
|
|
2
|
+
const require_manifest_python_deps = require("./manifest-python-deps-B4BmMoGT.js");
|
|
3
3
|
let node_fs = require("node:fs");
|
|
4
4
|
node_fs = require_chunk.__toESM(node_fs);
|
|
5
5
|
let node_path = require("node:path");
|
|
6
6
|
node_path = require_chunk.__toESM(node_path);
|
|
7
7
|
let _camstack_types = require("@camstack/types");
|
|
8
|
+
let node_url = require("node:url");
|
|
9
|
+
let node_module = require("node:module");
|
|
8
10
|
//#region src/kernel/moleculer/worker-device-restore.ts
|
|
9
11
|
/**
|
|
10
12
|
* Worker-side device restore helper.
|
|
@@ -88,6 +90,22 @@ async function runWorkerDeviceRestoreWithRetry(addon, context, addonId, sourceNo
|
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
//#endregion
|
|
93
|
+
//#region src/kernel/moleculer/register-framework-resolver.ts
|
|
94
|
+
/**
|
|
95
|
+
* Register the ESM resolver hook so this runner's addon imports of the
|
|
96
|
+
* host-provided packages (@camstack/system, @camstack/shm-ring, …) resolve from
|
|
97
|
+
* `frameworkDir/node_modules` instead of failing to walk up from the addon's
|
|
98
|
+
* isolated `/data/addons/<addon>` folder. No-op in dev (frameworkDir unset),
|
|
99
|
+
* where workspace symlinks already resolve the framework.
|
|
100
|
+
*/
|
|
101
|
+
function registerFrameworkResolver(frameworkDir) {
|
|
102
|
+
if (!frameworkDir) return;
|
|
103
|
+
(0, node_module.register)((0, node_url.pathToFileURL)(node_path.join(__dirname, "framework-resolver-hook.mjs")), {
|
|
104
|
+
parentURL: (0, node_url.pathToFileURL)(`${__dirname}/`).href,
|
|
105
|
+
data: { frameworkDir }
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
91
109
|
//#region src/kernel/moleculer/child-cap-dispatch.ts
|
|
92
110
|
/** Type guard narrowing a dynamically-read provider member to a callable method. */
|
|
93
111
|
function isCapMethod(value) {
|
|
@@ -365,6 +383,7 @@ async function main() {
|
|
|
365
383
|
process.exit(1);
|
|
366
384
|
}
|
|
367
385
|
console.log(`[addon-runner] Starting "${nodeId}" (UDS-only) with ${specs.length} addon(s): ${specs.map((s) => s.addonId).join(", ")}`);
|
|
386
|
+
registerFrameworkResolver(process.env["CAMSTACK_FRAMEWORK_DIR"]);
|
|
368
387
|
const loadedModules = [];
|
|
369
388
|
for (const spec of specs) try {
|
|
370
389
|
const { declaration, AddonClass } = await loadAddonModule(spec.addonId, spec.addonDir);
|
|
@@ -500,6 +519,13 @@ async function main() {
|
|
|
500
519
|
addonDataPlanes.set(addonId, endpoints);
|
|
501
520
|
} }
|
|
502
521
|
});
|
|
522
|
+
try {
|
|
523
|
+
const pkgRaw = JSON.parse(node_fs.readFileSync(node_path.join(spec.addonDir, "package.json"), "utf-8"));
|
|
524
|
+
await require_manifest_python_deps.installManifestNativeDeps(spec.addonDir, pkgRaw, context.logger);
|
|
525
|
+
} catch (nativeErr) {
|
|
526
|
+
console.error(`[addon-runner] native deps install failed for "${spec.addonId}": ${(0, _camstack_types.errMsg)(nativeErr)}`);
|
|
527
|
+
process.exit(1);
|
|
528
|
+
}
|
|
503
529
|
await require_manifest_python_deps.installManifestPythonDeps(declaration, spec.addonDir, context.deps, context.logger);
|
|
504
530
|
const registeredProviders = /* @__PURE__ */ new Map();
|
|
505
531
|
const initResult = (0, _camstack_types.normalizeAddonInitResult)(await addon.initialize(context));
|
package/dist/addon-runner.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { $ as setWorkerNativeCapsChangeListener, A as createUdsLoggerWithControl, L as LocalChildClient, X as getWorkerNativeCapProvider, Z as getWorkerNativeCapSnapshot, dt as CustomActionRegistry, i as createUdsAddonContext, mt as
|
|
1
|
+
import { $ as setWorkerNativeCapsChangeListener, A as createUdsLoggerWithControl, L as LocalChildClient, X as getWorkerNativeCapProvider, Z as getWorkerNativeCapSnapshot, dt as CustomActionRegistry, ht as resolveAddonClass, i as createUdsAddonContext, mt as installManifestNativeDeps, t as installManifestPythonDeps, tt as validateProviderRegistrations } from "./manifest-python-deps-CXbKrOdk.mjs";
|
|
2
|
+
import { register } from "node:module";
|
|
2
3
|
import * as fs from "node:fs";
|
|
3
4
|
import * as path$1 from "node:path";
|
|
4
5
|
import { ReadinessRegistry, ReadinessTimeoutError, errMsg, normalizeAddonInitResult } from "@camstack/types";
|
|
6
|
+
import { pathToFileURL } from "node:url";
|
|
5
7
|
//#region src/kernel/moleculer/worker-device-restore.ts
|
|
6
8
|
/**
|
|
7
9
|
* Worker-side device restore helper.
|
|
@@ -85,6 +87,22 @@ async function runWorkerDeviceRestoreWithRetry(addon, context, addonId, sourceNo
|
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
//#endregion
|
|
90
|
+
//#region src/kernel/moleculer/register-framework-resolver.ts
|
|
91
|
+
/**
|
|
92
|
+
* Register the ESM resolver hook so this runner's addon imports of the
|
|
93
|
+
* host-provided packages (@camstack/system, @camstack/shm-ring, …) resolve from
|
|
94
|
+
* `frameworkDir/node_modules` instead of failing to walk up from the addon's
|
|
95
|
+
* isolated `/data/addons/<addon>` folder. No-op in dev (frameworkDir unset),
|
|
96
|
+
* where workspace symlinks already resolve the framework.
|
|
97
|
+
*/
|
|
98
|
+
function registerFrameworkResolver(frameworkDir) {
|
|
99
|
+
if (!frameworkDir) return;
|
|
100
|
+
register(pathToFileURL(path$1.join(__dirname, "framework-resolver-hook.mjs")), {
|
|
101
|
+
parentURL: pathToFileURL(`${__dirname}/`).href,
|
|
102
|
+
data: { frameworkDir }
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
88
106
|
//#region src/kernel/moleculer/child-cap-dispatch.ts
|
|
89
107
|
/** Type guard narrowing a dynamically-read provider member to a callable method. */
|
|
90
108
|
function isCapMethod(value) {
|
|
@@ -362,6 +380,7 @@ async function main() {
|
|
|
362
380
|
process.exit(1);
|
|
363
381
|
}
|
|
364
382
|
console.log(`[addon-runner] Starting "${nodeId}" (UDS-only) with ${specs.length} addon(s): ${specs.map((s) => s.addonId).join(", ")}`);
|
|
383
|
+
registerFrameworkResolver(process.env["CAMSTACK_FRAMEWORK_DIR"]);
|
|
365
384
|
const loadedModules = [];
|
|
366
385
|
for (const spec of specs) try {
|
|
367
386
|
const { declaration, AddonClass } = await loadAddonModule(spec.addonId, spec.addonDir);
|
|
@@ -497,6 +516,13 @@ async function main() {
|
|
|
497
516
|
addonDataPlanes.set(addonId, endpoints);
|
|
498
517
|
} }
|
|
499
518
|
});
|
|
519
|
+
try {
|
|
520
|
+
const pkgRaw = JSON.parse(fs.readFileSync(path$1.join(spec.addonDir, "package.json"), "utf-8"));
|
|
521
|
+
await installManifestNativeDeps(spec.addonDir, pkgRaw, context.logger);
|
|
522
|
+
} catch (nativeErr) {
|
|
523
|
+
console.error(`[addon-runner] native deps install failed for "${spec.addonId}": ${errMsg(nativeErr)}`);
|
|
524
|
+
process.exit(1);
|
|
525
|
+
}
|
|
500
526
|
await installManifestPythonDeps(declaration, spec.addonDir, context.deps, context.logger);
|
|
501
527
|
const registeredProviders = /* @__PURE__ */ new Map();
|
|
502
528
|
const initResult = normalizeAddonInitResult(await addon.initialize(context));
|