linkque-cli-v2 1.6.18 → 1.6.19

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 (19) hide show
  1. package/dataTransformWorker.js +17 -3
  2. package/linkquejs.js +26 -57
  3. package/package.json +1 -1
  4. package/vendor/linkque-agent-appwrite-integrate/data-transform/dataTransformWorker.js +17 -3
  5. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{anthropic-messages-GSYNBLMR.js → anthropic-messages-TBZKK7UX.js} +2 -2
  6. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-3BH2PDL3.js → chunk-RL3OKTKX.js} +1 -1
  7. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-M6E4Y5HY.js → chunk-SGKJHCSV.js} +93 -93
  8. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-L5WNKJ4W.js → chunk-ZVFW6DFO.js} +26 -7
  9. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +2033 -1976
  10. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +2 -2
  11. package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +2 -2
  12. package/worker.js +15 -7
  13. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{azure-openai-responses-NPKMM3LF.js → azure-openai-responses-IYC43YOB.js} +1 -1
  14. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-KDHBKVSL.js → chunk-FCD4O3BT.js} +3 -3
  15. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{mistral-conversations-EIVAJAMW.js → mistral-conversations-KIOTOF73.js} +3 -3
  16. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-codex-responses-GEFKSNVN.js → openai-codex-responses-HYLTKNTN.js} +1 -1
  17. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-completions-TAACO6T5.js → openai-completions-CS3OYESP.js} +3 -3
  18. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-responses-4DDTXIGI.js → openai-responses-IYAGUHY7.js} +1 -1
  19. package/vendor/linkque-agent-appwrite-integrate/dist/esm/{pi-messages-7JN3W3BC.js → pi-messages-XGBW55RS.js} +3 -3
@@ -3,11 +3,11 @@ import {
3
3
  runClientCapability,
4
4
  runClientCapabilityCleanup,
5
5
  runClientCapabilityResult
6
- } from "../../chunk-L5WNKJ4W.js";
6
+ } from "../../chunk-ZVFW6DFO.js";
7
7
  import "../../chunk-IWOFD643.js";
8
8
  import "../../chunk-PXCGFBV5.js";
9
9
  import "../../chunk-ETG6PNHQ.js";
10
- import "../../chunk-M6E4Y5HY.js";
10
+ import "../../chunk-SGKJHCSV.js";
11
11
  import "../../chunk-XUFLSZM4.js";
12
12
  import "../../chunk-GAYNLDWK.js";
13
13
  import "../../chunk-SICWMO5Y.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  getBakedProtocol,
3
3
  setBakedProtocol
4
- } from "../chunk-3BH2PDL3.js";
5
- import "../chunk-M6E4Y5HY.js";
4
+ } from "../chunk-RL3OKTKX.js";
5
+ import "../chunk-SGKJHCSV.js";
6
6
  import "../chunk-XUFLSZM4.js";
7
7
  import "../chunk-GAYNLDWK.js";
8
8
  import "../chunk-SICWMO5Y.js";
