runpane 2.4.215 → 2.4.216

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 (43) hide show
  1. package/README.md +16 -1
  2. package/dist/autopilot.d.ts +16 -0
  3. package/dist/autopilot.d.ts.map +1 -0
  4. package/dist/autopilot.js +376 -0
  5. package/dist/autopilot.js.map +1 -0
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +11 -3
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands.d.ts +25 -0
  10. package/dist/commands.d.ts.map +1 -1
  11. package/dist/commands.js +104 -3
  12. package/dist/commands.js.map +1 -1
  13. package/dist/daemonClient.d.ts.map +1 -1
  14. package/dist/daemonClient.js +25 -1
  15. package/dist/daemonClient.js.map +1 -1
  16. package/dist/docs-index.json +1 -1
  17. package/dist/generated/contract.d.ts +1494 -148
  18. package/dist/generated/contract.d.ts.map +1 -1
  19. package/dist/generated/contract.js +5840 -3618
  20. package/dist/generated/contract.js.map +1 -1
  21. package/dist/localControl.d.ts +22 -5
  22. package/dist/localControl.d.ts.map +1 -1
  23. package/dist/localControl.js +171 -32
  24. package/dist/localControl.js.map +1 -1
  25. package/dist/mcp.js +1 -1
  26. package/dist/mcp.js.map +1 -1
  27. package/dist/mcpTools.d.ts +5 -4
  28. package/dist/mcpTools.d.ts.map +1 -1
  29. package/dist/mcpTools.js +14 -2
  30. package/dist/mcpTools.js.map +1 -1
  31. package/dist/notify.d.ts +31 -3
  32. package/dist/notify.d.ts.map +1 -1
  33. package/dist/notify.js +64 -9
  34. package/dist/notify.js.map +1 -1
  35. package/dist/updateCapacity.d.ts +2 -2
  36. package/dist/updateCapacity.d.ts.map +1 -1
  37. package/dist/updateCapacity.js +4 -1
  38. package/dist/updateCapacity.js.map +1 -1
  39. package/dist/watchLines.d.ts +1 -0
  40. package/dist/watchLines.d.ts.map +1 -1
  41. package/dist/watchLines.js +5 -0
  42. package/dist/watchLines.js.map +1 -1
  43. package/package.json +1 -1
package/README.md CHANGED
@@ -282,7 +282,22 @@ example `--until-event --kinds
282
282
  agent.report,agent.report.missing,agent.blocked,panel.exited,pane.gone`.
283
283
  `runpane inbox [--session <id|name>]` lists the reports, missing reports, and
