linkque-cli-v2 1.3.7 → 1.3.8-beta.1
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 +1085 -317
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-ZNU4GVF3.js → chunk-7MJID6LL.js} +103 -19
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-AACYYAZ6.js → chunk-BU3S4JYG.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-RHMVQTA7.js → chunk-EFUO43CY.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +40 -4
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +2 -2
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +2 -2
- package/vendor/linkque-agent-appwrite-integrate/package.json +1 -1
- package/worker.js +150 -23
package/package.json
CHANGED
package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-ZNU4GVF3.js → chunk-7MJID6LL.js}
RENAMED
|
@@ -27357,7 +27357,21 @@ var ETelemetryEventName;
|
|
|
27357
27357
|
ETelemetryEventName2["HISTORY_APPEND_FINISHED"] = "linkque.history.append.finished";
|
|
27358
27358
|
ETelemetryEventName2["HOOK_DRAIN_STARTED"] = "linkque.hook.drain.started";
|
|
27359
27359
|
ETelemetryEventName2["HOOK_DRAIN_FINISHED"] = "linkque.hook.drain.finished";
|
|
27360
|
+
ETelemetryEventName2["DEBUG_CONTENT_RECORDED"] = "linkque.debug.content.recorded";
|
|
27360
27361
|
})(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 = {}));
|
|
27361
27375
|
var ETelemetryOperationName;
|
|
27362
27376
|
(function(ETelemetryOperationName2) {
|
|
27363
27377
|
ETelemetryOperationName2["OPERATION"] = "linkque.operation";
|
|
@@ -28684,6 +28698,11 @@ var LinkquegwEventHookExecutor = class {
|
|
|
28684
28698
|
}
|
|
28685
28699
|
};
|
|
28686
28700
|
|
|
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
|
+
|
|
28687
28706
|
// ../linkque-agent-runtime/dist/esm/core/skillTools.js
|
|
28688
28707
|
var ACTIVATE_SKILL_TOOL_NAME = "activate_skill";
|
|
28689
28708
|
var AVAILABLE_SKILLS_OPEN = "<available_skills>";
|
|
@@ -28755,18 +28774,43 @@ function createActivateSkillTool(records) {
|
|
|
28755
28774
|
required: ["name"],
|
|
28756
28775
|
additionalProperties: false
|
|
28757
28776
|
},
|
|
28758
|
-
execute: async (args) => {
|
|
28777
|
+
execute: async (args, _signal, context2) => {
|
|
28759
28778
|
const name = extractName(args);
|
|
28760
|
-
|
|
28779
|
+
const startedAt = Date.now();
|
|
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
|
+
});
|
|
28761
28788
|
return "\u6FC0\u6D3B\u6280\u80FD\u5931\u8D25:\u7F3A\u5C11 name \u53C2\u6570\u3002";
|
|
28789
|
+
}
|
|
28762
28790
|
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
|
+
});
|
|
28763
28797
|
return `\u6FC0\u6D3B\u6280\u80FD\u5931\u8D25:\u672A\u627E\u5230\u6280\u80FD "${name}"\u3002\u53EF\u7528:${[...bodyByName.keys()].join(", ")}`;
|
|
28764
28798
|
}
|
|
28765
28799
|
if (activated.has(name)) {
|
|
28800
|
+
recordContentSection(obs, ETelemetryContentSection.SKILL_OUTPUT, {
|
|
28801
|
+
name,
|
|
28802
|
+
status: "already_loaded",
|
|
28803
|
+
durationMs: Date.now() - startedAt
|
|
28804
|
+
});
|
|
28766
28805
|
return `\u6280\u80FD "${name}" \u5DF2\u5728\u672C\u8F6E\u52A0\u8F7D,\u65E0\u9700\u91CD\u590D\u6FC0\u6D3B\u3002`;
|
|
28767
28806
|
}
|
|
28768
28807
|
activated.add(name);
|
|
28769
28808
|
const body = bodyByName.get(name) ?? "";
|
|
28809
|
+
recordContentSection(obs, ETelemetryContentSection.SKILL_OUTPUT, {
|
|
28810
|
+
name,
|
|
28811
|
+
status: "loaded",
|
|
28812
|
+
durationMs: Date.now() - startedAt
|
|
28813
|
+
});
|
|
28770
28814
|
return `<skill name="${escapeXml(name)}">
|
|
28771
28815
|
${body}
|
|
28772
28816
|
</skill>`;
|
|
@@ -29017,7 +29061,7 @@ function createKnowledgeTools(resources, searchPort, agentId) {
|
|
|
29017
29061
|
additionalProperties: false
|
|
29018
29062
|
},
|
|
29019
29063
|
annotations: { readOnlyHint: true },
|
|
29020
|
-
execute: () => listKnowledge()
|
|
29064
|
+
execute: (_args, _signal, context2) => listKnowledge(context2)
|
|
29021
29065
|
},
|
|
29022
29066
|
{
|
|
29023
29067
|
name: KNOWLEDGE_RECALL_TOOL_NAME,
|
|
@@ -29044,24 +29088,46 @@ function createKnowledgeTools(resources, searchPort, agentId) {
|
|
|
29044
29088
|
additionalProperties: false
|
|
29045
29089
|
},
|
|
29046
29090
|
annotations: { readOnlyHint: true },
|
|
29047
|
-
execute: (args, signal) => recallKnowledge(args, signal)
|
|
29091
|
+
execute: (args, signal, context2) => recallKnowledge(args, signal, context2)
|
|
29048
29092
|
}
|
|
29049
29093
|
];
|
|
29050
|
-
async function listKnowledge() {
|
|
29051
|
-
|
|
29094
|
+
async function listKnowledge(context2) {
|
|
29095
|
+
const result = { knowledgeBases: await getKnowledgeBases() };
|
|
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;
|
|
29052
29103
|
}
|
|
29053
|
-
async function recallKnowledge(args, signal) {
|
|
29104
|
+
async function recallKnowledge(args, signal, context2) {
|
|
29054
29105
|
const parsed = parseRecallArgs(args);
|
|
29106
|
+
const obs = context2?.observation;
|
|
29055
29107
|
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
|
+
});
|
|
29056
29115
|
return { hits: [], error: parsed.error };
|
|
29057
29116
|
}
|
|
29117
|
+
recordContentSection(obs, ETelemetryContentSection.KNOWLEDGE_INPUT, {
|
|
29118
|
+
knowledgeBaseId: parsed.knowledgeBaseId,
|
|
29119
|
+
query: parsed.query,
|
|
29120
|
+
topK: parsed.topK
|
|
29121
|
+
});
|
|
29058
29122
|
const knowledgeBases = await getKnowledgeBases();
|
|
29059
29123
|
const bound = knowledgeBases.some((info) => info.knowledgeBaseId === parsed.knowledgeBaseId);
|
|
29060
29124
|
if (!bound) {
|
|
29061
|
-
|
|
29125
|
+
const error = `knowledgeBaseId \u672A\u7ED1\u5B9A: ${parsed.knowledgeBaseId}\u3002\u8BF7\u5148\u8C03\u7528 knowledge_list \u67E5\u770B\u53EF\u7528\u77E5\u8BC6\u5E93\u3002`;
|
|
29126
|
+
recordContentSection(obs, ETelemetryContentSection.KNOWLEDGE_OUTPUT, {
|
|
29062
29127
|
hits: [],
|
|
29063
|
-
error
|
|
29064
|
-
};
|
|
29128
|
+
error
|
|
29129
|
+
});
|
|
29130
|
+
return { hits: [], error };
|
|
29065
29131
|
}
|
|
29066
29132
|
try {
|
|
29067
29133
|
const result = await searchPort.search({
|
|
@@ -29070,10 +29136,18 @@ function createKnowledgeTools(resources, searchPort, agentId) {
|
|
|
29070
29136
|
agentId,
|
|
29071
29137
|
topK: parsed.topK
|
|
29072
29138
|
}, signal);
|
|
29139
|
+
recordContentSection(obs, ETelemetryContentSection.KNOWLEDGE_OUTPUT, {
|
|
29140
|
+
hits: result.hits
|
|
29141
|
+
});
|
|
29073
29142
|
return { hits: result.hits };
|
|
29074
29143
|
} catch (e) {
|
|
29075
29144
|
const msg = e instanceof Error ? e.message : String(e);
|
|
29076
|
-
|
|
29145
|
+
const error = `\u77E5\u8BC6\u5E93\u68C0\u7D22\u5931\u8D25: ${msg}`;
|
|
29146
|
+
recordContentSection(obs, ETelemetryContentSection.KNOWLEDGE_OUTPUT, {
|
|
29147
|
+
hits: [],
|
|
29148
|
+
error
|
|
29149
|
+
});
|
|
29150
|
+
return { hits: [], error };
|
|
29077
29151
|
}
|
|
29078
29152
|
}
|
|
29079
29153
|
async function getKnowledgeBases() {
|
|
@@ -29100,7 +29174,7 @@ var NoopRuntimeObservation = class {
|
|
|
29100
29174
|
startOperation(_operation) {
|
|
29101
29175
|
return this;
|
|
29102
29176
|
}
|
|
29103
|
-
record(_name, _attributes) {
|
|
29177
|
+
record(_name, _attributes, _body) {
|
|
29104
29178
|
}
|
|
29105
29179
|
finish(_outcome, _attributes) {
|
|
29106
29180
|
}
|
|
@@ -29183,7 +29257,7 @@ var RuntimeObservation = class _RuntimeObservation {
|
|
|
29183
29257
|
find(key) {
|
|
29184
29258
|
return this.associations.get(key);
|
|
29185
29259
|
}
|
|
29186
|
-
record(name, attributes) {
|
|
29260
|
+
record(name, attributes, body) {
|
|
29187
29261
|
if (this.abandoned)
|
|
29188
29262
|
return;
|
|
29189
29263
|
try {
|
|
@@ -29191,7 +29265,7 @@ var RuntimeObservation = class _RuntimeObservation {
|
|
|
29191
29265
|
this.resultAttributes = {
|
|
29192
29266
|
[ETelemetryAttribute.LINKQUE_TOOL_FAILURE_STAGE]: attributes[ETelemetryAttribute.LINKQUE_TOOL_FAILURE_STAGE]
|
|
29193
29267
|
};
|
|
29194
|
-
this.sink.record(name, attributes);
|
|
29268
|
+
this.sink.record(name, attributes, body);
|
|
29195
29269
|
} catch {
|
|
29196
29270
|
}
|
|
29197
29271
|
}
|
|
@@ -35773,6 +35847,8 @@ var RemoteGatewayMcpServerProvider = class {
|
|
|
35773
35847
|
callTool: (params, resultSchema, requestOptions) => request("tools/call", params, () => client.callTool(params, resultSchema, requestOptions))
|
|
35774
35848
|
};
|
|
35775
35849
|
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);
|
|
35776
35852
|
const plan = createArgsMappingPlan(name, args, argsMappingRules);
|
|
35777
35853
|
if (plan.requiresUserId) {
|
|
35778
35854
|
if (config.signEndpoint !== void 0 && config.signEndpoint !== DEFAULT_SIGN_ENDPOINT && !config.verifyTokenEndpoint?.trim())
|
|
@@ -35795,15 +35871,18 @@ var RemoteGatewayMcpServerProvider = class {
|
|
|
35795
35871
|
};
|
|
35796
35872
|
}
|
|
35797
35873
|
const mapped = resolveArgsMappingPlan(plan, invocation.auth);
|
|
35874
|
+
recordContentSection(observation, ETelemetryContentSection.MCP_INPUT, mapped);
|
|
35798
35875
|
invocation.signal.throwIfAborted();
|
|
35799
35876
|
const remaining = Math.max(1, invocation.deadline - performance.now());
|
|
35800
35877
|
try {
|
|
35801
|
-
|
|
35878
|
+
const result = await loggedClient.callTool({ name, arguments: mapped }, void 0, {
|
|
35802
35879
|
signal: invocation.signal,
|
|
35803
35880
|
timeout: remaining,
|
|
35804
35881
|
maxTotalTimeout: remaining,
|
|
35805
35882
|
resetTimeoutOnProgress: false
|
|
35806
35883
|
});
|
|
35884
|
+
recordContentSection(observation, ETelemetryContentSection.MCP_OUTPUT, result);
|
|
35885
|
+
return result;
|
|
35807
35886
|
} catch (error) {
|
|
35808
35887
|
invocation.signal.throwIfAborted();
|
|
35809
35888
|
if (invocation.auth && !(error instanceof McpInvocationError))
|
|
@@ -35832,7 +35911,7 @@ async function listToolsFromClient(client, resourceId, callTool) {
|
|
|
35832
35911
|
const descriptor = {
|
|
35833
35912
|
name: tool.name,
|
|
35834
35913
|
resourceId,
|
|
35835
|
-
execute: (args, signal) => callTool(tool.name, args, signal)
|
|
35914
|
+
execute: (args, signal, context2) => callTool(tool.name, args, signal, { context: context2 })
|
|
35836
35915
|
};
|
|
35837
35916
|
if (tool.description !== void 0)
|
|
35838
35917
|
descriptor.description = tool.description;
|
|
@@ -37839,7 +37918,7 @@ var OtelRuntimeTelemetry = class {
|
|
|
37839
37918
|
operation.record(`${spec.eventPrefix}.${ETelemetryEventPhase.STARTED}`, {});
|
|
37840
37919
|
return operation;
|
|
37841
37920
|
}
|
|
37842
|
-
emit(operation, name, attributes, critical) {
|
|
37921
|
+
emit(operation, name, attributes, critical, body) {
|
|
37843
37922
|
if (this.disposed || this.queue.isExporting)
|
|
37844
37923
|
return;
|
|
37845
37924
|
const contextAttributes = operation.attributes;
|
|
@@ -37878,6 +37957,7 @@ var OtelRuntimeTelemetry = class {
|
|
|
37878
37957
|
eventName: name,
|
|
37879
37958
|
timestamp: time,
|
|
37880
37959
|
observedTimestamp: time,
|
|
37960
|
+
...body !== void 0 ? { body } : {},
|
|
37881
37961
|
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,
|
|
37882
37962
|
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],
|
|
37883
37963
|
attributes: record2,
|
|
@@ -37948,10 +38028,11 @@ var OtelObservation = class {
|
|
|
37948
38028
|
return new NoopRuntimeObservation();
|
|
37949
38029
|
return this.owner.createOperation(this.state, spec, this);
|
|
37950
38030
|
}
|
|
37951
|
-
record(name, attributes) {
|
|
38031
|
+
record(name, attributes, body) {
|
|
37952
38032
|
if (this.lost || !/^(harness|linkque)\.[a-z0-9_.]{1,128}$/.test(name))
|
|
37953
38033
|
return;
|
|
37954
|
-
|
|
38034
|
+
const critical = name.endsWith(`.${ETelemetryEventPhase.FINISHED}`) || name === ETelemetryEventName.MODEL_USAGE_RECORDED || name === ETelemetryEventName.RUNTIME_UNCAUGHT_ERROR || name.endsWith(`.${ETelemetryEventPhase.OBSERVATION_LOST}`);
|
|
38035
|
+
this.owner.emit(this, name, attributes, critical, body);
|
|
37955
38036
|
}
|
|
37956
38037
|
finish(outcome, attributes) {
|
|
37957
38038
|
if (this.ended)
|
|
@@ -38040,6 +38121,7 @@ export {
|
|
|
38040
38121
|
ETelemetryAttribute,
|
|
38041
38122
|
ETelemetryEventPrefix,
|
|
38042
38123
|
ETelemetryEventName,
|
|
38124
|
+
ETelemetryContentSection,
|
|
38043
38125
|
ETelemetryOperationName,
|
|
38044
38126
|
ETelemetryOutcome,
|
|
38045
38127
|
ETelemetryLossReason,
|
|
@@ -38075,6 +38157,8 @@ export {
|
|
|
38075
38157
|
summarizeBody,
|
|
38076
38158
|
formatHttpLogLine,
|
|
38077
38159
|
LinkquegwEventHookExecutor,
|
|
38160
|
+
recordContentSection,
|
|
38161
|
+
ACTIVATE_SKILL_TOOL_NAME,
|
|
38078
38162
|
parseSkillFile,
|
|
38079
38163
|
buildSkillCatalog,
|
|
38080
38164
|
createActivateSkillTool,
|
|
@@ -38,14 +38,15 @@ import {
|
|
|
38
38
|
resolveLinkqueGatewayAuth,
|
|
39
39
|
resolveRunStorage,
|
|
40
40
|
toAgentRunMessages
|
|
41
|
-
} from "../../chunk-
|
|
41
|
+
} from "../../chunk-EFUO43CY.js";
|
|
42
42
|
import "../../chunk-IWOFD643.js";
|
|
43
43
|
import "../../chunk-PXCGFBV5.js";
|
|
44
44
|
import "../../chunk-ETG6PNHQ.js";
|
|
45
45
|
import {
|
|
46
46
|
getBakedProtocol
|
|
47
|
-
} from "../../chunk-
|
|
47
|
+
} from "../../chunk-BU3S4JYG.js";
|
|
48
48
|
import {
|
|
49
|
+
ACTIVATE_SKILL_TOOL_NAME,
|
|
49
50
|
CANCEL_CONVERSATION_RUN_OPERATION,
|
|
50
51
|
CONVERSATION_HISTORY_VERSION,
|
|
51
52
|
CardActionDiagnostics,
|
|
@@ -72,6 +73,7 @@ import {
|
|
|
72
73
|
ETelemetryCancelSource,
|
|
73
74
|
ETelemetryCommitStatus,
|
|
74
75
|
ETelemetryCompleteness,
|
|
76
|
+
ETelemetryContentSection,
|
|
75
77
|
ETelemetryCoverage,
|
|
76
78
|
ETelemetryErrorType,
|
|
77
79
|
ETelemetryEventName,
|
|
@@ -145,6 +147,7 @@ import {
|
|
|
145
147
|
projectPresentationReceiptForModel,
|
|
146
148
|
readJsonPointer,
|
|
147
149
|
readStructuredContent,
|
|
150
|
+
recordContentSection,
|
|
148
151
|
redactHeaders,
|
|
149
152
|
resolvePhoneAuthorizationDependency,
|
|
150
153
|
resolveWebSearchResource,
|
|
@@ -154,7 +157,7 @@ import {
|
|
|
154
157
|
summarizeBody,
|
|
155
158
|
warnLogFailure,
|
|
156
159
|
wrapToolWithHooks
|
|
157
|
-
} from "../../chunk-
|
|
160
|
+
} from "../../chunk-7MJID6LL.js";
|
|
158
161
|
import "../../chunk-XUFLSZM4.js";
|
|
159
162
|
import "../../chunk-EAODRPW4.js";
|
|
160
163
|
import "../../chunk-GAYNLDWK.js";
|
|
@@ -7941,6 +7944,7 @@ import { randomUUID as randomUUID7 } from "node:crypto";
|
|
|
7941
7944
|
|
|
7942
7945
|
// ../linkque-agent-runtime/dist/esm/core/telemetry/toolObservation.js
|
|
7943
7946
|
import { randomUUID } from "node:crypto";
|
|
7947
|
+
var isSkillTool = (tool) => (tool.modelName ?? tool.name) === ACTIVATE_SKILL_TOOL_NAME;
|
|
7944
7948
|
function toolResultOutcome(result) {
|
|
7945
7949
|
try {
|
|
7946
7950
|
if (!(result && typeof result === "object")) {
|
|
@@ -7974,8 +7978,19 @@ function observeTool(tool, observation) {
|
|
|
7974
7978
|
detached: false,
|
|
7975
7979
|
links: []
|
|
7976
7980
|
});
|
|
7981
|
+
const captureBody = !isSkillTool(tool);
|
|
7977
7982
|
try {
|
|
7978
|
-
|
|
7983
|
+
if (captureBody) {
|
|
7984
|
+
recordContentSection(operation, ETelemetryContentSection.TOOL_INPUT, args);
|
|
7985
|
+
}
|
|
7986
|
+
const execContext = {
|
|
7987
|
+
...context ?? { toolCallId: "", emit: () => void 0 },
|
|
7988
|
+
observation: operation
|
|
7989
|
+
};
|
|
7990
|
+
const result = await tool.execute(args, signal, execContext);
|
|
7991
|
+
if (captureBody) {
|
|
7992
|
+
recordContentSection(operation, ETelemetryContentSection.TOOL_OUTPUT, result);
|
|
7993
|
+
}
|
|
7979
7994
|
operation.finish(toolResultOutcome(result), {
|
|
7980
7995
|
[ETelemetryAttribute.HARNESS_TOOL_RESULT_STATUS]: toolResultOutcome(result)
|
|
7981
7996
|
});
|
|
@@ -41863,11 +41878,32 @@ var AgentRuntime = class _AgentRuntime {
|
|
|
41863
41878
|
}
|
|
41864
41879
|
}, (observation) => this.runObservedAdvance(request, auth, options, observation), options.signal);
|
|
41865
41880
|
}
|
|
41881
|
+
/**
|
|
41882
|
+
* 记录本次用户输入(RFC §4.1):取进入 Runtime 的本次新消息中最后一条 user message
|
|
41883
|
+
* 的 content,作为 `linkque.debug.content.recorded` 的 body 走 record 链路落入
|
|
41884
|
+
* OTLP logs(body 含 section/value/availability)。不以模型 messages 上下文为输入;
|
|
41885
|
+
* 无 user 文本(卡片交互等)时按可用性如实标记,不伪造自然语言 Query。
|
|
41886
|
+
*/
|
|
41887
|
+
recordCurrentQuery(observation, request) {
|
|
41888
|
+
let lastUser;
|
|
41889
|
+
for (const message of request.messages) {
|
|
41890
|
+
if (message.role === "user")
|
|
41891
|
+
lastUser = message;
|
|
41892
|
+
}
|
|
41893
|
+
const text2 = typeof lastUser?.content === "string" ? lastUser.content : "";
|
|
41894
|
+
const body = {
|
|
41895
|
+
section: ETelemetryContentSection.QUERY_INPUT,
|
|
41896
|
+
value: text2,
|
|
41897
|
+
availability: text2 ? "available" : "not_recorded"
|
|
41898
|
+
};
|
|
41899
|
+
observation.record(ETelemetryEventName.DEBUG_CONTENT_RECORDED, {}, body);
|
|
41900
|
+
}
|
|
41866
41901
|
async *runObservedAdvance(request, auth, options, observation) {
|
|
41867
41902
|
observation.record(ETelemetryEventName.TELEMETRY_COVERAGE, {
|
|
41868
41903
|
[ETelemetryAttribute.LINKQUE_TELEMETRY_COVERAGE]: this.agentLoop instanceof PiAgentLoop ? ETelemetryCoverage.PI_MODEL_TOOL_HOOK : ETelemetryCoverage.CORE_ONLY,
|
|
41869
41904
|
[ETelemetryAttribute.HARNESS_TELEMETRY_COMPLETENESS]: this.agentLoop instanceof PiAgentLoop ? ETelemetryCompleteness.COMPLETE : ETelemetryCompleteness.PARTIAL
|
|
41870
41905
|
});
|
|
41906
|
+
this.recordCurrentQuery(observation, request);
|
|
41871
41907
|
const cleanup = [];
|
|
41872
41908
|
let termination = ETelemetryStreamTermination.CANCEL;
|
|
41873
41909
|
let failed = false;
|
package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
runClientCapability,
|
|
4
4
|
runClientCapabilityCleanup,
|
|
5
5
|
runClientCapabilityResult
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-EFUO43CY.js";
|
|
7
7
|
import "../../chunk-IWOFD643.js";
|
|
8
8
|
import "../../chunk-PXCGFBV5.js";
|
|
9
9
|
import "../../chunk-ETG6PNHQ.js";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-7MJID6LL.js";
|
|
11
11
|
import "../../chunk-XUFLSZM4.js";
|
|
12
12
|
import "../../chunk-EAODRPW4.js";
|
|
13
13
|
import "../../chunk-GAYNLDWK.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getBakedProtocol,
|
|
3
3
|
setBakedProtocol
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-BU3S4JYG.js";
|
|
5
|
+
import "../chunk-7MJID6LL.js";
|
|
6
6
|
import "../chunk-XUFLSZM4.js";
|
|
7
7
|
import "../chunk-EAODRPW4.js";
|
|
8
8
|
import "../chunk-GAYNLDWK.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@alipay/linkque-agent-appwrite-integrate","version":"1.
|
|
1
|
+
{"name":"@alipay/linkque-agent-appwrite-integrate","version":"1.3.8-beta.1","type":"module"}
|