zidane 1.0.2 → 1.2.0

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.
@@ -0,0 +1,45 @@
1
+ import {
2
+ init_spawn,
3
+ listFiles,
4
+ readFile,
5
+ shell,
6
+ spawn_exports,
7
+ writeFile
8
+ } from "./chunk-27EP7HB3.js";
9
+ import {
10
+ __toCommonJS
11
+ } from "./chunk-PNKVD2UK.js";
12
+
13
+ // src/harnesses/basic.ts
14
+ var basicTools = { shell, readFile, writeFile, listFiles };
15
+ var _spawn;
16
+ function getSpawn() {
17
+ if (!_spawn) {
18
+ _spawn = (init_spawn(), __toCommonJS(spawn_exports)).spawn;
19
+ }
20
+ return _spawn;
21
+ }
22
+ var spawnProxy = {
23
+ get spec() {
24
+ return getSpawn().spec;
25
+ },
26
+ execute(input, ctx) {
27
+ return getSpawn().execute(input, ctx);
28
+ }
29
+ };
30
+ var basic_default = defineHarness({
31
+ name: "basic",
32
+ system: "You are a helpful assistant with access to shell, file reading, file writing, directory listing, and sub-agent spawning tools. Use them to accomplish tasks in the project directory.",
33
+ tools: { ...basicTools, spawn: spawnProxy }
34
+ });
35
+
36
+ // src/harnesses/index.ts
37
+ function defineHarness(config) {
38
+ return config;
39
+ }
40
+
41
+ export {
42
+ basicTools,
43
+ basic_default,
44
+ defineHarness
45
+ };
@@ -0,0 +1,274 @@
1
+ // src/session/memory.ts
2
+ function createMemoryStore() {
3
+ const sessions = /* @__PURE__ */ new Map();
4
+ return {
5
+ async load(sessionId) {
6
+ const data = sessions.get(sessionId);
7
+ return data ? JSON.parse(JSON.stringify(data)) : null;
8
+ },
9
+ async save(session) {
10
+ sessions.set(session.id, JSON.parse(JSON.stringify(session)));
11
+ },
12
+ async delete(sessionId) {
13
+ sessions.delete(sessionId);
14
+ },
15
+ async list(filter) {
16
+ let ids = Array.from(sessions.keys());
17
+ if (filter?.agentId) {
18
+ ids = ids.filter((id) => sessions.get(id)?.agentId === filter.agentId);
19
+ }
20
+ if (filter?.limit) {
21
+ ids = ids.slice(0, filter.limit);
22
+ }
23
+ return ids;
24
+ }
25
+ };
26
+ }
27
+
28
+ // src/session/remote.ts
29
+ var TRAILING_SLASH = /\/$/;
30
+ function createRemoteStore(options) {
31
+ const baseUrl = options.url.replace(TRAILING_SLASH, "");
32
+ const defaultHeaders = {
33
+ "Content-Type": "application/json",
34
+ ...options.headers
35
+ };
36
+ async function request(path, init) {
37
+ const url = `${baseUrl}${path}`;
38
+ const res = await fetch(url, {
39
+ ...init,
40
+ headers: { ...defaultHeaders, ...init?.headers }
41
+ });
42
+ return res;
43
+ }
44
+ return {
45
+ async load(sessionId) {
46
+ const res = await request(`/sessions/${encodeURIComponent(sessionId)}`);
47
+ if (!res.ok) {
48
+ if (res.status === 404)
49
+ return null;
50
+ throw new Error(`Remote session load failed: ${res.status} ${res.statusText}`);
51
+ }
52
+ return await res.json();
53
+ },
54
+ async save(session) {
55
+ const res = await request(`/sessions/${encodeURIComponent(session.id)}`, {
56
+ method: "PUT",
57
+ body: JSON.stringify(session)
58
+ });
59
+ if (!res.ok) {
60
+ throw new Error(`Remote session save failed: ${res.status} ${res.statusText}`);
61
+ }
62
+ },
63
+ async delete(sessionId) {
64
+ const res = await request(`/sessions/${encodeURIComponent(sessionId)}`, {
65
+ method: "DELETE"
66
+ });
67
+ if (!res.ok && res.status !== 404) {
68
+ throw new Error(`Remote session delete failed: ${res.status} ${res.statusText}`);
69
+ }
70
+ },
71
+ async list(filter) {
72
+ const params = new URLSearchParams();
73
+ if (filter?.agentId)
74
+ params.set("agentId", filter.agentId);
75
+ if (filter?.limit)
76
+ params.set("limit", String(filter.limit));
77
+ const query = params.toString();
78
+ const path = query ? `/sessions?${query}` : "/sessions";
79
+ const res = await request(path);
80
+ if (!res.ok) {
81
+ throw new Error(`Remote session list failed: ${res.status} ${res.statusText}`);
82
+ }
83
+ const body = await res.json();
84
+ return body.ids;
85
+ }
86
+ };
87
+ }
88
+
89
+ // src/session/sqlite.ts
90
+ import { Database } from "bun:sqlite";
91
+ function createSqliteStore(options) {
92
+ const db = new Database(options.path);
93
+ db.run("PRAGMA journal_mode = WAL");
94
+ db.run(`
95
+ CREATE TABLE IF NOT EXISTS sessions (
96
+ id TEXT PRIMARY KEY,
97
+ agent_id TEXT,
98
+ data TEXT NOT NULL,
99
+ created_at INTEGER NOT NULL,
100
+ updated_at INTEGER NOT NULL
101
+ )
102
+ `);
103
+ db.run(`CREATE INDEX IF NOT EXISTS idx_sessions_agent_id ON sessions(agent_id)`);
104
+ const stmtLoad = db.prepare("SELECT data FROM sessions WHERE id = ?");
105
+ const stmtUpsert = db.prepare(`
106
+ INSERT INTO sessions (id, agent_id, data, created_at, updated_at)
107
+ VALUES (?, ?, ?, ?, ?)
108
+ ON CONFLICT(id) DO UPDATE SET
109
+ agent_id = excluded.agent_id,
110
+ data = excluded.data,
111
+ updated_at = excluded.updated_at
112
+ `);
113
+ const stmtDelete = db.prepare("DELETE FROM sessions WHERE id = ?");
114
+ const stmtList = db.prepare("SELECT id FROM sessions ORDER BY updated_at DESC");
115
+ const stmtListByAgent = db.prepare("SELECT id FROM sessions WHERE agent_id = ? ORDER BY updated_at DESC");
116
+ return {
117
+ async load(sessionId) {
118
+ const row = stmtLoad.get(sessionId);
119
+ if (!row)
120
+ return null;
121
+ return JSON.parse(row.data);
122
+ },
123
+ async save(session) {
124
+ stmtUpsert.run(
125
+ session.id,
126
+ session.agentId ?? null,
127
+ JSON.stringify(session),
128
+ session.createdAt,
129
+ session.updatedAt
130
+ );
131
+ },
132
+ async delete(sessionId) {
133
+ stmtDelete.run(sessionId);
134
+ },
135
+ async list(filter) {
136
+ let rows;
137
+ if (filter?.agentId) {
138
+ rows = stmtListByAgent.all(filter.agentId);
139
+ } else {
140
+ rows = stmtList.all();
141
+ }
142
+ const ids = rows.map((r) => r.id);
143
+ if (filter?.limit) {
144
+ return ids.slice(0, filter.limit);
145
+ }
146
+ return ids;
147
+ }
148
+ };
149
+ }
150
+
151
+ // src/session/index.ts
152
+ function createSession(options = {}) {
153
+ const store = options.store;
154
+ const now = Date.now();
155
+ const data = options._data ?? {
156
+ id: options.id ?? generateId(),
157
+ agentId: options.agentId,
158
+ messages: [],
159
+ runs: [],
160
+ metadata: options.metadata ?? {},
161
+ createdAt: now,
162
+ updatedAt: now
163
+ };
164
+ function touch() {
165
+ data.updatedAt = Date.now();
166
+ }
167
+ function findRun(runId) {
168
+ return data.runs.find((r) => r.id === runId);
169
+ }
170
+ return {
171
+ get id() {
172
+ return data.id;
173
+ },
174
+ get agentId() {
175
+ return data.agentId;
176
+ },
177
+ get messages() {
178
+ return data.messages;
179
+ },
180
+ get runs() {
181
+ return data.runs;
182
+ },
183
+ get metadata() {
184
+ return data.metadata;
185
+ },
186
+ startRun(runId, prompt) {
187
+ data.runs.push({
188
+ id: runId,
189
+ startedAt: Date.now(),
190
+ prompt,
191
+ status: "running"
192
+ });
193
+ touch();
194
+ },
195
+ completeRun(runId, stats) {
196
+ const run = findRun(runId);
197
+ if (run) {
198
+ run.status = "completed";
199
+ run.endedAt = Date.now();
200
+ run.turns = stats.turns;
201
+ run.tokensIn = stats.tokensIn;
202
+ run.tokensOut = stats.tokensOut;
203
+ if (stats.turnUsage) {
204
+ run.turnUsage = stats.turnUsage;
205
+ run.totalUsage = stats.turnUsage.reduce((acc, t) => ({
206
+ input: acc.input + t.input,
207
+ output: acc.output + t.output,
208
+ cacheCreation: (acc.cacheCreation ?? 0) + (t.cacheCreation ?? 0) || void 0,
209
+ cacheRead: (acc.cacheRead ?? 0) + (t.cacheRead ?? 0) || void 0,
210
+ thinking: (acc.thinking ?? 0) + (t.thinking ?? 0) || void 0
211
+ }), { input: 0, output: 0 });
212
+ }
213
+ if (stats.cost !== void 0)
214
+ run.cost = stats.cost;
215
+ }
216
+ touch();
217
+ },
218
+ abortRun(runId) {
219
+ const run = findRun(runId);
220
+ if (run) {
221
+ run.status = "aborted";
222
+ run.endedAt = Date.now();
223
+ }
224
+ touch();
225
+ },
226
+ errorRun(runId, error) {
227
+ const run = findRun(runId);
228
+ if (run) {
229
+ run.status = "error";
230
+ run.endedAt = Date.now();
231
+ run.error = error;
232
+ }
233
+ touch();
234
+ },
235
+ pushMessages(messages) {
236
+ data.messages.push(...messages);
237
+ touch();
238
+ },
239
+ setMessages(messages) {
240
+ data.messages = messages;
241
+ touch();
242
+ },
243
+ setMeta(key, value) {
244
+ data.metadata[key] = value;
245
+ touch();
246
+ },
247
+ async save() {
248
+ if (!store) {
249
+ throw new Error("No SessionStore configured. Pass a store to createSession() to enable persistence.");
250
+ }
251
+ await store.save(data);
252
+ },
253
+ toJSON() {
254
+ return JSON.parse(JSON.stringify(data));
255
+ }
256
+ };
257
+ }
258
+ async function loadSession(store, sessionId) {
259
+ const loaded = await store.load(sessionId);
260
+ if (!loaded)
261
+ return null;
262
+ return createSession({ store, _data: loaded });
263
+ }
264
+ function generateId() {
265
+ return `ses_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
266
+ }
267
+
268
+ export {
269
+ createMemoryStore,
270
+ createRemoteStore,
271
+ createSqliteStore,
272
+ createSession,
273
+ loadSession
274
+ };
@@ -0,0 +1,365 @@
1
+ // src/providers/openai-compat.ts
2
+ var TOOL_RESULTS_TAG = "__zidane_tool_results__";
3
+ var ASSISTANT_TOOL_CALLS_TAG = "__zidane_assistant_tc__";
4
+ async function consumeSSE(response, callbacks, signal) {
5
+ const reader = response.body.getReader();
6
+ const decoder = new TextDecoder();
7
+ let buffer = "";
8
+ let text = "";
9
+ let finishReason = "stop";
10
+ let usage = { input: 0, output: 0 };
11
+ const tcMap = /* @__PURE__ */ new Map();
12
+ try {
13
+ while (true) {
14
+ if (signal?.aborted)
15
+ break;
16
+ const { done, value } = await reader.read();
17
+ if (done)
18
+ break;
19
+ buffer += decoder.decode(value, { stream: true });
20
+ const lines = buffer.split("\n");
21
+ buffer = lines.pop() || "";
22
+ for (const line of lines) {
23
+ if (!line.startsWith("data: "))
24
+ continue;
25
+ const data = line.slice(6).trim();
26
+ if (data === "[DONE]")
27
+ continue;
28
+ let chunk;
29
+ try {
30
+ chunk = JSON.parse(data);
31
+ } catch {
32
+ continue;
33
+ }
34
+ const choice = chunk.choices?.[0];
35
+ if (!choice)
36
+ continue;
37
+ if (choice.finish_reason)
38
+ finishReason = choice.finish_reason;
39
+ if (choice.delta?.content) {
40
+ text += choice.delta.content;
41
+ callbacks.onText(choice.delta.content);
42
+ }
43
+ if (choice.delta?.tool_calls) {
44
+ for (const tc of choice.delta.tool_calls) {
45
+ const existing = tcMap.get(tc.index);
46
+ if (existing) {
47
+ if (tc.function?.arguments)
48
+ existing.args += tc.function.arguments;
49
+ } else {
50
+ tcMap.set(tc.index, {
51
+ id: tc.id || `call_${tc.index}`,
52
+ name: tc.function?.name || "",
53
+ args: tc.function?.arguments || ""
54
+ });
55
+ }
56
+ }
57
+ }
58
+ if (chunk.usage) {
59
+ usage = {
60
+ input: chunk.usage.prompt_tokens,
61
+ output: chunk.usage.completion_tokens,
62
+ cost: chunk.usage.total_cost ?? void 0
63
+ };
64
+ }
65
+ }
66
+ }
67
+ } finally {
68
+ reader.releaseLock();
69
+ }
70
+ const toolCalls = Array.from(tcMap.values()).map((tc) => ({
71
+ id: tc.id,
72
+ name: tc.name,
73
+ input: tc.args ? JSON.parse(tc.args) : {}
74
+ }));
75
+ return { text, toolCalls, finishReason, usage };
76
+ }
77
+ function toOAIMessages(system, messages) {
78
+ const out = [{ role: "system", content: system }];
79
+ for (const msg of messages) {
80
+ const toolResults = msg.content.filter((b) => b.type === "tool_result");
81
+ const toolCalls = msg.content.filter((b) => b.type === "tool_call");
82
+ const textBlocks = msg.content.filter((b) => b.type === "text");
83
+ const imageBlocks = msg.content.filter((b) => b.type === "image");
84
+ if (toolResults.length > 0) {
85
+ for (const tr of toolResults) {
86
+ out.push({ role: "tool", tool_call_id: tr.callId, content: tr.output });
87
+ }
88
+ continue;
89
+ }
90
+ if (toolCalls.length > 0) {
91
+ const textContent = textBlocks.length > 0 ? textBlocks[0].text : null;
92
+ out.push({
93
+ role: "assistant",
94
+ content: textContent,
95
+ tool_calls: toolCalls.map((tc) => ({
96
+ id: tc.id,
97
+ type: "function",
98
+ function: { name: tc.name, arguments: JSON.stringify(tc.input) }
99
+ }))
100
+ });
101
+ continue;
102
+ }
103
+ if (imageBlocks.length > 0) {
104
+ const parts = imageBlocks.map((img) => ({
105
+ type: "image_url",
106
+ image_url: { url: `data:${img.mediaType};base64,${img.data}` }
107
+ }));
108
+ for (const b of textBlocks) {
109
+ parts.push({ type: "text", text: b.text });
110
+ }
111
+ out.push({ role: msg.role, content: parts });
112
+ continue;
113
+ }
114
+ if (textBlocks.length === 1) {
115
+ out.push({ role: msg.role, content: textBlocks[0].text });
116
+ } else if (textBlocks.length > 1) {
117
+ out.push({ role: msg.role, content: textBlocks.map((b) => ({ type: "text", text: b.text })) });
118
+ } else {
119
+ out.push({ role: msg.role, content: null });
120
+ }
121
+ }
122
+ return out;
123
+ }
124
+ function formatTools(tools) {
125
+ return tools.map((t) => ({
126
+ type: "function",
127
+ function: { name: t.name, description: t.description, parameters: t.input_schema }
128
+ }));
129
+ }
130
+ function userMessage(content, images) {
131
+ if (images?.length) {
132
+ return {
133
+ role: "user",
134
+ content: [
135
+ ...images.map((img) => ({
136
+ type: "image",
137
+ mediaType: img.source.media_type,
138
+ data: img.source.data
139
+ })),
140
+ { type: "text", text: content }
141
+ ]
142
+ };
143
+ }
144
+ return { role: "user", content: [{ type: "text", text: content }] };
145
+ }
146
+ function assistantMessage(content) {
147
+ return { role: "assistant", content: [{ type: "text", text: content }] };
148
+ }
149
+ function toolResultsMessage(results) {
150
+ return {
151
+ role: "user",
152
+ content: results.map((r) => ({
153
+ type: "tool_result",
154
+ callId: r.id,
155
+ output: r.content
156
+ }))
157
+ };
158
+ }
159
+ function buildAssistantContent(text, toolCalls) {
160
+ const content = [];
161
+ if (text)
162
+ content.push({ type: "text", text });
163
+ for (const tc of toolCalls) {
164
+ content.push({ type: "tool_call", id: tc.id, name: tc.name, input: tc.input });
165
+ }
166
+ return { role: "assistant", content };
167
+ }
168
+
169
+ // src/session/messages.ts
170
+ function fromAnthropic(msg) {
171
+ const role = msg.role;
172
+ const content = [];
173
+ if (typeof msg.content === "string") {
174
+ content.push({ type: "text", text: msg.content });
175
+ return { role, content };
176
+ }
177
+ if (Array.isArray(msg.content)) {
178
+ for (const block of msg.content) {
179
+ if (!block || typeof block !== "object")
180
+ continue;
181
+ const b = block;
182
+ if (b.type === "text") {
183
+ content.push({ type: "text", text: b.text });
184
+ } else if (b.type === "image") {
185
+ const source = b.source;
186
+ if (source?.type === "base64") {
187
+ content.push({ type: "image", mediaType: source.media_type, data: source.data });
188
+ }
189
+ } else if (b.type === "tool_use") {
190
+ content.push({ type: "tool_call", id: b.id, name: b.name, input: b.input });
191
+ } else if (b.type === "tool_result") {
192
+ const output = typeof b.content === "string" ? b.content : JSON.stringify(b.content);
193
+ content.push({ type: "tool_result", callId: b.tool_use_id, output });
194
+ } else if (b.type === "thinking") {
195
+ content.push({ type: "thinking", text: b.thinking });
196
+ }
197
+ }
198
+ }
199
+ return { role, content };
200
+ }
201
+ function fromOpenAI(msg) {
202
+ const role = msg.role;
203
+ const content = [];
204
+ const c = msg.content;
205
+ if (c == null) {
206
+ return { role, content };
207
+ }
208
+ if (typeof c === "string") {
209
+ content.push({ type: "text", text: c });
210
+ return { role, content };
211
+ }
212
+ if (typeof c === "object" && c._tag === ASSISTANT_TOOL_CALLS_TAG) {
213
+ if (c.text) {
214
+ content.push({ type: "text", text: c.text });
215
+ }
216
+ if (Array.isArray(c.tool_calls)) {
217
+ for (const tc of c.tool_calls) {
218
+ const input = tc.function?.arguments ? typeof tc.function.arguments === "string" ? JSON.parse(tc.function.arguments) : tc.function.arguments : {};
219
+ content.push({ type: "tool_call", id: tc.id, name: tc.function?.name ?? "", input });
220
+ }
221
+ }
222
+ return { role, content };
223
+ }
224
+ if (typeof c === "object" && c._tag === TOOL_RESULTS_TAG) {
225
+ if (Array.isArray(c.results)) {
226
+ for (const r of c.results) {
227
+ content.push({ type: "tool_result", callId: r.tool_call_id, output: r.content });
228
+ }
229
+ }
230
+ return { role, content };
231
+ }
232
+ if (Array.isArray(c)) {
233
+ for (const block of c) {
234
+ if (!block || typeof block !== "object")
235
+ continue;
236
+ const b = block;
237
+ if (b.type === "text") {
238
+ content.push({ type: "text", text: b.text });
239
+ } else if (b.type === "image_url") {
240
+ const imageUrl = b.image_url?.url;
241
+ if (imageUrl?.startsWith("data:")) {
242
+ const [meta, data] = imageUrl.slice(5).split(",", 2);
243
+ const mediaType = meta.replace(";base64", "");
244
+ content.push({ type: "image", mediaType, data });
245
+ }
246
+ }
247
+ }
248
+ return { role, content };
249
+ }
250
+ return { role, content };
251
+ }
252
+ function toAnthropic(msg) {
253
+ const blocks = msg.content.map((block) => {
254
+ switch (block.type) {
255
+ case "text":
256
+ return { type: "text", text: block.text };
257
+ case "image":
258
+ return { type: "image", source: { type: "base64", media_type: block.mediaType, data: block.data } };
259
+ case "tool_call":
260
+ return { type: "tool_use", id: block.id, name: block.name, input: block.input };
261
+ case "tool_result":
262
+ return { type: "tool_result", tool_use_id: block.callId, content: block.output };
263
+ case "thinking":
264
+ return { type: "thinking", thinking: block.text };
265
+ default:
266
+ return { type: "text", text: "" };
267
+ }
268
+ });
269
+ if (blocks.length === 1 && blocks[0].type === "text") {
270
+ return { role: msg.role, content: blocks[0].text };
271
+ }
272
+ return { role: msg.role, content: blocks };
273
+ }
274
+ function toOpenAI(msg) {
275
+ const toolCalls = msg.content.filter((b) => b.type === "tool_call");
276
+ const toolResults = msg.content.filter((b) => b.type === "tool_result");
277
+ const textBlocks = msg.content.filter((b) => b.type === "text");
278
+ const imageBlocks = msg.content.filter((b) => b.type === "image");
279
+ if (toolResults.length > 0) {
280
+ return {
281
+ role: msg.role,
282
+ content: {
283
+ _tag: TOOL_RESULTS_TAG,
284
+ results: toolResults.map((b) => {
285
+ const tr = b;
286
+ return { tool_call_id: tr.callId, content: tr.output };
287
+ })
288
+ }
289
+ };
290
+ }
291
+ if (toolCalls.length > 0) {
292
+ const textContent = textBlocks.length > 0 ? textBlocks[0].text : null;
293
+ return {
294
+ role: msg.role,
295
+ content: {
296
+ _tag: ASSISTANT_TOOL_CALLS_TAG,
297
+ text: textContent,
298
+ tool_calls: toolCalls.map((b) => {
299
+ const tc = b;
300
+ return {
301
+ id: tc.id,
302
+ type: "function",
303
+ function: { name: tc.name, arguments: JSON.stringify(tc.input) }
304
+ };
305
+ })
306
+ }
307
+ };
308
+ }
309
+ if (imageBlocks.length > 0) {
310
+ const parts = imageBlocks.map((b) => {
311
+ const img = b;
312
+ return { type: "image_url", image_url: { url: `data:${img.mediaType};base64,${img.data}` } };
313
+ });
314
+ for (const b of textBlocks) {
315
+ parts.push({ type: "text", text: b.text });
316
+ }
317
+ return { role: msg.role, content: parts };
318
+ }
319
+ if (textBlocks.length === 1) {
320
+ return { role: msg.role, content: textBlocks[0].text };
321
+ }
322
+ if (textBlocks.length > 1) {
323
+ return { role: msg.role, content: textBlocks.map((b) => ({ type: "text", text: b.text })) };
324
+ }
325
+ return { role: msg.role, content: null };
326
+ }
327
+ function autoDetectAndConvert(msg) {
328
+ const c = msg.content;
329
+ if (c && typeof c === "object" && typeof c._tag === "string" && c._tag.startsWith("__zidane_")) {
330
+ return fromOpenAI(msg);
331
+ }
332
+ if (Array.isArray(c)) {
333
+ for (const block of c) {
334
+ if (!block || typeof block !== "object")
335
+ continue;
336
+ const b = block;
337
+ if (b.type === "tool_use" || b.type === "tool_result" && "tool_use_id" in b) {
338
+ return fromAnthropic(msg);
339
+ }
340
+ if (b.type === "image_url") {
341
+ return fromOpenAI(msg);
342
+ }
343
+ }
344
+ return fromAnthropic(msg);
345
+ }
346
+ if (typeof c === "string") {
347
+ return fromAnthropic(msg);
348
+ }
349
+ return fromAnthropic(msg);
350
+ }
351
+
352
+ export {
353
+ consumeSSE,
354
+ toOAIMessages,
355
+ formatTools,
356
+ userMessage,
357
+ assistantMessage,
358
+ toolResultsMessage,
359
+ buildAssistantContent,
360
+ fromAnthropic,
361
+ fromOpenAI,
362
+ toAnthropic,
363
+ toOpenAI,
364
+ autoDetectAndConvert
365
+ };
@@ -0,0 +1,26 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __esm = (fn, res) => function __init() {
6
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
7
+ };
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ export {
23
+ __esm,
24
+ __export,
25
+ __toCommonJS
26
+ };