@wice24/tars-sdk 0.1.1 → 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/dist/index.d.ts +6 -0
- package/dist/index.js +11 -0
- package/dist/types.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -66,6 +66,12 @@ export declare class TarsClient {
|
|
|
66
66
|
setMcpServers: (id: string, servers: McpServer[]) => Promise<{
|
|
67
67
|
ok: boolean;
|
|
68
68
|
}>;
|
|
69
|
+
/** Replace the session's client-executed tool declarations (takes effect
|
|
70
|
+
* next turn; 409s while a turn is in flight). How a host app rolls new
|
|
71
|
+
* tools out to sessions created before the tools existed. */
|
|
72
|
+
setCustomTools: (id: string, tools: Array<Pick<ClientTool, "name" | "description" | "inputSchema" | "timeoutSec">>) => Promise<{
|
|
73
|
+
ok: boolean;
|
|
74
|
+
}>;
|
|
69
75
|
/** Abort the in-flight turn, if any. Idempotent. */
|
|
70
76
|
interrupt: (id: string) => Promise<{
|
|
71
77
|
ok: boolean;
|
package/dist/index.js
CHANGED
|
@@ -96,6 +96,17 @@ export class TarsClient {
|
|
|
96
96
|
/** Replace the session's extra MCP server set (takes effect next turn;
|
|
97
97
|
* 409s while a turn is in flight). */
|
|
98
98
|
setMcpServers: (id, servers) => this.request('PATCH', `/v1/sessions/${id}`, { mcp_servers: servers }),
|
|
99
|
+
/** Replace the session's client-executed tool declarations (takes effect
|
|
100
|
+
* next turn; 409s while a turn is in flight). How a host app rolls new
|
|
101
|
+
* tools out to sessions created before the tools existed. */
|
|
102
|
+
setCustomTools: (id, tools) => this.request('PATCH', `/v1/sessions/${id}`, {
|
|
103
|
+
custom_tools: tools.map((t) => ({
|
|
104
|
+
name: t.name,
|
|
105
|
+
description: t.description,
|
|
106
|
+
input_schema: t.inputSchema,
|
|
107
|
+
...(t.timeoutSec ? { timeout_sec: t.timeoutSec } : {}),
|
|
108
|
+
})),
|
|
109
|
+
}),
|
|
99
110
|
/** Abort the in-flight turn, if any. Idempotent. */
|
|
100
111
|
interrupt: (id) => this.request('POST', `/v1/sessions/${id}/interrupt`),
|
|
101
112
|
usage: (id) => this.request('GET', `/v1/sessions/${id}/usage`),
|
package/dist/types.d.ts
CHANGED
|
@@ -190,6 +190,13 @@ export interface SessionInfo {
|
|
|
190
190
|
sandboxId: string | null;
|
|
191
191
|
title?: string | null;
|
|
192
192
|
metadata?: Record<string, string> | null;
|
|
193
|
+
/** Wire-shaped client-tool declarations stored on the session (no execute). */
|
|
194
|
+
custom_tools?: Array<{
|
|
195
|
+
name: string;
|
|
196
|
+
description: string;
|
|
197
|
+
input_schema: Record<string, unknown>;
|
|
198
|
+
timeout_sec?: number;
|
|
199
|
+
}> | null;
|
|
193
200
|
archived?: boolean;
|
|
194
201
|
last_seq?: number;
|
|
195
202
|
events?: SessionEvent[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wice24/tars-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Client SDK for TARS \u2014 the self-hosted managed-agents platform (sessions, streaming turns, client tools, MCP credentials, skills, files, usage)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|