@ricsam/r5d-worker 0.0.110 → 0.0.112

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.
@@ -0,0 +1,61 @@
1
+ export type CommandLaunchRequest = {
2
+ id: string;
3
+ kind: "exec" | "exec_start" | "pty_open";
4
+ workspaceEffect?: "none";
5
+ sessionId?: string;
6
+ assertAdmission: () => void;
7
+ };
8
+ export type CommandLaunchLease = {
9
+ wrap(argv: string[]): string[];
10
+ cancel(): Promise<void>;
11
+ diagnose(): Promise<string | undefined>;
12
+ release(): Promise<void>;
13
+ };
14
+ export declare class CommandLauncherUnavailableError extends Error {
15
+ constructor(message: string, cause?: unknown);
16
+ }
17
+ export declare class CommandLaunchCancelledError extends Error {
18
+ constructor();
19
+ }
20
+ export declare function parseCommandLauncher(configuration: string | undefined): string[] | undefined;
21
+ /** Launcher configuration is operator-owned; do not inherit worker or package credentials. */
22
+ export declare function commandLauncherEnvironment(source?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
23
+ /** Generic optional JSONL controller; policy and OS-specific launch prefixes live outside the worker. */
24
+ export declare class WorkerCommandLauncher {
25
+ private readonly options;
26
+ readonly mode: "direct" | "external";
27
+ private readonly child?;
28
+ private readonly pending;
29
+ private readonly launches;
30
+ private readonly exited;
31
+ private failure?;
32
+ private closing;
33
+ private initialized;
34
+ private closePromise?;
35
+ private sequence;
36
+ constructor(options?: {
37
+ argv?: string[];
38
+ env?: NodeJS.ProcessEnv;
39
+ onFailure?: (error: Error, ids: string[]) => void;
40
+ onStderr?: (text: string) => void;
41
+ requestTimeoutMs?: number;
42
+ acquisitionTimeoutMs?: number;
43
+ });
44
+ initialize(): Promise<void>;
45
+ get activeIds(): string[];
46
+ acquire(request: CommandLaunchRequest): Promise<CommandLaunchLease>;
47
+ cancel(id: string): Promise<void>;
48
+ cancelSession(sessionId: string): Promise<void>;
49
+ cancelMatching(matches: (id: string, sessionId?: string) => boolean): Promise<void>;
50
+ close(): Promise<void>;
51
+ private waitForExit;
52
+ private releaseRecord;
53
+ private assertHealthy;
54
+ private rpc;
55
+ private receive;
56
+ private rejectPending;
57
+ private fail;
58
+ }
59
+ export declare function createWorkerCommandLauncher(options?: Omit<NonNullable<ConstructorParameters<typeof WorkerCommandLauncher>[0]>, "argv"> & {
60
+ configuration?: string;
61
+ }): Promise<WorkerCommandLauncher>;
@@ -0,0 +1,3 @@
1
+ export declare const WORKER_INLINE_OUTPUT_MAX_BYTES: number;
2
+ /** Bound inline RPC buffers in the worker regardless of child launch policy. */
3
+ export declare function collectWorkerInlineOutput(stream: ReadableStream<Uint8Array> | null, maxBytes?: number, signal?: AbortSignal): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-worker",
3
- "version": "0.0.110",
3
+ "version": "0.0.112",
4
4
  "type": "module",
5
5
  "main": "./dist/cjs/main.cjs",
6
6
  "module": "./dist/mjs/main.mjs",