@getpaseo/cli 0.16.1 → 0.16.2

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,3 +1,6 @@
1
+ import { isAbsolute as isPosixAbsolute } from "node:path/posix";
2
+ import { isAbsolute as isWindowsAbsolute } from "node:path/win32";
3
+ import { resolve } from "node:path";
1
4
  import { connectToDaemon, getDaemonHost } from "../../utils/client.js";
2
5
  import { resolveCallerAgentId } from "../../utils/caller-agent.js";
3
6
  import { toWorkspaceRow, workspaceSchema } from "./shared.js";
@@ -75,12 +78,25 @@ function buildWorktreeWorkspaceSource(options, path) {
75
78
  throw new Error(`Unsupported worktree mode: ${String(options.mode)}`);
76
79
  }
77
80
  }
81
+ // A relative --path names a directory relative to where the command runs, so
82
+ // it is made absolute here for a local daemon, which would otherwise resolve
83
+ // it against its own working directory. For an explicit endpoint the path is
84
+ // sent as written, the same rule as resolveRepositoryDirectory. An absolute
85
+ // path can target a daemon on a different operating system, and the daemon
86
+ // expands a leading ~ to its own home directory.
87
+ function resolveCallerPath(input, daemonTarget) {
88
+ const isHomeRelative = input === "~" || input.startsWith("~/");
89
+ if (isHomeRelative || isPosixAbsolute(input) || isWindowsAbsolute(input))
90
+ return input;
91
+ return daemonTarget.kind === "instance" ? resolve(input) : input;
92
+ }
78
93
  export function buildWorkspaceSource(options) {
94
+ const callerPath = options.path === undefined ? undefined : resolveCallerPath(options.path, options.daemonTarget);
79
95
  if (options.isolation === "local") {
80
- return buildLocalWorkspaceSource(options, options.path ?? process.cwd());
96
+ return buildLocalWorkspaceSource(options, callerPath ?? process.cwd());
81
97
  }
82
98
  if (options.isolation === "worktree") {
83
- const sourcePath = options.path ?? (options.project ? undefined : process.cwd());
99
+ const sourcePath = callerPath ?? (options.project ? undefined : process.cwd());
84
100
  return buildWorktreeWorkspaceSource(options, sourcePath);
85
101
  }
86
102
  throw new Error(`Unsupported workspace isolation: ${String(options.isolation)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/cli",
3
- "version": "0.16.1",
3
+ "version": "0.16.2",
4
4
  "description": "Paseo CLI - control your AI coding agents from the command line",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@clack/prompts": "^1.0.0",
32
- "@getpaseo/client": "0.16.1",
33
- "@getpaseo/protocol": "0.16.1",
34
- "@getpaseo/server": "0.16.1",
32
+ "@getpaseo/client": "0.16.2",
33
+ "@getpaseo/protocol": "0.16.2",
34
+ "@getpaseo/server": "0.16.2",
35
35
  "chalk": "^5.3.0",
36
36
  "commander": "^12.0.0",
37
37
  "mime-types": "^2.1.35",