@camerontaylor/paseo-cli 0.8.0-fork.1 → 0.8.0-fork.3

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.
Files changed (120) hide show
  1. package/dist/cli.js +25 -37
  2. package/dist/commands/agent/archive.js +2 -15
  3. package/dist/commands/agent/attach.d.ts +1 -0
  4. package/dist/commands/agent/attach.js +8 -12
  5. package/dist/commands/agent/delete.js +4 -15
  6. package/dist/commands/agent/detach.js +2 -13
  7. package/dist/commands/agent/import.js +2 -16
  8. package/dist/commands/agent/inspect.js +2 -15
  9. package/dist/commands/agent/logs.js +12 -12
  10. package/dist/commands/agent/ls.js +2 -23
  11. package/dist/commands/agent/mode.js +2 -2
  12. package/dist/commands/agent/open.js +2 -8
  13. package/dist/commands/agent/reload.js +2 -15
  14. package/dist/commands/agent/run.js +11 -16
  15. package/dist/commands/agent/send.js +6 -15
  16. package/dist/commands/agent/stop.js +2 -15
  17. package/dist/commands/agent/update.js +2 -15
  18. package/dist/commands/agent/wait.js +4 -15
  19. package/dist/commands/clone.js +2 -8
  20. package/dist/commands/daemon/config.d.ts +3 -0
  21. package/dist/commands/daemon/config.js +102 -0
  22. package/dist/commands/daemon/index.js +20 -52
  23. package/dist/commands/daemon/local-daemon.d.ts +10 -75
  24. package/dist/commands/daemon/local-daemon.js +61 -503
  25. package/dist/commands/daemon/pair.d.ts +3 -8
  26. package/dist/commands/daemon/pair.js +31 -61
  27. package/dist/commands/daemon/reload.d.ts +3 -1
  28. package/dist/commands/daemon/reload.js +10 -2
  29. package/dist/commands/daemon/restart.d.ts +19 -11
  30. package/dist/commands/daemon/restart.js +102 -88
  31. package/dist/commands/daemon/set-password.js +6 -7
  32. package/dist/commands/daemon/start.d.ts +17 -3
  33. package/dist/commands/daemon/start.js +47 -52
  34. package/dist/commands/daemon/status.d.ts +12 -20
  35. package/dist/commands/daemon/status.js +90 -342
  36. package/dist/commands/daemon/stop.d.ts +19 -14
  37. package/dist/commands/daemon/stop.js +53 -55
  38. package/dist/commands/heartbeat/index.js +3 -3
  39. package/dist/commands/hub/connect.d.ts +1 -0
  40. package/dist/commands/hub/connect.js +1 -1
  41. package/dist/commands/hub/daemon-client.d.ts +3 -2
  42. package/dist/commands/hub/daemon-client.js +3 -3
  43. package/dist/commands/hub/disconnect.d.ts +1 -0
  44. package/dist/commands/hub/disconnect.js +1 -1
  45. package/dist/commands/hub/index.js +2 -2
  46. package/dist/commands/hub/init.d.ts +3 -1
  47. package/dist/commands/hub/init.js +13 -12
  48. package/dist/commands/hub/login.d.ts +4 -4
  49. package/dist/commands/hub/login.js +1 -1
  50. package/dist/commands/hub/logout.d.ts +1 -0
  51. package/dist/commands/hub/logout.js +2 -2
  52. package/dist/commands/hub/permissions.d.ts +1 -0
  53. package/dist/commands/hub/permissions.js +2 -2
  54. package/dist/commands/onboard.d.ts +7 -2
  55. package/dist/commands/onboard.js +58 -210
  56. package/dist/commands/open.js +2 -0
  57. package/dist/commands/permit/allow.js +2 -15
  58. package/dist/commands/permit/deny.js +2 -15
  59. package/dist/commands/permit/ls.js +2 -15
  60. package/dist/commands/plugin/index.js +7 -7
  61. package/dist/commands/plugin/shared.d.ts +4 -3
  62. package/dist/commands/plugin/shared.js +8 -8
  63. package/dist/commands/project/create.js +5 -3
  64. package/dist/commands/project/delete.js +4 -2
  65. package/dist/commands/project/ls.js +2 -2
  66. package/dist/commands/project/rename.js +4 -2
  67. package/dist/commands/provider/add.js +2 -2
  68. package/dist/commands/provider/diagnostic.js +1 -1
  69. package/dist/commands/provider/ls.js +2 -30
  70. package/dist/commands/provider/models.js +1 -1
  71. package/dist/commands/provider/rm.js +2 -2
  72. package/dist/commands/schedule/create.js +2 -2
  73. package/dist/commands/schedule/delete.js +1 -1
  74. package/dist/commands/schedule/inspect.js +1 -1
  75. package/dist/commands/schedule/logs.js +1 -1
  76. package/dist/commands/schedule/ls.js +1 -1
  77. package/dist/commands/schedule/pause.js +1 -1
  78. package/dist/commands/schedule/resume.js +1 -1
  79. package/dist/commands/schedule/run-once.js +1 -1
  80. package/dist/commands/schedule/shared.d.ts +3 -1
  81. package/dist/commands/schedule/shared.js +7 -5
  82. package/dist/commands/schedule/update.js +1 -1
  83. package/dist/commands/script/ls.js +1 -1
  84. package/dist/commands/script/shared.d.ts +2 -1
  85. package/dist/commands/script/shared.js +3 -3
  86. package/dist/commands/script/start.js +1 -1
  87. package/dist/commands/script/stop.js +1 -1
  88. package/dist/commands/terminal/capture.d.ts +1 -1
  89. package/dist/commands/terminal/capture.js +2 -3
  90. package/dist/commands/terminal/create.js +1 -1
  91. package/dist/commands/terminal/kill.js +1 -1
  92. package/dist/commands/terminal/ls.js +1 -1
  93. package/dist/commands/terminal/send-keys.d.ts +1 -1
  94. package/dist/commands/terminal/send-keys.js +2 -3
  95. package/dist/commands/terminal/shared.d.ts +2 -1
  96. package/dist/commands/terminal/shared.js +5 -3
  97. package/dist/commands/workspace/archive.d.ts +1 -0
  98. package/dist/commands/workspace/archive.js +4 -2
  99. package/dist/commands/workspace/create.js +4 -2
  100. package/dist/commands/workspace/ls.d.ts +1 -0
  101. package/dist/commands/workspace/ls.js +2 -2
  102. package/dist/commands/workspace/rename.d.ts +1 -0
  103. package/dist/commands/workspace/rename.js +4 -2
  104. package/dist/commands/workspace/setup.d.ts +1 -0
  105. package/dist/commands/workspace/setup.js +2 -2
  106. package/dist/commands/worktree/archive.js +4 -2
  107. package/dist/commands/worktree/create.js +2 -10
  108. package/dist/commands/worktree/ls.d.ts +0 -2
  109. package/dist/commands/worktree/ls.js +4 -30
  110. package/dist/output/with-output.d.ts +2 -0
  111. package/dist/run.js +11 -1
  112. package/dist/utils/client-id.d.ts +1 -1
  113. package/dist/utils/client-id.js +8 -14
  114. package/dist/utils/client.d.ts +16 -21
  115. package/dist/utils/client.js +57 -109
  116. package/dist/utils/command-options.d.ts +1 -0
  117. package/dist/utils/command-options.js +24 -2
  118. package/dist/utils/daemon-target.d.ts +13 -0
  119. package/dist/utils/daemon-target.js +51 -0
  120. package/package.json +8 -4
