snow-flow 3.0.9 → 3.0.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 (302) hide show
  1. package/claude-flow.bat +0 -0
  2. package/claude-flow.ps1 +0 -0
  3. package/dist/mcp/intelligent-reporting-mcp.d.ts +7 -0
  4. package/dist/mcp/intelligent-reporting-mcp.js +379 -0
  5. package/dist/mcp/servicenow-automation-mcp.js +0 -0
  6. package/dist/mcp/servicenow-deployment-mcp.js +0 -0
  7. package/dist/mcp/servicenow-integration-mcp.js +0 -0
  8. package/dist/mcp/servicenow-mcp-server.js +0 -0
  9. package/dist/mcp/servicenow-operations-mcp.js +0 -0
  10. package/dist/mcp/servicenow-platform-development-mcp.js +0 -0
  11. package/dist/mcp/servicenow-progressive-indexer.js +0 -0
  12. package/dist/mcp/servicenow-reporting-analytics-mcp.js +280 -29
  13. package/dist/mcp/servicenow-security-compliance-mcp.js +0 -0
  14. package/dist/mcp/servicenow-update-set-mcp.js +0 -0
  15. package/dist/mcp/start-all-mcp-servers.js +0 -0
  16. package/dist/mcp/start-servicenow-mcp.js +0 -0
  17. package/dist/services/widget-deployment-service.d.ts +2 -1
  18. package/dist/services/widget-deployment-service.js +17 -16
  19. package/dist/utils/anti-mock-data-validator.d.ts +66 -0
  20. package/dist/utils/anti-mock-data-validator.js +316 -0
  21. package/dist/utils/servicenow-eventual-consistency.d.ts +120 -0
  22. package/dist/utils/servicenow-eventual-consistency.js +220 -0
  23. package/memory/agents/README.md +1 -1
  24. package/memory/claude-flow-data.json +1 -1
  25. package/memory/sessions/README.md +1 -1
  26. package/package.json +4 -3
  27. package/.mcp.json +0 -22
  28. package/claude-flow.config.json +0 -20
  29. package/dist/agents/app-creator.agent.d.ts +0 -55
  30. package/dist/agents/app-creator.agent.js +0 -1292
  31. package/dist/agents/base/base-snow-agent.d.ts +0 -75
  32. package/dist/agents/base/base-snow-agent.js +0 -169
  33. package/dist/agents/base-snow-agent.d.ts +0 -63
  34. package/dist/agents/base-snow-agent.js +0 -296
  35. package/dist/agents/coordinator.d.ts +0 -200
  36. package/dist/agents/coordinator.js +0 -777
  37. package/dist/agents/flow-builder-agent.d.ts +0 -18
  38. package/dist/agents/flow-builder-agent.js +0 -197
  39. package/dist/agents/queen-403-handler.d.ts +0 -47
  40. package/dist/agents/queen-403-handler.js +0 -175
  41. package/dist/agents/queen-agent-example.d.ts +0 -23
  42. package/dist/agents/queen-agent-example.js +0 -240
  43. package/dist/agents/queen-agent.test.d.ts +0 -6
  44. package/dist/agents/script-generator.agent.d.ts +0 -32
  45. package/dist/agents/script-generator.agent.js +0 -772
  46. package/dist/agents/script-writer-agent.d.ts +0 -22
  47. package/dist/agents/script-writer-agent.js +0 -695
  48. package/dist/agents/security-agent.d.ts +0 -23
  49. package/dist/agents/security-agent.js +0 -619
  50. package/dist/agents/specialists/automation-specialist.agent.d.ts +0 -44
  51. package/dist/agents/specialists/automation-specialist.agent.js +0 -204
  52. package/dist/agents/specialists/data-specialist.agent.d.ts +0 -165
  53. package/dist/agents/specialists/data-specialist.agent.js +0 -484
  54. package/dist/agents/specialists/integration-specialist.agent.d.ts +0 -227
  55. package/dist/agents/specialists/integration-specialist.agent.js +0 -725
  56. package/dist/agents/specialists/reporting-specialist.agent.d.ts +0 -54
  57. package/dist/agents/specialists/reporting-specialist.agent.js +0 -193
  58. package/dist/agents/specialists/security-specialist.agent.d.ts +0 -85
  59. package/dist/agents/specialists/security-specialist.agent.js +0 -309
  60. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.d.ts +0 -111
  61. package/dist/agents/teams/adaptive/adaptive-coordinator.agent.js +0 -383
  62. package/dist/agents/teams/base-team.d.ts +0 -72
  63. package/dist/agents/teams/base-team.js +0 -253
  64. package/dist/agents/teams/team-types.d.ts +0 -265
  65. package/dist/agents/teams/team-types.js +0 -3
  66. package/dist/agents/teams/widget/widget-architect.agent.d.ts +0 -61
  67. package/dist/agents/teams/widget/widget-architect.agent.js +0 -436
  68. package/dist/agents/teams/widget/widget-backend.agent.d.ts +0 -74
  69. package/dist/agents/teams/widget/widget-backend.agent.js +0 -1531
  70. package/dist/agents/teams/widget/widget-frontend.agent.d.ts +0 -67
  71. package/dist/agents/teams/widget/widget-frontend.agent.js +0 -1014
  72. package/dist/agents/teams/widget/widget-platform.agent.d.ts +0 -90
  73. package/dist/agents/teams/widget/widget-platform.agent.js +0 -1190
  74. package/dist/agents/teams/widget/widget-uiux.agent.d.ts +0 -107
  75. package/dist/agents/teams/widget/widget-uiux.agent.js +0 -1033
  76. package/dist/agents/test-agent.d.ts +0 -26
  77. package/dist/agents/test-agent.js +0 -734
  78. package/dist/agents/test-agents.d.ts +0 -7
  79. package/dist/agents/test-agents.js +0 -64
  80. package/dist/agents/ui-builder.agent.d.ts +0 -50
  81. package/dist/agents/ui-builder.agent.js +0 -1539
  82. package/dist/agents/widget-builder.agent.d.ts +0 -32
  83. package/dist/agents/widget-builder.agent.js +0 -439
  84. package/dist/agents/widget-creator-agent.d.ts +0 -18
  85. package/dist/agents/widget-creator-agent.js +0 -498
  86. package/dist/agents/workflow-designer.agent.d.ts +0 -31
  87. package/dist/agents/workflow-designer.agent.js +0 -583
  88. package/dist/api/error-handling.d.ts +0 -325
  89. package/dist/api/error-handling.js +0 -1488
  90. package/dist/api/flow-designer-api.d.ts +0 -167
  91. package/dist/api/flow-designer-api.js +0 -554
  92. package/dist/api/natural-language-mapper.d.ts +0 -124
  93. package/dist/api/natural-language-mapper.js +0 -501
  94. package/dist/api/performance-optimizer.d.ts +0 -240
  95. package/dist/api/performance-optimizer.js +0 -706
  96. package/dist/api/transaction-manager.d.ts +0 -189
  97. package/dist/api/transaction-manager.js +0 -576
  98. package/dist/assembly/team-assembler.d.ts +0 -140
  99. package/dist/assembly/team-assembler.js +0 -502
  100. package/dist/benchmark-performance.d.ts +0 -41
  101. package/dist/benchmark-performance.js +0 -230
  102. package/dist/cli/snow-flow-cli-integration.d.ts +0 -30
  103. package/dist/cli/snow-flow-cli-integration.js +0 -396
  104. package/dist/coordination/coordination-engine.d.ts +0 -41
  105. package/dist/coordination/coordination-engine.js +0 -324
  106. package/dist/coordination/coordination.test.d.ts +0 -6
  107. package/dist/coordination/example.d.ts +0 -31
  108. package/dist/coordination/example.js +0 -394
  109. package/dist/coordination/execution-patterns.d.ts +0 -43
  110. package/dist/coordination/execution-patterns.js +0 -507
  111. package/dist/coordination/factory.d.ts +0 -94
  112. package/dist/coordination/factory.js +0 -433
  113. package/dist/coordination/index.d.ts +0 -71
  114. package/dist/coordination/index.js +0 -135
  115. package/dist/coordination/progress-monitor.d.ts +0 -71
  116. package/dist/coordination/progress-monitor.js +0 -505
  117. package/dist/coordination/quality-gates.d.ts +0 -124
  118. package/dist/coordination/quality-gates.js +0 -577
  119. package/dist/coordination/shared-memory.d.ts +0 -39
  120. package/dist/coordination/shared-memory.js +0 -289
  121. package/dist/coordination/task-dependencies.d.ts +0 -50
  122. package/dist/coordination/task-dependencies.js +0 -407
  123. package/dist/coordination/team-coordinator.d.ts +0 -59
  124. package/dist/coordination/team-coordinator.js +0 -550
  125. package/dist/coordination/types.d.ts +0 -152
  126. package/dist/coordination/types.js +0 -3
  127. package/dist/mcp/mcp-wrapper.d.ts +0 -8
  128. package/dist/mcp/mcp-wrapper.js +0 -77
  129. package/dist/mcp/servicenow-flow-composer-enhanced.js +0 -396
  130. package/dist/mcp/servicenow-flow-composer-mcp.d.ts +0 -7
  131. package/dist/mcp/servicenow-flow-composer-mcp.js +0 -3103
  132. package/dist/mcp/servicenow-graph-memory-mcp.d.ts +0 -7
  133. package/dist/mcp/servicenow-intelligent-mcp.d.ts +0 -143
  134. package/dist/mcp/servicenow-intelligent-mcp.js +0 -4156
  135. package/dist/mcp/servicenow-xml-flow-mcp.d.ts +0 -53
  136. package/dist/mcp/servicenow-xml-flow-mcp.js +0 -1704
  137. package/dist/mcp/singleton-check.js +0 -31
  138. package/dist/mcp/test-simple-mcp.d.ts +0 -6
  139. package/dist/mcp/test-simple-mcp.js +0 -63
  140. package/dist/memory/hierarchical-memory-system.d.ts +0 -90
  141. package/dist/memory/hierarchical-memory-system.js +0 -400
  142. package/dist/memory/index.d.ts +0 -9
  143. package/dist/memory/index.js +0 -20
  144. package/dist/memory/mcp-integration-example.d.ts +0 -6
  145. package/dist/memory/mcp-integration-example.js +0 -281
  146. package/dist/memory/memory-client.d.ts +0 -199
  147. package/dist/memory/memory-client.js +0 -364
  148. package/dist/memory/memory-manager.d.ts +0 -29
  149. package/dist/memory/memory-manager.js +0 -280
  150. package/dist/memory/memory-operations.d.ts +0 -179
  151. package/dist/memory/memory-operations.js +0 -691
  152. package/dist/memory/memory-system.d.ts +0 -153
  153. package/dist/memory/memory-system.js +0 -651
  154. package/dist/memory/memory-test.d.ts +0 -6
  155. package/dist/memory/memory-test.js +0 -161
  156. package/dist/memory/snow-flow-memory-patterns.d.ts +0 -213
  157. package/dist/memory/snow-flow-memory-patterns.js +0 -200
  158. package/dist/memory/snow-memory.d.ts +0 -54
  159. package/dist/memory/snow-memory.js +0 -301
  160. package/dist/memory/swarm-memory.d.ts +0 -135
  161. package/dist/memory/swarm-memory.js +0 -378
  162. package/dist/optimization/flow-performance-optimizer.js +0 -723
  163. package/dist/orchestration/discovery/service-discovery.d.ts +0 -81
  164. package/dist/orchestration/discovery/service-discovery.js +0 -808
  165. package/dist/orchestration/distributed-orchestrator.d.ts +0 -131
  166. package/dist/orchestration/distributed-orchestrator.js +0 -712
  167. package/dist/orchestration/distribution/task-distribution-engine.d.ts +0 -53
  168. package/dist/orchestration/distribution/task-distribution-engine.js +0 -586
  169. package/dist/orchestration/flow-update-orchestrator.js +0 -648
  170. package/dist/orchestration/interfaces/distributed-orchestration.interface.d.ts +0 -606
  171. package/dist/orchestration/interfaces/distributed-orchestration.interface.js +0 -65
  172. package/dist/orchestration/protocols/mcpx-protocol.d.ts +0 -71
  173. package/dist/orchestration/protocols/mcpx-protocol.js +0 -668
  174. package/dist/orchestration/state/distributed-state-manager.d.ts +0 -89
  175. package/dist/orchestration/state/distributed-state-manager.js +0 -716
  176. package/dist/orchestrator/flow-composer.d.ts +0 -105
  177. package/dist/orchestrator/flow-composer.js +0 -404
  178. package/dist/orchestrator/flow-pattern-templates.d.ts +0 -260
  179. package/dist/orchestrator/flow-pattern-templates.js +0 -908
  180. package/dist/orchestrator/flow-subflow-decision-engine.d.ts +0 -202
  181. package/dist/orchestrator/flow-subflow-decision-engine.js +0 -769
  182. package/dist/orchestrator/flow-validation-engine.d.ts +0 -169
  183. package/dist/orchestrator/flow-validation-engine.js +0 -913
  184. package/dist/orchestrator/snow-orchestrator.d.ts +0 -49
  185. package/dist/orchestrator/snow-orchestrator.js +0 -235
  186. package/dist/orchestrator/subflow-creation-handler.d.ts +0 -230
  187. package/dist/orchestrator/subflow-creation-handler.js +0 -791
  188. package/dist/patterns/adaptive-patterns.d.ts +0 -140
  189. package/dist/patterns/adaptive-patterns.js +0 -549
  190. package/dist/queen/advanced-integration-test.d.ts +0 -48
  191. package/dist/queen/advanced-integration-test.js +0 -473
  192. package/dist/queen/integration-example.d.ts +0 -82
  193. package/dist/queen/integration-example.js +0 -219
  194. package/dist/queen/integration-test.d.ts +0 -72
  195. package/dist/queen/integration-test.js +0 -563
  196. package/dist/queen/mock-mcp-client.d.ts +0 -71
  197. package/dist/queen/mock-mcp-client.js +0 -317
  198. package/dist/queen/run-integration-tests.d.ts +0 -9
  199. package/dist/queen/run-integration-tests.js +0 -27
  200. package/dist/sparc/coordinators/adaptive-coordinator.d.ts +0 -54
  201. package/dist/sparc/coordinators/adaptive-coordinator.js +0 -367
  202. package/dist/sparc/coordinators/team-coordinator.d.ts +0 -66
  203. package/dist/sparc/coordinators/team-coordinator.js +0 -402
  204. package/dist/sparc/modes/team-modes.d.ts +0 -33
  205. package/dist/sparc/modes/team-modes.js +0 -399
  206. package/dist/sparc/teams/application-team.d.ts +0 -73
  207. package/dist/sparc/teams/application-team.js +0 -463
  208. package/dist/sparc/teams/flow-team.d.ts +0 -67
  209. package/dist/sparc/teams/flow-team.js +0 -373
  210. package/dist/sparc/teams/widget-team.d.ts +0 -61
  211. package/dist/sparc/teams/widget-team.js +0 -280
  212. package/dist/specialists/app-specialists.d.ts +0 -93
  213. package/dist/specialists/app-specialists.js +0 -1639
  214. package/dist/specialists/base-specialist.d.ts +0 -19
  215. package/dist/specialists/base-specialist.js +0 -54
  216. package/dist/specialists/flow-specialists.d.ts +0 -113
  217. package/dist/specialists/flow-specialists.js +0 -1787
  218. package/dist/specialists/individual-specialists.d.ts +0 -67
  219. package/dist/specialists/individual-specialists.js +0 -632
  220. package/dist/specialists/widget-specialists.d.ts +0 -70
  221. package/dist/specialists/widget-specialists.js +0 -1264
  222. package/dist/src/utils/agent-detector.js +0 -655
  223. package/dist/teams/adaptive-team.d.ts +0 -81
  224. package/dist/teams/adaptive-team.js +0 -1153
  225. package/dist/teams/application-team.d.ts +0 -30
  226. package/dist/teams/application-team.js +0 -547
  227. package/dist/teams/base-team.d.ts +0 -55
  228. package/dist/teams/base-team.js +0 -243
  229. package/dist/teams/flow-team.d.ts +0 -28
  230. package/dist/teams/flow-team.js +0 -525
  231. package/dist/teams/widget-team.d.ts +0 -26
  232. package/dist/teams/widget-team.js +0 -459
  233. package/dist/templates/flow-template-system.js +0 -625
  234. package/dist/test-fetch-incidents.d.ts +0 -2
  235. package/dist/test-fetch-incidents.js +0 -84
  236. package/dist/test-incident-access.d.ts +0 -2
  237. package/dist/test-incident-access.js +0 -72
  238. package/dist/test-iphone-flow.js +0 -189
  239. package/dist/test-limit-problem.d.ts +0 -2
  240. package/dist/test-limit-problem.js +0 -60
  241. package/dist/test-ml-batch-fix.d.ts +0 -2
  242. package/dist/test-ml-batch-fix.js +0 -104
  243. package/dist/test-ml-batch.d.ts +0 -2
  244. package/dist/test-ml-batch.js +0 -87
  245. package/dist/test-ml-query.d.ts +0 -2
  246. package/dist/test-ml-query.js +0 -100
  247. package/dist/test-ml-training-fix.d.ts +0 -12
  248. package/dist/test-ml-training-fix.js +0 -113
  249. package/dist/test-ml-training.d.ts +0 -2
  250. package/dist/test-ml-training.js +0 -32
  251. package/dist/test-operations-query.d.ts +0 -2
  252. package/dist/test-operations-query.js +0 -84
  253. package/dist/test-performance-query.d.ts +0 -2
  254. package/dist/test-performance-query.js +0 -52
  255. package/dist/test-singleton-protection.d.ts +0 -8
  256. package/dist/test-singleton-protection.js +0 -110
  257. package/dist/test-smart-limits.d.ts +0 -13
  258. package/dist/test-smart-limits.js +0 -100
  259. package/dist/test-snow-query-incidents.d.ts +0 -2
  260. package/dist/test-snow-query-incidents.js +0 -66
  261. package/dist/test-universal-query.d.ts +0 -2
  262. package/dist/test-universal-query.js +0 -106
  263. package/dist/testing/flow-testing-automation.js +0 -641
  264. package/dist/utils/complete-flow-xml-generator.js +0 -1285
  265. package/dist/utils/file-storage-fallback.d.ts +0 -62
  266. package/dist/utils/file-storage-fallback.js +0 -289
  267. package/dist/utils/flow-api-discovery.d.ts +0 -151
  268. package/dist/utils/flow-api-discovery.js +0 -439
  269. package/dist/utils/flow-examples.js +0 -720
  270. package/dist/utils/flow-structure-builder.js +0 -677
  271. package/dist/utils/flow-xml-generator.d.ts +0 -41
  272. package/dist/utils/flow-xml-generator.js +0 -258
  273. package/dist/utils/improved-flow-xml-generator.js +0 -820
  274. package/dist/utils/mcp-process-manager.backup.d.ts +0 -58
  275. package/dist/utils/mcp-process-manager.backup.js +0 -220
  276. package/dist/utils/mcp-singleton-enforcer.d.ts +0 -36
  277. package/dist/utils/mcp-singleton-enforcer.js +0 -201
  278. package/dist/utils/mcp-timeout-fix.d.ts +0 -53
  279. package/dist/utils/mcp-timeout-fix.js +0 -221
  280. package/dist/utils/migrate-claude-flow.d.ts +0 -22
  281. package/dist/utils/migrate-claude-flow.js +0 -120
  282. package/dist/utils/scope-utils.d.ts +0 -72
  283. package/dist/utils/scope-utils.js +0 -386
  284. package/dist/utils/snow-oauth-old.d.ts +0 -65
  285. package/dist/utils/snow-oauth-old.js +0 -345
  286. package/dist/utils/xml-first-flow-generator.js +0 -513
  287. package/memory/servicenow_artifacts/000d9224c895221055906c7518aa2d3d.json +0 -30
  288. package/memory/servicenow_artifacts/0196b66173303010e46b4a2214f6a7a2.json +0 -36
  289. package/memory/servicenow_artifacts/125e5d1d837e2a102a7ea130ceaad397.json +0 -30
  290. package/memory/servicenow_artifacts/7637c1f2b7112210a5e5911cde11a972.json +0 -30
  291. package/memory/servicenow_artifacts/default_documentation_tables_1754056582292.json +0 -55
  292. package/memory/servicenow_artifacts/default_documentation_tables_1754057477189.json +0 -55
  293. package/memory/update-set-sessions/01f82af583faea102a7ea130ceaad3d4.json +0 -9
  294. package/memory/update-set-sessions/27718fb983faea102a7ea130ceaad34b.json +0 -9
  295. package/memory/update-set-sessions/412e9bf6833e22502a7ea130ceaad30a.json +0 -8
  296. package/memory/update-set-sessions/66fc5a79837aea102a7ea130ceaad3ab.json +0 -9
  297. package/memory/update-set-sessions/71a30ff5837eea102a7ea130ceaad37f.json +0 -9
  298. package/memory/update-set-sessions/74fba27983faea102a7ea130ceaad3bd.json +0 -9
  299. package/memory/update-set-sessions/a0b147b5837eea102a7ea130ceaad344.json +0 -58
  300. package/memory/update-set-sessions/b13f5eb983baea102a7ea130ceaad33e.json +0 -9
  301. package/reports/swarm-auto-centralized-1752649029776.json +0 -13
  302. package/src/memory/README.md +0 -240
