@camstack/server 1.2.14 → 1.2.15
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/api/addon-upload.js +2 -0
- package/dist/api/core/cap-providers.js +6 -0
- package/dist/api/trpc/generated-cap-mounts.js +3 -1
- package/dist/api/trpc/generated-cap-routers.js +190 -143
- package/dist/core/addon/addon-package.service.js +55 -51
- package/dist/core/addon/addon-registry.service.js +58 -0
- package/dist/core/agent/agent-addon-backfill.js +168 -0
- package/dist/core/agent/agent-registry.service.js +225 -9
- package/dist/core/agent/cluster-node-history-store.js +138 -1
- package/dist/launcher.js +14 -0
- package/dist/manual-boot.js +15 -0
- package/dist/server-root/index.js +3 -1
- package/package.json +9 -7
package/dist/api/addon-upload.js
CHANGED
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.getDeployStageRegistry = getDeployStageRegistry;
|
|
37
37
|
exports.registerDeployBundleRoute = registerDeployBundleRoute;
|
|
38
|
+
exports.hubBundleBaseUrl = hubBundleBaseUrl;
|
|
38
39
|
exports.buildHubHttpSource = buildHubHttpSource;
|
|
39
40
|
exports.registerAddonUploadRoute = registerAddonUploadRoute;
|
|
40
41
|
const fs = __importStar(require("node:fs"));
|
|
@@ -81,6 +82,7 @@ function registerDeployBundleRoute(fastify) {
|
|
|
81
82
|
const MAX_UPLOAD_BYTES = 50 * 1024 * 1024;
|
|
82
83
|
const AGENT_DEPLOY_TIMEOUT_MS = 60_000;
|
|
83
84
|
const AGENT_DEPLOY_CONTROL_TIMEOUT_MS = 30_000;
|
|
85
|
+
/** Base URL agents pull staged deploy bundles from. */
|
|
84
86
|
function hubBundleBaseUrl() {
|
|
85
87
|
return process.env['CAMSTACK_HUB_PUBLIC_URL'] ?? 'https://127.0.0.1:4443';
|
|
86
88
|
}
|
|
@@ -370,6 +370,12 @@ function buildNodesProvider(agentRegistry, moleculer, addonRegistry, getNodeRoot
|
|
|
370
370
|
await broker.call('$agent.undeploy', {
|
|
371
371
|
addonId: input.addonId,
|
|
372
372
|
}, { nodeID: input.nodeId, timeout: 30_000 });
|
|
373
|
+
// Drop it from the node's intended set. Without this the addon back-fill
|
|
374
|
+
// would put the package straight back on the next reconnect — the
|
|
375
|
+
// reconcile converges a node to the roster it last declared, so a
|
|
376
|
+
// deliberate per-node removal has to be recorded as such. This is the
|
|
377
|
+
// operator gesture that shrinks the record; nothing else does.
|
|
378
|
+
await agentRegistry.noteAddonUndeployed(input.nodeId, input.addonId);
|
|
373
379
|
return { success: true };
|
|
374
380
|
},
|
|
375
381
|
restartAddon: async (input) => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// AUTO-GENERATED by scripts/generate-cap-mounts.ts — DO NOT EDIT
|
|
3
3
|
// Re-run: npx tsx scripts/generate-cap-mounts.ts
|
|
4
4
|
//
|
|
5
|
-
// Mounted:
|
|
5
|
+
// Mounted: 140 Skipped (legacy): 3
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LEGACY_SHAPE_SKIP = void 0;
|
|
8
8
|
exports.mountAllCaps = mountAllCaps;
|
|
@@ -401,6 +401,8 @@ function mountAllCaps(services) {
|
|
|
401
401
|
system: (0, generated_cap_routers_js_1.createCapRouter_system)((_ctx) => reg?.getSingleton('system') ?? null, remoteCapProxy),
|
|
402
402
|
tamper: (0, generated_cap_routers_js_1.createCapRouter_tamper)((_ctx) => (0, cap_mount_helpers_js_1.requireDeviceScoped)(reg, 'tamper'), remoteCapProxy),
|
|
403
403
|
temperatureSensor: (0, generated_cap_routers_js_1.createCapRouter_temperatureSensor)((_ctx) => (0, cap_mount_helpers_js_1.requireDeviceScoped)(reg, 'temperature-sensor'), remoteCapProxy),
|
|
404
|
+
terminalSession: (0, generated_cap_routers_js_1.createCapRouter_terminalSession)((_ctx) => reg?.getSingleton('terminal-session') ??
|
|
405
|
+
null, remoteCapProxy),
|
|
404
406
|
toast: (0, generated_cap_routers_js_1.createCapRouter_toast)((_ctx) => reg?.getSingleton('toast') ?? null, remoteCapProxy),
|
|
405
407
|
turnProvider: (0, generated_cap_routers_js_1.createCapRouter_turnProvider)((_ctx, addonId) => {
|
|
406
408
|
if (!reg)
|