@abhishek944/pi-tasks 0.14.0 → 0.15.0
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 +1 -1
- package/dist/command.d.ts +1 -1
- package/dist/command.js +2 -2
- package/dist/index.js +9 -7
- package/dist/open-repository.d.ts +5 -3
- package/dist/open-repository.js +19 -5
- package/dist/ui/panel.d.ts +2 -1
- package/dist/ui/panel.js +16 -11
- package/dist/ui/works-dashboard.d.ts +3 -2
- package/dist/ui/works-dashboard.js +11 -9
- package/docs/REFERENCE.md +5 -5
- package/docs/USAGE_GUIDE.md +20 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ New tasks start at `0s`; historical tasks without timing show `—` until measur
|
|
|
54
54
|
|
|
55
55
|
The panel and `/works` prefix work names with IDs and task names with IDs plus ownership, such as `[W1] Locate subagent restrictions` and `[T1] [self] Inspect the implement skill`. Task ownership comes from an explicit `owner: self` or `owner: delegate` declaration at the start of a line in `taskInfo`; preserve it on updates. Missing or conflicting decisions show `[unassigned]`, without rewriting stored names or old records. Inside Herdr, `AgentCreate` automatically links its task to an underlined, clickable `[delegate]` badge; Open actions are also underlined. See [delegate pane links](docs/USAGE_GUIDE.md#delegate-pane-links) for linking and keyboard access.
|
|
56
56
|
|
|
57
|
-
The panel defaults to the floating top-right layout. The compact header no longer displays the session ID. An underlined Open session action beside Copy opens this agent's artifact folder
|
|
57
|
+
The panel defaults to the floating top-right layout. The compact header no longer displays the session ID. An underlined Open session action beside Copy opens this agent's artifact folder using the configured command, including existing nested delegated paths; if none exists, it creates `var/<sessionId>/`. The existing Open still opens the repository. Use `/works-panel open-session` without mouse input. Narrow headers shorten Minimize/Maximize to `[-]`/`[+]`. The `/works` dashboard title stays unchanged. Its top border centers the current repository's Git branch and staged/unstaged/untracked file counts, refreshed asynchronously with a one-second cache. Clean repositories show `clean`. In fullscreen TUI mode, its title bar has clickable Copy, Open, and Minimize/Maximize actions, and you can scroll overflowing rows directly with the mouse wheel. Open defaults to `cursor .`; configure `pi-tasks.openCommand` to use another tool (see [configuration](docs/USAGE_GUIDE.md#configure-open-and-open-session)). Open `/works` to inspect every row or copy from the keyboard. Use `/works-panel minimize`, `/works-panel maximize`, or `/works-panel open` when mouse input is unavailable. In `/works`, press `o` to run the configured command. Switch layouts with `/works-panel floating`, `/works-panel widget`, or `/works-panel off`.
|
|
58
58
|
|
|
59
59
|
## Task-owned agents
|
|
60
60
|
|
package/dist/command.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import type { GitStatusCache } from "./git-status.js";
|
|
3
3
|
import type { TaskState } from "./state.js";
|
|
4
|
-
export declare function registerWorksCommand(pi: ExtensionAPI, state: TaskState, git: GitStatusCache): void;
|
|
4
|
+
export declare function registerWorksCommand(pi: ExtensionAPI, state: TaskState, git: GitStatusCache, getOpenCommand: () => string[]): void;
|
package/dist/command.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { runWorksOverlay } from "./ui/overlay.js";
|
|
2
2
|
import { WorksDashboard } from "./ui/works-dashboard.js";
|
|
3
|
-
export function registerWorksCommand(pi, state, git) {
|
|
3
|
+
export function registerWorksCommand(pi, state, git, getOpenCommand) {
|
|
4
4
|
let closeActiveDashboard;
|
|
5
5
|
pi.on("session_start", () => {
|
|
6
6
|
closeActiveDashboard?.();
|
|
@@ -28,7 +28,7 @@ export function registerWorksCommand(pi, state, git) {
|
|
|
28
28
|
};
|
|
29
29
|
commandClose = closeCurrent;
|
|
30
30
|
closeActiveDashboard = closeCurrent;
|
|
31
|
-
return new WorksDashboard(tui, theme, keybindings, state, closeCurrent, ctx.cwd, git, (message, type) => ctx.ui.notify(message, type));
|
|
31
|
+
return new WorksDashboard(tui, theme, keybindings, state, closeCurrent, ctx.cwd, git, (message, type) => ctx.ui.notify(message, type), getOpenCommand);
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
catch (error) {
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { registerTaskAutoContinue } from "./auto-continue.js";
|
|
|
4
4
|
import { registerWorksCommand } from "./command.js";
|
|
5
5
|
import { registerDelegatedTimeTools } from "./delegated-time.js";
|
|
6
6
|
import { GitStatusCache } from "./git-status.js";
|
|
7
|
-
import { openRepository, openSession } from "./open-repository.js";
|
|
7
|
+
import { openRepository, openSession, readOpenCommand } from "./open-repository.js";
|
|
8
8
|
import { TaskState } from "./state.js";
|
|
9
9
|
import { safeSingleLine } from "./text.js";
|
|
10
10
|
import { registerTaskTiming } from "./timing.js";
|
|
@@ -15,14 +15,15 @@ export default function tasksExtension(pi) {
|
|
|
15
15
|
let panel;
|
|
16
16
|
const state = new TaskState(pi, () => panel?.update());
|
|
17
17
|
const git = new GitStatusCache();
|
|
18
|
-
|
|
18
|
+
const getOpenCommand = () => readOpenCommand(pi.getSettings?.());
|
|
19
|
+
panel = new TasksPanelHost(state, git, getOpenCommand);
|
|
19
20
|
registerTaskTools(pi, state);
|
|
20
21
|
registerDelegatedTimeTools(pi, state);
|
|
21
22
|
registerTaskTiming(pi, state);
|
|
22
23
|
registerAgentTools(pi, state);
|
|
23
24
|
registerTrackingGuidance(pi);
|
|
24
25
|
registerTaskAutoContinue(pi, state);
|
|
25
|
-
registerWorksCommand(pi, state, git);
|
|
26
|
+
registerWorksCommand(pi, state, git, getOpenCommand);
|
|
26
27
|
pi.registerCommand("works-panel", {
|
|
27
28
|
description: "Set the works panel display mode",
|
|
28
29
|
handler: async (args, ctx) => {
|
|
@@ -47,15 +48,16 @@ export default function tasksExtension(pi) {
|
|
|
47
48
|
}
|
|
48
49
|
if (requested === "open" || requested === "open-session") {
|
|
49
50
|
try {
|
|
51
|
+
const command = getOpenCommand();
|
|
50
52
|
if (requested === "open-session")
|
|
51
|
-
await openSession(ctx.cwd, ctx.sessionManager.getSessionId());
|
|
53
|
+
await openSession(ctx.cwd, ctx.sessionManager.getSessionId(), command);
|
|
52
54
|
else
|
|
53
|
-
await openRepository(ctx.cwd);
|
|
54
|
-
ctx.ui.notify(requested === "open-session" ? "Opened session artifacts
|
|
55
|
+
await openRepository(ctx.cwd, command);
|
|
56
|
+
ctx.ui.notify(requested === "open-session" ? "Opened session artifacts." : "Opened repository.", "info");
|
|
55
57
|
}
|
|
56
58
|
catch (error) {
|
|
57
59
|
const reason = error instanceof Error ? ` ${safeSingleLine(error.message)}` : "";
|
|
58
|
-
ctx.ui.notify(`Could not open
|
|
60
|
+
ctx.ui.notify(`Could not open directory. Check pi-tasks.openCommand and that its executable is installed on PATH.${reason}`, "error");
|
|
59
61
|
}
|
|
60
62
|
return;
|
|
61
63
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export declare function
|
|
1
|
+
/** Read the executable and fixed arguments from Pi's merged settings. */
|
|
2
|
+
export declare function readOpenCommand(settings: unknown): string[];
|
|
3
|
+
/** Launch the configured command without a shell, appending the target directory. */
|
|
4
|
+
export declare function openRepository(cwd: string, command?: string[]): Promise<void>;
|
|
3
5
|
/** Open the existing direct or nested agent artifact root, creating a new root only if needed. */
|
|
4
|
-
export declare function openSession(cwd: string, sessionId: string): Promise<void>;
|
|
6
|
+
export declare function openSession(cwd: string, sessionId: string, command?: string[]): Promise<void>;
|
package/dist/open-repository.js
CHANGED
|
@@ -3,12 +3,26 @@ import { glob, mkdir, stat } from "node:fs/promises";
|
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
5
|
const execFileAsync = promisify(execFile);
|
|
6
|
-
/**
|
|
7
|
-
export
|
|
8
|
-
|
|
6
|
+
/** Read the executable and fixed arguments from Pi's merged settings. */
|
|
7
|
+
export function readOpenCommand(settings) {
|
|
8
|
+
const config = settings !== null && typeof settings === "object" ? settings["pi-tasks"] : undefined;
|
|
9
|
+
const command = config !== null && typeof config === "object" ? config.openCommand : undefined;
|
|
10
|
+
if (command === undefined)
|
|
11
|
+
return ["cursor"];
|
|
12
|
+
if (!Array.isArray(command) || command.length === 0 || command.some((part) => typeof part !== "string" || part.includes("\0")) || !command[0].trim()) {
|
|
13
|
+
throw new Error("pi-tasks.openCommand must be a nonempty array of strings starting with an executable, for example [\"code\", \"--new-window\"].");
|
|
14
|
+
}
|
|
15
|
+
return [...command];
|
|
16
|
+
}
|
|
17
|
+
/** Launch the configured command without a shell, appending the target directory. */
|
|
18
|
+
export async function openRepository(cwd, command = ["cursor"]) {
|
|
19
|
+
const [executable, ...args] = command;
|
|
20
|
+
if (!executable)
|
|
21
|
+
throw new Error("An open command executable is required.");
|
|
22
|
+
await execFileAsync(executable, [...args, "."], { cwd, timeout: 10_000, maxBuffer: 64 * 1024, windowsHide: true });
|
|
9
23
|
}
|
|
10
24
|
/** Open the existing direct or nested agent artifact root, creating a new root only if needed. */
|
|
11
|
-
export async function openSession(cwd, sessionId) {
|
|
25
|
+
export async function openSession(cwd, sessionId, command = ["cursor"]) {
|
|
12
26
|
if (!/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(sessionId))
|
|
13
27
|
throw new Error("A valid Pi session ID is required to open session artifacts.");
|
|
14
28
|
const repository = await execFileAsync("git", ["rev-parse", "--show-toplevel"], { cwd, timeout: 5_000, maxBuffer: 64 * 1024, windowsHide: true })
|
|
@@ -25,5 +39,5 @@ export async function openSession(cwd, sessionId) {
|
|
|
25
39
|
throw new Error("Multiple artifact folders match this session; open the intended folder explicitly.");
|
|
26
40
|
const directory = matches[0] ?? resolve(varRoot, sessionId);
|
|
27
41
|
await mkdir(directory, { recursive: true });
|
|
28
|
-
await openRepository(directory);
|
|
42
|
+
await openRepository(directory, command);
|
|
29
43
|
}
|
package/dist/ui/panel.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare function metricsContentWidth(width: number): number;
|
|
|
8
8
|
export declare class TasksPanelHost {
|
|
9
9
|
private readonly state;
|
|
10
10
|
private readonly git;
|
|
11
|
+
private readonly getOpenCommand;
|
|
11
12
|
private tui;
|
|
12
13
|
private panel;
|
|
13
14
|
private handle;
|
|
@@ -16,7 +17,7 @@ export declare class TasksPanelHost {
|
|
|
16
17
|
private minimized;
|
|
17
18
|
private cwd;
|
|
18
19
|
private sessionId;
|
|
19
|
-
constructor(state: TaskState, git: GitStatusCache);
|
|
20
|
+
constructor(state: TaskState, git: GitStatusCache, getOpenCommand: () => string[]);
|
|
20
21
|
attach(ui: ExtensionUIContext, cwd: string, sessionId: string): void;
|
|
21
22
|
setMode(mode: TasksPanelMode): void;
|
|
22
23
|
getMode(): TasksPanelMode;
|
package/dist/ui/panel.js
CHANGED
|
@@ -18,6 +18,7 @@ export function metricsContentWidth(width) {
|
|
|
18
18
|
export class TasksPanelHost {
|
|
19
19
|
state;
|
|
20
20
|
git;
|
|
21
|
+
getOpenCommand;
|
|
21
22
|
tui;
|
|
22
23
|
panel;
|
|
23
24
|
handle;
|
|
@@ -26,9 +27,10 @@ export class TasksPanelHost {
|
|
|
26
27
|
minimized = false;
|
|
27
28
|
cwd = "";
|
|
28
29
|
sessionId = "Session unavailable";
|
|
29
|
-
constructor(state, git) {
|
|
30
|
+
constructor(state, git, getOpenCommand) {
|
|
30
31
|
this.state = state;
|
|
31
32
|
this.git = git;
|
|
33
|
+
this.getOpenCommand = getOpenCommand;
|
|
32
34
|
}
|
|
33
35
|
attach(ui, cwd, sessionId) {
|
|
34
36
|
this.hideCurrent();
|
|
@@ -71,7 +73,7 @@ export class TasksPanelHost {
|
|
|
71
73
|
this.tui = tui;
|
|
72
74
|
this.panel = new TasksPanel(tui, this.state, theme, "widget", this.minimized, (minimized) => {
|
|
73
75
|
this.minimized = minimized;
|
|
74
|
-
}, (message, type) => ui.notify(message, type), this.cwd, this.git, this.sessionId);
|
|
76
|
+
}, (message, type) => ui.notify(message, type), this.cwd, this.git, this.sessionId, this.getOpenCommand);
|
|
75
77
|
return this.panel;
|
|
76
78
|
});
|
|
77
79
|
return;
|
|
@@ -80,7 +82,7 @@ export class TasksPanelHost {
|
|
|
80
82
|
this.tui = tui;
|
|
81
83
|
this.panel = new TasksPanel(tui, this.state, theme, "floating", this.minimized, (minimized) => {
|
|
82
84
|
this.minimized = minimized;
|
|
83
|
-
}, (message, type) => ui.notify(message, type), this.cwd, this.git, this.sessionId);
|
|
85
|
+
}, (message, type) => ui.notify(message, type), this.cwd, this.git, this.sessionId, this.getOpenCommand);
|
|
84
86
|
this.handle = tui.showOverlay(this.panel, {
|
|
85
87
|
anchor: "top-right",
|
|
86
88
|
width: "42%",
|
|
@@ -118,6 +120,7 @@ class TasksPanel {
|
|
|
118
120
|
cwd;
|
|
119
121
|
git;
|
|
120
122
|
sessionId;
|
|
123
|
+
getOpenCommand;
|
|
121
124
|
scrollOffset = 0;
|
|
122
125
|
pageSize = 1;
|
|
123
126
|
contentLength = 0;
|
|
@@ -133,7 +136,7 @@ class TasksPanel {
|
|
|
133
136
|
openHitRegion;
|
|
134
137
|
sessionHitRegion;
|
|
135
138
|
toggleHitRegion;
|
|
136
|
-
constructor(tui, state, theme, placement, minimized, onMinimizedChange, notify, cwd, git, sessionId) {
|
|
139
|
+
constructor(tui, state, theme, placement, minimized, onMinimizedChange, notify, cwd, git, sessionId, getOpenCommand) {
|
|
137
140
|
this.tui = tui;
|
|
138
141
|
this.state = state;
|
|
139
142
|
this.theme = theme;
|
|
@@ -144,6 +147,7 @@ class TasksPanel {
|
|
|
144
147
|
this.cwd = cwd;
|
|
145
148
|
this.git = git;
|
|
146
149
|
this.sessionId = sessionId;
|
|
150
|
+
this.getOpenCommand = getOpenCommand;
|
|
147
151
|
}
|
|
148
152
|
render(width) {
|
|
149
153
|
this.delegateHits = [];
|
|
@@ -247,11 +251,11 @@ class TasksPanel {
|
|
|
247
251
|
return { handled: true, render: true };
|
|
248
252
|
}
|
|
249
253
|
if (this.isHit(event.x, this.sessionHitRegion)) {
|
|
250
|
-
void this.
|
|
254
|
+
void this.openDirectory(true);
|
|
251
255
|
return { handled: true, render: true };
|
|
252
256
|
}
|
|
253
257
|
if (this.isHit(event.x, this.openHitRegion)) {
|
|
254
|
-
void this.
|
|
258
|
+
void this.openDirectory();
|
|
255
259
|
return { handled: true, render: true };
|
|
256
260
|
}
|
|
257
261
|
}
|
|
@@ -341,23 +345,24 @@ class TasksPanel {
|
|
|
341
345
|
this.openingDelegate = false;
|
|
342
346
|
}
|
|
343
347
|
}
|
|
344
|
-
async
|
|
348
|
+
async openDirectory(session = false) {
|
|
345
349
|
if (this.opening)
|
|
346
350
|
return;
|
|
347
351
|
this.opening = true;
|
|
348
352
|
this.tui.requestRender();
|
|
349
353
|
try {
|
|
354
|
+
const command = this.getOpenCommand();
|
|
350
355
|
if (session)
|
|
351
|
-
await openSession(this.cwd, this.sessionId);
|
|
356
|
+
await openSession(this.cwd, this.sessionId, command);
|
|
352
357
|
else
|
|
353
|
-
await openRepository(this.cwd);
|
|
358
|
+
await openRepository(this.cwd, command);
|
|
354
359
|
if (!this.disposed)
|
|
355
|
-
this.notify(session ? "Opened session artifacts
|
|
360
|
+
this.notify(session ? "Opened session artifacts." : "Opened repository.", "info");
|
|
356
361
|
}
|
|
357
362
|
catch (error) {
|
|
358
363
|
const reason = error instanceof Error ? ` ${safeSingleLine(error.message)}` : "";
|
|
359
364
|
if (!this.disposed)
|
|
360
|
-
this.notify(
|
|
365
|
+
this.notify(`Could not open ${session ? "session artifacts" : "repository"}. Check pi-tasks.openCommand and that its executable is installed on PATH.${reason}`, "error");
|
|
361
366
|
}
|
|
362
367
|
finally {
|
|
363
368
|
this.opening = false;
|
|
@@ -11,6 +11,7 @@ export declare class WorksDashboard implements Component, Focusable {
|
|
|
11
11
|
private readonly cwd;
|
|
12
12
|
private readonly git;
|
|
13
13
|
private readonly notify;
|
|
14
|
+
private readonly getOpenCommand;
|
|
14
15
|
focused: boolean;
|
|
15
16
|
private selectedKey;
|
|
16
17
|
private scrollOffset;
|
|
@@ -32,7 +33,7 @@ export declare class WorksDashboard implements Component, Focusable {
|
|
|
32
33
|
private toggleHitRegion;
|
|
33
34
|
private disposed;
|
|
34
35
|
private readonly refreshTimer;
|
|
35
|
-
constructor(tui: TUI, theme: Theme, keybindings: KeybindingsManager, state: TaskState, close: () => void, cwd: string, git: GitStatusCache, notify: (message: string, type: "error") => void);
|
|
36
|
+
constructor(tui: TUI, theme: Theme, keybindings: KeybindingsManager, state: TaskState, close: () => void, cwd: string, git: GitStatusCache, notify: (message: string, type: "error") => void, getOpenCommand: () => string[]);
|
|
36
37
|
render(width: number): string[];
|
|
37
38
|
handleInput(data: string): void;
|
|
38
39
|
handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
|
|
@@ -50,7 +51,7 @@ export declare class WorksDashboard implements Component, Focusable {
|
|
|
50
51
|
private toggleMinimized;
|
|
51
52
|
private isHit;
|
|
52
53
|
private openLinkedDelegate;
|
|
53
|
-
private
|
|
54
|
+
private openDirectory;
|
|
54
55
|
private copyAllAsMarkdown;
|
|
55
56
|
private renderFooter;
|
|
56
57
|
}
|
|
@@ -17,6 +17,7 @@ export class WorksDashboard {
|
|
|
17
17
|
cwd;
|
|
18
18
|
git;
|
|
19
19
|
notify;
|
|
20
|
+
getOpenCommand;
|
|
20
21
|
focused = false;
|
|
21
22
|
selectedKey;
|
|
22
23
|
scrollOffset = 0;
|
|
@@ -38,7 +39,7 @@ export class WorksDashboard {
|
|
|
38
39
|
toggleHitRegion;
|
|
39
40
|
disposed = false;
|
|
40
41
|
refreshTimer;
|
|
41
|
-
constructor(tui, theme, keybindings, state, close, cwd, git, notify) {
|
|
42
|
+
constructor(tui, theme, keybindings, state, close, cwd, git, notify, getOpenCommand) {
|
|
42
43
|
this.tui = tui;
|
|
43
44
|
this.theme = theme;
|
|
44
45
|
this.keybindings = keybindings;
|
|
@@ -47,6 +48,7 @@ export class WorksDashboard {
|
|
|
47
48
|
this.cwd = cwd;
|
|
48
49
|
this.git = git;
|
|
49
50
|
this.notify = notify;
|
|
51
|
+
this.getOpenCommand = getOpenCommand;
|
|
50
52
|
this.unsubscribeGit = git.subscribe(() => tui.requestRender());
|
|
51
53
|
this.refreshTimer = setInterval(() => {
|
|
52
54
|
if (!this.disposed)
|
|
@@ -140,7 +142,7 @@ export class WorksDashboard {
|
|
|
140
142
|
return;
|
|
141
143
|
}
|
|
142
144
|
if (matchesKey(data, "o")) {
|
|
143
|
-
void this.
|
|
145
|
+
void this.openDirectory();
|
|
144
146
|
return;
|
|
145
147
|
}
|
|
146
148
|
if (matchesKey(data, "m")) {
|
|
@@ -225,7 +227,7 @@ export class WorksDashboard {
|
|
|
225
227
|
return { handled: true, focus: true, render: true };
|
|
226
228
|
}
|
|
227
229
|
if (this.isHit(event.x, this.openHitRegion)) {
|
|
228
|
-
void this.
|
|
230
|
+
void this.openDirectory();
|
|
229
231
|
return { handled: true, focus: true, render: true };
|
|
230
232
|
}
|
|
231
233
|
return undefined;
|
|
@@ -418,21 +420,21 @@ export class WorksDashboard {
|
|
|
418
420
|
this.tui.requestRender();
|
|
419
421
|
}
|
|
420
422
|
}
|
|
421
|
-
async
|
|
423
|
+
async openDirectory() {
|
|
422
424
|
if (this.opening)
|
|
423
425
|
return;
|
|
424
426
|
this.opening = true;
|
|
425
|
-
this.message = "Opening repository
|
|
427
|
+
this.message = "Opening repository…";
|
|
426
428
|
this.messageColor = "warning";
|
|
427
429
|
this.tui.requestRender();
|
|
428
430
|
try {
|
|
429
|
-
await openRepository(this.cwd);
|
|
430
|
-
this.message = "Opened repository
|
|
431
|
+
await openRepository(this.cwd, this.getOpenCommand());
|
|
432
|
+
this.message = "Opened repository.";
|
|
431
433
|
this.messageColor = "success";
|
|
432
434
|
}
|
|
433
435
|
catch (error) {
|
|
434
436
|
const reason = error instanceof Error ? ` ${safeSingleLine(error.message)}` : "";
|
|
435
|
-
this.message = `Could not open
|
|
437
|
+
this.message = `Could not open repository. Check pi-tasks.openCommand and that its executable is installed on PATH.${reason}`;
|
|
436
438
|
this.messageColor = "error";
|
|
437
439
|
if (!this.disposed)
|
|
438
440
|
this.notify(this.message, "error");
|
|
@@ -469,7 +471,7 @@ export class WorksDashboard {
|
|
|
469
471
|
}
|
|
470
472
|
}
|
|
471
473
|
renderFooter(width) {
|
|
472
|
-
const text = "↑/↓ select · Enter details · Esc close · C copy · O
|
|
474
|
+
const text = "↑/↓ select · Enter details · Esc close · C copy · O open · D delegate · M minimize";
|
|
473
475
|
return truncateToWidth(this.theme.fg("muted", text), width, "");
|
|
474
476
|
}
|
|
475
477
|
}
|
package/docs/REFERENCE.md
CHANGED
|
@@ -88,13 +88,13 @@ Any active task across all Works on the current branch requires continuation. Le
|
|
|
88
88
|
|
|
89
89
|
When `maxContinuations` is supplied, at most that many extra continuations are requested per fresh accepted main user run. The next unfinished boundary warns once and suspends continuation; a fresh user prompt resets the cap. With no limit supplied, continuation can consume tokens indefinitely while unfinished records remain, until explicitly interrupted, disabled or otherwise suspended, including during repeated provider failures. This is not a cost cap or a cap on native tool/retry requests, and another extension may independently request work. Settings changes take effect when Pi reloads effective settings, normally through `/reload`.
|
|
90
90
|
|
|
91
|
-
## Repository status and
|
|
91
|
+
## Repository status and opening directories
|
|
92
92
|
|
|
93
93
|
Both terminal views share a cwd-scoped asynchronous Git status cache, separate from persisted work/todo state. The top border centers `git <branch> · S<staged> U<unstaged> ?<untracked>`; zero counts collapse to `clean`, detached HEAD uses `@<shortcommit>`, and narrow frames shorten the branch first. The border label remains when minimized. Initial loading displays `git loading…`, non-repositories have a plain border, and initial read failures display `git unavailable`; refreshes and later failures retain the prior snapshot.
|
|
94
94
|
|
|
95
95
|
The implementation is informed by [pi-powerline-footer's cache behavior](https://github.com/nicobailon/pi-powerline-footer/blob/main/git-status.ts): a one-second cache, asynchronous stale-while-refresh reads, deduplicated requests, cwd/generation guards, read-only Git environment (`GIT_OPTIONAL_LOCKS=0`), and bounded child processes. This extension reads branch and file counts together rather than running a separate branch timer. Attached views share the poller; unsubscribing the last view or shutting down releases it. File-changing `write`, `edit`, and `bash` results expire cached data sooner.
|
|
96
96
|
|
|
97
|
-
Open appears between Copy and Minimize/Maximize. It executes `cursor` with the separate argument `.` in the active session working directory, without a shell. The executable must be on PATH; errors are shown instead of silently failing. `/works-panel open` supplies a command path, and `/works` uses `o`. Open is also available outside Git repositories.
|
|
97
|
+
Open appears between Copy and Minimize/Maximize. It executes the command from `pi-tasks.openCommand` (default `["cursor"]`) with the separate argument `.` appended in the active session working directory, without a shell. The executable must be on PATH or specified by absolute path; errors are shown instead of silently failing. `/works-panel open` supplies a command path, and `/works` uses `o`. Open is also available outside Git repositories.
|
|
98
98
|
|
|
99
99
|
### Ownership display
|
|
100
100
|
|
|
@@ -110,10 +110,10 @@ AgentCreate marks the parent task blocked and stores herdr-pane and herdr-monito
|
|
|
110
110
|
|
|
111
111
|
Delegate navigation and AgentFocus first focus the pane, then explicitly activate the tab returned by Herdr; pane-focus success alone does not guarantee that the visible client switched tabs.
|
|
112
112
|
|
|
113
|
-
Linked `[delegate]` badges and
|
|
113
|
+
Linked `[delegate]` badges and Open controls are underlined. Fullscreen mouse regions use ANSI-aware visible columns and only include complete visible badges after clipping and scrolling. Floating/widget rows, dashboard rows and todo detail headings support clicks; hidden/minimized/offscreen badges have no regions. In `/works`, `d` opens the selected task's delegate, and `/works-panel delegate T<number>` provides a command path in regular mode. Outside Herdr or without a pane link, ownership stays informational and is not underlined. Unavailable CLI, stale/closed targets and other navigation failures produce visible errors.
|
|
114
114
|
|
|
115
115
|
## Interfaces
|
|
116
116
|
|
|
117
|
-
The compact panel defaults to a non-capturing floating overlay anchored at the top-right. Its header hides the session ID and places an underlined Open session action immediately after Copy, including minimized/widget layouts. The action uses the Pi session-context identity to locate the matching direct/nested artifact directory under repository var and opens it via the
|
|
117
|
+
The compact panel defaults to a non-capturing floating overlay anchored at the top-right. Its header hides the session ID and places an underlined Open session action immediately after Copy, including minimized/widget layouts. The action uses the Pi session-context identity to locate the matching direct/nested artifact directory under repository var and opens it via the configured shell-free launcher. If absent, the standard var/sessionId directory is created on activation; ambiguous matches or unsafe identity fail visibly. No lookup or process launch occurs during rendering. /works-panel open-session supplies a keyboard-command path. Existing repository Open remains separate. On narrow headers, Minimize/Maximize shorten to [-]/[+] to preserve every action and its hit region; overflow hints use remaining space. It prefixes work and todo names with bracketed IDs (`[W1] Name`, `[T1] [self] Name`), alongside status icons, completion counts, and a visible row range when content exceeds the terminal-aware viewport. It hides on terminals narrower than 90 columns or shorter than 18 rows. In fullscreen TUI mode, its title-bar Copy action exports every work and nested todo as Markdown, while Minimize collapses the panel to a restorable title bar that keeps Copy, Open, and Maximize available. `/works-panel minimize` and `/works-panel maximize` provide a keyboard-command path and preserve the collapsed state when switching between floating and widget layouts. Overflow starts at the newest rows and follows newly added tail rows until the user scrolls upward. Mouse-wheel events over the expanded floating panel scroll it directly without taking keyboard focus; regular terminal mode shows the newest rows and uses `/works` for complete browsing and copying. Because Pi treats any persistent overlay as active, the floating mode can block display-mode changes. `/works-panel widget` switches to a right-aligned widget above the editor, renders all rows, and retains the title actions, while `/works-panel off` hides it.
|
|
118
118
|
|
|
119
|
-
`/works` opens a top-centered detailed overlay. List rows and detail headings use the same bracketed ID and ownership prefixes; list metadata no longer repeats the ID after the name. The dashboard title remains unchanged. Stored names remain unchanged. Its top-right Copy action uses `c` to copy every work and nested todo to the system clipboard as Markdown. Its Open action uses `o` to open the current directory
|
|
119
|
+
`/works` opens a top-centered detailed overlay. List rows and detail headings use the same bracketed ID and ownership prefixes; list metadata no longer repeats the ID after the name. The dashboard title remains unchanged. Stored names remain unchanged. Its top-right Copy action uses `c` to copy every work and nested todo to the system clipboard as Markdown. Its Open action uses `o` to open the current directory using the configured command. Its Minimize action uses `m` to collapse the overlay to a framed top bar containing live total work and todo counts, Copy, Open, and a Maximize action; activating Maximize restores the full dashboard. In fullscreen TUI mode, Copy, Open, and Minimize/Maximize also respond to left clicks. Configured selection keys choose records; confirmation or a row click opens a dedicated full detail view that replaces the list within the existing overlay. The view shows Back to works, ID/owner, name, parent work, status/progress/time, a prominent `Reason: ...` line when blocked, and full details. Arrow keys, Page Up/Page Down, and the mouse wheel scroll long details. The Back action or configured cancel key returns to the same list selection and scroll position; cancel from the list closes the dashboard. Delegate badges remain independent click targets and retain their agent-navigation behavior. Work rows also open full Work details. Missing/deleted selections return to the list.
|
package/docs/USAGE_GUIDE.md
CHANGED
|
@@ -79,6 +79,22 @@ Press Escape/abort to stop. The extension will not restart from a monitor wake o
|
|
|
79
79
|
|
|
80
80
|
Omitting `maxContinuations` means no continuation limit: it can keep consuming tokens while unfinished records remain. Manual abort and all other stopping conditions still apply. To cap it, add a positive integer such as `"maxContinuations": 10`. After the configured number of extra continuations, the extension warns and hands control back without changing records. A fresh accepted main user run resets the limit; a rejected prompt or steering/follow-up input queued inside a running activity does not. Set `enabled` to `false` and reload to disable the feature. It checks recorded states, not whether every user requirement was captured or genuinely verified.
|
|
81
81
|
|
|
82
|
+
## Configure Open and Open Session
|
|
83
|
+
|
|
84
|
+
Both actions share `pi-tasks.openCommand` in global `~/.pi/agent/settings.json` (or your custom agent directory) or a trusted project's `.pi/settings.json`. For example, to use VS Code:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"pi-tasks": {
|
|
89
|
+
"openCommand": ["code", "--new-window"]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Merge this field into your existing settings, then run `/reload`. The array contains an executable followed by optional fixed arguments; the target directory is appended as a separate `.` argument, with the process working directory set to the repository/session directory or session artifact folder. For example, the setting above runs `code --new-window .`. Use `["cursor"]` for Cursor, `["zed"]` for Zed, or `["open", "-a", "Visual Studio Code"]` on macOS. Executable paths and arguments containing spaces belong in individual array entries; no shell quoting, expansion, pipelines, or command substitution is performed.
|
|
95
|
+
|
|
96
|
+
Omitting the setting retains `["cursor"]`. Empty arrays, blank executables, non-string entries, and NUL characters are rejected visibly without launching anything. The executable must be installed on PATH or specified by absolute path. Configuration requires a Pi host with `pi.getSettings()` (Pi 1.2.0+); older hosts retain the Cursor default. Trusted project settings override global settings through Pi's settings API. The floating panel, widget, `/works` Open/`o`, and `/works-panel open|open-session` all use this setting. Open still targets the current session working directory; Open Session still locates or creates this agent's artifact folder.
|
|
97
|
+
|
|
82
98
|
## Work tools
|
|
83
99
|
|
|
84
100
|
```text
|
|
@@ -205,24 +221,24 @@ AgentCreate returns `assignmentSent: false`. Confirm MonitorList shows `Herdr si
|
|
|
205
221
|
|
|
206
222
|
Use actual paneId values, not pane names or a separate agent handle. These wrappers assume an agent pane is not repurposed. There are no process/session checks, startup receipts, registry, automatic reconnection, retry or rollback framework. Ordinary CLI errors are returned with any handles already obtained so the caller can inspect and decide what to do. Close only resources you created; a done signal does not automatically close anything or complete a task. If monitoring stops, use the existing monitor tools to inspect/reconnect explicitly.
|
|
207
223
|
|
|
208
|
-
Inside Herdr (`HERDR_ENV=1`), a linked `[delegate]` is underlined. In fullscreen mode, click that badge in compact/widget rows, dashboard rows, or task detail headings to focus its agent pane. Only fully visible badges are clickable. In `/works`, select the task and press `d`; `/works-panel delegate T<number>` provides a command path, including regular terminal mode. `[Open]` / `[O Open]` are also underlined and
|
|
224
|
+
Inside Herdr (`HERDR_ENV=1`), a linked `[delegate]` is underlined. In fullscreen mode, click that badge in compact/widget rows, dashboard rows, or task detail headings to focus its agent pane. Only fully visible badges are clickable. In `/works`, select the task and press `d`; `/works-panel delegate T<number>` provides a command path, including regular terminal mode. `[Open]` / `[O Open]` are also underlined and use the configured open command. Unlinked badges are not underlined, because they are not navigation actions.
|
|
209
225
|
|
|
210
226
|
Navigation directly focuses the linked paneId through Herdr. Closed panes, missing Herdr CLI and command errors are reported. No subprocess runs during rendering. Agent tools coordinate Herdr resources; pi-loop-monitor remains the sole monitoring runtime. Outside Herdr, badges remain informational.
|
|
211
227
|
|
|
212
|
-
The compact panel no longer displays the session ID. Before Copy, its header shows nonzero task-state counts across all Works: `3!` blocked, `2▶` active, `5✓` completed, and `1×` cancelled, using the same icon colors as task rows. Counts update in floating, widget and minimized layouts; narrow headers shorten the toggle and truncate the summary when needed. Its underlined `[Open session]` action sits immediately after Copy in floating, widget and minimized layouts. It opens this agent's existing artifact directory under repository `var/`
|
|
228
|
+
The compact panel no longer displays the session ID. Before Copy, its header shows nonzero task-state counts across all Works: `3!` blocked, `2▶` active, `5✓` completed, and `1×` cancelled, using the same icon colors as task rows. Counts update in floating, widget and minimized layouts; narrow headers shorten the toggle and truncate the summary when needed. Its underlined `[Open session]` action sits immediately after Copy in floating, widget and minimized layouts. It opens this agent's existing artifact directory under repository `var/` using the configured command, including a nested delegated session folder. If no folder exists, it creates `var/<full-sessionId>/`; multiple matching folders report an ambiguity rather than guessing. Session identity comes from Pi's context, not a pane name. Folder resolution and command launch happen only on activation, never during rendering. `/works-panel open-session` is the keyboard-command alternative. The existing Open action still opens the repository. Narrow compact headers use `[-]`/`[+]` for Minimize/Maximize so all actions fit. The `/works` dashboard retains its existing title and controls.
|
|
213
229
|
|
|
214
230
|
The panel defaults to a floating top-right layout and does not take keyboard focus. Its minimum box width is 48 columns to leave room for names beside both metrics; the widget hides below 48 columns. Separated right-hand Done and Time columns keep work/task percentages and measured durations aligned and visible even when names are long; the left side retains names, task status icons and Work task-counts. Work rows have no status icons. It hides on small terminals. The top border centers repository-wide Git status: `git main · S2 U3 ?1` means two staged files, three unstaged files, and one untracked file; a file with both staged and unstaged edits counts in both. A clean repository shows `git main · clean`. Long branches shorten before counts. Detached HEAD shows `@` plus the short commit. Git remains visible while minimized and adds no content row.
|
|
215
231
|
|
|
216
232
|
The asynchronous Git cache refreshes every second while a view is attached; file-changing tool results expire it sooner without blanking the last snapshot. Initial reads show `git loading…`; outside Git the border is plain, and initial failures show `git unavailable`. Later refresh failures retain the last snapshot until a successful read. Polling is read-only and stops when both the panel and dashboard are closed/off.
|
|
217
233
|
|
|
218
|
-
In fullscreen TUI mode, click Copy in its title bar to copy every work and todo as Markdown, Open to run
|
|
234
|
+
In fullscreen TUI mode, click Copy in its title bar to copy every work and todo as Markdown, Open to run the configured command in the current session directory, or Minimize to collapse the panel to a small title bar. Copy and Open remain available while minimized, and Maximize restores the rows. The configured executable must be on PATH (or be an absolute path); launch failures produce visible error feedback. When more rows exist than fit, the floating panel starts at the newest rows; move the mouse over it and use the wheel to scroll older or newer rows without taking focus from the editor. In regular terminal mode, open `/works` to browse and copy the complete list.
|
|
219
235
|
|
|
220
236
|
Use `/works-panel minimize`, `/works-panel maximize`, `/works-panel open`, or `/works-panel open-session` when mouse input is unavailable. Use `/works-panel widget` for a right-aligned layout above the editor that renders every row and retains the clickable title actions, `/works-panel floating` to return to the floating layout, or `/works-panel off` to hide it.
|
|
221
237
|
|
|
222
238
|
Run `/works` for full details. Its top border mirrors repository-wide Git status, and its top bar includes Copy, Open, and Minimize actions. In fullscreen TUI mode, click Minimize to collapse the dashboard to a top bar showing the current work and todo totals; click Maximize to restore it. The actions also have keyboard shortcuts that work in regular terminal mode.
|
|
223
239
|
|
|
224
240
|
- `c`: copy all works and todos as Markdown
|
|
225
|
-
- `o`: open the current repository/session directory
|
|
241
|
+
- `o`: open the current repository/session directory using the configured command
|
|
226
242
|
- `d`: open the selected task's linked delegated agent
|
|
227
243
|
- `m`: minimize or maximize the dashboard
|
|
228
244
|
- Fullscreen left click: activate header actions, or click a task/work row to open its full details. Clicking a linked delegate badge still opens its agent.
|