@camstack/server 1.2.214 → 1.2.216
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/agent/main.js +17 -0
- package/dist/api/trpc/generated-cap-routers.js +25 -0
- package/dist/launcher.js +25 -0
- package/package.json +1 -1
package/dist/agent/main.js
CHANGED
|
@@ -126,6 +126,23 @@ async function startAgent(configPath) {
|
|
|
126
126
|
installSource: resolvedSource,
|
|
127
127
|
});
|
|
128
128
|
await installer.ensureRequiredPackages(system_1.AddonInstaller.AGENT_PACKAGES);
|
|
129
|
+
// Restore repair, mirroring the hub launcher (D338): reinstall ONLY the
|
|
130
|
+
// runtime deps that are neither present nor resolvable from the closure.
|
|
131
|
+
if (typeof installer.ensureAddonRuntimeDeps === 'function') {
|
|
132
|
+
try {
|
|
133
|
+
const depsResult = await installer.ensureAddonRuntimeDeps();
|
|
134
|
+
if (depsResult.linked.length > 0 ||
|
|
135
|
+
depsResult.reinstalled.length > 0 ||
|
|
136
|
+
depsResult.failed.length > 0) {
|
|
137
|
+
console.log(`[Agent] Addon runtime deps ensured — linked: [${depsResult.linked.join(', ')}], ` +
|
|
138
|
+
`reinstalled: [${depsResult.reinstalled.join(', ')}], ` +
|
|
139
|
+
`failed: [${depsResult.failed.join(', ')}] (${depsResult.checked} checked)`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
catch (err) {
|
|
143
|
+
console.warn(`[Agent] ensureAddonRuntimeDeps failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
129
146
|
console.log(`[Agent] Addon packages ready in ${config.addonsDir}`);
|
|
130
147
|
let broker = (0, system_1.createBroker)({
|
|
131
148
|
nodeID: config.nodeId,
|
|
@@ -1190,6 +1190,22 @@ function createCapRouter_backup(getProvider, createRemoteProxy) {
|
|
|
1190
1190
|
const p = requireCapProvider('backup', () => getProvider(ctx));
|
|
1191
1191
|
return p.trigger(input);
|
|
1192
1192
|
}),
|
|
1193
|
+
listRuns: trpc_middleware_js_1.adminProcedure
|
|
1194
|
+
.input(zod_1.z.object({ nodeId: zod_1.z.string().optional() }).optional())
|
|
1195
|
+
.output(types_20.backupCapability.methods.listRuns.output)
|
|
1196
|
+
.query(async ({ input, ctx }) => {
|
|
1197
|
+
const p = resolveProvider('backup', input?.nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
1198
|
+
return p.listRuns();
|
|
1199
|
+
}),
|
|
1200
|
+
cancel: trpc_middleware_js_1.adminProcedure
|
|
1201
|
+
.input(types_20.backupCapability.methods.cancel.input.loose())
|
|
1202
|
+
.output(types_20.backupCapability.methods.cancel.output)
|
|
1203
|
+
.mutation(async ({ input, ctx }) => {
|
|
1204
|
+
const { nodeId, ...methodInput } = input;
|
|
1205
|
+
const p = resolveProvider('backup', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
1206
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
1207
|
+
return p.cancel(methodInput);
|
|
1208
|
+
}),
|
|
1193
1209
|
list: trpc_middleware_js_1.adminProcedure
|
|
1194
1210
|
.input(zod_1.z.object({ nodeId: zod_1.z.string().optional() }).optional())
|
|
1195
1211
|
.output(types_20.backupCapability.methods.list.output)
|
|
@@ -8994,6 +9010,15 @@ function createCapRouter_streamBroker(getProvider, createRemoteProxy) {
|
|
|
8994
9010
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
8995
9011
|
return p.unassignProfile(methodInput);
|
|
8996
9012
|
}),
|
|
9013
|
+
forgetDeviceHardware: trpc_middleware_js_1.adminProcedure
|
|
9014
|
+
.input(types_108.streamBrokerCapability.methods.forgetDeviceHardware.input.loose())
|
|
9015
|
+
.output(types_108.streamBrokerCapability.methods.forgetDeviceHardware.output)
|
|
9016
|
+
.mutation(async ({ input, ctx }) => {
|
|
9017
|
+
const { nodeId, ...methodInput } = input;
|
|
9018
|
+
const p = resolveProvider('stream-broker', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
9019
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
9020
|
+
return p.forgetDeviceHardware(methodInput);
|
|
9021
|
+
}),
|
|
8997
9022
|
renderPreBufferClip: trpc_middleware_js_1.adminProcedure
|
|
8998
9023
|
.input(types_108.streamBrokerCapability.methods.renderPreBufferClip.input.loose())
|
|
8999
9024
|
.output(types_108.streamBrokerCapability.methods.renderPreBufferClip.output)
|
package/dist/launcher.js
CHANGED
|
@@ -435,6 +435,31 @@ async function launch() {
|
|
|
435
435
|
console.warn(`[launcher] first-boot addon plan failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
436
436
|
}
|
|
437
437
|
await installer.ensureRequiredPackages(bootstrapRequired);
|
|
438
|
+
// Make every installed addon's runtime deps resolvable — the restore
|
|
439
|
+
// repair (D338: a restored addons/ tree carries no node_modules, and only
|
|
440
|
+
// bootstrap addons were reinstalled here, leaving every other addon
|
|
441
|
+
// silently broken until a manual redeploy). Reinstalls ONLY what is
|
|
442
|
+
// neither present nor resolvable from the server closure; an addon whose
|
|
443
|
+
// deps are satisfied is not touched. typeof-guarded like reconcileManifest:
|
|
444
|
+
// a system-only framework update can swap in a build that predates it.
|
|
445
|
+
if (typeof installer.ensureAddonRuntimeDeps === 'function') {
|
|
446
|
+
try {
|
|
447
|
+
const depsResult = await installer.ensureAddonRuntimeDeps();
|
|
448
|
+
if (depsResult.linked.length > 0 ||
|
|
449
|
+
depsResult.reinstalled.length > 0 ||
|
|
450
|
+
depsResult.failed.length > 0) {
|
|
451
|
+
console.log(`[launcher] Addon runtime deps ensured — linked: [${depsResult.linked.join(', ')}], ` +
|
|
452
|
+
`reinstalled: [${depsResult.reinstalled.join(', ')}], ` +
|
|
453
|
+
`failed: [${depsResult.failed.join(', ')}] (${depsResult.checked} checked)`);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
catch (err) {
|
|
457
|
+
console.warn(`[launcher] ensureAddonRuntimeDeps failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
console.warn('[launcher] ensureAddonRuntimeDeps unavailable — skipping addon dep repair');
|
|
462
|
+
}
|
|
438
463
|
// Reconcile the install manifest against what is on disk — the directory is
|
|
439
464
|
// the truth, because it is what the loader runs. Registers image-seeded
|
|
440
465
|
// addons (copied straight into addonsDir by the container entrypoint, never
|