@oh-my-pi/pi-coding-agent 6.9.69 → 8.0.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/CHANGELOG.md +219 -51
- package/README.md +1 -1
- package/docs/hooks.md +2 -2
- package/docs/sdk.md +1 -1
- package/examples/sdk/04-skills.ts +1 -1
- package/package.json +10 -10
- package/scripts/format-prompts.ts +143 -0
- package/scripts/generate-template.ts +1 -1
- package/src/cli/args.ts +3 -3
- package/src/cli/config-cli.ts +4 -4
- package/src/cli/file-processor.ts +3 -3
- package/src/cli/list-models.ts +2 -2
- package/src/cli/plugin-cli.ts +3 -3
- package/src/cli/session-picker.ts +2 -2
- package/src/cli/setup-cli.ts +2 -2
- package/src/cli/stats-cli.ts +1 -1
- package/src/cli/update-cli.ts +2 -2
- package/src/{core → config}/keybindings.ts +1 -1
- package/src/{core → config}/model-registry.ts +8 -1
- package/src/{core → config}/model-resolver.ts +3 -3
- package/src/{core → config}/prompt-templates.ts +2 -2
- package/src/{core → config}/settings-manager.ts +6 -6
- package/src/{core/cursor/exec-bridge.ts → cursor.ts} +4 -4
- package/src/discovery/agents-md.ts +4 -4
- package/src/discovery/builtin.ts +17 -17
- package/src/discovery/claude.ts +12 -12
- package/src/discovery/cline.ts +6 -6
- package/src/discovery/codex.ts +21 -21
- package/src/discovery/cursor.ts +9 -9
- package/src/discovery/gemini.ts +9 -9
- package/src/discovery/github.ts +6 -6
- package/src/discovery/helpers.ts +4 -4
- package/src/discovery/index.ts +16 -16
- package/src/discovery/mcp-json.ts +4 -4
- package/src/discovery/ssh.ts +4 -4
- package/src/discovery/vscode.ts +4 -4
- package/src/discovery/windsurf.ts +6 -6
- package/src/{core/tools/exa → exa}/company.ts +2 -3
- package/src/{core/tools/exa → exa}/index.ts +2 -2
- package/src/{core/tools/exa → exa}/linkedin.ts +2 -3
- package/src/{core/tools/exa → exa}/mcp-client.ts +2 -2
- package/src/{core/tools/exa → exa}/render.ts +3 -3
- package/src/{core/tools/exa → exa}/researcher.ts +1 -1
- package/src/{core/tools/exa → exa}/search.ts +2 -10
- package/src/{core/tools/exa → exa}/websets.ts +1 -1
- package/src/{core → exec}/bash-executor.ts +23 -7
- package/src/{core → export}/custom-share.ts +1 -1
- package/src/{core/export-html → export/html}/index.ts +3 -3
- package/src/{core → export}/ttsr.ts +2 -2
- package/src/{core → extensibility}/custom-commands/bundled/review/index.ts +4 -4
- package/src/{core → extensibility}/custom-commands/loader.ts +3 -3
- package/src/{core → extensibility}/custom-commands/types.ts +1 -1
- package/src/{core → extensibility}/custom-tools/loader.ts +9 -9
- package/src/{core → extensibility}/custom-tools/types.ts +6 -6
- package/src/{core → extensibility}/custom-tools/wrapper.ts +1 -1
- package/src/{core → extensibility}/extensions/loader.ts +8 -8
- package/src/{core → extensibility}/extensions/runner.ts +3 -3
- package/src/{core → extensibility}/extensions/types.ts +15 -15
- package/src/{core → extensibility}/extensions/wrapper.ts +1 -1
- package/src/{core → extensibility}/hooks/index.ts +1 -1
- package/src/{core → extensibility}/hooks/loader.ts +7 -7
- package/src/{core → extensibility}/hooks/runner.ts +4 -4
- package/src/{core → extensibility}/hooks/types.ts +9 -9
- package/src/{core → extensibility}/plugins/doctor.ts +1 -1
- package/src/{core → extensibility}/plugins/installer.ts +2 -3
- package/src/{core → extensibility}/plugins/paths.ts +1 -1
- package/src/{core → extensibility}/skills.ts +8 -48
- package/src/{core → extensibility}/slash-commands.ts +6 -6
- package/src/index.ts +127 -128
- package/src/internal-urls/agent-protocol.ts +126 -0
- package/src/internal-urls/artifact-protocol.ts +93 -0
- package/src/internal-urls/index.ts +28 -0
- package/src/internal-urls/json-query.ts +126 -0
- package/src/internal-urls/router.ts +69 -0
- package/src/internal-urls/rule-protocol.ts +56 -0
- package/src/internal-urls/skill-protocol.ts +112 -0
- package/src/internal-urls/types.ts +48 -0
- package/src/{core/python-executor.ts → ipy/executor.ts} +74 -13
- package/src/{core/python-gateway-coordinator.ts → ipy/gateway-coordinator.ts} +40 -270
- package/src/{core/python-kernel.ts → ipy/kernel.ts} +38 -10
- package/src/{core/python-prelude.py → ipy/prelude.py} +201 -8
- package/src/ipy/prelude.ts +3 -0
- package/src/{core/tools/lsp → lsp}/client.ts +7 -6
- package/src/{core/tools/lsp → lsp}/clients/biome-client.ts +1 -1
- package/src/{core/tools/lsp → lsp}/clients/index.ts +1 -1
- package/src/{core/tools/lsp → lsp}/clients/lsp-linter-client.ts +4 -4
- package/src/{core/tools/lsp → lsp}/config.ts +1 -1
- package/src/{core/tools/lsp → lsp}/index.ts +29 -17
- package/src/{core/tools/lsp → lsp}/render.ts +2 -2
- package/src/{core/tools/lsp → lsp}/types.ts +14 -16
- package/src/{core/tools/lsp → lsp}/utils.ts +1 -1
- package/src/main.ts +12 -12
- package/src/{core/mcp → mcp}/config.ts +8 -8
- package/src/{core/mcp → mcp}/loader.ts +5 -6
- package/src/{core/mcp → mcp}/manager.ts +2 -2
- package/src/{core/mcp → mcp}/tool-bridge.ts +35 -6
- package/src/{core/mcp → mcp}/tool-cache.ts +1 -1
- package/src/{core/mcp → mcp}/transports/http.ts +7 -1
- package/src/{core/mcp → mcp}/transports/stdio.ts +1 -1
- package/src/{core/mcp → mcp}/types.ts +1 -1
- package/src/migrations.ts +2 -2
- package/src/modes/{interactive/components → components}/armin.ts +1 -1
- package/src/modes/{interactive/components → components}/assistant-message.ts +1 -1
- package/src/modes/{interactive/components → components}/bash-execution.ts +37 -29
- package/src/modes/{interactive/components → components}/bordered-loader.ts +1 -1
- package/src/modes/{interactive/components → components}/branch-summary-message.ts +2 -2
- package/src/modes/{interactive/components → components}/compaction-summary-message.ts +2 -2
- package/src/modes/{interactive/components → components}/custom-message.ts +3 -3
- package/src/modes/{interactive/components → components}/diff.ts +1 -1
- package/src/modes/{interactive/components → components}/dynamic-border.ts +1 -1
- package/src/modes/{interactive/components → components}/extensions/extension-dashboard.ts +3 -3
- package/src/modes/{interactive/components → components}/extensions/extension-list.ts +2 -2
- package/src/modes/{interactive/components → components}/extensions/inspector-panel.ts +1 -1
- package/src/modes/{interactive/components → components}/extensions/state-manager.ts +11 -17
- package/src/modes/{interactive/components → components}/extensions/types.ts +1 -1
- package/src/modes/{interactive/components → components}/footer.ts +3 -3
- package/src/modes/{interactive/components → components}/history-search.ts +2 -2
- package/src/modes/{interactive/components → components}/hook-editor.ts +1 -1
- package/src/modes/{interactive/components → components}/hook-input.ts +1 -1
- package/src/modes/{interactive/components → components}/hook-message.ts +3 -3
- package/src/modes/{interactive/components → components}/hook-selector.ts +1 -1
- package/src/modes/{interactive/components → components}/keybinding-hints.ts +2 -2
- package/src/modes/{interactive/components → components}/login-dialog.ts +1 -1
- package/src/modes/{interactive/components → components}/model-selector.ts +5 -5
- package/src/modes/{interactive/components → components}/oauth-selector.ts +2 -2
- package/src/modes/{interactive/components → components}/plugin-settings.ts +3 -3
- package/src/modes/{interactive/components → components}/python-execution.ts +35 -24
- package/src/modes/{interactive/components → components}/queue-mode-selector.ts +1 -1
- package/src/modes/{interactive/components → components}/read-tool-group.ts +2 -2
- package/src/modes/{interactive/components → components}/session-selector.ts +3 -3
- package/src/modes/{interactive/components → components}/settings-defs.ts +2 -2
- package/src/modes/{interactive/components → components}/settings-selector.ts +2 -2
- package/src/modes/{interactive/components → components}/show-images-selector.ts +1 -1
- package/src/modes/{interactive/components → components}/status-line/segments.ts +2 -2
- package/src/modes/{interactive/components → components}/status-line/separators.ts +1 -1
- package/src/modes/{interactive/components → components}/status-line/types.ts +2 -2
- package/src/modes/{interactive/components → components}/status-line-segment-editor.ts +2 -2
- package/src/modes/{interactive/components → components}/status-line.ts +3 -3
- package/src/modes/{interactive/components → components}/theme-selector.ts +1 -1
- package/src/modes/{interactive/components → components}/thinking-selector.ts +1 -1
- package/src/modes/{interactive/components → components}/todo-display.ts +3 -4
- package/src/modes/{interactive/components → components}/todo-reminder.ts +2 -2
- package/src/modes/{interactive/components → components}/tool-execution.ts +8 -8
- package/src/modes/{interactive/components → components}/tree-selector.ts +3 -3
- package/src/modes/{interactive/components → components}/ttsr-notification.ts +2 -2
- package/src/modes/{interactive/components → components}/user-message-selector.ts +1 -1
- package/src/modes/{interactive/components → components}/user-message.ts +1 -1
- package/src/modes/{interactive/components → components}/welcome.ts +2 -2
- package/src/modes/{interactive/controllers → controllers}/command-controller.ts +381 -30
- package/src/modes/{interactive/controllers → controllers}/event-controller.ts +9 -9
- package/src/modes/{interactive/controllers → controllers}/extension-ui-controller.ts +8 -8
- package/src/modes/{interactive/controllers → controllers}/input-controller.ts +61 -13
- package/src/modes/{interactive/controllers → controllers}/selector-controller.ts +16 -16
- package/src/modes/index.ts +1 -1
- package/src/modes/{interactive/interactive-mode.ts → interactive-mode.ts} +20 -15
- package/src/modes/print-mode.ts +1 -1
- package/src/modes/rpc/rpc-client.ts +3 -3
- package/src/modes/rpc/rpc-mode.ts +3 -3
- package/src/modes/rpc/rpc-types.ts +3 -3
- package/src/modes/{interactive/theme → theme}/theme.ts +1 -1
- package/src/modes/{interactive/types.ts → types.ts} +10 -10
- package/src/modes/{interactive/utils → utils}/ui-helpers.ts +20 -27
- package/src/{core/tools/patch → patch}/applicator.ts +1 -1
- package/src/{core/tools/patch → patch}/diff.ts +1 -1
- package/src/{core/tools/patch → patch}/index.ts +31 -36
- package/src/{core/tools/patch → patch}/shared.ts +9 -6
- package/src/prompts/agents/explore.md +83 -46
- package/src/prompts/agents/init.md +9 -4
- package/src/prompts/agents/plan.md +8 -7
- package/src/prompts/agents/reviewer.md +36 -18
- package/src/prompts/agents/task.md +4 -4
- package/src/prompts/compaction/branch-summary-preamble.md +0 -1
- package/src/prompts/review-request.md +0 -1
- package/src/prompts/system/custom-system-prompt.md +2 -14
- package/src/prompts/system/file-operations.md +0 -2
- package/src/prompts/system/system-prompt.md +182 -171
- package/src/prompts/system/web-search.md +26 -0
- package/src/prompts/tools/ask.md +31 -24
- package/src/prompts/tools/bash.md +20 -17
- package/src/prompts/tools/calculator.md +9 -5
- package/src/prompts/tools/fetch.md +16 -0
- package/src/prompts/tools/find.md +15 -5
- package/src/prompts/tools/gemini-image.md +21 -6
- package/src/prompts/tools/grep.md +28 -12
- package/src/prompts/tools/lsp.md +35 -14
- package/src/prompts/tools/patch.md +39 -41
- package/src/prompts/tools/python.md +59 -77
- package/src/prompts/tools/read.md +23 -22
- package/src/prompts/tools/replace.md +19 -12
- package/src/prompts/tools/ssh.md +21 -28
- package/src/prompts/tools/task.md +54 -44
- package/src/prompts/tools/todo-write.md +52 -163
- package/src/prompts/tools/web-search.md +16 -9
- package/src/prompts/tools/write.md +13 -2
- package/src/{core/sdk.ts → sdk.ts} +65 -34
- package/src/{core → session}/agent-session.ts +157 -41
- package/src/{core → session}/agent-storage.ts +2 -2
- package/src/session/artifacts.ts +110 -0
- package/src/{core → session}/auth-storage.ts +525 -203
- package/src/{core → session}/compaction/branch-summarization.ts +5 -5
- package/src/{core → session}/compaction/compaction.ts +6 -6
- package/src/{core → session}/compaction/utils.ts +3 -3
- package/src/{core → session}/history-storage.ts +1 -1
- package/src/{core → session}/messages.ts +6 -8
- package/src/{core → session}/session-manager.ts +2 -2
- package/src/{core → session}/storage-migration.ts +2 -2
- package/src/session/streaming-output.ts +177 -0
- package/src/{core/ssh → ssh}/connection-manager.ts +1 -1
- package/src/{core/ssh → ssh}/ssh-executor.ts +19 -4
- package/src/{core/ssh → ssh}/sshfs-mount.ts +1 -1
- package/src/{core/system-prompt.ts → system-prompt.ts} +8 -37
- package/src/{core/tools/task → task}/agents.ts +8 -8
- package/src/{core/tools/task → task}/commands.ts +5 -6
- package/src/{core/tools/task → task}/discovery.ts +3 -3
- package/src/{core/tools/task → task}/executor.ts +34 -44
- package/src/{core/tools/task → task}/index.ts +206 -50
- package/src/{core/tools/task → task}/render.ts +80 -23
- package/src/{core/tools/task → task}/subprocess-tool-registry.ts +1 -1
- package/src/task/template.ts +47 -0
- package/src/{core/tools/task → task}/types.ts +19 -27
- package/src/{core/tools/task → task}/worker-protocol.ts +8 -4
- package/src/{core/tools/task → task}/worker.ts +34 -29
- package/src/task/worktree.ts +166 -0
- package/src/{core/tools → tools}/ask.ts +13 -21
- package/src/{core/tools → tools}/bash-interceptor.ts +1 -1
- package/src/{core/tools → tools}/bash.ts +61 -63
- package/src/{core/tools → tools}/calculator.ts +4 -4
- package/src/{core/tools → tools}/complete.ts +1 -1
- package/src/{core/tools → tools}/context.ts +2 -2
- package/src/{core/tools/web-fetch.ts → tools/fetch.ts} +97 -76
- package/src/{core/tools → tools}/find.ts +96 -107
- package/src/{core/tools → tools}/gemini-image.ts +420 -29
- package/src/{core/tools → tools}/grep.ts +155 -164
- package/src/{core/tools → tools}/index.ts +63 -56
- package/src/tools/list-limit.ts +40 -0
- package/src/{core/tools → tools}/ls.ts +44 -35
- package/src/{core/tools → tools}/notebook.ts +3 -3
- package/src/tools/output-meta.ts +443 -0
- package/src/tools/output-utils.ts +63 -0
- package/src/{core/tools → tools}/python.ts +106 -89
- package/src/tools/read.ts +882 -0
- package/src/{core/tools → tools}/render-utils.ts +1 -1
- package/src/{core/tools → tools}/renderers.ts +8 -10
- package/src/{core/tools → tools}/review.ts +2 -2
- package/src/{core/tools → tools}/ssh.ts +56 -59
- package/src/{core/tools → tools}/todo-write.ts +12 -23
- package/src/tools/tool-errors.ts +95 -0
- package/src/tools/tool-result.ts +92 -0
- package/src/{core/tools → tools}/truncate.ts +2 -2
- package/src/{core/tools → tools}/write.ts +15 -13
- package/src/utils/changelog.ts +1 -1
- package/src/{core → utils}/file-mentions.ts +4 -4
- package/src/utils/image-convert.ts +1 -1
- package/src/utils/image-resize.ts +1 -1
- package/src/utils/shell.ts +1 -1
- package/src/{core → utils}/title-generator.ts +4 -4
- package/src/utils/tools-manager.ts +1 -1
- package/src/{core/tools/web-scrapers → web/scrapers}/choosealicense.ts +1 -1
- package/src/{core/tools/web-scrapers → web/scrapers}/twitter.ts +3 -2
- package/src/{core/tools/web-scrapers → web/scrapers}/types.ts +4 -2
- package/src/{core/tools/web-scrapers → web/scrapers}/utils.ts +1 -1
- package/src/{core/tools/web-scrapers → web/scrapers}/youtube.ts +14 -13
- package/src/{core/tools/web-search → web/search}/auth.ts +4 -4
- package/src/{core/tools/web-search → web/search}/index.ts +22 -71
- package/src/{core/tools/web-search → web/search}/providers/anthropic.ts +7 -10
- package/src/{core/tools/web-search → web/search}/providers/exa.ts +2 -2
- package/src/{core/tools/web-search → web/search}/providers/perplexity.ts +4 -16
- package/src/{core/tools/web-search → web/search}/render.ts +3 -3
- package/scripts/migrate-sessions.sh +0 -93
- package/src/core/index.ts +0 -56
- package/src/core/python-prelude.ts +0 -3
- package/src/core/ssh-executor.ts +0 -5
- package/src/core/streaming-output.ts +0 -115
- package/src/core/tools/output.ts +0 -519
- package/src/core/tools/read.ts +0 -717
- package/src/core/tools/task/template.ts +0 -37
- package/src/prompts/tools/output.md +0 -47
- package/src/prompts/tools/web-fetch.md +0 -9
- /package/src/{core/tools/exa → exa}/types.ts +0 -0
- /package/src/{core → exec}/exec.ts +0 -0
- /package/src/{core/export-html → export/html}/template.css +0 -0
- /package/src/{core/export-html → export/html}/template.generated.ts +0 -0
- /package/src/{core/export-html → export/html}/template.html +0 -0
- /package/src/{core/export-html → export/html}/template.js +0 -0
- /package/src/{core/export-html → export/html}/template.macro.ts +0 -0
- /package/src/{core/export-html → export/html}/vendor/highlight.min.js +0 -0
- /package/src/{core/export-html → export/html}/vendor/marked.min.js +0 -0
- /package/src/{core → extensibility}/custom-commands/index.ts +0 -0
- /package/src/{core → extensibility}/custom-tools/index.ts +0 -0
- /package/src/{core → extensibility}/extensions/index.ts +0 -0
- /package/src/{core → extensibility}/hooks/tool-wrapper.ts +0 -0
- /package/src/{core → extensibility}/plugins/index.ts +0 -0
- /package/src/{core → extensibility}/plugins/loader.ts +0 -0
- /package/src/{core → extensibility}/plugins/manager.ts +0 -0
- /package/src/{core → extensibility}/plugins/parser.ts +0 -0
- /package/src/{core → extensibility}/plugins/types.ts +0 -0
- /package/src/{core/python-modules.ts → ipy/modules.ts} +0 -0
- /package/src/{core/tools/lsp → lsp}/defaults.json +0 -0
- /package/src/{core/tools/lsp → lsp}/edits.ts +0 -0
- /package/src/{core/tools/lsp → lsp}/lspmux.ts +0 -0
- /package/src/{core/tools/lsp → lsp}/rust-analyzer.ts +0 -0
- /package/src/{core/mcp → mcp}/client.ts +0 -0
- /package/src/{core/mcp → mcp}/index.ts +0 -0
- /package/src/{core/mcp → mcp}/json-rpc.ts +0 -0
- /package/src/{core/mcp → mcp}/transports/index.ts +0 -0
- /package/src/modes/{interactive/components → components}/countdown-timer.ts +0 -0
- /package/src/modes/{interactive/components → components}/custom-editor.ts +0 -0
- /package/src/modes/{interactive/components → components}/extensions/index.ts +0 -0
- /package/src/modes/{interactive/components → components}/index.ts +0 -0
- /package/src/modes/{interactive/components → components}/status-line/index.ts +0 -0
- /package/src/modes/{interactive/components → components}/status-line/presets.ts +0 -0
- /package/src/modes/{interactive/components → components}/visual-truncate.ts +0 -0
- /package/src/modes/{interactive/theme → theme}/dark.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/alabaster.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/amethyst.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/anthracite.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/basalt.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/birch.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-abyss.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-arctic.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-aurora.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-catppuccin.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-cavern.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-copper.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-cosmos.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-cyberpunk.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-dracula.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-eclipse.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-ember.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-equinox.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-forest.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-github.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-gruvbox.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-lavender.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-lunar.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-midnight.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-monochrome.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-monokai.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-nebula.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-nord.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-ocean.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-one.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-rainforest.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-reef.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-retro.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-rose-pine.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-sakura.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-slate.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-solarized.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-solstice.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-starfall.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-sunset.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-swamp.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-synthwave.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-taiga.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-terminal.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-tokyo-night.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-tundra.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-twilight.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/dark-volcanic.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/graphite.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/index.ts +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-arctic.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-aurora-day.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-canyon.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-catppuccin.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-cirrus.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-coral.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-cyberpunk.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-dawn.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-dunes.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-eucalyptus.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-forest.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-frost.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-github.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-glacier.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-gruvbox.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-haze.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-honeycomb.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-lagoon.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-lavender.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-meadow.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-mint.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-monochrome.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-ocean.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-one.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-opal.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-orchard.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-paper.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-prism.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-retro.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-sand.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-savanna.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-solarized.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-soleil.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-sunset.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-synthwave.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-tokyo-night.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-wetland.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/light-zenith.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/limestone.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/mahogany.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/marble.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/obsidian.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/onyx.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/pearl.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/porcelain.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/quartz.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/sandstone.json +0 -0
- /package/src/modes/{interactive/theme → theme}/defaults/titanium.json +0 -0
- /package/src/modes/{interactive/theme → theme}/light.json +0 -0
- /package/src/modes/{interactive/theme → theme}/theme-schema.json +0 -0
- /package/src/{core/tools/patch → patch}/fuzzy.ts +0 -0
- /package/src/{core/tools/patch → patch}/normalize.ts +0 -0
- /package/src/{core/tools/patch → patch}/normative.ts +0 -0
- /package/src/{core/tools/patch → patch}/parser.ts +0 -0
- /package/src/{core/tools/patch → patch}/types.ts +0 -0
- /package/src/{core → session}/compaction/index.ts +0 -0
- /package/src/{core → session}/session-storage.ts +0 -0
- /package/src/{core/tools/task → task}/name-generator.ts +0 -0
- /package/src/{core/tools/task → task}/omp-command.ts +0 -0
- /package/src/{core/tools/task → task}/parallel.ts +0 -0
- /package/src/{core/tools → tools}/jtd-to-json-schema.ts +0 -0
- /package/src/{core/tools → tools}/path-utils.ts +0 -0
- /package/src/{core → utils}/event-bus.ts +0 -0
- /package/src/{core → utils}/frontmatter.ts +0 -0
- /package/src/{core → utils}/terminal-notify.ts +0 -0
- /package/src/{core → utils}/timings.ts +0 -0
- /package/src/{core → utils}/utils.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/artifacthub.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/arxiv.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/aur.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/biorxiv.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/bluesky.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/brew.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/cheatsh.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/chocolatey.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/cisa-kev.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/clojars.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/coingecko.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/crates-io.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/crossref.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/devto.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/discogs.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/discourse.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/dockerhub.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/fdroid.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/firefox-addons.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/flathub.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/github-gist.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/github.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/gitlab.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/go-pkg.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/hackage.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/hackernews.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/hex.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/huggingface.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/iacr.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/index.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/jetbrains-marketplace.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/lemmy.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/lobsters.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/mastodon.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/maven.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/mdn.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/metacpan.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/musicbrainz.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/npm.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/nuget.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/nvd.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/ollama.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/open-vsx.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/opencorporates.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/openlibrary.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/orcid.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/osv.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/packagist.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/pub-dev.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/pubmed.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/pypi.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/rawg.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/readthedocs.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/reddit.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/repology.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/rfc.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/rubygems.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/searchcode.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/sec-edgar.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/semantic-scholar.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/snapcraft.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/sourcegraph.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/spdx.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/spotify.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/stackoverflow.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/terraform.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/tldr.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/vimeo.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/vscode-marketplace.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/w3c.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/wikidata.ts +0 -0
- /package/src/{core/tools/web-scrapers → web/scrapers}/wikipedia.ts +0 -0
- /package/src/{core/tools/web-search → web/search}/types.ts +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Fetch
|
|
2
|
+
|
|
3
|
+
Retrieves content from a URL and returns it in a clean, readable format.
|
|
4
|
+
|
|
5
|
+
<instruction>
|
|
6
|
+
- Extract information from web pages (documentation, articles, API references)
|
|
7
|
+
- Analyze GitHub issues, PRs, or repository content
|
|
8
|
+
- Retrieve from Stack Overflow, Wikipedia, Reddit, NPM, arXiv, technical blogs
|
|
9
|
+
- Access RSS/Atom feeds or JSON endpoints
|
|
10
|
+
- Read PDF or DOCX files hosted at a URL
|
|
11
|
+
- Use `raw: true` for untouched HTML or debugging
|
|
12
|
+
</instruction>
|
|
13
|
+
|
|
14
|
+
<output>
|
|
15
|
+
Returns processed, readable content extracted from the URL. HTML is transformed to remove navigation, ads, and boilerplate. PDF and DOCX files are converted to text. JSON endpoints return formatted JSON. With `raw: true`, returns untransformed HTML.
|
|
16
|
+
</output>
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
# Find
|
|
2
|
+
|
|
3
|
+
Fast file pattern matching that works with any codebase size.
|
|
4
|
+
|
|
5
|
+
<instruction>
|
|
2
6
|
- Supports glob patterns like "**/*.js" or "src/**/*.ts"
|
|
3
|
-
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
- Speculatively perform multiple searches in parallel when potentially useful
|
|
8
|
+
</instruction>
|
|
9
|
+
|
|
10
|
+
<output>
|
|
11
|
+
Matching file paths sorted by modification time (most recent first). Results truncated at 1000 entries or 50KB.
|
|
12
|
+
</output>
|
|
13
|
+
|
|
14
|
+
<avoid>
|
|
15
|
+
Open-ended searches requiring multiple rounds of globbing and grepping — use Task tool instead.
|
|
16
|
+
</avoid>
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
# Gemini Image
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
set aspect ratio or image size, and choose the model explicitly when needed.
|
|
3
|
+
Generate or edit images using Gemini image models.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
<instruction>
|
|
6
|
+
Provide structured parameters for best results. The tool assembles them into an optimized prompt.
|
|
7
|
+
|
|
8
|
+
When using multiple `input_images`, describe each image's role in the `subject` or `scene` field:
|
|
9
|
+
- "Use Image 1 for the character's face and outfit, Image 2 for the pose, Image 3 for the background environment"
|
|
10
|
+
- "Match the color palette from Image 1, apply the lighting style from Image 2"
|
|
11
|
+
</instruction>
|
|
12
|
+
|
|
13
|
+
<output>
|
|
14
|
+
Returns the generated image saved to disk. The response includes the file path where the image was written.
|
|
15
|
+
</output>
|
|
16
|
+
|
|
17
|
+
<important>
|
|
18
|
+
- For photoreal: add "ultra-detailed, realistic, natural skin texture" to style
|
|
19
|
+
- For posters/cards: use 9:16 aspect ratio with negative space for text placement
|
|
20
|
+
- For iteration: use `changes` to make targeted adjustments rather than regenerating from scratch
|
|
21
|
+
- For text: add "sharp, legible, correctly spelled" for important text; keep text short
|
|
22
|
+
- For diagrams: include "scientifically accurate" in style and provide facts explicitly
|
|
23
|
+
</important>
|
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
# Grep
|
|
2
|
+
|
|
3
|
+
A powerful search tool built on ripgrep.
|
|
4
|
+
|
|
5
|
+
<instruction>
|
|
6
|
+
- Supports full regex syntax (e.g., `log.*Error`, `function\\s+\\w+`)
|
|
7
|
+
- Filter files with `glob` (e.g., `*.js`, `**/*.tsx`) or `type` (e.g., `js`, `py`, `rust`)
|
|
8
|
+
- Pattern syntax uses ripgrep—literal braces need escaping (`interface\\{\\}` to find `interface{}` in Go)
|
|
9
|
+
- For cross-line patterns like `struct \\{[\\s\\S]*?field`, use `multiline: true`
|
|
10
|
+
</instruction>
|
|
11
|
+
|
|
12
|
+
<output>
|
|
13
|
+
Results depend on `output_mode`:
|
|
14
|
+
- `content`: Matching lines with file paths and line numbers
|
|
15
|
+
- `files_with_matches`: File paths only (one per line)
|
|
16
|
+
- `count`: Match counts per file
|
|
17
|
+
|
|
18
|
+
In `content` mode, truncated at 100 matches by default (configurable via `limit`).
|
|
19
|
+
For `files_with_matches` and `count` modes, use `head_limit` to truncate results.
|
|
20
|
+
</output>
|
|
21
|
+
|
|
22
|
+
<critical>
|
|
23
|
+
- ALWAYS use Grep for search tasks—NEVER invoke `grep` or `rg` via Bash. This tool has correct permissions and access.
|
|
24
|
+
</critical>
|
|
25
|
+
|
|
26
|
+
<avoid>
|
|
27
|
+
- Open-ended searches requiring multiple rounds—use Task tool with explore subagent instead
|
|
28
|
+
</avoid>
|
package/src/prompts/tools/lsp.md
CHANGED
|
@@ -1,14 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
1
|
+
# LSP
|
|
2
|
+
|
|
3
|
+
Interact with Language Server Protocol servers for code intelligence.
|
|
4
|
+
|
|
5
|
+
<operations>
|
|
6
|
+
- `diagnostics`: Get errors/warnings for a file
|
|
7
|
+
- `workspace_diagnostics`: Check entire project (uses tsc, cargo check, go build, etc.)
|
|
8
|
+
- `definition`: Go to symbol definition
|
|
9
|
+
- `references`: Find all references to a symbol
|
|
10
|
+
- `hover`: Get type info and documentation
|
|
11
|
+
- `symbols`: List symbols in a file (functions, classes, etc.)
|
|
12
|
+
- `workspace_symbols`: Search for symbols across the project
|
|
13
|
+
- `rename`: Rename a symbol across the codebase
|
|
14
|
+
- `actions`: List and apply code actions (quick fixes, refactors)
|
|
15
|
+
- `incoming_calls`: Find all callers of a function
|
|
16
|
+
- `outgoing_calls`: Find all functions called by a function
|
|
17
|
+
</operations>
|
|
18
|
+
|
|
19
|
+
<output>
|
|
20
|
+
Returns vary by operation:
|
|
21
|
+
- `diagnostics`/`workspace_diagnostics`: List of errors/warnings with file, line, severity, message
|
|
22
|
+
- `definition`: File path and position of the definition
|
|
23
|
+
- `references`: List of locations (file + position) where symbol is used
|
|
24
|
+
- `hover`: Type signature and documentation text
|
|
25
|
+
- `symbols`/`workspace_symbols`: List of symbol names, kinds, and locations
|
|
26
|
+
- `rename`: Confirmation of changes made across files
|
|
27
|
+
- `actions`: List of available code actions; when applied, returns the result
|
|
28
|
+
- `incoming_calls`/`outgoing_calls`: Call hierarchy with caller/callee locations
|
|
29
|
+
</output>
|
|
30
|
+
|
|
31
|
+
<important>
|
|
32
|
+
- Requires a running LSP server for the target language
|
|
33
|
+
- Some operations require the file to be saved to disk
|
|
34
|
+
- `workspace_diagnostics` may be slow on large projects
|
|
35
|
+
</important>
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
This is your primary tool for making changes to existing files.
|
|
1
|
+
# Edit
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
Performs patch operations on a file given a diff. Primary tool for modifying existing files.
|
|
4
|
+
|
|
5
|
+
<instruction>
|
|
6
|
+
**Hunk Headers:**
|
|
7
|
+
- `@@` — bare header when context lines are already unique
|
|
8
|
+
- `@@ $ANCHOR` — anchor must be copied verbatim from the file (full line or unique substring)
|
|
9
|
+
|
|
10
|
+
**Anchor Selection Algorithm:**
|
|
11
|
+
1. If surrounding context lines are already unique, use bare `@@`
|
|
12
|
+
2. Otherwise choose a highly specific anchor copied from the file:
|
|
13
|
+
- full function signature line
|
|
14
|
+
- class declaration line
|
|
15
|
+
- unique string literal / error message
|
|
16
|
+
- config key with uncommon name
|
|
17
|
+
3. If "Found multiple matches" error: add more context lines, use multiple hunks with separate anchors, or use a longer anchor substring
|
|
18
|
+
|
|
19
|
+
**Context Lines:**
|
|
20
|
+
- Include enough ` `-prefixed lines to make match unique (usually 2–8 total)
|
|
21
|
+
- Must exist in the file exactly as written (preserve indentation/trailing spaces)
|
|
22
|
+
</instruction>
|
|
9
23
|
|
|
10
24
|
<parameters>
|
|
11
25
|
```ts
|
|
12
|
-
type T =
|
|
26
|
+
type T =
|
|
13
27
|
// Diff is one or more hunks, within the same file.
|
|
14
28
|
// - Each hunk begins with "@@" (optionally with an anchor).
|
|
15
29
|
// - Each hunk body contains only lines starting with: ' ' | '+' | '-'.
|
|
@@ -24,40 +38,18 @@ type T =
|
|
|
24
38
|
```
|
|
25
39
|
</parameters>
|
|
26
40
|
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
41
|
+
<output>
|
|
42
|
+
Returns success/failure status. On failure, returns error message indicating:
|
|
43
|
+
- "Found multiple matches" — anchor/context not unique enough
|
|
44
|
+
- "No match found" — context lines don't exist in file (wrong content or stale read)
|
|
45
|
+
- Syntax errors in diff format
|
|
46
|
+
</output>
|
|
31
47
|
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- line numbers / ranges: `line 207`, `lines 26-37`
|
|
38
|
-
- location labels: `top of file`, `start`, `near imports`
|
|
39
|
-
- placeholders: `@@ @@`, `...`
|
|
40
|
-
</hunk_header>
|
|
41
|
-
|
|
42
|
-
<anchor_selection>
|
|
43
|
-
ANCHOR SELECTION ALGORITHM (use in this order):
|
|
44
|
-
1) If the surrounding context lines are already unique in the file, use bare `@@`.
|
|
45
|
-
2) Else choose an anchor that is highly specific and stable, copied from the file, e.g.:
|
|
46
|
-
- full function signature line
|
|
47
|
-
- class declaration line
|
|
48
|
-
- a unique string literal / error message
|
|
49
|
-
- a config key with uncommon name
|
|
50
|
-
3) If you get "Found multiple matches", escalate by:
|
|
51
|
-
- adding more context lines, OR
|
|
52
|
-
- using multiple hunks with separate nearby anchors, OR
|
|
53
|
-
- using a more specific anchor substring (longer, includes identifiers).
|
|
54
|
-
NEVER use generic anchors like `import`, `export`, `describe`, `function`, `const`.
|
|
55
|
-
</anchor_selection>
|
|
56
|
-
|
|
57
|
-
<context_rules>
|
|
58
|
-
- Include enough context lines (' ' prefixed) to make the match unique (usually 2–8 total).
|
|
59
|
-
- Context lines must exist in the file exactly as written; preserve indentation/trailing spaces.
|
|
60
|
-
</context_rules>
|
|
48
|
+
<critical>
|
|
49
|
+
- Always read the target file before editing
|
|
50
|
+
- Copy anchors and context lines verbatim (including whitespace)
|
|
51
|
+
- Never use anchors as comments (no line numbers, location labels, or placeholders like `@@ @@`)
|
|
52
|
+
</critical>
|
|
61
53
|
|
|
62
54
|
<example name="create">
|
|
63
55
|
edit {"path":"hello.txt","op":"create","diff":"Hello\n"}
|
|
@@ -74,3 +66,9 @@ edit {"path":"src/app.py","op":"update","rename":"src/main.py","diff":"@@\n ...\
|
|
|
74
66
|
<example name="delete">
|
|
75
67
|
edit {"path":"obsolete.txt","op":"delete"}
|
|
76
68
|
</example>
|
|
69
|
+
|
|
70
|
+
<avoid>
|
|
71
|
+
- Generic anchors: `import`, `export`, `describe`, `function`, `const`
|
|
72
|
+
- Anchor comments: `line 207`, `top of file`, `near imports`, `...`
|
|
73
|
+
- Editing without reading the file first (causes stale context errors)
|
|
74
|
+
</avoid>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Python
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Executes Python cells sequentially in a persistent IPython kernel.
|
|
4
4
|
|
|
5
|
+
<instruction>
|
|
5
6
|
The kernel persists between calls and between cells. **Imports, variables, and functions survive.** Use this.
|
|
6
7
|
|
|
7
8
|
**Work incrementally:**
|
|
@@ -15,64 +16,9 @@ The kernel persists between calls and between cells. **Imports, variables, and f
|
|
|
15
16
|
- Earlier cells already ran—their state persists in the kernel
|
|
16
17
|
- Resubmit with only the fixed cell (or the fixed cell + remaining cells)
|
|
17
18
|
- Do NOT rewrite working cells or re-import modules
|
|
19
|
+
</instruction>
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
- Putting everything in one giant cell
|
|
21
|
-
- Re-importing modules you already imported
|
|
22
|
-
- Rewriting working code when only one part failed
|
|
23
|
-
- Large functions that are hard to debug piece by piece
|
|
24
|
-
|
|
25
|
-
```python
|
|
26
|
-
# BAD: One giant cell
|
|
27
|
-
cells: [{
|
|
28
|
-
"title": "all-in-one",
|
|
29
|
-
"code": "import json\nfrom pathlib import Path\ndef process_all_files():\n # 50 lines...\n pass\nresult = process_all_files()"
|
|
30
|
-
}]
|
|
31
|
-
|
|
32
|
-
# GOOD: Multiple small cells
|
|
33
|
-
cells: [
|
|
34
|
-
{"title": "imports", "code": "import json\nfrom pathlib import Path"},
|
|
35
|
-
{"title": "parse helper", "code": "def parse_config(path):\n return json.loads(Path(path).read_text())"},
|
|
36
|
-
{"title": "test helper", "code": "parse_config('config.json')"},
|
|
37
|
-
{"title": "use helper", "code": "configs = [parse_config(p) for p in Path('.').glob('*.json')]"}
|
|
38
|
-
]
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## When to use Python
|
|
42
|
-
|
|
43
|
-
**Use Python for user-facing operations:**
|
|
44
|
-
- Displaying, concatenating, or merging files → `cat(*paths)`
|
|
45
|
-
- Batch transformations across files → `batch(paths, fn)`, `rsed()`
|
|
46
|
-
- Formatted output, tables, summaries
|
|
47
|
-
- Any loop, conditional, or multi-step logic
|
|
48
|
-
- Anything you'd write a bash script for
|
|
49
|
-
|
|
50
|
-
**Use specialized tools for YOUR reconnaissance:**
|
|
51
|
-
- Reading to understand code → Read tool
|
|
52
|
-
- Searching to locate something → Grep tool
|
|
53
|
-
- Finding files to identify targets → Find tool
|
|
54
|
-
|
|
55
|
-
The distinction: Read/Grep/Find gather info for *your* decisions. Python executes *the user's* request.
|
|
56
|
-
|
|
57
|
-
**Prefer Python over bash for:**
|
|
58
|
-
- Loops and iteration → Python for-loops, not bash for/while
|
|
59
|
-
- Text processing → `sed()`, `cols()`, `sort_lines()`, not sed/awk/cut
|
|
60
|
-
- File operations → prelude helpers, not mv/cp/rm commands
|
|
61
|
-
- Conditionals → Python if/else, not bash [[ ]]
|
|
62
|
-
|
|
63
|
-
**Shell commands:** Use `sh()` or `run()`, never raw `subprocess`:
|
|
64
|
-
```python
|
|
65
|
-
# Good
|
|
66
|
-
sh("bun run check")
|
|
67
|
-
run("cargo build --release")
|
|
68
|
-
|
|
69
|
-
# Bad - never use subprocess directly
|
|
70
|
-
import subprocess
|
|
71
|
-
subprocess.run(["bun", "run", "check"], ...)
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
## Prelude helpers
|
|
75
|
-
|
|
21
|
+
<prelude>
|
|
76
22
|
All helpers auto-print results and return values for chaining.
|
|
77
23
|
|
|
78
24
|
{{#if categories.length}}
|
|
@@ -84,14 +30,49 @@ All helpers auto-print results and return values for chaining.
|
|
|
84
30
|
{{docstring}}
|
|
85
31
|
{{/each}}
|
|
86
32
|
```
|
|
87
|
-
|
|
88
33
|
{{/each}}
|
|
89
34
|
{{else}}
|
|
90
35
|
(Documentation unavailable — Python kernel failed to start)
|
|
91
36
|
{{/if}}
|
|
37
|
+
</prelude>
|
|
92
38
|
|
|
93
|
-
|
|
39
|
+
<output>
|
|
40
|
+
Output streams in real time, truncated after 100KB.
|
|
41
|
+
If output is truncated, full output is stored under $ARTIFACTS and referenced as `artifact://<id>` in metadata.
|
|
94
42
|
|
|
43
|
+
The user sees output like a Jupyter notebook—rich displays are fully rendered:
|
|
44
|
+
- `display(JSON(data))` → interactive JSON tree
|
|
45
|
+
- `display(HTML(...))` → rendered HTML
|
|
46
|
+
- `display(Markdown(...))` → formatted markdown
|
|
47
|
+
- `plt.show()` → inline figures
|
|
48
|
+
|
|
49
|
+
**You will see object repr** (e.g., `<IPython.core.display.JSON object>`) **but the user sees the rendered output.** Trust that `display()` calls work correctly—do not assume the user sees only the repr.
|
|
50
|
+
</output>
|
|
51
|
+
|
|
52
|
+
<important>
|
|
53
|
+
- Kernel persists for the session by default; per-call mode uses a fresh kernel each call
|
|
54
|
+
- Use `reset: true` to clear state when session mode is active
|
|
55
|
+
</important>
|
|
56
|
+
|
|
57
|
+
<critical>
|
|
58
|
+
- Use `plt.show()` to display figures
|
|
59
|
+
- Use `display()` from IPython.display for rich output (HTML, Markdown, images, etc.)
|
|
60
|
+
- Use `sh()` or `run()` for shell commands, never raw `subprocess`
|
|
61
|
+
</critical>
|
|
62
|
+
|
|
63
|
+
<example name="good">
|
|
64
|
+
```python
|
|
65
|
+
# Multiple small cells
|
|
66
|
+
cells: [
|
|
67
|
+
{"title": "imports", "code": "import json\nfrom pathlib import Path"},
|
|
68
|
+
{"title": "parse helper", "code": "def parse_config(path):\n return json.loads(Path(path).read_text())"},
|
|
69
|
+
{"title": "test helper", "code": "parse_config('config.json')"},
|
|
70
|
+
{"title": "use helper", "code": "configs = [parse_config(p) for p in Path('.').glob('*.json')]"}
|
|
71
|
+
]
|
|
72
|
+
```
|
|
73
|
+
</example>
|
|
74
|
+
|
|
75
|
+
<example name="prelude-helpers">
|
|
95
76
|
```python
|
|
96
77
|
# Concatenate all markdown files in docs/
|
|
97
78
|
cat(*find("*.md", "docs"))
|
|
@@ -108,22 +89,23 @@ sort_lines(read("data.txt"), unique=True)
|
|
|
108
89
|
# Extract columns 0 and 2 from TSV
|
|
109
90
|
cols(read("data.tsv"), 0, 2, sep="\t")
|
|
110
91
|
```
|
|
92
|
+
</example>
|
|
111
93
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
- Use `plt.show()` to display figures
|
|
118
|
-
- Use `display()` from IPython.display for rich output (HTML, Markdown, images, etc.)
|
|
119
|
-
- Output streams in real time, truncated after 50KB
|
|
120
|
-
|
|
121
|
-
## Rich output rendering
|
|
94
|
+
<example name="shell-commands">
|
|
95
|
+
```python
|
|
96
|
+
# Good
|
|
97
|
+
sh("bun run check")
|
|
98
|
+
run("cargo build --release")
|
|
122
99
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
100
|
+
# Bad - never use subprocess directly
|
|
101
|
+
import subprocess
|
|
102
|
+
subprocess.run(["bun", "run", "check"], ...)
|
|
103
|
+
```
|
|
104
|
+
</example>
|
|
128
105
|
|
|
129
|
-
|
|
106
|
+
<avoid>
|
|
107
|
+
- Putting everything in one giant cell
|
|
108
|
+
- Re-importing modules you already imported
|
|
109
|
+
- Rewriting working cells when only one part failed
|
|
110
|
+
- Large functions that are hard to debug piece by piece
|
|
111
|
+
</avoid>
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
Assume this tool is able to read all files on the machine. If the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.
|
|
1
|
+
# Read
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
- By default, it reads up to {{DEFAULT_MAX_LINES}} lines starting from the beginning of the file
|
|
6
|
-
- You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters
|
|
7
|
-
- Any lines longer than 500 characters will be truncated
|
|
8
|
-
- By default, results omit line numbers. Use `lines: true` to include them
|
|
9
|
-
- This tool allows Claude Code to read images (eg PNG, JPG, etc). When reading an image file the contents are presented visually as Claude Code is a multimodal LLM.
|
|
10
|
-
- This tool can read PDF files (.pdf). PDFs are processed page by page, extracting both text and visual content for analysis.
|
|
11
|
-
- This tool can read Jupyter notebooks (.ipynb files) and returns all cells with their outputs, combining code, text, and visualizations.
|
|
12
|
-
- This tool can only read files, not directories. To read a directory, use the ls tool.
|
|
13
|
-
- You can call multiple tools in a single response. It is always better to speculatively read multiple potentially useful files in parallel.
|
|
14
|
-
- You will regularly be asked to read screenshots. If the user provides a path to a screenshot, ALWAYS use this tool to view the file at the path. This tool will work with all temporary file paths.
|
|
15
|
-
- If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.
|
|
16
|
-
|
|
17
|
-
Empty files trigger a warning. Directory paths return an ls-style listing. Missing files return an error with closest matches (gitignore respected).
|
|
18
|
-
|
|
19
|
-
## Best Practices
|
|
3
|
+
Reads files from the local filesystem or internal URLs.
|
|
20
4
|
|
|
5
|
+
<instruction>
|
|
6
|
+
- Reads up to {{DEFAULT_MAX_LINES}} lines by default
|
|
7
|
+
- Use `offset` and `limit` for large files
|
|
8
|
+
- Use `lines: true` to include line numbers
|
|
9
|
+
- Supports images (PNG, JPG) and PDFs
|
|
10
|
+
- For directories, use the ls tool instead
|
|
21
11
|
- Parallelize reads when exploring related files
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
12
|
+
- Supports internal URLs:
|
|
13
|
+
- `skill://<name>` - read SKILL.md for a skill
|
|
14
|
+
- `skill://<name>/<path>` - read relative path within skill directory
|
|
15
|
+
- `rule://<name>` - read rule content
|
|
16
|
+
- `agent://<id>` - read agent output artifact
|
|
17
|
+
- `agent://<id>/<path>` or `agent://<id>?q=<query>` - extract JSON from agent output
|
|
18
|
+
</instruction>
|
|
19
|
+
|
|
20
|
+
<output>
|
|
21
|
+
- Returns file content as text
|
|
22
|
+
- Images: returns visual content for analysis
|
|
23
|
+
- PDFs: returns extracted text
|
|
24
|
+
- Missing files: returns closest filename matches for correction
|
|
25
|
+
- Internal URLs: returns resolved content with pagination support
|
|
26
|
+
</output>
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
+
# Replace
|
|
2
|
+
|
|
1
3
|
Performs string replacements in files with fuzzy whitespace matching.
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
- Use the smallest edit that uniquely identifies the change
|
|
5
|
-
- If
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
<instruction>
|
|
6
|
+
- Use the smallest edit that uniquely identifies the change
|
|
7
|
+
- If `old_text` is not unique, expand to include more context or use `all: true` to replace all occurrences
|
|
8
|
+
- Fuzzy matching handles minor whitespace/indentation differences automatically
|
|
9
|
+
- Prefer editing existing files over creating new ones
|
|
10
|
+
</instruction>
|
|
11
|
+
|
|
12
|
+
<output>
|
|
13
|
+
Returns success/failure status. On success, the file is modified in place with the replacement applied. On failure (e.g., `old_text` not found or matches multiple locations without `all: true`), returns an error describing the issue.
|
|
14
|
+
</output>
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
<critical>
|
|
17
|
+
- You must read the file at least once in the conversation before editing. The tool will error if you attempt an edit without reading the file first.
|
|
18
|
+
</critical>
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
<bash_alternatives>
|
|
21
|
+
Replace is for content-addressed changes—you identify *what* to change by its text.
|
|
16
22
|
|
|
17
23
|
For position-addressed or pattern-addressed changes, bash is more efficient:
|
|
18
24
|
|
|
@@ -27,5 +33,6 @@ For position-addressed or pattern-addressed changes, bash is more efficient:
|
|
|
27
33
|
| Copy lines N-M to another file | `sed -n 'N,Mp' src >> dest` |
|
|
28
34
|
| Move lines N-M to another file | `sed -n 'N,Mp' src >> dest && sed -i 'N,Md' src` |
|
|
29
35
|
|
|
30
|
-
Use
|
|
36
|
+
Use Replace when the *content itself* identifies the location.
|
|
31
37
|
Use bash when *position* or *pattern* identifies what to change.
|
|
38
|
+
</bash_alternatives>
|
package/src/prompts/tools/ssh.md
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
## Critical: Match Commands to Host Shell
|
|
1
|
+
# SSH
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
Execute commands on remote SSH hosts.
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
<instruction>
|
|
6
|
+
1. Check the host's shell type from "Available hosts" below
|
|
7
|
+
2. Use ONLY commands for that shell type
|
|
8
|
+
3. Construct your command using the reference below
|
|
9
|
+
</instruction>
|
|
8
10
|
|
|
11
|
+
<commands>
|
|
9
12
|
**linux/bash, linux/zsh, macos/bash, macos/zsh** — Unix-like systems:
|
|
10
13
|
- Files: `ls`, `cat`, `head`, `tail`, `grep`, `find`
|
|
11
14
|
- System: `ps`, `top`, `df`, `uname`, `free` (Linux), `df`, `uname`, `top` (macOS)
|
|
@@ -26,49 +29,39 @@ Each host runs a specific shell. **You MUST use commands native to that shell.**
|
|
|
26
29
|
- Files: `dir`, `type`, `findstr`, `where`
|
|
27
30
|
- System: `tasklist`, `systeminfo`
|
|
28
31
|
- Navigation: `cd`, `echo %CD%`
|
|
32
|
+
</commands>
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
<output>
|
|
35
|
+
Command output (stdout/stderr combined), truncated at 50KB. Exit code is captured.
|
|
36
|
+
If output is truncated, full output is stored under $ARTIFACTS and referenced as `artifact://<id>` in metadata.
|
|
37
|
+
</output>
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
<critical>
|
|
40
|
+
Each host runs a specific shell. You MUST use commands native to that shell.
|
|
41
|
+
Verify host shell type from "Available hosts" and use matching commands.
|
|
42
|
+
</critical>
|
|
35
43
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<example>
|
|
44
|
+
<example name="linux">
|
|
39
45
|
Task: List files in /home/user on host "server1"
|
|
40
46
|
Host: server1 (10.0.0.1) | linux/bash
|
|
41
47
|
Command: `ls -la /home/user`
|
|
42
48
|
</example>
|
|
43
49
|
|
|
44
|
-
<example>
|
|
50
|
+
<example name="windows-cmd">
|
|
45
51
|
Task: Show running processes on host "winbox"
|
|
46
52
|
Host: winbox (192.168.1.5) | windows/cmd
|
|
47
53
|
Command: `tasklist /v`
|
|
48
54
|
</example>
|
|
49
55
|
|
|
50
|
-
<example>
|
|
56
|
+
<example name="windows-wsl">
|
|
51
57
|
Task: Check disk usage on host "wsl-dev"
|
|
52
58
|
Host: wsl-dev (192.168.1.10) | windows/bash
|
|
53
59
|
Command: `df -h`
|
|
54
60
|
Note: Windows host with WSL — use Unix commands
|
|
55
61
|
</example>
|
|
56
62
|
|
|
57
|
-
<example>
|
|
63
|
+
<example name="macos">
|
|
58
64
|
Task: Get system info on host "macbook"
|
|
59
65
|
Host: macbook (10.0.0.20) | macos/zsh
|
|
60
66
|
Command: `uname -a && sw_vers`
|
|
61
67
|
</example>
|
|
62
|
-
|
|
63
|
-
## Parameters
|
|
64
|
-
|
|
65
|
-
- **host**: Host name from "Available hosts" below
|
|
66
|
-
- **command**: Command to execute (see Command Reference above)
|
|
67
|
-
- **cwd**: Working directory (optional)
|
|
68
|
-
- **timeout**: Timeout in seconds (optional)
|
|
69
|
-
|
|
70
|
-
## Output
|
|
71
|
-
|
|
72
|
-
Truncated at 50KB. Exit codes captured.
|
|
73
|
-
|
|
74
|
-
**Before executing: verify host shell type below and use matching commands.**
|