@n8n/stores 1.23.0 → 1.25.0

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 (50) hide show
  1. package/dist/chunk-CUT6urMc.cjs +30 -0
  2. package/dist/constants-BbnUagQU.cjs +54 -0
  3. package/dist/constants-BbnUagQU.cjs.map +1 -0
  4. package/dist/constants-C9J2fW5t.d.ts +47 -0
  5. package/dist/constants-DuYkHX7y.js +48 -0
  6. package/dist/constants-DuYkHX7y.js.map +1 -0
  7. package/dist/constants-DwkrkpBX.d.cts +47 -0
  8. package/dist/constants.cjs +2 -6
  9. package/dist/constants.d.cts +2 -45
  10. package/dist/constants.d.ts +2 -45
  11. package/dist/constants.js +3 -7
  12. package/dist/index.cjs +2 -6
  13. package/dist/index.d.cts +2 -1
  14. package/dist/index.d.ts +2 -1
  15. package/dist/index.js +3 -7
  16. package/dist/metaTagConfig-DEzM-BAY.cjs +49 -0
  17. package/dist/metaTagConfig-DEzM-BAY.cjs.map +1 -0
  18. package/dist/metaTagConfig-DwSO4X1O.js +37 -0
  19. package/dist/metaTagConfig-DwSO4X1O.js.map +1 -0
  20. package/dist/metaTagConfig.cjs +3 -8
  21. package/dist/metaTagConfig.d.cts +3 -1
  22. package/dist/metaTagConfig.d.ts +3 -1
  23. package/dist/metaTagConfig.js +3 -9
  24. package/dist/useAgentRequestStore.cjs +49 -57
  25. package/dist/useAgentRequestStore.cjs.map +1 -1
  26. package/dist/useAgentRequestStore.d.cts +34 -32
  27. package/dist/useAgentRequestStore.d.ts +34 -32
  28. package/dist/useAgentRequestStore.js +46 -57
  29. package/dist/useAgentRequestStore.js.map +1 -1
  30. package/dist/useRootStore.cjs +163 -169
  31. package/dist/useRootStore.cjs.map +1 -1
  32. package/dist/useRootStore.d.cts +159 -157
  33. package/dist/useRootStore.d.ts +159 -157
  34. package/dist/useRootStore.js +160 -170
  35. package/dist/useRootStore.js.map +1 -1
  36. package/package.json +8 -8
  37. package/dist/chunk-FWZLY65U.cjs +0 -49
  38. package/dist/chunk-FWZLY65U.cjs.map +0 -1
  39. package/dist/chunk-MFIRIEND.js +0 -40
  40. package/dist/chunk-MFIRIEND.js.map +0 -1
  41. package/dist/chunk-T5NQGFO6.js +0 -49
  42. package/dist/chunk-T5NQGFO6.js.map +0 -1
  43. package/dist/chunk-TI4WVUCB.cjs +0 -40
  44. package/dist/chunk-TI4WVUCB.cjs.map +0 -1
  45. package/dist/constants.cjs.map +0 -1
  46. package/dist/constants.js.map +0 -1
  47. package/dist/index.cjs.map +0 -1
  48. package/dist/index.js.map +0 -1
  49. package/dist/metaTagConfig.cjs.map +0 -1
  50. package/dist/metaTagConfig.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/n8n/n8n/packages/frontend/@n8n/stores/dist/useAgentRequestStore.cjs","../src/useAgentRequestStore.ts"],"names":[],"mappings":"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","file":"/home/runner/work/n8n/n8n/packages/frontend/@n8n/stores/dist/useAgentRequestStore.cjs","sourcesContent":[null,"import { useLocalStorage } from '@vueuse/core';\nimport type { INodeParameters, NodeParameterValueType } from 'n8n-workflow';\nimport { defineStore } from 'pinia';\n\nconst LOCAL_STORAGE_AGENT_REQUESTS = 'N8N_AGENT_REQUESTS';\n\nexport interface IAgentRequest {\n\tquery: INodeParameters | string;\n\ttoolName?: string;\n}\n\nexport interface IAgentRequestStoreState {\n\t[workflowId: string]: {\n\t\t[nodeName: string]: IAgentRequest;\n\t};\n}\n\nexport const useAgentRequestStore = defineStore('agentRequest', () => {\n\t// State\n\tconst agentRequests = useLocalStorage<IAgentRequestStoreState>(LOCAL_STORAGE_AGENT_REQUESTS, {});\n\n\t// Helper function to ensure workflow and node entries exist\n\tconst ensureWorkflowAndNodeExist = (workflowId: string, nodeId: string): void => {\n\t\tif (!agentRequests.value[workflowId]) {\n\t\t\tagentRequests.value[workflowId] = {};\n\t\t}\n\n\t\tif (!agentRequests.value[workflowId][nodeId]) {\n\t\t\tagentRequests.value[workflowId][nodeId] = { query: {} };\n\t\t}\n\t};\n\n\t// Getters\n\tconst getAgentRequests = (workflowId: string, nodeId: string): INodeParameters | string => {\n\t\treturn agentRequests.value[workflowId]?.[nodeId]?.query || {};\n\t};\n\n\tconst getQueryValue = (\n\t\tworkflowId: string,\n\t\tnodeId: string,\n\t\tparamName: string,\n\t): NodeParameterValueType | undefined => {\n\t\tconst query = agentRequests.value[workflowId]?.[nodeId]?.query;\n\t\tif (typeof query === 'string') {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn query?.[paramName];\n\t};\n\n\tconst setAgentRequestForNode = (\n\t\tworkflowId: string,\n\t\tnodeId: string,\n\t\trequest: IAgentRequest,\n\t): void => {\n\t\tensureWorkflowAndNodeExist(workflowId, nodeId);\n\n\t\tagentRequests.value[workflowId][nodeId] = {\n\t\t\t...request,\n\t\t\tquery: typeof request.query === 'string' ? request.query : { ...request.query },\n\t\t};\n\t};\n\n\tconst clearAgentRequests = (workflowId: string, nodeId: string): void => {\n\t\tif (agentRequests.value[workflowId]) {\n\t\t\tagentRequests.value[workflowId][nodeId] = { query: {} };\n\t\t}\n\t};\n\n\tconst clearAllAgentRequests = (workflowId?: string): void => {\n\t\tif (workflowId) {\n\t\t\tagentRequests.value[workflowId] = {};\n\t\t} else {\n\t\t\tagentRequests.value = {};\n\t\t}\n\t};\n\n\tconst getAgentRequest = (workflowId: string, nodeId: string): IAgentRequest | undefined => {\n\t\tif (agentRequests.value[workflowId]) return agentRequests.value[workflowId]?.[nodeId];\n\t\treturn undefined;\n\t};\n\n\treturn {\n\t\tagentRequests,\n\t\tgetAgentRequests,\n\t\tgetQueryValue,\n\t\tsetAgentRequestForNode,\n\t\tclearAgentRequests,\n\t\tclearAllAgentRequests,\n\t\tgetAgentRequest,\n\t};\n});\n"]}
1
+ {"version":3,"file":"useAgentRequestStore.cjs","names":[],"sources":["../src/useAgentRequestStore.ts"],"sourcesContent":["import { useLocalStorage } from '@vueuse/core';\nimport type { INodeParameters, NodeParameterValueType } from 'n8n-workflow';\nimport { defineStore } from 'pinia';\n\nconst LOCAL_STORAGE_AGENT_REQUESTS = 'N8N_AGENT_REQUESTS';\n\nexport interface IAgentRequest {\n\tquery: INodeParameters | string;\n\ttoolName?: string;\n}\n\nexport interface IAgentRequestStoreState {\n\t[workflowId: string]: {\n\t\t[nodeName: string]: IAgentRequest;\n\t};\n}\n\nexport const useAgentRequestStore = defineStore('agentRequest', () => {\n\t// State\n\tconst agentRequests = useLocalStorage<IAgentRequestStoreState>(LOCAL_STORAGE_AGENT_REQUESTS, {});\n\n\t// Helper function to ensure workflow and node entries exist\n\tconst ensureWorkflowAndNodeExist = (workflowId: string, nodeId: string): void => {\n\t\tif (!agentRequests.value[workflowId]) {\n\t\t\tagentRequests.value[workflowId] = {};\n\t\t}\n\n\t\tif (!agentRequests.value[workflowId][nodeId]) {\n\t\t\tagentRequests.value[workflowId][nodeId] = { query: {} };\n\t\t}\n\t};\n\n\t// Getters\n\tconst getAgentRequests = (workflowId: string, nodeId: string): INodeParameters | string => {\n\t\treturn agentRequests.value[workflowId]?.[nodeId]?.query || {};\n\t};\n\n\tconst getQueryValue = (\n\t\tworkflowId: string,\n\t\tnodeId: string,\n\t\tparamName: string,\n\t): NodeParameterValueType | undefined => {\n\t\tconst query = agentRequests.value[workflowId]?.[nodeId]?.query;\n\t\tif (typeof query === 'string') {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn query?.[paramName];\n\t};\n\n\tconst setAgentRequestForNode = (\n\t\tworkflowId: string,\n\t\tnodeId: string,\n\t\trequest: IAgentRequest,\n\t): void => {\n\t\tensureWorkflowAndNodeExist(workflowId, nodeId);\n\n\t\tagentRequests.value[workflowId][nodeId] = {\n\t\t\t...request,\n\t\t\tquery: typeof request.query === 'string' ? request.query : { ...request.query },\n\t\t};\n\t};\n\n\tconst clearAgentRequests = (workflowId: string, nodeId: string): void => {\n\t\tif (agentRequests.value[workflowId]) {\n\t\t\tagentRequests.value[workflowId][nodeId] = { query: {} };\n\t\t}\n\t};\n\n\tconst clearAllAgentRequests = (workflowId?: string): void => {\n\t\tif (workflowId) {\n\t\t\tagentRequests.value[workflowId] = {};\n\t\t} else {\n\t\t\tagentRequests.value = {};\n\t\t}\n\t};\n\n\tconst getAgentRequest = (workflowId: string, nodeId: string): IAgentRequest | undefined => {\n\t\tif (agentRequests.value[workflowId]) return agentRequests.value[workflowId]?.[nodeId];\n\t\treturn undefined;\n\t};\n\n\treturn {\n\t\tagentRequests,\n\t\tgetAgentRequests,\n\t\tgetQueryValue,\n\t\tsetAgentRequestForNode,\n\t\tclearAgentRequests,\n\t\tclearAllAgentRequests,\n\t\tgetAgentRequest,\n\t};\n});\n"],"mappings":";;;;;;;AAIA,MAAM,+BAA+B;AAarC,MAAa,8CAAmC,sBAAsB;CAErE,MAAM,mDAAyD,8BAA8B,EAAE,CAAC;CAGhG,MAAM,8BAA8B,YAAoB,WAAyB;AAChF,MAAI,CAAC,cAAc,MAAM,YACxB,eAAc,MAAM,cAAc,EAAE;AAGrC,MAAI,CAAC,cAAc,MAAM,YAAY,QACpC,eAAc,MAAM,YAAY,UAAU,EAAE,OAAO,EAAE,EAAE;;CAKzD,MAAM,oBAAoB,YAAoB,WAA6C;AAC1F,SAAO,cAAc,MAAM,cAAc,SAAS,SAAS,EAAE;;CAG9D,MAAM,iBACL,YACA,QACA,cACwC;EACxC,MAAM,QAAQ,cAAc,MAAM,cAAc,SAAS;AACzD,MAAI,OAAO,UAAU,SACpB;AAED,SAAO,QAAQ;;CAGhB,MAAM,0BACL,YACA,QACA,YACU;AACV,6BAA2B,YAAY,OAAO;AAE9C,gBAAc,MAAM,YAAY,UAAU;GACzC,GAAG;GACH,OAAO,OAAO,QAAQ,UAAU,WAAW,QAAQ,QAAQ,EAAE,GAAG,QAAQ,OAAO;GAC/E;;CAGF,MAAM,sBAAsB,YAAoB,WAAyB;AACxE,MAAI,cAAc,MAAM,YACvB,eAAc,MAAM,YAAY,UAAU,EAAE,OAAO,EAAE,EAAE;;CAIzD,MAAM,yBAAyB,eAA8B;AAC5D,MAAI,WACH,eAAc,MAAM,cAAc,EAAE;MAEpC,eAAc,QAAQ,EAAE;;CAI1B,MAAM,mBAAmB,YAAoB,WAA8C;AAC1F,MAAI,cAAc,MAAM,YAAa,QAAO,cAAc,MAAM,cAAc;;AAI/E,QAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA"}
@@ -1,40 +1,42 @@
1
- import * as pinia from 'pinia';
2
- import * as _vueuse_core from '@vueuse/core';
3
- import { INodeParameters, NodeParameterValueType } from 'n8n-workflow';
1
+ import * as _vueuse_core0 from "@vueuse/core";
2
+ import * as pinia0 from "pinia";
3
+ import { INodeParameters, NodeParameterValueType } from "n8n-workflow";
4
4
 
5
+ //#region src/useAgentRequestStore.d.ts
5
6
  interface IAgentRequest {
6
- query: INodeParameters | string;
7
- toolName?: string;
7
+ query: INodeParameters | string;
8
+ toolName?: string;
8
9
  }
9
10
  interface IAgentRequestStoreState {
10
- [workflowId: string]: {
11
- [nodeName: string]: IAgentRequest;
12
- };
11
+ [workflowId: string]: {
12
+ [nodeName: string]: IAgentRequest;
13
+ };
13
14
  }
14
- declare const useAgentRequestStore: pinia.StoreDefinition<"agentRequest", Pick<{
15
- agentRequests: _vueuse_core.RemovableRef<IAgentRequestStoreState>;
16
- getAgentRequests: (workflowId: string, nodeId: string) => INodeParameters | string;
17
- getQueryValue: (workflowId: string, nodeId: string, paramName: string) => NodeParameterValueType | undefined;
18
- setAgentRequestForNode: (workflowId: string, nodeId: string, request: IAgentRequest) => void;
19
- clearAgentRequests: (workflowId: string, nodeId: string) => void;
20
- clearAllAgentRequests: (workflowId?: string) => void;
21
- getAgentRequest: (workflowId: string, nodeId: string) => IAgentRequest | undefined;
15
+ declare const useAgentRequestStore: pinia0.StoreDefinition<"agentRequest", Pick<{
16
+ agentRequests: _vueuse_core0.RemovableRef<IAgentRequestStoreState>;
17
+ getAgentRequests: (workflowId: string, nodeId: string) => INodeParameters | string;
18
+ getQueryValue: (workflowId: string, nodeId: string, paramName: string) => NodeParameterValueType | undefined;
19
+ setAgentRequestForNode: (workflowId: string, nodeId: string, request: IAgentRequest) => void;
20
+ clearAgentRequests: (workflowId: string, nodeId: string) => void;
21
+ clearAllAgentRequests: (workflowId?: string) => void;
22
+ getAgentRequest: (workflowId: string, nodeId: string) => IAgentRequest | undefined;
22
23
  }, "agentRequests">, Pick<{
23
- agentRequests: _vueuse_core.RemovableRef<IAgentRequestStoreState>;
24
- getAgentRequests: (workflowId: string, nodeId: string) => INodeParameters | string;
25
- getQueryValue: (workflowId: string, nodeId: string, paramName: string) => NodeParameterValueType | undefined;
26
- setAgentRequestForNode: (workflowId: string, nodeId: string, request: IAgentRequest) => void;
27
- clearAgentRequests: (workflowId: string, nodeId: string) => void;
28
- clearAllAgentRequests: (workflowId?: string) => void;
29
- getAgentRequest: (workflowId: string, nodeId: string) => IAgentRequest | undefined;
24
+ agentRequests: _vueuse_core0.RemovableRef<IAgentRequestStoreState>;
25
+ getAgentRequests: (workflowId: string, nodeId: string) => INodeParameters | string;
26
+ getQueryValue: (workflowId: string, nodeId: string, paramName: string) => NodeParameterValueType | undefined;
27
+ setAgentRequestForNode: (workflowId: string, nodeId: string, request: IAgentRequest) => void;
28
+ clearAgentRequests: (workflowId: string, nodeId: string) => void;
29
+ clearAllAgentRequests: (workflowId?: string) => void;
30
+ getAgentRequest: (workflowId: string, nodeId: string) => IAgentRequest | undefined;
30
31
  }, never>, Pick<{
31
- agentRequests: _vueuse_core.RemovableRef<IAgentRequestStoreState>;
32
- getAgentRequests: (workflowId: string, nodeId: string) => INodeParameters | string;
33
- getQueryValue: (workflowId: string, nodeId: string, paramName: string) => NodeParameterValueType | undefined;
34
- setAgentRequestForNode: (workflowId: string, nodeId: string, request: IAgentRequest) => void;
35
- clearAgentRequests: (workflowId: string, nodeId: string) => void;
36
- clearAllAgentRequests: (workflowId?: string) => void;
37
- getAgentRequest: (workflowId: string, nodeId: string) => IAgentRequest | undefined;
32
+ agentRequests: _vueuse_core0.RemovableRef<IAgentRequestStoreState>;
33
+ getAgentRequests: (workflowId: string, nodeId: string) => INodeParameters | string;
34
+ getQueryValue: (workflowId: string, nodeId: string, paramName: string) => NodeParameterValueType | undefined;
35
+ setAgentRequestForNode: (workflowId: string, nodeId: string, request: IAgentRequest) => void;
36
+ clearAgentRequests: (workflowId: string, nodeId: string) => void;
37
+ clearAllAgentRequests: (workflowId?: string) => void;
38
+ getAgentRequest: (workflowId: string, nodeId: string) => IAgentRequest | undefined;
38
39
  }, "getAgentRequests" | "getQueryValue" | "setAgentRequestForNode" | "clearAgentRequests" | "clearAllAgentRequests" | "getAgentRequest">>;
39
-
40
- export { type IAgentRequest, type IAgentRequestStoreState, useAgentRequestStore };
40
+ //#endregion
41
+ export { IAgentRequest, IAgentRequestStoreState, useAgentRequestStore };
42
+ //# sourceMappingURL=useAgentRequestStore.d.cts.map
@@ -1,40 +1,42 @@
1
- import * as pinia from 'pinia';
2
- import * as _vueuse_core from '@vueuse/core';
3
- import { INodeParameters, NodeParameterValueType } from 'n8n-workflow';
1
+ import * as _vueuse_core0 from "@vueuse/core";
2
+ import * as pinia0 from "pinia";
3
+ import { INodeParameters, NodeParameterValueType } from "n8n-workflow";
4
4
 
5
+ //#region src/useAgentRequestStore.d.ts
5
6
  interface IAgentRequest {
6
- query: INodeParameters | string;
7
- toolName?: string;
7
+ query: INodeParameters | string;
8
+ toolName?: string;
8
9
  }
9
10
  interface IAgentRequestStoreState {
10
- [workflowId: string]: {
11
- [nodeName: string]: IAgentRequest;
12
- };
11
+ [workflowId: string]: {
12
+ [nodeName: string]: IAgentRequest;
13
+ };
13
14
  }
14
- declare const useAgentRequestStore: pinia.StoreDefinition<"agentRequest", Pick<{
15
- agentRequests: _vueuse_core.RemovableRef<IAgentRequestStoreState>;
16
- getAgentRequests: (workflowId: string, nodeId: string) => INodeParameters | string;
17
- getQueryValue: (workflowId: string, nodeId: string, paramName: string) => NodeParameterValueType | undefined;
18
- setAgentRequestForNode: (workflowId: string, nodeId: string, request: IAgentRequest) => void;
19
- clearAgentRequests: (workflowId: string, nodeId: string) => void;
20
- clearAllAgentRequests: (workflowId?: string) => void;
21
- getAgentRequest: (workflowId: string, nodeId: string) => IAgentRequest | undefined;
15
+ declare const useAgentRequestStore: pinia0.StoreDefinition<"agentRequest", Pick<{
16
+ agentRequests: _vueuse_core0.RemovableRef<IAgentRequestStoreState>;
17
+ getAgentRequests: (workflowId: string, nodeId: string) => INodeParameters | string;
18
+ getQueryValue: (workflowId: string, nodeId: string, paramName: string) => NodeParameterValueType | undefined;
19
+ setAgentRequestForNode: (workflowId: string, nodeId: string, request: IAgentRequest) => void;
20
+ clearAgentRequests: (workflowId: string, nodeId: string) => void;
21
+ clearAllAgentRequests: (workflowId?: string) => void;
22
+ getAgentRequest: (workflowId: string, nodeId: string) => IAgentRequest | undefined;
22
23
  }, "agentRequests">, Pick<{
23
- agentRequests: _vueuse_core.RemovableRef<IAgentRequestStoreState>;
24
- getAgentRequests: (workflowId: string, nodeId: string) => INodeParameters | string;
25
- getQueryValue: (workflowId: string, nodeId: string, paramName: string) => NodeParameterValueType | undefined;
26
- setAgentRequestForNode: (workflowId: string, nodeId: string, request: IAgentRequest) => void;
27
- clearAgentRequests: (workflowId: string, nodeId: string) => void;
28
- clearAllAgentRequests: (workflowId?: string) => void;
29
- getAgentRequest: (workflowId: string, nodeId: string) => IAgentRequest | undefined;
24
+ agentRequests: _vueuse_core0.RemovableRef<IAgentRequestStoreState>;
25
+ getAgentRequests: (workflowId: string, nodeId: string) => INodeParameters | string;
26
+ getQueryValue: (workflowId: string, nodeId: string, paramName: string) => NodeParameterValueType | undefined;
27
+ setAgentRequestForNode: (workflowId: string, nodeId: string, request: IAgentRequest) => void;
28
+ clearAgentRequests: (workflowId: string, nodeId: string) => void;
29
+ clearAllAgentRequests: (workflowId?: string) => void;
30
+ getAgentRequest: (workflowId: string, nodeId: string) => IAgentRequest | undefined;
30
31
  }, never>, Pick<{
31
- agentRequests: _vueuse_core.RemovableRef<IAgentRequestStoreState>;
32
- getAgentRequests: (workflowId: string, nodeId: string) => INodeParameters | string;
33
- getQueryValue: (workflowId: string, nodeId: string, paramName: string) => NodeParameterValueType | undefined;
34
- setAgentRequestForNode: (workflowId: string, nodeId: string, request: IAgentRequest) => void;
35
- clearAgentRequests: (workflowId: string, nodeId: string) => void;
36
- clearAllAgentRequests: (workflowId?: string) => void;
37
- getAgentRequest: (workflowId: string, nodeId: string) => IAgentRequest | undefined;
32
+ agentRequests: _vueuse_core0.RemovableRef<IAgentRequestStoreState>;
33
+ getAgentRequests: (workflowId: string, nodeId: string) => INodeParameters | string;
34
+ getQueryValue: (workflowId: string, nodeId: string, paramName: string) => NodeParameterValueType | undefined;
35
+ setAgentRequestForNode: (workflowId: string, nodeId: string, request: IAgentRequest) => void;
36
+ clearAgentRequests: (workflowId: string, nodeId: string) => void;
37
+ clearAllAgentRequests: (workflowId?: string) => void;
38
+ getAgentRequest: (workflowId: string, nodeId: string) => IAgentRequest | undefined;
38
39
  }, "getAgentRequests" | "getQueryValue" | "setAgentRequestForNode" | "clearAgentRequests" | "clearAllAgentRequests" | "getAgentRequest">>;
39
-
40
- export { type IAgentRequest, type IAgentRequestStoreState, useAgentRequestStore };
40
+ //#endregion
41
+ export { IAgentRequest, IAgentRequestStoreState, useAgentRequestStore };
42
+ //# sourceMappingURL=useAgentRequestStore.d.ts.map
@@ -1,61 +1,50 @@
1
- // src/useAgentRequestStore.ts
2
1
  import { useLocalStorage } from "@vueuse/core";
3
2
  import { defineStore } from "pinia";
4
- var LOCAL_STORAGE_AGENT_REQUESTS = "N8N_AGENT_REQUESTS";
5
- var useAgentRequestStore = defineStore("agentRequest", () => {
6
- const agentRequests = useLocalStorage(LOCAL_STORAGE_AGENT_REQUESTS, {});
7
- const ensureWorkflowAndNodeExist = (workflowId, nodeId) => {
8
- if (!agentRequests.value[workflowId]) {
9
- agentRequests.value[workflowId] = {};
10
- }
11
- if (!agentRequests.value[workflowId][nodeId]) {
12
- agentRequests.value[workflowId][nodeId] = { query: {} };
13
- }
14
- };
15
- const getAgentRequests = (workflowId, nodeId) => {
16
- return agentRequests.value[workflowId]?.[nodeId]?.query || {};
17
- };
18
- const getQueryValue = (workflowId, nodeId, paramName) => {
19
- const query = agentRequests.value[workflowId]?.[nodeId]?.query;
20
- if (typeof query === "string") {
21
- return void 0;
22
- }
23
- return query?.[paramName];
24
- };
25
- const setAgentRequestForNode = (workflowId, nodeId, request) => {
26
- ensureWorkflowAndNodeExist(workflowId, nodeId);
27
- agentRequests.value[workflowId][nodeId] = {
28
- ...request,
29
- query: typeof request.query === "string" ? request.query : { ...request.query }
30
- };
31
- };
32
- const clearAgentRequests = (workflowId, nodeId) => {
33
- if (agentRequests.value[workflowId]) {
34
- agentRequests.value[workflowId][nodeId] = { query: {} };
35
- }
36
- };
37
- const clearAllAgentRequests = (workflowId) => {
38
- if (workflowId) {
39
- agentRequests.value[workflowId] = {};
40
- } else {
41
- agentRequests.value = {};
42
- }
43
- };
44
- const getAgentRequest = (workflowId, nodeId) => {
45
- if (agentRequests.value[workflowId]) return agentRequests.value[workflowId]?.[nodeId];
46
- return void 0;
47
- };
48
- return {
49
- agentRequests,
50
- getAgentRequests,
51
- getQueryValue,
52
- setAgentRequestForNode,
53
- clearAgentRequests,
54
- clearAllAgentRequests,
55
- getAgentRequest
56
- };
3
+
4
+ //#region src/useAgentRequestStore.ts
5
+ const LOCAL_STORAGE_AGENT_REQUESTS = "N8N_AGENT_REQUESTS";
6
+ const useAgentRequestStore = defineStore("agentRequest", () => {
7
+ const agentRequests = useLocalStorage(LOCAL_STORAGE_AGENT_REQUESTS, {});
8
+ const ensureWorkflowAndNodeExist = (workflowId, nodeId) => {
9
+ if (!agentRequests.value[workflowId]) agentRequests.value[workflowId] = {};
10
+ if (!agentRequests.value[workflowId][nodeId]) agentRequests.value[workflowId][nodeId] = { query: {} };
11
+ };
12
+ const getAgentRequests = (workflowId, nodeId) => {
13
+ return agentRequests.value[workflowId]?.[nodeId]?.query || {};
14
+ };
15
+ const getQueryValue = (workflowId, nodeId, paramName) => {
16
+ const query = agentRequests.value[workflowId]?.[nodeId]?.query;
17
+ if (typeof query === "string") return;
18
+ return query?.[paramName];
19
+ };
20
+ const setAgentRequestForNode = (workflowId, nodeId, request) => {
21
+ ensureWorkflowAndNodeExist(workflowId, nodeId);
22
+ agentRequests.value[workflowId][nodeId] = {
23
+ ...request,
24
+ query: typeof request.query === "string" ? request.query : { ...request.query }
25
+ };
26
+ };
27
+ const clearAgentRequests = (workflowId, nodeId) => {
28
+ if (agentRequests.value[workflowId]) agentRequests.value[workflowId][nodeId] = { query: {} };
29
+ };
30
+ const clearAllAgentRequests = (workflowId) => {
31
+ if (workflowId) agentRequests.value[workflowId] = {};
32
+ else agentRequests.value = {};
33
+ };
34
+ const getAgentRequest = (workflowId, nodeId) => {
35
+ if (agentRequests.value[workflowId]) return agentRequests.value[workflowId]?.[nodeId];
36
+ };
37
+ return {
38
+ agentRequests,
39
+ getAgentRequests,
40
+ getQueryValue,
41
+ setAgentRequestForNode,
42
+ clearAgentRequests,
43
+ clearAllAgentRequests,
44
+ getAgentRequest
45
+ };
57
46
  });
58
- export {
59
- useAgentRequestStore
60
- };
47
+
48
+ //#endregion
49
+ export { useAgentRequestStore };
61
50
  //# sourceMappingURL=useAgentRequestStore.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/useAgentRequestStore.ts"],"sourcesContent":["import { useLocalStorage } from '@vueuse/core';\nimport type { INodeParameters, NodeParameterValueType } from 'n8n-workflow';\nimport { defineStore } from 'pinia';\n\nconst LOCAL_STORAGE_AGENT_REQUESTS = 'N8N_AGENT_REQUESTS';\n\nexport interface IAgentRequest {\n\tquery: INodeParameters | string;\n\ttoolName?: string;\n}\n\nexport interface IAgentRequestStoreState {\n\t[workflowId: string]: {\n\t\t[nodeName: string]: IAgentRequest;\n\t};\n}\n\nexport const useAgentRequestStore = defineStore('agentRequest', () => {\n\t// State\n\tconst agentRequests = useLocalStorage<IAgentRequestStoreState>(LOCAL_STORAGE_AGENT_REQUESTS, {});\n\n\t// Helper function to ensure workflow and node entries exist\n\tconst ensureWorkflowAndNodeExist = (workflowId: string, nodeId: string): void => {\n\t\tif (!agentRequests.value[workflowId]) {\n\t\t\tagentRequests.value[workflowId] = {};\n\t\t}\n\n\t\tif (!agentRequests.value[workflowId][nodeId]) {\n\t\t\tagentRequests.value[workflowId][nodeId] = { query: {} };\n\t\t}\n\t};\n\n\t// Getters\n\tconst getAgentRequests = (workflowId: string, nodeId: string): INodeParameters | string => {\n\t\treturn agentRequests.value[workflowId]?.[nodeId]?.query || {};\n\t};\n\n\tconst getQueryValue = (\n\t\tworkflowId: string,\n\t\tnodeId: string,\n\t\tparamName: string,\n\t): NodeParameterValueType | undefined => {\n\t\tconst query = agentRequests.value[workflowId]?.[nodeId]?.query;\n\t\tif (typeof query === 'string') {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn query?.[paramName];\n\t};\n\n\tconst setAgentRequestForNode = (\n\t\tworkflowId: string,\n\t\tnodeId: string,\n\t\trequest: IAgentRequest,\n\t): void => {\n\t\tensureWorkflowAndNodeExist(workflowId, nodeId);\n\n\t\tagentRequests.value[workflowId][nodeId] = {\n\t\t\t...request,\n\t\t\tquery: typeof request.query === 'string' ? request.query : { ...request.query },\n\t\t};\n\t};\n\n\tconst clearAgentRequests = (workflowId: string, nodeId: string): void => {\n\t\tif (agentRequests.value[workflowId]) {\n\t\t\tagentRequests.value[workflowId][nodeId] = { query: {} };\n\t\t}\n\t};\n\n\tconst clearAllAgentRequests = (workflowId?: string): void => {\n\t\tif (workflowId) {\n\t\t\tagentRequests.value[workflowId] = {};\n\t\t} else {\n\t\t\tagentRequests.value = {};\n\t\t}\n\t};\n\n\tconst getAgentRequest = (workflowId: string, nodeId: string): IAgentRequest | undefined => {\n\t\tif (agentRequests.value[workflowId]) return agentRequests.value[workflowId]?.[nodeId];\n\t\treturn undefined;\n\t};\n\n\treturn {\n\t\tagentRequests,\n\t\tgetAgentRequests,\n\t\tgetQueryValue,\n\t\tsetAgentRequestForNode,\n\t\tclearAgentRequests,\n\t\tclearAllAgentRequests,\n\t\tgetAgentRequest,\n\t};\n});\n"],"mappings":";AAAA,SAAS,uBAAuB;AAEhC,SAAS,mBAAmB;AAE5B,IAAM,+BAA+B;AAa9B,IAAM,uBAAuB,YAAY,gBAAgB,MAAM;AAErE,QAAM,gBAAgB,gBAAyC,8BAA8B,CAAC,CAAC;AAG/F,QAAM,6BAA6B,CAAC,YAAoB,WAAyB;AAChF,QAAI,CAAC,cAAc,MAAM,UAAU,GAAG;AACrC,oBAAc,MAAM,UAAU,IAAI,CAAC;AAAA,IACpC;AAEA,QAAI,CAAC,cAAc,MAAM,UAAU,EAAE,MAAM,GAAG;AAC7C,oBAAc,MAAM,UAAU,EAAE,MAAM,IAAI,EAAE,OAAO,CAAC,EAAE;AAAA,IACvD;AAAA,EACD;AAGA,QAAM,mBAAmB,CAAC,YAAoB,WAA6C;AAC1F,WAAO,cAAc,MAAM,UAAU,IAAI,MAAM,GAAG,SAAS,CAAC;AAAA,EAC7D;AAEA,QAAM,gBAAgB,CACrB,YACA,QACA,cACwC;AACxC,UAAM,QAAQ,cAAc,MAAM,UAAU,IAAI,MAAM,GAAG;AACzD,QAAI,OAAO,UAAU,UAAU;AAC9B,aAAO;AAAA,IACR;AACA,WAAO,QAAQ,SAAS;AAAA,EACzB;AAEA,QAAM,yBAAyB,CAC9B,YACA,QACA,YACU;AACV,+BAA2B,YAAY,MAAM;AAE7C,kBAAc,MAAM,UAAU,EAAE,MAAM,IAAI;AAAA,MACzC,GAAG;AAAA,MACH,OAAO,OAAO,QAAQ,UAAU,WAAW,QAAQ,QAAQ,EAAE,GAAG,QAAQ,MAAM;AAAA,IAC/E;AAAA,EACD;AAEA,QAAM,qBAAqB,CAAC,YAAoB,WAAyB;AACxE,QAAI,cAAc,MAAM,UAAU,GAAG;AACpC,oBAAc,MAAM,UAAU,EAAE,MAAM,IAAI,EAAE,OAAO,CAAC,EAAE;AAAA,IACvD;AAAA,EACD;AAEA,QAAM,wBAAwB,CAAC,eAA8B;AAC5D,QAAI,YAAY;AACf,oBAAc,MAAM,UAAU,IAAI,CAAC;AAAA,IACpC,OAAO;AACN,oBAAc,QAAQ,CAAC;AAAA,IACxB;AAAA,EACD;AAEA,QAAM,kBAAkB,CAAC,YAAoB,WAA8C;AAC1F,QAAI,cAAc,MAAM,UAAU,EAAG,QAAO,cAAc,MAAM,UAAU,IAAI,MAAM;AACpF,WAAO;AAAA,EACR;AAEA,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD,CAAC;","names":[]}
1
+ {"version":3,"file":"useAgentRequestStore.js","names":[],"sources":["../src/useAgentRequestStore.ts"],"sourcesContent":["import { useLocalStorage } from '@vueuse/core';\nimport type { INodeParameters, NodeParameterValueType } from 'n8n-workflow';\nimport { defineStore } from 'pinia';\n\nconst LOCAL_STORAGE_AGENT_REQUESTS = 'N8N_AGENT_REQUESTS';\n\nexport interface IAgentRequest {\n\tquery: INodeParameters | string;\n\ttoolName?: string;\n}\n\nexport interface IAgentRequestStoreState {\n\t[workflowId: string]: {\n\t\t[nodeName: string]: IAgentRequest;\n\t};\n}\n\nexport const useAgentRequestStore = defineStore('agentRequest', () => {\n\t// State\n\tconst agentRequests = useLocalStorage<IAgentRequestStoreState>(LOCAL_STORAGE_AGENT_REQUESTS, {});\n\n\t// Helper function to ensure workflow and node entries exist\n\tconst ensureWorkflowAndNodeExist = (workflowId: string, nodeId: string): void => {\n\t\tif (!agentRequests.value[workflowId]) {\n\t\t\tagentRequests.value[workflowId] = {};\n\t\t}\n\n\t\tif (!agentRequests.value[workflowId][nodeId]) {\n\t\t\tagentRequests.value[workflowId][nodeId] = { query: {} };\n\t\t}\n\t};\n\n\t// Getters\n\tconst getAgentRequests = (workflowId: string, nodeId: string): INodeParameters | string => {\n\t\treturn agentRequests.value[workflowId]?.[nodeId]?.query || {};\n\t};\n\n\tconst getQueryValue = (\n\t\tworkflowId: string,\n\t\tnodeId: string,\n\t\tparamName: string,\n\t): NodeParameterValueType | undefined => {\n\t\tconst query = agentRequests.value[workflowId]?.[nodeId]?.query;\n\t\tif (typeof query === 'string') {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn query?.[paramName];\n\t};\n\n\tconst setAgentRequestForNode = (\n\t\tworkflowId: string,\n\t\tnodeId: string,\n\t\trequest: IAgentRequest,\n\t): void => {\n\t\tensureWorkflowAndNodeExist(workflowId, nodeId);\n\n\t\tagentRequests.value[workflowId][nodeId] = {\n\t\t\t...request,\n\t\t\tquery: typeof request.query === 'string' ? request.query : { ...request.query },\n\t\t};\n\t};\n\n\tconst clearAgentRequests = (workflowId: string, nodeId: string): void => {\n\t\tif (agentRequests.value[workflowId]) {\n\t\t\tagentRequests.value[workflowId][nodeId] = { query: {} };\n\t\t}\n\t};\n\n\tconst clearAllAgentRequests = (workflowId?: string): void => {\n\t\tif (workflowId) {\n\t\t\tagentRequests.value[workflowId] = {};\n\t\t} else {\n\t\t\tagentRequests.value = {};\n\t\t}\n\t};\n\n\tconst getAgentRequest = (workflowId: string, nodeId: string): IAgentRequest | undefined => {\n\t\tif (agentRequests.value[workflowId]) return agentRequests.value[workflowId]?.[nodeId];\n\t\treturn undefined;\n\t};\n\n\treturn {\n\t\tagentRequests,\n\t\tgetAgentRequests,\n\t\tgetQueryValue,\n\t\tsetAgentRequestForNode,\n\t\tclearAgentRequests,\n\t\tclearAllAgentRequests,\n\t\tgetAgentRequest,\n\t};\n});\n"],"mappings":";;;;AAIA,MAAM,+BAA+B;AAarC,MAAa,uBAAuB,YAAY,sBAAsB;CAErE,MAAM,gBAAgB,gBAAyC,8BAA8B,EAAE,CAAC;CAGhG,MAAM,8BAA8B,YAAoB,WAAyB;AAChF,MAAI,CAAC,cAAc,MAAM,YACxB,eAAc,MAAM,cAAc,EAAE;AAGrC,MAAI,CAAC,cAAc,MAAM,YAAY,QACpC,eAAc,MAAM,YAAY,UAAU,EAAE,OAAO,EAAE,EAAE;;CAKzD,MAAM,oBAAoB,YAAoB,WAA6C;AAC1F,SAAO,cAAc,MAAM,cAAc,SAAS,SAAS,EAAE;;CAG9D,MAAM,iBACL,YACA,QACA,cACwC;EACxC,MAAM,QAAQ,cAAc,MAAM,cAAc,SAAS;AACzD,MAAI,OAAO,UAAU,SACpB;AAED,SAAO,QAAQ;;CAGhB,MAAM,0BACL,YACA,QACA,YACU;AACV,6BAA2B,YAAY,OAAO;AAE9C,gBAAc,MAAM,YAAY,UAAU;GACzC,GAAG;GACH,OAAO,OAAO,QAAQ,UAAU,WAAW,QAAQ,QAAQ,EAAE,GAAG,QAAQ,OAAO;GAC/E;;CAGF,MAAM,sBAAsB,YAAoB,WAAyB;AACxE,MAAI,cAAc,MAAM,YACvB,eAAc,MAAM,YAAY,UAAU,EAAE,OAAO,EAAE,EAAE;;CAIzD,MAAM,yBAAyB,eAA8B;AAC5D,MAAI,WACH,eAAc,MAAM,cAAc,EAAE;MAEpC,eAAc,QAAQ,EAAE;;CAI1B,MAAM,mBAAmB,YAAoB,WAA8C;AAC1F,MAAI,cAAc,MAAM,YAAa,QAAO,cAAc,MAAM,cAAc;;AAI/E,QAAO;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA"}