agent-neckbeard 1.1.18 → 1.1.20
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/CHANGELOG.md +32 -0
- package/README.md +171 -67
- package/dist/chunk-33IXN6MM.js +21 -0
- package/dist/chunk-3EB4CT5S.js +2516 -0
- package/dist/{chunk-AM2J5KBI.js → chunk-DHFC3O44.js} +4 -8
- package/dist/index.cjs +3652 -535
- package/dist/index.d.cts +150 -56
- package/dist/index.d.ts +150 -56
- package/dist/index.js +1167 -501
- package/dist/{invoke-client-XEH6FVRH.js → invoke-client-D5TMTOYM.js} +2 -1
- package/dist/sandbox-capabilities-CFjnZ_kB.d.cts +77 -0
- package/dist/sandbox-capabilities-CFjnZ_kB.d.ts +77 -0
- package/dist/supervisor.cjs +6043 -0
- package/dist/supervisor.d.cts +470 -0
- package/dist/supervisor.d.ts +470 -0
- package/dist/supervisor.js +3535 -0
- package/docs/SUPERVISOR.md +248 -0
- package/package.json +20 -8
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** File content accepted by the public sandbox client. */
|
|
2
|
+
type SandboxFileContent = string | ArrayBuffer | Uint8Array;
|
|
3
|
+
/** File content used by portable, generated sandbox artifacts. */
|
|
4
|
+
type PortableSandboxFileContent = string | Uint8Array;
|
|
5
|
+
interface SandboxCommandOptions {
|
|
6
|
+
cwd?: string;
|
|
7
|
+
envs?: Record<string, string>;
|
|
8
|
+
timeoutMs: number;
|
|
9
|
+
onStdout?: (data: string) => void;
|
|
10
|
+
onStderr?: (data: string) => void;
|
|
11
|
+
}
|
|
12
|
+
/** Result from running a sandbox command with captured output. */
|
|
13
|
+
interface SandboxCommandResult {
|
|
14
|
+
exitCode: number;
|
|
15
|
+
stdout: string;
|
|
16
|
+
stderr: string;
|
|
17
|
+
}
|
|
18
|
+
interface SandboxDetachedCommandOptions {
|
|
19
|
+
cwd?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Environment applied only when the requested payload is spawned. Detached
|
|
22
|
+
* lifecycle preparation and its persistent reaper use a fixed clean
|
|
23
|
+
* environment.
|
|
24
|
+
*/
|
|
25
|
+
envs?: Record<string, string>;
|
|
26
|
+
/**
|
|
27
|
+
* Stable semantic identity for this launch. Providers hash this value before
|
|
28
|
+
* using it in sandbox paths so retries can adopt an already-prepared process
|
|
29
|
+
* without exposing the raw identity.
|
|
30
|
+
*/
|
|
31
|
+
launchId?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Runs after the provider has captured a birth-fenced process identity but
|
|
34
|
+
* before the sandbox process is allowed to execute the requested command.
|
|
35
|
+
*/
|
|
36
|
+
beforeRelease?: (command: SandboxDetachedCommand) => void | Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
interface SandboxDetachedCommand {
|
|
39
|
+
/**
|
|
40
|
+
* Provider-owned opaque session identity. Pass the complete handle to
|
|
41
|
+
* follow-up APIs instead of separating this value from `commandId`.
|
|
42
|
+
*/
|
|
43
|
+
readonly sessionId: string;
|
|
44
|
+
/** Provider-owned command identity, when the underlying provider has one. */
|
|
45
|
+
readonly commandId?: string;
|
|
46
|
+
}
|
|
47
|
+
interface SandboxFilesystemCapabilities<TContent = SandboxFileContent> {
|
|
48
|
+
makeDir(path: string): Promise<void>;
|
|
49
|
+
writeFile(path: string, content: TContent): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
interface SandboxCommandCapabilities<TOptions = SandboxCommandOptions> {
|
|
52
|
+
runCommand(command: string, options: TOptions): Promise<SandboxCommandResult>;
|
|
53
|
+
}
|
|
54
|
+
type SupervisorSandboxCommandOptions = Pick<SandboxCommandOptions, 'cwd' | 'envs' | 'timeoutMs'>;
|
|
55
|
+
/** Detached launch contract used only by durable supervisor deployment. */
|
|
56
|
+
interface SupervisorSandboxDetachedCommandOptions extends SandboxDetachedCommandOptions {
|
|
57
|
+
/**
|
|
58
|
+
* Starts the supervisor with a clean initial environment and hydrates
|
|
59
|
+
* `envs` from an inherited, unlinked descriptor.
|
|
60
|
+
*/
|
|
61
|
+
environmentMode: 'supervisor-fd-v1';
|
|
62
|
+
/** Binds a replacement generation to the exact supervisor environment. */
|
|
63
|
+
environmentRevision: string;
|
|
64
|
+
/**
|
|
65
|
+
* Permit replacement only after the exact released process session is
|
|
66
|
+
* proven empty. Durable reconciliation requires this generation policy.
|
|
67
|
+
*/
|
|
68
|
+
restartReleasedWhenExited: true;
|
|
69
|
+
}
|
|
70
|
+
/** Detached launch capability used only by durable supervisor deployment. */
|
|
71
|
+
interface SupervisorSandboxDetachedCommandCapabilities {
|
|
72
|
+
startDetachedCommand(command: string, options: SupervisorSandboxDetachedCommandOptions): Promise<SandboxDetachedCommand>;
|
|
73
|
+
}
|
|
74
|
+
/** Minimal host-side capabilities needed to deploy a generated supervisor. */
|
|
75
|
+
type SupervisorSandboxCapabilities = SandboxFilesystemCapabilities<PortableSandboxFileContent> & SandboxCommandCapabilities<SupervisorSandboxCommandOptions> & SupervisorSandboxDetachedCommandCapabilities;
|
|
76
|
+
|
|
77
|
+
export type { SandboxFileContent as S, SandboxCommandOptions as a, SandboxCommandResult as b, SandboxDetachedCommandOptions as c, SandboxDetachedCommand as d, SupervisorSandboxCapabilities as e, SupervisorSandboxDetachedCommandOptions as f };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** File content accepted by the public sandbox client. */
|
|
2
|
+
type SandboxFileContent = string | ArrayBuffer | Uint8Array;
|
|
3
|
+
/** File content used by portable, generated sandbox artifacts. */
|
|
4
|
+
type PortableSandboxFileContent = string | Uint8Array;
|
|
5
|
+
interface SandboxCommandOptions {
|
|
6
|
+
cwd?: string;
|
|
7
|
+
envs?: Record<string, string>;
|
|
8
|
+
timeoutMs: number;
|
|
9
|
+
onStdout?: (data: string) => void;
|
|
10
|
+
onStderr?: (data: string) => void;
|
|
11
|
+
}
|
|
12
|
+
/** Result from running a sandbox command with captured output. */
|
|
13
|
+
interface SandboxCommandResult {
|
|
14
|
+
exitCode: number;
|
|
15
|
+
stdout: string;
|
|
16
|
+
stderr: string;
|
|
17
|
+
}
|
|
18
|
+
interface SandboxDetachedCommandOptions {
|
|
19
|
+
cwd?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Environment applied only when the requested payload is spawned. Detached
|
|
22
|
+
* lifecycle preparation and its persistent reaper use a fixed clean
|
|
23
|
+
* environment.
|
|
24
|
+
*/
|
|
25
|
+
envs?: Record<string, string>;
|
|
26
|
+
/**
|
|
27
|
+
* Stable semantic identity for this launch. Providers hash this value before
|
|
28
|
+
* using it in sandbox paths so retries can adopt an already-prepared process
|
|
29
|
+
* without exposing the raw identity.
|
|
30
|
+
*/
|
|
31
|
+
launchId?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Runs after the provider has captured a birth-fenced process identity but
|
|
34
|
+
* before the sandbox process is allowed to execute the requested command.
|
|
35
|
+
*/
|
|
36
|
+
beforeRelease?: (command: SandboxDetachedCommand) => void | Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
interface SandboxDetachedCommand {
|
|
39
|
+
/**
|
|
40
|
+
* Provider-owned opaque session identity. Pass the complete handle to
|
|
41
|
+
* follow-up APIs instead of separating this value from `commandId`.
|
|
42
|
+
*/
|
|
43
|
+
readonly sessionId: string;
|
|
44
|
+
/** Provider-owned command identity, when the underlying provider has one. */
|
|
45
|
+
readonly commandId?: string;
|
|
46
|
+
}
|
|
47
|
+
interface SandboxFilesystemCapabilities<TContent = SandboxFileContent> {
|
|
48
|
+
makeDir(path: string): Promise<void>;
|
|
49
|
+
writeFile(path: string, content: TContent): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
interface SandboxCommandCapabilities<TOptions = SandboxCommandOptions> {
|
|
52
|
+
runCommand(command: string, options: TOptions): Promise<SandboxCommandResult>;
|
|
53
|
+
}
|
|
54
|
+
type SupervisorSandboxCommandOptions = Pick<SandboxCommandOptions, 'cwd' | 'envs' | 'timeoutMs'>;
|
|
55
|
+
/** Detached launch contract used only by durable supervisor deployment. */
|
|
56
|
+
interface SupervisorSandboxDetachedCommandOptions extends SandboxDetachedCommandOptions {
|
|
57
|
+
/**
|
|
58
|
+
* Starts the supervisor with a clean initial environment and hydrates
|
|
59
|
+
* `envs` from an inherited, unlinked descriptor.
|
|
60
|
+
*/
|
|
61
|
+
environmentMode: 'supervisor-fd-v1';
|
|
62
|
+
/** Binds a replacement generation to the exact supervisor environment. */
|
|
63
|
+
environmentRevision: string;
|
|
64
|
+
/**
|
|
65
|
+
* Permit replacement only after the exact released process session is
|
|
66
|
+
* proven empty. Durable reconciliation requires this generation policy.
|
|
67
|
+
*/
|
|
68
|
+
restartReleasedWhenExited: true;
|
|
69
|
+
}
|
|
70
|
+
/** Detached launch capability used only by durable supervisor deployment. */
|
|
71
|
+
interface SupervisorSandboxDetachedCommandCapabilities {
|
|
72
|
+
startDetachedCommand(command: string, options: SupervisorSandboxDetachedCommandOptions): Promise<SandboxDetachedCommand>;
|
|
73
|
+
}
|
|
74
|
+
/** Minimal host-side capabilities needed to deploy a generated supervisor. */
|
|
75
|
+
type SupervisorSandboxCapabilities = SandboxFilesystemCapabilities<PortableSandboxFileContent> & SandboxCommandCapabilities<SupervisorSandboxCommandOptions> & SupervisorSandboxDetachedCommandCapabilities;
|
|
76
|
+
|
|
77
|
+
export type { SandboxFileContent as S, SandboxCommandOptions as a, SandboxCommandResult as b, SandboxDetachedCommandOptions as c, SandboxDetachedCommand as d, SupervisorSandboxCapabilities as e, SupervisorSandboxDetachedCommandOptions as f };
|