@getmateo/cli 0.0.0-stage → 0.19.8

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 (304) hide show
  1. package/LICENSE +211 -0
  2. package/bin/mateo +3 -0
  3. package/dist/classify.d.ts +19 -0
  4. package/dist/classify.js +49 -0
  5. package/dist/cli.d.ts +3 -0
  6. package/dist/cli.js +143 -0
  7. package/dist/commands/agent/archive.d.ts +27 -0
  8. package/dist/commands/agent/archive.js +88 -0
  9. package/dist/commands/agent/attach.d.ts +8 -0
  10. package/dist/commands/agent/attach.js +160 -0
  11. package/dist/commands/agent/delete.d.ts +15 -0
  12. package/dist/commands/agent/delete.js +104 -0
  13. package/dist/commands/agent/detach.d.ts +16 -0
  14. package/dist/commands/agent/detach.js +44 -0
  15. package/dist/commands/agent/import.d.ts +14 -0
  16. package/dist/commands/agent/import.js +108 -0
  17. package/dist/commands/agent/index.d.ts +3 -0
  18. package/dist/commands/agent/index.js +56 -0
  19. package/dist/commands/agent/inspect.d.ts +15 -0
  20. package/dist/commands/agent/inspect.js +196 -0
  21. package/dist/commands/agent/logs.d.ts +39 -0
  22. package/dist/commands/agent/logs.js +369 -0
  23. package/dist/commands/agent/ls.d.ts +61 -0
  24. package/dist/commands/agent/ls.js +201 -0
  25. package/dist/commands/agent/mode.d.ts +18 -0
  26. package/dist/commands/agent/mode.js +100 -0
  27. package/dist/commands/agent/open.d.ts +11 -0
  28. package/dist/commands/agent/open.js +74 -0
  29. package/dist/commands/agent/reload.d.ts +25 -0
  30. package/dist/commands/agent/reload.js +64 -0
  31. package/dist/commands/agent/run.d.ts +77 -0
  32. package/dist/commands/agent/run.js +556 -0
  33. package/dist/commands/agent/send.d.ts +21 -0
  34. package/dist/commands/agent/send.js +187 -0
  35. package/dist/commands/agent/stop.d.ts +17 -0
  36. package/dist/commands/agent/stop.js +102 -0
  37. package/dist/commands/agent/update.d.ts +51 -0
  38. package/dist/commands/agent/update.js +173 -0
  39. package/dist/commands/agent/wait.d.ts +31 -0
  40. package/dist/commands/agent/wait.js +161 -0
  41. package/dist/commands/clone.d.ts +17 -0
  42. package/dist/commands/clone.js +59 -0
  43. package/dist/commands/daemon/config.d.ts +3 -0
  44. package/dist/commands/daemon/config.js +103 -0
  45. package/dist/commands/daemon/index.d.ts +3 -0
  46. package/dist/commands/daemon/index.js +28 -0
  47. package/dist/commands/daemon/local-daemon.d.ts +13 -0
  48. package/dist/commands/daemon/local-daemon.js +105 -0
  49. package/dist/commands/daemon/pair.d.ts +30 -0
  50. package/dist/commands/daemon/pair.js +145 -0
  51. package/dist/commands/daemon/reload.d.ts +12 -0
  52. package/dist/commands/daemon/reload.js +44 -0
  53. package/dist/commands/daemon/restart.d.ts +29 -0
  54. package/dist/commands/daemon/restart.js +169 -0
  55. package/dist/commands/daemon/runtime-toolchain.d.ts +6 -0
  56. package/dist/commands/daemon/runtime-toolchain.js +87 -0
  57. package/dist/commands/daemon/set-password.d.ts +17 -0
  58. package/dist/commands/daemon/set-password.js +89 -0
  59. package/dist/commands/daemon/start.d.ts +20 -0
  60. package/dist/commands/daemon/start.js +52 -0
  61. package/dist/commands/daemon/status.d.ts +13 -0
  62. package/dist/commands/daemon/status.js +119 -0
  63. package/dist/commands/daemon/stop.d.ts +20 -0
  64. package/dist/commands/daemon/stop.js +58 -0
  65. package/dist/commands/fleet/index.d.ts +4 -0
  66. package/dist/commands/fleet/index.js +57 -0
  67. package/dist/commands/heartbeat/index.d.ts +3 -0
  68. package/dist/commands/heartbeat/index.js +139 -0
  69. package/dist/commands/hooks.d.ts +19 -0
  70. package/dist/commands/hooks.js +89 -0
  71. package/dist/commands/hub/authority.d.ts +17 -0
  72. package/dist/commands/hub/authority.js +18 -0
  73. package/dist/commands/hub/connect.d.ts +24 -0
  74. package/dist/commands/hub/connect.js +44 -0
  75. package/dist/commands/hub/credentials.d.ts +21 -0
  76. package/dist/commands/hub/credentials.js +143 -0
  77. package/dist/commands/hub/daemon-client.d.ts +41 -0
  78. package/dist/commands/hub/daemon-client.js +14 -0
  79. package/dist/commands/hub/deploy-bundle.d.ts +16 -0
  80. package/dist/commands/hub/deploy-bundle.js +248 -0
  81. package/dist/commands/hub/deploy-triggers.d.ts +6 -0
  82. package/dist/commands/hub/deploy-triggers.js +116 -0
  83. package/dist/commands/hub/deploy.d.ts +50 -0
  84. package/dist/commands/hub/deploy.js +159 -0
  85. package/dist/commands/hub/disconnect.d.ts +17 -0
  86. package/dist/commands/hub/disconnect.js +24 -0
  87. package/dist/commands/hub/error.d.ts +6 -0
  88. package/dist/commands/hub/error.js +9 -0
  89. package/dist/commands/hub/export.d.ts +28 -0
  90. package/dist/commands/hub/export.js +80 -0
  91. package/dist/commands/hub/help.d.ts +3 -0
  92. package/dist/commands/hub/help.js +5 -0
  93. package/dist/commands/hub/hub-client/index.d.ts +22 -0
  94. package/dist/commands/hub/hub-client/index.js +135 -0
  95. package/dist/commands/hub/hub-client/internal/contracts.d.ts +126 -0
  96. package/dist/commands/hub/hub-client/internal/contracts.js +85 -0
  97. package/dist/commands/hub/hub-client/internal/problem.d.ts +3 -0
  98. package/dist/commands/hub/hub-client/internal/problem.js +85 -0
  99. package/dist/commands/hub/hub-client/internal/transport.d.ts +15 -0
  100. package/dist/commands/hub/hub-client/internal/transport.js +30 -0
  101. package/dist/commands/hub/index.d.ts +20 -0
  102. package/dist/commands/hub/index.js +94 -0
  103. package/dist/commands/hub/init-plan.d.ts +33 -0
  104. package/dist/commands/hub/init-plan.js +94 -0
  105. package/dist/commands/hub/init.d.ts +37 -0
  106. package/dist/commands/hub/init.js +525 -0
  107. package/dist/commands/hub/login-flow.d.ts +34 -0
  108. package/dist/commands/hub/login-flow.js +78 -0
  109. package/dist/commands/hub/login.d.ts +23 -0
  110. package/dist/commands/hub/login.js +40 -0
  111. package/dist/commands/hub/logout.d.ts +33 -0
  112. package/dist/commands/hub/logout.js +71 -0
  113. package/dist/commands/hub/origin.d.ts +2 -0
  114. package/dist/commands/hub/origin.js +27 -0
  115. package/dist/commands/hub/permissions.d.ts +22 -0
  116. package/dist/commands/hub/permissions.js +61 -0
  117. package/dist/commands/hub/projects.d.ts +24 -0
  118. package/dist/commands/hub/projects.js +49 -0
  119. package/dist/commands/hub/reporter.d.ts +10 -0
  120. package/dist/commands/hub/reporter.js +11 -0
  121. package/dist/commands/hub/starter-agent-runtime.d.ts +37 -0
  122. package/dist/commands/hub/starter-agent-runtime.js +49 -0
  123. package/dist/commands/hub/starter-trigger.d.ts +10 -0
  124. package/dist/commands/hub/starter-trigger.js +30 -0
  125. package/dist/commands/hub/status-output.d.ts +13 -0
  126. package/dist/commands/hub/status-output.js +30 -0
  127. package/dist/commands/onboard.d.ts +14 -0
  128. package/dist/commands/onboard.js +169 -0
  129. package/dist/commands/open.d.ts +4 -0
  130. package/dist/commands/open.js +91 -0
  131. package/dist/commands/permit/allow.d.ts +38 -0
  132. package/dist/commands/permit/allow.js +138 -0
  133. package/dist/commands/permit/deny.d.ts +13 -0
  134. package/dist/commands/permit/deny.js +100 -0
  135. package/dist/commands/permit/index.d.ts +3 -0
  136. package/dist/commands/permit/index.js +27 -0
  137. package/dist/commands/permit/ls.d.ts +21 -0
  138. package/dist/commands/permit/ls.js +54 -0
  139. package/dist/commands/plugin/index.d.ts +23 -0
  140. package/dist/commands/plugin/index.js +174 -0
  141. package/dist/commands/plugin/scaffold.d.ts +6 -0
  142. package/dist/commands/plugin/scaffold.js +212 -0
  143. package/dist/commands/plugin/shared.d.ts +7 -0
  144. package/dist/commands/plugin/shared.js +34 -0
  145. package/dist/commands/plugin/update.d.ts +37 -0
  146. package/dist/commands/plugin/update.js +58 -0
  147. package/dist/commands/project/create.d.ts +10 -0
  148. package/dist/commands/project/create.js +43 -0
  149. package/dist/commands/project/delete.d.ts +9 -0
  150. package/dist/commands/project/delete.js +35 -0
  151. package/dist/commands/project/index.d.ts +3 -0
  152. package/dist/commands/project/index.js +28 -0
  153. package/dist/commands/project/ls.d.ts +5 -0
  154. package/dist/commands/project/ls.js +19 -0
  155. package/dist/commands/project/rename.d.ts +15 -0
  156. package/dist/commands/project/rename.js +52 -0
  157. package/dist/commands/project/shared.d.ts +11 -0
  158. package/dist/commands/project/shared.js +18 -0
  159. package/dist/commands/provider/diagnostic.d.ts +12 -0
  160. package/dist/commands/provider/diagnostic.js +31 -0
  161. package/dist/commands/provider/index.d.ts +3 -0
  162. package/dist/commands/provider/index.js +21 -0
  163. package/dist/commands/provider/ls.d.ts +19 -0
  164. package/dist/commands/provider/ls.js +46 -0
  165. package/dist/commands/provider/models.d.ts +20 -0
  166. package/dist/commands/provider/models.js +53 -0
  167. package/dist/commands/schedule/create.d.ts +19 -0
  168. package/dist/commands/schedule/create.js +41 -0
  169. package/dist/commands/schedule/delete.d.ts +10 -0
  170. package/dist/commands/schedule/delete.js +32 -0
  171. package/dist/commands/schedule/index.d.ts +3 -0
  172. package/dist/commands/schedule/index.js +66 -0
  173. package/dist/commands/schedule/inspect.d.ts +6 -0
  174. package/dist/commands/schedule/inspect.js +27 -0
  175. package/dist/commands/schedule/logs.d.ts +6 -0
  176. package/dist/commands/schedule/logs.js +24 -0
  177. package/dist/commands/schedule/ls.d.ts +5 -0
  178. package/dist/commands/schedule/ls.js +25 -0
  179. package/dist/commands/schedule/pause.d.ts +5 -0
  180. package/dist/commands/schedule/pause.js +24 -0
  181. package/dist/commands/schedule/resume.d.ts +5 -0
  182. package/dist/commands/schedule/resume.js +24 -0
  183. package/dist/commands/schedule/run-once.d.ts +5 -0
  184. package/dist/commands/schedule/run-once.js +24 -0
  185. package/dist/commands/schedule/schema.d.ts +21 -0
  186. package/dist/commands/schedule/schema.js +67 -0
  187. package/dist/commands/schedule/shared.d.ts +61 -0
  188. package/dist/commands/schedule/shared.js +360 -0
  189. package/dist/commands/schedule/types.d.ts +165 -0
  190. package/dist/commands/schedule/types.js +2 -0
  191. package/dist/commands/schedule/update.d.ts +19 -0
  192. package/dist/commands/schedule/update.js +40 -0
  193. package/dist/commands/script/index.d.ts +3 -0
  194. package/dist/commands/script/index.js +19 -0
  195. package/dist/commands/script/ls.d.ts +6 -0
  196. package/dist/commands/script/ls.js +20 -0
  197. package/dist/commands/script/schema.d.ts +5 -0
  198. package/dist/commands/script/schema.js +13 -0
  199. package/dist/commands/script/shared.d.ts +12 -0
  200. package/dist/commands/script/shared.js +59 -0
  201. package/dist/commands/script/start.d.ts +6 -0
  202. package/dist/commands/script/start.js +23 -0
  203. package/dist/commands/script/stop.d.ts +6 -0
  204. package/dist/commands/script/stop.js +23 -0
  205. package/dist/commands/terminal/capture.d.ts +10 -0
  206. package/dist/commands/terminal/capture.js +67 -0
  207. package/dist/commands/terminal/create.d.ts +11 -0
  208. package/dist/commands/terminal/create.js +29 -0
  209. package/dist/commands/terminal/index.d.ts +3 -0
  210. package/dist/commands/terminal/index.js +51 -0
  211. package/dist/commands/terminal/kill.d.ts +6 -0
  212. package/dist/commands/terminal/kill.js +36 -0
  213. package/dist/commands/terminal/ls.d.ts +11 -0
  214. package/dist/commands/terminal/ls.js +21 -0
  215. package/dist/commands/terminal/schema.d.ts +10 -0
  216. package/dist/commands/terminal/schema.js +17 -0
  217. package/dist/commands/terminal/send-keys.d.ts +7 -0
  218. package/dist/commands/terminal/send-keys.js +44 -0
  219. package/dist/commands/terminal/shared.d.ts +13 -0
  220. package/dist/commands/terminal/shared.js +64 -0
  221. package/dist/commands/terminal/upgrade-hosts.d.ts +11 -0
  222. package/dist/commands/terminal/upgrade-hosts.js +46 -0
  223. package/dist/commands/usage/index.d.ts +29 -0
  224. package/dist/commands/usage/index.js +62 -0
  225. package/dist/commands/usage/presentation.d.ts +4 -0
  226. package/dist/commands/usage/presentation.js +146 -0
  227. package/dist/commands/workspace/archive.d.ts +13 -0
  228. package/dist/commands/workspace/archive.js +43 -0
  229. package/dist/commands/workspace/create.d.ts +50 -0
  230. package/dist/commands/workspace/create.js +132 -0
  231. package/dist/commands/workspace/index.d.ts +3 -0
  232. package/dist/commands/workspace/index.js +50 -0
  233. package/dist/commands/workspace/ls.d.ts +11 -0
  234. package/dist/commands/workspace/ls.js +33 -0
  235. package/dist/commands/workspace/rename.d.ts +23 -0
  236. package/dist/commands/workspace/rename.js +63 -0
  237. package/dist/commands/workspace/setup.d.ts +12 -0
  238. package/dist/commands/workspace/setup.js +41 -0
  239. package/dist/commands/workspace/shared.d.ts +15 -0
  240. package/dist/commands/workspace/shared.js +29 -0
  241. package/dist/commands/worktree/archive.d.ts +21 -0
  242. package/dist/commands/worktree/archive.js +108 -0
  243. package/dist/commands/worktree/create-input.d.ts +15 -0
  244. package/dist/commands/worktree/create-input.js +56 -0
  245. package/dist/commands/worktree/create.d.ts +11 -0
  246. package/dist/commands/worktree/create.js +50 -0
  247. package/dist/commands/worktree/index.d.ts +3 -0
  248. package/dist/commands/worktree/index.js +29 -0
  249. package/dist/commands/worktree/ls.d.ts +18 -0
  250. package/dist/commands/worktree/ls.js +73 -0
  251. package/dist/commands/worktree/repository-directory.d.ts +6 -0
  252. package/dist/commands/worktree/repository-directory.js +9 -0
  253. package/dist/index.d.ts +2 -0
  254. package/dist/index.js +6 -0
  255. package/dist/output/index.d.ts +45 -0
  256. package/dist/output/index.js +47 -0
  257. package/dist/output/json.d.ts +11 -0
  258. package/dist/output/json.js +37 -0
  259. package/dist/output/pairing.d.ts +9 -0
  260. package/dist/output/pairing.js +36 -0
  261. package/dist/output/quiet.d.ts +9 -0
  262. package/dist/output/quiet.js +22 -0
  263. package/dist/output/render.d.ts +15 -0
  264. package/dist/output/render.js +84 -0
  265. package/dist/output/table.d.ts +13 -0
  266. package/dist/output/table.js +135 -0
  267. package/dist/output/types.d.ts +73 -0
  268. package/dist/output/types.js +8 -0
  269. package/dist/output/with-output.d.ts +43 -0
  270. package/dist/output/with-output.js +85 -0
  271. package/dist/output/yaml.d.ts +11 -0
  272. package/dist/output/yaml.js +38 -0
  273. package/dist/run.d.ts +14 -0
  274. package/dist/run.js +62 -0
  275. package/dist/ssh/ssh-tunnel.d.ts +2 -0
  276. package/dist/ssh/ssh-tunnel.js +3 -0
  277. package/dist/utils/agent-directory.d.ts +31 -0
  278. package/dist/utils/agent-directory.js +48 -0
  279. package/dist/utils/caller-agent.d.ts +14 -0
  280. package/dist/utils/caller-agent.js +16 -0
  281. package/dist/utils/client-id.d.ts +2 -0
  282. package/dist/utils/client-id.js +31 -0
  283. package/dist/utils/client.d.ts +57 -0
  284. package/dist/utils/client.js +360 -0
  285. package/dist/utils/command-options.d.ts +8 -0
  286. package/dist/utils/command-options.js +49 -0
  287. package/dist/utils/daemon-target.d.ts +13 -0
  288. package/dist/utils/daemon-target.js +51 -0
  289. package/dist/utils/duration.d.ts +7 -0
  290. package/dist/utils/duration.js +39 -0
  291. package/dist/utils/errors.d.ts +5 -0
  292. package/dist/utils/errors.js +10 -0
  293. package/dist/utils/paths.d.ts +12 -0
  294. package/dist/utils/paths.js +22 -0
  295. package/dist/utils/provider-model.d.ts +11 -0
  296. package/dist/utils/provider-model.js +49 -0
  297. package/dist/utils/timeline.d.ts +12 -0
  298. package/dist/utils/timeline.js +16 -0
  299. package/dist/utils/wait-for-stop.d.ts +2 -0
  300. package/dist/utils/wait-for-stop.js +28 -0
  301. package/dist/version.d.ts +5 -0
  302. package/dist/version.js +24 -0
  303. package/package.json +63 -4
  304. package/README.md +0 -3
