@juicesharp/rpiv-todo 0.1.1 → 0.1.2
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/index.ts +2 -2
- package/package.json +16 -3
- package/todo.ts +16 -5
- package/docs/overlay.jpg +0 -0
package/index.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
14
|
-
import { registerTodoTool, registerTodosCommand, reconstructTodoState } from "./todo.js";
|
|
14
|
+
import { TOOL_NAME, registerTodoTool, registerTodosCommand, reconstructTodoState } from "./todo.js";
|
|
15
15
|
import { TodoOverlay } from "./todo-overlay.js";
|
|
16
16
|
|
|
17
17
|
export default function (pi: ExtensionAPI) {
|
|
@@ -48,7 +48,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
48
48
|
// Reads getTodos() at render time; do NOT call reconstructTodoState here
|
|
49
49
|
// (branch is stale — message_end runs after tool_execution_end).
|
|
50
50
|
pi.on("tool_execution_end", async (event) => {
|
|
51
|
-
if (event.toolName !==
|
|
51
|
+
if (event.toolName !== TOOL_NAME || event.isError) return;
|
|
52
52
|
todoOverlay?.update();
|
|
53
53
|
});
|
|
54
54
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-todo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Pi extension: Claude-Code-parity todo tool + persistent overlay widget",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pi-package",
|
|
7
|
+
"pi-extension",
|
|
8
|
+
"rpiv",
|
|
9
|
+
"todo"
|
|
10
|
+
],
|
|
6
11
|
"type": "module",
|
|
7
12
|
"license": "MIT",
|
|
8
13
|
"author": "juicesharp",
|
|
@@ -17,8 +22,16 @@
|
|
|
17
22
|
"publishConfig": {
|
|
18
23
|
"access": "public"
|
|
19
24
|
},
|
|
25
|
+
"files": [
|
|
26
|
+
"index.ts",
|
|
27
|
+
"todo.ts",
|
|
28
|
+
"todo-overlay.ts",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
20
31
|
"pi": {
|
|
21
|
-
"extensions": [
|
|
32
|
+
"extensions": [
|
|
33
|
+
"./index.ts"
|
|
34
|
+
]
|
|
22
35
|
},
|
|
23
36
|
"peerDependencies": {
|
|
24
37
|
"@mariozechner/pi-ai": "*",
|
package/todo.ts
CHANGED
|
@@ -15,6 +15,17 @@ import { StringEnum } from "@mariozechner/pi-ai";
|
|
|
15
15
|
import { Text } from "@mariozechner/pi-tui";
|
|
16
16
|
import { Type } from "@sinclair/typebox";
|
|
17
17
|
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Constants — tool/command identity and static user-facing strings
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
export const TOOL_NAME = "todo";
|
|
23
|
+
const TOOL_LABEL = "Todo";
|
|
24
|
+
const COMMAND_NAME = "todos";
|
|
25
|
+
|
|
26
|
+
const ERR_REQUIRES_INTERACTIVE = "/todos requires interactive mode";
|
|
27
|
+
const MSG_NO_TODOS = "No todos yet. Ask the agent to add some!";
|
|
28
|
+
|
|
18
29
|
// ---------------------------------------------------------------------------
|
|
19
30
|
// Types
|
|
20
31
|
// ---------------------------------------------------------------------------
|
|
@@ -611,8 +622,8 @@ const TodoParams = Type.Object({
|
|
|
611
622
|
|
|
612
623
|
export function registerTodoTool(pi: ExtensionAPI): void {
|
|
613
624
|
pi.registerTool({
|
|
614
|
-
name:
|
|
615
|
-
label:
|
|
625
|
+
name: TOOL_NAME,
|
|
626
|
+
label: TOOL_LABEL,
|
|
616
627
|
description:
|
|
617
628
|
"Manage a task list for tracking multi-step progress. Actions: create (new task), update (change status/fields/dependencies), list (all tasks, optionally filtered by status), get (single task details), delete (tombstone), clear (reset all). Status: pending → in_progress → completed, plus deleted tombstone. Use this to plan and track multi-step work like research, design, and implementation.",
|
|
618
629
|
promptSnippet: "Manage a Claude-Code-style task list to track multi-step progress",
|
|
@@ -708,16 +719,16 @@ export function registerTodoTool(pi: ExtensionAPI): void {
|
|
|
708
719
|
// ---------------------------------------------------------------------------
|
|
709
720
|
|
|
710
721
|
export function registerTodosCommand(pi: ExtensionAPI): void {
|
|
711
|
-
pi.registerCommand(
|
|
722
|
+
pi.registerCommand(COMMAND_NAME, {
|
|
712
723
|
description: "Show all todos on the current branch, grouped by status",
|
|
713
724
|
handler: async (_args, ctx) => {
|
|
714
725
|
if (!ctx.hasUI) {
|
|
715
|
-
ctx.ui.notify(
|
|
726
|
+
ctx.ui.notify(ERR_REQUIRES_INTERACTIVE, "error");
|
|
716
727
|
return;
|
|
717
728
|
}
|
|
718
729
|
const visible = tasks.filter((t) => t.status !== "deleted");
|
|
719
730
|
if (visible.length === 0) {
|
|
720
|
-
ctx.ui.notify(
|
|
731
|
+
ctx.ui.notify(MSG_NO_TODOS, "info");
|
|
721
732
|
return;
|
|
722
733
|
}
|
|
723
734
|
|
package/docs/overlay.jpg
DELETED
|
Binary file
|