@camerontaylor/paseo-cli 0.8.0-fork.1
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/bin/paseo +3 -0
- package/dist/classify.d.ts +19 -0
- package/dist/classify.js +49 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +135 -0
- package/dist/commands/agent/archive.d.ts +18 -0
- package/dist/commands/agent/archive.js +102 -0
- package/dist/commands/agent/attach.d.ts +11 -0
- package/dist/commands/agent/attach.js +161 -0
- package/dist/commands/agent/delete.d.ts +15 -0
- package/dist/commands/agent/delete.js +107 -0
- package/dist/commands/agent/detach.d.ts +9 -0
- package/dist/commands/agent/detach.js +38 -0
- package/dist/commands/agent/import.d.ts +14 -0
- package/dist/commands/agent/import.js +122 -0
- package/dist/commands/agent/index.d.ts +3 -0
- package/dist/commands/agent/index.js +56 -0
- package/dist/commands/agent/inspect.d.ts +15 -0
- package/dist/commands/agent/inspect.js +209 -0
- package/dist/commands/agent/logs.d.ts +19 -0
- package/dist/commands/agent/logs.js +180 -0
- package/dist/commands/agent/ls.d.ts +44 -0
- package/dist/commands/agent/ls.js +212 -0
- package/dist/commands/agent/mode.d.ts +18 -0
- package/dist/commands/agent/mode.js +100 -0
- package/dist/commands/agent/open.d.ts +11 -0
- package/dist/commands/agent/open.js +61 -0
- package/dist/commands/agent/reload.d.ts +15 -0
- package/dist/commands/agent/reload.js +75 -0
- package/dist/commands/agent/run.d.ts +78 -0
- package/dist/commands/agent/run.js +554 -0
- package/dist/commands/agent/send.d.ts +19 -0
- package/dist/commands/agent/send.js +187 -0
- package/dist/commands/agent/stop.d.ts +17 -0
- package/dist/commands/agent/stop.js +115 -0
- package/dist/commands/agent/update.d.ts +51 -0
- package/dist/commands/agent/update.js +186 -0
- package/dist/commands/agent/wait.d.ts +17 -0
- package/dist/commands/agent/wait.js +158 -0
- package/dist/commands/clone.d.ts +17 -0
- package/dist/commands/clone.js +65 -0
- package/dist/commands/daemon/index.d.ts +3 -0
- package/dist/commands/daemon/index.js +60 -0
- package/dist/commands/daemon/local-daemon.d.ts +78 -0
- package/dist/commands/daemon/local-daemon.js +547 -0
- package/dist/commands/daemon/pair.d.ts +35 -0
- package/dist/commands/daemon/pair.js +167 -0
- package/dist/commands/daemon/reload.d.ts +10 -0
- package/dist/commands/daemon/reload.js +36 -0
- package/dist/commands/daemon/restart.d.ts +12 -0
- package/dist/commands/daemon/restart.js +99 -0
- package/dist/commands/daemon/runtime-toolchain.d.ts +6 -0
- package/dist/commands/daemon/runtime-toolchain.js +87 -0
- package/dist/commands/daemon/set-password.d.ts +17 -0
- package/dist/commands/daemon/set-password.js +82 -0
- package/dist/commands/daemon/start.d.ts +6 -0
- package/dist/commands/daemon/start.js +57 -0
- package/dist/commands/daemon/status.d.ts +21 -0
- package/dist/commands/daemon/status.js +363 -0
- package/dist/commands/daemon/stop.d.ts +15 -0
- package/dist/commands/daemon/stop.js +60 -0
- package/dist/commands/heartbeat/index.d.ts +3 -0
- package/dist/commands/heartbeat/index.js +139 -0
- package/dist/commands/hooks.d.ts +19 -0
- package/dist/commands/hooks.js +89 -0
- package/dist/commands/hub/authority.d.ts +17 -0
- package/dist/commands/hub/authority.js +18 -0
- package/dist/commands/hub/connect.d.ts +23 -0
- package/dist/commands/hub/connect.js +44 -0
- package/dist/commands/hub/credentials.d.ts +21 -0
- package/dist/commands/hub/credentials.js +143 -0
- package/dist/commands/hub/daemon-client.d.ts +40 -0
- package/dist/commands/hub/daemon-client.js +14 -0
- package/dist/commands/hub/deploy-bundle.d.ts +16 -0
- package/dist/commands/hub/deploy-bundle.js +248 -0
- package/dist/commands/hub/deploy-triggers.d.ts +6 -0
- package/dist/commands/hub/deploy-triggers.js +116 -0
- package/dist/commands/hub/deploy.d.ts +50 -0
- package/dist/commands/hub/deploy.js +159 -0
- package/dist/commands/hub/disconnect.d.ts +16 -0
- package/dist/commands/hub/disconnect.js +24 -0
- package/dist/commands/hub/error.d.ts +6 -0
- package/dist/commands/hub/error.js +9 -0
- package/dist/commands/hub/export.d.ts +28 -0
- package/dist/commands/hub/export.js +80 -0
- package/dist/commands/hub/help.d.ts +3 -0
- package/dist/commands/hub/help.js +5 -0
- package/dist/commands/hub/hub-client/index.d.ts +22 -0
- package/dist/commands/hub/hub-client/index.js +135 -0
- package/dist/commands/hub/hub-client/internal/contracts.d.ts +126 -0
- package/dist/commands/hub/hub-client/internal/contracts.js +85 -0
- package/dist/commands/hub/hub-client/internal/problem.d.ts +3 -0
- package/dist/commands/hub/hub-client/internal/problem.js +85 -0
- package/dist/commands/hub/hub-client/internal/transport.d.ts +15 -0
- package/dist/commands/hub/hub-client/internal/transport.js +30 -0
- package/dist/commands/hub/index.d.ts +20 -0
- package/dist/commands/hub/index.js +94 -0
- package/dist/commands/hub/init-plan.d.ts +33 -0
- package/dist/commands/hub/init-plan.js +94 -0
- package/dist/commands/hub/init.d.ts +35 -0
- package/dist/commands/hub/init.js +524 -0
- package/dist/commands/hub/login-flow.d.ts +34 -0
- package/dist/commands/hub/login-flow.js +78 -0
- package/dist/commands/hub/login.d.ts +23 -0
- package/dist/commands/hub/login.js +40 -0
- package/dist/commands/hub/logout.d.ts +32 -0
- package/dist/commands/hub/logout.js +71 -0
- package/dist/commands/hub/origin.d.ts +2 -0
- package/dist/commands/hub/origin.js +27 -0
- package/dist/commands/hub/permissions.d.ts +21 -0
- package/dist/commands/hub/permissions.js +61 -0
- package/dist/commands/hub/projects.d.ts +24 -0
- package/dist/commands/hub/projects.js +49 -0
- package/dist/commands/hub/reporter.d.ts +10 -0
- package/dist/commands/hub/reporter.js +11 -0
- package/dist/commands/hub/starter-agent-runtime.d.ts +37 -0
- package/dist/commands/hub/starter-agent-runtime.js +49 -0
- package/dist/commands/hub/starter-trigger.d.ts +10 -0
- package/dist/commands/hub/starter-trigger.js +30 -0
- package/dist/commands/hub/status-output.d.ts +13 -0
- package/dist/commands/hub/status-output.js +30 -0
- package/dist/commands/onboard.d.ts +10 -0
- package/dist/commands/onboard.js +400 -0
- package/dist/commands/open.d.ts +4 -0
- package/dist/commands/open.js +89 -0
- package/dist/commands/permit/allow.d.ts +20 -0
- package/dist/commands/permit/allow.js +133 -0
- package/dist/commands/permit/deny.d.ts +12 -0
- package/dist/commands/permit/deny.js +105 -0
- package/dist/commands/permit/index.d.ts +3 -0
- package/dist/commands/permit/index.js +27 -0
- package/dist/commands/permit/ls.d.ts +18 -0
- package/dist/commands/permit/ls.js +66 -0
- package/dist/commands/plugin/index.d.ts +17 -0
- package/dist/commands/plugin/index.js +138 -0
- package/dist/commands/plugin/scaffold.d.ts +6 -0
- package/dist/commands/plugin/scaffold.js +162 -0
- package/dist/commands/plugin/shared.d.ts +5 -0
- package/dist/commands/plugin/shared.js +30 -0
- package/dist/commands/project/create.d.ts +10 -0
- package/dist/commands/project/create.js +41 -0
- package/dist/commands/project/delete.d.ts +9 -0
- package/dist/commands/project/delete.js +33 -0
- package/dist/commands/project/index.d.ts +3 -0
- package/dist/commands/project/index.js +28 -0
- package/dist/commands/project/ls.d.ts +5 -0
- package/dist/commands/project/ls.js +19 -0
- package/dist/commands/project/rename.d.ts +15 -0
- package/dist/commands/project/rename.js +50 -0
- package/dist/commands/project/shared.d.ts +11 -0
- package/dist/commands/project/shared.js +18 -0
- package/dist/commands/provider/add.d.ts +30 -0
- package/dist/commands/provider/add.js +123 -0
- package/dist/commands/provider/diagnostic.d.ts +12 -0
- package/dist/commands/provider/diagnostic.js +31 -0
- package/dist/commands/provider/index.d.ts +3 -0
- package/dist/commands/provider/index.js +38 -0
- package/dist/commands/provider/ls.d.ts +20 -0
- package/dist/commands/provider/ls.js +76 -0
- package/dist/commands/provider/models.d.ts +20 -0
- package/dist/commands/provider/models.js +53 -0
- package/dist/commands/provider/rm.d.ts +10 -0
- package/dist/commands/provider/rm.js +45 -0
- package/dist/commands/provider/shared.d.ts +7 -0
- package/dist/commands/provider/shared.js +10 -0
- package/dist/commands/schedule/create.d.ts +19 -0
- package/dist/commands/schedule/create.js +41 -0
- package/dist/commands/schedule/delete.d.ts +10 -0
- package/dist/commands/schedule/delete.js +32 -0
- package/dist/commands/schedule/index.d.ts +3 -0
- package/dist/commands/schedule/index.js +66 -0
- package/dist/commands/schedule/inspect.d.ts +6 -0
- package/dist/commands/schedule/inspect.js +27 -0
- package/dist/commands/schedule/logs.d.ts +6 -0
- package/dist/commands/schedule/logs.js +24 -0
- package/dist/commands/schedule/ls.d.ts +5 -0
- package/dist/commands/schedule/ls.js +25 -0
- package/dist/commands/schedule/pause.d.ts +5 -0
- package/dist/commands/schedule/pause.js +24 -0
- package/dist/commands/schedule/resume.d.ts +5 -0
- package/dist/commands/schedule/resume.js +24 -0
- package/dist/commands/schedule/run-once.d.ts +5 -0
- package/dist/commands/schedule/run-once.js +24 -0
- package/dist/commands/schedule/schema.d.ts +21 -0
- package/dist/commands/schedule/schema.js +67 -0
- package/dist/commands/schedule/shared.d.ts +59 -0
- package/dist/commands/schedule/shared.js +358 -0
- package/dist/commands/schedule/types.d.ts +165 -0
- package/dist/commands/schedule/types.js +2 -0
- package/dist/commands/schedule/update.d.ts +21 -0
- package/dist/commands/schedule/update.js +40 -0
- package/dist/commands/script/index.d.ts +3 -0
- package/dist/commands/script/index.js +19 -0
- package/dist/commands/script/ls.d.ts +6 -0
- package/dist/commands/script/ls.js +20 -0
- package/dist/commands/script/schema.d.ts +5 -0
- package/dist/commands/script/schema.js +13 -0
- package/dist/commands/script/shared.d.ts +11 -0
- package/dist/commands/script/shared.js +59 -0
- package/dist/commands/script/start.d.ts +6 -0
- package/dist/commands/script/start.js +23 -0
- package/dist/commands/script/stop.d.ts +6 -0
- package/dist/commands/script/stop.js +23 -0
- package/dist/commands/speech/index.d.ts +3 -0
- package/dist/commands/speech/index.js +5 -0
- package/dist/commands/terminal/capture.d.ts +10 -0
- package/dist/commands/terminal/capture.js +68 -0
- package/dist/commands/terminal/create.d.ts +11 -0
- package/dist/commands/terminal/create.js +29 -0
- package/dist/commands/terminal/index.d.ts +3 -0
- package/dist/commands/terminal/index.js +45 -0
- package/dist/commands/terminal/kill.d.ts +6 -0
- package/dist/commands/terminal/kill.js +36 -0
- package/dist/commands/terminal/ls.d.ts +11 -0
- package/dist/commands/terminal/ls.js +21 -0
- package/dist/commands/terminal/schema.d.ts +10 -0
- package/dist/commands/terminal/schema.js +17 -0
- package/dist/commands/terminal/send-keys.d.ts +7 -0
- package/dist/commands/terminal/send-keys.js +45 -0
- package/dist/commands/terminal/shared.d.ts +12 -0
- package/dist/commands/terminal/shared.js +62 -0
- package/dist/commands/workspace/archive.d.ts +12 -0
- package/dist/commands/workspace/archive.js +41 -0
- package/dist/commands/workspace/create.d.ts +49 -0
- package/dist/commands/workspace/create.js +114 -0
- package/dist/commands/workspace/index.d.ts +3 -0
- package/dist/commands/workspace/index.js +45 -0
- package/dist/commands/workspace/ls.d.ts +7 -0
- package/dist/commands/workspace/ls.js +28 -0
- package/dist/commands/workspace/rename.d.ts +22 -0
- package/dist/commands/workspace/rename.js +61 -0
- package/dist/commands/workspace/setup.d.ts +11 -0
- package/dist/commands/workspace/setup.js +41 -0
- package/dist/commands/workspace/shared.d.ts +12 -0
- package/dist/commands/workspace/shared.js +20 -0
- package/dist/commands/worktree/archive.d.ts +20 -0
- package/dist/commands/worktree/archive.js +104 -0
- package/dist/commands/worktree/create-input.d.ts +15 -0
- package/dist/commands/worktree/create-input.js +56 -0
- package/dist/commands/worktree/create.d.ts +11 -0
- package/dist/commands/worktree/create.js +58 -0
- package/dist/commands/worktree/index.d.ts +3 -0
- package/dist/commands/worktree/index.js +25 -0
- package/dist/commands/worktree/ls.d.ts +19 -0
- package/dist/commands/worktree/ls.js +97 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/output/index.d.ts +45 -0
- package/dist/output/index.js +47 -0
- package/dist/output/json.d.ts +11 -0
- package/dist/output/json.js +37 -0
- package/dist/output/pairing.d.ts +8 -0
- package/dist/output/pairing.js +24 -0
- package/dist/output/quiet.d.ts +9 -0
- package/dist/output/quiet.js +22 -0
- package/dist/output/render.d.ts +15 -0
- package/dist/output/render.js +84 -0
- package/dist/output/table.d.ts +13 -0
- package/dist/output/table.js +135 -0
- package/dist/output/types.d.ts +73 -0
- package/dist/output/types.js +8 -0
- package/dist/output/with-output.d.ts +41 -0
- package/dist/output/with-output.js +85 -0
- package/dist/output/yaml.d.ts +11 -0
- package/dist/output/yaml.js +38 -0
- package/dist/run.d.ts +14 -0
- package/dist/run.js +40 -0
- package/dist/ssh/ssh-tunnel.d.ts +9 -0
- package/dist/ssh/ssh-tunnel.js +79 -0
- package/dist/utils/client-id.d.ts +2 -0
- package/dist/utils/client-id.js +37 -0
- package/dist/utils/client.d.ts +54 -0
- package/dist/utils/client.js +363 -0
- package/dist/utils/command-options.d.ts +7 -0
- package/dist/utils/command-options.js +25 -0
- package/dist/utils/duration.d.ts +7 -0
- package/dist/utils/duration.js +39 -0
- package/dist/utils/errors.d.ts +5 -0
- package/dist/utils/errors.js +10 -0
- package/dist/utils/paths.d.ts +12 -0
- package/dist/utils/paths.js +22 -0
- package/dist/utils/provider-model.d.ts +11 -0
- package/dist/utils/provider-model.js +49 -0
- package/dist/utils/timeline.d.ts +11 -0
- package/dist/utils/timeline.js +11 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +10 -0
- package/package.json +50 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { loadConfig, resolvePaseoHome } from "@camerontaylor/paseo-server";
|
|
3
|
+
import { buildDaemonWebSocketUrl, buildRelayWebSocketUrl, normalizeHostPort, parseConnectionUri, shouldUseTlsForDefaultHostedRelay, } from "@camerontaylor/paseo-protocol/daemon-endpoints";
|
|
4
|
+
import { parseConnectionOfferFromUrl, } from "@camerontaylor/paseo-protocol/connection-offer";
|
|
5
|
+
import { parseSshTransportUri } from "@camerontaylor/paseo-protocol/ssh-transport";
|
|
6
|
+
import { DaemonClient } from "@camerontaylor/paseo-client/internal/daemon-client";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { WebSocket } from "ws";
|
|
9
|
+
import { getOrCreateCliClientId } from "./client-id.js";
|
|
10
|
+
import { resolveCliVersion } from "../version.js";
|
|
11
|
+
import { createSshTunnel } from "../ssh/ssh-tunnel.js";
|
|
12
|
+
const DEFAULT_HOST = "localhost:6767";
|
|
13
|
+
const DEFAULT_TIMEOUT = 15000;
|
|
14
|
+
const PID_FILENAME = "paseo.pid";
|
|
15
|
+
/**
|
|
16
|
+
* Get the daemon host from environment or options
|
|
17
|
+
*/
|
|
18
|
+
export function getDaemonHost(options) {
|
|
19
|
+
return resolveDaemonHostCandidates(options)[0] ?? DEFAULT_HOST;
|
|
20
|
+
}
|
|
21
|
+
export function buildDaemonConnectionCommandError(options) {
|
|
22
|
+
const host = getDaemonHost({ host: options.host });
|
|
23
|
+
const message = options.error instanceof Error ? options.error.message : String(options.error);
|
|
24
|
+
return {
|
|
25
|
+
code: "DAEMON_NOT_RUNNING",
|
|
26
|
+
message: `Cannot connect to daemon at ${host}: ${message}`,
|
|
27
|
+
details: host.trim().startsWith("ssh://")
|
|
28
|
+
? "Start the Paseo daemon on the SSH host; SSH transport does not install or start it."
|
|
29
|
+
: "Start the daemon with: paseo daemon start",
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function normalizeDaemonHost(raw) {
|
|
33
|
+
const trimmed = raw.trim();
|
|
34
|
+
if (!trimmed) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
if (trimmed.startsWith("tcp://")) {
|
|
38
|
+
try {
|
|
39
|
+
const parsed = parseConnectionUri(trimmed);
|
|
40
|
+
const endpoint = normalizeHostPort(parsed.isIpv6 ? `[${parsed.host}]:${parsed.port}` : `${parsed.host}:${parsed.port}`);
|
|
41
|
+
const query = new URLSearchParams();
|
|
42
|
+
if (parsed.useTls) {
|
|
43
|
+
query.set("ssl", "true");
|
|
44
|
+
}
|
|
45
|
+
if (parsed.password) {
|
|
46
|
+
query.set("password", parsed.password);
|
|
47
|
+
}
|
|
48
|
+
const queryString = query.toString();
|
|
49
|
+
const suffix = queryString ? `?${queryString}` : "";
|
|
50
|
+
return `tcp://${endpoint}${suffix}`;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (trimmed.startsWith("unix://") ||
|
|
57
|
+
trimmed.startsWith("pipe://") ||
|
|
58
|
+
trimmed.startsWith("\\\\.\\pipe\\")) {
|
|
59
|
+
return trimmed.startsWith("\\\\.\\pipe\\") ? `pipe://${trimmed}` : trimmed;
|
|
60
|
+
}
|
|
61
|
+
if (trimmed.startsWith("/") || trimmed.startsWith("~")) {
|
|
62
|
+
return `unix://${trimmed}`;
|
|
63
|
+
}
|
|
64
|
+
// Windows absolute paths (e.g. C:\Users\foo) are filesystem paths, not TCP or IPC targets.
|
|
65
|
+
if (/^[A-Za-z]:[/\\]/.test(trimmed)) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
if (/^\d+$/.test(trimmed)) {
|
|
69
|
+
return `127.0.0.1:${trimmed}`;
|
|
70
|
+
}
|
|
71
|
+
return trimmed.includes(":") ? trimmed : null;
|
|
72
|
+
}
|
|
73
|
+
export function resolveDefaultDaemonHost(env = process.env) {
|
|
74
|
+
return resolveDefaultDaemonHosts(env)[0] ?? DEFAULT_HOST;
|
|
75
|
+
}
|
|
76
|
+
function isIpcDaemonHost(host) {
|
|
77
|
+
return host !== null && (host.startsWith("unix://") || host.startsWith("pipe://"));
|
|
78
|
+
}
|
|
79
|
+
function isTcpDaemonHost(host) {
|
|
80
|
+
return host !== null && !isIpcDaemonHost(host);
|
|
81
|
+
}
|
|
82
|
+
function readPidSocketTarget(paseoHome) {
|
|
83
|
+
const pidPath = path.join(paseoHome, PID_FILENAME);
|
|
84
|
+
if (!existsSync(pidPath)) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
const parsed = JSON.parse(readFileSync(pidPath, "utf-8"));
|
|
89
|
+
if (typeof parsed.listen === "string")
|
|
90
|
+
return parsed.listen;
|
|
91
|
+
if (typeof parsed.sockPath === "string")
|
|
92
|
+
return parsed.sockPath;
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function resolveConfiguredIpcDaemonHost(env, paseoHome) {
|
|
100
|
+
const directEnvHost = normalizeDaemonHost(env.PASEO_LISTEN ?? "");
|
|
101
|
+
if (isIpcDaemonHost(directEnvHost)) {
|
|
102
|
+
return directEnvHost;
|
|
103
|
+
}
|
|
104
|
+
const pidHost = normalizeDaemonHost(readPidSocketTarget(paseoHome) ?? "");
|
|
105
|
+
if (isIpcDaemonHost(pidHost)) {
|
|
106
|
+
return pidHost;
|
|
107
|
+
}
|
|
108
|
+
const config = loadConfig(paseoHome, { env });
|
|
109
|
+
const configuredHost = normalizeDaemonHost(config.listen);
|
|
110
|
+
return isIpcDaemonHost(configuredHost) ? configuredHost : null;
|
|
111
|
+
}
|
|
112
|
+
function resolveConfiguredTcpDaemonHost(env, paseoHome) {
|
|
113
|
+
const configuredHost = normalizeDaemonHost(loadConfig(paseoHome, { env }).listen);
|
|
114
|
+
if (!isTcpDaemonHost(configuredHost)) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
return configuredHost === "127.0.0.1:6767" ? null : configuredHost;
|
|
118
|
+
}
|
|
119
|
+
export function resolveDefaultDaemonHosts(env = process.env) {
|
|
120
|
+
const paseoHome = resolvePaseoHome(env);
|
|
121
|
+
const candidates = [];
|
|
122
|
+
const configuredIpcHost = resolveConfiguredIpcDaemonHost(env, paseoHome);
|
|
123
|
+
if (configuredIpcHost) {
|
|
124
|
+
candidates.push(configuredIpcHost);
|
|
125
|
+
}
|
|
126
|
+
const configuredTcpHost = resolveConfiguredTcpDaemonHost(env, paseoHome);
|
|
127
|
+
if (configuredTcpHost) {
|
|
128
|
+
candidates.push(configuredTcpHost);
|
|
129
|
+
}
|
|
130
|
+
candidates.push(DEFAULT_HOST);
|
|
131
|
+
return Array.from(new Set(candidates));
|
|
132
|
+
}
|
|
133
|
+
function resolveDaemonHostCandidates(options) {
|
|
134
|
+
const explicitHost = getExplicitDaemonHost(options?.host);
|
|
135
|
+
if (explicitHost) {
|
|
136
|
+
return [explicitHost];
|
|
137
|
+
}
|
|
138
|
+
return resolveDefaultDaemonHosts();
|
|
139
|
+
}
|
|
140
|
+
export function getExplicitDaemonHost(host, env = process.env) {
|
|
141
|
+
const explicitHost = host ?? env.PASEO_HOST;
|
|
142
|
+
return explicitHost?.trim() ? explicitHost : undefined;
|
|
143
|
+
}
|
|
144
|
+
function stripIpcPrefix(trimmed) {
|
|
145
|
+
if (trimmed.startsWith("unix://"))
|
|
146
|
+
return trimmed.slice("unix://".length).trim();
|
|
147
|
+
if (trimmed.startsWith("pipe://"))
|
|
148
|
+
return trimmed.slice("pipe://".length).trim();
|
|
149
|
+
return trimmed;
|
|
150
|
+
}
|
|
151
|
+
export function resolveDaemonTarget(host) {
|
|
152
|
+
const trimmed = normalizeDaemonHost(host);
|
|
153
|
+
if (!trimmed) {
|
|
154
|
+
throw new Error(`Invalid daemon target: ${host}`);
|
|
155
|
+
}
|
|
156
|
+
if (trimmed.startsWith("unix://") ||
|
|
157
|
+
trimmed.startsWith("pipe://") ||
|
|
158
|
+
trimmed.startsWith("\\\\.\\pipe\\")) {
|
|
159
|
+
const socketPath = stripIpcPrefix(trimmed);
|
|
160
|
+
if (!socketPath) {
|
|
161
|
+
throw new Error("Invalid IPC daemon target: missing socket path");
|
|
162
|
+
}
|
|
163
|
+
const isUnixSocket = trimmed.startsWith("unix://");
|
|
164
|
+
return {
|
|
165
|
+
type: "ipc",
|
|
166
|
+
url: isUnixSocket ? `ws+unix://${socketPath}:/ws` : "ws://localhost/ws",
|
|
167
|
+
socketPath,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
if (trimmed.startsWith("tcp://")) {
|
|
171
|
+
const parsed = parseConnectionUri(trimmed);
|
|
172
|
+
const endpoint = normalizeHostPort(parsed.isIpv6 ? `[${parsed.host}]:${parsed.port}` : `${parsed.host}:${parsed.port}`);
|
|
173
|
+
return {
|
|
174
|
+
type: "tcp",
|
|
175
|
+
url: buildDaemonWebSocketUrl(endpoint, { useTls: parsed.useTls }),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
type: "tcp",
|
|
180
|
+
url: `ws://${trimmed}/ws`,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
export function resolveDaemonPassword(host) {
|
|
184
|
+
const trimmed = host.trim();
|
|
185
|
+
if (trimmed.startsWith("tcp://")) {
|
|
186
|
+
const fromUri = parseConnectionUri(trimmed).password;
|
|
187
|
+
if (fromUri)
|
|
188
|
+
return fromUri;
|
|
189
|
+
}
|
|
190
|
+
const fromEnv = process.env.PASEO_PASSWORD;
|
|
191
|
+
return fromEnv && fromEnv.length > 0 ? fromEnv : undefined;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Create a WebSocket factory that works in Node.js
|
|
195
|
+
*/
|
|
196
|
+
function createNodeWebSocketFactory() {
|
|
197
|
+
return (url, options) => {
|
|
198
|
+
return new WebSocket(url, options?.protocols, {
|
|
199
|
+
headers: options?.headers,
|
|
200
|
+
...(options?.socketPath ? { socketPath: options.socketPath } : {}),
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Create and connect a daemon client
|
|
206
|
+
* Returns the connected client or throws if connection fails
|
|
207
|
+
*/
|
|
208
|
+
async function tryConnectHost(host, password, clientId, timeout, nodeWebSocketFactory) {
|
|
209
|
+
const target = resolveDaemonTarget(host);
|
|
210
|
+
const client = new DaemonClient({
|
|
211
|
+
url: target.url,
|
|
212
|
+
clientId,
|
|
213
|
+
clientType: "cli",
|
|
214
|
+
appVersion: resolveCliVersion(),
|
|
215
|
+
password,
|
|
216
|
+
connectTimeoutMs: timeout,
|
|
217
|
+
webSocketFactory: (url, config) => nodeWebSocketFactory(url, {
|
|
218
|
+
headers: config?.headers,
|
|
219
|
+
protocols: config?.protocols,
|
|
220
|
+
...(target.type === "ipc" ? { socketPath: target.socketPath } : {}),
|
|
221
|
+
}),
|
|
222
|
+
reconnect: { enabled: false },
|
|
223
|
+
});
|
|
224
|
+
try {
|
|
225
|
+
await client.connect();
|
|
226
|
+
return { client };
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
await client.close().catch(() => { });
|
|
230
|
+
return { error };
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
async function connectViaRelayOffer(offer, clientId, timeout, nodeWebSocketFactory) {
|
|
234
|
+
const url = buildRelayWebSocketUrl({
|
|
235
|
+
endpoint: offer.relay.endpoint,
|
|
236
|
+
serverId: offer.serverId,
|
|
237
|
+
role: "client",
|
|
238
|
+
useTls: offer.relay.useTls ?? shouldUseTlsForDefaultHostedRelay(offer.relay.endpoint),
|
|
239
|
+
});
|
|
240
|
+
const client = new DaemonClient({
|
|
241
|
+
url,
|
|
242
|
+
clientId,
|
|
243
|
+
clientType: "cli",
|
|
244
|
+
appVersion: resolveCliVersion(),
|
|
245
|
+
connectTimeoutMs: timeout,
|
|
246
|
+
webSocketFactory: (target, config) => nodeWebSocketFactory(target, { headers: config?.headers, protocols: config?.protocols }),
|
|
247
|
+
e2ee: { enabled: true, daemonPublicKeyB64: offer.daemonPublicKeyB64 },
|
|
248
|
+
reconnect: { enabled: false },
|
|
249
|
+
});
|
|
250
|
+
try {
|
|
251
|
+
await client.connect();
|
|
252
|
+
return client;
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
await client.close().catch(() => { });
|
|
256
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
257
|
+
const lastError = client.lastError ? ` (${client.lastError})` : "";
|
|
258
|
+
throw new Error(`Failed to connect via relay offer: ${message}${lastError}`, { cause: error });
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
function parseHostOfferOrNull(host) {
|
|
262
|
+
if (!host)
|
|
263
|
+
return null;
|
|
264
|
+
try {
|
|
265
|
+
return parseConnectionOfferFromUrl(host);
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
269
|
+
throw new Error(`Invalid pairing offer URL: ${message}`, { cause: error });
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
export async function connectToDaemon(options) {
|
|
273
|
+
const timeout = options?.timeout ?? DEFAULT_TIMEOUT;
|
|
274
|
+
const clientId = await getOrCreateCliClientId();
|
|
275
|
+
const nodeWebSocketFactory = createNodeWebSocketFactory();
|
|
276
|
+
const explicitHost = getExplicitDaemonHost(options?.host);
|
|
277
|
+
if (explicitHost?.trim().startsWith("ssh://")) {
|
|
278
|
+
const target = parseSshTransportUri(explicitHost.trim());
|
|
279
|
+
const tunnel = await createSshTunnel(target);
|
|
280
|
+
const password = resolveDaemonPassword(explicitHost);
|
|
281
|
+
const result = await tryConnectHost(tunnel.endpoint, password, clientId, timeout, nodeWebSocketFactory);
|
|
282
|
+
if ("client" in result)
|
|
283
|
+
return result.client;
|
|
284
|
+
const failure = tunnel.failureDetail();
|
|
285
|
+
tunnel.close();
|
|
286
|
+
if (failure)
|
|
287
|
+
throw new Error(`SSH connection failed: ${failure}`, { cause: result.error });
|
|
288
|
+
throw result.error;
|
|
289
|
+
}
|
|
290
|
+
const offer = parseHostOfferOrNull(explicitHost);
|
|
291
|
+
if (offer) {
|
|
292
|
+
return connectViaRelayOffer(offer, clientId, timeout, nodeWebSocketFactory);
|
|
293
|
+
}
|
|
294
|
+
const hosts = resolveDaemonHostCandidates(options);
|
|
295
|
+
async function tryNext(index, lastError) {
|
|
296
|
+
if (index >= hosts.length) {
|
|
297
|
+
if (lastError instanceof Error)
|
|
298
|
+
throw lastError;
|
|
299
|
+
throw new Error(`Unable to connect to Paseo daemon via ${hosts.join(", ")}`);
|
|
300
|
+
}
|
|
301
|
+
const host = hosts[index];
|
|
302
|
+
const password = resolveDaemonPassword(host);
|
|
303
|
+
const result = await tryConnectHost(host, password, clientId, timeout, nodeWebSocketFactory);
|
|
304
|
+
if ("client" in result) {
|
|
305
|
+
return result.client;
|
|
306
|
+
}
|
|
307
|
+
return tryNext(index + 1, result.error);
|
|
308
|
+
}
|
|
309
|
+
return tryNext(0, null);
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Try to connect to the daemon, returns null if connection fails
|
|
313
|
+
*/
|
|
314
|
+
export async function tryConnectToDaemon(options) {
|
|
315
|
+
try {
|
|
316
|
+
return await connectToDaemon(options);
|
|
317
|
+
}
|
|
318
|
+
catch {
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Resolve an agent ID from a partial ID or name.
|
|
324
|
+
* Supports:
|
|
325
|
+
* - Full ID match
|
|
326
|
+
* - Prefix match (first N characters)
|
|
327
|
+
* - Title/name match (case-insensitive)
|
|
328
|
+
*
|
|
329
|
+
* Returns the full agent ID if found, null otherwise.
|
|
330
|
+
*/
|
|
331
|
+
export function resolveAgentId(idOrName, agents) {
|
|
332
|
+
if (!idOrName || agents.length === 0) {
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
const query = idOrName.toLowerCase();
|
|
336
|
+
// Try exact ID match first
|
|
337
|
+
const exactMatch = agents.find((a) => a.id === idOrName);
|
|
338
|
+
if (exactMatch) {
|
|
339
|
+
return exactMatch.id;
|
|
340
|
+
}
|
|
341
|
+
// Try ID prefix match
|
|
342
|
+
const prefixMatches = agents.filter((a) => a.id.toLowerCase().startsWith(query));
|
|
343
|
+
if (prefixMatches.length === 1 && prefixMatches[0]) {
|
|
344
|
+
return prefixMatches[0].id;
|
|
345
|
+
}
|
|
346
|
+
// Try title/name match (case-insensitive)
|
|
347
|
+
const titleMatches = agents.filter((a) => a.title?.toLowerCase() === query);
|
|
348
|
+
if (titleMatches.length === 1 && titleMatches[0]) {
|
|
349
|
+
return titleMatches[0].id;
|
|
350
|
+
}
|
|
351
|
+
// Try partial title match
|
|
352
|
+
const partialTitleMatches = agents.filter((a) => a.title?.toLowerCase().includes(query));
|
|
353
|
+
if (partialTitleMatches.length === 1 && partialTitleMatches[0]) {
|
|
354
|
+
return partialTitleMatches[0].id;
|
|
355
|
+
}
|
|
356
|
+
// If we have multiple prefix matches and no unique title match, return first prefix match
|
|
357
|
+
const firstPrefixMatch = prefixMatches[0];
|
|
358
|
+
if (firstPrefixMatch) {
|
|
359
|
+
return firstPrefixMatch.id;
|
|
360
|
+
}
|
|
361
|
+
return null;
|
|
362
|
+
}
|
|
363
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
export declare function collectMultiple(value: string, previous: string[]): string[];
|
|
3
|
+
export declare function addJsonOption<T extends Command>(command: T): T;
|
|
4
|
+
export declare function addDaemonHostOption<T extends Command>(command: T): T;
|
|
5
|
+
export declare function addJsonAndDaemonHostOptions<T extends Command>(command: T): T;
|
|
6
|
+
export declare function withGlobalOptions<Args extends unknown[], Result>(handler: (...args: Args) => Result): (...args: Args) => Result;
|
|
7
|
+
//# sourceMappingURL=command-options.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
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
|
+
export function collectMultiple(value, previous) {
|
|
4
|
+
return previous.concat([value]);
|
|
5
|
+
}
|
|
6
|
+
export function addJsonOption(command) {
|
|
7
|
+
command.option("--json", JSON_OPTION_DESCRIPTION);
|
|
8
|
+
return command;
|
|
9
|
+
}
|
|
10
|
+
export function addDaemonHostOption(command) {
|
|
11
|
+
command.option("--host <host>", DAEMON_HOST_OPTION_DESCRIPTION);
|
|
12
|
+
return command;
|
|
13
|
+
}
|
|
14
|
+
export function addJsonAndDaemonHostOptions(command) {
|
|
15
|
+
return addDaemonHostOption(addJsonOption(command));
|
|
16
|
+
}
|
|
17
|
+
export function withGlobalOptions(handler) {
|
|
18
|
+
return (...args) => {
|
|
19
|
+
const command = args.at(-1);
|
|
20
|
+
const mergedArgs = [...args];
|
|
21
|
+
mergedArgs[mergedArgs.length - 2] = command.optsWithGlobals();
|
|
22
|
+
return handler(...mergedArgs);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=command-options.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse duration string to milliseconds.
|
|
3
|
+
* Supports formats like: 5m, 30s, 1h, 2h30m, 1d, 90, etc.
|
|
4
|
+
* If no unit is specified, assumes seconds.
|
|
5
|
+
*/
|
|
6
|
+
export function parseDuration(input) {
|
|
7
|
+
const trimmed = input.trim();
|
|
8
|
+
// If it's just a number, treat as seconds
|
|
9
|
+
if (/^\d+$/.test(trimmed)) {
|
|
10
|
+
return parseInt(trimmed, 10) * 1000;
|
|
11
|
+
}
|
|
12
|
+
if (!/^(?:\d+[smhd])+$/.test(trimmed)) {
|
|
13
|
+
throw new Error(`Invalid duration format: ${input}. Use formats like: 5m, 30s, 1h, 2h30m, 1d`);
|
|
14
|
+
}
|
|
15
|
+
// Parse duration with units
|
|
16
|
+
let totalMs = 0;
|
|
17
|
+
const regex = /(\d+)([smhd])/g;
|
|
18
|
+
let match;
|
|
19
|
+
while ((match = regex.exec(trimmed)) !== null) {
|
|
20
|
+
const value = parseInt(match[1], 10);
|
|
21
|
+
const unit = match[2];
|
|
22
|
+
switch (unit) {
|
|
23
|
+
case "s":
|
|
24
|
+
totalMs += value * 1000;
|
|
25
|
+
break;
|
|
26
|
+
case "m":
|
|
27
|
+
totalMs += value * 60 * 1000;
|
|
28
|
+
break;
|
|
29
|
+
case "h":
|
|
30
|
+
totalMs += value * 60 * 60 * 1000;
|
|
31
|
+
break;
|
|
32
|
+
case "d":
|
|
33
|
+
totalMs += value * 24 * 60 * 60 * 1000;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return totalMs;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=duration.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path utilities for cwd filtering in agent commands.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Check if `candidatePath` is the same directory as `basePath` or a descendant of it.
|
|
6
|
+
*
|
|
7
|
+
* Handles both Unix (/) and Windows (\) path separators, including mixed separators.
|
|
8
|
+
* This is important because agent cwd paths come from the agent's OS (could be Windows)
|
|
9
|
+
* while the CLI filter path comes from the user (could also be Windows or Unix).
|
|
10
|
+
*/
|
|
11
|
+
export declare function isSameOrDescendantPath(basePath: string, candidatePath: string): boolean;
|
|
12
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path utilities for cwd filtering in agent commands.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Check if `candidatePath` is the same directory as `basePath` or a descendant of it.
|
|
6
|
+
*
|
|
7
|
+
* Handles both Unix (/) and Windows (\) path separators, including mixed separators.
|
|
8
|
+
* This is important because agent cwd paths come from the agent's OS (could be Windows)
|
|
9
|
+
* while the CLI filter path comes from the user (could also be Windows or Unix).
|
|
10
|
+
*/
|
|
11
|
+
export function isSameOrDescendantPath(basePath, candidatePath) {
|
|
12
|
+
// Normalize both paths: replace all backslashes with forward slashes, strip trailing separator
|
|
13
|
+
let normalizedBase = basePath.replace(/\\/g, "/").replace(/\/$/, "");
|
|
14
|
+
let normalizedCandidate = candidatePath.replace(/\\/g, "/").replace(/\/$/, "");
|
|
15
|
+
// Windows paths are case-insensitive — detect by drive letter prefix (e.g. "C:/")
|
|
16
|
+
if (/^[a-zA-Z]:\//.test(normalizedBase) || /^[a-zA-Z]:\//.test(normalizedCandidate)) {
|
|
17
|
+
normalizedBase = normalizedBase.toLowerCase();
|
|
18
|
+
normalizedCandidate = normalizedCandidate.toLowerCase();
|
|
19
|
+
}
|
|
20
|
+
return (normalizedCandidate === normalizedBase || normalizedCandidate.startsWith(normalizedBase + "/"));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ResolveProviderAndModelOptions {
|
|
2
|
+
provider?: string;
|
|
3
|
+
model?: string;
|
|
4
|
+
defaultProvider?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ResolvedProviderModel {
|
|
7
|
+
provider: string;
|
|
8
|
+
model: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare function resolveProviderAndModel(options: ResolveProviderAndModelOptions): ResolvedProviderModel;
|
|
11
|
+
//# sourceMappingURL=provider-model.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function resolveProviderAndModel(options) {
|
|
2
|
+
const providerInput = options.provider?.trim() || options.defaultProvider;
|
|
3
|
+
const modelInput = options.model?.trim();
|
|
4
|
+
if (!providerInput) {
|
|
5
|
+
const error = {
|
|
6
|
+
code: "MISSING_PROVIDER",
|
|
7
|
+
message: "Provider is required",
|
|
8
|
+
details: "Pass --provider <provider> or --provider <provider>/<model>. Use `paseo provider ls` to see providers and `paseo provider models <provider>` to see models.",
|
|
9
|
+
};
|
|
10
|
+
throw error;
|
|
11
|
+
}
|
|
12
|
+
if (options.model !== undefined && !modelInput) {
|
|
13
|
+
const error = {
|
|
14
|
+
code: "INVALID_MODEL",
|
|
15
|
+
message: "--model cannot be empty",
|
|
16
|
+
};
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
const slashIndex = providerInput.indexOf("/");
|
|
20
|
+
if (slashIndex === -1) {
|
|
21
|
+
return {
|
|
22
|
+
provider: providerInput,
|
|
23
|
+
model: modelInput,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const provider = providerInput.slice(0, slashIndex).trim();
|
|
27
|
+
const modelFromProvider = providerInput.slice(slashIndex + 1).trim();
|
|
28
|
+
if (!provider || !modelFromProvider) {
|
|
29
|
+
const error = {
|
|
30
|
+
code: "INVALID_PROVIDER",
|
|
31
|
+
message: "Invalid --provider value",
|
|
32
|
+
details: "Use --provider <provider> or --provider <provider>/<model>",
|
|
33
|
+
};
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
if (modelInput && modelInput !== modelFromProvider) {
|
|
37
|
+
const error = {
|
|
38
|
+
code: "CONFLICTING_MODEL_OPTIONS",
|
|
39
|
+
message: "Conflicting model values provided",
|
|
40
|
+
details: `--provider specifies model ${modelFromProvider}, but --model specifies ${modelInput}`,
|
|
41
|
+
};
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
provider,
|
|
46
|
+
model: modelInput ?? modelFromProvider,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=provider-model.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DaemonClient } from "@camerontaylor/paseo-client/internal/daemon-client";
|
|
2
|
+
import type { AgentTimelineItem } from "@camerontaylor/paseo-protocol/agent-types";
|
|
3
|
+
export declare const LIVE_HISTORY_FETCH_TIMEOUT_MS = 2000;
|
|
4
|
+
interface FetchProjectedTimelineItemsInput {
|
|
5
|
+
client: DaemonClient;
|
|
6
|
+
agentId: string;
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function fetchProjectedTimelineItems(input: FetchProjectedTimelineItemsInput): Promise<AgentTimelineItem[]>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=timeline.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const LIVE_HISTORY_FETCH_TIMEOUT_MS = 2000;
|
|
2
|
+
export async function fetchProjectedTimelineItems(input) {
|
|
3
|
+
const timeline = await input.client.fetchAgentTimeline(input.agentId, {
|
|
4
|
+
direction: "tail",
|
|
5
|
+
limit: 0,
|
|
6
|
+
projection: "projected",
|
|
7
|
+
timeout: input.timeoutMs,
|
|
8
|
+
});
|
|
9
|
+
return timeline.entries.map((entry) => entry.item);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=timeline.js.map
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
export function resolveCliVersion() {
|
|
4
|
+
const packageJson = require("../package.json");
|
|
5
|
+
if (typeof packageJson.version === "string" && packageJson.version.trim().length > 0) {
|
|
6
|
+
return packageJson.version.trim();
|
|
7
|
+
}
|
|
8
|
+
throw new Error("Unable to resolve @getpaseo/cli version from package.json.");
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=version.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@camerontaylor/paseo-cli",
|
|
3
|
+
"version": "0.8.0-fork.1",
|
|
4
|
+
"description": "Paseo CLI - control your AI coding agents from the command line",
|
|
5
|
+
"bin": {
|
|
6
|
+
"paseo": "bin/paseo"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"dist",
|
|
11
|
+
"!dist/**/*.map"
|
|
12
|
+
],
|
|
13
|
+
"type": "module",
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"clean": "node ../../scripts/clean-package-dist.mjs",
|
|
19
|
+
"build": "tsc -p tsconfig.json --incremental false",
|
|
20
|
+
"build:clean": "npm run clean && npm run build",
|
|
21
|
+
"prepack": "npm run build:clean",
|
|
22
|
+
"typecheck": "tsgo --noEmit",
|
|
23
|
+
"test": "npm run test:unit && npm run test:local",
|
|
24
|
+
"test:unit": "vitest run src",
|
|
25
|
+
"test:local": "tsx tests/run-all.ts",
|
|
26
|
+
"test:e2e": "npm run test:local",
|
|
27
|
+
"test:e2e:lifecycle": "npx tsx tests/e2e/agent-lifecycle.test.ts"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
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",
|
|
34
|
+
"chalk": "^5.3.0",
|
|
35
|
+
"commander": "^12.0.0",
|
|
36
|
+
"mime-types": "^2.1.35",
|
|
37
|
+
"tree-kill": "^1.2.2",
|
|
38
|
+
"ws": "^8.14.2",
|
|
39
|
+
"yaml": "^2.8.4",
|
|
40
|
+
"zod": "^4.4.3"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/mime-types": "^3.0.1",
|
|
44
|
+
"@types/ws": "^8.5.8",
|
|
45
|
+
"tsx": "^4.6.0",
|
|
46
|
+
"typescript": "^5.2.2",
|
|
47
|
+
"vitest": "^4.1.6",
|
|
48
|
+
"zx": "^8.8.5"
|
|
49
|
+
}
|
|
50
|
+
}
|