linkque-cli-v2 1.6.0 → 1.6.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 +69 -2
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-3WYLH7P7.js → chunk-2ZKZKYDK.js} +49 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-GPVKBHKR.js → chunk-CV22XO3R.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-TSJX2OMA.js → chunk-HINGKYT5.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +106 -8
- 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/worker.js +168 -7
package/linkquejs.js
CHANGED
|
@@ -20467,6 +20467,7 @@ var EHookExecutorName;
|
|
|
20467
20467
|
EHookExecutorName2["SecurityAnswerHookExecutor"] = "SecurityAnswerHookExecutor";
|
|
20468
20468
|
EHookExecutorName2["ImageUnderstandingHookExecutor"] = "ImageUnderstandingHookExecutor";
|
|
20469
20469
|
EHookExecutorName2["McpDiscoveryHookExecutor"] = "McpDiscoveryHookExecutor";
|
|
20470
|
+
EHookExecutorName2["CurrentTimeHookExecutor"] = "CurrentTimeHookExecutor";
|
|
20470
20471
|
})(EHookExecutorName || (EHookExecutorName = {}));
|
|
20471
20472
|
|
|
20472
20473
|
// ../agent-a2ui-card-contract/dist/esm/protocol.js
|
|
@@ -22447,6 +22448,34 @@ function hasInteractiveDescendant(id, components, visited) {
|
|
|
22447
22448
|
return refs.some((ref) => typeof ref === "string" && hasInteractiveDescendant(ref, components, visited));
|
|
22448
22449
|
}
|
|
22449
22450
|
|
|
22451
|
+
// ../agent-a2ui-card-contract/dist/esm/pipeline-input.js
|
|
22452
|
+
function createA2UICardPipelineModelInputSchema(sources) {
|
|
22453
|
+
const properties = {};
|
|
22454
|
+
const required2 = [];
|
|
22455
|
+
sources.forEach((source, index) => {
|
|
22456
|
+
const name = `input${index}`;
|
|
22457
|
+
properties[name] = {
|
|
22458
|
+
...scopeLocalReferences(source.inputSchema, `#/properties/${name}`),
|
|
22459
|
+
description: `\u7B2C ${index} \u4E2A\u6570\u636E\u6E90 ${source.toolName} \u7684 MCP \u8C03\u7528\u53C2\u6570\u3002${source.purpose}`
|
|
22460
|
+
};
|
|
22461
|
+
required2.push(name);
|
|
22462
|
+
});
|
|
22463
|
+
return { type: "object", properties, required: required2, additionalProperties: false };
|
|
22464
|
+
}
|
|
22465
|
+
function scopeLocalReferences(schema, root) {
|
|
22466
|
+
const visit = (value) => {
|
|
22467
|
+
if (Array.isArray(value))
|
|
22468
|
+
return value.map(visit);
|
|
22469
|
+
if (value === null || typeof value !== "object")
|
|
22470
|
+
return value;
|
|
22471
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
|
|
22472
|
+
key,
|
|
22473
|
+
key === "$ref" && typeof entry === "string" && (entry === "#" || entry.startsWith("#/")) ? `${root}${entry.slice(1)}` : visit(entry)
|
|
22474
|
+
]));
|
|
22475
|
+
};
|
|
22476
|
+
return visit(schema);
|
|
22477
|
+
}
|
|
22478
|
+
|
|
22450
22479
|
// ../agent-a2ui-card-contract/dist/esm/validation.js
|
|
22451
22480
|
var FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
22452
22481
|
"array",
|
|
@@ -22661,6 +22690,7 @@ function getA2UICardResourceConfigV4PipelineIssues(value) {
|
|
|
22661
22690
|
exactKeys(value, [
|
|
22662
22691
|
"schemaVersion",
|
|
22663
22692
|
"dataMode",
|
|
22693
|
+
"argumentMode",
|
|
22664
22694
|
"revision",
|
|
22665
22695
|
"displayName",
|
|
22666
22696
|
"description",
|
|
@@ -22676,6 +22706,9 @@ function getA2UICardResourceConfigV4PipelineIssues(value) {
|
|
|
22676
22706
|
if (value.schemaVersion !== "4" || value.dataMode !== "pipeline") {
|
|
22677
22707
|
issues.push(issue2("config.dataMode", "INVALID_DATA_MODE", "pipeline cards require schemaVersion 4 and dataMode pipeline"));
|
|
22678
22708
|
}
|
|
22709
|
+
if (value.argumentMode !== void 0 && value.argumentMode !== "model") {
|
|
22710
|
+
issues.push(issue2("config.argumentMode", "INVALID_ARGUMENT_MODE", "argumentMode must be model"));
|
|
22711
|
+
}
|
|
22679
22712
|
if (!isSafeIdentifier(value.revision)) {
|
|
22680
22713
|
issues.push(issue2("config.revision", "INVALID_CARD_REVISION", "revision must be a stable safe identifier"));
|
|
22681
22714
|
}
|
|
@@ -22685,7 +22718,10 @@ function getA2UICardResourceConfigV4PipelineIssues(value) {
|
|
|
22685
22718
|
optionalString(value.whenNotToUse, "config.whenNotToUse", issues);
|
|
22686
22719
|
validateLooseJsonSchema(value.presentationInputSchema, "config.presentationInputSchema", issues);
|
|
22687
22720
|
const fields = validateFields(value.fields, "config.fields", issues);
|
|
22688
|
-
validatePipelineDataSources(value.dataSources, "config.dataSources", issues);
|
|
22721
|
+
const pipelineSources = validatePipelineDataSources(value.dataSources, "config.dataSources", issues);
|
|
22722
|
+
if (value.argumentMode === "model" && pipelineSources) {
|
|
22723
|
+
validateModelPipelineArguments(value, pipelineSources, "config", issues);
|
|
22724
|
+
}
|
|
22689
22725
|
validateDataTransform(value.dataTransform, "config.dataTransform", issues);
|
|
22690
22726
|
const dataModelSchema = validateLooseJsonSchema(value.dataModelSchema, "config.dataModelSchema", issues);
|
|
22691
22727
|
const card = validateTemplate(value.a2uiTemplate, fields, issues);
|
|
@@ -22811,6 +22847,17 @@ function validateDataSources(value, path24, issues, options = {}) {
|
|
|
22811
22847
|
}
|
|
22812
22848
|
return value;
|
|
22813
22849
|
}
|
|
22850
|
+
function validateModelPipelineArguments(value, sources, path24, issues) {
|
|
22851
|
+
sources.forEach((source, index) => {
|
|
22852
|
+
if (isPlainRecord(source.fixedInput) && Object.keys(source.fixedInput).length || Array.isArray(source.inputBindings) && source.inputBindings.length) {
|
|
22853
|
+
issues.push(issue2(`${path24}.dataSources[${index}]`, "MODEL_ARGUMENTS_CONFLICT", "model arguments cannot be combined with fixedInput or inputBindings"));
|
|
22854
|
+
}
|
|
22855
|
+
});
|
|
22856
|
+
const expected = createA2UICardPipelineModelInputSchema(sources);
|
|
22857
|
+
if (isJsonValue(value.presentationInputSchema) && stableJsonStringify(value.presentationInputSchema) !== stableJsonStringify(expected)) {
|
|
22858
|
+
issues.push(issue2(`${path24}.presentationInputSchema`, "MODEL_ARGUMENT_SCHEMA_MISMATCH", "presentationInputSchema must match the configured MCP input schemas"));
|
|
22859
|
+
}
|
|
22860
|
+
}
|
|
22814
22861
|
function validatePipelineDataSources(value, path24, issues) {
|
|
22815
22862
|
if (!Array.isArray(value) || value.length === 0) {
|
|
22816
22863
|
issues.push(issue2(path24, "INVALID_DATA_SOURCES", "pipeline dataSources must be a non-empty array"));
|
|
@@ -23017,6 +23064,7 @@ function validateManifest(value, path24, issues) {
|
|
|
23017
23064
|
exactKeys(value, [
|
|
23018
23065
|
"schemaVersion",
|
|
23019
23066
|
"dataMode",
|
|
23067
|
+
"argumentMode",
|
|
23020
23068
|
"draftId",
|
|
23021
23069
|
"resourceId",
|
|
23022
23070
|
"baseRevision",
|
|
@@ -23033,6 +23081,9 @@ function validateManifest(value, path24, issues) {
|
|
|
23033
23081
|
if (!isSafeIdentifier(value.draftId)) {
|
|
23034
23082
|
issues.push(issue2(`${path24}.draftId`, "INVALID_DRAFT_ID", "draftId is invalid"));
|
|
23035
23083
|
}
|
|
23084
|
+
if (value.argumentMode !== void 0 && value.argumentMode !== "model") {
|
|
23085
|
+
issues.push(issue2(`${path24}.argumentMode`, "INVALID_ARGUMENT_MODE", "argumentMode must be model"));
|
|
23086
|
+
}
|
|
23036
23087
|
if (!isSafeIdentifier(value.resourceId)) {
|
|
23037
23088
|
issues.push(issue2(`${path24}.resourceId`, "INVALID_RESOURCE_ID", "resourceId is invalid"));
|
|
23038
23089
|
}
|
|
@@ -23043,7 +23094,10 @@ function validateManifest(value, path24, issues) {
|
|
|
23043
23094
|
optionalString(value.whenNotToUse, `${path24}.whenNotToUse`, issues);
|
|
23044
23095
|
validateLooseJsonSchema(value.presentationInputSchema, `${path24}.presentationInputSchema`, issues);
|
|
23045
23096
|
const fields2 = validateFields(value.fields, `${path24}.fields`, issues);
|
|
23046
|
-
validatePipelineDataSources(value.dataSources, `${path24}.dataSources`, issues);
|
|
23097
|
+
const pipelineSources = validatePipelineDataSources(value.dataSources, `${path24}.dataSources`, issues);
|
|
23098
|
+
if (value.argumentMode === "model" && pipelineSources) {
|
|
23099
|
+
validateModelPipelineArguments(value, pipelineSources, path24, issues);
|
|
23100
|
+
}
|
|
23047
23101
|
validateDataTransform(value.dataTransform, `${path24}.dataTransform`, issues);
|
|
23048
23102
|
const dataModelSchema = validateLooseJsonSchema(value.dataModelSchema, `${path24}.dataModelSchema`, issues);
|
|
23049
23103
|
if (fields2 && dataModelSchema) {
|
|
@@ -23600,6 +23654,7 @@ function compilePipelineResource(draft, revision) {
|
|
|
23600
23654
|
const resource = {
|
|
23601
23655
|
schemaVersion: "4",
|
|
23602
23656
|
dataMode: "pipeline",
|
|
23657
|
+
...draft.manifest.argumentMode ? { argumentMode: draft.manifest.argumentMode } : {},
|
|
23603
23658
|
revision,
|
|
23604
23659
|
displayName: draft.manifest.displayName,
|
|
23605
23660
|
description: draft.manifest.description,
|
|
@@ -41482,6 +41537,12 @@ async function finalizeCardWhileLocked(cwd, draftId, expectedDraftChecksum) {
|
|
|
41482
41537
|
"\u5F53\u524D Agent Runtime \u4E0D\u652F\u6301\u670D\u52A1\u7AEF\u6570\u636E\u8F6C\u6362 pipeline\uFF0C\u8BF7\u5148\u5347\u7EA7 Runtime"
|
|
41483
41538
|
);
|
|
41484
41539
|
}
|
|
41540
|
+
if (bundle.manifest.schemaVersion === "4" && bundle.manifest.dataMode === "pipeline" && bundle.manifest.argumentMode === "model" && !await readRuntimeSupportsModelFilledPipelineArguments(cwd)) {
|
|
41541
|
+
throw new LinkqueCliError(
|
|
41542
|
+
"CARD_RUNTIME_SCHEMA_UNSUPPORTED",
|
|
41543
|
+
"\u5F53\u524D Agent Runtime \u4E0D\u652F\u6301\u6A21\u578B\u586B\u5199\u591A MCP \u53C2\u6570\uFF0C\u8BF7\u5148\u5347\u7EA7 Runtime"
|
|
41544
|
+
);
|
|
41545
|
+
}
|
|
41485
41546
|
if (bundle.manifest.schemaVersion === "4" && bundle.manifest.dataMode === "pipeline") {
|
|
41486
41547
|
const executor = new DataTransformExecutor();
|
|
41487
41548
|
try {
|
|
@@ -41838,6 +41899,12 @@ async function readRuntimeSupportsDataPipeline(cwd) {
|
|
|
41838
41899
|
).catch(() => void 0);
|
|
41839
41900
|
return isJsonObject(value) && value.schemaVersion === 1 && isJsonObject(value.a2uiCard) && value.a2uiCard.serverDataPipeline === true;
|
|
41840
41901
|
}
|
|
41902
|
+
async function readRuntimeSupportsModelFilledPipelineArguments(cwd) {
|
|
41903
|
+
const value = await readOptionalJson(
|
|
41904
|
+
import_path22.default.join(cwd, RUNTIME_CAPABILITIES_PATH)
|
|
41905
|
+
).catch(() => void 0);
|
|
41906
|
+
return isJsonObject(value) && value.schemaVersion === 1 && isJsonObject(value.a2uiCard) && value.a2uiCard.serverDataPipeline === true && value.a2uiCard.modelFilledPipelineArguments === true;
|
|
41907
|
+
}
|
|
41841
41908
|
function containsFunctionAction(value) {
|
|
41842
41909
|
if (Array.isArray(value)) return value.some(containsFunctionAction);
|
|
41843
41910
|
if (!isJsonObject(value)) return false;
|
package/package.json
CHANGED
package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-3WYLH7P7.js → chunk-2ZKZKYDK.js}
RENAMED
|
@@ -22684,6 +22684,7 @@ var EHookExecutorName;
|
|
|
22684
22684
|
EHookExecutorName2["SecurityAnswerHookExecutor"] = "SecurityAnswerHookExecutor";
|
|
22685
22685
|
EHookExecutorName2["ImageUnderstandingHookExecutor"] = "ImageUnderstandingHookExecutor";
|
|
22686
22686
|
EHookExecutorName2["McpDiscoveryHookExecutor"] = "McpDiscoveryHookExecutor";
|
|
22687
|
+
EHookExecutorName2["CurrentTimeHookExecutor"] = "CurrentTimeHookExecutor";
|
|
22687
22688
|
})(EHookExecutorName || (EHookExecutorName = {}));
|
|
22688
22689
|
|
|
22689
22690
|
// ../linkque-agent-runtime/dist/esm/core/followUpQuestions.js
|
|
@@ -24766,6 +24767,34 @@ function hasInteractiveDescendant(id, components, visited) {
|
|
|
24766
24767
|
return refs.some((ref) => typeof ref === "string" && hasInteractiveDescendant(ref, components, visited));
|
|
24767
24768
|
}
|
|
24768
24769
|
|
|
24770
|
+
// ../agent-a2ui-card-contract/dist/esm/pipeline-input.js
|
|
24771
|
+
function createA2UICardPipelineModelInputSchema(sources) {
|
|
24772
|
+
const properties = {};
|
|
24773
|
+
const required = [];
|
|
24774
|
+
sources.forEach((source, index) => {
|
|
24775
|
+
const name = `input${index}`;
|
|
24776
|
+
properties[name] = {
|
|
24777
|
+
...scopeLocalReferences(source.inputSchema, `#/properties/${name}`),
|
|
24778
|
+
description: `\u7B2C ${index} \u4E2A\u6570\u636E\u6E90 ${source.toolName} \u7684 MCP \u8C03\u7528\u53C2\u6570\u3002${source.purpose}`
|
|
24779
|
+
};
|
|
24780
|
+
required.push(name);
|
|
24781
|
+
});
|
|
24782
|
+
return { type: "object", properties, required, additionalProperties: false };
|
|
24783
|
+
}
|
|
24784
|
+
function scopeLocalReferences(schema, root) {
|
|
24785
|
+
const visit = (value) => {
|
|
24786
|
+
if (Array.isArray(value))
|
|
24787
|
+
return value.map(visit);
|
|
24788
|
+
if (value === null || typeof value !== "object")
|
|
24789
|
+
return value;
|
|
24790
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
|
|
24791
|
+
key,
|
|
24792
|
+
key === "$ref" && typeof entry === "string" && (entry === "#" || entry.startsWith("#/")) ? `${root}${entry.slice(1)}` : visit(entry)
|
|
24793
|
+
]));
|
|
24794
|
+
};
|
|
24795
|
+
return visit(schema);
|
|
24796
|
+
}
|
|
24797
|
+
|
|
24769
24798
|
// ../agent-a2ui-card-contract/dist/esm/validation.js
|
|
24770
24799
|
var FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
24771
24800
|
"array",
|
|
@@ -24867,6 +24896,7 @@ function getA2UICardResourceConfigV4PipelineIssues(value) {
|
|
|
24867
24896
|
exactKeys(value, [
|
|
24868
24897
|
"schemaVersion",
|
|
24869
24898
|
"dataMode",
|
|
24899
|
+
"argumentMode",
|
|
24870
24900
|
"revision",
|
|
24871
24901
|
"displayName",
|
|
24872
24902
|
"description",
|
|
@@ -24882,6 +24912,9 @@ function getA2UICardResourceConfigV4PipelineIssues(value) {
|
|
|
24882
24912
|
if (value.schemaVersion !== "4" || value.dataMode !== "pipeline") {
|
|
24883
24913
|
issues.push(issue2("config.dataMode", "INVALID_DATA_MODE", "pipeline cards require schemaVersion 4 and dataMode pipeline"));
|
|
24884
24914
|
}
|
|
24915
|
+
if (value.argumentMode !== void 0 && value.argumentMode !== "model") {
|
|
24916
|
+
issues.push(issue2("config.argumentMode", "INVALID_ARGUMENT_MODE", "argumentMode must be model"));
|
|
24917
|
+
}
|
|
24885
24918
|
if (!isSafeIdentifier(value.revision)) {
|
|
24886
24919
|
issues.push(issue2("config.revision", "INVALID_CARD_REVISION", "revision must be a stable safe identifier"));
|
|
24887
24920
|
}
|
|
@@ -24891,7 +24924,10 @@ function getA2UICardResourceConfigV4PipelineIssues(value) {
|
|
|
24891
24924
|
optionalString(value.whenNotToUse, "config.whenNotToUse", issues);
|
|
24892
24925
|
validateLooseJsonSchema(value.presentationInputSchema, "config.presentationInputSchema", issues);
|
|
24893
24926
|
const fields = validateFields(value.fields, "config.fields", issues);
|
|
24894
|
-
validatePipelineDataSources(value.dataSources, "config.dataSources", issues);
|
|
24927
|
+
const pipelineSources = validatePipelineDataSources(value.dataSources, "config.dataSources", issues);
|
|
24928
|
+
if (value.argumentMode === "model" && pipelineSources) {
|
|
24929
|
+
validateModelPipelineArguments(value, pipelineSources, "config", issues);
|
|
24930
|
+
}
|
|
24895
24931
|
validateDataTransform(value.dataTransform, "config.dataTransform", issues);
|
|
24896
24932
|
const dataModelSchema = validateLooseJsonSchema(value.dataModelSchema, "config.dataModelSchema", issues);
|
|
24897
24933
|
const card = validateTemplate(value.a2uiTemplate, fields, issues);
|
|
@@ -25017,6 +25053,17 @@ function validateDataSources(value, path2, issues, options = {}) {
|
|
|
25017
25053
|
}
|
|
25018
25054
|
return value;
|
|
25019
25055
|
}
|
|
25056
|
+
function validateModelPipelineArguments(value, sources, path2, issues) {
|
|
25057
|
+
sources.forEach((source, index) => {
|
|
25058
|
+
if (isPlainRecord(source.fixedInput) && Object.keys(source.fixedInput).length || Array.isArray(source.inputBindings) && source.inputBindings.length) {
|
|
25059
|
+
issues.push(issue2(`${path2}.dataSources[${index}]`, "MODEL_ARGUMENTS_CONFLICT", "model arguments cannot be combined with fixedInput or inputBindings"));
|
|
25060
|
+
}
|
|
25061
|
+
});
|
|
25062
|
+
const expected = createA2UICardPipelineModelInputSchema(sources);
|
|
25063
|
+
if (isJsonValue(value.presentationInputSchema) && stableJsonStringify(value.presentationInputSchema) !== stableJsonStringify(expected)) {
|
|
25064
|
+
issues.push(issue2(`${path2}.presentationInputSchema`, "MODEL_ARGUMENT_SCHEMA_MISMATCH", "presentationInputSchema must match the configured MCP input schemas"));
|
|
25065
|
+
}
|
|
25066
|
+
}
|
|
25020
25067
|
function validatePipelineDataSources(value, path2, issues) {
|
|
25021
25068
|
if (!Array.isArray(value) || value.length === 0) {
|
|
25022
25069
|
issues.push(issue2(path2, "INVALID_DATA_SOURCES", "pipeline dataSources must be a non-empty array"));
|
|
@@ -39184,6 +39231,7 @@ export {
|
|
|
39184
39231
|
writeJsonPointer,
|
|
39185
39232
|
validateJsonSchemaValue2 as validateJsonSchemaValue,
|
|
39186
39233
|
normalizeCardDataValue,
|
|
39234
|
+
createA2UICardPipelineModelInputSchema,
|
|
39187
39235
|
executeA2UICardResolver,
|
|
39188
39236
|
parseA2UIFunctionMcpExecuteRequest,
|
|
39189
39237
|
stableToolName,
|
|
@@ -39,13 +39,13 @@ import {
|
|
|
39
39
|
resolveRunStorage,
|
|
40
40
|
toAgentRunMessages,
|
|
41
41
|
withIsoTimestamp
|
|
42
|
-
} from "../../chunk-
|
|
42
|
+
} from "../../chunk-HINGKYT5.js";
|
|
43
43
|
import "../../chunk-IWOFD643.js";
|
|
44
44
|
import "../../chunk-PXCGFBV5.js";
|
|
45
45
|
import "../../chunk-ETG6PNHQ.js";
|
|
46
46
|
import {
|
|
47
47
|
getBakedProtocol
|
|
48
|
-
} from "../../chunk-
|
|
48
|
+
} from "../../chunk-CV22XO3R.js";
|
|
49
49
|
import {
|
|
50
50
|
ACTIVATE_SKILL_TOOL_NAME,
|
|
51
51
|
CANCEL_CONVERSATION_RUN_OPERATION,
|
|
@@ -126,6 +126,7 @@ import {
|
|
|
126
126
|
buildSkillCatalog,
|
|
127
127
|
cloneJsonObject,
|
|
128
128
|
cloneJsonValue,
|
|
129
|
+
createA2UICardPipelineModelInputSchema,
|
|
129
130
|
createActivateSkillTool,
|
|
130
131
|
createCardPresentationToolName,
|
|
131
132
|
createKnowledgeTools,
|
|
@@ -181,7 +182,7 @@ import {
|
|
|
181
182
|
warnLogFailure,
|
|
182
183
|
wrapToolWithHooks,
|
|
183
184
|
writeJsonPointer
|
|
184
|
-
} from "../../chunk-
|
|
185
|
+
} from "../../chunk-2ZKZKYDK.js";
|
|
185
186
|
import "../../chunk-EAODRPW4.js";
|
|
186
187
|
import "../../chunk-XUFLSZM4.js";
|
|
187
188
|
import "../../chunk-GAYNLDWK.js";
|
|
@@ -41790,17 +41791,17 @@ async function executeCardDataPipeline(input) {
|
|
|
41790
41791
|
if (!invocation) {
|
|
41791
41792
|
throw new CardDataPipelineError("CARD_PIPELINE_INPUT_INVALID", "\u5361\u7247\u52A8\u6001\u53C2\u6570\u5FC5\u987B\u662F JSON \u5BF9\u8C61", void 0, "input");
|
|
41792
41793
|
}
|
|
41793
|
-
assertSchema(input.config.presentationInputSchema, invocation, "CARD_PIPELINE_INPUT_INVALID", "\u5361\u7247\u52A8\u6001\u53C2\u6570");
|
|
41794
|
+
assertSchema(input.config.argumentMode === "model" ? createA2UICardPipelineModelInputSchema(input.config.dataSources) : input.config.presentationInputSchema, invocation, "CARD_PIPELINE_INPUT_INVALID", "\u5361\u7247\u52A8\u6001\u53C2\u6570");
|
|
41794
41795
|
const prepared = await Promise.all(input.config.dataSources.map(async (source, index2) => {
|
|
41795
41796
|
const handle = await input.registry.resolve(source.mcpResourceId, source.toolName, input.signal);
|
|
41796
41797
|
if (!handle) {
|
|
41797
41798
|
throw new CardDataPipelineError("CARD_PIPELINE_MCP_UNAVAILABLE", `\u7B2C ${index2} \u4E2A MCP \u5DE5\u5177 ${source.mcpResourceId}/${source.toolName} \u5F53\u524D\u4E0D\u53EF\u7528`, index2, "mcp");
|
|
41798
41799
|
}
|
|
41799
|
-
const callInput = cloneJsonObject(source.fixedInput);
|
|
41800
|
+
const callInput = cloneJsonObject(input.config.argumentMode === "model" ? invocation[`input${index2}`] : source.fixedInput);
|
|
41800
41801
|
if (!callInput) {
|
|
41801
|
-
throw new CardDataPipelineError("CARD_PIPELINE_INPUT_INVALID", `\u7B2C ${index2} \u4E2A MCP \u56FA\u5B9A\u53C2\u6570\u4E0D\u662F JSON \u5BF9\u8C61`, index2, "input");
|
|
41802
|
+
throw new CardDataPipelineError("CARD_PIPELINE_INPUT_INVALID", input.config.argumentMode === "model" ? `\u7B2C ${index2} \u4E2A MCP \u6A21\u578B\u53C2\u6570\u4E0D\u662F JSON \u5BF9\u8C61` : `\u7B2C ${index2} \u4E2A MCP \u56FA\u5B9A\u53C2\u6570\u4E0D\u662F JSON \u5BF9\u8C61`, index2, "input");
|
|
41802
41803
|
}
|
|
41803
|
-
for (const binding of source.inputBindings) {
|
|
41804
|
+
for (const binding of input.config.argumentMode === "model" ? [] : source.inputBindings) {
|
|
41804
41805
|
const value = binding.source.kind === "invocation" ? readJsonPointer(invocation, binding.source.path) : input.runtimeContext[binding.source.key];
|
|
41805
41806
|
const cloned = value === void 0 ? void 0 : cloneJsonValue(value);
|
|
41806
41807
|
if (cloned === void 0 || !writeJsonPointer(callInput, binding.inputPath, cloned)) {
|
|
@@ -41937,7 +41938,7 @@ var CardRenderMcpServer = class {
|
|
|
41937
41938
|
label: config.displayName,
|
|
41938
41939
|
description: `${createPresentationDescription(config)}
|
|
41939
41940
|
\u8C03\u7528\u540E\u4F1A\u4E00\u6B21\u6027\u6821\u9A8C\u53C2\u6570\u3001\u5E76\u884C\u83B7\u53D6\u5168\u90E8\u6570\u636E\u5E76\u751F\u6210\u5361\u7247\uFF1B\u4E0D\u9700\u8981\u518D\u8C03\u7528 card_source \u6216 card_finish\u3002`,
|
|
41940
|
-
inputSchema: config.presentationInputSchema,
|
|
41941
|
+
inputSchema: config.argumentMode === "model" ? createA2UICardPipelineModelInputSchema(config.dataSources) : config.presentationInputSchema,
|
|
41941
41942
|
execute: async (args, signal, context) => {
|
|
41942
41943
|
const startedAt = Date.now();
|
|
41943
41944
|
try {
|
|
@@ -43772,6 +43773,100 @@ var DefaultHarnessPromptPlugin = class {
|
|
|
43772
43773
|
};
|
|
43773
43774
|
};
|
|
43774
43775
|
|
|
43776
|
+
// ../linkque-agent-runtime/dist/esm/impl/plugin/currentTimePlugin.js
|
|
43777
|
+
var CURRENT_TIME_PLUGIN_NAME = "current-time";
|
|
43778
|
+
var CURRENT_TIME_TOOL_NAME = "get_current_time";
|
|
43779
|
+
function createCurrentTimeTool() {
|
|
43780
|
+
return {
|
|
43781
|
+
name: CURRENT_TIME_TOOL_NAME,
|
|
43782
|
+
modelName: CURRENT_TIME_TOOL_NAME,
|
|
43783
|
+
label: "\u5F53\u524D\u65F6\u95F4",
|
|
43784
|
+
description: "\u67E5\u8BE2\u5F53\u524D\u65E5\u671F\u3001\u65F6\u95F4\u3001\u661F\u671F\u548C\u65F6\u533A\uFF0C\u4E3A\u6D89\u53CA\u65F6\u95F4\u7684\u63D0\u95EE\u4E0E\u4EFB\u52A1\u63D0\u4F9B\u5B9E\u65F6\u57FA\u51C6\u3002\u4F7F\u7528\u573A\u666F\uFF1A\u7528\u6237\u8BE2\u95EE\u73B0\u5728\u51E0\u70B9\u3001\u4ECA\u5929\u51E0\u53F7\u6216\u661F\u671F\u51E0\uFF1B\u9700\u8981\u628A\u201C\u4ECA\u5929\uFF0F\u660E\u5929\uFF0F\u672C\u5468\uFF0F\u6700\u8FD1\u201D\u7B49\u76F8\u5BF9\u65F6\u95F4\u8F6C\u6210\u5177\u4F53\u65E5\u671F\uFF1B\u8FDB\u884C\u4EFB\u52A1\u89C4\u5212\u3001\u6392\u671F\u3001\u622A\u6B62\u65F6\u95F4\u6216\u5269\u4F59\u65F6\u957F\u8BA1\u7B97\u3001\u5224\u65AD\u662F\u5426\u8FC7\u671F\uFF0C\u6216\u4E3A\u641C\u7D22\u786E\u5B9A\u76F8\u5BF9\u65F6\u95F4\u8303\u56F4\u65F6\uFF0C\u5E94\u5148\u8C03\u7528\u672C\u5DE5\u5177\u3002\u7528\u6237\u65E0\u9700\u660E\u786E\u6307\u5B9A\u5DE5\u5177\u540D\u3002\u4E0D\u8981\u5C06\u8BAD\u7EC3\u77E5\u8BC6\u3001\u5386\u53F2\u6D88\u606F\u65F6\u95F4\u6216\u5148\u524D\u5DE5\u5177\u7ED3\u679C\u5F53\u4F5C\u5F53\u524D\u65F6\u95F4\uFF1B\u957F\u4EFB\u52A1\u518D\u6B21\u4F9D\u8D56\u201C\u73B0\u5728\u201D\u65F6\u5E94\u91CD\u65B0\u67E5\u8BE2\u3002timeZone \u53EF\u9009\uFF0C\u4F7F\u7528 IANA \u65F6\u533A\u540D\u79F0\uFF0C\u4F8B\u5982 Asia/Shanghai\u3001America/New_York\uFF1B\u9ED8\u8BA4 Asia/Shanghai\uFF08\u5317\u4EAC\u65F6\u95F4\uFF09\uFF0C\u4E0D\u4EE3\u8868\u5DF2\u8BC6\u522B\u7528\u6237\u6240\u5728\u5730\u3002\u7528\u6237\u6307\u5B9A\u5176\u4ED6\u65F6\u533A\u65F6\u5E94\u4F20\u5165\u5BF9\u5E94\u65F6\u533A\uFF1B\u4EFB\u52A1\u5BF9\u65F6\u533A\u654F\u611F\u4E14\u7528\u6237\u6240\u5728\u5730\u4E0D\u660E\u65F6\u5E94\u786E\u8BA4\u65F6\u533A\u3002\u8FD4\u56DE\u6307\u5B9A\u65F6\u533A\u7684\u65E5\u671F\u65F6\u95F4\u3001\u661F\u671F\u548C UTC \u504F\u79FB\uFF0C\u4EE5\u53CA UTC \u65F6\u95F4\u548C\u6BEB\u79D2\u65F6\u95F4\u6233\u3002\u4EC5\u67E5\u8BE2\u65F6\u95F4\uFF0C\u4E0D\u521B\u5EFA\u63D0\u9192\u6216\u5B9A\u65F6\u4EFB\u52A1\uFF0C\u4E5F\u4E0D\u9A8C\u8BC1\u65B0\u95FB\u7B49\u4E8B\u5B9E\u662F\u5426\u6700\u65B0\uFF1B\u5DF2\u6709\u660E\u786E\u65E5\u671F\u4E14\u4E0D\u4F9D\u8D56\u5F53\u524D\u65F6\u95F4\u7684\u8BA1\u7B97\u65E0\u9700\u8C03\u7528\u3002",
|
|
43785
|
+
inputSchema: {
|
|
43786
|
+
type: "object",
|
|
43787
|
+
properties: {
|
|
43788
|
+
timeZone: {
|
|
43789
|
+
type: "string",
|
|
43790
|
+
minLength: 1,
|
|
43791
|
+
description: "IANA \u65F6\u533A\u540D\u79F0\uFF0C\u9ED8\u8BA4 Asia/Shanghai"
|
|
43792
|
+
}
|
|
43793
|
+
},
|
|
43794
|
+
additionalProperties: false
|
|
43795
|
+
},
|
|
43796
|
+
annotations: { readOnlyHint: true },
|
|
43797
|
+
execute: async (args, signal) => {
|
|
43798
|
+
signal?.throwIfAborted();
|
|
43799
|
+
if (typeof args !== "object" || args === null || Array.isArray(args) || Object.keys(args).some((key) => key !== "timeZone"))
|
|
43800
|
+
throw new Error("\u53C2\u6570\u5FC5\u987B\u662F\u4EC5\u5305\u542B\u53EF\u9009 timeZone \u7684\u5BF9\u8C61");
|
|
43801
|
+
const requested = args.timeZone;
|
|
43802
|
+
if (requested !== void 0 && (typeof requested !== "string" || !requested.trim()))
|
|
43803
|
+
throw new Error("timeZone \u5FC5\u987B\u662F\u6709\u6548\u7684 IANA \u65F6\u533A\u540D\u79F0");
|
|
43804
|
+
const timeZone = typeof requested === "string" ? requested.trim() : "Asia/Shanghai";
|
|
43805
|
+
const formatter = new Intl.DateTimeFormat("zh-CN", {
|
|
43806
|
+
timeZone,
|
|
43807
|
+
calendar: "gregory",
|
|
43808
|
+
numberingSystem: "latn",
|
|
43809
|
+
year: "numeric",
|
|
43810
|
+
month: "2-digit",
|
|
43811
|
+
day: "2-digit",
|
|
43812
|
+
hour: "2-digit",
|
|
43813
|
+
minute: "2-digit",
|
|
43814
|
+
second: "2-digit",
|
|
43815
|
+
hourCycle: "h23",
|
|
43816
|
+
weekday: "long",
|
|
43817
|
+
timeZoneName: "longOffset"
|
|
43818
|
+
});
|
|
43819
|
+
const now = /* @__PURE__ */ new Date();
|
|
43820
|
+
const parts = Object.fromEntries(formatter.formatToParts(now).map((part) => [part.type, part.value]));
|
|
43821
|
+
return {
|
|
43822
|
+
timeZone: formatter.resolvedOptions().timeZone,
|
|
43823
|
+
date: `${parts.year}-${parts.month}-${parts.day}`,
|
|
43824
|
+
time: `${parts.hour}:${parts.minute}:${parts.second}`,
|
|
43825
|
+
weekday: parts.weekday,
|
|
43826
|
+
utcOffset: parts.timeZoneName === "GMT" ? "+00:00" : parts.timeZoneName.replace("GMT", ""),
|
|
43827
|
+
utc: now.toISOString(),
|
|
43828
|
+
timestampMs: now.getTime()
|
|
43829
|
+
};
|
|
43830
|
+
}
|
|
43831
|
+
};
|
|
43832
|
+
}
|
|
43833
|
+
var CurrentTimePlugin = class {
|
|
43834
|
+
name = CURRENT_TIME_PLUGIN_NAME;
|
|
43835
|
+
hookExecutorList = [
|
|
43836
|
+
{
|
|
43837
|
+
name: EHookExecutorName.CurrentTimeHookExecutor,
|
|
43838
|
+
matches: (_resource, stage) => stage === EHookStage.PREPARE_AGENT_LOOP,
|
|
43839
|
+
execute: async (_resource, context) => context.stage === EHookStage.PREPARE_AGENT_LOOP ? {
|
|
43840
|
+
ok: true,
|
|
43841
|
+
patch: {
|
|
43842
|
+
stage: EHookStage.PREPARE_AGENT_LOOP,
|
|
43843
|
+
additionalTools: [createCurrentTimeTool()]
|
|
43844
|
+
}
|
|
43845
|
+
} : { ok: true, skipped: true }
|
|
43846
|
+
}
|
|
43847
|
+
];
|
|
43848
|
+
modifyAgentConfig = (config) => {
|
|
43849
|
+
const existing = config.agent.resources.filter((resource) => resource.resourceType === EResourceType.HOOK && resource.config.executorName === EHookExecutorName.CurrentTimeHookExecutor);
|
|
43850
|
+
if (existing.length) {
|
|
43851
|
+
const hook = existing[0].config;
|
|
43852
|
+
if (existing.length !== 1 || hook.stage !== EHookStage.PREPARE_AGENT_LOOP || hook.hasSideEffects !== true || hook.enabled === false || hook.matcher !== void 0)
|
|
43853
|
+
throw new Error("\u5F53\u524D\u65F6\u95F4 Hook \u5FC5\u987B\u542F\u7528 PREPARE_AGENT_LOOP + hasSideEffects=true\uFF0C\u4E14\u4E0D\u914D\u7F6E matcher");
|
|
43854
|
+
return;
|
|
43855
|
+
}
|
|
43856
|
+
config.agent.resources.push({
|
|
43857
|
+
resourceId: "current-time-prepare-agent-loop",
|
|
43858
|
+
resourceType: EResourceType.HOOK,
|
|
43859
|
+
providerType: EResourceProviderType.LINK_QUE,
|
|
43860
|
+
config: {
|
|
43861
|
+
name: "\u5F53\u524D\u65F6\u95F4\u5DE5\u5177\u6CE8\u5165",
|
|
43862
|
+
executorName: EHookExecutorName.CurrentTimeHookExecutor,
|
|
43863
|
+
stage: EHookStage.PREPARE_AGENT_LOOP,
|
|
43864
|
+
hasSideEffects: true
|
|
43865
|
+
}
|
|
43866
|
+
});
|
|
43867
|
+
};
|
|
43868
|
+
};
|
|
43869
|
+
|
|
43775
43870
|
// ../linkque-agent-appwrite-integrate/dist/esm/runtime/ports/appbaseSessionManager.js
|
|
43776
43871
|
var AppbaseSessionManager = class {
|
|
43777
43872
|
store;
|
|
@@ -44058,6 +44153,9 @@ function createAppBaseRuntime(protocol, env = process.env, ports = {}, logCtx) {
|
|
|
44058
44153
|
if (!plugins.some((plugin) => plugin.name === MCP_DISCOVERY_PLUGIN_NAME)) {
|
|
44059
44154
|
plugins.push(new McpDiscoveryPlugin());
|
|
44060
44155
|
}
|
|
44156
|
+
if (!plugins.some((plugin) => plugin.name === CURRENT_TIME_PLUGIN_NAME)) {
|
|
44157
|
+
plugins.push(new CurrentTimePlugin());
|
|
44158
|
+
}
|
|
44061
44159
|
if (plugins.length > 0) {
|
|
44062
44160
|
runtimePorts.plugins = plugins;
|
|
44063
44161
|
}
|
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-HINGKYT5.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-2ZKZKYDK.js";
|
|
11
11
|
import "../../chunk-EAODRPW4.js";
|
|
12
12
|
import "../../chunk-XUFLSZM4.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-CV22XO3R.js";
|
|
5
|
+
import "../chunk-2ZKZKYDK.js";
|
|
6
6
|
import "../chunk-EAODRPW4.js";
|
|
7
7
|
import "../chunk-XUFLSZM4.js";
|
|
8
8
|
import "../chunk-GAYNLDWK.js";
|
package/worker.js
CHANGED
|
@@ -388,6 +388,7 @@ var init_agentProtocol = __esm({
|
|
|
388
388
|
EHookExecutorName2["SecurityAnswerHookExecutor"] = "SecurityAnswerHookExecutor";
|
|
389
389
|
EHookExecutorName2["ImageUnderstandingHookExecutor"] = "ImageUnderstandingHookExecutor";
|
|
390
390
|
EHookExecutorName2["McpDiscoveryHookExecutor"] = "McpDiscoveryHookExecutor";
|
|
391
|
+
EHookExecutorName2["CurrentTimeHookExecutor"] = "CurrentTimeHookExecutor";
|
|
391
392
|
})(EHookExecutorName || (EHookExecutorName = {}));
|
|
392
393
|
}
|
|
393
394
|
});
|
|
@@ -10501,6 +10502,39 @@ var init_v4Catalog = __esm({
|
|
|
10501
10502
|
}
|
|
10502
10503
|
});
|
|
10503
10504
|
|
|
10505
|
+
// ../agent-a2ui-card-contract/dist/esm/pipeline-input.js
|
|
10506
|
+
function createA2UICardPipelineModelInputSchema(sources) {
|
|
10507
|
+
const properties = {};
|
|
10508
|
+
const required2 = [];
|
|
10509
|
+
sources.forEach((source, index2) => {
|
|
10510
|
+
const name = `input${index2}`;
|
|
10511
|
+
properties[name] = {
|
|
10512
|
+
...scopeLocalReferences(source.inputSchema, `#/properties/${name}`),
|
|
10513
|
+
description: `\u7B2C ${index2} \u4E2A\u6570\u636E\u6E90 ${source.toolName} \u7684 MCP \u8C03\u7528\u53C2\u6570\u3002${source.purpose}`
|
|
10514
|
+
};
|
|
10515
|
+
required2.push(name);
|
|
10516
|
+
});
|
|
10517
|
+
return { type: "object", properties, required: required2, additionalProperties: false };
|
|
10518
|
+
}
|
|
10519
|
+
function scopeLocalReferences(schema, root) {
|
|
10520
|
+
const visit = (value) => {
|
|
10521
|
+
if (Array.isArray(value))
|
|
10522
|
+
return value.map(visit);
|
|
10523
|
+
if (value === null || typeof value !== "object")
|
|
10524
|
+
return value;
|
|
10525
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
|
|
10526
|
+
key,
|
|
10527
|
+
key === "$ref" && typeof entry === "string" && (entry === "#" || entry.startsWith("#/")) ? `${root}${entry.slice(1)}` : visit(entry)
|
|
10528
|
+
]));
|
|
10529
|
+
};
|
|
10530
|
+
return visit(schema);
|
|
10531
|
+
}
|
|
10532
|
+
var init_pipeline_input = __esm({
|
|
10533
|
+
"../agent-a2ui-card-contract/dist/esm/pipeline-input.js"() {
|
|
10534
|
+
"use strict";
|
|
10535
|
+
}
|
|
10536
|
+
});
|
|
10537
|
+
|
|
10504
10538
|
// ../agent-a2ui-card-contract/dist/esm/validation.js
|
|
10505
10539
|
function getPersistedV4ProtocolIssues(card, path9) {
|
|
10506
10540
|
const issues = [];
|
|
@@ -10582,6 +10616,7 @@ function getA2UICardResourceConfigV4PipelineIssues(value) {
|
|
|
10582
10616
|
exactKeys(value, [
|
|
10583
10617
|
"schemaVersion",
|
|
10584
10618
|
"dataMode",
|
|
10619
|
+
"argumentMode",
|
|
10585
10620
|
"revision",
|
|
10586
10621
|
"displayName",
|
|
10587
10622
|
"description",
|
|
@@ -10597,6 +10632,9 @@ function getA2UICardResourceConfigV4PipelineIssues(value) {
|
|
|
10597
10632
|
if (value.schemaVersion !== "4" || value.dataMode !== "pipeline") {
|
|
10598
10633
|
issues.push(issue2("config.dataMode", "INVALID_DATA_MODE", "pipeline cards require schemaVersion 4 and dataMode pipeline"));
|
|
10599
10634
|
}
|
|
10635
|
+
if (value.argumentMode !== void 0 && value.argumentMode !== "model") {
|
|
10636
|
+
issues.push(issue2("config.argumentMode", "INVALID_ARGUMENT_MODE", "argumentMode must be model"));
|
|
10637
|
+
}
|
|
10600
10638
|
if (!isSafeIdentifier(value.revision)) {
|
|
10601
10639
|
issues.push(issue2("config.revision", "INVALID_CARD_REVISION", "revision must be a stable safe identifier"));
|
|
10602
10640
|
}
|
|
@@ -10606,7 +10644,10 @@ function getA2UICardResourceConfigV4PipelineIssues(value) {
|
|
|
10606
10644
|
optionalString(value.whenNotToUse, "config.whenNotToUse", issues);
|
|
10607
10645
|
validateLooseJsonSchema(value.presentationInputSchema, "config.presentationInputSchema", issues);
|
|
10608
10646
|
const fields = validateFields(value.fields, "config.fields", issues);
|
|
10609
|
-
validatePipelineDataSources(value.dataSources, "config.dataSources", issues);
|
|
10647
|
+
const pipelineSources = validatePipelineDataSources(value.dataSources, "config.dataSources", issues);
|
|
10648
|
+
if (value.argumentMode === "model" && pipelineSources) {
|
|
10649
|
+
validateModelPipelineArguments(value, pipelineSources, "config", issues);
|
|
10650
|
+
}
|
|
10610
10651
|
validateDataTransform(value.dataTransform, "config.dataTransform", issues);
|
|
10611
10652
|
const dataModelSchema = validateLooseJsonSchema(value.dataModelSchema, "config.dataModelSchema", issues);
|
|
10612
10653
|
const card = validateTemplate(value.a2uiTemplate, fields, issues);
|
|
@@ -10732,6 +10773,17 @@ function validateDataSources(value, path9, issues, options = {}) {
|
|
|
10732
10773
|
}
|
|
10733
10774
|
return value;
|
|
10734
10775
|
}
|
|
10776
|
+
function validateModelPipelineArguments(value, sources, path9, issues) {
|
|
10777
|
+
sources.forEach((source, index2) => {
|
|
10778
|
+
if (isPlainRecord(source.fixedInput) && Object.keys(source.fixedInput).length || Array.isArray(source.inputBindings) && source.inputBindings.length) {
|
|
10779
|
+
issues.push(issue2(`${path9}.dataSources[${index2}]`, "MODEL_ARGUMENTS_CONFLICT", "model arguments cannot be combined with fixedInput or inputBindings"));
|
|
10780
|
+
}
|
|
10781
|
+
});
|
|
10782
|
+
const expected = createA2UICardPipelineModelInputSchema(sources);
|
|
10783
|
+
if (isJsonValue(value.presentationInputSchema) && stableJsonStringify(value.presentationInputSchema) !== stableJsonStringify(expected)) {
|
|
10784
|
+
issues.push(issue2(`${path9}.presentationInputSchema`, "MODEL_ARGUMENT_SCHEMA_MISMATCH", "presentationInputSchema must match the configured MCP input schemas"));
|
|
10785
|
+
}
|
|
10786
|
+
}
|
|
10735
10787
|
function validatePipelineDataSources(value, path9, issues) {
|
|
10736
10788
|
if (!Array.isArray(value) || value.length === 0) {
|
|
10737
10789
|
issues.push(issue2(path9, "INVALID_DATA_SOURCES", "pipeline dataSources must be a non-empty array"));
|
|
@@ -11261,6 +11313,7 @@ var init_validation = __esm({
|
|
|
11261
11313
|
init_types2();
|
|
11262
11314
|
init_binding_context();
|
|
11263
11315
|
init_v4Catalog();
|
|
11316
|
+
init_pipeline_input();
|
|
11264
11317
|
FIELD_TYPES = /* @__PURE__ */ new Set([
|
|
11265
11318
|
"array",
|
|
11266
11319
|
"boolean",
|
|
@@ -11768,6 +11821,7 @@ var init_esm3 = __esm({
|
|
|
11768
11821
|
init_function_action();
|
|
11769
11822
|
init_presentation();
|
|
11770
11823
|
init_v4Catalog();
|
|
11824
|
+
init_pipeline_input();
|
|
11771
11825
|
}
|
|
11772
11826
|
});
|
|
11773
11827
|
|
|
@@ -208409,17 +208463,17 @@ async function executeCardDataPipeline(input) {
|
|
|
208409
208463
|
if (!invocation) {
|
|
208410
208464
|
throw new CardDataPipelineError("CARD_PIPELINE_INPUT_INVALID", "\u5361\u7247\u52A8\u6001\u53C2\u6570\u5FC5\u987B\u662F JSON \u5BF9\u8C61", void 0, "input");
|
|
208411
208465
|
}
|
|
208412
|
-
assertSchema(input.config.presentationInputSchema, invocation, "CARD_PIPELINE_INPUT_INVALID", "\u5361\u7247\u52A8\u6001\u53C2\u6570");
|
|
208466
|
+
assertSchema(input.config.argumentMode === "model" ? createA2UICardPipelineModelInputSchema(input.config.dataSources) : input.config.presentationInputSchema, invocation, "CARD_PIPELINE_INPUT_INVALID", "\u5361\u7247\u52A8\u6001\u53C2\u6570");
|
|
208413
208467
|
const prepared = await Promise.all(input.config.dataSources.map(async (source, index2) => {
|
|
208414
208468
|
const handle = await input.registry.resolve(source.mcpResourceId, source.toolName, input.signal);
|
|
208415
208469
|
if (!handle) {
|
|
208416
208470
|
throw new CardDataPipelineError("CARD_PIPELINE_MCP_UNAVAILABLE", `\u7B2C ${index2} \u4E2A MCP \u5DE5\u5177 ${source.mcpResourceId}/${source.toolName} \u5F53\u524D\u4E0D\u53EF\u7528`, index2, "mcp");
|
|
208417
208471
|
}
|
|
208418
|
-
const callInput = cloneJsonObject(source.fixedInput);
|
|
208472
|
+
const callInput = cloneJsonObject(input.config.argumentMode === "model" ? invocation[`input${index2}`] : source.fixedInput);
|
|
208419
208473
|
if (!callInput) {
|
|
208420
|
-
throw new CardDataPipelineError("CARD_PIPELINE_INPUT_INVALID", `\u7B2C ${index2} \u4E2A MCP \u56FA\u5B9A\u53C2\u6570\u4E0D\u662F JSON \u5BF9\u8C61`, index2, "input");
|
|
208474
|
+
throw new CardDataPipelineError("CARD_PIPELINE_INPUT_INVALID", input.config.argumentMode === "model" ? `\u7B2C ${index2} \u4E2A MCP \u6A21\u578B\u53C2\u6570\u4E0D\u662F JSON \u5BF9\u8C61` : `\u7B2C ${index2} \u4E2A MCP \u56FA\u5B9A\u53C2\u6570\u4E0D\u662F JSON \u5BF9\u8C61`, index2, "input");
|
|
208421
208475
|
}
|
|
208422
|
-
for (const binding of source.inputBindings) {
|
|
208476
|
+
for (const binding of input.config.argumentMode === "model" ? [] : source.inputBindings) {
|
|
208423
208477
|
const value = binding.source.kind === "invocation" ? readJsonPointer(invocation, binding.source.path) : input.runtimeContext[binding.source.key];
|
|
208424
208478
|
const cloned = value === void 0 ? void 0 : cloneJsonValue(value);
|
|
208425
208479
|
if (cloned === void 0 || !writeJsonPointer(callInput, binding.inputPath, cloned)) {
|
|
@@ -208560,6 +208614,7 @@ var init_cardRenderMcpServer = __esm({
|
|
|
208560
208614
|
"../linkque-agent-runtime/dist/esm/core/cardRenderMcpServer.js"() {
|
|
208561
208615
|
"use strict";
|
|
208562
208616
|
init_telemetry();
|
|
208617
|
+
init_esm3();
|
|
208563
208618
|
init_cardSourceResult();
|
|
208564
208619
|
init_cardTools();
|
|
208565
208620
|
init_mcpNaming();
|
|
@@ -208625,7 +208680,7 @@ var init_cardRenderMcpServer = __esm({
|
|
|
208625
208680
|
label: config2.displayName,
|
|
208626
208681
|
description: `${createPresentationDescription(config2)}
|
|
208627
208682
|
\u8C03\u7528\u540E\u4F1A\u4E00\u6B21\u6027\u6821\u9A8C\u53C2\u6570\u3001\u5E76\u884C\u83B7\u53D6\u5168\u90E8\u6570\u636E\u5E76\u751F\u6210\u5361\u7247\uFF1B\u4E0D\u9700\u8981\u518D\u8C03\u7528 card_source \u6216 card_finish\u3002`,
|
|
208628
|
-
inputSchema: config2.presentationInputSchema,
|
|
208683
|
+
inputSchema: config2.argumentMode === "model" ? createA2UICardPipelineModelInputSchema(config2.dataSources) : config2.presentationInputSchema,
|
|
208629
208684
|
execute: async (args, signal, context2) => {
|
|
208630
208685
|
const startedAt = Date.now();
|
|
208631
208686
|
try {
|
|
@@ -210682,9 +210737,113 @@ var init_defaultHarnessPromptPlugin = __esm({
|
|
|
210682
210737
|
}
|
|
210683
210738
|
});
|
|
210684
210739
|
|
|
210740
|
+
// ../linkque-agent-runtime/dist/esm/impl/plugin/currentTimePlugin.js
|
|
210741
|
+
function createCurrentTimeTool() {
|
|
210742
|
+
return {
|
|
210743
|
+
name: CURRENT_TIME_TOOL_NAME,
|
|
210744
|
+
modelName: CURRENT_TIME_TOOL_NAME,
|
|
210745
|
+
label: "\u5F53\u524D\u65F6\u95F4",
|
|
210746
|
+
description: "\u67E5\u8BE2\u5F53\u524D\u65E5\u671F\u3001\u65F6\u95F4\u3001\u661F\u671F\u548C\u65F6\u533A\uFF0C\u4E3A\u6D89\u53CA\u65F6\u95F4\u7684\u63D0\u95EE\u4E0E\u4EFB\u52A1\u63D0\u4F9B\u5B9E\u65F6\u57FA\u51C6\u3002\u4F7F\u7528\u573A\u666F\uFF1A\u7528\u6237\u8BE2\u95EE\u73B0\u5728\u51E0\u70B9\u3001\u4ECA\u5929\u51E0\u53F7\u6216\u661F\u671F\u51E0\uFF1B\u9700\u8981\u628A\u201C\u4ECA\u5929\uFF0F\u660E\u5929\uFF0F\u672C\u5468\uFF0F\u6700\u8FD1\u201D\u7B49\u76F8\u5BF9\u65F6\u95F4\u8F6C\u6210\u5177\u4F53\u65E5\u671F\uFF1B\u8FDB\u884C\u4EFB\u52A1\u89C4\u5212\u3001\u6392\u671F\u3001\u622A\u6B62\u65F6\u95F4\u6216\u5269\u4F59\u65F6\u957F\u8BA1\u7B97\u3001\u5224\u65AD\u662F\u5426\u8FC7\u671F\uFF0C\u6216\u4E3A\u641C\u7D22\u786E\u5B9A\u76F8\u5BF9\u65F6\u95F4\u8303\u56F4\u65F6\uFF0C\u5E94\u5148\u8C03\u7528\u672C\u5DE5\u5177\u3002\u7528\u6237\u65E0\u9700\u660E\u786E\u6307\u5B9A\u5DE5\u5177\u540D\u3002\u4E0D\u8981\u5C06\u8BAD\u7EC3\u77E5\u8BC6\u3001\u5386\u53F2\u6D88\u606F\u65F6\u95F4\u6216\u5148\u524D\u5DE5\u5177\u7ED3\u679C\u5F53\u4F5C\u5F53\u524D\u65F6\u95F4\uFF1B\u957F\u4EFB\u52A1\u518D\u6B21\u4F9D\u8D56\u201C\u73B0\u5728\u201D\u65F6\u5E94\u91CD\u65B0\u67E5\u8BE2\u3002timeZone \u53EF\u9009\uFF0C\u4F7F\u7528 IANA \u65F6\u533A\u540D\u79F0\uFF0C\u4F8B\u5982 Asia/Shanghai\u3001America/New_York\uFF1B\u9ED8\u8BA4 Asia/Shanghai\uFF08\u5317\u4EAC\u65F6\u95F4\uFF09\uFF0C\u4E0D\u4EE3\u8868\u5DF2\u8BC6\u522B\u7528\u6237\u6240\u5728\u5730\u3002\u7528\u6237\u6307\u5B9A\u5176\u4ED6\u65F6\u533A\u65F6\u5E94\u4F20\u5165\u5BF9\u5E94\u65F6\u533A\uFF1B\u4EFB\u52A1\u5BF9\u65F6\u533A\u654F\u611F\u4E14\u7528\u6237\u6240\u5728\u5730\u4E0D\u660E\u65F6\u5E94\u786E\u8BA4\u65F6\u533A\u3002\u8FD4\u56DE\u6307\u5B9A\u65F6\u533A\u7684\u65E5\u671F\u65F6\u95F4\u3001\u661F\u671F\u548C UTC \u504F\u79FB\uFF0C\u4EE5\u53CA UTC \u65F6\u95F4\u548C\u6BEB\u79D2\u65F6\u95F4\u6233\u3002\u4EC5\u67E5\u8BE2\u65F6\u95F4\uFF0C\u4E0D\u521B\u5EFA\u63D0\u9192\u6216\u5B9A\u65F6\u4EFB\u52A1\uFF0C\u4E5F\u4E0D\u9A8C\u8BC1\u65B0\u95FB\u7B49\u4E8B\u5B9E\u662F\u5426\u6700\u65B0\uFF1B\u5DF2\u6709\u660E\u786E\u65E5\u671F\u4E14\u4E0D\u4F9D\u8D56\u5F53\u524D\u65F6\u95F4\u7684\u8BA1\u7B97\u65E0\u9700\u8C03\u7528\u3002",
|
|
210747
|
+
inputSchema: {
|
|
210748
|
+
type: "object",
|
|
210749
|
+
properties: {
|
|
210750
|
+
timeZone: {
|
|
210751
|
+
type: "string",
|
|
210752
|
+
minLength: 1,
|
|
210753
|
+
description: "IANA \u65F6\u533A\u540D\u79F0\uFF0C\u9ED8\u8BA4 Asia/Shanghai"
|
|
210754
|
+
}
|
|
210755
|
+
},
|
|
210756
|
+
additionalProperties: false
|
|
210757
|
+
},
|
|
210758
|
+
annotations: { readOnlyHint: true },
|
|
210759
|
+
execute: async (args, signal) => {
|
|
210760
|
+
signal?.throwIfAborted();
|
|
210761
|
+
if (typeof args !== "object" || args === null || Array.isArray(args) || Object.keys(args).some((key) => key !== "timeZone"))
|
|
210762
|
+
throw new Error("\u53C2\u6570\u5FC5\u987B\u662F\u4EC5\u5305\u542B\u53EF\u9009 timeZone \u7684\u5BF9\u8C61");
|
|
210763
|
+
const requested = args.timeZone;
|
|
210764
|
+
if (requested !== void 0 && (typeof requested !== "string" || !requested.trim()))
|
|
210765
|
+
throw new Error("timeZone \u5FC5\u987B\u662F\u6709\u6548\u7684 IANA \u65F6\u533A\u540D\u79F0");
|
|
210766
|
+
const timeZone = typeof requested === "string" ? requested.trim() : "Asia/Shanghai";
|
|
210767
|
+
const formatter = new Intl.DateTimeFormat("zh-CN", {
|
|
210768
|
+
timeZone,
|
|
210769
|
+
calendar: "gregory",
|
|
210770
|
+
numberingSystem: "latn",
|
|
210771
|
+
year: "numeric",
|
|
210772
|
+
month: "2-digit",
|
|
210773
|
+
day: "2-digit",
|
|
210774
|
+
hour: "2-digit",
|
|
210775
|
+
minute: "2-digit",
|
|
210776
|
+
second: "2-digit",
|
|
210777
|
+
hourCycle: "h23",
|
|
210778
|
+
weekday: "long",
|
|
210779
|
+
timeZoneName: "longOffset"
|
|
210780
|
+
});
|
|
210781
|
+
const now = /* @__PURE__ */ new Date();
|
|
210782
|
+
const parts = Object.fromEntries(formatter.formatToParts(now).map((part) => [part.type, part.value]));
|
|
210783
|
+
return {
|
|
210784
|
+
timeZone: formatter.resolvedOptions().timeZone,
|
|
210785
|
+
date: `${parts.year}-${parts.month}-${parts.day}`,
|
|
210786
|
+
time: `${parts.hour}:${parts.minute}:${parts.second}`,
|
|
210787
|
+
weekday: parts.weekday,
|
|
210788
|
+
utcOffset: parts.timeZoneName === "GMT" ? "+00:00" : parts.timeZoneName.replace("GMT", ""),
|
|
210789
|
+
utc: now.toISOString(),
|
|
210790
|
+
timestampMs: now.getTime()
|
|
210791
|
+
};
|
|
210792
|
+
}
|
|
210793
|
+
};
|
|
210794
|
+
}
|
|
210795
|
+
var CURRENT_TIME_PLUGIN_NAME, CURRENT_TIME_TOOL_NAME, CurrentTimePlugin;
|
|
210796
|
+
var init_currentTimePlugin = __esm({
|
|
210797
|
+
"../linkque-agent-runtime/dist/esm/impl/plugin/currentTimePlugin.js"() {
|
|
210798
|
+
"use strict";
|
|
210799
|
+
init_esm();
|
|
210800
|
+
CURRENT_TIME_PLUGIN_NAME = "current-time";
|
|
210801
|
+
CURRENT_TIME_TOOL_NAME = "get_current_time";
|
|
210802
|
+
CurrentTimePlugin = class {
|
|
210803
|
+
name = CURRENT_TIME_PLUGIN_NAME;
|
|
210804
|
+
hookExecutorList = [
|
|
210805
|
+
{
|
|
210806
|
+
name: EHookExecutorName.CurrentTimeHookExecutor,
|
|
210807
|
+
matches: (_resource, stage) => stage === EHookStage.PREPARE_AGENT_LOOP,
|
|
210808
|
+
execute: async (_resource, context2) => context2.stage === EHookStage.PREPARE_AGENT_LOOP ? {
|
|
210809
|
+
ok: true,
|
|
210810
|
+
patch: {
|
|
210811
|
+
stage: EHookStage.PREPARE_AGENT_LOOP,
|
|
210812
|
+
additionalTools: [createCurrentTimeTool()]
|
|
210813
|
+
}
|
|
210814
|
+
} : { ok: true, skipped: true }
|
|
210815
|
+
}
|
|
210816
|
+
];
|
|
210817
|
+
modifyAgentConfig = (config2) => {
|
|
210818
|
+
const existing = config2.agent.resources.filter((resource) => resource.resourceType === EResourceType.HOOK && resource.config.executorName === EHookExecutorName.CurrentTimeHookExecutor);
|
|
210819
|
+
if (existing.length) {
|
|
210820
|
+
const hook = existing[0].config;
|
|
210821
|
+
if (existing.length !== 1 || hook.stage !== EHookStage.PREPARE_AGENT_LOOP || hook.hasSideEffects !== true || hook.enabled === false || hook.matcher !== void 0)
|
|
210822
|
+
throw new Error("\u5F53\u524D\u65F6\u95F4 Hook \u5FC5\u987B\u542F\u7528 PREPARE_AGENT_LOOP + hasSideEffects=true\uFF0C\u4E14\u4E0D\u914D\u7F6E matcher");
|
|
210823
|
+
return;
|
|
210824
|
+
}
|
|
210825
|
+
config2.agent.resources.push({
|
|
210826
|
+
resourceId: "current-time-prepare-agent-loop",
|
|
210827
|
+
resourceType: EResourceType.HOOK,
|
|
210828
|
+
providerType: EResourceProviderType.LINK_QUE,
|
|
210829
|
+
config: {
|
|
210830
|
+
name: "\u5F53\u524D\u65F6\u95F4\u5DE5\u5177\u6CE8\u5165",
|
|
210831
|
+
executorName: EHookExecutorName.CurrentTimeHookExecutor,
|
|
210832
|
+
stage: EHookStage.PREPARE_AGENT_LOOP,
|
|
210833
|
+
hasSideEffects: true
|
|
210834
|
+
}
|
|
210835
|
+
});
|
|
210836
|
+
};
|
|
210837
|
+
};
|
|
210838
|
+
}
|
|
210839
|
+
});
|
|
210840
|
+
|
|
210685
210841
|
// ../linkque-agent-runtime/dist/esm/impl/plugin/index.js
|
|
210686
210842
|
var plugin_exports = {};
|
|
210687
210843
|
__export(plugin_exports, {
|
|
210844
|
+
CURRENT_TIME_PLUGIN_NAME: () => CURRENT_TIME_PLUGIN_NAME,
|
|
210845
|
+
CURRENT_TIME_TOOL_NAME: () => CURRENT_TIME_TOOL_NAME,
|
|
210846
|
+
CurrentTimePlugin: () => CurrentTimePlugin,
|
|
210688
210847
|
DEFAULT_HARNESS_PROMPT: () => DEFAULT_HARNESS_PROMPT,
|
|
210689
210848
|
DEFAULT_HARNESS_PROMPT_PLUGIN_NAME: () => DEFAULT_HARNESS_PROMPT_PLUGIN_NAME,
|
|
210690
210849
|
DefaultHarnessPromptPlugin: () => DefaultHarnessPromptPlugin,
|
|
@@ -210708,6 +210867,7 @@ var init_plugin = __esm({
|
|
|
210708
210867
|
init_linkquegwEventPlugin();
|
|
210709
210868
|
init_mcpDiscoveryPlugin();
|
|
210710
210869
|
init_defaultHarnessPromptPlugin();
|
|
210870
|
+
init_currentTimePlugin();
|
|
210711
210871
|
}
|
|
210712
210872
|
});
|
|
210713
210873
|
|
|
@@ -219911,7 +220071,8 @@ var main = async () => {
|
|
|
219911
220071
|
...linkqueBaseUrl ? { baseUrl: linkqueBaseUrl } : {},
|
|
219912
220072
|
allowSandboxAccessKeyPlaceholder: true
|
|
219913
220073
|
}),
|
|
219914
|
-
new pluginModule.McpDiscoveryPlugin()
|
|
220074
|
+
new pluginModule.McpDiscoveryPlugin(),
|
|
220075
|
+
new pluginModule.CurrentTimePlugin()
|
|
219915
220076
|
];
|
|
219916
220077
|
const buildSkillLoader = () => new WebSkillLoader({
|
|
219917
220078
|
root: input.cwd,
|