runpane 2.4.213 → 2.4.215
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 +14 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +22 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands.d.ts +17 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +66 -5
- package/dist/commands.js.map +1 -1
- package/dist/docs-index.json +1 -1
- package/dist/generated/contract.d.ts +1609 -235
- package/dist/generated/contract.d.ts.map +1 -1
- package/dist/generated/contract.js +2798 -301
- package/dist/generated/contract.js.map +1 -1
- package/dist/localControl.d.ts +37 -3
- package/dist/localControl.d.ts.map +1 -1
- package/dist/localControl.js +304 -7
- package/dist/localControl.js.map +1 -1
- package/dist/notify.d.ts +71 -0
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +19 -10
- package/dist/notify.js.map +1 -1
- package/dist/secrets.d.ts +12 -0
- package/dist/secrets.d.ts.map +1 -0
- package/dist/secrets.js +296 -0
- package/dist/secrets.js.map +1 -0
- package/dist/sessionPayload.d.ts +2 -2
- package/dist/sessionPayload.js +1 -1
- package/dist/sessionPayload.js.map +1 -1
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +13 -0
- package/dist/telemetry.js.map +1 -1
- package/dist/watchLines.d.ts.map +1 -1
- package/dist/watchLines.js +2 -0
- package/dist/watchLines.js.map +1 -1
- package/package.json +1 -1
package/dist/localControl.js
CHANGED
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.workspaceStateResultSchema = exports.panelSubmitResultSchema = exports.panelScreenResultSchema = exports.panelCreateResultSchema = exports.panelListResultSchema = exports.paneCreateResultSchema = exports.runpaneSessionResultSchema = exports.runpaneSessionListResultSchema = exports.paneListResultSchema = exports.repoListResultSchema = void 0;
|
|
7
7
|
exports.runReposList = runReposList;
|
|
8
8
|
exports.runReposAdd = runReposAdd;
|
|
9
|
+
exports.runReposGet = runReposGet;
|
|
10
|
+
exports.runReposUpdate = runReposUpdate;
|
|
9
11
|
exports.runReposRename = runReposRename;
|
|
10
12
|
exports.runPanesList = runPanesList;
|
|
11
13
|
exports.runSessionsList = runSessionsList;
|
|
@@ -49,8 +51,10 @@ exports.runPanelsSubmit = runPanelsSubmit;
|
|
|
49
51
|
exports.markSuggestionLine = markSuggestionLine;
|
|
50
52
|
exports.printPromptNotes = printPromptNotes;
|
|
51
53
|
exports.runPanelsSubmitComposer = runPanelsSubmitComposer;
|
|
54
|
+
exports.runPanelsClose = runPanelsClose;
|
|
52
55
|
exports.runPanelsWait = runPanelsWait;
|
|
53
56
|
exports.runPanelsResume = runPanelsResume;
|
|
57
|
+
exports.runPause = runPause;
|
|
54
58
|
exports.runAgentsDoctor = runAgentsDoctor;
|
|
55
59
|
exports.buildPanelInputRequest = buildPanelInputRequest;
|
|
56
60
|
exports.buildPanelCreateRequest = buildPanelCreateRequest;
|
|
@@ -69,7 +73,7 @@ const commands_1 = require("./commands");
|
|
|
69
73
|
const sessionPayload_1 = require("./sessionPayload");
|
|
70
74
|
const watchLines_1 = require("./watchLines");
|
|
71
75
|
const agentSchema = boundaryDecoder_1.boundary.enumeration(...contract_1.RUNPANE_CONTRACT.enums.agents);
|
|
72
|
-
const orchestrationAgentSchema = boundaryDecoder_1.boundary.enumeration('claude', 'codex', 'cursor');
|
|
76
|
+
const orchestrationAgentSchema = boundaryDecoder_1.boundary.enumeration('claude', 'codex', 'cursor', 'opencode');
|
|
73
77
|
const repoSummarySchema = boundaryDecoder_1.boundary.object({
|
|
74
78
|
id: boundaryDecoder_1.boundary.number,
|
|
75
79
|
name: boundaryDecoder_1.boundary.string,
|
|
@@ -85,6 +89,29 @@ const repoAddPreviewSchema = boundaryDecoder_1.boundary.object({
|
|
|
85
89
|
wouldCreate: boundaryDecoder_1.boundary.boolean,
|
|
86
90
|
environment: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
87
91
|
});
|
|
92
|
+
const pausedMarkSchema = boundaryDecoder_1.boundary.object({
|
|
93
|
+
at: boundaryDecoder_1.boundary.string,
|
|
94
|
+
by: boundaryDecoder_1.boundary.enumeration('manual', 'auto'),
|
|
95
|
+
idleHours: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.number),
|
|
96
|
+
runScript: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.boolean),
|
|
97
|
+
});
|
|
98
|
+
const pauseResultSchema = boundaryDecoder_1.boundary.object({
|
|
99
|
+
ok: boundaryDecoder_1.boundary.boolean,
|
|
100
|
+
action: boundaryDecoder_1.boundary.enumeration('paused', 'resumed'),
|
|
101
|
+
scope: boundaryDecoder_1.boundary.object({
|
|
102
|
+
kind: boundaryDecoder_1.boundary.enumeration('panel', 'pane', 'session'),
|
|
103
|
+
panelId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
104
|
+
paneId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
105
|
+
paneName: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
106
|
+
sessionId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
107
|
+
sessionName: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
108
|
+
}),
|
|
109
|
+
panelIds: boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.string),
|
|
110
|
+
unchanged: boundaryDecoder_1.boundary.number,
|
|
111
|
+
failed: boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.object({ panelId: boundaryDecoder_1.boundary.string, error: boundaryDecoder_1.boundary.string })),
|
|
112
|
+
message: boundaryDecoder_1.boundary.string,
|
|
113
|
+
nextCommand: boundaryDecoder_1.boundary.string,
|
|
114
|
+
});
|
|
88
115
|
const paneSummarySchema = boundaryDecoder_1.boundary.object({
|
|
89
116
|
id: boundaryDecoder_1.boundary.string,
|
|
90
117
|
paneId: boundaryDecoder_1.boundary.string,
|
|
@@ -99,6 +126,8 @@ const paneSummarySchema = boundaryDecoder_1.boundary.object({
|
|
|
99
126
|
pinned: boundaryDecoder_1.boundary.boolean,
|
|
100
127
|
createdAt: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
101
128
|
lastActivity: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
129
|
+
inactiveSince: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
130
|
+
paused: boundaryDecoder_1.boundary.optional(pausedMarkSchema),
|
|
102
131
|
archived: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.boolean),
|
|
103
132
|
ownership: boundaryDecoder_1.boundary.enumeration('pane', 'external'),
|
|
104
133
|
});
|
|
@@ -180,6 +209,16 @@ const archiveSafetySchema = boundaryDecoder_1.boundary.object({
|
|
|
180
209
|
number: boundaryDecoder_1.boundary.number,
|
|
181
210
|
headOid: boundaryDecoder_1.boundary.string,
|
|
182
211
|
})),
|
|
212
|
+
busyAgents: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.object({
|
|
213
|
+
panelId: boundaryDecoder_1.boundary.string,
|
|
214
|
+
title: boundaryDecoder_1.boundary.string,
|
|
215
|
+
state: boundaryDecoder_1.boundary.enumeration('working', 'blocked'),
|
|
216
|
+
}))),
|
|
217
|
+
unsentInput: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.object({
|
|
218
|
+
panelId: boundaryDecoder_1.boundary.string,
|
|
219
|
+
title: boundaryDecoder_1.boundary.string,
|
|
220
|
+
kind: boundaryDecoder_1.boundary.enumeration('composer', 'editor'),
|
|
221
|
+
}))),
|
|
183
222
|
});
|
|
184
223
|
const agentReportFields = {
|
|
185
224
|
state: boundaryDecoder_1.boundary.enumeration('ready', 'blocked', 'failed', 'done'),
|
|
@@ -218,7 +257,7 @@ const panelLastMessageResultSchema = boundaryDecoder_1.boundary.union(boundaryDe
|
|
|
218
257
|
reason: boundaryDecoder_1.boundary.literal('transcript-unavailable'),
|
|
219
258
|
message: boundaryDecoder_1.boundary.string,
|
|
220
259
|
}));
|
|
221
|
-
const archiveBlockCodeSchema = boundaryDecoder_1.boundary.enumeration('uncommitted-changes', 'unpushed-commits', 'uncommitted-and-unpushed', 'status-unknown');
|
|
260
|
+
const archiveBlockCodeSchema = boundaryDecoder_1.boundary.enumeration('uncommitted-changes', 'unpushed-commits', 'uncommitted-and-unpushed', 'status-unknown', 'agent-busy', 'unsent-input');
|
|
222
261
|
const worktreeCleanupSchema = boundaryDecoder_1.boundary.enumeration('completed', 'failed', 'timeout', 'not-applicable');
|
|
223
262
|
const trashDeletionSchema = boundaryDecoder_1.boundary.enumeration('pending', 'done');
|
|
224
263
|
const panelSummarySchema = boundaryDecoder_1.boundary.object({
|
|
@@ -239,6 +278,7 @@ const panelSummarySchema = boundaryDecoder_1.boundary.object({
|
|
|
239
278
|
createdAt: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
240
279
|
lastActiveAt: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
241
280
|
report: boundaryDecoder_1.boundary.optional(agentReportSchema),
|
|
281
|
+
paused: boundaryDecoder_1.boundary.optional(pausedMarkSchema),
|
|
242
282
|
resumeId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
243
283
|
resumeSource: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.enumeration('agent-farm', 'configured', 'agent')),
|
|
244
284
|
});
|
|
@@ -253,6 +293,42 @@ const repoAddResultSchema = boundaryDecoder_1.boundary.object({
|
|
|
253
293
|
repo: boundaryDecoder_1.boundary.optional(repoSummarySchema),
|
|
254
294
|
preview: boundaryDecoder_1.boundary.optional(repoAddPreviewSchema),
|
|
255
295
|
});
|
|
296
|
+
const nullableString = boundaryDecoder_1.boundary.union(boundaryDecoder_1.boundary.string, boundaryDecoder_1.boundary.literal(null));
|
|
297
|
+
const repoScriptSourceSchema = boundaryDecoder_1.boundary.object({
|
|
298
|
+
command: boundaryDecoder_1.boundary.string,
|
|
299
|
+
source: boundaryDecoder_1.boundary.string,
|
|
300
|
+
});
|
|
301
|
+
const nullableScriptSource = boundaryDecoder_1.boundary.union(repoScriptSourceSchema, boundaryDecoder_1.boundary.literal(null));
|
|
302
|
+
const repoScriptSettingSchema = boundaryDecoder_1.boundary.object({
|
|
303
|
+
value: nullableString,
|
|
304
|
+
fallback: nullableScriptSource,
|
|
305
|
+
effective: nullableScriptSource,
|
|
306
|
+
});
|
|
307
|
+
const repoSettingsSchema = boundaryDecoder_1.boundary.object({
|
|
308
|
+
name: boundaryDecoder_1.boundary.string,
|
|
309
|
+
path: boundaryDecoder_1.boundary.string,
|
|
310
|
+
currentBranch: nullableString,
|
|
311
|
+
worktreeFolder: nullableString,
|
|
312
|
+
openIdeCommand: nullableString,
|
|
313
|
+
systemPrompt: nullableString,
|
|
314
|
+
configFile: nullableString,
|
|
315
|
+
buildScript: repoScriptSettingSchema,
|
|
316
|
+
runScript: repoScriptSettingSchema,
|
|
317
|
+
archiveScript: repoScriptSettingSchema,
|
|
318
|
+
envVars: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.union(boundaryDecoder_1.boundary.object({ key: boundaryDecoder_1.boundary.string, source: boundaryDecoder_1.boundary.literal('plain'), value: boundaryDecoder_1.boundary.string }), boundaryDecoder_1.boundary.object({ key: boundaryDecoder_1.boundary.string, source: boundaryDecoder_1.boundary.literal('keychain'), service: boundaryDecoder_1.boundary.string, account: boundaryDecoder_1.boundary.string }), boundaryDecoder_1.boundary.object({ key: boundaryDecoder_1.boundary.string, source: boundaryDecoder_1.boundary.literal('secret'), project: boundaryDecoder_1.boundary.string, name: boundaryDecoder_1.boundary.string })))),
|
|
319
|
+
});
|
|
320
|
+
const repoGetResultSchema = boundaryDecoder_1.boundary.object({
|
|
321
|
+
ok: boundaryDecoder_1.boundary.literal(true),
|
|
322
|
+
repo: repoSummarySchema,
|
|
323
|
+
settings: repoSettingsSchema,
|
|
324
|
+
});
|
|
325
|
+
const repoUpdateResultSchema = boundaryDecoder_1.boundary.object({
|
|
326
|
+
ok: boundaryDecoder_1.boundary.literal(true),
|
|
327
|
+
dryRun: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.literal(true)),
|
|
328
|
+
changed: boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.string),
|
|
329
|
+
repo: repoSummarySchema,
|
|
330
|
+
settings: repoSettingsSchema,
|
|
331
|
+
});
|
|
256
332
|
const repoRenameResultSchema = boundaryDecoder_1.boundary.object({
|
|
257
333
|
ok: boundaryDecoder_1.boundary.literal(true),
|
|
258
334
|
repo: repoSummarySchema,
|
|
@@ -297,12 +373,14 @@ const orchestrationSessionRecordSchema = boundaryDecoder_1.boundary.object({
|
|
|
297
373
|
name: boundaryDecoder_1.boundary.nonEmptyString,
|
|
298
374
|
archived: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.boolean),
|
|
299
375
|
isPinned: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.boolean),
|
|
376
|
+
paused: boundaryDecoder_1.boundary.optional(pausedMarkSchema),
|
|
300
377
|
agent: orchestrationAgentSchema,
|
|
301
378
|
internalSessionId: boundaryDecoder_1.boundary.nonEmptyString,
|
|
302
379
|
panelIds: boundaryDecoder_1.boundary.object({
|
|
303
380
|
claude: boundaryDecoder_1.boundary.nonEmptyString,
|
|
304
381
|
codex: boundaryDecoder_1.boundary.nonEmptyString,
|
|
305
382
|
cursor: boundaryDecoder_1.boundary.nonEmptyString,
|
|
383
|
+
opencode: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.nonEmptyString),
|
|
306
384
|
}),
|
|
307
385
|
launchCommand: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
308
386
|
profile: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
@@ -332,6 +410,11 @@ exports.runpaneSessionResultSchema = boundaryDecoder_1.boundary.object({
|
|
|
332
410
|
session: orchestrationSessionRecordSchema,
|
|
333
411
|
panelId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.nonEmptyString),
|
|
334
412
|
internalSessionId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.nonEmptyString),
|
|
413
|
+
panes: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.object({
|
|
414
|
+
archivedPaneIds: boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.nonEmptyString),
|
|
415
|
+
keptPanes: boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.object({ paneId: boundaryDecoder_1.boundary.nonEmptyString, name: boundaryDecoder_1.boundary.string, code: archiveBlockCodeSchema })),
|
|
416
|
+
failedPanes: boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.object({ paneId: boundaryDecoder_1.boundary.nonEmptyString, name: boundaryDecoder_1.boundary.string, error: boundaryDecoder_1.boundary.string })),
|
|
417
|
+
})),
|
|
335
418
|
});
|
|
336
419
|
const orchestrationPanelOverviewSchema = boundaryDecoder_1.boundary.object({
|
|
337
420
|
panelId: boundaryDecoder_1.boundary.nonEmptyString,
|
|
@@ -608,7 +691,7 @@ const paneArchiveBulkResultSchema = boundaryDecoder_1.boundary.object({
|
|
|
608
691
|
name: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
609
692
|
outcome: boundaryDecoder_1.boundary.enumeration('archived', 'would-archive', 'skipped', 'failed'),
|
|
610
693
|
skipped: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.object({
|
|
611
|
-
code: boundaryDecoder_1.boundary.enumeration('uncommitted-changes', 'unpushed-commits', 'uncommitted-and-unpushed', 'status-unknown', 'missing-pane', 'already-archived', 'main-repo', 'pr-open', 'pr-not-merged', 'pr-status-unknown'),
|
|
694
|
+
code: boundaryDecoder_1.boundary.enumeration('uncommitted-changes', 'unpushed-commits', 'uncommitted-and-unpushed', 'status-unknown', 'agent-busy', 'unsent-input', 'missing-pane', 'already-archived', 'main-repo', 'pr-open', 'pr-not-merged', 'pr-status-unknown'),
|
|
612
695
|
message: boundaryDecoder_1.boundary.string,
|
|
613
696
|
})),
|
|
614
697
|
error: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
|
|
@@ -655,6 +738,14 @@ const panelOpenResultSchema = boundaryDecoder_1.boundary.object({
|
|
|
655
738
|
active: boundaryDecoder_1.boundary.boolean,
|
|
656
739
|
reused: boundaryDecoder_1.boundary.boolean,
|
|
657
740
|
});
|
|
741
|
+
const panelCloseResultSchema = boundaryDecoder_1.boundary.object({
|
|
742
|
+
ok: boundaryDecoder_1.boundary.literal(true),
|
|
743
|
+
generation: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.number),
|
|
744
|
+
paneId: boundaryDecoder_1.boundary.string,
|
|
745
|
+
panelId: boundaryDecoder_1.boundary.string,
|
|
746
|
+
type: boundaryDecoder_1.boundary.string,
|
|
747
|
+
title: boundaryDecoder_1.boundary.string,
|
|
748
|
+
});
|
|
658
749
|
exports.panelListResultSchema = boundaryDecoder_1.boundary.object({
|
|
659
750
|
ok: boundaryDecoder_1.boundary.literal(true),
|
|
660
751
|
paneId: boundaryDecoder_1.boundary.string,
|
|
@@ -832,7 +923,7 @@ const agentDoctorResultSchema = boundaryDecoder_1.boundary.object({
|
|
|
832
923
|
})),
|
|
833
924
|
warnings: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.string)),
|
|
834
925
|
});
|
|
835
|
-
const workspaceEntryKindSchema = boundaryDecoder_1.boundary.enumeration('agent.ready', 'agent.busy', 'agent.blocked', 'agent.unknown', 'agent.idle', 'pane.created', 'pane.gone', 'panel.exited', 'panel.stopped', 'pane.associated', 'pane.detached', 'pr.conflicted', 'pr.checks', 'pr.merged', 'pr.closed', 'pr.head', 'pr.base_changed', 'pr.base_deleted', 'pr.review', 'pr.comment', 'pr.stopped', 'github.unavailable', 'github.recovered', 'agent.report', 'agent.report.missing');
|
|
926
|
+
const workspaceEntryKindSchema = boundaryDecoder_1.boundary.enumeration('agent.ready', 'agent.busy', 'agent.blocked', 'agent.unknown', 'agent.idle', 'pane.created', 'pane.gone', 'panel.exited', 'panel.stopped', 'panel.paused', 'panel.unpaused', 'pane.associated', 'pane.detached', 'pr.conflicted', 'pr.checks', 'pr.merged', 'pr.closed', 'pr.head', 'pr.base_changed', 'pr.base_deleted', 'pr.review', 'pr.comment', 'pr.stopped', 'github.unavailable', 'github.recovered', 'agent.report', 'agent.report.missing');
|
|
836
927
|
const agentStateSchema = boundaryDecoder_1.boundary.enumeration('blocked', 'working', 'idle', 'unknown');
|
|
837
928
|
const workspacePanelSummarySchema = boundaryDecoder_1.boundary.object({
|
|
838
929
|
panelId: boundaryDecoder_1.boundary.string,
|
|
@@ -983,6 +1074,154 @@ async function runReposAdd(parsed) {
|
|
|
983
1074
|
}
|
|
984
1075
|
return 0;
|
|
985
1076
|
}
|
|
1077
|
+
// Each `repos update` setting: its key in the request and --from-json, its flag, and where the parser stores it.
|
|
1078
|
+
const REPO_SETTINGS = [
|
|
1079
|
+
{ key: 'name', flag: '--name', value: (parsed) => parsed.name?.trim() },
|
|
1080
|
+
{ key: 'buildScript', flag: '--build-script', value: (parsed) => parsed.buildScript },
|
|
1081
|
+
{ key: 'runScript', flag: '--run-script', value: (parsed) => parsed.runScript },
|
|
1082
|
+
{ key: 'archiveScript', flag: '--archive-script', value: (parsed) => parsed.archiveScript },
|
|
1083
|
+
{ key: 'worktreeFolder', flag: '--worktree-folder', value: (parsed) => parsed.worktreeFolder },
|
|
1084
|
+
{ key: 'openIdeCommand', flag: '--open-ide-command', value: (parsed) => parsed.openIdeCommand },
|
|
1085
|
+
{ key: 'systemPrompt', flag: '--system-prompt', value: (parsed) => parsed.systemPrompt },
|
|
1086
|
+
];
|
|
1087
|
+
const CLEARABLE_REPO_SETTINGS = REPO_SETTINGS.filter((setting) => setting.key !== 'name').map((setting) => setting.flag.slice(2));
|
|
1088
|
+
const REPO_SETTINGS_NEXT = 'See the settings with `runpane repos get --repo <selector> --json`, and the flags with `runpane help repos update`.';
|
|
1089
|
+
function invalidRepoSettings(message) {
|
|
1090
|
+
return new errors_1.RunpaneError('ERR_RUNPANE_REPO_SETTINGS_INVALID', `${message} Nothing was changed.`, REPO_SETTINGS_NEXT);
|
|
1091
|
+
}
|
|
1092
|
+
async function runReposGet(parsed) {
|
|
1093
|
+
const result = await (0, daemonClient_1.invokeDaemon)('runpane:repos:get', [parsed.repo === undefined ? {} : { repo: parsed.repo }], repoGetResultSchema, {
|
|
1094
|
+
paneDir: parsed.paneDir,
|
|
1095
|
+
});
|
|
1096
|
+
if (parsed.json) {
|
|
1097
|
+
printJson(result);
|
|
1098
|
+
}
|
|
1099
|
+
else {
|
|
1100
|
+
printRepoSettings(result.repo, result.settings);
|
|
1101
|
+
}
|
|
1102
|
+
return 0;
|
|
1103
|
+
}
|
|
1104
|
+
async function runReposUpdate(parsed) {
|
|
1105
|
+
if (!parsed.repo) {
|
|
1106
|
+
throw new errors_1.RunpaneError('ERR_RUNPANE_REPO_REQUIRED', 'runpane repos update requires --repo <selector>. Nothing was changed.', 'Find the repo with `runpane repos list`.');
|
|
1107
|
+
}
|
|
1108
|
+
const request = { repo: parsed.repo, settings: buildRepoSettingsUpdate(parsed) };
|
|
1109
|
+
if (parsed.dryRun) {
|
|
1110
|
+
request.dryRun = true;
|
|
1111
|
+
}
|
|
1112
|
+
else {
|
|
1113
|
+
await (0, daemonActions_1.confirmMutation)(parsed);
|
|
1114
|
+
}
|
|
1115
|
+
const result = await (0, daemonClient_1.invokeDaemon)('runpane:repos:update', [request], repoUpdateResultSchema, {
|
|
1116
|
+
paneDir: parsed.paneDir,
|
|
1117
|
+
});
|
|
1118
|
+
if (parsed.json) {
|
|
1119
|
+
printJson(result);
|
|
1120
|
+
return 0;
|
|
1121
|
+
}
|
|
1122
|
+
const changed = result.changed.length > 0 ? `: ${result.changed.join(', ')}` : '; no setting changed';
|
|
1123
|
+
console.log(`${result.dryRun ? 'Would update' : 'Updated'} ${result.repo.name}${changed}`);
|
|
1124
|
+
printRepoSettings(result.repo, result.settings);
|
|
1125
|
+
return 0;
|
|
1126
|
+
}
|
|
1127
|
+
/** The settings object from --from-json, overridden by setting flags, with --clear settings set to null. */
|
|
1128
|
+
function buildRepoSettingsUpdate(parsed) {
|
|
1129
|
+
const settings = {};
|
|
1130
|
+
if (parsed.fromJson) {
|
|
1131
|
+
const text = stripUtf8Bom(readInputSource(parsed.fromJson));
|
|
1132
|
+
try {
|
|
1133
|
+
Object.assign(settings, (0, boundaryDecoder_1.decodeBoundary)(JSON.parse(text), boundaryDecoder_1.boundary.jsonObject));
|
|
1134
|
+
}
|
|
1135
|
+
catch (error) {
|
|
1136
|
+
if (error instanceof SyntaxError)
|
|
1137
|
+
throw error;
|
|
1138
|
+
throw invalidRepoSettings('--from-json must hold a JSON object of settings, such as {"runScript": "pnpm dev"}.');
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
const cleared = new Set(parsed.clear ?? []);
|
|
1142
|
+
for (const setting of cleared) {
|
|
1143
|
+
if (!CLEARABLE_REPO_SETTINGS.includes(setting)) {
|
|
1144
|
+
throw invalidRepoSettings(`Unknown setting "${setting}" for --clear. Clearable settings: ${CLEARABLE_REPO_SETTINGS.join(', ')}.`);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
for (const setting of REPO_SETTINGS) {
|
|
1148
|
+
const value = setting.value(parsed);
|
|
1149
|
+
const clear = cleared.has(setting.flag.slice(2));
|
|
1150
|
+
if (value !== undefined && clear) {
|
|
1151
|
+
throw invalidRepoSettings(`runpane repos update both sets and clears ${setting.flag.slice(2)}; pass one.`);
|
|
1152
|
+
}
|
|
1153
|
+
if (value !== undefined)
|
|
1154
|
+
settings[setting.key] = value;
|
|
1155
|
+
if (clear)
|
|
1156
|
+
settings[setting.key] = null;
|
|
1157
|
+
}
|
|
1158
|
+
applyEnvVarFlags(parsed, settings);
|
|
1159
|
+
if (Object.keys(settings).length === 0) {
|
|
1160
|
+
throw invalidRepoSettings(`runpane repos update needs at least one setting: ${REPO_SETTINGS.map((setting) => setting.flag).join(', ')}, --env <json>, --env-remove <name,...>, --clear <setting,...>, or --from-json <path|->.`);
|
|
1161
|
+
}
|
|
1162
|
+
return settings;
|
|
1163
|
+
}
|
|
1164
|
+
/** --env and --env-remove as `envVars` operations; each flag replaces the same operation from --from-json. */
|
|
1165
|
+
function applyEnvVarFlags(parsed, settings) {
|
|
1166
|
+
if (parsed.envArgs === undefined && parsed.envRemove === undefined)
|
|
1167
|
+
return;
|
|
1168
|
+
let envVars = {};
|
|
1169
|
+
try {
|
|
1170
|
+
envVars = { ...(0, boundaryDecoder_1.decodeBoundary)(settings.envVars, boundaryDecoder_1.boundary.jsonObject) };
|
|
1171
|
+
}
|
|
1172
|
+
catch {
|
|
1173
|
+
// No envVars (or a malformed one) in --from-json: the flags give the whole value.
|
|
1174
|
+
}
|
|
1175
|
+
if (parsed.envArgs !== undefined) {
|
|
1176
|
+
envVars.set = parsed.envArgs.flatMap((text) => {
|
|
1177
|
+
let value;
|
|
1178
|
+
try {
|
|
1179
|
+
value = (0, boundaryDecoder_1.decodeBoundary)(JSON.parse(text), boundaryDecoder_1.boundary.json);
|
|
1180
|
+
}
|
|
1181
|
+
catch {
|
|
1182
|
+
value = null;
|
|
1183
|
+
}
|
|
1184
|
+
if (!Array.isArray(value)) {
|
|
1185
|
+
throw invalidRepoSettings('--env must be a JSON array of variables, such as [{"key":"API_URL","source":"plain","value":"https://api.test"}].');
|
|
1186
|
+
}
|
|
1187
|
+
return value;
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
if (parsed.envRemove !== undefined)
|
|
1191
|
+
envVars.remove = parsed.envRemove;
|
|
1192
|
+
settings.envVars = envVars;
|
|
1193
|
+
}
|
|
1194
|
+
function printRepoSettings(repo, settings) {
|
|
1195
|
+
console.log(`${repo.id}\t${settings.name}\t${settings.path}`);
|
|
1196
|
+
console.log(`Current branch: ${settings.currentBranch ?? 'unknown'}`);
|
|
1197
|
+
console.log(`Worktree folder: ${settings.worktreeFolder ?? 'not set (worktrees/ in the repository)'}`);
|
|
1198
|
+
console.log(`Open IDE command: ${settings.openIdeCommand ?? 'not set'}`);
|
|
1199
|
+
console.log(`System prompt: ${settings.systemPrompt ?? 'not set'}`);
|
|
1200
|
+
const scripts = [['Build script', settings.buildScript], ['Run script', settings.runScript], ['Archive script', settings.archiveScript]];
|
|
1201
|
+
for (const [label, script] of scripts) {
|
|
1202
|
+
const effective = script.effective;
|
|
1203
|
+
if (!effective) {
|
|
1204
|
+
console.log(`${label}: not set`);
|
|
1205
|
+
continue;
|
|
1206
|
+
}
|
|
1207
|
+
const from = script.value
|
|
1208
|
+
? `Project Settings${script.fallback ? `, overrides ${script.fallback.source}` : ''}`
|
|
1209
|
+
: `from ${effective.source}`;
|
|
1210
|
+
const command = effective.command.includes('\n') ? `\n ${effective.command.split('\n').join('\n ')}` : ` ${effective.command}`;
|
|
1211
|
+
console.log(`${label} (${from}):${command}`);
|
|
1212
|
+
}
|
|
1213
|
+
if (settings.envVars === undefined)
|
|
1214
|
+
return;
|
|
1215
|
+
console.log(`Environment variables:${settings.envVars.length === 0 ? ' none' : ''}`);
|
|
1216
|
+
for (const variable of settings.envVars) {
|
|
1217
|
+
if (variable.source === 'plain')
|
|
1218
|
+
console.log(` ${variable.key}=${variable.value}`);
|
|
1219
|
+
else if (variable.source === 'keychain')
|
|
1220
|
+
console.log(` ${variable.key} from keychain item ${variable.service} / ${variable.account}`);
|
|
1221
|
+
else
|
|
1222
|
+
console.log(` ${variable.key} from Pane secret ${variable.project}/${variable.name}`);
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
986
1225
|
async function runReposRename(parsed) {
|
|
987
1226
|
if (!parsed.repo) {
|
|
988
1227
|
throw new errors_1.RunpaneError('ERR_RUNPANE_INVALID_ARGUMENT', 'runpane repos rename requires --repo. Nothing was changed.', 'Pass a repo id, path or name from `runpane repos list`, or `active`.');
|
|
@@ -1503,6 +1742,13 @@ function printSessionResult(result, json, action) {
|
|
|
1503
1742
|
console.log(`${prefix}${result.session.name} (${result.session.id})`);
|
|
1504
1743
|
if (result.panelId)
|
|
1505
1744
|
console.log(` panel: ${result.panelId}`);
|
|
1745
|
+
if (result.panes) {
|
|
1746
|
+
console.log(` archived ${result.panes.archivedPaneIds.length} Pane(s)`);
|
|
1747
|
+
for (const pane of result.panes.keptPanes)
|
|
1748
|
+
console.log(` kept open: ${pane.name} (${pane.paneId}) ${pane.code}; check it with \`runpane panes archive --pane ${pane.paneId} --dry-run\``);
|
|
1749
|
+
for (const pane of result.panes.failedPanes)
|
|
1750
|
+
console.log(` failed: ${pane.name} (${pane.paneId}) ${pane.error}`);
|
|
1751
|
+
}
|
|
1506
1752
|
return 0;
|
|
1507
1753
|
}
|
|
1508
1754
|
async function runPanesCost(parsed) {
|
|
@@ -1913,7 +2159,7 @@ async function runPanesArchive(parsed) {
|
|
|
1913
2159
|
request.dryRun = true;
|
|
1914
2160
|
if (parsed.removeWorktree)
|
|
1915
2161
|
request.removeWorktree = true;
|
|
1916
|
-
await confirmPaneArchive(parsed, `Archive pane ${request.paneId}${request.force ? ' (
|
|
2162
|
+
await confirmPaneArchive(parsed, `Archive pane ${request.paneId}${request.force ? ' (stopping its agents and discarding any unsent input, uncommitted or unpushed work)' : ''}`);
|
|
1917
2163
|
const result = await (0, daemonClient_1.invokeDaemon)('runpane:panes:archive', [request], paneArchiveResultSchema, {
|
|
1918
2164
|
paneDir: parsed.paneDir,
|
|
1919
2165
|
timeoutMs: 40_000,
|
|
@@ -2488,6 +2734,22 @@ async function runPanelsSubmitComposer(parsed) {
|
|
|
2488
2734
|
}
|
|
2489
2735
|
return result.ok ? 0 : 1;
|
|
2490
2736
|
}
|
|
2737
|
+
async function runPanelsClose(parsed) {
|
|
2738
|
+
if (!parsed.panelId) {
|
|
2739
|
+
throw new Error('runpane panels close requires --panel.');
|
|
2740
|
+
}
|
|
2741
|
+
await (0, daemonActions_1.confirmMutation)(parsed);
|
|
2742
|
+
const result = await (0, daemonClient_1.invokeDaemon)('runpane:panels:close', [{ panelId: parsed.panelId }], panelCloseResultSchema, {
|
|
2743
|
+
paneDir: parsed.paneDir,
|
|
2744
|
+
});
|
|
2745
|
+
if (parsed.json) {
|
|
2746
|
+
printJson(result);
|
|
2747
|
+
}
|
|
2748
|
+
else {
|
|
2749
|
+
console.log(`Closed ${result.type} tab "${result.title}" (${result.panelId}) in pane ${result.paneId}.`);
|
|
2750
|
+
}
|
|
2751
|
+
return 0;
|
|
2752
|
+
}
|
|
2491
2753
|
async function runPanelsWait(parsed) {
|
|
2492
2754
|
if (!parsed.panelId) {
|
|
2493
2755
|
throw new Error('runpane panels wait requires --panel.');
|
|
@@ -2537,6 +2799,32 @@ async function runPanelsResume(parsed) {
|
|
|
2537
2799
|
}
|
|
2538
2800
|
return result.ok ? 0 : 1;
|
|
2539
2801
|
}
|
|
2802
|
+
/** `panels pause`, `panes pause|resume` and `sessions pause|resume`: one daemon call each, printed alike. */
|
|
2803
|
+
async function runPause(parsed, scope, action) {
|
|
2804
|
+
const [flag, key, id] = scope === 'panel' ? ['--panel', 'panelId', parsed.panelId]
|
|
2805
|
+
: scope === 'pane' ? ['--pane', 'paneId', parsed.paneId] : ['--session', 'sessionId', parsed.sessionId?.trim()];
|
|
2806
|
+
if (!id)
|
|
2807
|
+
throw new Error(`runpane ${parsed.command} requires ${flag}.`);
|
|
2808
|
+
// Like the other Session updates, Session pause and resume need no --yes.
|
|
2809
|
+
if (scope !== 'session')
|
|
2810
|
+
await (0, daemonActions_1.confirmMutation)(parsed);
|
|
2811
|
+
const channel = `runpane:${scope === 'panel' ? 'panels' : scope === 'pane' ? 'panes' : 'sessions'}:${action}`;
|
|
2812
|
+
const result = await (0, daemonClient_1.invokeDaemon)(channel, [{ [key]: id }], pauseResultSchema, {
|
|
2813
|
+
paneDir: parsed.paneDir,
|
|
2814
|
+
// Pause waits for every tab's processes to exit; resume restarts them a few at a time.
|
|
2815
|
+
timeoutMs: RESUME_MANY_RESTART_BUDGET_MS,
|
|
2816
|
+
});
|
|
2817
|
+
if (parsed.json) {
|
|
2818
|
+
printJson(result);
|
|
2819
|
+
}
|
|
2820
|
+
else {
|
|
2821
|
+
console.log(result.message);
|
|
2822
|
+
for (const item of result.failed)
|
|
2823
|
+
console.log(`FAIL panel ${item.panelId}: ${item.error}`);
|
|
2824
|
+
console.log(`Next: ${result.nextCommand}`);
|
|
2825
|
+
}
|
|
2826
|
+
return result.ok ? 0 : 1;
|
|
2827
|
+
}
|
|
2540
2828
|
async function runAgentsDoctor(parsed) {
|
|
2541
2829
|
if (!parsed.agent) {
|
|
2542
2830
|
throw new Error(`runpane agents doctor requires --agent ${contract_1.RUNPANE_CONTRACT.enums.agents.join('|')}.`);
|
|
@@ -3070,6 +3358,8 @@ function workspaceLabel(kind) {
|
|
|
3070
3358
|
'pane.gone': 'GONE',
|
|
3071
3359
|
'panel.exited': 'EXIT',
|
|
3072
3360
|
'panel.stopped': 'STOPPED',
|
|
3361
|
+
'panel.paused': 'PAUSED',
|
|
3362
|
+
'panel.unpaused': 'UNPAUSED',
|
|
3073
3363
|
'pane.associated': 'JOINED',
|
|
3074
3364
|
'pane.detached': 'LEFT',
|
|
3075
3365
|
'pr.conflicted': 'PR CONFLICTED',
|
|
@@ -3113,7 +3403,8 @@ function printPaneListResult(result) {
|
|
|
3113
3403
|
for (const pane of result.panes) {
|
|
3114
3404
|
const repo = pane.repoName ? ` ${pane.repoName}` : '';
|
|
3115
3405
|
const pinned = pane.pinned ? ' pinned' : '';
|
|
3116
|
-
|
|
3406
|
+
const paused = pane.paused ? ' paused' : '';
|
|
3407
|
+
console.log(`${pane.id}\t${pane.name}\t${pane.status}${pinned}${paused}\t${pane.panelCount} panels\t${pane.worktreePath}${repo}`);
|
|
3117
3408
|
}
|
|
3118
3409
|
}
|
|
3119
3410
|
function printPaneCostResult(result) {
|
|
@@ -3228,6 +3519,12 @@ function printArchiveCommitEvidence(safetyCheck, print = console.log) {
|
|
|
3228
3519
|
for (const commit of safetyCheck.unpushedCommitDetails ?? []) {
|
|
3229
3520
|
print(`Unpushed: ${commit.sha} ${commit.subject}`);
|
|
3230
3521
|
}
|
|
3522
|
+
for (const agent of safetyCheck.busyAgents ?? []) {
|
|
3523
|
+
print(`Busy: ${agent.title} (panel ${agent.panelId}) is ${agent.state === 'working' ? 'mid-turn' : 'waiting for an answer'}`);
|
|
3524
|
+
}
|
|
3525
|
+
for (const input of safetyCheck.unsentInput ?? []) {
|
|
3526
|
+
print(`Unsent: ${input.title} (panel ${input.panelId}) ${input.kind === 'editor' ? 'has unsaved edits' : 'has text typed but not sent'}`);
|
|
3527
|
+
}
|
|
3231
3528
|
}
|
|
3232
3529
|
function printPanelCreateResult(result) {
|
|
3233
3530
|
console.log(`Created panel ${result.panelId} in pane ${result.paneId}: ${result.title}${result.active ? ' active' : ' background'}`);
|
|
@@ -3373,7 +3670,7 @@ function printPanelListResult(result) {
|
|
|
3373
3670
|
for (const panel of result.panels) {
|
|
3374
3671
|
const marker = panel.active ? '*' : ' ';
|
|
3375
3672
|
const initialized = panel.initialized === undefined ? '' : panel.initialized ? ' initialized' : ' not-initialized';
|
|
3376
|
-
const stopped = panel.running === false ? ' stopped' : '';
|
|
3673
|
+
const stopped = panel.paused ? ' paused' : panel.running === false ? ' stopped' : '';
|
|
3377
3674
|
const agent = panel.agentType ? ` ${panel.agentType}` : '';
|
|
3378
3675
|
const detection = panel.agentDetection && panel.agentDetection !== 'command' ? ` (${panel.agentDetection})` : '';
|
|
3379
3676
|
const resume = panel.resumeId ? ` resume ${panel.resumeId}` : '';
|