@@ -1,62 +0,0 @@
1
- /**
2
- * File Storage Fallback
3
- * WORKAROUND: Alternative to MCP memory_usage for storing large data
4
- * Uses local filesystem instead of unreliable MCP memory operations
5
- */
6
- export declare class FileStorageFallback {
7
- private static readonly STORAGE_DIR;
8
- /**
9
- * Initialize file storage directory
10
- */
11
- static initialize(): Promise<void>;
12
- /**
13
- * Store data to file (replacement for memory_usage store)
14
- */
15
- static store(key: string, data: any): Promise<void>;
16
- /**
17
- * Retrieve data from file (replacement for memory_usage retrieve)
18
- */
19
- static retrieve(key: string): Promise<any>;
20
- /**
21
- * Delete stored data
22
- */
23
- static delete(key: string): Promise<void>;
24
- /**
25
- * List all stored keys
26
- */
27
- static list(pattern?: string): Promise<string[]>;
28
- /**
29
- * Clear all stored data
30
- */
31
- static clear(): Promise<void>;
32
- /**
33
- * Get storage statistics
34
- */
35
- static getStats(): Promise<{
36
- totalFiles: number;
37
- totalSizeKB: number;
38
- largestFileKB: number;
39
- oldestFileAge: number;
40
- }>;
41
- /**
42
- * Get file path for a given key
43
- */
44
- private static getFilePath;
45
- /**
46
- * WORKAROUND: Direct replacement for MCP memory_usage
47
- * Provides drop-in replacement with same interface
48
- */
49
- static mcpMemoryReplacement(action: string, key?: string, value?: any): Promise<any>;
50
- }
51
- export declare const fileStore: (key: string, value: any) => Promise<void>;
52
- export declare const fileRetrieve: (key: string) => Promise<any>;
53
- export declare const fileDelete: (key: string) => Promise<void>;
54
- export declare const fileList: (pattern?: string) => Promise<string[]>;
55
- export declare const fileClear: () => Promise<void>;
56
- export declare const fileStats: () => Promise<{
57
- totalFiles: number;
58
- totalSizeKB: number;
59
- largestFileKB: number;
60
- oldestFileAge: number;
61
- }>;
62
- //# sourceMappingURL=file-storage-fallback.d.ts.map
@@ -1,289 +0,0 @@
1
- "use strict";
2
- /**
3
- * File Storage Fallback
4
- * WORKAROUND: Alternative to MCP memory_usage for storing large data
5
- * Uses local filesystem instead of unreliable MCP memory operations
6
- */
7
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
- if (k2 === undefined) k2 = k;
9
- var desc = Object.getOwnPropertyDescriptor(m, k);
10
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
- desc = { enumerable: true, get: function() { return m[k]; } };
12
- }
13
- Object.defineProperty(o, k2, desc);
14
- }) : (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- o[k2] = m[k];
17
- }));
18
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
- Object.defineProperty(o, "default", { enumerable: true, value: v });
20
- }) : function(o, v) {
21
- o["default"] = v;
22
- });
23
- var __importStar = (this && this.__importStar) || (function () {
24
- var ownKeys = function(o) {
25
- ownKeys = Object.getOwnPropertyNames || function (o) {
26
- var ar = [];
27
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
28
- return ar;
29
- };
30
- return ownKeys(o);
31
- };
32
- return function (mod) {
33
- if (mod && mod.__esModule) return mod;
34
- var result = {};
35
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
36
- __setModuleDefault(result, mod);
37
- return result;
38
- };
39
- })();
40
- Object.defineProperty(exports, "__esModule", { value: true });
41
- exports.fileStats = exports.fileClear = exports.fileList = exports.fileDelete = exports.fileRetrieve = exports.fileStore = exports.FileStorageFallback = void 0;
42
- const fs = __importStar(require("fs"));
43
- const path = __importStar(require("path"));
44
- const os = __importStar(require("os"));
45
- const logger_js_1 = require("./logger.js");
46
- const logger = new logger_js_1.Logger('FileStorageFallback');
47
- class FileStorageFallback {
48
- /**
49
- * Initialize file storage directory
50
- */
51
- static async initialize() {
52
- try {
53
- await fs.promises.mkdir(this.STORAGE_DIR, { recursive: true });
54
- logger.info(`📁 File storage initialized at: ${this.STORAGE_DIR}`);
55
- }
56
- catch (error) {
57
- logger.error('Failed to initialize file storage:', error);
58
- throw error;
59
- }
60
- }
61
- /**
62
- * Store data to file (replacement for memory_usage store)
63
- */
64
- static async store(key, data) {
65
- try {
66
- const filePath = this.getFilePath(key);
67
- const dirPath = path.dirname(filePath);
68
- // Ensure directory exists
69
- await fs.promises.mkdir(dirPath, { recursive: true });
70
- // Store data as JSON
71
- const jsonData = JSON.stringify(data, null, 2);
72
- // Check size (warn if large)
73
- const sizeKB = Buffer.byteLength(jsonData) / 1024;
74
- if (sizeKB > 1024) {
75
- logger.warn(`⚠️ Storing large data (${sizeKB.toFixed(2)} KB) to file: ${key}`);
76
- }
77
- await fs.promises.writeFile(filePath, jsonData, 'utf-8');
78
- logger.debug(`✅ Stored data to file: ${key}`);
79
- }
80
- catch (error) {
81
- logger.error(`Failed to store data for key '${key}':`, error);
82
- throw new Error(`File storage failed: ${error.message}`);
83
- }
84
- }
85
- /**
86
- * Retrieve data from file (replacement for memory_usage retrieve)
87
- */
88
- static async retrieve(key) {
89
- try {
90
- const filePath = this.getFilePath(key);
91
- // Check if file exists
92
- if (!fs.existsSync(filePath)) {
93
- logger.debug(`No data found for key: ${key}`);
94
- return null;
95
- }
96
- // Read and parse data
97
- const jsonData = await fs.promises.readFile(filePath, 'utf-8');
98
- const data = JSON.parse(jsonData);
99
- logger.debug(`✅ Retrieved data from file: ${key}`);
100
- return data;
101
- }
102
- catch (error) {
103
- logger.error(`Failed to retrieve data for key '${key}':`, error);
104
- // Return null instead of throwing to match memory_usage behavior
105
- return null;
106
- }
107
- }
108
- /**
109
- * Delete stored data
110
- */
111
- static async delete(key) {
112
- try {
113
- const filePath = this.getFilePath(key);
114
- if (fs.existsSync(filePath)) {
115
- await fs.promises.unlink(filePath);
116
- logger.debug(`🗑️ Deleted file: ${key}`);
117
- }
118
- }
119
- catch (error) {
120
- logger.error(`Failed to delete data for key '${key}':`, error);
121
- }
122
- }
123
- /**
124
- * List all stored keys
125
- */
126
- static async list(pattern) {
127
- try {
128
- const keys = [];
129
- const walkDir = async (dir, prefix = '') => {
130
- try {
131
- const entries = await fs.promises.readdir(dir, { withFileTypes: true });
132
- for (const entry of entries) {
133
- const fullPath = path.join(dir, entry.name);
134
- const key = prefix ? `${prefix}/${entry.name}` : entry.name;
135
- if (entry.isDirectory()) {
136
- await walkDir(fullPath, key);
137
- }
138
- else if (entry.name.endsWith('.json')) {
139
- const keyName = key.replace(/\.json$/, '');
140
- // Apply pattern filter if provided
141
- if (!pattern || keyName.includes(pattern)) {
142
- keys.push(keyName);
143
- }
144
- }
145
- }
146
- }
147
- catch (error) {
148
- logger.debug(`Error walking directory ${dir}:`, error.message);
149
- }
150
- };
151
- await walkDir(this.STORAGE_DIR);
152
- return keys;
153
- }
154
- catch (error) {
155
- logger.error('Failed to list stored keys:', error);
156
- return [];
157
- }
158
- }
159
- /**
160
- * Clear all stored data
161
- */
162
- static async clear() {
163
- try {
164
- // Remove and recreate the storage directory
165
- if (fs.existsSync(this.STORAGE_DIR)) {
166
- await fs.promises.rm(this.STORAGE_DIR, { recursive: true, force: true });
167
- }
168
- await fs.promises.mkdir(this.STORAGE_DIR, { recursive: true });
169
- logger.info('🧹 Cleared all file storage');
170
- }
171
- catch (error) {
172
- logger.error('Failed to clear file storage:', error);
173
- }
174
- }
175
- /**
176
- * Get storage statistics
177
- */
178
- static async getStats() {
179
- try {
180
- let totalFiles = 0;
181
- let totalSize = 0;
182
- let largestSize = 0;
183
- let oldestTime = Date.now();
184
- const walkDir = async (dir) => {
185
- try {
186
- const entries = await fs.promises.readdir(dir, { withFileTypes: true });
187
- for (const entry of entries) {
188
- const fullPath = path.join(dir, entry.name);
189
- if (entry.isDirectory()) {
190
- await walkDir(fullPath);
191
- }
192
- else if (entry.name.endsWith('.json')) {
193
- totalFiles++;
194
- const stats = await fs.promises.stat(fullPath);
195
- totalSize += stats.size;
196
- largestSize = Math.max(largestSize, stats.size);
197
- oldestTime = Math.min(oldestTime, stats.mtimeMs);
198
- }
199
- }
200
- }
201
- catch (error) {
202
- logger.debug(`Error getting stats for ${dir}:`, error.message);
203
- }
204
- };
205
- await walkDir(this.STORAGE_DIR);
206
- return {
207
- totalFiles,
208
- totalSizeKB: totalSize / 1024,
209
- largestFileKB: largestSize / 1024,
210
- oldestFileAge: Date.now() - oldestTime
211
- };
212
- }
213
- catch (error) {
214
- logger.error('Failed to get storage stats:', error);
215
- return {
216
- totalFiles: 0,
217
- totalSizeKB: 0,
218
- largestFileKB: 0,
219
- oldestFileAge: 0
220
- };
221
- }
222
- }
223
- /**
224
- * Get file path for a given key
225
- */
226
- static getFilePath(key) {
227
- // Sanitize key to create valid file path
228
- const sanitizedKey = key
229
- .replace(/[^a-zA-Z0-9_\-\/]/g, '_')
230
- .replace(/\/+/g, '/')
231
- .replace(/^\/|\/$/g, '');
232
- return path.join(this.STORAGE_DIR, `${sanitizedKey}.json`);
233
- }
234
- /**
235
- * WORKAROUND: Direct replacement for MCP memory_usage
236
- * Provides drop-in replacement with same interface
237
- */
238
- static async mcpMemoryReplacement(action, key, value) {
239
- logger.info(`📁 Using file storage fallback for MCP memory operation: ${action}`);
240
- switch (action) {
241
- case 'store':
242
- if (!key)
243
- throw new Error('Key required for store operation');
244
- await this.store(key, value);
245
- return { success: true, message: 'Stored to file' };
246
- case 'retrieve':
247
- if (!key)
248
- throw new Error('Key required for retrieve operation');
249
- const data = await this.retrieve(key);
250
- return { success: true, data };
251
- case 'delete':
252
- if (!key)
253
- throw new Error('Key required for delete operation');
254
- await this.delete(key);
255
- return { success: true, message: 'Deleted from file' };
256
- case 'list':
257
- const keys = await this.list(key); // key used as pattern
258
- return { success: true, keys };
259
- case 'clear':
260
- await this.clear();
261
- return { success: true, message: 'Cleared all file storage' };
262
- case 'stats':
263
- const stats = await this.getStats();
264
- return { success: true, stats };
265
- default:
266
- throw new Error(`Unknown action: ${action}`);
267
- }
268
- }
269
- }
270
- exports.FileStorageFallback = FileStorageFallback;
271
- FileStorageFallback.STORAGE_DIR = path.join(process.env.SNOW_FLOW_HOME || path.join(os.homedir(), '.snow-flow'), 'file-storage');
272
- // Auto-initialize on module load
273
- FileStorageFallback.initialize().catch(error => {
274
- logger.error('Failed to auto-initialize file storage:', error);
275
- });
276
- // Export convenience functions for drop-in replacement
277
- const fileStore = (key, value) => FileStorageFallback.store(key, value);
278
- exports.fileStore = fileStore;
279
- const fileRetrieve = (key) => FileStorageFallback.retrieve(key);
280
- exports.fileRetrieve = fileRetrieve;
281
- const fileDelete = (key) => FileStorageFallback.delete(key);
282
- exports.fileDelete = fileDelete;
283
- const fileList = (pattern) => FileStorageFallback.list(pattern);
284
- exports.fileList = fileList;
285
- const fileClear = () => FileStorageFallback.clear();
286
- exports.fileClear = fileClear;
287
- const fileStats = () => FileStorageFallback.getStats();
288
- exports.fileStats = fileStats;
289
- //# sourceMappingURL=file-storage-fallback.js.map
@@ -1,151 +0,0 @@
1
- /**
2
- * ServiceNow Flow Designer API Discovery Service
3
- * Provides dynamic discovery of action types, trigger types, and flow metadata
4
- */
5
- import { ServiceNowClient } from './servicenow-client.js';
6
- import { ActionType, TriggerType } from './action-type-cache.js';
7
- export interface FlowActionType extends ActionType {
8
- description?: string;
9
- category: string;
10
- inputs: FlowActionInput[];
11
- outputs: FlowActionOutput[];
12
- script_template?: string;
13
- execution_mode?: string;
14
- supports_async?: boolean;
15
- }
16
- export interface FlowActionInput {
17
- sys_id: string;
18
- name: string;
19
- label: string;
20
- type: string;
21
- required: boolean;
22
- default_value?: string;
23
- description?: string;
24
- validation?: string;
25
- }
26
- export interface FlowActionOutput {
27
- sys_id: string;
28
- name: string;
29
- label: string;
30
- type: string;
31
- description?: string;
32
- sample_value?: string;
33
- }
34
- export interface FlowTriggerType extends TriggerType {
35
- description?: string;
36
- supports_conditions: boolean;
37
- supported_tables: string[];
38
- inputs: FlowTriggerInput[];
39
- outputs: FlowTriggerOutput[];
40
- }
41
- export interface FlowTriggerInput {
42
- sys_id: string;
43
- name: string;
44
- label: string;
45
- type: string;
46
- required: boolean;
47
- description?: string;
48
- }
49
- export interface FlowTriggerOutput {
50
- sys_id: string;
51
- name: string;
52
- label: string;
53
- type: string;
54
- description?: string;
55
- }
56
- export interface ActionTypeSearchResult {
57
- exact_matches: FlowActionType[];
58
- partial_matches: FlowActionType[];
59
- semantic_matches: FlowActionType[];
60
- confidence_score: number;
61
- }
62
- export declare class FlowAPIDiscovery {
63
- private logger;
64
- private client;
65
- private actionTypeCache;
66
- private triggerTypeCache;
67
- private cacheExpiry;
68
- private lastCacheUpdate;
69
- constructor(client: ServiceNowClient);
70
- /**
71
- * Discover action types based on natural language intent
72
- */
73
- discoverActionTypes(intent: string, limit?: number): Promise<ActionTypeSearchResult>;
74
- /**
75
- * Discover trigger types based on table and operation
76
- */
77
- discoverTriggerTypes(table: string, operation: string): Promise<FlowTriggerType[]>;
78
- /**
79
- * Get detailed action type information including inputs/outputs
80
- */
81
- getActionTypeDetails(actionTypeId: string): Promise<FlowActionType | null>;
82
- /**
83
- * Get all available action categories
84
- */
85
- getActionCategories(): Promise<string[]>;
86
- /**
87
- * Search for actions by category
88
- */
89
- getActionsByCategory(category: string, limit?: number): Promise<FlowActionType[]>;
90
- /**
91
- * Validate action input configuration
92
- */
93
- validateActionInputs(actionTypeId: string, inputs: Record<string, any>): Promise<{
94
- valid: boolean;
95
- errors: string[];
96
- warnings: string[];
97
- }>;
98
- /**
99
- * Suggest action types based on flow context
100
- */
101
- suggestActionTypes(flowContext: {
102
- previousActions: string[];
103
- targetTable: string;
104
- flowPurpose: string;
105
- }): Promise<FlowActionType[]>;
106
- /**
107
- * Ensure cache is up to date
108
- */
109
- private ensureCache;
110
- /**
111
- * Refresh cache from ServiceNow
112
- */
113
- private refreshCache;
114
- /**
115
- * Fetch action types from ServiceNow
116
- */
117
- private fetchActionTypes;
118
- /**
119
- * Fetch trigger types from ServiceNow
120
- */
121
- private fetchTriggerTypes;
122
- /**
123
- * Fetch inputs and outputs for an action type
124
- */
125
- private fetchActionTypeInputsOutputs;
126
- /**
127
- * Get semantic mappings for common intents
128
- */
129
- private getSemanticMappings;
130
- /**
131
- * Calculate confidence score for search results
132
- */
133
- private calculateConfidenceScore;
134
- /**
135
- * Extract context keywords from flow context
136
- */
137
- private extractContextKeywords;
138
- /**
139
- * Score category relevance
140
- */
141
- private scoreCategory;
142
- /**
143
- * Score description relevance
144
- */
145
- private scoreDescription;
146
- /**
147
- * Score compatibility with flow context
148
- */
149
- private scoreCompatibility;
150
- }
151
- //# sourceMappingURL=flow-api-discovery.d.ts.map