dev3000 0.0.170 → 0.0.173
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/cdp-monitor.d.ts +3 -1
- package/dist/cdp-monitor.d.ts.map +1 -1
- package/dist/cdp-monitor.js +44 -9
- package/dist/cdp-monitor.js.map +1 -1
- package/dist/cli.js +196 -81
- package/dist/cli.js.map +1 -1
- package/dist/commands/crawl.d.ts.map +1 -1
- package/dist/commands/crawl.js +1 -1
- package/dist/commands/crawl.js.map +1 -1
- package/dist/dev-environment.d.ts +10 -1
- package/dist/dev-environment.d.ts.map +1 -1
- package/dist/dev-environment.js +72 -32
- package/dist/dev-environment.js.map +1 -1
- package/dist/portless.d.ts +15 -0
- package/dist/portless.d.ts.map +1 -0
- package/dist/portless.js +180 -0
- package/dist/portless.js.map +1 -0
- package/dist/screencast-manager.d.ts +3 -2
- package/dist/screencast-manager.d.ts.map +1 -1
- package/dist/screencast-manager.js +14 -5
- package/dist/screencast-manager.js.map +1 -1
- package/dist/skills/d3k/SKILL.md +40 -0
- package/dist/src/loading.html +2 -2
- package/dist/src/tui-interface-impl.tsx +24 -4
- package/dist/tui-interface-impl.d.ts +2 -0
- package/dist/tui-interface-impl.d.ts.map +1 -1
- package/dist/tui-interface-impl.js +18 -3
- package/dist/tui-interface-impl.js.map +1 -1
- package/dist/tui-interface-opentui.d.ts +2 -0
- package/dist/tui-interface-opentui.d.ts.map +1 -1
- package/dist/tui-interface-opentui.js +265 -24
- package/dist/tui-interface-opentui.js.map +1 -1
- package/dist/tui-interface.d.ts +3 -0
- package/dist/tui-interface.d.ts.map +1 -1
- package/dist/tui-interface.js +12 -4
- package/dist/tui-interface.js.map +1 -1
- package/dist/utils/agent-browser.d.ts.map +1 -1
- package/dist/utils/agent-browser.js +43 -19
- package/dist/utils/agent-browser.js.map +1 -1
- package/dist/utils/agent-selection.d.ts.map +1 -1
- package/dist/utils/agent-selection.js +1 -0
- package/dist/utils/agent-selection.js.map +1 -1
- package/dist/utils/browser-command-argv.d.ts +8 -0
- package/dist/utils/browser-command-argv.d.ts.map +1 -0
- package/dist/utils/browser-command-argv.js +41 -0
- package/dist/utils/browser-command-argv.js.map +1 -0
- package/dist/utils/build-version.d.ts +2 -0
- package/dist/utils/build-version.d.ts.map +1 -0
- package/dist/utils/build-version.js +8 -0
- package/dist/utils/build-version.js.map +1 -0
- package/package.json +24 -21
- package/src/tui-interface-impl.tsx +24 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crawl.js","sourceRoot":"","sources":["../../src/commands/crawl.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"crawl.js","sourceRoot":"","sources":["../../src/commands/crawl.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,KAAK,MAAM,OAAO,CAAA;AAczB,SAAS,kBAAkB;IACzB,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAA;IAC1C,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO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AM,CAAC;gBACP,kCAAkC;YACpC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAA;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAA;IAC7C,OAAO,CAAC,GAAG,EAAE,CAAA;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,cAAc,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAA;IAClE,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC;SACvB,IAAI,EAAE;SACN,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACf,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -40,6 +40,7 @@ interface DevEnvironmentOptions {
|
|
|
40
40
|
serverCommand: string;
|
|
41
41
|
startupTimeoutSeconds: number;
|
|
42
42
|
profileDir: string;
|
|
43
|
+
browserTool: "agent-browser" | "next-browser";
|
|
43
44
|
logFile: string;
|
|
44
45
|
debug?: boolean;
|
|
45
46
|
serversOnly?: boolean;
|
|
@@ -50,6 +51,7 @@ interface DevEnvironmentOptions {
|
|
|
50
51
|
userSetPort?: boolean;
|
|
51
52
|
tail?: boolean;
|
|
52
53
|
tui?: boolean;
|
|
54
|
+
portless?: boolean;
|
|
53
55
|
dateTimeFormat?: "local" | "utc";
|
|
54
56
|
pluginReactScan?: boolean;
|
|
55
57
|
debugPort?: number;
|
|
@@ -92,7 +94,7 @@ export declare function createPersistentLogFile(): string;
|
|
|
92
94
|
* processes belong to THIS d3k instance so we don't accidentally kill
|
|
93
95
|
* Chrome instances from other d3k sessions.
|
|
94
96
|
*/
|
|
95
|
-
export declare function writeSessionInfo(projectName: string, logFilePath: string, appPort: string, cdpUrl?: string | null, chromePids?: number[], serverCommand?: string, framework?: "nextjs" | "svelte" | "other", serverPid?: number, skillsInstalled?: string[], skillsAgentId?: string | null): void;
|
|
97
|
+
export declare function writeSessionInfo(projectName: string, logFilePath: string, appPort: string, publicUrl?: string | null, cdpUrl?: string | null, chromePids?: number[], serverCommand?: string, framework?: "nextjs" | "svelte" | "other", serverPid?: number, skillsInstalled?: string[], skillsAgentId?: string | null, preferredBrowserTool?: "agent-browser" | "next-browser"): void;
|
|
96
98
|
export declare function getSessionChromePids(projectName: string): number[];
|
|
97
99
|
export declare class DevEnvironment {
|
|
98
100
|
private serverProcess;
|
|
@@ -113,8 +115,12 @@ export declare class DevEnvironment {
|
|
|
113
115
|
private portChangeMessage;
|
|
114
116
|
private portDetected;
|
|
115
117
|
private serverUsesHttps;
|
|
118
|
+
private publicAppUrl;
|
|
119
|
+
private portlessAliasName;
|
|
116
120
|
/** Returns "https" or "http" based on detected server protocol */
|
|
117
121
|
private get serverProtocol();
|
|
122
|
+
private get localhostAppUrl();
|
|
123
|
+
private get preferredAppUrl();
|
|
118
124
|
constructor(options: DevEnvironmentOptions);
|
|
119
125
|
private checkPortsAvailable;
|
|
120
126
|
private checkProcessHealth;
|
|
@@ -130,6 +136,9 @@ export declare class DevEnvironment {
|
|
|
130
136
|
private cleanupOrphanedServer;
|
|
131
137
|
private acquireLock;
|
|
132
138
|
private releaseLock;
|
|
139
|
+
private syncPortlessAlias;
|
|
140
|
+
private clearPortlessAlias;
|
|
141
|
+
private writeCurrentSessionInfo;
|
|
133
142
|
private detectPortChange;
|
|
134
143
|
private debugLog;
|
|
135
144
|
private showRecentLogs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-environment.d.ts","sourceRoot":"","sources":["../src/dev-environment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev-environment.d.ts","sourceRoot":"","sources":["../src/dev-environment.ts"],"names":[],"mappings":"AA0DA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,+DAA+D;IAC/D,a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B,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,oBAAoB;IAkD5B,OAAO,CAAC,qBAAqB;IAoB7B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,WAAW;IA6BnB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,uBAAuB;IAqB/B,OAAO,CAAC,gBAAgB;IA4DxB,OAAO,CAAC,QAAQ;IA8BhB,OAAO,CAAC,cAAc;IA2BtB,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,uBAAuB;IAyB/B,OAAO,CAAC,sBAAsB;IAmB9B,OAAO,CAAC,0BAA0B;IAoBlC,OAAO,CAAC,oBAAoB;YA4Bd,aAAa;IA8D3B,OAAO,CAAC,gBAAgB;YAeV,sBAAsB;YAgCtB,kBAAkB;YA+ElB,gBAAgB;IA6I9B,OAAO,CAAC,oBAAoB;YAkKd,cAAc;CA2P7B;AAED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,iBASvE"}
|
package/dist/dev-environment.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
|
-
import { spawn } from "child_process";
|
|
2
|
+
import { execSync, spawn, spawnSync } from "child_process";
|
|
3
3
|
import { appendFileSync, copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, statSync, unlinkSync, writeFileSync } from "fs";
|
|
4
4
|
import https from "https";
|
|
5
5
|
import { createServer } from "net";
|
|
@@ -9,6 +9,7 @@ import { dirname, join, resolve, sep } from "path";
|
|
|
9
9
|
import { fileURLToPath } from "url";
|
|
10
10
|
import { stripVTControlCharacters } from "util";
|
|
11
11
|
import { CDPMonitor } from "./cdp-monitor.js";
|
|
12
|
+
import { ensurePortlessAlias, getPortlessUrl, isPortlessInstalled, removePortlessAlias } from "./portless.js";
|
|
12
13
|
import { ScreencastManager } from "./screencast-manager.js";
|
|
13
14
|
import { NextJsErrorDetector, OutputProcessor, StandardLogParser } from "./services/parsers/index.js";
|
|
14
15
|
import { getBundledSkillsPath, listAvailableSkills } from "./skills/index.js";
|
|
@@ -357,7 +358,7 @@ export function createPersistentLogFile() {
|
|
|
357
358
|
* processes belong to THIS d3k instance so we don't accidentally kill
|
|
358
359
|
* Chrome instances from other d3k sessions.
|
|
359
360
|
*/
|
|
360
|
-
export function writeSessionInfo(projectName, logFilePath, appPort, cdpUrl, chromePids, serverCommand, framework, serverPid, skillsInstalled, skillsAgentId) {
|
|
361
|
+
export function writeSessionInfo(projectName, logFilePath, appPort, publicUrl, cdpUrl, chromePids, serverCommand, framework, serverPid, skillsInstalled, skillsAgentId, preferredBrowserTool) {
|
|
361
362
|
const projectDir = getProjectDir();
|
|
362
363
|
try {
|
|
363
364
|
// Create project directory if it doesn't exist
|
|
@@ -369,6 +370,7 @@ export function writeSessionInfo(projectName, logFilePath, appPort, cdpUrl, chro
|
|
|
369
370
|
projectName,
|
|
370
371
|
logFilePath,
|
|
371
372
|
appPort,
|
|
373
|
+
publicUrl: publicUrl || null,
|
|
372
374
|
cdpUrl: cdpUrl || null,
|
|
373
375
|
startTime: new Date().toISOString(),
|
|
374
376
|
pid: process.pid,
|
|
@@ -378,7 +380,8 @@ export function writeSessionInfo(projectName, logFilePath, appPort, cdpUrl, chro
|
|
|
378
380
|
framework: framework || null,
|
|
379
381
|
serverPid: serverPid || null,
|
|
380
382
|
skillsInstalled: skillsInstalled || [],
|
|
381
|
-
skillsAgentId: skillsAgentId || null
|
|
383
|
+
skillsAgentId: skillsAgentId || null,
|
|
384
|
+
preferredBrowserTool: preferredBrowserTool || "agent-browser"
|
|
382
385
|
};
|
|
383
386
|
// Write session file in project directory
|
|
384
387
|
const sessionFile = join(projectDir, "session.json");
|
|
@@ -476,10 +479,18 @@ export class DevEnvironment {
|
|
|
476
479
|
portChangeMessage = null;
|
|
477
480
|
portDetected = false;
|
|
478
481
|
serverUsesHttps = false;
|
|
482
|
+
publicAppUrl = null;
|
|
483
|
+
portlessAliasName = null;
|
|
479
484
|
/** Returns "https" or "http" based on detected server protocol */
|
|
480
485
|
get serverProtocol() {
|
|
481
486
|
return this.serverUsesHttps ? "https" : "http";
|
|
482
487
|
}
|
|
488
|
+
get localhostAppUrl() {
|
|
489
|
+
return `${this.serverProtocol}://localhost:${this.options.port}`;
|
|
490
|
+
}
|
|
491
|
+
get preferredAppUrl() {
|
|
492
|
+
return this.publicAppUrl || this.localhostAppUrl;
|
|
493
|
+
}
|
|
483
494
|
constructor(options) {
|
|
484
495
|
this.options = { ...options };
|
|
485
496
|
this.logger = new Logger(options.logFile, options.tail || false, options.dateTimeFormat || "local");
|
|
@@ -521,7 +532,6 @@ export class DevEnvironment {
|
|
|
521
532
|
this.version = packageJson.version;
|
|
522
533
|
// Use git to detect if we're in the dev3000 source repository
|
|
523
534
|
try {
|
|
524
|
-
const { execSync } = require("child_process");
|
|
525
535
|
const gitRemote = execSync("git remote get-url origin 2>/dev/null", {
|
|
526
536
|
cwd: packageRoot,
|
|
527
537
|
encoding: "utf8"
|
|
@@ -544,6 +554,10 @@ export class DevEnvironment {
|
|
|
544
554
|
spinner: "dots",
|
|
545
555
|
isEnabled: !options.tui && !options.tail // Disable spinner in TUI mode
|
|
546
556
|
});
|
|
557
|
+
if (options.portless === true && isPortlessInstalled()) {
|
|
558
|
+
this.portlessAliasName = projectName;
|
|
559
|
+
this.publicAppUrl = getPortlessUrl(projectName);
|
|
560
|
+
}
|
|
547
561
|
// Ensure screenshot directory exists
|
|
548
562
|
try {
|
|
549
563
|
if (!existsSync(this.screenshotDir)) {
|
|
@@ -664,7 +678,6 @@ export class DevEnvironment {
|
|
|
664
678
|
this.cdpMonitor.prepareShutdown();
|
|
665
679
|
}
|
|
666
680
|
// Best-effort synchronous cleanup (mirrors SIGHUP handler).
|
|
667
|
-
const { spawnSync } = require("child_process");
|
|
668
681
|
const port = this.options.port;
|
|
669
682
|
this.debugLog(`Synchronous kill for port ${port}`);
|
|
670
683
|
spawnSync("sh", ["-c", `lsof -ti:${port} | xargs kill -9 2>/dev/null`], {
|
|
@@ -721,6 +734,7 @@ export class DevEnvironment {
|
|
|
721
734
|
// Start TUI interface with initial status and updated port
|
|
722
735
|
this.tui = new DevTUI({
|
|
723
736
|
appPort: this.options.port, // This may have been updated by checkPortsAvailable
|
|
737
|
+
appUrl: this.publicAppUrl,
|
|
724
738
|
logFile: this.options.logFile,
|
|
725
739
|
commandName: this.options.commandName,
|
|
726
740
|
serversOnly: this.options.serversOnly,
|
|
@@ -739,7 +753,6 @@ export class DevEnvironment {
|
|
|
739
753
|
}
|
|
740
754
|
// CRITICAL: Kill port processes SYNCHRONOUSLY first, before anything else
|
|
741
755
|
// This ensures cleanup happens even if the event loop gets interrupted
|
|
742
|
-
const { spawnSync } = require("child_process");
|
|
743
756
|
const port = this.options.port;
|
|
744
757
|
this.debugLog(`Synchronous kill for port ${port}`);
|
|
745
758
|
spawnSync("sh", ["-c", `lsof -ti:${port} | xargs kill -9 2>/dev/null`], {
|
|
@@ -811,6 +824,7 @@ export class DevEnvironment {
|
|
|
811
824
|
await this.checkPortsAvailable(true); // silent mode for TUI
|
|
812
825
|
// Update the app port in TUI (may have changed during port check)
|
|
813
826
|
this.tui.updateAppPort(this.options.port);
|
|
827
|
+
this.tui.updateAppUrl(this.publicAppUrl);
|
|
814
828
|
// Show port change message if needed
|
|
815
829
|
if (this.portChangeMessage) {
|
|
816
830
|
await this.tui.updateStatus(this.portChangeMessage);
|
|
@@ -847,6 +861,8 @@ export class DevEnvironment {
|
|
|
847
861
|
}
|
|
848
862
|
// Update TUI with confirmed port (may have changed during server startup)
|
|
849
863
|
this.tui.updateAppPort(this.options.port);
|
|
864
|
+
this.syncPortlessAlias();
|
|
865
|
+
this.tui.updateAppUrl(this.publicAppUrl);
|
|
850
866
|
// Legacy tools server removed - using CLI commands instead
|
|
851
867
|
// await this.waitForMcpServer()
|
|
852
868
|
// Start CDP monitoring only if server started successfully and not in servers-only mode
|
|
@@ -861,10 +877,7 @@ export class DevEnvironment {
|
|
|
861
877
|
this.debugLog("Browser monitoring disabled via --servers-only flag");
|
|
862
878
|
}
|
|
863
879
|
// Write session info for tooling discovery (include CDP URL if browser monitoring was started)
|
|
864
|
-
|
|
865
|
-
const chromePids = this.cdpMonitor?.getChromePids() || [];
|
|
866
|
-
const skillsInstalled = listAvailableSkills(process.cwd());
|
|
867
|
-
writeSessionInfo(projectName, this.options.logFile, this.options.port, cdpUrl, chromePids, this.options.serverCommand, this.options.framework, this.serverProcess?.pid, skillsInstalled, this.options.skillsAgentId ?? null);
|
|
880
|
+
this.writeCurrentSessionInfo(projectName);
|
|
868
881
|
// Clear status - ready!
|
|
869
882
|
await this.tui.updateStatus(null);
|
|
870
883
|
}
|
|
@@ -908,6 +921,7 @@ export class DevEnvironment {
|
|
|
908
921
|
}
|
|
909
922
|
// Legacy server removed - using CLI commands instead
|
|
910
923
|
// await this.waitForMcpServer()
|
|
924
|
+
this.syncPortlessAlias();
|
|
911
925
|
// Start CDP monitoring only if server started successfully and not in servers-only mode
|
|
912
926
|
if (!this.options.serversOnly && serverStarted) {
|
|
913
927
|
this.spinner.text = `Starting ${this.options.commandName} browser...`;
|
|
@@ -921,17 +935,13 @@ export class DevEnvironment {
|
|
|
921
935
|
}
|
|
922
936
|
// Get project name for session info and Visual Timeline URL
|
|
923
937
|
const projectName = getProjectName();
|
|
924
|
-
|
|
925
|
-
const cdpUrl = this.cdpMonitor?.getCdpUrl() || null;
|
|
926
|
-
const chromePids = this.cdpMonitor?.getChromePids() || [];
|
|
927
|
-
const skillsInstalled = listAvailableSkills(process.cwd());
|
|
928
|
-
writeSessionInfo(projectName, this.options.logFile, this.options.port, cdpUrl, chromePids, this.options.serverCommand, this.options.framework, this.serverProcess?.pid, skillsInstalled, this.options.skillsAgentId ?? null);
|
|
938
|
+
this.writeCurrentSessionInfo(projectName);
|
|
929
939
|
// Complete startup with success message only in non-TUI mode
|
|
930
940
|
this.spinner.succeed("Development environment ready!");
|
|
931
941
|
// Regular console output (when TUI is disabled with --no-tui)
|
|
932
942
|
console.log(chalk.cyan(`Logs: ${this.options.logFile}`));
|
|
933
943
|
console.log(chalk.cyan("☝️ Give this to an AI to auto debug and fix your app\n"));
|
|
934
|
-
console.log(chalk.cyan(`🌐 Your App: ${this.
|
|
944
|
+
console.log(chalk.cyan(`🌐 Your App: ${this.preferredAppUrl}`));
|
|
935
945
|
console.log(chalk.cyan(`🔧 CLI Tools: d3k fix, d3k crawl, d3k find-component`));
|
|
936
946
|
if (this.options.serversOnly) {
|
|
937
947
|
console.log(chalk.cyan("🖥️ Servers-only mode - browser monitoring disabled"));
|
|
@@ -964,11 +974,17 @@ export class DevEnvironment {
|
|
|
964
974
|
async startServer() {
|
|
965
975
|
this.debugLog(`Starting server process: ${this.options.serverCommand}`);
|
|
966
976
|
this.serverStartTime = Date.now();
|
|
977
|
+
const serverEnv = { ...process.env };
|
|
978
|
+
if (this.publicAppUrl) {
|
|
979
|
+
serverEnv.PORTLESS_URL = this.publicAppUrl;
|
|
980
|
+
serverEnv.__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS = ".localhost";
|
|
981
|
+
}
|
|
967
982
|
// Use the full command string with shell: true to properly handle complex commands
|
|
968
983
|
this.serverProcess = spawn(this.options.serverCommand, {
|
|
969
984
|
stdio: ["ignore", "pipe", "pipe"],
|
|
970
985
|
shell: true,
|
|
971
|
-
detached: true // Run independently
|
|
986
|
+
detached: true, // Run independently
|
|
987
|
+
env: serverEnv
|
|
972
988
|
});
|
|
973
989
|
this.debugLog(`Server process spawned with PID: ${this.serverProcess.pid}`);
|
|
974
990
|
// Log server output (to file only, reduce stdout noise)
|
|
@@ -1134,7 +1150,6 @@ export class DevEnvironment {
|
|
|
1134
1150
|
}
|
|
1135
1151
|
if (!isInSandbox()) {
|
|
1136
1152
|
try {
|
|
1137
|
-
const { spawnSync } = require("child_process");
|
|
1138
1153
|
spawnSync("pkill", ["-P", pid.toString()], { stdio: "ignore" });
|
|
1139
1154
|
}
|
|
1140
1155
|
catch {
|
|
@@ -1208,6 +1223,32 @@ export class DevEnvironment {
|
|
|
1208
1223
|
this.debugLog(`Failed to release lock: ${error}`);
|
|
1209
1224
|
}
|
|
1210
1225
|
}
|
|
1226
|
+
syncPortlessAlias() {
|
|
1227
|
+
if (!this.portlessAliasName) {
|
|
1228
|
+
return;
|
|
1229
|
+
}
|
|
1230
|
+
const result = ensurePortlessAlias(this.portlessAliasName, this.options.port);
|
|
1231
|
+
if (result.success) {
|
|
1232
|
+
this.publicAppUrl = result.url;
|
|
1233
|
+
this.debugLog(`Portless alias ready: ${this.portlessAliasName} -> ${this.options.port} (${result.url})`);
|
|
1234
|
+
}
|
|
1235
|
+
else {
|
|
1236
|
+
this.publicAppUrl = null;
|
|
1237
|
+
this.debugLog(`Portless alias setup failed: ${result.error}`);
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
clearPortlessAlias() {
|
|
1241
|
+
if (!this.portlessAliasName) {
|
|
1242
|
+
return;
|
|
1243
|
+
}
|
|
1244
|
+
removePortlessAlias(this.portlessAliasName);
|
|
1245
|
+
}
|
|
1246
|
+
writeCurrentSessionInfo(projectName = getProjectName()) {
|
|
1247
|
+
const cdpUrl = this.cdpMonitor?.getCdpUrl() || null;
|
|
1248
|
+
const chromePids = this.cdpMonitor?.getChromePids() || [];
|
|
1249
|
+
const skillsInstalled = listAvailableSkills(process.cwd());
|
|
1250
|
+
writeSessionInfo(projectName, this.options.logFile, this.options.port, this.publicAppUrl, cdpUrl, chromePids, this.options.serverCommand, this.options.framework, this.serverProcess?.pid, skillsInstalled, this.options.skillsAgentId ?? null, this.options.browserTool);
|
|
1251
|
+
}
|
|
1211
1252
|
detectPortChange(text) {
|
|
1212
1253
|
// Detect Next.js port switch: "⚠ Port 3000 is in use by process 39543, using available port 3001 instead."
|
|
1213
1254
|
// Also detect: "Local: http://localhost:3001"
|
|
@@ -1220,24 +1261,23 @@ export class DevEnvironment {
|
|
|
1220
1261
|
this.logger.log("server", `[PORT] Server switched from port ${oldPort} to ${detectedPort}`);
|
|
1221
1262
|
this.options.port = detectedPort;
|
|
1222
1263
|
this.portDetected = true;
|
|
1264
|
+
this.syncPortlessAlias();
|
|
1223
1265
|
// Update session info with new port
|
|
1224
1266
|
const projectName = getProjectName();
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
if (cdpUrl || chromePids.length > 0) {
|
|
1228
|
-
const skillsInstalled = listAvailableSkills(process.cwd());
|
|
1229
|
-
writeSessionInfo(projectName, this.options.logFile, this.options.port, cdpUrl || undefined, chromePids, this.options.serverCommand, this.options.framework, this.serverProcess?.pid, skillsInstalled, this.options.skillsAgentId ?? null);
|
|
1267
|
+
if (this.cdpMonitor || this.serverProcess?.pid) {
|
|
1268
|
+
this.writeCurrentSessionInfo(projectName);
|
|
1230
1269
|
this.debugLog(`Updated session info with new port: ${this.options.port}`);
|
|
1231
1270
|
}
|
|
1232
1271
|
// Update TUI header with new port
|
|
1233
1272
|
if (this.tui) {
|
|
1234
1273
|
this.tui.updateAppPort(detectedPort);
|
|
1274
|
+
this.tui.updateAppUrl(this.publicAppUrl);
|
|
1235
1275
|
}
|
|
1236
1276
|
// Navigate browser to new port if CDP monitor is active
|
|
1237
1277
|
if (this.cdpMonitor) {
|
|
1238
1278
|
this.debugLog(`Re-navigating browser from port ${oldPort} to ${detectedPort}`);
|
|
1239
|
-
this.logger.log("browser", `[CDP] Port changed - navigating to ${this.
|
|
1240
|
-
this.cdpMonitor.
|
|
1279
|
+
this.logger.log("browser", `[CDP] Port changed - navigating to ${this.preferredAppUrl}`);
|
|
1280
|
+
this.cdpMonitor.navigateToUrl(this.preferredAppUrl).catch((error) => {
|
|
1241
1281
|
this.debugLog(`Failed to navigate browser to new port: ${error}`);
|
|
1242
1282
|
});
|
|
1243
1283
|
}
|
|
@@ -1521,7 +1561,7 @@ export class DevEnvironment {
|
|
|
1521
1561
|
this.cdpMonitor = new CDPMonitor(this.options.profileDir, this.screenshotDir, (_source, message) => {
|
|
1522
1562
|
this.logger.log("browser", message);
|
|
1523
1563
|
}, this.options.debug, this.options.browser, this.options.pluginReactScan, this.options.port, // App server port to monitor
|
|
1524
|
-
this.options.debugPort, // Chrome debug port
|
|
1564
|
+
this.preferredAppUrl, this.options.debugPort, // Chrome debug port
|
|
1525
1565
|
this.options.headless, // Headless mode for serverless/CI environments
|
|
1526
1566
|
this.options.framework // Framework hint for optional React DevTools launch args
|
|
1527
1567
|
);
|
|
@@ -1545,18 +1585,18 @@ export class DevEnvironment {
|
|
|
1545
1585
|
this.screencastManager = new ScreencastManager(cdpUrl, (msg) => {
|
|
1546
1586
|
// Pass through CDP messages directly - they already have their own category tags
|
|
1547
1587
|
this.logger.log("browser", msg);
|
|
1548
|
-
}, this.options.port.toString(), this.options.debug);
|
|
1588
|
+
}, this.options.port.toString(), this.options.debug, this.publicAppUrl);
|
|
1549
1589
|
await this.screencastManager.start();
|
|
1550
1590
|
// this.logger.log("browser", "[Screencast] Auto-capture enabled for navigation events")
|
|
1551
1591
|
}
|
|
1552
1592
|
// Always write session info after CDP monitoring starts - this is critical for
|
|
1553
1593
|
// sandbox environments where external tools poll for the cdpUrl in the session file
|
|
1554
|
-
|
|
1594
|
+
this.writeCurrentSessionInfo(projectName);
|
|
1555
1595
|
this.debugLog(`Updated session info with CDP URL: ${cdpUrl}, Chrome PIDs: [${chromePids.join(", ")}]`);
|
|
1556
1596
|
this.logger.log("browser", `[CDP] Session info written with cdpUrl: ${cdpUrl ? "available" : "null"}`);
|
|
1557
1597
|
// Navigate to the app
|
|
1558
|
-
await this.cdpMonitor.
|
|
1559
|
-
this.logger.log("browser", `[CDP] Navigated to ${this.
|
|
1598
|
+
await this.cdpMonitor.navigateToUrl(this.preferredAppUrl);
|
|
1599
|
+
this.logger.log("browser", `[CDP] Navigated to ${this.preferredAppUrl}`);
|
|
1560
1600
|
}
|
|
1561
1601
|
catch (error) {
|
|
1562
1602
|
// Log error and throw to trigger graceful shutdown
|
|
@@ -1588,6 +1628,7 @@ export class DevEnvironment {
|
|
|
1588
1628
|
catch (_error) {
|
|
1589
1629
|
// Non-fatal - ignore cleanup errors
|
|
1590
1630
|
}
|
|
1631
|
+
this.clearPortlessAlias();
|
|
1591
1632
|
// Check PID file ownership BEFORE deleting (needed for cleanup decisions)
|
|
1592
1633
|
let weOwnPidFile = false;
|
|
1593
1634
|
try {
|
|
@@ -1603,6 +1644,7 @@ export class DevEnvironment {
|
|
|
1603
1644
|
catch (_error) {
|
|
1604
1645
|
// Non-fatal - ignore cleanup errors
|
|
1605
1646
|
}
|
|
1647
|
+
this.clearPortlessAlias();
|
|
1606
1648
|
// Stop TUI if it's running
|
|
1607
1649
|
if (this.tui) {
|
|
1608
1650
|
await this.tui.shutdown();
|
|
@@ -1717,7 +1759,6 @@ export class DevEnvironment {
|
|
|
1717
1759
|
}
|
|
1718
1760
|
// CRITICAL: Kill port processes SYNCHRONOUSLY first, before anything else
|
|
1719
1761
|
// This ensures cleanup happens even if the event loop gets interrupted
|
|
1720
|
-
const { spawnSync } = require("child_process");
|
|
1721
1762
|
const port = this.options.port;
|
|
1722
1763
|
this.debugLog(`Synchronous kill for port ${port}`);
|
|
1723
1764
|
spawnSync("sh", ["-c", `lsof -ti:${port} | xargs kill -9 2>/dev/null`], {
|
|
@@ -1777,7 +1818,6 @@ export class DevEnvironment {
|
|
|
1777
1818
|
this.cdpMonitor.prepareShutdown();
|
|
1778
1819
|
}
|
|
1779
1820
|
// CRITICAL: Kill port processes SYNCHRONOUSLY first, before anything else
|
|
1780
|
-
const { spawnSync } = require("child_process");
|
|
1781
1821
|
const port = this.options.port;
|
|
1782
1822
|
this.debugLog(`Synchronous kill for port ${port}`);
|
|
1783
1823
|
spawnSync("sh", ["-c", `lsof -ti:${port} | xargs kill -9 2>/dev/null`], {
|