@maiaos/cli 0.1.0-canary.2 → 0.1.0-canary.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -265
- package/dist/address-space/address-space.d.ts +38 -0
- package/dist/address-space/address-space.js +130 -0
- package/dist/address-space/index.d.ts +2 -0
- package/dist/address-space/index.js +2 -0
- package/dist/agents/client.d.ts +171 -0
- package/dist/agents/client.js +8 -0
- package/dist/agents/commands.d.ts +7 -0
- package/dist/agents/commands.js +65 -0
- package/dist/agents/index.d.ts +3 -0
- package/dist/agents/index.js +3 -0
- package/dist/agents/input.d.ts +130 -0
- package/dist/agents/input.js +99 -0
- package/dist/agents/output/format.d.ts +8 -0
- package/dist/agents/output/format.js +47 -0
- package/dist/agents/output/index.d.ts +2 -0
- package/dist/agents/output/index.js +2 -0
- package/dist/agents/tree/index.d.ts +2 -0
- package/dist/agents/tree/index.js +2 -0
- package/dist/agents/tree/tree.d.ts +3 -0
- package/dist/agents/tree/tree.js +43 -0
- package/dist/bin/maia.cdx.json +37 -14
- package/dist/bin/maia.mjs +1 -1
- package/dist/bootstrap/exit.d.ts +14 -0
- package/dist/bootstrap/exit.js +42 -0
- package/dist/bootstrap/process.js +4 -26
- package/dist/cli/cli.js +70 -13
- package/dist/command-line/context.d.ts +13 -4
- package/dist/command-line/context.js +1 -1
- package/dist/command-line/index.d.ts +5 -5
- package/dist/command-line/index.js +5 -4
- package/dist/command-line/input/index.d.ts +1 -1
- package/dist/command-line/input/index.js +1 -1
- package/dist/command-line/input/stdin.d.ts +1 -0
- package/dist/command-line/input/stdin.js +1 -0
- package/dist/command-line/json.d.ts +1 -0
- package/dist/command-line/json.js +23 -0
- package/dist/command-line/output.d.ts +8 -1
- package/dist/command-line/output.js +33 -14
- package/dist/command-line/rows.d.ts +2 -0
- package/dist/command-line/rows.js +10 -1
- package/dist/command-line/two-phase.d.ts +5 -0
- package/dist/command-line/two-phase.js +33 -8
- package/dist/command-tree/help.d.ts +1 -1
- package/dist/command-tree/help.js +1 -0
- package/dist/command-tree/index.d.ts +2 -2
- package/dist/command-tree/index.js +1 -1
- package/dist/command-tree/local.js +12 -0
- package/dist/command-tree/placeholder.d.ts +1 -0
- package/dist/command-tree/placeholder.js +1 -0
- package/dist/command-tree/row.d.ts +2 -0
- package/dist/command-tree/tree.d.ts +3 -2
- package/dist/command-tree/tree.js +18 -2
- package/dist/connection/client.d.ts +93 -1
- package/dist/connection/client.js +7 -1
- package/dist/connection/index.d.ts +1 -1
- package/dist/connection/index.js +1 -1
- package/dist/connection/system.d.ts +1 -0
- package/dist/connection/system.js +109 -5
- package/dist/connection/tree/tree.js +17 -4
- package/dist/container/output/format.js +1 -2
- package/dist/dashboard/cockpit-client.d.ts +6 -0
- package/dist/dashboard/cockpit-client.js +27 -0
- package/dist/dashboard/cockpits.d.ts +29 -0
- package/dist/dashboard/cockpits.js +65 -0
- package/dist/dashboard/dashboard.d.ts +7 -0
- package/dist/dashboard/dashboard.js +47 -0
- package/dist/dashboard/draw.d.ts +15 -0
- package/dist/dashboard/draw.js +30 -0
- package/dist/dashboard/frame.d.ts +4 -0
- package/dist/dashboard/frame.js +15 -0
- package/dist/dashboard/index.d.ts +2 -0
- package/dist/dashboard/index.js +2 -0
- package/dist/dashboard/modes.d.ts +5 -0
- package/dist/dashboard/modes.js +16 -0
- package/dist/dashboard/node-connection.d.ts +15 -0
- package/dist/dashboard/node-connection.js +51 -0
- package/dist/dashboard/pi-tui.d.ts +6 -0
- package/dist/dashboard/pi-tui.js +35 -0
- package/dist/dashboard/status-bar.d.ts +4 -0
- package/dist/dashboard/status-bar.js +60 -0
- package/dist/dashboard/terminal.d.ts +53 -0
- package/dist/dashboard/terminal.js +165 -0
- package/dist/dashboard/tree-model.d.ts +28 -0
- package/dist/dashboard/tree-model.js +97 -0
- package/dist/dashboard/tree.d.ts +10 -0
- package/dist/dashboard/tree.js +76 -0
- package/dist/fleet/fleet.d.ts +70 -0
- package/dist/fleet/fleet.js +91 -0
- package/dist/fleet/index.d.ts +2 -0
- package/dist/fleet/index.js +2 -0
- package/dist/hold/output/format.js +1 -5
- package/dist/hold/tree/tree.js +1 -0
- package/dist/import/commands.js +3 -4
- package/dist/import/output.js +1 -4
- package/dist/local-node/client.d.ts +8 -4
- package/dist/local-node/client.js +20 -9
- package/dist/local-node/index.d.ts +1 -1
- package/dist/local-node/index.js +1 -1
- package/dist/login/commands.js +2 -1
- package/dist/mcp/calls.d.ts +1 -0
- package/dist/mcp/calls.js +36 -3
- package/dist/mcp/commands.d.ts +5 -2
- package/dist/mcp/commands.js +30 -4
- package/dist/mcp/routing.d.ts +24 -0
- package/dist/mcp/routing.js +188 -0
- package/dist/mcp/server.d.ts +13 -4
- package/dist/mcp/server.js +35 -12
- package/dist/presentation/output/format.js +4 -3
- package/dist/project-guard/commands.js +11 -2
- package/dist/project-workspace/commands.js +16 -6
- package/dist/project-workspace/output/human.d.ts +13 -0
- package/dist/project-workspace/output/human.js +17 -5
- package/dist/project-workspace/output/index.d.ts +1 -1
- package/dist/project-workspace/output/index.js +1 -1
- package/dist/project-workspace/output/metadata.js +1 -1
- package/dist/project-workspace/tree/tree.js +27 -12
- package/dist/reference/commands.js +4 -2
- package/dist/reference/index.d.ts +1 -1
- package/dist/reference/index.js +1 -1
- package/dist/reference/resolve.d.ts +2 -0
- package/dist/reference/resolve.js +20 -17
- package/dist/remote-node/client.d.ts +89 -9
- package/dist/remote-node/client.js +6 -1
- package/dist/remote-node/commands.d.ts +9 -0
- package/dist/remote-node/commands.js +96 -18
- package/dist/remote-node/connector.d.ts +12 -4
- package/dist/remote-node/connector.js +46 -25
- package/dist/remote-node/index.d.ts +2 -2
- package/dist/remote-node/index.js +2 -2
- package/dist/remote-node/reachability.d.ts +43 -1
- package/dist/remote-node/reachability.js +13 -3
- package/dist/remote-node/text.d.ts +2 -1
- package/dist/remote-node/text.js +74 -27
- package/dist/remote-node/tree/tree.js +21 -1
- package/dist/routine/client.d.ts +398 -0
- package/dist/routine/client.js +28 -0
- package/dist/routine/commands.d.ts +9 -0
- package/dist/routine/commands.js +109 -0
- package/dist/routine/index.d.ts +3 -0
- package/dist/routine/index.js +3 -0
- package/dist/routine/input.d.ts +28 -0
- package/dist/routine/input.js +44 -0
- package/dist/routine/output/format.d.ts +23 -0
- package/dist/routine/output/format.js +83 -0
- package/dist/routine/output/index.d.ts +2 -0
- package/dist/routine/output/index.js +2 -0
- package/dist/routine/tree/index.d.ts +2 -0
- package/dist/routine/tree/index.js +2 -0
- package/dist/routine/tree/tree.d.ts +3 -0
- package/dist/routine/tree/tree.js +70 -0
- package/dist/session/agent-permission.d.ts +2 -2
- package/dist/session/approval/commands.js +24 -6
- package/dist/session/approval/output/format.d.ts +11 -0
- package/dist/session/approval/output/format.js +8 -0
- package/dist/session/approval/output/index.d.ts +1 -1
- package/dist/session/approval/output/index.js +1 -1
- package/dist/session/attach-client.d.ts +1 -1
- package/dist/session/attach-client.js +12 -3
- package/dist/session/attach-render.js +15 -7
- package/dist/session/attach.js +17 -3
- package/dist/session/client.d.ts +4 -2
- package/dist/session/client.js +4 -15
- package/dist/session/commands.js +76 -9
- package/dist/session/create-tasks.js +29 -11
- package/dist/session/index.d.ts +1 -1
- package/dist/session/index.js +1 -0
- package/dist/session/interaction/output/format.js +2 -1
- package/dist/session/output/diff.js +3 -10
- package/dist/session/output/failure.js +3 -10
- package/dist/session/output/human.js +21 -10
- package/dist/session/output/index.d.ts +1 -1
- package/dist/session/output/index.js +1 -1
- package/dist/session/output/tasks.d.ts +16 -1
- package/dist/session/output/tasks.js +41 -27
- package/dist/session/tree/tree.js +56 -8
- package/dist/session/turn/client.d.ts +4 -1
- package/dist/session/turn/client.js +15 -2
- package/dist/session/turn/commands.d.ts +2 -0
- package/dist/session/turn/commands.js +38 -5
- package/dist/session/turn/index.d.ts +3 -3
- package/dist/session/turn/index.js +1 -1
- package/dist/session/turn/output.d.ts +7 -2
- package/dist/session/turn/output.js +36 -13
- package/dist/status/client.d.ts +7 -2
- package/dist/status/output/compact.d.ts +1 -0
- package/dist/status/output/compact.js +3 -0
- package/dist/status/output/human.d.ts +1 -1
- package/dist/status/output/human.js +71 -14
- package/dist/team-workspace/ceremony.d.ts +19 -0
- package/dist/team-workspace/ceremony.js +141 -0
- package/dist/team-workspace/client.d.ts +58 -0
- package/dist/team-workspace/client.js +6 -0
- package/dist/team-workspace/commands.d.ts +3 -0
- package/dist/team-workspace/commands.js +85 -0
- package/dist/team-workspace/confirmation.d.ts +4 -0
- package/dist/team-workspace/confirmation.js +8 -0
- package/dist/team-workspace/dependencies.d.ts +8 -0
- package/dist/team-workspace/dependencies.js +2 -0
- package/dist/team-workspace/index.d.ts +6 -0
- package/dist/team-workspace/index.js +5 -0
- package/dist/team-workspace/launcher.d.ts +17 -0
- package/dist/team-workspace/launcher.js +30 -0
- package/dist/team-workspace/output.d.ts +15 -0
- package/dist/team-workspace/output.js +28 -0
- package/dist/team-workspace/terminal.d.ts +9 -0
- package/dist/team-workspace/terminal.js +46 -0
- package/dist/terminal/client.d.ts +4 -0
- package/dist/terminal/client.js +3 -0
- package/dist/terminal/commands.js +37 -25
- package/dist/terminal/output/compact-list.d.ts +1 -0
- package/dist/terminal/output/compact-list.js +1 -0
- package/dist/terminal/output/human.d.ts +2 -19
- package/dist/terminal/output/human.js +6 -6
- package/dist/terminal/tree/tree.js +15 -15
- package/package.json +8 -6
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import type { CliNodeOperations } from "../local-node/index.js";
|
|
2
|
+
export declare const makeRoutineCliClient: (node: CliNodeOperations) => {
|
|
3
|
+
confirmRoutineCreate: (input: {
|
|
4
|
+
readonly commandId: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly paused?: boolean | undefined;
|
|
7
|
+
readonly schedule: {
|
|
8
|
+
readonly expression: string;
|
|
9
|
+
readonly timezone: string;
|
|
10
|
+
};
|
|
11
|
+
readonly template: {
|
|
12
|
+
readonly connectionId?: string | undefined;
|
|
13
|
+
readonly executor?: "claude-code" | "codex-cli" | undefined;
|
|
14
|
+
readonly model?: string | undefined;
|
|
15
|
+
readonly projectId: string;
|
|
16
|
+
readonly prompt: string;
|
|
17
|
+
};
|
|
18
|
+
readonly inputDigest: string;
|
|
19
|
+
readonly proof: string;
|
|
20
|
+
}) => import("../local-node/client.js").CliNodeEffect<{
|
|
21
|
+
readonly actorId: string;
|
|
22
|
+
readonly commandId: string;
|
|
23
|
+
readonly delivery: "duplicate" | "new";
|
|
24
|
+
readonly inputDigest: string;
|
|
25
|
+
readonly method: "routine.create.confirm";
|
|
26
|
+
readonly receipt: {
|
|
27
|
+
readonly actorId: string;
|
|
28
|
+
readonly aggregateRevision: string;
|
|
29
|
+
readonly commandId: string;
|
|
30
|
+
readonly createdAt: string;
|
|
31
|
+
readonly eventCursor: string;
|
|
32
|
+
readonly method: string;
|
|
33
|
+
readonly receiptId: string;
|
|
34
|
+
readonly schemaVersion: 1;
|
|
35
|
+
readonly state: "succeeded";
|
|
36
|
+
readonly target: {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly type: string;
|
|
39
|
+
};
|
|
40
|
+
readonly updatedAt: string;
|
|
41
|
+
};
|
|
42
|
+
readonly routine: {
|
|
43
|
+
readonly confirmedBy: string;
|
|
44
|
+
readonly createdAt: string;
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly nextFireAt?: string | undefined;
|
|
48
|
+
readonly revision: string;
|
|
49
|
+
readonly schedule: {
|
|
50
|
+
readonly expression: string;
|
|
51
|
+
readonly timezone: string;
|
|
52
|
+
};
|
|
53
|
+
readonly schemaVersion: "maia.routine/v1";
|
|
54
|
+
readonly state: "active" | "disabled" | "paused";
|
|
55
|
+
readonly template: {
|
|
56
|
+
readonly connectionId?: string | undefined;
|
|
57
|
+
readonly executor?: "claude-code" | "codex-cli" | undefined;
|
|
58
|
+
readonly model?: string | undefined;
|
|
59
|
+
readonly projectId: string;
|
|
60
|
+
readonly prompt: string;
|
|
61
|
+
};
|
|
62
|
+
readonly updatedAt: string;
|
|
63
|
+
};
|
|
64
|
+
}>;
|
|
65
|
+
confirmRoutineDisable: (input: {
|
|
66
|
+
readonly inputDigest: string;
|
|
67
|
+
readonly proof: string;
|
|
68
|
+
readonly commandId: string;
|
|
69
|
+
readonly expectedRevision: string;
|
|
70
|
+
readonly routineId: string;
|
|
71
|
+
}) => import("../local-node/client.js").CliNodeEffect<{
|
|
72
|
+
readonly delivery: "duplicate" | "new";
|
|
73
|
+
readonly method: "routine.disable.confirm";
|
|
74
|
+
readonly receipt: {
|
|
75
|
+
readonly actorId: string;
|
|
76
|
+
readonly aggregateRevision: string;
|
|
77
|
+
readonly commandId: string;
|
|
78
|
+
readonly createdAt: string;
|
|
79
|
+
readonly eventCursor: string;
|
|
80
|
+
readonly method: string;
|
|
81
|
+
readonly receiptId: string;
|
|
82
|
+
readonly schemaVersion: 1;
|
|
83
|
+
readonly state: "succeeded";
|
|
84
|
+
readonly target: {
|
|
85
|
+
readonly id: string;
|
|
86
|
+
readonly type: string;
|
|
87
|
+
};
|
|
88
|
+
readonly updatedAt: string;
|
|
89
|
+
};
|
|
90
|
+
readonly routine: {
|
|
91
|
+
readonly confirmedBy: string;
|
|
92
|
+
readonly createdAt: string;
|
|
93
|
+
readonly id: string;
|
|
94
|
+
readonly name: string;
|
|
95
|
+
readonly nextFireAt?: string | undefined;
|
|
96
|
+
readonly revision: string;
|
|
97
|
+
readonly schedule: {
|
|
98
|
+
readonly expression: string;
|
|
99
|
+
readonly timezone: string;
|
|
100
|
+
};
|
|
101
|
+
readonly schemaVersion: "maia.routine/v1";
|
|
102
|
+
readonly state: "active" | "disabled" | "paused";
|
|
103
|
+
readonly template: {
|
|
104
|
+
readonly connectionId?: string | undefined;
|
|
105
|
+
readonly executor?: "claude-code" | "codex-cli" | undefined;
|
|
106
|
+
readonly model?: string | undefined;
|
|
107
|
+
readonly projectId: string;
|
|
108
|
+
readonly prompt: string;
|
|
109
|
+
};
|
|
110
|
+
readonly updatedAt: string;
|
|
111
|
+
};
|
|
112
|
+
}>;
|
|
113
|
+
confirmRoutineRun: (input: {
|
|
114
|
+
readonly inputDigest: string;
|
|
115
|
+
readonly proof: string;
|
|
116
|
+
readonly commandId: string;
|
|
117
|
+
readonly expectedRevision: string;
|
|
118
|
+
readonly routineId: string;
|
|
119
|
+
}) => import("../local-node/client.js").CliNodeEffect<{
|
|
120
|
+
readonly delivery: "duplicate" | "new";
|
|
121
|
+
readonly fire: {
|
|
122
|
+
readonly failure?: {
|
|
123
|
+
readonly code: string;
|
|
124
|
+
readonly message: string;
|
|
125
|
+
} | undefined;
|
|
126
|
+
readonly failureReason?: "approval_required" | "output_limit_exceeded" | "protocol_invalid" | "repository_changed" | "runtime_exited" | "runtime_failed" | "turn_deadline_exceeded" | "turn_rejected" | undefined;
|
|
127
|
+
readonly id: string;
|
|
128
|
+
readonly missed?: number | undefined;
|
|
129
|
+
readonly outcome: "failed" | "launching" | "skipped" | "started";
|
|
130
|
+
readonly reason?: "connection_disabled" | "held" | "launch_failed" | "outcome_unknown" | "overlap" | "routine_not_active" | "saturated" | "workspace_unavailable" | undefined;
|
|
131
|
+
readonly recordedAt: string;
|
|
132
|
+
readonly routineId: string;
|
|
133
|
+
readonly scheduledAt: string;
|
|
134
|
+
readonly sessionId?: string | undefined;
|
|
135
|
+
readonly triggerKind: "cron" | "manual";
|
|
136
|
+
readonly turnId?: string | undefined;
|
|
137
|
+
readonly turnState?: "completed" | "dispatching" | "failed" | "interrupted" | "outcome-unknown" | "queued" | "running" | undefined;
|
|
138
|
+
};
|
|
139
|
+
readonly method: "routine.run.confirm";
|
|
140
|
+
readonly receipt: {
|
|
141
|
+
readonly actorId: string;
|
|
142
|
+
readonly aggregateRevision: string;
|
|
143
|
+
readonly commandId: string;
|
|
144
|
+
readonly createdAt: string;
|
|
145
|
+
readonly eventCursor: string;
|
|
146
|
+
readonly method: string;
|
|
147
|
+
readonly receiptId: string;
|
|
148
|
+
readonly schemaVersion: 1;
|
|
149
|
+
readonly state: "succeeded";
|
|
150
|
+
readonly target: {
|
|
151
|
+
readonly id: string;
|
|
152
|
+
readonly type: string;
|
|
153
|
+
};
|
|
154
|
+
readonly updatedAt: string;
|
|
155
|
+
};
|
|
156
|
+
}>;
|
|
157
|
+
listRoutines: (input: {
|
|
158
|
+
readonly afterCursor?: string | undefined;
|
|
159
|
+
readonly limit: number;
|
|
160
|
+
readonly projectId?: string | undefined;
|
|
161
|
+
readonly state?: "active" | "disabled" | "paused" | undefined;
|
|
162
|
+
}) => import("../local-node/client.js").CliNodeEffect<{
|
|
163
|
+
readonly items: readonly {
|
|
164
|
+
readonly confirmedBy: string;
|
|
165
|
+
readonly createdAt: string;
|
|
166
|
+
readonly id: string;
|
|
167
|
+
readonly name: string;
|
|
168
|
+
readonly nextFireAt?: string | undefined;
|
|
169
|
+
readonly revision: string;
|
|
170
|
+
readonly schedule: {
|
|
171
|
+
readonly expression: string;
|
|
172
|
+
readonly timezone: string;
|
|
173
|
+
};
|
|
174
|
+
readonly schemaVersion: "maia.routine/v1";
|
|
175
|
+
readonly state: "active" | "disabled" | "paused";
|
|
176
|
+
readonly template: {
|
|
177
|
+
readonly connectionId?: string | undefined;
|
|
178
|
+
readonly executor?: "claude-code" | "codex-cli" | undefined;
|
|
179
|
+
readonly model?: string | undefined;
|
|
180
|
+
readonly projectId: string;
|
|
181
|
+
readonly prompt: string;
|
|
182
|
+
};
|
|
183
|
+
readonly updatedAt: string;
|
|
184
|
+
}[];
|
|
185
|
+
readonly method: "routine.list";
|
|
186
|
+
readonly nextCursor?: string | undefined;
|
|
187
|
+
}>;
|
|
188
|
+
pauseRoutine: (input: {
|
|
189
|
+
readonly commandId: string;
|
|
190
|
+
readonly expectedRevision: string;
|
|
191
|
+
readonly routineId: string;
|
|
192
|
+
}) => import("../local-node/client.js").CliNodeEffect<{
|
|
193
|
+
readonly delivery: "duplicate" | "new";
|
|
194
|
+
readonly method: "routine.pause";
|
|
195
|
+
readonly receipt: {
|
|
196
|
+
readonly actorId: string;
|
|
197
|
+
readonly aggregateRevision: string;
|
|
198
|
+
readonly commandId: string;
|
|
199
|
+
readonly createdAt: string;
|
|
200
|
+
readonly eventCursor: string;
|
|
201
|
+
readonly method: string;
|
|
202
|
+
readonly receiptId: string;
|
|
203
|
+
readonly schemaVersion: 1;
|
|
204
|
+
readonly state: "succeeded";
|
|
205
|
+
readonly target: {
|
|
206
|
+
readonly id: string;
|
|
207
|
+
readonly type: string;
|
|
208
|
+
};
|
|
209
|
+
readonly updatedAt: string;
|
|
210
|
+
};
|
|
211
|
+
readonly routine: {
|
|
212
|
+
readonly confirmedBy: string;
|
|
213
|
+
readonly createdAt: string;
|
|
214
|
+
readonly id: string;
|
|
215
|
+
readonly name: string;
|
|
216
|
+
readonly nextFireAt?: string | undefined;
|
|
217
|
+
readonly revision: string;
|
|
218
|
+
readonly schedule: {
|
|
219
|
+
readonly expression: string;
|
|
220
|
+
readonly timezone: string;
|
|
221
|
+
};
|
|
222
|
+
readonly schemaVersion: "maia.routine/v1";
|
|
223
|
+
readonly state: "active" | "disabled" | "paused";
|
|
224
|
+
readonly template: {
|
|
225
|
+
readonly connectionId?: string | undefined;
|
|
226
|
+
readonly executor?: "claude-code" | "codex-cli" | undefined;
|
|
227
|
+
readonly model?: string | undefined;
|
|
228
|
+
readonly projectId: string;
|
|
229
|
+
readonly prompt: string;
|
|
230
|
+
};
|
|
231
|
+
readonly updatedAt: string;
|
|
232
|
+
};
|
|
233
|
+
}>;
|
|
234
|
+
previewRoutineCreate: (input: {
|
|
235
|
+
readonly commandId: string;
|
|
236
|
+
readonly name: string;
|
|
237
|
+
readonly paused?: boolean | undefined;
|
|
238
|
+
readonly schedule: {
|
|
239
|
+
readonly expression: string;
|
|
240
|
+
readonly timezone: string;
|
|
241
|
+
};
|
|
242
|
+
readonly template: {
|
|
243
|
+
readonly connectionId?: string | undefined;
|
|
244
|
+
readonly executor?: "claude-code" | "codex-cli" | undefined;
|
|
245
|
+
readonly model?: string | undefined;
|
|
246
|
+
readonly projectId: string;
|
|
247
|
+
readonly prompt: string;
|
|
248
|
+
};
|
|
249
|
+
}) => import("../local-node/client.js").CliNodeEffect<{
|
|
250
|
+
readonly commandId: string;
|
|
251
|
+
readonly name: string;
|
|
252
|
+
readonly paused?: boolean | undefined;
|
|
253
|
+
readonly schedule: {
|
|
254
|
+
readonly expression: string;
|
|
255
|
+
readonly timezone: string;
|
|
256
|
+
};
|
|
257
|
+
readonly template: {
|
|
258
|
+
readonly connectionId?: string | undefined;
|
|
259
|
+
readonly executor?: "claude-code" | "codex-cli" | undefined;
|
|
260
|
+
readonly model?: string | undefined;
|
|
261
|
+
readonly projectId: string;
|
|
262
|
+
readonly prompt: string;
|
|
263
|
+
};
|
|
264
|
+
readonly inputDigest: string;
|
|
265
|
+
readonly proof: string;
|
|
266
|
+
readonly actorId: string;
|
|
267
|
+
readonly expiresAt: string;
|
|
268
|
+
readonly issuedAt: string;
|
|
269
|
+
readonly method: "routine.create.preview";
|
|
270
|
+
readonly nextFires: readonly string[];
|
|
271
|
+
readonly routineId: string;
|
|
272
|
+
}>;
|
|
273
|
+
previewRoutineDisable: (input: {
|
|
274
|
+
readonly commandId: string;
|
|
275
|
+
readonly expectedRevision: string;
|
|
276
|
+
readonly routineId: string;
|
|
277
|
+
}) => import("../local-node/client.js").CliNodeEffect<{
|
|
278
|
+
readonly inputDigest: string;
|
|
279
|
+
readonly proof: string;
|
|
280
|
+
readonly actorId: string;
|
|
281
|
+
readonly expiresAt: string;
|
|
282
|
+
readonly issuedAt: string;
|
|
283
|
+
readonly commandId: string;
|
|
284
|
+
readonly expectedRevision: string;
|
|
285
|
+
readonly routineId: string;
|
|
286
|
+
readonly method: "routine.disable.preview";
|
|
287
|
+
readonly name: string;
|
|
288
|
+
}>;
|
|
289
|
+
previewRoutineRun: (input: {
|
|
290
|
+
readonly commandId: string;
|
|
291
|
+
readonly expectedRevision: string;
|
|
292
|
+
readonly routineId: string;
|
|
293
|
+
}) => import("../local-node/client.js").CliNodeEffect<{
|
|
294
|
+
readonly inputDigest: string;
|
|
295
|
+
readonly proof: string;
|
|
296
|
+
readonly actorId: string;
|
|
297
|
+
readonly expiresAt: string;
|
|
298
|
+
readonly issuedAt: string;
|
|
299
|
+
readonly commandId: string;
|
|
300
|
+
readonly expectedRevision: string;
|
|
301
|
+
readonly routineId: string;
|
|
302
|
+
readonly method: "routine.run.preview";
|
|
303
|
+
readonly name: string;
|
|
304
|
+
}>;
|
|
305
|
+
resumeRoutine: (input: {
|
|
306
|
+
readonly commandId: string;
|
|
307
|
+
readonly expectedRevision: string;
|
|
308
|
+
readonly routineId: string;
|
|
309
|
+
}) => import("../local-node/client.js").CliNodeEffect<{
|
|
310
|
+
readonly delivery: "duplicate" | "new";
|
|
311
|
+
readonly method: "routine.resume";
|
|
312
|
+
readonly receipt: {
|
|
313
|
+
readonly actorId: string;
|
|
314
|
+
readonly aggregateRevision: string;
|
|
315
|
+
readonly commandId: string;
|
|
316
|
+
readonly createdAt: string;
|
|
317
|
+
readonly eventCursor: string;
|
|
318
|
+
readonly method: string;
|
|
319
|
+
readonly receiptId: string;
|
|
320
|
+
readonly schemaVersion: 1;
|
|
321
|
+
readonly state: "succeeded";
|
|
322
|
+
readonly target: {
|
|
323
|
+
readonly id: string;
|
|
324
|
+
readonly type: string;
|
|
325
|
+
};
|
|
326
|
+
readonly updatedAt: string;
|
|
327
|
+
};
|
|
328
|
+
readonly routine: {
|
|
329
|
+
readonly confirmedBy: string;
|
|
330
|
+
readonly createdAt: string;
|
|
331
|
+
readonly id: string;
|
|
332
|
+
readonly name: string;
|
|
333
|
+
readonly nextFireAt?: string | undefined;
|
|
334
|
+
readonly revision: string;
|
|
335
|
+
readonly schedule: {
|
|
336
|
+
readonly expression: string;
|
|
337
|
+
readonly timezone: string;
|
|
338
|
+
};
|
|
339
|
+
readonly schemaVersion: "maia.routine/v1";
|
|
340
|
+
readonly state: "active" | "disabled" | "paused";
|
|
341
|
+
readonly template: {
|
|
342
|
+
readonly connectionId?: string | undefined;
|
|
343
|
+
readonly executor?: "claude-code" | "codex-cli" | undefined;
|
|
344
|
+
readonly model?: string | undefined;
|
|
345
|
+
readonly projectId: string;
|
|
346
|
+
readonly prompt: string;
|
|
347
|
+
};
|
|
348
|
+
readonly updatedAt: string;
|
|
349
|
+
};
|
|
350
|
+
}>;
|
|
351
|
+
showRoutine: (input: {
|
|
352
|
+
readonly routineId: string;
|
|
353
|
+
}) => import("../local-node/client.js").CliNodeEffect<{
|
|
354
|
+
readonly fires: readonly {
|
|
355
|
+
readonly failure?: {
|
|
356
|
+
readonly code: string;
|
|
357
|
+
readonly message: string;
|
|
358
|
+
} | undefined;
|
|
359
|
+
readonly failureReason?: "approval_required" | "output_limit_exceeded" | "protocol_invalid" | "repository_changed" | "runtime_exited" | "runtime_failed" | "turn_deadline_exceeded" | "turn_rejected" | undefined;
|
|
360
|
+
readonly id: string;
|
|
361
|
+
readonly missed?: number | undefined;
|
|
362
|
+
readonly outcome: "failed" | "launching" | "skipped" | "started";
|
|
363
|
+
readonly reason?: "connection_disabled" | "held" | "launch_failed" | "outcome_unknown" | "overlap" | "routine_not_active" | "saturated" | "workspace_unavailable" | undefined;
|
|
364
|
+
readonly recordedAt: string;
|
|
365
|
+
readonly routineId: string;
|
|
366
|
+
readonly scheduledAt: string;
|
|
367
|
+
readonly sessionId?: string | undefined;
|
|
368
|
+
readonly triggerKind: "cron" | "manual";
|
|
369
|
+
readonly turnId?: string | undefined;
|
|
370
|
+
readonly turnState?: "completed" | "dispatching" | "failed" | "interrupted" | "outcome-unknown" | "queued" | "running" | undefined;
|
|
371
|
+
}[];
|
|
372
|
+
readonly method: "routine.show";
|
|
373
|
+
readonly routine: {
|
|
374
|
+
readonly confirmedBy: string;
|
|
375
|
+
readonly createdAt: string;
|
|
376
|
+
readonly id: string;
|
|
377
|
+
readonly name: string;
|
|
378
|
+
readonly nextFireAt?: string | undefined;
|
|
379
|
+
readonly revision: string;
|
|
380
|
+
readonly schedule: {
|
|
381
|
+
readonly expression: string;
|
|
382
|
+
readonly timezone: string;
|
|
383
|
+
};
|
|
384
|
+
readonly schemaVersion: "maia.routine/v1";
|
|
385
|
+
readonly state: "active" | "disabled" | "paused";
|
|
386
|
+
readonly template: {
|
|
387
|
+
readonly connectionId?: string | undefined;
|
|
388
|
+
readonly executor?: "claude-code" | "codex-cli" | undefined;
|
|
389
|
+
readonly model?: string | undefined;
|
|
390
|
+
readonly projectId: string;
|
|
391
|
+
readonly prompt: string;
|
|
392
|
+
};
|
|
393
|
+
readonly updatedAt: string;
|
|
394
|
+
};
|
|
395
|
+
}>;
|
|
396
|
+
};
|
|
397
|
+
export type RoutineCliDependencies = ReturnType<typeof makeRoutineCliClient>;
|
|
398
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { routineCreateConfirmParametersSchema, routineCreatePreviewParametersSchema, routineDisableConfirmParametersSchema, routineDisablePreviewParametersSchema, routineListParametersSchema, routineRunConfirmParametersSchema, routineShowParametersSchema, routineTransitionParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
const read = (schema, pick) => (node) => (input) => node.runValidatedNodeOperation(input, schema, (client, parameters, options) => pick(client)(parameters, options));
|
|
3
|
+
const change = (schema, pick) => (node) => (input) => node.runValidatedNodeOperation(input, schema, (client, parameters, options) => pick(client)(parameters, options), { commandId: input.commandId });
|
|
4
|
+
const OPERATIONS = {
|
|
5
|
+
confirmRoutineCreate: change(routineCreateConfirmParametersSchema, (client) => client.confirmRoutineCreate),
|
|
6
|
+
confirmRoutineDisable: change(routineDisableConfirmParametersSchema, (client) => client.confirmRoutineDisable),
|
|
7
|
+
confirmRoutineRun: change(routineRunConfirmParametersSchema, (client) => client.confirmRoutineRun),
|
|
8
|
+
listRoutines: read(routineListParametersSchema, (client) => client.listRoutines),
|
|
9
|
+
pauseRoutine: change(routineTransitionParametersSchema, (client) => client.pauseRoutine),
|
|
10
|
+
previewRoutineCreate: read(routineCreatePreviewParametersSchema, (client) => client.previewRoutineCreate),
|
|
11
|
+
previewRoutineDisable: read(routineDisablePreviewParametersSchema, (client) => client.previewRoutineDisable),
|
|
12
|
+
previewRoutineRun: read(routineTransitionParametersSchema, (client) => client.previewRoutineRun),
|
|
13
|
+
resumeRoutine: change(routineTransitionParametersSchema, (client) => client.resumeRoutine),
|
|
14
|
+
showRoutine: read(routineShowParametersSchema, (client) => client.showRoutine),
|
|
15
|
+
};
|
|
16
|
+
export const makeRoutineCliClient = (node) => ({
|
|
17
|
+
confirmRoutineCreate: OPERATIONS.confirmRoutineCreate(node),
|
|
18
|
+
confirmRoutineDisable: OPERATIONS.confirmRoutineDisable(node),
|
|
19
|
+
confirmRoutineRun: OPERATIONS.confirmRoutineRun(node),
|
|
20
|
+
listRoutines: OPERATIONS.listRoutines(node),
|
|
21
|
+
pauseRoutine: OPERATIONS.pauseRoutine(node),
|
|
22
|
+
previewRoutineCreate: OPERATIONS.previewRoutineCreate(node),
|
|
23
|
+
previewRoutineDisable: OPERATIONS.previewRoutineDisable(node),
|
|
24
|
+
previewRoutineRun: OPERATIONS.previewRoutineRun(node),
|
|
25
|
+
resumeRoutine: OPERATIONS.resumeRoutine(node),
|
|
26
|
+
showRoutine: OPERATIONS.showRoutine(node),
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CommandContext, type CommandEffect } from "../command-line/index.js";
|
|
2
|
+
export declare const runRoutineList: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
3
|
+
export declare const runRoutineShow: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
4
|
+
export declare const runRoutinePause: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
5
|
+
export declare const runRoutineResume: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
6
|
+
export declare const runRoutineDisable: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
7
|
+
export declare const runRoutineRun: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
8
|
+
export declare const runRoutineCreate: (tokens: readonly string[], context: CommandContext) => CommandEffect;
|
|
9
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { routineCreateConfirmParametersSchema, routineCreatePreviewParametersSchema, routineDisableConfirmParametersSchema, routineRunConfirmParametersSchema, } from "@maiaos/sdk";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { listEach, onHolder, onInputHolder, writeMerged, } from "../address-space/index.js";
|
|
4
|
+
import { CliArgumentError, confirmParameters, parseOptions, readInputMode, readPipedPreview, readTwoPhaseMode, requirePositionals, runInputTwoPhase, runTwoPhase, TWO_PHASE_FLAGS, writeNodeResult, } from "../command-line/index.js";
|
|
5
|
+
import { mergeLists } from "../fleet/index.js";
|
|
6
|
+
import { readRoutineList, readRoutineShow, readRoutineTransition, readRoutineTransitionInput, ROUTINE_TRANSITION_OPTIONS, } from "./input.js";
|
|
7
|
+
import { formatRoutineList, formatRoutineResult, } from "./output/index.js";
|
|
8
|
+
const write = (result, context) => writeNodeResult(result, context, {
|
|
9
|
+
toResult: (value) => ({ command: value.method, result: value }),
|
|
10
|
+
toText: formatRoutineResult,
|
|
11
|
+
});
|
|
12
|
+
const run = (operation, input, context) => {
|
|
13
|
+
if (operation === undefined)
|
|
14
|
+
return Effect.die(new Error("Missing routine client."));
|
|
15
|
+
return input.pipe(Effect.flatMap(operation), Effect.map((result) => write(result, context)));
|
|
16
|
+
};
|
|
17
|
+
const missing = () => Effect.die(new Error("Missing routine client."));
|
|
18
|
+
export const runRoutineList = (tokens, context) => Effect.gen(function* () {
|
|
19
|
+
const input = readRoutineList(tokens);
|
|
20
|
+
if (input.projectId !== undefined)
|
|
21
|
+
return yield* run(context.dependencies.listRoutines, Effect.succeed(input), context);
|
|
22
|
+
return yield* listEach(context, {
|
|
23
|
+
merged: (answers) => writeMerged(context, {
|
|
24
|
+
command: "routine.list",
|
|
25
|
+
result: { ...mergeLists(answers), method: "routine.list" },
|
|
26
|
+
}, formatRoutineList),
|
|
27
|
+
paged: input.afterCursor !== undefined,
|
|
28
|
+
read: (dependencies) => dependencies.listRoutines?.(input) ?? missing(),
|
|
29
|
+
sole: (result) => write(result, context),
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
export const runRoutineShow = (tokens, context) => Effect.suspend(() => run(context.dependencies.showRoutine, Effect.succeed(readRoutineShow(tokens)), context));
|
|
33
|
+
export const runRoutinePause = (tokens, context) => Effect.suspend(() => run(context.dependencies.pauseRoutine, readRoutineTransition(tokens), context));
|
|
34
|
+
export const runRoutineResume = (tokens, context) => Effect.suspend(() => run(context.dependencies.resumeRoutine, readRoutineTransition(tokens), context));
|
|
35
|
+
const readPreviewed = (tokens, context) => {
|
|
36
|
+
const parsed = parseOptions(tokens, ROUTINE_TRANSITION_OPTIONS, new Set(TWO_PHASE_FLAGS));
|
|
37
|
+
const mode = readTwoPhaseMode(parsed.flags, context);
|
|
38
|
+
if (mode === "confirm-stdin")
|
|
39
|
+
requirePositionals(parsed.positionals, 0);
|
|
40
|
+
return { mode, parsed };
|
|
41
|
+
};
|
|
42
|
+
const confirmPiped = (context, change) => Effect.flatMap(Effect.flatMap(readPipedPreview(context), (value) => confirmParameters(change.schema, value, ["name"])), (confirmation) => onHolder(context, { id: confirmation.routineId, kind: "routine" }, (bound) => {
|
|
43
|
+
const { confirm } = change.phases(bound);
|
|
44
|
+
if (confirm === undefined)
|
|
45
|
+
return Effect.fail(new CliArgumentError(`Routine ${change.verb} is unavailable.`));
|
|
46
|
+
return Effect.map(confirm(confirmation), (result) => write(result, bound));
|
|
47
|
+
}));
|
|
48
|
+
const runPreviewed = (tokens, context, change) => Effect.gen(function* () {
|
|
49
|
+
const { mode, parsed } = readPreviewed(tokens, context);
|
|
50
|
+
if (mode === "confirm-stdin")
|
|
51
|
+
return yield* confirmPiped(context, change);
|
|
52
|
+
const { schema, verb } = change;
|
|
53
|
+
const { confirm, preview } = change.phases(context);
|
|
54
|
+
if (confirm === undefined || preview === undefined)
|
|
55
|
+
return yield* new CliArgumentError(`Routine ${verb} is unavailable.`);
|
|
56
|
+
return yield* runTwoPhase({
|
|
57
|
+
confirm: (value) => Effect.flatMap(confirmParameters(schema, value, ["name"]), confirm),
|
|
58
|
+
context,
|
|
59
|
+
mode,
|
|
60
|
+
preview: () => Effect.flatMap(readRoutineTransitionInput(parsed), preview),
|
|
61
|
+
prompt: change,
|
|
62
|
+
writeConfirm: (result) => write(result, context),
|
|
63
|
+
writePreview: (result) => write(result, context),
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
export const runRoutineDisable = (tokens, context) => runPreviewed(tokens, context, {
|
|
67
|
+
describe: (preview) => `Disable routine ${preview.routineId} "${preview.name}" at revision ${preview.expectedRevision}. It fires no more Sessions and cannot be resumed.\n`,
|
|
68
|
+
phases: ({ dependencies }) => ({
|
|
69
|
+
confirm: dependencies.confirmRoutineDisable,
|
|
70
|
+
preview: dependencies.previewRoutineDisable,
|
|
71
|
+
}),
|
|
72
|
+
question: "Disable this routine for good?",
|
|
73
|
+
schema: routineDisableConfirmParametersSchema,
|
|
74
|
+
verb: "disable",
|
|
75
|
+
});
|
|
76
|
+
export const runRoutineRun = (tokens, context) => runPreviewed(tokens, context, {
|
|
77
|
+
describe: (preview) => `Run routine ${preview.routineId} "${preview.name}" at revision ${preview.expectedRevision} now; it starts one Session.\n`,
|
|
78
|
+
phases: ({ dependencies }) => ({
|
|
79
|
+
confirm: dependencies.confirmRoutineRun,
|
|
80
|
+
preview: dependencies.previewRoutineRun,
|
|
81
|
+
}),
|
|
82
|
+
question: "Run this routine now?",
|
|
83
|
+
schema: routineRunConfirmParametersSchema,
|
|
84
|
+
verb: "run",
|
|
85
|
+
});
|
|
86
|
+
const ROUTINE_INPUT_ROUTE = {
|
|
87
|
+
idOf: (input) => {
|
|
88
|
+
const template = Reflect.get(input, "template");
|
|
89
|
+
return typeof template === "object" && template !== null
|
|
90
|
+
? Reflect.get(template, "projectId")
|
|
91
|
+
: undefined;
|
|
92
|
+
},
|
|
93
|
+
kind: "project",
|
|
94
|
+
};
|
|
95
|
+
export const runRoutineCreate = (tokens, context) => Effect.suspend(() => {
|
|
96
|
+
readInputMode(tokens);
|
|
97
|
+
return onInputHolder(context, ROUTINE_INPUT_ROUTE, (bound) => runInputTwoPhase({
|
|
98
|
+
confirm: bound.dependencies.confirmRoutineCreate,
|
|
99
|
+
confirmSchema: routineCreateConfirmParametersSchema,
|
|
100
|
+
context: bound,
|
|
101
|
+
label: "routine input",
|
|
102
|
+
preview: bound.dependencies.previewRoutineCreate,
|
|
103
|
+
previewOnly: ["nextFires", "routineId"],
|
|
104
|
+
previewSchema: routineCreatePreviewParametersSchema,
|
|
105
|
+
tokens,
|
|
106
|
+
write: (result) => write(result, bound),
|
|
107
|
+
}));
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { type ParsedOptions } from "../command-line/index.js";
|
|
3
|
+
export declare const readRoutineList: (tokens: readonly string[]) => {
|
|
4
|
+
state?: undefined;
|
|
5
|
+
limit: number;
|
|
6
|
+
afterCursor?: string | undefined;
|
|
7
|
+
projectId?: string | undefined;
|
|
8
|
+
} | {
|
|
9
|
+
state: "active" | "disabled" | "paused";
|
|
10
|
+
limit: number;
|
|
11
|
+
afterCursor?: string | undefined;
|
|
12
|
+
projectId?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export declare const readRoutineShow: (tokens: readonly string[]) => {
|
|
15
|
+
routineId: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const ROUTINE_TRANSITION_OPTIONS: ReadonlySet<string>;
|
|
18
|
+
export declare const readRoutineTransitionInput: (parsed: ParsedOptions) => Effect.Effect<{
|
|
19
|
+
commandId: string;
|
|
20
|
+
expectedRevision: string;
|
|
21
|
+
routineId: string;
|
|
22
|
+
}, never, import("effect/Crypto").Crypto>;
|
|
23
|
+
export declare const readRoutineTransition: (tokens: readonly string[]) => Effect.Effect<{
|
|
24
|
+
commandId: string;
|
|
25
|
+
expectedRevision: string;
|
|
26
|
+
routineId: string;
|
|
27
|
+
}, never, import("effect/Crypto").Crypto>;
|
|
28
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { CliArgumentError, parseOptions, readExpectedRevision, readPageSize, requirePositionals, } from "../command-line/index.js";
|
|
3
|
+
import { commandIdentifier } from "../local-node/index.js";
|
|
4
|
+
const STATES = ["active", "disabled", "paused"];
|
|
5
|
+
const readState = (value) => {
|
|
6
|
+
if (value === undefined)
|
|
7
|
+
return {};
|
|
8
|
+
const state = STATES.find((candidate) => candidate === value);
|
|
9
|
+
if (state === undefined)
|
|
10
|
+
throw new CliArgumentError("Option '--state' must be 'active', 'paused' or 'disabled'.");
|
|
11
|
+
return { state };
|
|
12
|
+
};
|
|
13
|
+
export const readRoutineList = (tokens) => {
|
|
14
|
+
const parsed = parseOptions(tokens, new Set(["--after", "--limit", "--project", "--state"]));
|
|
15
|
+
requirePositionals(parsed.positionals, 0);
|
|
16
|
+
const afterCursor = parsed.options.get("--after");
|
|
17
|
+
const projectId = parsed.options.get("--project");
|
|
18
|
+
return {
|
|
19
|
+
limit: readPageSize(parsed.options.get("--limit")),
|
|
20
|
+
...(afterCursor === undefined ? {} : { afterCursor }),
|
|
21
|
+
...(projectId === undefined ? {} : { projectId }),
|
|
22
|
+
...readState(parsed.options.get("--state")),
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export const readRoutineShow = (tokens) => {
|
|
26
|
+
const parsed = parseOptions(tokens, new Set());
|
|
27
|
+
requirePositionals(parsed.positionals, 1);
|
|
28
|
+
return { routineId: parsed.positionals[0] ?? "" };
|
|
29
|
+
};
|
|
30
|
+
export const ROUTINE_TRANSITION_OPTIONS = new Set([
|
|
31
|
+
"--command-id",
|
|
32
|
+
"--expected-revision",
|
|
33
|
+
]);
|
|
34
|
+
export const readRoutineTransitionInput = (parsed) => {
|
|
35
|
+
requirePositionals(parsed.positionals, 1);
|
|
36
|
+
const expectedRevision = readExpectedRevision(parsed.options.get("--expected-revision"));
|
|
37
|
+
return Effect.map(commandIdentifier(parsed.options.get("--command-id")), (commandId) => ({
|
|
38
|
+
commandId,
|
|
39
|
+
expectedRevision,
|
|
40
|
+
routineId: parsed.positionals[0] ?? "",
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
43
|
+
export const readRoutineTransition = (tokens) => readRoutineTransitionInput(parseOptions(tokens, ROUTINE_TRANSITION_OPTIONS));
|
|
44
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Routine, RoutineCreateConfirmResult, RoutineCreatePreviewResult, RoutineDisableConfirmResult, RoutineDisablePreviewResult, RoutineListResult, RoutinePauseResult, RoutineResumeResult, RoutineRunConfirmResult, RoutineRunPreviewResult, RoutineShowResult } from "@maiaos/sdk";
|
|
2
|
+
import type { ListedNode } from "../../fleet/index.js";
|
|
3
|
+
export type RoutineResult = RoutineCreateConfirmResult | RoutineCreatePreviewResult | RoutineDisableConfirmResult | RoutineDisablePreviewResult | RoutineListResult | RoutinePauseResult | RoutineResumeResult | RoutineRunConfirmResult | RoutineRunPreviewResult | RoutineShowResult;
|
|
4
|
+
export type CliRoutineResult = {
|
|
5
|
+
readonly command: RoutineResult["method"];
|
|
6
|
+
readonly result: RoutineResult;
|
|
7
|
+
};
|
|
8
|
+
export declare const isRoutineResult: (result: {
|
|
9
|
+
readonly command: string;
|
|
10
|
+
}) => result is CliRoutineResult;
|
|
11
|
+
export type CliRoutineList = {
|
|
12
|
+
readonly command: "routine.list";
|
|
13
|
+
readonly result: {
|
|
14
|
+
readonly items: readonly (Routine & {
|
|
15
|
+
readonly node: string;
|
|
16
|
+
})[];
|
|
17
|
+
readonly method: "routine.list";
|
|
18
|
+
readonly nodes: readonly ListedNode[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const formatRoutineList: ({ result }: CliRoutineList) => string;
|
|
22
|
+
export declare const formatRoutineResult: ({ result }: CliRoutineResult) => string;
|
|
23
|
+
//# sourceMappingURL=format.d.ts.map
|