linkque-cli-v2 1.3.2 → 1.3.4

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.
Files changed (43) hide show
  1. package/linkquejs.js +1188 -570
  2. package/package.json +1 -1
  3. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{anthropic-messages-YOPI234A.js → anthropic-messages-EL2IU4YU.js} +7 -7
  4. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{azure-openai-responses-67YPFLZQ.js → azure-openai-responses-A4XURCOX.js} +9 -9
  5. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-JQKPMWIR.js → chunk-23PMJWOG.js} +37 -28
  6. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-VS2QQHAK.js → chunk-2ESYSVXG.js} +3 -1
  7. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-OXGCUIKV.js → chunk-B5XRGKYX.js} +1 -1
  8. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-2NGJGNYB.js → chunk-ETG6PNHQ.js} +1 -1
  9. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-7BQRUS4C.js → chunk-FC7MJHC3.js} +1 -1
  10. package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-G64JTU26.js +20 -0
  11. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-I64V3ICJ.js → chunk-GAYNLDWK.js} +1 -1
  12. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-6WHNFJT4.js → chunk-GQ4TD3EQ.js} +6 -6
  13. package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-HM7KNEG3.js +1639 -0
  14. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-MKS245OU.js → chunk-IWOFD643.js} +2 -2
  15. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-YDKZZ6EH.js → chunk-PXCGFBV5.js} +2 -2
  16. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-LSBJJGJC.js → chunk-Q2Y6LMNC.js} +3 -3
  17. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-UEVQXSKG.js → chunk-RR2GJPNV.js} +1 -1
  18. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-NIEA4H2C.js → chunk-VSZ3UDC7.js} +1 -1
  19. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-DYEQRE6N.js → chunk-WJHOHUET.js} +1 -1
  20. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-MDZWPPOW.js → chunk-YSRA6KFZ.js} +2663 -1236
  21. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{dist-QD3CV4KC.js → dist-TGBYXSBU.js} +1 -1
  22. package/vendor/linkque-agent-appwrite-integrate/dist/esm/getMachineId-bsd-H2ZLZRGB.js +40 -0
  23. package/vendor/linkque-agent-appwrite-integrate/dist/esm/getMachineId-darwin-HUKYR46U.js +39 -0
  24. package/vendor/linkque-agent-appwrite-integrate/dist/esm/getMachineId-linux-M5ZADHBA.js +33 -0
  25. package/vendor/linkque-agent-appwrite-integrate/dist/esm/getMachineId-unsupported-BM5RZZVM.js +23 -0
  26. package/vendor/linkque-agent-appwrite-integrate/dist/esm/getMachineId-win-BQPUF5TW.js +42 -0
  27. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-generative-ai-R5DASQKW.js → google-generative-ai-ENBYCHYT.js} +3 -3
  28. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-vertex-OLX2NFGJ.js → google-vertex-RIGAEYLC.js} +6 -6
  29. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{mistral-conversations-L6T7EWC2.js → mistral-conversations-TQA2MPJJ.js} +24 -24
  30. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{multipart-parser-AJMV6U6H.js → multipart-parser-BXFNUG5H.js} +2 -2
  31. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{multipart-parser-PULXGNYO.js → multipart-parser-TAD6XL3Q.js} +2 -2
  32. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{multipart-parser-2VJ7LVQD.js → multipart-parser-ZRVTGJCT.js} +2 -2
  33. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-codex-responses-7QJMWGY5.js → openai-codex-responses-WLREQPZK.js} +14 -14
  34. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-completions-75YD6VJJ.js → openai-completions-U6LUBY4P.js} +10 -10
  35. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-responses-G6MVJCGC.js → openai-responses-SFZAU5JA.js} +9 -9
  36. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openrouter-images-LMBZZQ76.js → openrouter-images-VSKAO4O5.js} +1 -1
  37. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{otel-7GSG7QQO.js → otel-RXJWJ2TU.js} +277 -1206
  38. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{pi-messages-ZX3KUWSZ.js → pi-messages-QQA6ZGV2.js} +8 -8
  39. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +1458 -400
  40. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +8 -7
  41. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +5 -4
  42. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{src-NGZW4JXI.js → src-JSJTYJV5.js} +3 -3
  43. package/worker.js +22311 -4507
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkque-cli-v2",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "Public Linkque CLI bundle for sandbox debugging",
5
5
  "bin": {
6
6
  "linkquejs": "linkquejs.js"
@@ -18,19 +18,19 @@ import {
18
18
  headersToRecord
19
19
  } from "./chunk-Y6UTJIT4.js";
20
20
  import {
21
- calculateCost
22
- } from "./chunk-Y3G4J3TB.js";
21
+ parseJsonWithRepair,
22
+ parseStreamingJson
23
+ } from "./chunk-WJHOHUET.js";
23
24
  import {
24
25
  getProviderEnvValue
25
- } from "./chunk-OXGCUIKV.js";
26
+ } from "./chunk-B5XRGKYX.js";
26
27
  import {
27
- parseJsonWithRepair,
28
- parseStreamingJson
29
- } from "./chunk-DYEQRE6N.js";
28
+ calculateCost
29
+ } from "./chunk-Y3G4J3TB.js";
30
30
  import {
31
31
  AssistantMessageEventStream
32
32
  } from "./chunk-46SEH6ER.js";
