@gxp-dev/tools 2.0.62 → 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.
- package/README.md +32 -31
- package/bin/gx-devtools.js +74 -54
- package/bin/lib/cli.js +23 -21
- package/bin/lib/commands/add-dependency.js +366 -325
- package/bin/lib/commands/assets.js +137 -139
- package/bin/lib/commands/build.js +169 -174
- package/bin/lib/commands/datastore.js +181 -183
- package/bin/lib/commands/dev.js +127 -131
- package/bin/lib/commands/extensions.js +147 -149
- package/bin/lib/commands/extract-config.js +73 -67
- package/bin/lib/commands/index.js +12 -12
- package/bin/lib/commands/init.js +342 -240
- package/bin/lib/commands/publish.js +69 -75
- package/bin/lib/commands/socket.js +69 -69
- package/bin/lib/commands/ssl.js +14 -14
- package/bin/lib/constants.js +10 -24
- package/bin/lib/tui/App.tsx +761 -705
- package/bin/lib/tui/components/AIPanel.tsx +191 -171
- package/bin/lib/tui/components/CommandInput.tsx +394 -343
- package/bin/lib/tui/components/GeminiPanel.tsx +175 -151
- package/bin/lib/tui/components/Header.tsx +23 -21
- package/bin/lib/tui/components/LogPanel.tsx +244 -220
- package/bin/lib/tui/components/TabBar.tsx +50 -48
- package/bin/lib/tui/components/WelcomeScreen.tsx +126 -71
- package/bin/lib/tui/index.tsx +37 -39
- package/bin/lib/tui/services/AIService.ts +518 -462
- package/bin/lib/tui/services/ExtensionService.ts +140 -129
- package/bin/lib/tui/services/GeminiService.ts +367 -337
- package/bin/lib/tui/services/ServiceManager.ts +344 -322
- package/bin/lib/tui/services/SocketService.ts +168 -168
- package/bin/lib/tui/services/ViteService.ts +88 -88
- package/bin/lib/tui/services/index.ts +47 -22
- package/bin/lib/utils/ai-scaffold.js +291 -280
- package/bin/lib/utils/extract-config.js +157 -140
- package/bin/lib/utils/files.js +82 -86
- package/bin/lib/utils/index.js +7 -7
- package/bin/lib/utils/paths.js +34 -34
- package/bin/lib/utils/prompts.js +194 -169
- package/bin/lib/utils/ssl.js +79 -81
- package/browser-extensions/README.md +0 -1
- package/browser-extensions/chrome/background.js +244 -237
- package/browser-extensions/chrome/content.js +32 -29
- package/browser-extensions/chrome/devtools.html +7 -7
- package/browser-extensions/chrome/devtools.js +19 -19
- package/browser-extensions/chrome/inspector.js +802 -767
- package/browser-extensions/chrome/manifest.json +71 -63
- package/browser-extensions/chrome/panel.html +674 -636
- package/browser-extensions/chrome/panel.js +722 -712
- package/browser-extensions/chrome/popup.html +586 -543
- package/browser-extensions/chrome/popup.js +282 -244
- package/browser-extensions/chrome/rules.json +1 -1
- package/browser-extensions/chrome/test-chrome.html +216 -136
- package/browser-extensions/chrome/test-mixed-content.html +284 -189
- package/browser-extensions/chrome/test-uri-pattern.html +221 -198
- package/browser-extensions/firefox/README.md +9 -6
- package/browser-extensions/firefox/background.js +221 -218
- package/browser-extensions/firefox/content.js +55 -52
- package/browser-extensions/firefox/debug-errors.html +386 -228
- package/browser-extensions/firefox/debug-https.html +153 -105
- package/browser-extensions/firefox/devtools.html +7 -7
- package/browser-extensions/firefox/devtools.js +23 -20
- package/browser-extensions/firefox/inspector.js +802 -767
- package/browser-extensions/firefox/manifest.json +68 -68
- package/browser-extensions/firefox/panel.html +674 -636
- package/browser-extensions/firefox/panel.js +722 -712
- package/browser-extensions/firefox/popup.html +572 -535
- package/browser-extensions/firefox/popup.js +281 -236
- package/browser-extensions/firefox/test-gramercy.html +170 -125
- package/browser-extensions/firefox/test-imports.html +59 -55
- package/browser-extensions/firefox/test-masking.html +231 -140
- package/browser-extensions/firefox/test-uri-pattern.html +221 -198
- package/dist/tui/App.d.ts +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +154 -150
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/components/AIPanel.d.ts.map +1 -1
- package/dist/tui/components/AIPanel.js +42 -35
- package/dist/tui/components/AIPanel.js.map +1 -1
- package/dist/tui/components/CommandInput.d.ts +1 -1
- package/dist/tui/components/CommandInput.d.ts.map +1 -1
- package/dist/tui/components/CommandInput.js +92 -62
- package/dist/tui/components/CommandInput.js.map +1 -1
- package/dist/tui/components/GeminiPanel.d.ts.map +1 -1
- package/dist/tui/components/GeminiPanel.js +37 -30
- package/dist/tui/components/GeminiPanel.js.map +1 -1
- package/dist/tui/components/Header.d.ts.map +1 -1
- package/dist/tui/components/Header.js +1 -1
- package/dist/tui/components/Header.js.map +1 -1
- package/dist/tui/components/LogPanel.d.ts +1 -1
- package/dist/tui/components/LogPanel.d.ts.map +1 -1
- package/dist/tui/components/LogPanel.js +26 -24
- package/dist/tui/components/LogPanel.js.map +1 -1
- package/dist/tui/components/TabBar.d.ts +2 -2
- package/dist/tui/components/TabBar.d.ts.map +1 -1
- package/dist/tui/components/TabBar.js +11 -11
- package/dist/tui/components/TabBar.js.map +1 -1
- package/dist/tui/components/WelcomeScreen.d.ts.map +1 -1
- package/dist/tui/components/WelcomeScreen.js +6 -6
- package/dist/tui/components/WelcomeScreen.js.map +1 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +8 -8
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/services/AIService.d.ts +2 -2
- package/dist/tui/services/AIService.d.ts.map +1 -1
- package/dist/tui/services/AIService.js +165 -125
- package/dist/tui/services/AIService.js.map +1 -1
- package/dist/tui/services/ExtensionService.d.ts +1 -1
- package/dist/tui/services/ExtensionService.d.ts.map +1 -1
- package/dist/tui/services/ExtensionService.js +33 -26
- package/dist/tui/services/ExtensionService.js.map +1 -1
- package/dist/tui/services/GeminiService.d.ts +1 -1
- package/dist/tui/services/GeminiService.d.ts.map +1 -1
- package/dist/tui/services/GeminiService.js +87 -76
- package/dist/tui/services/GeminiService.js.map +1 -1
- package/dist/tui/services/ServiceManager.d.ts +3 -3
- package/dist/tui/services/ServiceManager.d.ts.map +1 -1
- package/dist/tui/services/ServiceManager.js +72 -58
- package/dist/tui/services/ServiceManager.js.map +1 -1
- package/dist/tui/services/SocketService.d.ts.map +1 -1
- package/dist/tui/services/SocketService.js +32 -32
- package/dist/tui/services/SocketService.js.map +1 -1
- package/dist/tui/services/ViteService.d.ts.map +1 -1
- package/dist/tui/services/ViteService.js +26 -28
- package/dist/tui/services/ViteService.js.map +1 -1
- package/dist/tui/services/index.d.ts +6 -6
- package/dist/tui/services/index.d.ts.map +1 -1
- package/dist/tui/services/index.js +6 -6
- package/dist/tui/services/index.js.map +1 -1
- package/mcp/gxp-api-server.js +83 -81
- package/package.json +109 -93
- package/runtime/PortalContainer.vue +258 -234
- package/runtime/dev-tools/DevToolsModal.vue +153 -155
- package/runtime/dev-tools/LayoutSwitcher.vue +144 -140
- package/runtime/dev-tools/MockDataEditor.vue +456 -433
- package/runtime/dev-tools/SocketSimulator.vue +379 -371
- package/runtime/dev-tools/StoreInspector.vue +517 -455
- package/runtime/dev-tools/index.js +5 -5
- package/runtime/fallback-layouts/PrivateLayout.vue +2 -2
- package/runtime/fallback-layouts/PublicLayout.vue +2 -2
- package/runtime/fallback-layouts/SystemLayout.vue +2 -2
- package/runtime/gxpStringsPlugin.js +159 -134
- package/runtime/index.html +17 -19
- package/runtime/main.js +24 -22
- package/runtime/mock-api/auth-middleware.js +15 -15
- package/runtime/mock-api/image-generator.js +46 -46
- package/runtime/mock-api/index.js +55 -55
- package/runtime/mock-api/response-generator.js +116 -105
- package/runtime/mock-api/route-generator.js +107 -84
- package/runtime/mock-api/socket-triggers.js +94 -93
- package/runtime/mock-api/spec-loader.js +79 -80
- package/runtime/package.json +3 -0
- package/runtime/server.js +68 -68
- package/runtime/stores/gxpPortalConfigStore.js +204 -186
- package/runtime/stores/index.js +2 -2
- package/runtime/vite-inspector-plugin.js +858 -707
- package/runtime/vite-source-tracker-plugin.js +132 -113
- package/runtime/vite.config.js +207 -132
- package/scripts/launch-chrome.js +41 -41
- package/scripts/pack-chrome.js +38 -39
- package/socket-events/AiSessionMessageCreated.json +17 -17
- package/socket-events/SocialStreamPostCreated.json +23 -23
- package/socket-events/SocialStreamPostVariantCompleted.json +22 -22
- package/template/.claude/agents/gxp-developer.md +100 -99
- package/template/.claude/settings.json +7 -7
- package/template/AGENTS.md +30 -23
- package/template/GEMINI.md +20 -20
- package/template/README.md +70 -53
- package/template/app-manifest.json +2 -4
- package/template/configuration.json +10 -10
- package/template/default-styling.css +1 -1
- package/template/index.html +18 -20
- package/template/main.js +24 -22
- package/template/src/DemoPage.vue +415 -362
- package/template/src/Plugin.vue +76 -85
- package/template/src/stores/index.js +3 -3
- package/template/src/stores/test-data.json +164 -172
- package/template/theme-layouts/AdditionalStyling.css +50 -50
- package/template/theme-layouts/PrivateLayout.vue +8 -12
- package/template/theme-layouts/PublicLayout.vue +8 -12
- package/template/theme-layouts/SystemLayout.vue +8 -12
- package/template/vite.extend.js +45 -0
- package/template/vite.config.js +0 -409
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Box, Text } from
|
|
3
|
-
import { createRequire } from
|
|
4
|
-
import { fileURLToPath } from
|
|
5
|
-
import { dirname, join } from
|
|
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,
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
<Box marginTop={1}>
|
|
43
|
+
<Text color="gray">
|
|
44
|
+
Interactive development environment for GxP plugins
|
|
45
|
+
</Text>
|
|
46
|
+
</Box>
|
|
43
47
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
142
|
+
<Box marginTop={2}>
|
|
143
|
+
<Text dimColor>Type a command below to get started...</Text>
|
|
144
|
+
</Box>
|
|
145
|
+
</Box>
|
|
146
|
+
)
|
|
92
147
|
}
|
package/bin/lib/tui/index.tsx
CHANGED
|
@@ -1,53 +1,51 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import React from
|
|
3
|
-
import { render } from
|
|
4
|
-
import dotenv from
|
|
5
|
-
import path from
|
|
6
|
-
import App from
|
|
7
|
-
import { serviceManager } from
|
|
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(),
|
|
10
|
+
dotenv.config({ path: path.join(process.cwd(), ".env") })
|
|
11
11
|
|
|
12
12
|
interface TUIOptions {
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
|
48
|
-
const isMain =
|
|
44
|
+
import { fileURLToPath } from "url"
|
|
45
|
+
const isMain =
|
|
46
|
+
process.argv[1] && process.argv[1] === fileURLToPath(import.meta.url)
|
|
49
47
|
if (isMain) {
|
|
50
|
-
|
|
48
|
+
startTUI()
|
|
51
49
|
}
|
|
52
50
|
|
|
53
|
-
export default startTUI
|
|
51
|
+
export default startTUI
|