@archastro/sdk
    Preparing search index...
    Index

    Constructors

    Properties

    Methods

    • Create a computer Provisions a computer owned by the authenticated user. Only that user can see or use it. Requires the devbox_access entitlement.

      Parameters

      • input: {
            key?: string;
            metadata?: Record<string, unknown>;
            name: string;
            provider?: string;
            region?: string;
            repositories?: {
                app_access?: {
                    reason?: "refused" | "unavailable";
                    type: "granted" | "not_granted" | "not_installed";
                };
                ref?: string
                | null;
                repository: string;
            }[];
            setup_bundle?: string;
        }

        Request body.

        • Optionalkey?: string

          Stable key unique among your computers.

        • Optionalmetadata?: Record<string, unknown>

          Arbitrary computer metadata.

        • name: string

          Human-readable computer name.

        • Optionalprovider?: string

          Compute backend: devbox (default), sprites, vercel, or e2b.

        • Optionalregion?: string

          Provider region.

        • Optionalrepositories?: {
              app_access?: {
                  reason?: "refused" | "unavailable";
                  type: "granted" | "not_granted" | "not_installed";
              };
              ref?: string
              | null;
              repository: string;
          }[]

          Ordered GitHub checkouts (maximum 16): {repository: owner/name, ref: optional ref}. First is primary.

        • Optionalsetup_bundle?: string

          Base64 tar.gz repository setup bundle (maximum 512 KiB).

      Returns Promise<AgentComputer>

      The newly created computer. Returns HTTP 201.

    • Delete your computer Destroys one of the authenticated user's computers and releases its infrastructure. Irreversible. Requires the devbox_access entitlement.

      Parameters

      • computer: string

        Computer ID (cmp_...).

      Returns Promise<void>

      Empty response body. Returns HTTP 204 on success.

    • Run a command on your computer Runs a shell command on one of the authenticated user's computers and returns its combined output and exit code. The computer must be ready; otherwise the endpoint returns 409 computer_not_ready. A non-zero exit_code is not an HTTP error. Requires the devbox_access entitlement.

      Parameters

      • computer: string

        Computer ID (cmp_...).

      • input: { command: string; timeout_seconds?: number; working_directory?: string }

        Request body.

        • command: string

          Shell command to execute.

        • Optionaltimeout_seconds?: number

          Command timeout in seconds. Defaults to 60; at most 300.

        • Optionalworking_directory?: string

          Absolute working directory. Defaults to the computer's home directory.

      Returns Promise<ComputerExecResult>

      The output and exit code produced by the command.

    • Retrieve a computer Returns a computer the caller can see: their own, a team or agent computer visible to them, or a computer of a thread they can see. A computer the caller cannot see is reported as not found. For a ready or paused computer whose provider can pause, status is checked against the provider first, so a computer that paused while idle is returned as paused.

      Parameters

      • computer: string

        Computer ID (cmp_...).

      Returns Promise<AgentComputer>

      The requested computer.

    • Pause a computer Powers a computer down while keeping its disk, and returns it with status paused. The next command run on it resumes it. Works for any computer the caller can manage: their own, a team computer they administer, an agent's computer they manage, or a computer of a thread they manage. Pausing a paused computer succeeds. Returns 403 when the caller can see the computer but not manage it, 409 when it is neither ready nor paused, and 422 unsupported when its provider cannot pause.

      Parameters

      • computer: string

        Computer ID (cmp_...).

      Returns Promise<AgentComputer>

      The computer in its "paused" state.

    • Resume a computer Starts a paused computer from its kept disk and returns it with status ready. Authorized like pause: any computer the caller can manage. Resuming a running computer succeeds. Returns 403 when the caller can see the computer but not manage it, 409 when it is neither ready nor paused, and 422 unsupported when its provider cannot pause or resume.

      Parameters

      • computer: string

        Computer ID (cmp_...).

      Returns Promise<AgentComputer>

      The computer in its "ready" state.

    • Run repository setup

      Parameters

      • computer: string
      • input: { force?: boolean; setup_bundle?: string }

        Request body.

        • Optionalforce?: boolean

          Run again even when commit and bundle are unchanged.

        • Optionalsetup_bundle?: string

          Replacement base64 tar.gz setup bundle.

      Returns Promise<AgentComputer>

      Successful response

    • Open an interactive shell on your computer Starts an interactive shell host on one of the authenticated user's computers and returns a relay to connect to. The computer's daemon hosts the relay; connect to GET /relay/v1/connect/{id} with the same user's bearer within the relay's join window (expires_at). An established shell outlives that window. A paused computer is resumed first; any other non-ready computer returns 409 computer_not_ready. Requires the devbox_access entitlement.

      Parameters

      • computer: string

        Computer ID (cmp_...).

      Returns Promise<Relay>

      The relay the shell's host joined.