@clawos-dev/clawd 0.2.111-beta.211.36274e2 → 0.2.112-beta.212.a6b6915
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/cli.cjs +25 -12
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -39512,24 +39512,37 @@ function buildSessionHandlers(deps) {
|
|
|
39512
39512
|
if (prevProject && prevProject !== nextProject) {
|
|
39513
39513
|
await lifecycle.stopForSession(args.sessionId);
|
|
39514
39514
|
}
|
|
39515
|
-
if (nextProject && nextProject !== ""
|
|
39516
|
-
const
|
|
39517
|
-
const
|
|
39518
|
-
deps.logger?.info("session-update.start-dev-server", {
|
|
39515
|
+
if (nextProject && nextProject !== "") {
|
|
39516
|
+
const occupantSessionId = lifecycle.boundSessionId(nextProject);
|
|
39517
|
+
const alreadyRunningForThisSession = lifecycle.isRunning(nextProject) && occupantSessionId === args.sessionId;
|
|
39518
|
+
deps.logger?.info("session-update.maybe-start-dev-server", {
|
|
39519
39519
|
sessionId: args.sessionId,
|
|
39520
39520
|
projectName: nextProject,
|
|
39521
|
-
|
|
39522
|
-
|
|
39523
|
-
tunnelUrl
|
|
39521
|
+
occupantSessionId,
|
|
39522
|
+
alreadyRunningForThisSession
|
|
39524
39523
|
});
|
|
39525
|
-
if (
|
|
39526
|
-
|
|
39524
|
+
if (!alreadyRunningForThisSession) {
|
|
39525
|
+
if (occupantSessionId && occupantSessionId !== args.sessionId) {
|
|
39526
|
+
await lifecycle.stopForSession(occupantSessionId);
|
|
39527
|
+
}
|
|
39528
|
+
const projects = await projectStore.list();
|
|
39529
|
+
const target = projects.find((p2) => p2.name === nextProject);
|
|
39530
|
+
deps.logger?.info("session-update.start-dev-server", {
|
|
39527
39531
|
sessionId: args.sessionId,
|
|
39528
39532
|
projectName: nextProject,
|
|
39529
|
-
|
|
39530
|
-
|
|
39531
|
-
|
|
39533
|
+
targetFound: !!target,
|
|
39534
|
+
projectCwd: target ? projectStore.projectDir(nextProject) : null,
|
|
39535
|
+
tunnelUrl
|
|
39532
39536
|
});
|
|
39537
|
+
if (target) {
|
|
39538
|
+
lifecycle.startForSession({
|
|
39539
|
+
sessionId: args.sessionId,
|
|
39540
|
+
projectName: nextProject,
|
|
39541
|
+
cwd: projectStore.projectDir(nextProject),
|
|
39542
|
+
port: target.port,
|
|
39543
|
+
tunnelHost: tunnelUrl ? new URL(tunnelUrl.replace(/^wss?:\/\//i, "https://")).host : null
|
|
39544
|
+
});
|
|
39545
|
+
}
|
|
39533
39546
|
}
|
|
39534
39547
|
}
|
|
39535
39548
|
} catch (err) {
|
package/package.json
CHANGED