@ixo/common 1.1.36 → 1.1.38

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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @ixo/common@1.1.36 build /home/runner/work/qiforge/qiforge/packages/common
2
+ > @ixo/common@1.1.38 build /home/runner/work/qiforge/qiforge/packages/common
3
3
  > tsc && tsc-alias
4
4
 
@@ -21,5 +21,5 @@ export declare const askIXOGuruTool: import("@langchain/core/tools").DynamicStru
21
21
  }, {
22
22
  question: string;
23
23
  sessionId: string;
24
- }, string, "ask_guru_ai">;
24
+ }, string, unknown, "ask_guru_ai">;
25
25
  //# sourceMappingURL=ask-ixo-guru.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ask-ixo-guru.d.ts","sourceRoot":"","sources":["../../../../src/ai/tools/ask-ixo-guru/ask-ixo-guru.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE;QACP,IAAI,EAAE,IAAI,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,IAAI,EAAE,EAAE,CAAC;IACT,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA6CF,eAAO,MAAM,cAAc;;;;cAvCf,MAAM;eACL,MAAM;;;;yBAkDjB,CAAC"}
1
+ {"version":3,"file":"ask-ixo-guru.d.ts","sourceRoot":"","sources":["../../../../src/ai/tools/ask-ixo-guru/ask-ixo-guru.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE;QACP,IAAI,EAAE,IAAI,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,IAAI,EAAE,EAAE,CAAC;IACT,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA6CF,eAAO,MAAM,cAAc;;;;;;;;;kCAYzB,CAAC"}
@@ -3,6 +3,6 @@ interface IParseAgActionParams {
3
3
  description: string;
4
4
  schema: Record<string, unknown>;
5
5
  }
6
- export declare function parserActionTool(action: IParseAgActionParams): import("@langchain/core/tools").DynamicStructuredTool<Record<string, unknown>, unknown, unknown, string, string>;
6
+ export declare function parserActionTool(action: IParseAgActionParams): import("@langchain/core/tools").DynamicStructuredTool<Record<string, unknown>, unknown, unknown, string, unknown, string>;
7
7
  export {};
8
8
  //# sourceMappingURL=parser-action-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parser-action-tool.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/parser-action-tool.ts"],"names":[],"mappings":"AAKA,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAGD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,oHAgD5D"}
1
+ {"version":3,"file":"parser-action-tool.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/parser-action-tool.ts"],"names":[],"mappings":"AAMA,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAGD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,6HA+D5D"}
@@ -1,20 +1,27 @@
1
1
  import { tool } from '@langchain/core/tools';
2
+ import { randomUUID } from 'node:crypto';
2
3
  import { callAgAction } from './action-caller.js';
3
4
  import { logActionToMatrix } from './log-action-to-matrix.js';
