pi-ui-extend 1.0.18 → 1.0.19

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.
@@ -14,7 +14,7 @@ This package keeps shared Pi tools as ordinary source folders under `src/` and r
14
14
  - `src/repo-discovery` — `/idx-init`, `/idx-update`, and indexed-only `repo_architecture` / `repo_structure` / `repo_ast` / `repo_search` / `repo_explain` / `repo_deps`; tools register only when the launch project has `.indexer-cli`
15
15
  - `src/antigravity-auth` — `antigravity` custom provider with Google Antigravity OAuth login, startup account list, auth.json-only runtime account loading, `/antigravity-add-account` OAuth append into rotation, `/antigravity-account` status display, account rotation/failover, Antigravity plus Gemini CLI model registration, and streaming through the Cloud Code Assist unified gateway
16
16
  - `src/opencode-import` — `/opencode-import` for bounded migration of supported OpenCode OpenAI/Codex, GitHub Copilot, Z.ai, and Antigravity credentials into Pi; existing entries are preserved unless `--force` is passed
17
- - `src/todo` — `todo` tool, `/todos`, `/todos-persist`, and `/todos-scope`; supports parent/subtask hierarchy, blockers, ready-task filtering, deferred out-of-scope items, batch operations, JSON/Markdown import/export, automatic clearing when all visible todos are completed, and optional project persistence via `/todos persist on` or `/todos-persist on`; localization/i18n has been removed
17
+ - `src/todo` — `todo` tool, `/todos`, `/todos-persist`, `/todos-scope`, and `/todos-clear` (also `/todos clear`); supports parent/subtask hierarchy, blockers, ready-task filtering, deferred out-of-scope items, batch operations, JSON/Markdown import/export, automatic clearing when all visible todos are completed, and optional project persistence via `/todos persist on` or `/todos-persist on`; localization/i18n has been removed
18
18
  - `src/model-tools` — model-specific tool aliases such as Claude/GLM-style `Read` / `Edit` / `Write` / `Bash` / `Grep` / `Glob` / `LS`, GPT/Codex-style `shell`, and model-gated `apply_patch`
19
19
  - `src/usage` — `/usage` command and startup hint for read-only AI quota checks across OpenAI, Zhipu AI, Z.ai, and Google Antigravity, including Antigravity quota by model
20
20
  - `src/web-search` — `web_search` and `web_fetch` tools migrated from `@ollama/pi-web-search`; uses local Ollama by default or the official Ollama cloud API when an API key is configured, supports Tavily Search/Extract fallback, provides `/web-credentials` for secure user-level key storage, honors `OLLAMA_HOST`, supports request timeouts via `timeout_ms` / `PI_WEB_SEARCH_TIMEOUT_MS`, and reports provider-specific errors
@@ -49,6 +49,7 @@ const SECTION_DEFERRED = "── Deferred ──";
49
49
  const SECTION_COMPLETED = "── Completed ──";
50
50
  const PERSIST_COMMAND_NAME = "todos-persist";
51
51
  const SCOPE_COMMAND_NAME = "todos-scope";
52
+ const CLEAR_COMMAND_NAME = "todos-clear";
52
53
  export const TODO_STATE_EVENT = "pi-tools-suite:todo:state";
53
54
 
54
55
  type CommandCompletion = { value: string; label: string; description?: string };
@@ -59,6 +60,7 @@ const TODOS_ARGUMENT_COMPLETIONS: CommandCompletion[] = [
59
60
  { value: "persist off", label: "persist off", description: "Disable persistence and remove the project plan file" },
60
61
  { value: "persist clear", label: "persist clear", description: "Alias for persist off" },
61
62
  { value: "scope ", label: "scope <id...>", description: "Keep selected items active and defer out-of-scope items" },
63
+ { value: "clear", label: "clear", description: "Clear all todos" },
62
64
  { value: "--active", label: "--active", description: "Show pending/in_progress tasks" },
63
65
  { value: "--ready", label: "--ready", description: "Show pending tasks whose blockers are completed" },
64
66
  { value: "--blocked", label: "--blocked", description: "Show tasks with blockers" },
@@ -307,6 +309,19 @@ function handleScopeCommand(
307
309
  return true;
308
310
  }
309
311
 
312
+ function clearTodos(
313
+ pi: TodoStateEventEmitter,
314
+ ctx: { cwd?: string; hasUI?: boolean; ui?: { notify?: (message: string, level?: NotifyLevel) => void } },
315
+ ): void {
316
+ const result = applyTaskMutation(getState(), "clear", { action: "clear" });
317
+ if (result.op.kind !== "clear") return;
318
+ commitState(result.state);
319
+ publishTodoState(pi, ctx, "clear", { action: "clear" });
320
+ const sync = syncPersistedPlan(ctx.cwd, result.state);
321
+ const persistedText = sync?.completed ? `\nProject todo plan removed: ${sync.path}` : "";
322
+ notifyCommand(ctx, `Cleared ${result.op.count} todos.${persistedText}`);
323
+ }
324
+
310
325
  function filterCommandTasks(tasks: readonly Task[], options: TodosCommandOptions): Task[] {
311
326
  const byId = new Map(tasks.map((task) => [task.id, task]));
312
327
  let view = [...tasks];
@@ -429,12 +444,16 @@ export function registerTodoTool(pi: ExtensionAPI, hooks: TodoToolRegistrationOp
429
444
 
430
445
  export function registerTodosCommand(pi: ExtensionAPI): void {
431
446
  pi.registerCommand(COMMAND_NAME, {
432
- description: "Show todos on the current branch. Flags: --active, --ready, --blocked, --tree, --status <status>, --export [json|markdown]. Commands: persist on|off|clear|status, scope <id...>",
447
+ description: "Show todos on the current branch. Flags: --active, --ready, --blocked, --tree, --status <status>, --export [json|markdown]. Commands: persist on|off|clear|status, scope <id...>, clear",
433
448
  getArgumentCompletions: (prefix) => completeCommandArguments(String(prefix ?? ""), TODOS_ARGUMENT_COMPLETIONS),
434
449
  handler: async (args, ctx) => {
435
450
  activateTodoStateScope(ctx);
436
451
  if (handlePersistCommand(args, ctx)) return;
437
452
  if (handleScopeCommand(args, ctx, () => publishTodoState(pi as TodoStateEventEmitter, ctx))) return;
453
+ if (getCommandTokens(args)[0] === "clear") {
454
+ clearTodos(pi as TodoStateEventEmitter, ctx);
455
+ return;
456
+ }
438
457
  if (!ctx.hasUI) {
439
458
  console.error(ERR_REQUIRES_INTERACTIVE);
440
459
  return;
@@ -513,4 +532,12 @@ export function registerTodosCommand(pi: ExtensionAPI): void {
513
532
  handleScopeCommand(`scope ${getCommandText(args)}`, ctx, () => publishTodoState(pi as TodoStateEventEmitter, ctx));
514
533
  },
515
534
  });
535
+
536
+ pi.registerCommand(CLEAR_COMMAND_NAME, {
537
+ description: "Clear all todos on the current branch and remove the persisted project plan if enabled.",
538
+ handler: async (_args, ctx) => {
539
+ activateTodoStateScope(ctx);
540
+ clearTodos(pi as TodoStateEventEmitter, ctx);
541
+ },
542
+ });
516
543
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-ui-extend",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "Pix: a workspace-first terminal UI for Pi with tabs, readable tool activity, voice input, and bundled agent tools.",
5
5
  "private": false,
6
6
  "repository": {