linkque-cli-v2 1.3.1 → 1.3.2
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 +96 -62
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-KTFQX5XN.js → chunk-JQKPMWIR.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-P5YTVR76.js → chunk-MDZWPPOW.js} +98 -59
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-CITJWG2O.js → chunk-NIEA4H2C.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +5 -5
- 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 +102 -63
package/linkquejs.js
CHANGED
|
@@ -759,8 +759,8 @@ ${itemIndentStr}`);
|
|
|
759
759
|
* @param {number} width
|
|
760
760
|
* @returns {string}
|
|
761
761
|
*/
|
|
762
|
-
boxWrap(str,
|
|
763
|
-
if (
|
|
762
|
+
boxWrap(str, width2) {
|
|
763
|
+
if (width2 < this.minWidthToWrap) return str;
|
|
764
764
|
const rawLines = str.split(/\r\n|\n/);
|
|
765
765
|
const chunkPattern = /[\s]*[^\s]+/g;
|
|
766
766
|
const wrappedLines = [];
|
|
@@ -774,7 +774,7 @@ ${itemIndentStr}`);
|
|
|
774
774
|
let sumWidth = this.displayWidth(sumChunks[0]);
|
|
775
775
|
chunks.forEach((chunk) => {
|
|
776
776
|
const visibleWidth = this.displayWidth(chunk);
|
|
777
|
-
if (sumWidth + visibleWidth <=
|
|
777
|
+
if (sumWidth + visibleWidth <= width2) {
|
|
778
778
|
sumChunks.push(chunk);
|
|
779
779
|
sumWidth += visibleWidth;
|
|
780
780
|
return;
|
|
@@ -20460,6 +20460,8 @@ var ALLOWED_AST_TYPES = /* @__PURE__ */ new Set([
|
|
|
20460
20460
|
"Field",
|
|
20461
20461
|
"Function",
|
|
20462
20462
|
"Identity",
|
|
20463
|
+
"Index",
|
|
20464
|
+
"IndexExpression",
|
|
20463
20465
|
"KeyValuePair",
|
|
20464
20466
|
"Literal",
|
|
20465
20467
|
"MultiSelectHash",
|
|
@@ -20593,6 +20595,9 @@ function validateAst(ast) {
|
|
|
20593
20595
|
if (!ALLOWED_AST_TYPES.has(value.type)) {
|
|
20594
20596
|
throw new A2UICardExpressionError("CARD_EXPRESSION_NODE_FORBIDDEN", `JMESPath node ${value.type} is not allowed by ${A2UI_CARD_TRANSFORM_PROFILE}`);
|
|
20595
20597
|
}
|
|
20598
|
+
if (value.type === "Index" && (typeof value.value !== "number" || !Number.isSafeInteger(value.value) || value.value < 0)) {
|
|
20599
|
+
throw new A2UICardExpressionError("CARD_EXPRESSION_INVALID", "array index must be a non-negative safe integer");
|
|
20600
|
+
}
|
|
20596
20601
|
if (value.type === "Function" && value.name !== "not_null") {
|
|
20597
20602
|
throw new A2UICardExpressionError("CARD_EXPRESSION_FUNCTION_FORBIDDEN", `JMESPath function ${String(value.name)} is not allowed`);
|
|
20598
20603
|
}
|
|
@@ -21209,7 +21214,6 @@ var colors = [
|
|
|
21209
21214
|
"default",
|
|
21210
21215
|
"muted",
|
|
21211
21216
|
"primary",
|
|
21212
|
-
"accent",
|
|
21213
21217
|
"success",
|
|
21214
21218
|
"warning",
|
|
21215
21219
|
"error",
|
|
@@ -21261,8 +21265,18 @@ var iconNames = [
|
|
|
21261
21265
|
"warning",
|
|
21262
21266
|
"arrow-right-long"
|
|
21263
21267
|
];
|
|
21264
|
-
var
|
|
21265
|
-
|
|
21268
|
+
var layoutItem = {
|
|
21269
|
+
grow: {
|
|
21270
|
+
kind: "number",
|
|
21271
|
+
values: [0, 1, 2, 3, 4],
|
|
21272
|
+
parentComponents: ["Row", "Column"]
|
|
21273
|
+
}
|
|
21274
|
+
};
|
|
21275
|
+
var width = { width: { kind: "string", values: ["fit", "fill"] } };
|
|
21276
|
+
var radius = {
|
|
21277
|
+
radius: { kind: "string", values: ["none", "xs", "sm", "md", "full"] }
|
|
21278
|
+
};
|
|
21279
|
+
var decoration = {
|
|
21266
21280
|
padding: { kind: "string", values: spacing },
|
|
21267
21281
|
background: {
|
|
21268
21282
|
kind: "string",
|
|
@@ -21280,29 +21294,17 @@ var box = {
|
|
|
21280
21294
|
kind: "string",
|
|
21281
21295
|
values: ["none", "subtle", "card-border", "primary"]
|
|
21282
21296
|
},
|
|
21283
|
-
radius
|
|
21284
|
-
width: { kind: "string", values: ["fit", "fill"] },
|
|
21285
|
-
grow: { kind: "number", values: [0, 1, 2, 3, 4] },
|
|
21286
|
-
shrink: { kind: "boolean" }
|
|
21297
|
+
...radius
|
|
21287
21298
|
};
|
|
21288
21299
|
var typography = {
|
|
21289
21300
|
color: { kind: "string", values: colors },
|
|
21290
|
-
fontSize: {
|
|
21291
|
-
kind: "string",
|
|
21292
|
-
values: [
|
|
21293
|
-
"small",
|
|
21294
|
-
"medium",
|
|
21295
|
-
"large",
|
|
21296
|
-
"striking",
|
|
21297
|
-
"display",
|
|
21298
|
-
"badge",
|
|
21299
|
-
"merchant"
|
|
21300
|
-
]
|
|
21301
|
-
},
|
|
21301
|
+
fontSize: { kind: "string", values: ["xs", "sm", "md", "lg", "xl", "xxl"] },
|
|
21302
21302
|
fontWeight: { kind: "string", values: ["normal", "semibold", "bold"] }
|
|
21303
21303
|
};
|
|
21304
21304
|
var container = {
|
|
21305
|
-
...
|
|
21305
|
+
...layoutItem,
|
|
21306
|
+
...width,
|
|
21307
|
+
padding: { kind: "string", values: spacing },
|
|
21306
21308
|
children: { kind: "children", required: true },
|
|
21307
21309
|
gap: { kind: "string", values: spacing },
|
|
21308
21310
|
align: {
|
|
@@ -21322,6 +21324,7 @@ var container = {
|
|
|
21322
21324
|
},
|
|
21323
21325
|
"x2-overflow": { kind: "format" }
|
|
21324
21326
|
};
|
|
21327
|
+
var { justify: _listJustify, ...listContainer } = container;
|
|
21325
21328
|
var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
21326
21329
|
catalogId: LINKQUE_A2UI_V4_CATALOG_ID,
|
|
21327
21330
|
protocolVersion: "0.9",
|
|
@@ -21329,7 +21332,10 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
21329
21332
|
Card: {
|
|
21330
21333
|
interaction: "action",
|
|
21331
21334
|
properties: {
|
|
21332
|
-
...
|
|
21335
|
+
...layoutItem,
|
|
21336
|
+
...width,
|
|
21337
|
+
...decoration,
|
|
21338
|
+
child: { kind: "child", required: true },
|
|
21333
21339
|
action: { kind: "action" },
|
|
21334
21340
|
disabled: { kind: "boolean" }
|
|
21335
21341
|
}
|
|
@@ -21339,13 +21345,14 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
21339
21345
|
interaction: "none",
|
|
21340
21346
|
properties: {
|
|
21341
21347
|
...container,
|
|
21342
|
-
wrap: { kind: "string", values: ["wrap", "nowrap"] }
|
|
21348
|
+
wrap: { kind: "string", values: ["wrap", "nowrap"] },
|
|
21349
|
+
layout: { kind: "string", values: ["flex", "inline"] }
|
|
21343
21350
|
}
|
|
21344
21351
|
},
|
|
21345
21352
|
List: {
|
|
21346
21353
|
interaction: "none",
|
|
21347
21354
|
properties: {
|
|
21348
|
-
...
|
|
21355
|
+
...listContainer,
|
|
21349
21356
|
variant: {
|
|
21350
21357
|
kind: "string",
|
|
21351
21358
|
required: true,
|
|
@@ -21356,8 +21363,9 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
21356
21363
|
Text: {
|
|
21357
21364
|
interaction: "none",
|
|
21358
21365
|
properties: {
|
|
21359
|
-
...
|
|
21366
|
+
...layoutItem,
|
|
21360
21367
|
...typography,
|
|
21368
|
+
shrink: { kind: "boolean" },
|
|
21361
21369
|
text: { kind: "binding", required: true },
|
|
21362
21370
|
maxLines: { kind: "number", values: [0, 1, 2, 3, 4, 5, 6] },
|
|
21363
21371
|
decoration: { kind: "string", values: ["line-through"] },
|
|
@@ -21367,19 +21375,31 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
21367
21375
|
Tag: {
|
|
21368
21376
|
interaction: "none",
|
|
21369
21377
|
properties: {
|
|
21370
|
-
...
|
|
21371
|
-
...typography,
|
|
21378
|
+
...layoutItem,
|
|
21372
21379
|
text: { kind: "binding", required: true },
|
|
21373
21380
|
icon: { kind: "string", values: iconNames },
|
|
21374
|
-
|
|
21375
|
-
|
|
21376
|
-
|
|
21381
|
+
tone: {
|
|
21382
|
+
kind: "string",
|
|
21383
|
+
values: [
|
|
21384
|
+
"default",
|
|
21385
|
+
"muted",
|
|
21386
|
+
"primary",
|
|
21387
|
+
"success",
|
|
21388
|
+
"warning",
|
|
21389
|
+
"error"
|
|
21390
|
+
]
|
|
21391
|
+
},
|
|
21392
|
+
variant: { kind: "string", values: ["soft", "outline", "plain"] },
|
|
21393
|
+
size: { kind: "string", values: ["sm", "md"] },
|
|
21394
|
+
shrink: { kind: "boolean" },
|
|
21395
|
+
maxLines: { kind: "number", values: [0, 1, 2, 3, 4, 5, 6] }
|
|
21377
21396
|
}
|
|
21378
21397
|
},
|
|
21379
21398
|
Button: {
|
|
21380
21399
|
interaction: "action",
|
|
21381
21400
|
properties: {
|
|
21382
|
-
...
|
|
21401
|
+
...layoutItem,
|
|
21402
|
+
...width,
|
|
21383
21403
|
label: { kind: "binding", required: true },
|
|
21384
21404
|
action: { kind: "action", required: true },
|
|
21385
21405
|
checks: { kind: "format" },
|
|
@@ -21397,34 +21417,29 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
21397
21417
|
Image: {
|
|
21398
21418
|
interaction: "none",
|
|
21399
21419
|
properties: {
|
|
21400
|
-
...
|
|
21420
|
+
...layoutItem,
|
|
21421
|
+
...radius,
|
|
21401
21422
|
src: { kind: "binding", required: true },
|
|
21402
21423
|
alt: { kind: "binding" },
|
|
21403
21424
|
fit: {
|
|
21404
21425
|
kind: "string",
|
|
21405
21426
|
values: ["contain", "cover", "fill", "none", "scale-down"]
|
|
21406
21427
|
},
|
|
21407
|
-
|
|
21428
|
+
aspectRatio: {
|
|
21408
21429
|
kind: "string",
|
|
21409
|
-
values: [
|
|
21410
|
-
|
|
21411
|
-
|
|
21412
|
-
|
|
21413
|
-
|
|
21414
|
-
|
|
21415
|
-
"portraitFeature",
|
|
21416
|
-
"productThumbnail",
|
|
21417
|
-
"voucherThumbnail",
|
|
21418
|
-
"largeFeature",
|
|
21419
|
-
"header"
|
|
21420
|
-
]
|
|
21430
|
+
values: ["square", "portrait", "landscape", "wide", "banner"]
|
|
21431
|
+
},
|
|
21432
|
+
height: { kind: "string", values: ["auto", "fill"] },
|
|
21433
|
+
size: {
|
|
21434
|
+
kind: "string",
|
|
21435
|
+
values: ["xs", "sm", "md", "lg", "xl", "full"]
|
|
21421
21436
|
}
|
|
21422
21437
|
}
|
|
21423
21438
|
},
|
|
21424
21439
|
Icon: {
|
|
21425
21440
|
interaction: "none",
|
|
21426
21441
|
properties: {
|
|
21427
|
-
...
|
|
21442
|
+
...layoutItem,
|
|
21428
21443
|
name: { kind: "string", required: true, values: iconNames },
|
|
21429
21444
|
label: { kind: "string" },
|
|
21430
21445
|
color: { kind: "string", values: colors },
|
|
@@ -21437,15 +21452,15 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
21437
21452
|
Divider: {
|
|
21438
21453
|
interaction: "none",
|
|
21439
21454
|
properties: {
|
|
21440
|
-
...
|
|
21455
|
+
...layoutItem,
|
|
21441
21456
|
axis: { kind: "string", values: ["horizontal", "vertical"] }
|
|
21442
21457
|
}
|
|
21443
21458
|
},
|
|
21444
21459
|
TextField: {
|
|
21445
21460
|
interaction: "input",
|
|
21446
21461
|
properties: {
|
|
21447
|
-
...
|
|
21448
|
-
...
|
|
21462
|
+
...layoutItem,
|
|
21463
|
+
...width,
|
|
21449
21464
|
label: { kind: "string", required: true },
|
|
21450
21465
|
value: { kind: "binding", required: true },
|
|
21451
21466
|
checks: { kind: "format" },
|
|
@@ -21469,7 +21484,8 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
21469
21484
|
ChoicePicker: {
|
|
21470
21485
|
interaction: "input",
|
|
21471
21486
|
properties: {
|
|
21472
|
-
...
|
|
21487
|
+
...layoutItem,
|
|
21488
|
+
...width,
|
|
21473
21489
|
label: { kind: "string", required: true },
|
|
21474
21490
|
value: { kind: "binding", required: true },
|
|
21475
21491
|
options: { kind: "options", required: true },
|
|
@@ -21484,7 +21500,8 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
21484
21500
|
Stepper: {
|
|
21485
21501
|
interaction: "input",
|
|
21486
21502
|
properties: {
|
|
21487
|
-
...
|
|
21503
|
+
...layoutItem,
|
|
21504
|
+
...width,
|
|
21488
21505
|
label: { kind: "string", required: true },
|
|
21489
21506
|
value: { kind: "binding", required: true },
|
|
21490
21507
|
min: { kind: "number" },
|
|
@@ -21600,8 +21617,6 @@ function validateComponents(payload, path23, surfaces, issues) {
|
|
|
21600
21617
|
if (value !== void 0)
|
|
21601
21618
|
validateProperty(value, property, `${componentPath}.${name}`, issues, name);
|
|
21602
21619
|
}
|
|
21603
|
-
if (component.component === "Tag" && component.icon === void 0 && component.gap !== void 0)
|
|
21604
|
-
issues.push(issue2(`${componentPath}.gap`, "TAG_GAP_REQUIRES_ICON", "Tag.gap requires Tag.icon"));
|
|
21605
21620
|
if (component["x2-overflow"] !== void 0)
|
|
21606
21621
|
validateOverflow(component, componentPath, issues);
|
|
21607
21622
|
if (component.component === "TextField")
|
|
@@ -21615,7 +21630,7 @@ function validateComponents(payload, path23, surfaces, issues) {
|
|
|
21615
21630
|
validateStepper(component, componentPath, issues);
|
|
21616
21631
|
if (component.checks !== void 0)
|
|
21617
21632
|
validateChecks(component.checks, `${componentPath}.checks`, issues);
|
|
21618
|
-
if (component.format !== void 0 &&
|
|
21633
|
+
if (component.format !== void 0 && component.component === "Text")
|
|
21619
21634
|
validateNumberFormat(component.format, `${componentPath}.format`, issues);
|
|
21620
21635
|
if (component.action !== void 0)
|
|
21621
21636
|
validateAction(component.action, `${componentPath}.action`, issues, 0);
|
|
@@ -21629,6 +21644,11 @@ function validateProperty(value, schema, path23, issues, propertyName) {
|
|
|
21629
21644
|
issues.push(issue2(path23, "INVALID_DISPLAY_VALUE", `display value must be ${stringOnly ? "a string" : "a string or finite number"}, or a compatible display binding`));
|
|
21630
21645
|
return;
|
|
21631
21646
|
}
|
|
21647
|
+
if (schema.kind === "child") {
|
|
21648
|
+
if (!isSafeIdentifier(value))
|
|
21649
|
+
issues.push(issue2(path23, "INVALID_CHILD", "child must be a safe component id"));
|
|
21650
|
+
return;
|
|
21651
|
+
}
|
|
21632
21652
|
if (schema.kind === "children") {
|
|
21633
21653
|
const valid = Array.isArray(value) ? value.every(isSafeIdentifier) : isPlainRecord(value) && Object.keys(value).length === 2 && isSafeIdentifier(value.componentId) && typeof value.path === "string" && isSafePath(value.path);
|
|
21634
21654
|
if (!valid)
|
|
@@ -21869,20 +21889,27 @@ function validateReferences(surfaces, path23, issues) {
|
|
|
21869
21889
|
issues.push(issue2(`${path23}.surfaces.${surfaceId}`, "MISSING_ROOT_COMPONENT", "surface must define root"));
|
|
21870
21890
|
const edges = /* @__PURE__ */ new Map();
|
|
21871
21891
|
for (const [id, component] of components) {
|
|
21872
|
-
const
|
|
21873
|
-
const refs = Array.isArray(children) ? children.filter((entry) => typeof entry === "string") : isPlainRecord(children) && typeof children.componentId === "string" ? [children.componentId] : [];
|
|
21892
|
+
const refs = getComponentReferences(component);
|
|
21874
21893
|
edges.set(id, refs);
|
|
21875
21894
|
refs.forEach((ref) => {
|
|
21876
21895
|
if (!components.has(ref))
|
|
21877
|
-
issues.push(issue2(`${path23}.surfaces.${surfaceId}.components.${id}.children`, "MISSING_COMPONENT_REFERENCE", `component ${ref} does not exist`));
|
|
21896
|
+
issues.push(issue2(`${path23}.surfaces.${surfaceId}.components.${id}.${component.child !== void 0 ? "child" : "children"}`, "MISSING_COMPONENT_REFERENCE", `component ${ref} does not exist`));
|
|
21878
21897
|
});
|
|
21879
21898
|
if ((component.component === "Button" || component.component === "Card" && component.action !== void 0) && refs.some((ref) => hasInteractiveDescendant(ref, components, /* @__PURE__ */ new Set())))
|
|
21880
|
-
issues.push(issue2(`${path23}.surfaces.${surfaceId}.components.${id}.children`, "NESTED_INTERACTION", "action components cannot contain interactive descendants"));
|
|
21899
|
+
issues.push(issue2(`${path23}.surfaces.${surfaceId}.components.${id}.${component.child !== void 0 ? "child" : "children"}`, "NESTED_INTERACTION", "action components cannot contain interactive descendants"));
|
|
21881
21900
|
collectSurfaceOpenReferences(component.action).forEach((targetSurfaceId) => {
|
|
21882
21901
|
if (!surfaces.has(targetSurfaceId))
|
|
21883
21902
|
issues.push(issue2(`${path23}.surfaces.${surfaceId}.components.${id}.action`, "MISSING_SURFACE_REFERENCE", `surface ${targetSurfaceId} does not exist`));
|
|
21884
21903
|
});
|
|
21885
21904
|
}
|
|
21905
|
+
components.forEach((component, id) => {
|
|
21906
|
+
if (component.grow === void 0)
|
|
21907
|
+
return;
|
|
21908
|
+
const parents = [...components.values()].filter((parent) => getComponentReferences(parent).includes(id));
|
|
21909
|
+
if (id === "root" || parents.length === 0 || parents.some((parent) => parent.component !== "Row" && parent.component !== "Column")) {
|
|
21910
|
+
issues.push(issue2(`${path23}.surfaces.${surfaceId}.components.${id}.grow`, "INVALID_LAYOUT_PARENT", "grow requires a direct Row or Column parent in every occurrence"));
|
|
21911
|
+
}
|
|
21912
|
+
});
|
|
21886
21913
|
const visiting = /* @__PURE__ */ new Set();
|
|
21887
21914
|
const visited = /* @__PURE__ */ new Set();
|
|
21888
21915
|
const walk = (id) => {
|
|
@@ -21913,6 +21940,14 @@ function collectSurfaceOpenReferences(value, result = /* @__PURE__ */ new Set())
|
|
|
21913
21940
|
}
|
|
21914
21941
|
return result;
|
|
21915
21942
|
}
|
|
21943
|
+
function getComponentReferences(component) {
|
|
21944
|
+
if (typeof component.child === "string")
|
|
21945
|
+
return [component.child];
|
|
21946
|
+
const children = component.children;
|
|
21947
|
+
if (Array.isArray(children))
|
|
21948
|
+
return children.filter((entry) => typeof entry === "string");
|
|
21949
|
+
return isPlainRecord(children) && typeof children.componentId === "string" ? [children.componentId] : [];
|
|
21950
|
+
}
|
|
21916
21951
|
function hasInteractiveDescendant(id, components, visited) {
|
|
21917
21952
|
if (visited.has(id))
|
|
21918
21953
|
return false;
|
|
@@ -21922,8 +21957,7 @@ function hasInteractiveDescendant(id, components, visited) {
|
|
|
21922
21957
|
return false;
|
|
21923
21958
|
if (component.component === "Button" || component.action !== void 0 || ["TextField", "ChoicePicker", "Stepper"].includes(String(component.component)))
|
|
21924
21959
|
return true;
|
|
21925
|
-
const
|
|
21926
|
-
const refs = Array.isArray(children) ? children : isPlainRecord(children) ? [children.componentId] : [];
|
|
21960
|
+
const refs = getComponentReferences(component);
|
|
21927
21961
|
return refs.some((ref) => typeof ref === "string" && hasInteractiveDescendant(ref, components, visited));
|
|
21928
21962
|
}
|
|
21929
21963
|
|
package/package.json
CHANGED
package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-P5YTVR76.js → chunk-MDZWPPOW.js}
RENAMED
|
@@ -8994,6 +8994,8 @@ var ALLOWED_AST_TYPES = /* @__PURE__ */ new Set([
|
|
|
8994
8994
|
"Field",
|
|
8995
8995
|
"Function",
|
|
8996
8996
|
"Identity",
|
|
8997
|
+
"Index",
|
|
8998
|
+
"IndexExpression",
|
|
8997
8999
|
"KeyValuePair",
|
|
8998
9000
|
"Literal",
|
|
8999
9001
|
"MultiSelectHash",
|
|
@@ -9065,6 +9067,9 @@ function validateAst(ast) {
|
|
|
9065
9067
|
if (!ALLOWED_AST_TYPES.has(value.type)) {
|
|
9066
9068
|
throw new StructuralExpressionError("STRUCTURAL_EXPRESSION_NODE_FORBIDDEN", `JMESPath node ${value.type} is not allowed`);
|
|
9067
9069
|
}
|
|
9070
|
+
if (value.type === "Index" && (typeof value.value !== "number" || !Number.isSafeInteger(value.value) || value.value < 0)) {
|
|
9071
|
+
throw new StructuralExpressionError("STRUCTURAL_EXPRESSION_INVALID", "array index must be a non-negative safe integer");
|
|
9072
|
+
}
|
|
9068
9073
|
if (value.type === "Function" && value.name !== "not_null") {
|
|
9069
9074
|
throw new StructuralExpressionError("STRUCTURAL_EXPRESSION_FUNCTION_FORBIDDEN", `JMESPath function ${String(value.name)} is not allowed`);
|
|
9070
9075
|
}
|
|
@@ -9852,6 +9857,8 @@ var ALLOWED_AST_TYPES2 = /* @__PURE__ */ new Set([
|
|
|
9852
9857
|
"Field",
|
|
9853
9858
|
"Function",
|
|
9854
9859
|
"Identity",
|
|
9860
|
+
"Index",
|
|
9861
|
+
"IndexExpression",
|
|
9855
9862
|
"KeyValuePair",
|
|
9856
9863
|
"Literal",
|
|
9857
9864
|
"MultiSelectHash",
|
|
@@ -9944,6 +9951,9 @@ function validateAst2(ast) {
|
|
|
9944
9951
|
if (!ALLOWED_AST_TYPES2.has(value.type)) {
|
|
9945
9952
|
throw new A2UICardExpressionError("CARD_EXPRESSION_NODE_FORBIDDEN", `JMESPath node ${value.type} is not allowed by ${A2UI_CARD_TRANSFORM_PROFILE}`);
|
|
9946
9953
|
}
|
|
9954
|
+
if (value.type === "Index" && (typeof value.value !== "number" || !Number.isSafeInteger(value.value) || value.value < 0)) {
|
|
9955
|
+
throw new A2UICardExpressionError("CARD_EXPRESSION_INVALID", "array index must be a non-negative safe integer");
|
|
9956
|
+
}
|
|
9947
9957
|
if (value.type === "Function" && value.name !== "not_null") {
|
|
9948
9958
|
throw new A2UICardExpressionError("CARD_EXPRESSION_FUNCTION_FORBIDDEN", `JMESPath function ${String(value.name)} is not allowed`);
|
|
9949
9959
|
}
|
|
@@ -9962,7 +9972,6 @@ var colors = [
|
|
|
9962
9972
|
"default",
|
|
9963
9973
|
"muted",
|
|
9964
9974
|
"primary",
|
|
9965
|
-
"accent",
|
|
9966
9975
|
"success",
|
|
9967
9976
|
"warning",
|
|
9968
9977
|
"error",
|
|
@@ -10014,8 +10023,18 @@ var iconNames = [
|
|
|
10014
10023
|
"warning",
|
|
10015
10024
|
"arrow-right-long"
|
|
10016
10025
|
];
|
|
10017
|
-
var
|
|
10018
|
-
|
|
10026
|
+
var layoutItem = {
|
|
10027
|
+
grow: {
|
|
10028
|
+
kind: "number",
|
|
10029
|
+
values: [0, 1, 2, 3, 4],
|
|
10030
|
+
parentComponents: ["Row", "Column"]
|
|
10031
|
+
}
|
|
10032
|
+
};
|
|
10033
|
+
var width = { width: { kind: "string", values: ["fit", "fill"] } };
|
|
10034
|
+
var radius = {
|
|
10035
|
+
radius: { kind: "string", values: ["none", "xs", "sm", "md", "full"] }
|
|
10036
|
+
};
|
|
10037
|
+
var decoration = {
|
|
10019
10038
|
padding: { kind: "string", values: spacing },
|
|
10020
10039
|
background: {
|
|
10021
10040
|
kind: "string",
|
|
@@ -10033,29 +10052,17 @@ var box = {
|
|
|
10033
10052
|
kind: "string",
|
|
10034
10053
|
values: ["none", "subtle", "card-border", "primary"]
|
|
10035
10054
|
},
|
|
10036
|
-
radius
|
|
10037
|
-
width: { kind: "string", values: ["fit", "fill"] },
|
|
10038
|
-
grow: { kind: "number", values: [0, 1, 2, 3, 4] },
|
|
10039
|
-
shrink: { kind: "boolean" }
|
|
10055
|
+
...radius
|
|
10040
10056
|
};
|
|
10041
10057
|
var typography = {
|
|
10042
10058
|
color: { kind: "string", values: colors },
|
|
10043
|
-
fontSize: {
|
|
10044
|
-
kind: "string",
|
|
10045
|
-
values: [
|
|
10046
|
-
"small",
|
|
10047
|
-
"medium",
|
|
10048
|
-
"large",
|
|
10049
|
-
"striking",
|
|
10050
|
-
"display",
|
|
10051
|
-
"badge",
|
|
10052
|
-
"merchant"
|
|
10053
|
-
]
|
|
10054
|
-
},
|
|
10059
|
+
fontSize: { kind: "string", values: ["xs", "sm", "md", "lg", "xl", "xxl"] },
|
|
10055
10060
|
fontWeight: { kind: "string", values: ["normal", "semibold", "bold"] }
|
|
10056
10061
|
};
|
|
10057
10062
|
var container = {
|
|
10058
|
-
...
|
|
10063
|
+
...layoutItem,
|
|
10064
|
+
...width,
|
|
10065
|
+
padding: { kind: "string", values: spacing },
|
|
10059
10066
|
children: { kind: "children", required: true },
|
|
10060
10067
|
gap: { kind: "string", values: spacing },
|
|
10061
10068
|
align: {
|
|
@@ -10075,6 +10082,7 @@ var container = {
|
|
|
10075
10082
|
},
|
|
10076
10083
|
"x2-overflow": { kind: "format" }
|
|
10077
10084
|
};
|
|
10085
|
+
var { justify: _listJustify, ...listContainer } = container;
|
|
10078
10086
|
var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
10079
10087
|
catalogId: LINKQUE_A2UI_V4_CATALOG_ID,
|
|
10080
10088
|
protocolVersion: "0.9",
|
|
@@ -10082,7 +10090,10 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
10082
10090
|
Card: {
|
|
10083
10091
|
interaction: "action",
|
|
10084
10092
|
properties: {
|
|
10085
|
-
...
|
|
10093
|
+
...layoutItem,
|
|
10094
|
+
...width,
|
|
10095
|
+
...decoration,
|
|
10096
|
+
child: { kind: "child", required: true },
|
|
10086
10097
|
action: { kind: "action" },
|
|
10087
10098
|
disabled: { kind: "boolean" }
|
|
10088
10099
|
}
|
|
@@ -10092,13 +10103,14 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
10092
10103
|
interaction: "none",
|
|
10093
10104
|
properties: {
|
|
10094
10105
|
...container,
|
|
10095
|
-
wrap: { kind: "string", values: ["wrap", "nowrap"] }
|
|
10106
|
+
wrap: { kind: "string", values: ["wrap", "nowrap"] },
|
|
10107
|
+
layout: { kind: "string", values: ["flex", "inline"] }
|
|
10096
10108
|
}
|
|
10097
10109
|
},
|
|
10098
10110
|
List: {
|
|
10099
10111
|
interaction: "none",
|
|
10100
10112
|
properties: {
|
|
10101
|
-
...
|
|
10113
|
+
...listContainer,
|
|
10102
10114
|
variant: {
|
|
10103
10115
|
kind: "string",
|
|
10104
10116
|
required: true,
|
|
@@ -10109,8 +10121,9 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
10109
10121
|
Text: {
|
|
10110
10122
|
interaction: "none",
|
|
10111
10123
|
properties: {
|
|
10112
|
-
...
|
|
10124
|
+
...layoutItem,
|
|
10113
10125
|
...typography,
|
|
10126
|
+
shrink: { kind: "boolean" },
|
|
10114
10127
|
text: { kind: "binding", required: true },
|
|
10115
10128
|
maxLines: { kind: "number", values: [0, 1, 2, 3, 4, 5, 6] },
|
|
10116
10129
|
decoration: { kind: "string", values: ["line-through"] },
|
|
@@ -10120,19 +10133,31 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
10120
10133
|
Tag: {
|
|
10121
10134
|
interaction: "none",
|
|
10122
10135
|
properties: {
|
|
10123
|
-
...
|
|
10124
|
-
...typography,
|
|
10136
|
+
...layoutItem,
|
|
10125
10137
|
text: { kind: "binding", required: true },
|
|
10126
10138
|
icon: { kind: "string", values: iconNames },
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10139
|
+
tone: {
|
|
10140
|
+
kind: "string",
|
|
10141
|
+
values: [
|
|
10142
|
+
"default",
|
|
10143
|
+
"muted",
|
|
10144
|
+
"primary",
|
|
10145
|
+
"success",
|
|
10146
|
+
"warning",
|
|
10147
|
+
"error"
|
|
10148
|
+
]
|
|
10149
|
+
},
|
|
10150
|
+
variant: { kind: "string", values: ["soft", "outline", "plain"] },
|
|
10151
|
+
size: { kind: "string", values: ["sm", "md"] },
|
|
10152
|
+
shrink: { kind: "boolean" },
|
|
10153
|
+
maxLines: { kind: "number", values: [0, 1, 2, 3, 4, 5, 6] }
|
|
10130
10154
|
}
|
|
10131
10155
|
},
|
|
10132
10156
|
Button: {
|
|
10133
10157
|
interaction: "action",
|
|
10134
10158
|
properties: {
|
|
10135
|
-
...
|
|
10159
|
+
...layoutItem,
|
|
10160
|
+
...width,
|
|
10136
10161
|
label: { kind: "binding", required: true },
|
|
10137
10162
|
action: { kind: "action", required: true },
|
|
10138
10163
|
checks: { kind: "format" },
|
|
@@ -10150,34 +10175,29 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
10150
10175
|
Image: {
|
|
10151
10176
|
interaction: "none",
|
|
10152
10177
|
properties: {
|
|
10153
|
-
...
|
|
10178
|
+
...layoutItem,
|
|
10179
|
+
...radius,
|
|
10154
10180
|
src: { kind: "binding", required: true },
|
|
10155
10181
|
alt: { kind: "binding" },
|
|
10156
10182
|
fit: {
|
|
10157
10183
|
kind: "string",
|
|
10158
10184
|
values: ["contain", "cover", "fill", "none", "scale-down"]
|
|
10159
10185
|
},
|
|
10160
|
-
|
|
10186
|
+
aspectRatio: {
|
|
10161
10187
|
kind: "string",
|
|
10162
|
-
values: [
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
"portraitFeature",
|
|
10169
|
-
"productThumbnail",
|
|
10170
|
-
"voucherThumbnail",
|
|
10171
|
-
"largeFeature",
|
|
10172
|
-
"header"
|
|
10173
|
-
]
|
|
10188
|
+
values: ["square", "portrait", "landscape", "wide", "banner"]
|
|
10189
|
+
},
|
|
10190
|
+
height: { kind: "string", values: ["auto", "fill"] },
|
|
10191
|
+
size: {
|
|
10192
|
+
kind: "string",
|
|
10193
|
+
values: ["xs", "sm", "md", "lg", "xl", "full"]
|
|
10174
10194
|
}
|
|
10175
10195
|
}
|
|
10176
10196
|
},
|
|
10177
10197
|
Icon: {
|
|
10178
10198
|
interaction: "none",
|
|
10179
10199
|
properties: {
|
|
10180
|
-
...
|
|
10200
|
+
...layoutItem,
|
|
10181
10201
|
name: { kind: "string", required: true, values: iconNames },
|
|
10182
10202
|
label: { kind: "string" },
|
|
10183
10203
|
color: { kind: "string", values: colors },
|
|
@@ -10190,15 +10210,15 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
10190
10210
|
Divider: {
|
|
10191
10211
|
interaction: "none",
|
|
10192
10212
|
properties: {
|
|
10193
|
-
...
|
|
10213
|
+
...layoutItem,
|
|
10194
10214
|
axis: { kind: "string", values: ["horizontal", "vertical"] }
|
|
10195
10215
|
}
|
|
10196
10216
|
},
|
|
10197
10217
|
TextField: {
|
|
10198
10218
|
interaction: "input",
|
|
10199
10219
|
properties: {
|
|
10200
|
-
...
|
|
10201
|
-
...
|
|
10220
|
+
...layoutItem,
|
|
10221
|
+
...width,
|
|
10202
10222
|
label: { kind: "string", required: true },
|
|
10203
10223
|
value: { kind: "binding", required: true },
|
|
10204
10224
|
checks: { kind: "format" },
|
|
@@ -10222,7 +10242,8 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
10222
10242
|
ChoicePicker: {
|
|
10223
10243
|
interaction: "input",
|
|
10224
10244
|
properties: {
|
|
10225
|
-
...
|
|
10245
|
+
...layoutItem,
|
|
10246
|
+
...width,
|
|
10226
10247
|
label: { kind: "string", required: true },
|
|
10227
10248
|
value: { kind: "binding", required: true },
|
|
10228
10249
|
options: { kind: "options", required: true },
|
|
@@ -10237,7 +10258,8 @@ var A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
|
10237
10258
|
Stepper: {
|
|
10238
10259
|
interaction: "input",
|
|
10239
10260
|
properties: {
|
|
10240
|
-
...
|
|
10261
|
+
...layoutItem,
|
|
10262
|
+
...width,
|
|
10241
10263
|
label: { kind: "string", required: true },
|
|
10242
10264
|
value: { kind: "binding", required: true },
|
|
10243
10265
|
min: { kind: "number" },
|
|
@@ -10353,8 +10375,6 @@ function validateComponents(payload, path2, surfaces, issues) {
|
|
|
10353
10375
|
if (value !== void 0)
|
|
10354
10376
|
validateProperty(value, property, `${componentPath}.${name}`, issues, name);
|
|
10355
10377
|
}
|
|
10356
|
-
if (component.component === "Tag" && component.icon === void 0 && component.gap !== void 0)
|
|
10357
|
-
issues.push(issue2(`${componentPath}.gap`, "TAG_GAP_REQUIRES_ICON", "Tag.gap requires Tag.icon"));
|
|
10358
10378
|
if (component["x2-overflow"] !== void 0)
|
|
10359
10379
|
validateOverflow(component, componentPath, issues);
|
|
10360
10380
|
if (component.component === "TextField")
|
|
@@ -10368,7 +10388,7 @@ function validateComponents(payload, path2, surfaces, issues) {
|
|
|
10368
10388
|
validateStepper(component, componentPath, issues);
|
|
10369
10389
|
if (component.checks !== void 0)
|
|
10370
10390
|
validateChecks(component.checks, `${componentPath}.checks`, issues);
|
|
10371
|
-
if (component.format !== void 0 &&
|
|
10391
|
+
if (component.format !== void 0 && component.component === "Text")
|
|
10372
10392
|
validateNumberFormat(component.format, `${componentPath}.format`, issues);
|
|
10373
10393
|
if (component.action !== void 0)
|
|
10374
10394
|
validateAction(component.action, `${componentPath}.action`, issues, 0);
|
|
@@ -10382,6 +10402,11 @@ function validateProperty(value, schema, path2, issues, propertyName) {
|
|
|
10382
10402
|
issues.push(issue2(path2, "INVALID_DISPLAY_VALUE", `display value must be ${stringOnly ? "a string" : "a string or finite number"}, or a compatible display binding`));
|
|
10383
10403
|
return;
|
|
10384
10404
|
}
|
|
10405
|
+
if (schema.kind === "child") {
|
|
10406
|
+
if (!isSafeIdentifier(value))
|
|
10407
|
+
issues.push(issue2(path2, "INVALID_CHILD", "child must be a safe component id"));
|
|
10408
|
+
return;
|
|
10409
|
+
}
|
|
10385
10410
|
if (schema.kind === "children") {
|
|
10386
10411
|
const valid = Array.isArray(value) ? value.every(isSafeIdentifier) : isPlainRecord(value) && Object.keys(value).length === 2 && isSafeIdentifier(value.componentId) && typeof value.path === "string" && isSafePath(value.path);
|
|
10387
10412
|
if (!valid)
|
|
@@ -10622,20 +10647,27 @@ function validateReferences(surfaces, path2, issues) {
|
|
|
10622
10647
|
issues.push(issue2(`${path2}.surfaces.${surfaceId}`, "MISSING_ROOT_COMPONENT", "surface must define root"));
|
|
10623
10648
|
const edges = /* @__PURE__ */ new Map();
|
|
10624
10649
|
for (const [id, component] of components) {
|
|
10625
|
-
const
|
|
10626
|
-
const refs = Array.isArray(children) ? children.filter((entry) => typeof entry === "string") : isPlainRecord(children) && typeof children.componentId === "string" ? [children.componentId] : [];
|
|
10650
|
+
const refs = getComponentReferences(component);
|
|
10627
10651
|
edges.set(id, refs);
|
|
10628
10652
|
refs.forEach((ref) => {
|
|
10629
10653
|
if (!components.has(ref))
|
|
10630
|
-
issues.push(issue2(`${path2}.surfaces.${surfaceId}.components.${id}.children`, "MISSING_COMPONENT_REFERENCE", `component ${ref} does not exist`));
|
|
10654
|
+
issues.push(issue2(`${path2}.surfaces.${surfaceId}.components.${id}.${component.child !== void 0 ? "child" : "children"}`, "MISSING_COMPONENT_REFERENCE", `component ${ref} does not exist`));
|
|
10631
10655
|
});
|
|
10632
10656
|
if ((component.component === "Button" || component.component === "Card" && component.action !== void 0) && refs.some((ref) => hasInteractiveDescendant(ref, components, /* @__PURE__ */ new Set())))
|
|
10633
|
-
issues.push(issue2(`${path2}.surfaces.${surfaceId}.components.${id}.children`, "NESTED_INTERACTION", "action components cannot contain interactive descendants"));
|
|
10657
|
+
issues.push(issue2(`${path2}.surfaces.${surfaceId}.components.${id}.${component.child !== void 0 ? "child" : "children"}`, "NESTED_INTERACTION", "action components cannot contain interactive descendants"));
|
|
10634
10658
|
collectSurfaceOpenReferences(component.action).forEach((targetSurfaceId) => {
|
|
10635
10659
|
if (!surfaces.has(targetSurfaceId))
|
|
10636
10660
|
issues.push(issue2(`${path2}.surfaces.${surfaceId}.components.${id}.action`, "MISSING_SURFACE_REFERENCE", `surface ${targetSurfaceId} does not exist`));
|
|
10637
10661
|
});
|
|
10638
10662
|
}
|
|
10663
|
+
components.forEach((component, id) => {
|
|
10664
|
+
if (component.grow === void 0)
|
|
10665
|
+
return;
|
|
10666
|
+
const parents = [...components.values()].filter((parent) => getComponentReferences(parent).includes(id));
|
|
10667
|
+
if (id === "root" || parents.length === 0 || parents.some((parent) => parent.component !== "Row" && parent.component !== "Column")) {
|
|
10668
|
+
issues.push(issue2(`${path2}.surfaces.${surfaceId}.components.${id}.grow`, "INVALID_LAYOUT_PARENT", "grow requires a direct Row or Column parent in every occurrence"));
|
|
10669
|
+
}
|
|
10670
|
+
});
|
|
10639
10671
|
const visiting = /* @__PURE__ */ new Set();
|
|
10640
10672
|
const visited = /* @__PURE__ */ new Set();
|
|
10641
10673
|
const walk = (id) => {
|
|
@@ -10666,6 +10698,14 @@ function collectSurfaceOpenReferences(value, result = /* @__PURE__ */ new Set())
|
|
|
10666
10698
|
}
|
|
10667
10699
|
return result;
|
|
10668
10700
|
}
|
|
10701
|
+
function getComponentReferences(component) {
|
|
10702
|
+
if (typeof component.child === "string")
|
|
10703
|
+
return [component.child];
|
|
10704
|
+
const children = component.children;
|
|
10705
|
+
if (Array.isArray(children))
|
|
10706
|
+
return children.filter((entry) => typeof entry === "string");
|
|
10707
|
+
return isPlainRecord(children) && typeof children.componentId === "string" ? [children.componentId] : [];
|
|
10708
|
+
}
|
|
10669
10709
|
function hasInteractiveDescendant(id, components, visited) {
|
|
10670
10710
|
if (visited.has(id))
|
|
10671
10711
|
return false;
|
|
@@ -10675,8 +10715,7 @@ function hasInteractiveDescendant(id, components, visited) {
|
|
|
10675
10715
|
return false;
|
|
10676
10716
|
if (component.component === "Button" || component.action !== void 0 || ["TextField", "ChoicePicker", "Stepper"].includes(String(component.component)))
|
|
10677
10717
|
return true;
|
|
10678
|
-
const
|
|
10679
|
-
const refs = Array.isArray(children) ? children : isPlainRecord(children) ? [children.componentId] : [];
|
|
10718
|
+
const refs = getComponentReferences(component);
|
|
10680
10719
|
return refs.some((ref) => typeof ref === "string" && hasInteractiveDescendant(ref, components, visited));
|
|
10681
10720
|
}
|
|
10682
10721
|
|
|
@@ -24,13 +24,13 @@ import {
|
|
|
24
24
|
resolveLinkqueGatewayAuth,
|
|
25
25
|
resolveRunStorage,
|
|
26
26
|
toAgentRunMessages
|
|
27
|
-
} from "../../chunk-
|
|
27
|
+
} from "../../chunk-JQKPMWIR.js";
|
|
28
28
|
import "../../chunk-MKS245OU.js";
|
|
29
29
|
import "../../chunk-YDKZZ6EH.js";
|
|
30
30
|
import "../../chunk-2NGJGNYB.js";
|
|
31
31
|
import {
|
|
32
32
|
getBakedProtocol
|
|
33
|
-
} from "../../chunk-
|
|
33
|
+
} from "../../chunk-NIEA4H2C.js";
|
|
34
34
|
import {
|
|
35
35
|
A2UI_PAYMENT_RESULT_EVENT_NAME,
|
|
36
36
|
CANCEL_CONVERSATION_RUN_OPERATION,
|
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
verifyPaymentResult,
|
|
102
102
|
warnLogFailure,
|
|
103
103
|
wrapToolWithHooks
|
|
104
|
-
} from "../../chunk-
|
|
104
|
+
} from "../../chunk-MDZWPPOW.js";
|
|
105
105
|
import "../../chunk-XUFLSZM4.js";
|
|
106
106
|
import "../../chunk-I64V3ICJ.js";
|
|
107
107
|
import {
|
|
@@ -41187,7 +41187,7 @@ var DEFAULT_IMAGE_URL_RULES = [
|
|
|
41187
41187
|
{ host: "masspre.alipay.com", pathPrefix: "/linkque/afts/img/" },
|
|
41188
41188
|
{ host: "mdn.alipayobjects.com", pathPrefix: "/linkque/afts/img/" }
|
|
41189
41189
|
];
|
|
41190
|
-
var MAX_BYTES =
|
|
41190
|
+
var MAX_BYTES = 20 * 1024 * 1024;
|
|
41191
41191
|
function imageError(code) {
|
|
41192
41192
|
throw new Error(code);
|
|
41193
41193
|
}
|
|
@@ -41221,7 +41221,7 @@ async function boundedBody(response, max) {
|
|
|
41221
41221
|
function validate(data, mediaType) {
|
|
41222
41222
|
if (data.length > Math.ceil(MAX_BYTES / 3) * 4)
|
|
41223
41223
|
imageError("IMAGE_TOO_LARGE");
|
|
41224
|
-
if (
|
|
41224
|
+
if (data.length % 4 !== 0 || /[^A-Za-z0-9+/=]/.test(data))
|
|
41225
41225
|
imageError("IMAGE_DATA_INVALID");
|
|
41226
41226
|
const bytes = Buffer.from(data, "base64");
|
|
41227
41227
|
if (bytes.length > MAX_BYTES)
|
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-JQKPMWIR.js";
|
|
7
7
|
import "../../chunk-MKS245OU.js";
|
|
8
8
|
import "../../chunk-YDKZZ6EH.js";
|
|
9
9
|
import "../../chunk-2NGJGNYB.js";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-MDZWPPOW.js";
|
|
11
11
|
import "../../chunk-XUFLSZM4.js";
|
|
12
12
|
import "../../chunk-I64V3ICJ.js";
|
|
13
13
|
import "../../chunk-VS2QQHAK.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getBakedProtocol,
|
|
3
3
|
setBakedProtocol
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-NIEA4H2C.js";
|
|
5
|
+
import "../chunk-MDZWPPOW.js";
|
|
6
6
|
import "../chunk-XUFLSZM4.js";
|
|
7
7
|
import "../chunk-I64V3ICJ.js";
|
|
8
8
|
import "../chunk-VS2QQHAK.js";
|
package/worker.js
CHANGED
|
@@ -8689,6 +8689,9 @@ function validateAst(ast) {
|
|
|
8689
8689
|
if (!ALLOWED_AST_TYPES.has(value.type)) {
|
|
8690
8690
|
throw new StructuralExpressionError("STRUCTURAL_EXPRESSION_NODE_FORBIDDEN", `JMESPath node ${value.type} is not allowed`);
|
|
8691
8691
|
}
|
|
8692
|
+
if (value.type === "Index" && (typeof value.value !== "number" || !Number.isSafeInteger(value.value) || value.value < 0)) {
|
|
8693
|
+
throw new StructuralExpressionError("STRUCTURAL_EXPRESSION_INVALID", "array index must be a non-negative safe integer");
|
|
8694
|
+
}
|
|
8692
8695
|
if (value.type === "Function" && value.name !== "not_null") {
|
|
8693
8696
|
throw new StructuralExpressionError("STRUCTURAL_EXPRESSION_FUNCTION_FORBIDDEN", `JMESPath function ${String(value.name)} is not allowed`);
|
|
8694
8697
|
}
|
|
@@ -8714,6 +8717,8 @@ var init_structural = __esm({
|
|
|
8714
8717
|
"Field",
|
|
8715
8718
|
"Function",
|
|
8716
8719
|
"Identity",
|
|
8720
|
+
"Index",
|
|
8721
|
+
"IndexExpression",
|
|
8717
8722
|
"KeyValuePair",
|
|
8718
8723
|
"Literal",
|
|
8719
8724
|
"MultiSelectHash",
|
|
@@ -9291,6 +9296,9 @@ function validateAst2(ast) {
|
|
|
9291
9296
|
if (!ALLOWED_AST_TYPES2.has(value.type)) {
|
|
9292
9297
|
throw new A2UICardExpressionError("CARD_EXPRESSION_NODE_FORBIDDEN", `JMESPath node ${value.type} is not allowed by ${A2UI_CARD_TRANSFORM_PROFILE}`);
|
|
9293
9298
|
}
|
|
9299
|
+
if (value.type === "Index" && (typeof value.value !== "number" || !Number.isSafeInteger(value.value) || value.value < 0)) {
|
|
9300
|
+
throw new A2UICardExpressionError("CARD_EXPRESSION_INVALID", "array index must be a non-negative safe integer");
|
|
9301
|
+
}
|
|
9294
9302
|
if (value.type === "Function" && value.name !== "not_null") {
|
|
9295
9303
|
throw new A2UICardExpressionError("CARD_EXPRESSION_FUNCTION_FORBIDDEN", `JMESPath function ${String(value.name)} is not allowed`);
|
|
9296
9304
|
}
|
|
@@ -9315,6 +9323,8 @@ var init_expression = __esm({
|
|
|
9315
9323
|
"Field",
|
|
9316
9324
|
"Function",
|
|
9317
9325
|
"Identity",
|
|
9326
|
+
"Index",
|
|
9327
|
+
"IndexExpression",
|
|
9318
9328
|
"KeyValuePair",
|
|
9319
9329
|
"Literal",
|
|
9320
9330
|
"MultiSelectHash",
|
|
@@ -9746,8 +9756,6 @@ function validateComponents(payload, path6, surfaces, issues) {
|
|
|
9746
9756
|
if (value !== void 0)
|
|
9747
9757
|
validateProperty(value, property, `${componentPath}.${name}`, issues, name);
|
|
9748
9758
|
}
|
|
9749
|
-
if (component.component === "Tag" && component.icon === void 0 && component.gap !== void 0)
|
|
9750
|
-
issues.push(issue2(`${componentPath}.gap`, "TAG_GAP_REQUIRES_ICON", "Tag.gap requires Tag.icon"));
|
|
9751
9759
|
if (component["x2-overflow"] !== void 0)
|
|
9752
9760
|
validateOverflow(component, componentPath, issues);
|
|
9753
9761
|
if (component.component === "TextField")
|
|
@@ -9761,7 +9769,7 @@ function validateComponents(payload, path6, surfaces, issues) {
|
|
|
9761
9769
|
validateStepper(component, componentPath, issues);
|
|
9762
9770
|
if (component.checks !== void 0)
|
|
9763
9771
|
validateChecks(component.checks, `${componentPath}.checks`, issues);
|
|
9764
|
-
if (component.format !== void 0 &&
|
|
9772
|
+
if (component.format !== void 0 && component.component === "Text")
|
|
9765
9773
|
validateNumberFormat(component.format, `${componentPath}.format`, issues);
|
|
9766
9774
|
if (component.action !== void 0)
|
|
9767
9775
|
validateAction(component.action, `${componentPath}.action`, issues, 0);
|
|
@@ -9775,6 +9783,11 @@ function validateProperty(value, schema, path6, issues, propertyName) {
|
|
|
9775
9783
|
issues.push(issue2(path6, "INVALID_DISPLAY_VALUE", `display value must be ${stringOnly ? "a string" : "a string or finite number"}, or a compatible display binding`));
|
|
9776
9784
|
return;
|
|
9777
9785
|
}
|
|
9786
|
+
if (schema.kind === "child") {
|
|
9787
|
+
if (!isSafeIdentifier(value))
|
|
9788
|
+
issues.push(issue2(path6, "INVALID_CHILD", "child must be a safe component id"));
|
|
9789
|
+
return;
|
|
9790
|
+
}
|
|
9778
9791
|
if (schema.kind === "children") {
|
|
9779
9792
|
const valid = Array.isArray(value) ? value.every(isSafeIdentifier) : isPlainRecord(value) && Object.keys(value).length === 2 && isSafeIdentifier(value.componentId) && typeof value.path === "string" && isSafePath(value.path);
|
|
9780
9793
|
if (!valid)
|
|
@@ -10015,20 +10028,27 @@ function validateReferences(surfaces, path6, issues) {
|
|
|
10015
10028
|
issues.push(issue2(`${path6}.surfaces.${surfaceId}`, "MISSING_ROOT_COMPONENT", "surface must define root"));
|
|
10016
10029
|
const edges = /* @__PURE__ */ new Map();
|
|
10017
10030
|
for (const [id, component] of components) {
|
|
10018
|
-
const
|
|
10019
|
-
const refs = Array.isArray(children) ? children.filter((entry) => typeof entry === "string") : isPlainRecord(children) && typeof children.componentId === "string" ? [children.componentId] : [];
|
|
10031
|
+
const refs = getComponentReferences(component);
|
|
10020
10032
|
edges.set(id, refs);
|
|
10021
10033
|
refs.forEach((ref) => {
|
|
10022
10034
|
if (!components.has(ref))
|
|
10023
|
-
issues.push(issue2(`${path6}.surfaces.${surfaceId}.components.${id}.children`, "MISSING_COMPONENT_REFERENCE", `component ${ref} does not exist`));
|
|
10035
|
+
issues.push(issue2(`${path6}.surfaces.${surfaceId}.components.${id}.${component.child !== void 0 ? "child" : "children"}`, "MISSING_COMPONENT_REFERENCE", `component ${ref} does not exist`));
|
|
10024
10036
|
});
|
|
10025
10037
|
if ((component.component === "Button" || component.component === "Card" && component.action !== void 0) && refs.some((ref) => hasInteractiveDescendant(ref, components, /* @__PURE__ */ new Set())))
|
|
10026
|
-
issues.push(issue2(`${path6}.surfaces.${surfaceId}.components.${id}.children`, "NESTED_INTERACTION", "action components cannot contain interactive descendants"));
|
|
10038
|
+
issues.push(issue2(`${path6}.surfaces.${surfaceId}.components.${id}.${component.child !== void 0 ? "child" : "children"}`, "NESTED_INTERACTION", "action components cannot contain interactive descendants"));
|
|
10027
10039
|
collectSurfaceOpenReferences(component.action).forEach((targetSurfaceId) => {
|
|
10028
10040
|
if (!surfaces.has(targetSurfaceId))
|
|
10029
10041
|
issues.push(issue2(`${path6}.surfaces.${surfaceId}.components.${id}.action`, "MISSING_SURFACE_REFERENCE", `surface ${targetSurfaceId} does not exist`));
|
|
10030
10042
|
});
|
|
10031
10043
|
}
|
|
10044
|
+
components.forEach((component, id) => {
|
|
10045
|
+
if (component.grow === void 0)
|
|
10046
|
+
return;
|
|
10047
|
+
const parents = [...components.values()].filter((parent) => getComponentReferences(parent).includes(id));
|
|
10048
|
+
if (id === "root" || parents.length === 0 || parents.some((parent) => parent.component !== "Row" && parent.component !== "Column")) {
|
|
10049
|
+
issues.push(issue2(`${path6}.surfaces.${surfaceId}.components.${id}.grow`, "INVALID_LAYOUT_PARENT", "grow requires a direct Row or Column parent in every occurrence"));
|
|
10050
|
+
}
|
|
10051
|
+
});
|
|
10032
10052
|
const visiting = /* @__PURE__ */ new Set();
|
|
10033
10053
|
const visited2 = /* @__PURE__ */ new Set();
|
|
10034
10054
|
const walk = (id) => {
|
|
@@ -10059,6 +10079,14 @@ function collectSurfaceOpenReferences(value, result = /* @__PURE__ */ new Set())
|
|
|
10059
10079
|
}
|
|
10060
10080
|
return result;
|
|
10061
10081
|
}
|
|
10082
|
+
function getComponentReferences(component) {
|
|
10083
|
+
if (typeof component.child === "string")
|
|
10084
|
+
return [component.child];
|
|
10085
|
+
const children = component.children;
|
|
10086
|
+
if (Array.isArray(children))
|
|
10087
|
+
return children.filter((entry) => typeof entry === "string");
|
|
10088
|
+
return isPlainRecord(children) && typeof children.componentId === "string" ? [children.componentId] : [];
|
|
10089
|
+
}
|
|
10062
10090
|
function hasInteractiveDescendant(id, components, visited2) {
|
|
10063
10091
|
if (visited2.has(id))
|
|
10064
10092
|
return false;
|
|
@@ -10068,22 +10096,20 @@ function hasInteractiveDescendant(id, components, visited2) {
|
|
|
10068
10096
|
return false;
|
|
10069
10097
|
if (component.component === "Button" || component.action !== void 0 || ["TextField", "ChoicePicker", "Stepper"].includes(String(component.component)))
|
|
10070
10098
|
return true;
|
|
10071
|
-
const
|
|
10072
|
-
const refs = Array.isArray(children) ? children : isPlainRecord(children) ? [children.componentId] : [];
|
|
10099
|
+
const refs = getComponentReferences(component);
|
|
10073
10100
|
return refs.some((ref) => typeof ref === "string" && hasInteractiveDescendant(ref, components, visited2));
|
|
10074
10101
|
}
|
|
10075
|
-
var spacing, colors, iconNames,
|
|
10102
|
+
var spacing, colors, iconNames, layoutItem, width, radius, decoration, typography, container, _listJustify, listContainer, A2UI_V4_COMPONENT_CATALOG;
|
|
10076
10103
|
var init_v4Catalog = __esm({
|
|
10077
10104
|
"../agent-a2ui-card-contract/dist/esm/v4Catalog.js"() {
|
|
10078
10105
|
"use strict";
|
|
10079
|
-
init_protocol();
|
|
10080
10106
|
init_json2();
|
|
10107
|
+
init_protocol();
|
|
10081
10108
|
spacing = ["none", "xs", "sm", "md", "lg"];
|
|
10082
10109
|
colors = [
|
|
10083
10110
|
"default",
|
|
10084
10111
|
"muted",
|
|
10085
10112
|
"primary",
|
|
10086
|
-
"accent",
|
|
10087
10113
|
"success",
|
|
10088
10114
|
"warning",
|
|
10089
10115
|
"error",
|
|
@@ -10135,8 +10161,18 @@ var init_v4Catalog = __esm({
|
|
|
10135
10161
|
"warning",
|
|
10136
10162
|
"arrow-right-long"
|
|
10137
10163
|
];
|
|
10138
|
-
|
|
10139
|
-
|
|
10164
|
+
layoutItem = {
|
|
10165
|
+
grow: {
|
|
10166
|
+
kind: "number",
|
|
10167
|
+
values: [0, 1, 2, 3, 4],
|
|
10168
|
+
parentComponents: ["Row", "Column"]
|
|
10169
|
+
}
|
|
10170
|
+
};
|
|
10171
|
+
width = { width: { kind: "string", values: ["fit", "fill"] } };
|
|
10172
|
+
radius = {
|
|
10173
|
+
radius: { kind: "string", values: ["none", "xs", "sm", "md", "full"] }
|
|
10174
|
+
};
|
|
10175
|
+
decoration = {
|
|
10140
10176
|
padding: { kind: "string", values: spacing },
|
|
10141
10177
|
background: {
|
|
10142
10178
|
kind: "string",
|
|
@@ -10154,29 +10190,17 @@ var init_v4Catalog = __esm({
|
|
|
10154
10190
|
kind: "string",
|
|
10155
10191
|
values: ["none", "subtle", "card-border", "primary"]
|
|
10156
10192
|
},
|
|
10157
|
-
radius
|
|
10158
|
-
width: { kind: "string", values: ["fit", "fill"] },
|
|
10159
|
-
grow: { kind: "number", values: [0, 1, 2, 3, 4] },
|
|
10160
|
-
shrink: { kind: "boolean" }
|
|
10193
|
+
...radius
|
|
10161
10194
|
};
|
|
10162
10195
|
typography = {
|
|
10163
10196
|
color: { kind: "string", values: colors },
|
|
10164
|
-
fontSize: {
|
|
10165
|
-
kind: "string",
|
|
10166
|
-
values: [
|
|
10167
|
-
"small",
|
|
10168
|
-
"medium",
|
|
10169
|
-
"large",
|
|
10170
|
-
"striking",
|
|
10171
|
-
"display",
|
|
10172
|
-
"badge",
|
|
10173
|
-
"merchant"
|
|
10174
|
-
]
|
|
10175
|
-
},
|
|
10197
|
+
fontSize: { kind: "string", values: ["xs", "sm", "md", "lg", "xl", "xxl"] },
|
|
10176
10198
|
fontWeight: { kind: "string", values: ["normal", "semibold", "bold"] }
|
|
10177
10199
|
};
|
|
10178
10200
|
container = {
|
|
10179
|
-
...
|
|
10201
|
+
...layoutItem,
|
|
10202
|
+
...width,
|
|
10203
|
+
padding: { kind: "string", values: spacing },
|
|
10180
10204
|
children: { kind: "children", required: true },
|
|
10181
10205
|
gap: { kind: "string", values: spacing },
|
|
10182
10206
|
align: {
|
|
@@ -10196,6 +10220,7 @@ var init_v4Catalog = __esm({
|
|
|
10196
10220
|
},
|
|
10197
10221
|
"x2-overflow": { kind: "format" }
|
|
10198
10222
|
};
|
|
10223
|
+
({ justify: _listJustify, ...listContainer } = container);
|
|
10199
10224
|
A2UI_V4_COMPONENT_CATALOG = Object.freeze({
|
|
10200
10225
|
catalogId: LINKQUE_A2UI_V4_CATALOG_ID,
|
|
10201
10226
|
protocolVersion: "0.9",
|
|
@@ -10203,7 +10228,10 @@ var init_v4Catalog = __esm({
|
|
|
10203
10228
|
Card: {
|
|
10204
10229
|
interaction: "action",
|
|
10205
10230
|
properties: {
|
|
10206
|
-
...
|
|
10231
|
+
...layoutItem,
|
|
10232
|
+
...width,
|
|
10233
|
+
...decoration,
|
|
10234
|
+
child: { kind: "child", required: true },
|
|
10207
10235
|
action: { kind: "action" },
|
|
10208
10236
|
disabled: { kind: "boolean" }
|
|
10209
10237
|
}
|
|
@@ -10213,13 +10241,14 @@ var init_v4Catalog = __esm({
|
|
|
10213
10241
|
interaction: "none",
|
|
10214
10242
|
properties: {
|
|
10215
10243
|
...container,
|
|
10216
|
-
wrap: { kind: "string", values: ["wrap", "nowrap"] }
|
|
10244
|
+
wrap: { kind: "string", values: ["wrap", "nowrap"] },
|
|
10245
|
+
layout: { kind: "string", values: ["flex", "inline"] }
|
|
10217
10246
|
}
|
|
10218
10247
|
},
|
|
10219
10248
|
List: {
|
|
10220
10249
|
interaction: "none",
|
|
10221
10250
|
properties: {
|
|
10222
|
-
...
|
|
10251
|
+
...listContainer,
|
|
10223
10252
|
variant: {
|
|
10224
10253
|
kind: "string",
|
|
10225
10254
|
required: true,
|
|
@@ -10230,8 +10259,9 @@ var init_v4Catalog = __esm({
|
|
|
10230
10259
|
Text: {
|
|
10231
10260
|
interaction: "none",
|
|
10232
10261
|
properties: {
|
|
10233
|
-
...
|
|
10262
|
+
...layoutItem,
|
|
10234
10263
|
...typography,
|
|
10264
|
+
shrink: { kind: "boolean" },
|
|
10235
10265
|
text: { kind: "binding", required: true },
|
|
10236
10266
|
maxLines: { kind: "number", values: [0, 1, 2, 3, 4, 5, 6] },
|
|
10237
10267
|
decoration: { kind: "string", values: ["line-through"] },
|
|
@@ -10241,19 +10271,31 @@ var init_v4Catalog = __esm({
|
|
|
10241
10271
|
Tag: {
|
|
10242
10272
|
interaction: "none",
|
|
10243
10273
|
properties: {
|
|
10244
|
-
...
|
|
10245
|
-
...typography,
|
|
10274
|
+
...layoutItem,
|
|
10246
10275
|
text: { kind: "binding", required: true },
|
|
10247
10276
|
icon: { kind: "string", values: iconNames },
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10277
|
+
tone: {
|
|
10278
|
+
kind: "string",
|
|
10279
|
+
values: [
|
|
10280
|
+
"default",
|
|
10281
|
+
"muted",
|
|
10282
|
+
"primary",
|
|
10283
|
+
"success",
|
|
10284
|
+
"warning",
|
|
10285
|
+
"error"
|
|
10286
|
+
]
|
|
10287
|
+
},
|
|
10288
|
+
variant: { kind: "string", values: ["soft", "outline", "plain"] },
|
|
10289
|
+
size: { kind: "string", values: ["sm", "md"] },
|
|
10290
|
+
shrink: { kind: "boolean" },
|
|
10291
|
+
maxLines: { kind: "number", values: [0, 1, 2, 3, 4, 5, 6] }
|
|
10251
10292
|
}
|
|
10252
10293
|
},
|
|
10253
10294
|
Button: {
|
|
10254
10295
|
interaction: "action",
|
|
10255
10296
|
properties: {
|
|
10256
|
-
...
|
|
10297
|
+
...layoutItem,
|
|
10298
|
+
...width,
|
|
10257
10299
|
label: { kind: "binding", required: true },
|
|
10258
10300
|
action: { kind: "action", required: true },
|
|
10259
10301
|
checks: { kind: "format" },
|
|
@@ -10271,34 +10313,29 @@ var init_v4Catalog = __esm({
|
|
|
10271
10313
|
Image: {
|
|
10272
10314
|
interaction: "none",
|
|
10273
10315
|
properties: {
|
|
10274
|
-
...
|
|
10316
|
+
...layoutItem,
|
|
10317
|
+
...radius,
|
|
10275
10318
|
src: { kind: "binding", required: true },
|
|
10276
10319
|
alt: { kind: "binding" },
|
|
10277
10320
|
fit: {
|
|
10278
10321
|
kind: "string",
|
|
10279
10322
|
values: ["contain", "cover", "fill", "none", "scale-down"]
|
|
10280
10323
|
},
|
|
10281
|
-
|
|
10324
|
+
aspectRatio: {
|
|
10282
10325
|
kind: "string",
|
|
10283
|
-
values: [
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
"portraitFeature",
|
|
10290
|
-
"productThumbnail",
|
|
10291
|
-
"voucherThumbnail",
|
|
10292
|
-
"largeFeature",
|
|
10293
|
-
"header"
|
|
10294
|
-
]
|
|
10326
|
+
values: ["square", "portrait", "landscape", "wide", "banner"]
|
|
10327
|
+
},
|
|
10328
|
+
height: { kind: "string", values: ["auto", "fill"] },
|
|
10329
|
+
size: {
|
|
10330
|
+
kind: "string",
|
|
10331
|
+
values: ["xs", "sm", "md", "lg", "xl", "full"]
|
|
10295
10332
|
}
|
|
10296
10333
|
}
|
|
10297
10334
|
},
|
|
10298
10335
|
Icon: {
|
|
10299
10336
|
interaction: "none",
|
|
10300
10337
|
properties: {
|
|
10301
|
-
...
|
|
10338
|
+
...layoutItem,
|
|
10302
10339
|
name: { kind: "string", required: true, values: iconNames },
|
|
10303
10340
|
label: { kind: "string" },
|
|
10304
10341
|
color: { kind: "string", values: colors },
|
|
@@ -10311,15 +10348,15 @@ var init_v4Catalog = __esm({
|
|
|
10311
10348
|
Divider: {
|
|
10312
10349
|
interaction: "none",
|
|
10313
10350
|
properties: {
|
|
10314
|
-
...
|
|
10351
|
+
...layoutItem,
|
|
10315
10352
|
axis: { kind: "string", values: ["horizontal", "vertical"] }
|
|
10316
10353
|
}
|
|
10317
10354
|
},
|
|
10318
10355
|
TextField: {
|
|
10319
10356
|
interaction: "input",
|
|
10320
10357
|
properties: {
|
|
10321
|
-
...
|
|
10322
|
-
...
|
|
10358
|
+
...layoutItem,
|
|
10359
|
+
...width,
|
|
10323
10360
|
label: { kind: "string", required: true },
|
|
10324
10361
|
value: { kind: "binding", required: true },
|
|
10325
10362
|
checks: { kind: "format" },
|
|
@@ -10343,7 +10380,8 @@ var init_v4Catalog = __esm({
|
|
|
10343
10380
|
ChoicePicker: {
|
|
10344
10381
|
interaction: "input",
|
|
10345
10382
|
properties: {
|
|
10346
|
-
...
|
|
10383
|
+
...layoutItem,
|
|
10384
|
+
...width,
|
|
10347
10385
|
label: { kind: "string", required: true },
|
|
10348
10386
|
value: { kind: "binding", required: true },
|
|
10349
10387
|
options: { kind: "options", required: true },
|
|
@@ -10358,7 +10396,8 @@ var init_v4Catalog = __esm({
|
|
|
10358
10396
|
Stepper: {
|
|
10359
10397
|
interaction: "input",
|
|
10360
10398
|
properties: {
|
|
10361
|
-
...
|
|
10399
|
+
...layoutItem,
|
|
10400
|
+
...width,
|
|
10362
10401
|
label: { kind: "string", required: true },
|
|
10363
10402
|
value: { kind: "binding", required: true },
|
|
10364
10403
|
min: { kind: "number" },
|
|
@@ -191627,7 +191666,7 @@ async function boundedBody(response, max2) {
|
|
|
191627
191666
|
function validate(data, mediaType) {
|
|
191628
191667
|
if (data.length > Math.ceil(MAX_BYTES2 / 3) * 4)
|
|
191629
191668
|
imageError("IMAGE_TOO_LARGE");
|
|
191630
|
-
if (
|
|
191669
|
+
if (data.length % 4 !== 0 || /[^A-Za-z0-9+/=]/.test(data))
|
|
191631
191670
|
imageError("IMAGE_DATA_INVALID");
|
|
191632
191671
|
const bytes2 = Buffer.from(data, "base64");
|
|
191633
191672
|
if (bytes2.length > MAX_BYTES2)
|
|
@@ -191682,7 +191721,7 @@ var init_io = __esm({
|
|
|
191682
191721
|
{ host: "masspre.alipay.com", pathPrefix: "/linkque/afts/img/" },
|
|
191683
191722
|
{ host: "mdn.alipayobjects.com", pathPrefix: "/linkque/afts/img/" }
|
|
191684
191723
|
];
|
|
191685
|
-
MAX_BYTES2 =
|
|
191724
|
+
MAX_BYTES2 = 20 * 1024 * 1024;
|
|
191686
191725
|
}
|
|
191687
191726
|
});
|
|
191688
191727
|
|