@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.
Files changed (288) hide show
  1. package/bin/paseo +3 -0
  2. package/dist/classify.d.ts +19 -0
  3. package/dist/classify.js +49 -0
  4. package/dist/cli.d.ts +3 -0
  5. package/dist/cli.js +135 -0
  6. package/dist/commands/agent/archive.d.ts +18 -0
  7. package/dist/commands/agent/archive.js +102 -0
  8. package/dist/commands/agent/attach.d.ts +11 -0
  9. package/dist/commands/agent/attach.js +161 -0
  10. package/dist/commands/agent/delete.d.ts +15 -0
  11. package/dist/commands/agent/delete.js +107 -0
  12. package/dist/commands/agent/detach.d.ts +9 -0
  13. package/dist/commands/agent/detach.js +38 -0
  14. package/dist/commands/agent/import.d.ts +14 -0
  15. package/dist/commands/agent/import.js +122 -0
  16. package/dist/commands/agent/index.d.ts +3 -0
  17. package/dist/commands/agent/index.js +56 -0
  18. package/dist/commands/agent/inspect.d.ts +15 -0
  19. package/dist/commands/agent/inspect.js +209 -0
  20. package/dist/commands/agent/logs.d.ts +19 -0
  21. package/dist/commands/agent/logs.js +180 -0
  22. package/dist/commands/agent/ls.d.ts +44 -0
  23. package/dist/commands/agent/ls.js +212 -0
  24. package/dist/commands/agent/mode.d.ts +18 -0
  25. package/dist/commands/agent/mode.js +100 -0
  26. package/dist/commands/agent/open.d.ts +11 -0
  27. package/dist/commands/agent/open.js +61 -0
  28. package/dist/commands/agent/reload.d.ts +15 -0
  29. package/dist/commands/agent/reload.js +75 -0
  30. package/dist/commands/agent/run.d.ts +78 -0
  31. package/dist/commands/agent/run.js +554 -0
  32. package/dist/commands/agent/send.d.ts +19 -0
  33. package/dist/commands/agent/send.js +187 -0
  34. package/dist/commands/agent/stop.d.ts +17 -0
  35. package/dist/commands/agent/stop.js +115 -0
  36. package/dist/commands/agent/update.d.ts +51 -0
  37. package/dist/commands/agent/update.js +186 -0
  38. package/dist/commands/agent/wait.d.ts +17 -0
  39. package/dist/commands/agent/wait.js +158 -0
  40. package/dist/commands/clone.d.ts +17 -0
  41. package/dist/commands/clone.js +65 -0
  42. package/dist/commands/daemon/index.d.ts +3 -0
  43. package/dist/commands/daemon/index.js +60 -0
  44. package/dist/commands/daemon/local-daemon.d.ts +78 -0
  45. package/dist/commands/daemon/local-daemon.js +547 -0
  46. package/dist/commands/daemon/pair.d.ts +35 -0
  47. package/dist/commands/daemon/pair.js +167 -0
  48. package/dist/commands/daemon/reload.d.ts +10 -0
  49. package/dist/commands/daemon/reload.js +36 -0
  50. package/dist/commands/daemon/restart.d.ts +12 -0
  51. package/dist/commands/daemon/restart.js +99 -0
  52. package/dist/commands/daemon/runtime-toolchain.d.ts +6 -0
  53. package/dist/commands/daemon/runtime-toolchain.js +87 -0
  54. package/dist/commands/daemon/set-password.d.ts +17 -0
  55. package/dist/commands/daemon/set-password.js +82 -0
  56. package/dist/commands/daemon/start.d.ts +6 -0
  57. package/dist/commands/daemon/start.js +57 -0
  58. package/dist/commands/daemon/status.d.ts +21 -0
  59. package/dist/commands/daemon/status.js +363 -0
  60. package/dist/commands/daemon/stop.d.ts +15 -0
  61. package/dist/commands/daemon/stop.js +60 -0
  62. package/dist/commands/heartbeat/index.d.ts +3 -0
  63. package/dist/commands/heartbeat/index.js +139 -0
  64. package/dist/commands/hooks.d.ts +19 -0
  65. package/dist/commands/hooks.js +89 -0
  66. package/dist/commands/hub/authority.d.ts +17 -0
  67. package/dist/commands/hub/authority.js +18 -0
  68. package/dist/commands/hub/connect.d.ts +23 -0
  69. package/dist/commands/hub/connect.js +44 -0
  70. package/dist/commands/hub/credentials.d.ts +21 -0
  71. package/dist/commands/hub/credentials.js +143 -0
  72. package/dist/commands/hub/daemon-client.d.ts +40 -0
  73. package/dist/commands/hub/daemon-client.js +14 -0
  74. package/dist/commands/hub/deploy-bundle.d.ts +16 -0
  75. package/dist/commands/hub/deploy-bundle.js +248 -0
  76. package/dist/commands/hub/deploy-triggers.d.ts +6 -0
  77. package/dist/commands/hub/deploy-triggers.js +116 -0
  78. package/dist/commands/hub/deploy.d.ts +50 -0
  79. package/dist/commands/hub/deploy.js +159 -0
  80. package/dist/commands/hub/disconnect.d.ts +16 -0
  81. package/dist/commands/hub/disconnect.js +24 -0
  82. package/dist/commands/hub/error.d.ts +6 -0
  83. package/dist/commands/hub/error.js +9 -0
  84. package/dist/commands/hub/export.d.ts +28 -0
  85. package/dist/commands/hub/export.js +80 -0
  86. package/dist/commands/hub/help.d.ts +3 -0
  87. package/dist/commands/hub/help.js +5 -0
  88. package/dist/commands/hub/hub-client/index.d.ts +22 -0
  89. package/dist/commands/hub/hub-client/index.js +135 -0
  90. package/dist/commands/hub/hub-client/internal/contracts.d.ts +126 -0
  91. package/dist/commands/hub/hub-client/internal/contracts.js +85 -0
  92. package/dist/commands/hub/hub-client/internal/problem.d.ts +3 -0
  93. package/dist/commands/hub/hub-client/internal/problem.js +85 -0
  94. package/dist/commands/hub/hub-client/internal/transport.d.ts +15 -0
  95. package/dist/commands/hub/hub-client/internal/transport.js +30 -0
  96. package/dist/commands/hub/index.d.ts +20 -0
  97. package/dist/commands/hub/index.js +94 -0
  98. package/dist/commands/hub/init-plan.d.ts +33 -0
  99. package/dist/commands/hub/init-plan.js +94 -0
  100. package/dist/commands/hub/init.d.ts +35 -0
  101. package/dist/commands/hub/init.js +524 -0
  102. package/dist/commands/hub/login-flow.d.ts +34 -0
  103. package/dist/commands/hub/login-flow.js +78 -0
  104. package/dist/commands/hub/login.d.ts +23 -0
  105. package/dist/commands/hub/login.js +40 -0
  106. package/dist/commands/hub/logout.d.ts +32 -0
  107. package/dist/commands/hub/logout.js +71 -0
  108. package/dist/commands/hub/origin.d.ts +2 -0
  109. package/dist/commands/hub/origin.js +27 -0
  110. package/dist/commands/hub/permissions.d.ts +21 -0
  111. package/dist/commands/hub/permissions.js +61 -0
  112. package/dist/commands/hub/projects.d.ts +24 -0
  113. package/dist/commands/hub/projects.js +49 -0
  114. package/dist/commands/hub/reporter.d.ts +10 -0
  115. package/dist/commands/hub/reporter.js +11 -0
  116. package/dist/commands/hub/starter-agent-runtime.d.ts +37 -0
  117. package/dist/commands/hub/starter-agent-runtime.js +49 -0
  118. package/dist/commands/hub/starter-trigger.d.ts +10 -0
  119. package/dist/commands/hub/starter-trigger.js +30 -0
  120. package/dist/commands/hub/status-output.d.ts +13 -0
  121. package/dist/commands/hub/status-output.js +30 -0
  122. package/dist/commands/onboard.d.ts +10 -0
  123. package/dist/commands/onboard.js +400 -0
  124. package/dist/commands/open.d.ts +4 -0
  125. package/dist/commands/open.js +89 -0
  126. package/dist/commands/permit/allow.d.ts +20 -0
  127. package/dist/commands/permit/allow.js +133 -0
  128. package/dist/commands/permit/deny.d.ts +12 -0
  129. package/dist/commands/permit/deny.js +105 -0
  130. package/dist/commands/permit/index.d.ts +3 -0
  131. package/dist/commands/permit/index.js +27 -0
  132. package/dist/commands/permit/ls.d.ts +18 -0
  133. package/dist/commands/permit/ls.js +66 -0
  134. package/dist/commands/plugin/index.d.ts +17 -0
  135. package/dist/commands/plugin/index.js +138 -0
  136. package/dist/commands/plugin/scaffold.d.ts +6 -0
  137. package/dist/commands/plugin/scaffold.js +162 -0
  138. package/dist/commands/plugin/shared.d.ts +5 -0
  139. package/dist/commands/plugin/shared.js +30 -0
  140. package/dist/commands/project/create.d.ts +10 -0
  141. package/dist/commands/project/create.js +41 -0
  142. package/dist/commands/project/delete.d.ts +9 -0
  143. package/dist/commands/project/delete.js +33 -0
  144. package/dist/commands/project/index.d.ts +3 -0
  145. package/dist/commands/project/index.js +28 -0
  146. package/dist/commands/project/ls.d.ts +5 -0
  147. package/dist/commands/project/ls.js +19 -0
  148. package/dist/commands/project/rename.d.ts +15 -0
  149. package/dist/commands/project/rename.js +50 -0
  150. package/dist/commands/project/shared.d.ts +11 -0
  151. package/dist/commands/project/shared.js +18 -0
  152. package/dist/commands/provider/add.d.ts +30 -0
  153. package/dist/commands/provider/add.js +123 -0
  154. package/dist/commands/provider/diagnostic.d.ts +12 -0
  155. package/dist/commands/provider/diagnostic.js +31 -0
  156. package/dist/commands/provider/index.d.ts +3 -0
  157. package/dist/commands/provider/index.js +38 -0
  158. package/dist/commands/provider/ls.d.ts +20 -0
  159. package/dist/commands/provider/ls.js +76 -0
  160. package/dist/commands/provider/models.d.ts +20 -0
  161. package/dist/commands/provider/models.js +53 -0
  162. package/dist/commands/provider/rm.d.ts +10 -0
  163. package/dist/commands/provider/rm.js +45 -0
  164. package/dist/commands/provider/shared.d.ts +7 -0
  165. package/dist/commands/provider/shared.js +10 -0
  166. package/dist/commands/schedule/create.d.ts +19 -0
  167. package/dist/commands/schedule/create.js +41 -0
  168. package/dist/commands/schedule/delete.d.ts +10 -0
  169. package/dist/commands/schedule/delete.js +32 -0
  170. package/dist/commands/schedule/index.d.ts +3 -0
  171. package/dist/commands/schedule/index.js +66 -0
  172. package/dist/commands/schedule/inspect.d.ts +6 -0
  173. package/dist/commands/schedule/inspect.js +27 -0
  174. package/dist/commands/schedule/logs.d.ts +6 -0
  175. package/dist/commands/schedule/logs.js +24 -0
  176. package/dist/commands/schedule/ls.d.ts +5 -0
  177. package/dist/commands/schedule/ls.js +25 -0
  178. package/dist/commands/schedule/pause.d.ts +5 -0
  179. package/dist/commands/schedule/pause.js +24 -0
  180. package/dist/commands/schedule/resume.d.ts +5 -0
  181. package/dist/commands/schedule/resume.js +24 -0
  182. package/dist/commands/schedule/run-once.d.ts +5 -0
  183. package/dist/commands/schedule/run-once.js +24 -0
  184. package/dist/commands/schedule/schema.d.ts +21 -0
  185. package/dist/commands/schedule/schema.js +67 -0
  186. package/dist/commands/schedule/shared.d.ts +59 -0
  187. package/dist/commands/schedule/shared.js +358 -0
  188. package/dist/commands/schedule/types.d.ts +165 -0
  189. package/dist/commands/schedule/types.js +2 -0
  190. package/dist/commands/schedule/update.d.ts +21 -0
  191. package/dist/commands/schedule/update.js +40 -0
  192. package/dist/commands/script/index.d.ts +3 -0
  193. package/dist/commands/script/index.js +19 -0
  194. package/dist/commands/script/ls.d.ts +6 -0
  195. package/dist/commands/script/ls.js +20 -0
  196. package/dist/commands/script/schema.d.ts +5 -0
  197. package/dist/commands/script/schema.js +13 -0
  198. package/dist/commands/script/shared.d.ts +11 -0
  199. package/dist/commands/script/shared.js +59 -0
  200. package/dist/commands/script/start.d.ts +6 -0
  201. package/dist/commands/script/start.js +23 -0
  202. package/dist/commands/script/stop.d.ts +6 -0
  203. package/dist/commands/script/stop.js +23 -0
  204. package/dist/commands/speech/index.d.ts +3 -0
  205. package/dist/commands/speech/index.js +5 -0
  206. package/dist/commands/terminal/capture.d.ts +10 -0
  207. package/dist/commands/terminal/capture.js +68 -0
  208. package/dist/commands/terminal/create.d.ts +11 -0
  209. package/dist/commands/terminal/create.js +29 -0
  210. package/dist/commands/terminal/index.d.ts +3 -0
  211. package/dist/commands/terminal/index.js +45 -0
  212. package/dist/commands/terminal/kill.d.ts +6 -0
  213. package/dist/commands/terminal/kill.js +36 -0
  214. package/dist/commands/terminal/ls.d.ts +11 -0
  215. package/dist/commands/terminal/ls.js +21 -0
  216. package/dist/commands/terminal/schema.d.ts +10 -0
  217. package/dist/commands/terminal/schema.js +17 -0
  218. package/dist/commands/terminal/send-keys.d.ts +7 -0
  219. package/dist/commands/terminal/send-keys.js +45 -0
  220. package/dist/commands/terminal/shared.d.ts +12 -0
  221. package/dist/commands/terminal/shared.js +62 -0
  222. package/dist/commands/workspace/archive.d.ts +12 -0
  223. package/dist/commands/workspace/archive.js +41 -0
  224. package/dist/commands/workspace/create.d.ts +49 -0
  225. package/dist/commands/workspace/create.js +114 -0
  226. package/dist/commands/workspace/index.d.ts +3 -0
  227. package/dist/commands/workspace/index.js +45 -0
  228. package/dist/commands/workspace/ls.d.ts +7 -0
  229. package/dist/commands/workspace/ls.js +28 -0
  230. package/dist/commands/workspace/rename.d.ts +22 -0
  231. package/dist/commands/workspace/rename.js +61 -0
  232. package/dist/commands/workspace/setup.d.ts +11 -0
  233. package/dist/commands/workspace/setup.js +41 -0
  234. package/dist/commands/workspace/shared.d.ts +12 -0
  235. package/dist/commands/workspace/shared.js +20 -0
  236. package/dist/commands/worktree/archive.d.ts +20 -0
  237. package/dist/commands/worktree/archive.js +104 -0
  238. package/dist/commands/worktree/create-input.d.ts +15 -0
  239. package/dist/commands/worktree/create-input.js +56 -0
  240. package/dist/commands/worktree/create.d.ts +11 -0
  241. package/dist/commands/worktree/create.js +58 -0
  242. package/dist/commands/worktree/index.d.ts +3 -0
  243. package/dist/commands/worktree/index.js +25 -0
  244. package/dist/commands/worktree/ls.d.ts +19 -0
  245. package/dist/commands/worktree/ls.js +97 -0
  246. package/dist/index.d.ts +2 -0
  247. package/dist/index.js +6 -0
  248. package/dist/output/index.d.ts +45 -0
  249. package/dist/output/index.js +47 -0
  250. package/dist/output/json.d.ts +11 -0
  251. package/dist/output/json.js +37 -0
  252. package/dist/output/pairing.d.ts +8 -0
  253. package/dist/output/pairing.js +24 -0
  254. package/dist/output/quiet.d.ts +9 -0
  255. package/dist/output/quiet.js +22 -0
  256. package/dist/output/render.d.ts +15 -0
  257. package/dist/output/render.js +84 -0
  258. package/dist/output/table.d.ts +13 -0
  259. package/dist/output/table.js +135 -0
  260. package/dist/output/types.d.ts +73 -0
  261. package/dist/output/types.js +8 -0
  262. package/dist/output/with-output.d.ts +41 -0
  263. package/dist/output/with-output.js +85 -0
  264. package/dist/output/yaml.d.ts +11 -0
  265. package/dist/output/yaml.js +38 -0
  266. package/dist/run.d.ts +14 -0
  267. package/dist/run.js +40 -0
  268. package/dist/ssh/ssh-tunnel.d.ts +9 -0
  269. package/dist/ssh/ssh-tunnel.js +79 -0
  270. package/dist/utils/client-id.d.ts +2 -0
  271. package/dist/utils/client-id.js +37 -0
  272. package/dist/utils/client.d.ts +54 -0
  273. package/dist/utils/client.js +363 -0
  274. package/dist/utils/command-options.d.ts +7 -0
  275. package/dist/utils/command-options.js +25 -0
  276. package/dist/utils/duration.d.ts +7 -0
  277. package/dist/utils/duration.js +39 -0
  278. package/dist/utils/errors.d.ts +5 -0
  279. package/dist/utils/errors.js +10 -0
  280. package/dist/utils/paths.d.ts +12 -0
  281. package/dist/utils/paths.js +22 -0
  282. package/dist/utils/provider-model.d.ts +11 -0
  283. package/dist/utils/provider-model.js +49 -0
  284. package/dist/utils/timeline.d.ts +11 -0
  285. package/dist/utils/timeline.js +11 -0
  286. package/dist/version.d.ts +2 -0
  287. package/dist/version.js +10 -0
  288. package/package.json +50 -0