@@ -1,4 +1,5 @@
1
1
  import type { Command } from "commander";
2
+ export declare function addLocalDaemonOptions<T extends Command>(command: T): T;
2
3
  export declare function collectMultiple(value: string, previous: string[]): string[];
3
4
  export declare function addJsonOption<T extends Command>(command: T): T;
4
5
  export declare function addDaemonHostOption<T extends Command>(command: T): T;
@@ -1,5 +1,12 @@
1
+ import { selectDaemonTarget } from "./daemon-target.js";
1
2
  const JSON_OPTION_DESCRIPTION = "Output in JSON format";
2
- const DAEMON_HOST_OPTION_DESCRIPTION = "Daemon host target: host:port, tcp://host:port, or ssh://user@host (default: local socket/pipe, then localhost:6767)";
3
+ const DAEMON_HOST_OPTION_DESCRIPTION = "Explicit daemon endpoint: host:port, TCP, socket, SSH, or pairing URL (default: local home)";
4
+ const localCommands = new WeakSet();
5
+ export function addLocalDaemonOptions(command) {
6
+ localCommands.add(command);
7
+ command.option("--home <path>", "Local daemon home (default: ~/.paseo)");
8
+ return command;
9
+ }
3
10
  export function collectMultiple(value, previous) {
4
11
  return previous.concat([value]);
5
12
  }
@@ -9,6 +16,8 @@ export function addJsonOption(command) {
9
16
  }
10
17
  export function addDaemonHostOption(command) {
11
18
  command.option("--host <host>", DAEMON_HOST_OPTION_DESCRIPTION);
19
+ if (!command.options.some((option) => option.long === "--home"))
20
+ command.option("--home <path>", "Select a local daemon home (default: ~/.paseo)");
12
21
  return command;
13
22
  }
