@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.
- package/dist/cli.js +25 -37
- package/dist/commands/agent/archive.js +2 -15
- package/dist/commands/agent/attach.d.ts +1 -0
- package/dist/commands/agent/attach.js +8 -12
- package/dist/commands/agent/delete.js +4 -15
- package/dist/commands/agent/detach.js +2 -13
- package/dist/commands/agent/import.js +2 -16
- package/dist/commands/agent/inspect.js +2 -15
- package/dist/commands/agent/logs.js +12 -12
- package/dist/commands/agent/ls.js +2 -23
- package/dist/commands/agent/mode.js +2 -2
- package/dist/commands/agent/open.js +2 -8
- package/dist/commands/agent/reload.js +2 -15
- package/dist/commands/agent/run.js +11 -16
- package/dist/commands/agent/send.js +6 -15
- package/dist/commands/agent/stop.js +2 -15
- package/dist/commands/agent/update.js +2 -15
- package/dist/commands/agent/wait.js +4 -15
- package/dist/commands/clone.js +2 -8
- package/dist/commands/daemon/config.d.ts +3 -0
- package/dist/commands/daemon/config.js +102 -0
- package/dist/commands/daemon/index.js +20 -52
- package/dist/commands/daemon/local-daemon.d.ts +10 -75
- package/dist/commands/daemon/local-daemon.js +61 -503
- package/dist/commands/daemon/pair.d.ts +3 -8
- package/dist/commands/daemon/pair.js +31 -61
- package/dist/commands/daemon/reload.d.ts +3 -1
- package/dist/commands/daemon/reload.js +10 -2
- package/dist/commands/daemon/restart.d.ts +19 -11
- package/dist/commands/daemon/restart.js +102 -88
- package/dist/commands/daemon/set-password.js +6 -7
- package/dist/commands/daemon/start.d.ts +17 -3
- package/dist/commands/daemon/start.js +47 -52
- package/dist/commands/daemon/status.d.ts +12 -20
- package/dist/commands/daemon/status.js +90 -342
- package/dist/commands/daemon/stop.d.ts +19 -14
- package/dist/commands/daemon/stop.js +53 -55
- package/dist/commands/heartbeat/index.js +3 -3
- package/dist/commands/hub/connect.d.ts +1 -0
- package/dist/commands/hub/connect.js +1 -1
- package/dist/commands/hub/daemon-client.d.ts +3 -2
- package/dist/commands/hub/daemon-client.js +3 -3
- package/dist/commands/hub/disconnect.d.ts +1 -0
- package/dist/commands/hub/disconnect.js +1 -1
- package/dist/commands/hub/index.js +2 -2
- package/dist/commands/hub/init.d.ts +3 -1
- package/dist/commands/hub/init.js +13 -12
- package/dist/commands/hub/login.d.ts +4 -4
- package/dist/commands/hub/login.js +1 -1
- package/dist/commands/hub/logout.d.ts +1 -0
- package/dist/commands/hub/logout.js +2 -2
- package/dist/commands/hub/permissions.d.ts +1 -0
- package/dist/commands/hub/permissions.js +2 -2
- package/dist/commands/onboard.d.ts +7 -2
- package/dist/commands/onboard.js +58 -210
- package/dist/commands/open.js +2 -0
- package/dist/commands/permit/allow.js +2 -15
- package/dist/commands/permit/deny.js +2 -15
- package/dist/commands/permit/ls.js +2 -15
- package/dist/commands/plugin/index.js +7 -7
- package/dist/commands/plugin/shared.d.ts +4 -3
- package/dist/commands/plugin/shared.js +8 -8
- package/dist/commands/project/create.js +5 -3
- package/dist/commands/project/delete.js +4 -2
- package/dist/commands/project/ls.js +2 -2
- package/dist/commands/project/rename.js +4 -2
- package/dist/commands/provider/add.js +2 -2
- package/dist/commands/provider/diagnostic.js +1 -1
- package/dist/commands/provider/ls.js +2 -30
- package/dist/commands/provider/models.js +1 -1
- package/dist/commands/provider/rm.js +2 -2
- package/dist/commands/schedule/create.js +2 -2
- package/dist/commands/schedule/delete.js +1 -1
- package/dist/commands/schedule/inspect.js +1 -1
- package/dist/commands/schedule/logs.js +1 -1
- package/dist/commands/schedule/ls.js +1 -1
- package/dist/commands/schedule/pause.js +1 -1
- package/dist/commands/schedule/resume.js +1 -1
- package/dist/commands/schedule/run-once.js +1 -1
- package/dist/commands/schedule/shared.d.ts +3 -1
- package/dist/commands/schedule/shared.js +7 -5
- package/dist/commands/schedule/update.js +1 -1
- package/dist/commands/script/ls.js +1 -1
- package/dist/commands/script/shared.d.ts +2 -1
- package/dist/commands/script/shared.js +3 -3
- package/dist/commands/script/start.js +1 -1
- package/dist/commands/script/stop.js +1 -1
- package/dist/commands/terminal/capture.d.ts +1 -1
- package/dist/commands/terminal/capture.js +2 -3
- package/dist/commands/terminal/create.js +1 -1
- package/dist/commands/terminal/kill.js +1 -1
- package/dist/commands/terminal/ls.js +1 -1
- package/dist/commands/terminal/send-keys.d.ts +1 -1
- package/dist/commands/terminal/send-keys.js +2 -3
- package/dist/commands/terminal/shared.d.ts +2 -1
- package/dist/commands/terminal/shared.js +5 -3
- package/dist/commands/workspace/archive.d.ts +1 -0
- package/dist/commands/workspace/archive.js +4 -2
- package/dist/commands/workspace/create.js +4 -2
- package/dist/commands/workspace/ls.d.ts +1 -0
- package/dist/commands/workspace/ls.js +2 -2
- package/dist/commands/workspace/rename.d.ts +1 -0
- package/dist/commands/workspace/rename.js +4 -2
- package/dist/commands/workspace/setup.d.ts +1 -0
- package/dist/commands/workspace/setup.js +2 -2
- package/dist/commands/worktree/archive.js +4 -2
- package/dist/commands/worktree/create.js +2 -10
- package/dist/commands/worktree/ls.d.ts +0 -2
- package/dist/commands/worktree/ls.js +4 -30
- package/dist/output/with-output.d.ts +2 -0
- package/dist/run.js +11 -1
- package/dist/utils/client-id.d.ts +1 -1
- package/dist/utils/client-id.js +8 -14
- package/dist/utils/client.d.ts +16 -21
- package/dist/utils/client.js +57 -109
- package/dist/utils/command-options.d.ts +1 -0
- package/dist/utils/command-options.js +24 -2
- package/dist/utils/daemon-target.d.ts +13 -0
- package/dist/utils/daemon-target.js +51 -0
- 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 = "
|
|
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
|
-
|
|
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.
|
|
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.
|
|
32
|
-
"@camerontaylor/paseo-protocol": "0.8.0-fork.
|
|
33
|
-
"@camerontaylor/paseo-server": "0.8.0-fork.
|
|
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
|
}
|