@maiaos/cli 0.1.0-canary.6 → 0.1.0-canary.60

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 (266) hide show
  1. package/README.md +8 -7
  2. package/dist/agents/client.d.ts +47 -27
  3. package/dist/agents/client.js +10 -3
  4. package/dist/agents/commands.d.ts +1 -0
  5. package/dist/agents/commands.js +24 -2
  6. package/dist/agents/index.d.ts +1 -1
  7. package/dist/agents/index.js +1 -1
  8. package/dist/agents/input.js +6 -0
  9. package/dist/agents/output/format.js +11 -0
  10. package/dist/agents/tree/tree.js +13 -1
  11. package/dist/bin/maia.cdx.json +19 -19
  12. package/dist/bin/maia.mjs +1 -1
  13. package/dist/cli/cli.d.ts +8 -2
  14. package/dist/cli/cli.js +29 -6
  15. package/dist/cli/index.d.ts +1 -1
  16. package/dist/cli/index.js +1 -1
  17. package/dist/command-line/context.d.ts +4 -2
  18. package/dist/command-line/emit/index.d.ts +4 -0
  19. package/dist/command-line/emit/index.js +4 -0
  20. package/dist/command-line/{output.d.ts → emit/output.d.ts} +2 -2
  21. package/dist/command-line/{rows.d.ts → emit/rows.d.ts} +2 -0
  22. package/dist/command-line/{rows.js → emit/rows.js} +8 -0
  23. package/dist/command-line/index.d.ts +5 -5
  24. package/dist/command-line/index.js +5 -5
  25. package/dist/command-line/input/arguments.d.ts +10 -0
  26. package/dist/command-line/input/arguments.js +30 -10
  27. package/dist/command-line/input/index.d.ts +2 -1
  28. package/dist/command-line/input/index.js +2 -1
  29. package/dist/command-line/input/manager-options.d.ts +10 -0
  30. package/dist/command-line/input/manager-options.js +38 -0
  31. package/dist/command-line/two-phase/index.d.ts +2 -0
  32. package/dist/command-line/two-phase/index.js +2 -0
  33. package/dist/command-line/{two-phase.d.ts → two-phase/two-phase.d.ts} +12 -12
  34. package/dist/command-line/{two-phase.js → two-phase/two-phase.js} +2 -2
  35. package/dist/command-receipt/command.js +1 -1
  36. package/dist/command-tree/tree.d.ts +1 -1
  37. package/dist/command-tree/tree.js +6 -1
  38. package/dist/connection/input.js +2 -2
  39. package/dist/connection/system.js +3 -2
  40. package/dist/connection/tree/tree.js +5 -5
  41. package/dist/events/commands.js +65 -0
  42. package/dist/events/index.js +2 -0
  43. package/dist/events/tree/index.js +2 -0
  44. package/dist/events/tree/tree.js +17 -0
  45. package/dist/import/batch.js +196 -0
  46. package/dist/import/client.d.ts +3 -3
  47. package/dist/import/client.js +1 -1
  48. package/dist/import/commands.d.ts +1 -0
  49. package/dist/import/commands.js +82 -8
  50. package/dist/import/index.d.ts +1 -1
  51. package/dist/import/index.js +1 -1
  52. package/dist/import/input.js +38 -3
  53. package/dist/import/manifest.js +107 -0
  54. package/dist/import/output.js +46 -2
  55. package/dist/local-node/client.d.ts +1 -0
  56. package/dist/local-node/client.js +1 -0
  57. package/dist/local-node/index.d.ts +2 -1
  58. package/dist/local-node/index.js +2 -1
  59. package/dist/local-node/wait.d.ts +10 -0
  60. package/dist/local-node/wait.js +17 -0
  61. package/dist/login/gateway.js +2 -2
  62. package/dist/login/vendor-input.js +2 -2
  63. package/dist/mcp/calls.js +6 -1
  64. package/dist/mcp/routing.js +1 -0
  65. package/dist/project-guard/client.d.ts +12 -0
  66. package/dist/project-guard/input.js +15 -1
  67. package/dist/project-guard/output/format.js +5 -0
  68. package/dist/project-workspace/tree/tree.js +1 -1
  69. package/dist/reference/resolve.js +9 -2
  70. package/dist/remote-node/connector.js +8 -1
  71. package/dist/run-ledger/client.d.ts +2 -0
  72. package/dist/session/agent-permission.d.ts +2 -2
  73. package/dist/session/approval/client.d.ts +5 -2
  74. package/dist/session/approval/client.js +2 -2
  75. package/dist/session/approval/commands.d.ts +1 -0
  76. package/dist/session/approval/commands.js +97 -17
  77. package/dist/session/approval/index.d.ts +1 -1
  78. package/dist/session/approval/index.js +1 -1
  79. package/dist/session/client.d.ts +14 -3
  80. package/dist/session/client.js +17 -2
  81. package/dist/session/coding-client.d.ts +2 -0
  82. package/dist/session/coding-client.js +1 -2
  83. package/dist/session/coding-commands.js +24 -7
  84. package/dist/session/commands.d.ts +1 -0
  85. package/dist/session/commands.js +131 -18
  86. package/dist/session/create-tasks.js +10 -2
  87. package/dist/session/index.d.ts +1 -1
  88. package/dist/session/index.js +1 -1
  89. package/dist/session/output/human.js +32 -5
  90. package/dist/session/output/index.js +1 -1
  91. package/dist/session/output/tasks.js +51 -7
  92. package/dist/session/tree/tree.js +52 -19
  93. package/dist/session/turn/client.js +7 -9
  94. package/dist/session/turn/commands.js +67 -20
  95. package/dist/session/turn/output.d.ts +6 -0
  96. package/dist/session/turn/output.js +12 -2
  97. package/dist/status/client.d.ts +14 -3
  98. package/dist/status/command.js +3 -1
  99. package/dist/status/doctor.d.ts +5 -1
  100. package/dist/status/doctor.js +10 -4
  101. package/dist/status/output/compact.d.ts +3 -0
  102. package/dist/status/output/compact.js +17 -7
  103. package/dist/status/output/human.js +15 -0
  104. package/dist/terminal/control-commands.js +26 -9
  105. package/dist/terminal/keys.js +62 -0
  106. package/dist/terminal/output/compact-list.js +3 -0
  107. package/dist/terminal/output/human.js +2 -2
  108. package/dist/terminal/tree/tree.js +1 -1
  109. package/dist/webhooks/client.d.ts +156 -0
  110. package/dist/webhooks/client.js +8 -0
  111. package/dist/webhooks/commands.d.ts +17 -0
  112. package/dist/webhooks/commands.js +76 -0
  113. package/dist/webhooks/index.d.ts +3 -0
  114. package/dist/webhooks/index.js +3 -0
  115. package/dist/webhooks/input.js +125 -0
  116. package/dist/webhooks/output/format.js +75 -0
  117. package/dist/webhooks/output/index.js +2 -0
  118. package/dist/webhooks/tree/index.js +2 -0
  119. package/dist/webhooks/tree/tree.js +49 -0
  120. package/guidance/maia-cli/SKILL.md +1 -1
  121. package/guidance/maia-node/SKILL.md +54 -0
  122. package/guidance/maia-orchestration/SKILL.md +1 -2
  123. package/guidance/maia-sessions/SKILL.md +69 -0
  124. package/package.json +5 -5
  125. package/dist/address-space/address-space.d.ts +0 -38
  126. package/dist/address-space/index.d.ts +0 -2
  127. package/dist/agents/input.d.ts +0 -130
  128. package/dist/agents/output/format.d.ts +0 -8
  129. package/dist/agents/output/index.d.ts +0 -2
  130. package/dist/agents/tree/index.d.ts +0 -2
  131. package/dist/agents/tree/tree.d.ts +0 -3
  132. package/dist/bootstrap/exit.d.ts +0 -14
  133. package/dist/bootstrap/exit.js +0 -42
  134. package/dist/bootstrap/index.d.ts +0 -3
  135. package/dist/bootstrap/index.js +0 -3
  136. package/dist/bootstrap/process.d.ts +0 -5
  137. package/dist/bootstrap/process.js +0 -23
  138. package/dist/bootstrap/run.d.ts +0 -25
  139. package/dist/bootstrap/run.js +0 -95
  140. package/dist/bootstrap/stdio.d.ts +0 -4
  141. package/dist/bootstrap/stdio.js +0 -9
  142. package/dist/cli/environment.d.ts +0 -8
  143. package/dist/cli/services.d.ts +0 -4
  144. package/dist/command-line/input/stdin-stream.d.ts +0 -4
  145. package/dist/command-line/json-decoder.d.ts +0 -3
  146. package/dist/command-receipt/command.d.ts +0 -4
  147. package/dist/command-receipt/compact-list.d.ts +0 -20
  148. package/dist/command-receipt/index.d.ts +0 -3
  149. package/dist/command-tree/completion.d.ts +0 -6
  150. package/dist/command-tree/local.d.ts +0 -3
  151. package/dist/command-tree/row.js +0 -2
  152. package/dist/connection/access/format.d.ts +0 -8
  153. package/dist/connection/access/input.d.ts +0 -53
  154. package/dist/connection/input.d.ts +0 -50
  155. package/dist/connection/signin.d.ts +0 -4
  156. package/dist/connection/tree/index.d.ts +0 -2
  157. package/dist/connection/tree/tree.d.ts +0 -3
  158. package/dist/container/output/format.d.ts +0 -11
  159. package/dist/container/output/index.d.ts +0 -2
  160. package/dist/context/client.d.ts +0 -7
  161. package/dist/context/commands.d.ts +0 -3
  162. package/dist/context/index.d.ts +0 -3
  163. package/dist/dashboard/cockpit-client.d.ts +0 -6
  164. package/dist/dashboard/cockpit-client.js +0 -27
  165. package/dist/dashboard/cockpits.d.ts +0 -29
  166. package/dist/dashboard/cockpits.js +0 -65
  167. package/dist/dashboard/dashboard.d.ts +0 -7
  168. package/dist/dashboard/draw.d.ts +0 -15
  169. package/dist/dashboard/frame.d.ts +0 -4
  170. package/dist/dashboard/index.d.ts +0 -2
  171. package/dist/dashboard/modes.d.ts +0 -5
  172. package/dist/dashboard/node-connection.d.ts +0 -15
  173. package/dist/dashboard/node-connection.js +0 -51
  174. package/dist/dashboard/pi-tui.d.ts +0 -6
  175. package/dist/dashboard/status-bar.d.ts +0 -4
  176. package/dist/dashboard/terminal.d.ts +0 -53
  177. package/dist/dashboard/tree-model.d.ts +0 -28
  178. package/dist/dashboard/tree.d.ts +0 -10
  179. package/dist/development/cli.d.ts +0 -3
  180. package/dist/development/cli.js +0 -44
  181. package/dist/execution/tree/index.d.ts +0 -2
  182. package/dist/execution/tree/tree.d.ts +0 -3
  183. package/dist/hold/output/format.d.ts +0 -11
  184. package/dist/hold/output/index.d.ts +0 -2
  185. package/dist/hold/tree/index.d.ts +0 -2
  186. package/dist/hold/tree/tree.d.ts +0 -3
  187. package/dist/import/input.d.ts +0 -16
  188. package/dist/import/output.d.ts +0 -6
  189. package/dist/integration/output.d.ts +0 -22
  190. package/dist/login/failure.d.ts +0 -3
  191. package/dist/login/gateway.d.ts +0 -12
  192. package/dist/login/menu.d.ts +0 -4
  193. package/dist/login/output/format.d.ts +0 -16
  194. package/dist/login/output/index.d.ts +0 -2
  195. package/dist/login/vendor-account.d.ts +0 -95
  196. package/dist/login/vendor-input.d.ts +0 -14
  197. package/dist/mcp/calls.d.ts +0 -8
  198. package/dist/orchestration/output/compact-aggregate.d.ts +0 -121
  199. package/dist/orchestration/output/compact-run-list.d.ts +0 -20
  200. package/dist/orchestration/output/human.d.ts +0 -80
  201. package/dist/orchestration/output/index.d.ts +0 -4
  202. package/dist/orchestration/tree/index.d.ts +0 -2
  203. package/dist/orchestration/tree/tree.d.ts +0 -3
  204. package/dist/port-lease/input.d.ts +0 -65
  205. package/dist/port-lease/output/format.d.ts +0 -11
  206. package/dist/port-lease/output/index.d.ts +0 -2
  207. package/dist/presentation/output/format.d.ts +0 -11
  208. package/dist/presentation/output/index.d.ts +0 -3
  209. package/dist/project-guard/input.d.ts +0 -18
  210. package/dist/project-guard/output/format.d.ts +0 -11
  211. package/dist/project-guard/output/index.d.ts +0 -2
  212. package/dist/project-workspace/output/human.d.ts +0 -139
  213. package/dist/project-workspace/output/index.d.ts +0 -3
  214. package/dist/project-workspace/output/metadata.d.ts +0 -11
  215. package/dist/project-workspace/tree/index.d.ts +0 -2
  216. package/dist/project-workspace/tree/tree.d.ts +0 -3
  217. package/dist/provider/client.d.ts +0 -6
  218. package/dist/provider/commands.d.ts +0 -3
  219. package/dist/provider/index.d.ts +0 -3
  220. package/dist/reference/commands.d.ts +0 -3
  221. package/dist/reference/index.d.ts +0 -3
  222. package/dist/reference/resolve.d.ts +0 -31
  223. package/dist/reference/tree/index.d.ts +0 -2
  224. package/dist/reference/tree/tree.d.ts +0 -3
  225. package/dist/remote-node/reachability.d.ts +0 -64
  226. package/dist/remote-node/text.d.ts +0 -10
  227. package/dist/remote-node/tree/index.d.ts +0 -2
  228. package/dist/remote-node/tree/tree.d.ts +0 -3
  229. package/dist/routine/input.d.ts +0 -28
  230. package/dist/routine/output/format.d.ts +0 -23
  231. package/dist/routine/output/index.d.ts +0 -2
  232. package/dist/routine/tree/index.d.ts +0 -2
  233. package/dist/routine/tree/tree.d.ts +0 -3
  234. package/dist/run-ledger/input.d.ts +0 -42
  235. package/dist/run-ledger/output/format.d.ts +0 -11
  236. package/dist/run-ledger/output/index.d.ts +0 -2
  237. package/dist/session/approval/output/format.d.ts +0 -23
  238. package/dist/session/approval/output/index.d.ts +0 -2
  239. package/dist/session/attach-render.d.ts +0 -16
  240. package/dist/session/create-tasks.d.ts +0 -20
  241. package/dist/session/interaction/input.d.ts +0 -15
  242. package/dist/session/interaction/output/format.d.ts +0 -11
  243. package/dist/session/interaction/output/index.d.ts +0 -2
  244. package/dist/session/output/diff.d.ts +0 -3
  245. package/dist/session/output/failure.d.ts +0 -11
  246. package/dist/session/output/human.d.ts +0 -112
  247. package/dist/session/output/index.d.ts +0 -6
  248. package/dist/session/output/observe.d.ts +0 -4
  249. package/dist/session/output/tasks.d.ts +0 -34
  250. package/dist/session/task-file.d.ts +0 -5
  251. package/dist/session/tree/index.d.ts +0 -2
  252. package/dist/session/tree/tree.d.ts +0 -3
  253. package/dist/team-workspace/ceremony.d.ts +0 -19
  254. package/dist/team-workspace/confirmation.d.ts +0 -4
  255. package/dist/team-workspace/dependencies.js +0 -2
  256. package/dist/team-workspace/output.d.ts +0 -15
  257. package/dist/terminal/arguments.d.ts +0 -13
  258. package/dist/terminal/output/compact-list.d.ts +0 -148
  259. package/dist/terminal/output/human.d.ts +0 -42
  260. package/dist/terminal/output/index.d.ts +0 -3
  261. package/dist/terminal/tree/index.d.ts +0 -2
  262. package/dist/terminal/tree/tree.d.ts +0 -3
  263. /package/dist/command-line/{json-decoder.js → emit/json-decoder.js} +0 -0
  264. /package/dist/command-line/{json.d.ts → emit/json.d.ts} +0 -0
  265. /package/dist/command-line/{json.js → emit/json.js} +0 -0
  266. /package/dist/command-line/{output.js → emit/output.js} +0 -0