33
- import "./chunk-VS2QQHAK.js";
33
+ import "./chunk-2ESYSVXG.js";
34
34
 
35
35
  // ../../node_modules/@anthropic-ai/sdk/internal/tslib.mjs
36
36
  function __classPrivateFieldSet(receiver, state, value, kind, f) {
@@ -2,14 +2,14 @@ import {
2
2
  convertResponsesMessages,
3
3
  convertResponsesTools,
4
4
  processResponsesStream
5
- } from "./chunk-LSBJJGJC.js";
5
+ } from "./chunk-Q2Y6LMNC.js";
6
6
  import "./chunk-UFVAKOTZ.js";
7
- import {
8
- AzureOpenAI
9
- } from "./chunk-7QWAKKTY.js";
10
7
  import {
11
8
  clampOpenAIPromptCacheKey
12
9
  } from "./chunk-FHNQ6DPF.js";
10
+ import {
11
+ AzureOpenAI
12
+ } from "./chunk-7QWAKKTY.js";
13
13
  import {
14
14
  formatProviderError,
15
15
  normalizeProviderError
@@ -21,17 +21,17 @@ import "./chunk-CT4G24PS.js";
21
21
  import {
22
22
  headersToRecord
23
23
  } from "./chunk-Y6UTJIT4.js";
24
+ import "./chunk-WJHOHUET.js";
25
+ import {
26
+ getProviderEnvValue
27
+ } from "./chunk-B5XRGKYX.js";
24
28
  import {
25
29
  clampThinkingLevel
26
30
  } from "./chunk-Y3G4J3TB.js";
27
- import {
28
- getProviderEnvValue
29
- } from "./chunk-OXGCUIKV.js";
30
- import "./chunk-DYEQRE6N.js";
31
31
  import {
32
32
  AssistantMessageEventStream
33
33
  } from "./chunk-46SEH6ER.js";
34
- import "./chunk-VS2QQHAK.js";
34
+ import "./chunk-2ESYSVXG.js";
35
35
 
36
36
  // ../../node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js
37
37
  var DEFAULT_AZURE_API_VERSION = "v1";
@@ -7,23 +7,23 @@ import {
7
7
  le,
8
8
  ut,
9
9
  ye
10
- } from "./chunk-MKS245OU.js";
10
+ } from "./chunk-IWOFD643.js";
11
11
  import {
12
12
  require_node,
13
13
  require_node_fetch_native_with_agent_61758d11
14
- } from "./chunk-YDKZZ6EH.js";
14
+ } from "./chunk-PXCGFBV5.js";
15
15
  import {
16
16
  require_json_bigint
17
- } from "./chunk-2NGJGNYB.js";
17
+ } from "./chunk-ETG6PNHQ.js";
18
18
  import {
19
19
  RUNTIME_CONFIG_DEFAULTS,
20
20
  RuntimeConfigProvider
21
- } from "./chunk-MDZWPPOW.js";
21
+ } from "./chunk-YSRA6KFZ.js";
22
22
  import {
23
23
  __commonJS,
24
24
  __require,
25
25
  __toESM
26
- } from "./chunk-VS2QQHAK.js";
26
+ } from "./chunk-2ESYSVXG.js";
27
27
 
28
28
  // ../../node_modules/node-fetch-native-with-agent/dist/shared/node-fetch-native-with-agent.df7e6bd6.cjs
