@codespar/sdk 0.1.0 → 0.2.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 -0
- package/dist/__tests__/codespar.test.d.ts +7 -0
- package/dist/__tests__/codespar.test.d.ts.map +1 -1
- package/dist/__tests__/codespar.test.js +195 -237
- package/dist/__tests__/codespar.test.js.map +1 -1
- package/dist/index.d.ts +14 -31
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -47
- package/dist/index.js.map +1 -1
- package/dist/session.d.ts +7 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +203 -42
- package/dist/session.js.map +1 -1
- package/dist/types.d.ts +169 -59
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +5 -3
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -4,13 +4,11 @@ export interface CodeSparConfig {
|
|
|
4
4
|
apiKey?: string;
|
|
5
5
|
/** Base URL for CodeSpar API. Defaults to https://api.codespar.dev */
|
|
6
6
|
baseUrl?: string;
|
|
7
|
-
/** Enable managed mode (billing, logging, rate limiting via CodeSpar backend) */
|
|
8
|
-
managed?: boolean;
|
|
9
7
|
}
|
|
10
8
|
export interface SessionConfig {
|
|
11
|
-
/** MCP servers to connect
|
|
9
|
+
/** MCP servers to connect, by id (e.g. "zoop", "nuvem-fiscal") */
|
|
12
10
|
servers?: string[];
|
|
13
|
-
/** Preset configurations. "brazilian" enables
|
|
11
|
+
/** Preset configurations. "brazilian" enables BR commerce servers. */
|
|
14
12
|
preset?: "brazilian" | "mexican" | "argentinian" | "colombian" | "all";
|
|
15
13
|
/** Connection management options */
|
|
16
14
|
manageConnections?: {
|
|
@@ -23,62 +21,111 @@ export interface SessionConfig {
|
|
|
23
21
|
metadata?: Record<string, string>;
|
|
24
22
|
}
|
|
25
23
|
export interface Session {
|
|
26
|
-
/** Unique session ID */
|
|
24
|
+
/** Unique session ID (e.g. "ses_HZb4d5yxIAxLawb4") */
|
|
27
25
|
id: string;
|
|
28
26
|
/** User ID that owns this session */
|
|
29
27
|
userId: string;
|
|
30
|
-
/**
|
|
31
|
-
servers:
|
|
28
|
+
/** IDs of the servers attached to this session */
|
|
29
|
+
servers: string[];
|
|
32
30
|
/** Session creation timestamp */
|
|
33
31
|
createdAt: Date;
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/** List connected servers and their auth status */
|
|
47
|
-
connections(): Promise<ServerConnection[]>;
|
|
48
|
-
/** MCP transport URLs for IDE integration */
|
|
32
|
+
/** Session status */
|
|
33
|
+
status: "active" | "closed" | "error";
|
|
34
|
+
/**
|
|
35
|
+
* MCP transport endpoint for this session. Pass to @codespar/mcp helpers
|
|
36
|
+
* (getClaudeDesktopConfig, getCursorConfig) to generate config files for
|
|
37
|
+
* MCP-compatible clients.
|
|
38
|
+
*
|
|
39
|
+
* Note: the runtime MCP endpoint is not yet implemented in the backend
|
|
40
|
+
* (planned for Marco 3). The URL is provided so config generators can
|
|
41
|
+
* produce the correct values today; runtime connection will work once
|
|
42
|
+
* the backend MCP transport ships.
|
|
43
|
+
*/
|
|
49
44
|
mcp: {
|
|
50
45
|
url: string;
|
|
51
46
|
headers: Record<string, string>;
|
|
52
47
|
};
|
|
53
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Get tools available in this session. Loads from the backend on first
|
|
50
|
+
* call and caches. Call connections() to refresh.
|
|
51
|
+
*/
|
|
52
|
+
tools(): Promise<Tool[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Find tools by intent description. Loads tools first if not cached.
|
|
55
|
+
*/
|
|
56
|
+
findTools(intent: string): Promise<Tool[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Execute a specific tool by name. Tool calls are logged on the
|
|
59
|
+
* backend with input + output for billing and audit.
|
|
60
|
+
*/
|
|
61
|
+
execute(toolName: string, params: Record<string, unknown>): Promise<ToolResult>;
|
|
62
|
+
/** Run a Complete Loop workflow. */
|
|
63
|
+
loop(config: LoopConfig): Promise<LoopResult>;
|
|
64
|
+
/**
|
|
65
|
+
* Proxy a raw HTTP request to a connected server's upstream API with
|
|
66
|
+
* credentials injected server-side. Lets an agent call any endpoint of
|
|
67
|
+
* a toolkit — not just pre-defined tools — without ever seeing the
|
|
68
|
+
* provider API key. The backend handles auth injection, rate limiting,
|
|
69
|
+
* and logs the call for audit/billing.
|
|
70
|
+
*/
|
|
71
|
+
proxyExecute(request: ProxyRequest): Promise<ProxyResult>;
|
|
72
|
+
/**
|
|
73
|
+
* Send a natural-language message. Drives a Claude tool-use loop on
|
|
74
|
+
* the backend and returns the full transcript when done.
|
|
75
|
+
*/
|
|
76
|
+
send(message: string): Promise<SendResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Stream a natural-language message. Yields events as the agent
|
|
79
|
+
* runs (assistant text, tool_use, tool_result, done).
|
|
80
|
+
*/
|
|
81
|
+
sendStream(message: string): AsyncIterable<StreamEvent>;
|
|
82
|
+
/**
|
|
83
|
+
* Start a Connect Link OAuth flow for a server. Returns a link token
|
|
84
|
+
* + authorize URL the end-user opens to grant provider access.
|
|
85
|
+
*
|
|
86
|
+
* Pass `config.redirectUri` so the provider redirects back to your
|
|
87
|
+
* UI after the user authorizes — CodeSpar's callback stores the
|
|
88
|
+
* tokens in the vault and forwards the user there with
|
|
89
|
+
* `?status=connected&connection_id=<id>` appended.
|
|
90
|
+
*/
|
|
91
|
+
authorize(serverId: string, config: AuthConfig): Promise<AuthResult>;
|
|
92
|
+
/**
|
|
93
|
+
* List server connections + available tools. Refreshes the internal
|
|
94
|
+
* tools cache as a side effect.
|
|
95
|
+
*/
|
|
96
|
+
connections(): Promise<ServerConnection[]>;
|
|
97
|
+
/** Close session and release resources. */
|
|
54
98
|
close(): Promise<void>;
|
|
55
99
|
}
|
|
56
100
|
export interface Tool {
|
|
57
|
-
/**
|
|
101
|
+
/** Tool name (e.g. "codespar_pay") */
|
|
58
102
|
name: string;
|
|
59
|
-
/**
|
|
60
|
-
slug: string;
|
|
61
|
-
/** Human-readable description */
|
|
103
|
+
/** Human-readable description shown to LLMs */
|
|
62
104
|
description: string;
|
|
63
|
-
/**
|
|
105
|
+
/** JSON Schema for tool inputs */
|
|
106
|
+
input_schema: Record<string, unknown>;
|
|
107
|
+
/** Server that provides this tool (for routing/billing). May be "codespar" for meta-tools. */
|
|
64
108
|
server: string;
|
|
65
|
-
/** Input schema (JSON Schema) */
|
|
66
|
-
inputSchema: Record<string, unknown>;
|
|
67
109
|
}
|
|
68
110
|
export interface ToolResult {
|
|
111
|
+
/** Whether the call succeeded */
|
|
69
112
|
success: boolean;
|
|
113
|
+
/** Tool output (varies by tool) */
|
|
70
114
|
data: unknown;
|
|
71
|
-
|
|
115
|
+
/** Error message if failed */
|
|
116
|
+
error: string | null;
|
|
72
117
|
/** Execution time in ms */
|
|
73
118
|
duration: number;
|
|
74
119
|
/** Server that executed the tool */
|
|
75
120
|
server: string;
|
|
76
121
|
/** Tool that was executed */
|
|
77
122
|
tool: string;
|
|
123
|
+
/** Backend tool-call id for cross-referencing logs */
|
|
124
|
+
tool_call_id?: string;
|
|
125
|
+
/** Timestamp the call was logged */
|
|
126
|
+
called_at?: string;
|
|
78
127
|
}
|
|
79
128
|
export interface LoopStep {
|
|
80
|
-
/** Server ID or package name */
|
|
81
|
-
server: string;
|
|
82
129
|
/** Tool name to execute */
|
|
83
130
|
tool: string;
|
|
84
131
|
/** Tool parameters */
|
|
@@ -113,43 +160,106 @@ export interface LoopResult {
|
|
|
113
160
|
/** Total steps attempted */
|
|
114
161
|
totalSteps: number;
|
|
115
162
|
}
|
|
163
|
+
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
164
|
+
export interface ProxyRequest {
|
|
165
|
+
/** Server id that owns the upstream API (e.g. "stripe", "asaas"). */
|
|
166
|
+
server: string;
|
|
167
|
+
/** Upstream path, relative to the server's base URL (e.g. "/v1/charges"). */
|
|
168
|
+
endpoint: string;
|
|
169
|
+
/** HTTP method. */
|
|
170
|
+
method: HttpMethod;
|
|
171
|
+
/** JSON body. Ignored for GET. */
|
|
172
|
+
body?: unknown;
|
|
173
|
+
/** Query string parameters. */
|
|
174
|
+
params?: Record<string, string | number | boolean>;
|
|
175
|
+
/** Extra headers to forward. Auth headers are injected by the backend — never send them here. */
|
|
176
|
+
headers?: Record<string, string>;
|
|
177
|
+
}
|
|
178
|
+
export interface ProxyResult {
|
|
179
|
+
/** HTTP status code returned by the upstream API. */
|
|
180
|
+
status: number;
|
|
181
|
+
/** Parsed JSON response body, or raw string if not JSON. */
|
|
182
|
+
data: unknown;
|
|
183
|
+
/** Response headers (lowercased keys). */
|
|
184
|
+
headers: Record<string, string>;
|
|
185
|
+
/** Upstream call duration in ms, as measured by the backend. */
|
|
186
|
+
duration: number;
|
|
187
|
+
/** Backend proxy-call id for cross-referencing logs. */
|
|
188
|
+
proxy_call_id?: string;
|
|
189
|
+
}
|
|
116
190
|
export interface AuthConfig {
|
|
117
|
-
/**
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
clientSecret?: string;
|
|
191
|
+
/** Where the provider sends the user after authorizing. HTTPS only. */
|
|
192
|
+
redirectUri: string;
|
|
193
|
+
/** Optional scope override (format is provider-specific). */
|
|
194
|
+
scopes?: string;
|
|
122
195
|
}
|
|
123
196
|
export interface AuthResult {
|
|
124
|
-
/**
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
|
|
197
|
+
/** Opaque one-shot state token — echoed back on callback. */
|
|
198
|
+
linkToken: string;
|
|
199
|
+
/** URL the end-user opens to grant access. */
|
|
200
|
+
authorizeUrl: string;
|
|
201
|
+
/** When the state token expires (10min default). */
|
|
202
|
+
expiresAt: string;
|
|
130
203
|
}
|
|
131
204
|
export interface ServerConnection {
|
|
132
|
-
/** Server
|
|
205
|
+
/** Server id (e.g. "zoop") */
|
|
133
206
|
id: string;
|
|
134
|
-
/**
|
|
207
|
+
/** Display name */
|
|
135
208
|
name: string;
|
|
136
|
-
/**
|
|
137
|
-
|
|
138
|
-
/**
|
|
209
|
+
/** Category (payments, fiscal, ecommerce, etc.) */
|
|
210
|
+
category: string;
|
|
211
|
+
/** Country code (BR, MX, AR, CO, GLOBAL) */
|
|
212
|
+
country: string;
|
|
213
|
+
/** Auth method */
|
|
214
|
+
auth_type: "oauth" | "api_key" | "cert" | "none";
|
|
215
|
+
/** Whether the server is connected and tools are callable */
|
|
139
216
|
connected: boolean;
|
|
140
|
-
/** Auth method used */
|
|
141
|
-
auth: "oauth2" | "api_key" | "none";
|
|
142
|
-
/** Number of tools available */
|
|
143
|
-
toolCount: number;
|
|
144
217
|
}
|
|
145
218
|
export interface SendResult {
|
|
146
|
-
/**
|
|
147
|
-
|
|
148
|
-
/** Tools
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
|
|
219
|
+
/** Final agent message text */
|
|
220
|
+
message: string;
|
|
221
|
+
/** Tools called during the run, in order */
|
|
222
|
+
tool_calls: ToolCallRecord[];
|
|
223
|
+
/** How many model iterations the loop ran */
|
|
224
|
+
iterations: number;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Single tool-call record returned by send / sendStream.
|
|
228
|
+
* Mirrors the backend's session_tool_calls row shape.
|
|
229
|
+
*/
|
|
230
|
+
export interface ToolCallRecord {
|
|
231
|
+
id: string;
|
|
232
|
+
tool_name: string;
|
|
233
|
+
server_id: string;
|
|
234
|
+
status: "success" | "error";
|
|
235
|
+
duration_ms: number;
|
|
236
|
+
input: unknown;
|
|
237
|
+
output: unknown;
|
|
238
|
+
error_code: string | null;
|
|
152
239
|
}
|
|
240
|
+
export type StreamEvent = {
|
|
241
|
+
type: "user_message";
|
|
242
|
+
content: string;
|
|
243
|
+
} | {
|
|
244
|
+
type: "assistant_text";
|
|
245
|
+
content: string;
|
|
246
|
+
iteration: number;
|
|
247
|
+
} | {
|
|
248
|
+
type: "tool_use";
|
|
249
|
+
id: string;
|
|
250
|
+
name: string;
|
|
251
|
+
input: Record<string, unknown>;
|
|
252
|
+
} | {
|
|
253
|
+
type: "tool_result";
|
|
254
|
+
toolCall: ToolCallRecord;
|
|
255
|
+
} | {
|
|
256
|
+
type: "done";
|
|
257
|
+
result: SendResult;
|
|
258
|
+
} | {
|
|
259
|
+
type: "error";
|
|
260
|
+
error: string;
|
|
261
|
+
message?: string;
|
|
262
|
+
};
|
|
153
263
|
export declare const SessionConfigSchema: z.ZodObject<{
|
|
154
264
|
servers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
155
265
|
preset: z.ZodOptional<z.ZodEnum<["brazilian", "mexican", "argentinian", "colombian", "all"]>>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,WAAW,cAAc;IAC7B,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,WAAW,cAAc;IAC7B,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,sEAAsE;IACtE,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS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,CAAC;IAC7B,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAID,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC9D;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAC9E;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAIvD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU9B,CAAC"}
|
package/dist/types.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
/* ── Validation schemas
|
|
2
|
+
/* ── Validation schemas ───────────────────────────────────────── */
|
|
3
3
|
export const SessionConfigSchema = z.object({
|
|
4
4
|
servers: z.array(z.string()).optional(),
|
|
5
5
|
preset: z.enum(["brazilian", "mexican", "argentinian", "colombian", "all"]).optional(),
|
|
6
|
-
manageConnections: z
|
|
6
|
+
manageConnections: z
|
|
7
|
+
.object({
|
|
7
8
|
waitForConnections: z.boolean().optional(),
|
|
8
9
|
timeout: z.number().optional(),
|
|
9
|
-
})
|
|
10
|
+
})
|
|
11
|
+
.optional(),
|
|
10
12
|
metadata: z.record(z.string()).optional(),
|
|
11
13
|
});
|
|
12
14
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkSxB,qEAAqE;AAErE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE;IACtF,iBAAiB,EAAE,CAAC;SACjB,MAAM,CAAC;QACN,kBAAkB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QAC1C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC;SACD,QAAQ,EAAE;IACb,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC"}
|
package/package.json
CHANGED