@frumu/tandem-client 0.3.22 → 0.3.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/README.md +61 -56
- package/dist/{index.d.cts → client.d.ts} +9 -634
- package/dist/client.d.ts.map +1 -0
- package/dist/index.cjs +22 -6
- package/dist/index.d.ts +9 -1163
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -6
- package/dist/normalize/index.d.ts +259 -0
- package/dist/normalize/index.d.ts.map +1 -0
- package/dist/public/index.d.ts +575 -0
- package/dist/public/index.d.ts.map +1 -0
- package/dist/stream.d.ts +47 -0
- package/dist/stream.d.ts.map +1 -0
- package/dist/wire/index.d.ts +538 -0
- package/dist/wire/index.d.ts.map +1 -0
- package/package.json +48 -43
package/README.md
CHANGED
|
@@ -16,8 +16,8 @@ Requires **Node 18+** (uses built-in `fetch` and `ReadableStream`).
|
|
|
16
16
|
import { TandemClient } from "@frumu/tandem-client";
|
|
17
17
|
|
|
18
18
|
const client = new TandemClient({
|
|
19
|
-
baseUrl: "http://localhost:39731",
|
|
20
|
-
token: "your-engine-token",
|
|
19
|
+
baseUrl: "http://localhost:39731", // engine URL
|
|
20
|
+
token: "your-engine-token", // from `tandem-engine token generate`
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
// 1. Create a session
|
|
@@ -45,11 +45,15 @@ for await (const event of client.stream(sessionId, runId)) {
|
|
|
45
45
|
|
|
46
46
|
### `new TandemClient(options)`
|
|
47
47
|
|
|
48
|
-
| Option
|
|
49
|
-
|
|
50
|
-
| `baseUrl`
|
|
51
|
-
| `token`
|
|
52
|
-
| `timeoutMs` | `number` | Request timeout in ms (default 20000)
|
|
48
|
+
| Option | Type | Description |
|
|
49
|
+
| ----------- | -------- | ----------------------------------------------- |
|
|
50
|
+
| `baseUrl` | `string` | Engine base URL (e.g. `http://localhost:39731`) |
|
|
51
|
+
| `token` | `string` | Engine API token |
|
|
52
|
+
| `timeoutMs` | `number` | Request timeout in ms (default 20000) |
|
|
53
|
+
|
|
54
|
+
### `client.setToken(token)` → `void`
|
|
55
|
+
|
|
56
|
+
Update the bearer token used for subsequent HTTP and SSE requests.
|
|
53
57
|
|
|
54
58
|
### `client.health()` → `SystemHealth`
|
|
55
59
|
|
|
@@ -67,32 +71,33 @@ Stream all engine events across all sessions.
|
|
|
67
71
|
|
|
68
72
|
### `client.sessions`
|
|
69
73
|
|
|
70
|
-
| Method
|
|
71
|
-
|
|
72
|
-
| `create(options?)`
|
|
73
|
-
| `list(options?)`
|
|
74
|
-
| `get(sessionId)`
|
|
75
|
-
| `delete(sessionId)`
|
|
76
|
-
| `messages(sessionId)`
|
|
77
|
-
| `activeRun(sessionId)`
|
|
74
|
+
| Method | Description |
|
|
75
|
+
| -------------------------------- | --------------------------------------- |
|
|
76
|
+
| `create(options?)` | Create a session, returns `sessionId` |
|
|
77
|
+
| `list(options?)` | List sessions |
|
|
78
|
+
| `get(sessionId)` | Get session details |
|
|
79
|
+
| `delete(sessionId)` | Delete a session |
|
|
80
|
+
| `messages(sessionId)` | Get message history |
|
|
81
|
+
| `activeRun(sessionId)` | Get the currently active run |
|
|
78
82
|
| `promptAsync(sessionId, prompt)` | Start an async run, returns `{ runId }` |
|
|
79
83
|
|
|
80
84
|
### `client.routines`
|
|
81
85
|
|
|
82
|
-
| Method
|
|
83
|
-
|
|
84
|
-
| `list(family?)`
|
|
85
|
-
| `create(options, family?)`
|
|
86
|
-
| `delete(id, family?)`
|
|
87
|
-
| `runNow(id, family?)`
|
|
88
|
-
| `listRuns(family?, limit?)`
|
|
89
|
-
| `listArtifacts(runId, family?)` | List artifacts from a run
|
|
86
|
+
| Method | Description |
|
|
87
|
+
| ------------------------------- | ----------------------------- |
|
|
88
|
+
| `list(family?)` | List routines or automations |
|
|
89
|
+
| `create(options, family?)` | Create a scheduled routine |
|
|
90
|
+
| `delete(id, family?)` | Delete a routine |
|
|
91
|
+
| `runNow(id, family?)` | Trigger a routine immediately |
|
|
92
|
+
| `listRuns(family?, limit?)` | List recent run records |
|
|
93
|
+
| `listArtifacts(runId, family?)` | List artifacts from a run |
|
|
90
94
|
|
|
91
95
|
**Create a scheduled routine:**
|
|
96
|
+
|
|
92
97
|
```typescript
|
|
93
98
|
await client.routines.create({
|
|
94
99
|
name: "Daily digest",
|
|
95
|
-
schedule: "0 8 * * *",
|
|
100
|
+
schedule: "0 8 * * *", // cron expression
|
|
96
101
|
prompt: "Summarize today's activity and write a report",
|
|
97
102
|
allowed_tools: ["read", "websearch", "webfetch"],
|
|
98
103
|
});
|
|
@@ -100,15 +105,15 @@ await client.routines.create({
|
|
|
100
105
|
|
|
101
106
|
### `client.mcp`
|
|
102
107
|
|
|
103
|
-
| Method
|
|
104
|
-
|
|
105
|
-
| `list()`
|
|
106
|
-
| `listTools()`
|
|
107
|
-
| `add(options)`
|
|
108
|
-
| `connect(name)`
|
|
109
|
-
| `disconnect(name)`
|
|
110
|
-
| `refresh(name)`
|
|
111
|
-
| `setEnabled(name, enabled)` | Enable/disable
|
|
108
|
+
| Method | Description |
|
|
109
|
+
| --------------------------- | --------------------------- |
|
|
110
|
+
| `list()` | List registered MCP servers |
|
|
111
|
+
| `listTools()` | List all discovered tools |
|
|
112
|
+
| `add(options)` | Register an MCP server |
|
|
113
|
+
| `connect(name)` | Connect and discover tools |
|
|
114
|
+
| `disconnect(name)` | Disconnect |
|
|
115
|
+
| `refresh(name)` | Re-discover tools |
|
|
116
|
+
| `setEnabled(name, enabled)` | Enable/disable |
|
|
112
117
|
|
|
113
118
|
```typescript
|
|
114
119
|
await client.mcp.add({ name: "arcade", transport: "https://mcp.arcade.ai/mcp" });
|
|
@@ -118,28 +123,28 @@ const tools = await client.mcp.listTools();
|
|
|
118
123
|
|
|
119
124
|
### `client.channels`
|
|
120
125
|
|
|
121
|
-
| Method
|
|
122
|
-
|
|
123
|
-
| `config()`
|
|
124
|
-
| `status()`
|
|
125
|
-
| `put(channel, payload)` | Configure a channel
|
|
126
|
-
| `delete(channel)`
|
|
126
|
+
| Method | Description |
|
|
127
|
+
| ----------------------- | ------------------------------ |
|
|
128
|
+
| `config()` | Get channel configuration |
|
|
129
|
+
| `status()` | Get live connection status |
|
|
130
|
+
| `put(channel, payload)` | Configure a channel |
|
|
131
|
+
| `delete(channel)` | Remove a channel configuration |
|
|
127
132
|
|
|
128
133
|
### `client.permissions`
|
|
129
134
|
|
|
130
|
-
| Method
|
|
131
|
-
|
|
132
|
-
| `list()`
|
|
135
|
+
| Method | Description |
|
|
136
|
+
| ------------------------- | --------------------------------- |
|
|
137
|
+
| `list()` | List pending requests and rules |
|
|
133
138
|
| `reply(requestId, reply)` | Approve/deny a permission request |
|
|
134
139
|
|
|
135
140
|
### `client.providers`
|
|
136
141
|
|
|
137
|
-
| Method
|
|
138
|
-
|
|
139
|
-
| `catalog()`
|
|
140
|
-
| `config()`
|
|
141
|
-
| `setDefaults(providerId, modelId)` | Set default provider and model
|
|
142
|
-
| `setApiKey(providerId, apiKey)`
|
|
142
|
+
| Method | Description |
|
|
143
|
+
| ---------------------------------- | ---------------------------------- |
|
|
144
|
+
| `catalog()` | List available providers |
|
|
145
|
+
| `config()` | Get current provider configuration |
|
|
146
|
+
| `setDefaults(providerId, modelId)` | Set default provider and model |
|
|
147
|
+
| `setApiKey(providerId, apiKey)` | Store an API key |
|
|
143
148
|
|
|
144
149
|
---
|
|
145
150
|
|
|
@@ -147,14 +152,14 @@ const tools = await client.mcp.listTools();
|
|
|
147
152
|
|
|
148
153
|
Common `event.type` values:
|
|
149
154
|
|
|
150
|
-
| Type
|
|
151
|
-
|
|
152
|
-
| `session.response`
|
|
153
|
-
| `session.tool_call`
|
|
154
|
-
| `session.tool_result` | Tool result
|
|
155
|
-
| `run.complete`
|
|
156
|
-
| `run.failed`
|
|
157
|
-
| `permission.request`
|
|
155
|
+
| Type | Description |
|
|
156
|
+
| --------------------- | -------------------------------------------------- |
|
|
157
|
+
| `session.response` | Streaming text delta in `event.properties.delta` |
|
|
158
|
+
| `session.tool_call` | Tool invocation in `event.properties` |
|
|
159
|
+
| `session.tool_result` | Tool result |
|
|
160
|
+
| `run.complete` | Run finished successfully |
|
|
161
|
+
| `run.failed` | Run failed |
|
|
162
|
+
| `permission.request` | Approval needed — use `client.permissions.reply()` |
|
|
158
163
|
|
|
159
164
|
## License
|
|
160
165
|
|