@tangle-network/sandbox 0.6.1 → 0.8.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.
@@ -1,272 +1,5 @@
1
- //#region src/agent-profile.d.ts
2
- /**
3
- * Provider-neutral agent profile types for public SDK consumers.
4
- *
5
- * These model portable agent intent at the application boundary.
6
- * Individual backends can translate this shape into their own native
7
- * profile/configuration formats internally.
8
- */
9
- /**
10
- * Permission policy value for a capability.
11
- */
12
- type AgentProfilePermissionValue = "allow" | "ask" | "deny";
13
- type AgentProfilePermission = AgentProfilePermissionValue | Record<string, AgentProfilePermissionValue>;
14
- /**
15
- * Generic resource reference that can be resolved into a file or instruction.
16
- */
17
- type AgentProfileResourceRef = {
18
- kind: "inline";
19
- name: string;
20
- content: string;
21
- } | {
22
- kind: "github";
23
- /**
24
- * Optional repository in "owner/repo" form. When omitted, providers may
25
- * only resolve the path if they have an ambient repository context.
26
- */
27
- repository?: string;
28
- path: string;
29
- ref?: string;
30
- name?: string;
31
- };
32
- /**
33
- * Helper for creating typed inline resource refs.
34
- */
35
- declare function defineInlineResource(name: string, content: string): AgentProfileResourceRef;
36
- /**
37
- * Helper for creating typed GitHub-backed resource refs.
38
- */
39
- declare function defineGitHubResource(path: string, options?: {
40
- repository?: string;
41
- ref?: string;
42
- name?: string;
43
- }): AgentProfileResourceRef;
44
- /**
45
- * Resource mounted into a backend workspace.
46
- */
47
- interface AgentProfileFileMount {
48
- path: string;
49
- resource: AgentProfileResourceRef;
50
- executable?: boolean;
51
- }
52
- /**
53
- * Provider-neutral resource bundle.
54
- */
55
- interface AgentProfileResources {
56
- /**
57
- * Generic files to materialize into the agent workspace before execution.
58
- */
59
- files?: AgentProfileFileMount[];
60
- /**
61
- * Provider-native tool files. Backends materialize these into their standard
62
- * discovery location when they support file-based tools.
63
- */
64
- tools?: AgentProfileResourceRef[];
65
- /**
66
- * Agent Skills (`SKILL.md`) packages. Supported by Cursor, Claude Code,
67
- * Codex-compatible layouts, OpenCode, and Hermes-style skill harnesses.
68
- */
69
- skills?: AgentProfileResourceRef[];
70
- /**
71
- * Provider-native subagent definition files.
72
- */
73
- agents?: AgentProfileResourceRef[];
74
- /**
75
- * Provider-native slash command files.
76
- */
77
- commands?: AgentProfileResourceRef[];
78
- /**
79
- * Additional instructions injected into the agent context.
80
- */
81
- instructions?: string | AgentProfileResourceRef;
82
- /**
83
- * Fail initialization when a provider cannot materialize a resource.
84
- */
85
- failOnError?: boolean;
86
- }
87
- /**
88
- * Model selection hints for backends.
89
- */
90
- interface AgentProfileModelHints {
91
- /**
92
- * Preferred default model (format depends on backend, commonly "provider/model").
93
- */
94
- default?: string;
95
- /**
96
- * Preferred small/cheap model for lightweight work.
97
- */
98
- small?: string;
99
- /**
100
- * Optional provider preference hint.
101
- */
102
- provider?: string;
103
- /**
104
- * Backend-agnostic model metadata/hints.
105
- */
106
- metadata?: Record<string, unknown>;
107
- }
108
- /**
109
- * Prompt shaping for an agent.
110
- */
111
- interface AgentProfilePrompt {
112
- /**
113
- * Full system prompt replacement, when supported.
114
- */
115
- systemPrompt?: string;
116
- /**
117
- * Additional instruction lines appended to the active prompt.
118
- */
119
- instructions?: string[];
120
- }
121
- /**
122
- * Generic subagent definition.
123
- */
124
- interface AgentSubagentProfile {
125
- description?: string;
126
- prompt?: string;
127
- model?: string;
128
- tools?: Record<string, boolean>;
129
- permissions?: Record<string, AgentProfilePermission>;
130
- maxSteps?: number;
131
- metadata?: Record<string, unknown>;
132
- }
133
- interface AgentProfileHookCommand {
134
- command: string;
135
- timeoutMs?: number;
136
- blocking?: boolean;
137
- matcher?: string;
138
- env?: Record<string, string>;
139
- }
140
- interface AgentProfileMode {
141
- description?: string;
142
- model?: string;
143
- prompt?: string;
144
- tools?: Record<string, boolean>;
145
- permissions?: Record<string, AgentProfilePermission>;
146
- metadata?: Record<string, unknown>;
147
- }
148
- /**
149
- * Confidential-execution options for sandbox backends.
150
- *
151
- * The Tangle blueprint path translates this into TEE job parameters and fails
152
- * closed when the requested TEE is unavailable. Callers should verify returned
153
- * attestation evidence before treating a session as confidential.
154
- */
155
- interface AgentProfileConfidential {
156
- /**
157
- * TEE variant requested from the operator.
158
- */
159
- tee?: "tdx" | "nitro" | "phala-dstack" | "sev-snp" | "any" | (string & {});
160
- /**
161
- * Optional hex-encoded 32-64 byte challenge for deploy-time report data.
162
- */
163
- attestationNonce?: string;
164
- /**
165
- * Require no persistence across session end when supported by the backend.
166
- */
167
- sealed?: boolean;
168
- /**
169
- * Ask the SDK/backend to create or require a fresh attestation challenge.
170
- */
171
- attestationRefresh?: boolean;
172
- }
173
- /**
174
- * Generic MCP server configuration.
175
- */
176
- interface AgentProfileMcpServer {
177
- transport?: "stdio" | "sse" | "http";
178
- command?: string;
179
- args?: string[];
180
- env?: Record<string, string>;
181
- cwd?: string;
182
- url?: string;
183
- headers?: Record<string, string>;
184
- enabled?: boolean;
185
- metadata?: Record<string, unknown>;
186
- }
187
- /**
188
- * Public provider-neutral agent profile contract.
189
- */
190
- interface AgentProfile {
191
- name?: string;
192
- description?: string;
193
- version?: string;
194
- tags?: string[];
195
- prompt?: AgentProfilePrompt;
196
- model?: AgentProfileModelHints;
197
- permissions?: Record<string, AgentProfilePermission>;
198
- tools?: Record<string, boolean>;
199
- mcp?: Record<string, AgentProfileMcpServer>;
200
- subagents?: Record<string, AgentSubagentProfile>;
201
- resources?: AgentProfileResources;
202
- hooks?: Record<string, AgentProfileHookCommand[]>;
203
- modes?: Record<string, AgentProfileMode>;
204
- confidential?: AgentProfileConfidential;
205
- metadata?: Record<string, unknown>;
206
- /**
207
- * Non-portable backend-specific extensions.
208
- *
209
- * Use this only for features that cannot be expressed generically.
210
- * SDK consumers should treat extension keys as backend namespaces.
211
- */
212
- extensions?: Record<string, Record<string, unknown> | undefined>;
213
- }
214
- /**
215
- * Helper for declaring typed profiles in application code.
216
- */
217
- declare function defineAgentProfile<T extends AgentProfile>(profile: T): T;
218
- /**
219
- * Capabilities describing how a backend interprets AgentProfile.
220
- */
221
- interface AgentProfileCapabilities {
222
- namedProfiles: boolean;
223
- systemPrompt: boolean;
224
- instructions: boolean;
225
- tools: boolean;
226
- permissions: boolean;
227
- mcp: boolean;
228
- subagents: boolean;
229
- resources: {
230
- files: boolean;
231
- instructions: boolean;
232
- tools?: boolean;
233
- skills?: boolean;
234
- agents?: boolean;
235
- commands?: boolean;
236
- };
237
- hooks?: boolean;
238
- modes?: boolean;
239
- runtimeUpdate: boolean;
240
- validation: boolean;
241
- /**
242
- * Backend extension namespaces understood by this backend.
243
- */
244
- extensions?: string[];
245
- }
246
- /**
247
- * Validation issue for a profile/backend pairing.
248
- */
249
- interface AgentProfileValidationIssue {
250
- level: "error" | "warning" | "info";
251
- code: string;
252
- message: string;
253
- path?: string;
254
- }
255
- /**
256
- * Validation output for a provider adapter.
257
- */
258
- interface AgentProfileValidationResult {
259
- ok: boolean;
260
- issues: AgentProfileValidationIssue[];
261
- normalizedProfile?: AgentProfile;
262
- }
263
- /**
264
- * Merge two public AgentProfile values.
265
- *
266
- * Overlay fields win on conflicts. Array-like instruction sets are appended.
267
- */
268
- declare function mergeAgentProfiles(base: AgentProfile | undefined, overlay: AgentProfile | undefined): AgentProfile | undefined;
269
- //#endregion
1
+ import { AgentProfile, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileFileMount, AgentProfileMcpServer, AgentProfileModelHints, AgentProfilePermissionValue, AgentProfilePrompt, AgentProfileResourceRef, AgentProfileResources, AgentProfileValidationIssue, AgentProfileValidationResult, AgentSubagentProfile, defineAgentProfile, defineGitHubResource, defineInlineResource, mergeAgentProfiles } from "@tangle-network/agent-interface";
2
+
270
3
  //#region src/types.d.ts