29
29
  var require_node_fetch_native_with_agent_df7e6bd6 = __commonJS({
@@ -7341,8 +7341,11 @@ var APPBASE_RUNTIME_CONFIG_DEFAULTS = Object.freeze({
7341
7341
  AGENT_CONFIG_URL_PRE: `${LINKQUE_ENDPOINT_PRE}/api/agent/config`,
7342
7342
  LINKQUE_BASE_URL_PRE: `${LINKQUE_ENDPOINT_PRE}/api/anthropic`,
7343
7343
  LINKQUEGW_KNOWLEDGE_BASE_URL_PRE: LINKQUE_ENDPOINT_PRE,
7344
+ LINKQUEGW_WEB_SEARCH_BASE_URL_PRE: LINKQUE_ENDPOINT_PRE,
7344
7345
  LINKQUEGW_EVENT_BASE_URL_PRE: LINKQUE_ENDPOINT_PRE,
7345
7346
  LINKQUEGW_MCP_SIGN_ENDPOINT_PRE: `${LINKQUE_ENDPOINT_PRE}/api/mcp/signature`,
7347
+ LINKQUE_OPEN_MCP_BASE_URL: "https://opengw.alipay.com",
7348
+ LINKQUE_OPEN_MCP_BASE_URL_PRE: "https://opengw-pre.alipay.com",
7346
7349
  RUN_DATABASE_ID: "linkque",
7347
7350
  RUN_TABLE_ID: "linkque_conversation_runs",
7348
7351
  SESSION_DATABASE_ID: "linkque",
@@ -11789,6 +11792,23 @@ function isConflict(error) {
11789
11792
  }
11790
11793
 
11791
11794
  // ../linkque-agent-appwrite-integrate/dist/esm/runtime/diagnostics.js
11795
+ function createA2UIInfoLog(env, logCtx, traceId, getMcpTraceId) {
11796
+ const level = new AppbaseRuntimeConfigProvider(env).get("LOG_LEVEL").trim().toLowerCase();
11797
+ if (!logCtx?.log || !["info", "debug"].includes(level))
11798
+ return void 0;
11799
+ return (line, scope) => {
11800
+ try {
11801
+ logCtx.log?.("[a2ui-action][info]", JSON.stringify({
11802
+ ...JSON.parse(line),
11803
+ level: "info",
11804
+ scope,
11805
+ traceId,
11806
+ mcpTraceId: getMcpTraceId?.()
11807
+ }));
11808
+ } catch {
11809
+ }
11810
+ };
11811
+ }
11792
11812
  function maskSecret(raw) {
11793
11813
  return raw ? "<set>" : "<unset>";
11794
11814
  }
@@ -11884,13 +11904,12 @@ function createPaymentInvocation(ownerId, request, now = /* @__PURE__ */ new Dat
11884
11904
  ownerId,
11885
11905
  agentId: request.agentId,
11886
11906
  threadId: request.threadId,
11887
- actionId: request.actionId,
11888
11907
  cardRef: request.source.cardRef,
11889
11908
  cardRevision: request.source.cardRevision,
11890
11909
  cardInstanceId: request.source.cardInstanceId,
11891
11910
  surfaceId: request.source.surfaceId,
11892
11911
  componentId: request.source.componentId,
11893
- actionContext: request.actionContext,
11912
+ input: request.input,
11894
11913
  status: "executing",
11895
11914
  createdAt: now.toISOString(),
11896
11915
  expiresAt: new Date(now.getTime() + PAYMENT_INVOCATION_TTL_MS).toISOString()
@@ -11902,17 +11921,19 @@ function createPaymentInvocationId(ownerId, request) {
11902
11921
  agentId: request.agentId,
11903
11922
  threadId: request.threadId,
11904
11923
  cardInstanceId: request.source.cardInstanceId,
11905
- actionId: request.actionId,
11906
- actionContext: request.actionContext
11924
+ cardRevision: request.source.cardRevision,
11925
+ surfaceId: request.source.surfaceId,
11926
+ componentId: request.source.componentId,
11927
+ input: request.input
11907
11928
  });
11908
11929
  return `pa_${createHash("sha256").update(material).digest("hex").slice(0, 32)}`;
11909
11930
  }
11910
11931
  function createPaymentActionStore(databases, databaseId, tableId) {
11911
11932
  return {
11912
11933
  async begin(invocation) {
11913
- const { invocationId, actionContext, ...fields } = invocation;
11934
+ const { invocationId, input, ...fields } = invocation;
11914
11935
  try {
11915
- const document = await databases.createDocument(databaseId, tableId, invocationId, { ...fields, actionContext: JSON.stringify(actionContext) }, []);
11936
+ const document = await databases.createDocument(databaseId, tableId, invocationId, { ...fields, input: JSON.stringify(input) }, []);
11916
11937
  return {
11917
11938
  kind: "created",
11918
11939
  invocation: readInvocation2(document) ?? invocation
@@ -11937,10 +11958,6 @@ function createPaymentActionStore(databases, databaseId, tableId) {
11937
11958
  },
11938
11959
  async update(invocationId, patch) {
11939
11960
  const data = { ...patch };
11940
- if (patch.callback)
11941
- data.callback = JSON.stringify(patch.callback);
11942
- if (patch.verification)
11943
- data.verification = JSON.stringify(patch.verification);
11944
11961
  const document = await databases.updateDocument(databaseId, tableId, invocationId, data);
11945
11962
  const invocation = readInvocation2(document);
11946
11963
  if (!invocation)
@@ -11963,29 +11980,24 @@ function readInvocation2(value) {
11963
11980
  if (!value || typeof value !== "object" || Array.isArray(value))
11964
11981
  return void 0;
11965
11982
  const row = value;
11966
- if (typeof row.$id !== "string" || typeof row.ownerId !== "string" || typeof row.agentId !== "string" || typeof row.threadId !== "string" || typeof row.actionId !== "string" || typeof row.cardRef !== "string" || typeof row.cardRevision !== "string" || typeof row.cardInstanceId !== "string" || typeof row.surfaceId !== "string" || typeof row.componentId !== "string" || typeof row.actionContext !== "string" || typeof row.status !== "string" || typeof row.createdAt !== "string" || typeof row.expiresAt !== "string")
11983
+ if (typeof row.$id !== "string" || typeof row.ownerId !== "string" || typeof row.agentId !== "string" || typeof row.threadId !== "string" || typeof row.cardRef !== "string" || typeof row.cardRevision !== "string" || typeof row.cardInstanceId !== "string" || typeof row.surfaceId !== "string" || typeof row.componentId !== "string" || typeof row.input !== "string" || typeof row.status !== "string" || typeof row.createdAt !== "string" || typeof row.expiresAt !== "string")
11967
11984
  return void 0;
11968
- const actionContext = parseJsonObject(row.actionContext);
11969
- if (!actionContext)
11985
+ const input = parseJsonObject(row.input);
11986
+ if (!input)
11970
11987
  return void 0;
11971
11988
  return {
11972
11989
  invocationId: row.$id,
11973
11990
  ownerId: row.ownerId,
11974
11991
  agentId: row.agentId,
11975
11992
  threadId: row.threadId,
11976
- actionId: row.actionId,
11977
11993
  cardRef: row.cardRef,
11978
11994
  cardRevision: row.cardRevision,
11979
11995
  cardInstanceId: row.cardInstanceId,
11980
11996
  surfaceId: row.surfaceId,
11981
11997
  componentId: row.componentId,
11982
- actionContext,
11998
+ input,
11983
11999
  status: row.status,
11984
12000
  ...typeof row.tradeNO === "string" ? { tradeNO: row.tradeNO } : {},
11985
- ...typeof row.callback === "string" && parseJsonObject(row.callback) ? { callback: parseJsonObject(row.callback) } : {},
11986
- ...typeof row.verification === "string" && parseVerification(row.verification) ? {
11987
- verification: parseVerification(row.verification)
11988
- } : {},
11989
12001
  createdAt: row.createdAt,
11990
12002
  expiresAt: row.expiresAt
11991
12003
  };
@@ -11998,10 +12010,6 @@ function parseJsonObject(value) {
11998
12010
  return void 0;
11999
12011
  }
12000
12012
  }
12001
- function parseVerification(value) {
12002
- const parsed = parseJsonObject(value);
12003
- return parsed && typeof parsed.paid === "boolean" ? parsed : void 0;
12004
- }
12005
12013
  function stableStringify(value) {
12006
12014
  if (Array.isArray(value))
12007
12015
  return `[${value.map(stableStringify).join(",")}]`;
@@ -12263,6 +12271,7 @@ export {
12263
12271
  readAuthenticatedUserId,
12264
12272
  readAppwriteApiKey,
12265
12273
  Query,
12274
+ createA2UIInfoLog,
12266
12275
  isDebugLogLevel,
12267
12276
  describeRuntimeEnv,
12268
12277
  resolveRunStorage,
@@ -36,11 +36,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
37
37
  mod
38
38
  ));
39
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
39
40
 
40
41
  export {
41
42
  __require,
42
43
  __esm,
43
44
  __commonJS,
44
45
  __export,
45
- __toESM
46
+ __toESM,
47
+ __toCommonJS
46
48
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __require
3
- } from "./chunk-VS2QQHAK.js";
3
+ } from "./chunk-2ESYSVXG.js";
4
4
 
5
5
  // ../../node_modules/@earendil-works/pi-ai/dist/utils/provider-env.js
6
6
  var procEnvCache = null;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __commonJS
3
- } from "./chunk-VS2QQHAK.js";
3
+ } from "./chunk-2ESYSVXG.js";
4
4
 
5
5
  // ../../node_modules/bignumber.js/bignumber.js
6
6
  var require_bignumber = __commonJS({
@@ -13,7 +13,7 @@ import {
13
13
  string,
14
14
  union,
15
15
  unknown
16
- } from "./chunk-I64V3ICJ.js";
16
+ } from "./chunk-GAYNLDWK.js";
17
17
 
18
18
  // ../../node_modules/@mistralai/mistralai/esm/lib/primitives.js
19
19
  function remap(inp, mappings) {
@@ -0,0 +1,20 @@
1
+ import {
2
+ __commonJS,
3
+ __require
4
+ } from "./chunk-2ESYSVXG.js";
5
+
6
+ // ../../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js
7
+ var require_execAsync = __commonJS({
8
+ "../../node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js"(exports) {
9
+ "use strict";
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.execAsync = void 0;
12
+ var child_process = __require("child_process");
13
+ var util = __require("util");
14
+ exports.execAsync = util.promisify(child_process.exec);
15
+ }
16
+ });
17
+
18
+ export {
19
+ require_execAsync
20
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./chunk-VS2QQHAK.js";
3
+ } from "./chunk-2ESYSVXG.js";
4
4
 
5
5
  // ../../node_modules/zod/v4/core/index.js
6
6
  var core_exports2 = {};
@@ -1,17 +1,17 @@
1
- import {
2
- require_json_bigint
3
- } from "./chunk-2NGJGNYB.js";
4
1
  import {
5
2
  transformMessages
6
3
  } from "./chunk-RYONFGPP.js";
7
4
  import {
8
5
  sanitizeSurrogates
9
6
  } from "./chunk-CT4G24PS.js";
7
+ import {
8
+ require_json_bigint
9
+ } from "./chunk-ETG6PNHQ.js";
10
10
  import {
11
11
  __commonJS,
12
12
  __require,
13
13
  __toESM
14
- } from "./chunk-VS2QQHAK.js";
14
+ } from "./chunk-2ESYSVXG.js";
15
15
 
16
16
  // ../../node_modules/retry/lib/retry_operation.js
17
17
  var require_retry_operation = __commonJS({
@@ -1324,12 +1324,12 @@ Content-Type: ${partContentType}\r
1324
1324
  * @returns A proxy agent
1325
1325
  */
1326
1326
  static async #getProxyAgent() {
1327
- this.#proxyAgent ||= (await import("./dist-QD3CV4KC.js")).HttpsProxyAgent;
1327
+ this.#proxyAgent ||= (await import("./dist-TGBYXSBU.js")).HttpsProxyAgent;
1328
1328
  return this.#proxyAgent;
1329
1329
  }
1330
1330
  static async #getFetch() {
1331
1331
  const hasWindow = typeof window !== "undefined" && !!window;
1332
- this.#fetch ||= hasWindow ? window.fetch : (await import("./src-NGZW4JXI.js")).default;
1332
+ this.#fetch ||= hasWindow ? window.fetch : (await import("./src-JSJTYJV5.js")).default;
1333
1333
  return this.#fetch;
1334
1334
  }
1335
1335
  /**