@panorama-ai/gateway 2.24.100
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 +74 -0
- package/dist/cli-providers/claude-utils.d.ts +10 -0
- package/dist/cli-providers/claude-utils.d.ts.map +1 -0
- package/dist/cli-providers/claude-utils.js +73 -0
- package/dist/cli-providers/claude-utils.js.map +1 -0
- package/dist/cli-providers/claude.d.ts +3 -0
- package/dist/cli-providers/claude.d.ts.map +1 -0
- package/dist/cli-providers/claude.js +212 -0
- package/dist/cli-providers/claude.js.map +1 -0
- package/dist/cli-providers/codex-schema.d.ts +10 -0
- package/dist/cli-providers/codex-schema.d.ts.map +1 -0
- package/dist/cli-providers/codex-schema.js +76 -0
- package/dist/cli-providers/codex-schema.js.map +1 -0
- package/dist/cli-providers/codex.d.ts +3 -0
- package/dist/cli-providers/codex.d.ts.map +1 -0
- package/dist/cli-providers/codex.js +271 -0
- package/dist/cli-providers/codex.js.map +1 -0
- package/dist/cli-providers/gemini.d.ts +3 -0
- package/dist/cli-providers/gemini.d.ts.map +1 -0
- package/dist/cli-providers/gemini.js +214 -0
- package/dist/cli-providers/gemini.js.map +1 -0
- package/dist/cli-providers/registry.d.ts +5 -0
- package/dist/cli-providers/registry.d.ts.map +1 -0
- package/dist/cli-providers/registry.js +25 -0
- package/dist/cli-providers/registry.js.map +1 -0
- package/dist/cli-providers/types.d.ts +61 -0
- package/dist/cli-providers/types.d.ts.map +1 -0
- package/dist/cli-providers/types.js +2 -0
- package/dist/cli-providers/types.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2288 -0
- package/dist/index.js.map +1 -0
- package/dist/subagent-adapters/claude-code.d.ts +3 -0
- package/dist/subagent-adapters/claude-code.d.ts.map +1 -0
- package/dist/subagent-adapters/claude-code.js +565 -0
- package/dist/subagent-adapters/claude-code.js.map +1 -0
- package/dist/subagent-adapters/claude-support.d.ts +30 -0
- package/dist/subagent-adapters/claude-support.d.ts.map +1 -0
- package/dist/subagent-adapters/claude-support.js +67 -0
- package/dist/subagent-adapters/claude-support.js.map +1 -0
- package/dist/subagent-adapters/codex.d.ts +3 -0
- package/dist/subagent-adapters/codex.d.ts.map +1 -0
- package/dist/subagent-adapters/codex.js +241 -0
- package/dist/subagent-adapters/codex.js.map +1 -0
- package/dist/subagent-adapters/gemini.d.ts +3 -0
- package/dist/subagent-adapters/gemini.d.ts.map +1 -0
- package/dist/subagent-adapters/gemini.js +257 -0
- package/dist/subagent-adapters/gemini.js.map +1 -0
- package/dist/subagent-adapters/registry.d.ts +4 -0
- package/dist/subagent-adapters/registry.d.ts.map +1 -0
- package/dist/subagent-adapters/registry.js +19 -0
- package/dist/subagent-adapters/registry.js.map +1 -0
- package/dist/subagent-adapters/types.d.ts +60 -0
- package/dist/subagent-adapters/types.d.ts.map +1 -0
- package/dist/subagent-adapters/types.js +2 -0
- package/dist/subagent-adapters/types.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
import { SUBAGENT_SCHEMA_VERSION } from './types.js';
|
|
2
|
+
import { coerceClaudeSupport } from './claude-support.js';
|
|
3
|
+
function normalizeStringList(value) {
|
|
4
|
+
if (Array.isArray(value)) {
|
|
5
|
+
const items = value.map((item) => String(item).trim()).filter((item) => item.length > 0);
|
|
6
|
+
return items.length > 0 ? items : null;
|
|
7
|
+
}
|
|
8
|
+
if (typeof value === 'string') {
|
|
9
|
+
const trimmed = value.trim();
|
|
10
|
+
if (!trimmed)
|
|
11
|
+
return null;
|
|
12
|
+
return trimmed.split(',').map((item) => item.trim()).filter((item) => item.length > 0);
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function normalizeClaudeToolName(name) {
|
|
17
|
+
const trimmed = name.trim();
|
|
18
|
+
if (!trimmed)
|
|
19
|
+
return null;
|
|
20
|
+
const lower = trimmed.toLowerCase();
|
|
21
|
+
if (lower === 'web__search' || lower === 'web_search' || lower === 'websearch') {
|
|
22
|
+
return 'WebSearch';
|
|
23
|
+
}
|
|
24
|
+
return trimmed;
|
|
25
|
+
}
|
|
26
|
+
function normalizeClaudeToolList(value) {
|
|
27
|
+
const list = normalizeStringList(value);
|
|
28
|
+
if (!list)
|
|
29
|
+
return null;
|
|
30
|
+
const normalized = list
|
|
31
|
+
.map((tool) => normalizeClaudeToolName(tool))
|
|
32
|
+
.filter((tool) => !!tool && tool.length > 0);
|
|
33
|
+
return normalized.length > 0 ? normalized : null;
|
|
34
|
+
}
|
|
35
|
+
function stringifyJsonSchema(value) {
|
|
36
|
+
if (!value)
|
|
37
|
+
return null;
|
|
38
|
+
if (typeof value === 'string') {
|
|
39
|
+
return value.trim().length > 0 ? value : null;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
return JSON.stringify(value);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function appendIsolationArgs(args, support) {
|
|
49
|
+
if (support.settingSourcesFlag) {
|
|
50
|
+
args.push('--setting-sources', 'local');
|
|
51
|
+
}
|
|
52
|
+
if (support.disableSlashCommandsFlag) {
|
|
53
|
+
args.push('--disable-slash-commands');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function toOutputEnvelope(content, contentType, summary, sources) {
|
|
57
|
+
const output = {
|
|
58
|
+
schema_version: SUBAGENT_SCHEMA_VERSION,
|
|
59
|
+
content,
|
|
60
|
+
content_type: contentType,
|
|
61
|
+
};
|
|
62
|
+
if (summary && summary.trim().length > 0) {
|
|
63
|
+
output.summary = summary.trim();
|
|
64
|
+
}
|
|
65
|
+
if (sources && sources.length > 0) {
|
|
66
|
+
output.sources = sources;
|
|
67
|
+
}
|
|
68
|
+
return output;
|
|
69
|
+
}
|
|
70
|
+
function extractSummaryAndSources(value) {
|
|
71
|
+
if (!value || typeof value !== 'object')
|
|
72
|
+
return {};
|
|
73
|
+
const obj = value;
|
|
74
|
+
const summary = typeof obj.summary === 'string'
|
|
75
|
+
? obj.summary
|
|
76
|
+
: typeof obj.overview === 'string'
|
|
77
|
+
? obj.overview
|
|
78
|
+
: undefined;
|
|
79
|
+
const sources = Array.isArray(obj.sources) && obj.sources.every((item) => typeof item === 'string')
|
|
80
|
+
? obj.sources
|
|
81
|
+
: undefined;
|
|
82
|
+
return { summary, sources };
|
|
83
|
+
}
|
|
84
|
+
function buildClaudeArgs(prompt, config, support, resumeSessionId) {
|
|
85
|
+
let effectivePrompt = prompt;
|
|
86
|
+
const args = [];
|
|
87
|
+
const rawOutputFormat = typeof config.output_format === 'string' ? config.output_format.trim().toLowerCase() : '';
|
|
88
|
+
const desiredOutputFormat = rawOutputFormat === 'text'
|
|
89
|
+
? 'text'
|
|
90
|
+
: rawOutputFormat === 'stream-json' || rawOutputFormat === 'stream_json' || rawOutputFormat === 'stream'
|
|
91
|
+
? 'stream-json'
|
|
92
|
+
: 'json';
|
|
93
|
+
const outputFormat = !support.outputFormatFlag && desiredOutputFormat === 'stream-json'
|
|
94
|
+
? 'json'
|
|
95
|
+
: desiredOutputFormat;
|
|
96
|
+
if (support.outputFormatFlag) {
|
|
97
|
+
args.push('--output-format', outputFormat);
|
|
98
|
+
}
|
|
99
|
+
const model = typeof config.model === 'string' ? config.model.trim() : '';
|
|
100
|
+
if (model && support.modelFlag) {
|
|
101
|
+
args.push('--model', model);
|
|
102
|
+
}
|
|
103
|
+
const allowedTools = normalizeClaudeToolList(config.allowed_tools);
|
|
104
|
+
if (allowedTools && support.allowedToolsFlag) {
|
|
105
|
+
args.push('--allowedTools', allowedTools.join(','));
|
|
106
|
+
}
|
|
107
|
+
else if (allowedTools && support.toolsFlag) {
|
|
108
|
+
args.push('--tools', allowedTools.join(','));
|
|
109
|
+
}
|
|
110
|
+
const disallowedTools = normalizeClaudeToolList(config.disallowed_tools);
|
|
111
|
+
if (disallowedTools && support.disallowedToolsFlag) {
|
|
112
|
+
args.push('--disallowedTools', disallowedTools.join(','));
|
|
113
|
+
}
|
|
114
|
+
const appendSystemPrompt = typeof config.append_system_prompt === 'string'
|
|
115
|
+
? config.append_system_prompt.trim()
|
|
116
|
+
: '';
|
|
117
|
+
if (appendSystemPrompt) {
|
|
118
|
+
if (support.appendSystemPromptFlag) {
|
|
119
|
+
args.push('--append-system-prompt', appendSystemPrompt);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
effectivePrompt = `${effectivePrompt}\n\n${appendSystemPrompt}`;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const systemPrompt = typeof config.system_prompt === 'string'
|
|
126
|
+
? config.system_prompt.trim()
|
|
127
|
+
: '';
|
|
128
|
+
if (systemPrompt && support.systemPromptFlag) {
|
|
129
|
+
args.push('--system-prompt', systemPrompt);
|
|
130
|
+
}
|
|
131
|
+
const jsonSchema = stringifyJsonSchema(config.json_schema);
|
|
132
|
+
if (jsonSchema) {
|
|
133
|
+
if (support.jsonSchemaFlag) {
|
|
134
|
+
args.push('--json-schema', jsonSchema);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
effectivePrompt = `${effectivePrompt}\n\nReturn STRICT JSON matching this schema:\n${jsonSchema}`;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (config.include_partial_messages === true &&
|
|
141
|
+
support.includePartialMessagesFlag &&
|
|
142
|
+
outputFormat === 'stream-json') {
|
|
143
|
+
args.push('--include-partial-messages');
|
|
144
|
+
}
|
|
145
|
+
if (outputFormat === 'stream-json' && support.verboseFlag) {
|
|
146
|
+
args.push('--verbose');
|
|
147
|
+
}
|
|
148
|
+
const permissionMode = typeof config.permission_mode === 'string'
|
|
149
|
+
? config.permission_mode.trim()
|
|
150
|
+
: '';
|
|
151
|
+
if (permissionMode && support.permissionModeFlag) {
|
|
152
|
+
args.push('--permission-mode', permissionMode);
|
|
153
|
+
}
|
|
154
|
+
const maxBudget = typeof config.max_budget_usd === 'number'
|
|
155
|
+
? config.max_budget_usd
|
|
156
|
+
: typeof config.max_budget_usd === 'string'
|
|
157
|
+
? Number.parseFloat(config.max_budget_usd)
|
|
158
|
+
: NaN;
|
|
159
|
+
if (Number.isFinite(maxBudget) && support.maxBudgetFlag) {
|
|
160
|
+
args.push('--max-budget-usd', String(maxBudget));
|
|
161
|
+
}
|
|
162
|
+
const inputFormat = typeof config.input_format === 'string'
|
|
163
|
+
? config.input_format.trim()
|
|
164
|
+
: '';
|
|
165
|
+
if (inputFormat && support.inputFormatFlag) {
|
|
166
|
+
args.push('--input-format', inputFormat);
|
|
167
|
+
}
|
|
168
|
+
const betas = normalizeStringList(config.betas);
|
|
169
|
+
if (betas && betas.length > 0 && support.betasFlag) {
|
|
170
|
+
args.push('--betas', ...betas);
|
|
171
|
+
}
|
|
172
|
+
const noSessionPersistence = config.no_session_persistence === true && support.noSessionPersistenceFlag;
|
|
173
|
+
if (noSessionPersistence) {
|
|
174
|
+
args.push('--no-session-persistence');
|
|
175
|
+
}
|
|
176
|
+
const sessionId = typeof config.session_id === 'string'
|
|
177
|
+
? config.session_id.trim()
|
|
178
|
+
: '';
|
|
179
|
+
if (sessionId && support.sessionIdFlag) {
|
|
180
|
+
args.push('--session-id', sessionId);
|
|
181
|
+
}
|
|
182
|
+
const explicitResume = typeof config.resume_session_id === 'string'
|
|
183
|
+
? config.resume_session_id.trim()
|
|
184
|
+
: '';
|
|
185
|
+
const resumeId = explicitResume || (resumeSessionId ?? '');
|
|
186
|
+
if (resumeId) {
|
|
187
|
+
if (!support.resumeFlag) {
|
|
188
|
+
throw new Error('Claude CLI does not support session continuation (--resume)');
|
|
189
|
+
}
|
|
190
|
+
args.push('--resume', resumeId);
|
|
191
|
+
}
|
|
192
|
+
appendIsolationArgs(args, support);
|
|
193
|
+
const timeoutMs = typeof config.timeout_ms === 'number'
|
|
194
|
+
? config.timeout_ms
|
|
195
|
+
: null;
|
|
196
|
+
args.push('-p', effectivePrompt);
|
|
197
|
+
return {
|
|
198
|
+
args,
|
|
199
|
+
outputFormat,
|
|
200
|
+
timeoutMs: Number.isFinite(timeoutMs) ? timeoutMs : null,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function normalizeOutputFromJson(parsed) {
|
|
204
|
+
const metadata = {
|
|
205
|
+
adapter_id: 'claude_code',
|
|
206
|
+
};
|
|
207
|
+
if (typeof parsed.session_id === 'string') {
|
|
208
|
+
metadata.session_id = parsed.session_id;
|
|
209
|
+
}
|
|
210
|
+
if (typeof parsed.total_cost_usd === 'number') {
|
|
211
|
+
metadata.total_cost_usd = parsed.total_cost_usd;
|
|
212
|
+
}
|
|
213
|
+
if (parsed.usage) {
|
|
214
|
+
metadata.usage = parsed.usage;
|
|
215
|
+
}
|
|
216
|
+
if (parsed.modelUsage) {
|
|
217
|
+
metadata.model_usage = parsed.modelUsage;
|
|
218
|
+
}
|
|
219
|
+
if (parsed.permission_denials) {
|
|
220
|
+
metadata.permission_denials = parsed.permission_denials;
|
|
221
|
+
}
|
|
222
|
+
const structured = parsed.structured_output;
|
|
223
|
+
if (structured && typeof structured === 'object') {
|
|
224
|
+
const { summary, sources } = extractSummaryAndSources(structured);
|
|
225
|
+
return {
|
|
226
|
+
output: toOutputEnvelope(structured, 'json', summary, sources),
|
|
227
|
+
metadata,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
const result = parsed.result;
|
|
231
|
+
if (typeof result === 'string') {
|
|
232
|
+
const { summary, sources } = extractSummaryAndSources(parsed);
|
|
233
|
+
return {
|
|
234
|
+
output: toOutputEnvelope(result, 'markdown', summary, sources),
|
|
235
|
+
metadata,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
if (result !== undefined) {
|
|
239
|
+
const contentType = result && typeof result === 'object' ? 'json' : 'text';
|
|
240
|
+
const { summary, sources } = extractSummaryAndSources(result);
|
|
241
|
+
return {
|
|
242
|
+
output: toOutputEnvelope(result, contentType, summary, sources),
|
|
243
|
+
metadata,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
const { summary, sources } = extractSummaryAndSources(parsed);
|
|
247
|
+
return {
|
|
248
|
+
output: toOutputEnvelope(parsed, 'json', summary, sources),
|
|
249
|
+
metadata,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function extractStringValue(value) {
|
|
253
|
+
if (!value)
|
|
254
|
+
return null;
|
|
255
|
+
if (typeof value === 'string') {
|
|
256
|
+
const trimmed = value.trim();
|
|
257
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
258
|
+
}
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
function extractAssistantContent(event) {
|
|
262
|
+
const direct = extractStringValue(event.content) ??
|
|
263
|
+
extractStringValue(event.message) ??
|
|
264
|
+
extractStringValue(event.result) ??
|
|
265
|
+
extractStringValue(event.output);
|
|
266
|
+
if (direct)
|
|
267
|
+
return direct;
|
|
268
|
+
const message = event.message;
|
|
269
|
+
if (message && typeof message === 'object') {
|
|
270
|
+
const msgObj = message;
|
|
271
|
+
const content = msgObj.content;
|
|
272
|
+
if (typeof content === 'string') {
|
|
273
|
+
return extractStringValue(content);
|
|
274
|
+
}
|
|
275
|
+
if (Array.isArray(content)) {
|
|
276
|
+
const textChunks = content
|
|
277
|
+
.map((item) => {
|
|
278
|
+
if (!item || typeof item !== 'object')
|
|
279
|
+
return null;
|
|
280
|
+
const part = item;
|
|
281
|
+
return extractStringValue(part.text) ?? extractStringValue(part.content);
|
|
282
|
+
})
|
|
283
|
+
.filter((item) => !!item);
|
|
284
|
+
if (textChunks.length > 0) {
|
|
285
|
+
return textChunks.join('');
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
function extractMetadataFromEvents(events) {
|
|
292
|
+
const metadata = { adapter_id: 'claude_code' };
|
|
293
|
+
for (const entry of events) {
|
|
294
|
+
const event = entry.event;
|
|
295
|
+
if (!event)
|
|
296
|
+
continue;
|
|
297
|
+
if (typeof event.session_id === 'string' && event.session_id.trim().length > 0) {
|
|
298
|
+
metadata.session_id = event.session_id;
|
|
299
|
+
}
|
|
300
|
+
if (typeof event.total_cost_usd === 'number') {
|
|
301
|
+
metadata.total_cost_usd = event.total_cost_usd;
|
|
302
|
+
}
|
|
303
|
+
if (event.usage) {
|
|
304
|
+
metadata.usage = event.usage;
|
|
305
|
+
}
|
|
306
|
+
if (event.modelUsage) {
|
|
307
|
+
metadata.model_usage = event.modelUsage;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return metadata;
|
|
311
|
+
}
|
|
312
|
+
function normalizeStreamEvents(events) {
|
|
313
|
+
const normalized = [];
|
|
314
|
+
const assistantIndexById = new Map();
|
|
315
|
+
const toolNameByUseId = new Map();
|
|
316
|
+
const toolCallSeen = new Set();
|
|
317
|
+
const toolResultSeen = new Set();
|
|
318
|
+
const upsertAssistantMessage = (messageId, payload) => {
|
|
319
|
+
if (messageId && assistantIndexById.has(messageId)) {
|
|
320
|
+
const index = assistantIndexById.get(messageId);
|
|
321
|
+
if (index !== undefined) {
|
|
322
|
+
normalized[index] = { event_type: 'message', payload };
|
|
323
|
+
}
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
normalized.push({ event_type: 'message', payload });
|
|
327
|
+
if (messageId) {
|
|
328
|
+
assistantIndexById.set(messageId, normalized.length - 1);
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
for (const entry of events) {
|
|
332
|
+
const event = entry.event;
|
|
333
|
+
if (!event || typeof event.type !== 'string')
|
|
334
|
+
continue;
|
|
335
|
+
const eventType = event.type;
|
|
336
|
+
if (eventType === 'result')
|
|
337
|
+
continue;
|
|
338
|
+
if (eventType === 'system') {
|
|
339
|
+
continue;
|
|
340
|
+
}
|
|
341
|
+
if (eventType === 'assistant') {
|
|
342
|
+
const message = getMessageFromEvent(event);
|
|
343
|
+
const messageId = message && typeof message.id === 'string' ? message.id : null;
|
|
344
|
+
const model = message && typeof message.model === 'string' ? message.model : '';
|
|
345
|
+
const stopReason = message && typeof message.stop_reason === 'string' ? message.stop_reason : '';
|
|
346
|
+
if (message) {
|
|
347
|
+
const contentParts = getContentParts(message);
|
|
348
|
+
const textParts = [];
|
|
349
|
+
const toolParts = [];
|
|
350
|
+
for (const part of contentParts) {
|
|
351
|
+
const partType = typeof part.type === 'string' ? part.type : '';
|
|
352
|
+
if (partType === 'tool_use') {
|
|
353
|
+
toolParts.push(part);
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
const text = extractStringValue(part.text) ?? extractStringValue(part.content);
|
|
357
|
+
if (text) {
|
|
358
|
+
textParts.push(text);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
const combinedText = trimText(textParts.join(''));
|
|
362
|
+
if (combinedText) {
|
|
363
|
+
const payload = {
|
|
364
|
+
role: 'assistant',
|
|
365
|
+
content: combinedText,
|
|
366
|
+
};
|
|
367
|
+
if (messageId)
|
|
368
|
+
payload.message_id = messageId;
|
|
369
|
+
if (model)
|
|
370
|
+
payload.model = model;
|
|
371
|
+
if (stopReason)
|
|
372
|
+
payload.stop_reason = stopReason;
|
|
373
|
+
upsertAssistantMessage(messageId, payload);
|
|
374
|
+
}
|
|
375
|
+
for (const part of toolParts) {
|
|
376
|
+
const toolUseId = typeof part.id === 'string'
|
|
377
|
+
? part.id
|
|
378
|
+
: typeof part.tool_use_id === 'string'
|
|
379
|
+
? part.tool_use_id
|
|
380
|
+
: null;
|
|
381
|
+
const toolName = typeof part.name === 'string' ? part.name.trim() : '';
|
|
382
|
+
if (toolUseId && !toolCallSeen.has(toolUseId)) {
|
|
383
|
+
toolCallSeen.add(toolUseId);
|
|
384
|
+
if (toolName) {
|
|
385
|
+
toolNameByUseId.set(toolUseId, toolName);
|
|
386
|
+
}
|
|
387
|
+
const toolInput = part.input ?? null;
|
|
388
|
+
normalized.push({
|
|
389
|
+
event_type: 'tool_call',
|
|
390
|
+
payload: {
|
|
391
|
+
tool_name: toolName || null,
|
|
392
|
+
tool_use_id: toolUseId,
|
|
393
|
+
tool_input: toolInput,
|
|
394
|
+
summary: buildToolInputSummary(toolInput),
|
|
395
|
+
message_id: messageId,
|
|
396
|
+
},
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
continue;
|
|
401
|
+
}
|
|
402
|
+
const fallbackText = extractAssistantContent(event);
|
|
403
|
+
if (fallbackText) {
|
|
404
|
+
upsertAssistantMessage(messageId, {
|
|
405
|
+
role: 'assistant',
|
|
406
|
+
content: trimText(fallbackText),
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
if (eventType === 'user') {
|
|
412
|
+
const message = getMessageFromEvent(event);
|
|
413
|
+
const messageId = message && typeof message.id === 'string' ? message.id : null;
|
|
414
|
+
if (!message)
|
|
415
|
+
continue;
|
|
416
|
+
const contentParts = getContentParts(message);
|
|
417
|
+
for (const part of contentParts) {
|
|
418
|
+
const partType = typeof part.type === 'string' ? part.type : '';
|
|
419
|
+
if (partType !== 'tool_result')
|
|
420
|
+
continue;
|
|
421
|
+
const toolUseId = typeof part.tool_use_id === 'string'
|
|
422
|
+
? part.tool_use_id
|
|
423
|
+
: typeof part.id === 'string'
|
|
424
|
+
? part.id
|
|
425
|
+
: null;
|
|
426
|
+
if (toolUseId && toolResultSeen.has(toolUseId))
|
|
427
|
+
continue;
|
|
428
|
+
if (toolUseId)
|
|
429
|
+
toolResultSeen.add(toolUseId);
|
|
430
|
+
const content = stringifyContent(part.content);
|
|
431
|
+
const trimmedContent = trimText(content);
|
|
432
|
+
if (!trimmedContent)
|
|
433
|
+
continue;
|
|
434
|
+
normalized.push({
|
|
435
|
+
event_type: 'tool_result',
|
|
436
|
+
payload: {
|
|
437
|
+
tool_use_id: toolUseId,
|
|
438
|
+
tool_name: toolUseId ? toolNameByUseId.get(toolUseId) ?? null : null,
|
|
439
|
+
content: trimmedContent,
|
|
440
|
+
is_error: part.is_error === true,
|
|
441
|
+
message_id: messageId,
|
|
442
|
+
},
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
return normalized;
|
|
449
|
+
}
|
|
450
|
+
function asRecord(value) {
|
|
451
|
+
if (!value || typeof value !== 'object')
|
|
452
|
+
return null;
|
|
453
|
+
return value;
|
|
454
|
+
}
|
|
455
|
+
function getMessageFromEvent(event) {
|
|
456
|
+
const message = event.message;
|
|
457
|
+
return asRecord(message);
|
|
458
|
+
}
|
|
459
|
+
function getContentParts(message) {
|
|
460
|
+
const content = message.content;
|
|
461
|
+
if (Array.isArray(content)) {
|
|
462
|
+
return content.filter((item) => !!item && typeof item === 'object');
|
|
463
|
+
}
|
|
464
|
+
if (typeof content === 'string') {
|
|
465
|
+
return [{ type: 'text', text: content }];
|
|
466
|
+
}
|
|
467
|
+
return [];
|
|
468
|
+
}
|
|
469
|
+
function stringifyContent(value) {
|
|
470
|
+
if (typeof value === 'string')
|
|
471
|
+
return value;
|
|
472
|
+
if (value === null || value === undefined)
|
|
473
|
+
return '';
|
|
474
|
+
try {
|
|
475
|
+
return JSON.stringify(value, null, 2);
|
|
476
|
+
}
|
|
477
|
+
catch {
|
|
478
|
+
return String(value);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
function trimText(value) {
|
|
482
|
+
return value.replace(/\s+$/, '');
|
|
483
|
+
}
|
|
484
|
+
function buildToolInputSummary(input) {
|
|
485
|
+
if (!input)
|
|
486
|
+
return null;
|
|
487
|
+
if (typeof input === 'string') {
|
|
488
|
+
const trimmed = input.trim();
|
|
489
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
490
|
+
}
|
|
491
|
+
if (typeof input === 'object') {
|
|
492
|
+
const record = input;
|
|
493
|
+
const query = typeof record.query === 'string' ? record.query.trim() : '';
|
|
494
|
+
if (query)
|
|
495
|
+
return `Query: ${query}`;
|
|
496
|
+
const text = typeof record.text === 'string' ? record.text.trim() : '';
|
|
497
|
+
if (text)
|
|
498
|
+
return text;
|
|
499
|
+
}
|
|
500
|
+
return null;
|
|
501
|
+
}
|
|
502
|
+
export function createClaudeCodeAdapter() {
|
|
503
|
+
return {
|
|
504
|
+
id: 'claude_code',
|
|
505
|
+
label: 'Claude Code',
|
|
506
|
+
supportsContinuation: true,
|
|
507
|
+
buildRunPlan(context) {
|
|
508
|
+
const support = coerceClaudeSupport(context.support);
|
|
509
|
+
const { args, outputFormat, timeoutMs } = buildClaudeArgs(context.prompt, context.config, support, context.resumeSessionId);
|
|
510
|
+
return {
|
|
511
|
+
command: context.command,
|
|
512
|
+
args,
|
|
513
|
+
outputFormat,
|
|
514
|
+
timeoutMs,
|
|
515
|
+
};
|
|
516
|
+
},
|
|
517
|
+
normalizeRunResult({ stdout, outputFormat, }) {
|
|
518
|
+
if (outputFormat === 'json') {
|
|
519
|
+
try {
|
|
520
|
+
const parsed = JSON.parse(stdout);
|
|
521
|
+
const normalized = normalizeOutputFromJson(parsed);
|
|
522
|
+
return {
|
|
523
|
+
...normalized,
|
|
524
|
+
rawResponse: parsed,
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
catch (error) {
|
|
528
|
+
const parseError = error instanceof Error ? error.message : 'Failed to parse JSON output';
|
|
529
|
+
return {
|
|
530
|
+
output: toOutputEnvelope(stdout.trim(), 'text'),
|
|
531
|
+
metadata: { adapter_id: 'claude_code' },
|
|
532
|
+
parseError,
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
return {
|
|
537
|
+
output: toOutputEnvelope(stdout.trim(), 'text'),
|
|
538
|
+
metadata: { adapter_id: 'claude_code' },
|
|
539
|
+
};
|
|
540
|
+
},
|
|
541
|
+
normalizeStreamingResult({ events, rawOutput }) {
|
|
542
|
+
const resultEvent = [...events]
|
|
543
|
+
.reverse()
|
|
544
|
+
.find((entry) => entry.event && entry.event.type === 'result');
|
|
545
|
+
if (resultEvent?.event) {
|
|
546
|
+
const normalized = normalizeOutputFromJson(resultEvent.event);
|
|
547
|
+
return {
|
|
548
|
+
...normalized,
|
|
549
|
+
rawResponse: resultEvent.event,
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
const assistantEvent = [...events]
|
|
553
|
+
.reverse()
|
|
554
|
+
.find((entry) => entry.event && typeof entry.event.type === 'string');
|
|
555
|
+
const assistantText = (assistantEvent?.event ? extractAssistantContent(assistantEvent.event) : null) ??
|
|
556
|
+
rawOutput.trim();
|
|
557
|
+
return {
|
|
558
|
+
output: toOutputEnvelope(assistantText.trim(), 'markdown'),
|
|
559
|
+
metadata: extractMetadataFromEvents(events),
|
|
560
|
+
};
|
|
561
|
+
},
|
|
562
|
+
normalizeStreamEvents,
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
//# sourceMappingURL=claude-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/subagent-adapters/claude-code.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAsB,MAAM,qBAAqB,CAAA;AAE7E,SAAS,mBAAmB,CAAC,KAAc;IACzC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QACxF,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;IACxC,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EA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,OAAO,EAAE;iBACT,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA;YAEvE,MAAM,aAAa,GACjB,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,CAAC,uBAAuB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;gBAC9E,SAAS,CAAC,IAAI,EAAE,CAAA;YAElB,OAAO;gBACL,MAAM,EAAE,gBAAgB,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,UAAU,CAAC;gBAC1D,QAAQ,EAAE,yBAAyB,CAAC,MAAM,CAAC;aAC5C,CAAA;QACH,CAAC;QACD,qBAAqB;KACtB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface ClaudeSupport {
|
|
2
|
+
toolsFlag: boolean;
|
|
3
|
+
allowedToolsFlag: boolean;
|
|
4
|
+
disallowedToolsFlag: boolean;
|
|
5
|
+
outputFormatFlag: boolean;
|
|
6
|
+
modelFlag: boolean;
|
|
7
|
+
jsonSchemaFlag: boolean;
|
|
8
|
+
appendSystemPromptFlag: boolean;
|
|
9
|
+
systemPromptFlag: boolean;
|
|
10
|
+
includePartialMessagesFlag: boolean;
|
|
11
|
+
permissionModeFlag: boolean;
|
|
12
|
+
maxBudgetFlag: boolean;
|
|
13
|
+
inputFormatFlag: boolean;
|
|
14
|
+
betasFlag: boolean;
|
|
15
|
+
noSessionPersistenceFlag: boolean;
|
|
16
|
+
sessionIdFlag: boolean;
|
|
17
|
+
resumeFlag: boolean;
|
|
18
|
+
verboseFlag: boolean;
|
|
19
|
+
settingsFlag: boolean;
|
|
20
|
+
settingSourcesFlag: boolean;
|
|
21
|
+
disableSlashCommandsFlag: boolean;
|
|
22
|
+
strictMcpConfigFlag: boolean;
|
|
23
|
+
mcpConfigFlag: boolean;
|
|
24
|
+
pluginDirFlag: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const DEFAULT_CLAUDE_SUPPORT: ClaudeSupport;
|
|
27
|
+
export declare function coerceClaudeSupport(flags?: Record<string, boolean> | null): ClaudeSupport;
|
|
28
|
+
export declare function toFlagRecord(flags: ClaudeSupport): Record<string, boolean>;
|
|
29
|
+
export declare function parseClaudeSupport(helpText: string): ClaudeSupport;
|
|
30
|
+
//# sourceMappingURL=claude-support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-support.d.ts","sourceRoot":"","sources":["../../src/subagent-adapters/claude-support.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,OAAO,CAAA;IAClB,gBAAgB,EAAE,OAAO,CAAA;IACzB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,gBAAgB,EAAE,OAAO,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;IAClB,cAAc,EAAE,OAAO,CAAA;IACvB,sBAAsB,EAAE,OAAO,CAAA;IAC/B,gBAAgB,EAAE,OAAO,CAAA;IACzB,0BAA0B,EAAE,OAAO,CAAA;IACnC,kBAAkB,EAAE,OAAO,CAAA;IAC3B,aAAa,EAAE,OAAO,CAAA;IACtB,eAAe,EAAE,OAAO,CAAA;IACxB,SAAS,EAAE,OAAO,CAAA;IAClB,wBAAwB,EAAE,OAAO,CAAA;IACjC,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,OAAO,CAAA;IACpB,YAAY,EAAE,OAAO,CAAA;IACrB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,wBAAwB,EAAE,OAAO,CAAA;IACjC,mBAAmB,EAAE,OAAO,CAAA;IAC5B,aAAa,EAAE,OAAO,CAAA;IACtB,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAwBpC,CAAA;AAED,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,aAAa,CAMzF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAI1E;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CA8BlE"}
|