tangle-sandbox 0.1.0__py3-none-any.whl

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.
Files changed (54) hide show
  1. tangle_sandbox/__init__.py +287 -0
  2. tangle_sandbox/_batch.py +517 -0
  3. tangle_sandbox/_batch_events.py +285 -0
  4. tangle_sandbox/_batch_profile.py +49 -0
  5. tangle_sandbox/_batch_state.py +677 -0
  6. tangle_sandbox/_call.py +107 -0
  7. tangle_sandbox/_contract_schema.py +169 -0
  8. tangle_sandbox/_create_retry.py +186 -0
  9. tangle_sandbox/_direct_runtime.py +81 -0
  10. tangle_sandbox/_error_catalog.py +128 -0
  11. tangle_sandbox/_fleet_ops.py +231 -0
  12. tangle_sandbox/_fleet_wire.py +557 -0
  13. tangle_sandbox/_generated_git.py +70 -0
  14. tangle_sandbox/_generated_operations.py +39 -0
  15. tangle_sandbox/_http.py +363 -0
  16. tangle_sandbox/_instance_ops.py +331 -0
  17. tangle_sandbox/_instance_wire.py +416 -0
  18. tangle_sandbox/_intelligence.py +35 -0
  19. tangle_sandbox/_subresources.py +387 -0
  20. tangle_sandbox/_wire.py +23 -0
  21. tangle_sandbox/auth/__init__.py +166 -0
  22. tangle_sandbox/auth/tokens.py +150 -0
  23. tangle_sandbox/auth/types.py +72 -0
  24. tangle_sandbox/batch_types.py +156 -0
  25. tangle_sandbox/capabilities.py +77 -0
  26. tangle_sandbox/client.py +872 -0
  27. tangle_sandbox/collaboration/__init__.py +55 -0
  28. tangle_sandbox/collaboration/client.py +233 -0
  29. tangle_sandbox/collaboration/document_id.py +72 -0
  30. tangle_sandbox/collaboration/file_bridge.py +213 -0
  31. tangle_sandbox/collaboration/types.py +158 -0
  32. tangle_sandbox/errors.py +278 -0
  33. tangle_sandbox/fleet.py +485 -0
  34. tangle_sandbox/fleet_handle.py +399 -0
  35. tangle_sandbox/fleet_types.py +211 -0
  36. tangle_sandbox/image.py +528 -0
  37. tangle_sandbox/instance.py +588 -0
  38. tangle_sandbox/manage_sandboxes.py +310 -0
  39. tangle_sandbox/public-batch-request.schema.json +1576 -0
  40. tangle_sandbox/py.typed +1 -0
  41. tangle_sandbox/session_gateway/__init__.py +71 -0
  42. tangle_sandbox/session_gateway/client.py +832 -0
  43. tangle_sandbox/session_gateway/types.py +278 -0
  44. tangle_sandbox/tangle/__init__.py +54 -0
  45. tangle_sandbox/tangle/abi.py +204 -0
  46. tangle_sandbox/tangle/chain_client.py +281 -0
  47. tangle_sandbox/tangle/client.py +500 -0
  48. tangle_sandbox/tangle/operator_auth.py +127 -0
  49. tangle_sandbox/tangle/types.py +66 -0
  50. tangle_sandbox/trace_exporter.py +260 -0
  51. tangle_sandbox/types.py +849 -0
  52. tangle_sandbox-0.1.0.dist-info/METADATA +443 -0
  53. tangle_sandbox-0.1.0.dist-info/RECORD +54 -0
  54. tangle_sandbox-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,287 @@