@@ -0,0 +1,28 @@
1
+ import { Command } from "commander";
2
+ import { withOutput } from "../../output/index.js";
3
+ import { addJsonAndDaemonHostOptions } from "../../utils/command-options.js";
4
+ import { runCreateCommand } from "./create.js";
5
+ import { runDeleteCommand } from "./delete.js";
6
+ import { runLsCommand } from "./ls.js";
7
+ import { runRenameCommand } from "./rename.js";
8
+ export function createProjectCommand() {
9
+ const project = new Command("project").description("Manage projects");
10
+ addJsonAndDaemonHostOptions(project
11
+ .command("create")
12
+ .description("Register a project directory")
13
+ .argument("[path]", "Project directory (default: current directory)")).action(withOutput(runCreateCommand));
14
+ addJsonAndDaemonHostOptions(project.command("ls").description("List projects")).action(withOutput(runLsCommand));
15
+ addJsonAndDaemonHostOptions(project
16
+ .command("rename")
17
+ .description("Set a project's user-visible name")
18
+ .argument("<project-id>", "Project id")
19
+ .argument("[name]", "New project name")
20
+ .option("--reset", "Clear the custom name and use the directory name")
21
+ .allowExcessArguments(false)).action(withOutput(runRenameCommand));
22
+ addJsonAndDaemonHostOptions(project
23
+ .command("delete")
24
+ .description("Delete a project and its workspaces")
25
+ .argument("<project-id>", "Project id")).action(withOutput(runDeleteCommand));
26
+ return project;
27
+ }
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,5 @@
1
+ import type { Command } from "commander";
2
+ import type { CommandOptions, ListResult } from "../../output/index.js";
3
+ import { type ProjectRow } from "./shared.js";
4
+ export declare function runLsCommand(options: CommandOptions, _command: Command): Promise<ListResult<ProjectRow>>;
5
+ //# sourceMappingURL=ls.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { buildDaemonConnectionCommandError, connectToDaemon } from "../../utils/client.js";
2
+ import { projectSchema, toProjectRow } from "./shared.js";
3
+ export async function runLsCommand(options, _command) {
4
+ const client = await connectToDaemon({ target: options.daemonTarget }).catch((error) => {
5
+ throw buildDaemonConnectionCommandError({ target: options.daemonTarget, error });
6
+ });
7
+ try {
8
+ const payload = await client.listProjects();
9
+ return {
10
+ type: "list",
11
+ data: payload.projects.map(toProjectRow),
12
+ schema: projectSchema,
13
+ };
14
+ }
15
+ finally {
16
+ await client.close().catch(() => undefined);
17
+ }
18
+ }
19
+ //# sourceMappingURL=ls.js.map
@@ -0,0 +1,15 @@
1
+ import type { Command } from "commander";
2
+ import type { CommandOptions, SingleResult } from "../../output/index.js";
3
+ interface ProjectRenameResult {
4
+ projectId: string;
5
+ name: string | null;
6
+ }
7
+ export declare function resolveProjectName(input: {
8
+ name?: string;
9
+ reset?: boolean;
10
+ }): string | null;
11
+ export declare function runRenameCommand(projectId: string, nameArg: string | undefined, options: CommandOptions & {
12
+ reset?: boolean;
13
+ }, _command: Command): Promise<SingleResult<ProjectRenameResult>>;
14
+ export {};
15
+ //# sourceMappingURL=rename.d.ts.map
@@ -0,0 +1,52 @@
1
+ import { buildDaemonConnectionCommandError, connectToDaemon } from "../../utils/client.js";
2
+ const projectRenameSchema = {
3
+ idField: "projectId",
4
+ columns: [
5
+ { header: "PROJECT ID", field: "projectId", width: 20 },
6
+ { header: "NAME", field: "name", width: 30 },
7
+ ],
8
+ };
9
+ export function resolveProjectName(input) {
10
+ if (input.reset) {
11
+ if (input.name !== undefined) {
12
+ throw {
13
+ code: "INVALID_OPTIONS",
14
+ message: "--reset cannot be combined with a name",
15
+ };
16
+ }
17
+ return null;
18
+ }
19
+ const name = input.name?.trim() ?? "";
20
+ if (name.length === 0) {
21
+ throw {
22
+ code: "MISSING_NAME",
23
+ message: "Project name cannot be empty",
24
+ details: "Usage: mateo project rename <project-id> <name> | --reset",
25
+ };
26
+ }
27
+ return name;
28
+ }
29
+ export async function runRenameCommand(projectId, nameArg, options, _command) {
30
+ const name = resolveProjectName({ name: nameArg, reset: options.reset });
31
+ const client = await connectToDaemon({ target: options.daemonTarget }).catch((error) => {
32
+ throw buildDaemonConnectionCommandError({ target: options.daemonTarget, error });
33
+ });
34
+ try {
35
+ const applied = await client.renameProject(projectId, name);
36
+ return {
37
+ type: "single",
38
+ data: { projectId, name: applied.customName },
39
+ schema: projectRenameSchema,
40
+ };
41
+ }
42
+ catch (error) {
43
+ if (error && typeof error === "object" && "code" in error)
44
+ throw error;
45
+ const message = error instanceof Error ? error.message : String(error);
46
+ throw { code: "PROJECT_RENAME_FAILED", message };
47
+ }
48
+ finally {
49
+ await client.close().catch(() => undefined);
50
+ }
51
+ }
52
+ //# sourceMappingURL=rename.js.map
@@ -0,0 +1,11 @@
1
+ import type { WorkspaceProjectDescriptorPayload } from "@getmateo/protocol/messages";
2
+ import type { OutputSchema } from "../../output/index.js";
3
+ export interface ProjectRow {
4
+ projectId: string;
5
+ name: string;
6
+ kind: "git" | "non_git" | "directory";
7
+ path: string;
8
+ }
9
+ export declare const projectSchema: OutputSchema<ProjectRow>;
10
+ export declare function toProjectRow(project: WorkspaceProjectDescriptorPayload): ProjectRow;
11
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1,18 @@
1
+ export const projectSchema = {
2
+ idField: "projectId",
3
+ columns: [
4
+ { header: "PROJECT ID", field: "projectId", width: 20 },
5
+ { header: "NAME", field: "name", width: 24 },
6
+ { header: "KIND", field: "kind", width: 10 },
7
+ { header: "PATH", field: "path", width: 42 },
8
+ ],
9
+ };
10
+ export function toProjectRow(project) {
11
+ return {
12
+ projectId: project.projectId,
13
+ name: project.projectDisplayName,
14
+ kind: project.projectKind,
15
+ path: project.projectRootPath,
16
+ };
17
+ }
18
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1,12 @@
1
+ import type { Command } from "commander";
2
+ import type { CommandOptions, OutputSchema, SingleResult } from "../../output/index.js";
3
+ export interface ProviderDiagnosticResult {
4
+ provider: string;
5
+ diagnostic: string;
6
+ }
7
+ export declare const providerDiagnosticSchema: OutputSchema<ProviderDiagnosticResult>;
8
+ export interface ProviderDiagnosticOptions extends CommandOptions {
9
+ host?: string;
10
+ }
11
+ export declare function runDiagnosticCommand(provider: string, options: ProviderDiagnosticOptions, _command: Command): Promise<SingleResult<ProviderDiagnosticResult>>;
12
+ //# sourceMappingURL=diagnostic.d.ts.map
@@ -0,0 +1,31 @@
1
+ import { connectToDaemon } from "../../utils/client.js";
2
+ export const providerDiagnosticSchema = {
3
+ idField: "provider",
4
+ columns: [
5
+ { header: "PROVIDER", field: "provider" },
6
+ { header: "DIAGNOSTIC", field: "diagnostic" },
7
+ ],
8
+ renderHuman(result) {
9
+ if (result.type === "single")
10
+ return result.data.diagnostic;
11
+ return result.data.map((entry) => entry.diagnostic).join("\n\n");
12
+ },
13
+ };
14
+ export async function runDiagnosticCommand(provider, options, _command) {
15
+ const client = await connectToDaemon({ target: options.daemonTarget });
16
+ try {
17
+ const result = await client.getProviderDiagnostic(provider.trim().toLowerCase());
18
+ return {
19
+ type: "single",
20
+ data: {
21
+ provider: result.provider,
22
+ diagnostic: result.diagnostic,
23
+ },
24
+ schema: providerDiagnosticSchema,
25
+ };
26
+ }
27
+ finally {
28
+ await client.close();
29
+ }
30
+ }
31
+ //# sourceMappingURL=diagnostic.js.map
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function createProviderCommand(): Command;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { Command } from "commander";
2
+ import { runLsCommand } from "./ls.js";
3
+ import { runModelsCommand } from "./models.js";
4
+ import { runDiagnosticCommand } from "./diagnostic.js";
5
+ import { withOutput } from "../../output/index.js";
6
+ import { addJsonAndDaemonHostOptions } from "../../utils/command-options.js";
7
+ export function createProviderCommand() {
8
+ const provider = new Command("provider").description("Manage agent providers");
9
+ addJsonAndDaemonHostOptions(provider.command("ls").description("List available providers and status")).action(withOutput(runLsCommand));
10
+ addJsonAndDaemonHostOptions(provider
11
+ .command("models")
12
+ .description("List models for a provider")
13
+ .argument("<provider>", "Provider name (claude, codex, opencode)")
14
+ .option("--thinking", "Include thinking option IDs for each model")).action(withOutput(runModelsCommand));
15
+ addJsonAndDaemonHostOptions(provider
16
+ .command("diagnostic")
17
+ .description("Show provider installation, environment, and availability diagnostics")
18
+ .argument("<provider>", "Provider name")).action(withOutput(runDiagnosticCommand));
19
+ return provider;
20
+ }
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,19 @@
1
+ import type { Command } from "commander";
2
+ import type { CommandOptions, ListResult, OutputSchema } from "../../output/index.js";
3
+ import type { ProviderSnapshotEntry } from "@getmateo/protocol/agent-types";
4
+ export interface ProviderListItem {
5
+ provider: ProviderSnapshotEntry["provider"];
6
+ label: string;
7
+ status: string;
8
+ enabled: "Enabled" | "Disabled";
9
+ defaultMode: string;
10
+ modes: string;
11
+ }
12
+ /** Schema for provider ls output */
13
+ export declare const providerLsSchema: OutputSchema<ProviderListItem>;
14
+ export type ProviderLsResult = ListResult<ProviderListItem>;
15
+ export interface ProviderLsOptions extends CommandOptions {
16
+ host?: string;
17
+ }
18
+ export declare function runLsCommand(options: ProviderLsOptions, _command: Command): Promise<ProviderLsResult>;
19
+ //# sourceMappingURL=ls.d.ts.map
@@ -0,0 +1,46 @@
1
+ import { connectToDaemon } from "../../utils/client.js";
2
+ /** Schema for provider ls output */
3
+ export const providerLsSchema = {
4
+ idField: "provider",
5
+ columns: [
6
+ { header: "PROVIDER", field: "provider", width: 12 },
7
+ { header: "LABEL", field: "label", width: 16 },
8
+ {
9
+ header: "STATUS",
10
+ field: "status",
11
+ width: 12,
12
+ color: (value) => {
13
+ if (value === "available")
14
+ return "green";
15
+ if (value === "unavailable")
16
+ return "red";
17
+ return undefined;
18
+ },
19
+ },
20
+ { header: "ENABLED", field: "enabled", width: 10 },
21
+ { header: "DEFAULT MODE", field: "defaultMode", width: 14 },
22
+ { header: "MODES", field: "modes", width: 30 },
23
+ ],
24
+ };
25
+ export async function runLsCommand(options, _command) {
26
+ const client = await connectToDaemon({ target: options.daemonTarget });
27
+ try {
28
+ const snapshot = await client.getProvidersSnapshot();
29
+ return {
30
+ type: "list",
31
+ data: snapshot.entries.map((entry) => ({
32
+ provider: entry.provider,
33
+ label: entry.label ?? entry.provider,
34
+ status: entry.status === "ready" ? "available" : entry.status,
35
+ enabled: !entry.enabled ? "Disabled" : "Enabled",
36
+ defaultMode: entry.defaultModeId ?? "default",
37
+ modes: (entry.modes ?? []).map((mode) => mode.label).join(", "),
38
+ })),
39
+ schema: providerLsSchema,
40
+ };
41
+ }
42
+ finally {
43
+ await client.close().catch(() => { });
44
+ }
45
+ }
46
+ //# sourceMappingURL=ls.js.map
@@ -0,0 +1,20 @@
1
+ import type { Command } from "commander";
2
+ import type { CommandOptions, ListResult, OutputSchema } from "../../output/index.js";
3
+ /** Model list item for display */
4
+ export interface ModelListItem {
5
+ model: string;
6
+ id: string;
7
+ description: string;
8
+ thinkingOptionIds: string[];
9
+ defaultThinkingOptionId: string | null;
10
+ thinkingOptions: string;
11
+ }
12
+ /** Schema for provider models output */
13
+ export declare const providerModelsSchema: OutputSchema<ModelListItem>;
14
+ export type ProviderModelsResult = ListResult<ModelListItem>;
15
+ export interface ProviderModelsOptions extends CommandOptions {
16
+ host?: string;
17
+ thinking?: boolean;
18
+ }
19
+ export declare function runModelsCommand(provider: string, options: ProviderModelsOptions, _command: Command): Promise<ProviderModelsResult>;
20
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1,53 @@
1
+ import { connectToDaemon } from "../../utils/client.js";
2
+ /** Schema for provider models output */
3
+ export const providerModelsSchema = {
4
+ idField: "id",
5
+ columns: [
6
+ { header: "ID", field: "id", width: 30 },
7
+ { header: "MODEL", field: "model", width: 30 },
8
+ { header: "DESCRIPTION", field: "description", width: 40 },
9
+ ],
10
+ };
11
+ const providerModelsWithThinkingSchema = {
12
+ idField: "id",
13
+ columns: [
14
+ { header: "ID", field: "id", width: 30 },
15
+ { header: "MODEL", field: "model", width: 30 },
16
+ { header: "THINKING IDS", field: "thinkingOptions", width: 40 },
17
+ {
18
+ header: "DEFAULT THINKING",
19
+ field: (item) => item.defaultThinkingOptionId ?? "auto",
20
+ width: 18,
21
+ },
22
+ ],
23
+ };
24
+ export async function runModelsCommand(provider, options, _command) {
25
+ const normalizedProvider = provider.toLowerCase();
26
+ const client = await connectToDaemon({ target: options.daemonTarget });
27
+ try {
28
+ const result = await client.listProviderModels(normalizedProvider);
29
+ if (result.error) {
30
+ throw {
31
+ code: "PROVIDER_ERROR",
32
+ message: `Failed to fetch models for ${provider}: ${result.error}`,
33
+ };
34
+ }
35
+ const models = (result.models ?? []).map((m) => ({
36
+ model: m.label,
37
+ id: m.id,
38
+ description: m.description ?? "",
39
+ thinkingOptionIds: (m.thinkingOptions ?? []).map((option) => option.id),
40
+ defaultThinkingOptionId: m.defaultThinkingOptionId ?? null,
41
+ thinkingOptions: (m.thinkingOptions ?? []).map((option) => option.id).join(", ") || "none",
42
+ }));
43
+ return {
44
+ type: "list",
45
+ data: models,
46
+ schema: options.thinking ? providerModelsWithThinkingSchema : providerModelsSchema,
47
+ };
48
+ }
49
+ finally {
50
+ await client.close();
51
+ }
52
+ }
53
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1,19 @@
1
+ import type { Command } from "commander";
2
+ import type { SingleResult } from "../../output/index.js";
3
+ import { type ScheduleCommandOptions, type ScheduleRow } from "./shared.js";
4
+ export interface ScheduleCreateOptions extends ScheduleCommandOptions {
5
+ every?: string;
6
+ cron?: string;
7
+ timezone?: string;
8
+ name?: string;
9
+ target?: string;
10
+ provider?: string;
11
+ mode?: string;
12
+ thinking?: string;
13
+ cwd?: string;
14
+ maxRuns?: string;
15
+ expiresIn?: string;
16
+ runNow?: boolean;
17
+ }
18
+ export declare function runCreateCommand(prompt: string, options: ScheduleCreateOptions, command: Command): Promise<SingleResult<ScheduleRow>>;
19
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1,41 @@
1
+ import { scheduleSchema } from "./schema.js";
2
+ import { connectScheduleClient, parseScheduleCreateInput, toScheduleCommandError, toScheduleRow, } from "./shared.js";
3
+ export async function runCreateCommand(prompt, options, command) {
4
+ const runNowSource = command.getOptionValueSource("runNow");
5
+ const runNow = runNowSource === "cli" ? Boolean(options.runNow) : undefined;
6
+ const input = parseScheduleCreateInput({
7
+ prompt,
8
+ every: options.every,
9
+ cron: options.cron,
10
+ timezone: options.timezone,
11
+ name: options.name,
12
+ target: options.target,
13
+ provider: options.provider,
14
+ mode: options.mode,
15
+ thinking: options.thinking,
16
+ cwd: options.cwd,
17
+ daemonTarget: options.daemonTarget,
18
+ maxRuns: options.maxRuns,
19
+ expiresIn: options.expiresIn,
20
+ runNow,
21
+ });
22
+ const { client } = await connectScheduleClient(options.daemonTarget);
23
+ try {
24
+ const payload = await client.scheduleCreate(input);
25
+ if (payload.error || !payload.schedule) {
26
+ throw new Error(payload.error ?? "Schedule creation failed");
27
+ }
28
+ return {
29
+ type: "single",
30
+ data: toScheduleRow(payload.schedule),
31
+ schema: scheduleSchema,
32
+ };
33
+ }
34
+ catch (error) {
35
+ throw toScheduleCommandError("SCHEDULE_CREATE_FAILED", "create schedule", error);
36
+ }
37
+ finally {
38
+ await client.close().catch(() => { });
39
+ }
40
+ }
41
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1,10 @@
1
+ import type { Command } from "commander";
2
+ import type { SingleResult } from "../../output/index.js";
3
+ import { type ScheduleCommandOptions } from "./shared.js";
4
+ interface ScheduleDeleteRow {
5
+ id: string;
6
+ status: string;
7
+ }
8
+ export declare function runDeleteCommand(id: string, options: ScheduleCommandOptions, _command: Command): Promise<SingleResult<ScheduleDeleteRow>>;
9
+ export {};
10
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1,32 @@
1
+ import { connectScheduleClient, toScheduleCommandError, } from "./shared.js";
2
+ const scheduleDeleteSchema = {
3
+ idField: "id",
4
+ columns: [
5
+ { header: "ID", field: "id", width: 10 },
6
+ { header: "STATUS", field: "status", width: 12 },
7
+ ],
8
+ };
9
+ export async function runDeleteCommand(id, options, _command) {
10
+ const { client } = await connectScheduleClient(options.daemonTarget);
11
+ try {
12
+ const payload = await client.scheduleDelete({ id });
13
+ if (payload.error) {
14
+ throw new Error(payload.error);
15
+ }
16
+ return {
17
+ type: "single",
18
+ data: {
19
+ id: payload.scheduleId,
20
+ status: "deleted",
21
+ },
22
+ schema: scheduleDeleteSchema,
23
+ };
24
+ }
25
+ catch (error) {
26
+ throw toScheduleCommandError("SCHEDULE_DELETE_FAILED", "delete schedule", error);
27
+ }
28
+ finally {
29
+ await client.close().catch(() => { });
30
+ }
31
+ }
32
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function createScheduleCommand(): Command;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,66 @@
1
+ import { Command, Option } from "commander";
2
+ import { withOutput } from "../../output/index.js";
3
+ import { addJsonAndDaemonHostOptions } from "../../utils/command-options.js";
4
+ import { runCreateCommand } from "./create.js";
5
+ import { runLsCommand } from "./ls.js";
6
+ import { runInspectCommand } from "./inspect.js";
7
+ import { runLogsCommand } from "./logs.js";
8
+ import { runPauseCommand } from "./pause.js";
9
+ import { runResumeCommand } from "./resume.js";
10
+ import { runDeleteCommand } from "./delete.js";
11
+ import { runRunOnceCommand } from "./run-once.js";
12
+ import { runUpdateCommand } from "./update.js";
13
+ export function createScheduleCommand() {
14
+ const schedule = new Command("schedule").description("Manage recurring schedules");
15
+ addJsonAndDaemonHostOptions(schedule
16
+ .command("create")
17
+ .description("Create a schedule")
18
+ .argument("<prompt>", "Prompt to run on the schedule")
19
+ .option("--every <duration>", "Cron-compatible cadence preset (for example: 5m, 1h)")
20
+ .option("--cron <expr>", "Cron cadence expression")
21
+ .option("--timezone <iana>", "IANA time zone for cron cadence (default: UTC)")
22
+ .option("--name <name>", "Optional schedule name")
23
+ .addOption(new Option("--target <target>", "Legacy schedule target").hideHelp())
24
+ .option("--provider <provider>", "Agent provider, or provider/model (e.g. codex or codex/gpt-5.4)")
25
+ .option("--mode <mode>", "Provider-specific mode (e.g. claude bypassPermissions, opencode build)")
26
+ .option("--thinking <id>", "Thinking option ID for new-agent runs")
27
+ .option("--cwd <path>", "Working directory (default: current; required with --host)")
28
+ .option("--run-now", "Fire one immediate run on creation")
29
+ .option("--max-runs <n>", "Maximum number of runs")
30
+ .option("--expires-in <duration>", "Time to live for the schedule")).action(withOutput(runCreateCommand));
31
+ addJsonAndDaemonHostOptions(schedule.command("ls").description("List schedules")).action(withOutput(runLsCommand));
32
+ addJsonAndDaemonHostOptions(schedule.command("inspect").description("Inspect a schedule").argument("<id>", "Schedule ID")).action(withOutput(runInspectCommand));
33
+ addJsonAndDaemonHostOptions(schedule
34
+ .command("logs")
35
+ .description("Show recent schedule run logs")
36
+ .argument("<id>", "Schedule ID")).action(withOutput(runLogsCommand));
37
+ addJsonAndDaemonHostOptions(schedule.command("pause").description("Pause a schedule").argument("<id>", "Schedule ID")).action(withOutput(runPauseCommand));
38
+ addJsonAndDaemonHostOptions(schedule
39
+ .command("resume")
40
+ .description("Resume a paused schedule")
41
+ .argument("<id>", "Schedule ID")).action(withOutput(runResumeCommand));
42
+ addJsonAndDaemonHostOptions(schedule.command("delete").description("Delete a schedule").argument("<id>", "Schedule ID")).action(withOutput(runDeleteCommand));
43
+ addJsonAndDaemonHostOptions(schedule
44
+ .command("run-once")
45
+ .description("Manually trigger a single run of a schedule without affecting cadence")
46
+ .argument("<id>", "Schedule ID")).action(withOutput(runRunOnceCommand));
47
+ addJsonAndDaemonHostOptions(schedule
48
+ .command("update")
49
+ .description("Update an existing schedule in place")
50
+ .argument("<id>", "Schedule ID")
51
+ .option("--every <duration>", "Cron-compatible cadence preset (for example: 5m, 1h)")
52
+ .option("--cron <expr>", "Switch to cron cadence expression")
53
+ .option("--timezone <iana>", "IANA time zone for cron cadence (requires --cron)")
54
+ .option("--name <name>", "Rename the schedule (empty string clears the name)")
55
+ .option("--prompt <text>", "Replace the schedule prompt")
56
+ .option("--provider <provider>", "New agent provider, or provider/model (only for new-agent target)")
57
+ .option("--model <model>", "New agent model (only for new-agent target)")
58
+ .option("--mode <mode>", "New agent provider mode (only for new-agent target)")
59
+ .option("--cwd <path>", "New working directory (only for new-agent target)")
60
+ .option("--max-runs <n>", "Set or change maximum number of runs")
61
+ .option("--no-max-runs", "Clear the max-runs limit")
62
+ .option("--expires-in <duration>", "Set or change time to live for the schedule")
63
+ .option("--no-expires-in", "Clear the expiration")).action(withOutput(runUpdateCommand));
64
+ return schedule;
65
+ }
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ import type { Command } from "commander";
2
+ import type { ListResult } from "../../output/index.js";
3
+ import { type ScheduleInspectRow } from "./schema.js";
4
+ import { type ScheduleCommandOptions } from "./shared.js";
5
+ export declare function runInspectCommand(id: string, options: ScheduleCommandOptions, _command: Command): Promise<ListResult<ScheduleInspectRow>>;
6
+ //# sourceMappingURL=inspect.d.ts.map
@@ -0,0 +1,27 @@
1
+ import { createScheduleInspectRows, createScheduleInspectSchema, } from "./schema.js";
2
+ import { connectScheduleClient, toScheduleCommandError, } from "./shared.js";
3
+ export async function runInspectCommand(id, options, _command) {
4
+ const { client } = await connectScheduleClient(options.daemonTarget);
5
+ try {
6
+ const payload = await client.scheduleInspect({ id });
7
+ if (payload.error || !payload.schedule) {
8
+ throw new Error(payload.error ?? `Schedule not found: ${id}`);
9
+ }
10
+ if (payload.schedule.target.type !== "new-agent") {
11
+ throw new Error(`Schedule not found: ${id}`);
12
+ }
13
+ const rows = createScheduleInspectRows(payload.schedule);
14
+ return {
15
+ type: "list",
16
+ data: rows,
17
+ schema: createScheduleInspectSchema(payload.schedule),
18
+ };
19
+ }
20
+ catch (error) {
21
+ throw toScheduleCommandError("SCHEDULE_INSPECT_FAILED", "inspect schedule", error);
22
+ }
23
+ finally {
24
+ await client.close().catch(() => { });
25
+ }
26
+ }
27
+ //# sourceMappingURL=inspect.js.map
@@ -0,0 +1,6 @@
1
+ import type { Command } from "commander";
2
+ import type { ListResult } from "../../output/index.js";
3
+ import { type ScheduleLogRow } from "./schema.js";
4
+ import { type ScheduleCommandOptions } from "./shared.js";
5
+ export declare function runLogsCommand(id: string, options: ScheduleCommandOptions, _command: Command): Promise<ListResult<ScheduleLogRow>>;
6
+ //# sourceMappingURL=logs.d.ts.map
@@ -0,0 +1,24 @@
1
+ import { scheduleLogSchema, toScheduleLogRow } from "./schema.js";
2
+ import { connectScheduleClient, requireNewAgentSchedule, toScheduleCommandError, } from "./shared.js";
3
+ export async function runLogsCommand(id, options, _command) {
4
+ const { client } = await connectScheduleClient(options.daemonTarget);
5
+ try {
6
+ await requireNewAgentSchedule(client, id);
7
+ const payload = await client.scheduleLogs({ id });
8
+ if (payload.error) {
9
+ throw new Error(payload.error);
10
+ }
11
+ return {
12
+ type: "list",
13
+ data: payload.runs.map(toScheduleLogRow),
14
+ schema: scheduleLogSchema,
15
+ };
16
+ }
17
+ catch (error) {
18
+ throw toScheduleCommandError("SCHEDULE_LOGS_FAILED", "read schedule logs", error);
19
+ }
20
+ finally {
21
+ await client.close().catch(() => { });
22
+ }
23
+ }
24
+ //# sourceMappingURL=logs.js.map
@@ -0,0 +1,5 @@
1
+ import type { Command } from "commander";
2
+ import type { ListResult } from "../../output/index.js";
3
+ import { type ScheduleCommandOptions, type ScheduleRow } from "./shared.js";
4
+ export declare function runLsCommand(options: ScheduleCommandOptions, _command: Command): Promise<ListResult<ScheduleRow>>;
5
+ //# sourceMappingURL=ls.d.ts.map