linkque-cli-v2 1.3.4 → 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 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 (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
7578
- if (uri.indexOf("%") !== -1) {
7579
- if (parsed.host !== void 0 && !malformedIPLiteral) {
7580
- const host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
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
  }
@@ -21611,6 +21612,54 @@ function getA2UIV4ProtocolIssues(value, path23 = "card") {
21611
21612
  validateReferences(surfaces, path23, issues);
21612
21613
  return issues;
21613
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
+ }
21614
21663
  function validateComponents(payload, path23, surfaces, issues) {
21615
21664
  if (!Array.isArray(payload.components)) {
21616
21665
  issues.push(issue2(`${path23}.updateComponents.components`, "INVALID_A2UI_COMPONENTS", "components must be an array"));
@@ -21627,52 +21676,7 @@ function validateComponents(payload, path23, surfaces, issues) {
21627
21676
  if (surface.has(component.id))
21628
21677
  issues.push(issue2(`${componentPath}.id`, "DUPLICATE_COMPONENT_ID", `component id ${component.id} is duplicated`));
21629
21678
  surface.set(component.id, component);
21630
- const schema = A2UI_V4_COMPONENT_CATALOG.components[component.component];
21631
- if (!schema) {
21632
- issues.push(issue2(`${componentPath}.component`, "UNSUPPORTED_COMPONENT", `V4 does not support component ${component.component}`));
21633
- return;
21634
- }
21635
- const allowed = /* @__PURE__ */ new Set([
21636
- "id",
21637
- "component",
21638
- ...Object.keys(schema.properties)
21639
- ]);
21640
- for (const key of Object.keys(component))
21641
- if (!allowed.has(key))
21642
- issues.push(issue2(`${componentPath}.${key}`, "UNSUPPORTED_COMPONENT_PROP", `${component.component} does not support property ${key}`));
21643
- for (const [name, property] of Object.entries(schema.properties)) {
21644
- const value = component[name];
21645
- if (property.required && value === void 0)
21646
- issues.push(issue2(`${componentPath}.${name}`, "REQUIRED_COMPONENT_PROP_MISSING", `${component.component}.${name} is required`));
21647
- if (value !== void 0)
21648
- validateProperty(value, property, `${componentPath}.${name}`, issues, name);
21649
- }
21650
- if (component["x2-overflow"] !== void 0)
21651
- validateOverflow(component, componentPath, issues);
21652
- if (component.component === "TextField")
21653
- validateTextField(component, componentPath, issues);
21654
- if (component.component === "ChoicePicker") {
21655
- if (!isStrictBinding(component.value))
21656
- issues.push(issue2(`${componentPath}.value`, "INPUT_REQUIRES_BINDING", "ChoicePicker.value must be a strict writable binding"));
21657
- validateOptions(component.options, `${componentPath}.options`, issues);
21658
- }
21659
- if (component.component === "Stepper")
21660
- validateStepper(component, componentPath, issues);
21661
- if (["Card", "Row", "Column", "List"].includes(component.component)) {
21662
- for (const axis of ["width", "height"]) {
21663
- const value = component[axis];
21664
- const modes = axis === "width" ? ["fit", "fill"] : ["auto"];
21665
- if (value !== void 0 && !(typeof value === "string" && (modes.includes(value) || /^\d+(?:\.\d+)?px$/.test(value) && Number.isFinite(parseFloat(value))))) {
21666
- issues.push(issue2(`${componentPath}.${axis}`, "INVALID_COMPONENT_PROP_VALUE", `size must be ${modes.join(" / ")} or a non-negative px string such as 120px`));
21667
- }
21668
- }
21669
- }
21670
- if (component.checks !== void 0)
21671
- validateChecks(component.checks, `${componentPath}.checks`, issues);
21672
- if (component.format !== void 0 && component.component === "Text")
21673
- validateNumberFormat(component.format, `${componentPath}.format`, issues);
21674
- if (component.action !== void 0)
21675
- validateAction(component.action, `${componentPath}.action`, issues, 0);
21679
+ validateV4Component(component, componentPath, issues);
21676
21680
  });
21677
21681
  }
21678
21682
  function validateProperty(value, schema, path23, issues, propertyName) {
@@ -23809,7 +23813,7 @@ var MCP_PROXY_DESCRIPTION = [
23809
23813
  "\u4EC5 mcp({}) \u5217\u51FA\u7684\u5DE5\u5177\u53EF\u8C03\u7528(\u672A\u58F0\u660E\u7684\u5DE5\u5177\u4E0D\u4F1A\u51FA\u73B0)\u3002"
23810
23814
  ].join("\n");
23811
23815
 
23812
- // ../linkque-agent-runtime/dist/esm/core/telemetry/telemetryEnums.js
23816
+ // ../linkque-agent-protocol/dist/esm/telemetry/telemetryEnums.js
23813
23817
  var ETelemetryAttribute;
23814
23818
  (function(ETelemetryAttribute2) {
23815
23819
  ETelemetryAttribute2["HARNESS_TELEMETRY_SCHEMA_VERSION"] = "harness.telemetry.schema.version";
@@ -24001,24 +24005,6 @@ var ETelemetrySignal;
24001
24005
  ETelemetrySignal2["LOGS"] = "logs";
24002
24006
  ETelemetrySignal2["TRACES"] = "traces";
24003
24007
  })(ETelemetrySignal || (ETelemetrySignal = {}));
24004
- var ETelemetryDiagnosticCode;
24005
- (function(ETelemetryDiagnosticCode2) {
24006
- ETelemetryDiagnosticCode2["INVALID_AUTHORIZATION"] = "invalid_authorization";
24007
- ETelemetryDiagnosticCode2["PARTITION_LIMIT"] = "partition_limit";
24008
- ETelemetryDiagnosticCode2["UNAVAILABLE_PARTITION"] = "unavailable_partition";
24009
- ETelemetryDiagnosticCode2["QUEUE_LIMIT"] = "queue_limit";
24010
- ETelemetryDiagnosticCode2["QUEUE_EXPIRED"] = "queue_expired";
24011
- ETelemetryDiagnosticCode2["SENDER_FAILED"] = "sender_failed";
24012
- ETelemetryDiagnosticCode2["PARTIAL_SUCCESS"] = "partial_success";
24013
- ETelemetryDiagnosticCode2["AUTHORIZATION_REJECTED"] = "authorization_rejected";
24014
- ETelemetryDiagnosticCode2["PERMANENT_REJECTION"] = "permanent_rejection";
24015
- ETelemetryDiagnosticCode2["SEND_RETRY"] = "send_retry";
24016
- ETelemetryDiagnosticCode2["SHUTDOWN_DROP"] = "shutdown_drop";
24017
- ETelemetryDiagnosticCode2["LOCAL_SINK_FAILED"] = "local_sink_failed";
24018
- ETelemetryDiagnosticCode2["CAPTURE_FAILED"] = "capture_failed";
24019
- ETelemetryDiagnosticCode2["IDENTITY_MISMATCH"] = "identity_mismatch";
24020
- ETelemetryDiagnosticCode2["ACTIVE_LIMIT"] = "active_limit";
24021
- })(ETelemetryDiagnosticCode || (ETelemetryDiagnosticCode = {}));
24022
24008
  var ETelemetryLossReason;
24023
24009
  (function(ETelemetryLossReason2) {
24024
24010
  ETelemetryLossReason2["UNCAUGHT_ERROR"] = "uncaught_error";
@@ -24149,6 +24135,31 @@ var ETelemetryGenAiOperation;
24149
24135
  ETelemetryGenAiOperation2["EXECUTE_TOOL"] = "execute_tool";
24150
24136
  ETelemetryGenAiOperation2["INVOKE_AGENT"] = "invoke_agent";
24151
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 = {}));
24152
24163
  var ETelemetryAssociation;
24153
24164
  (function(ETelemetryAssociation2) {
24154
24165
  ETelemetryAssociation2["LOOP"] = "loop";
@@ -24164,11 +24175,6 @@ var ETelemetryMetadata;
24164
24175
  ETelemetryMetadata2["SERVICE_NAMESPACE"] = "linkque";
24165
24176
  ETelemetryMetadata2["ROUTE_CONTEXT_KEY"] = "linkque.telemetry.route";
24166
24177
  })(ETelemetryMetadata || (ETelemetryMetadata = {}));
24167
- var ETelemetryVersion;
24168
- (function(ETelemetryVersion2) {
24169
- ETelemetryVersion2["V0_2"] = "0.2";
24170
- ETelemetryVersion2["V1_0"] = "1.0";
24171
- })(ETelemetryVersion || (ETelemetryVersion = {}));
24172
24178
 
24173
24179
  // ../linkque-agent-runtime/dist/esm/config/runtimeConfigProvider.js
24174
24180
  var LINKQUE_ENDPOINT_PROD = "https://linkquegw.alipay.com";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkque-cli-v2",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "Public Linkque CLI bundle for sandbox debugging",
5
5
  "bin": {
6
6
  "linkquejs": "linkquejs.js"
@@ -18,7 +18,7 @@ import {
18
18
  import {
19
19
  RUNTIME_CONFIG_DEFAULTS,
20
20
  RuntimeConfigProvider
21
- } from "./chunk-YSRA6KFZ.js";
21
+ } from "./chunk-VVEDZWQ5.js";
22
22
  import {
23
23
  __commonJS,
24
24
  __require,
@@ -11629,6 +11629,7 @@ _Operator.dateSubDays = (days) => new _Operator("dateSubDays", [days]).toString(
11629
11629
  _Operator.dateSetNow = () => new _Operator("dateSetNow", []).toString();
11630
11630
 
11631
11631
  // ../linkque-agent-appwrite-integrate/dist/esm/runtime/clientCapabilityStore.js
11632
+ import { createHash } from "node:crypto";
11632
11633
  var TRANSACTION_TTL_SECONDS = 60;
11633
11634
  var COMPLETE_MAX_ATTEMPTS = 3;
11634
11635
  function createClientCapabilityStore(databases, databaseId, tableId) {
@@ -11667,6 +11668,10 @@ function createClientCapabilityStore(databases, databaseId, tableId) {
11667
11668
  await rollbackTransaction(databases, transaction.$id);
11668
11669
  return { kind: "forbidden" };
11669
11670
  }
11671
+ if (!matchesCapability(current.capability, request.result)) {
11672
+ await rollbackTransaction(databases, transaction.$id);
11673
+ return { kind: "invalid" };
11674
+ }
11670
11675
  if (current.status === "expired" || Date.parse(current.acceptUntil) <= Date.now()) {
11671
11676
  if (current.status === "pending") {
11672
11677
  await databases.updateDocument({
@@ -11685,7 +11690,7 @@ function createClientCapabilityStore(databases, databaseId, tableId) {
11685
11690
  const serialized = serializeResult(request.result);
11686
11691
  if (current.status !== "pending") {
11687
11692
  await rollbackTransaction(databases, transaction.$id);
11688
- return current.result === serialized ? { kind: "accepted", repeated: true } : { kind: "conflict" };
11693
+ return current.result === serialized || current.result === consumedDigest(serialized) ? { kind: "accepted", repeated: true } : { kind: "conflict" };
11689
11694
  }
11690
11695
  await databases.updateDocument({
11691
11696
  databaseId,
@@ -11711,8 +11716,10 @@ function createClientCapabilityStore(databases, databaseId, tableId) {
11711
11716
  throw new Error("Failed to complete client capability result");
11712
11717
  },
11713
11718
  async consume(invocationId) {
11719
+ const current = await this.get(invocationId);
11714
11720
  await databases.updateDocument(databaseId, tableId, invocationId, {
11715
11721
  status: "consumed",
11722
+ result: current?.result ? consumedDigest(current.result) : void 0,
11716
11723
  consumedAt: (/* @__PURE__ */ new Date()).toISOString()
11717
11724
  });
11718
11725
  },
@@ -11752,6 +11759,15 @@ function parseStoredClientCapabilityResult(value) {
11752
11759
  function serializeResult(result) {
11753
11760
  return JSON.stringify(result);
11754
11761
  }
11762
+ function consumedDigest(serialized) {
11763
+ return `sha256:${createHash("sha256").update(serialized).digest("hex")}`;
11764
+ }
11765
+ function matchesCapability(capability, result) {
11766
+ if (!result.ok)
11767
+ return true;
11768
+ const data = isRecord(result.data) ? result.data : {};
11769
+ return capability === "location" ? Number.isFinite(data.latitude) && Number.isFinite(data.longitude) : typeof data.authCode === "string" && data.authCode.length > 0;
11770
+ }
11755
11771
  async function commitTransaction(databases, transactionId) {
11756
11772
  await databases.updateTransaction({ transactionId, commit: true });
11757
11773
  }
@@ -11762,7 +11778,7 @@ function readInvocation(value) {
11762
11778
  if (!value || typeof value !== "object" || Array.isArray(value))
11763
11779
  return void 0;
11764
11780
  const row = value;
11765
- if (typeof row.$id !== "string" || typeof row.ownerId !== "string" || typeof row.agentId !== "string" || typeof row.threadId !== "string" || typeof row.runId !== "string" || typeof row.toolCallId !== "string" || row.capability !== "location" || typeof row.status !== "string" || typeof row.input !== "string" || typeof row.createdAt !== "string" || typeof row.acceptUntil !== "string" || typeof row.expiresAt !== "string")
11781
+ if (typeof row.$id !== "string" || typeof row.ownerId !== "string" || typeof row.agentId !== "string" || typeof row.threadId !== "string" || typeof row.runId !== "string" || typeof row.toolCallId !== "string" || !["location", "userInfo"].includes(String(row.capability)) || typeof row.status !== "string" || typeof row.input !== "string" || typeof row.createdAt !== "string" || typeof row.acceptUntil !== "string" || typeof row.expiresAt !== "string")
11766
11782
  return void 0;
11767
11783
  return {
11768
11784
  invocationId: row.$id,
@@ -11771,7 +11787,7 @@ function readInvocation(value) {
11771
11787
  threadId: row.threadId,
11772
11788
  runId: row.runId,
11773
11789
  toolCallId: row.toolCallId,
11774
- capability: "location",
11790
+ capability: row.capability,
11775
11791
  status: row.status,
11776
11792
  input: row.input,
11777
11793
  ...typeof row.result === "string" ? { result: row.result } : {},
@@ -11781,6 +11797,9 @@ function readInvocation(value) {
11781
11797
  ...typeof row.consumedAt === "string" ? { consumedAt: row.consumedAt } : {}
11782
11798
  };
11783
11799
  }
11800
+ function isRecord(value) {
11801
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
11802
+ }
11784
11803
  function isNotFound(error) {
11785
11804
  return Boolean(error && typeof error === "object" && "code" in error && error.code === 404);
11786
11805
  }
@@ -11895,7 +11914,7 @@ function parsePositiveInt(raw, name) {
11895
11914
  }
11896
11915
 
11897
11916
  // ../linkque-agent-appwrite-integrate/dist/esm/runtime/paymentActionStore.js
11898
- import { createHash } from "node:crypto";
11917
+ import { createHash as createHash2 } from "node:crypto";
11899
11918
  var PAYMENT_INVOCATION_TTL_MS = 24 * 60 * 60 * 1e3;
11900
11919
  function createPaymentInvocation(ownerId, request, now = /* @__PURE__ */ new Date()) {
11901
11920
  const invocationId = createPaymentInvocationId(ownerId, request);
@@ -11926,7 +11945,7 @@ function createPaymentInvocationId(ownerId, request) {
11926
11945
  componentId: request.source.componentId,
11927
11946
  input: request.input
11928
11947
  });
11929
- return `pa_${createHash("sha256").update(material).digest("hex").slice(0, 32)}`;
11948
+ return `pa_${createHash2("sha256").update(material).digest("hex").slice(0, 32)}`;
11930
11949
  }
11931
11950
  function createPaymentActionStore(databases, databaseId, tableId) {
11932
11951
  return {
@@ -12197,6 +12216,9 @@ async function runClientCapabilityResult(method, body, ownerId, store) {
12197
12216
  if (outcome.kind === "conflict") {
12198
12217
  return jsonError(409, "result_conflict", "\u8BE5\u8C03\u7528\u5DF2\u6709\u4E0D\u540C\u7ED3\u679C");
12199
12218
  }
12219
+ if (outcome.kind === "invalid") {
12220
+ return jsonError(400, "invalid_result", "\u7AEF\u4FA7\u80FD\u529B\u7ED3\u679C\u4E0E\u8BF7\u6C42\u4E0D\u5339\u914D");
12221
+ }
12200
12222
  if (outcome.kind === "expired" || outcome.kind === "not_found") {
12201
12223
  return jsonError(410, "invocation_expired", "\u8BE5\u7AEF\u4FA7\u8C03\u7528\u5DF2\u5931\u6548");
12202
12224
  }
@@ -12228,17 +12250,17 @@ async function clientCapability(ctx) {
12228
12250
  return ctx.res.json?.(result.body, result.status);
12229
12251
  }
12230
12252
  function parseResultRequest(value) {
12231
- if (!isRecord(value) || value.version !== "1.0")
12253
+ if (!isRecord2(value) || value.version !== "1.0")
12232
12254
  return void 0;
12233
- if (!nonEmpty(value.invocationId) || !nonEmpty(value.runId) || !isRecord(value.result)) {
12255
+ if (!nonEmpty(value.invocationId) || !nonEmpty(value.runId) || !isRecord2(value.result)) {
12234
12256
  return void 0;
12235
12257
  }
12236
12258
  if (value.result.ok === true) {
12237
- if (!isLocation(value.result.data))
12259
+ if (!isLocation(value.result.data) && !isUserInfo(value.result.data))
12238
12260
  return void 0;
12239
12261
  } else if (value.result.ok === false) {
12240
12262
  const error = value.result.error;
12241
- if (!isRecord(error) || !nonEmpty(error.code) || !nonEmpty(error.message) || typeof error.retriable !== "boolean") {
12263
+ if (!isRecord2(error) || !nonEmpty(error.code) || !nonEmpty(error.message) || typeof error.retriable !== "boolean") {
12242
12264
  return void 0;
12243
12265
  }
12244
12266
  } else
@@ -12246,9 +12268,12 @@ function parseResultRequest(value) {
12246
12268
  return value;
12247
12269
  }
12248
12270
  function isLocation(value) {
12249
- return isRecord(value) && Number.isFinite(value.latitude) && Number.isFinite(value.longitude);
12271
+ return isRecord2(value) && Number.isFinite(value.latitude) && Number.isFinite(value.longitude);
12250
12272
  }
12251
- function isRecord(value) {
12273
+ function isUserInfo(value) {
12274
+ return isRecord2(value) && nonEmpty(value.authCode) && value.authCode.length <= 4096;
12275
+ }
12276
+ function isRecord2(value) {
12252
12277
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
12253
12278
  }
12254
12279
  function nonEmpty(value) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  EModelProvider
3
- } from "./chunk-YSRA6KFZ.js";
3
+ } from "./chunk-VVEDZWQ5.js";
4
4
 
5
5
  // ../linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js
6
6
  var baked;
@@ -4250,13 +4250,14 @@ var require_fast_uri = __commonJS({
4250
4250
  if (!malformedIPLiteral) {
4251
4251
  malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
4252
4252
  }
4253
- if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
4254
- if (uri.indexOf("%") !== -1) {
4255
- if (parsed.host !== void 0 && !malformedIPLiteral) {
4256
- const host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
4257
- parsed.host = reescapeHostDelimiters(host, isIP);
4258
- }
4253
+ if (uri.indexOf("%") !== -1 && parsed.host !== void 0 && !malformedIPLiteral) {
4254
+ let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
4255
+ if (!isIP) {
4256
+ host = normalizePercentEncoding(host.toLowerCase());
4259
4257
  }
4258
+ parsed.host = reescapeHostDelimiters(host, isIP);
4259
+ }
4260
+ if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
4260
4261
  if (parsed.path) {
4261
4262
  parsed.path = normalizePathEncoding(parsed.path);
4262
4263
  }
@@ -10211,6 +10212,54 @@ function getA2UIV4ProtocolIssues(value, path2 = "card") {
10211
10212
  validateReferences(surfaces, path2, issues);
10212
10213
  return issues;
10213
10214
  }
10215
+ function validateV4Component(component, componentPath, issues) {
10216
+ const schema = A2UI_V4_COMPONENT_CATALOG.components[component.component];
10217
+ if (!schema) {
10218
+ issues.push(issue2(`${componentPath}.component`, "UNSUPPORTED_COMPONENT", `V4 does not support component ${component.component}`));
10219
+ return;
10220
+ }
10221
+ const allowed = /* @__PURE__ */ new Set([
10222
+ "id",
10223
+ "component",
10224
+ ...Object.keys(schema.properties)
10225
+ ]);
10226
+ for (const key of Object.keys(component))
10227
+ if (!allowed.has(key))
10228
+ issues.push(issue2(`${componentPath}.${key}`, "UNSUPPORTED_COMPONENT_PROP", `${component.component} does not support property ${key}`));
10229
+ for (const [name, property] of Object.entries(schema.properties)) {
10230
+ const value = component[name];
10231
+ if (property.required && value === void 0)
10232
+ issues.push(issue2(`${componentPath}.${name}`, "REQUIRED_COMPONENT_PROP_MISSING", `${component.component}.${name} is required`));
10233
+ if (value !== void 0)
10234
+ validateProperty(value, property, `${componentPath}.${name}`, issues, name);
10235
+ }
10236
+ if (component["x2-overflow"] !== void 0)
10237
+ validateOverflow(component, componentPath, issues);
10238
+ if (component.component === "TextField")
10239
+ validateTextField(component, componentPath, issues);
10240
+ if (component.component === "ChoicePicker") {
10241
+ if (!isStrictBinding(component.value))
10242
+ issues.push(issue2(`${componentPath}.value`, "INPUT_REQUIRES_BINDING", "ChoicePicker.value must be a strict writable binding"));
10243
+ validateOptions(component.options, `${componentPath}.options`, issues);
10244
+ }
10245
+ if (component.component === "Stepper")
10246
+ validateStepper(component, componentPath, issues);
10247
+ if (["Card", "Row", "Column", "List"].includes(component.component)) {
10248
+ for (const axis of ["width", "height"]) {
10249
+ const value = component[axis];
10250
+ const modes = axis === "width" ? ["fit", "fill"] : ["auto"];
10251
+ if (value !== void 0 && !(typeof value === "string" && (modes.includes(value) || /^\d+(?:\.\d+)?px$/.test(value) && Number.isFinite(parseFloat(value))))) {
10252
+ issues.push(issue2(`${componentPath}.${axis}`, "INVALID_COMPONENT_PROP_VALUE", `size must be ${modes.join(" / ")} or a non-negative px string such as 120px`));
10253
+ }
10254
+ }
10255
+ }
10256
+ if (component.checks !== void 0)
10257
+ validateChecks(component.checks, `${componentPath}.checks`, issues);
10258
+ if (component.format !== void 0 && component.component === "Text")
10259
+ validateNumberFormat(component.format, `${componentPath}.format`, issues);
10260
+ if (component.action !== void 0)
10261
+ validateAction(component.action, `${componentPath}.action`, issues, 0);
10262
+ }
10214
10263
  function validateComponents(payload, path2, surfaces, issues) {
10215
10264
  if (!Array.isArray(payload.components)) {
10216
10265
  issues.push(issue2(`${path2}.updateComponents.components`, "INVALID_A2UI_COMPONENTS", "components must be an array"));
@@ -10227,52 +10276,7 @@ function validateComponents(payload, path2, surfaces, issues) {
10227
10276
  if (surface.has(component.id))
10228
10277
  issues.push(issue2(`${componentPath}.id`, "DUPLICATE_COMPONENT_ID", `component id ${component.id} is duplicated`));
10229
10278
  surface.set(component.id, component);
10230
- const schema = A2UI_V4_COMPONENT_CATALOG.components[component.component];
10231
- if (!schema) {
10232
- issues.push(issue2(`${componentPath}.component`, "UNSUPPORTED_COMPONENT", `V4 does not support component ${component.component}`));
10233
- return;
10234
- }
10235
- const allowed = /* @__PURE__ */ new Set([
10236
- "id",
10237
- "component",
10238
- ...Object.keys(schema.properties)
10239
- ]);
10240
- for (const key of Object.keys(component))
10241
- if (!allowed.has(key))
10242
- issues.push(issue2(`${componentPath}.${key}`, "UNSUPPORTED_COMPONENT_PROP", `${component.component} does not support property ${key}`));
10243
- for (const [name, property] of Object.entries(schema.properties)) {
10244
- const value = component[name];
10245
- if (property.required && value === void 0)
10246
- issues.push(issue2(`${componentPath}.${name}`, "REQUIRED_COMPONENT_PROP_MISSING", `${component.component}.${name} is required`));
10247
- if (value !== void 0)
10248
- validateProperty(value, property, `${componentPath}.${name}`, issues, name);
10249
- }
10250
- if (component["x2-overflow"] !== void 0)
10251
- validateOverflow(component, componentPath, issues);
10252
- if (component.component === "TextField")
10253
- validateTextField(component, componentPath, issues);
10254
- if (component.component === "ChoicePicker") {
10255
- if (!isStrictBinding(component.value))
10256
- issues.push(issue2(`${componentPath}.value`, "INPUT_REQUIRES_BINDING", "ChoicePicker.value must be a strict writable binding"));
10257
- validateOptions(component.options, `${componentPath}.options`, issues);
10258
- }
10259
- if (component.component === "Stepper")
10260
- validateStepper(component, componentPath, issues);
10261
- if (["Card", "Row", "Column", "List"].includes(component.component)) {
10262
- for (const axis of ["width", "height"]) {
10263
- const value = component[axis];
10264
- const modes = axis === "width" ? ["fit", "fill"] : ["auto"];
10265
- if (value !== void 0 && !(typeof value === "string" && (modes.includes(value) || /^\d+(?:\.\d+)?px$/.test(value) && Number.isFinite(parseFloat(value))))) {
10266
- issues.push(issue2(`${componentPath}.${axis}`, "INVALID_COMPONENT_PROP_VALUE", `size must be ${modes.join(" / ")} or a non-negative px string such as 120px`));
10267
- }
10268
- }
10269
- }
10270
- if (component.checks !== void 0)
10271
- validateChecks(component.checks, `${componentPath}.checks`, issues);
10272
- if (component.format !== void 0 && component.component === "Text")
10273
- validateNumberFormat(component.format, `${componentPath}.format`, issues);
10274
- if (component.action !== void 0)
10275
- validateAction(component.action, `${componentPath}.action`, issues, 0);
10279
+ validateV4Component(component, componentPath, issues);
10276
10280
  });
10277
10281
  }
10278
10282
  function validateProperty(value, schema, path2, issues, propertyName) {
@@ -13277,7 +13281,7 @@ function normalizeHookResources(resources) {
13277
13281
  }).sort((a, b) => (a.config.order ?? 0) - (b.config.order ?? 0));
13278
13282
  }
13279
13283
 
13280
- // ../linkque-agent-runtime/dist/esm/core/telemetry/telemetryEnums.js
13284
+ // ../linkque-agent-protocol/dist/esm/telemetry/telemetryEnums.js
13281
13285
  var ETelemetryAttribute;
13282
13286
  (function(ETelemetryAttribute2) {
13283
13287
  ETelemetryAttribute2["HARNESS_TELEMETRY_SCHEMA_VERSION"] = "harness.telemetry.schema.version";
@@ -13469,24 +13473,6 @@ var ETelemetrySignal;
13469
13473
  ETelemetrySignal2["LOGS"] = "logs";
13470
13474
  ETelemetrySignal2["TRACES"] = "traces";
13471
13475
  })(ETelemetrySignal || (ETelemetrySignal = {}));
13472
- var ETelemetryDiagnosticCode;
13473
- (function(ETelemetryDiagnosticCode2) {
13474
- ETelemetryDiagnosticCode2["INVALID_AUTHORIZATION"] = "invalid_authorization";
13475
- ETelemetryDiagnosticCode2["PARTITION_LIMIT"] = "partition_limit";
13476
- ETelemetryDiagnosticCode2["UNAVAILABLE_PARTITION"] = "unavailable_partition";
13477
- ETelemetryDiagnosticCode2["QUEUE_LIMIT"] = "queue_limit";
13478
- ETelemetryDiagnosticCode2["QUEUE_EXPIRED"] = "queue_expired";
13479
- ETelemetryDiagnosticCode2["SENDER_FAILED"] = "sender_failed";
13480
- ETelemetryDiagnosticCode2["PARTIAL_SUCCESS"] = "partial_success";
13481
- ETelemetryDiagnosticCode2["AUTHORIZATION_REJECTED"] = "authorization_rejected";
13482
- ETelemetryDiagnosticCode2["PERMANENT_REJECTION"] = "permanent_rejection";
13483
- ETelemetryDiagnosticCode2["SEND_RETRY"] = "send_retry";
13484
- ETelemetryDiagnosticCode2["SHUTDOWN_DROP"] = "shutdown_drop";
13485
- ETelemetryDiagnosticCode2["LOCAL_SINK_FAILED"] = "local_sink_failed";
13486
- ETelemetryDiagnosticCode2["CAPTURE_FAILED"] = "capture_failed";
13487
- ETelemetryDiagnosticCode2["IDENTITY_MISMATCH"] = "identity_mismatch";
13488
- ETelemetryDiagnosticCode2["ACTIVE_LIMIT"] = "active_limit";
13489
- })(ETelemetryDiagnosticCode || (ETelemetryDiagnosticCode = {}));
13490
13476
  var ETelemetryLossReason;
13491
13477
  (function(ETelemetryLossReason2) {
13492
13478
  ETelemetryLossReason2["UNCAUGHT_ERROR"] = "uncaught_error";
@@ -13617,21 +13603,6 @@ var ETelemetryGenAiOperation;
13617
13603
  ETelemetryGenAiOperation2["EXECUTE_TOOL"] = "execute_tool";
13618
13604
  ETelemetryGenAiOperation2["INVOKE_AGENT"] = "invoke_agent";
13619
13605
  })(ETelemetryGenAiOperation || (ETelemetryGenAiOperation = {}));
13620
- var ETelemetryAssociation;
13621
- (function(ETelemetryAssociation2) {
13622
- ETelemetryAssociation2["LOOP"] = "loop";
13623
- ETelemetryAssociation2["ITERATION"] = "iteration";
13624
- ETelemetryAssociation2["MODEL"] = "model";
13625
- ETelemetryAssociation2["TOOL"] = "tool";
13626
- ETelemetryAssociation2["PROVIDER"] = "provider";
13627
- })(ETelemetryAssociation || (ETelemetryAssociation = {}));
13628
- var ETelemetryMetadata;
13629
- (function(ETelemetryMetadata2) {
13630
- ETelemetryMetadata2["SCOPE_NAME"] = "com.alipay.linkque.runtime.telemetry";
13631
- ETelemetryMetadata2["RUNTIME_KIND"] = "node_toolkit";
13632
- ETelemetryMetadata2["SERVICE_NAMESPACE"] = "linkque";
13633
- ETelemetryMetadata2["ROUTE_CONTEXT_KEY"] = "linkque.telemetry.route";
13634
- })(ETelemetryMetadata || (ETelemetryMetadata = {}));
13635
13606
  var ETelemetryVersion;
13636
13607
  (function(ETelemetryVersion2) {
13637
13608
  ETelemetryVersion2["V0_2"] = "0.2";
@@ -14412,6 +14383,41 @@ var SideEffectRunner = class {
14412
14383
  }
14413
14384
  };
14414
14385
 
14386
+ // ../linkque-agent-runtime/dist/esm/core/telemetry/telemetryEnums.js
14387
+ var ETelemetryDiagnosticCode;
14388
+ (function(ETelemetryDiagnosticCode2) {
14389
+ ETelemetryDiagnosticCode2["INVALID_AUTHORIZATION"] = "invalid_authorization";
14390
+ ETelemetryDiagnosticCode2["PARTITION_LIMIT"] = "partition_limit";
14391
+ ETelemetryDiagnosticCode2["UNAVAILABLE_PARTITION"] = "unavailable_partition";
14392
+ ETelemetryDiagnosticCode2["QUEUE_LIMIT"] = "queue_limit";
14393
+ ETelemetryDiagnosticCode2["QUEUE_EXPIRED"] = "queue_expired";
14394
+ ETelemetryDiagnosticCode2["SENDER_FAILED"] = "sender_failed";
14395
+ ETelemetryDiagnosticCode2["PARTIAL_SUCCESS"] = "partial_success";
14396
+ ETelemetryDiagnosticCode2["AUTHORIZATION_REJECTED"] = "authorization_rejected";
14397
+ ETelemetryDiagnosticCode2["PERMANENT_REJECTION"] = "permanent_rejection";
14398
+ ETelemetryDiagnosticCode2["SEND_RETRY"] = "send_retry";
14399
+ ETelemetryDiagnosticCode2["SHUTDOWN_DROP"] = "shutdown_drop";
14400
+ ETelemetryDiagnosticCode2["LOCAL_SINK_FAILED"] = "local_sink_failed";
14401
+ ETelemetryDiagnosticCode2["CAPTURE_FAILED"] = "capture_failed";
14402
+ ETelemetryDiagnosticCode2["IDENTITY_MISMATCH"] = "identity_mismatch";
14403
+ ETelemetryDiagnosticCode2["ACTIVE_LIMIT"] = "active_limit";
14404
+ })(ETelemetryDiagnosticCode || (ETelemetryDiagnosticCode = {}));
14405
+ var ETelemetryAssociation;
14406
+ (function(ETelemetryAssociation2) {
14407
+ ETelemetryAssociation2["LOOP"] = "loop";
14408
+ ETelemetryAssociation2["ITERATION"] = "iteration";
14409
+ ETelemetryAssociation2["MODEL"] = "model";
14410
+ ETelemetryAssociation2["TOOL"] = "tool";
14411
+ ETelemetryAssociation2["PROVIDER"] = "provider";
14412
+ })(ETelemetryAssociation || (ETelemetryAssociation = {}));
14413
+ var ETelemetryMetadata;
14414
+ (function(ETelemetryMetadata2) {
14415
+ ETelemetryMetadata2["SCOPE_NAME"] = "com.alipay.linkque.runtime.telemetry";
14416
+ ETelemetryMetadata2["RUNTIME_KIND"] = "node_toolkit";
14417
+ ETelemetryMetadata2["SERVICE_NAMESPACE"] = "linkque";
14418
+ ETelemetryMetadata2["ROUTE_CONTEXT_KEY"] = "linkque.telemetry.route";
14419
+ })(ETelemetryMetadata || (ETelemetryMetadata = {}));
14420
+
14415
14421
  // ../linkque-agent-runtime/dist/esm/core/hook/hookToolWrapper.js
14416
14422
  function resolveHookToolName(tool) {
14417
14423
  return tool.modelName ?? tool.name;
@@ -16076,7 +16082,10 @@ function createConversationCustomEvent(name, value, fields = {}) {
16076
16082
  }
16077
16083
 
16078
16084
  // ../agent-conversation-contract/dist/esm/run.js
16079
- var CONVERSATION_CLIENT_CAPABILITIES = ["location"];
16085
+ var CONVERSATION_CLIENT_CAPABILITIES = [
16086
+ "location",
16087
+ "userInfo"
16088
+ ];
16080
16089
  var ConversationProtocolValidationError = class extends Error {
16081
16090
  issues;
16082
16091
  code = "CONVERSATION_PROTOCOL_INVALID";
@@ -23170,11 +23179,11 @@ export {
23170
23179
  ETelemetryModelPurpose,
23171
23180
  ETelemetryErrorType,
23172
23181
  ETelemetryGenAiOperation,
23173
- ETelemetryAssociation,
23174
23182
  warnLogFailure,
23175
23183
  HookDispatcher,
23176
23184
  DEFAULT_HOOK_DRAIN_BUDGET_MS,
23177
23185
  SideEffectRunner,
23186
+ ETelemetryAssociation,
23178
23187
  wrapToolWithHooks,
23179
23188
  NoopHookExecutor,
23180
23189
  RUNTIME_CONFIG_DEFAULTS,