@hera-al/server 1.6.1
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/LICENSE +21 -0
- package/README.md +325 -0
- package/bundled/apple-notes/SKILL.md +77 -0
- package/bundled/apple-reminders/SKILL.md +96 -0
- package/bundled/blogwatcher/SKILL.md +69 -0
- package/bundled/camsnap/SKILL.md +45 -0
- package/bundled/discord/SKILL.md +578 -0
- package/bundled/gemini/SKILL.md +43 -0
- package/bundled/gifgrep/SKILL.md +79 -0
- package/bundled/github/SKILL.md +77 -0
- package/bundled/gog/SKILL.md +116 -0
- package/bundled/goplaces/SKILL.md +52 -0
- package/bundled/himalaya/SKILL.md +257 -0
- package/bundled/himalaya/references/configuration.md +184 -0
- package/bundled/himalaya/references/message-composition.md +199 -0
- package/bundled/homebrew/SKILL.md +82 -0
- package/bundled/local-places/SERVER_README.md +101 -0
- package/bundled/local-places/SKILL.md +102 -0
- package/bundled/local-places/pyproject.toml +21 -0
- package/bundled/local-places/src/local_places/__init__.py +2 -0
- package/bundled/local-places/src/local_places/google_places.py +314 -0
- package/bundled/local-places/src/local_places/main.py +65 -0
- package/bundled/local-places/src/local_places/schemas.py +107 -0
- package/bundled/markitdown/SKILL.md +96 -0
- package/bundled/mcporter/SKILL.md +61 -0
- package/bundled/merge-pr/SKILL.md +187 -0
- package/bundled/merge-pr/agents/openai.yaml +4 -0
- package/bundled/nano-banana-pro/SKILL.md +58 -0
- package/bundled/nano-banana-pro/scripts/generate_image.py +184 -0
- package/bundled/nano-pdf/SKILL.md +38 -0
- package/bundled/open-prose/README.md +25 -0
- package/bundled/open-prose/index.ts +5 -0
- package/bundled/open-prose/openclaw.plugin.json +11 -0
- package/bundled/open-prose/package.json +15 -0
- package/bundled/open-prose/skills/prose/LICENSE +21 -0
- package/bundled/open-prose/skills/prose/SKILL.md +323 -0
- package/bundled/open-prose/skills/prose/alt-borges.md +141 -0
- package/bundled/open-prose/skills/prose/alts/arabian-nights.md +358 -0
- package/bundled/open-prose/skills/prose/alts/borges.md +360 -0
- package/bundled/open-prose/skills/prose/alts/folk.md +322 -0
- package/bundled/open-prose/skills/prose/alts/homer.md +346 -0
- package/bundled/open-prose/skills/prose/alts/kafka.md +373 -0
- package/bundled/open-prose/skills/prose/compiler.md +2971 -0
- package/bundled/open-prose/skills/prose/examples/01-hello-world.prose +4 -0
- package/bundled/open-prose/skills/prose/examples/02-research-and-summarize.prose +6 -0
- package/bundled/open-prose/skills/prose/examples/03-code-review.prose +17 -0
- package/bundled/open-prose/skills/prose/examples/04-write-and-refine.prose +14 -0
- package/bundled/open-prose/skills/prose/examples/05-debug-issue.prose +20 -0
- package/bundled/open-prose/skills/prose/examples/06-explain-codebase.prose +17 -0
- package/bundled/open-prose/skills/prose/examples/07-refactor.prose +20 -0
- package/bundled/open-prose/skills/prose/examples/08-blog-post.prose +20 -0
- package/bundled/open-prose/skills/prose/examples/09-research-with-agents.prose +25 -0
- package/bundled/open-prose/skills/prose/examples/10-code-review-agents.prose +32 -0
- package/bundled/open-prose/skills/prose/examples/11-skills-and-imports.prose +27 -0
- package/bundled/open-prose/skills/prose/examples/12-secure-agent-permissions.prose +43 -0
- package/bundled/open-prose/skills/prose/examples/13-variables-and-context.prose +51 -0
- package/bundled/open-prose/skills/prose/examples/14-composition-blocks.prose +48 -0
- package/bundled/open-prose/skills/prose/examples/15-inline-sequences.prose +23 -0
- package/bundled/open-prose/skills/prose/examples/16-parallel-reviews.prose +19 -0
- package/bundled/open-prose/skills/prose/examples/17-parallel-research.prose +19 -0
- package/bundled/open-prose/skills/prose/examples/18-mixed-parallel-sequential.prose +36 -0
- package/bundled/open-prose/skills/prose/examples/19-advanced-parallel.prose +71 -0
- package/bundled/open-prose/skills/prose/examples/20-fixed-loops.prose +20 -0
- package/bundled/open-prose/skills/prose/examples/21-pipeline-operations.prose +35 -0
- package/bundled/open-prose/skills/prose/examples/22-error-handling.prose +51 -0
- package/bundled/open-prose/skills/prose/examples/23-retry-with-backoff.prose +63 -0
- package/bundled/open-prose/skills/prose/examples/24-choice-blocks.prose +86 -0
- package/bundled/open-prose/skills/prose/examples/25-conditionals.prose +114 -0
- package/bundled/open-prose/skills/prose/examples/26-parameterized-blocks.prose +100 -0
- package/bundled/open-prose/skills/prose/examples/27-string-interpolation.prose +105 -0
- package/bundled/open-prose/skills/prose/examples/28-automated-pr-review.prose +37 -0
- package/bundled/open-prose/skills/prose/examples/28-gas-town.prose +1572 -0
- package/bundled/open-prose/skills/prose/examples/29-captains-chair.prose +218 -0
- package/bundled/open-prose/skills/prose/examples/30-captains-chair-simple.prose +42 -0
- package/bundled/open-prose/skills/prose/examples/31-captains-chair-with-memory.prose +145 -0
- package/bundled/open-prose/skills/prose/examples/33-pr-review-autofix.prose +168 -0
- package/bundled/open-prose/skills/prose/examples/34-content-pipeline.prose +204 -0
- package/bundled/open-prose/skills/prose/examples/35-feature-factory.prose +296 -0
- package/bundled/open-prose/skills/prose/examples/36-bug-hunter.prose +237 -0
- package/bundled/open-prose/skills/prose/examples/37-the-forge.prose +1474 -0
- package/bundled/open-prose/skills/prose/examples/38-skill-scan.prose +455 -0
- package/bundled/open-prose/skills/prose/examples/39-architect-by-simulation.prose +277 -0
- package/bundled/open-prose/skills/prose/examples/40-rlm-self-refine.prose +32 -0
- package/bundled/open-prose/skills/prose/examples/41-rlm-divide-conquer.prose +38 -0
- package/bundled/open-prose/skills/prose/examples/42-rlm-filter-recurse.prose +46 -0
- package/bundled/open-prose/skills/prose/examples/43-rlm-pairwise.prose +50 -0
- package/bundled/open-prose/skills/prose/examples/44-run-endpoint-ux-test.prose +261 -0
- package/bundled/open-prose/skills/prose/examples/45-plugin-release.prose +159 -0
- package/bundled/open-prose/skills/prose/examples/45-run-endpoint-ux-test-with-remediation.prose +637 -0
- package/bundled/open-prose/skills/prose/examples/46-run-endpoint-ux-test-fast.prose +148 -0
- package/bundled/open-prose/skills/prose/examples/46-workflow-crystallizer.prose +225 -0
- package/bundled/open-prose/skills/prose/examples/47-language-self-improvement.prose +356 -0
- package/bundled/open-prose/skills/prose/examples/48-habit-miner.prose +445 -0
- package/bundled/open-prose/skills/prose/examples/49-prose-run-retrospective.prose +210 -0
- package/bundled/open-prose/skills/prose/examples/README.md +391 -0
- package/bundled/open-prose/skills/prose/examples/roadmap/README.md +22 -0
- package/bundled/open-prose/skills/prose/examples/roadmap/iterative-refinement.prose +20 -0
- package/bundled/open-prose/skills/prose/examples/roadmap/parallel-review.prose +18 -0
- package/bundled/open-prose/skills/prose/examples/roadmap/simple-pipeline.prose +17 -0
- package/bundled/open-prose/skills/prose/examples/roadmap/syntax/open-prose-syntax.prose +223 -0
- package/bundled/open-prose/skills/prose/guidance/antipatterns.md +951 -0
- package/bundled/open-prose/skills/prose/guidance/patterns.md +700 -0
- package/bundled/open-prose/skills/prose/guidance/system-prompt.md +180 -0
- package/bundled/open-prose/skills/prose/help.md +144 -0
- package/bundled/open-prose/skills/prose/lib/README.md +108 -0
- package/bundled/open-prose/skills/prose/lib/calibrator.prose +215 -0
- package/bundled/open-prose/skills/prose/lib/cost-analyzer.prose +174 -0
- package/bundled/open-prose/skills/prose/lib/error-forensics.prose +250 -0
- package/bundled/open-prose/skills/prose/lib/inspector.prose +196 -0
- package/bundled/open-prose/skills/prose/lib/profiler.prose +460 -0
- package/bundled/open-prose/skills/prose/lib/program-improver.prose +275 -0
- package/bundled/open-prose/skills/prose/lib/project-memory.prose +118 -0
- package/bundled/open-prose/skills/prose/lib/user-memory.prose +93 -0
- package/bundled/open-prose/skills/prose/lib/vm-improver.prose +243 -0
- package/bundled/open-prose/skills/prose/primitives/session.md +593 -0
- package/bundled/open-prose/skills/prose/prose.md +1237 -0
- package/bundled/open-prose/skills/prose/state/filesystem.md +498 -0
- package/bundled/open-prose/skills/prose/state/in-context.md +384 -0
- package/bundled/open-prose/skills/prose/state/postgres.md +880 -0
- package/bundled/open-prose/skills/prose/state/sqlite.md +574 -0
- package/bundled/peekaboo/SKILL.md +190 -0
- package/bundled/prepare-pr/SKILL.md +277 -0
- package/bundled/prepare-pr/agents/openai.yaml +4 -0
- package/bundled/review-pr/SKILL.md +228 -0
- package/bundled/review-pr/agents/openai.yaml +4 -0
- package/bundled/sag/SKILL.md +87 -0
- package/bundled/skill-creator/SKILL.md +370 -0
- package/bundled/skill-creator/license.txt +202 -0
- package/bundled/skill-creator/scripts/init_skill.py +378 -0
- package/bundled/skill-creator/scripts/package_skill.py +111 -0
- package/bundled/skill-creator/scripts/quick_validate.py +101 -0
- package/bundled/spotify-player/SKILL.md +64 -0
- package/bundled/ssh/SKILL.md +119 -0
- package/bundled/summarize/SKILL.md +87 -0
- package/bundled/video-frames/SKILL.md +46 -0
- package/bundled/video-frames/scripts/frame.sh +81 -0
- package/bundled/voice-call/SKILL.md +45 -0
- package/bundled/wacli/SKILL.md +72 -0
- package/bundled/weather/SKILL.md +54 -0
- package/dist/agent/agent-service.d.ts +88 -0
- package/dist/agent/agent-service.js +1 -0
- package/dist/agent/message-queue.d.ts +24 -0
- package/dist/agent/message-queue.js +1 -0
- package/dist/agent/prompt-builder.d.ts +58 -0
- package/dist/agent/prompt-builder.js +1 -0
- package/dist/agent/session-agent.d.ts +197 -0
- package/dist/agent/session-agent.js +1 -0
- package/dist/agent/session-db.d.ts +26 -0
- package/dist/agent/session-db.js +1 -0
- package/dist/agent/session-error-handler.d.ts +37 -0
- package/dist/agent/session-error-handler.js +1 -0
- package/dist/agent/session-manager.d.ts +19 -0
- package/dist/agent/session-manager.js +1 -0
- package/dist/agent/workspace-files.d.ts +51 -0
- package/dist/agent/workspace-files.js +1 -0
- package/dist/auth/auth-middleware.d.ts +9 -0
- package/dist/auth/auth-middleware.js +1 -0
- package/dist/auth/node-signature-db.d.ts +30 -0
- package/dist/auth/node-signature-db.js +1 -0
- package/dist/auth/token-db.d.ts +38 -0
- package/dist/auth/token-db.js +1 -0
- package/dist/browser/browser-service.d.ts +9 -0
- package/dist/browser/browser-service.js +1 -0
- package/dist/channels/channel.d.ts +2 -0
- package/dist/channels/channel.js +1 -0
- package/dist/channels/responses.d.ts +21 -0
- package/dist/channels/responses.js +1 -0
- package/dist/commands/clear.d.ts +7 -0
- package/dist/commands/clear.js +1 -0
- package/dist/commands/cmd.d.ts +7 -0
- package/dist/commands/cmd.js +1 -0
- package/dist/commands/coder.d.ts +12 -0
- package/dist/commands/coder.js +1 -0
- package/dist/commands/command-registry.d.ts +12 -0
- package/dist/commands/command-registry.js +1 -0
- package/dist/commands/command.d.ts +22 -0
- package/dist/commands/command.js +1 -0
- package/dist/commands/compact.d.ts +7 -0
- package/dist/commands/compact.js +1 -0
- package/dist/commands/customsubagents.d.ts +15 -0
- package/dist/commands/customsubagents.js +1 -0
- package/dist/commands/help.d.ts +9 -0
- package/dist/commands/help.js +1 -0
- package/dist/commands/mcp.d.ts +9 -0
- package/dist/commands/mcp.js +1 -0
- package/dist/commands/model.d.ts +22 -0
- package/dist/commands/model.js +1 -0
- package/dist/commands/models.d.ts +11 -0
- package/dist/commands/models.js +1 -0
- package/dist/commands/new.d.ts +7 -0
- package/dist/commands/new.js +1 -0
- package/dist/commands/plugin.d.ts +7 -0
- package/dist/commands/plugin.js +1 -0
- package/dist/commands/sandbox.d.ts +12 -0
- package/dist/commands/sandbox.js +1 -0
- package/dist/commands/showtool.d.ts +12 -0
- package/dist/commands/showtool.js +1 -0
- package/dist/commands/status.d.ts +24 -0
- package/dist/commands/status.js +1 -0
- package/dist/commands/stop.d.ts +10 -0
- package/dist/commands/stop.js +1 -0
- package/dist/commands/subagents.d.ts +12 -0
- package/dist/commands/subagents.js +1 -0
- package/dist/commands/usage.d.ts +25 -0
- package/dist/commands/usage.js +1 -0
- package/dist/commands/useplugin.d.ts +7 -0
- package/dist/commands/useplugin.js +1 -0
- package/dist/config-watcher.d.ts +14 -0
- package/dist/config-watcher.js +1 -0
- package/dist/config.d.ts +267 -0
- package/dist/config.js +1 -0
- package/dist/cron/cron-service.d.ts +57 -0
- package/dist/cron/cron-service.js +1 -0
- package/dist/cron/heartbeat-token.d.ts +29 -0
- package/dist/cron/heartbeat-token.js +1 -0
- package/dist/cron/schedule.d.ts +3 -0
- package/dist/cron/schedule.js +1 -0
- package/dist/cron/store.d.ts +4 -0
- package/dist/cron/store.js +1 -0
- package/dist/cron/types.d.ts +47 -0
- package/dist/cron/types.js +1 -0
- package/dist/gateway/bridge.d.ts +38 -0
- package/dist/gateway/bridge.js +1 -0
- package/dist/gateway/channel-manager.d.ts +45 -0
- package/dist/gateway/channel-manager.js +1 -0
- package/dist/gateway/channels/qr-image.d.ts +5 -0
- package/dist/gateway/channels/qr-image.js +1 -0
- package/dist/gateway/channels/telegram.d.ts +39 -0
- package/dist/gateway/channels/telegram.js +1 -0
- package/dist/gateway/channels/webchat.d.ts +51 -0
- package/dist/gateway/channels/webchat.js +1 -0
- package/dist/gateway/channels/whatsapp.d.ts +40 -0
- package/dist/gateway/channels/whatsapp.js +1 -0
- package/dist/gateway/node-registry.d.ts +38 -0
- package/dist/gateway/node-registry.js +1 -0
- package/dist/heracli/index.d.ts +3 -0
- package/dist/heracli/index.js +2 -0
- package/dist/heracli/logs.d.ts +13 -0
- package/dist/heracli/logs.js +1 -0
- package/dist/heracli/security/audit.d.ts +17 -0
- package/dist/heracli/security/audit.js +1 -0
- package/dist/heracli/security/checks/channel-policies.d.ts +6 -0
- package/dist/heracli/security/checks/channel-policies.js +1 -0
- package/dist/heracli/security/checks/credentials.d.ts +6 -0
- package/dist/heracli/security/checks/credentials.js +1 -0
- package/dist/heracli/security/checks/fs-permissions.d.ts +6 -0
- package/dist/heracli/security/checks/fs-permissions.js +1 -0
- package/dist/heracli/security/checks/network.d.ts +4 -0
- package/dist/heracli/security/checks/network.js +1 -0
- package/dist/heracli/security/report.d.ts +4 -0
- package/dist/heracli/security/report.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/installer/hera.d.ts +3 -0
- package/dist/installer/hera.js +2 -0
- package/dist/media/message-processor.d.ts +23 -0
- package/dist/media/message-processor.js +1 -0
- package/dist/memory/memory-manager.d.ts +21 -0
- package/dist/memory/memory-manager.js +1 -0
- package/dist/memory/memory-provider.d.ts +22 -0
- package/dist/memory/memory-provider.js +1 -0
- package/dist/memory/memory-search.d.ts +102 -0
- package/dist/memory/memory-search.js +1 -0
- package/dist/memory/recall-strategies.d.ts +2 -0
- package/dist/memory/recall-strategies.js +1 -0
- package/dist/nostromo/auth.d.ts +29 -0
- package/dist/nostromo/auth.js +1 -0
- package/dist/nostromo/nostromo.d.ts +23 -0
- package/dist/nostromo/nostromo.js +1 -0
- package/dist/nostromo/ui-html-layout.d.ts +3 -0
- package/dist/nostromo/ui-html-layout.js +1 -0
- package/dist/nostromo/ui-html-modals.d.ts +3 -0
- package/dist/nostromo/ui-html-modals.js +1 -0
- package/dist/nostromo/ui-js-agent.d.ts +3 -0
- package/dist/nostromo/ui-js-agent.js +1 -0
- package/dist/nostromo/ui-js-channels.d.ts +3 -0
- package/dist/nostromo/ui-js-channels.js +1 -0
- package/dist/nostromo/ui-js-competences.d.ts +3 -0
- package/dist/nostromo/ui-js-competences.js +1 -0
- package/dist/nostromo/ui-js-config.d.ts +3 -0
- package/dist/nostromo/ui-js-config.js +1 -0
- package/dist/nostromo/ui-js-core.d.ts +3 -0
- package/dist/nostromo/ui-js-core.js +1 -0
- package/dist/nostromo/ui-js-ops.d.ts +3 -0
- package/dist/nostromo/ui-js-ops.js +1 -0
- package/dist/nostromo/ui-js-prompts.d.ts +3 -0
- package/dist/nostromo/ui-js-prompts.js +1 -0
- package/dist/nostromo/ui-styles.d.ts +3 -0
- package/dist/nostromo/ui-styles.js +1 -0
- package/dist/nostromo/ui.d.ts +2 -0
- package/dist/nostromo/ui.js +1 -0
- package/dist/server.d.ts +80 -0
- package/dist/server.js +1 -0
- package/dist/stt/local-whisper.d.ts +9 -0
- package/dist/stt/local-whisper.js +1 -0
- package/dist/stt/openai-whisper.d.ts +14 -0
- package/dist/stt/openai-whisper.js +1 -0
- package/dist/stt/stt-loader.d.ts +4 -0
- package/dist/stt/stt-loader.js +1 -0
- package/dist/stt/stt-provider.d.ts +4 -0
- package/dist/stt/stt-provider.js +1 -0
- package/dist/tools/browser-tools.d.ts +9 -0
- package/dist/tools/browser-tools.js +1 -0
- package/dist/tools/cron-tools.d.ts +4 -0
- package/dist/tools/cron-tools.js +1 -0
- package/dist/tools/memory-tools.d.ts +3 -0
- package/dist/tools/memory-tools.js +1 -0
- package/dist/tools/message-tools.d.ts +5 -0
- package/dist/tools/message-tools.js +1 -0
- package/dist/tools/node-tools.d.ts +3 -0
- package/dist/tools/node-tools.js +1 -0
- package/dist/tools/server-tools.d.ts +2 -0
- package/dist/tools/server-tools.js +1 -0
- package/dist/tools/tts-tools.d.ts +3 -0
- package/dist/tools/tts-tools.js +1 -0
- package/dist/tts/tts-service.d.ts +19 -0
- package/dist/tts/tts-service.js +1 -0
- package/dist/utils/chunk.d.ts +3 -0
- package/dist/utils/chunk.js +1 -0
- package/dist/utils/logger.d.ts +16 -0
- package/dist/utils/logger.js +1 -0
- package/dist/utils/markdown/fences.d.ts +11 -0
- package/dist/utils/markdown/fences.js +1 -0
- package/dist/utils/markdown/ir.d.ts +33 -0
- package/dist/utils/markdown/ir.js +1 -0
- package/dist/utils/markdown/render.d.ts +19 -0
- package/dist/utils/markdown/render.js +1 -0
- package/dist/utils/markdown/tables.d.ts +3 -0
- package/dist/utils/markdown/tables.js +1 -0
- package/dist/utils/media-response.d.ts +29 -0
- package/dist/utils/media-response.js +1 -0
- package/dist/utils/package-paths.d.ts +5 -0
- package/dist/utils/package-paths.js +1 -0
- package/dist/utils/telegram-format.d.ts +13 -0
- package/dist/utils/telegram-format.js +1 -0
- package/installationPkg/.env.example +26 -0
- package/installationPkg/AGENTS.md +143 -0
- package/installationPkg/BOOTSTRAP.md +45 -0
- package/installationPkg/CBINT.json +16 -0
- package/installationPkg/HEARTBEAT.md +5 -0
- package/installationPkg/IDENTITY.md +7 -0
- package/installationPkg/SOUL.md +36 -0
- package/installationPkg/SYSTEM_PROMPT.md +55 -0
- package/installationPkg/SYSTEM_PROMPT_SUBAGENT.md +40 -0
- package/installationPkg/TOOLS.md +36 -0
- package/installationPkg/USER.md +11 -0
- package/installationPkg/config.example.yaml +291 -0
- package/package.json +95 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Bug Hunter
|
|
2
|
+
#
|
|
3
|
+
# Given a bug report or error, systematically investigate, diagnose,
|
|
4
|
+
# and fix it. Watch the AI think through the problem like a senior
|
|
5
|
+
# developer - gathering evidence, forming hypotheses, and verifying fixes.
|
|
6
|
+
#
|
|
7
|
+
# Usage: Paste an error message or describe a bug.
|
|
8
|
+
|
|
9
|
+
input bug_report: "Error message, stack trace, or bug description"
|
|
10
|
+
|
|
11
|
+
agent detective:
|
|
12
|
+
model: opus
|
|
13
|
+
persist: true
|
|
14
|
+
prompt: """
|
|
15
|
+
You are a debugging specialist. Your approach:
|
|
16
|
+
1. Gather evidence before forming hypotheses
|
|
17
|
+
2. Follow the data, not assumptions
|
|
18
|
+
3. Verify each hypothesis with tests
|
|
19
|
+
4. Document your reasoning for future reference
|
|
20
|
+
|
|
21
|
+
Think out loud. Show your work.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
agent surgeon:
|
|
25
|
+
model: opus
|
|
26
|
+
prompt: """
|
|
27
|
+
You are a code surgeon. You make precise, minimal fixes:
|
|
28
|
+
- Change only what's necessary
|
|
29
|
+
- Preserve existing behavior
|
|
30
|
+
- Add regression tests
|
|
31
|
+
- Leave code cleaner than you found it
|
|
32
|
+
|
|
33
|
+
No drive-by refactoring. Fix the bug, nothing more.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
# ============================================================================
|
|
37
|
+
# Phase 1: Evidence Gathering
|
|
38
|
+
# ============================================================================
|
|
39
|
+
|
|
40
|
+
session: detective
|
|
41
|
+
prompt: "New bug to investigate. Let me gather initial evidence."
|
|
42
|
+
|
|
43
|
+
parallel:
|
|
44
|
+
# Parse the error
|
|
45
|
+
error_analysis = session: detective
|
|
46
|
+
prompt: """
|
|
47
|
+
Analyze this bug report/error:
|
|
48
|
+
{bug_report}
|
|
49
|
+
|
|
50
|
+
Extract:
|
|
51
|
+
- Error type and message
|
|
52
|
+
- Stack trace (if present)
|
|
53
|
+
- File paths and line numbers
|
|
54
|
+
- Any patterns or keywords
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
# Search for related code
|
|
58
|
+
code_context = session "Search for related code"
|
|
59
|
+
prompt: """
|
|
60
|
+
Based on the error, search the codebase:
|
|
61
|
+
1. Find the file(s) mentioned in the error
|
|
62
|
+
2. Find related files that might be involved
|
|
63
|
+
3. Look for similar patterns that might have the same bug
|
|
64
|
+
4. Check git history for recent changes to these files
|
|
65
|
+
|
|
66
|
+
Use Glob and Grep to search efficiently.
|
|
67
|
+
"""
|
|
68
|
+
context: bug_report
|
|
69
|
+
|
|
70
|
+
# Check for known issues
|
|
71
|
+
prior_knowledge = session "Check for similar issues"
|
|
72
|
+
prompt: """
|
|
73
|
+
Search for similar issues:
|
|
74
|
+
1. Check git log for related commits
|
|
75
|
+
2. Search for TODO/FIXME comments nearby
|
|
76
|
+
3. Look for any existing tests that might be relevant
|
|
77
|
+
|
|
78
|
+
Report what you find.
|
|
79
|
+
"""
|
|
80
|
+
context: bug_report
|
|
81
|
+
|
|
82
|
+
# ============================================================================
|
|
83
|
+
# Phase 2: Diagnosis
|
|
84
|
+
# ============================================================================
|
|
85
|
+
|
|
86
|
+
resume: detective
|
|
87
|
+
prompt: """
|
|
88
|
+
Synthesize all evidence into hypotheses.
|
|
89
|
+
|
|
90
|
+
For each hypothesis:
|
|
91
|
+
- State the theory
|
|
92
|
+
- Supporting evidence
|
|
93
|
+
- How to verify
|
|
94
|
+
- Confidence level (high/medium/low)
|
|
95
|
+
|
|
96
|
+
Start with the most likely cause.
|
|
97
|
+
"""
|
|
98
|
+
context: { error_analysis, code_context, prior_knowledge }
|
|
99
|
+
|
|
100
|
+
let hypotheses = resume: detective
|
|
101
|
+
prompt: "List hypotheses in order of likelihood. We'll test the top one first."
|
|
102
|
+
|
|
103
|
+
# ============================================================================
|
|
104
|
+
# Phase 3: Hypothesis Testing
|
|
105
|
+
# ============================================================================
|
|
106
|
+
|
|
107
|
+
loop until **root cause confirmed** (max: 5):
|
|
108
|
+
let current_hypothesis = resume: detective
|
|
109
|
+
prompt: "Select the next most likely hypothesis to test."
|
|
110
|
+
context: hypotheses
|
|
111
|
+
|
|
112
|
+
# Design and run a test
|
|
113
|
+
let test_result = session: detective
|
|
114
|
+
prompt: """
|
|
115
|
+
Test this hypothesis: {current_hypothesis}
|
|
116
|
+
|
|
117
|
+
Design a verification approach:
|
|
118
|
+
1. What would we expect to see if this is the cause?
|
|
119
|
+
2. How can we reproduce it?
|
|
120
|
+
3. Run the test and report results
|
|
121
|
+
|
|
122
|
+
Use actual code execution to verify.
|
|
123
|
+
"""
|
|
124
|
+
context: { current_hypothesis, code_context }
|
|
125
|
+
|
|
126
|
+
# Evaluate result
|
|
127
|
+
choice **based on the test results**:
|
|
128
|
+
option "Hypothesis confirmed":
|
|
129
|
+
resume: detective
|
|
130
|
+
prompt: """
|
|
131
|
+
Root cause confirmed: {current_hypothesis}
|
|
132
|
+
|
|
133
|
+
Document:
|
|
134
|
+
- The exact cause
|
|
135
|
+
- Why it happens
|
|
136
|
+
- The conditions that trigger it
|
|
137
|
+
"""
|
|
138
|
+
context: test_result
|
|
139
|
+
|
|
140
|
+
option "Hypothesis disproven":
|
|
141
|
+
resume: detective
|
|
142
|
+
prompt: """
|
|
143
|
+
Hypothesis disproven. Update our understanding:
|
|
144
|
+
- What did we learn?
|
|
145
|
+
- How does this change remaining hypotheses?
|
|
146
|
+
- What should we test next?
|
|
147
|
+
"""
|
|
148
|
+
context: test_result
|
|
149
|
+
hypotheses = resume: detective
|
|
150
|
+
prompt: "Re-rank remaining hypotheses based on new evidence"
|
|
151
|
+
|
|
152
|
+
option "Inconclusive - need more evidence":
|
|
153
|
+
resume: detective
|
|
154
|
+
prompt: "What additional evidence do we need? How do we get it?"
|
|
155
|
+
context: test_result
|
|
156
|
+
|
|
157
|
+
# ============================================================================
|
|
158
|
+
# Phase 4: Fix Implementation
|
|
159
|
+
# ============================================================================
|
|
160
|
+
|
|
161
|
+
let diagnosis = resume: detective
|
|
162
|
+
prompt: """
|
|
163
|
+
Final diagnosis summary:
|
|
164
|
+
- Root cause: [what]
|
|
165
|
+
- Location: [where]
|
|
166
|
+
- Trigger: [when/how]
|
|
167
|
+
- Impact: [what breaks]
|
|
168
|
+
|
|
169
|
+
Hand off to surgeon for the fix.
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
session: surgeon
|
|
173
|
+
prompt: """
|
|
174
|
+
Implement the fix for this bug:
|
|
175
|
+
|
|
176
|
+
{diagnosis}
|
|
177
|
+
|
|
178
|
+
Steps:
|
|
179
|
+
1. Read and understand the code around the bug
|
|
180
|
+
2. Implement the minimal fix
|
|
181
|
+
3. Verify the fix doesn't break other things
|
|
182
|
+
4. Create a test that would have caught this bug
|
|
183
|
+
"""
|
|
184
|
+
context: { diagnosis, code_context }
|
|
185
|
+
|
|
186
|
+
# Run tests to verify
|
|
187
|
+
let verification = session "Verify the fix"
|
|
188
|
+
prompt: """
|
|
189
|
+
Verify the fix works:
|
|
190
|
+
1. Run the reproduction case - should now pass
|
|
191
|
+
2. Run the full test suite - should all pass
|
|
192
|
+
3. Check for any edge cases we might have missed
|
|
193
|
+
"""
|
|
194
|
+
|
|
195
|
+
if **tests are failing**:
|
|
196
|
+
loop until **all tests pass** (max: 3):
|
|
197
|
+
session: surgeon
|
|
198
|
+
prompt: "Fix is incomplete. Adjust based on test results."
|
|
199
|
+
context: verification
|
|
200
|
+
|
|
201
|
+
verification = session "Re-verify after adjustment"
|
|
202
|
+
prompt: "Run tests again and report"
|
|
203
|
+
|
|
204
|
+
# ============================================================================
|
|
205
|
+
# Phase 5: Documentation & Commit
|
|
206
|
+
# ============================================================================
|
|
207
|
+
|
|
208
|
+
session "Create bug fix commit"
|
|
209
|
+
prompt: """
|
|
210
|
+
Create a well-documented commit:
|
|
211
|
+
|
|
212
|
+
git commit with message:
|
|
213
|
+
fix: [brief description]
|
|
214
|
+
|
|
215
|
+
Root cause: [what was wrong]
|
|
216
|
+
Fix: [what we changed]
|
|
217
|
+
Test: [what test we added]
|
|
218
|
+
|
|
219
|
+
Closes #[issue number if applicable]
|
|
220
|
+
"""
|
|
221
|
+
|
|
222
|
+
output report = resume: detective
|
|
223
|
+
prompt: """
|
|
224
|
+
Bug Hunt Complete!
|
|
225
|
+
|
|
226
|
+
Investigation Report:
|
|
227
|
+
- Bug: {bug_report summary}
|
|
228
|
+
- Root Cause: {diagnosis}
|
|
229
|
+
- Fix: [files changed]
|
|
230
|
+
- Tests Added: [what tests]
|
|
231
|
+
- Time to Resolution: [duration]
|
|
232
|
+
|
|
233
|
+
Lessons Learned:
|
|
234
|
+
- How could we have caught this earlier?
|
|
235
|
+
- Are there similar patterns to check?
|
|
236
|
+
- Should we add any tooling/linting?
|
|
237
|
+
"""
|