14
23
  export function addJsonAndDaemonHostOptions(command) {
@@ -18,7 +27,20 @@ export function withGlobalOptions(handler) {
18
27
  return (...args) => {
19
28
  const command = args.at(-1);
20
29
  const mergedArgs = [...args];
21
- mergedArgs[mergedArgs.length - 2] = command.optsWithGlobals();
30
+ const options = command.optsWithGlobals();
31
+ const selectors = { home: new Set(), host: new Set() };
32
+ for (let current = command; current; current = current.parent) {
33
+ for (const key of ["home", "host"]) {
34
+ const value = current.opts()[key];
35
+ if (typeof value === "string")
36
+ selectors[key].add(value);
37
+ }
38
+ }
39
+ if (selectors.home.size > 1 || selectors.host.size > 1)
40
+ throw { code: "TARGET_AMBIGUOUS", message: "Conflicting duplicate daemon selectors." };
41
+ const localOnly = localCommands.has(command);
42
+ options.daemonTarget = selectDaemonTarget(options, process.env, localOnly);
43
+ mergedArgs[mergedArgs.length - 2] = options;
22
44
  return handler(...mergedArgs);
23
45
  };
24
46
  }
@@ -0,0 +1,13 @@
1
+ export type DaemonTarget = {
2
+ kind: "instance";
3
+ home: string;
4
+ } | {
5
+ kind: "endpoint";
6
+ host: string;
7
+ };
8
+ export declare function selectDaemonTarget(options: {
9
+ home?: string;
10
+ host?: string;
11
+ }, env?: NodeJS.ProcessEnv, localOnly?: boolean): DaemonTarget;
12
+ export declare function describeDaemonTarget(target: DaemonTarget): string;
13
+ //# sourceMappingURL=daemon-target.d.ts.map
@@ -0,0 +1,51 @@
1
+ import { resolvePaseoHome } from "@camerontaylor/paseo-server";
2
+ export function selectDaemonTarget(options, env = process.env, localOnly = false) {
3
+ for (const key of ["home", "host"]) {
4
+ if (options[key] !== undefined && !options[key].trim())
5
+ throw { code: "TARGET_INVALID", message: `--${key} requires a non-empty value.` };
6
+ }
7
+ if (options.home !== undefined && options.host !== undefined)
8
+ throw { code: "TARGET_AMBIGUOUS", message: "Choose either --home or --host, not both." };
9
+ if (localOnly) {
10
+ if (options.host !== undefined)
11
+ throw {
12
+ code: "LOCAL_OPERATION",
13
+ message: "This is a local operation; use --home. --host is not supported.",
14
+ };
15
+ return {
16
+ kind: "instance",
17
+ home: resolvePaseoHome({ PASEO_HOME: options.home ?? env.PASEO_HOME }),
18
+ };
19
+ }
20
+ if (options.home !== undefined)
21
+ return { kind: "instance", home: resolvePaseoHome({ PASEO_HOME: options.home }) };
22
+ if (options.host !== undefined)
23
+ return { kind: "endpoint", host: options.host };
24
+ if (env.PASEO_HOME && env.PASEO_HOST)
25
+ throw {
26
+ code: "TARGET_AMBIGUOUS",
27
+ message: "PASEO_HOME and PASEO_HOST are both set. Choose --home or --host explicitly.",
28
+ };
29
+ if (env.PASEO_HOST)
30
+ return { kind: "endpoint", host: env.PASEO_HOST };
31
+ return { kind: "instance", home: resolvePaseoHome({ PASEO_HOME: env.PASEO_HOME }) };
32
+ }
33
+ export function describeDaemonTarget(target) {
34
+ if (target.kind === "instance")
35
+ return `home ${target.home}`;
36
+ try {
37
+ const url = new URL(target.host);
38
+ if (url.password)
39
+ url.password = "REDACTED";
40
+ for (const key of url.searchParams.keys())
41
+ if (/password|token|secret/i.test(key))
42
+ url.searchParams.set(key, "REDACTED");
43
+ if (url.hash)
44
+ url.hash = "REDACTED";
45
+ return url.toString();
46
+ }
47
+ catch {
48
+ return target.host.replace(/([?&](?:password|token|secret)=)[^&]*/gi, "$1REDACTED");
49
+ }
50
+ }
51
+ //# sourceMappingURL=daemon-target.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camerontaylor/paseo-cli",
3
- "version": "0.8.0-fork.1",
3
+ "version": "0.8.0-fork.3",
4
4
  "description": "Paseo CLI - control your AI coding agents from the command line",
5
5
  "bin": {
6
6
  "paseo": "bin/paseo"
@@ -28,9 +28,9 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@clack/prompts": "^1.0.0",
31
- "@camerontaylor/paseo-client": "0.8.0-fork.1",
32
- "@camerontaylor/paseo-protocol": "0.8.0-fork.1",
33
- "@camerontaylor/paseo-server": "0.8.0-fork.1",
31
+ "@camerontaylor/paseo-client": "0.8.0-fork.3",
32
+ "@camerontaylor/paseo-protocol": "0.8.0-fork.3",
33
+ "@camerontaylor/paseo-server": "0.8.0-fork.3",
34
34
  "chalk": "^5.3.0",
35
35
  "commander": "^12.0.0",
36
36
  "mime-types": "^2.1.35",
@@ -46,5 +46,9 @@
46
46
  "typescript": "^5.2.2",
47
47
  "vitest": "^4.1.6",
48
48
  "zx": "^8.8.5"
49
+ },
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "https://github.com/camerontaylor/paseo"
49
53
  }
50
54
  }