package/worker.js CHANGED
@@ -225708,12 +225708,18 @@ var init_piAIFilter = __esm({
225708
225708
  if (modelList.length === 0)
225709
225709
  return [];
225710
225710
  let usage;
225711
+ const messages = this.context.messages.map((message) => {
225712
+ if (message.role !== "toolResult")
225713
+ return message;
225714
+ const { details: _details, ...modelMessage } = message;
225715
+ return modelMessage;
225716
+ });
225711
225717
  const context2 = {
225712
225718
  systemPrompt: `${this.context.systemPrompt ?? ""}
225713
225719
 
225714
225720
  ${INSTRUCTION}`,
225715
225721
  messages: [
225716
- ...structuredClone(this.context.messages),
225722
+ ...structuredClone(messages),
225717
225723
  {
225718
225724
  role: "user",
225719
225725
  timestamp: Date.now(),
@@ -225772,7 +225778,9 @@ ${INSTRUCTION}`,
225772
225778
  traceparent: `00-${span.traceId}-${span.spanId}-${(span.traceFlags & 1).toString(16).padStart(2, "0")}`
225773
225779
  }
225774
225780
  } : this.model;
225775
- const { onPayload: _payload, onResponse: _response, ...options } = this.options;
225781
+ const streamOptions = typeof this.options === "function" ? await this.options() : this.options;
225782
+ signal?.throwIfAborted();
225783
+ const { onPayload: _payload, onResponse: _response, ...options } = streamOptions;
225776
225784
  const message = await this.models.streamSimple(model, context2, { ...options, signal }).result();
225777
225785
  usage = message.usage;
225778
225786
  signal?.throwIfAborted();
@@ -225945,10 +225953,10 @@ async function createAgentSession(options) {
225945
225953
  streamFn: (model, context2, streamOptions) => {
225946
225954
  filterSnapshot = {
225947
225955
  model,
225948
- context: structuredClone({
225956
+ context: {
225949
225957
  systemPrompt: context2.systemPrompt,
225950
- messages: context2.messages
225951
- }),
225958
+ messages: context2.messages.slice()
225959
+ },
225952
225960
  options: { ...streamOptions }
225953
225961
  };
225954
225962
  const logical = options.telemetry?.startModel(model);
@@ -226079,10 +226087,10 @@ async function createAgentSession(options) {
226079
226087
  systemPrompt: agent.state.systemPrompt,
226080
226088
  messages: agent.state.messages.slice(0, agent.state.messages.indexOf(assistant)).filter((message) => message.role === "user" || message.role === "assistant" || message.role === "toolResult")
226081
226089
  },
226082
- options: {
226090
+ options: async () => ({
226083
226091
  apiKey: await options.getApiKey(options.model.provider),
226084
226092
  reasoning: options.thinkingLevel === "off" ? void 0 : options.thinkingLevel
226085
- }
226093
+ })
226086
226094
  };
226087
226095
  }
226088
226096
  const results = await Promise.all(calls.map(async (content) => {
@@ -14,10 +14,10 @@ import {
14
14
  formatProviderError,
15
15
  normalizeProviderError
16
16
  } from "./chunk-NKEOCGYU.js";
17
+ import "./chunk-WJHOHUET.js";
17
18
  import {
18
19
  getProviderEnvValue
19
20
  } from "./chunk-B5XRGKYX.js";
20
- import "./chunk-WJHOHUET.js";
21
21
  import {
22
22
  buildBaseOptions,
23
23
  clampThinkingLevel
@@ -5,13 +5,13 @@ import {
5
5
  buildCopilotDynamicHeaders,
6
6
  hasCopilotVisionInput
7
7
  } from "./chunk-XMVFOHGJ.js";
8
- import {
9
- getProviderEnvValue
10
- } from "./chunk-B5XRGKYX.js";
11
8
  import {
12
9
  parseJsonWithRepair,
13
10
  parseStreamingJson
14
11
  } from "./chunk-WJHOHUET.js";
12
+ import {
13
+ getProviderEnvValue
14
+ } from "./chunk-B5XRGKYX.js";
15
15
  import {
16
16
  adjustMaxTokensForThinking,
17
17
  buildBaseOptions,
@@ -1,3 +1,6 @@
1
+ import {
2
+ shortHash
3
+ } from "./chunk-UFVAKOTZ.js";
1
4
  import {
2
5
  BuiltInConnectors$inboundSchema,
3
6
  BuiltInConnectors$outboundSchema,
@@ -34,9 +37,6 @@ import {
34
37
  smartUnion,
35
38
  unwrapAsync
36
39
  } from "./chunk-FC7MJHC3.js";
37
- import {
38
- shortHash
39
- } from "./chunk-UFVAKOTZ.js";
40
40
  import {
41
41
  parseStreamingJson
42
42
  } from "./chunk-WJHOHUET.js";
@@ -22,10 +22,10 @@ import {
22
22
  import {
23
23
  splitDeferredTools
24
24
  } from "./chunk-HTG7JBF2.js";
25
+ import "./chunk-WJHOHUET.js";
25
26
  import {
26
27
  getProviderEnvValue
27
28
  } from "./chunk-B5XRGKYX.js";
28
- import "./chunk-WJHOHUET.js";
29
29
  import {
30
30
  buildBaseOptions,
31
31
  clampThinkingLevel
@@ -12,12 +12,12 @@ import {
12
12
  buildCopilotDynamicHeaders,
13
13
  hasCopilotVisionInput
14
14
  } from "./chunk-XMVFOHGJ.js";
15
- import {
16
- getProviderEnvValue
17
- } from "./chunk-B5XRGKYX.js";
18
15
  import {
19
16
  parseStreamingJson
20
17
  } from "./chunk-WJHOHUET.js";
18
+ import {
19
+ getProviderEnvValue
20
+ } from "./chunk-B5XRGKYX.js";
21
21
  import {
22
22
  buildBaseOptions,
23
23
  calculateCost,
@@ -21,10 +21,10 @@ import {
21
21
  buildCopilotDynamicHeaders,
22
22
  hasCopilotVisionInput
23
23
  } from "./chunk-XMVFOHGJ.js";
24
+ import "./chunk-WJHOHUET.js";
24
25
  import {
25
26
  getProviderEnvValue
26
27
  } from "./chunk-B5XRGKYX.js";
27
- import "./chunk-WJHOHUET.js";
28
28
  import {
29
29
  buildBaseOptions,
30
30
  clampThinkingLevel
@@ -2,12 +2,12 @@ import {
2
2
  appendAssistantMessageDiagnostic,
3
3
  createAssistantMessageDiagnostic
4
4
  } from "./chunk-E2P6TIFG.js";
5
- import {
6
- getProviderEnvValue
7
- } from "./chunk-B5XRGKYX.js";
8
5
  import {
9
6
  parseStreamingJson
10
7
  } from "./chunk-WJHOHUET.js";
8
+ import {
9
+ getProviderEnvValue
10
+ } from "./chunk-B5XRGKYX.js";
11
11
  import {
12
12
  AssistantMessageEventStream
13
13
  } from "./chunk-46SEH6ER.js";