271
4
  type JsonValue = string | number | boolean | null | JsonValue[] | {
272
5
  [key: string]: JsonValue;
@@ -817,10 +550,8 @@ interface CreateSandboxOptions {
817
550
  *
818
551
  * The capability is enforced at two layers:
819
552
  * 1. The sidecar refuses to start if a capability's binaries are
820
- * missing (computer_use needs the universal Nix profile, which
821
- * Docker / host-agent / Firecracker drivers ship via the host
822
- * bind-mount or the universal sidecar image variant; Firecracker
823
- * host profiles built without the universal flake do not).
553
+ * missing (`computer_use` needs the mounted Nix profile with
554
+ * Xvfb, dbus, xdotool, and scrot available at runtime).
824
555
  * 2. The MCP token endpoint refuses to mint a `cap: ["computer_use"]`
825
556
  * JWT for a sandbox that wasn't created with that capability.
826
557
  *
@@ -937,6 +668,12 @@ interface SandboxConnection {
937
668
  authToken?: string;
938
669
  /** Token expiration timestamp (ISO 8601). Refresh before this time. */
939
670
  authTokenExpiresAt?: string;
671
+ /** Public inbound edge attachment state for `runtimeUrl`. */
672
+ edgeStatus?: "pending" | "ready" | "failed" | "skipped";
673
+ /** Timestamp when the public edge reached this sandbox. */
674
+ edgeReadyAt?: string;
675
+ /** Last public edge attachment error message. */
676
+ edgeError?: string;
940
677
  /** SSH connection info if `sshEnabled` was true during creation */
941
678
  ssh?: SSHCredentials;
942
679
  /** Web terminal URL if `webTerminalEnabled` was true during creation */
@@ -3530,8 +3267,11 @@ interface Process {
3530
3267
  /**
3531
3268
  * Kill the process.
3532
3269
  * @param signal - Signal to send (default: SIGTERM)
3270
+ * @param options - Kill behavior options
3533
3271
  */
3534
- kill(signal?: ProcessSignal): Promise<void>;
3272
+ kill(signal?: ProcessSignal, options?: {
3273
+ tree?: boolean;
3274
+ }): Promise<void>;
3535
3275
  /**
3536
3276
  * Stream stdout/stderr logs in real-time.
3537
3277
  * Includes buffered logs from process start.