@abhishek944/pi-tasks 0.1.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/dist/tools.js ADDED
@@ -0,0 +1,173 @@
1
+ import { StringEnum } from "@earendil-works/pi-ai";
2
+ import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead } from "@earendil-works/pi-coding-agent";
3
+ import { Type } from "typebox";
4
+ import { renderTaskCall, renderTaskResult, taskResult } from "./tool-result.js";
5
+ const WorkStatusSchema = StringEnum(["planned", "active", "blocked", "completed", "cancelled"]);
6
+ const TodoStatusSchema = StringEnum(["pending", "active", "blocked", "completed", "cancelled"]);
7
+ const NameSchema = Type.String({ minLength: 1, maxLength: 240 });
8
+ const InfoSchema = Type.String({ minLength: 1, maxLength: 10_000 });
9
+ export function registerTaskTools(pi, state) {
10
+ pi.registerTool({
11
+ name: "WorkCreate",
12
+ label: "WorkCreate",
13
+ description: "Create a session-scoped work item. Use detailed workInfo that preserves the goal, context, scope, constraints, decisions, and expected outcome.",
14
+ promptSnippet: "Create a session-scoped work item before starting substantial actionable work",
15
+ promptGuidelines: [
16
+ "Use WorkCreate for normal requests that start new work in the main conversation; never use it during /ask or /btw.",
17
+ "Before creating work, use WorkList to avoid duplicating an existing work item.",
18
+ ],
19
+ parameters: Type.Object({
20
+ workName: NameSchema,
21
+ workInfo: InfoSchema,
22
+ status: Type.Optional(WorkStatusSchema),
23
+ }, { additionalProperties: false }),
24
+ execute(_id, params) {
25
+ const work = state.createWork(params.workName, params.workInfo, params.status);
26
+ return Promise.resolve(taskResult(`Created work ${work.workId}: ${work.workName} [${work.status}]`, "work-create", { workId: work.workId }));
27
+ },
28
+ renderCall: renderTaskCall("WorkCreate"),
29
+ renderResult: renderTaskResult,
30
+ });
31
+ pi.registerTool({
32
+ name: "WorkList",
33
+ label: "WorkList",
34
+ description: "List session-scoped works and their associated todos. Results include detailed workInfo and taskInfo and are truncated at 50KB or 2000 lines.",
35
+ parameters: Type.Object({
36
+ workId: Type.Optional(Type.String()),
37
+ status: Type.Optional(WorkStatusSchema),
38
+ }, { additionalProperties: false }),
39
+ execute(_id, params) {
40
+ const works = state.listWorks({ workId: params.workId, status: params.status });
41
+ return Promise.resolve(taskResult(bounded(formatWorks(works)), "work-list", { count: works.length }, `${works.length} work${works.length === 1 ? "" : "s"} found`));
42
+ },
43
+ renderCall: renderTaskCall("WorkList"),
44
+ renderResult: renderTaskResult,
45
+ });
46
+ pi.registerTool({
47
+ name: "WorkUpdate",
48
+ label: "WorkUpdate",
49
+ description: "Update a work's name, detailed information, or status. Use before implementation to mark relevant work active and after progress to keep its detailed context current.",
50
+ promptSnippet: "Update work status and detailed context as actionable work progresses",
51
+ promptGuidelines: ["Use WorkUpdate and TodoUpdate before and after actionable main-conversation work; never update tracking during /ask or /btw."],
52
+ parameters: Type.Object({
53
+ workId: Type.String(),
54
+ workName: Type.Optional(NameSchema),
55
+ workInfo: Type.Optional(InfoSchema),
56
+ status: Type.Optional(WorkStatusSchema),
57
+ }, { additionalProperties: false, minProperties: 2 }),
58
+ execute(_id, params) {
59
+ const work = state.updateWork(params.workId, { workName: params.workName, workInfo: params.workInfo, status: params.status });
60
+ return Promise.resolve(taskResult(`Updated work ${work.workId}: ${work.workName} [${work.status}]`, "work-update", { workId: work.workId }));
61
+ },
62
+ renderCall: renderTaskCall("WorkUpdate"),
63
+ renderResult: renderTaskResult,
64
+ });
65
+ pi.registerTool({
66
+ name: "WorkDelete",
67
+ label: "WorkDelete",
68
+ description: "Delete a work and every associated todo from the current session branch. Use only for explicit cancellation or mistaken entries.",
69
+ parameters: Type.Object({ workId: Type.String() }, { additionalProperties: false }),
70
+ execute(_id, params) {
71
+ const work = state.getWork(params.workId);
72
+ if (!work)
73
+ throw new Error(`Work ${params.workId} not found.`);
74
+ const todoCount = state.listTodos({ workId: params.workId }).length;
75
+ state.deleteWork(params.workId);
76
+ return Promise.resolve(taskResult(`Deleted work ${params.workId} and ${todoCount} associated todo${todoCount === 1 ? "" : "s"}.`, "work-delete"));
77
+ },
78
+ renderCall: renderTaskCall("WorkDelete"),
79
+ renderResult: renderTaskResult,
80
+ });
81
+ pi.registerTool({
82
+ name: "TodoCreate",
83
+ label: "TodoCreate",
84
+ description: "Create a todo under an existing work. taskInfo must contain enough detailed context, scope, constraints, expected outcome, and verification guidance to execute the task without guessing.",
85
+ promptSnippet: "Create detailed todos under the current work before implementation",
86
+ promptGuidelines: [
87
+ "Use TodoCreate only under an existing work and only for actionable main-conversation work; never use it during /ask or /btw.",
88
+ "Keep taskInfo detailed, current, and self-contained.",
89
+ ],
90
+ parameters: Type.Object({
91
+ workId: Type.String(),
92
+ taskName: NameSchema,
93
+ taskInfo: InfoSchema,
94
+ status: Type.Optional(TodoStatusSchema),
95
+ }, { additionalProperties: false }),
96
+ execute(_id, params) {
97
+ const todo = state.createTodo(params.workId, params.taskName, params.taskInfo, params.status);
98
+ return Promise.resolve(taskResult(`Created todo ${todo.taskId} under ${todo.workId}: ${todo.taskName} [${todo.status}]`, "todo-create", { taskId: todo.taskId, workId: todo.workId }));
99
+ },
100
+ renderCall: renderTaskCall("TodoCreate"),
101
+ renderResult: renderTaskResult,
102
+ });
103
+ pi.registerTool({
104
+ name: "TodoList",
105
+ label: "TodoList",
106
+ description: "List todos by task, work, or status. Results include detailed taskInfo and are truncated at 50KB or 2000 lines.",
107
+ parameters: Type.Object({
108
+ taskId: Type.Optional(Type.String()),
109
+ workId: Type.Optional(Type.String()),
110
+ status: Type.Optional(TodoStatusSchema),
111
+ }, { additionalProperties: false }),
112
+ execute(_id, params) {
113
+ const todos = state.listTodos({ taskId: params.taskId, workId: params.workId, status: params.status });
114
+ return Promise.resolve(taskResult(bounded(formatTodos(todos)), "todo-list", { count: todos.length }, `${todos.length} todo${todos.length === 1 ? "" : "s"} found`));
115
+ },
116
+ renderCall: renderTaskCall("TodoList"),
117
+ renderResult: renderTaskResult,
118
+ });
119
+ pi.registerTool({
120
+ name: "TodoUpdate",
121
+ label: "TodoUpdate",
122
+ description: "Update a todo's name, detailed information, or status. Mark a todo active immediately before starting it and completed or blocked after the attempt.",
123
+ promptSnippet: "Keep todo status and detailed context synchronized with active work",
124
+ promptGuidelines: ["Use TodoUpdate immediately before and after working on a todo in the main conversation; never update tracking during /ask or /btw."],
125
+ parameters: Type.Object({
126
+ taskId: Type.String(),
127
+ taskName: Type.Optional(NameSchema),
128
+ taskInfo: Type.Optional(InfoSchema),
129
+ status: Type.Optional(TodoStatusSchema),
130
+ }, { additionalProperties: false, minProperties: 2 }),
131
+ execute(_id, params) {
132
+ const todo = state.updateTodo(params.taskId, { taskName: params.taskName, taskInfo: params.taskInfo, status: params.status });
133
+ return Promise.resolve(taskResult(`Updated todo ${todo.taskId}: ${todo.taskName} [${todo.status}]`, "todo-update", { taskId: todo.taskId, workId: todo.workId }));
134
+ },
135
+ renderCall: renderTaskCall("TodoUpdate"),
136
+ renderResult: renderTaskResult,
137
+ });
138
+ pi.registerTool({
139
+ name: "TodoDelete",
140
+ label: "TodoDelete",
141
+ description: "Delete a todo from its work. Use only for explicit cancellation, scope removal, or mistaken entries.",
142
+ parameters: Type.Object({ taskId: Type.String() }, { additionalProperties: false }),
143
+ execute(_id, params) {
144
+ const todo = state.getTodo(params.taskId);
145
+ if (!todo)
146
+ throw new Error(`Todo ${params.taskId} not found.`);
147
+ state.deleteTodo(params.taskId);
148
+ return Promise.resolve(taskResult(`Deleted todo ${params.taskId}: ${todo.taskName}`, "todo-delete"));
149
+ },
150
+ renderCall: renderTaskCall("TodoDelete"),
151
+ renderResult: renderTaskResult,
152
+ });
153
+ }
154
+ function formatWorks(works) {
155
+ if (works.length === 0)
156
+ return "No works found in this session.";
157
+ return works.map((work) => [
158
+ `${work.workId} [${work.status}] ${work.workName}`,
159
+ `Work info:\n${work.workInfo}`,
160
+ work.tasks.length ? `Todos:\n${formatTodos(work.tasks)}` : "Todos: none",
161
+ ].join("\n")).join("\n\n---\n\n");
162
+ }
163
+ function formatTodos(todos) {
164
+ if (todos.length === 0)
165
+ return "No todos found.";
166
+ return todos.map((todo) => `${todo.taskId} [${todo.status}] ${todo.taskName}\nWork: ${todo.workId}\nTask info:\n${todo.taskInfo}`).join("\n\n");
167
+ }
168
+ function bounded(text) {
169
+ const result = truncateHead(text, { maxBytes: DEFAULT_MAX_BYTES, maxLines: DEFAULT_MAX_LINES });
170
+ if (!result.truncated)
171
+ return result.content;
172
+ return `${result.content}\n\n[Output truncated: ${result.outputLines}/${result.totalLines} lines, ${formatSize(result.outputBytes)}/${formatSize(result.totalBytes)}.]`;
173
+ }
@@ -0,0 +1,2 @@
1
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
+ export declare function registerTrackingGuidance(pi: ExtensionAPI): void;
@@ -0,0 +1,27 @@
1
+ const REQUIRED_TRACKING_TOOLS = ["WorkCreate", "WorkList", "WorkUpdate", "TodoCreate", "TodoList", "TodoUpdate"];
2
+ const TRACKING_GUIDANCE = `[SESSION COORDINATION]
3
+ Work is the overall outcome being pursued. A todo is a concrete step that belongs to a work. A monitor runs one long-lived background command. A loop schedules a future, recurring, event-driven, or idle continuation.
4
+
5
+ For every normal user request that starts or continues work, keep the session's work and todo records synchronized. Do not skip tracking because the work looks small.
6
+
7
+ Before implementation, investigation, or any other requested work:
8
+ 1. Use WorkList and TodoList to find the relevant existing records and avoid duplicates.
9
+ 2. If no suitable work exists, create one with WorkCreate. Otherwise use WorkUpdate to refresh its detailed workInfo and mark it active.
10
+ 3. Create or update the work's todos so they match the requested scope. Keep taskInfo detailed and self-contained.
11
+ 4. Mark the todo being attempted active with TodoUpdate before doing that work.
12
+
13
+ During and after the attempt:
14
+ - When available, use MonitorCreate only when a command should continue in the background; inspect it with MonitorList and do not poll it with shell sleep loops.
15
+ - When available, use LoopCreate only when work needs a future or repeated wake. Do not create a loop for ordinary synchronous work.
16
+ - A loop or monitor does not replace work and todo status. Update the related todo when its result is known.
17
+ - Mark the todo completed, blocked, or cancelled as appropriate and update taskInfo with important current context.
18
+ - Keep the work active while required todos remain, blocked when progress cannot continue, and completed only when its required todos are complete.
19
+ - Never create or update works, todos, loops, or monitors during /ask, /btw, or any BTW side thread.`;
20
+ export function registerTrackingGuidance(pi) {
21
+ pi.on("before_agent_start", (event) => {
22
+ const active = new Set(pi.getActiveTools());
23
+ if (!REQUIRED_TRACKING_TOOLS.every((name) => active.has(name)))
24
+ return;
25
+ return { systemPrompt: `${event.systemPrompt}\n\n${TRACKING_GUIDANCE}` };
26
+ });
27
+ }
@@ -0,0 +1,55 @@
1
+ export type WorkStatus = "planned" | "active" | "blocked" | "completed" | "cancelled";
2
+ export type TodoStatus = "pending" | "active" | "blocked" | "completed" | "cancelled";
3
+ export interface Work {
4
+ workId: string;
5
+ workName: string;
6
+ workInfo: string;
7
+ status: WorkStatus;
8
+ createdAt: number;
9
+ updatedAt: number;
10
+ }
11
+ export interface Todo {
12
+ taskId: string;
13
+ workId: string;
14
+ taskName: string;
15
+ taskInfo: string;
16
+ status: TodoStatus;
17
+ createdAt: number;
18
+ updatedAt: number;
19
+ }
20
+ export interface WorkWithTodos extends Work {
21
+ tasks: Todo[];
22
+ }
23
+ export type TaskEvent = {
24
+ version: 1;
25
+ type: "work-created";
26
+ at: number;
27
+ work: Work;
28
+ } | {
29
+ version: 1;
30
+ type: "work-updated";
31
+ at: number;
32
+ workId: string;
33
+ patch: Partial<Pick<Work, "workName" | "workInfo" | "status">>;
34
+ } | {
35
+ version: 1;
36
+ type: "work-deleted";
37
+ at: number;
38
+ workId: string;
39
+ } | {
40
+ version: 1;
41
+ type: "todo-created";
42
+ at: number;
43
+ todo: Todo;
44
+ } | {
45
+ version: 1;
46
+ type: "todo-updated";
47
+ at: number;
48
+ taskId: string;
49
+ patch: Partial<Pick<Todo, "taskName" | "taskInfo" | "status">>;
50
+ } | {
51
+ version: 1;
52
+ type: "todo-deleted";
53
+ at: number;
54
+ taskId: string;
55
+ };
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { ExtensionCommandContext, KeybindingsManager, Theme } from "@earendil-works/pi-coding-agent";
2
+ import { type Component, type Focusable, type TUI } from "@earendil-works/pi-tui";
3
+ type OverlayComponent = Component & Focusable & {
4
+ dispose?(): void;
5
+ };
6
+ export declare function runWorksOverlay(ctx: ExtensionCommandContext, createComponent: (tui: TUI, theme: Theme, keybindings: KeybindingsManager, close: () => void) => OverlayComponent): Promise<void>;
7
+ export {};
@@ -0,0 +1,50 @@
1
+ export async function runWorksOverlay(ctx, createComponent) {
2
+ let component;
3
+ let handle;
4
+ let ownerTui;
5
+ let closed = false;
6
+ let pendingOutcome;
7
+ let finish;
8
+ const completeClose = () => {
9
+ if (!handle || !ownerTui || !pendingOutcome || !finish)
10
+ return;
11
+ handle.hide();
12
+ ownerTui.showOverlay({ render: () => [], invalidate: () => { } }, { width: 1, maxHeight: 1, visible: () => false, nonCapturing: true });
13
+ const outcome = pendingOutcome;
14
+ pendingOutcome = undefined;
15
+ finish(outcome);
16
+ };
17
+ const close = (error) => {
18
+ if (closed)
19
+ return;
20
+ closed = true;
21
+ pendingOutcome = error === undefined ? {} : { error };
22
+ completeClose();
23
+ };
24
+ const outcome = await ctx.ui.custom((tui, theme, keybindings, done) => {
25
+ ownerTui = tui;
26
+ finish = done;
27
+ component = createComponent(tui, theme, keybindings, () => close());
28
+ component.focused = handle?.isFocused() ?? true;
29
+ return component;
30
+ }, {
31
+ overlay: true,
32
+ overlayOptions: {
33
+ width: "78%",
34
+ minWidth: 72,
35
+ maxHeight: "82%",
36
+ anchor: "top-center",
37
+ margin: { top: 1, left: 2, right: 2 },
38
+ nonCapturing: true,
39
+ },
40
+ onHandle: (overlayHandle) => {
41
+ handle = overlayHandle;
42
+ handle.focus();
43
+ if (component)
44
+ component.focused = handle.isFocused();
45
+ completeClose();
46
+ },
47
+ });
48
+ if (outcome.error !== undefined)
49
+ throw outcome.error;
50
+ }
@@ -0,0 +1,25 @@
1
+ import type { ExtensionUIContext, Theme } from "@earendil-works/pi-coding-agent";
2
+ import type { TaskState } from "../state.js";
3
+ import type { TodoStatus, WorkStatus } from "../types.js";
4
+ export type TasksPanelMode = "floating" | "widget" | "off";
5
+ export declare class TasksPanelHost {
6
+ private readonly state;
7
+ private tui;
8
+ private panel;
9
+ private handle;
10
+ private ui;
11
+ private mode;
12
+ constructor(state: TaskState);
13
+ attach(ui: ExtensionUIContext): void;
14
+ setMode(mode: TasksPanelMode): void;
15
+ getMode(): TasksPanelMode;
16
+ update(): void;
17
+ hide(): void;
18
+ private applyMode;
19
+ private hideCurrent;
20
+ }
21
+ export declare function workIcon(status: WorkStatus, theme: Theme): string;
22
+ export declare function todoIcon(status: TodoStatus, theme: Theme): string;
23
+ export declare function frame(content: string, innerWidth: number, theme: Theme): string;
24
+ export declare function rule(innerWidth: number, theme: Theme): string;
25
+ export declare function border(innerWidth: number, edge: "top" | "bottom", theme: Theme): string;
@@ -0,0 +1,145 @@
1
+ import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
2
+ const EMPTY_COMPONENT = { render: () => [], invalidate: () => { } };
3
+ export class TasksPanelHost {
4
+ state;
5
+ tui;
6
+ panel;
7
+ handle;
8
+ ui;
9
+ mode = "floating";
10
+ constructor(state) {
11
+ this.state = state;
12
+ }
13
+ attach(ui) {
14
+ this.hideCurrent();
15
+ this.ui = ui;
16
+ this.applyMode();
17
+ }
18
+ setMode(mode) {
19
+ this.mode = mode;
20
+ if (this.ui)
21
+ this.applyMode();
22
+ }
23
+ getMode() {
24
+ return this.mode;
25
+ }
26
+ update() {
27
+ this.panel?.invalidate();
28
+ this.tui?.requestRender();
29
+ }
30
+ hide() {
31
+ this.hideCurrent();
32
+ this.ui = undefined;
33
+ }
34
+ applyMode() {
35
+ const ui = this.ui;
36
+ if (!ui)
37
+ return;
38
+ this.hideCurrent();
39
+ this.ui = ui;
40
+ if (this.mode === "off")
41
+ return;
42
+ if (this.mode === "widget") {
43
+ ui.setWidget("pi-tasks-panel", (tui, theme) => {
44
+ this.tui = tui;
45
+ this.panel = new TasksPanel(this.state, theme, "widget");
46
+ return this.panel;
47
+ });
48
+ return;
49
+ }
50
+ ui.setWidget("pi-tasks-panel-host", (tui, theme) => {
51
+ this.tui = tui;
52
+ this.panel = new TasksPanel(this.state, theme, "floating");
53
+ this.handle = tui.showOverlay(this.panel, {
54
+ anchor: "top-right",
55
+ width: "42%",
56
+ minWidth: 38,
57
+ maxHeight: "48%",
58
+ margin: { top: 1, right: 1 },
59
+ nonCapturing: true,
60
+ visible: (terminalWidth, terminalHeight) => terminalWidth >= 90 && terminalHeight >= 18,
61
+ });
62
+ return EMPTY_COMPONENT;
63
+ });
64
+ }
65
+ hideCurrent() {
66
+ this.handle?.hide();
67
+ this.handle = undefined;
68
+ this.ui?.setWidget("pi-tasks-panel", undefined);
69
+ this.ui?.setWidget("pi-tasks-panel-host", undefined);
70
+ this.panel = undefined;
71
+ this.tui = undefined;
72
+ }
73
+ }
74
+ class TasksPanel {
75
+ state;
76
+ theme;
77
+ placement;
78
+ constructor(state, theme, placement) {
79
+ this.state = state;
80
+ this.theme = theme;
81
+ this.placement = placement;
82
+ }
83
+ render(width) {
84
+ if (width < 38)
85
+ return [];
86
+ const works = this.state.listWorks();
87
+ const boxWidth = this.placement === "floating" ? width : Math.min(54, Math.max(38, Math.floor(width * 0.44)));
88
+ const innerWidth = boxWidth - 2;
89
+ const leftPad = this.placement === "widget" ? " ".repeat(Math.max(0, width - boxWidth)) : "";
90
+ const content = [];
91
+ if (works.length === 0)
92
+ content.push(this.theme.fg("muted", "No works yet."));
93
+ for (const work of works) {
94
+ const completed = work.tasks.filter((todo) => todo.status === "completed").length;
95
+ content.push(`${workIcon(work.status, this.theme)} ${this.theme.fg("text", work.workName)} ${this.theme.fg("dim", `${completed}/${work.tasks.length}`)}`);
96
+ for (const todo of work.tasks)
97
+ content.push(` ${todoIcon(todo.status, this.theme)} ${this.theme.fg(todo.status === "completed" ? "muted" : "text", todo.taskName)}`);
98
+ }
99
+ const maxContentLines = 10;
100
+ const shown = content.slice(0, maxContentLines);
101
+ if (content.length > shown.length)
102
+ shown[shown.length - 1] = this.theme.fg("dim", `… ${content.length - shown.length + 1} more; use /works`);
103
+ const lines = [
104
+ border(innerWidth, "top", this.theme),
105
+ frame(this.theme.fg("accent", this.theme.bold("Works")), innerWidth, this.theme),
106
+ rule(innerWidth, this.theme),
107
+ ...shown.map((line) => frame(line, innerWidth, this.theme)),
108
+ border(innerWidth, "bottom", this.theme),
109
+ ];
110
+ return lines.map((line) => `${leftPad}${line}`);
111
+ }
112
+ invalidate() { }
113
+ }
114
+ export function workIcon(status, theme) {
115
+ if (status === "completed")
116
+ return theme.fg("success", "✓");
117
+ if (status === "active")
118
+ return theme.fg("accent", "▶");
119
+ if (status === "blocked")
120
+ return theme.fg("warning", "!");
121
+ if (status === "cancelled")
122
+ return theme.fg("error", "×");
123
+ return theme.fg("muted", "○");
124
+ }
125
+ export function todoIcon(status, theme) {
126
+ if (status === "completed")
127
+ return theme.fg("success", "✓");
128
+ if (status === "active")
129
+ return theme.fg("accent", "▶");
130
+ if (status === "blocked")
131
+ return theme.fg("warning", "!");
132
+ if (status === "cancelled")
133
+ return theme.fg("error", "×");
134
+ return theme.fg("muted", "○");
135
+ }
136
+ export function frame(content, innerWidth, theme) {
137
+ const truncated = truncateToWidth(content, innerWidth, "");
138
+ return `${theme.fg("border", "│")}${truncated}${" ".repeat(Math.max(0, innerWidth - visibleWidth(truncated)))}${theme.fg("border", "│")}`;
139
+ }
140
+ export function rule(innerWidth, theme) {
141
+ return theme.fg("border", `├${"─".repeat(innerWidth)}┤`);
142
+ }
143
+ export function border(innerWidth, edge, theme) {
144
+ return theme.fg("border", `${edge === "top" ? "┌" : "└"}${"─".repeat(innerWidth)}${edge === "top" ? "┐" : "┘"}`);
145
+ }
@@ -0,0 +1,31 @@
1
+ import type { KeybindingsManager, Theme } from "@earendil-works/pi-coding-agent";
2
+ import { type Component, type Focusable, type TUI } from "@earendil-works/pi-tui";
3
+ import type { TaskState } from "../state.js";
4
+ export declare class WorksDashboard implements Component, Focusable {
5
+ private readonly tui;
6
+ private readonly theme;
7
+ private readonly keybindings;
8
+ private readonly state;
9
+ private readonly close;
10
+ focused: boolean;
11
+ private selectedKey;
12
+ private scrollOffset;
13
+ private detailOffset;
14
+ private detailPageSize;
15
+ private detailsVisible;
16
+ private message;
17
+ private disposed;
18
+ private readonly refreshTimer;
19
+ constructor(tui: TUI, theme: Theme, keybindings: KeybindingsManager, state: TaskState, close: () => void);
20
+ render(width: number): string[];
21
+ handleInput(data: string): void;
22
+ invalidate(): void;
23
+ dispose(): void;
24
+ private items;
25
+ private syncSelection;
26
+ private select;
27
+ private keepSelectionVisible;
28
+ private renderRow;
29
+ private renderDetails;
30
+ private renderFooter;
31
+ }