@memberjunction/core-actions 2.107.0 → 2.108.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 (79) hide show
  1. package/dist/custom/ai/find-best-agent.action.d.ts +53 -0
  2. package/dist/custom/ai/find-best-agent.action.d.ts.map +1 -0
  3. package/dist/custom/ai/find-best-agent.action.js +194 -0
  4. package/dist/custom/ai/find-best-agent.action.js.map +1 -0
  5. package/dist/custom/ai/summarize-content.action.d.ts +3 -3
  6. package/dist/custom/ai/summarize-content.action.d.ts.map +1 -1
  7. package/dist/custom/ai/summarize-content.action.js +51 -143
  8. package/dist/custom/ai/summarize-content.action.js.map +1 -1
  9. package/dist/custom/code-execution/execute-code.action.d.ts +61 -0
  10. package/dist/custom/code-execution/execute-code.action.d.ts.map +1 -0
  11. package/dist/custom/code-execution/execute-code.action.js +172 -0
  12. package/dist/custom/code-execution/execute-code.action.js.map +1 -0
  13. package/dist/custom/data/csv-parser.action.js +1 -1
  14. package/dist/custom/data/csv-parser.action.js.map +1 -1
  15. package/dist/custom/data/execute-research-query.action.d.ts +36 -18
  16. package/dist/custom/data/execute-research-query.action.d.ts.map +1 -1
  17. package/dist/custom/data/execute-research-query.action.js +221 -114
  18. package/dist/custom/data/execute-research-query.action.js.map +1 -1
  19. package/dist/custom/data/explore-database-schema.action.d.ts +4 -0
  20. package/dist/custom/data/explore-database-schema.action.d.ts.map +1 -1
  21. package/dist/custom/data/explore-database-schema.action.js +101 -8
  22. package/dist/custom/data/explore-database-schema.action.js.map +1 -1
  23. package/dist/custom/data/get-entity-details.action.d.ts +63 -0
  24. package/dist/custom/data/get-entity-details.action.d.ts.map +1 -0
  25. package/dist/custom/data/get-entity-details.action.js +284 -0
  26. package/dist/custom/data/get-entity-details.action.js.map +1 -0
  27. package/dist/custom/data/get-entity-list.action.d.ts +57 -0
  28. package/dist/custom/data/get-entity-list.action.d.ts.map +1 -0
  29. package/dist/custom/data/get-entity-list.action.js +177 -0
  30. package/dist/custom/data/get-entity-list.action.js.map +1 -0
  31. package/dist/custom/visualization/create-svg-chart.action.d.ts +97 -0
  32. package/dist/custom/visualization/create-svg-chart.action.d.ts.map +1 -0
  33. package/dist/custom/visualization/create-svg-chart.action.js +290 -0
  34. package/dist/custom/visualization/create-svg-chart.action.js.map +1 -0
  35. package/dist/custom/visualization/create-svg-diagram.action.d.ts +151 -0
  36. package/dist/custom/visualization/create-svg-diagram.action.d.ts.map +1 -0
  37. package/dist/custom/visualization/create-svg-diagram.action.js +764 -0
  38. package/dist/custom/visualization/create-svg-diagram.action.js.map +1 -0
  39. package/dist/custom/visualization/create-svg-infographic.action.d.ts +72 -0
  40. package/dist/custom/visualization/create-svg-infographic.action.d.ts.map +1 -0
  41. package/dist/custom/visualization/create-svg-infographic.action.js +343 -0
  42. package/dist/custom/visualization/create-svg-infographic.action.js.map +1 -0
  43. package/dist/custom/visualization/create-svg-network.action.d.ts +106 -0
  44. package/dist/custom/visualization/create-svg-network.action.d.ts.map +1 -0
  45. package/dist/custom/visualization/create-svg-network.action.js +651 -0
  46. package/dist/custom/visualization/create-svg-network.action.js.map +1 -0
  47. package/dist/custom/visualization/create-svg-word-cloud.action.d.ts +94 -0
  48. package/dist/custom/visualization/create-svg-word-cloud.action.d.ts.map +1 -0
  49. package/dist/custom/visualization/create-svg-word-cloud.action.js +422 -0
  50. package/dist/custom/visualization/create-svg-word-cloud.action.js.map +1 -0
  51. package/dist/custom/visualization/shared/svg-theming.d.ts +91 -0
  52. package/dist/custom/visualization/shared/svg-theming.d.ts.map +1 -0
  53. package/dist/custom/visualization/shared/svg-theming.js +235 -0
  54. package/dist/custom/visualization/shared/svg-theming.js.map +1 -0
  55. package/dist/custom/visualization/shared/svg-types.d.ts +338 -0
  56. package/dist/custom/visualization/shared/svg-types.d.ts.map +1 -0
  57. package/dist/custom/visualization/shared/svg-types.js +11 -0
  58. package/dist/custom/visualization/shared/svg-types.js.map +1 -0
  59. package/dist/custom/visualization/shared/svg-utils.d.ts +129 -0
  60. package/dist/custom/visualization/shared/svg-utils.d.ts.map +1 -0
  61. package/dist/custom/visualization/shared/svg-utils.js +287 -0
  62. package/dist/custom/visualization/shared/svg-utils.js.map +1 -0
  63. package/dist/custom/web/google-custom-search.action.d.ts +6 -1
  64. package/dist/custom/web/google-custom-search.action.d.ts.map +1 -1
  65. package/dist/custom/web/google-custom-search.action.js +78 -10
  66. package/dist/custom/web/google-custom-search.action.js.map +1 -1
  67. package/dist/custom/web/web-page-content.action.d.ts +24 -0
  68. package/dist/custom/web/web-page-content.action.d.ts.map +1 -1
  69. package/dist/custom/web/web-page-content.action.js +90 -9
  70. package/dist/custom/web/web-page-content.action.js.map +1 -1
  71. package/dist/generated/action_subclasses.d.ts +10 -10
  72. package/dist/generated/action_subclasses.d.ts.map +1 -1
  73. package/dist/generated/action_subclasses.js +29 -29
  74. package/dist/generated/action_subclasses.js.map +1 -1
  75. package/dist/index.d.ts +10 -0
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +28 -0
  78. package/dist/index.js.map +1 -1
  79. package/package.json +29 -12
