@camstack/server 1.2.593 → 1.2.594
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-root-inventory.js +11 -50
- package/dist/agent/addon-scan.js +6 -44
- package/dist/agent/agent-addon-runtime.js +3 -8
- package/dist/agent/agent-addon-updates.js +12 -52
- package/dist/agent/agent-cap-dispatch-service.js +3 -5
- package/dist/agent/agent-config.js +7 -42
- package/dist/agent/agent-deploy-swap.js +5 -41
- package/dist/agent/agent-group-runner.js +8 -47
- package/dist/agent/agent-http-auth.js +10 -22
- package/dist/agent/agent-http.js +69 -115
- package/dist/agent/agent-hub-addon-update.js +10 -16
- package/dist/agent/agent-hub-registration.js +4 -7
- package/dist/agent/agent-infra-capabilities.js +5 -9
- package/dist/agent/agent-json-file.js +5 -42
- package/dist/agent/agent-mesh-gate.js +5 -8
- package/dist/agent/agent-node-certificates.js +25 -28
- package/dist/agent/agent-pairing-local.js +10 -47
- package/dist/agent/agent-pairing-routes.js +16 -20
- package/dist/agent/agent-pairing-store.js +18 -58
- package/dist/agent/agent-reconnect.js +1 -4
- package/dist/agent/agent-service.js +42 -78
- package/dist/agent/agent-sniffing-listener.js +11 -48
- package/dist/agent/agent-undeploy.js +5 -41
- package/dist/agent/agent-update-routes.js +14 -19
- package/dist/agent/agent-update-service.js +38 -80
- package/dist/agent/apply-model-distribution.js +1 -4
- package/dist/agent/apply-stage-dev-uploads.js +6 -9
- package/dist/agent/derive-hub-url.js +3 -8
- package/dist/agent/fetch-bundle-from-hub.js +6 -9
- package/dist/agent/hubs-found.js +6 -43
- package/dist/agent/infra-boot-guard.js +1 -4
- package/dist/agent/infra-boot-plan.js +2 -6
- package/dist/agent/main.js +158 -186
- package/dist/agent/register-agent-cap-dispatch.js +3 -6
- package/dist/agent/serial-queue.js +2 -7
- package/dist/agent-status-page.js +1 -4
- package/dist/api/addon-upload.js +22 -61
- package/dist/api/agent-addon-delivery.js +6 -11
- package/dist/api/auth-whoami.js +1 -4
- package/dist/api/backup-download-pump.js +5 -9
- package/dist/api/backup-download.js +7 -10
- package/dist/api/core/addon-settings.router.js +16 -19
- package/dist/api/core/agent-pairing.router.js +76 -79
- package/dist/api/core/agents.router.js +21 -24
- package/dist/api/core/auth-admin-tokens.procedures.js +48 -52
- package/dist/api/core/auth-device-cert.procedures.js +62 -67
- package/dist/api/core/auth-limits.js +16 -25
- package/dist/api/core/auth-reauth.procedures.js +32 -37
- package/dist/api/core/auth-revoke-credentials.procedures.js +22 -26
- package/dist/api/core/auth-sessions.procedures.js +52 -56
- package/dist/api/core/auth.router.js +300 -304
- package/dist/api/core/cap-providers.js +74 -121
- package/dist/api/core/capabilities.router.js +34 -37
- package/dist/api/core/capability-preference-writes.js +10 -17
- package/dist/api/core/certificates.router.js +106 -109
- package/dist/api/core/cluster-nodes.router.js +15 -18
- package/dist/api/core/collection-preference.js +2 -6
- package/dist/api/core/event-bus-proxy.router.js +34 -37
- package/dist/api/core/failure-contributions.js +4 -8
- package/dist/api/core/hwaccel.router.js +17 -20
- package/dist/api/core/integration-secrets.js +8 -12
- package/dist/api/core/lifecycle-job-runner.js +13 -49
- package/dist/api/core/live-events.router.js +29 -32
- package/dist/api/core/load-contributions.js +4 -8
- package/dist/api/core/logging-settings.js +30 -43
- package/dist/api/core/logs.router.js +40 -43
- package/dist/api/core/notifications.router.js +15 -18
- package/dist/api/core/public-event-filter.js +4 -8
- package/dist/api/core/repl.router.js +18 -21
- package/dist/api/core/request-census-settings.js +11 -16
- package/dist/api/core/server-management.provider.js +1 -4
- package/dist/api/core/server-name.js +9 -17
- package/dist/api/core/site-location.js +16 -24
- package/dist/api/core/stream-probe.router.js +21 -24
- package/dist/api/core/system-events.router.js +23 -26
- package/dist/api/cors/cors-policy.js +20 -29
- package/dist/api/cors/register-cors-policy.js +9 -14
- package/dist/api/deploy-stage-registry.js +6 -10
- package/dist/api/dev-uploads-bundle.js +12 -50
- package/dist/api/health/adaptive-probe.routes.js +9 -13
- package/dist/api/health/health.routes.js +8 -13
- package/dist/api/hub-cluster-url.js +3 -9
- package/dist/api/model-distributor.js +12 -50
- package/dist/api/oauth2/consent-page.js +10 -13
- package/dist/api/oauth2/oauth2-routes.js +17 -25
- package/dist/api/oauth2/private-host.js +1 -4
- package/dist/api/server-upload-propagate.js +15 -51
- package/dist/api/server-upload.js +13 -50
- package/dist/api/sse-no-compression.js +1 -4
- package/dist/api/static/frame-policy.js +4 -9
- package/dist/api/static/precompressed-asset.js +15 -57
- package/dist/api/static/spa-mount.js +8 -47
- package/dist/api/static/spa-static.js +5 -12
- package/dist/api/tarball-manifest.js +7 -44
- package/dist/api/trpc/cap-mount-helpers.js +7 -12
- package/dist/api/trpc/cap-route-error-formatter.js +10 -13
- package/dist/api/trpc/cap-router-runtime.js +40 -51
- package/dist/api/trpc/client-ip.js +9 -20
- package/dist/api/trpc/core-cap-bridge.js +32 -42
- package/dist/api/trpc/device-collection-dispatch.js +23 -27
- package/dist/api/trpc/device-config-secret-redaction.js +24 -40
- package/dist/api/trpc/generated-cap-mounts.js +218 -222
- package/dist/api/trpc/generated-cap-routers.js +4688 -4850
- package/dist/api/trpc/http-request-census-hook.js +8 -11
- package/dist/api/trpc/http-request-census.js +34 -41
- package/dist/api/trpc/http-request-census.singleton.js +4 -8
- package/dist/api/trpc/localized-schema-paths.js +1 -4
- package/dist/api/trpc/principal-visibility.js +14 -22
- package/dist/api/trpc/remote-addon-update-grant.js +1 -4
- package/dist/api/trpc/scope-access.js +10 -15
- package/dist/api/trpc/server-provided-caps.js +3 -7
- package/dist/api/trpc/share-view-access.js +6 -14
- package/dist/api/trpc/trpc-error-device-tags.js +3 -6
- package/dist/api/trpc/trpc-error-principal.js +2 -6
- package/dist/api/trpc/trpc.context.js +20 -25
- package/dist/api/trpc/trpc.middleware.js +38 -46
- package/dist/api/trpc/trpc.router.js +58 -99
- package/dist/api/trpc/user-error.js +5 -8
- package/dist/api/trpc/ws-request-census.js +17 -24
- package/dist/api/trpc/ws-slow-consumer-guard.js +11 -16
- package/dist/api/upload-auth.js +5 -9
- package/dist/auth/addon-route-jwt-gate.js +4 -7
- package/dist/auth/addon-route-share-gate.js +7 -12
- package/dist/auth/app-confirm-page.js +17 -22
- package/dist/auth/app-confirm-routes.js +26 -31
- package/dist/auth/app-confirmations.js +7 -44
- package/dist/auth/app-page-shell.js +17 -30
- package/dist/auth/app-page-strings.js +11 -17
- package/dist/auth/app-passkey-page.js +16 -21
- package/dist/auth/app-passkey-routes.js +37 -41
- package/dist/auth/app-refused-route.js +13 -18
- package/dist/auth/auth-network-policy.js +11 -15
- package/dist/auth/auth-provider-gate.js +4 -9
- package/dist/auth/auth-rate-limit.js +3 -7
- package/dist/auth/client-address.js +6 -9
- package/dist/auth/device-enroll-proofs.js +6 -43
- package/dist/auth/external-link-intents.js +3 -7
- package/dist/auth/hub-sessions.js +6 -12
- package/dist/auth/native-link-completions.js +7 -11
- package/dist/auth/native-return.js +9 -13
- package/dist/auth/passkey-provider.js +26 -32
- package/dist/auth/second-factors.js +6 -10
- package/dist/auth/session-connections.js +6 -12
- package/dist/auth/session-cookie.js +12 -23
- package/dist/auth/session-lifetimes.js +8 -12
- package/dist/auth/session-mint.js +4 -11
- package/dist/auth/sso-finish-app.js +13 -16
- package/dist/auth/sso-finish-deps.js +21 -27
- package/dist/auth/sso-finish.js +28 -38
- package/dist/auth/sso-routes.js +22 -25
- package/dist/auth/used-bridge-ids.js +1 -5
- package/dist/boot/boot-config.js +16 -55
- package/dist/boot/init-sequence.js +1 -4
- package/dist/boot/integration-id-backfill.js +3 -8
- package/dist/boot/platform-keychain-key.js +5 -42
- package/dist/boot/post-boot.service.js +14 -18
- package/dist/boot/reconcile-lifecycle-jobs.js +3 -6
- package/dist/boot/retired-public-url-env.js +4 -8
- package/dist/bootstrap-packages.js +1 -4
- package/dist/closure-node-modules.js +2 -38
- package/dist/closure-patches/patch-reach.json +6 -2
- package/dist/core/addon/addon-call-gateway.js +1 -5
- package/dist/core/addon/addon-package.service.js +83 -123
- package/dist/core/addon/addon-process-view.js +2 -6
- package/dist/core/addon/addon-realign-plan.js +1 -4
- package/dist/core/addon/addon-registry.service.js +199 -185
- package/dist/core/addon/addon-row-manifest.js +1 -4
- package/dist/core/addon/addon-search.service.js +3 -7
- package/dist/core/addon/addon-settings-provider.js +1 -3
- package/dist/core/addon/addon-uninstall.js +4 -11
- package/dist/core/addon/addon.tokens.js +2 -5
- package/dist/core/addon/device-meta-mirror.js +8 -13
- package/dist/core/addon/forked-custom-actions.js +6 -11
- package/dist/core/addon/integration-visibility.js +3 -6
- package/dist/core/addon/materialize-route-path.js +1 -4
- package/dist/core/addon/package-dir-utils.js +8 -45
- package/dist/core/addon/prune-misplaced-addons.js +5 -43
- package/dist/core/addon/runner-convergence.js +1 -4
- package/dist/core/addon/runner-serialization.js +1 -4
- package/dist/core/addon/runner-spawn-fanout.js +3 -8
- package/dist/core/addon/settings-door-wiring.js +5 -8
- package/dist/core/addon/single-flight-refresh.js +1 -4
- package/dist/core/addon-bridge/addon-bridge.service.js +7 -44
- package/dist/core/addon-pages/addon-pages.service.js +3 -40
- package/dist/core/addon-widgets/addon-widgets.service.js +4 -42
- package/dist/core/agent/agent-addon-backfill.js +9 -17
- package/dist/core/agent/agent-delivery-ledger.js +3 -7
- package/dist/core/agent/agent-liveness-event.js +2 -6
- package/dist/core/agent/agent-pairing-http.js +41 -45
- package/dist/core/agent/agent-registry.service.js +53 -92
- package/dist/core/agent/cluster-node-history-mirror.js +3 -7
- package/dist/core/agent/cluster-node-history-store.js +113 -58
- package/dist/core/agent/hub-agent-pairing.js +1 -5
- package/dist/core/agent/node-certificates-client.js +3 -6
- package/dist/core/agent/node-directory.js +1 -4
- package/dist/core/app-links/well-known-app-links.js +2 -6
- package/dist/core/auth/auth.service.js +3 -8
- package/dist/core/auth/handoff-code.service.js +11 -49
- package/dist/core/auth/record-kinds.js +35 -0
- package/dist/core/auth/share-token.service.js +174 -122
- package/dist/core/capability/capability.service.js +1 -5
- package/dist/core/config/config.schema.js +1 -6
- package/dist/core/config/config.service.js +2 -6
- package/dist/core/events/event-bus.service.js +3 -7
- package/dist/core/feature/feature.service.js +2 -6
- package/dist/core/lifecycle/lifecycle-runner.singleton.js +5 -10
- package/dist/core/lifecycle/lifecycle-state-machine.js +1 -5
- package/dist/core/logging/log-ring-buffer.js +1 -5
- package/dist/core/logging/logging.service.js +5 -9
- package/dist/core/logging/scoped-logger.js +1 -5
- package/dist/core/moleculer/agent-readiness-pull.js +1 -4
- package/dist/core/moleculer/agent-registration-request.js +3 -7
- package/dist/core/moleculer/cap-call-fn.js +39 -5
- package/dist/core/moleculer/cap-route-authority.js +3 -8
- package/dist/core/moleculer/hub-mesh-guard.js +5 -9
- package/dist/core/moleculer/moleculer.service.js +108 -119
- package/dist/core/network/network-quality.service.js +2 -6
- package/dist/core/notification/notification-wrapper.service.js +3 -7
- package/dist/core/notification/toast-wrapper.service.js +3 -7
- package/dist/core/provider/provider.tokens.js +1 -4
- package/dist/core/repl/repl-engine.service.js +4 -8
- package/dist/core/runner-health/runner-boot-check.js +7 -15
- package/dist/core/runner-health/update-preflight.js +9 -14
- package/dist/core/server-update/server-update.service.js +12 -49
- package/dist/core/server-update/system-apply-closure-patches.js +6 -42
- package/dist/core/server-update/system-ensure-prebuilds.js +3 -6
- package/dist/core/server-update/system-exec-npm.js +2 -5
- package/dist/core/storage/fs-storage-backend.js +1 -5
- package/dist/core/storage/storage-location-manager.js +1 -5
- package/dist/core/storage/storage.service.js +2 -6
- package/dist/core/streaming/ffmpeg-stream-info.js +3 -8
- package/dist/core/streaming/stream-probe.service.js +12 -16
- package/dist/core/streaming/ttl-cache.js +1 -5
- package/dist/core/topology/topology-emitter.service.js +19 -23
- package/dist/core/update-availability-emitter.js +3 -7
- package/dist/core/update-availability-store.js +8 -45
- package/dist/core/updates/agent-installed-packages.js +5 -9
- package/dist/core/updates/restart-marker.js +3 -8
- package/dist/core/updates/update-check-scheduler.js +13 -18
- package/dist/core/updates/wrapper-update-checker.js +3 -7
- package/dist/first-boot-addon-plan.js +2 -6
- package/dist/framework-nodepath.js +2 -38
- package/dist/i18n/request-lang.js +7 -11
- package/dist/launcher.js +30 -65
- package/dist/lifecycle-journal-path.js +2 -38
- package/dist/main.js +287 -324
- package/dist/manual-boot.js +120 -157
- package/dist/node-role.js +1 -4
- package/dist/package-inventory.js +7 -48
- package/dist/pending-restore.js +7 -43
- package/dist/single-copy-cleanup-runner.js +9 -45
- package/dist/single-copy-cleanup.js +7 -15
- package/dist/sqlite-restore.js +9 -48
- package/dist/starter.js +4 -39
- package/dist/ui-serving/lazy-ui-serving.js +3 -39
- package/package.json +13 -13
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.NetworkQualityService = void 0;
|
|
4
|
-
const system_1 = require("@camstack/system");
|
|
5
|
-
class NetworkQualityService extends system_1.NetworkQualityTracker {
|
|
1
|
+
import { NetworkQualityTracker } from '@camstack/system';
|
|
2
|
+
export class NetworkQualityService extends NetworkQualityTracker {
|
|
6
3
|
}
|
|
7
|
-
exports.NetworkQualityService = NetworkQualityService;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotificationServiceWrapper = void 0;
|
|
4
|
-
const system_1 = require("@camstack/system");
|
|
1
|
+
import { NotificationService } from '@camstack/system';
|
|
5
2
|
/**
|
|
6
3
|
* NestJS-injectable wrapper around the core NotificationService.
|
|
7
4
|
*
|
|
8
5
|
* Lazily creates the NotificationService on first use, wiring in the
|
|
9
6
|
* CapabilityRegistry for proxy-based output resolution.
|
|
10
7
|
*/
|
|
11
|
-
class NotificationServiceWrapper {
|
|
8
|
+
export class NotificationServiceWrapper {
|
|
12
9
|
caps;
|
|
13
10
|
logging;
|
|
14
11
|
_service = null;
|
|
@@ -18,7 +15,7 @@ class NotificationServiceWrapper {
|
|
|
18
15
|
}
|
|
19
16
|
get service() {
|
|
20
17
|
if (!this._service) {
|
|
21
|
-
this._service = new
|
|
18
|
+
this._service = new NotificationService(this.logging.createLogger('notifications'));
|
|
22
19
|
const registry = this.caps.getRegistry();
|
|
23
20
|
if (registry) {
|
|
24
21
|
this._service.setRegistry(registry);
|
|
@@ -30,4 +27,3 @@ class NotificationServiceWrapper {
|
|
|
30
27
|
return this.service.notify(notification);
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
|
-
exports.NotificationServiceWrapper = NotificationServiceWrapper;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToastServiceWrapper = void 0;
|
|
4
|
-
const system_1 = require("@camstack/system");
|
|
1
|
+
import { ToastService } from '@camstack/system';
|
|
5
2
|
/**
|
|
6
3
|
* NestJS-injectable wrapper around the core ToastService.
|
|
7
4
|
*
|
|
8
5
|
* Provides toast broadcasting to connected UI clients.
|
|
9
6
|
*/
|
|
10
|
-
class ToastServiceWrapper {
|
|
11
|
-
_service = new
|
|
7
|
+
export class ToastServiceWrapper {
|
|
8
|
+
_service = new ToastService();
|
|
12
9
|
get service() {
|
|
13
10
|
return this._service;
|
|
14
11
|
}
|
|
@@ -22,4 +19,3 @@ class ToastServiceWrapper {
|
|
|
22
19
|
return this._service.subscribe(connectionId, userId, callback);
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
exports.ToastServiceWrapper = ToastServiceWrapper;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const system_1 = require("@camstack/system");
|
|
5
|
-
const types_1 = require("@camstack/types");
|
|
6
|
-
class ReplEngineService extends system_1.ReplEngine {
|
|
1
|
+
import { ReplEngine } from '@camstack/system';
|
|
2
|
+
import { SystemMirror } from '@camstack/types';
|
|
3
|
+
export class ReplEngineService extends ReplEngine {
|
|
7
4
|
/**
|
|
8
5
|
* Lazily-instantiated `SystemMirror` shared across REPL sessions.
|
|
9
6
|
* Holds a single warm-boot mirror that every `sm.getDeviceById(id)`
|
|
@@ -48,7 +45,7 @@ class ReplEngineService extends system_1.ReplEngine {
|
|
|
48
45
|
return Promise.resolve(this.systemMirror);
|
|
49
46
|
if (!this.systemMirrorInit) {
|
|
50
47
|
const api = this.buildInProcessApi(addonRegistry, eventBus);
|
|
51
|
-
const sm = new
|
|
48
|
+
const sm = new SystemMirror(api);
|
|
52
49
|
this.systemMirrorInit = sm.init().then(() => {
|
|
53
50
|
this.systemMirror = sm;
|
|
54
51
|
return sm;
|
|
@@ -137,4 +134,3 @@ class ReplEngineService extends system_1.ReplEngine {
|
|
|
137
134
|
super(contextProvider);
|
|
138
135
|
}
|
|
139
136
|
}
|
|
140
|
-
exports.ReplEngineService = ReplEngineService;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RunnerBootCheckService = exports.RUNNER_BOOT_CHECK_DELAY_MS = void 0;
|
|
4
|
-
exports.evaluateRunnerBootCheck = evaluateRunnerBootCheck;
|
|
5
|
-
exports.isRunnerBootCheckSettled = isRunnerBootCheckSettled;
|
|
6
|
-
exports.isRunnerBootCheckDegraded = isRunnerBootCheckDegraded;
|
|
7
|
-
exports.describeRunnerBootCheck = describeRunnerBootCheck;
|
|
8
1
|
/**
|
|
9
2
|
* Pure verdict. A planned runner is `running`, `refused` (typed Init refusal),
|
|
10
3
|
* `missing` (the process service has no entry), or `failed` - which here means
|
|
11
4
|
* "has an entry and is none of the above": the D6 breaker's terminal state, a
|
|
12
5
|
* crash waiting on its backoff, a stop, or a start that never reached READY.
|
|
13
6
|
*/
|
|
14
|
-
function evaluateRunnerBootCheck(input) {
|
|
7
|
+
export function evaluateRunnerBootCheck(input) {
|
|
15
8
|
const byName = new Map(input.processes.map((p) => [p.name, p]));
|
|
16
9
|
const expectedIds = input.planned ?? input.processes.map((p) => p.name);
|
|
17
10
|
const failed = [];
|
|
@@ -55,16 +48,16 @@ function evaluateRunnerBootCheck(input) {
|
|
|
55
48
|
};
|
|
56
49
|
}
|
|
57
50
|
/** True when no runner is still on its way - only a settled verdict is pushed. */
|
|
58
|
-
function isRunnerBootCheckSettled(check) {
|
|
51
|
+
export function isRunnerBootCheckSettled(check) {
|
|
59
52
|
return (check.pending ?? []).length === 0;
|
|
60
53
|
}
|
|
61
54
|
/** True when the check found anything an operator has to act on. */
|
|
62
|
-
function isRunnerBootCheckDegraded(check) {
|
|
55
|
+
export function isRunnerBootCheckDegraded(check) {
|
|
63
56
|
return (check !== undefined &&
|
|
64
57
|
(check.failed.length > 0 || check.refused.length > 0 || check.missing.length > 0));
|
|
65
58
|
}
|
|
66
59
|
/** One sentence naming the findings, for a log line or an alert. */
|
|
67
|
-
function describeRunnerBootCheck(check) {
|
|
60
|
+
export function describeRunnerBootCheck(check) {
|
|
68
61
|
const parts = [];
|
|
69
62
|
if (check.failed.length > 0)
|
|
70
63
|
parts.push(`failed: ${check.failed.join(', ')}`);
|
|
@@ -77,8 +70,8 @@ function describeRunnerBootCheck(check) {
|
|
|
77
70
|
parts.push(`still starting: ${(check.pending ?? []).join(', ')}`);
|
|
78
71
|
return `${check.running}/${check.expected} runners running${parts.length > 0 ? ` - ${parts.join(' - ')}` : ''}`;
|
|
79
72
|
}
|
|
80
|
-
|
|
81
|
-
class RunnerBootCheckService {
|
|
73
|
+
export const RUNNER_BOOT_CHECK_DELAY_MS = 60_000;
|
|
74
|
+
export class RunnerBootCheckService {
|
|
82
75
|
options;
|
|
83
76
|
latest;
|
|
84
77
|
timer = null;
|
|
@@ -90,7 +83,7 @@ class RunnerBootCheckService {
|
|
|
90
83
|
return this.latest;
|
|
91
84
|
}
|
|
92
85
|
/** Arm the one-shot check. A second call while armed is a no-op. */
|
|
93
|
-
scheduleAfterBoot(delayMs =
|
|
86
|
+
scheduleAfterBoot(delayMs = RUNNER_BOOT_CHECK_DELAY_MS) {
|
|
94
87
|
if (this.timer !== null)
|
|
95
88
|
return;
|
|
96
89
|
this.timer = setTimeout(() => {
|
|
@@ -172,4 +165,3 @@ class RunnerBootCheckService {
|
|
|
172
165
|
return check;
|
|
173
166
|
}
|
|
174
167
|
}
|
|
175
|
-
exports.RunnerBootCheckService = RunnerBootCheckService;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LEGACY_BLOB_GUARD_SINCE = void 0;
|
|
4
|
-
exports.buildUpdatePreflight = buildUpdatePreflight;
|
|
5
|
-
exports.legacyGuardClientOf = legacyGuardClientOf;
|
|
6
1
|
/**
|
|
7
2
|
* The `applyServerUpdate` pre-flight (D877).
|
|
8
3
|
*
|
|
@@ -20,13 +15,13 @@ exports.legacyGuardClientOf = legacyGuardClientOf;
|
|
|
20
15
|
* the refusals listed here - a new deterministic Init refusal has to be added
|
|
21
16
|
* to this module to be pre-checked.
|
|
22
17
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
import { assertLegacyBlobsMigrated, UNMIGRATED_SETTINGS_REMEDY, UnmigratedSettingsError, } from '@camstack/system';
|
|
19
|
+
import { compareSemver } from '../../server-root/index.js';
|
|
25
20
|
/** The first server version whose addons run `assertLegacyBlobsMigrated` at Init. */
|
|
26
|
-
|
|
27
|
-
function buildUpdatePreflight(deps) {
|
|
21
|
+
export const LEGACY_BLOB_GUARD_SINCE = '1.2.585';
|
|
22
|
+
export function buildUpdatePreflight(deps) {
|
|
28
23
|
return async (targetVersion) => {
|
|
29
|
-
if (
|
|
24
|
+
if (compareSemver(targetVersion, LEGACY_BLOB_GUARD_SINCE) < 0)
|
|
30
25
|
return [];
|
|
31
26
|
const store = deps.store();
|
|
32
27
|
if (store === null) {
|
|
@@ -35,17 +30,17 @@ function buildUpdatePreflight(deps) {
|
|
|
35
30
|
const blockers = [];
|
|
36
31
|
for (const addonId of deps.forkedAddonIds()) {
|
|
37
32
|
try {
|
|
38
|
-
await
|
|
33
|
+
await assertLegacyBlobsMigrated(store, addonId, deps.logger);
|
|
39
34
|
}
|
|
40
35
|
catch (err) {
|
|
41
36
|
// A refusal is the finding; any other error is "could not ask" and the
|
|
42
37
|
// caller treats a throw as exactly that (it never blocks on it).
|
|
43
|
-
if (!(err instanceof
|
|
38
|
+
if (!(err instanceof UnmigratedSettingsError))
|
|
44
39
|
throw err;
|
|
45
40
|
blockers.push({
|
|
46
41
|
addonId,
|
|
47
42
|
reason: err.message,
|
|
48
|
-
remedy:
|
|
43
|
+
remedy: UNMIGRATED_SETTINGS_REMEDY,
|
|
49
44
|
});
|
|
50
45
|
}
|
|
51
46
|
}
|
|
@@ -53,7 +48,7 @@ function buildUpdatePreflight(deps) {
|
|
|
53
48
|
};
|
|
54
49
|
}
|
|
55
50
|
/** The three store calls the guard makes, over the hub's `settings-store` provider. */
|
|
56
|
-
function legacyGuardClientOf(store) {
|
|
51
|
+
export function legacyGuardClientOf(store) {
|
|
57
52
|
return {
|
|
58
53
|
query: { query: (input) => store.query(input) },
|
|
59
54
|
get: { query: (input) => store.get(input) },
|
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ServerUpdateService = void 0;
|
|
37
1
|
/**
|
|
38
2
|
* ServerUpdateService — hub-side adapter over the SHARED `RootUpdateService`
|
|
39
3
|
* (`@camstack/node-root`, bundled into `dist/server-root/index.js`).
|
|
@@ -51,13 +15,13 @@ exports.ServerUpdateService = void 0;
|
|
|
51
15
|
*
|
|
52
16
|
* Spec: docs/superpowers/specs/2026-07-18-single-framework-copy-collapse-design.md
|
|
53
17
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class ServerUpdateService extends
|
|
18
|
+
import * as path from 'node:path';
|
|
19
|
+
import { HUB_ROOT_SPEC, RootUpdateService, } from '../../server-root/index.js';
|
|
20
|
+
import { UpdateAvailabilityEmitter } from '../update-availability-emitter.js';
|
|
21
|
+
import { buildSystemEnsureNativePrebuilds, } from './system-ensure-prebuilds.js';
|
|
22
|
+
import { buildSystemApplyClosurePatches, } from './system-apply-closure-patches.js';
|
|
23
|
+
import { buildSystemExecNpm } from './system-exec-npm.js';
|
|
24
|
+
export class ServerUpdateService extends RootUpdateService {
|
|
61
25
|
updateAvailability;
|
|
62
26
|
nodeId;
|
|
63
27
|
constructor(options) {
|
|
@@ -70,7 +34,7 @@ class ServerUpdateService extends index_js_1.RootUpdateService {
|
|
|
70
34
|
// the availability emitter.
|
|
71
35
|
const nodeId = options.nodeId ?? 'hub';
|
|
72
36
|
super({
|
|
73
|
-
spec:
|
|
37
|
+
spec: HUB_ROOT_SPEC,
|
|
74
38
|
nodeId,
|
|
75
39
|
envNames: {
|
|
76
40
|
bootMode: 'CAMSTACK_SERVER_BOOT_MODE',
|
|
@@ -88,19 +52,19 @@ class ServerUpdateService extends index_js_1.RootUpdateService {
|
|
|
88
52
|
// packaged desktop app with a bare bundled Node) can still stage a root
|
|
89
53
|
// update. `cacheDir` mirrors AddonInstaller's `<dataDir>/addons/.npm-bootstrap`.
|
|
90
54
|
execNpm: options.execNpm ??
|
|
91
|
-
|
|
55
|
+
buildSystemExecNpm({
|
|
92
56
|
cacheDir: path.join(dataDir, 'addons', '.npm-bootstrap'),
|
|
93
57
|
logger: options.logger,
|
|
94
58
|
}),
|
|
95
59
|
// Fetch a missing `better-sqlite3` prebuild for the running ABI before the
|
|
96
60
|
// native-prebuild validator refuses the swap (toolchain-less packaged
|
|
97
61
|
// desktop). No-op on docker where the install already carried it.
|
|
98
|
-
ensureNativePrebuilds: options.ensureNativePrebuilds ??
|
|
62
|
+
ensureNativePrebuilds: options.ensureNativePrebuilds ?? buildSystemEnsureNativePrebuilds(options.logger),
|
|
99
63
|
// Apply the closure patches ourselves. npm 12 blocks the root package's
|
|
100
64
|
// postinstall by default, and a silently-unpatched closure is refused by
|
|
101
65
|
// the validator — an update that can never apply. Idempotent, so this
|
|
102
66
|
// costs nothing where npm did run the lifecycle.
|
|
103
|
-
applyClosurePatches: options.applyClosurePatches ??
|
|
67
|
+
applyClosurePatches: options.applyClosurePatches ?? buildSystemApplyClosurePatches(options.logger),
|
|
104
68
|
env: options.env,
|
|
105
69
|
now: options.now,
|
|
106
70
|
...(options.updatePreflight !== undefined
|
|
@@ -112,7 +76,7 @@ class ServerUpdateService extends index_js_1.RootUpdateService {
|
|
|
112
76
|
});
|
|
113
77
|
this.updateAvailability =
|
|
114
78
|
options.eventBus !== undefined
|
|
115
|
-
? new
|
|
79
|
+
? new UpdateAvailabilityEmitter(options.eventBus, { type: 'core', id: 'server-update-service' }, options.updateAvailabilityStore)
|
|
116
80
|
: null;
|
|
117
81
|
this.nodeId = nodeId;
|
|
118
82
|
}
|
|
@@ -135,4 +99,3 @@ class ServerUpdateService extends index_js_1.RootUpdateService {
|
|
|
135
99
|
return result;
|
|
136
100
|
}
|
|
137
101
|
}
|
|
138
|
-
exports.ServerUpdateService = ServerUpdateService;
|
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.buildSystemApplyClosurePatches = buildSystemApplyClosurePatches;
|
|
37
1
|
/**
|
|
38
2
|
* `buildSystemApplyClosurePatches` — run the root package's OWN shipped patch
|
|
39
3
|
* applier inside a staged closure, without going through npm.
|
|
@@ -69,16 +33,16 @@ exports.buildSystemApplyClosurePatches = buildSystemApplyClosurePatches;
|
|
|
69
33
|
* with `PATH=/usr/bin:/bin:/usr/sbin:/sbin`), so resolving `node` by name would
|
|
70
34
|
* ENOENT on exactly the host this was written for.
|
|
71
35
|
*/
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const execFileAsync =
|
|
36
|
+
import { execFile } from 'node:child_process';
|
|
37
|
+
import * as fs from 'node:fs';
|
|
38
|
+
import * as path from 'node:path';
|
|
39
|
+
import { promisify } from 'node:util';
|
|
40
|
+
const execFileAsync = promisify(execFile);
|
|
77
41
|
/** Where the published root package keeps its applier, inside a closure. */
|
|
78
42
|
const APPLIER_REL = ['node_modules', '@camstack', 'server', 'scripts', 'closure-postinstall.mjs'];
|
|
79
43
|
/** A patch pass must never be the slow part of an update. */
|
|
80
44
|
const APPLY_TIMEOUT_MS = 60_000;
|
|
81
|
-
function buildSystemApplyClosurePatches(logger) {
|
|
45
|
+
export function buildSystemApplyClosurePatches(logger) {
|
|
82
46
|
return async (closureDir) => {
|
|
83
47
|
const applier = path.join(closureDir, ...APPLIER_REL);
|
|
84
48
|
if (!fs.existsSync(applier)) {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildSystemEnsureNativePrebuilds = buildSystemEnsureNativePrebuilds;
|
|
4
1
|
/**
|
|
5
2
|
* `buildSystemEnsureNativePrebuilds` — the `@camstack/system`-backed
|
|
6
3
|
* `ensureNativePrebuilds` adapter the shared `RootUpdateService` uses as its
|
|
@@ -14,9 +11,9 @@ exports.buildSystemEnsureNativePrebuilds = buildSystemEnsureNativePrebuilds;
|
|
|
14
11
|
* already landed → a no-op); it only acts on a toolchain-less packaged desktop
|
|
15
12
|
* whose `npm install` left `better-sqlite3` source-only.
|
|
16
13
|
*/
|
|
17
|
-
|
|
18
|
-
function buildSystemEnsureNativePrebuilds(logger) {
|
|
14
|
+
import { ensureNativePrebuilds } from '@camstack/system';
|
|
15
|
+
export function buildSystemEnsureNativePrebuilds(logger) {
|
|
19
16
|
return async (closureDir) => {
|
|
20
|
-
await
|
|
17
|
+
await ensureNativePrebuilds(closureDir, { logger });
|
|
21
18
|
};
|
|
22
19
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildSystemExecNpm = buildSystemExecNpm;
|
|
4
1
|
/**
|
|
5
2
|
* `buildSystemExecNpm` — the runNpm-backed `execNpm` the shared
|
|
6
3
|
* `RootUpdateService` uses to shell out to npm when staging a root-package
|
|
@@ -18,8 +15,8 @@ exports.buildSystemExecNpm = buildSystemExecNpm;
|
|
|
18
15
|
* `runNpmFn` is a module-level DI seam (defaults to the real `runNpm`) so the
|
|
19
16
|
* arg/cwd/timeout mapping is unit-testable without touching the network.
|
|
20
17
|
*/
|
|
21
|
-
|
|
22
|
-
function buildSystemExecNpm(options, runNpmFn =
|
|
18
|
+
import { runNpm } from '@camstack/system';
|
|
19
|
+
export function buildSystemExecNpm(options, runNpmFn = runNpm) {
|
|
23
20
|
return async (args, opts) => {
|
|
24
21
|
const { stdout } = await runNpmFn(args, {
|
|
25
22
|
cacheDir: options.cacheDir,
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FsStorageBackend = void 0;
|
|
4
1
|
// Re-export from @camstack/system
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports, "FsStorageBackend", { enumerable: true, get: function () { return system_1.FsStorageBackend; } });
|
|
2
|
+
export { FsStorageBackend } from '@camstack/system';
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StorageLocationManager = void 0;
|
|
4
1
|
// Re-export from @camstack/system
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports, "StorageLocationManager", { enumerable: true, get: function () { return system_1.StorageLocationManager; } });
|
|
2
|
+
export { StorageLocationManager } from '@camstack/system';
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.StorageService = void 0;
|
|
4
|
-
const system_1 = require("@camstack/system");
|
|
5
|
-
class StorageService extends system_1.StorageManager {
|
|
1
|
+
import { StorageManager } from '@camstack/system';
|
|
2
|
+
export class StorageService extends StorageManager {
|
|
6
3
|
}
|
|
7
|
-
exports.StorageService = StorageService;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildStreamProbeArgs = buildStreamProbeArgs;
|
|
4
|
-
exports.probeFoundAStream = probeFoundAStream;
|
|
5
|
-
exports.parseFfmpegStreamInfo = parseFfmpegStreamInfo;
|
|
6
1
|
/** How long the probe waits on a network input, in µs (ffmpeg's unit). */
|
|
7
2
|
const PROBE_INPUT_TIMEOUT_US = '5000000';
|
|
8
3
|
/**
|
|
@@ -14,7 +9,7 @@ const PROBE_INPUT_TIMEOUT_US = '5000000';
|
|
|
14
9
|
* `-timeout` is an http and rtsp option, is unknown to a file, and on rtmp
|
|
15
10
|
* would mean LISTEN mode. So each scheme gets exactly what it consumes.
|
|
16
11
|
*/
|
|
17
|
-
function buildStreamProbeArgs(url) {
|
|
12
|
+
export function buildStreamProbeArgs(url) {
|
|
18
13
|
const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(url)?.[1]?.toLowerCase() ?? '';
|
|
19
14
|
const input = [];
|
|
20
15
|
if (scheme === 'rtsp' || scheme === 'rtsps') {
|
|
@@ -26,7 +21,7 @@ function buildStreamProbeArgs(url) {
|
|
|
26
21
|
return ['-hide_banner', '-nostdin', ...input, '-i', url];
|
|
27
22
|
}
|
|
28
23
|
/** Did the probe find anything at all? An empty result is a failed probe. */
|
|
29
|
-
function probeFoundAStream(meta) {
|
|
24
|
+
export function probeFoundAStream(meta) {
|
|
30
25
|
return meta.codec !== undefined || meta.audio !== undefined;
|
|
31
26
|
}
|
|
32
27
|
/** Codec aliases normalised to canonical names. */
|
|
@@ -120,7 +115,7 @@ function readAudio(body) {
|
|
|
120
115
|
return audio;
|
|
121
116
|
}
|
|
122
117
|
/** The FIRST video and FIRST audio stream of `ffmpeg -i`'s report. */
|
|
123
|
-
function parseFfmpegStreamInfo(stderr) {
|
|
118
|
+
export function parseFfmpegStreamInfo(stderr) {
|
|
124
119
|
const meta = {};
|
|
125
120
|
// CRLF too: `(.*)$` cannot cross a `\r`, and a Windows build or a captured
|
|
126
121
|
// log hands one over.
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const ttl_cache_1 = require("./ttl-cache");
|
|
6
|
-
const types_1 = require("@camstack/types");
|
|
7
|
-
const ffmpeg_stream_info_1 = require("./ffmpeg-stream-info");
|
|
1
|
+
import { execFile } from 'child_process';
|
|
2
|
+
import { TtlCache } from './ttl-cache';
|
|
3
|
+
import { errMsg } from '@camstack/types';
|
|
4
|
+
import { buildStreamProbeArgs, parseFfmpegStreamInfo, probeFoundAStream, } from './ffmpeg-stream-info';
|
|
8
5
|
const CACHE_TTL_MS = 3_600_000; // 1 hour
|
|
9
6
|
const PROBE_TIMEOUT_MS = 5_000;
|
|
10
7
|
/**
|
|
@@ -22,7 +19,7 @@ const CACHE_MAX_ENTRIES = 512;
|
|
|
22
19
|
function redactUrl(text) {
|
|
23
20
|
return text.replace(/\/\/[^@/\s]*@/g, '//***@');
|
|
24
21
|
}
|
|
25
|
-
class StreamProbeService {
|
|
22
|
+
export class StreamProbeService {
|
|
26
23
|
resolveFfmpeg;
|
|
27
24
|
logger;
|
|
28
25
|
/**
|
|
@@ -32,7 +29,7 @@ class StreamProbeService {
|
|
|
32
29
|
* was probed again — so an entry nobody asked about a second time was never
|
|
33
30
|
* found expired and never removed. See {@link TtlCache}.
|
|
34
31
|
*/
|
|
35
|
-
cache = new
|
|
32
|
+
cache = new TtlCache({
|
|
36
33
|
ttlMs: CACHE_TTL_MS,
|
|
37
34
|
maxEntries: CACHE_MAX_ENTRIES,
|
|
38
35
|
});
|
|
@@ -57,7 +54,7 @@ class StreamProbeService {
|
|
|
57
54
|
// Only an ANSWER is cached. An empty result is a probe that failed (no
|
|
58
55
|
// binary, a timeout, a refused dial), and caching it for an hour made one
|
|
59
56
|
// bad moment the answer for an hour.
|
|
60
|
-
if (
|
|
57
|
+
if (probeFoundAStream(metadata))
|
|
61
58
|
this.cache.set(url, metadata);
|
|
62
59
|
return metadata;
|
|
63
60
|
}
|
|
@@ -124,7 +121,7 @@ class StreamProbeService {
|
|
|
124
121
|
// We aborted intentionally after reading headers — that's success
|
|
125
122
|
return { status: 'ok', labels: ['Reachable'] };
|
|
126
123
|
}
|
|
127
|
-
const msg =
|
|
124
|
+
const msg = errMsg(err);
|
|
128
125
|
return { status: 'error', error: `Unreachable: ${msg}` };
|
|
129
126
|
}
|
|
130
127
|
}
|
|
@@ -149,7 +146,7 @@ class StreamProbeService {
|
|
|
149
146
|
}
|
|
150
147
|
catch (err) {
|
|
151
148
|
this.logger.error('stream probe refused — no pinned ffmpeg on this node (D540)', {
|
|
152
|
-
meta: { url: redactUrl(url), error:
|
|
149
|
+
meta: { url: redactUrl(url), error: errMsg(err) },
|
|
153
150
|
});
|
|
154
151
|
return {};
|
|
155
152
|
}
|
|
@@ -157,10 +154,10 @@ class StreamProbeService {
|
|
|
157
154
|
// exits non-zero for want of an output. That exit is the expected one, so
|
|
158
155
|
// the report is read whatever the code; an empty report is the failure.
|
|
159
156
|
const stderr = await new Promise((resolve) => {
|
|
160
|
-
|
|
157
|
+
execFile(ffmpeg, buildStreamProbeArgs(url), { timeout: PROBE_TIMEOUT_MS, encoding: 'utf8' }, (_err, _stdout, errText) => resolve(errText));
|
|
161
158
|
});
|
|
162
|
-
const metadata =
|
|
163
|
-
if (!
|
|
159
|
+
const metadata = parseFfmpegStreamInfo(stderr);
|
|
160
|
+
if (!probeFoundAStream(metadata)) {
|
|
164
161
|
this.logger.error('stream probe found no stream', {
|
|
165
162
|
meta: { url: redactUrl(url), stderr: redactUrl(stderr.trim().slice(-500)) },
|
|
166
163
|
});
|
|
@@ -168,4 +165,3 @@ class StreamProbeService {
|
|
|
168
165
|
return metadata;
|
|
169
166
|
}
|
|
170
167
|
}
|
|
171
|
-
exports.StreamProbeService = StreamProbeService;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TtlCache = void 0;
|
|
4
|
-
class TtlCache {
|
|
1
|
+
export class TtlCache {
|
|
5
2
|
entries = new Map();
|
|
6
3
|
ttlMs;
|
|
7
4
|
maxEntries;
|
|
@@ -69,4 +66,3 @@ class TtlCache {
|
|
|
69
66
|
}
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
|
-
exports.TtlCache = TtlCache;
|