@proagentstore/cli 0.1.29 → 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). Without this the CLI would launch in a non-existent path.
34
- const workDir = input.workDir || join(this.reposBaseDir, sanitizeSessionName(input.repoId));
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,
package/dist/index.js CHANGED
@@ -972,13 +972,17 @@ function createRunnerCommand() {
972
972
  const capabilities = await requestRunner("GET", "/capabilities", { url: localUrl, token: runnerToken, instanceId: primary });
973
973
  const caps = Array.isArray(capabilities.capabilities) ? capabilities.capabilities.filter((item) => typeof item === "string") : [];
974
974
  for (const id of instanceIds) {
975
- await requestPags("POST", `/v1/instances/${apiPathSegment(id)}/runtime`, opts, {
976
- endpointUrl: url,
977
- token: runnerToken,
978
- placement: "local",
979
- capabilities: caps,
980
- runnerVersion: clean(opts.runnerVersion) || ""
981
- });
975
+ try {
976
+ await requestPags("POST", `/v1/instances/${apiPathSegment(id)}/runtime`, opts, {
977
+ endpointUrl: url,
978
+ token: runnerToken,
979
+ placement: "local",
980
+ capabilities: caps,
981
+ runnerVersion: clean(opts.runnerVersion) || ""
982
+ });
983
+ } catch (error) {
984
+ writeError(`register ${id.slice(0, 8)}\u2026 failed (${error instanceof Error ? error.message : String(error)}); will retry`);
985
+ }
982
986
  }
983
987
  };
984
988
  const first = await openTunnel();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proagentstore/cli",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "description": "CLI for creating, publishing, and running ProAgentStore agents",
5
5
  "license": "MIT",
6
6
  "type": "module",