linkque-cli-v2 1.3.8-beta.1 → 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 +343 -1093
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-7MJID6LL.js → chunk-OHRCYI66.js} +165 -222
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-EFUO43CY.js → chunk-WM6JHW55.js} +225 -214
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-BU3S4JYG.js → chunk-XL6BPKTI.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +110 -71
- 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/vendor/linkque-agent-appwrite-integrate/package.json +1 -1
- package/worker.js +180 -185
- 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/package.json
CHANGED
package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-7MJID6LL.js → chunk-OHRCYI66.js}
RENAMED
|
@@ -1,108 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BRAND,
|
|
3
|
-
DIRTY,
|
|
4
|
-
EMPTY_PATH,
|
|
5
|
-
INVALID,
|
|
6
|
-
NEVER,
|
|
7
|
-
OK,
|
|
8
|
-
ParseStatus,
|
|
9
|
-
ZodAny,
|
|
10
|
-
ZodArray,
|
|
11
|
-
ZodBigInt,
|
|
12
|
-
ZodBoolean,
|
|
13
|
-
ZodBranded,
|
|
14
|
-
ZodCatch,
|
|
15
|
-
ZodDate,
|
|
16
|
-
ZodDefault,
|
|
17
|
-
ZodDiscriminatedUnion,
|
|
18
|
-
ZodEffects,
|
|
19
|
-
ZodEnum,
|
|
20
|
-
ZodError,
|
|
21
|
-
ZodFirstPartyTypeKind,
|
|
22
|
-
ZodFunction,
|
|
23
|
-
ZodIntersection,
|
|
24
|
-
ZodIssueCode,
|
|
25
|
-
ZodLazy,
|
|
26
|
-
ZodLiteral,
|
|
27
|
-
ZodMap,
|
|
28
|
-
ZodNaN,
|
|
29
|
-
ZodNativeEnum,
|
|
30
|
-
ZodNever,
|
|
31
|
-
ZodNull,
|
|
32
|
-
ZodNullable,
|
|
33
|
-
ZodNumber,
|
|
34
|
-
ZodObject,
|
|
35
|
-
ZodOptional,
|
|
36
|
-
ZodParsedType,
|
|
37
|
-
ZodPipeline,
|
|
38
|
-
ZodPromise,
|
|
39
|
-
ZodReadonly,
|
|
40
|
-
ZodRecord,
|
|
41
|
-
ZodSet,
|
|
42
|
-
ZodString,
|
|
43
|
-
ZodSymbol,
|
|
44
|
-
ZodTuple,
|
|
45
|
-
ZodType,
|
|
46
|
-
ZodUndefined,
|
|
47
|
-
ZodUnion,
|
|
48
|
-
ZodUnknown,
|
|
49
|
-
ZodVoid,
|
|
50
|
-
addIssueToContext,
|
|
51
|
-
anyType,
|
|
52
|
-
arrayType,
|
|
53
|
-
bigIntType,
|
|
54
|
-
booleanType,
|
|
55
|
-
coerce,
|
|
56
|
-
custom,
|
|
57
|
-
dateType,
|
|
58
|
-
datetimeRegex,
|
|
59
|
-
discriminatedUnionType,
|
|
60
|
-
effectsType,
|
|
61
|
-
en_default,
|
|
62
|
-
enumType,
|
|
63
|
-
functionType,
|
|
64
|
-
getErrorMap,
|
|
65
|
-
getParsedType,
|
|
66
|
-
instanceOfType,
|
|
67
|
-
intersectionType,
|
|
68
|
-
isAborted,
|
|
69
|
-
isAsync,
|
|
70
|
-
isDirty,
|
|
71
|
-
isValid,
|
|
72
|
-
late,
|
|
73
|
-
lazyType,
|
|
74
|
-
literalType,
|
|
75
|
-
makeIssue,
|
|
76
|
-
mapType,
|
|
77
|
-
nanType,
|
|
78
|
-
nativeEnumType,
|
|
79
|
-
neverType,
|
|
80
|
-
nullType,
|
|
81
|
-
nullableType,
|
|
82
|
-
numberType,
|
|
83
|
-
objectType,
|
|
84
|
-
objectUtil,
|
|
85
|
-
oboolean,
|
|
86
|
-
onumber,
|
|
87
|
-
optionalType,
|
|
88
|
-
ostring,
|
|
89
|
-
pipelineType,
|
|
90
|
-
preprocessType,
|
|
91
|
-
promiseType,
|
|
92
|
-
quotelessJson,
|
|
93
|
-
recordType,
|
|
94
|
-
setErrorMap,
|
|
95
|
-
setType,
|
|
96
|
-
strictObjectType,
|
|
97
|
-
stringType,
|
|
98
|
-
symbolType,
|
|
99
|
-
tupleType,
|
|
100
|
-
undefinedType,
|
|
101
|
-
unionType,
|
|
102
|
-
unknownType,
|
|
103
|
-
util,
|
|
104
|
-
voidType
|
|
105
|
-
} from "./chunk-XUFLSZM4.js";
|
|
106
1
|
import {
|
|
107
2
|
ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED,
|
|
108
3
|
ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED,
|
|
@@ -352,6 +247,111 @@ import {
|
|
|
352
247
|
init_stable_events,
|
|
353
248
|
init_stable_metrics
|
|
354
249
|
} from "./chunk-EAODRPW4.js";
|
|
250
|
+
import {
|
|
251
|
+
BRAND,
|
|
252
|
+
DIRTY,
|
|
253
|
+
EMPTY_PATH,
|
|
254
|
+
INVALID,
|
|
255
|
+
NEVER,
|
|
256
|
+
OK,
|
|
257
|
+
ParseStatus,
|
|
258
|
+
ZodAny,
|
|
259
|
+
ZodArray,
|
|
260
|
+
ZodBigInt,
|
|
261
|
+
ZodBoolean,
|
|
262
|
+
ZodBranded,
|
|
263
|
+
ZodCatch,
|
|
264
|
+
ZodDate,
|
|
265
|
+
ZodDefault,
|
|
266
|
+
ZodDiscriminatedUnion,
|
|
267
|
+
ZodEffects,
|
|
268
|
+
ZodEnum,
|
|
269
|
+
ZodError,
|
|
270
|
+
ZodFirstPartyTypeKind,
|
|
271
|
+
ZodFunction,
|
|
272
|
+
ZodIntersection,
|
|
273
|
+
ZodIssueCode,
|
|
274
|
+
ZodLazy,
|
|
275
|
+
ZodLiteral,
|
|
276
|
+
ZodMap,
|
|
277
|
+
ZodNaN,
|
|
278
|
+
ZodNativeEnum,
|
|
279
|
+
ZodNever,
|
|
280
|
+
ZodNull,
|
|
281
|
+
ZodNullable,
|
|
282
|
+
ZodNumber,
|
|
283
|
+
ZodObject,
|
|
284
|
+
ZodOptional,
|
|
285
|
+
ZodParsedType,
|
|
286
|
+
ZodPipeline,
|
|
287
|
+
ZodPromise,
|
|
288
|
+
ZodReadonly,
|
|
289
|
+
ZodRecord,
|
|
290
|
+
ZodSet,
|
|
291
|
+
ZodString,
|
|
292
|
+
ZodSymbol,
|
|
293
|
+
ZodTuple,
|
|
294
|
+
ZodType,
|
|
295
|
+
ZodUndefined,
|
|
296
|
+
ZodUnion,
|
|
297
|
+
ZodUnknown,
|
|
298
|
+
ZodVoid,
|
|
299
|
+
addIssueToContext,
|
|
300
|
+
anyType,
|
|
301
|
+
arrayType,
|
|
302
|
+
bigIntType,
|
|
303
|
+
booleanType,
|
|
304
|
+
coerce,
|
|
305
|
+
custom,
|
|
306
|
+
dateType,
|
|
307
|
+
datetimeRegex,
|
|
308
|
+
discriminatedUnionType,
|
|
309
|
+
effectsType,
|
|
310
|
+
en_default,
|
|
311
|
+
enumType,
|
|
312
|
+
functionType,
|
|
313
|
+
getErrorMap,
|
|
314
|
+
getParsedType,
|
|
315
|
+
instanceOfType,
|
|
316
|
+
intersectionType,
|
|
317
|
+
isAborted,
|
|
318
|
+
isAsync,
|
|
319
|
+
isDirty,
|
|
320
|
+
isValid,
|
|
321
|
+
late,
|
|
322
|
+
lazyType,
|
|
323
|
+
literalType,
|
|
324
|
+
makeIssue,
|
|
325
|
+
mapType,
|
|
326
|
+
nanType,
|
|
327
|
+
nativeEnumType,
|
|
328
|
+
neverType,
|
|
329
|
+
nullType,
|
|
330
|
+
nullableType,
|
|
331
|
+
numberType,
|
|
332
|
+
objectType,
|
|
333
|
+
objectUtil,
|
|
334
|
+
oboolean,
|
|
335
|
+
onumber,
|
|
336
|
+
optionalType,
|
|
337
|
+
ostring,
|
|
338
|
+
pipelineType,
|
|
339
|
+
preprocessType,
|
|
340
|
+
promiseType,
|
|
341
|
+
quotelessJson,
|
|
342
|
+
recordType,
|
|
343
|
+
setErrorMap,
|
|
344
|
+
setType,
|
|
345
|
+
strictObjectType,
|
|
346
|
+
stringType,
|
|
347
|
+
symbolType,
|
|
348
|
+
tupleType,
|
|
349
|
+
undefinedType,
|
|
350
|
+
unionType,
|
|
351
|
+
unknownType,
|
|
352
|
+
util,
|
|
353
|
+
voidType
|
|
354
|
+
} from "./chunk-XUFLSZM4.js";
|
|
355
355
|
import {
|
|
356
356
|
NEVER as NEVER2,
|
|
357
357
|
ZodIssueCode as ZodIssueCode2,
|
|
@@ -4514,14 +4514,13 @@ var require_fast_uri = __commonJS({
|
|
|
4514
4514
|
if (!malformedIPLiteral) {
|
|
4515
4515
|
malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
|
|
4516
4516
|
}
|
|
4517
|
-
if (uri.indexOf("%") !== -1 && parsed.host !== void 0 && !malformedIPLiteral) {
|
|
4518
|
-
let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
|
|
4519
|
-
if (!isIP) {
|
|
4520
|
-
host = normalizePercentEncoding(host.toLowerCase());
|
|
4521
|
-
}
|
|
4522
|
-
parsed.host = reescapeHostDelimiters(host, isIP);
|
|
4523
|
-
}
|
|
4524
4517
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
4518
|
+
if (uri.indexOf("%") !== -1) {
|
|
4519
|
+
if (parsed.host !== void 0 && !malformedIPLiteral) {
|
|
4520
|
+
const host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
|
|
4521
|
+
parsed.host = reescapeHostDelimiters(host, isIP);
|
|
4522
|
+
}
|
|
4523
|
+
}
|
|
4525
4524
|
if (parsed.path) {
|
|
4526
4525
|
parsed.path = normalizePathEncoding(parsed.path);
|
|
4527
4526
|
}
|
|
@@ -27357,21 +27356,7 @@ var ETelemetryEventName;
|
|
|
27357
27356
|
ETelemetryEventName2["HISTORY_APPEND_FINISHED"] = "linkque.history.append.finished";
|
|
27358
27357
|
ETelemetryEventName2["HOOK_DRAIN_STARTED"] = "linkque.hook.drain.started";
|
|
27359
27358
|
ETelemetryEventName2["HOOK_DRAIN_FINISHED"] = "linkque.hook.drain.finished";
|
|
27360
|
-
ETelemetryEventName2["DEBUG_CONTENT_RECORDED"] = "linkque.debug.content.recorded";
|
|
27361
27359
|
})(ETelemetryEventName || (ETelemetryEventName = {}));
|
|
27362
|
-
var ETelemetryContentSection;
|
|
27363
|
-
(function(ETelemetryContentSection2) {
|
|
27364
|
-
ETelemetryContentSection2["QUERY_INPUT"] = "query.input";
|
|
27365
|
-
ETelemetryContentSection2["TOOL_INPUT"] = "tool.input";
|
|
27366
|
-
ETelemetryContentSection2["TOOL_OUTPUT"] = "tool.output";
|
|
27367
|
-
ETelemetryContentSection2["MCP_REQUESTED_INPUT"] = "mcp.requested_input";
|
|
27368
|
-
ETelemetryContentSection2["MCP_INPUT"] = "mcp.input";
|
|
27369
|
-
ETelemetryContentSection2["MCP_OUTPUT"] = "mcp.output";
|
|
27370
|
-
ETelemetryContentSection2["SKILL_INPUT"] = "skill.input";
|
|
27371
|
-
ETelemetryContentSection2["SKILL_OUTPUT"] = "skill.output";
|
|
27372
|
-
ETelemetryContentSection2["KNOWLEDGE_INPUT"] = "knowledge.input";
|
|
27373
|
-
ETelemetryContentSection2["KNOWLEDGE_OUTPUT"] = "knowledge.output";
|
|
27374
|
-
})(ETelemetryContentSection || (ETelemetryContentSection = {}));
|
|
27375
27360
|
var ETelemetryOperationName;
|
|
27376
27361
|
(function(ETelemetryOperationName2) {
|
|
27377
27362
|
ETelemetryOperationName2["OPERATION"] = "linkque.operation";
|
|
@@ -28698,11 +28683,6 @@ var LinkquegwEventHookExecutor = class {
|
|
|
28698
28683
|
}
|
|
28699
28684
|
};
|
|
28700
28685
|
|
|
28701
|
-
// ../linkque-agent-runtime/dist/esm/core/telemetry/contentRecording.js
|
|
28702
|
-
function recordContentSection(observation, section, value, availability = "available") {
|
|
28703
|
-
observation?.record(ETelemetryEventName.DEBUG_CONTENT_RECORDED, {}, { section, value, availability });
|
|
28704
|
-
}
|
|
28705
|
-
|
|
28706
28686
|
// ../linkque-agent-runtime/dist/esm/core/skillTools.js
|
|
28707
28687
|
var ACTIVATE_SKILL_TOOL_NAME = "activate_skill";
|
|
28708
28688
|
var AVAILABLE_SKILLS_OPEN = "<available_skills>";
|
|
@@ -28774,43 +28754,18 @@ function createActivateSkillTool(records) {
|
|
|
28774
28754
|
required: ["name"],
|
|
28775
28755
|
additionalProperties: false
|
|
28776
28756
|
},
|
|
28777
|
-
execute: async (args
|
|
28757
|
+
execute: async (args) => {
|
|
28778
28758
|
const name = extractName(args);
|
|
28779
|
-
|
|
28780
|
-
const obs = context2?.observation;
|
|
28781
|
-
recordContentSection(obs, ETelemetryContentSection.SKILL_INPUT, { name: name ?? null });
|
|
28782
|
-
if (!name) {
|
|
28783
|
-
recordContentSection(obs, ETelemetryContentSection.SKILL_OUTPUT, {
|
|
28784
|
-
status: "failed",
|
|
28785
|
-
error: "\u7F3A\u5C11 name \u53C2\u6570",
|
|
28786
|
-
durationMs: Date.now() - startedAt
|
|
28787
|
-
});
|
|
28759
|
+
if (!name)
|
|
28788
28760
|
return "\u6FC0\u6D3B\u6280\u80FD\u5931\u8D25:\u7F3A\u5C11 name \u53C2\u6570\u3002";
|
|
28789
|
-
}
|
|
28790
28761
|
if (!bodyByName.has(name)) {
|
|
28791
|
-
recordContentSection(obs, ETelemetryContentSection.SKILL_OUTPUT, {
|
|
28792
|
-
name,
|
|
28793
|
-
status: "failed",
|
|
28794
|
-
error: `\u672A\u627E\u5230\u6280\u80FD "${name}"`,
|
|
28795
|
-
durationMs: Date.now() - startedAt
|
|
28796
|
-
});
|
|
28797
28762
|
return `\u6FC0\u6D3B\u6280\u80FD\u5931\u8D25:\u672A\u627E\u5230\u6280\u80FD "${name}"\u3002\u53EF\u7528:${[...bodyByName.keys()].join(", ")}`;
|
|
28798
28763
|
}
|
|
28799
28764
|
if (activated.has(name)) {
|
|
28800
|
-
recordContentSection(obs, ETelemetryContentSection.SKILL_OUTPUT, {
|
|
28801
|
-
name,
|
|
28802
|
-
status: "already_loaded",
|
|
28803
|
-
durationMs: Date.now() - startedAt
|
|
28804
|
-
});
|
|
28805
28765
|
return `\u6280\u80FD "${name}" \u5DF2\u5728\u672C\u8F6E\u52A0\u8F7D,\u65E0\u9700\u91CD\u590D\u6FC0\u6D3B\u3002`;
|
|
28806
28766
|
}
|
|
28807
28767
|
activated.add(name);
|
|
28808
28768
|
const body = bodyByName.get(name) ?? "";
|
|
28809
|
-
recordContentSection(obs, ETelemetryContentSection.SKILL_OUTPUT, {
|
|
28810
|
-
name,
|
|
28811
|
-
status: "loaded",
|
|
28812
|
-
durationMs: Date.now() - startedAt
|
|
28813
|
-
});
|
|
28814
28769
|
return `<skill name="${escapeXml(name)}">
|
|
28815
28770
|
${body}
|
|
28816
28771
|
</skill>`;
|
|
@@ -29061,7 +29016,7 @@ function createKnowledgeTools(resources, searchPort, agentId) {
|
|
|
29061
29016
|
additionalProperties: false
|
|
29062
29017
|
},
|
|
29063
29018
|
annotations: { readOnlyHint: true },
|
|
29064
|
-
execute: (
|
|
29019
|
+
execute: () => listKnowledge()
|
|
29065
29020
|
},
|
|
29066
29021
|
{
|
|
29067
29022
|
name: KNOWLEDGE_RECALL_TOOL_NAME,
|
|
@@ -29088,46 +29043,24 @@ function createKnowledgeTools(resources, searchPort, agentId) {
|
|
|
29088
29043
|
additionalProperties: false
|
|
29089
29044
|
},
|
|
29090
29045
|
annotations: { readOnlyHint: true },
|
|
29091
|
-
execute: (args, signal
|
|
29046
|
+
execute: (args, signal) => recallKnowledge(args, signal)
|
|
29092
29047
|
}
|
|
29093
29048
|
];
|
|
29094
|
-
async function listKnowledge(
|
|
29095
|
-
|
|
29096
|
-
recordContentSection(context2?.observation, ETelemetryContentSection.KNOWLEDGE_OUTPUT, {
|
|
29097
|
-
knowledgeBases: result.knowledgeBases.map((kb) => ({
|
|
29098
|
-
knowledgeBaseId: kb.knowledgeBaseId,
|
|
29099
|
-
knowledgeDesc: kb.knowledgeDesc
|
|
29100
|
-
}))
|
|
29101
|
-
});
|
|
29102
|
-
return result;
|
|
29049
|
+
async function listKnowledge() {
|
|
29050
|
+
return { knowledgeBases: await getKnowledgeBases() };
|
|
29103
29051
|
}
|
|
29104
|
-
async function recallKnowledge(args, signal
|
|
29052
|
+
async function recallKnowledge(args, signal) {
|
|
29105
29053
|
const parsed = parseRecallArgs(args);
|
|
29106
|
-
const obs = context2?.observation;
|
|
29107
29054
|
if ("error" in parsed) {
|
|
29108
|
-
recordContentSection(obs, ETelemetryContentSection.KNOWLEDGE_INPUT, {
|
|
29109
|
-
error: parsed.error
|
|
29110
|
-
});
|
|
29111
|
-
recordContentSection(obs, ETelemetryContentSection.KNOWLEDGE_OUTPUT, {
|
|
29112
|
-
hits: [],
|
|
29113
|
-
error: parsed.error
|
|
29114
|
-
});
|
|
29115
29055
|
return { hits: [], error: parsed.error };
|
|
29116
29056
|
}
|
|
29117
|
-
recordContentSection(obs, ETelemetryContentSection.KNOWLEDGE_INPUT, {
|
|
29118
|
-
knowledgeBaseId: parsed.knowledgeBaseId,
|
|
29119
|
-
query: parsed.query,
|
|
29120
|
-
topK: parsed.topK
|
|
29121
|
-
});
|
|
29122
29057
|
const knowledgeBases = await getKnowledgeBases();
|
|
29123
29058
|
const bound = knowledgeBases.some((info) => info.knowledgeBaseId === parsed.knowledgeBaseId);
|
|
29124
29059
|
if (!bound) {
|
|
29125
|
-
|
|
29126
|
-
recordContentSection(obs, ETelemetryContentSection.KNOWLEDGE_OUTPUT, {
|
|
29060
|
+
return {
|
|
29127
29061
|
hits: [],
|
|
29128
|
-
error
|
|
29129
|
-
}
|
|
29130
|
-
return { hits: [], error };
|
|
29062
|
+
error: `knowledgeBaseId \u672A\u7ED1\u5B9A: ${parsed.knowledgeBaseId}\u3002\u8BF7\u5148\u8C03\u7528 knowledge_list \u67E5\u770B\u53EF\u7528\u77E5\u8BC6\u5E93\u3002`
|
|
29063
|
+
};
|
|
29131
29064
|
}
|
|
29132
29065
|
try {
|
|
29133
29066
|
const result = await searchPort.search({
|
|
@@ -29136,18 +29069,10 @@ function createKnowledgeTools(resources, searchPort, agentId) {
|
|
|
29136
29069
|
agentId,
|
|
29137
29070
|
topK: parsed.topK
|
|
29138
29071
|
}, signal);
|
|
29139
|
-
recordContentSection(obs, ETelemetryContentSection.KNOWLEDGE_OUTPUT, {
|
|
29140
|
-
hits: result.hits
|
|
29141
|
-
});
|
|
29142
29072
|
return { hits: result.hits };
|
|
29143
29073
|
} catch (e) {
|
|
29144
29074
|
const msg = e instanceof Error ? e.message : String(e);
|
|
29145
|
-
|
|
29146
|
-
recordContentSection(obs, ETelemetryContentSection.KNOWLEDGE_OUTPUT, {
|
|
29147
|
-
hits: [],
|
|
29148
|
-
error
|
|
29149
|
-
});
|
|
29150
|
-
return { hits: [], error };
|
|
29075
|
+
return { hits: [], error: `\u77E5\u8BC6\u5E93\u68C0\u7D22\u5931\u8D25: ${msg}` };
|
|
29151
29076
|
}
|
|
29152
29077
|
}
|
|
29153
29078
|
async function getKnowledgeBases() {
|
|
@@ -29174,7 +29099,7 @@ var NoopRuntimeObservation = class {
|
|
|
29174
29099
|
startOperation(_operation) {
|
|
29175
29100
|
return this;
|
|
29176
29101
|
}
|
|
29177
|
-
record(_name, _attributes
|
|
29102
|
+
record(_name, _attributes) {
|
|
29178
29103
|
}
|
|
29179
29104
|
finish(_outcome, _attributes) {
|
|
29180
29105
|
}
|
|
@@ -29257,7 +29182,7 @@ var RuntimeObservation = class _RuntimeObservation {
|
|
|
29257
29182
|
find(key) {
|
|
29258
29183
|
return this.associations.get(key);
|
|
29259
29184
|
}
|
|
29260
|
-
record(name, attributes
|
|
29185
|
+
record(name, attributes) {
|
|
29261
29186
|
if (this.abandoned)
|
|
29262
29187
|
return;
|
|
29263
29188
|
try {
|
|
@@ -29265,7 +29190,7 @@ var RuntimeObservation = class _RuntimeObservation {
|
|
|
29265
29190
|
this.resultAttributes = {
|
|
29266
29191
|
[ETelemetryAttribute.LINKQUE_TOOL_FAILURE_STAGE]: attributes[ETelemetryAttribute.LINKQUE_TOOL_FAILURE_STAGE]
|
|
29267
29192
|
};
|
|
29268
|
-
this.sink.record(name, attributes
|
|
29193
|
+
this.sink.record(name, attributes);
|
|
29269
29194
|
} catch {
|
|
29270
29195
|
}
|
|
29271
29196
|
}
|
|
@@ -30405,6 +30330,26 @@ function isRecord5(value) {
|
|
|
30405
30330
|
}
|
|
30406
30331
|
|
|
30407
30332
|
// ../agent-conversation-contract/dist/esm/sse.js
|
|
30333
|
+
var MAX_CONVERSATION_TOOL_CALL_DISPLAY_NAME_LENGTH = 20;
|
|
30334
|
+
function parseConversationToolCallDisplayName(value) {
|
|
30335
|
+
if (typeof value !== "string" || /[\r\n\u2028\u2029]/u.test(value)) {
|
|
30336
|
+
return void 0;
|
|
30337
|
+
}
|
|
30338
|
+
const normalized = value.trim();
|
|
30339
|
+
if (!normalized || normalized.length > MAX_CONVERSATION_TOOL_CALL_DISPLAY_NAME_LENGTH) {
|
|
30340
|
+
return void 0;
|
|
30341
|
+
}
|
|
30342
|
+
return normalized;
|
|
30343
|
+
}
|
|
30344
|
+
function createConversationToolCallStartEvent(toolCallId, toolCallName, displayName) {
|
|
30345
|
+
const normalized = parseConversationToolCallDisplayName(displayName);
|
|
30346
|
+
return {
|
|
30347
|
+
type: EventType.TOOL_CALL_START,
|
|
30348
|
+
toolCallId,
|
|
30349
|
+
toolCallName,
|
|
30350
|
+
...normalized ? { displayName: normalized } : {}
|
|
30351
|
+
};
|
|
30352
|
+
}
|
|
30408
30353
|
function createConversationRunAck(runId, threadId, options = {}) {
|
|
30409
30354
|
return {
|
|
30410
30355
|
event: "ack",
|
|
@@ -30422,8 +30367,18 @@ function createConversationAGUIEvent(data, id) {
|
|
|
30422
30367
|
}
|
|
30423
30368
|
function parseConversationAGUIEvent(value) {
|
|
30424
30369
|
const parsed = EventSchemas.safeParse(value);
|
|
30425
|
-
if (parsed.success)
|
|
30426
|
-
|
|
30370
|
+
if (parsed.success) {
|
|
30371
|
+
if (parsed.data.type !== EventType.TOOL_CALL_START)
|
|
30372
|
+
return parsed.data;
|
|
30373
|
+
const event = parsed.data;
|
|
30374
|
+
const displayName = parseConversationToolCallDisplayName(event.displayName);
|
|
30375
|
+
const baseEvent = { ...event };
|
|
30376
|
+
delete baseEvent.displayName;
|
|
30377
|
+
return {
|
|
30378
|
+
...baseEvent,
|
|
30379
|
+
...displayName ? { displayName } : {}
|
|
30380
|
+
};
|
|
30381
|
+
}
|
|
30427
30382
|
throw new ConversationProtocolValidationError(parsed.error.issues.map((issue3) => `${issue3.path.length ? issue3.path.join(".") : "event"}: ${issue3.message}`));
|
|
30428
30383
|
}
|
|
30429
30384
|
function createConversationTransportError(data, id) {
|
|
@@ -35847,8 +35802,6 @@ var RemoteGatewayMcpServerProvider = class {
|
|
|
35847
35802
|
callTool: (params, resultSchema, requestOptions) => request("tools/call", params, () => client.callTool(params, resultSchema, requestOptions))
|
|
35848
35803
|
};
|
|
35849
35804
|
const callTool = (name, args, signal, options) => callHeaders.run(options?.headers ?? {}, () => this.invocationContext.run(timeoutMs, signal, async (invocation) => {
|
|
35850
|
-
const observation = options?.context?.observation;
|
|
35851
|
-
recordContentSection(observation, ETelemetryContentSection.MCP_REQUESTED_INPUT, args);
|
|
35852
35805
|
const plan = createArgsMappingPlan(name, args, argsMappingRules);
|
|
35853
35806
|
if (plan.requiresUserId) {
|
|
35854
35807
|
if (config.signEndpoint !== void 0 && config.signEndpoint !== DEFAULT_SIGN_ENDPOINT && !config.verifyTokenEndpoint?.trim())
|
|
@@ -35871,18 +35824,15 @@ var RemoteGatewayMcpServerProvider = class {
|
|
|
35871
35824
|
};
|
|
35872
35825
|
}
|
|
35873
35826
|
const mapped = resolveArgsMappingPlan(plan, invocation.auth);
|
|
35874
|
-
recordContentSection(observation, ETelemetryContentSection.MCP_INPUT, mapped);
|
|
35875
35827
|
invocation.signal.throwIfAborted();
|
|
35876
35828
|
const remaining = Math.max(1, invocation.deadline - performance.now());
|
|
35877
35829
|
try {
|
|
35878
|
-
|
|
35830
|
+
return await loggedClient.callTool({ name, arguments: mapped }, void 0, {
|
|
35879
35831
|
signal: invocation.signal,
|
|
35880
35832
|
timeout: remaining,
|
|
35881
35833
|
maxTotalTimeout: remaining,
|
|
35882
35834
|
resetTimeoutOnProgress: false
|
|
35883
35835
|
});
|
|
35884
|
-
recordContentSection(observation, ETelemetryContentSection.MCP_OUTPUT, result);
|
|
35885
|
-
return result;
|
|
35886
35836
|
} catch (error) {
|
|
35887
35837
|
invocation.signal.throwIfAborted();
|
|
35888
35838
|
if (invocation.auth && !(error instanceof McpInvocationError))
|
|
@@ -35911,7 +35861,7 @@ async function listToolsFromClient(client, resourceId, callTool) {
|
|
|
35911
35861
|
const descriptor = {
|
|
35912
35862
|
name: tool.name,
|
|
35913
35863
|
resourceId,
|
|
35914
|
-
execute: (args, signal
|
|
35864
|
+
execute: (args, signal) => callTool(tool.name, args, signal)
|
|
35915
35865
|
};
|
|
35916
35866
|
if (tool.description !== void 0)
|
|
35917
35867
|
descriptor.description = tool.description;
|
|
@@ -37067,11 +37017,7 @@ function mapAgentEventToBaseEvents(event, messageId, thinkingId) {
|
|
|
37067
37017
|
}
|
|
37068
37018
|
case "tool_start": {
|
|
37069
37019
|
const events = [
|
|
37070
|
-
|
|
37071
|
-
type: EventType.TOOL_CALL_START,
|
|
37072
|
-
toolCallId: event.toolCallId,
|
|
37073
|
-
toolCallName: event.toolName
|
|
37074
|
-
}
|
|
37020
|
+
createConversationToolCallStartEvent(event.toolCallId, event.toolName, event.displayName)
|
|
37075
37021
|
];
|
|
37076
37022
|
const argsDelta = safeStringifyArgs(event.args);
|
|
37077
37023
|
if (argsDelta !== "") {
|
|
@@ -37918,7 +37864,7 @@ var OtelRuntimeTelemetry = class {
|
|
|
37918
37864
|
operation.record(`${spec.eventPrefix}.${ETelemetryEventPhase.STARTED}`, {});
|
|
37919
37865
|
return operation;
|
|
37920
37866
|
}
|
|
37921
|
-
emit(operation, name, attributes, critical
|
|
37867
|
+
emit(operation, name, attributes, critical) {
|
|
37922
37868
|
if (this.disposed || this.queue.isExporting)
|
|
37923
37869
|
return;
|
|
37924
37870
|
const contextAttributes = operation.attributes;
|
|
@@ -37957,7 +37903,6 @@ var OtelRuntimeTelemetry = class {
|
|
|
37957
37903
|
eventName: name,
|
|
37958
37904
|
timestamp: time,
|
|
37959
37905
|
observedTimestamp: time,
|
|
37960
|
-
...body !== void 0 ? { body } : {},
|
|
37961
37906
|
severityNumber: record2[ETelemetryAttribute.HARNESS_OPERATION_OUTCOME] === ETelemetryOutcome.ERROR || record2[ETelemetryAttribute.HARNESS_OPERATION_OUTCOME] === ETelemetryOutcome.TIMEOUT ? import_api_logs.SeverityNumber.ERROR : import_api_logs.SeverityNumber.INFO,
|
|
37962
37907
|
severityText: record2[ETelemetryAttribute.HARNESS_OPERATION_OUTCOME] === ETelemetryOutcome.ERROR || record2[ETelemetryAttribute.HARNESS_OPERATION_OUTCOME] === ETelemetryOutcome.TIMEOUT ? import_api_logs.SeverityNumber[import_api_logs.SeverityNumber.ERROR] : import_api_logs.SeverityNumber[import_api_logs.SeverityNumber.INFO],
|
|
37963
37908
|
attributes: record2,
|
|
@@ -38028,11 +37973,10 @@ var OtelObservation = class {
|
|
|
38028
37973
|
return new NoopRuntimeObservation();
|
|
38029
37974
|
return this.owner.createOperation(this.state, spec, this);
|
|
38030
37975
|
}
|
|
38031
|
-
record(name, attributes
|
|
37976
|
+
record(name, attributes) {
|
|
38032
37977
|
if (this.lost || !/^(harness|linkque)\.[a-z0-9_.]{1,128}$/.test(name))
|
|
38033
37978
|
return;
|
|
38034
|
-
|
|
38035
|
-
this.owner.emit(this, name, attributes, critical, body);
|
|
37979
|
+
this.owner.emit(this, name, attributes, name.endsWith(`.${ETelemetryEventPhase.FINISHED}`) || name === ETelemetryEventName.MODEL_USAGE_RECORDED || name === ETelemetryEventName.RUNTIME_UNCAUGHT_ERROR || name.endsWith(`.${ETelemetryEventPhase.OBSERVATION_LOST}`));
|
|
38036
37980
|
}
|
|
38037
37981
|
finish(outcome, attributes) {
|
|
38038
37982
|
if (this.ended)
|
|
@@ -38121,7 +38065,6 @@ export {
|
|
|
38121
38065
|
ETelemetryAttribute,
|
|
38122
38066
|
ETelemetryEventPrefix,
|
|
38123
38067
|
ETelemetryEventName,
|
|
38124
|
-
ETelemetryContentSection,
|
|
38125
38068
|
ETelemetryOperationName,
|
|
38126
38069
|
ETelemetryOutcome,
|
|
38127
38070
|
ETelemetryLossReason,
|
|
@@ -38157,8 +38100,6 @@ export {
|
|
|
38157
38100
|
summarizeBody,
|
|
38158
38101
|
formatHttpLogLine,
|
|
38159
38102
|
LinkquegwEventHookExecutor,
|
|
38160
|
-
recordContentSection,
|
|
38161
|
-
ACTIVATE_SKILL_TOOL_NAME,
|
|
38162
38103
|
parseSkillFile,
|
|
38163
38104
|
buildSkillCatalog,
|
|
38164
38105
|
createActivateSkillTool,
|
|
@@ -38188,6 +38129,8 @@ export {
|
|
|
38188
38129
|
DEFAULT_CONVERSATION_SEARCH_LIMIT,
|
|
38189
38130
|
ConversationHistoryValidationError,
|
|
38190
38131
|
parseConversationHistoryRequest,
|
|
38132
|
+
MAX_CONVERSATION_TOOL_CALL_DISPLAY_NAME_LENGTH,
|
|
38133
|
+
parseConversationToolCallDisplayName,
|
|
38191
38134
|
encodeConversationSseEvent,
|
|
38192
38135
|
streamToConversationEvents,
|
|
38193
38136
|
OtelRuntimeTelemetry
|