Reviewed extension documentation.
UnderstandCreated file watcher extension with start/stop tools.
BuildStarted watching markdown files in target directory.
Setuptehre are md files in plans/, i'm editing them in vs code. i want you to get notified if i change them, with the latest content if a file change is detected on this. can you write an extension that does that? should be something configurable, possibly giving you a tool to start/stop observing.
The user wants a pi extension that watches markdown files in a directory and notifies the agent when changes are detected. Let me first read the extension docs to understand how to build this.
Let me read the extension docs first.
>ls /opt/homebrew/lib/node_modules/@mariozechner/pi-coding-agent/examples/extensions/antigravity-image-gen.ts
auto-commit-on-exit.ts
bash-spawn-hook.ts
bookmark.ts
built-in-tool-renderer.ts
claude-rules.ts
commands.ts
confirm-destructive.ts
custom-compaction.ts
custom-footer.ts
custom-header.ts
custom-provider-anthropic
custom-provider-gitlab-duo
custom-provider-qwen-cli
dirty-repo-guard.ts
doom-overlay
dynamic-resources
dynamic-tools.ts
event-bus.ts
file-trigger.ts
git-checkpoint.ts
handoff.ts
hello.ts
hidden-thinking-label.ts
inline-bash.ts
input-transform.ts
interactive-shell.ts
mac-system-theme.ts
message-renderer.ts
minimal-mode.ts
modal-editor.ts
model-status.ts
notify.ts
overlay-qa-tests.ts
overlay-test.ts
permission-gate.ts
pirate.ts
plan-mode
preset.ts
protected-paths.ts
provider-payload.ts
qna.ts
question.ts
questionnaire.ts
rainbow-editor.ts
README.md
reload-runtime.ts
rpc-demo.ts
sandbox
send-user-message.ts
session-name.ts
shutdown-command.ts
snake.ts
space-invaders.ts
ssh.ts
status-line.ts
subagent
summarize.ts
system-prompt-header.ts
timed-confirm.ts
titlebar-spinner.ts
todo.ts
tool-override.ts
tools.ts
trigger-compact.ts
truncated-tool.ts
widget-placement.ts
with-depsGood, I have a good understanding of the extension API. Now let me build the extension. The user wants:
Let me create this extension.
Now I have a clear picture. Let me build the extension.
Done. Created .pi/extensions/watch-plans.ts. Here's what it does:
Two tools:
watch_plans_start - starts watching a directory (defaults to plans/). Takes an optional directory parameter.watch_plans_stop - stops watching.Behavior:
.md file changessendMessageUse /reload to pick it up, then ask me to start watching and I'll call watch_plans_start.
oki start watching
Now watching /Users/badlogic/workspaces/pi-mono/plans for .md file changes.Watching plans/ now. Go ahead and edit your markdown files in VS Code, I'll see the changes as they come in.