@camstack/system 1.0.2
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/addon-api-factory.d.ts +35 -0
- package/dist/addon-routes/addon-route-registry.d.ts +37 -0
- package/dist/addon-runner.js +599 -0
- package/dist/addon-runner.mjs +597 -0
- package/dist/auth/api-key-manager.d.ts +26 -0
- package/dist/auth/auth-manager.d.ts +109 -0
- package/dist/auth/parse-record.d.ts +18 -0
- package/dist/auth/scope-matcher.d.ts +7 -0
- package/dist/auth/scoped-token-manager.d.ts +40 -0
- package/dist/auth/totp-manager.d.ts +51 -0
- package/dist/auth/user-manager.d.ts +34 -0
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.d.ts +53 -0
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +259 -0
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +251 -0
- package/dist/builtins/addon-pages-aggregator/dedupe-pages.d.ts +6 -0
- package/dist/builtins/addon-pages-aggregator/index.d.ts +1 -0
- package/dist/builtins/addon-pages-aggregator/index.js +8 -0
- package/dist/builtins/addon-pages-aggregator/index.mjs +2 -0
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.d.ts +47 -0
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +228 -0
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +220 -0
- package/dist/builtins/addon-widgets-aggregator/index.d.ts +1 -0
- package/dist/builtins/addon-widgets-aggregator/index.js +8 -0
- package/dist/builtins/addon-widgets-aggregator/index.mjs +2 -0
- package/dist/builtins/alerts/alerts.addon.d.ts +81 -0
- package/dist/builtins/alerts/alerts.addon.js +601 -0
- package/dist/builtins/alerts/alerts.addon.mjs +595 -0
- package/dist/builtins/alerts/index.d.ts +1 -0
- package/dist/builtins/alerts/index.js +4 -0
- package/dist/builtins/alerts/index.mjs +2 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +147 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2229 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2220 -0
- package/dist/builtins/backup-orchestrator/cron-helpers.d.ts +23 -0
- package/dist/builtins/backup-orchestrator/destination-policy.d.ts +72 -0
- package/dist/builtins/backup-orchestrator/download-helpers.d.ts +12 -0
- package/dist/builtins/backup-orchestrator/index.d.ts +2 -0
- package/dist/builtins/backup-orchestrator/index.js +8 -0
- package/dist/builtins/backup-orchestrator/index.mjs +2 -0
- package/dist/builtins/backup-orchestrator/manifest-store.d.ts +77 -0
- package/dist/builtins/console-logging/console-destination.d.ts +13 -0
- package/dist/builtins/console-logging/console-logging.addon.d.ts +25 -0
- package/dist/builtins/console-logging/index.d.ts +3 -0
- package/dist/builtins/console-logging/index.js +104 -0
- package/dist/builtins/console-logging/index.mjs +95 -0
- package/dist/builtins/device-manager/device-config-contribution.d.ts +32 -0
- package/dist/builtins/device-manager/device-event-propagator.d.ts +26 -0
- package/dist/builtins/device-manager/device-link-overlay.d.ts +23 -0
- package/dist/builtins/device-manager/device-link-resolver.d.ts +15 -0
- package/dist/builtins/device-manager/device-manager.addon.d.ts +452 -0
- package/dist/builtins/device-manager/device-manager.addon.js +3299 -0
- package/dist/builtins/device-manager/device-manager.addon.mjs +3292 -0
- package/dist/builtins/device-manager/index.d.ts +2 -0
- package/dist/builtins/device-manager/index.js +8 -0
- package/dist/builtins/device-manager/index.mjs +2 -0
- package/dist/builtins/hub-forwarder/hub-forwarder-destination.d.ts +44 -0
- package/dist/builtins/hub-forwarder/hub-forwarder.addon.d.ts +15 -0
- package/dist/builtins/hub-forwarder/index.d.ts +3 -0
- package/dist/builtins/hub-forwarder/index.js +154 -0
- package/dist/builtins/hub-forwarder/index.mjs +145 -0
- package/dist/builtins/local-auth/auth-schema.d.ts +26 -0
- package/dist/builtins/local-auth/index.d.ts +1 -0
- package/dist/builtins/local-auth/index.js +4 -0
- package/dist/builtins/local-auth/index.mjs +2 -0
- package/dist/builtins/local-auth/local-auth.addon.d.ts +18 -0
- package/dist/builtins/local-auth/local-auth.addon.js +8094 -0
- package/dist/builtins/local-auth/local-auth.addon.mjs +8063 -0
- package/dist/builtins/local-auth/oauth-grants.d.ts +45 -0
- package/dist/builtins/local-auth/oauth-session-manager.d.ts +50 -0
- package/dist/builtins/local-network/index.d.ts +2 -0
- package/dist/builtins/local-network/index.js +10 -0
- package/dist/builtins/local-network/index.mjs +2 -0
- package/dist/builtins/local-network/local-network.addon.d.ts +150 -0
- package/dist/builtins/local-network/local-network.addon.js +489 -0
- package/dist/builtins/local-network/local-network.addon.mjs +477 -0
- package/dist/builtins/native-metrics/index.d.ts +2 -0
- package/dist/builtins/native-metrics/native-metrics-provider.d.ts +48 -0
- package/dist/builtins/native-metrics/native-metrics.addon.d.ts +73 -0
- package/dist/builtins/native-metrics/native-metrics.addon.js +922 -0
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +914 -0
- package/dist/builtins/platform-probe/hardware-decode-accel-probe.d.ts +37 -0
- package/dist/builtins/platform-probe/hardware-encoder-probe.d.ts +13 -0
- package/dist/builtins/platform-probe/index.d.ts +22 -0
- package/dist/builtins/platform-probe/index.js +834 -0
- package/dist/builtins/platform-probe/index.mjs +822 -0
- package/dist/builtins/platform-probe/inference-config-resolver.d.ts +29 -0
- package/dist/builtins/platform-probe/intel-accelerators.d.ts +11 -0
- package/dist/builtins/platform-probe/platform-scorer.d.ts +30 -0
- package/dist/builtins/platform-probe/runtime-packages.d.ts +6 -0
- package/dist/builtins/remote-access-orchestrator/enabled-providers-reconcile.d.ts +96 -0
- package/dist/builtins/remote-access-orchestrator/index.d.ts +1 -0
- package/dist/builtins/remote-access-orchestrator/index.js +8 -0
- package/dist/builtins/remote-access-orchestrator/index.mjs +2 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts +40 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +214 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +208 -0
- package/dist/builtins/shared/settle-sources.d.ts +22 -0
- package/dist/builtins/snapshot/index.d.ts +2 -0
- package/dist/builtins/snapshot/index.js +494 -0
- package/dist/builtins/snapshot/index.mjs +488 -0
- package/dist/builtins/snapshot/snapshot.addon.d.ts +120 -0
- package/dist/builtins/sqlite-storage/config-store.d.ts +8 -0
- package/dist/builtins/sqlite-storage/device-store.d.ts +23 -0
- package/dist/builtins/sqlite-storage/filesystem-browse-provider.d.ts +25 -0
- package/dist/builtins/sqlite-storage/filesystem-storage-provider.d.ts +83 -0
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.d.ts +32 -0
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +396 -0
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +388 -0
- package/dist/builtins/sqlite-storage/index.d.ts +8 -0
- package/dist/builtins/sqlite-storage/index.js +62 -0
- package/dist/builtins/sqlite-storage/index.mjs +49 -0
- package/dist/builtins/sqlite-storage/integration-registry.d.ts +27 -0
- package/dist/builtins/sqlite-storage/path-guard.d.ts +4 -0
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +102 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +14 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +644 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +636 -0
- package/dist/builtins/storage-orchestrator/index.d.ts +6 -0
- package/dist/builtins/storage-orchestrator/index.js +10 -0
- package/dist/builtins/storage-orchestrator/index.mjs +2 -0
- package/dist/builtins/storage-orchestrator/location-store.d.ts +49 -0
- package/dist/builtins/storage-orchestrator/provider-discovery.d.ts +10 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +103 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1138 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1128 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +236 -0
- package/dist/builtins/storage-orchestrator/storage-pressure-manager.d.ts +38 -0
- package/dist/builtins/system-backup/system-backup.service.d.ts +137 -0
- package/dist/builtins/system-config/index.d.ts +1 -0
- package/dist/builtins/system-config/index.js +8 -0
- package/dist/builtins/system-config/index.mjs +2 -0
- package/dist/builtins/system-config/system-config.addon.d.ts +10 -0
- package/dist/builtins/system-config/system-config.addon.js +232 -0
- package/dist/builtins/system-config/system-config.addon.mjs +226 -0
- package/dist/builtins/winston-logging/index.d.ts +3 -0
- package/dist/builtins/winston-logging/index.js +156 -0
- package/dist/builtins/winston-logging/index.mjs +144 -0
- package/dist/builtins/winston-logging/winston-destination.d.ts +21 -0
- package/dist/builtins/winston-logging/winston-logging.addon.d.ts +19 -0
- package/dist/chunk-CNf5ZN-e.mjs +37 -0
- package/dist/chunk-Cek0wNdY.js +64 -0
- package/dist/download/model-download-service.d.ts +41 -0
- package/dist/download/model-downloader.d.ts +31 -0
- package/dist/events/event-bus.d.ts +10 -0
- package/dist/events/system-event-bus.d.ts +14 -0
- package/dist/feature/feature-manager.d.ts +11 -0
- package/dist/formatter-B7qW8bPJ.mjs +162 -0
- package/dist/formatter-DqAKDlvN.js +167 -0
- package/dist/http/authenticated-file-server.d.ts +53 -0
- package/dist/http/data-plane-registry.d.ts +23 -0
- package/dist/http/file-data-plane.d.ts +10 -0
- package/dist/http/reverse-proxy.d.ts +15 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.js +93485 -0
- package/dist/index.mjs +93179 -0
- package/dist/intel-accelerators-Gg0P5mnl.js +20 -0
- package/dist/intel-accelerators-hGgpZ0pX.mjs +19 -0
- package/dist/kernel/addon-class-resolver.d.ts +4 -0
- package/dist/kernel/addon-engine-manager.d.ts +22 -0
- package/dist/kernel/addon-health-monitor.d.ts +154 -0
- package/dist/kernel/addon-installer.d.ts +208 -0
- package/dist/kernel/addon-loader.d.ts +106 -0
- package/dist/kernel/addon-manifest.d.ts +77 -0
- package/dist/kernel/capability-handle.d.ts +46 -0
- package/dist/kernel/capability-registry.d.ts +412 -0
- package/dist/kernel/config-manager.d.ts +212 -0
- package/dist/kernel/config-schema.d.ts +93 -0
- package/dist/kernel/custom-action-registry.d.ts +23 -0
- package/dist/kernel/deps/addon-deps-manager.d.ts +19 -0
- package/dist/kernel/deps/manifest-native-deps.d.ts +25 -0
- package/dist/kernel/deps/manifest-python-deps.d.ts +20 -0
- package/dist/kernel/device-registry.d.ts +29 -0
- package/dist/kernel/fs-utils.d.ts +41 -0
- package/dist/kernel/hwaccel/hwaccel-resolver.d.ts +19 -0
- package/dist/kernel/hwaccel/hwaccel-service.d.ts +4 -0
- package/dist/kernel/index.d.ts +74 -0
- package/dist/kernel/infra-capabilities.d.ts +13 -0
- package/dist/kernel/moleculer/addon-context-factory.d.ts +91 -0
- package/dist/kernel/moleculer/addon-data-plane-facility.d.ts +19 -0
- package/dist/kernel/moleculer/addon-runner.d.ts +1 -0
- package/dist/kernel/moleculer/addon-service-factory.d.ts +50 -0
- package/dist/kernel/moleculer/broker-factory.d.ts +50 -0
- package/dist/kernel/moleculer/cap-usage-registry.d.ts +46 -0
- package/dist/kernel/moleculer/capabilities-access.d.ts +21 -0
- package/dist/kernel/moleculer/child-addon-call-dispatch.d.ts +46 -0
- package/dist/kernel/moleculer/child-cap-dispatch.d.ts +20 -0
- package/dist/kernel/moleculer/cluster-secret.d.ts +15 -0
- package/dist/kernel/moleculer/core-cap-service.d.ts +50 -0
- package/dist/kernel/moleculer/crash-supervisor.d.ts +50 -0
- package/dist/kernel/moleculer/device-cap-proxy.d.ts +79 -0
- package/dist/kernel/moleculer/event-bus-core.d.ts +53 -0
- package/dist/kernel/moleculer/event-bus.d.ts +53 -0
- package/dist/kernel/moleculer/hub-log-forwarder.d.ts +36 -0
- package/dist/kernel/moleculer/hub-service.d.ts +35 -0
- package/dist/kernel/moleculer/node-registry.d.ts +126 -0
- package/dist/kernel/moleculer/process-context.d.ts +4 -0
- package/dist/kernel/moleculer/process-service.d.ts +72 -0
- package/dist/kernel/moleculer/provider-registry.d.ts +28 -0
- package/dist/kernel/moleculer/readiness-context.d.ts +62 -0
- package/dist/kernel/moleculer/readiness-service.d.ts +7 -0
- package/dist/kernel/moleculer/register-node-client.d.ts +35 -0
- package/dist/kernel/moleculer/remote-logger.d.ts +43 -0
- package/dist/kernel/moleculer/resilient-cap-call.d.ts +28 -0
- package/dist/kernel/moleculer/stream-probe-service.d.ts +9 -0
- package/dist/kernel/moleculer/trpc-links.d.ts +189 -0
- package/dist/kernel/moleculer/typed-array-serde.d.ts +25 -0
- package/dist/kernel/moleculer/worker-device-restore.d.ts +10 -0
- package/dist/kernel/provider-kind-drift.d.ts +12 -0
- package/dist/kernel/restart-coordinator.d.ts +90 -0
- package/dist/kernel/storage-location-registry.d.ts +40 -0
- package/dist/kernel/transport/cap-action-name.d.ts +100 -0
- package/dist/kernel/transport/cap-route-resolver.d.ts +148 -0
- package/dist/kernel/transport/cap-route.d.ts +148 -0
- package/dist/kernel/transport/child-cap-protocol.d.ts +136 -0
- package/dist/kernel/transport/create-local-transport.d.ts +7 -0
- package/dist/kernel/transport/frame-codec.d.ts +7 -0
- package/dist/kernel/transport/index.d.ts +27 -0
- package/dist/kernel/transport/local-child-client.d.ts +136 -0
- package/dist/kernel/transport/local-child-registry.d.ts +179 -0
- package/dist/kernel/transport/local-endpoint-path.d.ts +6 -0
- package/dist/kernel/transport/local-transport.d.ts +46 -0
- package/dist/kernel/transport/parent-unowned-call.d.ts +75 -0
- package/dist/kernel/transport/socket-channel.d.ts +27 -0
- package/dist/kernel/transport/uds-event-bridge.d.ts +36 -0
- package/dist/kernel/transport/uds-event-bus.d.ts +22 -0
- package/dist/kernel/transport/uds-local-transport.d.ts +18 -0
- package/dist/kernel/transport/uds-log-ingest.d.ts +28 -0
- package/dist/kernel/transport/uds-logger.d.ts +44 -0
- package/dist/kernel/utils/ring-buffer.d.ts +15 -0
- package/dist/kernel/workspace-detect.d.ts +9 -0
- package/dist/lifecycle/lifecycle-state-machine.d.ts +28 -0
- package/dist/logging/formatter.d.ts +30 -0
- package/dist/logging/log-manager.d.ts +54 -0
- package/dist/logging/log-ring-buffer.d.ts +47 -0
- package/dist/logging/partitioned-log-buffer.d.ts +35 -0
- package/dist/logging/scoped-logger.d.ts +17 -0
- package/dist/main-DNnMW7Z2.js +9983 -0
- package/dist/main-rtjOwPBR.mjs +9976 -0
- package/dist/manifest-python-deps-D1DbAQEv.js +6724 -0
- package/dist/manifest-python-deps-DZsKTbs1.mjs +6315 -0
- package/dist/network/network-quality.d.ts +11 -0
- package/dist/notification/notification-service.d.ts +37 -0
- package/dist/notification/toast-service.d.ts +22 -0
- package/dist/pipeline/engine-manager-resolver.d.ts +15 -0
- package/dist/pipeline/pipeline-runner.d.ts +8 -0
- package/dist/pipeline/pipeline-validator.d.ts +13 -0
- package/dist/process/resource-monitor.d.ts +11 -0
- package/dist/python/python-env-manager.d.ts +12 -0
- package/dist/repl/interfaces.d.ts +31 -0
- package/dist/repl/repl-engine.d.ts +8 -0
- package/dist/resource-monitor-ClDGFyf6.mjs +57 -0
- package/dist/resource-monitor-IIEanuJt.js +74 -0
- package/dist/settle-sources-Bhsy57y-.js +38 -0
- package/dist/settle-sources-CDtNC8ub.mjs +33 -0
- package/dist/storage/fs-storage-backend.d.ts +40 -0
- package/dist/storage/storage-location-manager.d.ts +23 -0
- package/dist/storage/storage-manager.d.ts +83 -0
- package/dist/tar-BgAEMRBR.js +5434 -0
- package/dist/tar-ByMOPNM0.mjs +5429 -0
- package/dist/tls/cert-manager.d.ts +26 -0
- package/dist/tls/index.d.ts +1 -0
- package/package.json +343 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ISettingsBackend, StorageLocation } from '@camstack/types';
|
|
2
|
+
/**
|
|
3
|
+
* Abstract storage interface for `StorageLocation` records. Methods are
|
|
4
|
+
* async because production-side implementations hit SQLite — but the
|
|
5
|
+
* orchestrator's mutation paths fire-and-forget the writes so a slow
|
|
6
|
+
* disk doesn't block the cap surface.
|
|
7
|
+
*/
|
|
8
|
+
export interface ILocationStore {
|
|
9
|
+
/** Read every persisted location. Called once at boot. */
|
|
10
|
+
loadAll(): Promise<readonly StorageLocation[]>;
|
|
11
|
+
/** Insert or replace a single location by id. */
|
|
12
|
+
upsert(loc: StorageLocation): Promise<void>;
|
|
13
|
+
/** Remove a location by id. */
|
|
14
|
+
delete(id: string): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* SQLite-backed implementation of `ILocationStore` — uses the
|
|
18
|
+
* `settings-store` cap's structured-table surface (`ensureTable` /
|
|
19
|
+
* `tableInsert` / `tableUpdate` / `tableDelete` / `tableQuery`). Wired
|
|
20
|
+
* to the live `ISettingsBackend` provider obtained from
|
|
21
|
+
* `kernel.capabilityRegistry.getSingleton('settings-store')`.
|
|
22
|
+
*
|
|
23
|
+
* The cap-router surface (`ctx.api.settingsStore.*`) does NOT expose
|
|
24
|
+
* the `tableXxx` methods — they're only on the raw `ISettingsBackend`.
|
|
25
|
+
* Same constraint that drives `IntegrationRegistry` to take a direct
|
|
26
|
+
* provider reference instead of going through the cap.
|
|
27
|
+
*/
|
|
28
|
+
export declare class SqliteLocationStore implements ILocationStore {
|
|
29
|
+
private readonly backend;
|
|
30
|
+
private tableEnsured;
|
|
31
|
+
constructor(backend: ISettingsBackend);
|
|
32
|
+
/**
|
|
33
|
+
* Lazy `ensureTable` — keeps the constructor cheap and async-free.
|
|
34
|
+
* Called from every mutation/read path; the backend's `ensureTable`
|
|
35
|
+
* is itself idempotent (additive migration), so repeated calls are
|
|
36
|
+
* effectively no-ops after the first.
|
|
37
|
+
*/
|
|
38
|
+
private ensureTable;
|
|
39
|
+
loadAll(): Promise<readonly StorageLocation[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Replace-or-insert. Implemented as `delete` + `insert` rather than
|
|
42
|
+
* the conditional `tableUpdate` path because the orchestrator
|
|
43
|
+
* serializes every mutation through the in-memory map before
|
|
44
|
+
* dispatching to the store — there's no contention to lose, and the
|
|
45
|
+
* delete-then-insert path is unconditionally simpler.
|
|
46
|
+
*/
|
|
47
|
+
upsert(loc: StorageLocation): Promise<void>;
|
|
48
|
+
delete(id: string): Promise<void>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IStorageProviderImpl, IStorageCapProvider } from '@camstack/types';
|
|
2
|
+
/** One entry of the `storage.listProviders` output array. */
|
|
3
|
+
export type StorageProviderListEntry = Awaited<ReturnType<IStorageCapProvider['listProviders']>>[number];
|
|
4
|
+
/**
|
|
5
|
+
* Callback invoked when a provider's `getProviderInfo()` throws. The array
|
|
6
|
+
* `index` is passed so the orchestrator can identify which provider failed —
|
|
7
|
+
* `getProviderInfo()` itself threw, so there is no static id to log otherwise.
|
|
8
|
+
*/
|
|
9
|
+
export type ProviderInfoErrorHandler = (provider: IStorageProviderImpl, error: unknown, index: number) => void;
|
|
10
|
+
export declare function collectProviderInfos(providers: readonly IStorageProviderImpl[], onError: ProviderInfoErrorHandler): Promise<StorageProviderListEntry[]>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { BaseAddon, ProviderRegistration } from '@camstack/types';
|
|
2
|
+
interface StorageOrchestratorConfig extends Record<string, unknown> {
|
|
3
|
+
}
|
|
4
|
+
export declare class StorageOrchestratorAddon extends BaseAddon<StorageOrchestratorConfig> {
|
|
5
|
+
private service;
|
|
6
|
+
private pressureManager;
|
|
7
|
+
private pressureTimer;
|
|
8
|
+
private pressureSweepInFlight;
|
|
9
|
+
/**
|
|
10
|
+
* `uploadId` → providerId. Populated on `beginUpload`, consulted on
|
|
11
|
+
* every subsequent `writeChunk` / `finalizeUpload` / `abortUpload`,
|
|
12
|
+
* cleared on terminal calls. The provider holds the actual session
|
|
13
|
+
* state (open file descriptor, buffered offsets, …) — we just
|
|
14
|
+
* remember which provider owns it.
|
|
15
|
+
*/
|
|
16
|
+
private readonly uploadOwners;
|
|
17
|
+
/** Symmetric to `uploadOwners` for download sessions. */
|
|
18
|
+
private readonly downloadOwners;
|
|
19
|
+
/**
|
|
20
|
+
* Cached `providerId → nodeLocal` snapshot (SP1). Backs the orchestrator's
|
|
21
|
+
* synchronous `NodeLocalResolver` — `getProviderInfo()` is async, so we
|
|
22
|
+
* keep a sync cache and refresh it whenever the provider collection
|
|
23
|
+
* changes (alongside the seed pass). Absent providerId → resolver returns
|
|
24
|
+
* `undefined` (treated as node-agnostic).
|
|
25
|
+
*/
|
|
26
|
+
private readonly nodeLocalByProvider;
|
|
27
|
+
/**
|
|
28
|
+
* Disposers run on `onShutdown` — currently the eventBus subscription
|
|
29
|
+
* for `capability:provider-registered` events used by the lazy seed
|
|
30
|
+
* fallback. Stored separately from the `BaseAddon` disposer chain so
|
|
31
|
+
* it can be inspected in tests.
|
|
32
|
+
*/
|
|
33
|
+
private readonly seedSubscriptionDisposers;
|
|
34
|
+
constructor();
|
|
35
|
+
protected onInitialize(): Promise<ProviderRegistration[]>;
|
|
36
|
+
protected onShutdown(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Resolve the live `ISettingsBackend` from the capability registry
|
|
39
|
+
* and wrap it in a `SqliteLocationStore`. Returns `null` when the
|
|
40
|
+
* settings-store cap isn't registered yet — the service falls back
|
|
41
|
+
* to in-memory only. Production boot order (sqlite-settings runs
|
|
42
|
+
* before the orchestrator) makes this the rare path.
|
|
43
|
+
*/
|
|
44
|
+
private resolveLocationStore;
|
|
45
|
+
/**
|
|
46
|
+
* Late-wire the persistence store once the `settings-store` cap registers.
|
|
47
|
+
* Production boot order means the store is usually absent at
|
|
48
|
+
* `onInitialize`; this runs on every `capability:provider-registered`
|
|
49
|
+
* event until it succeeds. Single-flighted + idempotent (the service
|
|
50
|
+
* ignores a second attach). Without this, operator edits (e.g. a
|
|
51
|
+
* location's `minFreePercent`) live only in memory and are wiped on every
|
|
52
|
+
* restart — the service never hydrates from / persists to SQLite.
|
|
53
|
+
*/
|
|
54
|
+
private storeWireInFlight;
|
|
55
|
+
private ensureStoreWired;
|
|
56
|
+
private storageProviders;
|
|
57
|
+
/** Single-flighted pressure sweep — never overlaps a slow eviction round. */
|
|
58
|
+
private runPressureSweep;
|
|
59
|
+
/**
|
|
60
|
+
* locationId → resolved `minFreePercent`. The policy is intrinsic to the
|
|
61
|
+
* location's provider (`shouldSaveDiskSpace` gates the guard, `minFreePercent`
|
|
62
|
+
* is the default), overridable per-location via `config.minFreePercent`.
|
|
63
|
+
* Locations with the guard off (or threshold 0) are omitted. Moved here from
|
|
64
|
+
* the recorder so disk-pressure is a single core concern.
|
|
65
|
+
*/
|
|
66
|
+
private resolveLocationThresholds;
|
|
67
|
+
private locationBasePath;
|
|
68
|
+
/** Free capacity (%) on a location's volume via `statfs`; 100 (guard inert) when unstattable. */
|
|
69
|
+
private locationFreePercent;
|
|
70
|
+
/** Total bytes on a location's volume via `statfs`; 0 when unstattable. */
|
|
71
|
+
private locationVolumeTotalBytes;
|
|
72
|
+
/**
|
|
73
|
+
* Seed default storage locations from the addon-declared
|
|
74
|
+
* `storageLocations`, aggregated by the kernel into a
|
|
75
|
+
* `StorageLocationRegistry`. Idempotent — re-running on a populated
|
|
76
|
+
* map is a no-op (each declared id's `<id>:default` is already in the
|
|
77
|
+
* service's map).
|
|
78
|
+
*
|
|
79
|
+
* `basePath` is the filesystem storage root, falling back to
|
|
80
|
+
* `process.env.CAMSTACK_DATA ?? path.resolve(process.cwd(), 'camstack-data')`.
|
|
81
|
+
* Every declared default is attributed to the `filesystem-storage`
|
|
82
|
+
* provider; operators repoint individual locations (or add remote
|
|
83
|
+
* SFTP/S3/WebDAV instances) through the admin UI afterwards.
|
|
84
|
+
*/
|
|
85
|
+
private seedFromDeclarations;
|
|
86
|
+
/**
|
|
87
|
+
* Rebuild the `providerId → nodeLocal` cache from every registered
|
|
88
|
+
* `storage-provider`'s `getProviderInfo()`. Cheap registry scan; runs on
|
|
89
|
+
* boot and on every provider-registered reconcile. Failed probes are
|
|
90
|
+
* skipped (the provider stays absent → treated as node-agnostic).
|
|
91
|
+
*/
|
|
92
|
+
private refreshNodeLocalCache;
|
|
93
|
+
private resolveByUploadId;
|
|
94
|
+
private resolveByDownloadId;
|
|
95
|
+
/**
|
|
96
|
+
* Look up a `storage-provider` by `providerId` only — used for
|
|
97
|
+
* upload / download dispatch where the original `StorageLocation` is
|
|
98
|
+
* no longer in scope. Throws if the provider has gone away (e.g.
|
|
99
|
+
* addon unloaded mid-session).
|
|
100
|
+
*/
|
|
101
|
+
private providerByProviderId;
|
|
102
|
+
}
|
|
103
|
+
export default StorageOrchestratorAddon;
|