284
284
  on-screen questions a Session has not acknowledged (an orchestrator reads it
285
- when it starts or resumes), and `runpane inbox ack <id>...` clears them.
285
+ when it starts or resumes), plus the answers its workers got, and `runpane inbox
286
+ ack <id>...` clears them; `--decision <D-n>` records an answer's decision. An
287
+ orchestrator relays a worker's question into its card with `runpane notify
288
+ --relays <item> ...`.
289
+
290
+ Autopilot (experimental) reads `runpane autopilot status|waiting|stack` and adds
291
+ to its stack with `runpane autopilot stack push (--item <id>|--file <path>|--url
292
+ <url>|--session <id|name>) [--tab <path-or-url>]... [--next]`. It acts on waiting
293
+ items with `runpane autopilot answer <id> (--choice <label>|--approve|--deny|--text
294
+ <text>) --because <why>`, `runpane autopilot close <id> --reason <why>` and
295
+ `runpane autopilot rewrite <id> --ui <options|approve|ask> --title <text> ...`,
296
+ recorded "by Autopilot"; permission prompts stay the person's. It waits with
297
+ `runpane watch --as autopilot --kinds
298
+ item.created,item.answered,session.created,session.archived,orchestrator.turn_ended
299
+ --until-event --json`; like `agent.report.missing`, these kinds reach only
300
+ watchers that list them.
286
301
 
287
302
  To dispatch and get the result in one call, add `--wait`. It blocks on that
288
303
  panel and prints one line of JSON when the worker reports (exit 0), ends
@@ -0,0 +1,16 @@
1
+ import type { ParsedArgs } from './commands';
2
+ /** `runpane autopilot status`: the switch, the agent, the run, the stack and the walk. */
3
+ export declare function runAutopilotStatus(parsed: ParsedArgs): Promise<number>;
4
+ /** `runpane autopilot waiting`: what waits on the person, grouped by Session in the order Pane gives. */
5
+ export declare function runAutopilotWaiting(parsed: ParsedArgs): Promise<number>;
6
+ /** `runpane autopilot stack`: the entries in order; `>` marks the one on screen. */
7
+ export declare function runAutopilotStack(parsed: ParsedArgs): Promise<number>;
8
+ /** `runpane autopilot stack push`: one more entry; it never replaces the one on screen. */
9
+ export declare function runAutopilotStackPush(parsed: ParsedArgs, cwd?: string): Promise<number>;
10
+ /** `runpane autopilot answer`: delivered at once, and recorded "by Autopilot" on the item. */
11
+ export declare function runAutopilotAnswer(parsed: ParsedArgs): Promise<number>;
12
+ /** `runpane autopilot close`: its asker is told, and the person can reopen it. */
13
+ export declare function runAutopilotClose(parsed: ParsedArgs): Promise<number>;
14
+ /** `runpane autopilot rewrite`: closes the item and re-asks it; the answer goes to the original asker. */
15
+ export declare function runAutopilotRewrite(parsed: ParsedArgs, cwd?: string): Promise<number>;
16
+ //# sourceMappingURL=autopilot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autopilot.d.ts","sourceRoot":"","sources":["../src/autopilot.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAkR7C,0FAA0F;AAC1F,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAsB5E;AAED,yGAAyG;AACzG,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B7E;AAED,oFAAoF;AACpF,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB3E;AAqBD,2FAA2F;AAC3F,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAY5G;AA+ED,8FAA8F;AAC9F,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAM5E;AAED,kFAAkF;AAClF,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAM3E;AAED,0GAA0G;AAC1G,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAM1G"}
@@ -0,0 +1,376 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runAutopilotStatus = runAutopilotStatus;
7
+ exports.runAutopilotWaiting = runAutopilotWaiting;
8
+ exports.runAutopilotStack = runAutopilotStack;
9
+ exports.runAutopilotStackPush = runAutopilotStackPush;
10
+ exports.runAutopilotAnswer = runAutopilotAnswer;
11
+ exports.runAutopilotClose = runAutopilotClose;
12
+ exports.runAutopilotRewrite = runAutopilotRewrite;
13
+ const node_path_1 = __importDefault(require("node:path"));
14
+ const boundaryDecoder_1 = require("./boundaryDecoder");
15
+ const daemonClient_1 = require("./daemonClient");
16
+ const errors_1 = require("./errors");
17
+ const notify_1 = require("./notify");
18
+ const tabSchema = boundaryDecoder_1.boundary.union(boundaryDecoder_1.boundary.object({ kind: boundaryDecoder_1.boundary.literal('item'), label: boundaryDecoder_1.boundary.string, notifyId: boundaryDecoder_1.boundary.string }), boundaryDecoder_1.boundary.object({ kind: boundaryDecoder_1.boundary.literal('file'), label: boundaryDecoder_1.boundary.string, path: boundaryDecoder_1.boundary.string }), boundaryDecoder_1.boundary.object({ kind: boundaryDecoder_1.boundary.literal('url'), label: boundaryDecoder_1.boundary.string, url: boundaryDecoder_1.boundary.string }), boundaryDecoder_1.boundary.object({ kind: boundaryDecoder_1.boundary.literal('session'), label: boundaryDecoder_1.boundary.string, sessionId: boundaryDecoder_1.boundary.string }));
19
+ const refSchema = boundaryDecoder_1.boundary.union(boundaryDecoder_1.boundary.object({ kind: boundaryDecoder_1.boundary.literal('item'), notifyId: boundaryDecoder_1.boundary.string }), boundaryDecoder_1.boundary.object({ kind: boundaryDecoder_1.boundary.literal('file'), path: boundaryDecoder_1.boundary.string }), boundaryDecoder_1.boundary.object({ kind: boundaryDecoder_1.boundary.literal('url'), url: boundaryDecoder_1.boundary.string }), boundaryDecoder_1.boundary.object({ kind: boundaryDecoder_1.boundary.literal('session'), sessionId: boundaryDecoder_1.boundary.string }));
20
+ const entrySchema = boundaryDecoder_1.boundary.object({
21
+ id: boundaryDecoder_1.boundary.string,
22
+ ref: refSchema,
23
+ title: boundaryDecoder_1.boundary.string,
24
+ sessionId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
25
+ sessionName: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
26
+ tabs: boundaryDecoder_1.boundary.array(tabSchema),
27
+ note: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
28
+ addedAt: boundaryDecoder_1.boundary.number,
29
+ byAutopilot: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.boolean),
30
+ doneAt: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.number),
31
+ });
32
+ const stackFields = {
33
+ entries: boundaryDecoder_1.boundary.array(entrySchema),
34
+ shownId: boundaryDecoder_1.boundary.nullable(boundaryDecoder_1.boundary.string),
35
+ };
36
+ const stackSchema = boundaryDecoder_1.boundary.object(stackFields);
37
+ const stackResultSchema = boundaryDecoder_1.boundary.object({ ok: boundaryDecoder_1.boundary.literal(true), ...stackFields });
38
+ const snapshotResultSchema = boundaryDecoder_1.boundary.object({
39
+ ok: boundaryDecoder_1.boundary.literal(true),
40
+ enabled: boundaryDecoder_1.boundary.boolean,
41
+ chatTabsEnabled: boundaryDecoder_1.boundary.boolean,
42
+ entitlement: boundaryDecoder_1.boundary.object({
43
+ entitled: boundaryDecoder_1.boundary.boolean,
44
+ reason: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
45
+ next: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
46
+ }),
47
+ run: boundaryDecoder_1.boundary.nullable(boundaryDecoder_1.boundary.object({
48
+ id: boundaryDecoder_1.boundary.string,
49
+ folder: boundaryDecoder_1.boundary.string,
50
+ docsFolder: boundaryDecoder_1.boundary.string,
51
+ createdAt: boundaryDecoder_1.boundary.string,
52
+ })),
53
+ panelId: boundaryDecoder_1.boundary.nullable(boundaryDecoder_1.boundary.string),
54
+ ownerPaneId: boundaryDecoder_1.boundary.nullable(boundaryDecoder_1.boundary.string),
55
+ state: boundaryDecoder_1.boundary.enumeration('stopped', 'running', 'paused'),
56
+ sentinel: boundaryDecoder_1.boundary.boolean,
57
+ sentinelSince: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.number),
58
+ stack: stackSchema,
59
+ walk: boundaryDecoder_1.boundary.object({
60
+ sessionId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
61
+ sessions: boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.object({ id: boundaryDecoder_1.boundary.string, name: boundaryDecoder_1.boundary.string, waiting: boundaryDecoder_1.boundary.number })),
62
+ }),
63
+ });
64
+ const waitingItemSchema = boundaryDecoder_1.boundary.object({
65
+ id: boundaryDecoder_1.boundary.string,
66
+ title: boundaryDecoder_1.boundary.string,
67
+ // An older Pane marks a worker's question "stuck"; here it reads as the question it is.
68
+ kind: boundaryDecoder_1.boundary.enumeration('approval', 'question', 'permission', 'stuck'),
69
+ sessionId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
70
+ sessionName: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
71
+ agent: boundaryDecoder_1.boundary.string,
72
+ pane: boundaryDecoder_1.boundary.string,
73
+ paneId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
74
+ panelId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
75
+ orchestrator: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.boolean),
76
+ byAutopilot: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.boolean),
77
+ context: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
78
+ choices: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.string)),
79
+ links: boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.object({
80
+ label: boundaryDecoder_1.boundary.string,
81
+ path: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
82
+ url: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
83
+ })),
84
+ createdAt: boundaryDecoder_1.boundary.number,
85
+ ageMs: boundaryDecoder_1.boundary.number,
86
+ machine: boundaryDecoder_1.boundary.string,
87
+ machineId: boundaryDecoder_1.boundary.string,
88
+ onStack: boundaryDecoder_1.boundary.boolean,
89
+ quiet: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.boolean),
90
+ stale: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.boolean),
91
+ reopened: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.object({
92
+ by: boundaryDecoder_1.boundary.enumeration('you', 'autopilot', 'orchestrator', 'pane'),
93
+ device: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
94
+ at: boundaryDecoder_1.boundary.number,
95
+ closedBy: boundaryDecoder_1.boundary.enumeration('you', 'autopilot', 'orchestrator', 'pane'),
96
+ closedReason: boundaryDecoder_1.boundary.string,
97
+ })),
98
+ connected: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.object({
99
+ kind: boundaryDecoder_1.boundary.enumeration('session', 'pane', 'autopilot', 'machine'),
100
+ id: boundaryDecoder_1.boundary.string,
101
+ name: boundaryDecoder_1.boundary.string,
102
+ paneId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
103
+ })),
104
+ });
105
+ const waitingResultSchema = boundaryDecoder_1.boundary.object({
106
+ ok: boundaryDecoder_1.boundary.literal(true),
107
+ items: boundaryDecoder_1.boundary.array(waitingItemSchema),
108
+ offline: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.string)),
109
+ cantSee: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.string)),
110
+ });
111
+ const actionResultSchema = boundaryDecoder_1.boundary.object({
112
+ ok: boundaryDecoder_1.boundary.literal(true),
113
+ id: boundaryDecoder_1.boundary.string,
114
+ machine: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
115
+ });
116
+ const pushResultSchema = boundaryDecoder_1.boundary.object({
117
+ ok: boundaryDecoder_1.boundary.literal(true),
118
+ entry: boundaryDecoder_1.boundary.nullable(entrySchema),
119
+ shown: boundaryDecoder_1.boundary.boolean,
120
+ position: boundaryDecoder_1.boundary.number,
121
+ total: boundaryDecoder_1.boundary.number,
122
+ });
123
+ const URL_TAB = /^https?:\/\//i;
124
+ function printJson(value) {
125
+ console.log(JSON.stringify(value, null, 2));
126
+ }
127
+ function plural(count, one, many) {
128
+ return `${count} ${count === 1 ? one : many}`;
129
+ }
130
+ /** `45s`, `12m`, `3h`, `2d`: how long an item has waited. */
131
+ function formatAge(ageMs) {
132
+ const seconds = Math.max(0, Math.floor(ageMs / 1000));
133
+ if (seconds < 60)
134
+ return `${seconds}s`;
135
+ const minutes = Math.floor(seconds / 60);
136
+ if (minutes < 60)
137
+ return `${minutes}m`;
138
+ const hours = Math.floor(minutes / 60);
139
+ if (hours < 24)
140
+ return `${hours}h`;
141
+ return `${Math.floor(hours / 24)}d`;
142
+ }
143
+ /** `runpane autopilot status`: the switch, the agent, the run, the stack and the walk. */
144
+ async function runAutopilotStatus(parsed) {
145
+ const result = await (0, daemonClient_1.invokeDaemon)('runpane:autopilot:status', [], snapshotResultSchema, { paneDir: parsed.paneDir });
146
+ if (parsed.json) {
147
+ printJson(result);
148
+ return 0;
149
+ }
150
+ console.log(result.enabled ? `Autopilot is on and ${result.state}.` : 'Autopilot is off. Turn it on in Settings > Advanced > Experimental > Autopilot.');
151
+ if (result.enabled && result.sentinel)
152
+ console.log('Sentinel is on: Autopilot keeps your Sessions moving while you are away.');
153
+ if (!result.entitlement.entitled) {
154
+ const reason = result.entitlement.reason ?? 'This account cannot use Autopilot.';
155
+ console.log(`Not available: ${reason}${result.entitlement.next ? ` Next: ${result.entitlement.next}` : ''}`);
156
+ }
157
+ if (result.enabled && !result.chatTabsEnabled)
158
+ console.log('Chat tabs are off; Autopilot runs as a chat tab, so it needs them on.');
159
+ if (result.run)
160
+ console.log(`Run ${result.run.id}: ${result.run.folder}`);
161
+ if (result.panelId)
162
+ console.log(`Chat tab: panel ${result.panelId}${result.ownerPaneId ? ` in pane ${result.ownerPaneId}` : ''}`);
163
+ const shown = result.stack.entries.find(entry => entry.id === result.stack.shownId);
164
+ console.log(`Stack: ${plural(result.stack.entries.length, 'entry', 'entries')}${shown ? `; showing "${shown.title}"` : ''}.`);
165
+ const walking = result.walk.sessions.find(session => session.id === result.walk.sessionId);
166
+ const waiting = result.walk.sessions.reduce((sum, session) => sum + session.waiting, 0);
167
+ const sessionsWaiting = result.walk.sessions.filter(session => session.waiting > 0).length;
168
+ console.log(`Waiting: ${plural(waiting, 'item', 'items')} in ${plural(sessionsWaiting, 'Session', 'Sessions')}${walking ? `; the walk is on ${walking.name}` : ''}.`);
169
+ return 0;
170
+ }
171
+ /** `runpane autopilot waiting`: what waits on the person, grouped by Session in the order Pane gives. */
172
+ async function runAutopilotWaiting(parsed) {
173
+ const decoded = await (0, daemonClient_1.invokeDaemon)('runpane:autopilot:waiting', [], waitingResultSchema, { paneDir: parsed.paneDir });
174
+ const result = {
175
+ ...decoded,
176
+ items: decoded.items.map(item => ({ ...item, kind: item.kind === 'stuck' ? 'question' : item.kind })),
177
+ };
178
+ if (parsed.json) {
179
+ printJson(result);
180
+ return 0;
181
+ }
182
+ if (result.items.length === 0)
183
+ console.log('Nothing is waiting on the person.');
184
+ let group;
185
+ for (const item of result.items) {
186
+ const key = item.sessionId ?? '';
187
+ if (key !== group) {
188
+ group = key;
189
+ console.log(item.sessionId ? `${item.sessionName ?? item.sessionId} (${item.sessionId})` : 'Not in a Session');
190
+ }
191
+ const marks = [
192
+ item.machineId === 'local' ? '' : ` on ${item.machine}`,
193
+ item.onStack ? ' on the stack' : '',
194
+ item.stale ? ' stale' : '',
195
+ item.quiet ? ' quiet' : '',
196
+ item.reopened ? ' reopened by you' : '',
197
+ ].join('');
198
+ console.log(` ${item.id} ${item.kind} ${item.title} ${item.agent} - ${item.pane} ${formatAge(item.ageMs)}${marks}`);
199
+ }
200
+ for (const machine of result.offline ?? [])
201
+ console.log(`${machine} offline`);
202
+ for (const machine of result.cantSee ?? [])
203
+ console.log(`Can't see: ${machine}`);
204
+ return 0;
205
+ }
206
+ /** `runpane autopilot stack`: the entries in order; `>` marks the one on screen. */
207
+ async function runAutopilotStack(parsed) {
208
+ const result = await (0, daemonClient_1.invokeDaemon)('runpane:autopilot:stack', [], stackResultSchema, { paneDir: parsed.paneDir });
209
+ if (parsed.json) {
210
+ printJson(result);
211
+ return 0;
212
+ }
213
+ if (result.entries.length === 0) {
214
+ console.log('The stack is empty.');
215
+ return 0;
216
+ }
217
+ console.log(`Stack: ${plural(result.entries.length, 'entry', 'entries')}.`);
218
+ result.entries.forEach((entry, index) => {
219
+ const shown = entry.id === result.shownId;
220
+ const session = entry.sessionName ? ` - ${entry.sessionName}` : '';
221
+ console.log(`${shown ? '>' : ' '} ${index + 1}. ${entry.id} ${entry.ref.kind}: ${entry.title}${session}${entry.doneAt !== undefined ? ' (done)' : ''}${shown ? ' (shown)' : ''}`);
222
+ });
223
+ return 0;
224
+ }
225
+ /**
226
+ * Builds the `runpane:autopilot:stack-push` request. Files (the entry's and its tabs') resolve
227
+ * against `cwd`, so Pane gets absolute paths; a tab that starts with http:// or https:// is a URL.
228
+ */
229
+ function buildStackPushRequest(parsed, cwd) {
230
+ const request = {};
231
+ if (parsed.item !== undefined)
232
+ request.item = parsed.item;
233
+ if (parsed.file !== undefined)
234
+ request.file = node_path_1.default.resolve(cwd, parsed.file);
235
+ if (parsed.url !== undefined)
236
+ request.url = parsed.url;
237
+ if (parsed.sessionId !== undefined)
238
+ request.session = parsed.sessionId;
239
+ if (parsed.title !== undefined)
240
+ request.title = parsed.title;
241
+ if (parsed.note !== undefined)
242
+ request.note = parsed.note;
243
+ if (parsed.stackTabs?.length) {
244
+ request.tabs = parsed.stackTabs.map(tab => (URL_TAB.test(tab) ? { url: tab } : { path: node_path_1.default.resolve(cwd, tab) }));
245
+ }
246
+ if (parsed.stackNext)
247
+ request.next = true;
248
+ return request;
249
+ }
250
+ /** `runpane autopilot stack push`: one more entry; it never replaces the one on screen. */
251
+ async function runAutopilotStackPush(parsed, cwd = process.cwd()) {
252
+ const request = buildStackPushRequest(parsed, cwd);
253
+ const result = await (0, daemonClient_1.invokeDaemon)('runpane:autopilot:stack-push', [request], pushResultSchema, { paneDir: parsed.paneDir });
254
+ if (parsed.json) {
255
+ printJson(result);
256
+ return 0;
257
+ }
258
+ const title = result.entry ? `"${result.entry.title}"` : 'it';
259
+ console.log(result.shown
260
+ ? `On the stack and on screen: ${title} (${result.position} of ${result.total}).`
261
+ : `On the stack: ${title} (${result.position} of ${result.total}); it comes up when the person is done with the one on screen.`);
262
+ return 0;
263
+ }
264
+ function invalidAction(message, next) {
265
+ return new errors_1.RunpaneError('ERR_AUTOPILOT_INVALID', `${message} Nothing was changed.`, next);
266
+ }
267
+ /** The `<id>` every action takes, from `runpane autopilot waiting`. */
268
+ function requireItem(parsed, verb) {
269
+ if (!parsed.item?.trim())
270
+ throw invalidAction(`runpane autopilot ${verb} needs a waiting item's id.`, 'List what waits with runpane autopilot waiting --json and pass an id from it.');
271
+ return parsed.item;
272
+ }
273
+ function buildAnswerRequest(parsed) {
274
+ const id = requireItem(parsed, 'answer');
275
+ const ways = [parsed.answerChoice !== undefined, parsed.answerApprove === true, parsed.answerDeny === true, parsed.panelInput !== undefined].filter(Boolean).length;
276
+ if (ways !== 1)
277
+ throw invalidAction('runpane autopilot answer needs exactly one of --choice <label>, --approve, --deny, or --text <text>.', 'Pass one way of answering.');
278
+ if (!parsed.because?.trim())
279
+ throw invalidAction('runpane autopilot answer needs --because <why>: a D-n, a document or the person\'s words, recorded on the item.', 'Say why with --because. If you have no reason to give, bring the item to the person instead.');
280
+ const because = parsed.because;
281
+ if (parsed.panelInput !== undefined) {
282
+ if (parsed.note !== undefined)
283
+ throw invalidAction('--note goes with --choice, --approve or --deny.', 'Put the note in --text.');
284
+ if (!parsed.panelInput.trim())
285
+ throw invalidAction('--text must be non-empty.', 'Pass the answer in --text.');
286
+ return { id, answer: { text: parsed.panelInput }, because };
287
+ }
288
+ if (parsed.answerChoice !== undefined) {
289
+ if (!parsed.answerChoice.trim())
290
+ throw invalidAction('--choice must be one of the item\'s labels.', 'Read its choices with runpane autopilot waiting --json.');
291
+ const answer = parsed.note === undefined ? { choice: parsed.answerChoice } : { choice: parsed.answerChoice, note: parsed.note };
292
+ return { id, answer, because };
293
+ }
294
+ const approved = parsed.answerApprove === true;
295
+ const answer = parsed.note === undefined ? { approved } : { approved, note: parsed.note };
296
+ return { id, answer, because };
297
+ }
298
+ function buildCloseRequest(parsed) {
299
+ const id = requireItem(parsed, 'close');
300
+ if (!parsed.reason?.trim())
301
+ throw invalidAction('runpane autopilot close needs --reason <why>, recorded on the item and told to its asker.', 'Say why with --reason.');
302
+ return { id, reason: parsed.reason };
303
+ }
304
+ /** Links' files resolve against `cwd`, so Pane gets absolute paths, as `stack push` does. */
305
+ function buildRewriteRequest(parsed, cwd) {
306
+ const id = requireItem(parsed, 'rewrite');
307
+ if (parsed.notifyDetail !== undefined || parsed.notifyDetailLabel !== undefined || parsed.notifyAction !== undefined) {
308
+ throw invalidAction('runpane autopilot rewrite takes --context, --choices, --suggestions and --links, not --detail, --detail-label or --action.', 'Put what the person needs to read in --context.');
309
+ }
310
+ if (parsed.notifyUi === 'info')
311
+ throw invalidAction('A rewrite must take an answer, so --ui info doesn\'t fit.', 'Use --ui options, approve, or ask.');
312
+ let question;
313
+ try {
314
+ question = (0, notify_1.parseNotifyQuestion)({
315
+ ui: parsed.notifyUi,
316
+ title: parsed.title,
317
+ context: parsed.notifyContext,
318
+ choices: parsed.notifyChoices,
319
+ suggestions: parsed.notifySuggestions,
320
+ links: parsed.notifyLinks,
321
+ });
322
+ }
323
+ catch (error) {
324
+ if (!(error instanceof errors_1.RunpaneError))
325
+ throw error;
326
+ throw new errors_1.RunpaneError('ERR_AUTOPILOT_INVALID', error.message, 'Fix it and run runpane autopilot rewrite again.');
327
+ }
328
+ const request = { id, ...question };
329
+ if (question.links)
330
+ request.links = question.links.map(link => ('path' in link ? { ...link, path: node_path_1.default.resolve(cwd, link.path) } : link));
331
+ return request;
332
+ }
333
+ /** Answer, close and rewrite: an older Pane has no such channel. */
334
+ async function act(parsed, verb, request) {
335
+ try {
336
+ return await (0, daemonClient_1.invokeDaemon)(`runpane:autopilot:${verb}`, [request], actionResultSchema, { paneDir: parsed.paneDir });
337
+ }
338
+ catch (error) {
339
+ if (error instanceof daemonClient_1.PaneDaemonClientError && error.code === 'ERR_UNKNOWN_CHANNEL') {
340
+ throw new errors_1.RunpaneError('ERR_AUTOPILOT_PANE_TOO_OLD', `This Pane can't run runpane autopilot ${verb} yet. Nothing was changed.`, 'Update Pane, or bring the item to the person.');
341
+ }
342
+ throw error;
343
+ }
344
+ }
345
+ const onMachine = (result) => (result.machine ? ` on ${result.machine}` : '');
346
+ /** `runpane autopilot answer`: delivered at once, and recorded "by Autopilot" on the item. */
347
+ async function runAutopilotAnswer(parsed) {
348
+ const request = buildAnswerRequest(parsed);
349
+ const result = await act(parsed, 'answer', request);
350
+ if (parsed.json)
351
+ printJson(result);
352
+ else
353
+ console.log(`Answered ${result.id}${onMachine(result)}, recorded by Autopilot because ${request.because}. The person can Override it.`);
354
+ return 0;
355
+ }
356
+ /** `runpane autopilot close`: its asker is told, and the person can reopen it. */
357
+ async function runAutopilotClose(parsed) {
358
+ const request = buildCloseRequest(parsed);
359
+ const result = await act(parsed, 'close', request);
360
+ if (parsed.json)
361
+ printJson(result);
362
+ else
363
+ console.log(`Closed ${result.id}${onMachine(result)}: ${request.reason}. The person can reopen it.`);
364
+ return 0;
365
+ }
366
+ /** `runpane autopilot rewrite`: closes the item and re-asks it; the answer goes to the original asker. */
367
+ async function runAutopilotRewrite(parsed, cwd = process.cwd()) {
368
+ const request = buildRewriteRequest(parsed, cwd);
369
+ const result = await act(parsed, 'rewrite', request);
370
+ if (parsed.json)
371
+ printJson(result);
372
+ else
373
+ console.log(`Rewrote ${request.id} as ${result.id}${onMachine(result)}. Its answer goes to the original asker.`);
374
+ return 0;
375
+ }
376
+ //# sourceMappingURL=autopilot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autopilot.js","sourceRoot":"","sources":["../src/autopilot.ts"],"names":[],"mappings":";;;;;AAqRA,gDAsBC;AAGD,kDA8BC;AAGD,8CAiBC;AAsBD,sDAYC;AAgFD,gDAMC;AAGD,8CAMC;AAGD,kDAMC;AA1eD,0DAA6B;AAC7B,uDAAkE;AAElE,iDAAqE;AACrE,qCAAwC;AACxC,qCAAoE;AAsIpE,MAAM,SAAS,GAAiC,0BAAQ,CAAC,KAAK,CAC5D,0BAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,0BAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,0BAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,0BAAQ,CAAC,MAAM,EAAE,CAAC,EACtG,0BAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,0BAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,0BAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,0BAAQ,CAAC,MAAM,EAAE,CAAC,EAClG,0BAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,0BAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,0BAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,0BAAQ,CAAC,MAAM,EAAE,CAAC,EAChG,0BAAQ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AI,MAAM,CAAC,IAAI;QAAE,SAAS,CAAC,MAAM,CAAC,CAAC;;QAC9B,OAAO,CAAC,GAAG,CAAC,WAAW,OAAO,CAAC,EAAE,OAAO,MAAM,CAAC,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,0CAA0C,CAAC,CAAC;IACtH,OAAO,CAAC,CAAC;AACX,CAAC"}
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAeA,OAAO,EAA0E,KAAK,UAAU,EAAuB,MAAM,YAAY,CAAC;AAoE1I,OAAO,EAOL,KAAK,uBAAuB,EAC7B,MAAM,aAAa,CAAC;AAmBrB,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAsC1D;AA2dD,wBAAsB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,gBAAgB,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsHrH"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAgBA,OAAO,EAA0E,KAAK,UAAU,EAAuB,MAAM,YAAY,CAAC;AAoE1I,OAAO,EAOL,KAAK,uBAAuB,EAC7B,MAAM,aAAa,CAAC;AAmBrB,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAsC1D;AAkeD,wBAAsB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,gBAAgB,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsHrH"}
package/dist/cli.js CHANGED
@@ -50,6 +50,7 @@ const handoff_1 = require("./handoff");
50
50
  const links_1 = require("./links");
