@ian-pascoe/pi-todo 0.1.3 → 0.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ian-pascoe/pi-todo",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "private": false,
5
5
  "description": "Minimal session-native Todo List for Pi agents.",
6
6
  "keywords": [
@@ -2,6 +2,7 @@
2
2
  name: pi-todo
3
3
  description: Diagnose Pi Todo when its tool, restored Todo List, model context, clear command, transcript rendering, or widget is missing or incorrect.
4
4
  license: MIT
5
+ disable-model-invocation: true
5
6
  ---
6
7
 
7
8
  # Pi Todo
@@ -13,8 +13,10 @@ import {
13
13
  type TodoStateSnapshot,
14
14
  type TodoStatus,
15
15
  type TodoTask,
16
+ TodoOperationError,
16
17
  type TodoToolDetails,
17
18
  } from "./todo-list.js";
19
+ import { TROUBLESHOOTING_HINT } from "./troubleshooting-skill.js";
18
20
 
19
21
  const TODO_STATE_ENTRY_TYPE = "pi-todo-state";
20
22
  const JOURNAL_FAULT = Symbol.for("@ian-pascoe/pi-todo/journal-fault");
@@ -161,7 +163,15 @@ export default function piTodoExtension(pi: ExtensionAPI): void {
161
163
  executionMode: "sequential",
162
164
  async execute(_toolCallId, params, signal, _onUpdate, context) {
163
165
  signal?.throwIfAborted();
164
- const result = runTodoAction(params, context);
166
+ let result: ReturnType<typeof runTodoAction>;
167
+ try {
168
+ result = runTodoAction(params, context);
169
+ } catch (cause) {
170
+ // Task-operation errors are model-fixable input errors; anything else is a journal failure.
171
+ if (cause instanceof TodoOperationError) throw cause;
172
+ const message = cause instanceof Error ? cause.message : String(cause);
173
+ throw new Error(`${message}\n\n${TROUBLESHOOTING_HINT}`, { cause });
174
+ }
165
175
  return {
166
176
  content: [{ type: "text", text: result.message }],
167
177
  details: result.details,
@@ -0,0 +1,9 @@
1
+ import { fileURLToPath } from "node:url";
2
+
3
+ /** Absolute path of this package's user-invoked troubleshooting Skill. */
4
+ export const TROUBLESHOOTING_SKILL_PATH = fileURLToPath(
5
+ new URL("../skills/pi-todo/SKILL.md", import.meta.url),
6
+ );
7
+
8
+ /** Model-facing pointer appended to failures this package's Skill diagnoses. */
9
+ export const TROUBLESHOOTING_HINT = `For diagnosis, read the pi-todo troubleshooting Skill at ${TROUBLESHOOTING_SKILL_PATH}.`;