@tangle-network/tcloud 0.4.10 → 0.4.12
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/README.md +6 -0
- package/dist/{chunk-DRCOPW7D.js → chunk-GNACB23W.js} +3 -2
- package/dist/{chunk-IWDE7ZPN.js → chunk-UBUCUSCF.js} +1 -1
- package/dist/cli.cjs +3 -2
- package/dist/cli.js +2 -2
- package/dist/index.cjs +3 -2
- package/dist/index.js +2 -2
- package/dist/sandbox.cjs +3 -2
- package/dist/sandbox.d.cts +23 -1
- package/dist/sandbox.d.ts +23 -1
- package/dist/sandbox.js +1 -1
- package/package.json +11 -12
package/README.md
CHANGED
|
@@ -465,6 +465,12 @@ See the [`examples/`](./examples/) directory — each is a self-contained script
|
|
|
465
465
|
| 08 | [OpenAI SDK](./examples/08-openai-compat.ts) | Drop-in replacement via baseURL |
|
|
466
466
|
| 09 | [Vercel AI SDK](./examples/09-vercel-ai-sdk.ts) | generateText + streamText with Tangle |
|
|
467
467
|
| 10 | [Spending Limits](./examples/10-spending-limits.ts) | Budget caps, request limits, warning callbacks |
|
|
468
|
+
| 11 | [Inference Strategies](./examples/11-inference-strategies.ts) | Min-exposure + operator rotation patterns |
|
|
469
|
+
| 12 | [Bridge Sessions](./examples/12-bridge-sessions.ts) | Persistent bridge sessions for harness routing |
|
|
470
|
+
| 13 | [Bridge Chat App](./examples/13-bridge-chat-app.ts) | Multi-turn bridge application |
|
|
471
|
+
| 14 | [Direct cli-bridge](./examples/14-direct-cli-bridge.ts) | Local cli-bridge, no router |
|
|
472
|
+
| 15 | [Sandbox Agents](./examples/15-sandbox-agents.ts) | Sandbox agents + inline AgentProfile |
|
|
473
|
+
| 16 | [Tangle Intelligence Hook](./examples/16-tangle-intelligence-hook.ts) | Trace inference into hosted intelligence (one OTLP block) |
|
|
468
474
|
|
|
469
475
|
Run any example:
|
|
470
476
|
```bash
|
|
@@ -245,10 +245,11 @@ function buildSandboxCreateOptions(options) {
|
|
|
245
245
|
url: options.gitUrl,
|
|
246
246
|
ref: options.gitRef
|
|
247
247
|
} : void 0,
|
|
248
|
-
resources: options.cpu || options.memoryMb || options.diskGb ? {
|
|
248
|
+
resources: options.cpu || options.memoryMb || options.diskGb || options.accelerator ? {
|
|
249
249
|
cpuCores: options.cpu,
|
|
250
250
|
memoryMB: options.memoryMb,
|
|
251
|
-
diskGB: options.diskGb
|
|
251
|
+
diskGB: options.diskGb,
|
|
252
|
+
accelerator: options.accelerator
|
|
252
253
|
} : void 0,
|
|
253
254
|
// backend: merge `backend` (type string) with `agentProfile` (carried
|
|
254
255
|
// as `backend.profile` on the underlying SDK). Either may be set
|
package/dist/cli.cjs
CHANGED
|
@@ -1856,10 +1856,11 @@ function buildSandboxCreateOptions(options) {
|
|
|
1856
1856
|
url: options.gitUrl,
|
|
1857
1857
|
ref: options.gitRef
|
|
1858
1858
|
} : void 0,
|
|
1859
|
-
resources: options.cpu || options.memoryMb || options.diskGb ? {
|
|
1859
|
+
resources: options.cpu || options.memoryMb || options.diskGb || options.accelerator ? {
|
|
1860
1860
|
cpuCores: options.cpu,
|
|
1861
1861
|
memoryMB: options.memoryMb,
|
|
1862
|
-
diskGB: options.diskGb
|
|
1862
|
+
diskGB: options.diskGb,
|
|
1863
|
+
accelerator: options.accelerator
|
|
1863
1864
|
} : void 0,
|
|
1864
1865
|
// backend: merge `backend` (type string) with `agentProfile` (carried
|
|
1865
1866
|
// as `backend.profile` on the underlying SDK). Either may be set
|
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
TCloud
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UBUCUSCF.js";
|
|
5
5
|
import {
|
|
6
6
|
TCloudSandbox
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GNACB23W.js";
|
|
8
8
|
import {
|
|
9
9
|
generateWallet
|
|
10
10
|
} from "./chunk-THOMQXU5.js";
|
package/dist/index.cjs
CHANGED
|
@@ -2000,10 +2000,11 @@ function buildSandboxCreateOptions(options) {
|
|
|
2000
2000
|
url: options.gitUrl,
|
|
2001
2001
|
ref: options.gitRef
|
|
2002
2002
|
} : void 0,
|
|
2003
|
-
resources: options.cpu || options.memoryMb || options.diskGb ? {
|
|
2003
|
+
resources: options.cpu || options.memoryMb || options.diskGb || options.accelerator ? {
|
|
2004
2004
|
cpuCores: options.cpu,
|
|
2005
2005
|
memoryMB: options.memoryMb,
|
|
2006
|
-
diskGB: options.diskGb
|
|
2006
|
+
diskGB: options.diskGb,
|
|
2007
|
+
accelerator: options.accelerator
|
|
2007
2008
|
} : void 0,
|
|
2008
2009
|
// backend: merge `backend` (type string) with `agentProfile` (carried
|
|
2009
2010
|
// as `backend.profile` on the underlying SDK). Either may be set
|
package/dist/index.js
CHANGED
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
toHex,
|
|
12
12
|
verifyAttestation,
|
|
13
13
|
verifyAttestationAsync
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UBUCUSCF.js";
|
|
15
15
|
import {
|
|
16
16
|
TCloudSandbox,
|
|
17
17
|
createTeeAttestationChallenge,
|
|
18
18
|
generateAttestationNonce,
|
|
19
19
|
startTeeAttestationHeartbeat
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-GNACB23W.js";
|
|
21
21
|
import {
|
|
22
22
|
createShieldedClient,
|
|
23
23
|
estimateCost,
|
package/dist/sandbox.cjs
CHANGED
|
@@ -271,10 +271,11 @@ function buildSandboxCreateOptions(options) {
|
|
|
271
271
|
url: options.gitUrl,
|
|
272
272
|
ref: options.gitRef
|
|
273
273
|
} : void 0,
|
|
274
|
-
resources: options.cpu || options.memoryMb || options.diskGb ? {
|
|
274
|
+
resources: options.cpu || options.memoryMb || options.diskGb || options.accelerator ? {
|
|
275
275
|
cpuCores: options.cpu,
|
|
276
276
|
memoryMB: options.memoryMb,
|
|
277
|
-
diskGB: options.diskGb
|
|
277
|
+
diskGB: options.diskGb,
|
|
278
|
+
accelerator: options.accelerator
|
|
278
279
|
} : void 0,
|
|
279
280
|
// backend: merge `backend` (type string) with `agentProfile` (carried
|
|
280
281
|
// as `backend.profile` on the underlying SDK). Either may be set
|
package/dist/sandbox.d.cts
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { AgentProfile } from '@tangle-network/sandbox';
|
|
2
2
|
import { AsyncAttestationPolicy, AttestationVerificationResult } from '@tangle-network/tcloud-attestation';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* GPU / accelerator request, mirroring `@tangle-network/sandbox`'s
|
|
6
|
+
* `SandboxResources.accelerator` shape (that type is not re-exported from the
|
|
7
|
+
* SDK's public entry, so we declare the structural shape here and forward it
|
|
8
|
+
* verbatim). `kind` is the accelerator class (e.g. 'nvidia-a100'); `count`
|
|
9
|
+
* defaults to 1; `memoryMB` is a minimum device-memory floor when the exact
|
|
10
|
+
* class is flexible.
|
|
11
|
+
*/
|
|
12
|
+
interface SandboxAccelerator {
|
|
13
|
+
kind: string;
|
|
14
|
+
count?: number;
|
|
15
|
+
memoryMB?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
4
18
|
type TCloudSandboxTee = 'any' | 'tdx' | 'nitro' | 'sev-snp' | 'phala-dstack' | 'gcp' | 'azure' | (string & {});
|
|
5
19
|
interface TCloudSandboxCreateOptions {
|
|
6
20
|
name?: string;
|
|
@@ -10,6 +24,14 @@ interface TCloudSandboxCreateOptions {
|
|
|
10
24
|
cpu?: number;
|
|
11
25
|
memoryMb?: number;
|
|
12
26
|
diskGb?: number;
|
|
27
|
+
/**
|
|
28
|
+
* GPU / accelerator request for heavy compute workloads (CFD, FEA, PDE,
|
|
29
|
+
* MD, training). Forwarded verbatim to the underlying `@tangle-network/
|
|
30
|
+
* sandbox` `CreateSandboxOptions.resources.accelerator`, which the fleet
|
|
31
|
+
* autoscaler uses to provision a GPU-class host. `{ kind, count?, memoryMB? }`
|
|
32
|
+
* — e.g. `{ kind: 'nvidia-a100', count: 1 }`. Omit for CPU-only sandboxes.
|
|
33
|
+
*/
|
|
34
|
+
accelerator?: SandboxAccelerator;
|
|
13
35
|
gitUrl?: string;
|
|
14
36
|
gitRef?: string;
|
|
15
37
|
backend?: 'opencode' | 'claude-code' | 'codex' | 'amp' | (string & {});
|
|
@@ -107,4 +129,4 @@ declare function buildSandboxCreateOptions(options: TCloudSandboxCreateOptions):
|
|
|
107
129
|
declare function shouldVerifyAttestation(options: Pick<TCloudSandboxCreateOptions, 'tee' | 'verify'>): boolean;
|
|
108
130
|
declare function generateAttestationNonce(bytes?: number): string;
|
|
109
131
|
|
|
110
|
-
export { TCloudSandbox, type TCloudSandboxAttestationStatus, type TCloudSandboxConfig, type TCloudSandboxCreateOptions, type TCloudSandboxCreateResult, type TCloudSandboxTee, type TCloudTeeAttestationChallenge, type TCloudTeeAttestationHeartbeat, type TCloudTeeAttestationHeartbeatOptions, type TCloudTeeAttestationHeartbeatSample, buildSandboxCreateOptions, createTeeAttestationChallenge, generateAttestationNonce, shouldVerifyAttestation, startTeeAttestationHeartbeat };
|
|
132
|
+
export { type SandboxAccelerator, TCloudSandbox, type TCloudSandboxAttestationStatus, type TCloudSandboxConfig, type TCloudSandboxCreateOptions, type TCloudSandboxCreateResult, type TCloudSandboxTee, type TCloudTeeAttestationChallenge, type TCloudTeeAttestationHeartbeat, type TCloudTeeAttestationHeartbeatOptions, type TCloudTeeAttestationHeartbeatSample, buildSandboxCreateOptions, createTeeAttestationChallenge, generateAttestationNonce, shouldVerifyAttestation, startTeeAttestationHeartbeat };
|
package/dist/sandbox.d.ts
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { AgentProfile } from '@tangle-network/sandbox';
|
|
2
2
|
import { AsyncAttestationPolicy, AttestationVerificationResult } from '@tangle-network/tcloud-attestation';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* GPU / accelerator request, mirroring `@tangle-network/sandbox`'s
|
|
6
|
+
* `SandboxResources.accelerator` shape (that type is not re-exported from the
|
|
7
|
+
* SDK's public entry, so we declare the structural shape here and forward it
|
|
8
|
+
* verbatim). `kind` is the accelerator class (e.g. 'nvidia-a100'); `count`
|
|
9
|
+
* defaults to 1; `memoryMB` is a minimum device-memory floor when the exact
|
|
10
|
+
* class is flexible.
|
|
11
|
+
*/
|
|
12
|
+
interface SandboxAccelerator {
|
|
13
|
+
kind: string;
|
|
14
|
+
count?: number;
|
|
15
|
+
memoryMB?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
4
18
|
type TCloudSandboxTee = 'any' | 'tdx' | 'nitro' | 'sev-snp' | 'phala-dstack' | 'gcp' | 'azure' | (string & {});
|
|
5
19
|
interface TCloudSandboxCreateOptions {
|
|
6
20
|
name?: string;
|
|
@@ -10,6 +24,14 @@ interface TCloudSandboxCreateOptions {
|
|
|
10
24
|
cpu?: number;
|
|
11
25
|
memoryMb?: number;
|
|
12
26
|
diskGb?: number;
|
|
27
|
+
/**
|
|
28
|
+
* GPU / accelerator request for heavy compute workloads (CFD, FEA, PDE,
|
|
29
|
+
* MD, training). Forwarded verbatim to the underlying `@tangle-network/
|
|
30
|
+
* sandbox` `CreateSandboxOptions.resources.accelerator`, which the fleet
|
|
31
|
+
* autoscaler uses to provision a GPU-class host. `{ kind, count?, memoryMB? }`
|
|
32
|
+
* — e.g. `{ kind: 'nvidia-a100', count: 1 }`. Omit for CPU-only sandboxes.
|
|
33
|
+
*/
|
|
34
|
+
accelerator?: SandboxAccelerator;
|
|
13
35
|
gitUrl?: string;
|
|
14
36
|
gitRef?: string;
|
|
15
37
|
backend?: 'opencode' | 'claude-code' | 'codex' | 'amp' | (string & {});
|
|
@@ -107,4 +129,4 @@ declare function buildSandboxCreateOptions(options: TCloudSandboxCreateOptions):
|
|
|
107
129
|
declare function shouldVerifyAttestation(options: Pick<TCloudSandboxCreateOptions, 'tee' | 'verify'>): boolean;
|
|
108
130
|
declare function generateAttestationNonce(bytes?: number): string;
|
|
109
131
|
|
|
110
|
-
export { TCloudSandbox, type TCloudSandboxAttestationStatus, type TCloudSandboxConfig, type TCloudSandboxCreateOptions, type TCloudSandboxCreateResult, type TCloudSandboxTee, type TCloudTeeAttestationChallenge, type TCloudTeeAttestationHeartbeat, type TCloudTeeAttestationHeartbeatOptions, type TCloudTeeAttestationHeartbeatSample, buildSandboxCreateOptions, createTeeAttestationChallenge, generateAttestationNonce, shouldVerifyAttestation, startTeeAttestationHeartbeat };
|
|
132
|
+
export { type SandboxAccelerator, TCloudSandbox, type TCloudSandboxAttestationStatus, type TCloudSandboxConfig, type TCloudSandboxCreateOptions, type TCloudSandboxCreateResult, type TCloudSandboxTee, type TCloudTeeAttestationChallenge, type TCloudTeeAttestationHeartbeat, type TCloudTeeAttestationHeartbeatOptions, type TCloudTeeAttestationHeartbeatSample, buildSandboxCreateOptions, createTeeAttestationChallenge, generateAttestationNonce, shouldVerifyAttestation, startTeeAttestationHeartbeat };
|
package/dist/sandbox.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/tcloud",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.12",
|
|
4
4
|
"description": "TypeScript SDK and CLI for Tangle AI Cloud — decentralized LLM inference",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -68,21 +68,13 @@
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
"scripts": {
|
|
72
|
-
"build": "tsup src/index.ts src/cli.ts src/shielded.ts src/instance.ts src/attestation.ts src/sandbox.ts --format esm,cjs --dts --clean --external socks-proxy-agent",
|
|
73
|
-
"docs": "typedoc src/index.ts --out docs --name tcloud --readme README.md",
|
|
74
|
-
"test": "vitest run",
|
|
75
|
-
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
76
|
-
"dev": "tsx src/cli.ts",
|
|
77
|
-
"prepublishOnly": "npm run build"
|
|
78
|
-
},
|
|
79
71
|
"dependencies": {
|
|
80
72
|
"@scure/bip32": "^2.2.0",
|
|
81
73
|
"@scure/bip39": "^2.2.0",
|
|
82
74
|
"@tangle-network/sandbox": "^0.3.0",
|
|
83
|
-
"@tangle-network/tcloud-attestation": "workspace:^",
|
|
84
75
|
"commander": "^14.0.3",
|
|
85
|
-
"viem": "^2.48.4"
|
|
76
|
+
"viem": "^2.48.4",
|
|
77
|
+
"@tangle-network/tcloud-attestation": "^0.1.1"
|
|
86
78
|
},
|
|
87
79
|
"devDependencies": {
|
|
88
80
|
"@types/node": "^22.0.0",
|
|
@@ -118,5 +110,12 @@
|
|
|
118
110
|
],
|
|
119
111
|
"engines": {
|
|
120
112
|
"node": ">=18"
|
|
113
|
+
},
|
|
114
|
+
"scripts": {
|
|
115
|
+
"build": "tsup src/index.ts src/cli.ts src/shielded.ts src/instance.ts src/attestation.ts src/sandbox.ts --format esm,cjs --dts --clean --external socks-proxy-agent",
|
|
116
|
+
"docs": "typedoc src/index.ts --out docs --name tcloud --readme README.md",
|
|
117
|
+
"test": "vitest run",
|
|
118
|
+
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
119
|
+
"dev": "tsx src/cli.ts"
|
|
121
120
|
}
|
|
122
|
-
}
|
|
121
|
+
}
|