@saturn-universe/runtime-host 0.0.0-stage → 0.1.0
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/LICENSE +661 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/README.md +13 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/index.mjs +1473 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/package.json +10 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/src/board.mjs +321 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/src/ledger.mjs +1143 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/src/platform/ctfd.mjs +154 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/src/platform/ctfplus.mjs +769 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/src/platform/gzctf.mjs +130 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/src/platform/http.mjs +336 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/src/platform/index.mjs +133 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/src/platform/lease.mjs +153 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/src/server.mjs +336 -0
- package/dist/builtin-plugins/saturn-plugin-ctf/src/view.mjs +714 -0
- package/dist/command-dispatch.d.ts +10 -0
- package/dist/command-dispatch.js +65 -0
- package/dist/completion-judge.d.ts +10 -0
- package/dist/completion-judge.js +156 -0
- package/dist/composition.d.ts +108 -0
- package/dist/composition.js +1180 -0
- package/dist/configuration.d.ts +49 -0
- package/dist/configuration.js +51 -0
- package/dist/context-extensions.d.ts +681 -0
- package/dist/context-extensions.js +289 -0
- package/dist/cordis/context-core-plugin.d.ts +35 -0
- package/dist/cordis/context-core-plugin.js +296 -0
- package/dist/cordis/env-probe-plugin.d.ts +27 -0
- package/dist/cordis/env-probe-plugin.js +114 -0
- package/dist/cordis/host-context.d.ts +65 -0
- package/dist/cordis/host-context.js +199 -0
- package/dist/cordis/model-responses-plugin.d.ts +81 -0
- package/dist/cordis/model-responses-plugin.js +209 -0
- package/dist/cordis/plugin-contributions.d.ts +47 -0
- package/dist/cordis/plugin-contributions.js +119 -0
- package/dist/cordis/plugin-lifecycle.d.ts +57 -0
- package/dist/cordis/plugin-lifecycle.js +222 -0
- package/dist/cordis/plugin-loader.d.ts +18 -0
- package/dist/cordis/plugin-loader.js +310 -0
- package/dist/cordis/plugin-sdk-adapter.d.ts +17 -0
- package/dist/cordis/plugin-sdk-adapter.js +283 -0
- package/dist/cordis/required-host-plugin.d.ts +6 -0
- package/dist/cordis/required-host-plugin.js +1 -0
- package/dist/cordis/runtime-hooks-plugin.d.ts +23 -0
- package/dist/cordis/runtime-hooks-plugin.js +103 -0
- package/dist/cordis/sandbox-plugin.d.ts +18 -0
- package/dist/cordis/sandbox-plugin.js +21 -0
- package/dist/cordis/scoped-layers.d.ts +63 -0
- package/dist/cordis/scoped-layers.js +170 -0
- package/dist/cordis/tools/builtin-agent-tools-plugin.d.ts +11 -0
- package/dist/cordis/tools/builtin-agent-tools-plugin.js +171 -0
- package/dist/cordis/tools/index.d.ts +17 -0
- package/dist/cordis/tools/index.js +40 -0
- package/dist/cordis/tools/mcp-tools-plugin.d.ts +7 -0
- package/dist/cordis/tools/mcp-tools-plugin.js +116 -0
- package/dist/cordis/tools/process-manager-plugin.d.ts +11 -0
- package/dist/cordis/tools/process-manager-plugin.js +39 -0
- package/dist/cordis/tools/sandbox-target-tools-plugin.d.ts +13 -0
- package/dist/cordis/tools/sandbox-target-tools-plugin.js +255 -0
- package/dist/cordis/tools/tool-guidance.d.ts +4 -0
- package/dist/cordis/tools/tool-guidance.js +30 -0
- package/dist/cordis/tools/tools-core-plugin.d.ts +128 -0
- package/dist/cordis/tools/tools-core-plugin.js +486 -0
- package/dist/cordis/tools/web-fetch.d.ts +17 -0
- package/dist/cordis/tools/web-fetch.js +529 -0
- package/dist/cordis/tools/web-search-tools-plugin.d.ts +10 -0
- package/dist/cordis/tools/web-search-tools-plugin.js +191 -0
- package/dist/cordis/tools/workspace-tools-plugin.d.ts +8 -0
- package/dist/cordis/tools/workspace-tools-plugin.js +145 -0
- package/dist/env-probe.d.ts +8 -0
- package/dist/env-probe.js +172 -0
- package/dist/host-configuration.d.ts +27 -0
- package/dist/host-configuration.js +185 -0
- package/dist/host-tools.d.ts +19 -0
- package/dist/host-tools.js +30 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +140 -0
- package/dist/ipc.d.ts +24 -0
- package/dist/ipc.js +162 -0
- package/dist/logger.d.ts +11 -0
- package/dist/logger.js +84 -0
- package/dist/mcp-configuration.d.ts +17 -0
- package/dist/mcp-configuration.js +50 -0
- package/dist/modes.d.ts +27 -0
- package/dist/modes.js +472 -0
- package/dist/ownership.d.ts +7 -0
- package/dist/ownership.js +100 -0
- package/dist/plugin-configuration.d.ts +9 -0
- package/dist/plugin-configuration.js +21 -0
- package/dist/plugin-tool-grants.d.ts +18 -0
- package/dist/plugin-tool-grants.js +21 -0
- package/dist/process-workspaces.d.ts +4 -0
- package/dist/process-workspaces.js +28 -0
- package/dist/progress.d.ts +30 -0
- package/dist/progress.js +699 -0
- package/dist/provider-catalog.d.ts +754 -0
- package/dist/provider-catalog.js +471 -0
- package/dist/run-budget.d.ts +24 -0
- package/dist/run-budget.js +47 -0
- package/dist/run-checkpoint.d.ts +2 -0
- package/dist/run-checkpoint.js +52 -0
- package/dist/sandbox-manager.d.ts +111 -0
- package/dist/sandbox-manager.js +1519 -0
- package/dist/session-paths.d.ts +15 -0
- package/dist/session-paths.js +40 -0
- package/dist/side-question.d.ts +14 -0
- package/dist/side-question.js +89 -0
- package/dist/skills-runtime.d.ts +13 -0
- package/dist/skills-runtime.js +243 -0
- package/dist/token-estimator.d.ts +3 -0
- package/dist/token-estimator.js +73 -0
- package/dist/tool-result.d.ts +2 -0
- package/dist/tool-result.js +91 -0
- package/dist/user-config.d.ts +23 -0
- package/dist/user-config.js +36 -0
- package/package.json +28 -3
- package/README.md +0 -3
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { AgentSessionId, HostSandboxStatus, LoggerPort, ModeDefinition, RunId, SandboxBackendKind, SandboxNetworkMode, WorkerSandboxProfile } from '@saturn-universe/core';
|
|
2
|
+
import type { ContainerRunner, ExecutionBackend } from '@saturn-universe/tools';
|
|
3
|
+
export interface SandboxMetaRecord {
|
|
4
|
+
readonly version: 1;
|
|
5
|
+
readonly workspaceRoot: string;
|
|
6
|
+
readonly workspaceHash: string;
|
|
7
|
+
readonly sessionId?: string;
|
|
8
|
+
readonly runId: string;
|
|
9
|
+
readonly role: 'main' | 'worker' | 'target';
|
|
10
|
+
readonly memberId: string;
|
|
11
|
+
readonly agentSessionId: string;
|
|
12
|
+
readonly sandboxProfile: WorkerSandboxProfile | 'main' | 'target';
|
|
13
|
+
readonly backend: SandboxBackendKind;
|
|
14
|
+
readonly image: string;
|
|
15
|
+
readonly containerId: string;
|
|
16
|
+
readonly containerName: string;
|
|
17
|
+
readonly workDir: string;
|
|
18
|
+
readonly readonly: boolean;
|
|
19
|
+
readonly workSubpath?: string;
|
|
20
|
+
readonly network: SandboxNetworkMode;
|
|
21
|
+
readonly networkName?: string;
|
|
22
|
+
readonly port?: number;
|
|
23
|
+
readonly createdAt: string;
|
|
24
|
+
readonly updatedAt: string;
|
|
25
|
+
readonly expiresAt?: string;
|
|
26
|
+
readonly status: 'running' | 'completed' | 'failed' | 'cancelled' | 'quota_exceeded' | 'cleaned';
|
|
27
|
+
}
|
|
28
|
+
export interface SandboxProbeContext {
|
|
29
|
+
readonly backend: string;
|
|
30
|
+
readonly image?: string;
|
|
31
|
+
readonly containerWorkDir?: string;
|
|
32
|
+
readonly network?: string;
|
|
33
|
+
readonly fallbackActive?: boolean;
|
|
34
|
+
readonly probeSummary?: string;
|
|
35
|
+
readonly capAdd?: readonly string[];
|
|
36
|
+
readonly tmpNoexec?: boolean;
|
|
37
|
+
readonly kvmActive?: boolean;
|
|
38
|
+
readonly workSubpath?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SandboxManagerOptions {
|
|
41
|
+
readonly root: string;
|
|
42
|
+
readonly mode: ModeDefinition;
|
|
43
|
+
readonly logger: LoggerPort;
|
|
44
|
+
readonly allowUnsafeFallback?: boolean;
|
|
45
|
+
readonly runner?: ContainerRunner;
|
|
46
|
+
readonly checkKvmAvailable?: () => boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface SandboxTargetStartInput {
|
|
49
|
+
readonly runId: RunId;
|
|
50
|
+
readonly agentSessionId?: AgentSessionId;
|
|
51
|
+
readonly name?: string;
|
|
52
|
+
readonly command: string;
|
|
53
|
+
readonly port: number;
|
|
54
|
+
readonly capabilities?: readonly string[];
|
|
55
|
+
readonly seedFiles?: Readonly<Record<string, string>>;
|
|
56
|
+
readonly readyTimeoutMs?: number;
|
|
57
|
+
}
|
|
58
|
+
export interface SandboxTargetStartResult {
|
|
59
|
+
readonly targetId: string;
|
|
60
|
+
readonly name: string;
|
|
61
|
+
readonly host: string;
|
|
62
|
+
readonly port: number;
|
|
63
|
+
readonly network: string;
|
|
64
|
+
readonly status: 'running';
|
|
65
|
+
readonly initialLogs: string;
|
|
66
|
+
}
|
|
67
|
+
export interface SandboxTargetStopResult {
|
|
68
|
+
readonly targetId: string;
|
|
69
|
+
readonly name: string;
|
|
70
|
+
readonly status: 'stopped';
|
|
71
|
+
}
|
|
72
|
+
export interface SandboxTargetLogsResult {
|
|
73
|
+
readonly targetId: string;
|
|
74
|
+
readonly name: string;
|
|
75
|
+
readonly logs: string;
|
|
76
|
+
readonly truncated: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface SandboxMainSyncResult {
|
|
79
|
+
readonly synced: readonly string[];
|
|
80
|
+
readonly skipped: readonly string[];
|
|
81
|
+
readonly partial: boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface SandboxManager {
|
|
84
|
+
readonly executionBackend: ExecutionBackend;
|
|
85
|
+
activate(signal?: AbortSignal): Promise<void>;
|
|
86
|
+
ensureMainSandbox(runId: RunId, agentSessionId: AgentSessionId, sessionId?: string): Promise<void>;
|
|
87
|
+
syncMainWorkspaceSubpaths(runId: RunId, subpaths: readonly string[], sessionId?: string): Promise<SandboxMainSyncResult>;
|
|
88
|
+
ensureWorkerSandbox(input: {
|
|
89
|
+
readonly runId: RunId;
|
|
90
|
+
readonly sessionId?: string;
|
|
91
|
+
readonly memberId: string;
|
|
92
|
+
readonly agentSessionId: AgentSessionId;
|
|
93
|
+
readonly parentAgentSessionId?: AgentSessionId;
|
|
94
|
+
readonly sandboxProfile?: WorkerSandboxProfile;
|
|
95
|
+
readonly workSubpath?: string;
|
|
96
|
+
}): Promise<void>;
|
|
97
|
+
isAgentIsolated(runId: RunId, agentSessionId: AgentSessionId): boolean;
|
|
98
|
+
teardownWorker(runId: RunId, agentSessionId: AgentSessionId, status: 'completed' | 'failed' | 'interrupted'): Promise<void>;
|
|
99
|
+
teardownRun(runId: RunId, status?: string): Promise<void>;
|
|
100
|
+
getProbeContext(runId?: RunId, agentSessionId?: AgentSessionId): SandboxProbeContext | undefined;
|
|
101
|
+
isTargetServicesEnabled(): boolean;
|
|
102
|
+
isWorkerTargetServicesEnabled(): boolean;
|
|
103
|
+
startTarget(input: SandboxTargetStartInput): Promise<SandboxTargetStartResult>;
|
|
104
|
+
stopTarget(runId: RunId, name?: string, agentSessionId?: AgentSessionId): Promise<SandboxTargetStopResult>;
|
|
105
|
+
getTargetLogs(runId: RunId, name?: string, tailLines?: number, agentSessionId?: AgentSessionId): Promise<SandboxTargetLogsResult>;
|
|
106
|
+
status(): HostSandboxStatus;
|
|
107
|
+
dispose(): Promise<void>;
|
|
108
|
+
}
|
|
109
|
+
export declare function sanitizeSandboxSegment(value: string): string;
|
|
110
|
+
export declare function computeWorkspaceHash(workspaceRoot: string): string;
|
|
111
|
+
export declare function createSandboxManager(options: SandboxManagerOptions): SandboxManager;
|