1
+ """
2
+ Tangle Sandbox SDK
3
+
4
+ Python client SDK for building AI-powered development environments.
5
+
6
+ Quick Start:
7
+ >>> from tangle_sandbox import Sandbox
8
+ >>> client = Sandbox(api_key="sk_sandbox_...", base_url="https://api.example.com")
9
+ >>> box = client.create(name="my-project", environment="ethereum")
10
+ >>> box.wait_for("running")
11
+ >>> result = box.exec("npm test")
12
+ >>> print(result.stdout)
13
+ >>> box.delete()
14
+
15
+ Async Usage:
16
+ >>> from tangle_sandbox import AsyncSandbox
17
+ >>> async with AsyncSandbox(api_key="...", base_url="...") as client:
18
+ ... box = await client.create(name="my-project")
19
+ ... result = await box.exec("npm test")
20
+ ... await box.delete()
21
+ """
22
+
23
+ # Before the imports below: _http sends it on every request.
24
+ __version__ = "0.1.0"
25
+
26
+ from .batch_types import (
27
+ BatchBackend,
28
+ BatchBackendModel,
29
+ BatchBackendServer,
30
+ BatchCleanup,
31
+ BatchGraceCleanup,
32
+ BatchLifecycle,
33
+ BatchPersistentCleanup,
34
+ BatchReleaseCleanup,
35
+ BatchResult,
36
+ BatchRunRequest,
37
+ BatchTask,
38
+ BatchTaskResult,
39
+ BatchTaskUsage,
40
+ )
41
+ from .capabilities import (
42
+ AsyncGitCapability,
43
+ GitCapability,
44
+ )
45
+ from .client import AsyncSandbox, Sandbox
46
+ from .errors import (
47
+ AuthError,
48
+ BatchFailedError,
49
+ CapabilityError,
50
+ NetworkError,
51
+ NotFoundError,
52
+ PartialFailureError,
53
+ QuotaError,
54
+ SandboxError,
55
+ ServerError,
56
+ StateError,
57
+ TimeoutError,
58
+ ValidationError,
59
+ )
60
+ from .fleet import AsyncSandboxFleetClient, SandboxFleetClient
61
+ from .fleet_handle import AsyncSandboxFleet, SandboxFleet
62
+ from .fleet_types import (
63
+ CreateSandboxFleetOptions,
64
+ CreateSandboxFleetTokenOptions,
65
+ CreateSandboxFleetWithCoordinatorOptions,
66
+ FleetDispatchResultBuffer,
67
+ FleetDispatchResultBufferOptions,
68
+ FleetExecDispatchOptions,
69
+ FleetPromptDispatchOptions,
70
+ FleetRetryPolicy,
71
+ ListSandboxFleetOptions,
72
+ ReapExpiredSandboxFleetsOptions,
73
+ SandboxFleetDispatchResponse,
74
+ SandboxFleetIntelligenceEnvelope,
75
+ SandboxFleetMachineSpec,
76
+ SandboxFleetPolicy,
77
+ SandboxFleetTraceBundle,
78
+ SandboxFleetTraceExport,
79
+ SandboxFleetWorkspace,
80
+ )
81
+ from .image import Image, ImageBuilder, generate_dockerfile
82
+ from .instance import AsyncSandboxInstance, SandboxInstance
83
+ from .manage_sandboxes import (
84
+ MANAGE_SANDBOXES_PARAMETERS,
85
+ MANAGE_SANDBOXES_TOOL_NAME,
86
+ AsyncManageSandboxesTool,
87
+ ManageSandboxesTool,
88
+ create_async_manage_sandboxes_tool,
89
+ create_manage_sandboxes_tool,
90
+ )
91
+ from .trace_exporter import (
92
+ build_trace_export_payload,
93
+ export_trace_bundle,
94
+ export_trace_bundle_async,
95
+ otel_trace_id_for_tangle_trace,
96
+ to_otel_json,
97
+ )
98
+ from .types import (
99
+ MAX_EGRESS_DENIALS_LIMIT,
100
+ BackendConfig,
101
+ BackendType,
102
+ BuildProgressEvent,
103
+ CreateSandboxOptions,
104
+ CreateTeamOptions,
105
+ DriverConfig,
106
+ EgressDenial,
107
+ EgressPolicy,
108
+ ExecOptions,
109
+ ExecResult,
110
+ GitAuth,
111
+ GitBranch,
112
+ GitCommit,
113
+ GitConfig,
114
+ GitDiff,
115
+ GitStatus,
116
+ ImageBuildOptions,
117
+ ImageBuildResult,
118
+ ImageSpec,
119
+ IntelligenceReport,
120
+ InviteTeamMemberOptions,
121
+ ListSandboxOptions,
122
+ PromptOptions,
123
+ PromptResult,
124
+ ProvisionEvent,
125
+ ProvisionResult,
126
+ ProvisionStatus,
127
+ ProvisionStep,
128
+ SandboxAccelerator,
129
+ SandboxClientConfig,
130
+ SandboxConnection,
131
+ SandboxEnvironment,
132
+ SandboxEvent,
133
+ SandboxInfo,
134
+ SandboxIntelligenceEnvelope,
135
+ SandboxResources,
136
+ SandboxRuntime,
137
+ SandboxStatus,
138
+ SandboxTraceBundle,
139
+ SandboxTraceExport,
140
+ SearchMatch,
141
+ SearchOptions,
142
+ SecretInfo,
143
+ SnapshotInfo,
144
+ SnapshotOptions,
145
+ SnapshotResult,
146
+ SSHCredentials,
147
+ StorageConfig,
148
+ SubscriptionInfo,
149
+ Team,
150
+ TeamInvitation,
151
+ TeamMember,
152
+ TokenUsage,
153
+ UsageInfo,
154
+ WaitForOptions,
155
+ )
156
+
157
+ __all__ = [
158
+ # Clients
159
+ "Sandbox",
160
+ "AsyncSandbox",
161
+ "SandboxFleet",
162
+ "SandboxFleetClient",
163
+ "AsyncSandboxFleet",
164
+ "AsyncSandboxFleetClient",
165
+ "MANAGE_SANDBOXES_TOOL_NAME",
166
+ "MANAGE_SANDBOXES_PARAMETERS",
167
+ "ManageSandboxesTool",
168
+ "AsyncManageSandboxesTool",
169
+ "create_manage_sandboxes_tool",
170
+ "create_async_manage_sandboxes_tool",
171
+ "build_trace_export_payload",
172
+ "export_trace_bundle",
173
+ "export_trace_bundle_async",
174
+ "otel_trace_id_for_tangle_trace",
175
+ "to_otel_json",
176
+ # Instances
177
+ "SandboxInstance",
178
+ "AsyncSandboxInstance",
179
+ # Capabilities
180
+ "GitCapability",
181
+ "AsyncGitCapability",
182
+ # Image
183
+ "Image",
184
+ "ImageBuilder",
185
+ "generate_dockerfile",
186
+ # Errors
187
+ "SandboxError",
188
+ "AuthError",
189
+ "BatchFailedError",
190
+ "NotFoundError",
191
+ "QuotaError",
192
+ "CapabilityError",
193
+ "PartialFailureError",
194
+ "ValidationError",
195
+ "StateError",
196
+ "TimeoutError",
197
+ "NetworkError",
198
+ "ServerError",
199
+ # Types
200
+ "SandboxClientConfig",
201
+ "CreateSandboxOptions",
202
+ "ListSandboxOptions",
203
+ "SandboxStatus",
204
+ "SandboxResources",
205
+ "SandboxAccelerator",
206
+ "SandboxInfo",
207
+ "SandboxConnection",
208
+ "SandboxEvent",
209
+ "SandboxIntelligenceEnvelope",
210
+ "SSHCredentials",
211
+ "ExecResult",
212
+ "ExecOptions",
213
+ "PromptResult",
214
+ "PromptOptions",
215
+ "TokenUsage",
216
+ "SearchMatch",
217
+ "SearchOptions",
218
+ "GitAuth",
219
+ "GitConfig",
220
+ "GitStatus",
221
+ "GitCommit",
222
+ "GitBranch",
223
+ "GitDiff",
224
+ "SnapshotResult",
225
+ "SnapshotInfo",
226
+ "SnapshotOptions",
227
+ "WaitForOptions",
228
+ "BackendConfig",
229
+ "BackendType",
230
+ "DriverConfig",
231
+ "SandboxRuntime",
232
+ "MAX_EGRESS_DENIALS_LIMIT",
233
+ "EgressDenial",
234
+ "EgressPolicy",
235
+ "StorageConfig",
236
+ "ImageSpec",
237
+ "ImageBuildResult",
238
+ "ImageBuildOptions",
239
+ "IntelligenceReport",
240
+ "BuildProgressEvent",
241
+ "ProvisionEvent",
242
+ "ProvisionResult",
243
+ "ProvisionStep",
244
+ "ProvisionStatus",
245
+ "UsageInfo",
246
+ "SubscriptionInfo",
247
+ "BatchBackend",
248
+ "BatchBackendModel",
249
+ "BatchBackendServer",
250
+ "BatchCleanup",
251
+ "BatchGraceCleanup",
252
+ "BatchLifecycle",
253
+ "BatchPersistentCleanup",
254
+ "BatchReleaseCleanup",
255
+ "BatchTask",
256
+ "BatchTaskResult",
257
+ "BatchTaskUsage",
258
+ "BatchResult",
259
+ "BatchRunRequest",
260
+ "SandboxFleetMachineSpec",
261
+ "SandboxFleetPolicy",
262
+ "SandboxFleetWorkspace",
263
+ "CreateSandboxFleetOptions",
264
+ "CreateSandboxFleetWithCoordinatorOptions",
265
+ "ListSandboxFleetOptions",
266
+ "FleetRetryPolicy",
267
+ "FleetDispatchResultBuffer",
268
+ "FleetDispatchResultBufferOptions",
269
+ "FleetExecDispatchOptions",
270
+ "FleetPromptDispatchOptions",
271
+ "SandboxFleetDispatchResponse",
272
+ "SandboxFleetIntelligenceEnvelope",
273
+ "SandboxFleetTraceBundle",
274
+ "SandboxFleetTraceExport",
275
+ "SandboxTraceBundle",
276
+ "SandboxTraceExport",
277
+ "CreateSandboxFleetTokenOptions",
278
+ "ReapExpiredSandboxFleetsOptions",
279
+ # Subresource types (secrets / environments / teams)
280
+ "SecretInfo",
281
+ "SandboxEnvironment",
282
+ "Team",
283
+ "TeamMember",
284
+ "TeamInvitation",
285
+ "CreateTeamOptions",
286
+ "InviteTeamMemberOptions",
287
+ ]