4
5
  export function parserActionTool(action) {
5
6
  const { name, description, schema } = action;
6
7
  return tool(async (input, runnableConfig) => {
7
8
  const { configurable } = runnableConfig;
8
- const { thread_id: sessionId, requestId, configs } = configurable;
9
+ const sessionIdField = configurable
10
+ .sessionId;
11
+ const sessionId = typeof sessionIdField === 'string' && sessionIdField.length > 0
12
+ ? sessionIdField
13
+ : configurable.thread_id;
14
+ const { requestId, configs } = configurable;
9
15
  if (!sessionId) {
10
16
  throw new Error('sessionId is required for AG-UI actions');
11
17
  }
18
+ const toolCallId = `ag_${requestId ?? 'noreq'}_${randomUUID().slice(0, 8)}`;
12
19
  const result = await callAgAction({
13
20
  sessionId,
14
- toolCallId: `ag_${requestId}`,
21
+ toolCallId,
15
22
  toolName: name,
16
23
  args: input,
17
- timeout: 5000,
24
+ timeout: 15000,
18
25
  });
19
26
  if (configs?.matrix.roomId) {
20
27
  void logActionToMatrix({
@@ -1 +1 @@
1
- {"version":3,"file":"parser-action-tool.js","sourceRoot":"","sources":["../../../src/ai/tools/parser-action-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAS9D,MAAM,UAAU,gBAAgB,CAAC,MAA4B;IAC3D,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC7C,OAAO,IAAI,CACT,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;QAC9B,MAAM,EAAE,YAAY,EAAE,GACpB,cAAmD,CAAC;QACtD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,YAA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Y,EAAE,GACpB,cAAmD,CAAC;QAKtD,MAAM,cAAc,GAAI,YAAwC;aAC7D,SAAS,CAAC;QACb,MAAM,SAAS,GACb,OAAO,cAAc,KAAK,QAAQ,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC;YAC7D,CAAC,CAAC,cAAc;YAChB,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC;QAC7B,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC;QAE5C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC7D,CAAC;QAKD,MAAM,UAAU,GAAG,MAAM,SAAS,IAAI,OAAO,IAAI,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAG5E,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC;YAChC,SAAS;YACT,UAAU;YACV,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,KAAgC;YACtC,OAAO,EAAE,KAAK;SACf,CAAC,CAAC;QAEH,IAAI,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;YAC3B,KAAK,iBAAiB,CACpB;gBACE,IAAI;gBACJ,IAAI,EAAE,KAAgC;gBACtC,MAAM;gBACN,OAAO,EAAE,IAAI;aACd,EACD;gBACE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM;gBAC7B,QAAQ,EAAE,SAAS;aACpB,CACF,CAAC;QACJ,CAAC;QAGD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC,EACD;QACE,IAAI;QACJ,WAAW;QACX,MAAM;QACN,QAAQ,EAAE;YACR,UAAU,EAAE,IAAI;SACjB;KACF,CACF,CAAC;AACJ,CAAC"}
@@ -3,6 +3,6 @@ interface IParserBrowserToolParams {
3
3
  schema: Record<string, unknown>;
4
4
  toolName: string;
5
5
  }
6
- export declare function parserBrowserTool(params: IParserBrowserToolParams): import("@langchain/core/tools").DynamicStructuredTool<Record<string, unknown>, unknown, unknown, unknown, string>;
6
+ export declare function parserBrowserTool(params: IParserBrowserToolParams): import("@langchain/core/tools").DynamicStructuredTool<Record<string, unknown>, unknown, unknown, unknown, unknown, string>;
7
7
  export {};
8
8
  //# sourceMappingURL=parser-browser-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parser-browser-tool.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/parser-browser-tool.ts"],"names":[],"mappings":"AAKA,UAAU,wBAAwB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,wBAAwB,qHA2CjE"}
1
+ {"version":3,"file":"parser-browser-tool.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/parser-browser-tool.ts"],"names":[],"mappings":"AAKA,UAAU,wBAAwB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,wBAAwB,8HA2CjE"}
@@ -5,6 +5,6 @@ declare const webSearchTool: import("@langchain/core/tools").DynamicStructuredTo
5
5
  input: string;
6
6
  }, {
7
7
  input: string;
8
- }, string, "web_search_tool">;
8
+ }, string, unknown, "web_search_tool">;
9
9
  export { webSearchTool };
10
10
  //# sourceMappingURL=web-search-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"web-search-tool.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/web-search-tool.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,QAAA,MAAM,aAAa;;;WACU,MAAM;;;6BA6BlC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"web-search-tool.d.ts","sourceRoot":"","sources":["../../../src/ai/tools/web-search-tool.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,QAAA,MAAM,aAAa;;;;;;sCA8BlB,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixo/common",
3
- "version": "1.1.36",
3
+ "version": "1.1.38",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -29,26 +29,26 @@
29
29
  "@types/better-sqlite3": "^7.6.13",
30
30
  "@types/node": "^22.7.3",
31
31
  "@types/store": "^2.0.5",
32
- "better-sqlite3": "^12.4.6",
32
+ "better-sqlite3": "^12.9.0",
33
33
  "testcontainers": "^10.16.0",
34
34
  "typescript": "^5.3.3",
35
35
  "@ixo/eslint-config": "2.0.0",
36
- "@ixo/typescript-config": "1.0.0",
36
+ "@ixo/oracles-events": "^1.0.4",
37
37
  "@ixo/vitest-config": "1.0.0",
38
- "@ixo/oracles-events": "^1.0.4"
38
+ "@ixo/typescript-config": "1.0.0"
39
39
  },
40
40
  "dependencies": {
41
41
  "@cosmjs/proto-signing": "^0.33.0",
42
42
  "@cosmjs/stargate": "^0.33.0",
43
43
  "@ixo/impactxclient-sdk": "^2.3.1",
44
- "@langchain/community": "^1.1.22",
45
- "@langchain/core": "^1.1.31",
46
- "@langchain/langgraph": "^1.2.1",
47
- "@langchain/langgraph-checkpoint": "^1.0.0",
44
+ "@langchain/community": "^1.1.27",
45
+ "@langchain/core": "^1.1.42",
46
+ "@langchain/langgraph": "^1.2.9",
47
+ "@langchain/langgraph-checkpoint": "^1.0.1",
48
48
  "@langchain/langgraph-checkpoint-sqlite": "^1.0.1",
49
- "@langchain/openai": "^1.2.12",
49
+ "@langchain/openai": "^1.4.5",
50
50
  "@langchain/textsplitters": "^1.0.1",
51
- "@tavily/core": "0.0.2",
51
+ "@tavily/core": "0.7.2",
52
52
  "axios": "^1.7.9",
53
53
  "axios-retry": "^4.5.0",
54
54
  "class-transformer": "^0.5.1",
@@ -56,12 +56,12 @@
56
56
  "dotenv": "^16.4.5",
57
57
  "duck-duck-scrape": "^2.2.5",
58
58
  "html-to-text": "9.0.5",
59
- "langchain": "^1.2.30",
60
- "langsmith": "^0.5.8",
61
- "mammoth": "1.8.0",
62
- "openai": "^6.9.1",
63
- "pdf-parse": "^1.1.1",
64
- "playwright": "^1.51.0",
59
+ "langchain": "^1.3.5",
60
+ "langsmith": "^0.5.25",
61
+ "mammoth": "1.12.0",
62
+ "openai": "^6.34.0",
63
+ "pdf-parse": "2.4.5",
64
+ "playwright": "^1.59.1",
65
65
  "node-emoji": "^2.2.0",
66
66
  "store": "^2.0.12",
67
67
  "zod": "^4.3.6",
@@ -1,5 +1,6 @@
1
1
  import { type IRunnableConfigWithRequiredFields } from '@ixo/matrix';
2
2
  import { tool } from '@langchain/core/tools';
3
+ import { randomUUID } from 'node:crypto';
3
4
  import { callAgAction } from './action-caller.js';
4
5
  import { logActionToMatrix } from './log-action-to-matrix.js';
5
6
 
@@ -16,19 +17,34 @@ export function parserActionTool(action: IParseAgActionParams) {
16
17
  async (input, runnableConfig) => {
17
18
  const { configurable } =
18
19
  runnableConfig as IRunnableConfigWithRequiredFields;
19
- const { thread_id: sessionId, requestId, configs } = configurable;
20
+ // Prefer explicit `sessionId` sub-agent wrappers set this to the real
21
+ // user WS session so routing works from nested contexts. Fall back to
22
+ // `thread_id` for direct invocations from the main agent (where
23
+ // thread_id IS the user's session).
24
+ const sessionIdField = (configurable as { sessionId?: unknown })
25
+ .sessionId;
26
+ const sessionId =
27
+ typeof sessionIdField === 'string' && sessionIdField.length > 0
28
+ ? sessionIdField
29
+ : configurable.thread_id;
30
+ const { requestId, configs } = configurable;
20
31
 
21
32
  if (!sessionId) {
22
33
  throw new Error('sessionId is required for AG-UI actions');
23
34
  }
24
35
 
36
+ // Unique toolCallId per invocation. Protects against:
37
+ // - Multiple tool calls sharing one requestId (React key collisions)
38
+ // - Any future code path that forgets to propagate requestId
39
+ const toolCallId = `ag_${requestId ?? 'noreq'}_${randomUUID().slice(0, 8)}`;
40
+
25
41
  // Call the action and WAIT for result from frontend
26
42
  const result = await callAgAction({
27
43
  sessionId,
28
- toolCallId: `ag_${requestId}`,
44
+ toolCallId,
29
45
  toolName: name,
30
46
  args: input as Record<string, unknown>,
31
- timeout: 5000, // 5 seconds
47
+ timeout: 15000, // 15 seconds
32
48
  });
33
49
 
34
50
  if (configs?.matrix.roomId) {