@ultrst-armada/kloks 2.0.0 → 2.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/package.json +1 -1
- package/packages/backend/dist/api/index.js +1 -1
- package/packages/backend/dist/api/middleware.test.d.ts +1 -0
- package/packages/backend/dist/{chunk-WC6EPW3A.js → chunk-POLVHTHJ.js} +16 -6
- package/packages/backend/dist/index.js +1 -1
- package/packages/backend/dist/node.js +1 -1
- package/packages/client/dist/auth.d.ts +20 -1
- package/packages/client/dist/auth.js +13 -3
- package/packages/client/dist/chunk-ATLIA7AJ.js +143 -0
- package/packages/client/dist/index.d.ts +1 -1
- package/packages/client/dist/index.js +13 -3
- package/packages/client/package.json +1 -1
- package/packages/functions/dist/async.d.ts +36 -0
- package/packages/functions/dist/base.d.ts +31 -1
- package/packages/functions/dist/cache.d.ts +27 -0
- package/packages/functions/dist/env-node.d.ts +8 -0
- package/packages/functions/dist/env.d.ts +19 -0
- package/packages/functions/dist/events.d.ts +32 -0
- package/packages/functions/dist/fileCache.d.ts +9 -0
- package/packages/functions/dist/fs-lock.d.ts +9 -0
- package/packages/functions/dist/fs.d.ts +35 -0
- package/packages/functions/dist/http.d.ts +36 -0
- package/packages/functions/dist/index.d.ts +14 -16
- package/packages/functions/dist/node.d.ts +7 -110
- package/packages/functions/dist/object.d.ts +32 -0
- package/packages/functions/dist/portable.d.ts +12 -206
- package/packages/functions/dist/shell.d.ts +37 -0
- package/packages/functions/dist/string.d.ts +14 -0
- package/packages/functions/dist/types.d.ts +31 -0
- package/packages/functions/package.json +1 -1
- package/packages/state-graph/dist/browser.js +16 -16
- package/packages/state-graph/dist/index.js +16 -16
- package/packages/client/dist/chunk-B4WOPCRZ.js +0 -26
- package/packages/functions/dist/base-DDYO-DzM.d.ts +0 -64
- package/packages/state-graph/dist/{chunk-UKTICGGV.js → chunk-YUJC367F.js} +3 -3
|
@@ -1,110 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* @file fs-lock.ts
|
|
9
|
-
* @description File locking primitive for atomic file operations.
|
|
10
|
-
*/
|
|
11
|
-
type ReleaseFn = () => void;
|
|
12
|
-
declare class FileLock {
|
|
13
|
-
private static locks;
|
|
14
|
-
static acquire(filePath: string): Promise<ReleaseFn>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @file fs.ts
|
|
19
|
-
* @description Robust cross-platform filesystem abstraction layer.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
declare function readFile(filePath: string, encoding?: BufferEncoding): Promise<string>;
|
|
23
|
-
declare function writeFile(filePath: string, content: string | Buffer): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Atomic file writing via temp files.
|
|
26
|
-
*/
|
|
27
|
-
declare function writeFileAtomic(filePath: string, content: string | Buffer): Promise<void>;
|
|
28
|
-
declare function appendFile(filePath: string, content: string | Buffer): Promise<void>;
|
|
29
|
-
declare function deleteFile(filePath: string): Promise<void>;
|
|
30
|
-
declare function fileExists(filePath: string): Promise<boolean>;
|
|
31
|
-
declare function getFileStat(filePath: string): Promise<{
|
|
32
|
-
size: number;
|
|
33
|
-
createdAt: Date;
|
|
34
|
-
modifiedAt: Date;
|
|
35
|
-
isDir: boolean;
|
|
36
|
-
}>;
|
|
37
|
-
declare function readJSON<T>(filePath: string): Promise<T | null>;
|
|
38
|
-
declare function writeJSON(filePath: string, data: unknown, indent?: number): Promise<void>;
|
|
39
|
-
declare function updateJSON<T>(filePath: string, patch: Partial<T>): Promise<T>;
|
|
40
|
-
declare function ensureDir(dirPath: string): Promise<void>;
|
|
41
|
-
declare function deleteDir(dirPath: string, recursive?: boolean): Promise<void>;
|
|
42
|
-
declare function listDir(dirPath: string): Promise<string[]>;
|
|
43
|
-
declare function walkDir(dirPath: string, filter?: (file: string) => boolean): AsyncIterable<string>;
|
|
44
|
-
declare function dirExists(dirPath: string): Promise<boolean>;
|
|
45
|
-
declare function copyDir(src: string, dest: string): Promise<void>;
|
|
46
|
-
declare function firstExisting(candidates: string[]): Promise<string | null>;
|
|
47
|
-
declare function watchFile(filePath: string, handler: (event: string) => void, debounceMs?: number): fs.FSWatcher;
|
|
48
|
-
declare function watchDir(dirPath: string, handler: (event: string, filename: string | null) => void, debounceMs?: number): fs.FSWatcher;
|
|
49
|
-
declare function createTempFile(prefix?: string): string;
|
|
50
|
-
declare function createTempDir(prefix?: string): string;
|
|
51
|
-
declare function withTempDir<T>(fn: (tempDir: string) => Promise<T>, prefix?: string): Promise<T>;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @file shell.ts
|
|
55
|
-
* @description Safe promise-based exec and spawn wrappers with cross-platform command routing.
|
|
56
|
-
*/
|
|
57
|
-
|
|
58
|
-
interface SpawnHandle {
|
|
59
|
-
pid?: number;
|
|
60
|
-
kill: (signal?: NodeJS.Signals | number) => boolean;
|
|
61
|
-
promise: Promise<{
|
|
62
|
-
code: number | null;
|
|
63
|
-
signal: NodeJS.Signals | null;
|
|
64
|
-
}>;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Promisified command execution.
|
|
68
|
-
*/
|
|
69
|
-
declare function execCmd(cmd: string, opts?: ExecOptions & {
|
|
70
|
-
timeout?: number;
|
|
71
|
-
}): Promise<{
|
|
72
|
-
stdout: string;
|
|
73
|
-
stderr: string;
|
|
74
|
-
}>;
|
|
75
|
-
/**
|
|
76
|
-
* Streaming command execution.
|
|
77
|
-
*/
|
|
78
|
-
declare function spawnCmd(cmd: string, args: string[], opts?: SpawnOptions): SpawnHandle;
|
|
79
|
-
/**
|
|
80
|
-
* Defines posix vs win32 specific commands.
|
|
81
|
-
*/
|
|
82
|
-
declare function platform<T>(routing: {
|
|
83
|
-
posix: T;
|
|
84
|
-
win32: T;
|
|
85
|
-
}): T;
|
|
86
|
-
/**
|
|
87
|
-
* Resolves the full path of a binary.
|
|
88
|
-
*/
|
|
89
|
-
declare function which(cmd: string): string | null;
|
|
90
|
-
|
|
91
|
-
declare class FileCache<T> {
|
|
92
|
-
private cacheDir;
|
|
93
|
-
constructor(cacheDir: string);
|
|
94
|
-
private getFilePath;
|
|
95
|
-
get(key: string): T | null;
|
|
96
|
-
set(key: string, value: T): void;
|
|
97
|
-
delete(key: string): void;
|
|
98
|
-
clear(): void;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* @file env-node.ts
|
|
103
|
-
* @description Node-only .env file loading.
|
|
104
|
-
*/
|
|
105
|
-
/**
|
|
106
|
-
* Loads a .env file and injects variables into process.env.
|
|
107
|
-
*/
|
|
108
|
-
declare function loadEnv(filePath?: string): void;
|
|
109
|
-
|
|
110
|
-
export { FileCache, FileLock, type ReleaseFn, type SpawnHandle, appendFile, copyDir, createTempDir, createTempFile, deleteDir, deleteFile, dirExists, ensureDir, execCmd, fileExists, firstExisting, getFileStat, listDir, loadEnv, platform, readFile, readJSON, spawnCmd, updateJSON, walkDir, watchDir, watchFile, which, withTempDir, writeFile, writeFileAtomic, writeJSON };
|
|
1
|
+
/** Node-only filesystem and process utilities for @ultrst-armada/kloks/functions. */
|
|
2
|
+
export * from './portable.js';
|
|
3
|
+
export * from './fs-lock.js';
|
|
4
|
+
export * from './fs.js';
|
|
5
|
+
export * from './shell.js';
|
|
6
|
+
export * from './fileCache.js';
|
|
7
|
+
export * from './env-node.js';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file object.ts
|
|
3
|
+
* @description Deep clone, deep merge, deep equal, object diffing, and dot-notation in-memory path accessor tools.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Structurally deep clones an object with circular dependency check.
|
|
7
|
+
*/
|
|
8
|
+
export declare function deepClone<T>(obj: T, seen?: Map<any, any>): T;
|
|
9
|
+
/**
|
|
10
|
+
* Recursively deep merges override objects into a base.
|
|
11
|
+
*/
|
|
12
|
+
export declare function deepMerge(base: any, ...overrides: any[]): any;
|
|
13
|
+
/**
|
|
14
|
+
* Performs a strict structural equality check.
|
|
15
|
+
*/
|
|
16
|
+
export declare function deepEqual(a: any, b: any): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Performs an object diff between before and after states.
|
|
19
|
+
*/
|
|
20
|
+
export declare function objectDiff(before: any, after: any): {
|
|
21
|
+
added: any;
|
|
22
|
+
removed: any;
|
|
23
|
+
changed: any;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Accesses an in-memory object by dot-notation.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getPath(obj: any, path: string, defaultValue?: any): any;
|
|
29
|
+
/**
|
|
30
|
+
* Mutates or sets an in-memory object by dot-notation.
|
|
31
|
+
*/
|
|
32
|
+
export declare function setPath(obj: any, path: string, value: any): any;
|
|
@@ -1,207 +1,13 @@
|
|
|
1
|
-
export { D as Disposable, L as Logger, P as Provider, R as Result, S as SkipoBase, a as SkipoConfig } from './base-DDYO-DzM.js';
|
|
2
|
-
import { ZodTypeAny } from 'zod';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
|
-
* @file
|
|
6
|
-
* @description
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
declare function interpolate(tmpl: string, data: Record<string, any>): string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @file async.ts
|
|
21
|
-
* @description sleep, withTimeout, retry, pLimit, debounce, throttle, once, and memoize primitives.
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* Classic sleep/delay.
|
|
25
|
-
*/
|
|
26
|
-
declare function sleep(ms: number): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Rejects if the task does not finish within ms.
|
|
29
|
-
*/
|
|
30
|
-
declare function withTimeout<T>(promise: Promise<T>, ms: number, label?: string): Promise<T>;
|
|
31
|
-
/**
|
|
32
|
-
* Retries an async execution up to maxAttempts times.
|
|
33
|
-
*/
|
|
34
|
-
declare function retry<T>(fn: () => Promise<T>, maxAttempts: number, delayMs?: number): Promise<T>;
|
|
35
|
-
/**
|
|
36
|
-
* Limits concurrent async task execution.
|
|
37
|
-
*/
|
|
38
|
-
declare function pLimit<T>(tasks: (() => Promise<T>)[], concurrency: number): Promise<T[]>;
|
|
39
|
-
/**
|
|
40
|
-
* Debounces a function.
|
|
41
|
-
*/
|
|
42
|
-
declare function debounce<T extends (...args: any[]) => any>(fn: T, ms: number): (...args: Parameters<T>) => void;
|
|
43
|
-
/**
|
|
44
|
-
* Throttles a function.
|
|
45
|
-
*/
|
|
46
|
-
declare function throttle<T extends (...args: any[]) => any>(fn: T, ms: number): (...args: Parameters<T>) => void;
|
|
47
|
-
/**
|
|
48
|
-
* Wraps a function to run only once and cache its outcome.
|
|
49
|
-
*/
|
|
50
|
-
declare function once<T extends (...args: any[]) => any>(fn: T): (...args: Parameters<T>) => ReturnType<T>;
|
|
51
|
-
/**
|
|
52
|
-
* Computational memoization cache helper.
|
|
53
|
-
*/
|
|
54
|
-
declare function memoize<T extends (...args: any[]) => any>(fn: T, keyFn?: (...args: Parameters<T>) => string): (...args: Parameters<T>) => ReturnType<T>;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* @file object.ts
|
|
58
|
-
* @description Deep clone, deep merge, deep equal, object diffing, and dot-notation in-memory path accessor tools.
|
|
59
|
-
*/
|
|
60
|
-
/**
|
|
61
|
-
* Structurally deep clones an object with circular dependency check.
|
|
62
|
-
*/
|
|
63
|
-
declare function deepClone<T>(obj: T, seen?: Map<any, any>): T;
|
|
64
|
-
/**
|
|
65
|
-
* Recursively deep merges override objects into a base.
|
|
66
|
-
*/
|
|
67
|
-
declare function deepMerge(base: any, ...overrides: any[]): any;
|
|
68
|
-
/**
|
|
69
|
-
* Performs a strict structural equality check.
|
|
70
|
-
*/
|
|
71
|
-
declare function deepEqual(a: any, b: any): boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Performs an object diff between before and after states.
|
|
74
|
-
*/
|
|
75
|
-
declare function objectDiff(before: any, after: any): {
|
|
76
|
-
added: any;
|
|
77
|
-
removed: any;
|
|
78
|
-
changed: any;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Accesses an in-memory object by dot-notation.
|
|
82
|
-
*/
|
|
83
|
-
declare function getPath(obj: any, path: string, defaultValue?: any): any;
|
|
84
|
-
/**
|
|
85
|
-
* Mutates or sets an in-memory object by dot-notation.
|
|
86
|
-
*/
|
|
87
|
-
declare function setPath(obj: any, path: string, value: any): any;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @file cache.ts
|
|
91
|
-
* @description Portable LRU cache, TTL cache, and Stale-While-Revalidate utilities.
|
|
92
|
-
*/
|
|
93
|
-
declare class LRUCache<K, V> {
|
|
94
|
-
private maxSize;
|
|
95
|
-
private cache;
|
|
96
|
-
constructor(maxSize: number);
|
|
97
|
-
get(key: K): V | undefined;
|
|
98
|
-
set(key: K, value: V): void;
|
|
99
|
-
delete(key: K): boolean;
|
|
100
|
-
clear(): void;
|
|
101
|
-
size(): number;
|
|
102
|
-
}
|
|
103
|
-
declare class TTLCache<K, V> {
|
|
104
|
-
private ttlMs;
|
|
105
|
-
private cache;
|
|
106
|
-
constructor(ttlMs: number);
|
|
107
|
-
get(key: K): V | null;
|
|
108
|
-
set(key: K, value: V): void;
|
|
109
|
-
delete(key: K): boolean;
|
|
110
|
-
clear(): void;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Stale-While-Revalidate utility.
|
|
114
|
-
*/
|
|
115
|
-
declare function swr<K, V>(cache: TTLCache<K, V>, key: K, fetchFn: () => Promise<V>): Promise<V>;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* @file env.ts
|
|
119
|
-
* @description Runtime-neutral environment value parsing and validation.
|
|
120
|
-
*/
|
|
121
|
-
|
|
122
|
-
type EnvironmentValues = Record<string, string | undefined>;
|
|
123
|
-
/**
|
|
124
|
-
* Reads an environment value with type coercion and defaults.
|
|
125
|
-
* Worker and browser callers should pass their environment bindings explicitly.
|
|
126
|
-
*/
|
|
127
|
-
declare function getEnv<T>(key: string, defaultValue?: T, env?: EnvironmentValues): T;
|
|
128
|
-
/** Asserts an environment value is set and returns its string value. */
|
|
129
|
-
declare function requireEnv(key: string, env?: EnvironmentValues): string;
|
|
130
|
-
/** Validates an environment object using a Zod schema. */
|
|
131
|
-
declare function validateEnvSchema<T extends ZodTypeAny>(zodSchema: T, env?: EnvironmentValues): T['_output'];
|
|
132
|
-
/** Checks if a connection string is a placeholder or template value. */
|
|
133
|
-
declare function isPlaceholderConnection(url?: string): boolean;
|
|
134
|
-
/** Sanitizes a database URL, returning undefined if it is empty or a placeholder. */
|
|
135
|
-
declare function sanitizeDatabaseUrl(url?: string): string | undefined;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* @file http.ts
|
|
139
|
-
* @description Safe, type-safe HTTP client wrapper.
|
|
140
|
-
*/
|
|
141
|
-
interface SkipoHTTPOptions extends RequestInit {
|
|
142
|
-
timeout?: number;
|
|
143
|
-
retries?: number;
|
|
144
|
-
}
|
|
145
|
-
interface SkipoHTTPResult<T> {
|
|
146
|
-
status: "success" | "error";
|
|
147
|
-
data?: T;
|
|
148
|
-
message?: string;
|
|
149
|
-
code?: number;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Helper to perform fetch with timeout and retries.
|
|
153
|
-
*/
|
|
154
|
-
declare function requestRaw(url: string, opts?: SkipoHTTPOptions): Promise<Response>;
|
|
155
|
-
declare function request<T>(url: string, opts?: SkipoHTTPOptions): Promise<SkipoHTTPResult<T>>;
|
|
156
|
-
declare function get<T>(url: string, opts?: SkipoHTTPOptions): Promise<SkipoHTTPResult<T>>;
|
|
157
|
-
declare function post<T>(url: string, body: any, opts?: SkipoHTTPOptions): Promise<SkipoHTTPResult<T>>;
|
|
158
|
-
declare function put<T>(url: string, body: any, opts?: SkipoHTTPOptions): Promise<SkipoHTTPResult<T>>;
|
|
159
|
-
declare function del<T>(url: string, opts?: SkipoHTTPOptions): Promise<SkipoHTTPResult<T>>;
|
|
160
|
-
/**
|
|
161
|
-
* Creates a client instance.
|
|
162
|
-
*/
|
|
163
|
-
declare function createClient(baseUrl: string, defaultHeaders?: Record<string, string>): {
|
|
164
|
-
get: <T>(path: string, opts?: SkipoHTTPOptions) => Promise<SkipoHTTPResult<T>>;
|
|
165
|
-
post: <T>(path: string, body: any, opts?: SkipoHTTPOptions) => Promise<SkipoHTTPResult<T>>;
|
|
166
|
-
put: <T>(path: string, body: any, opts?: SkipoHTTPOptions) => Promise<SkipoHTTPResult<T>>;
|
|
167
|
-
del: <T>(path: string, opts?: SkipoHTTPOptions) => Promise<SkipoHTTPResult<T>>;
|
|
168
|
-
};
|
|
169
|
-
/**
|
|
170
|
-
* Streaming SSE / Chunk response.
|
|
171
|
-
*/
|
|
172
|
-
declare function streamResponse(url: string, opts?: SkipoHTTPOptions): AsyncIterable<string>;
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* @file events.ts
|
|
176
|
-
* @description Skipo Universal Real-Time Event Bus. Facilitates real-time event broadcasting and streaming.
|
|
177
|
-
*/
|
|
178
|
-
interface RealtimeWorkspaceEvent {
|
|
179
|
-
id: string;
|
|
180
|
-
timestamp: number;
|
|
181
|
-
userId?: string;
|
|
182
|
-
workspaceId?: string;
|
|
183
|
-
source: 'api' | 'ui';
|
|
184
|
-
method?: string;
|
|
185
|
-
endpoint?: string;
|
|
186
|
-
action: 'DOCUMENT_CREATED' | 'DOCUMENT_UPDATED' | 'DOCUMENT_DELETED' | 'CATEGORY_CREATED' | 'CATEGORY_UPDATED' | 'CATEGORY_DELETED' | 'GRAPH_UPDATED' | 'BIOME_CHANGED' | 'WORKSPACE_UPDATED' | 'WORKSPACE_SWITCHED' | 'GENERIC_ACTION' | string;
|
|
187
|
-
details?: string;
|
|
188
|
-
payload?: any;
|
|
189
|
-
}
|
|
190
|
-
type EventListener = (event: RealtimeWorkspaceEvent) => void;
|
|
191
|
-
/**
|
|
192
|
-
* Publish a new event to all active real-time subscribers and store in buffer.
|
|
193
|
-
*/
|
|
194
|
-
declare function publishRealtimeEvent(eventInput: Omit<RealtimeWorkspaceEvent, 'id' | 'timestamp'> & {
|
|
195
|
-
id?: string;
|
|
196
|
-
timestamp?: number;
|
|
197
|
-
}): RealtimeWorkspaceEvent;
|
|
198
|
-
/**
|
|
199
|
-
* Subscribe to real-time events. Returns an unsubscribe function.
|
|
200
|
-
*/
|
|
201
|
-
declare function subscribeRealtimeEvents(listener: EventListener): () => void;
|
|
202
|
-
/**
|
|
203
|
-
* Retrieve recent events since a specified timestamp, optionally filtered by workspaceId or userId.
|
|
204
|
-
*/
|
|
205
|
-
declare function getRecentEvents(sinceTimestamp?: number, workspaceId?: string, userId?: string): RealtimeWorkspaceEvent[];
|
|
206
|
-
|
|
207
|
-
export { type EnvironmentValues, type EventListener, LRUCache, type RealtimeWorkspaceEvent, type SkipoHTTPOptions, type SkipoHTTPResult, TTLCache, createClient, debounce, deepClone, deepEqual, deepMerge, del, get, getEnv, getPath, getRecentEvents, interpolate, isPlaceholderConnection, memoize, objectDiff, once, pLimit, post, prefixedId, publishRealtimeEvent, put, request, requestRaw, requireEnv, retry, sanitizeDatabaseUrl, setPath, shortId, sleep, streamResponse, subscribeRealtimeEvents, swr, throttle, toCamelCase, toKebabCase, toPascalCase, toScreamingSnake, toSlug, toSnakeCase, uuid, validateEnvSchema, withTimeout };
|
|
2
|
+
* @file portable.ts
|
|
3
|
+
* @description Runtime-neutral functions with no Node built-ins or KrnlTS dependency.
|
|
4
|
+
*/
|
|
5
|
+
export * from './types.js';
|
|
6
|
+
export * from './base.js';
|
|
7
|
+
export * from './string.js';
|
|
8
|
+
export * from './async.js';
|
|
9
|
+
export * from './object.js';
|
|
10
|
+
export * from './cache.js';
|
|
11
|
+
export * from './env.js';
|
|
12
|
+
export * from './http.js';
|
|
13
|
+
export * from './events.js';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file shell.ts
|
|
3
|
+
* @description Safe promise-based exec and spawn wrappers with cross-platform command routing.
|
|
4
|
+
*/
|
|
5
|
+
import type { ExecOptions, SpawnOptions } from "child_process";
|
|
6
|
+
export interface SpawnHandle {
|
|
7
|
+
pid?: number;
|
|
8
|
+
kill: (signal?: NodeJS.Signals | number) => boolean;
|
|
9
|
+
promise: Promise<{
|
|
10
|
+
code: number | null;
|
|
11
|
+
signal: NodeJS.Signals | null;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Promisified command execution.
|
|
16
|
+
*/
|
|
17
|
+
export declare function execCmd(cmd: string, opts?: ExecOptions & {
|
|
18
|
+
timeout?: number;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
stdout: string;
|
|
21
|
+
stderr: string;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Streaming command execution.
|
|
25
|
+
*/
|
|
26
|
+
export declare function spawnCmd(cmd: string, args: string[], opts?: SpawnOptions): SpawnHandle;
|
|
27
|
+
/**
|
|
28
|
+
* Defines posix vs win32 specific commands.
|
|
29
|
+
*/
|
|
30
|
+
export declare function platform<T>(routing: {
|
|
31
|
+
posix: T;
|
|
32
|
+
win32: T;
|
|
33
|
+
}): T;
|
|
34
|
+
/**
|
|
35
|
+
* Resolves the full path of a binary.
|
|
36
|
+
*/
|
|
37
|
+
export declare function which(cmd: string): string | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file string.ts
|
|
3
|
+
* @description String case conversions, UUID & ShortID generators, and minimal template interpolation.
|
|
4
|
+
*/
|
|
5
|
+
export declare function toCamelCase(str: string): string;
|
|
6
|
+
export declare function toPascalCase(str: string): string;
|
|
7
|
+
export declare function toSnakeCase(str: string): string;
|
|
8
|
+
export declare function toKebabCase(str: string): string;
|
|
9
|
+
export declare function toScreamingSnake(str: string): string;
|
|
10
|
+
export declare function toSlug(str: string): string;
|
|
11
|
+
export declare function uuid(): string;
|
|
12
|
+
export declare function shortId(length?: number): string;
|
|
13
|
+
export declare function prefixedId(prefix: string, length?: number): string;
|
|
14
|
+
export declare function interpolate(tmpl: string, data: Record<string, any>): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Standard result type for operations that can fail */
|
|
2
|
+
export type Result<T, E = Error> = {
|
|
3
|
+
ok: true;
|
|
4
|
+
value: T;
|
|
5
|
+
} | {
|
|
6
|
+
ok: false;
|
|
7
|
+
error: E;
|
|
8
|
+
};
|
|
9
|
+
/** Standard logger interface */
|
|
10
|
+
export interface Logger {
|
|
11
|
+
log(message: string, ...args: unknown[]): void;
|
|
12
|
+
warn(message: string, ...args: unknown[]): void;
|
|
13
|
+
error(message: string, ...args: unknown[]): void;
|
|
14
|
+
debug?(message: string, ...args: unknown[]): void;
|
|
15
|
+
}
|
|
16
|
+
/** Disposable resource interface */
|
|
17
|
+
export interface Disposable {
|
|
18
|
+
dispose(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/** Generic provider interface */
|
|
21
|
+
export interface Provider<_T = unknown> {
|
|
22
|
+
initialize(): Promise<void>;
|
|
23
|
+
dispose(): Promise<void>;
|
|
24
|
+
isInitialized(): boolean;
|
|
25
|
+
}
|
|
26
|
+
/** Configuration for any Skipo component */
|
|
27
|
+
export interface SkipoConfig {
|
|
28
|
+
name: string;
|
|
29
|
+
logger?: Logger;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
|
-
"build": "tsup src/index.ts src/base.ts src/portable.ts src/node.ts --format esm --
|
|
37
|
+
"build": "tsup src/index.ts src/base.ts src/portable.ts src/node.ts --format esm --clean --external zod --external ws --external @ultrst-armada/krnl && tsc --emitDeclarationOnly --declaration --project tsconfig.json",
|
|
38
38
|
"typecheck": "tsc --noEmit",
|
|
39
39
|
"clean": "rm -rf dist"
|
|
40
40
|
},
|
|
@@ -252,7 +252,7 @@ import {
|
|
|
252
252
|
validateProjectGraph,
|
|
253
253
|
validateUniversalConnection,
|
|
254
254
|
zoomAtPoint
|
|
255
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-YUJC367F.js";
|
|
256
256
|
import {
|
|
257
257
|
BaseHandle,
|
|
258
258
|
DataHandle,
|
|
@@ -262,6 +262,21 @@ import {
|
|
|
262
262
|
instantiateSubgraph
|
|
263
263
|
} from "./chunk-OXUDG6HE.js";
|
|
264
264
|
import "./chunk-RHRXPY2U.js";
|
|
265
|
+
import {
|
|
266
|
+
AttractionEngine,
|
|
267
|
+
GhostInferenceEngine,
|
|
268
|
+
GhostLayoutResolver,
|
|
269
|
+
GhostTracePathBuilder,
|
|
270
|
+
calculateSocketCoordinates,
|
|
271
|
+
getBeamPoints,
|
|
272
|
+
useMagneticTraces
|
|
273
|
+
} from "./chunk-JXDJZSFW.js";
|
|
274
|
+
import {
|
|
275
|
+
ConnectionRuleStore,
|
|
276
|
+
HandleTypeRegistry,
|
|
277
|
+
WireTypeRegistry,
|
|
278
|
+
initializeDefaultGraphRules
|
|
279
|
+
} from "./chunk-TZOL3RN7.js";
|
|
265
280
|
import {
|
|
266
281
|
LifecycleCycleError,
|
|
267
282
|
LifecycleGraph,
|
|
@@ -285,21 +300,6 @@ import {
|
|
|
285
300
|
CustomViewWindow,
|
|
286
301
|
DEFAULT_GRAPH_SETTINGS
|
|
287
302
|
} from "./chunk-5KP74NMF.js";
|
|
288
|
-
import {
|
|
289
|
-
AttractionEngine,
|
|
290
|
-
GhostInferenceEngine,
|
|
291
|
-
GhostLayoutResolver,
|
|
292
|
-
GhostTracePathBuilder,
|
|
293
|
-
calculateSocketCoordinates,
|
|
294
|
-
getBeamPoints,
|
|
295
|
-
useMagneticTraces
|
|
296
|
-
} from "./chunk-JXDJZSFW.js";
|
|
297
|
-
import {
|
|
298
|
-
ConnectionRuleStore,
|
|
299
|
-
HandleTypeRegistry,
|
|
300
|
-
WireTypeRegistry,
|
|
301
|
-
initializeDefaultGraphRules
|
|
302
|
-
} from "./chunk-TZOL3RN7.js";
|
|
303
303
|
import {
|
|
304
304
|
AutoSolidify,
|
|
305
305
|
SpatialEngine,
|
|
@@ -252,7 +252,7 @@ import {
|
|
|
252
252
|
validateProjectGraph,
|
|
253
253
|
validateUniversalConnection,
|
|
254
254
|
zoomAtPoint
|
|
255
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-YUJC367F.js";
|
|
256
256
|
import {
|
|
257
257
|
BaseHandle,
|
|
258
258
|
DataHandle,
|
|
@@ -262,6 +262,21 @@ import {
|
|
|
262
262
|
instantiateSubgraph
|
|
263
263
|
} from "./chunk-OXUDG6HE.js";
|
|
264
264
|
import "./chunk-RHRXPY2U.js";
|
|
265
|
+
import {
|
|
266
|
+
AttractionEngine,
|
|
267
|
+
GhostInferenceEngine,
|
|
268
|
+
GhostLayoutResolver,
|
|
269
|
+
GhostTracePathBuilder,
|
|
270
|
+
calculateSocketCoordinates,
|
|
271
|
+
getBeamPoints,
|
|
272
|
+
useMagneticTraces
|
|
273
|
+
} from "./chunk-JXDJZSFW.js";
|
|
274
|
+
import {
|
|
275
|
+
ConnectionRuleStore,
|
|
276
|
+
HandleTypeRegistry,
|
|
277
|
+
WireTypeRegistry,
|
|
278
|
+
initializeDefaultGraphRules
|
|
279
|
+
} from "./chunk-TZOL3RN7.js";
|
|
265
280
|
import {
|
|
266
281
|
LifecycleCycleError,
|
|
267
282
|
LifecycleGraph,
|
|
@@ -285,21 +300,6 @@ import {
|
|
|
285
300
|
CustomViewWindow,
|
|
286
301
|
DEFAULT_GRAPH_SETTINGS
|
|
287
302
|
} from "./chunk-5KP74NMF.js";
|
|
288
|
-
import {
|
|
289
|
-
AttractionEngine,
|
|
290
|
-
GhostInferenceEngine,
|
|
291
|
-
GhostLayoutResolver,
|
|
292
|
-
GhostTracePathBuilder,
|
|
293
|
-
calculateSocketCoordinates,
|
|
294
|
-
getBeamPoints,
|
|
295
|
-
useMagneticTraces
|
|
296
|
-
} from "./chunk-JXDJZSFW.js";
|
|
297
|
-
import {
|
|
298
|
-
ConnectionRuleStore,
|
|
299
|
-
HandleTypeRegistry,
|
|
300
|
-
WireTypeRegistry,
|
|
301
|
-
initializeDefaultGraphRules
|
|
302
|
-
} from "./chunk-TZOL3RN7.js";
|
|
303
303
|
import {
|
|
304
304
|
AutoSolidify,
|
|
305
305
|
SpatialEngine,
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// src/auth.ts
|
|
2
|
-
import {
|
|
3
|
-
LuthAuthClient,
|
|
4
|
-
createLuthAuthClient,
|
|
5
|
-
hydrateLuthTokenFromUrl,
|
|
6
|
-
resolveClientOrigin,
|
|
7
|
-
resolveClientEnvironment,
|
|
8
|
-
LuthAuthError,
|
|
9
|
-
DEFAULT_LUTH_URL
|
|
10
|
-
} from "@dinilmusick/gutts/auth";
|
|
11
|
-
import {
|
|
12
|
-
LuthAuthClient as LuthAuthClient2,
|
|
13
|
-
createLuthAuthClient as createLuthAuthClient2
|
|
14
|
-
} from "@dinilmusick/gutts/auth";
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
LuthAuthClient,
|
|
18
|
-
createLuthAuthClient,
|
|
19
|
-
hydrateLuthTokenFromUrl,
|
|
20
|
-
resolveClientOrigin,
|
|
21
|
-
resolveClientEnvironment,
|
|
22
|
-
LuthAuthError,
|
|
23
|
-
DEFAULT_LUTH_URL,
|
|
24
|
-
LuthAuthClient2,
|
|
25
|
-
createLuthAuthClient2
|
|
26
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/** Standard result type for operations that can fail */
|
|
2
|
-
type Result<T, E = Error> = {
|
|
3
|
-
ok: true;
|
|
4
|
-
value: T;
|
|
5
|
-
} | {
|
|
6
|
-
ok: false;
|
|
7
|
-
error: E;
|
|
8
|
-
};
|
|
9
|
-
/** Standard logger interface */
|
|
10
|
-
interface Logger {
|
|
11
|
-
log(message: string, ...args: unknown[]): void;
|
|
12
|
-
warn(message: string, ...args: unknown[]): void;
|
|
13
|
-
error(message: string, ...args: unknown[]): void;
|
|
14
|
-
debug?(message: string, ...args: unknown[]): void;
|
|
15
|
-
}
|
|
16
|
-
/** Disposable resource interface */
|
|
17
|
-
interface Disposable {
|
|
18
|
-
dispose(): Promise<void>;
|
|
19
|
-
}
|
|
20
|
-
/** Generic provider interface */
|
|
21
|
-
interface Provider<_T = unknown> {
|
|
22
|
-
initialize(): Promise<void>;
|
|
23
|
-
dispose(): Promise<void>;
|
|
24
|
-
isInitialized(): boolean;
|
|
25
|
-
}
|
|
26
|
-
/** Configuration for any Skipo component */
|
|
27
|
-
interface SkipoConfig {
|
|
28
|
-
name: string;
|
|
29
|
-
logger?: Logger;
|
|
30
|
-
[key: string]: unknown;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* SkipoBase — Abstract foundation class for all Skipo components.
|
|
35
|
-
* Provides lifecycle management, logging, and unique identification.
|
|
36
|
-
* All @skipo/* classes should extend this.
|
|
37
|
-
*/
|
|
38
|
-
declare abstract class SkipoBase implements Disposable {
|
|
39
|
-
/** Unique instance identifier */
|
|
40
|
-
readonly instanceId: string;
|
|
41
|
-
/** Human-readable component name */
|
|
42
|
-
readonly name: string;
|
|
43
|
-
/** Logger instance */
|
|
44
|
-
protected readonly logger: Logger;
|
|
45
|
-
/** Whether this component has been initialized */
|
|
46
|
-
protected initialized: boolean;
|
|
47
|
-
/** Whether this component has been disposed */
|
|
48
|
-
protected disposed: boolean;
|
|
49
|
-
constructor(config?: SkipoConfig);
|
|
50
|
-
/** Initialize the component. Call before use. */
|
|
51
|
-
initialize(): Promise<void>;
|
|
52
|
-
/** Override to add custom initialization logic */
|
|
53
|
-
protected onInitialize(): Promise<void>;
|
|
54
|
-
/** Dispose the component and release resources */
|
|
55
|
-
dispose(): Promise<void>;
|
|
56
|
-
/** Override to add custom cleanup logic */
|
|
57
|
-
protected onDispose(): Promise<void>;
|
|
58
|
-
/** Guard: throws if not initialized */
|
|
59
|
-
protected ensureInitialized(): void;
|
|
60
|
-
/** Guard: throws if already disposed */
|
|
61
|
-
protected ensureNotDisposed(): void;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export { type Disposable as D, type Logger as L, type Provider as P, type Result as R, SkipoBase as S, type SkipoConfig as a };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataHandle
|
|
3
3
|
} from "./chunk-OXUDG6HE.js";
|
|
4
|
-
import {
|
|
5
|
-
BaseNode
|
|
6
|
-
} from "./chunk-5KP74NMF.js";
|
|
7
4
|
import {
|
|
8
5
|
AttractionEngine
|
|
9
6
|
} from "./chunk-JXDJZSFW.js";
|
|
@@ -11,6 +8,9 @@ import {
|
|
|
11
8
|
HandleTypeRegistry,
|
|
12
9
|
WireTypeRegistry
|
|
13
10
|
} from "./chunk-TZOL3RN7.js";
|
|
11
|
+
import {
|
|
12
|
+
BaseNode
|
|
13
|
+
} from "./chunk-5KP74NMF.js";
|
|
14
14
|
import {
|
|
15
15
|
AutoSolidify,
|
|
16
16
|
TraceEngine
|