@proagentstore/cli 0.1.30 → 0.1.31
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { homedir } from "node:os";
|
|
2
|
-
import { join } from "node:path";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
3
|
import { CodingSession } from "./session.js";
|
|
4
4
|
import { ensureRepo, listSessions as listTmuxSessions, sanitizeSessionName } from "./tmux.js";
|
|
5
5
|
/** Hard cap on a pane returned to the brain/console (matches the worker MAX_PANE_CHARS). */
|
|
@@ -30,8 +30,11 @@ export class CodingRuntime {
|
|
|
30
30
|
let session = this.sessions.get(input.sessionId);
|
|
31
31
|
if (!session) {
|
|
32
32
|
// Resolve the working dir and ensure the repo is present (clone on first
|
|
33
|
-
// start).
|
|
34
|
-
|
|
33
|
+
// start). A user-supplied local path may use ~ — expand it; otherwise
|
|
34
|
+
// clone into a managed dir. Without this the CLI would launch nowhere.
|
|
35
|
+
const workDir = input.workDir
|
|
36
|
+
? resolve(input.workDir.replace(/^~(?=$|\/)/, homedir()))
|
|
37
|
+
: join(this.reposBaseDir, sanitizeSessionName(input.repoId));
|
|
35
38
|
ensureRepo(workDir, { cloneUrl: input.cloneUrl, branch: input.branch, token: input.token });
|
|
36
39
|
session = new CodingSession({
|
|
37
40
|
id: input.sessionId,
|