@@ -0,0 +1,40 @@
1
+ import { withOutput } from "../../output/index.js";
2
+ import { addJsonOption } from "../../utils/command-options.js";
3
+ import { resolveHubOrigin } from "./authority.js";
4
+ import { reportHubProgress } from "./reporter.js";
5
+ import { addHubResolutionHelp } from "./help.js";
6
+ const schema = {
7
+ idField: "origin",
8
+ columns: [
9
+ { header: "HUB", field: "origin" },
10
+ { header: "STATUS", field: "status" },
11
+ ],
12
+ };
13
+ export async function runHubLogin(originInput, options, dependencies) {
14
+ const origin = resolveHubOrigin({
15
+ options: { origin: originInput },
16
+ env: dependencies.env,
17
+ credentials: dependencies.credentials,
18
+ });
19
+ reportHubProgress(dependencies.reporter, options, `Logging in to ${origin}`);
20
+ const credential = await dependencies.flow.authorize(origin);
21
+ dependencies.credentials.save({ origin, credential });
22
+ reportHubProgress(dependencies.reporter, options, "Logged in");
23
+ if (!options.json &&
24
+ dependencies.isInteractive?.() &&
25
+ dependencies.continueGuidedSetup !== undefined) {
26
+ await dependencies.continueGuidedSetup(origin);
27
+ }
28
+ return { type: "single", data: { origin, status: "logged_in" }, schema };
29
+ }
30
+ export function addHubLoginCommand(parent, dependencies) {
31
+ addJsonOption(addHubResolutionHelp(parent
32
+ .command("login")
33
+ .description("Log in to a Paseo Hub for CLI access")
34
+ .argument("[origin]", "Paseo Hub origin"))).action(withOutput(async (...args) => {
35
+ const origin = args[0];
36
+ const options = args.at(-2);
37
+ return runHubLogin(origin, options, dependencies);
38
+ }));
39
+ }
40
+ //# sourceMappingURL=login.js.map
@@ -0,0 +1,32 @@
1
+ import type { Command } from "commander";
2
+ import { type SingleResult } from "../../output/index.js";
3
+ import type { HubCredentialStore } from "./credentials.js";
4
+ import type { HubDaemonConnection } from "./daemon-client.js";
5
+ import { type HubReporter } from "./reporter.js";
6
+ interface HubLogoutResult {
7
+ origin: string | null;
8
+ status: "logged_out" | "not_logged_in";
9
+ daemonDisconnected: boolean;
10
+ warning?: string;
11
+ }
12
+ interface HubLogoutOptions {
13
+ disconnectDaemon?: boolean;
14
+ force?: boolean;
15
+ host?: string;
16
+ json?: boolean;
17
+ }
18
+ interface HubLogoutDependencies {
19
+ credentials: HubCredentialStore;
20
+ daemon: HubDaemonConnection;
21
+ isInteractive(): boolean;
22
+ confirmDisconnect(origin: string): Promise<boolean>;
23
+ reporter: HubReporter;
24
+ }
25
+ export declare function runHubLogout(options: HubLogoutOptions, dependencies: HubLogoutDependencies): Promise<SingleResult<HubLogoutResult>>;
26
+ export declare function addHubLogoutCommand(parent: Command, dependencies: HubLogoutDependencies): void;
27
+ export declare const productionLogoutPrompt: {
28
+ isInteractive: () => boolean;
29
+ confirmDisconnect(origin: string): Promise<boolean>;
30
+ };
31
+ export {};
32
+ //# sourceMappingURL=logout.d.ts.map
@@ -0,0 +1,71 @@
1
+ import { confirm, isCancel } from "@clack/prompts";
2
+ import { withOutput } from "../../output/index.js";
3
+ import { addJsonAndDaemonHostOptions } from "../../utils/command-options.js";
4
+ import { withHubDaemon } from "./daemon-client.js";
5
+ import { reportHubProgress } from "./reporter.js";
6
+ const schema = {
7
+ idField: "status",
8
+ columns: [
9
+ { header: "HUB", field: "origin" },
10
+ { header: "STATUS", field: "status" },
11
+ { header: "DAEMON DISCONNECTED", field: "daemonDisconnected" },
12
+ { header: "WARNING", field: "warning" },
13
+ ],
14
+ };
15
+ export async function runHubLogout(options, dependencies) {
16
+ const active = dependencies.credentials.active();
17
+ if (active === null) {
18
+ return logoutResult({ origin: null, status: "not_logged_in", daemonDisconnected: false });
19
+ }
20
+ reportHubProgress(dependencies.reporter, options, `Logging out of ${active.origin}`);
21
+ const mayPrompt = options.json !== true && dependencies.isInteractive();
22
+ let daemonStatus = null;
23
+ const shouldInspectDaemon = options.disconnectDaemon === true || mayPrompt;
24
+ if (shouldInspectDaemon) {
25
+ daemonStatus = await withHubDaemon(dependencies.daemon, options.host, async (daemon) => daemon.getHubStatus().then((response) => response.status));
26
+ }
27
+ const sameHub = daemonStatus?.hubOrigin === active.origin;
28
+ let shouldDisconnect = options.disconnectDaemon === true && sameHub;
29
+ if (options.disconnectDaemon !== true && mayPrompt && sameHub) {
30
+ shouldDisconnect = await dependencies.confirmDisconnect(active.origin);
31
+ }
32
+ if (!shouldDisconnect) {
33
+ dependencies.credentials.logoutActive();
34
+ return logoutResult({ origin: active.origin, status: "logged_out", daemonDisconnected: false });
35
+ }
36
+ reportHubProgress(dependencies.reporter, options, `Disconnecting this daemon from ${active.origin}`);
37
+ const disconnect = await withHubDaemon(dependencies.daemon, options.host, async (daemon) => {
38
+ return daemon.disconnectHub(options.force ?? false);
39
+ });
40
+ dependencies.credentials.logoutActive();
41
+ return logoutResult({
42
+ origin: active.origin,
43
+ status: "logged_out",
44
+ daemonDisconnected: disconnect.status.state === "not_connected",
45
+ ...(disconnect.warning ? { warning: disconnect.warning } : {}),
46
+ });
47
+ }
48
+ export function addHubLogoutCommand(parent, dependencies) {
49
+ addJsonAndDaemonHostOptions(parent
50
+ .command("logout")
51
+ .description("Remove the active stored Hub CLI login")
52
+ .option("--disconnect-daemon", "Also disconnect a daemon related to the same Hub")
53
+ .option("--force", "Remove daemon authority without notifying the Hub")).action(withOutput(async (...args) => {
54
+ const options = args.at(-2);
55
+ return runHubLogout(options, dependencies);
56
+ }));
57
+ }
58
+ export const productionLogoutPrompt = {
59
+ isInteractive: () => Boolean(process.stdin.isTTY && process.stdout.isTTY),
60
+ async confirmDisconnect(origin) {
61
+ const answer = await confirm({
62
+ message: `Disconnect this daemon from ${origin}?`,
63
+ initialValue: false,
64
+ });
65
+ return !isCancel(answer) && answer;
66
+ },
67
+ };
68
+ function logoutResult(data) {
69
+ return { type: "single", data, schema };
70
+ }
71
+ //# sourceMappingURL=logout.js.map
@@ -0,0 +1,2 @@
1
+ export declare function normalizeHubOrigin(value: string): string;
2
+ //# sourceMappingURL=origin.d.ts.map
@@ -0,0 +1,27 @@
1
+ import { HubCommandError } from "./error.js";
2
+ export function normalizeHubOrigin(value) {
3
+ let url;
4
+ try {
5
+ url = new URL(value);
6
+ }
7
+ catch {
8
+ throw invalidHubOrigin();
9
+ }
10
+ if (!["http:", "https:"].includes(url.protocol) ||
11
+ (url.protocol === "http:" && !isLoopbackHostname(url.hostname)) ||
12
+ url.username ||
13
+ url.password ||
14
+ url.pathname !== "/" ||
15
+ url.search ||
16
+ url.hash) {
17
+ throw invalidHubOrigin();
18
+ }
19
+ return url.origin;
20
+ }
21
+ function isLoopbackHostname(hostname) {
22
+ return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]";
23
+ }
24
+ function invalidHubOrigin() {
25
+ return new HubCommandError("HUB_INVALID_ORIGIN", "Hub URL must be an HTTPS origin without credentials, path, query, or hash. HTTP is allowed only for localhost, 127.0.0.1, or [::1].");
26
+ }
27
+ //# sourceMappingURL=origin.js.map
@@ -0,0 +1,21 @@
1
+ import type { Command } from "commander";
2
+ import { type ListResult } from "../../output/index.js";
3
+ import type { HubDaemonConnection } from "./daemon-client.js";
4
+ import { type HubReporter } from "./reporter.js";
5
+ interface HubPermissionsOptions {
6
+ host?: string;
7
+ json?: boolean;
8
+ }
9
+ interface HubPermissionsDependencies {
10
+ daemon: HubDaemonConnection;
11
+ reporter: HubReporter;
12
+ }
13
+ interface PermissionRow {
14
+ permission: string;
15
+ description: string;
16
+ }
17
+ export declare function runHubPermissionsList(options: HubPermissionsOptions, dependencies: HubPermissionsDependencies): Promise<ListResult<PermissionRow>>;
18
+ export declare function runHubPermissionChange(operation: "grant" | "revoke", permission: string, options: HubPermissionsOptions, dependencies: HubPermissionsDependencies): Promise<ListResult<import("./status-output.js").HubRow>>;
19
+ export declare function addHubPermissionsCommand(parent: Command, dependencies: HubPermissionsDependencies): void;
20
+ export {};
21
+ //# sourceMappingURL=permissions.d.ts.map
@@ -0,0 +1,61 @@
1
+ import { withOutput } from "../../output/index.js";
2
+ import { addJsonAndDaemonHostOptions } from "../../utils/command-options.js";
3
+ import { withHubDaemon } from "./daemon-client.js";
4
+ import { reportHubProgress } from "./reporter.js";
5
+ import { hubStatusResult } from "./status-output.js";
6
+ const schema = {
7
+ idField: "permission",
8
+ columns: [
9
+ { header: "PERMISSION", field: "permission" },
10
+ { header: "DESCRIPTION", field: "description" },
11
+ ],
12
+ };
13
+ export function runHubPermissionsList(options, dependencies) {
14
+ return withHubDaemon(dependencies.daemon, options.host, async (client) => {
15
+ const status = (await client.getHubStatus()).status;
16
+ requireConnectedHub(status);
17
+ return {
18
+ type: "list",
19
+ data: status.permissions.map((permission) => ({
20
+ permission,
21
+ description: describePermission(permission),
22
+ })),
23
+ schema,
24
+ };
25
+ });
26
+ }
27
+ export function runHubPermissionChange(operation, permission, options, dependencies) {
28
+ return withHubDaemon(dependencies.daemon, options.host, async (client) => {
29
+ const current = (await client.getHubStatus()).status;
30
+ requireConnectedHub(current);
31
+ const response = await client.updateHubPermissions(operation === "grant" ? { grant: [permission] } : { revoke: [permission] });
32
+ reportHubProgress(dependencies.reporter, options, `${operation === "grant" ? "Granted" : "Revoked"} ${permission} ${operation === "grant" ? "to" : "from"} ${response.status.hubOrigin}`);
33
+ return hubStatusResult(response.status);
34
+ });
35
+ }
36
+ export function addHubPermissionsCommand(parent, dependencies) {
37
+ const permissions = parent
38
+ .command("permissions")
39
+ .description("Manage this Hub's daemon permissions");
40
+ addJsonAndDaemonHostOptions(permissions.command("list")).action(withOutput(async (...args) => {
41
+ const options = args.at(-2);
42
+ return runHubPermissionsList(options, dependencies);
43
+ }));
44
+ for (const operation of ["grant", "revoke"]) {
45
+ addJsonAndDaemonHostOptions(permissions.command(operation).argument("<permission>", "Daemon permission")).action(withOutput(async (...args) => {
46
+ const permission = args[0];
47
+ const options = args.at(-2);
48
+ return runHubPermissionChange(operation, permission, options, dependencies);
49
+ }));
50
+ }
51
+ }
52
+ function requireConnectedHub(status) {
53
+ if (status.hubOrigin === null ||
54
+ (status.state !== "connected" && status.state !== "reconnecting")) {
55
+ throw new Error("This daemon is not connected to a Hub");
56
+ }
57
+ }
58
+ function describePermission(permission) {
59
+ return permission === "hub.execute" ? "Run agents for Hub automations" : permission;
60
+ }
61
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1,24 @@
1
+ import type { Command } from "commander";
2
+ import { type SingleResult } from "../../output/index.js";
3
+ import type { HubHttpClient, HubProject } from "./hub-client/index.js";
4
+ import type { HubCredentialStore } from "./credentials.js";
5
+ import { type HubReporter } from "./reporter.js";
6
+ interface HubProjectsResult {
7
+ origin: string;
8
+ projects: HubProject[];
9
+ }
10
+ export interface HubProjectsOptions {
11
+ hub?: string;
12
+ apiKey?: string;
13
+ json?: boolean;
14
+ }
15
+ interface HubProjectsDependencies {
16
+ env: Readonly<Record<string, string | undefined>>;
17
+ credentials: HubCredentialStore;
18
+ hub: Pick<HubHttpClient, "listProjects">;
19
+ reporter: HubReporter;
20
+ }
21
+ export declare function runHubProjects(options: HubProjectsOptions, dependencies: HubProjectsDependencies): Promise<SingleResult<HubProjectsResult>>;
22
+ export declare function addHubProjectsCommand(parent: Command, dependencies: HubProjectsDependencies): void;
23
+ export {};
24
+ //# sourceMappingURL=projects.d.ts.map
@@ -0,0 +1,49 @@
1
+ import { render, withOutput } from "../../output/index.js";
2
+ import { addJsonOption } from "../../utils/command-options.js";
3
+ import { resolveHubCredential, resolveHubOrigin } from "./authority.js";
4
+ import { reportHubProgress } from "./reporter.js";
5
+ import { addHubResolutionHelp } from "./help.js";
6
+ const projectSchema = {
7
+ idField: "id",
8
+ columns: [
9
+ { header: "SLUG", field: "slug" },
10
+ { header: "NAME", field: "name" },
11
+ { header: "ID", field: "id" },
12
+ { header: "HUB", field: "origin" },
13
+ ],
14
+ };
15
+ const schema = {
16
+ idField: "origin",
17
+ columns: [
18
+ { header: "HUB", field: "origin" },
19
+ { header: "PROJECTS", field: (result) => result.projects.length },
20
+ ],
21
+ renderHuman(result, options) {
22
+ const results = result.type === "single" ? [result.data] : result.data;
23
+ const data = results.flatMap((entry) => entry.projects.map((project) => ({ ...project, origin: entry.origin })));
24
+ return render({ type: "list", data, schema: projectSchema }, options);
25
+ },
26
+ };
27
+ export async function runHubProjects(options, dependencies) {
28
+ const resolution = {
29
+ options: { origin: options.hub, apiKey: options.apiKey },
30
+ env: dependencies.env,
31
+ credentials: dependencies.credentials,
32
+ };
33
+ const origin = resolveHubOrigin(resolution);
34
+ reportHubProgress(dependencies.reporter, options, `Listing projects from ${origin}`);
35
+ const credential = resolveHubCredential({ ...resolution, origin });
36
+ const projects = await dependencies.hub.listProjects(origin, credential);
37
+ return { type: "single", data: { origin, projects }, schema };
38
+ }
39
+ export function addHubProjectsCommand(parent, dependencies) {
40
+ addJsonOption(addHubResolutionHelp(parent
41
+ .command("projects")
42
+ .description("List projects for the authenticated Hub organization")
43
+ .option("--hub <origin>", "Paseo Hub origin")
44
+ .option("--api-key <secret>", "Organization API key"))).action(withOutput(async (...args) => {
45
+ const options = args.at(-2);
46
+ return runHubProjects(options, dependencies);
47
+ }));
48
+ }
49
+ //# sourceMappingURL=projects.js.map
@@ -0,0 +1,10 @@
1
+ export interface HubReporter {
2
+ progress(message: string): void;
3
+ }
4
+ export declare const processHubReporter: HubReporter;
5
+ interface HubReportOptions {
6
+ json?: boolean;
7
+ }
8
+ export declare function reportHubProgress(reporter: HubReporter, options: HubReportOptions, message: string): void;
9
+ export {};
10
+ //# sourceMappingURL=reporter.d.ts.map
@@ -0,0 +1,11 @@
1
+ export const processHubReporter = {
2
+ progress(message) {
3
+ process.stderr.write(`${message}\n`);
4
+ },
5
+ };
6
+ export function reportHubProgress(reporter, options, message) {
7
+ if (options.json === true)
8
+ return;
9
+ reporter.progress(message);
10
+ }
11
+ //# sourceMappingURL=reporter.js.map
@@ -0,0 +1,37 @@
1
+ import type { ProviderSnapshotEntry } from "@camerontaylor/paseo-protocol/agent-types";
2
+ export interface HubStarterAgentRuntime {
3
+ provider: string;
4
+ model: string;
5
+ mode?: string;
6
+ }
7
+ export interface HubStarterAgentProvider {
8
+ id: string;
9
+ label: string;
10
+ models: readonly HubStarterAgentModel[];
11
+ modes: readonly HubStarterAgentMode[];
12
+ }
13
+ export interface HubStarterAgentModel {
14
+ id: string;
15
+ label: string;
16
+ suggested: boolean;
17
+ }
18
+ export interface HubStarterAgentMode {
19
+ id: string;
20
+ label: string;
21
+ suggested: boolean;
22
+ }
23
+ export type HubStarterAgentProviderSnapshotState = {
24
+ kind: "ready";
25
+ providers: readonly HubStarterAgentProvider[];
26
+ } | {
27
+ kind: "loading";
28
+ } | {
29
+ kind: "unavailable";
30
+ };
31
+ export declare function availableStarterAgentProviders(entries: readonly ProviderSnapshotEntry[]): HubStarterAgentProvider[];
32
+ export declare function starterAgentProviderSnapshotState(entries: readonly ProviderSnapshotEntry[]): HubStarterAgentProviderSnapshotState;
33
+ export declare function suggestedStarterAgentChoice<T extends {
34
+ suggested: boolean;
35
+ }>(choices: readonly T[]): T | undefined;
36
+ export declare function selectedStarterAgentRuntime(provider: HubStarterAgentProvider, modelId: string, modeId?: string): HubStarterAgentRuntime | undefined;
37
+ //# sourceMappingURL=starter-agent-runtime.d.ts.map
@@ -0,0 +1,49 @@
1
+ export function availableStarterAgentProviders(entries) {
2
+ return entries.flatMap((entry) => {
3
+ if (entry.status !== "ready" || !entry.enabled)
4
+ return [];
5
+ const models = (entry.models ?? [])
6
+ .filter((model) => model.isSelectable !== false)
7
+ .map((model) => ({ id: model.id, label: model.label, suggested: model.isDefault === true }));
8
+ if (models.length === 0)
9
+ return [];
10
+ const modes = (entry.modes ?? []).map((mode) => ({
11
+ id: mode.id,
12
+ label: mode.label,
13
+ suggested: mode.id === entry.defaultModeId,
14
+ }));
15
+ return [
16
+ {
17
+ id: entry.provider,
18
+ label: entry.label ?? entry.provider,
19
+ models,
20
+ modes,
21
+ },
22
+ ];
23
+ });
24
+ }
25
+ export function starterAgentProviderSnapshotState(entries) {
26
+ const providers = availableStarterAgentProviders(entries);
27
+ if (providers.length > 0)
28
+ return { kind: "ready", providers };
29
+ if (entries.length === 0)
30
+ return { kind: "loading" };
31
+ if (entries.some((entry) => entry.enabled && entry.status === "loading")) {
32
+ return { kind: "loading" };
33
+ }
34
+ return { kind: "unavailable" };
35
+ }
36
+ export function suggestedStarterAgentChoice(choices) {
37
+ return choices.find((choice) => choice.suggested);
38
+ }
39
+ export function selectedStarterAgentRuntime(provider, modelId, modeId) {
40
+ if (!provider.models.some((model) => model.id === modelId))
41
+ return undefined;
42
+ if (provider.modes.length === 0) {
43
+ return modeId === undefined ? { provider: provider.id, model: modelId } : undefined;
44
+ }
45
+ if (modeId === undefined || !provider.modes.some((mode) => mode.id === modeId))
46
+ return undefined;
47
+ return { provider: provider.id, model: modelId, mode: modeId };
48
+ }
49
+ //# sourceMappingURL=starter-agent-runtime.js.map
@@ -0,0 +1,10 @@
1
+ import type { HubConfigurationResources } from "./hub-client/index.js";
2
+ import type { HubInitProvider } from "./init-plan.js";
3
+ export interface HubStarterTriggerConnection {
4
+ id: string;
5
+ label: string;
6
+ provider: HubInitProvider;
7
+ filters: Readonly<Record<string, string>>;
8
+ }
9
+ export declare function availableStarterTriggerConnections(resources: HubConfigurationResources, githubRepository?: string): HubStarterTriggerConnection[];
10
+ //# sourceMappingURL=starter-trigger.d.ts.map
@@ -0,0 +1,30 @@
1
+ export function availableStarterTriggerConnections(resources, githubRepository) {
2
+ return [
3
+ ...resources.github.flatMap((connection) => githubRepository !== undefined && connection.repositories.includes(githubRepository)
4
+ ? [
5
+ {
6
+ id: `github:${githubRepository}`,
7
+ label: `GitHub — ${githubRepository}`,
8
+ provider: "github",
9
+ filters: {
10
+ connection: connection.slug,
11
+ repo: githubRepository,
12
+ },
13
+ },
14
+ ]
15
+ : []),
16
+ ...resources.slack.map(({ slug, teamName }) => ({
17
+ id: `slack:${slug}`,
18
+ label: `Slack — ${teamName}`,
19
+ provider: "slack",
20
+ filters: { connection: slug },
21
+ })),
22
+ ...resources.discord.map(({ slug, guildName }) => ({
23
+ id: `discord:${slug}`,
24
+ label: `Discord — ${guildName}`,
25
+ provider: "discord",
26
+ filters: { connection: slug },
27
+ })),
28
+ ];
29
+ }
30
+ //# sourceMappingURL=starter-trigger.js.map
@@ -0,0 +1,13 @@
1
+ import type { ListResult } from "../../output/index.js";
2
+ import type { HubStatus } from "./daemon-client.js";
3
+ export interface HubRow {
4
+ state: string;
5
+ daemonId: string | null;
6
+ hub: string | null;
7
+ permissions: string;
8
+ connectedAt: string | null;
9
+ error: string | null;
10
+ warning?: string;
11
+ }
12
+ export declare function hubStatusResult(status: HubStatus, warning?: string, reportedHubOrigin?: string | null): ListResult<HubRow>;
13
+ //# sourceMappingURL=status-output.d.ts.map
@@ -0,0 +1,30 @@
1
+ const schema = {
2
+ idField: "state",
3
+ columns: [
4
+ { header: "STATE", field: "state" },
5
+ { header: "HUB", field: "hub" },
6
+ { header: "DAEMON", field: "daemonId" },
7
+ { header: "PERMISSIONS", field: "permissions" },
8
+ { header: "CONNECTED", field: "connectedAt" },
9
+ { header: "ERROR", field: "error" },
10
+ { header: "WARNING", field: "warning" },
11
+ ],
12
+ };
13
+ export function hubStatusResult(status, warning, reportedHubOrigin = status.hubOrigin) {
14
+ return {
15
+ type: "list",
16
+ data: [
17
+ {
18
+ state: status.state,
19
+ daemonId: status.daemonId,
20
+ hub: reportedHubOrigin,
21
+ permissions: status.permissions.join(", "),
22
+ connectedAt: status.connectedAt,
23
+ error: status.lastError,
24
+ warning,
25
+ },
26
+ ],
27
+ schema,
28
+ };
29
+ }
30
+ //# sourceMappingURL=status-output.js.map
@@ -0,0 +1,10 @@
1
+ import { Command } from "commander";
2
+ import { type DaemonStartOptions } from "./daemon/local-daemon.js";
3
+ interface OnboardOptions extends DaemonStartOptions {
4
+ timeout?: string;
5
+ voice?: "ask" | "enable" | "disable";
6
+ }
7
+ export declare function onboardCommand(): Command;
8
+ export declare function runOnboard(options: OnboardOptions): Promise<void>;
9
+ export {};
10
+ //# sourceMappingURL=onboard.d.ts.map