51
51
  const notify_1 = require("./notify");
52
52
  const secrets_1 = require("./secrets");
53
+ const autopilot_1 = require("./autopilot");
53
54
  const commands_1 = require("./commands");
54
55
  const daemonClient_1 = require("./daemonClient");
55
56
  const errors_1 = require("./errors");
@@ -306,6 +307,9 @@ const commandHandlers = new Map(Object.entries({
306
307
  'panels open': async (parsed, telemetryContext) => {
307
308
  return (0, localControl_1.runPanelsOpen)(parsed);
308
309
  },
310
+ 'panels close': async (parsed, telemetryContext) => {
311
+ return (0, localControl_1.runPanelsClose)(parsed);
312
+ },
309
313
  'panels output': async (parsed, telemetryContext) => {
310
314
  return (0, localControl_1.runPanelsOutput)(parsed);
311
315
  },
@@ -321,9 +325,6 @@ const commandHandlers = new Map(Object.entries({
321
325
  'panels submit-composer': async (parsed, telemetryContext) => {
322
326
  return (0, localControl_1.runPanelsSubmitComposer)(parsed);
323
327
  },
324
- 'panels close': async (parsed, telemetryContext) => {
325
- return (0, localControl_1.runPanelsClose)(parsed);
326
- },
327
328
  'panels wait': async (parsed, telemetryContext) => {
328
329
  return (0, localControl_1.runPanelsWait)(parsed);
329
330
  },
@@ -340,6 +341,13 @@ const commandHandlers = new Map(Object.entries({
340
341
  'notify': async (parsed) => (0, notify_1.runNotify)(parsed),
341
342
  'inbox': async (parsed) => (0, localControl_1.runInbox)(parsed),
342
343
  'inbox ack': async (parsed) => (0, localControl_1.runInboxAck)(parsed),
344
+ 'autopilot status': async (parsed) => (0, autopilot_1.runAutopilotStatus)(parsed),
345
+ 'autopilot waiting': async (parsed) => (0, autopilot_1.runAutopilotWaiting)(parsed),
346
+ 'autopilot stack': async (parsed) => (0, autopilot_1.runAutopilotStack)(parsed),
347
+ 'autopilot stack push': async (parsed) => (0, autopilot_1.runAutopilotStackPush)(parsed),
348
+ 'autopilot answer': async (parsed) => (0, autopilot_1.runAutopilotAnswer)(parsed),
349
+ 'autopilot close': async (parsed) => (0, autopilot_1.runAutopilotClose)(parsed),
350
+ 'autopilot rewrite': async (parsed) => (0, autopilot_1.runAutopilotRewrite)(parsed),
343
351
  'agents doctor': async (parsed, telemetryContext) => {
344
352
  return (0, localControl_1.runAgentsDoctor)(parsed);
345
353
  },