@tangle-network/tcloud 0.1.0 → 0.1.2
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 +4 -4
- package/dist/{chunk-YORNEPCU.js → chunk-76AB7HOV.js} +1 -1
- package/dist/{chunk-4AOQNUQ3.js → chunk-FL352XGA.js} +1 -1
- package/dist/cli.cjs +3 -3
- package/dist/cli.js +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{shielded-BRhsV-s-.d.cts → shielded-6uJexMiT.d.cts} +1 -1
- package/dist/{shielded-BRhsV-s-.d.ts → shielded-6uJexMiT.d.ts} +1 -1
- package/dist/shielded.cjs +1 -1
- package/dist/shielded.d.cts +1 -1
- package/dist/shielded.d.ts +1 -1
- package/dist/shielded.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# tcloud
|
|
2
2
|
|
|
3
|
-
TypeScript SDK and CLI for [Tangle AI Cloud](https://
|
|
3
|
+
TypeScript SDK and CLI for [Tangle AI Cloud](https://router.tangle.tools) — decentralized LLM inference with operator routing, reputation-based selection, and anonymous payments via ShieldedCredits.
|
|
4
4
|
|
|
5
5
|
Zero framework dependencies. Pure `fetch` + SSE. Works in Node.js, Deno, Bun, and edge runtimes.
|
|
6
6
|
|
|
@@ -281,7 +281,7 @@ Wallets use BIP-39 mnemonics with BIP-44 derivation. Private keys are encrypted
|
|
|
281
281
|
Config stored in `~/.tcloud/config.json`:
|
|
282
282
|
|
|
283
283
|
```bash
|
|
284
|
-
tcloud config --api-url https://
|
|
284
|
+
tcloud config --api-url https://router.tangle.tools
|
|
285
285
|
tcloud config --model gpt-4o-mini
|
|
286
286
|
```
|
|
287
287
|
|
|
@@ -299,7 +299,7 @@ import OpenAI from 'openai'
|
|
|
299
299
|
|
|
300
300
|
const client = new OpenAI({
|
|
301
301
|
apiKey: 'sk-tan-...',
|
|
302
|
-
baseURL: 'https://
|
|
302
|
+
baseURL: 'https://router.tangle.tools/v1',
|
|
303
303
|
})
|
|
304
304
|
|
|
305
305
|
const completion = await client.chat.completions.create({
|
|
@@ -318,7 +318,7 @@ import { generateText } from 'ai'
|
|
|
318
318
|
|
|
319
319
|
const tangle = createOpenAI({
|
|
320
320
|
apiKey: 'sk-tan-...',
|
|
321
|
-
baseURL: 'https://
|
|
321
|
+
baseURL: 'https://router.tangle.tools/v1',
|
|
322
322
|
})
|
|
323
323
|
|
|
324
324
|
const { text } = await generateText({
|
|
@@ -3,7 +3,7 @@ import { privateKeyToAccount } from "viem/accounts";
|
|
|
3
3
|
import { keccak256, encodeAbiParameters, parseAbiParameters, concat, toBytes } from "viem";
|
|
4
4
|
|
|
5
5
|
// src/client.ts
|
|
6
|
-
var DEFAULT_BASE_URL = "https://
|
|
6
|
+
var DEFAULT_BASE_URL = "https://router.tangle.tools/v1";
|
|
7
7
|
async function proxiedFetch(privacy, url, init, streaming) {
|
|
8
8
|
if (!privacy || privacy.mode === "direct") {
|
|
9
9
|
return fetch(url, init);
|
package/dist/cli.cjs
CHANGED
|
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
var import_commander = require("commander");
|
|
28
28
|
|
|
29
29
|
// src/client.ts
|
|
30
|
-
var DEFAULT_BASE_URL = "https://
|
|
30
|
+
var DEFAULT_BASE_URL = "https://router.tangle.tools/v1";
|
|
31
31
|
async function proxiedFetch(privacy, url, init, streaming) {
|
|
32
32
|
if (!privacy || privacy.mode === "direct") {
|
|
33
33
|
return fetch(url, init);
|
|
@@ -642,7 +642,7 @@ function ensureDir() {
|
|
|
642
642
|
function loadConfig() {
|
|
643
643
|
ensureDir();
|
|
644
644
|
if (fs.existsSync(CONFIG_FILE)) return JSON.parse(fs.readFileSync(CONFIG_FILE, "utf-8"));
|
|
645
|
-
return { apiUrl: "https://
|
|
645
|
+
return { apiUrl: "https://router.tangle.tools", defaultModel: "gpt-4o-mini", chainId: 3799 };
|
|
646
646
|
}
|
|
647
647
|
function saveConfig(c) {
|
|
648
648
|
ensureDir();
|
|
@@ -859,7 +859,7 @@ credits.command("add").description("Add credits").argument("<amount>").action(as
|
|
|
859
859
|
});
|
|
860
860
|
credits.command("fund").description("Fund shielded credits from pool").action(() => {
|
|
861
861
|
console.log("Shielded credit funding requires integration with the VAnchor pool.");
|
|
862
|
-
console.log("See: https://docs.
|
|
862
|
+
console.log("See: https://docs.tangle.tools/privacy/funding");
|
|
863
863
|
});
|
|
864
864
|
var keys = program.command("keys").description("API key management");
|
|
865
865
|
keys.command("create").description("Create API key").argument("<name>").action(async (name) => {
|
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-76AB7HOV.js";
|
|
5
5
|
import {
|
|
6
6
|
generateWallet
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FL352XGA.js";
|
|
8
8
|
|
|
9
9
|
// src/cli.ts
|
|
10
10
|
import { Command } from "commander";
|
|
@@ -20,7 +20,7 @@ function ensureDir() {
|
|
|
20
20
|
function loadConfig() {
|
|
21
21
|
ensureDir();
|
|
22
22
|
if (fs.existsSync(CONFIG_FILE)) return JSON.parse(fs.readFileSync(CONFIG_FILE, "utf-8"));
|
|
23
|
-
return { apiUrl: "https://
|
|
23
|
+
return { apiUrl: "https://router.tangle.tools", defaultModel: "gpt-4o-mini", chainId: 3799 };
|
|
24
24
|
}
|
|
25
25
|
function saveConfig(c) {
|
|
26
26
|
ensureDir();
|
|
@@ -237,7 +237,7 @@ credits.command("add").description("Add credits").argument("<amount>").action(as
|
|
|
237
237
|
});
|
|
238
238
|
credits.command("fund").description("Fund shielded credits from pool").action(() => {
|
|
239
239
|
console.log("Shielded credit funding requires integration with the VAnchor pool.");
|
|
240
|
-
console.log("See: https://docs.
|
|
240
|
+
console.log("See: https://docs.tangle.tools/privacy/funding");
|
|
241
241
|
});
|
|
242
242
|
var keys = program.command("keys").description("API key management");
|
|
243
243
|
keys.command("create").description("Create API key").argument("<name>").action(async (name) => {
|
package/dist/index.cjs
CHANGED
|
@@ -41,7 +41,7 @@ __export(index_exports, {
|
|
|
41
41
|
module.exports = __toCommonJS(index_exports);
|
|
42
42
|
|
|
43
43
|
// src/client.ts
|
|
44
|
-
var DEFAULT_BASE_URL = "https://
|
|
44
|
+
var DEFAULT_BASE_URL = "https://router.tangle.tools/v1";
|
|
45
45
|
async function proxiedFetch(privacy, url, init, streaming) {
|
|
46
46
|
if (!privacy || privacy.mode === "direct") {
|
|
47
47
|
return fetch(url, init);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TCloudClient, a as TCloudConfig, S as ShieldedWallet, g as generateWallet } from './shielded-
|
|
2
|
-
export { C as ChatCompletion, b as ChatCompletionChunk, c as ChatMessage, d as ChatOptions, e as CreditBalance, M as Model, O as Operator, P as PrivacyConfig, R as RoutingConfig, f as ShieldedConfig, h as SpendAuth, i as SpendingLimits, j as TCloudError, k as createShieldedClient, l as estimateCost, s as signSpendAuth } from './shielded-
|
|
1
|
+
import { T as TCloudClient, a as TCloudConfig, S as ShieldedWallet, g as generateWallet } from './shielded-6uJexMiT.cjs';
|
|
2
|
+
export { C as ChatCompletion, b as ChatCompletionChunk, c as ChatMessage, d as ChatOptions, e as CreditBalance, M as Model, O as Operator, P as PrivacyConfig, R as RoutingConfig, f as ShieldedConfig, h as SpendAuth, i as SpendingLimits, j as TCloudError, k as createShieldedClient, l as estimateCost, s as signSpendAuth } from './shielded-6uJexMiT.cjs';
|
|
3
3
|
import 'viem';
|
|
4
4
|
|
|
5
5
|
declare class TCloud extends TCloudClient {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TCloudClient, a as TCloudConfig, S as ShieldedWallet, g as generateWallet } from './shielded-
|
|
2
|
-
export { C as ChatCompletion, b as ChatCompletionChunk, c as ChatMessage, d as ChatOptions, e as CreditBalance, M as Model, O as Operator, P as PrivacyConfig, R as RoutingConfig, f as ShieldedConfig, h as SpendAuth, i as SpendingLimits, j as TCloudError, k as createShieldedClient, l as estimateCost, s as signSpendAuth } from './shielded-
|
|
1
|
+
import { T as TCloudClient, a as TCloudConfig, S as ShieldedWallet, g as generateWallet } from './shielded-6uJexMiT.js';
|
|
2
|
+
export { C as ChatCompletion, b as ChatCompletionChunk, c as ChatMessage, d as ChatOptions, e as CreditBalance, M as Model, O as Operator, P as PrivacyConfig, R as RoutingConfig, f as ShieldedConfig, h as SpendAuth, i as SpendingLimits, j as TCloudError, k as createShieldedClient, l as estimateCost, s as signSpendAuth } from './shielded-6uJexMiT.js';
|
|
3
3
|
import 'viem';
|
|
4
4
|
|
|
5
5
|
declare class TCloud extends TCloudClient {
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TCloud
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-76AB7HOV.js";
|
|
4
4
|
import {
|
|
5
5
|
TCloudClient,
|
|
6
6
|
TCloudError,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
estimateCost,
|
|
9
9
|
generateWallet,
|
|
10
10
|
signSpendAuth
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FL352XGA.js";
|
|
12
12
|
export {
|
|
13
13
|
TCloud,
|
|
14
14
|
TCloudClient,
|
|
@@ -2,7 +2,7 @@ import { Hex } from 'viem';
|
|
|
2
2
|
|
|
3
3
|
/** Core types for the tcloud SDK */
|
|
4
4
|
interface TCloudConfig {
|
|
5
|
-
/** API base URL (default: https://
|
|
5
|
+
/** API base URL (default: https://router.tangle.tools/v1) */
|
|
6
6
|
baseURL?: string;
|
|
7
7
|
/** API key for standard (non-private) mode */
|
|
8
8
|
apiKey?: string;
|
|
@@ -2,7 +2,7 @@ import { Hex } from 'viem';
|
|
|
2
2
|
|
|
3
3
|
/** Core types for the tcloud SDK */
|
|
4
4
|
interface TCloudConfig {
|
|
5
|
-
/** API base URL (default: https://
|
|
5
|
+
/** API base URL (default: https://router.tangle.tools/v1) */
|
|
6
6
|
baseURL?: string;
|
|
7
7
|
/** API key for standard (non-private) mode */
|
|
8
8
|
apiKey?: string;
|
package/dist/shielded.cjs
CHANGED
|
@@ -40,7 +40,7 @@ var import_accounts = require("viem/accounts");
|
|
|
40
40
|
var import_viem = require("viem");
|
|
41
41
|
|
|
42
42
|
// src/client.ts
|
|
43
|
-
var DEFAULT_BASE_URL = "https://
|
|
43
|
+
var DEFAULT_BASE_URL = "https://router.tangle.tools/v1";
|
|
44
44
|
async function proxiedFetch(privacy, url, init, streaming) {
|
|
45
45
|
if (!privacy || privacy.mode === "direct") {
|
|
46
46
|
return fetch(url, init);
|
package/dist/shielded.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'viem';
|
|
2
|
-
export { A as AutoReplenishOptions, S as ShieldedWallet, h as SpendAuth, k as createShieldedClient, l as estimateCost, g as generateWallet, s as signSpendAuth } from './shielded-
|
|
2
|
+
export { A as AutoReplenishOptions, S as ShieldedWallet, h as SpendAuth, k as createShieldedClient, l as estimateCost, g as generateWallet, s as signSpendAuth } from './shielded-6uJexMiT.cjs';
|
package/dist/shielded.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'viem';
|
|
2
|
-
export { A as AutoReplenishOptions, S as ShieldedWallet, h as SpendAuth, k as createShieldedClient, l as estimateCost, g as generateWallet, s as signSpendAuth } from './shielded-
|
|
2
|
+
export { A as AutoReplenishOptions, S as ShieldedWallet, h as SpendAuth, k as createShieldedClient, l as estimateCost, g as generateWallet, s as signSpendAuth } from './shielded-6uJexMiT.js';
|
package/dist/shielded.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/tcloud",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "TypeScript SDK and CLI for Tangle AI Cloud — decentralized LLM inference",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"bin": {
|
|
10
|
-
"tcloud": "
|
|
10
|
+
"tcloud": "dist/cli.js"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"license": "Apache-2.0",
|
|
61
61
|
"repository": {
|
|
62
62
|
"type": "git",
|
|
63
|
-
"url": "https://github.com/tangle-network/tcloud
|
|
63
|
+
"url": "https://github.com/tangle-network/tcloud.git",
|
|
64
64
|
"directory": "packages/tcloud"
|
|
65
65
|
},
|
|
66
66
|
"homepage": "https://docs.tangleai.cloud",
|