@vybestack/llxprt-code-core 0.6.1-nightly.251202.1e208436b → 0.6.1-nightly.251204.b119e390d
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/src/auth/precedence.js +9 -10
- package/dist/src/auth/precedence.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/providers/BaseProvider.d.ts +3 -0
- package/dist/src/providers/BaseProvider.js +11 -0
- package/dist/src/providers/BaseProvider.js.map +1 -1
- package/dist/src/providers/IProvider.d.ts +3 -0
- package/dist/src/providers/ProviderManager.js +6 -0
- package/dist/src/providers/ProviderManager.js.map +1 -1
- package/dist/src/providers/openai-vercel/OpenAIVercelProvider.d.ts +130 -0
- package/dist/src/providers/openai-vercel/OpenAIVercelProvider.js +943 -0
- package/dist/src/providers/openai-vercel/OpenAIVercelProvider.js.map +1 -0
- package/dist/src/providers/openai-vercel/errors.d.ts +46 -0
- package/dist/src/providers/openai-vercel/errors.js +137 -0
- package/dist/src/providers/openai-vercel/errors.js.map +1 -0
- package/dist/src/providers/openai-vercel/index.d.ts +22 -0
- package/dist/src/providers/openai-vercel/index.js +23 -0
- package/dist/src/providers/openai-vercel/index.js.map +1 -0
- package/dist/src/providers/openai-vercel/messageConversion.d.ts +33 -0
- package/dist/src/providers/openai-vercel/messageConversion.js +394 -0
- package/dist/src/providers/openai-vercel/messageConversion.js.map +1 -0
- package/dist/src/providers/openai-vercel/toolIdUtils.d.ts +33 -0
- package/dist/src/providers/openai-vercel/toolIdUtils.js +117 -0
- package/dist/src/providers/openai-vercel/toolIdUtils.js.map +1 -0
- package/dist/src/utils/filesearch/ignore.js +3 -2
- package/dist/src/utils/filesearch/ignore.js.map +1 -1
- package/dist/src/utils/gitIgnoreParser.js +2 -1
- package/dist/src/utils/gitIgnoreParser.js.map +1 -1
- package/dist/src/utils/schemaValidator.js +41 -6
- package/dist/src/utils/schemaValidator.js.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 Vybestack LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { normalizeToHistoryToolId, normalizeToOpenAIToolId, } from './toolIdUtils.js';
|
|
17
|
+
import { buildToolResponsePayload, EMPTY_TOOL_RESULT_PLACEHOLDER, } from '../utils/toolResponsePayload.js';
|
|
18
|
+
function inferMediaEncoding(imageData) {
|
|
19
|
+
const defaultResult = { encoding: 'url', mimeType: 'image/*' };
|
|
20
|
+
if (imageData.startsWith('data:image/') && imageData.includes(';base64,')) {
|
|
21
|
+
const mimeMatch = imageData.slice('data:'.length).match(/^([^;]+);base64,/);
|
|
22
|
+
const mimeType = mimeMatch?.[1] ?? 'image/*';
|
|
23
|
+
return { encoding: 'base64', mimeType };
|
|
24
|
+
}
|
|
25
|
+
if (imageData.startsWith('data:')) {
|
|
26
|
+
return defaultResult;
|
|
27
|
+
}
|
|
28
|
+
if (imageData.startsWith('http://') || imageData.startsWith('https://')) {
|
|
29
|
+
return defaultResult;
|
|
30
|
+
}
|
|
31
|
+
// Fallback: treat as base64 when it is not a recognizable URL
|
|
32
|
+
return { encoding: 'base64', mimeType: 'image/*' };
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Convert IContent array to Vercel AI SDK CoreMessage array
|
|
36
|
+
*/
|
|
37
|
+
export function convertToVercelMessages(contents) {
|
|
38
|
+
const messages = [];
|
|
39
|
+
for (const content of contents) {
|
|
40
|
+
const metadata = content.metadata;
|
|
41
|
+
const metadataRole = metadata?.role;
|
|
42
|
+
if (metadataRole === 'system' ||
|
|
43
|
+
content.speaker === 'system') {
|
|
44
|
+
// Convert system messages
|
|
45
|
+
const textBlocks = content.blocks.filter((b) => b.type === 'text');
|
|
46
|
+
const text = textBlocks
|
|
47
|
+
.map((b) => b.text)
|
|
48
|
+
.filter((t) => t.length > 0)
|
|
49
|
+
.join('\n');
|
|
50
|
+
if (text) {
|
|
51
|
+
messages.push({
|
|
52
|
+
role: 'system',
|
|
53
|
+
content: text,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else if (content.speaker === 'human') {
|
|
58
|
+
// Convert human messages to user messages
|
|
59
|
+
const textBlocks = content.blocks.filter((b) => b.type === 'text');
|
|
60
|
+
const mediaBlocks = content.blocks.filter((b) => b.type === 'media');
|
|
61
|
+
const hasImages = mediaBlocks.length > 0;
|
|
62
|
+
const text = textBlocks
|
|
63
|
+
.map((b) => b.text)
|
|
64
|
+
.filter((t) => t.length > 0)
|
|
65
|
+
.join('\n');
|
|
66
|
+
if (hasImages) {
|
|
67
|
+
const parts = [];
|
|
68
|
+
if (text) {
|
|
69
|
+
parts.push({ type: 'text', text });
|
|
70
|
+
}
|
|
71
|
+
for (const media of mediaBlocks) {
|
|
72
|
+
parts.push({
|
|
73
|
+
type: 'image',
|
|
74
|
+
image: normalizeImageData(media),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (parts.length > 0) {
|
|
78
|
+
messages.push({
|
|
79
|
+
role: 'user',
|
|
80
|
+
content: parts,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else if (text) {
|
|
85
|
+
messages.push({
|
|
86
|
+
role: 'user',
|
|
87
|
+
content: text,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else if (content.speaker === 'ai') {
|
|
92
|
+
// Convert AI messages to assistant messages
|
|
93
|
+
const textBlocks = content.blocks.filter((b) => b.type === 'text');
|
|
94
|
+
const toolCallBlocks = content.blocks.filter((b) => b.type === 'tool_call');
|
|
95
|
+
const text = textBlocks
|
|
96
|
+
.map((b) => b.text)
|
|
97
|
+
.filter((t) => t.length > 0)
|
|
98
|
+
.join('\n');
|
|
99
|
+
if (toolCallBlocks.length > 0) {
|
|
100
|
+
const contentParts = [];
|
|
101
|
+
if (text) {
|
|
102
|
+
contentParts.push({ type: 'text', text });
|
|
103
|
+
}
|
|
104
|
+
for (const block of toolCallBlocks) {
|
|
105
|
+
const toolCall = block;
|
|
106
|
+
const input = toolCall.input !== undefined ? toolCall.input : block.parameters;
|
|
107
|
+
contentParts.push({
|
|
108
|
+
type: 'tool-call',
|
|
109
|
+
toolCallId: normalizeToOpenAIToolId(block.id),
|
|
110
|
+
toolName: block.name,
|
|
111
|
+
input,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
messages.push({
|
|
115
|
+
role: 'assistant',
|
|
116
|
+
content: contentParts,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
else if (text) {
|
|
120
|
+
messages.push({
|
|
121
|
+
role: 'assistant',
|
|
122
|
+
content: text,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else if (content.speaker === 'tool') {
|
|
127
|
+
// Convert tool messages to tool result messages
|
|
128
|
+
const toolResponseBlocks = content.blocks.filter((b) => b.type === 'tool_response');
|
|
129
|
+
if (toolResponseBlocks.length > 0) {
|
|
130
|
+
const toolContent = toolResponseBlocks.map((block) => {
|
|
131
|
+
const payload = buildToolResponsePayload(block);
|
|
132
|
+
const extBlock = block;
|
|
133
|
+
return {
|
|
134
|
+
type: 'tool-result',
|
|
135
|
+
toolCallId: normalizeToOpenAIToolId(extBlock.callId || extBlock.id || ''),
|
|
136
|
+
toolName: extBlock.name || extBlock.toolName || '',
|
|
137
|
+
output: {
|
|
138
|
+
type: 'text',
|
|
139
|
+
value: payload.result,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
const toolMessage = {
|
|
144
|
+
role: 'tool',
|
|
145
|
+
content: toolContent,
|
|
146
|
+
};
|
|
147
|
+
messages.push(toolMessage);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return messages;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Convert Vercel AI SDK CoreMessage array back to IContent array
|
|
155
|
+
*/
|
|
156
|
+
export function convertFromVercelMessages(messages) {
|
|
157
|
+
const contents = [];
|
|
158
|
+
for (const message of messages) {
|
|
159
|
+
if (message.role === 'user') {
|
|
160
|
+
// Convert user messages to human messages
|
|
161
|
+
if (Array.isArray(message.content)) {
|
|
162
|
+
const blocks = [];
|
|
163
|
+
for (const part of message.content) {
|
|
164
|
+
const partType = part.type;
|
|
165
|
+
if (typeof part === 'string') {
|
|
166
|
+
if (part) {
|
|
167
|
+
blocks.push({ type: 'text', text: part });
|
|
168
|
+
}
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
if (partType === 'text') {
|
|
172
|
+
const text = part.text;
|
|
173
|
+
if (text) {
|
|
174
|
+
blocks.push({ type: 'text', text });
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else if (partType === 'image') {
|
|
178
|
+
const imageData = part.image ??
|
|
179
|
+
part.url;
|
|
180
|
+
if (imageData) {
|
|
181
|
+
const { encoding, mimeType } = inferMediaEncoding(imageData);
|
|
182
|
+
blocks.push({
|
|
183
|
+
type: 'media',
|
|
184
|
+
data: imageData,
|
|
185
|
+
encoding,
|
|
186
|
+
mimeType,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (blocks.length > 0) {
|
|
192
|
+
contents.push({
|
|
193
|
+
speaker: 'human',
|
|
194
|
+
blocks,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
const text = typeof message.content === 'string' ? message.content : '';
|
|
200
|
+
if (text) {
|
|
201
|
+
contents.push({
|
|
202
|
+
speaker: 'human',
|
|
203
|
+
blocks: [
|
|
204
|
+
{
|
|
205
|
+
type: 'text',
|
|
206
|
+
text,
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else if (message.role === 'assistant') {
|
|
214
|
+
// Convert assistant messages to AI messages
|
|
215
|
+
const blocks = [];
|
|
216
|
+
if (typeof message.content === 'string') {
|
|
217
|
+
if (message.content) {
|
|
218
|
+
blocks.push({
|
|
219
|
+
type: 'text',
|
|
220
|
+
text: message.content,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
else if (Array.isArray(message.content)) {
|
|
225
|
+
for (const part of message.content) {
|
|
226
|
+
const partType = part.type;
|
|
227
|
+
if (typeof part === 'string') {
|
|
228
|
+
if (part) {
|
|
229
|
+
blocks.push({
|
|
230
|
+
type: 'text',
|
|
231
|
+
text: part,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
else if (partType === 'text') {
|
|
236
|
+
const text = part.text;
|
|
237
|
+
if (text) {
|
|
238
|
+
blocks.push({
|
|
239
|
+
type: 'text',
|
|
240
|
+
text,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
else if (partType === 'image') {
|
|
245
|
+
const imageData = part.image ??
|
|
246
|
+
part.url;
|
|
247
|
+
if (imageData) {
|
|
248
|
+
const { encoding, mimeType } = inferMediaEncoding(imageData);
|
|
249
|
+
blocks.push({
|
|
250
|
+
type: 'media',
|
|
251
|
+
data: imageData,
|
|
252
|
+
encoding,
|
|
253
|
+
mimeType,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
else if (partType === 'tool-call') {
|
|
258
|
+
const toolPart = part;
|
|
259
|
+
const parameters = toolPart.input !== undefined ? toolPart.input : toolPart.args;
|
|
260
|
+
const toolCallBlock = {
|
|
261
|
+
type: 'tool_call',
|
|
262
|
+
id: normalizeToHistoryToolId(toolPart.toolCallId),
|
|
263
|
+
name: toolPart.toolName,
|
|
264
|
+
parameters,
|
|
265
|
+
};
|
|
266
|
+
if (toolPart.input !== undefined) {
|
|
267
|
+
toolCallBlock.input = toolPart.input;
|
|
268
|
+
}
|
|
269
|
+
blocks.push(toolCallBlock);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// Handle toolInvocations if present (extended message format)
|
|
274
|
+
const extendedMessage = message;
|
|
275
|
+
if (extendedMessage.toolInvocations &&
|
|
276
|
+
extendedMessage.toolInvocations.length > 0) {
|
|
277
|
+
for (const invocation of extendedMessage.toolInvocations) {
|
|
278
|
+
if (invocation.state === 'call') {
|
|
279
|
+
blocks.push({
|
|
280
|
+
type: 'tool_call',
|
|
281
|
+
id: normalizeToHistoryToolId(invocation.toolCallId),
|
|
282
|
+
name: invocation.toolName,
|
|
283
|
+
parameters: invocation.args,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (blocks.length > 0) {
|
|
289
|
+
contents.push({
|
|
290
|
+
speaker: 'ai',
|
|
291
|
+
blocks,
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
else if (message.role === 'tool') {
|
|
296
|
+
// Convert tool messages to tool response messages
|
|
297
|
+
const blocks = [];
|
|
298
|
+
for (const part of message.content) {
|
|
299
|
+
if (part.type === 'tool-result') {
|
|
300
|
+
const output = part.output;
|
|
301
|
+
const isErrorOutput = output &&
|
|
302
|
+
typeof output === 'object' &&
|
|
303
|
+
'type' in output &&
|
|
304
|
+
typeof output.type === 'string' &&
|
|
305
|
+
output.type?.startsWith('error');
|
|
306
|
+
const resultValue = output &&
|
|
307
|
+
typeof output === 'object' &&
|
|
308
|
+
'value' in output
|
|
309
|
+
? output.value
|
|
310
|
+
: output;
|
|
311
|
+
let parsedResult = resultValue;
|
|
312
|
+
if (typeof resultValue === 'string') {
|
|
313
|
+
if (resultValue === EMPTY_TOOL_RESULT_PLACEHOLDER) {
|
|
314
|
+
parsedResult = undefined;
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
try {
|
|
318
|
+
parsedResult = JSON.parse(resultValue);
|
|
319
|
+
}
|
|
320
|
+
catch {
|
|
321
|
+
parsedResult = resultValue;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const toolResponseBlock = {
|
|
326
|
+
type: 'tool_response',
|
|
327
|
+
callId: normalizeToHistoryToolId(part.toolCallId),
|
|
328
|
+
toolName: part.toolName,
|
|
329
|
+
result: parsedResult,
|
|
330
|
+
};
|
|
331
|
+
if (isErrorOutput) {
|
|
332
|
+
toolResponseBlock.isError = true;
|
|
333
|
+
if (typeof resultValue === 'string') {
|
|
334
|
+
toolResponseBlock.error = resultValue;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
blocks.push(toolResponseBlock);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
if (blocks.length > 0) {
|
|
341
|
+
contents.push({
|
|
342
|
+
speaker: 'tool',
|
|
343
|
+
blocks,
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
else if (message.role === 'system') {
|
|
348
|
+
// Convert system messages
|
|
349
|
+
const systemContent = message.content;
|
|
350
|
+
const text = typeof systemContent === 'string'
|
|
351
|
+
? systemContent
|
|
352
|
+
: Array.isArray(systemContent)
|
|
353
|
+
? systemContent
|
|
354
|
+
.map((part) => {
|
|
355
|
+
if (typeof part === 'string')
|
|
356
|
+
return part;
|
|
357
|
+
if (part.type === 'text')
|
|
358
|
+
return part.text || '';
|
|
359
|
+
return '';
|
|
360
|
+
})
|
|
361
|
+
.join('\n')
|
|
362
|
+
: '';
|
|
363
|
+
if (text) {
|
|
364
|
+
const systemContentObj = {
|
|
365
|
+
speaker: 'ai',
|
|
366
|
+
blocks: [
|
|
367
|
+
{
|
|
368
|
+
type: 'text',
|
|
369
|
+
text,
|
|
370
|
+
},
|
|
371
|
+
],
|
|
372
|
+
metadata: {
|
|
373
|
+
role: 'system',
|
|
374
|
+
},
|
|
375
|
+
};
|
|
376
|
+
contents.push(systemContentObj);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return contents;
|
|
381
|
+
}
|
|
382
|
+
function normalizeImageData(media) {
|
|
383
|
+
if (media.data.startsWith('data:')) {
|
|
384
|
+
return media.data;
|
|
385
|
+
}
|
|
386
|
+
if (media.encoding === 'url') {
|
|
387
|
+
return media.data;
|
|
388
|
+
}
|
|
389
|
+
const prefix = media.mimeType
|
|
390
|
+
? `data:${media.mimeType};base64,`
|
|
391
|
+
: 'data:image/*;base64,';
|
|
392
|
+
return `${prefix}${media.data}`;
|
|
393
|
+
}
|
|
394
|
+
//# sourceMappingURL=messageConversion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageConversion.js","sourceRoot":"","sources":["../../../../src/providers/openai-vercel/messageConversion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAyBH,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,iCAAiC,CAAC;AAEzC,SAAS,kBAAkB,CAAC,SAAiB;IAI3C,MAAM,aAAa,GAAG,EAAE,QAAQ,EAAE,KAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAExE,IAAI,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC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,OAAO,CAAC,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC,IAAI,CAAC;IACpB,CAAC;IAED,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC,IAAI,CAAC;IACpB,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ;QAC3B,CAAC,CAAC,QAAQ,KAAK,CAAC,QAAQ,UAAU;QAClC,CAAC,CAAC,sBAAsB,CAAC;IAC3B,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 Vybestack LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Normalizes various tool ID formats to OpenAI format (call_xxx)
|
|
18
|
+
* - hist_tool_xxx → call_xxx
|
|
19
|
+
* - toolu_xxx → call_xxx
|
|
20
|
+
* - call_xxx → call_xxx (unchanged)
|
|
21
|
+
* - raw UUID → call_uuid
|
|
22
|
+
* - Sanitizes non-alphanumeric characters (except underscore)
|
|
23
|
+
* - If result is empty after sanitization, generates a fallback ID
|
|
24
|
+
*/
|
|
25
|
+
export declare function normalizeToOpenAIToolId(id: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Normalizes various tool ID formats to history format (hist_tool_xxx)
|
|
28
|
+
* - call_xxx → hist_tool_xxx
|
|
29
|
+
* - toolu_xxx → hist_tool_xxx
|
|
30
|
+
* - hist_tool_xxx → hist_tool_xxx (unchanged)
|
|
31
|
+
* - raw UUID → hist_tool_uuid
|
|
32
|
+
*/
|
|
33
|
+
export declare function normalizeToHistoryToolId(id: string): string;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 Vybestack LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @plan PLAN-20251127-OPENAIVERCEL.P04a
|
|
18
|
+
* @requirement REQ-OV-004
|
|
19
|
+
* @description Tool ID normalization utility functions
|
|
20
|
+
*/
|
|
21
|
+
import * as crypto from 'crypto';
|
|
22
|
+
/**
|
|
23
|
+
* Normalizes various tool ID formats to OpenAI format (call_xxx)
|
|
24
|
+
* - hist_tool_xxx → call_xxx
|
|
25
|
+
* - toolu_xxx → call_xxx
|
|
26
|
+
* - call_xxx → call_xxx (unchanged)
|
|
27
|
+
* - raw UUID → call_uuid
|
|
28
|
+
* - Sanitizes non-alphanumeric characters (except underscore)
|
|
29
|
+
* - If result is empty after sanitization, generates a fallback ID
|
|
30
|
+
*/
|
|
31
|
+
export function normalizeToOpenAIToolId(id) {
|
|
32
|
+
const sanitize = (value) => value.replace(/[^a-zA-Z0-9_]/g, '') ||
|
|
33
|
+
'call_' + crypto.randomUUID().replace(/-/g, '');
|
|
34
|
+
// If already in OpenAI format, sanitize and return
|
|
35
|
+
if (id.startsWith('call_')) {
|
|
36
|
+
const sanitized = sanitize(id);
|
|
37
|
+
// If only "call_" remains after sanitization, generate fallback
|
|
38
|
+
if (sanitized === 'call_') {
|
|
39
|
+
return 'call_' + crypto.randomUUID().replace(/-/g, '');
|
|
40
|
+
}
|
|
41
|
+
return sanitized;
|
|
42
|
+
}
|
|
43
|
+
// For history format, extract the UUID and add OpenAI prefix
|
|
44
|
+
if (id.startsWith('hist_tool_')) {
|
|
45
|
+
const uuid = id.substring('hist_tool_'.length);
|
|
46
|
+
const sanitizedUuid = uuid.replace(/[^a-zA-Z0-9_]/g, '');
|
|
47
|
+
// If nothing left after sanitization, generate fallback
|
|
48
|
+
if (!sanitizedUuid) {
|
|
49
|
+
return 'call_' + crypto.randomUUID().replace(/-/g, '');
|
|
50
|
+
}
|
|
51
|
+
return 'call_' + sanitizedUuid;
|
|
52
|
+
}
|
|
53
|
+
// For Anthropic format, extract the UUID and add OpenAI prefix
|
|
54
|
+
if (id.startsWith('toolu_')) {
|
|
55
|
+
const uuid = id.substring('toolu_'.length);
|
|
56
|
+
const sanitizedUuid = uuid.replace(/[^a-zA-Z0-9_]/g, '');
|
|
57
|
+
// If nothing left after sanitization, generate fallback
|
|
58
|
+
if (!sanitizedUuid) {
|
|
59
|
+
return 'call_' + crypto.randomUUID().replace(/-/g, '');
|
|
60
|
+
}
|
|
61
|
+
return 'call_' + sanitizedUuid;
|
|
62
|
+
}
|
|
63
|
+
// Unknown format - assume it's a raw UUID or identifier
|
|
64
|
+
const sanitizedId = id.replace(/[^a-zA-Z0-9_]/g, '');
|
|
65
|
+
// If nothing left after sanitization, generate fallback
|
|
66
|
+
if (!sanitizedId) {
|
|
67
|
+
return 'call_' + crypto.randomUUID().replace(/-/g, '');
|
|
68
|
+
}
|
|
69
|
+
return 'call_' + sanitizedId;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Normalizes various tool ID formats to history format (hist_tool_xxx)
|
|
73
|
+
* - call_xxx → hist_tool_xxx
|
|
74
|
+
* - toolu_xxx → hist_tool_xxx
|
|
75
|
+
* - hist_tool_xxx → hist_tool_xxx (unchanged)
|
|
76
|
+
* - raw UUID → hist_tool_uuid
|
|
77
|
+
*/
|
|
78
|
+
export function normalizeToHistoryToolId(id) {
|
|
79
|
+
// If already in history format, sanitize and return
|
|
80
|
+
if (id.startsWith('hist_tool_')) {
|
|
81
|
+
const uuid = id.substring('hist_tool_'.length);
|
|
82
|
+
const sanitizedUuid = uuid.replace(/[^a-zA-Z0-9_]/g, '');
|
|
83
|
+
// If nothing left after sanitization, generate fallback
|
|
84
|
+
if (!sanitizedUuid) {
|
|
85
|
+
return 'hist_tool_' + crypto.randomUUID().replace(/-/g, '');
|
|
86
|
+
}
|
|
87
|
+
return 'hist_tool_' + sanitizedUuid;
|
|
88
|
+
}
|
|
89
|
+
// For OpenAI format, extract the UUID and add history prefix
|
|
90
|
+
if (id.startsWith('call_')) {
|
|
91
|
+
const uuid = id.substring('call_'.length);
|
|
92
|
+
const sanitizedUuid = uuid.replace(/[^a-zA-Z0-9_]/g, '');
|
|
93
|
+
// If nothing left after sanitization, generate fallback
|
|
94
|
+
if (!sanitizedUuid) {
|
|
95
|
+
return 'hist_tool_' + crypto.randomUUID().replace(/-/g, '');
|
|
96
|
+
}
|
|
97
|
+
return 'hist_tool_' + sanitizedUuid;
|
|
98
|
+
}
|
|
99
|
+
// For Anthropic format, extract the UUID and add history prefix
|
|
100
|
+
if (id.startsWith('toolu_')) {
|
|
101
|
+
const uuid = id.substring('toolu_'.length);
|
|
102
|
+
const sanitizedUuid = uuid.replace(/[^a-zA-Z0-9_]/g, '');
|
|
103
|
+
// If nothing left after sanitization, generate fallback
|
|
104
|
+
if (!sanitizedUuid) {
|
|
105
|
+
return 'hist_tool_' + crypto.randomUUID().replace(/-/g, '');
|
|
106
|
+
}
|
|
107
|
+
return 'hist_tool_' + sanitizedUuid;
|
|
108
|
+
}
|
|
109
|
+
// Unknown format - assume it's a raw UUID or identifier
|
|
110
|
+
const sanitizedId = id.replace(/[^a-zA-Z0-9_]/g, '');
|
|
111
|
+
// If nothing left after sanitization, generate fallback
|
|
112
|
+
if (!sanitizedId) {
|
|
113
|
+
return 'hist_tool_' + crypto.randomUUID().replace(/-/g, '');
|
|
114
|
+
}
|
|
115
|
+
return 'hist_tool_' + sanitizedId;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=toolIdUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolIdUtils.js","sourceRoot":"","sources":["../../../../src/providers/openai-vercel/toolIdUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,EAAU;IAChD,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE,CACjC,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;QACnC,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAElD,mDAAmD;IACnD,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC/B,gEAAgE;QAChE,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;YAC1B,OAAO,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,6DAA6D;IAC7D,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,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AAa,CAAC;IACtC,CAAC;IAED,wDAAwD;IACxD,MAAM,WAAW,GAAG,EAAE,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;IACrD,wDAAwD;IACxD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,YAAY,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,YAAY,GAAG,WAAW,CAAC;AACpC,CAAC"}
|
|
@@ -8,6 +8,7 @@ import path from 'node:path';
|
|
|
8
8
|
import ignore from 'ignore';
|
|
9
9
|
import picomatch from 'picomatch';
|
|
10
10
|
const hasFileExtension = picomatch('**/*[*.]*');
|
|
11
|
+
const createIgnore = ignore;
|
|
11
12
|
export function loadIgnoreRules(options) {
|
|
12
13
|
const ignorer = new Ignore();
|
|
13
14
|
if (options.useGitignore) {
|
|
@@ -33,8 +34,8 @@ export function loadIgnoreRules(options) {
|
|
|
33
34
|
}
|
|
34
35
|
export class Ignore {
|
|
35
36
|
allPatterns = [];
|
|
36
|
-
dirIgnorer =
|
|
37
|
-
fileIgnorer =
|
|
37
|
+
dirIgnorer = createIgnore();
|
|
38
|
+
fileIgnorer = createIgnore();
|
|
38
39
|
/**
|
|
39
40
|
* Adds one or more ignore patterns.
|
|
40
41
|
* @param patterns A single pattern string or an array of pattern strings.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../../../src/utils/filesearch/ignore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../../../src/utils/filesearch/ignore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IA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H,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,kBAAkB;QAChB,OAAO,CAAC,OAAe,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;;OAIG;IACH,aAAa;QACX,OAAO,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED;;;;;OAKG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -7,9 +7,10 @@ import * as fs from 'fs';
|
|
|
7
7
|
import * as path from 'path';
|
|
8
8
|
import ignore from 'ignore';
|
|
9
9
|
import { isGitRepository } from './gitUtils.js';
|
|
10
|
+
const createIgnore = ignore;
|
|
10
11
|
export class GitIgnoreParser {
|
|
11
12
|
projectRoot;
|
|
12
|
-
ig =
|
|
13
|
+
ig = createIgnore();
|
|
13
14
|
patterns = [];
|
|
14
15
|
constructor(projectRoot) {
|
|
15
16
|
this.projectRoot = path.resolve(projectRoot);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitIgnoreParser.js","sourceRoot":"","sources":["../../../src/utils/gitIgnoreParser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"gitIgnoreParser.js","sourceRoot":"","sources":["../../../src/utils/gitIgnoreParser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,MAGN,MAAM,QAAQ,CAAC;AAChB,O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