@hasna/sandboxes 0.1.23 → 0.1.24
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/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +3690 -2940
- package/dist/db/agents.d.ts +0 -1
- package/dist/db/database.d.ts +1 -2
- package/dist/db/events.d.ts +0 -1
- package/dist/db/pg-migrations.d.ts +0 -1
- package/dist/db/projects.d.ts +0 -1
- package/dist/db/sandboxes.d.ts +0 -1
- package/dist/db/sessions.d.ts +0 -1
- package/dist/db/snapshots.d.ts +0 -1
- package/dist/db/templates.d.ts +0 -1
- package/dist/db/webhooks.d.ts +0 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4197 -3171
- package/dist/lib/agent-runner.d.ts +0 -1
- package/dist/lib/agents/claude.d.ts +0 -1
- package/dist/lib/agents/codex.d.ts +0 -1
- package/dist/lib/agents/gemini.d.ts +0 -1
- package/dist/lib/agents/index.d.ts +0 -1
- package/dist/lib/agents/opencode.d.ts +0 -1
- package/dist/lib/agents/pi.d.ts +0 -1
- package/dist/lib/agents/takumi.d.ts +9 -0
- package/dist/lib/agents/types.d.ts +0 -1
- package/dist/lib/archive.d.ts +31 -0
- package/dist/lib/config.d.ts +0 -1
- package/dist/lib/images.d.ts +0 -1
- package/dist/lib/keepalive.d.ts +0 -1
- package/dist/lib/runtime-state.d.ts +0 -1
- package/dist/lib/secrets.d.ts +26 -0
- package/dist/lib/stream.d.ts +0 -1
- package/dist/lib/version.d.ts +0 -1
- package/dist/lib/webhook.d.ts +0 -1
- package/dist/mcp/index.d.ts +0 -1
- package/dist/mcp/index.js +9916 -8415
- package/dist/providers/daytona.d.ts +2 -2
- package/dist/providers/e2b.d.ts +2 -2
- package/dist/providers/index.d.ts +0 -1
- package/dist/providers/modal.d.ts +2 -2
- package/dist/providers/types.d.ts +3 -2
- package/dist/sdk.d.ts +65 -0
- package/dist/server/index.d.ts +0 -1
- package/dist/server/index.js +3875 -3134
- package/dist/server/serve.d.ts +0 -1
- package/dist/types/index.d.ts +9 -2
- package/package.json +1 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/db/agents.d.ts.map +0 -1
- package/dist/db/database.d.ts.map +0 -1
- package/dist/db/events.d.ts.map +0 -1
- package/dist/db/pg-migrations.d.ts.map +0 -1
- package/dist/db/projects.d.ts.map +0 -1
- package/dist/db/sandboxes.d.ts.map +0 -1
- package/dist/db/sessions.d.ts.map +0 -1
- package/dist/db/snapshots.d.ts.map +0 -1
- package/dist/db/templates.d.ts.map +0 -1
- package/dist/db/webhooks.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/agent-runner.d.ts.map +0 -1
- package/dist/lib/agents/claude.d.ts.map +0 -1
- package/dist/lib/agents/codex.d.ts.map +0 -1
- package/dist/lib/agents/gemini.d.ts.map +0 -1
- package/dist/lib/agents/index.d.ts.map +0 -1
- package/dist/lib/agents/opencode.d.ts.map +0 -1
- package/dist/lib/agents/pi.d.ts.map +0 -1
- package/dist/lib/agents/types.d.ts.map +0 -1
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/images.d.ts.map +0 -1
- package/dist/lib/keepalive.d.ts.map +0 -1
- package/dist/lib/runtime-state.d.ts.map +0 -1
- package/dist/lib/stream.d.ts.map +0 -1
- package/dist/lib/version.d.ts.map +0 -1
- package/dist/lib/webhook.d.ts.map +0 -1
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/providers/daytona.d.ts.map +0 -1
- package/dist/providers/e2b.d.ts.map +0 -1
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/modal.d.ts.map +0 -1
- package/dist/providers/types.d.ts.map +0 -1
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/serve.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
package/dist/lib/agents/pi.d.ts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SandboxProvider } from "../../providers/types.js";
|
|
2
|
+
import type { AgentDriver } from "./types.js";
|
|
3
|
+
export declare class TakumiDriver implements AgentDriver {
|
|
4
|
+
readonly name = "takumi";
|
|
5
|
+
readonly requiredEnvVars: string[];
|
|
6
|
+
install(provider: SandboxProvider, providerSandboxId: string): Promise<void>;
|
|
7
|
+
configure(provider: SandboxProvider, providerSandboxId: string, envVars: Record<string, string>): Promise<void>;
|
|
8
|
+
buildCommand(prompt: string): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Directories that are almost never worth shipping into a sandbox and that
|
|
3
|
+
* dominate upload size. Callers can override via `TarDirectoryOptions.exclude`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_UPLOAD_EXCLUDES: string[];
|
|
6
|
+
export interface TarDirectoryOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Path/glob patterns to exclude (matched by `tar --exclude`). A bare name
|
|
9
|
+
* like `node_modules` excludes that directory and its contents at any depth
|
|
10
|
+
* on both bsdtar (macOS) and GNU tar (Linux). Defaults to
|
|
11
|
+
* {@link DEFAULT_UPLOAD_EXCLUDES}; pass `[]` to include everything.
|
|
12
|
+
*/
|
|
13
|
+
exclude?: string[];
|
|
14
|
+
}
|
|
15
|
+
/** Single-quote a value for safe POSIX shell interpolation. */
|
|
16
|
+
export declare function shellQuote(value: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Create a gzipped tar of a local directory's contents and return it as a Buffer.
|
|
19
|
+
*
|
|
20
|
+
* The archive is rooted at the directory contents (members are relative, e.g.
|
|
21
|
+
* `./src/index.ts`), so it extracts cleanly into any target with
|
|
22
|
+
* `tar -xzf - -C <dir>`. Uses the system `tar`, which is present on macOS
|
|
23
|
+
* (bsdtar) and Linux (GNU tar).
|
|
24
|
+
*/
|
|
25
|
+
export declare function tarDirectory(localDir: string, opts?: TarDirectoryOptions): Promise<Buffer>;
|
|
26
|
+
/**
|
|
27
|
+
* Build the shell command that unpacks an uploaded tarball into `remoteDir`
|
|
28
|
+
* and removes the tarball afterward. Shared by providers that upload a single
|
|
29
|
+
* archive then extract it in-sandbox.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildUntarCommand(remoteTarPath: string, remoteDir: string): string;
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -7,4 +7,3 @@ export declare function getDefaultImage(): string | undefined;
|
|
|
7
7
|
export declare function getProviderApiKey(provider: SandboxProviderName): string | undefined;
|
|
8
8
|
export declare function setConfigValue(key: string, value: string): void;
|
|
9
9
|
export declare function getConfigValue(key: string): string | undefined;
|
|
10
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/lib/images.d.ts
CHANGED
package/dist/lib/keepalive.d.ts
CHANGED
|
@@ -2,4 +2,3 @@ export declare function startKeepAlive(sandboxId: string, intervalMs?: number):
|
|
|
2
2
|
export declare function stopKeepAlive(sandboxId: string): void;
|
|
3
3
|
export declare function isKeepAliveActive(sandboxId: string): boolean;
|
|
4
4
|
export declare function stopAllKeepAlives(): void;
|
|
5
|
-
//# sourceMappingURL=keepalive.d.ts.map
|
|
@@ -2,4 +2,3 @@ export declare function getErrorMessage(error: unknown): string;
|
|
|
2
2
|
export declare function finalizeSessionExit(sessionId: string, exitCode: number): void;
|
|
3
3
|
export declare function finalizeSessionFailure(sessionId: string, _error?: unknown, exitCode?: number): void;
|
|
4
4
|
export declare function finalizeSandboxProvisionFailure(sandboxId: string, error?: unknown): string;
|
|
5
|
-
//# sourceMappingURL=runtime-state.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve credentials from the @hasna/secrets vault and inject them into agents
|
|
3
|
+
* as per-call environment variables — never persisted to the sandbox record.
|
|
4
|
+
*/
|
|
5
|
+
export type SecretResolver = (key: string) => Promise<string>;
|
|
6
|
+
export interface SecretMapping {
|
|
7
|
+
/** Environment variable name to expose inside the sandbox (e.g. ANTHROPIC_API_KEY). */
|
|
8
|
+
env: string;
|
|
9
|
+
/** Vault key to read (e.g. hasnaxyz/anthropic/live/api_key). */
|
|
10
|
+
key: string;
|
|
11
|
+
}
|
|
12
|
+
/** Parse an `ENV_NAME=vault/key` spec into a {@link SecretMapping}. */
|
|
13
|
+
export declare function parseSecretMapping(spec: string): SecretMapping;
|
|
14
|
+
/**
|
|
15
|
+
* Default resolver: read a secret value from the @hasna/secrets vault via the
|
|
16
|
+
* globally-installed `secrets` CLI (`secrets get <key>`).
|
|
17
|
+
*/
|
|
18
|
+
export declare const cliSecretResolver: SecretResolver;
|
|
19
|
+
/**
|
|
20
|
+
* Resolve secret mappings to an `{ ENV_NAME: value }` record using the vault.
|
|
21
|
+
* The returned record is meant to be passed as per-call env vars (callEnvVars),
|
|
22
|
+
* so resolved secret values are never written to the persisted sandbox record.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveSecretEnv(mappings: SecretMapping[], resolver?: SecretResolver): Promise<Record<string, string>>;
|
|
25
|
+
/** Convenience: parse `ENV=key` specs and resolve them in one step. */
|
|
26
|
+
export declare function resolveSecretSpecs(specs: string[], resolver?: SecretResolver): Promise<Record<string, string>>;
|
package/dist/lib/stream.d.ts
CHANGED
package/dist/lib/version.d.ts
CHANGED
package/dist/lib/webhook.d.ts
CHANGED
|
@@ -11,4 +11,3 @@ export declare function dispatchWebhook(event: string, data: {
|
|
|
11
11
|
[key: string]: unknown;
|
|
12
12
|
}): Promise<void>;
|
|
13
13
|
export declare const WEBHOOK_EVENTS: readonly ["sandbox.created", "sandbox.started", "sandbox.stopped", "sandbox.deleted", "session.started", "session.completed", "session.output"];
|
|
14
|
-
//# sourceMappingURL=webhook.d.ts.map
|
package/dist/mcp/index.d.ts
CHANGED