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