sandbox-agent 0.3.1 → 0.4.0-rc.1

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,15 @@
1
+ // src/providers/shared.ts
2
+ var DEFAULT_SANDBOX_AGENT_IMAGE = "rivetdev/sandbox-agent:0.3.2-full";
3
+ var SANDBOX_AGENT_INSTALL_SCRIPT = "https://releases.rivet.dev/sandbox-agent/0.3.x/install.sh";
4
+ var DEFAULT_AGENTS = ["claude", "codex"];
5
+ function buildServerStartCommand(port) {
6
+ return `nohup sandbox-agent server --no-token --host 0.0.0.0 --port ${port} >/tmp/sandbox-agent.log 2>&1 &`;
7
+ }
8
+
9
+ export {
10
+ DEFAULT_SANDBOX_AGENT_IMAGE,
11
+ SANDBOX_AGENT_INSTALL_SCRIPT,
12
+ DEFAULT_AGENTS,
13
+ buildServerStartCommand
14
+ };
15
+ //# sourceMappingURL=chunk-L5GMFVCC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/providers/shared.ts"],"sourcesContent":["export const DEFAULT_SANDBOX_AGENT_IMAGE = \"rivetdev/sandbox-agent:0.3.2-full\";\nexport const SANDBOX_AGENT_INSTALL_SCRIPT = \"https://releases.rivet.dev/sandbox-agent/0.3.x/install.sh\";\nexport const DEFAULT_AGENTS = [\"claude\", \"codex\"] as const;\n\nexport function buildServerStartCommand(port: number): string {\n return `nohup sandbox-agent server --no-token --host 0.0.0.0 --port ${port} >/tmp/sandbox-agent.log 2>&1 &`;\n}\n"],"mappings":";AAAO,IAAM,8BAA8B;AACpC,IAAM,+BAA+B;AACrC,IAAM,iBAAiB,CAAC,UAAU,OAAO;AAEzC,SAAS,wBAAwB,MAAsB;AAC5D,SAAO,+DAA+D,IAAI;AAC5E;","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,17 +1,7 @@
1
1
  import { NewSessionRequest, SessionConfigOption, SessionModeState, AnyMessage, AcpEnvelopeDirection, RequestPermissionRequest, RequestPermissionResponse, NewSessionResponse, PermissionOptionKind, PromptRequest, PromptResponse, SetSessionModeResponse, SetSessionConfigOptionResponse } from 'acp-http-client';
2
2
  export { AcpRpcError } from 'acp-http-client';
3
-
4
- type SandboxAgentSpawnLogMode = "inherit" | "pipe" | "silent";
5
- type SandboxAgentSpawnOptions = {
6
- enabled?: boolean;
7
- host?: string;
8
- port?: number;
9
- token?: string;
10
- binaryPath?: string;
11
- timeoutMs?: number;
12
- log?: SandboxAgentSpawnLogMode;
13
- env?: Record<string, string>;
14
- };
3
+ import { S as SandboxProvider } from './types-DLlJOfyX.js';
4
+ export { S as SandboxAgentSpawnLogMode, a as SandboxAgentSpawnOptions } from './spawn-76JDF5d3.js';
15
5
 
