ai-extension-preview 0.1.10 → 0.1.11
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/dist/index.js +2 -5
- package/dist/plugins/BrowserPlugin.js +16 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ async function authenticate(host) {
|
|
|
41
41
|
const statusRes = await axios.get(`${host}/preview/status/${sessionId}`);
|
|
42
42
|
const data = statusRes.data;
|
|
43
43
|
if (data.status === 'linked') {
|
|
44
|
-
|
|
44
|
+
console.log(chalk.green('✔ Connected!'));
|
|
45
45
|
if (!data.jobId) {
|
|
46
46
|
console.error('Error: No Job ID associated with this connection.');
|
|
47
47
|
process.exit(1);
|
|
@@ -97,10 +97,7 @@ async function main() {
|
|
|
97
97
|
});
|
|
98
98
|
// 2. Register Plugins
|
|
99
99
|
// Note: In a real dynamic system we might load these from a folder
|
|
100
|
-
|
|
101
|
-
// Register Plugins
|
|
102
|
-
// UI Plugin first or last?
|
|
103
|
-
// If first, it captures subsequent logs.
|
|
100
|
+
runtime.logger.info('Registering plugins...');
|
|
104
101
|
runtime.registerPlugin(CorePlugin);
|
|
105
102
|
runtime.registerPlugin(DownloaderPlugin);
|
|
106
103
|
runtime.registerPlugin(BrowserPlugin);
|
|
@@ -97,11 +97,14 @@ export const BrowserPlugin = {
|
|
|
97
97
|
if (!isWSL && process.platform === 'win32') {
|
|
98
98
|
executable = normalizePathToWindows(chromePath);
|
|
99
99
|
}
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
const isWin = process.platform === 'win32';
|
|
101
|
+
const STAGING_DIR = isWSL
|
|
102
|
+
? '/mnt/c/Temp/ai-ext-preview'
|
|
103
|
+
: (isWin ? 'C:\\Temp\\ai-ext-preview' : path.join(config.workDir, '../staging'));
|
|
104
|
+
// On Windows (Native or WSL host), Chrome sees:
|
|
105
|
+
const EXTENSION_PATH = (isWSL || isWin) ? 'C:\\Temp\\ai-ext-preview' : STAGING_DIR;
|
|
106
|
+
// Clean profile path for everyone
|
|
107
|
+
const WIN_PROFILE_DIR = 'C:\\Temp\\ai-ext-profile';
|
|
105
108
|
// --- SYNC FUNCTION ---
|
|
106
109
|
const syncToStaging = async () => {
|
|
107
110
|
try {
|
|
@@ -251,8 +254,14 @@ Start-Process -FilePath $chromePath -ArgumentList $argStr
|
|
|
251
254
|
else {
|
|
252
255
|
// Native Windows / Linux
|
|
253
256
|
// Use extensionRoot which points to the detected subfolder or root
|
|
254
|
-
|
|
255
|
-
|
|
257
|
+
let safeDist = path.resolve(extensionRoot);
|
|
258
|
+
let safeProfile = path.join(path.dirname(config.workDir), 'profile'); // Default Linux/Mac
|
|
259
|
+
// FIX: On Git Bash (win32), ensure paths are C:\Style for Chrome
|
|
260
|
+
if (process.platform === 'win32') {
|
|
261
|
+
safeDist = normalizePathToWindows(safeDist);
|
|
262
|
+
// Use C:\Temp profile to avoid permissions issues, matching WSL strategy
|
|
263
|
+
safeProfile = WIN_PROFILE_DIR;
|
|
264
|
+
}
|
|
256
265
|
await ctx.actions.runAction('core:log', { level: 'info', message: `Native Launch Executable: ${executable}` });
|
|
257
266
|
await ctx.actions.runAction('core:log', { level: 'info', message: `Native Launch Target: ${safeDist}` });
|
|
258
267
|
const cleanArgs = [
|