linkque-cli-v2 1.3.3 → 1.3.5
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 +188 -317
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-BWCMNWG2.js → chunk-LT6VSAY4.js} +54 -41
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-JXQYQ563.js → chunk-NBYB7HSY.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-CM4N2PT3.js → chunk-VVEDZWQ5.js} +1850 -1944
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +708 -351
- 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 +892 -616
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{anthropic-messages-5DOLTIGP.js → anthropic-messages-EL2IU4YU.js} +3 -3
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{azure-openai-responses-HVAVRLTK.js → azure-openai-responses-A4XURCOX.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{mistral-conversations-UJBDG2KY.js → mistral-conversations-TQA2MPJJ.js} +10 -10
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-codex-responses-3KOC6KHN.js → openai-codex-responses-WLREQPZK.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-completions-HG6OJRL5.js → openai-completions-U6LUBY4P.js} +3 -3
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-responses-F6V2PG3Y.js → openai-responses-SFZAU5JA.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{pi-messages-DC4DVRAJ.js → pi-messages-QQA6ZGV2.js} +3 -3
package/linkquejs.js
CHANGED
|
@@ -7574,13 +7574,14 @@ var require_fast_uri = __commonJS({
|
|
|
7574
7574
|
if (!malformedIPLiteral) {
|
|
7575
7575
|
malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
|
|
7576
7576
|
}
|
|
7577
|
-
if (
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
parsed.host = reescapeHostDelimiters(host, isIP);
|
|
7582
|
-
}
|
|
7577
|
+
if (uri.indexOf("%") !== -1 && parsed.host !== void 0 && !malformedIPLiteral) {
|
|
7578
|
+
let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
|
|
7579
|
+
if (!isIP) {
|
|
7580
|
+
host = normalizePercentEncoding(host.toLowerCase());
|
|
7583
7581
|
}
|
|
7582
|
+
parsed.host = reescapeHostDelimiters(host, isIP);
|
|
7583
|
+
}
|
|
7584
|
+
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
7584
7585
|
if (parsed.path) {
|
|
7585
7586
|
parsed.path = normalizePathEncoding(parsed.path);
|
|
7586
7587
|
}
|
|
@@ -21232,207 +21233,6 @@ function candidateKey(resourceId, toolName) {
|
|
|
21232
21233
|
return `${resourceId}\0${toolName}`;
|
|
21233
21234
|
}
|
|
21234
21235
|
|
|
21235
|
-
// ../agent-a2ui-card-contract/dist/esm/payment-action.js
|
|
21236
|
-
var A2UI_PAYMENT_ACTION_NAME = "payment.trade-pay";
|
|
21237
|
-
var A2UI_PAYMENT_CALLBACK_MAX_BYTES = 16 * 1024;
|
|
21238
|
-
function getA2UICardActionBindingIssues(value, path23 = "actionBindings") {
|
|
21239
|
-
if (!Array.isArray(value)) {
|
|
21240
|
-
return [
|
|
21241
|
-
issue2(path23, "INVALID_ACTION_BINDINGS", "actionBindings must be an array")
|
|
21242
|
-
];
|
|
21243
|
-
}
|
|
21244
|
-
const issues = [];
|
|
21245
|
-
const actionIds = /* @__PURE__ */ new Set();
|
|
21246
|
-
value.forEach((candidate, index) => {
|
|
21247
|
-
const itemPath = `${path23}[${index}]`;
|
|
21248
|
-
if (!isPlainRecord(candidate)) {
|
|
21249
|
-
issues.push(issue2(itemPath, "INVALID_ACTION_BINDING", "action binding must be an object"));
|
|
21250
|
-
return;
|
|
21251
|
-
}
|
|
21252
|
-
if (!isSafeIdentifier(candidate.actionId)) {
|
|
21253
|
-
issues.push(issue2(`${itemPath}.actionId`, "INVALID_ACTION_ID", "actionId is invalid"));
|
|
21254
|
-
} else if (actionIds.has(candidate.actionId)) {
|
|
21255
|
-
issues.push(issue2(`${itemPath}.actionId`, "DUPLICATE_ACTION_ID", "actionId must be unique"));
|
|
21256
|
-
} else {
|
|
21257
|
-
actionIds.add(candidate.actionId);
|
|
21258
|
-
}
|
|
21259
|
-
if (candidate.kind !== "payment") {
|
|
21260
|
-
issues.push(issue2(`${itemPath}.kind`, "INVALID_ACTION_KIND", "kind must be payment"));
|
|
21261
|
-
return;
|
|
21262
|
-
}
|
|
21263
|
-
rejectExtraKeys(candidate, ["actionId", "kind", "createTrade", "queryTrade"], itemPath, issues);
|
|
21264
|
-
validateToolBinding(candidate.createTrade, `${itemPath}.createTrade`, "create", issues);
|
|
21265
|
-
validateToolBinding(candidate.queryTrade, `${itemPath}.queryTrade`, "query", issues);
|
|
21266
|
-
});
|
|
21267
|
-
return issues;
|
|
21268
|
-
}
|
|
21269
|
-
function getA2UIPaymentActionReferenceIssues(card, bindings, path23 = "a2uiTemplate.content") {
|
|
21270
|
-
const issues = [];
|
|
21271
|
-
const bindingIds = new Set(bindings.map((binding) => binding.actionId));
|
|
21272
|
-
const referenced = /* @__PURE__ */ new Set();
|
|
21273
|
-
card.forEach((message, messageIndex) => {
|
|
21274
|
-
message.datas.forEach((instruction, instructionIndex) => {
|
|
21275
|
-
const instructionRecord = instruction;
|
|
21276
|
-
const update = isPlainRecord(instructionRecord.updateComponents) ? instructionRecord.updateComponents : void 0;
|
|
21277
|
-
const components = update && Array.isArray(update.components) ? update.components : [];
|
|
21278
|
-
components.forEach((component, componentIndex) => {
|
|
21279
|
-
if (!isPlainRecord(component))
|
|
21280
|
-
return;
|
|
21281
|
-
collectPaymentActionReferences(component.action, `${path23}[${messageIndex}].datas[${instructionIndex}].updateComponents.components[${componentIndex}].action`, referenced, issues);
|
|
21282
|
-
});
|
|
21283
|
-
});
|
|
21284
|
-
});
|
|
21285
|
-
for (const actionId of referenced) {
|
|
21286
|
-
if (!bindingIds.has(actionId)) {
|
|
21287
|
-
issues.push(issue2(path23, "PAYMENT_ACTION_BINDING_MISSING", `payment action ${actionId} has no action binding`));
|
|
21288
|
-
}
|
|
21289
|
-
}
|
|
21290
|
-
for (const actionId of bindingIds) {
|
|
21291
|
-
if (!referenced.has(actionId)) {
|
|
21292
|
-
issues.push(issue2(path23, "PAYMENT_ACTION_UNUSED", `payment action binding ${actionId} is not referenced`));
|
|
21293
|
-
}
|
|
21294
|
-
}
|
|
21295
|
-
return issues;
|
|
21296
|
-
}
|
|
21297
|
-
function validateToolBinding(value, path23, phase, issues) {
|
|
21298
|
-
if (!isPlainRecord(value)) {
|
|
21299
|
-
issues.push(issue2(path23, "INVALID_PAYMENT_TOOL", `${path23} must be an object`));
|
|
21300
|
-
return;
|
|
21301
|
-
}
|
|
21302
|
-
rejectExtraKeys(value, phase === "create" ? ["mcpResourceId", "toolName", "inputBindings", "tradeNoPath"] : [
|
|
21303
|
-
"mcpResourceId",
|
|
21304
|
-
"toolName",
|
|
21305
|
-
"inputBindings",
|
|
21306
|
-
"statusPath",
|
|
21307
|
-
"paidValues"
|
|
21308
|
-
], path23, issues);
|
|
21309
|
-
if (!isSafeIdentifier(value.mcpResourceId)) {
|
|
21310
|
-
issues.push(issue2(`${path23}.mcpResourceId`, "INVALID_MCP_RESOURCE_ID", "mcpResourceId is invalid"));
|
|
21311
|
-
}
|
|
21312
|
-
if (typeof value.toolName !== "string" || !value.toolName.trim()) {
|
|
21313
|
-
issues.push(issue2(`${path23}.toolName`, "INVALID_TOOL_NAME", "toolName is required"));
|
|
21314
|
-
}
|
|
21315
|
-
validateInputBindings2(value.inputBindings, `${path23}.inputBindings`, phase, issues);
|
|
21316
|
-
if (phase === "create") {
|
|
21317
|
-
if (!isSafeJsonPointer(value.tradeNoPath)) {
|
|
21318
|
-
issues.push(issue2(`${path23}.tradeNoPath`, "INVALID_TRADE_NO_PATH", "tradeNoPath must be an absolute JSON Pointer"));
|
|
21319
|
-
}
|
|
21320
|
-
return;
|
|
21321
|
-
}
|
|
21322
|
-
if (!isSafeJsonPointer(value.statusPath)) {
|
|
21323
|
-
issues.push(issue2(`${path23}.statusPath`, "INVALID_PAYMENT_STATUS_PATH", "statusPath must be an absolute JSON Pointer"));
|
|
21324
|
-
}
|
|
21325
|
-
if (!Array.isArray(value.inputBindings) || !value.inputBindings.some((binding) => isPlainRecord(binding) && isPlainRecord(binding.source) && binding.source.kind === "trade-no")) {
|
|
21326
|
-
issues.push(issue2(`${path23}.inputBindings`, "PAYMENT_TRADE_NO_BINDING_MISSING", "queryTrade must map tradeNO"));
|
|
21327
|
-
}
|
|
21328
|
-
if (!Array.isArray(value.paidValues) || value.paidValues.length === 0 || value.paidValues.some((entry) => !isJsonPrimitive(entry))) {
|
|
21329
|
-
issues.push(issue2(`${path23}.paidValues`, "INVALID_PAID_VALUES", "paidValues must contain JSON primitives"));
|
|
21330
|
-
}
|
|
21331
|
-
}
|
|
21332
|
-
function collectPaymentActionReferences(value, path23, referenced, issues) {
|
|
21333
|
-
if (!isPlainRecord(value))
|
|
21334
|
-
return;
|
|
21335
|
-
if (isPlainRecord(value.client) && value.client.name === A2UI_PAYMENT_ACTION_NAME) {
|
|
21336
|
-
const context = value.client.context;
|
|
21337
|
-
if (!isPlainRecord(context) || !isSafeIdentifier(context.actionId)) {
|
|
21338
|
-
issues.push(issue2(path23, "INVALID_PAYMENT_ACTION", "payment action requires a safe actionId"));
|
|
21339
|
-
return;
|
|
21340
|
-
}
|
|
21341
|
-
rejectExtraKeys(context, ["actionId", "actionContext"], `${path23}.client.context`, issues);
|
|
21342
|
-
if (!isPlainRecord(context.actionContext)) {
|
|
21343
|
-
issues.push(issue2(path23, "INVALID_PAYMENT_ACTION", "payment action requires an object actionContext"));
|
|
21344
|
-
}
|
|
21345
|
-
referenced.add(context.actionId);
|
|
21346
|
-
return;
|
|
21347
|
-
}
|
|
21348
|
-
if (!isPlainRecord(value.select))
|
|
21349
|
-
return;
|
|
21350
|
-
if (Array.isArray(value.select.cases)) {
|
|
21351
|
-
value.select.cases.forEach((entry, index) => {
|
|
21352
|
-
if (isPlainRecord(entry)) {
|
|
21353
|
-
collectPaymentActionReferences(entry.action, `${path23}.select.cases[${index}].action`, referenced, issues);
|
|
21354
|
-
}
|
|
21355
|
-
});
|
|
21356
|
-
}
|
|
21357
|
-
collectPaymentActionReferences(value.select.default, `${path23}.select.default`, referenced, issues);
|
|
21358
|
-
}
|
|
21359
|
-
function validateInputBindings2(value, path23, phase, issues) {
|
|
21360
|
-
if (!Array.isArray(value) || value.length > 128) {
|
|
21361
|
-
issues.push(issue2(path23, "INVALID_PAYMENT_INPUT_BINDINGS", "inputBindings must be an array of at most 128 entries"));
|
|
21362
|
-
return;
|
|
21363
|
-
}
|
|
21364
|
-
const targets = /* @__PURE__ */ new Set();
|
|
21365
|
-
value.forEach((candidate, index) => {
|
|
21366
|
-
const itemPath = `${path23}[${index}]`;
|
|
21367
|
-
if (!isPlainRecord(candidate) || !isSafeJsonPointer(candidate.inputPath)) {
|
|
21368
|
-
issues.push(issue2(itemPath, "INVALID_PAYMENT_INPUT_BINDING", "inputPath must be an absolute JSON Pointer"));
|
|
21369
|
-
return;
|
|
21370
|
-
}
|
|
21371
|
-
rejectExtraKeys(candidate, ["inputPath", "source"], itemPath, issues);
|
|
21372
|
-
if (targets.has(candidate.inputPath)) {
|
|
21373
|
-
issues.push(issue2(`${itemPath}.inputPath`, "DUPLICATE_PAYMENT_INPUT_PATH", "inputPath must be unique"));
|
|
21374
|
-
}
|
|
21375
|
-
targets.add(candidate.inputPath);
|
|
21376
|
-
validateInputSource(candidate.source, `${itemPath}.source`, phase, issues);
|
|
21377
|
-
});
|
|
21378
|
-
}
|
|
21379
|
-
function validateInputSource(value, path23, phase, issues) {
|
|
21380
|
-
if (!isPlainRecord(value) || typeof value.kind !== "string") {
|
|
21381
|
-
issues.push(issue2(path23, "INVALID_PAYMENT_INPUT_SOURCE", "source must be an object"));
|
|
21382
|
-
return;
|
|
21383
|
-
}
|
|
21384
|
-
if (value.kind === "action-context") {
|
|
21385
|
-
rejectExtraKeys(value, ["kind", "path"], path23, issues);
|
|
21386
|
-
if (!isSafeJsonPointer(value.path, true)) {
|
|
21387
|
-
issues.push(issue2(`${path23}.path`, "INVALID_PAYMENT_SOURCE_PATH", "action context path must be a JSON Pointer"));
|
|
21388
|
-
}
|
|
21389
|
-
return;
|
|
21390
|
-
}
|
|
21391
|
-
if (value.kind === "runtime-context") {
|
|
21392
|
-
rejectExtraKeys(value, ["kind", "key"], path23, issues);
|
|
21393
|
-
if (!RUNTIME_CONTEXT_KEYS2.has(String(value.key))) {
|
|
21394
|
-
issues.push(issue2(`${path23}.key`, "INVALID_RUNTIME_CONTEXT_KEY", "runtime context key is unsupported"));
|
|
21395
|
-
}
|
|
21396
|
-
return;
|
|
21397
|
-
}
|
|
21398
|
-
if (value.kind === "literal") {
|
|
21399
|
-
rejectExtraKeys(value, ["kind", "value"], path23, issues);
|
|
21400
|
-
if (!isJsonValue(value.value)) {
|
|
21401
|
-
issues.push(issue2(`${path23}.value`, "INVALID_PAYMENT_LITERAL", "literal must be JSON"));
|
|
21402
|
-
}
|
|
21403
|
-
return;
|
|
21404
|
-
}
|
|
21405
|
-
if (phase === "query" && value.kind === "trade-no") {
|
|
21406
|
-
rejectExtraKeys(value, ["kind"], path23, issues);
|
|
21407
|
-
return;
|
|
21408
|
-
}
|
|
21409
|
-
if (phase === "query" && value.kind === "callback") {
|
|
21410
|
-
rejectExtraKeys(value, ["kind", "path"], path23, issues);
|
|
21411
|
-
if (!isSafeJsonPointer(value.path, true)) {
|
|
21412
|
-
issues.push(issue2(`${path23}.path`, "INVALID_PAYMENT_CALLBACK_PATH", "callback path must be a JSON Pointer"));
|
|
21413
|
-
}
|
|
21414
|
-
return;
|
|
21415
|
-
}
|
|
21416
|
-
issues.push(issue2(path23, "INVALID_PAYMENT_INPUT_SOURCE", `${value.kind} is unavailable for ${phase}`));
|
|
21417
|
-
}
|
|
21418
|
-
function rejectExtraKeys(value, allowed, path23, issues) {
|
|
21419
|
-
const allowedKeys = new Set(allowed);
|
|
21420
|
-
for (const key of Object.keys(value)) {
|
|
21421
|
-
if (!allowedKeys.has(key)) {
|
|
21422
|
-
issues.push(issue2(`${path23}.${key}`, "UNEXPECTED_ACTION_BINDING_FIELD", `${key} is not allowed`));
|
|
21423
|
-
}
|
|
21424
|
-
}
|
|
21425
|
-
}
|
|
21426
|
-
function isJsonPrimitive(value) {
|
|
21427
|
-
return value === null || ["string", "number", "boolean"].includes(typeof value);
|
|
21428
|
-
}
|
|
21429
|
-
var RUNTIME_CONTEXT_KEYS2 = /* @__PURE__ */ new Set([
|
|
21430
|
-
"agentId",
|
|
21431
|
-
"tenantId",
|
|
21432
|
-
"threadId",
|
|
21433
|
-
"userId"
|
|
21434
|
-
]);
|
|
21435
|
-
|
|
21436
21236
|
// ../agent-a2ui-card-contract/dist/esm/v4Catalog.js
|
|
21437
21237
|
var spacing = ["none", "xs", "sm", "md", "lg"];
|
|
21438
21238
|
var colors = [
|
|
@@ -21812,6 +21612,54 @@ function getA2UIV4ProtocolIssues(value, path23 = "card") {
|
|
|
21812
21612
|
validateReferences(surfaces, path23, issues);
|
|
21813
21613
|
return issues;
|
|
21814
21614
|
}
|
|
21615
|
+
function validateV4Component(component, componentPath, issues) {
|
|
21616
|
+
const schema = A2UI_V4_COMPONENT_CATALOG.components[component.component];
|
|
21617
|
+
if (!schema) {
|
|
21618
|
+
issues.push(issue2(`${componentPath}.component`, "UNSUPPORTED_COMPONENT", `V4 does not support component ${component.component}`));
|
|
21619
|
+
return;
|
|
21620
|
+
}
|
|
21621
|
+
const allowed = /* @__PURE__ */ new Set([
|
|
21622
|
+
"id",
|
|
21623
|
+
"component",
|
|
21624
|
+
...Object.keys(schema.properties)
|
|
21625
|
+
]);
|
|
21626
|
+
for (const key of Object.keys(component))
|
|
21627
|
+
if (!allowed.has(key))
|
|
21628
|
+
issues.push(issue2(`${componentPath}.${key}`, "UNSUPPORTED_COMPONENT_PROP", `${component.component} does not support property ${key}`));
|
|
21629
|
+
for (const [name, property] of Object.entries(schema.properties)) {
|
|
21630
|
+
const value = component[name];
|
|
21631
|
+
if (property.required && value === void 0)
|
|
21632
|
+
issues.push(issue2(`${componentPath}.${name}`, "REQUIRED_COMPONENT_PROP_MISSING", `${component.component}.${name} is required`));
|
|
21633
|
+
if (value !== void 0)
|
|
21634
|
+
validateProperty(value, property, `${componentPath}.${name}`, issues, name);
|
|
21635
|
+
}
|
|
21636
|
+
if (component["x2-overflow"] !== void 0)
|
|
21637
|
+
validateOverflow(component, componentPath, issues);
|
|
21638
|
+
if (component.component === "TextField")
|
|
21639
|
+
validateTextField(component, componentPath, issues);
|
|
21640
|
+
if (component.component === "ChoicePicker") {
|
|
21641
|
+
if (!isStrictBinding(component.value))
|
|
21642
|
+
issues.push(issue2(`${componentPath}.value`, "INPUT_REQUIRES_BINDING", "ChoicePicker.value must be a strict writable binding"));
|
|
21643
|
+
validateOptions(component.options, `${componentPath}.options`, issues);
|
|
21644
|
+
}
|
|
21645
|
+
if (component.component === "Stepper")
|
|
21646
|
+
validateStepper(component, componentPath, issues);
|
|
21647
|
+
if (["Card", "Row", "Column", "List"].includes(component.component)) {
|
|
21648
|
+
for (const axis of ["width", "height"]) {
|
|
21649
|
+
const value = component[axis];
|
|
21650
|
+
const modes = axis === "width" ? ["fit", "fill"] : ["auto"];
|
|
21651
|
+
if (value !== void 0 && !(typeof value === "string" && (modes.includes(value) || /^\d+(?:\.\d+)?px$/.test(value) && Number.isFinite(parseFloat(value))))) {
|
|
21652
|
+
issues.push(issue2(`${componentPath}.${axis}`, "INVALID_COMPONENT_PROP_VALUE", `size must be ${modes.join(" / ")} or a non-negative px string such as 120px`));
|
|
21653
|
+
}
|
|
21654
|
+
}
|
|
21655
|
+
}
|
|
21656
|
+
if (component.checks !== void 0)
|
|
21657
|
+
validateChecks(component.checks, `${componentPath}.checks`, issues);
|
|
21658
|
+
if (component.format !== void 0 && component.component === "Text")
|
|
21659
|
+
validateNumberFormat(component.format, `${componentPath}.format`, issues);
|
|
21660
|
+
if (component.action !== void 0)
|
|
21661
|
+
validateAction(component.action, `${componentPath}.action`, issues, 0);
|
|
21662
|
+
}
|
|
21815
21663
|
function validateComponents(payload, path23, surfaces, issues) {
|
|
21816
21664
|
if (!Array.isArray(payload.components)) {
|
|
21817
21665
|
issues.push(issue2(`${path23}.updateComponents.components`, "INVALID_A2UI_COMPONENTS", "components must be an array"));
|
|
@@ -21828,52 +21676,7 @@ function validateComponents(payload, path23, surfaces, issues) {
|
|
|
21828
21676
|
if (surface.has(component.id))
|
|
21829
21677
|
issues.push(issue2(`${componentPath}.id`, "DUPLICATE_COMPONENT_ID", `component id ${component.id} is duplicated`));
|
|
21830
21678
|
surface.set(component.id, component);
|
|
21831
|
-
|
|
21832
|
-
if (!schema) {
|
|
21833
|
-
issues.push(issue2(`${componentPath}.component`, "UNSUPPORTED_COMPONENT", `V4 does not support component ${component.component}`));
|
|
21834
|
-
return;
|
|
21835
|
-
}
|
|
21836
|
-
const allowed = /* @__PURE__ */ new Set([
|
|
21837
|
-
"id",
|
|
21838
|
-
"component",
|
|
21839
|
-
...Object.keys(schema.properties)
|
|
21840
|
-
]);
|
|
21841
|
-
for (const key of Object.keys(component))
|
|
21842
|
-
if (!allowed.has(key))
|
|
21843
|
-
issues.push(issue2(`${componentPath}.${key}`, "UNSUPPORTED_COMPONENT_PROP", `${component.component} does not support property ${key}`));
|
|
21844
|
-
for (const [name, property] of Object.entries(schema.properties)) {
|
|
21845
|
-
const value = component[name];
|
|
21846
|
-
if (property.required && value === void 0)
|
|
21847
|
-
issues.push(issue2(`${componentPath}.${name}`, "REQUIRED_COMPONENT_PROP_MISSING", `${component.component}.${name} is required`));
|
|
21848
|
-
if (value !== void 0)
|
|
21849
|
-
validateProperty(value, property, `${componentPath}.${name}`, issues, name);
|
|
21850
|
-
}
|
|
21851
|
-
if (component["x2-overflow"] !== void 0)
|
|
21852
|
-
validateOverflow(component, componentPath, issues);
|
|
21853
|
-
if (component.component === "TextField")
|
|
21854
|
-
validateTextField(component, componentPath, issues);
|
|
21855
|
-
if (component.component === "ChoicePicker") {
|
|
21856
|
-
if (!isStrictBinding(component.value))
|
|
21857
|
-
issues.push(issue2(`${componentPath}.value`, "INPUT_REQUIRES_BINDING", "ChoicePicker.value must be a strict writable binding"));
|
|
21858
|
-
validateOptions(component.options, `${componentPath}.options`, issues);
|
|
21859
|
-
}
|
|
21860
|
-
if (component.component === "Stepper")
|
|
21861
|
-
validateStepper(component, componentPath, issues);
|
|
21862
|
-
if (["Card", "Row", "Column", "List"].includes(component.component)) {
|
|
21863
|
-
for (const axis of ["width", "height"]) {
|
|
21864
|
-
const value = component[axis];
|
|
21865
|
-
const modes = axis === "width" ? ["fit", "fill"] : ["auto"];
|
|
21866
|
-
if (value !== void 0 && !(typeof value === "string" && (modes.includes(value) || /^\d+(?:\.\d+)?px$/.test(value) && Number.isFinite(parseFloat(value))))) {
|
|
21867
|
-
issues.push(issue2(`${componentPath}.${axis}`, "INVALID_COMPONENT_PROP_VALUE", `size must be ${modes.join(" / ")} or a non-negative px string such as 120px`));
|
|
21868
|
-
}
|
|
21869
|
-
}
|
|
21870
|
-
}
|
|
21871
|
-
if (component.checks !== void 0)
|
|
21872
|
-
validateChecks(component.checks, `${componentPath}.checks`, issues);
|
|
21873
|
-
if (component.format !== void 0 && component.component === "Text")
|
|
21874
|
-
validateNumberFormat(component.format, `${componentPath}.format`, issues);
|
|
21875
|
-
if (component.action !== void 0)
|
|
21876
|
-
validateAction(component.action, `${componentPath}.action`, issues, 0);
|
|
21679
|
+
validateV4Component(component, componentPath, issues);
|
|
21877
21680
|
});
|
|
21878
21681
|
}
|
|
21879
21682
|
function validateProperty(value, schema, path23, issues, propertyName) {
|
|
@@ -21923,7 +21726,7 @@ function validateAction(value, path23, issues, depth) {
|
|
|
21923
21726
|
issues.push(issue2(path23, "INVALID_ACTION", "action must be an object with at most four nested selects"));
|
|
21924
21727
|
return;
|
|
21925
21728
|
}
|
|
21926
|
-
const branches = ["event", "local", "client", "select"].filter((key) => key in value);
|
|
21729
|
+
const branches = ["event", "function", "local", "client", "select"].filter((key) => key in value);
|
|
21927
21730
|
if (branches.length !== 1 || Object.keys(value).length !== 1) {
|
|
21928
21731
|
issues.push(issue2(path23, "INVALID_ACTION", "action must contain exactly one branch"));
|
|
21929
21732
|
return;
|
|
@@ -21944,6 +21747,10 @@ function validateAction(value, path23, issues, depth) {
|
|
|
21944
21747
|
issues.push(issue2(`${path23}.event.x2-user-message`, "INVALID_ACTION_CONTEXT", "x2-user-message must be a string or strict binding"));
|
|
21945
21748
|
if (body.target !== void 0)
|
|
21946
21749
|
validateOverlayTarget(body.target, `${path23}.event.target`, issues);
|
|
21750
|
+
} else if (branch === "function") {
|
|
21751
|
+
rejectUnknownKeys(body, ["ref"], `${path23}.function`, issues);
|
|
21752
|
+
if (!isFunctionActionRef(body.ref))
|
|
21753
|
+
issues.push(issue2(`${path23}.function.ref`, "INVALID_FUNCTION_ACTION_REF", "function ref must be a dot-separated identifier up to 128 characters"));
|
|
21947
21754
|
} else if (branch === "local") {
|
|
21948
21755
|
rejectUnknownKeys(body, ["name", "path", "value"], `${path23}.local`, issues);
|
|
21949
21756
|
if (body.name !== "data.set" || typeof body.path !== "string" || !isSafePath(body.path) || !Object.prototype.hasOwnProperty.call(body, "value"))
|
|
@@ -21970,6 +21777,9 @@ function validateAction(value, path23, issues, depth) {
|
|
|
21970
21777
|
validateAction(body.default, `${path23}.select.default`, issues, depth + 1);
|
|
21971
21778
|
}
|
|
21972
21779
|
}
|
|
21780
|
+
function isFunctionActionRef(value) {
|
|
21781
|
+
return typeof value === "string" && value.length <= 128 && /^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u.test(value);
|
|
21782
|
+
}
|
|
21973
21783
|
function validateClientAction(body, path23, issues) {
|
|
21974
21784
|
rejectUnknownKeys(body, ["name", "context"], path23, issues);
|
|
21975
21785
|
if (body.name === "ui.overlay.close") {
|
|
@@ -21990,14 +21800,50 @@ function validateClientAction(body, path23, issues) {
|
|
|
21990
21800
|
return;
|
|
21991
21801
|
}
|
|
21992
21802
|
if (body.name === "payment.trade-pay") {
|
|
21993
|
-
|
|
21994
|
-
issues.push(issue2(`${path23}.context`, "INVALID_CLIENT_ACTION_CONTEXT", "payment.trade-pay requires actionId and actionContext"));
|
|
21995
|
-
else
|
|
21996
|
-
validateActionDynamicValue(body.context.actionContext, `${path23}.context.actionContext`, issues);
|
|
21803
|
+
validatePaymentActionContext(body.context, `${path23}.context`, issues);
|
|
21997
21804
|
return;
|
|
21998
21805
|
}
|
|
21999
21806
|
issues.push(issue2(`${path23}.name`, "UNSUPPORTED_CLIENT_ACTION", `unsupported client action ${String(body.name)}`));
|
|
22000
21807
|
}
|
|
21808
|
+
function validatePaymentActionContext(value, path23, issues) {
|
|
21809
|
+
if (!isPlainRecord(value)) {
|
|
21810
|
+
issues.push(issue2(path23, "INVALID_CLIENT_ACTION_CONTEXT", "payment.trade-pay requires createTrade and onSuccess"));
|
|
21811
|
+
return;
|
|
21812
|
+
}
|
|
21813
|
+
rejectUnknownKeys(value, ["createTrade", "onSuccess"], path23, issues);
|
|
21814
|
+
const createTrade = isPlainRecord(value.createTrade) ? value.createTrade : void 0;
|
|
21815
|
+
if (!createTrade) {
|
|
21816
|
+
issues.push(issue2(`${path23}.createTrade`, "INVALID_PAYMENT_CREATE_TRADE", "createTrade must be an object"));
|
|
21817
|
+
} else {
|
|
21818
|
+
rejectUnknownKeys(createTrade, ["mcpResourceId", "toolName", "input", "tradeNoPath"], `${path23}.createTrade`, issues);
|
|
21819
|
+
if (!isSafeIdentifier(createTrade.mcpResourceId))
|
|
21820
|
+
issues.push(issue2(`${path23}.createTrade.mcpResourceId`, "INVALID_MCP_RESOURCE_ID", "mcpResourceId is invalid"));
|
|
21821
|
+
if (typeof createTrade.toolName !== "string" || !createTrade.toolName.trim())
|
|
21822
|
+
issues.push(issue2(`${path23}.createTrade.toolName`, "INVALID_TOOL_NAME", "toolName is required"));
|
|
21823
|
+
if (!isPlainRecord(createTrade.input))
|
|
21824
|
+
issues.push(issue2(`${path23}.createTrade.input`, "INVALID_PAYMENT_INPUT", "input must be an object"));
|
|
21825
|
+
else
|
|
21826
|
+
validateActionDynamicValue(createTrade.input, `${path23}.createTrade.input`, issues);
|
|
21827
|
+
if (!isSafeJsonPointer(createTrade.tradeNoPath))
|
|
21828
|
+
issues.push(issue2(`${path23}.createTrade.tradeNoPath`, "INVALID_TRADE_NO_PATH", "tradeNoPath must be an absolute JSON Pointer"));
|
|
21829
|
+
}
|
|
21830
|
+
const onSuccess = isPlainRecord(value.onSuccess) ? value.onSuccess : void 0;
|
|
21831
|
+
const event = onSuccess && isPlainRecord(onSuccess.event) ? onSuccess.event : void 0;
|
|
21832
|
+
if (!onSuccess || !event) {
|
|
21833
|
+
issues.push(issue2(`${path23}.onSuccess`, "INVALID_PAYMENT_SUCCESS_EVENT", "onSuccess.event is required"));
|
|
21834
|
+
return;
|
|
21835
|
+
}
|
|
21836
|
+
rejectUnknownKeys(onSuccess, ["event"], `${path23}.onSuccess`, issues);
|
|
21837
|
+
rejectUnknownKeys(event, ["name", "context", "x2-user-message"], `${path23}.onSuccess.event`, issues);
|
|
21838
|
+
if (typeof event.name !== "string" || !/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/.test(event.name) || event.name.length > 96)
|
|
21839
|
+
issues.push(issue2(`${path23}.onSuccess.event.name`, "INVALID_ACTION_NAME", "event name is invalid"));
|
|
21840
|
+
if (event.context !== void 0 && !isPlainRecord(event.context))
|
|
21841
|
+
issues.push(issue2(`${path23}.onSuccess.event.context`, "INVALID_ACTION_CONTEXT", "event context must be an object"));
|
|
21842
|
+
else if (event.context !== void 0)
|
|
21843
|
+
validateActionDynamicValue(event.context, `${path23}.onSuccess.event.context`, issues);
|
|
21844
|
+
if (typeof event["x2-user-message"] !== "string" || !event["x2-user-message"].trim())
|
|
21845
|
+
issues.push(issue2(`${path23}.onSuccess.event.x2-user-message`, "INVALID_ACTION_CONTEXT", "x2-user-message must be a non-empty string"));
|
|
21846
|
+
}
|
|
22001
21847
|
function validateActionDynamicValue(value, path23, issues) {
|
|
22002
21848
|
if (Array.isArray(value)) {
|
|
22003
21849
|
value.forEach((entry, index) => validateActionDynamicValue(entry, `${path23}[${index}]`, issues));
|
|
@@ -22216,7 +22062,7 @@ var FIELD_SOURCES = [
|
|
|
22216
22062
|
"runtime-context",
|
|
22217
22063
|
"local"
|
|
22218
22064
|
];
|
|
22219
|
-
var
|
|
22065
|
+
var RUNTIME_CONTEXT_KEYS2 = /* @__PURE__ */ new Set([
|
|
22220
22066
|
"agentId",
|
|
22221
22067
|
"tenantId",
|
|
22222
22068
|
"threadId",
|
|
@@ -22252,9 +22098,6 @@ function getA2UICardDraftBundleIssues(value) {
|
|
|
22252
22098
|
issues.push(...getPersistedV4ProtocolIssues(card, "draft.card"));
|
|
22253
22099
|
validateV4BindingContracts(card, analysis.occurrences, manifest.fields, "draft.card", issues);
|
|
22254
22100
|
}
|
|
22255
|
-
if (manifest?.schemaVersion === "3" || manifest?.schemaVersion === "4") {
|
|
22256
|
-
issues.push(...getA2UIPaymentActionReferenceIssues(card, manifest.actionBindings ?? [], "draft.card"));
|
|
22257
|
-
}
|
|
22258
22101
|
}
|
|
22259
22102
|
return issues;
|
|
22260
22103
|
}
|
|
@@ -22412,6 +22255,9 @@ function getA2UICardResourceConfigIssues(value) {
|
|
|
22412
22255
|
}
|
|
22413
22256
|
function getA2UICardResourceConfigV3Issues(value) {
|
|
22414
22257
|
const issues = [];
|
|
22258
|
+
if (value.actionBindings !== void 0) {
|
|
22259
|
+
issues.push(issue2("config.actionBindings", "LEGACY_PAYMENT_ACTION_BINDINGS_UNSUPPORTED", "payment actions must be defined inline in card JSON"));
|
|
22260
|
+
}
|
|
22415
22261
|
exactKeys(value, [
|
|
22416
22262
|
"schemaVersion",
|
|
22417
22263
|
"revision",
|
|
@@ -22422,7 +22268,6 @@ function getA2UICardResourceConfigV3Issues(value) {
|
|
|
22422
22268
|
"fields",
|
|
22423
22269
|
"dataSources",
|
|
22424
22270
|
"bindings",
|
|
22425
|
-
"actionBindings",
|
|
22426
22271
|
"a2uiTemplate"
|
|
22427
22272
|
], "config", issues);
|
|
22428
22273
|
if (value.schemaVersion !== "3" && value.schemaVersion !== "4") {
|
|
@@ -22446,11 +22291,6 @@ function getA2UICardResourceConfigV3Issues(value) {
|
|
|
22446
22291
|
issues.push(...getA2UIV4ProtocolIssues(card, "config.a2uiTemplate.content"));
|
|
22447
22292
|
issues.push(...getPersistedV4ProtocolIssues(card, "config.a2uiTemplate.content"));
|
|
22448
22293
|
}
|
|
22449
|
-
const actionBindings = value.actionBindings === void 0 ? [] : value.actionBindings;
|
|
22450
|
-
issues.push(...getA2UICardActionBindingIssues(actionBindings, "config.actionBindings"));
|
|
22451
|
-
if (card && Array.isArray(actionBindings)) {
|
|
22452
|
-
issues.push(...getA2UIPaymentActionReferenceIssues(card, actionBindings, "config.a2uiTemplate.content"));
|
|
22453
|
-
}
|
|
22454
22294
|
if (fields && dataSources && bindings) {
|
|
22455
22295
|
validateV3Coverage(fields, dataSources, bindings, issues, { card });
|
|
22456
22296
|
}
|
|
@@ -22646,6 +22486,9 @@ function validateManifest(value, path23, issues) {
|
|
|
22646
22486
|
return void 0;
|
|
22647
22487
|
}
|
|
22648
22488
|
if (value.schemaVersion === "3" || value.schemaVersion === "4") {
|
|
22489
|
+
if (value.actionBindings !== void 0) {
|
|
22490
|
+
issues.push(issue2(`${path23}.actionBindings`, "LEGACY_PAYMENT_ACTION_BINDINGS_UNSUPPORTED", "payment actions must be defined inline in card JSON"));
|
|
22491
|
+
}
|
|
22649
22492
|
exactKeys(value, [
|
|
22650
22493
|
"schemaVersion",
|
|
22651
22494
|
"draftId",
|
|
@@ -22656,8 +22499,7 @@ function validateManifest(value, path23, issues) {
|
|
|
22656
22499
|
"whenToUse",
|
|
22657
22500
|
"whenNotToUse",
|
|
22658
22501
|
"fields",
|
|
22659
|
-
"bindings"
|
|
22660
|
-
"actionBindings"
|
|
22502
|
+
"bindings"
|
|
22661
22503
|
], path23, issues);
|
|
22662
22504
|
if (!isSafeIdentifier(value.draftId)) {
|
|
22663
22505
|
issues.push(issue2(`${path23}.draftId`, "INVALID_DRAFT_ID", "draftId is invalid"));
|
|
@@ -22677,9 +22519,6 @@ function validateManifest(value, path23, issues) {
|
|
|
22677
22519
|
if (value.bindings !== void 0) {
|
|
22678
22520
|
validateV3BindingSelections(value.bindings, `${path23}.bindings`, fields2, issues);
|
|
22679
22521
|
}
|
|
22680
|
-
if (value.actionBindings !== void 0) {
|
|
22681
|
-
issues.push(...getA2UICardActionBindingIssues(value.actionBindings, `${path23}.actionBindings`));
|
|
22682
|
-
}
|
|
22683
22522
|
return fields2 ? value : void 0;
|
|
22684
22523
|
}
|
|
22685
22524
|
exactKeys(value, [
|
|
@@ -22812,7 +22651,7 @@ function validateFieldSource(candidate, itemPath, issues) {
|
|
|
22812
22651
|
issues.push(issue2(`${itemPath}.sourcePath`, "UNEXPECTED_FIELD_SOURCE_PATH", "sourcePath is only allowed for invocation fields"));
|
|
22813
22652
|
}
|
|
22814
22653
|
if (candidate.source === "runtime-context") {
|
|
22815
|
-
if (!
|
|
22654
|
+
if (!RUNTIME_CONTEXT_KEYS2.has(candidate.runtimeContextKey)) {
|
|
22816
22655
|
issues.push(issue2(`${itemPath}.runtimeContextKey`, "INVALID_RUNTIME_CONTEXT", "runtime-context fields require an allowed runtimeContextKey"));
|
|
22817
22656
|
}
|
|
22818
22657
|
} else if (candidate.runtimeContextKey !== void 0) {
|
|
@@ -22864,11 +22703,11 @@ function validateResolverCalls(value, path23, issues) {
|
|
|
22864
22703
|
issues.push(issue2(`${itemPath}.mcpResourceId`, "INVALID_MCP_RESOURCE_ID", "mcpResourceId is invalid"));
|
|
22865
22704
|
}
|
|
22866
22705
|
requiredString(candidate.toolName, `${itemPath}.toolName`, issues);
|
|
22867
|
-
|
|
22706
|
+
validateInputBindings2(candidate.inputBindings, `${itemPath}.inputBindings`, issues);
|
|
22868
22707
|
});
|
|
22869
22708
|
return value;
|
|
22870
22709
|
}
|
|
22871
|
-
function
|
|
22710
|
+
function validateInputBindings2(value, path23, issues) {
|
|
22872
22711
|
if (!Array.isArray(value)) {
|
|
22873
22712
|
issues.push(issue2(path23, "INVALID_INPUT_BINDINGS", "inputBindings must be an array"));
|
|
22874
22713
|
return void 0;
|
|
@@ -22888,11 +22727,11 @@ function validateInputBindings3(value, path23, issues) {
|
|
|
22888
22727
|
} else {
|
|
22889
22728
|
paths.add(candidate.inputPath);
|
|
22890
22729
|
}
|
|
22891
|
-
|
|
22730
|
+
validateInputSource(candidate.source, `${itemPath}.source`, issues);
|
|
22892
22731
|
});
|
|
22893
22732
|
return value;
|
|
22894
22733
|
}
|
|
22895
|
-
function
|
|
22734
|
+
function validateInputSource(value, path23, issues) {
|
|
22896
22735
|
if (!isPlainRecord(value)) {
|
|
22897
22736
|
issues.push(issue2(path23, "INVALID_INPUT_SOURCE", "source must be an object"));
|
|
22898
22737
|
return;
|
|
@@ -22906,7 +22745,7 @@ function validateInputSource2(value, path23, issues) {
|
|
|
22906
22745
|
}
|
|
22907
22746
|
if (value.kind === "runtime-context") {
|
|
22908
22747
|
exactKeys(value, ["kind", "key"], path23, issues);
|
|
22909
|
-
if (!
|
|
22748
|
+
if (!RUNTIME_CONTEXT_KEYS2.has(value.key)) {
|
|
22910
22749
|
issues.push(issue2(`${path23}.key`, "INVALID_RUNTIME_CONTEXT", "runtime context key is invalid"));
|
|
22911
22750
|
}
|
|
22912
22751
|
return;
|
|
@@ -23270,9 +23109,6 @@ function compileModernResource(draft, revision, bindings, tools) {
|
|
|
23270
23109
|
fields: draft.manifest.fields,
|
|
23271
23110
|
dataSources: [...sourceById.values()].sort((left, right) => left.sourceId.localeCompare(right.sourceId)),
|
|
23272
23111
|
bindings: outputBindings.sort((left, right) => left.fieldId.localeCompare(right.fieldId)),
|
|
23273
|
-
...draft.manifest.actionBindings?.length ? {
|
|
23274
|
-
actionBindings: JSON.parse(JSON.stringify(draft.manifest.actionBindings))
|
|
23275
|
-
} : {},
|
|
23276
23112
|
a2uiTemplate: {
|
|
23277
23113
|
argsSchema: createA2UICardViewModelSchema(draft.manifest.fields),
|
|
23278
23114
|
content: stableJsonStringify(draft.card)
|
|
@@ -23541,6 +23377,9 @@ var SHA256_CONSTANTS = [
|
|
|
23541
23377
|
3329325298
|
|
23542
23378
|
];
|
|
23543
23379
|
|
|
23380
|
+
// ../agent-a2ui-card-contract/dist/esm/payment-action.js
|
|
23381
|
+
var A2UI_PAYMENT_ACTION_NAME = "payment.trade-pay";
|
|
23382
|
+
|
|
23544
23383
|
// ../agent-a2ui-card-contract/dist/esm/authoring-model.js
|
|
23545
23384
|
var INTERNAL_KEYS = /* @__PURE__ */ new Set([
|
|
23546
23385
|
"__proto__",
|
|
@@ -23593,7 +23432,7 @@ function extractA2UICardAuthoringModel(bundle, options = {}) {
|
|
|
23593
23432
|
discoverComponentTargets(component, occurrenceId, projection, targets);
|
|
23594
23433
|
allFieldOccurrenceTargets.push(...fieldTargets(component, occurrenceId, fields, componentOccurrences, false));
|
|
23595
23434
|
targets.push(...fieldTargets(component, occurrenceId, fields, componentOccurrences, true));
|
|
23596
|
-
targets.push(...actionTargets(component, occurrenceId
|
|
23435
|
+
targets.push(...actionTargets(component, occurrenceId));
|
|
23597
23436
|
}
|
|
23598
23437
|
if (targets.length === 0) {
|
|
23599
23438
|
targets.push({
|
|
@@ -23786,7 +23625,7 @@ function discoverTargets(value, occurrenceId, propertyPath, targets) {
|
|
|
23786
23625
|
});
|
|
23787
23626
|
}
|
|
23788
23627
|
}
|
|
23789
|
-
function actionTargets(component, occurrenceId
|
|
23628
|
+
function actionTargets(component, occurrenceId) {
|
|
23790
23629
|
if (!isPlainRecord(component.action))
|
|
23791
23630
|
return [];
|
|
23792
23631
|
const action = component.action;
|
|
@@ -23809,6 +23648,19 @@ function actionTargets(component, occurrenceId, actionBindings) {
|
|
|
23809
23648
|
}
|
|
23810
23649
|
return [agentOnlyAction(occurrenceId, "\u52A8\u6001\u6216\u590D\u6742\u4E8B\u4EF6\u901A\u8FC7\u667A\u80FD\u4F53\u4FEE\u6539")];
|
|
23811
23650
|
}
|
|
23651
|
+
const functionAction = isPlainRecord(action.function) ? action.function : void 0;
|
|
23652
|
+
if (functionAction && typeof functionAction.ref === "string") {
|
|
23653
|
+
return [
|
|
23654
|
+
{
|
|
23655
|
+
kind: "function",
|
|
23656
|
+
targetId: createA2UICardAuthoringTargetId(occurrenceId, "action"),
|
|
23657
|
+
occurrenceId,
|
|
23658
|
+
propertyPath: "action",
|
|
23659
|
+
label: "\u524D\u7AEF\u51FD\u6570",
|
|
23660
|
+
ref: functionAction.ref
|
|
23661
|
+
}
|
|
23662
|
+
];
|
|
23663
|
+
}
|
|
23812
23664
|
const client = isPlainRecord(action.client) ? action.client : void 0;
|
|
23813
23665
|
if (client?.name === "ui.page.open") {
|
|
23814
23666
|
const context = isPlainRecord(client.context) ? client.context : void 0;
|
|
@@ -23827,9 +23679,7 @@ function actionTargets(component, occurrenceId, actionBindings) {
|
|
|
23827
23679
|
}
|
|
23828
23680
|
if (client?.name === A2UI_PAYMENT_ACTION_NAME) {
|
|
23829
23681
|
const context = isPlainRecord(client.context) ? client.context : void 0;
|
|
23830
|
-
const
|
|
23831
|
-
const actionContext = isPlainRecord(context?.actionContext) ? context.actionContext : {};
|
|
23832
|
-
const binding = actionBindings?.find((candidate) => candidate.kind === "payment" && candidate.actionId === actionId);
|
|
23682
|
+
const payment = context ? JSON.parse(JSON.stringify(context)) : void 0;
|
|
23833
23683
|
return [
|
|
23834
23684
|
{
|
|
23835
23685
|
kind: "payment",
|
|
@@ -23837,10 +23687,8 @@ function actionTargets(component, occurrenceId, actionBindings) {
|
|
|
23837
23687
|
occurrenceId,
|
|
23838
23688
|
propertyPath: "action",
|
|
23839
23689
|
label: "\u652F\u4ED8",
|
|
23840
|
-
|
|
23841
|
-
|
|
23842
|
-
...binding ? { binding } : {},
|
|
23843
|
-
configured: Boolean(actionId && binding)
|
|
23690
|
+
...payment ? { payment } : {},
|
|
23691
|
+
configured: Boolean(payment)
|
|
23844
23692
|
}
|
|
23845
23693
|
];
|
|
23846
23694
|
}
|
|
@@ -23965,7 +23813,7 @@ var MCP_PROXY_DESCRIPTION = [
|
|
|
23965
23813
|
"\u4EC5 mcp({}) \u5217\u51FA\u7684\u5DE5\u5177\u53EF\u8C03\u7528(\u672A\u58F0\u660E\u7684\u5DE5\u5177\u4E0D\u4F1A\u51FA\u73B0)\u3002"
|
|
23966
23814
|
].join("\n");
|
|
23967
23815
|
|
|
23968
|
-
// ../linkque-agent-
|
|
23816
|
+
// ../linkque-agent-protocol/dist/esm/telemetry/telemetryEnums.js
|
|
23969
23817
|
var ETelemetryAttribute;
|
|
23970
23818
|
(function(ETelemetryAttribute2) {
|
|
23971
23819
|
ETelemetryAttribute2["HARNESS_TELEMETRY_SCHEMA_VERSION"] = "harness.telemetry.schema.version";
|
|
@@ -24157,24 +24005,6 @@ var ETelemetrySignal;
|
|
|
24157
24005
|
ETelemetrySignal2["LOGS"] = "logs";
|
|
24158
24006
|
ETelemetrySignal2["TRACES"] = "traces";
|
|
24159
24007
|
})(ETelemetrySignal || (ETelemetrySignal = {}));
|
|
24160
|
-
var ETelemetryDiagnosticCode;
|
|
24161
|
-
(function(ETelemetryDiagnosticCode2) {
|
|
24162
|
-
ETelemetryDiagnosticCode2["INVALID_AUTHORIZATION"] = "invalid_authorization";
|
|
24163
|
-
ETelemetryDiagnosticCode2["PARTITION_LIMIT"] = "partition_limit";
|
|
24164
|
-
ETelemetryDiagnosticCode2["UNAVAILABLE_PARTITION"] = "unavailable_partition";
|
|
24165
|
-
ETelemetryDiagnosticCode2["QUEUE_LIMIT"] = "queue_limit";
|
|
24166
|
-
ETelemetryDiagnosticCode2["QUEUE_EXPIRED"] = "queue_expired";
|
|
24167
|
-
ETelemetryDiagnosticCode2["SENDER_FAILED"] = "sender_failed";
|
|
24168
|
-
ETelemetryDiagnosticCode2["PARTIAL_SUCCESS"] = "partial_success";
|
|
24169
|
-
ETelemetryDiagnosticCode2["AUTHORIZATION_REJECTED"] = "authorization_rejected";
|
|
24170
|
-
ETelemetryDiagnosticCode2["PERMANENT_REJECTION"] = "permanent_rejection";
|
|
24171
|
-
ETelemetryDiagnosticCode2["SEND_RETRY"] = "send_retry";
|
|
24172
|
-
ETelemetryDiagnosticCode2["SHUTDOWN_DROP"] = "shutdown_drop";
|
|
24173
|
-
ETelemetryDiagnosticCode2["LOCAL_SINK_FAILED"] = "local_sink_failed";
|
|
24174
|
-
ETelemetryDiagnosticCode2["CAPTURE_FAILED"] = "capture_failed";
|
|
24175
|
-
ETelemetryDiagnosticCode2["IDENTITY_MISMATCH"] = "identity_mismatch";
|
|
24176
|
-
ETelemetryDiagnosticCode2["ACTIVE_LIMIT"] = "active_limit";
|
|
24177
|
-
})(ETelemetryDiagnosticCode || (ETelemetryDiagnosticCode = {}));
|
|
24178
24008
|
var ETelemetryLossReason;
|
|
24179
24009
|
(function(ETelemetryLossReason2) {
|
|
24180
24010
|
ETelemetryLossReason2["UNCAUGHT_ERROR"] = "uncaught_error";
|
|
@@ -24305,6 +24135,31 @@ var ETelemetryGenAiOperation;
|
|
|
24305
24135
|
ETelemetryGenAiOperation2["EXECUTE_TOOL"] = "execute_tool";
|
|
24306
24136
|
ETelemetryGenAiOperation2["INVOKE_AGENT"] = "invoke_agent";
|
|
24307
24137
|
})(ETelemetryGenAiOperation || (ETelemetryGenAiOperation = {}));
|
|
24138
|
+
var ETelemetryVersion;
|
|
24139
|
+
(function(ETelemetryVersion2) {
|
|
24140
|
+
ETelemetryVersion2["V0_2"] = "0.2";
|
|
24141
|
+
ETelemetryVersion2["V1_0"] = "1.0";
|
|
24142
|
+
})(ETelemetryVersion || (ETelemetryVersion = {}));
|
|
24143
|
+
|
|
24144
|
+
// ../linkque-agent-runtime/dist/esm/core/telemetry/telemetryEnums.js
|
|
24145
|
+
var ETelemetryDiagnosticCode;
|
|
24146
|
+
(function(ETelemetryDiagnosticCode2) {
|
|
24147
|
+
ETelemetryDiagnosticCode2["INVALID_AUTHORIZATION"] = "invalid_authorization";
|
|
24148
|
+
ETelemetryDiagnosticCode2["PARTITION_LIMIT"] = "partition_limit";
|
|
24149
|
+
ETelemetryDiagnosticCode2["UNAVAILABLE_PARTITION"] = "unavailable_partition";
|
|
24150
|
+
ETelemetryDiagnosticCode2["QUEUE_LIMIT"] = "queue_limit";
|
|
24151
|
+
ETelemetryDiagnosticCode2["QUEUE_EXPIRED"] = "queue_expired";
|
|
24152
|
+
ETelemetryDiagnosticCode2["SENDER_FAILED"] = "sender_failed";
|
|
24153
|
+
ETelemetryDiagnosticCode2["PARTIAL_SUCCESS"] = "partial_success";
|
|
24154
|
+
ETelemetryDiagnosticCode2["AUTHORIZATION_REJECTED"] = "authorization_rejected";
|
|
24155
|
+
ETelemetryDiagnosticCode2["PERMANENT_REJECTION"] = "permanent_rejection";
|
|
24156
|
+
ETelemetryDiagnosticCode2["SEND_RETRY"] = "send_retry";
|
|
24157
|
+
ETelemetryDiagnosticCode2["SHUTDOWN_DROP"] = "shutdown_drop";
|
|
24158
|
+
ETelemetryDiagnosticCode2["LOCAL_SINK_FAILED"] = "local_sink_failed";
|
|
24159
|
+
ETelemetryDiagnosticCode2["CAPTURE_FAILED"] = "capture_failed";
|
|
24160
|
+
ETelemetryDiagnosticCode2["IDENTITY_MISMATCH"] = "identity_mismatch";
|
|
24161
|
+
ETelemetryDiagnosticCode2["ACTIVE_LIMIT"] = "active_limit";
|
|
24162
|
+
})(ETelemetryDiagnosticCode || (ETelemetryDiagnosticCode = {}));
|
|
24308
24163
|
var ETelemetryAssociation;
|
|
24309
24164
|
(function(ETelemetryAssociation2) {
|
|
24310
24165
|
ETelemetryAssociation2["LOOP"] = "loop";
|
|
@@ -24320,11 +24175,6 @@ var ETelemetryMetadata;
|
|
|
24320
24175
|
ETelemetryMetadata2["SERVICE_NAMESPACE"] = "linkque";
|
|
24321
24176
|
ETelemetryMetadata2["ROUTE_CONTEXT_KEY"] = "linkque.telemetry.route";
|
|
24322
24177
|
})(ETelemetryMetadata || (ETelemetryMetadata = {}));
|
|
24323
|
-
var ETelemetryVersion;
|
|
24324
|
-
(function(ETelemetryVersion2) {
|
|
24325
|
-
ETelemetryVersion2["V0_2"] = "0.2";
|
|
24326
|
-
ETelemetryVersion2["V1_0"] = "1.0";
|
|
24327
|
-
})(ETelemetryVersion || (ETelemetryVersion = {}));
|
|
24328
24178
|
|
|
24329
24179
|
// ../linkque-agent-runtime/dist/esm/config/runtimeConfigProvider.js
|
|
24330
24180
|
var LINKQUE_ENDPOINT_PROD = "https://linkquegw.alipay.com";
|
|
@@ -34743,7 +34593,6 @@ var A2UI_ACTION_TABLE_COLUMNS = [
|
|
|
34743
34593
|
"ownerId",
|
|
34744
34594
|
"agentId",
|
|
34745
34595
|
"threadId",
|
|
34746
|
-
"actionId",
|
|
34747
34596
|
"cardRef",
|
|
34748
34597
|
"cardRevision",
|
|
34749
34598
|
"surfaceId",
|
|
@@ -34773,7 +34622,7 @@ var A2UI_ACTION_TABLE_COLUMNS = [
|
|
|
34773
34622
|
default: null
|
|
34774
34623
|
},
|
|
34775
34624
|
{
|
|
34776
|
-
key: "
|
|
34625
|
+
key: "input",
|
|
34777
34626
|
type: "text",
|
|
34778
34627
|
required: true,
|
|
34779
34628
|
array: false,
|
|
@@ -36285,6 +36134,7 @@ var HEALTH_PATH = "/healthz";
|
|
|
36285
36134
|
var RUNS_PATH = "/runs";
|
|
36286
36135
|
var HOME_DATA_PATH = "/home-data";
|
|
36287
36136
|
var A2UI_ACTION_PATH = "/a2ui-action";
|
|
36137
|
+
var FUNCTION_ACTION_MCP_PATH = "/function-actions/mcp";
|
|
36288
36138
|
var AGENT_RUNTIME_PROTOCOL = "conversation-runs-v2";
|
|
36289
36139
|
var API_KEY_ENV = "LINKQUE_AGENT_API_KEY";
|
|
36290
36140
|
var stopped = (health) => ({
|
|
@@ -36553,6 +36403,7 @@ var spawnAgentOwner = (cwd, config3, port, apiKey, statePath) => {
|
|
|
36553
36403
|
healthPath: HEALTH_PATH,
|
|
36554
36404
|
homeDataPath: HOME_DATA_PATH,
|
|
36555
36405
|
a2uiActionPath: A2UI_ACTION_PATH,
|
|
36406
|
+
functionActionMcpPath: FUNCTION_ACTION_MCP_PATH,
|
|
36556
36407
|
logPath: import_path15.default.join(cwd, AGENT_LOG),
|
|
36557
36408
|
port,
|
|
36558
36409
|
runsPath: RUNS_PATH,
|
|
@@ -40886,6 +40737,12 @@ async function finalizeCardWhileLocked(cwd, draftId, expectedDraftChecksum) {
|
|
|
40886
40737
|
`\u5F53\u524D Runtime \u4E0D\u652F\u6301\u5361\u7247\u534F\u8BAE V${bundle.manifest.schemaVersion}\uFF0C\u8BF7\u5148\u5347\u7EA7 Runtime`
|
|
40887
40738
|
);
|
|
40888
40739
|
}
|
|
40740
|
+
if (bundle.manifest.schemaVersion === "4" && containsFunctionAction(bundle.card) && !await readRuntimeSupportsFunctionActions(cwd)) {
|
|
40741
|
+
throw new LinkqueCliError(
|
|
40742
|
+
"CARD_RUNTIME_SCHEMA_UNSUPPORTED",
|
|
40743
|
+
"\u5F53\u524D Runtime \u4E0D\u652F\u6301\u524D\u7AEF\u51FD\u6570 Action\uFF0C\u8BF7\u5148\u5347\u7EA7 Runtime"
|
|
40744
|
+
);
|
|
40745
|
+
}
|
|
40889
40746
|
const context = parseOptionalBindingContext(
|
|
40890
40747
|
await readOptionalJson(import_path22.default.join(directory, "binding-context.json"))
|
|
40891
40748
|
);
|
|
@@ -41190,6 +41047,20 @@ async function readRuntimeSupportedSchemaVersions(cwd) {
|
|
|
41190
41047
|
}
|
|
41191
41048
|
return [...new Set(versions)];
|
|
41192
41049
|
}
|
|
41050
|
+
async function readRuntimeSupportsFunctionActions(cwd) {
|
|
41051
|
+
const value = await readOptionalJson(
|
|
41052
|
+
import_path22.default.join(cwd, RUNTIME_CAPABILITIES_PATH)
|
|
41053
|
+
).catch(() => void 0);
|
|
41054
|
+
return isJsonObject(value) && value.schemaVersion === 1 && isJsonObject(value.a2uiCard) && value.a2uiCard.frontendFunctionActions === true;
|
|
41055
|
+
}
|
|
41056
|
+
function containsFunctionAction(value) {
|
|
41057
|
+
if (Array.isArray(value)) return value.some(containsFunctionAction);
|
|
41058
|
+
if (!isJsonObject(value)) return false;
|
|
41059
|
+
if (isJsonObject(value.action) && isJsonObject(value.action.function)) {
|
|
41060
|
+
return true;
|
|
41061
|
+
}
|
|
41062
|
+
return Object.values(value).some(containsFunctionAction);
|
|
41063
|
+
}
|
|
41193
41064
|
async function readOptionalJsonObject(file) {
|
|
41194
41065
|
const value = await readOptionalJson(file);
|
|
41195
41066
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|