@getpochi/cli 0.5.57 → 0.5.58
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/cli.js +520 -506
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -65198,11 +65198,11 @@ var init_common3 = __esm(() => {
|
|
|
65198
65198
|
});
|
|
65199
65199
|
|
|
65200
65200
|
// ../../node_modules/@livestore/utils/dist/effect/WebChannel/broadcastChannelWithAck.js
|
|
65201
|
-
var ConnectMessage, ConnectAckMessage, DisconnectMessage, PayloadMessage, Message, broadcastChannelWithAck = ({ channelName, schema:
|
|
65201
|
+
var ConnectMessage, ConnectAckMessage, DisconnectMessage, PayloadMessage, Message, broadcastChannelWithAck = ({ channelName, schema: inputSchema2 }) => scopeWithCloseable((scope5) => gen4(function* () {
|
|
65202
65202
|
const channel = new BroadcastChannel(channelName);
|
|
65203
65203
|
const messageQueue = yield* exports_Queue.unbounded();
|
|
65204
65204
|
const connectionId = crypto.randomUUID();
|
|
65205
|
-
const schema4 = mapSchema(
|
|
65205
|
+
const schema4 = mapSchema(inputSchema2);
|
|
65206
65206
|
const peerIdRef = { current: undefined };
|
|
65207
65207
|
const connectedLatch = yield* makeLatch2(false);
|
|
65208
65208
|
const supportsTransferables = false;
|
|
@@ -65299,8 +65299,8 @@ var shutdown8 = (webChannel) => exports_Deferred.done(webChannel.closedDeferred,
|
|
|
65299
65299
|
},
|
|
65300
65300
|
supportsTransferables: false
|
|
65301
65301
|
};
|
|
65302
|
-
}).pipe(withSpan3(`WebChannel:noopChannel`))), broadcastChannel = ({ channelName, schema:
|
|
65303
|
-
const schema4 = mapSchema(
|
|
65302
|
+
}).pipe(withSpan3(`WebChannel:noopChannel`))), broadcastChannel = ({ channelName, schema: inputSchema2 }) => scopeWithCloseable((scope5) => gen4(function* () {
|
|
65303
|
+
const schema4 = mapSchema(inputSchema2);
|
|
65304
65304
|
const channel = new BroadcastChannel(channelName);
|
|
65305
65305
|
yield* addFinalizer3(() => try_3(() => channel.close()).pipe(ignoreLogged2));
|
|
65306
65306
|
const send = (message) => gen4(function* () {
|
|
@@ -65319,8 +65319,8 @@ var shutdown8 = (webChannel) => exports_Deferred.done(webChannel.closedDeferred,
|
|
|
65319
65319
|
schema: schema4,
|
|
65320
65320
|
supportsTransferables
|
|
65321
65321
|
};
|
|
65322
|
-
}).pipe(withSpan3(`WebChannel:broadcastChannel(${channelName})`))), windowChannel = ({ listenWindow, sendWindow, targetOrigin = "*", ids: ids3, schema:
|
|
65323
|
-
const schema4 = mapSchema(
|
|
65322
|
+
}).pipe(withSpan3(`WebChannel:broadcastChannel(${channelName})`))), windowChannel = ({ listenWindow, sendWindow, targetOrigin = "*", ids: ids3, schema: inputSchema2 }) => scopeWithCloseable((scope5) => gen4(function* () {
|
|
65323
|
+
const schema4 = mapSchema(inputSchema2);
|
|
65324
65324
|
const debugInfo = {
|
|
65325
65325
|
sendTotal: 0,
|
|
65326
65326
|
listenTotal: 0,
|
|
@@ -65362,8 +65362,8 @@ var shutdown8 = (webChannel) => exports_Deferred.done(webChannel.closedDeferred,
|
|
|
65362
65362
|
supportsTransferables,
|
|
65363
65363
|
debugInfo
|
|
65364
65364
|
};
|
|
65365
|
-
}).pipe(withSpan3(`WebChannel:windowChannel`))), messagePortChannel = ({ port: port2, schema:
|
|
65366
|
-
const schema4 = mapSchema(
|
|
65365
|
+
}).pipe(withSpan3(`WebChannel:windowChannel`))), messagePortChannel = ({ port: port2, schema: inputSchema2, debugId }) => scopeWithCloseable((scope5) => gen4(function* () {
|
|
65366
|
+
const schema4 = mapSchema(inputSchema2);
|
|
65367
65367
|
const label = debugId === undefined ? "messagePort" : `messagePort:${debugId}`;
|
|
65368
65368
|
const send = (message) => gen4(function* () {
|
|
65369
65369
|
const [messageEncoded, transferables] = yield* encodeWithTransferables(schema4.send)(message);
|
|
@@ -65383,13 +65383,13 @@ var shutdown8 = (webChannel) => exports_Deferred.done(webChannel.closedDeferred,
|
|
|
65383
65383
|
schema: schema4,
|
|
65384
65384
|
supportsTransferables
|
|
65385
65385
|
};
|
|
65386
|
-
}).pipe(withSpan3(`WebChannel:messagePortChannel`))), sameThreadChannels, sameThreadChannel = ({ schema:
|
|
65386
|
+
}).pipe(withSpan3(`WebChannel:messagePortChannel`))), sameThreadChannels, sameThreadChannel = ({ schema: inputSchema2, channelName }) => scopeWithCloseable((scope5) => gen4(function* () {
|
|
65387
65387
|
let pubSub = sameThreadChannels.get(channelName);
|
|
65388
65388
|
if (pubSub === undefined) {
|
|
65389
65389
|
pubSub = yield* exports_PubSub.unbounded().pipe(acquireRelease2(exports_PubSub.shutdown));
|
|
65390
65390
|
sameThreadChannels.set(channelName, pubSub);
|
|
65391
65391
|
}
|
|
65392
|
-
const schema4 = mapSchema(
|
|
65392
|
+
const schema4 = mapSchema(inputSchema2);
|
|
65393
65393
|
const send = (message) => gen4(function* () {
|
|
65394
65394
|
yield* exports_PubSub.publish(pubSub, message);
|
|
65395
65395
|
});
|
|
@@ -65404,8 +65404,8 @@ var shutdown8 = (webChannel) => exports_Deferred.done(webChannel.closedDeferred,
|
|
|
65404
65404
|
schema: schema4,
|
|
65405
65405
|
supportsTransferables: false
|
|
65406
65406
|
};
|
|
65407
|
-
})), messagePortChannelWithAck = ({ port: port2, schema:
|
|
65408
|
-
const schema4 = mapSchema(
|
|
65407
|
+
})), messagePortChannelWithAck = ({ port: port2, schema: inputSchema2, debugId }) => scopeWithCloseable((scope5) => gen4(function* () {
|
|
65408
|
+
const schema4 = mapSchema(inputSchema2);
|
|
65409
65409
|
const label = debugId === undefined ? "messagePort" : `messagePort:${debugId}`;
|
|
65410
65410
|
const requestAckMap = new Map;
|
|
65411
65411
|
const ChannelRequest = TaggedStruct("ChannelRequest", {
|
|
@@ -65464,14 +65464,14 @@ var shutdown8 = (webChannel) => exports_Deferred.done(webChannel.closedDeferred,
|
|
|
65464
65464
|
supportsTransferables,
|
|
65465
65465
|
debugInfo
|
|
65466
65466
|
};
|
|
65467
|
-
}).pipe(withSpan3(`WebChannel:messagePortChannelWithAck`))), queueChannelProxy = ({ schema:
|
|
65467
|
+
}).pipe(withSpan3(`WebChannel:messagePortChannelWithAck`))), queueChannelProxy = ({ schema: inputSchema2 }) => scopeWithCloseable((scope5) => gen4(function* () {
|
|
65468
65468
|
const sendQueue = yield* exports_Queue.unbounded().pipe(acquireRelease2(exports_Queue.shutdown));
|
|
65469
65469
|
const listenQueue = yield* exports_Queue.unbounded().pipe(acquireRelease2(exports_Queue.shutdown));
|
|
65470
65470
|
const send = (message) => exports_Queue.offer(sendQueue, message);
|
|
65471
65471
|
const listen = fromQueue3(listenQueue).pipe(map33(exports_Either.right), listenToDebugPing("queueChannel"));
|
|
65472
65472
|
const closedDeferred = yield* exports_Deferred.make().pipe(acquireRelease2(exports_Deferred.done(exports_Exit.void)));
|
|
65473
65473
|
const supportsTransferables = true;
|
|
65474
|
-
const schema4 = mapSchema(
|
|
65474
|
+
const schema4 = mapSchema(inputSchema2);
|
|
65475
65475
|
const webChannel = {
|
|
65476
65476
|
[WebChannelSymbol]: WebChannelSymbol,
|
|
65477
65477
|
send,
|
|
@@ -78671,19 +78671,19 @@ var init_system_tables = __esm(() => {
|
|
|
78671
78671
|
});
|
|
78672
78672
|
|
|
78673
78673
|
// ../../node_modules/@livestore/common/dist/schema/schema.js
|
|
78674
|
-
var LiveStoreSchemaSymbol, makeSchema = (
|
|
78675
|
-
const state =
|
|
78676
|
-
const tables =
|
|
78674
|
+
var LiveStoreSchemaSymbol, makeSchema = (inputSchema2) => {
|
|
78675
|
+
const state = inputSchema2.state;
|
|
78676
|
+
const tables = inputSchema2.state.sqlite.tables;
|
|
78677
78677
|
for (const tableDef of stateSystemTables) {
|
|
78678
78678
|
tables.set(tableDef.sqliteDef.name, tableDef);
|
|
78679
78679
|
}
|
|
78680
78680
|
const eventsDefsMap = new Map;
|
|
78681
|
-
if (isReadonlyArray(
|
|
78682
|
-
for (const eventDef of
|
|
78681
|
+
if (isReadonlyArray(inputSchema2.events)) {
|
|
78682
|
+
for (const eventDef of inputSchema2.events) {
|
|
78683
78683
|
eventsDefsMap.set(eventDef.name, eventDef);
|
|
78684
78684
|
}
|
|
78685
78685
|
} else {
|
|
78686
|
-
for (const eventDef of Object.values(
|
|
78686
|
+
for (const eventDef of Object.values(inputSchema2.events ?? {})) {
|
|
78687
78687
|
if (eventsDefsMap.has(eventDef.name)) {
|
|
78688
78688
|
shouldNeverHappen(`Duplicate event name: ${eventDef.name}. Please use unique names for events.`);
|
|
78689
78689
|
}
|
|
@@ -78702,7 +78702,7 @@ var LiveStoreSchemaSymbol, makeSchema = (inputSchema) => {
|
|
|
78702
78702
|
state,
|
|
78703
78703
|
eventsDefsMap,
|
|
78704
78704
|
devtools: {
|
|
78705
|
-
alias:
|
|
78705
|
+
alias: inputSchema2.devtools?.alias ?? "default"
|
|
78706
78706
|
}
|
|
78707
78707
|
};
|
|
78708
78708
|
}, getEventDef = (schema4, eventName) => {
|
|
@@ -78793,8 +78793,8 @@ __export(exports_mod3, {
|
|
|
78793
78793
|
ClientDocumentTableDefSymbol: () => ClientDocumentTableDefSymbol,
|
|
78794
78794
|
AutoIncrement: () => AutoIncrement
|
|
78795
78795
|
});
|
|
78796
|
-
var makeState2 = (
|
|
78797
|
-
const inputTables = Array.isArray(
|
|
78796
|
+
var makeState2 = (inputSchema2) => {
|
|
78797
|
+
const inputTables = Array.isArray(inputSchema2.tables) ? inputSchema2.tables : Object.values(inputSchema2.tables);
|
|
78798
78798
|
const tables = new Map;
|
|
78799
78799
|
for (const tableDef of inputTables) {
|
|
78800
78800
|
const sqliteDef = tableDef.sqliteDef;
|
|
@@ -78807,7 +78807,7 @@ var makeState2 = (inputSchema) => {
|
|
|
78807
78807
|
tables.set(tableDef.sqliteDef.name, tableDef);
|
|
78808
78808
|
}
|
|
78809
78809
|
const materializers2 = new Map;
|
|
78810
|
-
for (const [name17, materializer] of Object.entries(
|
|
78810
|
+
for (const [name17, materializer] of Object.entries(inputSchema2.materializers)) {
|
|
78811
78811
|
materializers2.set(name17, materializer);
|
|
78812
78812
|
}
|
|
78813
78813
|
for (const tableDef of inputTables) {
|
|
@@ -78819,7 +78819,7 @@ var makeState2 = (inputSchema) => {
|
|
|
78819
78819
|
_tag: "dbSchema",
|
|
78820
78820
|
tables: [...tables.values()].map((_2) => _2.sqliteDef.ast)
|
|
78821
78821
|
});
|
|
78822
|
-
return { sqlite: { tables, migrations:
|
|
78822
|
+
return { sqlite: { tables, migrations: inputSchema2.migrations ?? { strategy: "auto" }, hash: hash4 }, materializers: materializers2 };
|
|
78823
78823
|
};
|
|
78824
78824
|
var init_mod6 = __esm(() => {
|
|
78825
78825
|
init_mod();
|
|
@@ -80509,12 +80509,12 @@ var makeMeshNode = (nodeName) => exports_Effect2.gen(function* () {
|
|
|
80509
80509
|
const makeChannel3 = ({
|
|
80510
80510
|
target: target2,
|
|
80511
80511
|
channelName,
|
|
80512
|
-
schema:
|
|
80512
|
+
schema: inputSchema2,
|
|
80513
80513
|
mode,
|
|
80514
80514
|
timeout: timeout5 = exports_Duration.seconds(1),
|
|
80515
80515
|
closeExisting = false
|
|
80516
80516
|
}) => exports_Effect2.gen(function* () {
|
|
80517
|
-
const schema5 = exports_mod.mapSchema(
|
|
80517
|
+
const schema5 = exports_mod.mapSchema(inputSchema2);
|
|
80518
80518
|
const channelKey = `target:${target2}, channelName:${channelName}`;
|
|
80519
80519
|
if (channelMap.has(channelKey)) {
|
|
80520
80520
|
const existingChannel = channelMap.get(channelKey).debugInfo?.channel;
|
|
@@ -339147,6 +339147,400 @@ var McpTool = exports_external.object({
|
|
|
339147
339147
|
jsonSchema: exports_external.custom().describe("Validated json schema.")
|
|
339148
339148
|
}).required().describe("The parameters of the MCP tool.")
|
|
339149
339149
|
});
|
|
339150
|
+
// ../../node_modules/@ai-sdk/provider/dist/index.mjs
|
|
339151
|
+
var marker = "vercel.ai.error";
|
|
339152
|
+
var symbol2 = Symbol.for(marker);
|
|
339153
|
+
var _a;
|
|
339154
|
+
var _AISDKError = class _AISDKError2 extends Error {
|
|
339155
|
+
constructor({
|
|
339156
|
+
name: name14,
|
|
339157
|
+
message,
|
|
339158
|
+
cause
|
|
339159
|
+
}) {
|
|
339160
|
+
super(message);
|
|
339161
|
+
this[_a] = true;
|
|
339162
|
+
this.name = name14;
|
|
339163
|
+
this.cause = cause;
|
|
339164
|
+
}
|
|
339165
|
+
static isInstance(error40) {
|
|
339166
|
+
return _AISDKError2.hasMarker(error40, marker);
|
|
339167
|
+
}
|
|
339168
|
+
static hasMarker(error40, marker15) {
|
|
339169
|
+
const markerSymbol = Symbol.for(marker15);
|
|
339170
|
+
return error40 != null && typeof error40 === "object" && markerSymbol in error40 && typeof error40[markerSymbol] === "boolean" && error40[markerSymbol] === true;
|
|
339171
|
+
}
|
|
339172
|
+
};
|
|
339173
|
+
_a = symbol2;
|
|
339174
|
+
var AISDKError = _AISDKError;
|
|
339175
|
+
var name = "AI_APICallError";
|
|
339176
|
+
var marker2 = `vercel.ai.error.${name}`;
|
|
339177
|
+
var symbol22 = Symbol.for(marker2);
|
|
339178
|
+
var _a2;
|
|
339179
|
+
var APICallError = class extends AISDKError {
|
|
339180
|
+
constructor({
|
|
339181
|
+
message,
|
|
339182
|
+
url: url2,
|
|
339183
|
+
requestBodyValues,
|
|
339184
|
+
statusCode,
|
|
339185
|
+
responseHeaders,
|
|
339186
|
+
responseBody,
|
|
339187
|
+
cause,
|
|
339188
|
+
isRetryable = statusCode != null && (statusCode === 408 || statusCode === 409 || statusCode === 429 || statusCode >= 500),
|
|
339189
|
+
data
|
|
339190
|
+
}) {
|
|
339191
|
+
super({ name, message, cause });
|
|
339192
|
+
this[_a2] = true;
|
|
339193
|
+
this.url = url2;
|
|
339194
|
+
this.requestBodyValues = requestBodyValues;
|
|
339195
|
+
this.statusCode = statusCode;
|
|
339196
|
+
this.responseHeaders = responseHeaders;
|
|
339197
|
+
this.responseBody = responseBody;
|
|
339198
|
+
this.isRetryable = isRetryable;
|
|
339199
|
+
this.data = data;
|
|
339200
|
+
}
|
|
339201
|
+
static isInstance(error40) {
|
|
339202
|
+
return AISDKError.hasMarker(error40, marker2);
|
|
339203
|
+
}
|
|
339204
|
+
};
|
|
339205
|
+
_a2 = symbol22;
|
|
339206
|
+
var name2 = "AI_EmptyResponseBodyError";
|
|
339207
|
+
var marker3 = `vercel.ai.error.${name2}`;
|
|
339208
|
+
var symbol3 = Symbol.for(marker3);
|
|
339209
|
+
var _a3;
|
|
339210
|
+
var EmptyResponseBodyError = class extends AISDKError {
|
|
339211
|
+
constructor({ message = "Empty response body" } = {}) {
|
|
339212
|
+
super({ name: name2, message });
|
|
339213
|
+
this[_a3] = true;
|
|
339214
|
+
}
|
|
339215
|
+
static isInstance(error40) {
|
|
339216
|
+
return AISDKError.hasMarker(error40, marker3);
|
|
339217
|
+
}
|
|
339218
|
+
};
|
|
339219
|
+
_a3 = symbol3;
|
|
339220
|
+
function getErrorMessage(error40) {
|
|
339221
|
+
if (error40 == null) {
|
|
339222
|
+
return "unknown error";
|
|
339223
|
+
}
|
|
339224
|
+
if (typeof error40 === "string") {
|
|
339225
|
+
return error40;
|
|
339226
|
+
}
|
|
339227
|
+
if (error40 instanceof Error) {
|
|
339228
|
+
return error40.message;
|
|
339229
|
+
}
|
|
339230
|
+
return JSON.stringify(error40);
|
|
339231
|
+
}
|
|
339232
|
+
var name3 = "AI_InvalidArgumentError";
|
|
339233
|
+
var marker4 = `vercel.ai.error.${name3}`;
|
|
339234
|
+
var symbol4 = Symbol.for(marker4);
|
|
339235
|
+
var _a4;
|
|
339236
|
+
var InvalidArgumentError = class extends AISDKError {
|
|
339237
|
+
constructor({
|
|
339238
|
+
message,
|
|
339239
|
+
cause,
|
|
339240
|
+
argument
|
|
339241
|
+
}) {
|
|
339242
|
+
super({ name: name3, message, cause });
|
|
339243
|
+
this[_a4] = true;
|
|
339244
|
+
this.argument = argument;
|
|
339245
|
+
}
|
|
339246
|
+
static isInstance(error40) {
|
|
339247
|
+
return AISDKError.hasMarker(error40, marker4);
|
|
339248
|
+
}
|
|
339249
|
+
};
|
|
339250
|
+
_a4 = symbol4;
|
|
339251
|
+
var name4 = "AI_InvalidPromptError";
|
|
339252
|
+
var marker5 = `vercel.ai.error.${name4}`;
|
|
339253
|
+
var symbol5 = Symbol.for(marker5);
|
|
339254
|
+
var _a5;
|
|
339255
|
+
var InvalidPromptError = class extends AISDKError {
|
|
339256
|
+
constructor({
|
|
339257
|
+
prompt,
|
|
339258
|
+
message,
|
|
339259
|
+
cause
|
|
339260
|
+
}) {
|
|
339261
|
+
super({ name: name4, message: `Invalid prompt: ${message}`, cause });
|
|
339262
|
+
this[_a5] = true;
|
|
339263
|
+
this.prompt = prompt;
|
|
339264
|
+
}
|
|
339265
|
+
static isInstance(error40) {
|
|
339266
|
+
return AISDKError.hasMarker(error40, marker5);
|
|
339267
|
+
}
|
|
339268
|
+
};
|
|
339269
|
+
_a5 = symbol5;
|
|
339270
|
+
var name5 = "AI_InvalidResponseDataError";
|
|
339271
|
+
var marker6 = `vercel.ai.error.${name5}`;
|
|
339272
|
+
var symbol6 = Symbol.for(marker6);
|
|
339273
|
+
var _a6;
|
|
339274
|
+
var InvalidResponseDataError = class extends AISDKError {
|
|
339275
|
+
constructor({
|
|
339276
|
+
data,
|
|
339277
|
+
message = `Invalid response data: ${JSON.stringify(data)}.`
|
|
339278
|
+
}) {
|
|
339279
|
+
super({ name: name5, message });
|
|
339280
|
+
this[_a6] = true;
|
|
339281
|
+
this.data = data;
|
|
339282
|
+
}
|
|
339283
|
+
static isInstance(error40) {
|
|
339284
|
+
return AISDKError.hasMarker(error40, marker6);
|
|
339285
|
+
}
|
|
339286
|
+
};
|
|
339287
|
+
_a6 = symbol6;
|
|
339288
|
+
var name6 = "AI_JSONParseError";
|
|
339289
|
+
var marker7 = `vercel.ai.error.${name6}`;
|
|
339290
|
+
var symbol7 = Symbol.for(marker7);
|
|
339291
|
+
var _a7;
|
|
339292
|
+
var JSONParseError = class extends AISDKError {
|
|
339293
|
+
constructor({ text, cause }) {
|
|
339294
|
+
super({
|
|
339295
|
+
name: name6,
|
|
339296
|
+
message: `JSON parsing failed: Text: ${text}.
|
|
339297
|
+
Error message: ${getErrorMessage(cause)}`,
|
|
339298
|
+
cause
|
|
339299
|
+
});
|
|
339300
|
+
this[_a7] = true;
|
|
339301
|
+
this.text = text;
|
|
339302
|
+
}
|
|
339303
|
+
static isInstance(error40) {
|
|
339304
|
+
return AISDKError.hasMarker(error40, marker7);
|
|
339305
|
+
}
|
|
339306
|
+
};
|
|
339307
|
+
_a7 = symbol7;
|
|
339308
|
+
var name7 = "AI_LoadAPIKeyError";
|
|
339309
|
+
var marker8 = `vercel.ai.error.${name7}`;
|
|
339310
|
+
var symbol8 = Symbol.for(marker8);
|
|
339311
|
+
var _a8;
|
|
339312
|
+
var LoadAPIKeyError = class extends AISDKError {
|
|
339313
|
+
constructor({ message }) {
|
|
339314
|
+
super({ name: name7, message });
|
|
339315
|
+
this[_a8] = true;
|
|
339316
|
+
}
|
|
339317
|
+
static isInstance(error40) {
|
|
339318
|
+
return AISDKError.hasMarker(error40, marker8);
|
|
339319
|
+
}
|
|
339320
|
+
};
|
|
339321
|
+
_a8 = symbol8;
|
|
339322
|
+
var name8 = "AI_LoadSettingError";
|
|
339323
|
+
var marker9 = `vercel.ai.error.${name8}`;
|
|
339324
|
+
var symbol9 = Symbol.for(marker9);
|
|
339325
|
+
var _a9;
|
|
339326
|
+
var LoadSettingError = class extends AISDKError {
|
|
339327
|
+
constructor({ message }) {
|
|
339328
|
+
super({ name: name8, message });
|
|
339329
|
+
this[_a9] = true;
|
|
339330
|
+
}
|
|
339331
|
+
static isInstance(error40) {
|
|
339332
|
+
return AISDKError.hasMarker(error40, marker9);
|
|
339333
|
+
}
|
|
339334
|
+
};
|
|
339335
|
+
_a9 = symbol9;
|
|
339336
|
+
var name9 = "AI_NoContentGeneratedError";
|
|
339337
|
+
var marker10 = `vercel.ai.error.${name9}`;
|
|
339338
|
+
var symbol10 = Symbol.for(marker10);
|
|
339339
|
+
var _a10;
|
|
339340
|
+
_a10 = symbol10;
|
|
339341
|
+
var name10 = "AI_NoSuchModelError";
|
|
339342
|
+
var marker11 = `vercel.ai.error.${name10}`;
|
|
339343
|
+
var symbol11 = Symbol.for(marker11);
|
|
339344
|
+
var _a11;
|
|
339345
|
+
var NoSuchModelError = class extends AISDKError {
|
|
339346
|
+
constructor({
|
|
339347
|
+
errorName = name10,
|
|
339348
|
+
modelId,
|
|
339349
|
+
modelType,
|
|
339350
|
+
message = `No such ${modelType}: ${modelId}`
|
|
339351
|
+
}) {
|
|
339352
|
+
super({ name: errorName, message });
|
|
339353
|
+
this[_a11] = true;
|
|
339354
|
+
this.modelId = modelId;
|
|
339355
|
+
this.modelType = modelType;
|
|
339356
|
+
}
|
|
339357
|
+
static isInstance(error40) {
|
|
339358
|
+
return AISDKError.hasMarker(error40, marker11);
|
|
339359
|
+
}
|
|
339360
|
+
};
|
|
339361
|
+
_a11 = symbol11;
|
|
339362
|
+
var name11 = "AI_TooManyEmbeddingValuesForCallError";
|
|
339363
|
+
var marker12 = `vercel.ai.error.${name11}`;
|
|
339364
|
+
var symbol12 = Symbol.for(marker12);
|
|
339365
|
+
var _a12;
|
|
339366
|
+
var TooManyEmbeddingValuesForCallError = class extends AISDKError {
|
|
339367
|
+
constructor(options) {
|
|
339368
|
+
super({
|
|
339369
|
+
name: name11,
|
|
339370
|
+
message: `Too many values for a single embedding call. The ${options.provider} model "${options.modelId}" can only embed up to ${options.maxEmbeddingsPerCall} values per call, but ${options.values.length} values were provided.`
|
|
339371
|
+
});
|
|
339372
|
+
this[_a12] = true;
|
|
339373
|
+
this.provider = options.provider;
|
|
339374
|
+
this.modelId = options.modelId;
|
|
339375
|
+
this.maxEmbeddingsPerCall = options.maxEmbeddingsPerCall;
|
|
339376
|
+
this.values = options.values;
|
|
339377
|
+
}
|
|
339378
|
+
static isInstance(error40) {
|
|
339379
|
+
return AISDKError.hasMarker(error40, marker12);
|
|
339380
|
+
}
|
|
339381
|
+
};
|
|
339382
|
+
_a12 = symbol12;
|
|
339383
|
+
var name12 = "AI_TypeValidationError";
|
|
339384
|
+
var marker13 = `vercel.ai.error.${name12}`;
|
|
339385
|
+
var symbol13 = Symbol.for(marker13);
|
|
339386
|
+
var _a13;
|
|
339387
|
+
var _TypeValidationError = class _TypeValidationError2 extends AISDKError {
|
|
339388
|
+
constructor({ value: value2, cause }) {
|
|
339389
|
+
super({
|
|
339390
|
+
name: name12,
|
|
339391
|
+
message: `Type validation failed: Value: ${JSON.stringify(value2)}.
|
|
339392
|
+
Error message: ${getErrorMessage(cause)}`,
|
|
339393
|
+
cause
|
|
339394
|
+
});
|
|
339395
|
+
this[_a13] = true;
|
|
339396
|
+
this.value = value2;
|
|
339397
|
+
}
|
|
339398
|
+
static isInstance(error40) {
|
|
339399
|
+
return AISDKError.hasMarker(error40, marker13);
|
|
339400
|
+
}
|
|
339401
|
+
static wrap({
|
|
339402
|
+
value: value2,
|
|
339403
|
+
cause
|
|
339404
|
+
}) {
|
|
339405
|
+
return _TypeValidationError2.isInstance(cause) && cause.value === value2 ? cause : new _TypeValidationError2({ value: value2, cause });
|
|
339406
|
+
}
|
|
339407
|
+
};
|
|
339408
|
+
_a13 = symbol13;
|
|
339409
|
+
var TypeValidationError = _TypeValidationError;
|
|
339410
|
+
var name13 = "AI_UnsupportedFunctionalityError";
|
|
339411
|
+
var marker14 = `vercel.ai.error.${name13}`;
|
|
339412
|
+
var symbol14 = Symbol.for(marker14);
|
|
339413
|
+
var _a14;
|
|
339414
|
+
var UnsupportedFunctionalityError = class extends AISDKError {
|
|
339415
|
+
constructor({
|
|
339416
|
+
functionality,
|
|
339417
|
+
message = `'${functionality}' functionality not supported.`
|
|
339418
|
+
}) {
|
|
339419
|
+
super({ name: name13, message });
|
|
339420
|
+
this[_a14] = true;
|
|
339421
|
+
this.functionality = functionality;
|
|
339422
|
+
}
|
|
339423
|
+
static isInstance(error40) {
|
|
339424
|
+
return AISDKError.hasMarker(error40, marker14);
|
|
339425
|
+
}
|
|
339426
|
+
};
|
|
339427
|
+
_a14 = symbol14;
|
|
339428
|
+
|
|
339429
|
+
// ../../node_modules/eventsource-parser/dist/index.js
|
|
339430
|
+
class ParseError extends Error {
|
|
339431
|
+
constructor(message, options) {
|
|
339432
|
+
super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
|
|
339433
|
+
}
|
|
339434
|
+
}
|
|
339435
|
+
function noop(_arg) {}
|
|
339436
|
+
function createParser(callbacks) {
|
|
339437
|
+
if (typeof callbacks == "function")
|
|
339438
|
+
throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
|
|
339439
|
+
const { onEvent = noop, onError = noop, onRetry = noop, onComment } = callbacks;
|
|
339440
|
+
let incompleteLine = "", isFirstChunk = true, id, data = "", eventType = "";
|
|
339441
|
+
function feed(newChunk) {
|
|
339442
|
+
const chunk = isFirstChunk ? newChunk.replace(/^\xEF\xBB\xBF/, "") : newChunk, [complete, incomplete] = splitLines(`${incompleteLine}${chunk}`);
|
|
339443
|
+
for (const line of complete)
|
|
339444
|
+
parseLine(line);
|
|
339445
|
+
incompleteLine = incomplete, isFirstChunk = false;
|
|
339446
|
+
}
|
|
339447
|
+
function parseLine(line) {
|
|
339448
|
+
if (line === "") {
|
|
339449
|
+
dispatchEvent();
|
|
339450
|
+
return;
|
|
339451
|
+
}
|
|
339452
|
+
if (line.startsWith(":")) {
|
|
339453
|
+
onComment && onComment(line.slice(line.startsWith(": ") ? 2 : 1));
|
|
339454
|
+
return;
|
|
339455
|
+
}
|
|
339456
|
+
const fieldSeparatorIndex = line.indexOf(":");
|
|
339457
|
+
if (fieldSeparatorIndex !== -1) {
|
|
339458
|
+
const field = line.slice(0, fieldSeparatorIndex), offset = line[fieldSeparatorIndex + 1] === " " ? 2 : 1, value2 = line.slice(fieldSeparatorIndex + offset);
|
|
339459
|
+
processField(field, value2, line);
|
|
339460
|
+
return;
|
|
339461
|
+
}
|
|
339462
|
+
processField(line, "", line);
|
|
339463
|
+
}
|
|
339464
|
+
function processField(field, value2, line) {
|
|
339465
|
+
switch (field) {
|
|
339466
|
+
case "event":
|
|
339467
|
+
eventType = value2;
|
|
339468
|
+
break;
|
|
339469
|
+
case "data":
|
|
339470
|
+
data = `${data}${value2}
|
|
339471
|
+
`;
|
|
339472
|
+
break;
|
|
339473
|
+
case "id":
|
|
339474
|
+
id = value2.includes("\x00") ? undefined : value2;
|
|
339475
|
+
break;
|
|
339476
|
+
case "retry":
|
|
339477
|
+
/^\d+$/.test(value2) ? onRetry(parseInt(value2, 10)) : onError(new ParseError(`Invalid \`retry\` value: "${value2}"`, {
|
|
339478
|
+
type: "invalid-retry",
|
|
339479
|
+
value: value2,
|
|
339480
|
+
line
|
|
339481
|
+
}));
|
|
339482
|
+
break;
|
|
339483
|
+
default:
|
|
339484
|
+
onError(new ParseError(`Unknown field "${field.length > 20 ? `${field.slice(0, 20)}…` : field}"`, { type: "unknown-field", field, value: value2, line }));
|
|
339485
|
+
break;
|
|
339486
|
+
}
|
|
339487
|
+
}
|
|
339488
|
+
function dispatchEvent() {
|
|
339489
|
+
data.length > 0 && onEvent({
|
|
339490
|
+
id,
|
|
339491
|
+
event: eventType || undefined,
|
|
339492
|
+
data: data.endsWith(`
|
|
339493
|
+
`) ? data.slice(0, -1) : data
|
|
339494
|
+
}), id = undefined, data = "", eventType = "";
|
|
339495
|
+
}
|
|
339496
|
+
function reset(options = {}) {
|
|
339497
|
+
incompleteLine && options.consume && parseLine(incompleteLine), isFirstChunk = true, id = undefined, data = "", eventType = "", incompleteLine = "";
|
|
339498
|
+
}
|
|
339499
|
+
return { feed, reset };
|
|
339500
|
+
}
|
|
339501
|
+
function splitLines(chunk) {
|
|
339502
|
+
const lines = [];
|
|
339503
|
+
let incompleteLine = "", searchIndex = 0;
|
|
339504
|
+
for (;searchIndex < chunk.length; ) {
|
|
339505
|
+
const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(`
|
|
339506
|
+
`, searchIndex);
|
|
339507
|
+
let lineEnd = -1;
|
|
339508
|
+
if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = Math.min(crIndex, lfIndex) : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1) {
|
|
339509
|
+
incompleteLine = chunk.slice(searchIndex);
|
|
339510
|
+
break;
|
|
339511
|
+
} else {
|
|
339512
|
+
const line = chunk.slice(searchIndex, lineEnd);
|
|
339513
|
+
lines.push(line), searchIndex = lineEnd + 1, chunk[searchIndex - 1] === "\r" && chunk[searchIndex] === `
|
|
339514
|
+
` && searchIndex++;
|
|
339515
|
+
}
|
|
339516
|
+
}
|
|
339517
|
+
return [lines, incompleteLine];
|
|
339518
|
+
}
|
|
339519
|
+
|
|
339520
|
+
// ../../node_modules/eventsource-parser/dist/stream.js
|
|
339521
|
+
class EventSourceParserStream extends TransformStream {
|
|
339522
|
+
constructor({ onError, onRetry, onComment } = {}) {
|
|
339523
|
+
let parser;
|
|
339524
|
+
super({
|
|
339525
|
+
start(controller) {
|
|
339526
|
+
parser = createParser({
|
|
339527
|
+
onEvent: (event) => {
|
|
339528
|
+
controller.enqueue(event);
|
|
339529
|
+
},
|
|
339530
|
+
onError(error40) {
|
|
339531
|
+
onError === "terminate" ? controller.error(error40) : typeof onError == "function" && onError(error40);
|
|
339532
|
+
},
|
|
339533
|
+
onRetry,
|
|
339534
|
+
onComment
|
|
339535
|
+
});
|
|
339536
|
+
},
|
|
339537
|
+
transform(chunk) {
|
|
339538
|
+
parser.feed(chunk);
|
|
339539
|
+
}
|
|
339540
|
+
});
|
|
339541
|
+
}
|
|
339542
|
+
}
|
|
339543
|
+
|
|
339150
339544
|
// ../../node_modules/zod/v3/external.js
|
|
339151
339545
|
var exports_external2 = {};
|
|
339152
339546
|
__export(exports_external2, {
|
|
@@ -343120,422 +343514,6 @@ var coerce = {
|
|
|
343120
343514
|
date: (arg) => ZodDate2.create({ ...arg, coerce: true })
|
|
343121
343515
|
};
|
|
343122
343516
|
var NEVER2 = INVALID;
|
|
343123
|
-
// ../../node_modules/zod/index.js
|
|
343124
|
-
var zod_default = exports_external2;
|
|
343125
|
-
|
|
343126
|
-
// ../tools/src/constants.ts
|
|
343127
|
-
var EditFileResultPrompt = `You may see the following fields in the result:
|
|
343128
|
-
- userEdits: If the user makes any edits, this field will contain a diff between your edit and their changes.
|
|
343129
|
-
- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.
|
|
343130
|
-
- newProblems: If any new problems are found after the edit, this field will contain information about them.
|
|
343131
|
-
`.trim();
|
|
343132
|
-
var EditFileOutputSchema = exports_external2.object({
|
|
343133
|
-
success: exports_external2.boolean().describe("Indicates whether the file was successfully written."),
|
|
343134
|
-
userEdits: exports_external2.string().describe("The user's edits to the file, only present if the file was edited by the user.").optional(),
|
|
343135
|
-
autoFormattingEdits: exports_external2.string().describe("The auto-formatting edits to the file, only present if the auto formatter made changes.").optional(),
|
|
343136
|
-
newProblems: exports_external2.string().optional().describe("The new problems found after writing the file, if any."),
|
|
343137
|
-
_meta: exports_external2.object({
|
|
343138
|
-
editSummary: exports_external2.object({
|
|
343139
|
-
added: exports_external2.number().describe("Number of lines added to the file."),
|
|
343140
|
-
removed: exports_external2.number().describe("Number of lines removed from the file.")
|
|
343141
|
-
}).optional().describe("A summary of the edits made to the file.")
|
|
343142
|
-
}).optional().describe("Metadata that would be removed before sending to the LLM (e.g. UI specific data).")
|
|
343143
|
-
});
|
|
343144
|
-
|
|
343145
|
-
// ../../node_modules/@ai-sdk/provider/dist/index.mjs
|
|
343146
|
-
var marker = "vercel.ai.error";
|
|
343147
|
-
var symbol2 = Symbol.for(marker);
|
|
343148
|
-
var _a;
|
|
343149
|
-
var _AISDKError = class _AISDKError2 extends Error {
|
|
343150
|
-
constructor({
|
|
343151
|
-
name: name14,
|
|
343152
|
-
message,
|
|
343153
|
-
cause
|
|
343154
|
-
}) {
|
|
343155
|
-
super(message);
|
|
343156
|
-
this[_a] = true;
|
|
343157
|
-
this.name = name14;
|
|
343158
|
-
this.cause = cause;
|
|
343159
|
-
}
|
|
343160
|
-
static isInstance(error40) {
|
|
343161
|
-
return _AISDKError2.hasMarker(error40, marker);
|
|
343162
|
-
}
|
|
343163
|
-
static hasMarker(error40, marker15) {
|
|
343164
|
-
const markerSymbol = Symbol.for(marker15);
|
|
343165
|
-
return error40 != null && typeof error40 === "object" && markerSymbol in error40 && typeof error40[markerSymbol] === "boolean" && error40[markerSymbol] === true;
|
|
343166
|
-
}
|
|
343167
|
-
};
|
|
343168
|
-
_a = symbol2;
|
|
343169
|
-
var AISDKError = _AISDKError;
|
|
343170
|
-
var name = "AI_APICallError";
|
|
343171
|
-
var marker2 = `vercel.ai.error.${name}`;
|
|
343172
|
-
var symbol22 = Symbol.for(marker2);
|
|
343173
|
-
var _a2;
|
|
343174
|
-
var APICallError = class extends AISDKError {
|
|
343175
|
-
constructor({
|
|
343176
|
-
message,
|
|
343177
|
-
url: url2,
|
|
343178
|
-
requestBodyValues,
|
|
343179
|
-
statusCode,
|
|
343180
|
-
responseHeaders,
|
|
343181
|
-
responseBody,
|
|
343182
|
-
cause,
|
|
343183
|
-
isRetryable = statusCode != null && (statusCode === 408 || statusCode === 409 || statusCode === 429 || statusCode >= 500),
|
|
343184
|
-
data
|
|
343185
|
-
}) {
|
|
343186
|
-
super({ name, message, cause });
|
|
343187
|
-
this[_a2] = true;
|
|
343188
|
-
this.url = url2;
|
|
343189
|
-
this.requestBodyValues = requestBodyValues;
|
|
343190
|
-
this.statusCode = statusCode;
|
|
343191
|
-
this.responseHeaders = responseHeaders;
|
|
343192
|
-
this.responseBody = responseBody;
|
|
343193
|
-
this.isRetryable = isRetryable;
|
|
343194
|
-
this.data = data;
|
|
343195
|
-
}
|
|
343196
|
-
static isInstance(error40) {
|
|
343197
|
-
return AISDKError.hasMarker(error40, marker2);
|
|
343198
|
-
}
|
|
343199
|
-
};
|
|
343200
|
-
_a2 = symbol22;
|
|
343201
|
-
var name2 = "AI_EmptyResponseBodyError";
|
|
343202
|
-
var marker3 = `vercel.ai.error.${name2}`;
|
|
343203
|
-
var symbol3 = Symbol.for(marker3);
|
|
343204
|
-
var _a3;
|
|
343205
|
-
var EmptyResponseBodyError = class extends AISDKError {
|
|
343206
|
-
constructor({ message = "Empty response body" } = {}) {
|
|
343207
|
-
super({ name: name2, message });
|
|
343208
|
-
this[_a3] = true;
|
|
343209
|
-
}
|
|
343210
|
-
static isInstance(error40) {
|
|
343211
|
-
return AISDKError.hasMarker(error40, marker3);
|
|
343212
|
-
}
|
|
343213
|
-
};
|
|
343214
|
-
_a3 = symbol3;
|
|
343215
|
-
function getErrorMessage(error40) {
|
|
343216
|
-
if (error40 == null) {
|
|
343217
|
-
return "unknown error";
|
|
343218
|
-
}
|
|
343219
|
-
if (typeof error40 === "string") {
|
|
343220
|
-
return error40;
|
|
343221
|
-
}
|
|
343222
|
-
if (error40 instanceof Error) {
|
|
343223
|
-
return error40.message;
|
|
343224
|
-
}
|
|
343225
|
-
return JSON.stringify(error40);
|
|
343226
|
-
}
|
|
343227
|
-
var name3 = "AI_InvalidArgumentError";
|
|
343228
|
-
var marker4 = `vercel.ai.error.${name3}`;
|
|
343229
|
-
var symbol4 = Symbol.for(marker4);
|
|
343230
|
-
var _a4;
|
|
343231
|
-
var InvalidArgumentError = class extends AISDKError {
|
|
343232
|
-
constructor({
|
|
343233
|
-
message,
|
|
343234
|
-
cause,
|
|
343235
|
-
argument
|
|
343236
|
-
}) {
|
|
343237
|
-
super({ name: name3, message, cause });
|
|
343238
|
-
this[_a4] = true;
|
|
343239
|
-
this.argument = argument;
|
|
343240
|
-
}
|
|
343241
|
-
static isInstance(error40) {
|
|
343242
|
-
return AISDKError.hasMarker(error40, marker4);
|
|
343243
|
-
}
|
|
343244
|
-
};
|
|
343245
|
-
_a4 = symbol4;
|
|
343246
|
-
var name4 = "AI_InvalidPromptError";
|
|
343247
|
-
var marker5 = `vercel.ai.error.${name4}`;
|
|
343248
|
-
var symbol5 = Symbol.for(marker5);
|
|
343249
|
-
var _a5;
|
|
343250
|
-
var InvalidPromptError = class extends AISDKError {
|
|
343251
|
-
constructor({
|
|
343252
|
-
prompt,
|
|
343253
|
-
message,
|
|
343254
|
-
cause
|
|
343255
|
-
}) {
|
|
343256
|
-
super({ name: name4, message: `Invalid prompt: ${message}`, cause });
|
|
343257
|
-
this[_a5] = true;
|
|
343258
|
-
this.prompt = prompt;
|
|
343259
|
-
}
|
|
343260
|
-
static isInstance(error40) {
|
|
343261
|
-
return AISDKError.hasMarker(error40, marker5);
|
|
343262
|
-
}
|
|
343263
|
-
};
|
|
343264
|
-
_a5 = symbol5;
|
|
343265
|
-
var name5 = "AI_InvalidResponseDataError";
|
|
343266
|
-
var marker6 = `vercel.ai.error.${name5}`;
|
|
343267
|
-
var symbol6 = Symbol.for(marker6);
|
|
343268
|
-
var _a6;
|
|
343269
|
-
var InvalidResponseDataError = class extends AISDKError {
|
|
343270
|
-
constructor({
|
|
343271
|
-
data,
|
|
343272
|
-
message = `Invalid response data: ${JSON.stringify(data)}.`
|
|
343273
|
-
}) {
|
|
343274
|
-
super({ name: name5, message });
|
|
343275
|
-
this[_a6] = true;
|
|
343276
|
-
this.data = data;
|
|
343277
|
-
}
|
|
343278
|
-
static isInstance(error40) {
|
|
343279
|
-
return AISDKError.hasMarker(error40, marker6);
|
|
343280
|
-
}
|
|
343281
|
-
};
|
|
343282
|
-
_a6 = symbol6;
|
|
343283
|
-
var name6 = "AI_JSONParseError";
|
|
343284
|
-
var marker7 = `vercel.ai.error.${name6}`;
|
|
343285
|
-
var symbol7 = Symbol.for(marker7);
|
|
343286
|
-
var _a7;
|
|
343287
|
-
var JSONParseError = class extends AISDKError {
|
|
343288
|
-
constructor({ text, cause }) {
|
|
343289
|
-
super({
|
|
343290
|
-
name: name6,
|
|
343291
|
-
message: `JSON parsing failed: Text: ${text}.
|
|
343292
|
-
Error message: ${getErrorMessage(cause)}`,
|
|
343293
|
-
cause
|
|
343294
|
-
});
|
|
343295
|
-
this[_a7] = true;
|
|
343296
|
-
this.text = text;
|
|
343297
|
-
}
|
|
343298
|
-
static isInstance(error40) {
|
|
343299
|
-
return AISDKError.hasMarker(error40, marker7);
|
|
343300
|
-
}
|
|
343301
|
-
};
|
|
343302
|
-
_a7 = symbol7;
|
|
343303
|
-
var name7 = "AI_LoadAPIKeyError";
|
|
343304
|
-
var marker8 = `vercel.ai.error.${name7}`;
|
|
343305
|
-
var symbol8 = Symbol.for(marker8);
|
|
343306
|
-
var _a8;
|
|
343307
|
-
var LoadAPIKeyError = class extends AISDKError {
|
|
343308
|
-
constructor({ message }) {
|
|
343309
|
-
super({ name: name7, message });
|
|
343310
|
-
this[_a8] = true;
|
|
343311
|
-
}
|
|
343312
|
-
static isInstance(error40) {
|
|
343313
|
-
return AISDKError.hasMarker(error40, marker8);
|
|
343314
|
-
}
|
|
343315
|
-
};
|
|
343316
|
-
_a8 = symbol8;
|
|
343317
|
-
var name8 = "AI_LoadSettingError";
|
|
343318
|
-
var marker9 = `vercel.ai.error.${name8}`;
|
|
343319
|
-
var symbol9 = Symbol.for(marker9);
|
|
343320
|
-
var _a9;
|
|
343321
|
-
var LoadSettingError = class extends AISDKError {
|
|
343322
|
-
constructor({ message }) {
|
|
343323
|
-
super({ name: name8, message });
|
|
343324
|
-
this[_a9] = true;
|
|
343325
|
-
}
|
|
343326
|
-
static isInstance(error40) {
|
|
343327
|
-
return AISDKError.hasMarker(error40, marker9);
|
|
343328
|
-
}
|
|
343329
|
-
};
|
|
343330
|
-
_a9 = symbol9;
|
|
343331
|
-
var name9 = "AI_NoContentGeneratedError";
|
|
343332
|
-
var marker10 = `vercel.ai.error.${name9}`;
|
|
343333
|
-
var symbol10 = Symbol.for(marker10);
|
|
343334
|
-
var _a10;
|
|
343335
|
-
_a10 = symbol10;
|
|
343336
|
-
var name10 = "AI_NoSuchModelError";
|
|
343337
|
-
var marker11 = `vercel.ai.error.${name10}`;
|
|
343338
|
-
var symbol11 = Symbol.for(marker11);
|
|
343339
|
-
var _a11;
|
|
343340
|
-
var NoSuchModelError = class extends AISDKError {
|
|
343341
|
-
constructor({
|
|
343342
|
-
errorName = name10,
|
|
343343
|
-
modelId,
|
|
343344
|
-
modelType,
|
|
343345
|
-
message = `No such ${modelType}: ${modelId}`
|
|
343346
|
-
}) {
|
|
343347
|
-
super({ name: errorName, message });
|
|
343348
|
-
this[_a11] = true;
|
|
343349
|
-
this.modelId = modelId;
|
|
343350
|
-
this.modelType = modelType;
|
|
343351
|
-
}
|
|
343352
|
-
static isInstance(error40) {
|
|
343353
|
-
return AISDKError.hasMarker(error40, marker11);
|
|
343354
|
-
}
|
|
343355
|
-
};
|
|
343356
|
-
_a11 = symbol11;
|
|
343357
|
-
var name11 = "AI_TooManyEmbeddingValuesForCallError";
|
|
343358
|
-
var marker12 = `vercel.ai.error.${name11}`;
|
|
343359
|
-
var symbol12 = Symbol.for(marker12);
|
|
343360
|
-
var _a12;
|
|
343361
|
-
var TooManyEmbeddingValuesForCallError = class extends AISDKError {
|
|
343362
|
-
constructor(options) {
|
|
343363
|
-
super({
|
|
343364
|
-
name: name11,
|
|
343365
|
-
message: `Too many values for a single embedding call. The ${options.provider} model "${options.modelId}" can only embed up to ${options.maxEmbeddingsPerCall} values per call, but ${options.values.length} values were provided.`
|
|
343366
|
-
});
|
|
343367
|
-
this[_a12] = true;
|
|
343368
|
-
this.provider = options.provider;
|
|
343369
|
-
this.modelId = options.modelId;
|
|
343370
|
-
this.maxEmbeddingsPerCall = options.maxEmbeddingsPerCall;
|
|
343371
|
-
this.values = options.values;
|
|
343372
|
-
}
|
|
343373
|
-
static isInstance(error40) {
|
|
343374
|
-
return AISDKError.hasMarker(error40, marker12);
|
|
343375
|
-
}
|
|
343376
|
-
};
|
|
343377
|
-
_a12 = symbol12;
|
|
343378
|
-
var name12 = "AI_TypeValidationError";
|
|
343379
|
-
var marker13 = `vercel.ai.error.${name12}`;
|
|
343380
|
-
var symbol13 = Symbol.for(marker13);
|
|
343381
|
-
var _a13;
|
|
343382
|
-
var _TypeValidationError = class _TypeValidationError2 extends AISDKError {
|
|
343383
|
-
constructor({ value: value2, cause }) {
|
|
343384
|
-
super({
|
|
343385
|
-
name: name12,
|
|
343386
|
-
message: `Type validation failed: Value: ${JSON.stringify(value2)}.
|
|
343387
|
-
Error message: ${getErrorMessage(cause)}`,
|
|
343388
|
-
cause
|
|
343389
|
-
});
|
|
343390
|
-
this[_a13] = true;
|
|
343391
|
-
this.value = value2;
|
|
343392
|
-
}
|
|
343393
|
-
static isInstance(error40) {
|
|
343394
|
-
return AISDKError.hasMarker(error40, marker13);
|
|
343395
|
-
}
|
|
343396
|
-
static wrap({
|
|
343397
|
-
value: value2,
|
|
343398
|
-
cause
|
|
343399
|
-
}) {
|
|
343400
|
-
return _TypeValidationError2.isInstance(cause) && cause.value === value2 ? cause : new _TypeValidationError2({ value: value2, cause });
|
|
343401
|
-
}
|
|
343402
|
-
};
|
|
343403
|
-
_a13 = symbol13;
|
|
343404
|
-
var TypeValidationError = _TypeValidationError;
|
|
343405
|
-
var name13 = "AI_UnsupportedFunctionalityError";
|
|
343406
|
-
var marker14 = `vercel.ai.error.${name13}`;
|
|
343407
|
-
var symbol14 = Symbol.for(marker14);
|
|
343408
|
-
var _a14;
|
|
343409
|
-
var UnsupportedFunctionalityError = class extends AISDKError {
|
|
343410
|
-
constructor({
|
|
343411
|
-
functionality,
|
|
343412
|
-
message = `'${functionality}' functionality not supported.`
|
|
343413
|
-
}) {
|
|
343414
|
-
super({ name: name13, message });
|
|
343415
|
-
this[_a14] = true;
|
|
343416
|
-
this.functionality = functionality;
|
|
343417
|
-
}
|
|
343418
|
-
static isInstance(error40) {
|
|
343419
|
-
return AISDKError.hasMarker(error40, marker14);
|
|
343420
|
-
}
|
|
343421
|
-
};
|
|
343422
|
-
_a14 = symbol14;
|
|
343423
|
-
|
|
343424
|
-
// ../../node_modules/eventsource-parser/dist/index.js
|
|
343425
|
-
class ParseError extends Error {
|
|
343426
|
-
constructor(message, options) {
|
|
343427
|
-
super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
|
|
343428
|
-
}
|
|
343429
|
-
}
|
|
343430
|
-
function noop(_arg) {}
|
|
343431
|
-
function createParser(callbacks) {
|
|
343432
|
-
if (typeof callbacks == "function")
|
|
343433
|
-
throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
|
|
343434
|
-
const { onEvent = noop, onError = noop, onRetry = noop, onComment } = callbacks;
|
|
343435
|
-
let incompleteLine = "", isFirstChunk = true, id, data = "", eventType = "";
|
|
343436
|
-
function feed(newChunk) {
|
|
343437
|
-
const chunk = isFirstChunk ? newChunk.replace(/^\xEF\xBB\xBF/, "") : newChunk, [complete, incomplete] = splitLines(`${incompleteLine}${chunk}`);
|
|
343438
|
-
for (const line of complete)
|
|
343439
|
-
parseLine(line);
|
|
343440
|
-
incompleteLine = incomplete, isFirstChunk = false;
|
|
343441
|
-
}
|
|
343442
|
-
function parseLine(line) {
|
|
343443
|
-
if (line === "") {
|
|
343444
|
-
dispatchEvent();
|
|
343445
|
-
return;
|
|
343446
|
-
}
|
|
343447
|
-
if (line.startsWith(":")) {
|
|
343448
|
-
onComment && onComment(line.slice(line.startsWith(": ") ? 2 : 1));
|
|
343449
|
-
return;
|
|
343450
|
-
}
|
|
343451
|
-
const fieldSeparatorIndex = line.indexOf(":");
|
|
343452
|
-
if (fieldSeparatorIndex !== -1) {
|
|
343453
|
-
const field = line.slice(0, fieldSeparatorIndex), offset = line[fieldSeparatorIndex + 1] === " " ? 2 : 1, value2 = line.slice(fieldSeparatorIndex + offset);
|
|
343454
|
-
processField(field, value2, line);
|
|
343455
|
-
return;
|
|
343456
|
-
}
|
|
343457
|
-
processField(line, "", line);
|
|
343458
|
-
}
|
|
343459
|
-
function processField(field, value2, line) {
|
|
343460
|
-
switch (field) {
|
|
343461
|
-
case "event":
|
|
343462
|
-
eventType = value2;
|
|
343463
|
-
break;
|
|
343464
|
-
case "data":
|
|
343465
|
-
data = `${data}${value2}
|
|
343466
|
-
`;
|
|
343467
|
-
break;
|
|
343468
|
-
case "id":
|
|
343469
|
-
id = value2.includes("\x00") ? undefined : value2;
|
|
343470
|
-
break;
|
|
343471
|
-
case "retry":
|
|
343472
|
-
/^\d+$/.test(value2) ? onRetry(parseInt(value2, 10)) : onError(new ParseError(`Invalid \`retry\` value: "${value2}"`, {
|
|
343473
|
-
type: "invalid-retry",
|
|
343474
|
-
value: value2,
|
|
343475
|
-
line
|
|
343476
|
-
}));
|
|
343477
|
-
break;
|
|
343478
|
-
default:
|
|
343479
|
-
onError(new ParseError(`Unknown field "${field.length > 20 ? `${field.slice(0, 20)}…` : field}"`, { type: "unknown-field", field, value: value2, line }));
|
|
343480
|
-
break;
|
|
343481
|
-
}
|
|
343482
|
-
}
|
|
343483
|
-
function dispatchEvent() {
|
|
343484
|
-
data.length > 0 && onEvent({
|
|
343485
|
-
id,
|
|
343486
|
-
event: eventType || undefined,
|
|
343487
|
-
data: data.endsWith(`
|
|
343488
|
-
`) ? data.slice(0, -1) : data
|
|
343489
|
-
}), id = undefined, data = "", eventType = "";
|
|
343490
|
-
}
|
|
343491
|
-
function reset(options = {}) {
|
|
343492
|
-
incompleteLine && options.consume && parseLine(incompleteLine), isFirstChunk = true, id = undefined, data = "", eventType = "", incompleteLine = "";
|
|
343493
|
-
}
|
|
343494
|
-
return { feed, reset };
|
|
343495
|
-
}
|
|
343496
|
-
function splitLines(chunk) {
|
|
343497
|
-
const lines = [];
|
|
343498
|
-
let incompleteLine = "", searchIndex = 0;
|
|
343499
|
-
for (;searchIndex < chunk.length; ) {
|
|
343500
|
-
const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(`
|
|
343501
|
-
`, searchIndex);
|
|
343502
|
-
let lineEnd = -1;
|
|
343503
|
-
if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = Math.min(crIndex, lfIndex) : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1) {
|
|
343504
|
-
incompleteLine = chunk.slice(searchIndex);
|
|
343505
|
-
break;
|
|
343506
|
-
} else {
|
|
343507
|
-
const line = chunk.slice(searchIndex, lineEnd);
|
|
343508
|
-
lines.push(line), searchIndex = lineEnd + 1, chunk[searchIndex - 1] === "\r" && chunk[searchIndex] === `
|
|
343509
|
-
` && searchIndex++;
|
|
343510
|
-
}
|
|
343511
|
-
}
|
|
343512
|
-
return [lines, incompleteLine];
|
|
343513
|
-
}
|
|
343514
|
-
|
|
343515
|
-
// ../../node_modules/eventsource-parser/dist/stream.js
|
|
343516
|
-
class EventSourceParserStream extends TransformStream {
|
|
343517
|
-
constructor({ onError, onRetry, onComment } = {}) {
|
|
343518
|
-
let parser;
|
|
343519
|
-
super({
|
|
343520
|
-
start(controller) {
|
|
343521
|
-
parser = createParser({
|
|
343522
|
-
onEvent: (event) => {
|
|
343523
|
-
controller.enqueue(event);
|
|
343524
|
-
},
|
|
343525
|
-
onError(error40) {
|
|
343526
|
-
onError === "terminate" ? controller.error(error40) : typeof onError == "function" && onError(error40);
|
|
343527
|
-
},
|
|
343528
|
-
onRetry,
|
|
343529
|
-
onComment
|
|
343530
|
-
});
|
|
343531
|
-
},
|
|
343532
|
-
transform(chunk) {
|
|
343533
|
-
parser.feed(chunk);
|
|
343534
|
-
}
|
|
343535
|
-
});
|
|
343536
|
-
}
|
|
343537
|
-
}
|
|
343538
|
-
|
|
343539
343517
|
// ../../node_modules/@ai-sdk/provider-utils/dist/index.mjs
|
|
343540
343518
|
init_dist();
|
|
343541
343519
|
function combineHeaders(...headers) {
|
|
@@ -352013,6 +351991,27 @@ var uiMessageSchema = exports_external.object({
|
|
|
352013
351991
|
...toolUIPartSchemas
|
|
352014
351992
|
]))
|
|
352015
351993
|
});
|
|
351994
|
+
// ../../node_modules/zod/index.js
|
|
351995
|
+
var zod_default = exports_external2;
|
|
351996
|
+
|
|
351997
|
+
// ../tools/src/constants.ts
|
|
351998
|
+
var EditFileResultPrompt = `You may see the following fields in the result:
|
|
351999
|
+
- userEdits: If the user makes any edits, this field will contain a diff between your edit and their changes.
|
|
352000
|
+
- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.
|
|
352001
|
+
- newProblems: If any new problems are found after the edit, this field will contain information about them.
|
|
352002
|
+
`.trim();
|
|
352003
|
+
var EditFileOutputSchema = exports_external2.object({
|
|
352004
|
+
success: exports_external2.boolean().describe("Indicates whether the file was successfully written."),
|
|
352005
|
+
userEdits: exports_external2.string().describe("The user's edits to the file, only present if the file was edited by the user.").optional(),
|
|
352006
|
+
autoFormattingEdits: exports_external2.string().describe("The auto-formatting edits to the file, only present if the auto formatter made changes.").optional(),
|
|
352007
|
+
newProblems: exports_external2.string().optional().describe("The new problems found after writing the file, if any."),
|
|
352008
|
+
_meta: exports_external2.object({
|
|
352009
|
+
editSummary: exports_external2.object({
|
|
352010
|
+
added: exports_external2.number().describe("Number of lines added to the file."),
|
|
352011
|
+
removed: exports_external2.number().describe("Number of lines removed from the file.")
|
|
352012
|
+
}).optional().describe("A summary of the edits made to the file.")
|
|
352013
|
+
}).optional().describe("Metadata that would be removed before sending to the LLM (e.g. UI specific data).")
|
|
352014
|
+
});
|
|
352016
352015
|
// ../tools/src/apply-diff.ts
|
|
352017
352016
|
var toolDef = {
|
|
352018
352017
|
description: `This is a tool for editing files. For moving or renaming files, you should generally use the executeCommand tool with the 'mv' command instead. For larger edits, use the writeFile tool to overwrite files.
|
|
@@ -352311,7 +352310,8 @@ var CustomAgent = exports_external2.object({
|
|
|
352311
352310
|
name: exports_external2.string().describe("The name of the custom agent."),
|
|
352312
352311
|
description: exports_external2.string().describe("A brief description of the custom agent."),
|
|
352313
352312
|
tools: exports_external2.array(exports_external2.string()).optional().describe("List of tools the agent can use."),
|
|
352314
|
-
systemPrompt: exports_external2.string().describe("The system prompt for the custom agent.")
|
|
352313
|
+
systemPrompt: exports_external2.string().describe("The system prompt for the custom agent."),
|
|
352314
|
+
model: exports_external2.string().optional().describe("The model to use for the custom agent.")
|
|
352315
352315
|
});
|
|
352316
352316
|
var overrideCustomAgentTools = (customAgent) => {
|
|
352317
352317
|
if (!customAgent)
|
|
@@ -352333,6 +352333,17 @@ ${(customAgents ?? []).map((agent) => `- ${agent.name}: ${agent.description}`).j
|
|
|
352333
352333
|
`)}
|
|
352334
352334
|
`;
|
|
352335
352335
|
}
|
|
352336
|
+
var inputSchema = exports_external2.object({
|
|
352337
|
+
description: exports_external2.string().describe("A short description of the task."),
|
|
352338
|
+
prompt: exports_external2.string().describe("The detailed prompt for the task to be performed."),
|
|
352339
|
+
agentType: exports_external2.string().optional().describe("The type of the specialized agent to use for the task."),
|
|
352340
|
+
_meta: exports_external2.object({
|
|
352341
|
+
uid: exports_external2.string().describe("A unique identifier for the task.")
|
|
352342
|
+
}).optional(),
|
|
352343
|
+
_transient: exports_external2.object({
|
|
352344
|
+
task: exports_external2.custom().describe("The inlined subtask result.")
|
|
352345
|
+
}).optional()
|
|
352346
|
+
});
|
|
352336
352347
|
var createNewTaskTool = (customAgents) => tool({
|
|
352337
352348
|
description: `Launch a new agent to handle complex, multi-step tasks autonomously.
|
|
352338
352349
|
${makeCustomAgentToolDescription(customAgents)}
|
|
@@ -352353,54 +352364,8 @@ Usage notes:
|
|
|
352353
352364
|
4. The agent's outputs should generally be trusted
|
|
352354
352365
|
5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent
|
|
352355
352366
|
6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.
|
|
352356
|
-
|
|
352357
|
-
|
|
352358
|
-
|
|
352359
|
-
<example_agent_descriptions>
|
|
352360
|
-
"code-reviewer": use this agent after you are done writing a signficant piece of code
|
|
352361
|
-
"greeting-responder": use this agent when to respond to user greetings with a friendly joke
|
|
352362
|
-
</example_agent_description>
|
|
352363
|
-
|
|
352364
|
-
<example>
|
|
352365
|
-
user: "Please write a function that checks if a number is prime"
|
|
352366
|
-
assistant: Sure let me write a function that checks if a number is prime
|
|
352367
|
-
assistant: First let me use the Write tool to write a function that checks if a number is prime
|
|
352368
|
-
assistant: I'm going to use the Write tool to write the following code:
|
|
352369
|
-
<code>
|
|
352370
|
-
function isPrime(n) {
|
|
352371
|
-
if (n <= 1) return false
|
|
352372
|
-
for (let i = 2; i * i <= n; i++) {
|
|
352373
|
-
if (n % i === 0) return false
|
|
352374
|
-
}
|
|
352375
|
-
return true
|
|
352376
|
-
}
|
|
352377
|
-
</code>
|
|
352378
|
-
<commentary>
|
|
352379
|
-
Since a signficant piece of code was written and the task was completed, now use the code-reviewer agent to review the code
|
|
352380
|
-
</commentary>
|
|
352381
|
-
assistant: Now let me use the code-reviewer agent to review the code
|
|
352382
|
-
assistant: Uses the Task tool to launch the with the code-reviewer agent
|
|
352383
|
-
</example>
|
|
352384
|
-
|
|
352385
|
-
<example>
|
|
352386
|
-
user: "Hello"
|
|
352387
|
-
<commentary>
|
|
352388
|
-
Since the user is greeting, use the greeting-responder agent to respond with a friendly joke
|
|
352389
|
-
</commentary>
|
|
352390
|
-
assistant: "I'm going to use the Task tool to launch the with the greeting-responder agent"
|
|
352391
|
-
</example>
|
|
352392
|
-
`,
|
|
352393
|
-
inputSchema: exports_external2.object({
|
|
352394
|
-
description: exports_external2.string().describe("A short description of the task."),
|
|
352395
|
-
prompt: exports_external2.string().describe("The detailed prompt for the task to be performed."),
|
|
352396
|
-
agentType: exports_external2.string().optional().describe("The type of the specialized agent to use for the task."),
|
|
352397
|
-
_meta: exports_external2.object({
|
|
352398
|
-
uid: exports_external2.string().describe("A unique identifier for the task.")
|
|
352399
|
-
}).optional(),
|
|
352400
|
-
_transient: exports_external2.object({
|
|
352401
|
-
task: exports_external2.custom().describe("The inlined subtask result.")
|
|
352402
|
-
}).optional()
|
|
352403
|
-
}),
|
|
352367
|
+
`.trim(),
|
|
352368
|
+
inputSchema,
|
|
352404
352369
|
outputSchema: exports_external2.object({
|
|
352405
352370
|
result: exports_external2.string().describe("The result of the task, submitted through the `attemptCompletion` tool.")
|
|
352406
352371
|
})
|
|
@@ -352634,6 +352599,19 @@ When in doubt, use this tool. Being proactive with task management demonstrates
|
|
|
352634
352599
|
})
|
|
352635
352600
|
};
|
|
352636
352601
|
var todoWrite = tool(toolDef10);
|
|
352602
|
+
// ../tools/src/edit-notebook.ts
|
|
352603
|
+
var editNotebook = tool({
|
|
352604
|
+
description: "Edit a specific cell in a Jupyter notebook (.ipynb file) by its cell ID",
|
|
352605
|
+
inputSchema: exports_external2.object({
|
|
352606
|
+
path: exports_external2.string().describe("The path to the notebook file"),
|
|
352607
|
+
cellId: exports_external2.string().describe("The ID of the cell to edit"),
|
|
352608
|
+
content: exports_external2.string().describe("The new content of the cell")
|
|
352609
|
+
}),
|
|
352610
|
+
outputSchema: exports_external2.object({
|
|
352611
|
+
success: exports_external2.boolean().describe("Whether the edit was successful")
|
|
352612
|
+
})
|
|
352613
|
+
});
|
|
352614
|
+
|
|
352637
352615
|
// ../tools/src/kill-background-job.ts
|
|
352638
352616
|
var toolDef11 = {
|
|
352639
352617
|
description: `- Kills a running background job by its ID
|
|
@@ -352729,11 +352707,19 @@ ${EditFileResultPrompt}`.trim(),
|
|
|
352729
352707
|
var writeToFile = tool(toolDef14);
|
|
352730
352708
|
|
|
352731
352709
|
// ../tools/src/index.ts
|
|
352710
|
+
function isUserInputToolName(name17) {
|
|
352711
|
+
return name17 === "askFollowupQuestion" || name17 === "attemptCompletion";
|
|
352712
|
+
}
|
|
352732
352713
|
function isUserInputToolPart(part) {
|
|
352733
|
-
|
|
352714
|
+
if (!isToolUIPart(part))
|
|
352715
|
+
return false;
|
|
352716
|
+
return isUserInputToolName(getToolName(part));
|
|
352717
|
+
}
|
|
352718
|
+
function isAutoApproveToolName(name17) {
|
|
352719
|
+
return ToolsByPermission.default.some((tool2) => name17 === tool2);
|
|
352734
352720
|
}
|
|
352735
352721
|
function isAutoApproveTool(part) {
|
|
352736
|
-
return
|
|
352722
|
+
return isAutoApproveToolName(getToolName(part));
|
|
352737
352723
|
}
|
|
352738
352724
|
var ToolsByPermission = {
|
|
352739
352725
|
read: [
|
|
@@ -352750,7 +352736,8 @@ var ToolsByPermission = {
|
|
|
352750
352736
|
write: [
|
|
352751
352737
|
"writeToFile",
|
|
352752
352738
|
"applyDiff",
|
|
352753
|
-
"multiApplyDiff"
|
|
352739
|
+
"multiApplyDiff",
|
|
352740
|
+
"editNotebook"
|
|
352754
352741
|
],
|
|
352755
352742
|
execute: [
|
|
352756
352743
|
"executeCommand",
|
|
@@ -352772,6 +352759,7 @@ var createCliTools = (customAgents) => ({
|
|
|
352772
352759
|
searchFiles,
|
|
352773
352760
|
todoWrite,
|
|
352774
352761
|
writeToFile,
|
|
352762
|
+
editNotebook,
|
|
352775
352763
|
newTask: createNewTaskTool(customAgents)
|
|
352776
352764
|
});
|
|
352777
352765
|
var createClientTools = (customAgents) => {
|
|
@@ -352960,11 +352948,12 @@ function getCurrentWorkingFile(workspace) {
|
|
|
352960
352948
|
if (!selection) {
|
|
352961
352949
|
return "";
|
|
352962
352950
|
}
|
|
352963
|
-
const { filepath, range, content } = selection;
|
|
352951
|
+
const { filepath, range, content, notebookCell } = selection;
|
|
352964
352952
|
if (!content || content.trim() === "") {
|
|
352965
352953
|
return "";
|
|
352966
352954
|
}
|
|
352967
|
-
|
|
352955
|
+
const location2 = notebookCell ? `${filepath} (Cell ID: ${notebookCell.cellId})` : `${filepath}:${range.start.line + 1}-${range.end.line + 1}`;
|
|
352956
|
+
return `# Active Selection (${location2})
|
|
352968
352957
|
|
|
352969
352958
|
\`\`\`
|
|
352970
352959
|
${content}
|
|
@@ -353466,7 +353455,11 @@ var Environment = exports_external2.object({
|
|
|
353466
353455
|
character: exports_external2.number().describe("The ending character number of the selection.")
|
|
353467
353456
|
}).describe("The end position of the selection.")
|
|
353468
353457
|
}).describe("The range of the active selection."),
|
|
353469
|
-
content: exports_external2.string().describe("The content of the active selection.")
|
|
353458
|
+
content: exports_external2.string().describe("The content of the active selection."),
|
|
353459
|
+
notebookCell: exports_external2.object({
|
|
353460
|
+
cellIndex: exports_external2.number().describe("The zero-based index of the notebook cell."),
|
|
353461
|
+
cellId: exports_external2.string().describe("The ID of the notebook cell. This can be used with the editNotebook tool to edit the cell. Falls back to the cell index as a string if no ID is available.")
|
|
353462
|
+
}).optional().describe("Notebook cell information if the selection is in a Jupyter notebook. The cellId can be used directly with the editNotebook tool.")
|
|
353470
353463
|
}).optional().describe("Active editor selection in the current workspace."),
|
|
353471
353464
|
gitStatus: exports_external2.object({
|
|
353472
353465
|
userName: exports_external2.string().describe("The name of the git user.").optional(),
|
|
@@ -367777,7 +367770,7 @@ var {
|
|
|
367777
367770
|
// package.json
|
|
367778
367771
|
var package_default = {
|
|
367779
367772
|
name: "@getpochi/cli",
|
|
367780
|
-
version: "0.5.
|
|
367773
|
+
version: "0.5.58",
|
|
367781
367774
|
type: "module",
|
|
367782
367775
|
bin: {
|
|
367783
367776
|
pochi: "src/cli.ts"
|
|
@@ -379329,6 +379322,7 @@ function matter2(file5, options4) {
|
|
|
379329
379322
|
var CustomAgentFrontmatter = v4_default.object({
|
|
379330
379323
|
name: v4_default.string().optional(),
|
|
379331
379324
|
description: v4_default.string(),
|
|
379325
|
+
model: v4_default.string().optional(),
|
|
379332
379326
|
tools: v4_default.union([v4_default.string(), v4_default.array(v4_default.string())]).optional()
|
|
379333
379327
|
});
|
|
379334
379328
|
async function parseAgentFile(filePath, readFileContent) {
|
|
@@ -379389,7 +379383,8 @@ async function parseAgentFile(filePath, readFileContent) {
|
|
|
379389
379383
|
name: frontmatterData.name || defaultName,
|
|
379390
379384
|
tools,
|
|
379391
379385
|
description: frontmatterData.description,
|
|
379392
|
-
systemPrompt
|
|
379386
|
+
systemPrompt,
|
|
379387
|
+
model: frontmatterData.model
|
|
379393
379388
|
};
|
|
379394
379389
|
}
|
|
379395
379390
|
// ../common/src/tool-utils/workflow-parser.ts
|
|
@@ -409383,7 +409378,7 @@ async function digest(data) {
|
|
|
409383
409378
|
|
|
409384
409379
|
// ../livekit/src/chat/llm/repair-tool-call.ts
|
|
409385
409380
|
var logger21 = getLogger("RepairToolCall");
|
|
409386
|
-
var makeRepairToolCall = (model2) => async ({ toolCall, inputSchema, error: error46 }) => {
|
|
409381
|
+
var makeRepairToolCall = (model2) => async ({ toolCall, inputSchema: inputSchema2, error: error46 }) => {
|
|
409387
409382
|
if (NoSuchToolError.isInstance(error46)) {
|
|
409388
409383
|
return null;
|
|
409389
409384
|
}
|
|
@@ -409393,7 +409388,7 @@ var makeRepairToolCall = (model2) => async ({ toolCall, inputSchema, error: erro
|
|
|
409393
409388
|
`The model tried to call the tool "${toolCall.toolName}" with the following arguments:`,
|
|
409394
409389
|
JSON.stringify(toolCall.input),
|
|
409395
409390
|
"The tool accepts the following schema:",
|
|
409396
|
-
JSON.stringify(
|
|
409391
|
+
JSON.stringify(inputSchema2(toolCall)),
|
|
409397
409392
|
"Please fix the arguments. Please ONLY output the json string, without any other text (no markdown code block wrapper, either)",
|
|
409398
409393
|
"",
|
|
409399
409394
|
"<good-example>",
|
|
@@ -409742,7 +409737,7 @@ function createNewTaskMiddleware(store, cwd2, parentTaskId, customAgents) {
|
|
|
409742
409737
|
if (chunk4.type === "tool-call" && chunk4.toolName === "newTask" && (chunk4.toolCallId === toolCallId || toolCallId === "")) {
|
|
409743
409738
|
const parsedResult = await safeParseJSON({
|
|
409744
409739
|
text: chunk4.input,
|
|
409745
|
-
schema:
|
|
409740
|
+
schema: inputSchema
|
|
409746
409741
|
});
|
|
409747
409742
|
if (!parsedResult.success) {
|
|
409748
409743
|
throw new InvalidToolInputError({
|
|
@@ -410340,8 +410335,18 @@ function createGoogleVertexTuningModel(llm) {
|
|
|
410340
410335
|
middleware: {
|
|
410341
410336
|
middlewareVersion: "v2",
|
|
410342
410337
|
async transformParams({ params: params3 }) {
|
|
410343
|
-
|
|
410344
|
-
|
|
410338
|
+
return {
|
|
410339
|
+
...params3,
|
|
410340
|
+
maxOutputTokens: params3.maxOutputTokens,
|
|
410341
|
+
providerOptions: {
|
|
410342
|
+
google: {
|
|
410343
|
+
thinkingConfig: {
|
|
410344
|
+
includeThoughts: true,
|
|
410345
|
+
thinkingBudget: 4096
|
|
410346
|
+
}
|
|
410347
|
+
}
|
|
410348
|
+
}
|
|
410349
|
+
};
|
|
410345
410350
|
}
|
|
410346
410351
|
}
|
|
410347
410352
|
});
|
|
@@ -411935,7 +411940,16 @@ var program5 = new Command().name("pochi").description(`${source_default.bold("P
|
|
|
411935
411940
|
const llm = await createLLMConfig(program5, options6);
|
|
411936
411941
|
const rg2 = findRipgrep();
|
|
411937
411942
|
if (!rg2) {
|
|
411938
|
-
return program5.error(
|
|
411943
|
+
return program5.error(`ripgrep is not installed or not found in your $PATH.
|
|
411944
|
+
` + `Some file search features require ripgrep to function properly.
|
|
411945
|
+
|
|
411946
|
+
` + `To install ripgrep:
|
|
411947
|
+
` + `\u2022 macOS: brew install ripgrep
|
|
411948
|
+
` + `\u2022 Ubuntu/Debian: apt-get install ripgrep
|
|
411949
|
+
` + `\u2022 Windows: winget install BurntSushi.ripgrep.MSVC
|
|
411950
|
+
` + `\u2022 Or visit: https://github.com/BurntSushi/ripgrep#installation
|
|
411951
|
+
|
|
411952
|
+
` + "Please install ripgrep and try again.");
|
|
411939
411953
|
}
|
|
411940
411954
|
const onSubTaskCreated = (runner2) => {
|
|
411941
411955
|
renderer.renderSubTask(runner2);
|