16
6
  interface components {
17
7
  schemas: {
@@ -1368,6 +1358,7 @@ interface SessionRecord {
1368
1358
  lastConnectionId: string;
1369
1359
  createdAt: number;
1370
1360
  destroyedAt?: number;
1361
+ sandboxId?: string;
1371
1362
  sessionInit?: Omit<NewSessionRequest, "_meta">;
1372
1363
  configOptions?: SessionConfigOption[];
1373
1364
  modes?: SessionModeState | null;
@@ -1394,11 +1385,11 @@ interface ListEventsRequest extends ListPageRequest {
1394
1385
  sessionId: string;
1395
1386
  }
1396
1387
  interface SessionPersistDriver {
1397
- getSession(id: string): Promise<SessionRecord | null>;
1388
+ getSession(id: string): Promise<SessionRecord | undefined>;
1398
1389
  listSessions(request?: ListPageRequest): Promise<ListPage<SessionRecord>>;
1399
1390
  updateSession(session: SessionRecord): Promise<void>;
1400
1391
  listEvents(request: ListEventsRequest): Promise<ListPage<SessionEvent>>;
1401
- insertEvent(event: SessionEvent): Promise<void>;
1392
+ insertEvent(sessionId: string, event: SessionEvent): Promise<void>;
1402
1393
  }
1403
1394
  interface InMemorySessionPersistDriverOptions {
1404
1395
  maxSessions?: number;
@@ -1410,11 +1401,11 @@ declare class InMemorySessionPersistDriver implements SessionPersistDriver {
1410
1401
  private readonly sessions;
1411
1402
  private readonly eventsBySession;
1412
1403
  constructor(options?: InMemorySessionPersistDriverOptions);
1413
- getSession(id: string): Promise<SessionRecord | null>;
1404
+ getSession(id: string): Promise<SessionRecord | undefined>;
1414
1405
  listSessions(request?: ListPageRequest): Promise<ListPage<SessionRecord>>;
1415
1406
  updateSession(session: SessionRecord): Promise<void>;
1416
1407
  listEvents(request: ListEventsRequest): Promise<ListPage<SessionEvent>>;
1417
- insertEvent(event: SessionEvent): Promise<void>;
1408
+ insertEvent(sessionId: string, event: SessionEvent): Promise<void>;
1418
1409
  }
1419
1410
  type ResponsesOf<T> = T extends {
1420
1411
  responses: infer R;
@@ -1451,6 +1442,8 @@ interface SandboxAgentConnectCommonOptions {
1451
1442
  replayMaxChars?: number;
1452
1443
  signal?: AbortSignal;
1453
1444
  token?: string;
1445
+ skipHealthCheck?: boolean;
1446
+ /** @deprecated Use skipHealthCheck instead. */
1454
1447
  waitForHealth?: boolean | SandboxAgentHealthWaitOptions;
1455
1448
  }
1456
1449
  type SandboxAgentConnectOptions = (SandboxAgentConnectCommonOptions & {
@@ -1461,16 +1454,23 @@ type SandboxAgentConnectOptions = (SandboxAgentConnectCommonOptions & {
1461
1454
  baseUrl?: string;
1462
1455
  });
1463
1456
  interface SandboxAgentStartOptions {
1457
+ sandbox: SandboxProvider;
1458
+ sandboxId?: string;
1459
+ skipHealthCheck?: boolean;
1464
1460
  fetch?: typeof fetch;
1465
1461
  headers?: HeadersInit;
1466
1462
  persist?: SessionPersistDriver;
1467
1463
  replayMaxEvents?: number;
1468
1464
  replayMaxChars?: number;
1469
- spawn?: SandboxAgentSpawnOptions | boolean;
1465
+ signal?: AbortSignal;
1466
+ token?: string;
1470
1467
  }
1471
1468
  interface SessionCreateRequest {
1472
1469
  id?: string;
1473
1470
  agent: string;
1471
+ /** Shorthand for `sessionInit.cwd`. Ignored when `sessionInit` is provided. */
1472
+ cwd?: string;
1473
+ /** Full session init. When omitted, built from `cwd` (or default) with empty `mcpServers`. */
1474
1474
  sessionInit?: Omit<NewSessionRequest, "_meta">;
1475
1475
  model?: string;
1476
1476
  mode?: string;
@@ -1479,6 +1479,9 @@ interface SessionCreateRequest {
1479
1479
  interface SessionResumeOrCreateRequest {
1480
1480
  id: string;
1481
1481
  agent: string;
1482
+ /** Shorthand for `sessionInit.cwd`. Ignored when `sessionInit` is provided. */
1483
+ cwd?: string;
1484
+ /** Full session init. When omitted, built from `cwd` (or default) with empty `mcpServers`. */
1482
1485
  sessionInit?: Omit<NewSessionRequest, "_meta">;
1483
1486
  model?: string;
1484
1487
  mode?: string;
@@ -1647,10 +1650,12 @@ declare class SandboxAgent {
1647
1650
  private readonly defaultHeaders?;
1648
1651
  private readonly healthWait;
1649
1652
  private readonly healthWaitAbortController;
1653
+ private sandboxProvider?;
1654
+ private sandboxProviderId?;
1655
+ private sandboxProviderRawId?;
1650
1656
  private readonly persist;
1651
1657
  private readonly replayMaxEvents;
1652
1658
  private readonly replayMaxChars;
1653
- private spawnHandle?;
1654
1659
  private healthPromise?;
1655
1660
  private healthError?;
1656
1661
  private disposed;
@@ -1662,10 +1667,15 @@ declare class SandboxAgent {
1662
1667
  private readonly pendingPermissionRequests;
1663
1668
  private readonly nextSessionEventIndexBySession;
1664
1669
  private readonly seedSessionEventIndexBySession;
1670
+ private readonly pendingObservedEnvelopePersistenceBySession;
1665
1671
  constructor(options: SandboxAgentConnectOptions);
1666
1672
  static connect(options: SandboxAgentConnectOptions): Promise<SandboxAgent>;
1667
- static start(options?: SandboxAgentStartOptions): Promise<SandboxAgent>;
1673
+ static start(options: SandboxAgentStartOptions): Promise<SandboxAgent>;
1674
+ get sandboxId(): string | undefined;
1675
+ get sandbox(): SandboxProvider | undefined;
1676
+ get inspectorUrl(): string;
1668
1677
  dispose(): Promise<void>;
1678
+ destroySandbox(): Promise<void>;
1669
1679
  listSessions(request?: ListPageRequest): Promise<ListPage<Session>>;
1670
1680
  getSession(id: string): Promise<Session | null>;
1671
1681
  getEvents(request: ListEventsRequest): Promise<ListPage<SessionEvent>>;
@@ -1740,6 +1750,7 @@ declare class SandboxAgent {
1740
1750
  connectProcessTerminal(id: string, options?: ProcessTerminalSessionOptions): ProcessTerminalSession;
1741
1751
  private getLiveConnection;
1742
1752
  private persistObservedEnvelope;
1753
+ private enqueueObservedEnvelopePersistence;
1743
1754
  private persistSessionStateFromEvent;
1744
1755
  private allocateSessionEventIndex;
1745
1756
  private ensureSessionEventIndexSeeded;
@@ -1781,4 +1792,4 @@ interface InspectorUrlOptions {
1781
1792
  */
1782
1793
  declare function buildInspectorUrl(options: InspectorUrlOptions): string;
1783
1794
 
1784
- export { type AcpEnvelope, type AcpServerInfo, type AcpServerListResponse, type AgentInfo, type AgentInstallRequest, type AgentInstallResponse, type AgentListResponse, type AgentQuery, type AgentQueryOptions, type FsActionResponse, type FsDeleteQuery, type FsEntriesQuery, type FsEntry, type FsMoveRequest, type FsMoveResponse, type FsPathQuery, type FsStat, type FsUploadBatchQuery, type FsUploadBatchResponse, type FsWriteResponse, type HealthResponse, InMemorySessionPersistDriver, type InMemorySessionPersistDriverOptions, type InspectorUrlOptions, type ListEventsRequest, type ListPage, type ListPageRequest, LiveAcpConnection, type McpConfigQuery, type McpServerConfig, type PermissionReply, type PermissionRequestListener, type ProblemDetails, type ProcessConfig, type ProcessCreateRequest, type ProcessInfo, type ProcessInputRequest, type ProcessInputResponse, type ProcessListResponse, type ProcessLogEntry, type ProcessLogFollowQuery, type ProcessLogListener, type ProcessLogSubscription, type ProcessLogsQuery, type ProcessLogsResponse, type ProcessLogsStream, type ProcessRunRequest, type ProcessRunResponse, type ProcessSignalQuery, type ProcessState, type ProcessTerminalClientFrame, type ProcessTerminalConnectOptions, type ProcessTerminalErrorFrame, type ProcessTerminalExitFrame, type ProcessTerminalReadyFrame, type ProcessTerminalResizeRequest, type ProcessTerminalResizeResponse, type ProcessTerminalServerFrame, ProcessTerminalSession, type ProcessTerminalSessionOptions, type ProcessTerminalWebSocketUrlOptions, SandboxAgent, type SandboxAgentConnectOptions, SandboxAgentError, type SandboxAgentHealthWaitOptions, type SandboxAgentSpawnLogMode, type SandboxAgentSpawnOptions, type SandboxAgentStartOptions, Session, type SessionCreateRequest, type SessionEvent, type SessionEventListener, type SessionPermissionRequest, type SessionPermissionRequestOption, type SessionPersistDriver, type SessionRecord, type SessionResumeOrCreateRequest, type SessionSendOptions, type SkillsConfig, type SkillsConfigQuery, type TerminalErrorStatus, type TerminalExitStatus, type TerminalReadyStatus, type TerminalResizePayload, type TerminalStatusMessage, UnsupportedPermissionReplyError, UnsupportedSessionCategoryError, UnsupportedSessionConfigOptionError, UnsupportedSessionValueError, buildInspectorUrl };
1795
+ export { type AcpEnvelope, type AcpServerInfo, type AcpServerListResponse, type AgentInfo, type AgentInstallRequest, type AgentInstallResponse, type AgentListResponse, type AgentQuery, type AgentQueryOptions, type FsActionResponse, type FsDeleteQuery, type FsEntriesQuery, type FsEntry, type FsMoveRequest, type FsMoveResponse, type FsPathQuery, type FsStat, type FsUploadBatchQuery, type FsUploadBatchResponse, type FsWriteResponse, type HealthResponse, InMemorySessionPersistDriver, type InMemorySessionPersistDriverOptions, type InspectorUrlOptions, type ListEventsRequest, type ListPage, type ListPageRequest, LiveAcpConnection, type McpConfigQuery, type McpServerConfig, type PermissionReply, type PermissionRequestListener, type ProblemDetails, type ProcessConfig, type ProcessCreateRequest, type ProcessInfo, type ProcessInputRequest, type ProcessInputResponse, type ProcessListResponse, type ProcessLogEntry, type ProcessLogFollowQuery, type ProcessLogListener, type ProcessLogSubscription, type ProcessLogsQuery, type ProcessLogsResponse, type ProcessLogsStream, type ProcessRunRequest, type ProcessRunResponse, type ProcessSignalQuery, type ProcessState, type ProcessTerminalClientFrame, type ProcessTerminalConnectOptions, type ProcessTerminalErrorFrame, type ProcessTerminalExitFrame, type ProcessTerminalReadyFrame, type ProcessTerminalResizeRequest, type ProcessTerminalResizeResponse, type ProcessTerminalServerFrame, ProcessTerminalSession, type ProcessTerminalSessionOptions, type ProcessTerminalWebSocketUrlOptions, SandboxAgent, type SandboxAgentConnectOptions, SandboxAgentError, type SandboxAgentHealthWaitOptions, type SandboxAgentStartOptions, SandboxProvider, Session, type SessionCreateRequest, type SessionEvent, type SessionEventListener, type SessionPermissionRequest, type SessionPermissionRequestOption, type SessionPersistDriver, type SessionRecord, type SessionResumeOrCreateRequest, type SessionSendOptions, type SkillsConfig, type SkillsConfigQuery, type TerminalErrorStatus, type TerminalExitStatus, type TerminalReadyStatus, type TerminalResizePayload, type TerminalStatusMessage, UnsupportedPermissionReplyError, UnsupportedSessionCategoryError, UnsupportedSessionConfigOptionError, UnsupportedSessionValueError, buildInspectorUrl };