@camstack/core 0.1.4 → 0.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/core",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
5
5
  "keywords": [
6
6
  "camstack",
@@ -78,7 +78,8 @@
78
78
  "dev": "tsup --watch",
79
79
  "typecheck": "tsc --noEmit",
80
80
  "test": "vitest run",
81
- "test:watch": "vitest"
81
+ "test:watch": "vitest",
82
+ "publish": "npm publish --access public"
82
83
  },
83
84
  "dependencies": {
84
85
  "@camstack/kernel": "*",
@@ -1,42 +0,0 @@
1
- import { IScopedLogger, IEventBus, IStorageLocation, BackupManifest, ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
2
- export { BackupManifest } from '@camstack/types';
3
-
4
- interface BackupConfig {
5
- readonly backupDir: string;
6
- readonly retentionCount: number;
7
- }
8
- declare class LocalBackupService {
9
- private readonly config;
10
- private readonly logger;
11
- private readonly eventBus;
12
- private readonly storage;
13
- private manifests;
14
- constructor(config: BackupConfig, logger: IScopedLogger, eventBus: IEventBus, storage: IStorageLocation);
15
- /** Create a backup of specified locations */
16
- backup(options?: {
17
- locations?: string[];
18
- label?: string;
19
- }): Promise<BackupManifest>;
20
- /** Restore from a backup */
21
- restore(backupId: string): Promise<void>;
22
- /** List all backups sorted by timestamp descending */
23
- list(): readonly BackupManifest[];
24
- /** Delete a specific backup */
25
- delete(backupId: string): Promise<void>;
26
- private pruneOldBackups;
27
- }
28
-
29
- declare class LocalBackupAddon implements ICamstackAddon, IConfigurable {
30
- readonly manifest: AddonManifest;
31
- private service;
32
- private currentConfig;
33
- initialize(context: AddonContext): Promise<void>;
34
- shutdown(): Promise<void>;
35
- getService(): LocalBackupService;
36
- getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
37
- getConfigSchema(): ConfigUISchema;
38
- getConfig(): Record<string, unknown>;
39
- onConfigChange(config: Record<string, unknown>): Promise<void>;
40
- }
41
-
42
- export { type BackupConfig, LocalBackupAddon, LocalBackupService, LocalBackupAddon as default };
@@ -1,42 +0,0 @@
1
- import { IScopedLogger, IEventBus, IStorageLocation, BackupManifest, ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
2
- export { BackupManifest } from '@camstack/types';
3
-
4
- interface BackupConfig {
5
- readonly backupDir: string;
6
- readonly retentionCount: number;
7
- }
8
- declare class LocalBackupService {
9
- private readonly config;
10
- private readonly logger;
11
- private readonly eventBus;
12
- private readonly storage;
13
- private manifests;
14
- constructor(config: BackupConfig, logger: IScopedLogger, eventBus: IEventBus, storage: IStorageLocation);
15
- /** Create a backup of specified locations */
16
- backup(options?: {
17
- locations?: string[];
18
- label?: string;
19
- }): Promise<BackupManifest>;
20
- /** Restore from a backup */
21
- restore(backupId: string): Promise<void>;
22
- /** List all backups sorted by timestamp descending */
23
- list(): readonly BackupManifest[];
24
- /** Delete a specific backup */
25
- delete(backupId: string): Promise<void>;
26
- private pruneOldBackups;
27
- }
28
-
29
- declare class LocalBackupAddon implements ICamstackAddon, IConfigurable {
30
- readonly manifest: AddonManifest;
31
- private service;
32
- private currentConfig;
33
- initialize(context: AddonContext): Promise<void>;
34
- shutdown(): Promise<void>;
35
- getService(): LocalBackupService;
36
- getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
37
- getConfigSchema(): ConfigUISchema;
38
- getConfig(): Record<string, unknown>;
39
- onConfigChange(config: Record<string, unknown>): Promise<void>;
40
- }
41
-
42
- export { type BackupConfig, LocalBackupAddon, LocalBackupService, LocalBackupAddon as default };
@@ -1,2 +0,0 @@
1
- import '@camstack/types';
2
- export { F as FilesystemStorageAddon, F as default } from '../../filesystem-storage.addon-C42r589X.mjs';
@@ -1,2 +0,0 @@
1
- import '@camstack/types';
2
- export { F as FilesystemStorageAddon, F as default } from '../../filesystem-storage.addon-C42r589X.js';
@@ -1,4 +0,0 @@
1
- export { F as FilesystemStorageAddon, a as FilesystemStorageProvider, F as default } from '../../filesystem-storage.addon-C42r589X.mjs';
2
- export { S as SqliteSettingsAddon, a as SqliteSettingsBackend } from '../../sqlite-settings.addon-DigoKwpZ.mjs';
3
- export { A as AddonTableSchema, C as CORE_TABLE_DDL, F as FileSystemStorage, S as SettingsStore, a as SqliteStorageAddon, b as SqliteStorageProvider, c as addonTableToDdl } from '../../sql-schema-CKz78rId.mjs';
4
- import '@camstack/types';
@@ -1,4 +0,0 @@
1
- export { F as FilesystemStorageAddon, a as FilesystemStorageProvider, F as default } from '../../filesystem-storage.addon-C42r589X.js';
2
- export { S as SqliteSettingsAddon, a as SqliteSettingsBackend } from '../../sqlite-settings.addon-DigoKwpZ.js';
3
- export { A as AddonTableSchema, C as CORE_TABLE_DDL, F as FileSystemStorage, S as SettingsStore, a as SqliteStorageAddon, b as SqliteStorageProvider, c as addonTableToDdl } from '../../sql-schema-CKz78rId.js';
4
- import '@camstack/types';
@@ -1,2 +0,0 @@
1
- import '@camstack/types';
2
- export { S as SqliteSettingsAddon, S as default } from '../../sqlite-settings.addon-DigoKwpZ.mjs';
@@ -1,2 +0,0 @@
1
- import '@camstack/types';
2
- export { S as SqliteSettingsAddon, S as default } from '../../sqlite-settings.addon-DigoKwpZ.js';
@@ -1,30 +0,0 @@
1
- import { ILogDestination, LogEntry, LogFilter, ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
2
-
3
- interface WinstonConfig {
4
- readonly level: string;
5
- readonly retentionDays: number;
6
- /** Resolved absolute path to the logs directory (replaces the old dataPath field). */
7
- readonly logsDir: string;
8
- }
9
- declare class WinstonDestination implements ILogDestination {
10
- private logger;
11
- initialize(config?: WinstonConfig): Promise<void>;
12
- write(entry: LogEntry): void;
13
- query(_filter: LogFilter): Promise<readonly LogEntry[]>;
14
- shutdown(): Promise<void>;
15
- }
16
-
17
- declare class WinstonLoggingAddon implements ICamstackAddon, IConfigurable {
18
- readonly manifest: AddonManifest;
19
- private destination;
20
- private currentConfig;
21
- initialize(context: AddonContext): Promise<void>;
22
- shutdown(): Promise<void>;
23
- getDestination(): WinstonDestination;
24
- getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
25
- getConfigSchema(): ConfigUISchema;
26
- getConfig(): Record<string, unknown>;
27
- onConfigChange(config: Record<string, unknown>): Promise<void>;
28
- }
29
-
30
- export { WinstonDestination, WinstonLoggingAddon, WinstonLoggingAddon as default };
@@ -1,30 +0,0 @@
1
- import { ILogDestination, LogEntry, LogFilter, ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
2
-
3
- interface WinstonConfig {
4
- readonly level: string;
5
- readonly retentionDays: number;
6
- /** Resolved absolute path to the logs directory (replaces the old dataPath field). */
7
- readonly logsDir: string;
8
- }
9
- declare class WinstonDestination implements ILogDestination {
10
- private logger;
11
- initialize(config?: WinstonConfig): Promise<void>;
12
- write(entry: LogEntry): void;
13
- query(_filter: LogFilter): Promise<readonly LogEntry[]>;
14
- shutdown(): Promise<void>;
15
- }
16
-
17
- declare class WinstonLoggingAddon implements ICamstackAddon, IConfigurable {
18
- readonly manifest: AddonManifest;
19
- private destination;
20
- private currentConfig;
21
- initialize(context: AddonContext): Promise<void>;
22
- shutdown(): Promise<void>;
23
- getDestination(): WinstonDestination;
24
- getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
25
- getConfigSchema(): ConfigUISchema;
26
- getConfig(): Record<string, unknown>;
27
- onConfigChange(config: Record<string, unknown>): Promise<void>;
28
- }
29
-
30
- export { WinstonDestination, WinstonLoggingAddon, WinstonLoggingAddon as default };
@@ -1,57 +0,0 @@
1
- import { IStorageProvider, StorageLocationType, ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
2
-
3
- /**
4
- * Filesystem storage provider — serves all location types from a local directory tree.
5
- *
6
- * Default layout:
7
- * {rootPath}/recordings-high/
8
- * {rootPath}/recordings-low/
9
- * {rootPath}/recordings-clips/
10
- * {rootPath}/event-images/
11
- * {rootPath}/models/
12
- * {rootPath}/addons-data/
13
- * {rootPath}/logs/
14
- * /tmp/camstack-cache/ (cache is always local)
15
- *
16
- * Individual location paths can be overridden.
17
- */
18
- declare class FilesystemStorageProvider implements IStorageProvider {
19
- readonly id = "local";
20
- readonly name = "Local Filesystem";
21
- readonly supportedLocations: readonly StorageLocationType[];
22
- private readonly rootPath;
23
- private readonly locationPaths;
24
- constructor(rootPath: string, overrides?: Partial<Record<StorageLocationType, string>>);
25
- resolve(location: StorageLocationType, relativePath: string): string;
26
- write(location: StorageLocationType, relativePath: string, data: Buffer | NodeJS.ReadableStream): Promise<void>;
27
- read(location: StorageLocationType, relativePath: string): Promise<Buffer>;
28
- exists(location: StorageLocationType, relativePath: string): Promise<boolean>;
29
- list(location: StorageLocationType, prefix?: string): Promise<readonly string[]>;
30
- delete(location: StorageLocationType, relativePath: string): Promise<void>;
31
- getAvailableSpace(location: StorageLocationType): Promise<number | null>;
32
- initialize(): Promise<void>;
33
- shutdown(): Promise<void>;
34
- /** Get the resolved path for a location type */
35
- getLocationPath(location: StorageLocationType): string;
36
- /** Get the root path */
37
- getRootPath(): string;
38
- }
39
-
40
- /**
41
- * Filesystem Storage addon — provides local disk storage for all location types.
42
- * Capability: 'storage' (collection)
43
- */
44
- declare class FilesystemStorageAddon implements ICamstackAddon, IConfigurable {
45
- readonly manifest: AddonManifest;
46
- private provider;
47
- private currentConfig;
48
- initialize(context: AddonContext): Promise<void>;
49
- shutdown(): Promise<void>;
50
- getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
51
- getProvider(): FilesystemStorageProvider | null;
52
- getConfigSchema(): ConfigUISchema;
53
- getConfig(): Record<string, unknown>;
54
- onConfigChange(config: Record<string, unknown>): Promise<void>;
55
- }
56
-
57
- export { FilesystemStorageAddon as F, FilesystemStorageProvider as a };
@@ -1,57 +0,0 @@
1
- import { IStorageProvider, StorageLocationType, ICamstackAddon, IConfigurable, AddonManifest, AddonContext, CapabilityProviderMap, ConfigUISchema } from '@camstack/types';
2
-
3
- /**
4
- * Filesystem storage provider — serves all location types from a local directory tree.
5
- *
6
- * Default layout:
7
- * {rootPath}/recordings-high/
8
- * {rootPath}/recordings-low/
9
- * {rootPath}/recordings-clips/
10
- * {rootPath}/event-images/
11
- * {rootPath}/models/
12
- * {rootPath}/addons-data/
13
- * {rootPath}/logs/
14
- * /tmp/camstack-cache/ (cache is always local)
15
- *
16
- * Individual location paths can be overridden.
17
- */
18
- declare class FilesystemStorageProvider implements IStorageProvider {
19
- readonly id = "local";
20
- readonly name = "Local Filesystem";
21
- readonly supportedLocations: readonly StorageLocationType[];
22
- private readonly rootPath;
23
- private readonly locationPaths;
24
- constructor(rootPath: string, overrides?: Partial<Record<StorageLocationType, string>>);
25
- resolve(location: StorageLocationType, relativePath: string): string;
26
- write(location: StorageLocationType, relativePath: string, data: Buffer | NodeJS.ReadableStream): Promise<void>;
27
- read(location: StorageLocationType, relativePath: string): Promise<Buffer>;
28
- exists(location: StorageLocationType, relativePath: string): Promise<boolean>;
29
- list(location: StorageLocationType, prefix?: string): Promise<readonly string[]>;
30
- delete(location: StorageLocationType, relativePath: string): Promise<void>;
31
- getAvailableSpace(location: StorageLocationType): Promise<number | null>;
32
- initialize(): Promise<void>;
33
- shutdown(): Promise<void>;
34
- /** Get the resolved path for a location type */
35
- getLocationPath(location: StorageLocationType): string;
36
- /** Get the root path */
37
- getRootPath(): string;
38
- }
39
-
40
- /**
41
- * Filesystem Storage addon — provides local disk storage for all location types.
42
- * Capability: 'storage' (collection)
43
- */
44
- declare class FilesystemStorageAddon implements ICamstackAddon, IConfigurable {
45
- readonly manifest: AddonManifest;
46
- private provider;
47
- private currentConfig;
48
- initialize(context: AddonContext): Promise<void>;
49
- shutdown(): Promise<void>;
50
- getCapabilityProvider<K extends keyof CapabilityProviderMap>(name: K): CapabilityProviderMap[K] | null;
51
- getProvider(): FilesystemStorageProvider | null;
52
- getConfigSchema(): ConfigUISchema;
53
- getConfig(): Record<string, unknown>;
54
- onConfigChange(config: Record<string, unknown>): Promise<void>;
55
- }
56
-
57
- export { FilesystemStorageAddon as F, FilesystemStorageProvider as a };