@ai.ntellect/core 0.6.11 → 0.6.13

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 (44) hide show
  1. package/app/README.md +36 -0
  2. package/app/app/favicon.ico +0 -0
  3. package/app/app/globals.css +21 -0
  4. package/app/app/gun.ts +0 -0
  5. package/app/app/layout.tsx +18 -0
  6. package/app/app/page.tsx +321 -0
  7. package/app/eslint.config.mjs +16 -0
  8. package/app/next.config.ts +7 -0
  9. package/app/package-lock.json +5912 -0
  10. package/app/package.json +31 -0
  11. package/app/pnpm-lock.yaml +4031 -0
  12. package/app/postcss.config.mjs +8 -0
  13. package/app/public/file.svg +1 -0
  14. package/app/public/globe.svg +1 -0
  15. package/app/public/next.svg +1 -0
  16. package/app/public/vercel.svg +1 -0
  17. package/app/public/window.svg +1 -0
  18. package/app/tailwind.config.ts +18 -0
  19. package/app/tsconfig.json +27 -0
  20. package/dist/graph/controller.js +30 -41
  21. package/dist/graph/graph.js +167 -0
  22. package/dist/index.js +3 -2
  23. package/dist/memory/adapters/meilisearch/index.js +39 -63
  24. package/dist/utils/experimental-graph-rag.js +152 -0
  25. package/dist/utils/stringifiy-zod-schema.js +7 -6
  26. package/graph/controller.ts +57 -52
  27. package/graph/graph.ts +198 -0
  28. package/index.ts +3 -2
  29. package/memory/adapters/meilisearch/index.ts +41 -76
  30. package/package.json +2 -2
  31. package/tsconfig.json +1 -1
  32. package/types/index.ts +35 -38
  33. package/utils/experimental-graph-rag.ts +170 -0
  34. package/utils/stringifiy-zod-schema.ts +6 -6
  35. package/create-llm-to-select-multiple-graph copy.ts +0 -237
  36. package/create-llm-to-select-multiple-graph.ts +0 -148
  37. package/dist/create-llm-to-select-multiple-graph copy.js +0 -171
  38. package/dist/create-llm-to-select-multiple-graph.js +0 -142
  39. package/dist/graph/engine.js +0 -646
  40. package/dist/index copy.js +0 -76
  41. package/dist/utils/setup-graphs.js +0 -28
  42. package/graph/engine.ts +0 -805
  43. package/index copy.ts +0 -81
  44. package/utils/setup-graphs.ts +0 -45
package/index copy.ts DELETED
@@ -1,81 +0,0 @@
1
- export interface NetworkConfig {
2
- name: string;
3
- id?: number;
4
- rpc: string;
5
- explorerUrl: string;
6
- nativeToken: string; // WETH
7
- }
8
- export const networkConfigs: Record<string, NetworkConfig> = {
9
- ethereum: {
10
- name: "Ethereum Mainnet",
11
- id: 1,
12
- rpc: "https://eth.llamarpc.com",
13
- explorerUrl: "https://etherscan.io",
14
- nativeToken: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
15
- },
16
- polygon: {
17
- name: "Polygon Mainnet",
18
- id: 137,
19
- rpc: "https://polygon.llamarpc.com",
20
- explorerUrl: "https://polygonscan.com",
21
- nativeToken: "0x0000000000000000000000000000000000001010",
22
- },
23
- arbitrum: {
24
- name: "Arbitrum Mainnet",
25
- id: 42161,
26
- rpc: "https://arbitrum.llamarpc.com",
27
- explorerUrl: "https://arbiscan.io",
28
- nativeToken: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
29
- },
30
- base: {
31
- name: "Base Mainnet",
32
- id: 8453,
33
- rpc: "https://base.llamarpc.com",
34
- explorerUrl: "https://basescan.org",
35
- nativeToken: "0x4200000000000000000000000000000000000006",
36
- },
37
- solana: {
38
- name: "Solana Mainnet",
39
- rpc: "https://api.mainnet-beta.solana.com",
40
- explorerUrl: "https://solscan.io",
41
- nativeToken: "So11111111111111111111111111111111111111112",
42
- },
43
- sepolia: {
44
- name: "Sepolia Testnet",
45
- id: 11155111,
46
- rpc: "https://rpc.sepolia.ethpandaops.io",
47
- explorerUrl: "https://sepolia.etherscan.io",
48
- nativeToken: "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",
49
- },
50
- baseSepolia: {
51
- name: "Base Sepolia Testnet",
52
- id: 84532,
53
- rpc: "https://base-sepolia-rpc.publicnode.com",
54
- explorerUrl: "https://sepolia.basescan.org",
55
- nativeToken: "0x4200000000000000000000000000000000000006",
56
- },
57
- };
58
-
59
- export const getNetworkProvider = (networkName: string) => {
60
- const config = networkConfigs[networkName.toLowerCase()];
61
- if (!config) {
62
- throw new Error(`Network ${networkName} not supported`);
63
- }
64
- return { config };
65
- };
66
-
67
- export const ROUTER_ADDRESSES: { [key: string]: string } = {
68
- ethereum: "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
69
- sepolia: "0xeE567Fe1712Faf6149d80dA1E6934E354124CfE3",
70
- arbitrum: "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24",
71
- polygon: "0xedf6066a2b290C185783862C7F4776A2C8077AD1",
72
- base: "0x4752ba5dbc23f44d87826276bf6fd6b1c372ad24",
73
- optimism: "0x4A7b5Da61326A6379179b40d00F57E5bbDC962c2",
74
- blast: "0xBB66Eb1c5e875933D44DAe661dbD80e5D9B03035",
75
- zora: "0xa00F34A632630EFd15223B1968358bA4845bEEC7",
76
- worldchain: "0x541aB7c31A119441eF3575F6973277DE0eF460bd",
77
- };
78
-
79
- export const getRouterAddress = (networkName: string) => {
80
- return ROUTER_ADDRESSES[networkName.toLowerCase()];
81
- };
@@ -1,45 +0,0 @@
1
- import { GraphEngine } from "../graph/engine";
2
- import { Action, GraphDefinition, SharedState } from "../types";
3
-
4
- export function setupGraphsWithActions<T>(
5
- actions: Action[],
6
- baseStateMapping: Record<string, SharedState<T>>,
7
- graphMaps: GraphDefinition<T>[]
8
- ): {
9
- initialStates: SharedState<T>[];
10
- graphs: GraphEngine<T>[];
11
- startNodes: string[];
12
- } {
13
- const initialStates = actions.map((action) => {
14
- const parametersObject = Object.fromEntries(
15
- action.parameters.map((param) => [
16
- param.name,
17
- param.value !== undefined ? param.value : null,
18
- ]) // Handle optional values
19
- );
20
-
21
- const baseState = baseStateMapping[action.name] || {};
22
-
23
- return {
24
- ...baseState,
25
- ...parametersObject,
26
- };
27
- });
28
-
29
- const selectedGraphs = actions
30
- .map((action) => graphMaps.find((graph) => graph.name === action.name))
31
- .filter((graph): graph is GraphDefinition<T> => graph !== undefined);
32
-
33
- if (selectedGraphs.length !== actions.length) {
34
- throw new Error("Graph not found");
35
- }
36
-
37
- const startNodes = selectedGraphs.map((graph) => graph.entryNode);
38
- const graphEngines = selectedGraphs.map((graph) => new GraphEngine(graph));
39
-
40
- return {
41
- initialStates: initialStates as SharedState<T>[],
42
- graphs: graphEngines,
43
- startNodes,
44
- };
45
- }