@blxzer/cursor-trellis 0.1.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 +45 -0
- package/LICENSE +235 -0
- package/README.md +9 -0
- package/bin/smart-search.js +79 -0
- package/bin/trellis.js +3 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +258 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/channel/adapters/claude.d.ts +29 -0
- package/dist/commands/channel/adapters/claude.d.ts.map +1 -0
- package/dist/commands/channel/adapters/claude.js +203 -0
- package/dist/commands/channel/adapters/claude.js.map +1 -0
- package/dist/commands/channel/adapters/codex.d.ts +85 -0
- package/dist/commands/channel/adapters/codex.d.ts.map +1 -0
- package/dist/commands/channel/adapters/codex.js +505 -0
- package/dist/commands/channel/adapters/codex.js.map +1 -0
- package/dist/commands/channel/adapters/index.d.ts +84 -0
- package/dist/commands/channel/adapters/index.d.ts.map +1 -0
- package/dist/commands/channel/adapters/index.js +115 -0
- package/dist/commands/channel/adapters/index.js.map +1 -0
- package/dist/commands/channel/adapters/types.d.ts +33 -0
- package/dist/commands/channel/adapters/types.d.ts.map +1 -0
- package/dist/commands/channel/adapters/types.js +2 -0
- package/dist/commands/channel/adapters/types.js.map +1 -0
- package/dist/commands/channel/agent-loader.d.ts +32 -0
- package/dist/commands/channel/agent-loader.d.ts.map +1 -0
- package/dist/commands/channel/agent-loader.js +154 -0
- package/dist/commands/channel/agent-loader.js.map +1 -0
- package/dist/commands/channel/context-loader.d.ts +26 -0
- package/dist/commands/channel/context-loader.d.ts.map +1 -0
- package/dist/commands/channel/context-loader.js +290 -0
- package/dist/commands/channel/context-loader.js.map +1 -0
- package/dist/commands/channel/context.d.ts +16 -0
- package/dist/commands/channel/context.d.ts.map +1 -0
- package/dist/commands/channel/context.js +83 -0
- package/dist/commands/channel/context.js.map +1 -0
- package/dist/commands/channel/create.d.ts +27 -0
- package/dist/commands/channel/create.d.ts.map +1 -0
- package/dist/commands/channel/create.js +39 -0
- package/dist/commands/channel/create.js.map +1 -0
- package/dist/commands/channel/dev-parse-trace.d.ts +14 -0
- package/dist/commands/channel/dev-parse-trace.d.ts.map +1 -0
- package/dist/commands/channel/dev-parse-trace.js +70 -0
- package/dist/commands/channel/dev-parse-trace.js.map +1 -0
- package/dist/commands/channel/guard.d.ts +150 -0
- package/dist/commands/channel/guard.d.ts.map +1 -0
- package/dist/commands/channel/guard.js +474 -0
- package/dist/commands/channel/guard.js.map +1 -0
- package/dist/commands/channel/index.d.ts +3 -0
- package/dist/commands/channel/index.d.ts.map +1 -0
- package/dist/commands/channel/index.js +531 -0
- package/dist/commands/channel/index.js.map +1 -0
- package/dist/commands/channel/interrupt.d.ts +10 -0
- package/dist/commands/channel/interrupt.d.ts.map +1 -0
- package/dist/commands/channel/interrupt.js +22 -0
- package/dist/commands/channel/interrupt.js.map +1 -0
- package/dist/commands/channel/kill.d.ts +7 -0
- package/dist/commands/channel/kill.d.ts.map +1 -0
- package/dist/commands/channel/kill.js +121 -0
- package/dist/commands/channel/kill.js.map +1 -0
- package/dist/commands/channel/list.d.ts +17 -0
- package/dist/commands/channel/list.d.ts.map +1 -0
- package/dist/commands/channel/list.js +233 -0
- package/dist/commands/channel/list.js.map +1 -0
- package/dist/commands/channel/messages.d.ts +15 -0
- package/dist/commands/channel/messages.d.ts.map +1 -0
- package/dist/commands/channel/messages.js +245 -0
- package/dist/commands/channel/messages.js.map +1 -0
- package/dist/commands/channel/rm.d.ts +27 -0
- package/dist/commands/channel/rm.d.ts.map +1 -0
- package/dist/commands/channel/rm.js +216 -0
- package/dist/commands/channel/rm.js.map +1 -0
- package/dist/commands/channel/run.d.ts +30 -0
- package/dist/commands/channel/run.d.ts.map +1 -0
- package/dist/commands/channel/run.js +130 -0
- package/dist/commands/channel/run.js.map +1 -0
- package/dist/commands/channel/send.d.ts +11 -0
- package/dist/commands/channel/send.d.ts.map +1 -0
- package/dist/commands/channel/send.js +24 -0
- package/dist/commands/channel/send.js.map +1 -0
- package/dist/commands/channel/spawn.d.ts +40 -0
- package/dist/commands/channel/spawn.d.ts.map +1 -0
- package/dist/commands/channel/spawn.js +244 -0
- package/dist/commands/channel/spawn.js.map +1 -0
- package/dist/commands/channel/store/events.d.ts +39 -0
- package/dist/commands/channel/store/events.d.ts.map +1 -0
- package/dist/commands/channel/store/events.js +87 -0
- package/dist/commands/channel/store/events.js.map +1 -0
- package/dist/commands/channel/store/filter.d.ts +3 -0
- package/dist/commands/channel/store/filter.d.ts.map +1 -0
- package/dist/commands/channel/store/filter.js +2 -0
- package/dist/commands/channel/store/filter.js.map +1 -0
- package/dist/commands/channel/store/lock.d.ts +23 -0
- package/dist/commands/channel/store/lock.d.ts.map +1 -0
- package/dist/commands/channel/store/lock.js +99 -0
- package/dist/commands/channel/store/lock.js.map +1 -0
- package/dist/commands/channel/store/paths.d.ts +63 -0
- package/dist/commands/channel/store/paths.d.ts.map +1 -0
- package/dist/commands/channel/store/paths.js +246 -0
- package/dist/commands/channel/store/paths.js.map +1 -0
- package/dist/commands/channel/store/schema.d.ts +27 -0
- package/dist/commands/channel/store/schema.d.ts.map +1 -0
- package/dist/commands/channel/store/schema.js +34 -0
- package/dist/commands/channel/store/schema.js.map +1 -0
- package/dist/commands/channel/store/thread-state.d.ts +5 -0
- package/dist/commands/channel/store/thread-state.d.ts.map +1 -0
- package/dist/commands/channel/store/thread-state.js +16 -0
- package/dist/commands/channel/store/thread-state.js.map +1 -0
- package/dist/commands/channel/store/watch.d.ts +19 -0
- package/dist/commands/channel/store/watch.d.ts.map +1 -0
- package/dist/commands/channel/store/watch.js +146 -0
- package/dist/commands/channel/store/watch.js.map +1 -0
- package/dist/commands/channel/supervisor/idle.d.ts +46 -0
- package/dist/commands/channel/supervisor/idle.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/idle.js +72 -0
- package/dist/commands/channel/supervisor/idle.js.map +1 -0
- package/dist/commands/channel/supervisor/inbox.d.ts +30 -0
- package/dist/commands/channel/supervisor/inbox.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/inbox.js +160 -0
- package/dist/commands/channel/supervisor/inbox.js.map +1 -0
- package/dist/commands/channel/supervisor/shutdown.d.ts +68 -0
- package/dist/commands/channel/supervisor/shutdown.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/shutdown.js +146 -0
- package/dist/commands/channel/supervisor/shutdown.js.map +1 -0
- package/dist/commands/channel/supervisor/stdout.d.ts +51 -0
- package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/stdout.js +121 -0
- package/dist/commands/channel/supervisor/stdout.js.map +1 -0
- package/dist/commands/channel/supervisor/turns.d.ts +31 -0
- package/dist/commands/channel/supervisor/turns.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/turns.js +45 -0
- package/dist/commands/channel/supervisor/turns.js.map +1 -0
- package/dist/commands/channel/supervisor/warning.d.ts +48 -0
- package/dist/commands/channel/supervisor/warning.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/warning.js +77 -0
- package/dist/commands/channel/supervisor/warning.js.map +1 -0
- package/dist/commands/channel/supervisor.d.ts +59 -0
- package/dist/commands/channel/supervisor.d.ts.map +1 -0
- package/dist/commands/channel/supervisor.js +344 -0
- package/dist/commands/channel/supervisor.js.map +1 -0
- package/dist/commands/channel/text-body.d.ts +13 -0
- package/dist/commands/channel/text-body.d.ts.map +1 -0
- package/dist/commands/channel/text-body.js +47 -0
- package/dist/commands/channel/text-body.js.map +1 -0
- package/dist/commands/channel/threads.d.ts +39 -0
- package/dist/commands/channel/threads.d.ts.map +1 -0
- package/dist/commands/channel/threads.js +106 -0
- package/dist/commands/channel/threads.js.map +1 -0
- package/dist/commands/channel/title.d.ts +12 -0
- package/dist/commands/channel/title.d.ts.map +1 -0
- package/dist/commands/channel/title.js +24 -0
- package/dist/commands/channel/title.js.map +1 -0
- package/dist/commands/channel/wait.d.ts +17 -0
- package/dist/commands/channel/wait.d.ts.map +1 -0
- package/dist/commands/channel/wait.js +75 -0
- package/dist/commands/channel/wait.js.map +1 -0
- package/dist/commands/init.d.ts +62 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +1656 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mem.d.ts +30 -0
- package/dist/commands/mem.d.ts.map +1 -0
- package/dist/commands/mem.js +424 -0
- package/dist/commands/mem.js.map +1 -0
- package/dist/commands/rollout.d.ts +34 -0
- package/dist/commands/rollout.d.ts.map +1 -0
- package/dist/commands/rollout.js +102 -0
- package/dist/commands/rollout.js.map +1 -0
- package/dist/commands/uninstall.d.ts +27 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +339 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/update.d.ts +80 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +2185 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/upgrade.d.ts +28 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +84 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/workflow.d.ts +35 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +219 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/configurators/antigravity.d.ts +7 -0
- package/dist/configurators/antigravity.d.ts.map +1 -0
- package/dist/configurators/antigravity.js +19 -0
- package/dist/configurators/antigravity.js.map +1 -0
- package/dist/configurators/claude.d.ts +9 -0
- package/dist/configurators/claude.d.ts.map +1 -0
- package/dist/configurators/claude.js +72 -0
- package/dist/configurators/claude.js.map +1 -0
- package/dist/configurators/codebuddy.d.ts +10 -0
- package/dist/configurators/codebuddy.d.ts.map +1 -0
- package/dist/configurators/codebuddy.js +30 -0
- package/dist/configurators/codebuddy.js.map +1 -0
- package/dist/configurators/codex.d.ts +8 -0
- package/dist/configurators/codex.d.ts.map +1 -0
- package/dist/configurators/codex.js +87 -0
- package/dist/configurators/codex.js.map +1 -0
- package/dist/configurators/copilot.d.ts +10 -0
- package/dist/configurators/copilot.d.ts.map +1 -0
- package/dist/configurators/copilot.js +51 -0
- package/dist/configurators/copilot.js.map +1 -0
- package/dist/configurators/cursor.d.ts +20 -0
- package/dist/configurators/cursor.d.ts.map +1 -0
- package/dist/configurators/cursor.js +49 -0
- package/dist/configurators/cursor.js.map +1 -0
- package/dist/configurators/cursor2plus-local.d.ts +6 -0
- package/dist/configurators/cursor2plus-local.d.ts.map +1 -0
- package/dist/configurators/cursor2plus-local.js +20 -0
- package/dist/configurators/cursor2plus-local.js.map +1 -0
- package/dist/configurators/droid.d.ts +10 -0
- package/dist/configurators/droid.d.ts.map +1 -0
- package/dist/configurators/droid.js +30 -0
- package/dist/configurators/droid.js.map +1 -0
- package/dist/configurators/gemini.d.ts +16 -0
- package/dist/configurators/gemini.d.ts.map +1 -0
- package/dist/configurators/gemini.js +38 -0
- package/dist/configurators/gemini.js.map +1 -0
- package/dist/configurators/index.d.ts +69 -0
- package/dist/configurators/index.d.ts.map +1 -0
- package/dist/configurators/index.js +395 -0
- package/dist/configurators/index.js.map +1 -0
- package/dist/configurators/kilo.d.ts +7 -0
- package/dist/configurators/kilo.d.ts.map +1 -0
- package/dist/configurators/kilo.js +19 -0
- package/dist/configurators/kilo.js.map +1 -0
- package/dist/configurators/kiro.d.ts +8 -0
- package/dist/configurators/kiro.d.ts.map +1 -0
- package/dist/configurators/kiro.js +24 -0
- package/dist/configurators/kiro.js.map +1 -0
- package/dist/configurators/opencode.d.ts +14 -0
- package/dist/configurators/opencode.d.ts.map +1 -0
- package/dist/configurators/opencode.js +96 -0
- package/dist/configurators/opencode.js.map +1 -0
- package/dist/configurators/pi.d.ts +3 -0
- package/dist/configurators/pi.d.ts.map +1 -0
- package/dist/configurators/pi.js +45 -0
- package/dist/configurators/pi.js.map +1 -0
- package/dist/configurators/qoder.d.ts +11 -0
- package/dist/configurators/qoder.d.ts.map +1 -0
- package/dist/configurators/qoder.js +31 -0
- package/dist/configurators/qoder.js.map +1 -0
- package/dist/configurators/shared.d.ts +183 -0
- package/dist/configurators/shared.d.ts.map +1 -0
- package/dist/configurators/shared.js +557 -0
- package/dist/configurators/shared.js.map +1 -0
- package/dist/configurators/windsurf.d.ts +7 -0
- package/dist/configurators/windsurf.d.ts.map +1 -0
- package/dist/configurators/windsurf.js +19 -0
- package/dist/configurators/windsurf.js.map +1 -0
- package/dist/configurators/workflow.d.ts +46 -0
- package/dist/configurators/workflow.d.ts.map +1 -0
- package/dist/configurators/workflow.js +180 -0
- package/dist/configurators/workflow.js.map +1 -0
- package/dist/constants/paths.d.ts +70 -0
- package/dist/constants/paths.d.ts.map +1 -0
- package/dist/constants/paths.js +79 -0
- package/dist/constants/paths.js.map +1 -0
- package/dist/constants/version.d.ts +9 -0
- package/dist/constants/version.d.ts.map +1 -0
- package/dist/constants/version.js +15 -0
- package/dist/constants/version.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/index.d.ts +62 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +187 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/manifests/0.1.0.json +9 -0
- package/dist/templates/claude/agents/trellis-check.md +124 -0
- package/dist/templates/claude/agents/trellis-implement.md +110 -0
- package/dist/templates/claude/agents/trellis-research.md +137 -0
- package/dist/templates/claude/index.d.ts +22 -0
- package/dist/templates/claude/index.d.ts.map +1 -0
- package/dist/templates/claude/index.js +46 -0
- package/dist/templates/claude/index.js.map +1 -0
- package/dist/templates/claude/settings.json +84 -0
- package/dist/templates/codebuddy/agents/trellis-check.md +115 -0
- package/dist/templates/codebuddy/agents/trellis-implement.md +110 -0
- package/dist/templates/codebuddy/agents/trellis-research.md +137 -0
- package/dist/templates/codebuddy/index.d.ts +15 -0
- package/dist/templates/codebuddy/index.d.ts.map +1 -0
- package/dist/templates/codebuddy/index.js +15 -0
- package/dist/templates/codebuddy/index.js.map +1 -0
- package/dist/templates/codebuddy/settings.json +70 -0
- package/dist/templates/codex/agents/trellis-check.toml +67 -0
- package/dist/templates/codex/agents/trellis-implement.toml +40 -0
- package/dist/templates/codex/agents/trellis-research.toml +73 -0
- package/dist/templates/codex/config.toml +28 -0
- package/dist/templates/codex/hooks/session-start.py +575 -0
- package/dist/templates/codex/hooks.json +15 -0
- package/dist/templates/codex/index.d.ts +39 -0
- package/dist/templates/codex/index.d.ts.map +1 -0
- package/dist/templates/codex/index.js +85 -0
- package/dist/templates/codex/index.js.map +1 -0
- package/dist/templates/codex/skills/before-dev/SKILL.md +40 -0
- package/dist/templates/codex/skills/brainstorm/SKILL.md +112 -0
- package/dist/templates/codex/skills/break-loop/SKILL.md +130 -0
- package/dist/templates/codex/skills/check/SKILL.md +98 -0
- package/dist/templates/codex/skills/check-cross-layer/SKILL.md +158 -0
- package/dist/templates/codex/skills/create-command/SKILL.md +101 -0
- package/dist/templates/codex/skills/finish-work/SKILL.md +90 -0
- package/dist/templates/codex/skills/improve-ut/SKILL.md +69 -0
- package/dist/templates/codex/skills/integrate-skill/SKILL.md +221 -0
- package/dist/templates/codex/skills/onboard/SKILL.md +363 -0
- package/dist/templates/codex/skills/record-session/SKILL.md +67 -0
- package/dist/templates/codex/skills/start/SKILL.md +66 -0
- package/dist/templates/codex/skills/update-spec/SKILL.md +335 -0
- package/dist/templates/common/bundled-skills/smart-search-cli/SKILL.md +388 -0
- package/dist/templates/common/bundled-skills/smart-search-cli/agents/openai.yaml +3 -0
- package/dist/templates/common/bundled-skills/smart-search-cli/examples/batch-search.md +98 -0
- package/dist/templates/common/bundled-skills/smart-search-cli/examples/evidence-gathering.md +89 -0
- package/dist/templates/common/bundled-skills/smart-search-cli/references/cli-contract.md +337 -0
- package/dist/templates/common/bundled-skills/trellis-cursor2plus-setup/SKILL.md +62 -0
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +73 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +83 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +54 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +84 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +57 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +80 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +83 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +88 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +65 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +55 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +68 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +80 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +51 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +102 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +133 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +75 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +71 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +80 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +69 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +61 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +76 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +128 -0
- package/dist/templates/common/bundled-skills/trellis-micro-grill/SKILL.md +47 -0
- package/dist/templates/common/bundled-skills/trellis-skill-creator/SKILL.md +44 -0
- package/dist/templates/common/bundled-skills/trellis-skill-creator/references/authoring-rules.md +97 -0
- package/dist/templates/common/bundled-skills/trellis-skill-creator/references/review-checklist.md +47 -0
- package/dist/templates/common/bundled-skills/trellis-skill-creator/references/trellis-skill-locations.md +52 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +41 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +90 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +59 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +61 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +70 -0
- package/dist/templates/common/commands/continue.md +63 -0
- package/dist/templates/common/commands/finish-work.md +68 -0
- package/dist/templates/common/commands/start.md +69 -0
- package/dist/templates/common/index.d.ts +48 -0
- package/dist/templates/common/index.d.ts.map +1 -0
- package/dist/templates/common/index.js +104 -0
- package/dist/templates/common/index.js.map +1 -0
- package/dist/templates/common/skills/before-dev.md +35 -0
- package/dist/templates/common/skills/brainstorm.md +164 -0
- package/dist/templates/common/skills/break-loop.md +125 -0
- package/dist/templates/common/skills/check.md +106 -0
- package/dist/templates/common/skills/update-spec.md +364 -0
- package/dist/templates/copilot/hooks/session-start.py +557 -0
- package/dist/templates/copilot/hooks.json +19 -0
- package/dist/templates/copilot/index.d.ts +23 -0
- package/dist/templates/copilot/index.d.ts.map +1 -0
- package/dist/templates/copilot/index.js +54 -0
- package/dist/templates/copilot/index.js.map +1 -0
- package/dist/templates/copilot/prompts/before-dev.prompt.md +39 -0
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +111 -0
- package/dist/templates/copilot/prompts/break-loop.prompt.md +129 -0
- package/dist/templates/copilot/prompts/check-cross-layer.prompt.md +157 -0
- package/dist/templates/copilot/prompts/check.prompt.md +97 -0
- package/dist/templates/copilot/prompts/create-command.prompt.md +116 -0
- package/dist/templates/copilot/prompts/finish-work.prompt.md +99 -0
- package/dist/templates/copilot/prompts/integrate-skill.prompt.md +223 -0
- package/dist/templates/copilot/prompts/onboard.prompt.md +362 -0
- package/dist/templates/copilot/prompts/parallel.prompt.md +204 -0
- package/dist/templates/copilot/prompts/record-session.prompt.md +66 -0
- package/dist/templates/copilot/prompts/start.prompt.md +63 -0
- package/dist/templates/copilot/prompts/update-spec.prompt.md +358 -0
- package/dist/templates/cursor/agents/trellis-check.md +139 -0
- package/dist/templates/cursor/agents/trellis-implement.md +119 -0
- package/dist/templates/cursor/agents/trellis-research.md +147 -0
- package/dist/templates/cursor/commands/cursor2plus-setup.md +82 -0
- package/dist/templates/cursor/hooks.json +30 -0
- package/dist/templates/cursor/index.d.ts +19 -0
- package/dist/templates/cursor/index.d.ts.map +1 -0
- package/dist/templates/cursor/index.js +19 -0
- package/dist/templates/cursor/index.js.map +1 -0
- package/dist/templates/cursor/rules/trellis-triage.mdc +38 -0
- package/dist/templates/cursor/worktrees.json +11 -0
- package/dist/templates/droid/droids/trellis-check.md +107 -0
- package/dist/templates/droid/droids/trellis-implement.md +102 -0
- package/dist/templates/droid/droids/trellis-research.md +137 -0
- package/dist/templates/droid/index.d.ts +15 -0
- package/dist/templates/droid/index.d.ts.map +1 -0
- package/dist/templates/droid/index.js +15 -0
- package/dist/templates/droid/index.js.map +1 -0
- package/dist/templates/droid/settings.json +70 -0
- package/dist/templates/extract.d.ts +40 -0
- package/dist/templates/extract.d.ts.map +1 -0
- package/dist/templates/extract.js +106 -0
- package/dist/templates/extract.js.map +1 -0
- package/dist/templates/gemini/agents/trellis-check.md +107 -0
- package/dist/templates/gemini/agents/trellis-implement.md +102 -0
- package/dist/templates/gemini/agents/trellis-research.md +136 -0
- package/dist/templates/gemini/index.d.ts +13 -0
- package/dist/templates/gemini/index.d.ts.map +1 -0
- package/dist/templates/gemini/index.js +13 -0
- package/dist/templates/gemini/index.js.map +1 -0
- package/dist/templates/gemini/settings.json +28 -0
- package/dist/templates/kiro/agents/trellis-check.json +26 -0
- package/dist/templates/kiro/agents/trellis-implement.json +26 -0
- package/dist/templates/kiro/agents/trellis-research.json +30 -0
- package/dist/templates/kiro/index.d.ts +18 -0
- package/dist/templates/kiro/index.d.ts.map +1 -0
- package/dist/templates/kiro/index.js +18 -0
- package/dist/templates/kiro/index.js.map +1 -0
- package/dist/templates/markdown/agents.md +32 -0
- package/dist/templates/markdown/gitignore.txt +15 -0
- package/dist/templates/markdown/index.d.ts +30 -0
- package/dist/templates/markdown/index.d.ts.map +1 -0
- package/dist/templates/markdown/index.js +55 -0
- package/dist/templates/markdown/index.js.map +1 -0
- package/dist/templates/markdown/spec/backend/database-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/spec/backend/error-handling.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/index.md.txt +38 -0
- package/dist/templates/markdown/spec/backend/logging-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/backend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/component-guidelines.md.txt +59 -0
- package/dist/templates/markdown/spec/frontend/directory-structure.md.txt +54 -0
- package/dist/templates/markdown/spec/frontend/hook-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/index.md.txt +39 -0
- package/dist/templates/markdown/spec/frontend/quality-guidelines.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/state-management.md.txt +51 -0
- package/dist/templates/markdown/spec/frontend/type-safety.md.txt +51 -0
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +223 -0
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +259 -0
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +633 -0
- package/dist/templates/markdown/spec/guides/cursor-context-injection-guide.md.txt +65 -0
- package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +382 -0
- package/dist/templates/markdown/spec/guides/durable-learning-decision-guide.md.txt +76 -0
- package/dist/templates/markdown/spec/guides/index.md.txt +101 -0
- package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +92 -0
- package/dist/templates/markdown/workspace-index.md +125 -0
- package/dist/templates/markdown/worktree.yaml.txt +58 -0
- package/dist/templates/opencode/agents/trellis-check.md +122 -0
- package/dist/templates/opencode/agents/trellis-implement.md +118 -0
- package/dist/templates/opencode/agents/trellis-research.md +145 -0
- package/dist/templates/opencode/lib/session-utils.js +667 -0
- package/dist/templates/opencode/lib/trellis-context.js +336 -0
- package/dist/templates/opencode/package.json +5 -0
- package/dist/templates/opencode/plugins/inject-subagent-context.js +495 -0
- package/dist/templates/opencode/plugins/inject-workflow-state.js +159 -0
- package/dist/templates/opencode/plugins/session-start.js +101 -0
- package/dist/templates/pi/agents/trellis-check.md +37 -0
- package/dist/templates/pi/agents/trellis-implement.md +42 -0
- package/dist/templates/pi/agents/trellis-research.md +25 -0
- package/dist/templates/pi/extensions/trellis/index.ts.txt +1600 -0
- package/dist/templates/pi/index.d.ts +5 -0
- package/dist/templates/pi/index.d.ts.map +1 -0
- package/dist/templates/pi/index.js +12 -0
- package/dist/templates/pi/index.js.map +1 -0
- package/dist/templates/pi/settings.json +12 -0
- package/dist/templates/qoder/agents/trellis-check.md +108 -0
- package/dist/templates/qoder/agents/trellis-implement.md +103 -0
- package/dist/templates/qoder/agents/trellis-research.md +137 -0
- package/dist/templates/qoder/index.d.ts +15 -0
- package/dist/templates/qoder/index.d.ts.map +1 -0
- package/dist/templates/qoder/index.js +15 -0
- package/dist/templates/qoder/index.js.map +1 -0
- package/dist/templates/qoder/settings.json +47 -0
- package/dist/templates/shared-hooks/index.d.ts +50 -0
- package/dist/templates/shared-hooks/index.d.ts.map +1 -0
- package/dist/templates/shared-hooks/index.js +92 -0
- package/dist/templates/shared-hooks/index.js.map +1 -0
- package/dist/templates/shared-hooks/inject-shell-session-context.py +183 -0
- package/dist/templates/shared-hooks/inject-subagent-context.py +774 -0
- package/dist/templates/shared-hooks/inject-workflow-state.py +366 -0
- package/dist/templates/shared-hooks/research-end-retrieval-pack.py +220 -0
- package/dist/templates/shared-hooks/session-start.py +873 -0
- package/dist/templates/template-utils.d.ts +28 -0
- package/dist/templates/template-utils.d.ts.map +1 -0
- package/dist/templates/template-utils.js +83 -0
- package/dist/templates/template-utils.js.map +1 -0
- package/dist/templates/trellis/config.yaml +132 -0
- package/dist/templates/trellis/gitignore.txt +39 -0
- package/dist/templates/trellis/index.d.ts +80 -0
- package/dist/templates/trellis/index.d.ts.map +1 -0
- package/dist/templates/trellis/index.js +171 -0
- package/dist/templates/trellis/index.js.map +1 -0
- package/dist/templates/trellis/local/README.md +59 -0
- package/dist/templates/trellis/local/config.local.json.example +6 -0
- package/dist/templates/trellis/local/index.d.ts +7 -0
- package/dist/templates/trellis/local/index.d.ts.map +1 -0
- package/dist/templates/trellis/local/index.js +14 -0
- package/dist/templates/trellis/local/index.js.map +1 -0
- package/dist/templates/trellis/local/patch_wpelc8.py +297 -0
- package/dist/templates/trellis/local/subagent-models.json.example +4 -0
- package/dist/templates/trellis/local/trellis-task-models.json.example +10 -0
- package/dist/templates/trellis/local/trellis-task-models.json5.example +45 -0
- package/dist/templates/trellis/local/trellis_task_models_config.py +200 -0
- package/dist/templates/trellis/scripts/__init__.py +5 -0
- package/dist/templates/trellis/scripts/add_session.py +547 -0
- package/dist/templates/trellis/scripts/build_context_pack.py +12 -0
- package/dist/templates/trellis/scripts/build_retrieval_pack.py +12 -0
- package/dist/templates/trellis/scripts/common/__init__.py +103 -0
- package/dist/templates/trellis/scripts/common/active_task.py +607 -0
- package/dist/templates/trellis/scripts/common/artifact_search.py +587 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +811 -0
- package/dist/templates/trellis/scripts/common/cli_environment.py +155 -0
- package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +902 -0
- package/dist/templates/trellis/scripts/common/config.py +458 -0
- package/dist/templates/trellis/scripts/common/context_pack.py +371 -0
- package/dist/templates/trellis/scripts/common/developer.py +190 -0
- package/dist/templates/trellis/scripts/common/git.py +31 -0
- package/dist/templates/trellis/scripts/common/git_context.py +149 -0
- package/dist/templates/trellis/scripts/common/io.py +37 -0
- package/dist/templates/trellis/scripts/common/log.py +45 -0
- package/dist/templates/trellis/scripts/common/packages_context.py +239 -0
- package/dist/templates/trellis/scripts/common/parent_orchestration.py +691 -0
- package/dist/templates/trellis/scripts/common/paths.py +457 -0
- package/dist/templates/trellis/scripts/common/retrieval_adapter_metadata.py +889 -0
- package/dist/templates/trellis/scripts/common/retrieval_evidence.py +917 -0
- package/dist/templates/trellis/scripts/common/retrieval_pack.py +425 -0
- package/dist/templates/trellis/scripts/common/retrieval_pack_context.py +126 -0
- package/dist/templates/trellis/scripts/common/safe_commit.py +285 -0
- package/dist/templates/trellis/scripts/common/session_context.py +1159 -0
- package/dist/templates/trellis/scripts/common/session_memory.py +360 -0
- package/dist/templates/trellis/scripts/common/smart_search_evidence.py +479 -0
- package/dist/templates/trellis/scripts/common/smart_search_resolve.py +125 -0
- package/dist/templates/trellis/scripts/common/task_context.py +223 -0
- package/dist/templates/trellis/scripts/common/task_dashboard.py +140 -0
- package/dist/templates/trellis/scripts/common/task_gates.py +1735 -0
- package/dist/templates/trellis/scripts/common/task_map.py +586 -0
- package/dist/templates/trellis/scripts/common/task_queue.py +188 -0
- package/dist/templates/trellis/scripts/common/task_store.py +1533 -0
- package/dist/templates/trellis/scripts/common/task_utils.py +274 -0
- package/dist/templates/trellis/scripts/common/tasks.py +231 -0
- package/dist/templates/trellis/scripts/common/test_retrieval_arbitration.py +333 -0
- package/dist/templates/trellis/scripts/common/trellis_config.py +131 -0
- package/dist/templates/trellis/scripts/common/types.py +110 -0
- package/dist/templates/trellis/scripts/common/workflow_phase.py +212 -0
- package/dist/templates/trellis/scripts/get_context.py +17 -0
- package/dist/templates/trellis/scripts/get_developer.py +26 -0
- package/dist/templates/trellis/scripts/hooks/linear_sync.py +243 -0
- package/dist/templates/trellis/scripts/init_developer.py +51 -0
- package/dist/templates/trellis/scripts/route_codebase_retrieval.py +77 -0
- package/dist/templates/trellis/scripts/run_smart_search.py +12 -0
- package/dist/templates/trellis/scripts/search_artifacts.py +13 -0
- package/dist/templates/trellis/scripts/search_memory.py +12 -0
- package/dist/templates/trellis/scripts/task.py +851 -0
- package/dist/templates/trellis/tasks/.gitkeep +0 -0
- package/dist/templates/trellis/tasks/templates/release-execution/design.md +61 -0
- package/dist/templates/trellis/tasks/templates/release-execution/handoff-template.md +29 -0
- package/dist/templates/trellis/tasks/templates/release-execution/implement.md +29 -0
- package/dist/templates/trellis/tasks/templates/release-execution/prd.md +31 -0
- package/dist/templates/trellis/tasks/templates/release-readiness/design.md +50 -0
- package/dist/templates/trellis/tasks/templates/release-readiness/handoff-template.md +39 -0
- package/dist/templates/trellis/tasks/templates/release-readiness/implement.md +29 -0
- package/dist/templates/trellis/tasks/templates/release-readiness/prd.md +31 -0
- package/dist/templates/trellis/workflow.md +960 -0
- package/dist/types/ai-tools.d.ts +106 -0
- package/dist/types/ai-tools.d.ts.map +1 -0
- package/dist/types/ai-tools.js +294 -0
- package/dist/types/ai-tools.js.map +1 -0
- package/dist/types/migration.d.ts +125 -0
- package/dist/types/migration.d.ts.map +1 -0
- package/dist/types/migration.js +8 -0
- package/dist/types/migration.js.map +1 -0
- package/dist/utils/codebase-retrieval-router.d.ts +77 -0
- package/dist/utils/codebase-retrieval-router.d.ts.map +1 -0
- package/dist/utils/codebase-retrieval-router.js +767 -0
- package/dist/utils/codebase-retrieval-router.js.map +1 -0
- package/dist/utils/compare-versions.d.ts +12 -0
- package/dist/utils/compare-versions.d.ts.map +1 -0
- package/dist/utils/compare-versions.js +86 -0
- package/dist/utils/compare-versions.js.map +1 -0
- package/dist/utils/cwd-guard.d.ts +38 -0
- package/dist/utils/cwd-guard.d.ts.map +1 -0
- package/dist/utils/cwd-guard.js +62 -0
- package/dist/utils/cwd-guard.js.map +1 -0
- package/dist/utils/file-writer.d.ts +36 -0
- package/dist/utils/file-writer.d.ts.map +1 -0
- package/dist/utils/file-writer.js +203 -0
- package/dist/utils/file-writer.js.map +1 -0
- package/dist/utils/manifest-prune.d.ts +61 -0
- package/dist/utils/manifest-prune.d.ts.map +1 -0
- package/dist/utils/manifest-prune.js +136 -0
- package/dist/utils/manifest-prune.js.map +1 -0
- package/dist/utils/posix.d.ts +13 -0
- package/dist/utils/posix.d.ts.map +1 -0
- package/dist/utils/posix.js +15 -0
- package/dist/utils/posix.js.map +1 -0
- package/dist/utils/post-update-smoke.d.ts +7 -0
- package/dist/utils/post-update-smoke.d.ts.map +1 -0
- package/dist/utils/post-update-smoke.js +40 -0
- package/dist/utils/post-update-smoke.js.map +1 -0
- package/dist/utils/project-capabilities.d.ts +54 -0
- package/dist/utils/project-capabilities.d.ts.map +1 -0
- package/dist/utils/project-capabilities.js +515 -0
- package/dist/utils/project-capabilities.js.map +1 -0
- package/dist/utils/project-detector.d.ts +46 -0
- package/dist/utils/project-detector.d.ts.map +1 -0
- package/dist/utils/project-detector.js +666 -0
- package/dist/utils/project-detector.js.map +1 -0
- package/dist/utils/proxy.d.ts +25 -0
- package/dist/utils/proxy.d.ts.map +1 -0
- package/dist/utils/proxy.js +60 -0
- package/dist/utils/proxy.js.map +1 -0
- package/dist/utils/readiness.d.ts +20 -0
- package/dist/utils/readiness.d.ts.map +1 -0
- package/dist/utils/readiness.js +430 -0
- package/dist/utils/readiness.js.map +1 -0
- package/dist/utils/retrieval-execution-telemetry.d.ts +162 -0
- package/dist/utils/retrieval-execution-telemetry.d.ts.map +1 -0
- package/dist/utils/retrieval-execution-telemetry.js +288 -0
- package/dist/utils/retrieval-execution-telemetry.js.map +1 -0
- package/dist/utils/retrieval-result-ranking.d.ts +40 -0
- package/dist/utils/retrieval-result-ranking.d.ts.map +1 -0
- package/dist/utils/retrieval-result-ranking.js +162 -0
- package/dist/utils/retrieval-result-ranking.js.map +1 -0
- package/dist/utils/task-json.d.ts +13 -0
- package/dist/utils/task-json.d.ts.map +1 -0
- package/dist/utils/task-json.js +12 -0
- package/dist/utils/task-json.js.map +1 -0
- package/dist/utils/template-fetcher.d.ts +150 -0
- package/dist/utils/template-fetcher.d.ts.map +1 -0
- package/dist/utils/template-fetcher.js +907 -0
- package/dist/utils/template-fetcher.js.map +1 -0
- package/dist/utils/template-hash.d.ts +123 -0
- package/dist/utils/template-hash.d.ts.map +1 -0
- package/dist/utils/template-hash.js +334 -0
- package/dist/utils/template-hash.js.map +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts +66 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -0
- package/dist/utils/uninstall-scrubbers.js +342 -0
- package/dist/utils/uninstall-scrubbers.js.map +1 -0
- package/dist/utils/update-rollout-report.d.ts +137 -0
- package/dist/utils/update-rollout-report.d.ts.map +1 -0
- package/dist/utils/update-rollout-report.js +108 -0
- package/dist/utils/update-rollout-report.js.map +1 -0
- package/dist/utils/workflow-resolver.d.ts +86 -0
- package/dist/utils/workflow-resolver.d.ts.map +1 -0
- package/dist/utils/workflow-resolver.js +265 -0
- package/dist/utils/workflow-resolver.js.map +1 -0
- package/package.json +137 -0
- package/scripts/postinstall.js +45 -0
- package/vendor/smart-search/LICENSE +21 -0
- package/vendor/smart-search/README.md +412 -0
- package/vendor/smart-search/README.zh-CN.md +430 -0
- package/vendor/smart-search/npm/bin/smart-search.js +63 -0
- package/vendor/smart-search/npm/scripts/postinstall.js +87 -0
- package/vendor/smart-search/npm/scripts/resolve-prerelease-version.js +108 -0
- package/vendor/smart-search/npm/scripts/set-package-version.js +35 -0
- package/vendor/smart-search/npm/scripts/sync-python-version.js +22 -0
- package/vendor/smart-search/npm/scripts/test-wrapper-repair.js +99 -0
- package/vendor/smart-search/npm/scripts/test.js +85 -0
- package/vendor/smart-search/package.json +42 -0
- package/vendor/smart-search/pyproject.toml +37 -0
- package/vendor/smart-search/skills/smart-search-cli/SKILL.md +387 -0
- package/vendor/smart-search/skills/smart-search-cli/agents/openai.yaml +3 -0
- package/vendor/smart-search/skills/smart-search-cli/examples/batch-search.md +98 -0
- package/vendor/smart-search/skills/smart-search-cli/examples/evidence-gathering.md +89 -0
- package/vendor/smart-search/skills/smart-search-cli/references/cli-contract.md +337 -0
- package/vendor/smart-search/src/smart_search/__init__.py +1 -0
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/SKILL.md +387 -0
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/agents/openai.yaml +3 -0
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/batch-search.md +98 -0
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/evidence-gathering.md +89 -0
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/references/cli-contract.md +337 -0
- package/vendor/smart-search/src/smart_search/cli.py +2003 -0
- package/vendor/smart-search/src/smart_search/config.py +580 -0
- package/vendor/smart-search/src/smart_search/logger.py +43 -0
- package/vendor/smart-search/src/smart_search/providers/__init__.py +16 -0
- package/vendor/smart-search/src/smart_search/providers/base.py +41 -0
- package/vendor/smart-search/src/smart_search/providers/context7.py +141 -0
- package/vendor/smart-search/src/smart_search/providers/exa.py +206 -0
- package/vendor/smart-search/src/smart_search/providers/jina.py +136 -0
- package/vendor/smart-search/src/smart_search/providers/openai_compatible.py +370 -0
- package/vendor/smart-search/src/smart_search/providers/zhipu.py +143 -0
- package/vendor/smart-search/src/smart_search/service.py +2865 -0
- package/vendor/smart-search/src/smart_search/sources.py +429 -0
- package/vendor/smart-search/src/smart_search/utils.py +220 -0
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Orchestrate retrieval evidence scoring and context pack building.
|
|
4
|
+
|
|
5
|
+
Pure functions only. Does not run Smart Search, artifact search, session memory
|
|
6
|
+
search, network calls, MCP tools, or codebase retrieval.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import argparse
|
|
12
|
+
import json
|
|
13
|
+
import sys
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
17
|
+
from common.codebase_retrieval_router import resolve_router_envelope
|
|
18
|
+
from common.context_pack import build_context_pack
|
|
19
|
+
from common.retrieval_adapter_metadata import build_evidence_envelope
|
|
20
|
+
from common.retrieval_evidence import ScoredEvidence, resolve_cross_source_conflicts, score_evidence_bundle
|
|
21
|
+
|
|
22
|
+
ORCHESTRATOR_VERSION = 1
|
|
23
|
+
ORCHESTRATOR_SOURCE = "retrieval-pack-orchestrator"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def build_retrieval_pack(
|
|
27
|
+
retrieval_guide: dict[str, Any] | None = None,
|
|
28
|
+
*,
|
|
29
|
+
artifact_search_results: list[dict[str, Any]] | None = None,
|
|
30
|
+
session_memory_results: list[dict[str, Any]] | None = None,
|
|
31
|
+
smart_search_manifests: list[dict[str, Any]] | None = None,
|
|
32
|
+
smart_search_manifest_paths: list[str] | None = None,
|
|
33
|
+
codebase_candidates: list[dict[str, Any]] | None = None,
|
|
34
|
+
repo_root: Path | str | None = None,
|
|
35
|
+
max_items: int | None = None,
|
|
36
|
+
max_estimated_tokens: int | None = None,
|
|
37
|
+
include_diagnostics: bool = False,
|
|
38
|
+
router_envelope: dict[str, Any] | None = None,
|
|
39
|
+
adapter_hints: list[dict[str, Any]] | None = None,
|
|
40
|
+
) -> dict[str, object]:
|
|
41
|
+
"""Score and pack already-collected retrieval evidence into one payload."""
|
|
42
|
+
warnings: list[str] = []
|
|
43
|
+
guide = dict_value(retrieval_guide)
|
|
44
|
+
recommendations = list_value(guide.get("recommendations"))
|
|
45
|
+
selected_task_artifacts = dict_value(guide.get("selectedTaskArtifacts"))
|
|
46
|
+
|
|
47
|
+
artifact_results = normalize_dict_list(artifact_search_results)
|
|
48
|
+
memory_results = normalize_dict_list(session_memory_results)
|
|
49
|
+
candidate_results = normalize_dict_list(codebase_candidates)
|
|
50
|
+
|
|
51
|
+
manifests = collect_smart_search_manifests(
|
|
52
|
+
repo_root=resolve_repo_root(repo_root),
|
|
53
|
+
selected_task_artifacts=selected_task_artifacts,
|
|
54
|
+
explicit_manifests=normalize_dict_list(smart_search_manifests),
|
|
55
|
+
manifest_paths=list_value(smart_search_manifest_paths),
|
|
56
|
+
warnings=warnings,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
bundle: dict[str, Any] = {}
|
|
60
|
+
if recommendations:
|
|
61
|
+
bundle["recommendations"] = recommendations
|
|
62
|
+
if selected_task_artifacts:
|
|
63
|
+
bundle["selectedTaskArtifacts"] = selected_task_artifacts
|
|
64
|
+
if artifact_results:
|
|
65
|
+
bundle["artifactSearchResults"] = artifact_results
|
|
66
|
+
if memory_results:
|
|
67
|
+
bundle["sessionMemoryResults"] = memory_results
|
|
68
|
+
if manifests:
|
|
69
|
+
bundle["smartSearchManifests"] = manifests
|
|
70
|
+
if candidate_results:
|
|
71
|
+
bundle["codebaseCandidates"] = candidate_results
|
|
72
|
+
|
|
73
|
+
collection = {
|
|
74
|
+
"recommendations": len(recommendations),
|
|
75
|
+
"artifactSearchResults": len(artifact_results),
|
|
76
|
+
"sessionMemoryResults": len(memory_results),
|
|
77
|
+
"smartSearchManifests": len(manifests),
|
|
78
|
+
"codebaseCandidates": len(candidate_results),
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
scored_evidence = score_evidence_bundle(bundle)
|
|
82
|
+
|
|
83
|
+
# RB-010: Cross-source arbitration
|
|
84
|
+
query_intent = None
|
|
85
|
+
if router_envelope and isinstance(router_envelope, dict):
|
|
86
|
+
intents = router_envelope.get("intents", [])
|
|
87
|
+
if intents and isinstance(intents[0], dict):
|
|
88
|
+
query_intent = intents[0].get("id")
|
|
89
|
+
|
|
90
|
+
scored_items = _reconstruct_scored_items(scored_evidence)
|
|
91
|
+
arbitrated_evidence = resolve_cross_source_conflicts(
|
|
92
|
+
scored_items, query_intent=query_intent
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
scored_evidence_compat = {
|
|
96
|
+
**scored_evidence,
|
|
97
|
+
"items": arbitrated_evidence.get("items", []),
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
context_pack = build_context_pack(
|
|
101
|
+
scored_evidence_compat,
|
|
102
|
+
max_items=max_items,
|
|
103
|
+
max_estimated_tokens=max_estimated_tokens,
|
|
104
|
+
include_diagnostics=include_diagnostics,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
evidence_envelope = build_evidence_envelope(
|
|
108
|
+
bundle=bundle,
|
|
109
|
+
scored_evidence=scored_evidence,
|
|
110
|
+
collection=collection,
|
|
111
|
+
orchestrator_warnings=warnings,
|
|
112
|
+
router_envelope=router_envelope,
|
|
113
|
+
adapter_hints=adapter_hints,
|
|
114
|
+
arbitrated_evidence=arbitrated_evidence,
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
"version": ORCHESTRATOR_VERSION,
|
|
119
|
+
"source": ORCHESTRATOR_SOURCE,
|
|
120
|
+
"bundle": bundle,
|
|
121
|
+
"scoredEvidence": scored_evidence,
|
|
122
|
+
"arbitratedEvidence": arbitrated_evidence,
|
|
123
|
+
"contextPack": context_pack,
|
|
124
|
+
"collection": collection,
|
|
125
|
+
"warnings": warnings,
|
|
126
|
+
"evidenceEnvelope": evidence_envelope,
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def _reconstruct_scored_items(scored_evidence: dict[str, Any]) -> list[ScoredEvidence]:
|
|
131
|
+
"""Reconstruct ScoredEvidence objects from scored evidence JSON items."""
|
|
132
|
+
items: list[ScoredEvidence] = []
|
|
133
|
+
for item_dict in scored_evidence.get("items", []):
|
|
134
|
+
if not isinstance(item_dict, dict):
|
|
135
|
+
continue
|
|
136
|
+
items.append(
|
|
137
|
+
ScoredEvidence(
|
|
138
|
+
source=item_dict.get("source", ""),
|
|
139
|
+
kind=item_dict.get("kind", ""),
|
|
140
|
+
reference=item_dict.get("reference", ""),
|
|
141
|
+
title=item_dict.get("title", ""),
|
|
142
|
+
status=item_dict.get("status", ""),
|
|
143
|
+
trust=item_dict.get("trust", ""),
|
|
144
|
+
confidence=item_dict.get("confidence", ""),
|
|
145
|
+
relevance=item_dict.get("relevance", 0),
|
|
146
|
+
freshness=item_dict.get("freshness", 0),
|
|
147
|
+
source_authority=item_dict.get("sourceAuthority", 0),
|
|
148
|
+
validation_state=item_dict.get("validationState", ""),
|
|
149
|
+
score=item_dict.get("score", 0),
|
|
150
|
+
reasons=item_dict.get("reasons", []),
|
|
151
|
+
warnings=item_dict.get("warnings", []),
|
|
152
|
+
)
|
|
153
|
+
)
|
|
154
|
+
return items
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def collect_smart_search_manifests(
|
|
158
|
+
*,
|
|
159
|
+
repo_root: Path | None,
|
|
160
|
+
selected_task_artifacts: dict[str, Any],
|
|
161
|
+
explicit_manifests: list[dict[str, Any]],
|
|
162
|
+
manifest_paths: list[str],
|
|
163
|
+
warnings: list[str],
|
|
164
|
+
) -> list[dict[str, Any]]:
|
|
165
|
+
"""Merge caller-provided manifests with read-only path and task discovery."""
|
|
166
|
+
merged: dict[str, dict[str, Any]] = {}
|
|
167
|
+
|
|
168
|
+
for manifest in explicit_manifests:
|
|
169
|
+
key = manifest_key(manifest)
|
|
170
|
+
merged[key] = manifest
|
|
171
|
+
|
|
172
|
+
if repo_root is not None:
|
|
173
|
+
for manifest_path in manifest_paths:
|
|
174
|
+
loaded = load_manifest_path(repo_root, manifest_path, warnings)
|
|
175
|
+
if loaded is not None:
|
|
176
|
+
merged[manifest_key(loaded)] = loaded
|
|
177
|
+
|
|
178
|
+
task_path = string_value(selected_task_artifacts.get("taskPath"))
|
|
179
|
+
for manifest in discover_task_manifests(repo_root, task_path, warnings):
|
|
180
|
+
merged[manifest_key(manifest)] = manifest
|
|
181
|
+
|
|
182
|
+
return [merged[key] for key in sorted(merged)]
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def discover_task_manifests(
|
|
186
|
+
repo_root: Path,
|
|
187
|
+
task_path: str | None,
|
|
188
|
+
warnings: list[str],
|
|
189
|
+
) -> list[dict[str, Any]]:
|
|
190
|
+
if not task_path:
|
|
191
|
+
return []
|
|
192
|
+
|
|
193
|
+
evidence_root = resolve_task_evidence_root(repo_root, task_path, warnings)
|
|
194
|
+
if evidence_root is None:
|
|
195
|
+
return []
|
|
196
|
+
if not evidence_root.is_dir():
|
|
197
|
+
return []
|
|
198
|
+
|
|
199
|
+
manifests: list[dict[str, Any]] = []
|
|
200
|
+
for run_dir in sorted(evidence_root.iterdir(), key=lambda path: path.name):
|
|
201
|
+
if not run_dir.is_dir():
|
|
202
|
+
continue
|
|
203
|
+
manifest_file = run_dir / "manifest.json"
|
|
204
|
+
if not manifest_file.is_file():
|
|
205
|
+
continue
|
|
206
|
+
loaded = load_manifest_file(repo_root, manifest_file, warnings)
|
|
207
|
+
if loaded is not None:
|
|
208
|
+
manifests.append(loaded)
|
|
209
|
+
return manifests
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def resolve_task_evidence_root(
|
|
213
|
+
repo_root: Path,
|
|
214
|
+
task_path: str,
|
|
215
|
+
warnings: list[str],
|
|
216
|
+
) -> Path | None:
|
|
217
|
+
candidate = Path(task_path)
|
|
218
|
+
if not candidate.is_absolute():
|
|
219
|
+
candidate = repo_root / candidate
|
|
220
|
+
task_root = candidate.resolve()
|
|
221
|
+
resolved_repo_root = repo_root.resolve()
|
|
222
|
+
try:
|
|
223
|
+
task_root.relative_to(resolved_repo_root)
|
|
224
|
+
except ValueError:
|
|
225
|
+
warnings.append(
|
|
226
|
+
f"selected task path is outside repo_root and was ignored: {task_path}"
|
|
227
|
+
)
|
|
228
|
+
return None
|
|
229
|
+
return task_root / "research" / "smart-search"
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def load_manifest_path(
|
|
233
|
+
repo_root: Path,
|
|
234
|
+
manifest_path: str,
|
|
235
|
+
warnings: list[str],
|
|
236
|
+
) -> dict[str, Any] | None:
|
|
237
|
+
normalized = manifest_path.strip()
|
|
238
|
+
if not normalized:
|
|
239
|
+
return None
|
|
240
|
+
|
|
241
|
+
candidate = Path(normalized)
|
|
242
|
+
if not candidate.is_absolute():
|
|
243
|
+
candidate = repo_root / candidate
|
|
244
|
+
return load_manifest_file(repo_root, candidate, warnings)
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def load_manifest_file(
|
|
248
|
+
repo_root: Path,
|
|
249
|
+
manifest_file: Path,
|
|
250
|
+
warnings: list[str],
|
|
251
|
+
) -> dict[str, Any] | None:
|
|
252
|
+
try:
|
|
253
|
+
raw = manifest_file.read_text(encoding="utf-8")
|
|
254
|
+
except OSError as error:
|
|
255
|
+
warnings.append(
|
|
256
|
+
f"could not read Smart Search manifest {to_repo_path(manifest_file, repo_root)}: {error}"
|
|
257
|
+
)
|
|
258
|
+
return None
|
|
259
|
+
|
|
260
|
+
try:
|
|
261
|
+
parsed = json.loads(raw)
|
|
262
|
+
except json.JSONDecodeError as error:
|
|
263
|
+
warnings.append(
|
|
264
|
+
f"invalid Smart Search manifest JSON at {to_repo_path(manifest_file, repo_root)}: {error}"
|
|
265
|
+
)
|
|
266
|
+
return None
|
|
267
|
+
|
|
268
|
+
if not isinstance(parsed, dict):
|
|
269
|
+
warnings.append(
|
|
270
|
+
f"Smart Search manifest at {to_repo_path(manifest_file, repo_root)} must be a JSON object"
|
|
271
|
+
)
|
|
272
|
+
return None
|
|
273
|
+
|
|
274
|
+
manifest = dict(parsed)
|
|
275
|
+
if not string_value(manifest.get("manifestPath")):
|
|
276
|
+
manifest["manifestPath"] = to_repo_path(manifest_file, repo_root)
|
|
277
|
+
return manifest
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
def manifest_key(manifest: dict[str, Any]) -> str:
|
|
281
|
+
return (
|
|
282
|
+
string_value(manifest.get("manifestPath"))
|
|
283
|
+
or string_value(manifest.get("evidenceDir"))
|
|
284
|
+
or json.dumps(manifest, sort_keys=True, ensure_ascii=False)
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
def resolve_repo_root(repo_root: Path | str | None) -> Path | None:
|
|
289
|
+
if repo_root is None:
|
|
290
|
+
return None
|
|
291
|
+
return Path(repo_root).resolve()
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
def to_repo_path(path: Path, repo_root: Path) -> str:
|
|
295
|
+
try:
|
|
296
|
+
return path.resolve().relative_to(repo_root.resolve()).as_posix()
|
|
297
|
+
except ValueError:
|
|
298
|
+
return str(path)
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
def normalize_dict_list(values: list[dict[str, Any]] | None) -> list[dict[str, Any]]:
|
|
302
|
+
if not values:
|
|
303
|
+
return []
|
|
304
|
+
return [item for item in values if isinstance(item, dict)]
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
|
|
308
|
+
parser = argparse.ArgumentParser(
|
|
309
|
+
description="Score and pack already-collected retrieval evidence.",
|
|
310
|
+
)
|
|
311
|
+
parser.add_argument(
|
|
312
|
+
"--input",
|
|
313
|
+
help="Path to orchestrator input JSON. Defaults to stdin when omitted.",
|
|
314
|
+
)
|
|
315
|
+
parser.add_argument(
|
|
316
|
+
"--root",
|
|
317
|
+
help="Repository root for read-only Smart Search manifest discovery.",
|
|
318
|
+
)
|
|
319
|
+
parser.add_argument(
|
|
320
|
+
"--platform",
|
|
321
|
+
default=None,
|
|
322
|
+
help="Host platform for platform-adaptive retrieval routing (e.g. cursor, claude-code, codex).",
|
|
323
|
+
)
|
|
324
|
+
parser.add_argument(
|
|
325
|
+
"--max-items",
|
|
326
|
+
type=int,
|
|
327
|
+
default=None,
|
|
328
|
+
help="Maximum number of selected evidence items.",
|
|
329
|
+
)
|
|
330
|
+
parser.add_argument(
|
|
331
|
+
"--max-estimated-tokens",
|
|
332
|
+
type=int,
|
|
333
|
+
default=None,
|
|
334
|
+
help="Maximum estimated token budget for selected items.",
|
|
335
|
+
)
|
|
336
|
+
parser.add_argument(
|
|
337
|
+
"--include-diagnostics",
|
|
338
|
+
action="store_true",
|
|
339
|
+
help="Include failed/unavailable evidence in selected output when budget allows.",
|
|
340
|
+
)
|
|
341
|
+
parser.add_argument(
|
|
342
|
+
"--json",
|
|
343
|
+
action="store_true",
|
|
344
|
+
help="Emit JSON to stdout.",
|
|
345
|
+
)
|
|
346
|
+
return parser.parse_args(argv)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
def main(argv: list[str] | None = None) -> int:
|
|
350
|
+
args = parse_args(argv)
|
|
351
|
+
try:
|
|
352
|
+
payload = read_input_payload(args.input)
|
|
353
|
+
except (OSError, json.JSONDecodeError) as error:
|
|
354
|
+
print(f"retrieval pack error: {error}", file=sys.stderr)
|
|
355
|
+
return 1
|
|
356
|
+
|
|
357
|
+
if not isinstance(payload, dict):
|
|
358
|
+
print("retrieval pack error: input must be a JSON object", file=sys.stderr)
|
|
359
|
+
return 1
|
|
360
|
+
|
|
361
|
+
result = build_retrieval_pack(
|
|
362
|
+
retrieval_guide=dict_value(payload.get("retrievalGuide")),
|
|
363
|
+
artifact_search_results=normalize_dict_list(
|
|
364
|
+
list_value(payload.get("artifactSearchResults"))
|
|
365
|
+
),
|
|
366
|
+
session_memory_results=normalize_dict_list(
|
|
367
|
+
list_value(payload.get("sessionMemoryResults"))
|
|
368
|
+
),
|
|
369
|
+
smart_search_manifests=normalize_dict_list(
|
|
370
|
+
list_value(payload.get("smartSearchManifests"))
|
|
371
|
+
),
|
|
372
|
+
smart_search_manifest_paths=[
|
|
373
|
+
path
|
|
374
|
+
for path in (string_value(item) for item in list_value(payload.get("smartSearchManifestPaths")))
|
|
375
|
+
if path
|
|
376
|
+
],
|
|
377
|
+
codebase_candidates=normalize_dict_list(
|
|
378
|
+
list_value(payload.get("codebaseCandidates"))
|
|
379
|
+
),
|
|
380
|
+
repo_root=args.root,
|
|
381
|
+
max_items=args.max_items,
|
|
382
|
+
max_estimated_tokens=args.max_estimated_tokens,
|
|
383
|
+
include_diagnostics=args.include_diagnostics,
|
|
384
|
+
router_envelope=resolve_router_envelope(
|
|
385
|
+
resolve_repo_root(args.root),
|
|
386
|
+
explicit_router=dict_value(payload.get("routerEnvelope")) or None,
|
|
387
|
+
query=string_value(payload.get("query")) or None,
|
|
388
|
+
platform=args.platform,
|
|
389
|
+
),
|
|
390
|
+
adapter_hints=normalize_dict_list(list_value(payload.get("adapterHints"))),
|
|
391
|
+
)
|
|
392
|
+
|
|
393
|
+
if args.json:
|
|
394
|
+
print(json.dumps(result, indent=2, ensure_ascii=False))
|
|
395
|
+
else:
|
|
396
|
+
print(json.dumps(result, ensure_ascii=False))
|
|
397
|
+
return 0
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
def read_input_payload(input_path: str | None) -> object:
|
|
401
|
+
if input_path:
|
|
402
|
+
with open(input_path, encoding="utf-8") as handle:
|
|
403
|
+
return json.load(handle)
|
|
404
|
+
if sys.stdin.isatty():
|
|
405
|
+
return {}
|
|
406
|
+
return json.load(sys.stdin)
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
def dict_value(value: Any) -> dict[str, Any]:
|
|
410
|
+
return value if isinstance(value, dict) else {}
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
def list_value(value: Any) -> list[Any]:
|
|
414
|
+
return value if isinstance(value, list) else []
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
def string_value(value: Any) -> str | None:
|
|
418
|
+
if isinstance(value, str):
|
|
419
|
+
stripped = value.strip()
|
|
420
|
+
return stripped or None
|
|
421
|
+
return None
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
if __name__ == "__main__":
|
|
425
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Retrieval pack context output for get_context.py --mode retrieval-pack.
|
|
4
|
+
|
|
5
|
+
Uses session retrievalGuide and optional caller-supplied evidence input.
|
|
6
|
+
Does not run Smart Search, artifact search, session memory search, MCP,
|
|
7
|
+
browser, network, or codebase retrieval automatically.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import json
|
|
13
|
+
import sys
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
17
|
+
from .codebase_retrieval_router import resolve_router_envelope
|
|
18
|
+
from .paths import get_repo_root, get_selected_task
|
|
19
|
+
from .retrieval_pack import (
|
|
20
|
+
build_retrieval_pack,
|
|
21
|
+
dict_value,
|
|
22
|
+
list_value,
|
|
23
|
+
normalize_dict_list,
|
|
24
|
+
string_value,
|
|
25
|
+
)
|
|
26
|
+
from .session_context import _get_retrieval_guide
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def read_evidence_input(input_path: str | None) -> dict[str, Any]:
|
|
30
|
+
"""Read optional evidence JSON from --input or stdin."""
|
|
31
|
+
if input_path:
|
|
32
|
+
with open(input_path, encoding="utf-8") as handle:
|
|
33
|
+
parsed = json.load(handle)
|
|
34
|
+
elif sys.stdin.isatty():
|
|
35
|
+
return {}
|
|
36
|
+
else:
|
|
37
|
+
raw = sys.stdin.read()
|
|
38
|
+
if not raw.strip():
|
|
39
|
+
return {}
|
|
40
|
+
parsed = json.loads(raw)
|
|
41
|
+
|
|
42
|
+
if not isinstance(parsed, dict):
|
|
43
|
+
raise ValueError("evidence input must be a JSON object")
|
|
44
|
+
return parsed
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def get_context_retrieval_pack_json(
|
|
48
|
+
repo_root: Path | None = None,
|
|
49
|
+
*,
|
|
50
|
+
evidence_input: dict[str, Any] | None = None,
|
|
51
|
+
max_items: int | None = None,
|
|
52
|
+
max_estimated_tokens: int | None = None,
|
|
53
|
+
include_diagnostics: bool = False,
|
|
54
|
+
platform: str | None = None,
|
|
55
|
+
project_file_count: int | None = None,
|
|
56
|
+
) -> dict[str, object]:
|
|
57
|
+
"""Build a retrieval pack from session guidance and optional evidence input."""
|
|
58
|
+
if repo_root is None:
|
|
59
|
+
repo_root = get_repo_root()
|
|
60
|
+
|
|
61
|
+
payload = evidence_input or {}
|
|
62
|
+
selected_task = get_selected_task(repo_root)
|
|
63
|
+
retrieval_guide = _get_retrieval_guide(repo_root, selected_task)
|
|
64
|
+
|
|
65
|
+
return build_retrieval_pack(
|
|
66
|
+
retrieval_guide=retrieval_guide,
|
|
67
|
+
artifact_search_results=normalize_dict_list(
|
|
68
|
+
list_value(payload.get("artifactSearchResults"))
|
|
69
|
+
),
|
|
70
|
+
session_memory_results=normalize_dict_list(
|
|
71
|
+
list_value(payload.get("sessionMemoryResults"))
|
|
72
|
+
),
|
|
73
|
+
smart_search_manifests=normalize_dict_list(
|
|
74
|
+
list_value(payload.get("smartSearchManifests"))
|
|
75
|
+
),
|
|
76
|
+
smart_search_manifest_paths=[
|
|
77
|
+
path
|
|
78
|
+
for path in (
|
|
79
|
+
string_value(item)
|
|
80
|
+
for item in list_value(payload.get("smartSearchManifestPaths"))
|
|
81
|
+
)
|
|
82
|
+
if path
|
|
83
|
+
],
|
|
84
|
+
codebase_candidates=normalize_dict_list(
|
|
85
|
+
list_value(payload.get("codebaseCandidates"))
|
|
86
|
+
),
|
|
87
|
+
repo_root=repo_root,
|
|
88
|
+
max_items=max_items,
|
|
89
|
+
max_estimated_tokens=max_estimated_tokens,
|
|
90
|
+
include_diagnostics=include_diagnostics,
|
|
91
|
+
router_envelope=resolve_router_envelope(
|
|
92
|
+
repo_root,
|
|
93
|
+
explicit_router=dict_value(payload.get("routerEnvelope")) or None,
|
|
94
|
+
query=string_value(payload.get("query")) or None,
|
|
95
|
+
platform=platform,
|
|
96
|
+
project_file_count=project_file_count,
|
|
97
|
+
),
|
|
98
|
+
adapter_hints=normalize_dict_list(list_value(payload.get("adapterHints"))),
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def output_retrieval_pack_json(
|
|
103
|
+
*,
|
|
104
|
+
repo_root: Path | None = None,
|
|
105
|
+
evidence_input: dict[str, Any] | None = None,
|
|
106
|
+
max_items: int | None = None,
|
|
107
|
+
max_estimated_tokens: int | None = None,
|
|
108
|
+
include_diagnostics: bool = False,
|
|
109
|
+
pretty: bool = False,
|
|
110
|
+
platform: str | None = None,
|
|
111
|
+
project_file_count: int | None = None,
|
|
112
|
+
) -> None:
|
|
113
|
+
"""Print retrieval pack JSON to stdout."""
|
|
114
|
+
result = get_context_retrieval_pack_json(
|
|
115
|
+
repo_root,
|
|
116
|
+
evidence_input=evidence_input,
|
|
117
|
+
max_items=max_items,
|
|
118
|
+
max_estimated_tokens=max_estimated_tokens,
|
|
119
|
+
include_diagnostics=include_diagnostics,
|
|
120
|
+
platform=platform,
|
|
121
|
+
project_file_count=project_file_count,
|
|
122
|
+
)
|
|
123
|
+
if pretty:
|
|
124
|
+
print(json.dumps(result, indent=2, ensure_ascii=False))
|
|
125
|
+
else:
|
|
126
|
+
print(json.dumps(result, ensure_ascii=False))
|