@ordewell/cli 0.10.0 → 0.10.1
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/dist/main.js +39 -7
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -2385,11 +2385,26 @@ function approvalKeysLine(block, cols) {
|
|
|
2385
2385
|
}
|
|
2386
2386
|
function checkpointCardLines(order, question, cols, approvalFirst) {
|
|
2387
2387
|
const room = Math.max(1, cols - 2);
|
|
2388
|
-
const
|
|
2388
|
+
const first = approvalFirst ? wrap("answer the tool request above first (ctrl-y / ctrl-g), then:", room) : [];
|
|
2389
2389
|
return [
|
|
2390
2390
|
truncate(`${style.accent("\u25C6")} ${style.bold(`Task ${order} asks`)}`, cols),
|
|
2391
2391
|
...wrap(sanitize(question).trim(), room).map((line) => ` ${line}`),
|
|
2392
|
-
...
|
|
2392
|
+
...first.map((line) => style.grey(` ${line}`)),
|
|
2393
|
+
...CHECKPOINT_CHOICES.flatMap(([key, text]) => choiceLines(key, text, room))
|
|
2394
|
+
];
|
|
2395
|
+
}
|
|
2396
|
+
var CHECKPOINT_CHOICES = [
|
|
2397
|
+
["enter", "reply: the task goes on with what you typed"],
|
|
2398
|
+
["ctrl-y", "approve as is"],
|
|
2399
|
+
["ctrl-g", "reject (with nothing typed, a plain no)"]
|
|
2400
|
+
];
|
|
2401
|
+
var CHOICE_KEY_WIDTH = 6;
|
|
2402
|
+
function choiceLines(key, text, room) {
|
|
2403
|
+
const hang = CHOICE_KEY_WIDTH + 2;
|
|
2404
|
+
const [head = "", ...rest] = wrap(text, Math.max(1, room - hang));
|
|
2405
|
+
return [
|
|
2406
|
+
` ${style.accent(style.bold(pad(key, CHOICE_KEY_WIDTH)))} ${style.grey(head)}`,
|
|
2407
|
+
...rest.map((line) => ` ${" ".repeat(hang)}${style.grey(line)}`)
|
|
2393
2408
|
];
|
|
2394
2409
|
}
|
|
2395
2410
|
var COMMAND_PAINT = {
|
|
@@ -4485,6 +4500,7 @@ var SLASH_COMMANDS = [
|
|
|
4485
4500
|
{ name: "cancel", usage: "/cancel <id>", description: "Kill a running task", category: "tasks" },
|
|
4486
4501
|
{ name: "force-start", usage: "/force-start <id>", description: "Start a task now, ignoring dependencies", category: "tasks" },
|
|
4487
4502
|
{ name: "continue", usage: "/continue <id> <message>", description: "Continue a finished task in its saved runner session, with your message", category: "tasks" },
|
|
4503
|
+
{ name: "open", usage: "/open <id>", description: "Open a task's view: its log, and the keys that answer its checkpoint or tool request", category: "tasks" },
|
|
4488
4504
|
{ name: "checkpoint", usage: "/checkpoint <id> approve|reject [reason]", description: "Answer the checkpoint a task waits at: approve lets it go on, reject tells it why not", category: "tasks" },
|
|
4489
4505
|
{ name: "task-runner", usage: "/task-runner <id> [runner]", description: "Choose or set a task's executor (re-picks its model and mode)", category: "tasks" },
|
|
4490
4506
|
{ name: "task-model", usage: "/task-model <id> [model]", description: "Choose or set a task's executor model", category: "tasks" },
|
|
@@ -4830,7 +4846,12 @@ var PLAN_KEYS = {
|
|
|
4830
4846
|
move: { keys: "up / down", meaning: "move between tasks", group: "Navigation" },
|
|
4831
4847
|
scroll: { keys: "pgup / pgdn", meaning: "scroll the plan", group: "Navigation" },
|
|
4832
4848
|
expand: { keys: "\u2192", meaning: "reveal a task's subtasks, then edit its prompt", group: "Navigation", hint: "\u2192 expand" },
|
|
4833
|
-
log: {
|
|
4849
|
+
log: {
|
|
4850
|
+
keys: "enter",
|
|
4851
|
+
meaning: "open the task's log and message its runner \u2014 or, at a checkpoint, answer it",
|
|
4852
|
+
group: "Navigation",
|
|
4853
|
+
hint: (task) => task?.status === "awaiting_user" && task.awaitingReason === "checkpoint" ? "enter answer" : "enter log"
|
|
4854
|
+
},
|
|
4834
4855
|
back: { keys: "esc", meaning: "collapse the task, or leave a task's log for the plan", group: "Navigation" },
|
|
4835
4856
|
runner: { keys: "R", meaning: "pick the task's runner", group: "Assign" },
|
|
4836
4857
|
model: { keys: "o", meaning: "pick the task's model", group: "Assign", hint: "o model" },
|
|
@@ -4931,6 +4952,7 @@ function footerHints(state) {
|
|
|
4931
4952
|
const taskSends = !!tv && tv.view.working && !!state.editor.text.trim() && !continuesTask(findTask(state.tasks, tv.taskId));
|
|
4932
4953
|
const sendNowHint = planning || taskSends ? "ctrl-s send now" : null;
|
|
4933
4954
|
const stopRunnerHint = runnerStoppable(state) ? "ctrl-x stop runner" : null;
|
|
4955
|
+
const checkpointHints = tv && waitingCheckpoint(findTask(state.tasks, tv.taskId)) && !waitingApproval(tv) ? ["enter reply", "ctrl-y approve", "ctrl-g reject"] : [];
|
|
4934
4956
|
if (state.focus === "plan") {
|
|
4935
4957
|
if (state.taskEditor) {
|
|
4936
4958
|
return ["type to edit prompt", "pgup/pgdn scroll", "alt-enter newline", "enter save", "esc cancel"];
|
|
@@ -4940,6 +4962,7 @@ function footerHints(state) {
|
|
|
4940
4962
|
const detailHint = (0, import_core30.hasHiddenDetail)(state.taskView ? state.taskView.view.blocks : state.conversation.blocks) ? [state.detailAll ? "ctrl-o collapse all" : "ctrl-o expand all"] : [];
|
|
4941
4963
|
return [
|
|
4942
4964
|
"/help",
|
|
4965
|
+
...checkpointHints,
|
|
4943
4966
|
...stopRunnerHint ? [stopRunnerHint] : [],
|
|
4944
4967
|
"tab plan",
|
|
4945
4968
|
...detailHint,
|
|
@@ -5013,7 +5036,7 @@ function taskHeaderLines(state, tv, cols) {
|
|
|
5013
5036
|
taskActivity(task, tv.view.working)
|
|
5014
5037
|
].filter(Boolean);
|
|
5015
5038
|
const approval = waitingApproval(tv);
|
|
5016
|
-
const hint = approval ? ["ctrl-y allow", ...approval.allowForTask ? ["ctrl-t allow for task"] : [], "ctrl-g deny (composer text is the note)"] : waitingCheckpoint(task) ? ["ctrl-y approve", "ctrl-g reject
|
|
5039
|
+
const hint = approval ? ["ctrl-y allow", ...approval.allowForTask ? ["ctrl-t allow for task"] : [], "ctrl-g deny (composer text is the note)"] : waitingCheckpoint(task) ? ["enter reply", "ctrl-y approve", "ctrl-g reject", "ctrl-x stop runner"] : task && (0, import_core30.resumeLabel)(task) ? ["ctrl-x don't resume"] : [...runnerStoppable(state) ? ["ctrl-x stop runner"] : [], "ctrl-r remove queued", "ctrl-s send now"];
|
|
5017
5040
|
if (approval && waitingCheckpoint(task)) hint.push("then the checkpoint");
|
|
5018
5041
|
const index = tv.attempts.indexOf(tv.attempt);
|
|
5019
5042
|
if (tv.attempts.length > 1) hint.push(`alt\u2190/\u2192 attempt ${index >= 0 ? index + 1 : 1}/${tv.attempts.length}`);
|
|
@@ -5515,7 +5538,7 @@ function commandSheetBody(cols) {
|
|
|
5515
5538
|
style.grey(" ctrl-n/ctrl-p pick a pending message (the newest until you do) \xB7 ctrl-r removes a queued one"),
|
|
5516
5539
|
style.grey(" ctrl-x stops the runner's running turn, and it then waits for your next message \u2014 on a task paused on a usage limit, it keeps it from resuming"),
|
|
5517
5540
|
style.grey(" ctrl-y allows a tool request (its keys sit under it) \xB7 ctrl-t allows it for the task \xB7 ctrl-g denies it, with the composer text as the note"),
|
|
5518
|
-
style.grey(" at a checkpoint, ctrl-y approves
|
|
5541
|
+
style.grey(" at a checkpoint, enter replies with what you typed, ctrl-y approves, ctrl-g rejects (the text is its reason) \xB7 /checkpoint <id> approve|reject [reason] from anywhere"),
|
|
5519
5542
|
style.grey(" alt\u2190/\u2192 changes attempt \xB7 esc returns")
|
|
5520
5543
|
);
|
|
5521
5544
|
return body;
|
|
@@ -6398,13 +6421,14 @@ function taskLogArrived(state, action) {
|
|
|
6398
6421
|
function announceApprovals(state, action) {
|
|
6399
6422
|
if (state.taskView?.taskId === action.taskId) return state;
|
|
6400
6423
|
const task = findTask(state.tasks, action.taskId);
|
|
6401
|
-
const
|
|
6424
|
+
const way = task ? `tab to the plan, select task ${task.order} and press enter (or /open ${task.order})` : "tab to the plan, select it and press enter";
|
|
6425
|
+
const spoken = action.events.reduce((s, event) => event.type === "approval_requested" && !event.decided ? say(s, "system", `Task ${task?.order ?? "?"} waits for approval: ${(0, import_core35.runnerToolSubject)(event.tool, event.args)} \u2014 ${way}, then ctrl-y allows or ctrl-g denies`) : s, state);
|
|
6402
6426
|
return spoken !== state ? { ...spoken, scroll: state.scroll } : spoken;
|
|
6403
6427
|
}
|
|
6404
6428
|
function announceCheckpoint(state, action) {
|
|
6405
6429
|
const task = findTask(state.tasks, action.taskId) ?? state.tasks.find((t) => t.title === action.title);
|
|
6406
6430
|
const label = task ? `Task ${task.order}` : action.title;
|
|
6407
|
-
const where =
|
|
6431
|
+
const where = task ? `tab to the plan, select task ${task.order} and press enter (or /open ${task.order}) to answer` : "tab to the plan, select it and press enter to answer";
|
|
6408
6432
|
const spoken = say(state, "system", `${label} asks: ${(0, import_core35.truncateCheckpointSummary)(action.summary)} \u2014 ${where}`);
|
|
6409
6433
|
return { ...spoken, scroll: state.scroll };
|
|
6410
6434
|
}
|
|
@@ -7385,6 +7409,8 @@ function runCommand(state, { name, args }) {
|
|
|
7385
7409
|
if (!text) return fail3(state, "Usage: /continue <id> <message>");
|
|
7386
7410
|
return continueTaskStep(state, sessionId, taskId, text);
|
|
7387
7411
|
});
|
|
7412
|
+
case "open":
|
|
7413
|
+
return taskCommand(state, args[0], (sessionId, taskId) => openTaskView(state, sessionId, taskId));
|
|
7388
7414
|
case "checkpoint":
|
|
7389
7415
|
return taskCommand(state, args[0], (sessionId, taskId) => {
|
|
7390
7416
|
const answer = args[1]?.toLowerCase();
|
|
@@ -8257,6 +8283,12 @@ function submit(state) {
|
|
|
8257
8283
|
return step({ ...cleared, taskView: { ...state.taskView, notice } });
|
|
8258
8284
|
}
|
|
8259
8285
|
if (state.taskView.notice) cleared.taskView = { ...state.taskView, notice: void 0 };
|
|
8286
|
+
if (!command && waitingCheckpoint(task)) {
|
|
8287
|
+
if (waitingApproval(state.taskView)) {
|
|
8288
|
+
return step(say(state, "system", "A tool request is waiting ahead of the checkpoint \u2014 answer it first (ctrl-y to allow, ctrl-g to deny), then enter replies to the checkpoint."));
|
|
8289
|
+
}
|
|
8290
|
+
return answerCheckpoint(cleared, state.sessionId, taskId, "reject", text);
|
|
8291
|
+
}
|
|
8260
8292
|
if (continuesTask(task)) return continueTaskStep(cleared, state.sessionId, taskId, text);
|
|
8261
8293
|
if (command && offered2.length > 0) return step(cleared, [{ type: "invokeTaskCommand", sessionId: state.sessionId, taskId, ...command }]);
|
|
8262
8294
|
return step(cleared, [{ type: "sendTaskMessage", sessionId: state.sessionId, taskId, text }]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordewell/cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Ordewell CLI and TUI — plan, run and verify coding-agent tasks from the terminal.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Alessandro Costanzo Ciano",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"typecheck": "tsc --noEmit"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@ordewell/core": "^0.10.
|
|
53
|
-
"@ordewell/web": "^0.10.
|
|
52
|
+
"@ordewell/core": "^0.10.1",
|
|
53
|
+
"@ordewell/web": "^0.10.1",
|
|
54
54
|
"string-width": "^7.2.0",
|
|
55
55
|
"ws": "^8.18.0"
|
|
56
56
|
},
|