linkque-cli-v2 1.3.8 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/linkquejs.js +6 -7
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-ZNU4GVF3.js → chunk-OHRCYI66.js} +146 -119
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-RHMVQTA7.js → chunk-WM6JHW55.js} +225 -214
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-AACYYAZ6.js → chunk-XL6BPKTI.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +109 -34
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +3 -3
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +3 -3
- package/worker.js +135 -32
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{anthropic-messages-EL2IU4YU.js → anthropic-messages-5DOLTIGP.js} +3 -3
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{azure-openai-responses-A4XURCOX.js → azure-openai-responses-HVAVRLTK.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{mistral-conversations-5RZTVEO2.js → mistral-conversations-OEBGEDLQ.js} +10 -10
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-codex-responses-WLREQPZK.js → openai-codex-responses-3KOC6KHN.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-completions-U6LUBY4P.js → openai-completions-HG6OJRL5.js} +3 -3
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-responses-SFZAU5JA.js → openai-responses-F6V2PG3Y.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{pi-messages-QQA6ZGV2.js → pi-messages-DC4DVRAJ.js} +3 -3
package/worker.js
CHANGED
|
@@ -4361,14 +4361,13 @@ var require_fast_uri = __commonJS({
|
|
|
4361
4361
|
if (!malformedIPLiteral) {
|
|
4362
4362
|
malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP2);
|
|
4363
4363
|
}
|
|
4364
|
-
if (uri.indexOf("%") !== -1 && parsed.host !== void 0 && !malformedIPLiteral) {
|
|
4365
|
-
let host = isIP2 ? parsed.host : normalizePercentEncoding(parsed.host, true);
|
|
4366
|
-
if (!isIP2) {
|
|
4367
|
-
host = normalizePercentEncoding(host.toLowerCase());
|
|
4368
|
-
}
|
|
4369
|
-
parsed.host = reescapeHostDelimiters(host, isIP2);
|
|
4370
|
-
}
|
|
4371
4364
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
4365
|
+
if (uri.indexOf("%") !== -1) {
|
|
4366
|
+
if (parsed.host !== void 0 && !malformedIPLiteral) {
|
|
4367
|
+
const host = isIP2 ? parsed.host : normalizePercentEncoding(parsed.host, true);
|
|
4368
|
+
parsed.host = reescapeHostDelimiters(host, isIP2);
|
|
4369
|
+
}
|
|
4370
|
+
}
|
|
4372
4371
|
if (parsed.path) {
|
|
4373
4372
|
parsed.path = normalizePathEncoding(parsed.path);
|
|
4374
4373
|
}
|
|
@@ -33188,6 +33187,25 @@ var init_history = __esm({
|
|
|
33188
33187
|
});
|
|
33189
33188
|
|
|
33190
33189
|
// ../agent-conversation-contract/dist/esm/sse.js
|
|
33190
|
+
function parseConversationToolCallDisplayName(value) {
|
|
33191
|
+
if (typeof value !== "string" || /[\r\n\u2028\u2029]/u.test(value)) {
|
|
33192
|
+
return void 0;
|
|
33193
|
+
}
|
|
33194
|
+
const normalized = value.trim();
|
|
33195
|
+
if (!normalized || normalized.length > MAX_CONVERSATION_TOOL_CALL_DISPLAY_NAME_LENGTH) {
|
|
33196
|
+
return void 0;
|
|
33197
|
+
}
|
|
33198
|
+
return normalized;
|
|
33199
|
+
}
|
|
33200
|
+
function createConversationToolCallStartEvent(toolCallId, toolCallName, displayName) {
|
|
33201
|
+
const normalized = parseConversationToolCallDisplayName(displayName);
|
|
33202
|
+
return {
|
|
33203
|
+
type: EventType.TOOL_CALL_START,
|
|
33204
|
+
toolCallId,
|
|
33205
|
+
toolCallName,
|
|
33206
|
+
...normalized ? { displayName: normalized } : {}
|
|
33207
|
+
};
|
|
33208
|
+
}
|
|
33191
33209
|
function createConversationRunAck(runId, threadId, options = {}) {
|
|
33192
33210
|
return {
|
|
33193
33211
|
event: "ack",
|
|
@@ -33205,8 +33223,18 @@ function createConversationAGUIEvent(data, id) {
|
|
|
33205
33223
|
}
|
|
33206
33224
|
function parseConversationAGUIEvent(value) {
|
|
33207
33225
|
const parsed = EventSchemas.safeParse(value);
|
|
33208
|
-
if (parsed.success)
|
|
33209
|
-
|
|
33226
|
+
if (parsed.success) {
|
|
33227
|
+
if (parsed.data.type !== EventType.TOOL_CALL_START)
|
|
33228
|
+
return parsed.data;
|
|
33229
|
+
const event = parsed.data;
|
|
33230
|
+
const displayName = parseConversationToolCallDisplayName(event.displayName);
|
|
33231
|
+
const baseEvent = { ...event };
|
|
33232
|
+
delete baseEvent.displayName;
|
|
33233
|
+
return {
|
|
33234
|
+
...baseEvent,
|
|
33235
|
+
...displayName ? { displayName } : {}
|
|
33236
|
+
};
|
|
33237
|
+
}
|
|
33210
33238
|
throw new ConversationProtocolValidationError(parsed.error.issues.map((issue4) => `${issue4.path.length ? issue4.path.join(".") : "event"}: ${issue4.message}`));
|
|
33211
33239
|
}
|
|
33212
33240
|
function createConversationTransportError(data, id) {
|
|
@@ -33222,12 +33250,14 @@ function encodeConversationSseEvent(event) {
|
|
|
33222
33250
|
|
|
33223
33251
|
`;
|
|
33224
33252
|
}
|
|
33253
|
+
var MAX_CONVERSATION_TOOL_CALL_DISPLAY_NAME_LENGTH;
|
|
33225
33254
|
var init_sse = __esm({
|
|
33226
33255
|
"../agent-conversation-contract/dist/esm/sse.js"() {
|
|
33227
33256
|
"use strict";
|
|
33228
33257
|
init_dist();
|
|
33229
33258
|
init_run();
|
|
33230
33259
|
init_version();
|
|
33260
|
+
MAX_CONVERSATION_TOOL_CALL_DISPLAY_NAME_LENGTH = 20;
|
|
33231
33261
|
}
|
|
33232
33262
|
});
|
|
33233
33263
|
|
|
@@ -33272,11 +33302,7 @@ function mapAgentEventToBaseEvents(event, messageId, thinkingId) {
|
|
|
33272
33302
|
}
|
|
33273
33303
|
case "tool_start": {
|
|
33274
33304
|
const events = [
|
|
33275
|
-
|
|
33276
|
-
type: EventType.TOOL_CALL_START,
|
|
33277
|
-
toolCallId: event.toolCallId,
|
|
33278
|
-
toolCallName: event.toolName
|
|
33279
|
-
}
|
|
33305
|
+
createConversationToolCallStartEvent(event.toolCallId, event.toolName, event.displayName)
|
|
33280
33306
|
];
|
|
33281
33307
|
const argsDelta = safeStringifyArgs(event.args);
|
|
33282
33308
|
if (argsDelta !== "") {
|
|
@@ -205165,13 +205191,16 @@ function toPiAgentTools(descriptors, emitToolEvent = () => void 0) {
|
|
|
205165
205191
|
if (names.has(name))
|
|
205166
205192
|
throw new Error(`Duplicate AgentTool name ${name}`);
|
|
205167
205193
|
names.add(name);
|
|
205194
|
+
const uiStatusParameters = decorateToolParametersWithUiStatus(descriptor.inputSchema);
|
|
205168
205195
|
return {
|
|
205169
205196
|
name,
|
|
205170
205197
|
label: descriptor.label ?? descriptor.name,
|
|
205171
205198
|
description: descriptor.description ?? descriptor.name,
|
|
205172
|
-
parameters:
|
|
205199
|
+
parameters: uiStatusParameters.parameters,
|
|
205200
|
+
...uiStatusParameters.enabled ? { prepareArguments: stripToolUiStatusArgument } : {},
|
|
205173
205201
|
execute: async (toolCallId, params, signal) => {
|
|
205174
|
-
const
|
|
205202
|
+
const args = uiStatusParameters.enabled ? stripToolUiStatusArgument(params) : params;
|
|
205203
|
+
const result = await descriptor.execute(args, signal, {
|
|
205175
205204
|
toolCallId,
|
|
205176
205205
|
emit: emitToolEvent
|
|
205177
205206
|
});
|
|
@@ -205189,6 +205218,45 @@ function toPiAgentTools(descriptors, emitToolEvent = () => void 0) {
|
|
|
205189
205218
|
};
|
|
205190
205219
|
});
|
|
205191
205220
|
}
|
|
205221
|
+
function getToolUiStatusEnabledNames(descriptors) {
|
|
205222
|
+
return new Set(descriptors.flatMap((descriptor) => decorateToolParametersWithUiStatus(descriptor.inputSchema).enabled ? [descriptor.modelName ?? descriptor.name] : []));
|
|
205223
|
+
}
|
|
205224
|
+
function decorateToolParametersWithUiStatus(value) {
|
|
205225
|
+
const parameters = normalizeParameters(value);
|
|
205226
|
+
if (!isRecord6(parameters) || parameters.type !== "object") {
|
|
205227
|
+
return { parameters, enabled: false };
|
|
205228
|
+
}
|
|
205229
|
+
if ([...UNSAFE_TOOL_SCHEMA_KEYS].some((key) => key in parameters)) {
|
|
205230
|
+
return { parameters, enabled: false };
|
|
205231
|
+
}
|
|
205232
|
+
const properties = parameters.properties;
|
|
205233
|
+
if (properties !== void 0 && !isRecord6(properties)) {
|
|
205234
|
+
return { parameters, enabled: false };
|
|
205235
|
+
}
|
|
205236
|
+
const required2 = parameters.required;
|
|
205237
|
+
if (properties && TOOL_UI_STATUS_ARGUMENT in properties || Array.isArray(required2) && required2.includes(TOOL_UI_STATUS_ARGUMENT)) {
|
|
205238
|
+
return { parameters, enabled: false };
|
|
205239
|
+
}
|
|
205240
|
+
return {
|
|
205241
|
+
parameters: {
|
|
205242
|
+
...parameters,
|
|
205243
|
+
properties: {
|
|
205244
|
+
...properties,
|
|
205245
|
+
[TOOL_UI_STATUS_ARGUMENT]: TOOL_UI_STATUS_SCHEMA
|
|
205246
|
+
}
|
|
205247
|
+
},
|
|
205248
|
+
enabled: true
|
|
205249
|
+
};
|
|
205250
|
+
}
|
|
205251
|
+
function stripToolUiStatusArgument(value) {
|
|
205252
|
+
if (!isRecord6(value) || !(TOOL_UI_STATUS_ARGUMENT in value))
|
|
205253
|
+
return value;
|
|
205254
|
+
const { [TOOL_UI_STATUS_ARGUMENT]: _status, ...args } = value;
|
|
205255
|
+
return args;
|
|
205256
|
+
}
|
|
205257
|
+
function isRecord6(value) {
|
|
205258
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
205259
|
+
}
|
|
205192
205260
|
function normalizeParameters(value) {
|
|
205193
205261
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
205194
205262
|
return value;
|
|
@@ -205222,6 +205290,7 @@ function safeStringifyPayload(payload) {
|
|
|
205222
205290
|
return "<unserializable>";
|
|
205223
205291
|
}
|
|
205224
205292
|
}
|
|
205293
|
+
var TOOL_UI_STATUS_ARGUMENT, TOOL_UI_STATUS_SCHEMA, UNSAFE_TOOL_SCHEMA_KEYS;
|
|
205225
205294
|
var init_createAgentSession = __esm({
|
|
205226
205295
|
"../linkque-agent-runtime/dist/esm/impl/agent/pi/createAgentSession.js"() {
|
|
205227
205296
|
"use strict";
|
|
@@ -205230,11 +205299,35 @@ var init_createAgentSession = __esm({
|
|
|
205230
205299
|
init_logFailure();
|
|
205231
205300
|
init_dist4();
|
|
205232
205301
|
init_dist3();
|
|
205302
|
+
init_esm5();
|
|
205233
205303
|
init_esm();
|
|
205234
205304
|
init_types();
|
|
205235
205305
|
init_cardTools();
|
|
205236
205306
|
init_httpLoggingFetch();
|
|
205237
205307
|
init_llmRequestThrottle();
|
|
205308
|
+
TOOL_UI_STATUS_ARGUMENT = "__ui_status";
|
|
205309
|
+
TOOL_UI_STATUS_SCHEMA = Object.freeze({
|
|
205310
|
+
type: "string",
|
|
205311
|
+
minLength: 1,
|
|
205312
|
+
maxLength: MAX_CONVERSATION_TOOL_CALL_DISPLAY_NAME_LENGTH,
|
|
205313
|
+
description: "\u754C\u9762\u8FDB\u884C\u4E2D\u72B6\u6001\u3002\u8BF7\u7528\u4E0D\u8D85\u8FC720\u4E2A\u5B57\u7684\u4E2D\u6587\u77ED\u53E5\u6982\u62EC\u672C\u6B21\u8C03\u7528\u76EE\u7684\uFF0C\u4F8B\u5982\u201C\u6B63\u5728\u641C\u7D22\u9644\u8FD1\u9152\u5E97\u201D\uFF1B\u63CF\u8FF0\u52A8\u4F5C\u4E0E\u5BF9\u8C61\uFF0C\u4E0D\u590D\u8FF0\u624B\u673A\u53F7\u3001\u8BA2\u5355\u53F7\u7B49\u5177\u4F53\u53C2\u6570\u503C\u3002"
|
|
205314
|
+
});
|
|
205315
|
+
UNSAFE_TOOL_SCHEMA_KEYS = /* @__PURE__ */ new Set([
|
|
205316
|
+
"$dynamicRef",
|
|
205317
|
+
"$ref",
|
|
205318
|
+
"$recursiveRef",
|
|
205319
|
+
"allOf",
|
|
205320
|
+
"anyOf",
|
|
205321
|
+
"dependentSchemas",
|
|
205322
|
+
"else",
|
|
205323
|
+
"if",
|
|
205324
|
+
"not",
|
|
205325
|
+
"oneOf",
|
|
205326
|
+
"patternProperties",
|
|
205327
|
+
"propertyNames",
|
|
205328
|
+
"then",
|
|
205329
|
+
"unevaluatedProperties"
|
|
205330
|
+
]);
|
|
205238
205331
|
}
|
|
205239
205332
|
});
|
|
205240
205333
|
|
|
@@ -205447,7 +205540,7 @@ function providerIdFor(provider) {
|
|
|
205447
205540
|
throw new Error(`\u672A\u5B9E\u73B0\u7684 model provider: ${provider}`);
|
|
205448
205541
|
}
|
|
205449
205542
|
}
|
|
205450
|
-
function translateEvent(event) {
|
|
205543
|
+
function translateEvent(event, uiStatusToolNames = /* @__PURE__ */ new Set()) {
|
|
205451
205544
|
switch (event.type) {
|
|
205452
205545
|
case "message_update": {
|
|
205453
205546
|
const inner = event.assistantMessageEvent;
|
|
@@ -205481,13 +205574,17 @@ function translateEvent(event) {
|
|
|
205481
205574
|
}
|
|
205482
205575
|
return void 0;
|
|
205483
205576
|
}
|
|
205484
|
-
case "tool_execution_start":
|
|
205577
|
+
case "tool_execution_start": {
|
|
205578
|
+
const uiStatusEnabled = uiStatusToolNames.has(event.toolName);
|
|
205579
|
+
const displayName = uiStatusEnabled ? parseConversationToolCallDisplayName(readToolUiStatus(event.args)) : void 0;
|
|
205485
205580
|
return {
|
|
205486
205581
|
type: "tool_start",
|
|
205487
205582
|
toolCallId: event.toolCallId,
|
|
205488
205583
|
toolName: event.toolName,
|
|
205489
|
-
|
|
205584
|
+
...displayName ? { displayName } : {},
|
|
205585
|
+
args: uiStatusEnabled ? stripToolUiStatusArgument(event.args) : event.args
|
|
205490
205586
|
};
|
|
205587
|
+
}
|
|
205491
205588
|
case "tool_execution_end":
|
|
205492
205589
|
return {
|
|
205493
205590
|
type: "tool_end",
|
|
@@ -205502,14 +205599,17 @@ function translateEvent(event) {
|
|
|
205502
205599
|
return void 0;
|
|
205503
205600
|
}
|
|
205504
205601
|
}
|
|
205505
|
-
function translateEvents(event) {
|
|
205506
|
-
const translated = translateEvent(event);
|
|
205602
|
+
function translateEvents(event, uiStatusToolNames = /* @__PURE__ */ new Set()) {
|
|
205603
|
+
const translated = translateEvent(event, uiStatusToolNames);
|
|
205507
205604
|
const events = translated ? [translated] : [];
|
|
205508
205605
|
if (event.type === "tool_execution_end" && !event.isError && event.result && typeof event.result === "object" && isAgentPresentationToolResult(event.result.details)) {
|
|
205509
205606
|
events.push(event.result.details.card);
|
|
205510
205607
|
}
|
|
205511
205608
|
return events;
|
|
205512
205609
|
}
|
|
205610
|
+
function readToolUiStatus(args) {
|
|
205611
|
+
return args && typeof args === "object" && !Array.isArray(args) ? args[TOOL_UI_STATUS_ARGUMENT] : void 0;
|
|
205612
|
+
}
|
|
205513
205613
|
function toErrorEvent(err3) {
|
|
205514
205614
|
const message = err3 instanceof Error ? err3.message : typeof err3 === "string" ? err3 : "unknown agent error";
|
|
205515
205615
|
const code = err3 !== null && typeof err3 === "object" && "code" in err3 && typeof err3.code === "string" ? err3.code : void 0;
|
|
@@ -205522,6 +205622,7 @@ var init_agentService = __esm({
|
|
|
205522
205622
|
init_piTelemetry();
|
|
205523
205623
|
init_compat2();
|
|
205524
205624
|
init_esm();
|
|
205625
|
+
init_esm5();
|
|
205525
205626
|
init_types();
|
|
205526
205627
|
init_createAgentSession();
|
|
205527
205628
|
init_testProvider();
|
|
@@ -205582,6 +205683,7 @@ var init_agentService = __esm({
|
|
|
205582
205683
|
sessionDisposed = false;
|
|
205583
205684
|
session;
|
|
205584
205685
|
unsubscribe;
|
|
205686
|
+
uiStatusToolNames;
|
|
205585
205687
|
constructor(prompt, auth2, options, images, createSession, linkqueBaseUrl) {
|
|
205586
205688
|
this.prompt = prompt;
|
|
205587
205689
|
this.auth = auth2;
|
|
@@ -205589,6 +205691,7 @@ var init_agentService = __esm({
|
|
|
205589
205691
|
this.images = images;
|
|
205590
205692
|
this.createSession = createSession;
|
|
205591
205693
|
this.linkqueBaseUrl = linkqueBaseUrl;
|
|
205694
|
+
this.uiStatusToolNames = getToolUiStatusEnabledNames(options.tools ?? []);
|
|
205592
205695
|
}
|
|
205593
205696
|
/** 产出事件直到 done/error;迭代异常(return()/throw())时走 finally 清理。 */
|
|
205594
205697
|
async *iterate() {
|
|
@@ -205722,7 +205825,7 @@ var init_agentService = __esm({
|
|
|
205722
205825
|
return;
|
|
205723
205826
|
this.telemetry?.onEvent(event);
|
|
205724
205827
|
this.logDebug(`[pi-event] ${this.safeStringify(event)}`);
|
|
205725
|
-
for (const translated of translateEvents(event)) {
|
|
205828
|
+
for (const translated of translateEvents(event, this.uiStatusToolNames)) {
|
|
205726
205829
|
if (translated.type === "error" || translated.type === "done") {
|
|
205727
205830
|
if (this.settled)
|
|
205728
205831
|
return;
|
|
@@ -217516,10 +217619,10 @@ var handleFunctionActionMcp = async (req, res, input) => {
|
|
|
217516
217619
|
}
|
|
217517
217620
|
};
|
|
217518
217621
|
var parseHomeDataProxyInput = (value) => {
|
|
217519
|
-
const trustedContext =
|
|
217520
|
-
const trustedUserId =
|
|
217622
|
+
const trustedContext = isRecord7(value) ? value[HOME_DATA_TRUSTED_CONTEXT_FIELD] : void 0;
|
|
217623
|
+
const trustedUserId = isRecord7(trustedContext) ? trustedContext.userId : void 0;
|
|
217521
217624
|
const normalizedUserId = typeof trustedUserId === "string" ? trustedUserId.trim() : "";
|
|
217522
|
-
if (!
|
|
217625
|
+
if (!isRecord7(value) || !normalizedUserId) {
|
|
217523
217626
|
throw new Error("home-data trusted user is invalid");
|
|
217524
217627
|
}
|
|
217525
217628
|
const request = { ...value };
|
|
@@ -217527,19 +217630,19 @@ var parseHomeDataProxyInput = (value) => {
|
|
|
217527
217630
|
return { request, userId: normalizedUserId };
|
|
217528
217631
|
};
|
|
217529
217632
|
var parseA2UIActionProxyInput = (value) => {
|
|
217530
|
-
const trustedContext =
|
|
217531
|
-
const userId =
|
|
217532
|
-
if (!
|
|
217633
|
+
const trustedContext = isRecord7(value) ? value[HOME_DATA_TRUSTED_CONTEXT_FIELD] : void 0;
|
|
217634
|
+
const userId = isRecord7(trustedContext) && typeof trustedContext.userId === "string" ? trustedContext.userId.trim() : "";
|
|
217635
|
+
if (!isRecord7(value) || !userId)
|
|
217533
217636
|
throw new Error("a2ui action trusted user is invalid");
|
|
217534
217637
|
const request = { ...value };
|
|
217535
217638
|
delete request[HOME_DATA_TRUSTED_CONTEXT_FIELD];
|
|
217536
|
-
const tenantId =
|
|
217639
|
+
const tenantId = isRecord7(trustedContext) && typeof trustedContext.tenantId === "string" ? trustedContext.tenantId.trim() : void 0;
|
|
217537
217640
|
return { request, userId, ...tenantId ? { tenantId } : {} };
|
|
217538
217641
|
};
|
|
217539
217642
|
var parseFunctionActionMcpProxyInput = (value) => {
|
|
217540
|
-
if (!
|
|
217643
|
+
if (!isRecord7(value)) throw new Error("function action request is invalid");
|
|
217541
217644
|
const trustedContext = value._trustedContext_;
|
|
217542
|
-
const userId =
|
|
217645
|
+
const userId = isRecord7(trustedContext) && typeof trustedContext.userId === "string" ? trustedContext.userId.trim() : "";
|
|
217543
217646
|
if (!userId) {
|
|
217544
217647
|
throw new Error("function action trusted context is invalid");
|
|
217545
217648
|
}
|
|
@@ -217551,7 +217654,7 @@ var writeJson = (res, status, value) => {
|
|
|
217551
217654
|
res.writeHead(status, { "content-type": "application/json; charset=utf-8" });
|
|
217552
217655
|
res.end(JSON.stringify(value));
|
|
217553
217656
|
};
|
|
217554
|
-
var
|
|
217657
|
+
var isRecord7 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
217555
217658
|
var errorMessage4 = (error40) => error40 instanceof Error ? error40.message : "unknown agent error";
|
|
217556
217659
|
var main = async () => {
|
|
217557
217660
|
const input = decodeInput();
|
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
headersToRecord
|
|
19
19
|
} from "./chunk-Y6UTJIT4.js";
|
|
20
|
+
import {
|
|
21
|
+
getProviderEnvValue
|
|
22
|
+
} from "./chunk-B5XRGKYX.js";
|
|
20
23
|
import {
|
|
21
24
|
parseJsonWithRepair,
|
|
22
25
|
parseStreamingJson
|
|
23
26
|
} from "./chunk-WJHOHUET.js";
|
|
24
|
-
import {
|
|
25
|
-
getProviderEnvValue
|
|
26
|
-
} from "./chunk-B5XRGKYX.js";
|
|
27
27
|
import {
|
|
28
28
|
calculateCost
|
|
29
29
|
} from "./chunk-Y3G4J3TB.js";
|
|
@@ -21,10 +21,10 @@ import "./chunk-CT4G24PS.js";
|
|
|
21
21
|
import {
|
|
22
22
|
headersToRecord
|
|
23
23
|
} from "./chunk-Y6UTJIT4.js";
|
|
24
|
-
import "./chunk-WJHOHUET.js";
|
|
25
24
|
import {
|
|
26
25
|
getProviderEnvValue
|
|
27
26
|
} from "./chunk-B5XRGKYX.js";
|
|
27
|
+
import "./chunk-WJHOHUET.js";
|
|
28
28
|
import {
|
|
29
29
|
clampThinkingLevel
|
|
30
30
|
} from "./chunk-Y3G4J3TB.js";
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
shortHash
|
|
3
|
-
} from "./chunk-UFVAKOTZ.js";
|
|
4
|
-
import {
|
|
5
|
-
buildBaseOptions,
|
|
6
|
-
transformMessages
|
|
7
|
-
} from "./chunk-RYONFGPP.js";
|
|
8
|
-
import {
|
|
9
|
-
sanitizeSurrogates
|
|
10
|
-
} from "./chunk-CT4G24PS.js";
|
|
11
1
|
import {
|
|
12
2
|
BuiltInConnectors$inboundSchema,
|
|
13
3
|
BuiltInConnectors$outboundSchema,
|
|
@@ -44,6 +34,16 @@ import {
|
|
|
44
34
|
smartUnion,
|
|
45
35
|
unwrapAsync
|
|
46
36
|
} from "./chunk-FC7MJHC3.js";
|
|
37
|
+
import {
|
|
38
|
+
shortHash
|
|
39
|
+
} from "./chunk-UFVAKOTZ.js";
|
|
40
|
+
import {
|
|
41
|
+
buildBaseOptions,
|
|
42
|
+
transformMessages
|
|
43
|
+
} from "./chunk-RYONFGPP.js";
|
|
44
|
+
import {
|
|
45
|
+
sanitizeSurrogates
|
|
46
|
+
} from "./chunk-CT4G24PS.js";
|
|
47
47
|
import {
|
|
48
48
|
parseStreamingJson
|
|
49
49
|
} from "./chunk-WJHOHUET.js";
|
|
@@ -29,10 +29,10 @@ import {
|
|
|
29
29
|
createAssistantMessageDiagnostic,
|
|
30
30
|
formatThrownValue
|
|
31
31
|
} from "./chunk-E2P6TIFG.js";
|
|
32
|
-
import "./chunk-WJHOHUET.js";
|
|
33
32
|
import {
|
|
34
33
|
getProviderEnvValue
|
|
35
34
|
} from "./chunk-B5XRGKYX.js";
|
|
35
|
+
import "./chunk-WJHOHUET.js";
|
|
36
36
|
import {
|
|
37
37
|
clampThinkingLevel
|
|
38
38
|
} from "./chunk-Y3G4J3TB.js";
|
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
import {
|
|
23
23
|
headersToRecord
|
|
24
24
|
} from "./chunk-Y6UTJIT4.js";
|
|
25
|
-
import {
|
|
26
|
-
parseStreamingJson
|
|
27
|
-
} from "./chunk-WJHOHUET.js";
|
|
28
25
|
import {
|
|
29
26
|
getProviderEnvValue
|
|
30
27
|
} from "./chunk-B5XRGKYX.js";
|
|
28
|
+
import {
|
|
29
|
+
parseStreamingJson
|
|
30
|
+
} from "./chunk-WJHOHUET.js";
|
|
31
31
|
import {
|
|
32
32
|
calculateCost,
|
|
33
33
|
clampThinkingLevel
|
|
@@ -28,10 +28,10 @@ import "./chunk-CT4G24PS.js";
|
|
|
28
28
|
import {
|
|
29
29
|
headersToRecord
|
|
30
30
|
} from "./chunk-Y6UTJIT4.js";
|
|
31
|
-
import "./chunk-WJHOHUET.js";
|
|
32
31
|
import {
|
|
33
32
|
getProviderEnvValue
|
|
34
33
|
} from "./chunk-B5XRGKYX.js";
|
|
34
|
+
import "./chunk-WJHOHUET.js";
|
|
35
35
|
import {
|
|
36
36
|
clampThinkingLevel
|
|
37
37
|
} from "./chunk-Y3G4J3TB.js";
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
appendAssistantMessageDiagnostic,
|
|
7
7
|
createAssistantMessageDiagnostic
|
|
8
8
|
} from "./chunk-E2P6TIFG.js";
|
|
9
|
-
import {
|
|
10
|
-
parseStreamingJson
|
|
11
|
-
} from "./chunk-WJHOHUET.js";
|
|
12
9
|
import {
|
|
13
10
|
getProviderEnvValue
|
|
14
11
|
} from "./chunk-B5XRGKYX.js";
|
|
12
|
+
import {
|
|
13
|
+
parseStreamingJson
|
|
14
|
+
} from "./chunk-WJHOHUET.js";
|
|
15
15
|
import {
|
|
16
16
|
AssistantMessageEventStream
|
|
17
17
|
} from "./chunk-46SEH6ER.js";
|