@@ -3,8 +3,19 @@ import { liveTerminalWriteParametersSchema, MAX_TERMINAL_INPUT_CHUNK_BYTES, } fr
3
3
  import * as Effect from "effect/Effect";
4
4
  import { CliArgumentError, parseOptions, requirePositionals, } from "../command-line/index.js";
5
5
  import { readTerminalColumns, readTerminalControllerFence, readTerminalExpectedRevision, readTerminalGeneration, readTerminalInputSequence, readTerminalLeaseDuration, readTerminalRows, terminalControllerFenceOptionNames, } from "./arguments.js";
6
+ import { terminalInputBytes, UnknownKeyError } from "./keys.js";
6
7
  import { writeTerminalResult } from "./output/index.js";
7
8
  const optionNames = (...additional) => new Set([...terminalControllerFenceOptionNames, ...additional]);
9
+ const typedInputBytes = (options) => {
10
+ try {
11
+ return terminalInputBytes([...options].filter(([name]) => name === "--text" || name === "--keys"));
12
+ }
13
+ catch (error) {
14
+ throw error instanceof UnknownKeyError
15
+ ? new CliArgumentError(error.message)
16
+ : error;
17
+ }
18
+ };
8
19
  const commandId = (options) => {
9
20
  const value = options.get("--command-id");
10
21
  return value === undefined ? {} : { commandId: value };
@@ -99,15 +110,15 @@ export const runControllerAcquire = (tokens, context) => Effect.gen(function* ()
99
110
  }));
