@gxp-dev/tools 2.0.63 → 2.0.65
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 +191 -139
- 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,147 +1,150 @@
|
|
|
1
1
|
// Override fetch to intercept requests
|
|
2
|
-
(function () {
|
|
3
|
-
const originalFetch = window.fetch
|
|
4
|
-
let isProxyEnabled = false
|
|
5
|
-
let proxyConfig = {}
|
|
6
|
-
let inspectorEnabled = false
|
|
2
|
+
;(function () {
|
|
3
|
+
const originalFetch = window.fetch
|
|
4
|
+
let isProxyEnabled = false
|
|
5
|
+
let proxyConfig = {}
|
|
6
|
+
let inspectorEnabled = false
|
|
7
7
|
|
|
8
8
|
// Get initial state from background script
|
|
9
9
|
browser.runtime
|
|
10
10
|
.sendMessage({ action: "getConfig" })
|
|
11
11
|
.then((response) => {
|
|
12
12
|
if (response) {
|
|
13
|
-
isProxyEnabled = response.enabled
|
|
14
|
-
proxyConfig = response
|
|
13
|
+
isProxyEnabled = response.enabled
|
|
14
|
+
proxyConfig = response
|
|
15
15
|
console.log("[Traffic Proxy Content] Config received:", {
|
|
16
16
|
enabled: isProxyEnabled,
|
|
17
17
|
config: proxyConfig,
|
|
18
18
|
url: window.location.href,
|
|
19
|
-
})
|
|
19
|
+
})
|
|
20
20
|
}
|
|
21
21
|
})
|
|
22
22
|
.catch((err) =>
|
|
23
|
-
console.error("[Traffic Proxy Content] Failed to get proxy config:", err)
|
|
24
|
-
)
|
|
23
|
+
console.error("[Traffic Proxy Content] Failed to get proxy config:", err),
|
|
24
|
+
)
|
|
25
25
|
|
|
26
26
|
// Listen for config changes and inspector messages
|
|
27
27
|
browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|
28
28
|
if (message.action === "configUpdate") {
|
|
29
|
-
isProxyEnabled = message.enabled
|
|
30
|
-
proxyConfig = message.config
|
|
29
|
+
isProxyEnabled = message.enabled
|
|
30
|
+
proxyConfig = message.config
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// Inspector toggle request from popup
|
|
34
34
|
if (message.action === "toggleInspector") {
|
|
35
35
|
// Relay to page context via postMessage
|
|
36
|
-
window.postMessage(
|
|
36
|
+
window.postMessage(
|
|
37
|
+
{ type: "GXP_INSPECTOR_ACTION", action: "toggleInspector" },
|
|
38
|
+
"*",
|
|
39
|
+
)
|
|
37
40
|
// Toggle local state
|
|
38
|
-
inspectorEnabled = !inspectorEnabled
|
|
39
|
-
sendResponse({ enabled: inspectorEnabled })
|
|
40
|
-
return true
|
|
41
|
+
inspectorEnabled = !inspectorEnabled
|
|
42
|
+
sendResponse({ enabled: inspectorEnabled })
|
|
43
|
+
return true
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
// Get inspector state request from popup
|
|
44
47
|
if (message.action === "getInspectorState") {
|
|
45
|
-
sendResponse({ enabled: inspectorEnabled })
|
|
46
|
-
return true
|
|
48
|
+
sendResponse({ enabled: inspectorEnabled })
|
|
49
|
+
return true
|
|
47
50
|
}
|
|
48
|
-
})
|
|
51
|
+
})
|
|
49
52
|
|
|
50
53
|
// Listen for messages from page context (inspector.js)
|
|
51
|
-
window.addEventListener(
|
|
52
|
-
if (event.source !== window) return
|
|
54
|
+
window.addEventListener("message", (event) => {
|
|
55
|
+
if (event.source !== window) return
|
|
53
56
|
|
|
54
57
|
// Inspector state updates from page context
|
|
55
|
-
if (event.data?.type ===
|
|
56
|
-
inspectorEnabled = event.data.enabled
|
|
58
|
+
if (event.data?.type === "GXP_INSPECTOR_STATE") {
|
|
59
|
+
inspectorEnabled = event.data.enabled
|
|
57
60
|
}
|
|
58
|
-
})
|
|
61
|
+
})
|
|
59
62
|
|
|
60
63
|
// Override fetch function
|
|
61
64
|
window.fetch = function (input, init) {
|
|
62
|
-
console.log("fetch", input, init)
|
|
65
|
+
console.log("fetch", input, init)
|
|
63
66
|
if (!isProxyEnabled) {
|
|
64
|
-
return originalFetch.apply(this, arguments)
|
|
67
|
+
return originalFetch.apply(this, arguments)
|
|
65
68
|
}
|
|
66
69
|
|
|
67
|
-
let url = input
|
|
70
|
+
let url = input
|
|
68
71
|
if (typeof input === "object" && input.url) {
|
|
69
|
-
url = input.url
|
|
72
|
+
url = input.url
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
// Apply proxy rules
|
|
73
|
-
const modifiedUrl = applyProxyRules(url)
|
|
76
|
+
const modifiedUrl = applyProxyRules(url)
|
|
74
77
|
|
|
75
78
|
// If URL was modified, use the new URL
|
|
76
79
|
if (modifiedUrl !== url) {
|
|
77
80
|
if (typeof input === "string") {
|
|
78
|
-
input = modifiedUrl
|
|
81
|
+
input = modifiedUrl
|
|
79
82
|
} else if (typeof input === "object") {
|
|
80
|
-
input = new Request(modifiedUrl, input)
|
|
83
|
+
input = new Request(modifiedUrl, input)
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
86
|
|
|
84
|
-
return originalFetch.apply(this, arguments)
|
|
85
|
-
}
|
|
87
|
+
return originalFetch.apply(this, arguments)
|
|
88
|
+
}
|
|
86
89
|
|
|
87
90
|
// Apply proxy rules to URL
|
|
88
91
|
function applyProxyRules(url) {
|
|
89
92
|
if (!proxyConfig || !proxyConfig.rules) {
|
|
90
|
-
return url
|
|
93
|
+
return url
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
try {
|
|
94
97
|
// Check each rule type
|
|
95
98
|
for (const [ruleType, rule] of Object.entries(proxyConfig.rules)) {
|
|
96
|
-
if (!rule.enabled || !rule.pattern) continue
|
|
99
|
+
if (!rule.enabled || !rule.pattern) continue
|
|
97
100
|
|
|
98
|
-
const regex = new RegExp(rule.pattern, "i")
|
|
101
|
+
const regex = new RegExp(rule.pattern, "i")
|
|
99
102
|
if (regex.test(url)) {
|
|
100
103
|
// Handle blank return for CSS
|
|
101
104
|
if (rule.returnBlank) {
|
|
102
105
|
console.log(
|
|
103
|
-
`[Traffic Proxy Content] Returning blank for ${ruleType}: ${url}
|
|
104
|
-
)
|
|
106
|
+
`[Traffic Proxy Content] Returning blank for ${ruleType}: ${url}`,
|
|
107
|
+
)
|
|
105
108
|
return ruleType === "css"
|
|
106
109
|
? "data:text/css;charset=utf-8,"
|
|
107
|
-
: "data:text/javascript;charset=utf-8,"
|
|
110
|
+
: "data:text/javascript;charset=utf-8,"
|
|
108
111
|
}
|
|
109
112
|
|
|
110
113
|
// Handle redirect
|
|
111
114
|
if (rule.redirectUrl) {
|
|
112
115
|
console.log(
|
|
113
|
-
`[Traffic Proxy Content] Redirecting ${ruleType}: ${url} → ${rule.redirectUrl}
|
|
114
|
-
)
|
|
115
|
-
return rule.redirectUrl
|
|
116
|
+
`[Traffic Proxy Content] Redirecting ${ruleType}: ${url} → ${rule.redirectUrl}`,
|
|
117
|
+
)
|
|
118
|
+
return rule.redirectUrl
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
122
|
} catch (e) {
|
|
120
|
-
console.log("Error processing URL for proxy rules:", url, e)
|
|
123
|
+
console.log("Error processing URL for proxy rules:", url, e)
|
|
121
124
|
}
|
|
122
125
|
|
|
123
|
-
return url
|
|
126
|
+
return url
|
|
124
127
|
}
|
|
125
128
|
|
|
126
129
|
// Override XMLHttpRequest as well
|
|
127
|
-
const originalXHROpen = XMLHttpRequest.prototype.open
|
|
130
|
+
const originalXHROpen = XMLHttpRequest.prototype.open
|
|
128
131
|
XMLHttpRequest.prototype.open = function (
|
|
129
132
|
method,
|
|
130
133
|
url,
|
|
131
134
|
async,
|
|
132
135
|
user,
|
|
133
|
-
password
|
|
136
|
+
password,
|
|
134
137
|
) {
|
|
135
|
-
console.log("open", method, url, async, user, password)
|
|
138
|
+
console.log("open", method, url, async, user, password)
|
|
136
139
|
if (isProxyEnabled) {
|
|
137
|
-
url = applyProxyRules(url)
|
|
140
|
+
url = applyProxyRules(url)
|
|
138
141
|
}
|
|
139
|
-
return originalXHROpen.call(this, method, url, async, user, password)
|
|
140
|
-
}
|
|
142
|
+
return originalXHROpen.call(this, method, url, async, user, password)
|
|
143
|
+
}
|
|
141
144
|
|
|
142
145
|
// Note: Dynamic imports (import('module')) are handled by the background script's webRequest API
|
|
143
146
|
// Static imports (import ... from 'module') are also handled by webRequest API
|
|
144
147
|
// This content script primarily handles fetch() and XHR calls
|
|
145
148
|
|
|
146
|
-
console.log("Traffic Proxy content script loaded")
|
|
147
|
-
})()
|
|
149
|
+
console.log("Traffic Proxy content script loaded")
|
|
150
|
+
})()
|