@@ -0,0 +1,151 @@
1
+ import { RunActionParams } from '@memberjunction/actions-base';
2
+ import { BaseAction } from '@memberjunction/actions';
3
+ import { SVGActionResult } from './shared/svg-types';
4
+ /**
5
+ * Action that generates SVG diagrams including flowcharts, org charts, and ER diagrams.
6
+ *
7
+ * This action provides server-side SVG generation for structured diagrams, designed for
8
+ * AI agents and workflows to create publication-quality visualizations from structured data.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * // Flowchart example
13
+ * await runAction({
14
+ * ActionName: 'Create SVG Diagram',
15
+ * Params: [
16
+ * { Name: 'DiagramType', Value: 'flow' },
17
+ * { Name: 'Nodes', Value: JSON.stringify([
18
+ * { id: '1', kind: 'start', label: 'Start' },
19
+ * { id: '2', kind: 'process', label: 'Process Data' },
20
+ * { id: '3', kind: 'end', label: 'End' }
21
+ * ]) },
22
+ * { Name: 'Edges', Value: JSON.stringify([
23
+ * { from: '1', to: '2', label: 'Begin' },
24
+ * { from: '2', to: '3' }
25
+ * ]) },
26
+ * { Name: 'Direction', Value: 'TB' },
27
+ * { Name: 'Width', Value: '800' },
28
+ * { Name: 'Height', Value: '600' }
29
+ * ]
30
+ * });
31
+ *
32
+ * // Org chart example
33
+ * await runAction({
34
+ * ActionName: 'Create SVG Diagram',
35
+ * Params: [
36
+ * { Name: 'DiagramType', Value: 'org' },
37
+ * { Name: 'Nodes', Value: JSON.stringify({
38
+ * id: '1',
39
+ * label: 'CEO',
40
+ * role: 'Chief Executive Officer',
41
+ * children: [
42
+ * { id: '2', label: 'CTO', role: 'Technology' },
43
+ * { id: '3', label: 'CFO', role: 'Finance' }
44
+ * ]
45
+ * }) }
46
+ * ]
47
+ * });
48
+ * ```
49
+ */
50
+ export declare class CreateSVGDiagramAction extends BaseAction {
51
+ /**
52
+ * Generates an SVG diagram from the provided data and configuration
53
+ *
54
+ * @param params - The action parameters containing:
55
+ * - DiagramType: Type of diagram ('flow' | 'org' | 'er')
56
+ * - Nodes: JSON array or object of nodes
57
+ * - Edges: JSON array of edges (for flow and ER diagrams)
58
+ * - Direction: Layout direction ('TB' | 'LR' | 'RL' | 'BT') for flow diagrams
59
+ * - Width: Diagram width in pixels (optional, default: 800)
60
+ * - Height: Diagram height in pixels (optional, default: 600)
61
+ * - Title: Diagram title (optional)
62
+ * - Palette: Color palette ('mjDefault' | 'gray' | 'pastel' | 'highContrast')
63
+ * - Seed: Random seed for deterministic layouts (optional)
64
+ *
65
+ * @returns A promise resolving to an SVGActionResult with:
66
+ * - Success: true if diagram was generated successfully
67
+ * - ResultCode: "SUCCESS" or error code
68
+ * - Message: The SVG string or error message
69
+ * - svg: The SVG XML string
70
+ * - width: Diagram width in pixels
71
+ * - height: Diagram height in pixels
72
+ */
73
+ protected InternalRunAction(params: RunActionParams): Promise<SVGActionResult>;
74
+ /**
75
+ * Renders a flowchart using dagre layout
76
+ */
77
+ private renderFlowDiagram;
78
+ /**
79
+ * Gets dimensions for flow node based on kind
80
+ */
81
+ private getNodeDimensions;
82
+ /**
83
+ * Renders a single flow node
84
+ */
85
+ private renderFlowNode;
86
+ /**
87
+ * Gets color index for node kind
88
+ */
89
+ private getNodeColorIndex;
90
+ /**
91
+ * Renders an ellipse shape
92
+ */
93
+ private renderEllipse;
94
+ /**
95
+ * Renders a diamond shape
96
+ */
97
+ private renderDiamond;
98
+ /**
99
+ * Renders a rounded rectangle
100
+ */
101
+ private renderRoundedRect;
102
+ /**
103
+ * Renders a flow edge
104
+ */
105
+ private renderFlowEdge;
106
+ /**
107
+ * Renders an org chart using d3-hierarchy
108
+ */
109
+ private renderOrgChart;
110
+ /**
111
+ * Renders an org chart link
112
+ */
113
+ private renderOrgLink;
114
+ /**
115
+ * Renders an org chart node
116
+ */
117
+ private renderOrgNode;
118
+ /**
119
+ * Renders an ER diagram using dagre layout
120
+ */
121
+ private renderERDiagram;
122
+ /**
123
+ * Renders an ER table
124
+ */
125
+ private renderERTable;
126
+ /**
127
+ * Renders an ER relation
128
+ */
129
+ private renderERRelation;
130
+ /**
131
+ * Adds a title to the SVG
132
+ */
133
+ private addTitle;
134
+ /**
135
+ * Helper to safely parse JSON that might already be an object
136
+ */
137
+ private parseJSON;
138
+ /**
139
+ * Helper to ensure a parameter value is a string, with type conversion and validation
140
+ */
141
+ private ensureString;
142
+ /**
143
+ * Helper to get parameter value by name (case-insensitive)
144
+ */
145
+ private getParamValue;
146
+ }
147
+ /**
148
+ * Loader function to ensure the CreateSVGDiagramAction class is included in the bundle.
149
+ */
150
+ export declare function LoadCreateSVGDiagramAction(): void;
151
+ //# sourceMappingURL=create-svg-diagram.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-svg-diagram.action.d.ts","sourceRoot":"","sources":["../../../src/custom/visualization/create-svg-diagram.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAKrD,OAAO,EAOH,eAAe,EAIlB,MAAM,oBAAoB,CAAC;AAI5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,qBACa,sBAAuB,SAAQ,UAAU;IAClD;;;;;;;;;;;;;;;;;;;;;OAqBG;cACa,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAsEpF;;OAEG;YACW,iBAAiB;IA0F/B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAmBzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAgDtB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAazB;;OAEG;IACH,OAAO,CAAC,aAAa;IAarB;;OAEG;IACH,OAAO,CAAC,aAAa;IAarB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAUzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAuCtB;;OAEG;YACW,cAAc;IA+D5B;;OAEG;IACH,OAAO,CAAC,aAAa;IAwBrB;;OAEG;IACH,OAAO,CAAC,aAAa;IAuErB;;OAEG;YACW,eAAe;IA2F7B;;OAEG;IACH,OAAO,CAAC,aAAa;IAgFrB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAmCxB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAahB;;OAEG;IACH,OAAO,CAAC,SAAS;IAuBjB;;OAEG;IACH,OAAO,CAAC,YAAY;IAqBpB;;OAEG;IACH,OAAO,CAAC,aAAa;CAQxB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,SAEzC"}