100
111
  });
101
112
  const parseTerminalWriteOptions = (tokens) => {
102
- const parsed = parseOptions(tokens, optionNames("--input-id", "--input-sequence"), new Set(["--input-stdin"]));
113
+ const parsed = parseOptions(tokens, optionNames("--input-id", "--input-sequence", "--keys", "--text"), new Set(["--input-stdin"]));
103
114
  requirePositionals(parsed.positionals, 1);
104
- if (!parsed.flags.has("--input-stdin")) {
105
- throw new CliArgumentError("Option '--input-stdin' is required.");
115
+ const typed = parsed.options.has("--text") || parsed.options.has("--keys");
116
+ if (parsed.flags.has("--input-stdin") === typed) {
117
+ throw new CliArgumentError("Give the input as '--input-stdin' or as '--text' and '--keys', not both.");
106
118
  }
107
119
  return parsed;
108
120
  };
109
- const readTerminalWriteScope = (tokens) => {
110
- const parsed = parseTerminalWriteOptions(tokens);
121
+ const readTerminalWriteScope = (parsed) => {
111
122
  const terminalId = requiredTerminalId(parsed.positionals);
112
123
  const inputId = parsed.options.get("--input-id");
113
124
  if (inputId === undefined) {
@@ -146,14 +157,20 @@ const readTerminalInput = (context) => {
146
157
  });
147
158
  };
148
159
  export const runTerminalInputWrite = (tokens, context) => Effect.gen(function* () {
149
- const scope = readTerminalWriteScope(tokens);
150
- const input = yield* readTerminalInput(context);
151
- if (input.length === 0) {
160
+ const parsed = parseTerminalWriteOptions(tokens);
161
+ const scope = readTerminalWriteScope(parsed);
162
+ const bytes = parsed.flags.has("--input-stdin")
163
+ ? Buffer.from(yield* readTerminalInput(context), "utf8")
164
+ : typedInputBytes(parsed.options);
165
+ if (bytes.length === 0) {
152
166
  throw new CliArgumentError("Terminal input must not be empty.");
153
167
  }
168
+ if (bytes.length > MAX_TERMINAL_INPUT_CHUNK_BYTES) {
169
+ throw new CliArgumentError(`Terminal input must be at most ${String(MAX_TERMINAL_INPUT_CHUNK_BYTES)} bytes.`);
170
+ }
154
171
  const result = yield* context.dependencies.writeTerminalInput({
155
172
  ...scope,
156
- bytesBase64: Buffer.from(input, "utf8").toString("base64"),
173
+ bytesBase64: bytes.toString("base64"),
157
174
  });
158
175
  return writeTerminalResult(result, context, (value) => ({
159
176
  command: "terminal.input.write",
@@ -0,0 +1,62 @@
1
+ import { Buffer } from "node:buffer";
2
+ import { Data } from "effect";
3
+ const NAMED_KEYS = new Map([
4
+ ["Backspace", "\u007F"],
5
+ ["Delete", "\u001B[3~"],
6
+ ["Down", "\u001B[B"],
7
+ ["End", "\u001B[F"],
8
+ ["Enter", "\r"],
9
+ ["Escape", "\u001B"],
10
+ ["F1", "\u001BOP"],
11
+ ["F2", "\u001BOQ"],
12
+ ["F3", "\u001BOR"],
13
+ ["F4", "\u001BOS"],
14
+ ["F5", "\u001B[15~"],
15
+ ["F6", "\u001B[17~"],
16
+ ["F7", "\u001B[18~"],
17
+ ["F8", "\u001B[19~"],
18
+ ["F9", "\u001B[20~"],
19
+ ["F10", "\u001B[21~"],
20
+ ["F11", "\u001B[23~"],
21
+ ["F12", "\u001B[24~"],
22
+ ["Home", "\u001B[H"],
23
+ ["Insert", "\u001B[2~"],
24
+ ["Left", "\u001B[D"],
25
+ ["PageDown", "\u001B[6~"],
26
+ ["PageUp", "\u001B[5~"],
27
+ ["Right", "\u001B[C"],
28
+ ["Space", " "],
29
+ ["Tab", "\t"],
30
+ ["Up", "\u001B[A"],
31
+ ]);
32
+ export class UnknownKeyError extends Data.TaggedError("UnknownKeyError") {
33
+ }
34
+ export const TERMINAL_KEY_NAMES = [
35
+ ...NAMED_KEYS.keys(),
36
+ "C-<a..z>",
37
+ "M-<char>",
38
+ ];
39
+ const bytesOfKey = (name) => {
40
+ const named = NAMED_KEYS.get(name);
41
+ if (named !== undefined)
42
+ return named;
43
+ if (/^C-[a-z]$/u.test(name)) {
44
+ return String.fromCodePoint((name.codePointAt(2) ?? 0) - 0x60);
45
+ }
46
+ const alt = /^M-(\P{Cc})$/u.exec(name);
47
+ if (alt?.[1] !== undefined)
48
+ return `\u001B${alt[1]}`;
49
+ throw new UnknownKeyError({
50
+ message: `Unknown key '${name}'. Keys: ${TERMINAL_KEY_NAMES.join(", ")}.`,
51
+ });
52
+ };
53
+ export const terminalInputBytes = (parts) => Buffer.from([...parts]
54
+ .map(([option, value]) => option === "--text"
55
+ ? value
56
+ : value
57
+ .split(/\s+/u)
58
+ .filter((name) => name !== "")
59
+ .map(bytesOfKey)
60
+ .join(""))
61
+ .join(""), "utf8");
62
+ //# sourceMappingURL=keys.js.map
@@ -132,6 +132,9 @@ export const projectTerminalEventsResult = (value, audience = "json") => ({
132
132
  ...(value.nextTerminalCursor === undefined
133
133
  ? {}
134
134
  : { nextCursor: value.nextTerminalCursor }),
135
+ ...(value.oldestRetainedCursor === undefined
136
+ ? {}
137
+ : { oldestRetainedCursor: value.oldestRetainedCursor }),
135
138
  terminalId: value.terminalId,
136
139
  });
137
140
  export const projectTerminalChunk = (chunk) => ({
@@ -1,4 +1,4 @@
1
- import { cell, formatRows, jsonLine, writeNodeResult, } from "../../command-line/index.js";
1
+ import { cell, formatRows, jsonLine, withPrunedHistory, writeNodeResult, } from "../../command-line/index.js";
2
2
  const isHumanLiveTerminal = (terminal) => terminal.state !== "unavailable" && "capability" in terminal;
3
3
  const formatTerminalProjection = (terminal) => {
4
4
  if (terminal.state === "unavailable") {
@@ -21,7 +21,7 @@ const formatTerminalEvent = (event) => {
21
21
  }
22
22
  return `${cell(event.cursor)}\t${cell(event.type)}`;
23
23
  };
24
- export const formatTerminalEvents = (result) => formatRows(result.items, formatTerminalEvent);
24
+ export const formatTerminalEvents = (result) => withPrunedHistory(formatRows(result.items, formatTerminalEvent), result.oldestRetainedCursor);
25
25
  export const formatTerminalRead = (result) => (result.gap === undefined
26
26
  ? ""
27
27
  : `gap\t${result.gap.reason}\t${cell(result.gap.oldestAvailableCursor)}\n`) +
@@ -72,7 +72,7 @@ export const TERMINAL_TREE = {
72
72
  { route: "<terminal-id>", run: [terminal, "runControllerRelease"] },
73
73
  ],
74
74
  [
75
- "terminal input write <terminal-id> --input-stdin --input-id <id> --input-sequence <1..2147483647> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
75
+ "terminal input write <terminal-id> (--input-stdin | [--text <text>] [--keys <names>]) --input-id <id> --input-sequence <1..2147483647> --controller-id <id> --controller-epoch <epoch> --controller-revision <revision> --controller-expires-at <timestamp> --terminal-generation <1..65535> --expected-revision <revision> [--command-id <id>]",
76
76
  1,
77
77
  "terminal.input.write",
78
78
  "Write input to a terminal you control.",
@@ -0,0 +1,156 @@
1
+ import { type WebhooksChangeConfirmParameters, type WebhooksChangePreviewParameters, type WebhooksDeliveriesParameters, type WebhooksListParameters } from "@maiaos/sdk";
2
+ import type { CliNodeOperations } from "../local-node/index.js";
3
+ export declare const makeWebhooksClient: (node: CliNodeOperations) => {
4
+ confirmWebhookChange: (input: WebhooksChangeConfirmParameters) => import("../local-node/client.js").CliNodeEffect<{
5
+ readonly actorId: string;
6
+ readonly commandId: string;
7
+ readonly delivery: "duplicate" | "new";
8
+ readonly deliveryId?: string | undefined;
9
+ readonly inputDigest: string;
10
+ readonly kind: "add" | "redeliver" | "remove" | "test";
11
+ readonly method: "webhooks.change.confirm";
12
+ readonly receipt: {
13
+ readonly actorId: string;
14
+ readonly aggregateRevision: string;
15
+ readonly commandId: string;
16
+ readonly createdAt: string;
17
+ readonly eventCursor: string;
18
+ readonly method: string;
19
+ readonly receiptId: string;
20
+ readonly schemaVersion: 1;
21
+ readonly state: "succeeded";
22
+ readonly target: {
23
+ readonly id: string;
24
+ readonly type: string;
25
+ };
26
+ readonly updatedAt: string;
27
+ };
28
+ readonly webhook: {
29
+ readonly actorId: string;
30
+ readonly createdAt: string;
31
+ readonly droppedParked: number;
32
+ readonly gapOldest?: string | undefined;
33
+ readonly gapResets: number;
34
+ readonly id: string;
35
+ readonly lastErrorClass?: string | undefined;
36
+ readonly revision: string;
37
+ readonly schemaVersion: "maia.webhook/v1";
38
+ readonly spec: {
39
+ readonly allowPrivate: boolean;
40
+ readonly events: readonly ("admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
41
+ readonly filters: readonly {
42
+ readonly key: string;
43
+ readonly value: string;
44
+ }[];
45
+ readonly secretEnv: string;
46
+ readonly url: string;
47
+ };
48
+ readonly state: "active" | "removed";
49
+ readonly updatedAt: string;
50
+ };
51
+ }>;
52
+ listWebhookDeliveries: (input: WebhooksDeliveriesParameters) => import("../local-node/client.js").CliNodeEffect<{
53
+ readonly items: readonly {
54
+ readonly attempts: number;
55
+ readonly createdAt: string;
56
+ readonly errorClass?: string | undefined;
57
+ readonly eventId: string;
58
+ readonly id: string;
59
+ readonly kind: "admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test";
60
+ readonly nextAttemptAt?: string | undefined;
61
+ readonly state: "dead" | "delivered" | "denied" | "expired" | "in_flight" | "pending" | "retry";
62
+ readonly updatedAt: string;
63
+ readonly webhookId: string;
64
+ }[];
65
+ readonly method: "webhooks.deliveries";
66
+ readonly nextCursor?: string | undefined;
67
+ }>;
68
+ listWebhooks: (input: WebhooksListParameters) => import("../local-node/client.js").CliNodeEffect<{
69
+ readonly items: readonly {
70
+ readonly actorId: string;
71
+ readonly createdAt: string;
72
+ readonly droppedParked: number;
73
+ readonly gapOldest?: string | undefined;
74
+ readonly gapResets: number;
75
+ readonly id: string;
76
+ readonly lastErrorClass?: string | undefined;
77
+ readonly revision: string;
78
+ readonly schemaVersion: "maia.webhook/v1";
79
+ readonly spec: {
80
+ readonly allowPrivate: boolean;
81
+ readonly events: readonly ("admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
82
+ readonly filters: readonly {
83
+ readonly key: string;
84
+ readonly value: string;
85
+ }[];
86
+ readonly secretEnv: string;
87
+ readonly url: string;
88
+ };
89
+ readonly state: "active" | "removed";
90
+ readonly updatedAt: string;
91
+ }[];
92
+ readonly method: "webhooks.list";
93
+ readonly nextCursor?: string | undefined;
94
+ }>;
95
+ previewWebhookChange: (input: WebhooksChangePreviewParameters) => import("../local-node/client.js").CliNodeEffect<{
96
+ readonly change: {
97
+ readonly kind: "add";
98
+ readonly spec: {
99
+ readonly allowPrivate: boolean;
100
+ readonly events: readonly ("admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
101
+ readonly filters: readonly {
102
+ readonly key: string;
103
+ readonly value: string;
104
+ }[];
105
+ readonly secretEnv: string;
106
+ readonly url: string;
107
+ };
108
+ } | {
109
+ readonly expectedRevision: string;
110
+ readonly webhookId: string;
111
+ readonly kind: "remove";
112
+ } | {
113
+ readonly expectedRevision: string;
114
+ readonly webhookId: string;
115
+ readonly kind: "test";
116
+ } | {
117
+ readonly deliveryId: string;
118
+ readonly expectedRevision: string;
119
+ readonly kind: "redeliver";
120
+ };
121
+ readonly commandId: string;
122
+ readonly inputDigest: string;
123
+ readonly proof: string;
124
+ readonly actorId: string;
125
+ readonly current?: {
126
+ readonly actorId: string;
127
+ readonly createdAt: string;
128
+ readonly droppedParked: number;
129
+ readonly gapOldest?: string | undefined;
130
+ readonly gapResets: number;
131
+ readonly id: string;
132
+ readonly lastErrorClass?: string | undefined;
133
+ readonly revision: string;
134
+ readonly schemaVersion: "maia.webhook/v1";
135
+ readonly spec: {
136
+ readonly allowPrivate: boolean;
137
+ readonly events: readonly ("admission.refused" | "node.started" | "node.stopping" | "session.adopted" | "session.blocked" | "session.ended" | "session.idle" | "session.runtime.failed" | "session.started" | "session.turn.completed" | "session.turn.failed" | "session.working" | "update.done" | "webhook.test")[];
138
+ readonly filters: readonly {
139
+ readonly key: string;
140
+ readonly value: string;
141
+ }[];
142
+ readonly secretEnv: string;
143
+ readonly url: string;
144
+ };
145
+ readonly state: "active" | "removed";
146
+ readonly updatedAt: string;
147
+ } | undefined;
148
+ readonly deletesDeliveries?: number | undefined;
149
+ readonly expiresAt: string;
150
+ readonly issuedAt: string;
151
+ readonly method: "webhooks.change.preview";
152
+ readonly webhookId: string;
153
+ }>;
154
+ };
155
+ export type WebhooksCliDependencies = ReturnType<typeof makeWebhooksClient>;
156
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { webhooksChangeConfirmParametersSchema, webhooksChangePreviewParametersSchema, webhooksDeliveriesParametersSchema, webhooksListParametersSchema, } from "@maiaos/sdk";
2
+ export const makeWebhooksClient = (node) => ({
3
+ confirmWebhookChange: (input) => node.runValidatedNodeOperation(input, webhooksChangeConfirmParametersSchema, (client, parameters, options) => client.confirmWebhookChange(parameters, options), { commandId: input.commandId }),
4
+ listWebhookDeliveries: (input) => node.runValidatedNodeOperation(input, webhooksDeliveriesParametersSchema, (client, parameters, options) => client.listWebhookDeliveries(parameters, options)),
5
+ listWebhooks: (input) => node.runValidatedNodeOperation(input, webhooksListParametersSchema, (client, parameters, options) => client.listWebhooks(parameters, options)),
6
+ previewWebhookChange: (input) => node.runValidatedNodeOperation(input, webhooksChangePreviewParametersSchema, (client, parameters, options) => client.previewWebhookChange(parameters, options)),
7
+ });
8
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1,17 @@
1
+ import type * as Crypto from "effect/Crypto";
2
+ import * as Effect from "effect/Effect";
3
+ import { type OutputContext } from "../command-line/emit/index.js";
4
+ import { CliArgumentError } from "../command-line/input/index.js";
5
+ import type { WebhooksCliDependencies } from "./client.js";
6
+ type CommandContext = OutputContext & {
7
+ readonly dependencies: WebhooksCliDependencies;
8
+ };
9
+ type CommandEffect = Effect.Effect<number, CliArgumentError, Crypto.Crypto>;
10
+ export declare const runWebhooksList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
11
+ export declare const runWebhooksDeliveries: (tokens: readonly string[], context: CommandContext) => CommandEffect;
12
+ export declare const runWebhooksAdd: (tokens: readonly string[], context: CommandContext) => CommandEffect;
13
+ export declare const runWebhooksRemove: (tokens: readonly string[], context: CommandContext) => CommandEffect;
14
+ export declare const runWebhooksTest: (tokens: readonly string[], context: CommandContext) => CommandEffect;
15
+ export declare const runWebhooksRedeliver: (tokens: readonly string[], context: CommandContext) => CommandEffect;
16
+ export {};
17
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1,76 @@
1
+ import { webhooksChangeConfirmParametersSchema, } from "@maiaos/sdk";
2
+ import * as Effect from "effect/Effect";
3
+ import { writeNodeResult, } from "../command-line/emit/index.js";
4
+ import { CliArgumentError, parseOptionsWith, requirePositionals, } from "../command-line/input/index.js";
5
+ import { confirmParameters, readTwoPhaseMode, runTwoPhase, } from "../command-line/two-phase/index.js";
6
+ import { readAddChange, readRedeliverChange, readRemoveChange, readTestChange, readWebhooksDeliveries, readWebhooksList, WEBHOOK_OPTIONS, } from "./input.js";
7
+ import { formatWebhooksResult } from "./output/index.js";
8
+ const write = (context) => (result) => writeNodeResult(result, context, {
9
+ toResult: (value) => ({ command: value.method, result: value }),
10
+ toText: formatWebhooksResult,
11
+ });
12
+ const unavailable = () => Effect.die(new Error("Missing webhooks client."));
13
+ export const runWebhooksList = (tokens, context) => Effect.gen(function* () {
14
+ const list = context.dependencies.listWebhooks;
15
+ if (list === undefined)
16
+ return yield* unavailable();
17
+ return write(context)(yield* list(readWebhooksList(tokens)));
18
+ });
19
+ export const runWebhooksDeliveries = (tokens, context) => Effect.gen(function* () {
20
+ const list = context.dependencies.listWebhookDeliveries;
21
+ if (list === undefined)
22
+ return yield* unavailable();
23
+ return write(context)(yield* list(readWebhooksDeliveries(tokens)));
24
+ });
25
+ const describe = (preview) => formatWebhooksResult({ command: preview.method, result: preview });
26
+ const confirmOwnKind = (kind, confirm) => (preview) => Effect.flatMap(confirmParameters(webhooksChangeConfirmParametersSchema, preview, [
27
+ "current",
28
+ "deletesDeliveries",
29
+ "webhookId",
30
+ ]), (parameters) => parameters.change.kind === kind
31
+ ? confirm(parameters)
32
+ : Effect.fail(new CliArgumentError(`The piped preview is a ${parameters.change.kind} change; confirm it with 'maia webhooks ${parameters.change.kind} --confirm-stdin'.`)));
33
+ const runChange = (tokens, context, spec) => Effect.gen(function* () {
34
+ const parsed = parseOptionsWith(tokens, spec.options);
35
+ const mode = readTwoPhaseMode(parsed.flags, context);
36
+ if (mode === "confirm-stdin")
37
+ requirePositionals(parsed.positionals, 0);
38
+ const { confirmWebhookChange, previewWebhookChange } = context.dependencies;
39
+ if (confirmWebhookChange === undefined ||
40
+ previewWebhookChange === undefined)
41
+ return yield* new CliArgumentError("Webhook changes are unavailable.");
42
+ return yield* runTwoPhase({
43
+ confirm: confirmOwnKind(spec.kind, confirmWebhookChange),
44
+ context,
45
+ mode,
46
+ preview: () => Effect.flatMap(spec.read(parsed), previewWebhookChange),
47
+ prompt: { describe, question: spec.question },
48
+ writeConfirm: write(context),
49
+ writePreview: write(context),
50
+ });
51
+ });
52
+ export const runWebhooksAdd = (tokens, context) => runChange(tokens, context, {
53
+ kind: "add",
54
+ options: WEBHOOK_OPTIONS.add,
55
+ question: "Add this webhook?",
56
+ read: readAddChange,
57
+ });
58
+ export const runWebhooksRemove = (tokens, context) => runChange(tokens, context, {
59
+ kind: "remove",
60
+ options: WEBHOOK_OPTIONS.remove,
61
+ question: "Remove this webhook and its deliveries?",
62
+ read: readRemoveChange,
63
+ });
64
+ export const runWebhooksTest = (tokens, context) => runChange(tokens, context, {
65
+ kind: "test",
66
+ options: WEBHOOK_OPTIONS.test,
67
+ question: "Send a test event to this webhook?",
68
+ read: readTestChange,
69
+ });
70
+ export const runWebhooksRedeliver = (tokens, context) => runChange(tokens, context, {
71
+ kind: "redeliver",
72
+ options: WEBHOOK_OPTIONS.redeliver,
73
+ question: "Send this delivery again?",
74
+ read: readRedeliverChange,
75
+ });
76
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1,3 @@
1
+ export { makeWebhooksClient, type WebhooksCliDependencies } from "./client.js";
2
+ export { runWebhooksAdd, runWebhooksDeliveries, runWebhooksList, runWebhooksRedeliver, runWebhooksRemove, runWebhooksTest, } from "./commands.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export { makeWebhooksClient } from "./client.js";
2
+ export { runWebhooksAdd, runWebhooksDeliveries, runWebhooksList, runWebhooksRedeliver, runWebhooksRemove, runWebhooksTest, } from "./commands.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,125 @@
1
+ import { webhookSpecSchema, } from "@maiaos/sdk";
2
+ import * as Effect from "effect/Effect";
3
+ import { CliArgumentError, parseOptionsWith, readExpectedRevision, readPageSize, requirePositionals, } from "../command-line/input/index.js";
4
+ import { TWO_PHASE_FLAGS } from "../command-line/two-phase/index.js";
5
+ import { commandIdentifier } from "../local-node/index.js";
6
+ const targetOptions = ["--command-id", "--expected-revision"];
7
+ export const WEBHOOK_OPTIONS = {
8
+ add: {
9
+ allowed: new Set([
10
+ "--command-id",
11
+ "--event",
12
+ "--label",
13
+ "--node-id",
14
+ "--project",
15
+ "--secret-env",
16
+ "--url",
17
+ ]),
18
+ allowedFlags: new Set([...TWO_PHASE_FLAGS, "--allow-private"]),
19
+ repeatable: new Set(["--event", "--label"]),
20
+ },
21
+ deliveries: {
22
+ allowed: new Set(["--after", "--limit", "--webhook"]),
23
+ allowedFlags: new Set(["--failed"]),
24
+ repeatable: new Set(),
25
+ },
26
+ list: {
27
+ allowed: new Set(["--after", "--limit"]),
28
+ allowedFlags: new Set(),
29
+ repeatable: new Set(),
30
+ },
31
+ redeliver: {
32
+ allowed: new Set(targetOptions),
33
+ allowedFlags: new Set(TWO_PHASE_FLAGS),
34
+ repeatable: new Set(),
35
+ },
36
+ remove: {
37
+ allowed: new Set(targetOptions),
38
+ allowedFlags: new Set(TWO_PHASE_FLAGS),
39
+ repeatable: new Set(),
40
+ },
41
+ test: {
42
+ allowed: new Set(targetOptions),
43
+ allowedFlags: new Set(TWO_PHASE_FLAGS),
44
+ repeatable: new Set(),
45
+ },
46
+ };
47
+ const required = (options, name) => {
48
+ const value = options.get(name);
49
+ if (value === undefined)
50
+ throw new CliArgumentError(`Option '${name}' is required.`);
51
+ return value;
52
+ };
53
+ const INVALID_SPEC = "The webhook is invalid: check '--url' (http or https, no credentials), '--secret-env' (an upper-case variable name), '--event' (a hook event) and '--label' (key=value, no comma).";
54
+ const labelFilter = (label) => {
55
+ const [key, ...rest] = label.split("=");
56
+ if (key === undefined || key === "" || rest.length === 0)
57
+ throw new CliArgumentError("Option '--label' takes key=value.");
58
+ return { key: `label.${key}`, value: rest.join("=") };
59
+ };
60
+ const filtersOf = (options) => {
61
+ const project = options.get("--project");
62
+ const node = options.get("--node-id");
63
+ return [
64
+ ...(project === undefined ? [] : [{ key: "project", value: project }]),
65
+ ...(node === undefined ? [] : [{ key: "node", value: node }]),
66
+ ...(options.get("--label")?.split(",").map(labelFilter) ?? []),
67
+ ];
68
+ };
69
+ const readSpec = (parsed) => {
70
+ const { flags, options } = parsed;
71
+ const spec = webhookSpecSchema.safeParse({
72
+ allowPrivate: flags.has("--allow-private"),
73
+ events: required(options, "--event").split(","),
74
+ filters: filtersOf(options),
75
+ secretEnv: required(options, "--secret-env"),
76
+ url: required(options, "--url"),
77
+ });
78
+ if (!spec.success)
79
+ throw new CliArgumentError(INVALID_SPEC);
80
+ return spec.data;
81
+ };
82
+ export const readWebhooksList = (tokens) => {
83
+ const { options, positionals } = parseOptionsWith(tokens, WEBHOOK_OPTIONS.list);
84
+ requirePositionals(positionals, 0);
85
+ const afterCursor = options.get("--after");
86
+ return {
87
+ ...(afterCursor === undefined ? {} : { afterCursor }),
88
+ limit: readPageSize(options.get("--limit")),
89
+ };
90
+ };
91
+ export const readWebhooksDeliveries = (tokens) => {
92
+ const { flags, options, positionals } = parseOptionsWith(tokens, WEBHOOK_OPTIONS.deliveries);
93
+ requirePositionals(positionals, 0);
94
+ const afterCursor = options.get("--after");
95
+ const webhookId = options.get("--webhook");
96
+ return {
97
+ ...(afterCursor === undefined ? {} : { afterCursor }),
98
+ ...(flags.has("--failed") ? { failedOnly: true } : {}),
99
+ limit: readPageSize(options.get("--limit")),
100
+ ...(webhookId === undefined ? {} : { webhookId }),
101
+ };
102
+ };
103
+ const withCommandId = (parsed, change) => Effect.map(commandIdentifier(parsed.options.get("--command-id")), (commandId) => ({ change, commandId }));
104
+ export const readAddChange = (parsed) => {
105
+ requirePositionals(parsed.positionals, 0);
106
+ return withCommandId(parsed, { kind: "add", spec: readSpec(parsed) });
107
+ };
108
+ const targetOf = (parsed, positionals) => {
109
+ requirePositionals(parsed.positionals, positionals);
110
+ return {
111
+ expectedRevision: readExpectedRevision(parsed.options.get("--expected-revision")),
112
+ webhookId: parsed.positionals[0] ?? "",
113
+ };
114
+ };
115
+ export const readRemoveChange = (parsed) => withCommandId(parsed, { ...targetOf(parsed, 1), kind: "remove" });
116
+ export const readTestChange = (parsed) => withCommandId(parsed, { ...targetOf(parsed, 1), kind: "test" });
117
+ export const readRedeliverChange = (parsed) => {
118
+ requirePositionals(parsed.positionals, 1);
119
+ return withCommandId(parsed, {
120
+ deliveryId: parsed.positionals[0] ?? "",
121
+ expectedRevision: readExpectedRevision(parsed.options.get("--expected-revision")),
122
+ kind: "redeliver",
123
+ });
124
+ };
125
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1,75 @@
1
+ import { cell, formatRows, tab, withNextPage, } from "../../command-line/emit/index.js";
2
+ const hookLine = (hook) => tab([
3
+ hook.id,
4
+ hook.state,
5
+ hook.revision,
6
+ cell(hook.spec.url),
7
+ hook.spec.events.join(","),
8
+ ]);
9
+ const deliveryLine = (delivery) => tab([
10
+ delivery.id,
11
+ delivery.webhookId,
12
+ delivery.state,
13
+ delivery.kind,
14
+ `attempts=${String(delivery.attempts)}`,
15
+ delivery.errorClass ?? "",
16
+ ]);
17
+ const specOf = ({ change, current }) => change.kind === "add" ? change.spec : current?.spec;
18
+ const specLines = (spec) => [
19
+ spec.allowPrivate
20
+ ? "allowPrivate=true (sends may reach private and loopback addresses)"
21
+ : "allowPrivate=false",
22
+ `url=${cell(spec.url)}`,
23
+ `events=${spec.events.join(",")}`,
24
+ `filters=${spec.filters.map(({ key, value }) => `${key}=${cell(value)}`).join(",") || "none"}`,
25
+ `secretEnv=${spec.secretEnv}`,
26
+ ];
27
+ const targetLines = (result) => {
28
+ const { change, deletesDeliveries } = result;
29
+ return [
30
+ ...(change.kind === "add" ? [] : [`revision=${change.expectedRevision}`]),
31
+ ...(change.kind === "redeliver" ? [`delivery=${change.deliveryId}`] : []),
32
+ ...(deletesDeliveries === undefined
33
+ ? []
34
+ : [`deletes=${String(deletesDeliveries)} deliveries`]),
35
+ ];
36
+ };
37
+ const previewLines = (result) => {
38
+ const { change, commandId, expiresAt, webhookId } = result;
39
+ const spec = specOf(result);
40
+ const header = tab([
41
+ change.kind,
42
+ webhookId,
43
+ `command=${commandId}`,
44
+ `expires=${expiresAt}`,
45
+ ]);
46
+ return `${[header, ...(spec === undefined ? [] : specLines(spec)), ...targetLines(result)].join("\n")}\n`;
47
+ };
48
+ const confirmLine = ({ delivery, receipt, webhook, }) => `${tab([webhook.id, webhook.state, webhook.revision, receipt.receiptId, delivery])}\n`;
49
+ const DELIVERY_HEADERS = [
50
+ "DELIVERY",
51
+ "WEBHOOK",
52
+ "STATE",
53
+ "KIND",
54
+ "ATTEMPTS",
55
+ "ERROR",
56
+ ];
57
+ export const formatWebhooksResult = ({ result }) => {
58
+ switch (result.method) {
59
+ case "webhooks.list":
60
+ return withNextPage(formatRows(result.items, hookLine, {
61
+ empty: "No webhooks.",
62
+ headers: ["WEBHOOK", "STATE", "REVISION", "URL", "EVENTS"],
63
+ }), result.nextCursor);
64
+ case "webhooks.deliveries":
65
+ return withNextPage(formatRows(result.items, deliveryLine, {
66
+ empty: "No deliveries.",
67
+ headers: DELIVERY_HEADERS,
68
+ }), result.nextCursor);
69
+ case "webhooks.change.preview":
70
+ return previewLines(result);
71
+ case "webhooks.change.confirm":
72
+ return confirmLine(result);
73
+ }
74
+ };
75
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1,2 @@
1
+ export { formatWebhooksResult, } from "./format.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ export { WEBHOOKS_TREE } from "./tree.js";
2
+ //# sourceMappingURL=index.js.map