mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-20 21:02:09 +00:00
Integrate OpenHandoff factory workspace (#212)
This commit is contained in:
parent
3d9476ed0b
commit
bf282199b5
251 changed files with 42824 additions and 692 deletions
99
factory/packages/backend/src/providers/provider-api/index.ts
Normal file
99
factory/packages/backend/src/providers/provider-api/index.ts
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
import type { ProviderId } from "@openhandoff/shared";
|
||||
|
||||
export interface ProviderCapabilities {
|
||||
remote: boolean;
|
||||
supportsSessionReuse: boolean;
|
||||
}
|
||||
|
||||
export interface CreateSandboxRequest {
|
||||
workspaceId: string;
|
||||
repoId: string;
|
||||
repoRemote: string;
|
||||
branchName: string;
|
||||
handoffId: string;
|
||||
debug?: (message: string, context?: Record<string, unknown>) => void;
|
||||
options?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface ResumeSandboxRequest {
|
||||
workspaceId: string;
|
||||
sandboxId: string;
|
||||
options?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface DestroySandboxRequest {
|
||||
workspaceId: string;
|
||||
sandboxId: string;
|
||||
}
|
||||
|
||||
export interface ReleaseSandboxRequest {
|
||||
workspaceId: string;
|
||||
sandboxId: string;
|
||||
}
|
||||
|
||||
export interface EnsureAgentRequest {
|
||||
workspaceId: string;
|
||||
sandboxId: string;
|
||||
}
|
||||
|
||||
export interface SandboxHealthRequest {
|
||||
workspaceId: string;
|
||||
sandboxId: string;
|
||||
}
|
||||
|
||||
export interface AttachTargetRequest {
|
||||
workspaceId: string;
|
||||
sandboxId: string;
|
||||
}
|
||||
|
||||
export interface ExecuteSandboxCommandRequest {
|
||||
workspaceId: string;
|
||||
sandboxId: string;
|
||||
command: string;
|
||||
label?: string;
|
||||
}
|
||||
|
||||
export interface SandboxHandle {
|
||||
sandboxId: string;
|
||||
switchTarget: string;
|
||||
metadata: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface AgentEndpoint {
|
||||
endpoint: string;
|
||||
token?: string;
|
||||
}
|
||||
|
||||
export interface SandboxHealth {
|
||||
status: "healthy" | "degraded" | "down";
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface AttachTarget {
|
||||
target: string;
|
||||
}
|
||||
|
||||
export interface ExecuteSandboxCommandResult {
|
||||
exitCode: number;
|
||||
result: string;
|
||||
}
|
||||
|
||||
export interface SandboxProvider {
|
||||
id(): ProviderId;
|
||||
capabilities(): ProviderCapabilities;
|
||||
validateConfig(input: unknown): Promise<Record<string, unknown>>;
|
||||
|
||||
createSandbox(req: CreateSandboxRequest): Promise<SandboxHandle>;
|
||||
resumeSandbox(req: ResumeSandboxRequest): Promise<SandboxHandle>;
|
||||
destroySandbox(req: DestroySandboxRequest): Promise<void>;
|
||||
/**
|
||||
* Release resources for a sandbox without deleting its filesystem/state.
|
||||
* For remote providers, this typically maps to "stop"/"suspend".
|
||||
*/
|
||||
releaseSandbox(req: ReleaseSandboxRequest): Promise<void>;
|
||||
|
||||
ensureSandboxAgent(req: EnsureAgentRequest): Promise<AgentEndpoint>;
|
||||
health(req: SandboxHealthRequest): Promise<SandboxHealth>;
|
||||
attachTarget(req: AttachTargetRequest): Promise<AttachTarget>;
|
||||
executeCommand(req: ExecuteSandboxCommandRequest): Promise<ExecuteSandboxCommandResult>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue