@gxp-dev/tools 2.0.63 → 2.0.64

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 (182) hide show
  1. package/README.md +32 -31
  2. package/bin/gx-devtools.js +74 -54
  3. package/bin/lib/cli.js +23 -21
  4. package/bin/lib/commands/add-dependency.js +366 -325
  5. package/bin/lib/commands/assets.js +137 -139
  6. package/bin/lib/commands/build.js +169 -174
  7. package/bin/lib/commands/datastore.js +181 -183
  8. package/bin/lib/commands/dev.js +127 -131
  9. package/bin/lib/commands/extensions.js +147 -149
  10. package/bin/lib/commands/extract-config.js +73 -67
  11. package/bin/lib/commands/index.js +12 -12
  12. package/bin/lib/commands/init.js +342 -240
  13. package/bin/lib/commands/publish.js +69 -75
  14. package/bin/lib/commands/socket.js +69 -69
  15. package/bin/lib/commands/ssl.js +14 -14
  16. package/bin/lib/constants.js +10 -24
  17. package/bin/lib/tui/App.tsx +761 -705
  18. package/bin/lib/tui/components/AIPanel.tsx +191 -171
  19. package/bin/lib/tui/components/CommandInput.tsx +394 -343
  20. package/bin/lib/tui/components/GeminiPanel.tsx +175 -151
  21. package/bin/lib/tui/components/Header.tsx +23 -21
  22. package/bin/lib/tui/components/LogPanel.tsx +244 -220
  23. package/bin/lib/tui/components/TabBar.tsx +50 -48
  24. package/bin/lib/tui/components/WelcomeScreen.tsx +126 -71
  25. package/bin/lib/tui/index.tsx +37 -39
  26. package/bin/lib/tui/services/AIService.ts +518 -462
  27. package/bin/lib/tui/services/ExtensionService.ts +140 -129
  28. package/bin/lib/tui/services/GeminiService.ts +367 -337
  29. package/bin/lib/tui/services/ServiceManager.ts +344 -322
  30. package/bin/lib/tui/services/SocketService.ts +168 -168
  31. package/bin/lib/tui/services/ViteService.ts +88 -88
  32. package/bin/lib/tui/services/index.ts +47 -22
  33. package/bin/lib/utils/ai-scaffold.js +291 -280
  34. package/bin/lib/utils/extract-config.js +157 -140
  35. package/bin/lib/utils/files.js +82 -86
  36. package/bin/lib/utils/index.js +7 -7
  37. package/bin/lib/utils/paths.js +34 -34
  38. package/bin/lib/utils/prompts.js +194 -169
  39. package/bin/lib/utils/ssl.js +79 -81
  40. package/browser-extensions/README.md +0 -1
  41. package/browser-extensions/chrome/background.js +244 -237
  42. package/browser-extensions/chrome/content.js +32 -29
  43. package/browser-extensions/chrome/devtools.html +7 -7
  44. package/browser-extensions/chrome/devtools.js +19 -19
  45. package/browser-extensions/chrome/inspector.js +802 -767
  46. package/browser-extensions/chrome/manifest.json +71 -63
  47. package/browser-extensions/chrome/panel.html +674 -636
  48. package/browser-extensions/chrome/panel.js +722 -712
  49. package/browser-extensions/chrome/popup.html +586 -543
  50. package/browser-extensions/chrome/popup.js +282 -244
  51. package/browser-extensions/chrome/rules.json +1 -1
  52. package/browser-extensions/chrome/test-chrome.html +216 -136
  53. package/browser-extensions/chrome/test-mixed-content.html +284 -189
  54. package/browser-extensions/chrome/test-uri-pattern.html +221 -198
  55. package/browser-extensions/firefox/README.md +9 -6
  56. package/browser-extensions/firefox/background.js +221 -218
  57. package/browser-extensions/firefox/content.js +55 -52
  58. package/browser-extensions/firefox/debug-errors.html +386 -228
  59. package/browser-extensions/firefox/debug-https.html +153 -105
  60. package/browser-extensions/firefox/devtools.html +7 -7
  61. package/browser-extensions/firefox/devtools.js +23 -20
  62. package/browser-extensions/firefox/inspector.js +802 -767
  63. package/browser-extensions/firefox/manifest.json +68 -68
  64. package/browser-extensions/firefox/panel.html +674 -636
  65. package/browser-extensions/firefox/panel.js +722 -712
  66. package/browser-extensions/firefox/popup.html +572 -535
  67. package/browser-extensions/firefox/popup.js +281 -236
  68. package/browser-extensions/firefox/test-gramercy.html +170 -125
  69. package/browser-extensions/firefox/test-imports.html +59 -55
  70. package/browser-extensions/firefox/test-masking.html +231 -140
  71. package/browser-extensions/firefox/test-uri-pattern.html +221 -198
  72. package/dist/tui/App.d.ts +1 -1
  73. package/dist/tui/App.d.ts.map +1 -1
  74. package/dist/tui/App.js +154 -150
  75. package/dist/tui/App.js.map +1 -1
  76. package/dist/tui/components/AIPanel.d.ts.map +1 -1
  77. package/dist/tui/components/AIPanel.js +42 -35
  78. package/dist/tui/components/AIPanel.js.map +1 -1
  79. package/dist/tui/components/CommandInput.d.ts +1 -1
  80. package/dist/tui/components/CommandInput.d.ts.map +1 -1
  81. package/dist/tui/components/CommandInput.js +92 -62
  82. package/dist/tui/components/CommandInput.js.map +1 -1
  83. package/dist/tui/components/GeminiPanel.d.ts.map +1 -1
  84. package/dist/tui/components/GeminiPanel.js +37 -30
  85. package/dist/tui/components/GeminiPanel.js.map +1 -1
  86. package/dist/tui/components/Header.d.ts.map +1 -1
  87. package/dist/tui/components/Header.js +1 -1
  88. package/dist/tui/components/Header.js.map +1 -1
  89. package/dist/tui/components/LogPanel.d.ts +1 -1
  90. package/dist/tui/components/LogPanel.d.ts.map +1 -1
  91. package/dist/tui/components/LogPanel.js +26 -24
  92. package/dist/tui/components/LogPanel.js.map +1 -1
  93. package/dist/tui/components/TabBar.d.ts +2 -2
  94. package/dist/tui/components/TabBar.d.ts.map +1 -1
  95. package/dist/tui/components/TabBar.js +11 -11
  96. package/dist/tui/components/TabBar.js.map +1 -1
  97. package/dist/tui/components/WelcomeScreen.d.ts.map +1 -1
  98. package/dist/tui/components/WelcomeScreen.js +6 -6
  99. package/dist/tui/components/WelcomeScreen.js.map +1 -1
  100. package/dist/tui/index.d.ts.map +1 -1
  101. package/dist/tui/index.js +8 -8
  102. package/dist/tui/index.js.map +1 -1
  103. package/dist/tui/services/AIService.d.ts +2 -2
  104. package/dist/tui/services/AIService.d.ts.map +1 -1
  105. package/dist/tui/services/AIService.js +165 -125
  106. package/dist/tui/services/AIService.js.map +1 -1
  107. package/dist/tui/services/ExtensionService.d.ts +1 -1
  108. package/dist/tui/services/ExtensionService.d.ts.map +1 -1
  109. package/dist/tui/services/ExtensionService.js +33 -26
  110. package/dist/tui/services/ExtensionService.js.map +1 -1
  111. package/dist/tui/services/GeminiService.d.ts +1 -1
  112. package/dist/tui/services/GeminiService.d.ts.map +1 -1
  113. package/dist/tui/services/GeminiService.js +87 -76
  114. package/dist/tui/services/GeminiService.js.map +1 -1
  115. package/dist/tui/services/ServiceManager.d.ts +3 -3
  116. package/dist/tui/services/ServiceManager.d.ts.map +1 -1
  117. package/dist/tui/services/ServiceManager.js +72 -58
  118. package/dist/tui/services/ServiceManager.js.map +1 -1
  119. package/dist/tui/services/SocketService.d.ts.map +1 -1
  120. package/dist/tui/services/SocketService.js +32 -32
  121. package/dist/tui/services/SocketService.js.map +1 -1
  122. package/dist/tui/services/ViteService.d.ts.map +1 -1
  123. package/dist/tui/services/ViteService.js +26 -28
  124. package/dist/tui/services/ViteService.js.map +1 -1
  125. package/dist/tui/services/index.d.ts +6 -6
  126. package/dist/tui/services/index.d.ts.map +1 -1
  127. package/dist/tui/services/index.js +6 -6
  128. package/dist/tui/services/index.js.map +1 -1
  129. package/mcp/gxp-api-server.js +83 -81
  130. package/package.json +109 -93
  131. package/runtime/PortalContainer.vue +258 -234
  132. package/runtime/dev-tools/DevToolsModal.vue +153 -155
  133. package/runtime/dev-tools/LayoutSwitcher.vue +144 -140
  134. package/runtime/dev-tools/MockDataEditor.vue +456 -433
  135. package/runtime/dev-tools/SocketSimulator.vue +379 -371
  136. package/runtime/dev-tools/StoreInspector.vue +517 -455
  137. package/runtime/dev-tools/index.js +5 -5
  138. package/runtime/fallback-layouts/PrivateLayout.vue +2 -2
  139. package/runtime/fallback-layouts/PublicLayout.vue +2 -2
  140. package/runtime/fallback-layouts/SystemLayout.vue +2 -2
  141. package/runtime/gxpStringsPlugin.js +159 -134
  142. package/runtime/index.html +17 -19
  143. package/runtime/main.js +24 -22
  144. package/runtime/mock-api/auth-middleware.js +15 -15
  145. package/runtime/mock-api/image-generator.js +46 -46
  146. package/runtime/mock-api/index.js +55 -55
  147. package/runtime/mock-api/response-generator.js +116 -105
  148. package/runtime/mock-api/route-generator.js +107 -84
  149. package/runtime/mock-api/socket-triggers.js +94 -93
  150. package/runtime/mock-api/spec-loader.js +79 -80
  151. package/runtime/package.json +3 -0
  152. package/runtime/server.js +68 -68
  153. package/runtime/stores/gxpPortalConfigStore.js +204 -186
  154. package/runtime/stores/index.js +2 -2
  155. package/runtime/vite-inspector-plugin.js +858 -707
  156. package/runtime/vite-source-tracker-plugin.js +132 -113
  157. package/runtime/vite.config.js +191 -139
  158. package/scripts/launch-chrome.js +41 -41
  159. package/scripts/pack-chrome.js +38 -39
  160. package/socket-events/AiSessionMessageCreated.json +17 -17
  161. package/socket-events/SocialStreamPostCreated.json +23 -23
  162. package/socket-events/SocialStreamPostVariantCompleted.json +22 -22
  163. package/template/.claude/agents/gxp-developer.md +100 -99
  164. package/template/.claude/settings.json +7 -7
  165. package/template/AGENTS.md +30 -23
  166. package/template/GEMINI.md +20 -20
  167. package/template/README.md +70 -53
  168. package/template/app-manifest.json +2 -4
  169. package/template/configuration.json +10 -10
  170. package/template/default-styling.css +1 -1
  171. package/template/index.html +18 -20
  172. package/template/main.js +24 -22
  173. package/template/src/DemoPage.vue +415 -362
  174. package/template/src/Plugin.vue +76 -85
  175. package/template/src/stores/index.js +3 -3
  176. package/template/src/stores/test-data.json +164 -172
  177. package/template/theme-layouts/AdditionalStyling.css +50 -50
  178. package/template/theme-layouts/PrivateLayout.vue +8 -12
  179. package/template/theme-layouts/PublicLayout.vue +8 -12
  180. package/template/theme-layouts/SystemLayout.vue +8 -12
  181. package/template/vite.extend.js +45 -0
  182. package/template/vite.config.js +0 -409
@@ -1,16 +1,16 @@
1
- import React from 'react';
2
- import { Box, Text } from 'ink';
3
- import { createRequire } from 'module';
4
- import { fileURLToPath } from 'url';
5
- import { dirname, join } from 'path';
1
+ import React from "react"
2
+ import { Box, Text } from "ink"
3
+ import { createRequire } from "module"
4
+ import { fileURLToPath } from "url"
5
+ import { dirname, join } from "path"
6
6
 
7
- const require = createRequire(import.meta.url);
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = dirname(__filename);
7
+ const require = createRequire(import.meta.url)
8
+ const __filename = fileURLToPath(import.meta.url)
9
+ const __dirname = dirname(__filename)
10
10
 
11
11
  // Navigate up from dist/tui/components to package root
12
- const pkgPath = join(__dirname, '..', '..', '..', 'package.json');
13
- const pkg = require(pkgPath);
12
+ const pkgPath = join(__dirname, "..", "..", "..", "package.json")
13
+ const pkg = require(pkgPath)
14
14
 
15
15
  const LOGO = `
16
16
  ██████╗ ██╗ ██╗██████╗
@@ -19,74 +19,129 @@ const LOGO = `
19
19
  ██║ ██║ ██╔██╗ ██╔═══╝
20
20
  ╚██████╔╝██╔╝ ██╗██║
21
21
  ╚═════╝ ╚═╝ ╚═╝╚═╝
22
- `;
22
+ `
23
23
 
24
24
  export default function WelcomeScreen() {
25
- return (
26
- <Box
27
- flexDirection="column"
28
- alignItems="center"
29
- justifyContent="center"
30
- flexGrow={1}
31
- padding={1}
32
- >
33
- <Text color="blue">{LOGO}</Text>
25
+ return (
26
+ <Box
27
+ flexDirection="column"
28
+ alignItems="center"
29
+ justifyContent="center"
30
+ flexGrow={1}
31
+ padding={1}
32
+ >
33
+ <Text color="blue">{LOGO}</Text>
34
34
 
35
- <Box marginTop={1} flexDirection="column" alignItems="center">
36
- <Text bold color="white">GxP DevStudio</Text>
37
- <Text dimColor>v{pkg.version}</Text>
38
- </Box>
35
+ <Box marginTop={1} flexDirection="column" alignItems="center">
36
+ <Text bold color="white">
37
+ GxP DevStudio
38
+ </Text>
39
+ <Text dimColor>v{pkg.version}</Text>
40
+ </Box>
39
41
 
40
- <Box marginTop={1}>
41
- <Text color="gray">Interactive development environment for GxP plugins</Text>
42
- </Box>
42
+ <Box marginTop={1}>
43
+ <Text color="gray">
44
+ Interactive development environment for GxP plugins
45
+ </Text>
46
+ </Box>
43
47
 
44
- <Box marginTop={2} flexDirection="row" justifyContent="center">
45
- {/* Quick Start Column */}
46
- <Box flexDirection="column" marginRight={4}>
47
- <Text color="cyan" bold>Quick Start</Text>
48
- <Box marginTop={1} flexDirection="column">
49
- <Text> <Text color="yellow">/dev</Text> Start Vite + Socket.IO</Text>
50
- <Text> <Text color="yellow">/dev --no-socket</Text> Start Vite only (no Socket)</Text>
51
- <Text> <Text color="yellow">/dev --with-mock</Text> Start with Mock API</Text>
52
- <Text> <Text color="yellow">/socket</Text> Start Socket.IO server</Text>
53
- <Text> <Text color="yellow">/ext chrome</Text> Launch Chrome extension</Text>
54
- <Text> <Text color="yellow">/help</Text> Show all commands</Text>
55
- </Box>
56
- </Box>
48
+ <Box marginTop={2} flexDirection="row" justifyContent="center">
49
+ {/* Quick Start Column */}
50
+ <Box flexDirection="column" marginRight={4}>
51
+ <Text color="cyan" bold>
52
+ Quick Start
53
+ </Text>
54
+ <Box marginTop={1} flexDirection="column">
55
+ <Text>
56
+ {" "}
57
+ <Text color="yellow">/dev</Text> Start Vite + Socket.IO
58
+ </Text>
59
+ <Text>
60
+ {" "}
61
+ <Text color="yellow">/dev --no-socket</Text> Start Vite only (no
62
+ Socket)
63
+ </Text>
64
+ <Text>
65
+ {" "}
66
+ <Text color="yellow">/dev --with-mock</Text> Start with Mock API
67
+ </Text>
68
+ <Text>
69
+ {" "}
70
+ <Text color="yellow">/socket</Text> Start Socket.IO server
71
+ </Text>
72
+ <Text>
73
+ {" "}
74
+ <Text color="yellow">/ext chrome</Text> Launch Chrome extension
75
+ </Text>
76
+ <Text>
77
+ {" "}
78
+ <Text color="yellow">/help</Text> Show all commands
79
+ </Text>
80
+ </Box>
81
+ </Box>
57
82
 
58
- {/* Keyboard Shortcuts Column */}
59
- <Box flexDirection="column" marginLeft={4}>
60
- <Text color="cyan" bold>Keyboard Shortcuts</Text>
61
- <Box marginTop={1} flexDirection="column">
62
- <Text> <Text color="green">Tab</Text> Cycle through tabs</Text>
63
- <Text> <Text color="green">Left/Right</Text> Switch tabs</Text>
64
- <Text> <Text color="green">Ctrl+K</Text> Stop current service</Text>
65
- <Text> <Text color="green">Ctrl+L</Text> Clear current log</Text>
66
- <Text> <Text color="green">Ctrl+C</Text> Exit application</Text>
67
- </Box>
68
- </Box>
69
- </Box>
83
+ {/* Keyboard Shortcuts Column */}
84
+ <Box flexDirection="column" marginLeft={4}>
85
+ <Text color="cyan" bold>
86
+ Keyboard Shortcuts
87
+ </Text>
88
+ <Box marginTop={1} flexDirection="column">
89
+ <Text>
90
+ {" "}
91
+ <Text color="green">Tab</Text> Cycle through tabs
92
+ </Text>
93
+ <Text>
94
+ {" "}
95
+ <Text color="green">Left/Right</Text> Switch tabs
96
+ </Text>
97
+ <Text>
98
+ {" "}
99
+ <Text color="green">Ctrl+K</Text> Stop current service
100
+ </Text>
101
+ <Text>
102
+ {" "}
103
+ <Text color="green">Ctrl+L</Text> Clear current log
104
+ </Text>
105
+ <Text>
106
+ {" "}
107
+ <Text color="green">Ctrl+C</Text> Exit application
108
+ </Text>
109
+ </Box>
110
+ </Box>
111
+ </Box>
70
112
 
71
- <Box marginTop={2} flexDirection="column" alignItems="center">
72
- <Text color="cyan" bold>Socket Events</Text>
73
- <Box marginTop={1} flexDirection="column" alignItems="center">
74
- <Text color="gray">Use <Text color="yellow">/socket list</Text> to see available events</Text>
75
- <Text color="gray">Use <Text color="yellow">/socket send EventName</Text> to simulate events</Text>
76
- </Box>
77
- </Box>
113
+ <Box marginTop={2} flexDirection="column" alignItems="center">
114
+ <Text color="cyan" bold>
115
+ Socket Events
116
+ </Text>
117
+ <Box marginTop={1} flexDirection="column" alignItems="center">
118
+ <Text color="gray">
119
+ Use <Text color="yellow">/socket list</Text> to see available events
120
+ </Text>
121
+ <Text color="gray">
122
+ Use <Text color="yellow">/socket send EventName</Text> to simulate
123
+ events
124
+ </Text>
125
+ </Box>
126
+ </Box>
78
127
 
79
- <Box marginTop={2} flexDirection="column" alignItems="center">
80
- <Text color="cyan" bold>Browser Extensions</Text>
81
- <Box marginTop={1} flexDirection="column" alignItems="center">
82
- <Text color="gray">Test your plugin on live GxP pages with the browser extension</Text>
83
- <Text color="gray">Open DevTools and use the "GxP Inspector" panel to select components</Text>
84
- </Box>
85
- </Box>
128
+ <Box marginTop={2} flexDirection="column" alignItems="center">
129
+ <Text color="cyan" bold>
130
+ Browser Extensions
131
+ </Text>
132
+ <Box marginTop={1} flexDirection="column" alignItems="center">
133
+ <Text color="gray">
134
+ Test your plugin on live GxP pages with the browser extension
135
+ </Text>
136
+ <Text color="gray">
137
+ Open DevTools and use the "GxP Inspector" panel to select components
138
+ </Text>
139
+ </Box>
140
+ </Box>
86
141
 
87
- <Box marginTop={2}>
88
- <Text dimColor>Type a command below to get started...</Text>
89
- </Box>
90
- </Box>
91
- );
142
+ <Box marginTop={2}>
143
+ <Text dimColor>Type a command below to get started...</Text>
144
+ </Box>
145
+ </Box>
146
+ )
92
147
  }
@@ -1,53 +1,51 @@
1
1
  #!/usr/bin/env node
2
- import React from 'react';
3
- import { render } from 'ink';
4
- import dotenv from 'dotenv';
5
- import path from 'path';
6
- import App from './App.js';
7
- import { serviceManager } from './services/index.js';
2
+ import React from "react"
3
+ import { render } from "ink"
4
+ import dotenv from "dotenv"
5
+ import path from "path"
6
+ import App from "./App.js"
7
+ import { serviceManager } from "./services/index.js"
8
8
 
9
9
  // Load .env from the current working directory (project directory)
10
- dotenv.config({ path: path.join(process.cwd(), '.env') });
10
+ dotenv.config({ path: path.join(process.cwd(), ".env") })
11
11
 
12
12
  interface TUIOptions {
13
- autoStart?: string[]; // Commands to auto-start (e.g., ['dev', 'socket'])
14
- args?: Record<string, unknown>; // Command arguments
13
+ autoStart?: string[] // Commands to auto-start (e.g., ['dev', 'socket'])
14
+ args?: Record<string, unknown> // Command arguments
15
15
  }
16
16
 
17
17
  export function startTUI(options: TUIOptions = {}) {
18
- // Check if stdin supports raw mode (required for Ink input handling)
19
- // This can fail when:
20
- // - Running in CI environments
21
- // - Piped input (stdin is not a TTY)
22
- // - Some terminal emulators
23
- const stdin = process.stdin;
24
- const stdinIsTTY = stdin.isTTY === true;
25
-
26
- // If stdin doesn't support raw mode, we need to handle it gracefully
27
- // Ink 5.x uses stdin by default and requires raw mode for input
28
- if (!stdinIsTTY) {
29
- throw new Error('NO_TTY');
30
- }
31
-
32
- const { waitUntilExit } = render(
33
- <App
34
- autoStart={options.autoStart}
35
- args={options.args}
36
- />
37
- );
38
-
39
- waitUntilExit().then(() => {
40
- // Ensure all services are stopped before exiting
41
- serviceManager.forceStopAll();
42
- process.exit(0);
43
- });
18
+ // Check if stdin supports raw mode (required for Ink input handling)
19
+ // This can fail when:
20
+ // - Running in CI environments
21
+ // - Piped input (stdin is not a TTY)
22
+ // - Some terminal emulators
23
+ const stdin = process.stdin
24
+ const stdinIsTTY = stdin.isTTY === true
25
+
26
+ // If stdin doesn't support raw mode, we need to handle it gracefully
27
+ // Ink 5.x uses stdin by default and requires raw mode for input
28
+ if (!stdinIsTTY) {
29
+ throw new Error("NO_TTY")
30
+ }
31
+
32
+ const { waitUntilExit } = render(
33
+ <App autoStart={options.autoStart} args={options.args} />,
34
+ )
35
+
36
+ waitUntilExit().then(() => {
37
+ // Ensure all services are stopped before exiting
38
+ serviceManager.forceStopAll()
39
+ process.exit(0)
40
+ })
44
41
  }
45
42
 
46
43
  // Check if run directly (ESM way)
47
- import { fileURLToPath } from 'url';
48
- const isMain = process.argv[1] && process.argv[1] === fileURLToPath(import.meta.url);
44
+ import { fileURLToPath } from "url"
45
+ const isMain =
46
+ process.argv[1] && process.argv[1] === fileURLToPath(import.meta.url)
49
47
  if (isMain) {
50
- startTUI();
48
+ startTUI()
51
49
  }
52
50
 
53
- export default startTUI;
51
+ export default startTUI