@openclaw/tokenjuice 2026.5.28
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/README.md +35 -0
- package/dist/index.js +13 -0
- package/dist/runtime-api.js +2 -0
- package/dist/tool-result-middleware.js +34 -0
- package/node_modules/tokenjuice/LICENSE +21 -0
- package/node_modules/tokenjuice/README.md +311 -0
- package/node_modules/tokenjuice/SECURITY.md +50 -0
- package/node_modules/tokenjuice/dist/cli/doctor-output.d.ts +2 -0
- package/node_modules/tokenjuice/dist/cli/doctor-output.js +92 -0
- package/node_modules/tokenjuice/dist/cli/install-output.d.ts +5 -0
- package/node_modules/tokenjuice/dist/cli/install-output.js +11 -0
- package/node_modules/tokenjuice/dist/cli/main.d.ts +34 -0
- package/node_modules/tokenjuice/dist/cli/main.js +6614 -0
- package/node_modules/tokenjuice/dist/core/analysis.d.ts +88 -0
- package/node_modules/tokenjuice/dist/core/analysis.js +313 -0
- package/node_modules/tokenjuice/dist/core/artifacts.d.ts +9 -0
- package/node_modules/tokenjuice/dist/core/artifacts.js +210 -0
- package/node_modules/tokenjuice/dist/core/builtin-rules.generated.d.ts +2 -0
- package/node_modules/tokenjuice/dist/core/builtin-rules.generated.js +262 -0
- package/node_modules/tokenjuice/dist/core/classify.d.ts +18 -0
- package/node_modules/tokenjuice/dist/core/classify.js +181 -0
- package/node_modules/tokenjuice/dist/core/cli-client.d.ts +2 -0
- package/node_modules/tokenjuice/dist/core/cli-client.js +127 -0
- package/node_modules/tokenjuice/dist/core/command-identity.d.ts +9 -0
- package/node_modules/tokenjuice/dist/core/command-identity.js +201 -0
- package/node_modules/tokenjuice/dist/core/command-match.d.ts +16 -0
- package/node_modules/tokenjuice/dist/core/command-match.js +443 -0
- package/node_modules/tokenjuice/dist/core/command-shell.d.ts +18 -0
- package/node_modules/tokenjuice/dist/core/command-shell.js +291 -0
- package/node_modules/tokenjuice/dist/core/command.d.ts +5 -0
- package/node_modules/tokenjuice/dist/core/command.js +4 -0
- package/node_modules/tokenjuice/dist/core/compaction-metadata.d.ts +10 -0
- package/node_modules/tokenjuice/dist/core/compaction-metadata.js +28 -0
- package/node_modules/tokenjuice/dist/core/env.d.ts +1 -0
- package/node_modules/tokenjuice/dist/core/env.js +5 -0
- package/node_modules/tokenjuice/dist/core/execution-input.d.ts +2 -0
- package/node_modules/tokenjuice/dist/core/execution-input.js +51 -0
- package/node_modules/tokenjuice/dist/core/fixtures.d.ts +14 -0
- package/node_modules/tokenjuice/dist/core/fixtures.js +190 -0
- package/node_modules/tokenjuice/dist/core/github-actions-summary.d.ts +6 -0
- package/node_modules/tokenjuice/dist/core/github-actions-summary.js +105 -0
- package/node_modules/tokenjuice/dist/core/integrations/compact-bash-result.d.ts +33 -0
- package/node_modules/tokenjuice/dist/core/integrations/compact-bash-result.js +85 -0
- package/node_modules/tokenjuice/dist/core/integrations/rewrite-policy.d.ts +8 -0
- package/node_modules/tokenjuice/dist/core/integrations/rewrite-policy.js +25 -0
- package/node_modules/tokenjuice/dist/core/inventory-safety.d.ts +11 -0
- package/node_modules/tokenjuice/dist/core/inventory-safety.js +347 -0
- package/node_modules/tokenjuice/dist/core/json-protocol.d.ts +2 -0
- package/node_modules/tokenjuice/dist/core/json-protocol.js +131 -0
- package/node_modules/tokenjuice/dist/core/reduce-formatters.d.ts +15 -0
- package/node_modules/tokenjuice/dist/core/reduce-formatters.js +611 -0
- package/node_modules/tokenjuice/dist/core/reduce-inspection-summary.d.ts +9 -0
- package/node_modules/tokenjuice/dist/core/reduce-inspection-summary.js +125 -0
- package/node_modules/tokenjuice/dist/core/reduce-utils.d.ts +12 -0
- package/node_modules/tokenjuice/dist/core/reduce-utils.js +117 -0
- package/node_modules/tokenjuice/dist/core/reduce.d.ts +5 -0
- package/node_modules/tokenjuice/dist/core/reduce.js +511 -0
- package/node_modules/tokenjuice/dist/core/rules.d.ts +22 -0
- package/node_modules/tokenjuice/dist/core/rules.js +265 -0
- package/node_modules/tokenjuice/dist/core/source.d.ts +6 -0
- package/node_modules/tokenjuice/dist/core/source.js +113 -0
- package/node_modules/tokenjuice/dist/core/text.d.ts +23 -0
- package/node_modules/tokenjuice/dist/core/text.js +204 -0
- package/node_modules/tokenjuice/dist/core/time.d.ts +2 -0
- package/node_modules/tokenjuice/dist/core/time.js +82 -0
- package/node_modules/tokenjuice/dist/core/validate-rules.d.ts +10 -0
- package/node_modules/tokenjuice/dist/core/validate-rules.js +198 -0
- package/node_modules/tokenjuice/dist/core/wrap.d.ts +2 -0
- package/node_modules/tokenjuice/dist/core/wrap.js +104 -0
- package/node_modules/tokenjuice/dist/hosts/adal/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/adal/index.js +157 -0
- package/node_modules/tokenjuice/dist/hosts/aether/index.d.ts +30 -0
- package/node_modules/tokenjuice/dist/hosts/aether/index.js +671 -0
- package/node_modules/tokenjuice/dist/hosts/agent-layer/index.d.ts +25 -0
- package/node_modules/tokenjuice/dist/hosts/agent-layer/index.js +173 -0
- package/node_modules/tokenjuice/dist/hosts/agentinit/index.d.ts +27 -0
- package/node_modules/tokenjuice/dist/hosts/agentinit/index.js +252 -0
- package/node_modules/tokenjuice/dist/hosts/agentlink/index.d.ts +26 -0
- package/node_modules/tokenjuice/dist/hosts/agentlink/index.js +310 -0
- package/node_modules/tokenjuice/dist/hosts/agentloom/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/agentloom/index.js +161 -0
- package/node_modules/tokenjuice/dist/hosts/agents-cli/index.d.ts +26 -0
- package/node_modules/tokenjuice/dist/hosts/agents-cli/index.js +136 -0
- package/node_modules/tokenjuice/dist/hosts/agents-md/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/agents-md/index.js +240 -0
- package/node_modules/tokenjuice/dist/hosts/agentsge/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/agentsge/index.js +119 -0
- package/node_modules/tokenjuice/dist/hosts/agentsmesh/index.d.ts +26 -0
- package/node_modules/tokenjuice/dist/hosts/agentsmesh/index.js +337 -0
- package/node_modules/tokenjuice/dist/hosts/ai-memory-protocol/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/ai-memory-protocol/index.js +392 -0
- package/node_modules/tokenjuice/dist/hosts/aictl/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/aictl/index.js +271 -0
- package/node_modules/tokenjuice/dist/hosts/aider/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/aider/index.js +79 -0
- package/node_modules/tokenjuice/dist/hosts/amazon-q/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/amazon-q/index.js +169 -0
- package/node_modules/tokenjuice/dist/hosts/amp/index.d.ts +26 -0
- package/node_modules/tokenjuice/dist/hosts/amp/index.js +306 -0
- package/node_modules/tokenjuice/dist/hosts/antigravity/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/antigravity/index.js +172 -0
- package/node_modules/tokenjuice/dist/hosts/anywhere-agents/index.d.ts +26 -0
- package/node_modules/tokenjuice/dist/hosts/anywhere-agents/index.js +260 -0
- package/node_modules/tokenjuice/dist/hosts/augment/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/augment/index.js +171 -0
- package/node_modules/tokenjuice/dist/hosts/avante/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/avante/index.js +68 -0
- package/node_modules/tokenjuice/dist/hosts/baz/index.d.ts +25 -0
- package/node_modules/tokenjuice/dist/hosts/baz/index.js +286 -0
- package/node_modules/tokenjuice/dist/hosts/bito/index.d.ts +28 -0
- package/node_modules/tokenjuice/dist/hosts/bito/index.js +363 -0
- package/node_modules/tokenjuice/dist/hosts/blackbox/index.d.ts +25 -0
- package/node_modules/tokenjuice/dist/hosts/blackbox/index.js +305 -0
- package/node_modules/tokenjuice/dist/hosts/blocks/index.d.ts +25 -0
- package/node_modules/tokenjuice/dist/hosts/blocks/index.js +317 -0
- package/node_modules/tokenjuice/dist/hosts/bob/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/bob/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/builder/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/builder/index.js +177 -0
- package/node_modules/tokenjuice/dist/hosts/charlie/index.d.ts +25 -0
- package/node_modules/tokenjuice/dist/hosts/charlie/index.js +275 -0
- package/node_modules/tokenjuice/dist/hosts/claude-code/index.d.ts +30 -0
- package/node_modules/tokenjuice/dist/hosts/claude-code/index.js +364 -0
- package/node_modules/tokenjuice/dist/hosts/clawdbot/index.d.ts +25 -0
- package/node_modules/tokenjuice/dist/hosts/clawdbot/index.js +320 -0
- package/node_modules/tokenjuice/dist/hosts/cline/index.d.ts +27 -0
- package/node_modules/tokenjuice/dist/hosts/cline/index.js +156 -0
- package/node_modules/tokenjuice/dist/hosts/codeant/index.d.ts +25 -0
- package/node_modules/tokenjuice/dist/hosts/codeant/index.js +370 -0
- package/node_modules/tokenjuice/dist/hosts/codebuddy/index.d.ts +29 -0
- package/node_modules/tokenjuice/dist/hosts/codebuddy/index.js +379 -0
- package/node_modules/tokenjuice/dist/hosts/codebuff/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/codebuff/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/codegen/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/codegen/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/coder-agents/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/coder-agents/index.js +339 -0
- package/node_modules/tokenjuice/dist/hosts/coderabbit/index.d.ts +25 -0
- package/node_modules/tokenjuice/dist/hosts/coderabbit/index.js +599 -0
- package/node_modules/tokenjuice/dist/hosts/codex/index.d.ts +93 -0
- package/node_modules/tokenjuice/dist/hosts/codex/index.js +945 -0
- package/node_modules/tokenjuice/dist/hosts/command-code/index.d.ts +29 -0
- package/node_modules/tokenjuice/dist/hosts/command-code/index.js +366 -0
- package/node_modules/tokenjuice/dist/hosts/continue/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/continue/index.js +81 -0
- package/node_modules/tokenjuice/dist/hosts/copilot-agent/index.d.ts +29 -0
- package/node_modules/tokenjuice/dist/hosts/copilot-agent/index.js +497 -0
- package/node_modules/tokenjuice/dist/hosts/copilot-cli/index.d.ts +31 -0
- package/node_modules/tokenjuice/dist/hosts/copilot-cli/index.js +428 -0
- package/node_modules/tokenjuice/dist/hosts/crush/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/crush/index.js +135 -0
- package/node_modules/tokenjuice/dist/hosts/cursor/index.d.ts +30 -0
- package/node_modules/tokenjuice/dist/hosts/cursor/index.js +293 -0
- package/node_modules/tokenjuice/dist/hosts/deepagents/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/deepagents/index.js +157 -0
- package/node_modules/tokenjuice/dist/hosts/devin/index.d.ts +31 -0
- package/node_modules/tokenjuice/dist/hosts/devin/index.js +283 -0
- package/node_modules/tokenjuice/dist/hosts/docker-agent/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/docker-agent/index.js +206 -0
- package/node_modules/tokenjuice/dist/hosts/dot-agents/index.d.ts +26 -0
- package/node_modules/tokenjuice/dist/hosts/dot-agents/index.js +171 -0
- package/node_modules/tokenjuice/dist/hosts/droid/index.d.ts +26 -0
- package/node_modules/tokenjuice/dist/hosts/droid/index.js +313 -0
- package/node_modules/tokenjuice/dist/hosts/eca/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/eca/index.js +347 -0
- package/node_modules/tokenjuice/dist/hosts/elyra/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/elyra/index.js +382 -0
- package/node_modules/tokenjuice/dist/hosts/firebase-studio/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/firebase-studio/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/forgecode/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/forgecode/index.js +273 -0
- package/node_modules/tokenjuice/dist/hosts/gemini-cli/index.d.ts +26 -0
- package/node_modules/tokenjuice/dist/hosts/gemini-cli/index.js +234 -0
- package/node_modules/tokenjuice/dist/hosts/gitlab-duo/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/gitlab-duo/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/goose/index.d.ts +26 -0
- package/node_modules/tokenjuice/dist/hosts/goose/index.js +288 -0
- package/node_modules/tokenjuice/dist/hosts/gptme/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/gptme/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/greptile/index.d.ts +25 -0
- package/node_modules/tokenjuice/dist/hosts/greptile/index.js +299 -0
- package/node_modules/tokenjuice/dist/hosts/grok-build/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/grok-build/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/grok-cli/index.d.ts +26 -0
- package/node_modules/tokenjuice/dist/hosts/grok-cli/index.js +262 -0
- package/node_modules/tokenjuice/dist/hosts/jean2/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/jean2/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/jetbrains-ai/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/jetbrains-ai/index.js +202 -0
- package/node_modules/tokenjuice/dist/hosts/jules/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/jules/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/junie/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/junie/index.js +68 -0
- package/node_modules/tokenjuice/dist/hosts/kilo/index.d.ts +30 -0
- package/node_modules/tokenjuice/dist/hosts/kilo/index.js +497 -0
- package/node_modules/tokenjuice/dist/hosts/kimi/index.d.ts +29 -0
- package/node_modules/tokenjuice/dist/hosts/kimi/index.js +255 -0
- package/node_modules/tokenjuice/dist/hosts/kiro/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/kiro/index.js +116 -0
- package/node_modules/tokenjuice/dist/hosts/knowns/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/knowns/index.js +273 -0
- package/node_modules/tokenjuice/dist/hosts/leanctl/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/leanctl/index.js +317 -0
- package/node_modules/tokenjuice/dist/hosts/localcode/index.d.ts +31 -0
- package/node_modules/tokenjuice/dist/hosts/localcode/index.js +539 -0
- package/node_modules/tokenjuice/dist/hosts/mcp-agent/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/mcp-agent/index.js +302 -0
- package/node_modules/tokenjuice/dist/hosts/mini-swe-agent/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/mini-swe-agent/index.js +226 -0
- package/node_modules/tokenjuice/dist/hosts/mistral-vibe/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/mistral-vibe/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/mux/index.d.ts +28 -0
- package/node_modules/tokenjuice/dist/hosts/mux/index.js +411 -0
- package/node_modules/tokenjuice/dist/hosts/novakit/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/novakit/index.js +273 -0
- package/node_modules/tokenjuice/dist/hosts/ona/index.d.ts +41 -0
- package/node_modules/tokenjuice/dist/hosts/ona/index.js +596 -0
- package/node_modules/tokenjuice/dist/hosts/open-interpreter/index.d.ts +26 -0
- package/node_modules/tokenjuice/dist/hosts/open-interpreter/index.js +348 -0
- package/node_modules/tokenjuice/dist/hosts/openclaw/extension.d.ts +8 -0
- package/node_modules/tokenjuice/dist/hosts/openclaw/extension.js +104 -0
- package/node_modules/tokenjuice/dist/hosts/openclaw/index.d.ts +1 -0
- package/node_modules/tokenjuice/dist/hosts/openclaw/index.js +1 -0
- package/node_modules/tokenjuice/dist/hosts/opencode/extension/runtime.d.ts +17 -0
- package/node_modules/tokenjuice/dist/hosts/opencode/extension/runtime.js +9094 -0
- package/node_modules/tokenjuice/dist/hosts/opencode/index.d.ts +21 -0
- package/node_modules/tokenjuice/dist/hosts/opencode/index.js +163 -0
- package/node_modules/tokenjuice/dist/hosts/openhands/index.d.ts +28 -0
- package/node_modules/tokenjuice/dist/hosts/openhands/index.js +211 -0
- package/node_modules/tokenjuice/dist/hosts/openwebui/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/openwebui/index.js +245 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/pi-types.d.ts +79 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/pi-types.js +3 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/runtime.d.ts +5 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/runtime.js +9372 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/settings.d.ts +1 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/settings.js +26 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/status-panel.d.ts +3 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/status-panel.js +72 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/status.d.ts +20 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/status.js +58 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/tool-result.d.ts +4 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/tool-result.js +24 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/utils.d.ts +1 -0
- package/node_modules/tokenjuice/dist/hosts/pi/extension/utils.js +6 -0
- package/node_modules/tokenjuice/dist/hosts/pi/index.d.ts +26 -0
- package/node_modules/tokenjuice/dist/hosts/pi/index.js +228 -0
- package/node_modules/tokenjuice/dist/hosts/pi-go/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/pi-go/index.js +352 -0
- package/node_modules/tokenjuice/dist/hosts/plandex/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/plandex/index.js +164 -0
- package/node_modules/tokenjuice/dist/hosts/qoder/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/qoder/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/qodo/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/qodo/index.js +584 -0
- package/node_modules/tokenjuice/dist/hosts/qwen-code/index.d.ts +28 -0
- package/node_modules/tokenjuice/dist/hosts/qwen-code/index.js +276 -0
- package/node_modules/tokenjuice/dist/hosts/replit/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/replit/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/roo/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/roo/index.js +101 -0
- package/node_modules/tokenjuice/dist/hosts/rovo/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/rovo/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/ruler/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/ruler/index.js +157 -0
- package/node_modules/tokenjuice/dist/hosts/shared/hook-command-doctor.d.ts +19 -0
- package/node_modules/tokenjuice/dist/hosts/shared/hook-command-doctor.js +32 -0
- package/node_modules/tokenjuice/dist/hosts/shared/hook-command.d.ts +5 -0
- package/node_modules/tokenjuice/dist/hosts/shared/hook-command.js +94 -0
- package/node_modules/tokenjuice/dist/hosts/shared/hook-doctor.d.ts +212 -0
- package/node_modules/tokenjuice/dist/hosts/shared/hook-doctor.js +270 -0
- package/node_modules/tokenjuice/dist/hosts/shared/hook-output.d.ts +4 -0
- package/node_modules/tokenjuice/dist/hosts/shared/hook-output.js +15 -0
- package/node_modules/tokenjuice/dist/hosts/shared/hooks-json-file.d.ts +18 -0
- package/node_modules/tokenjuice/dist/hosts/shared/hooks-json-file.js +108 -0
- package/node_modules/tokenjuice/dist/hosts/shared/host-command.d.ts +10 -0
- package/node_modules/tokenjuice/dist/hosts/shared/host-command.js +70 -0
- package/node_modules/tokenjuice/dist/hosts/shared/instruction-doctor.d.ts +16 -0
- package/node_modules/tokenjuice/dist/hosts/shared/instruction-doctor.js +13 -0
- package/node_modules/tokenjuice/dist/hosts/shared/instruction-file.d.ts +29 -0
- package/node_modules/tokenjuice/dist/hosts/shared/instruction-file.js +121 -0
- package/node_modules/tokenjuice/dist/hosts/shared/instruction-guidance.d.ts +7 -0
- package/node_modules/tokenjuice/dist/hosts/shared/instruction-guidance.js +12 -0
- package/node_modules/tokenjuice/dist/hosts/shared/marker-instructions.d.ts +32 -0
- package/node_modules/tokenjuice/dist/hosts/shared/marker-instructions.js +100 -0
- package/node_modules/tokenjuice/dist/hosts/shared/pre-tool-wrap.d.ts +91 -0
- package/node_modules/tokenjuice/dist/hosts/shared/pre-tool-wrap.js +186 -0
- package/node_modules/tokenjuice/dist/hosts/shared/tool-result.d.ts +15 -0
- package/node_modules/tokenjuice/dist/hosts/shared/tool-result.js +52 -0
- package/node_modules/tokenjuice/dist/hosts/stagewise/index.d.ts +25 -0
- package/node_modules/tokenjuice/dist/hosts/stagewise/index.js +468 -0
- package/node_modules/tokenjuice/dist/hosts/swe-agent/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/swe-agent/index.js +223 -0
- package/node_modules/tokenjuice/dist/hosts/tabby/index.d.ts +24 -0
- package/node_modules/tokenjuice/dist/hosts/tabby/index.js +469 -0
- package/node_modules/tokenjuice/dist/hosts/tabnine/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/tabnine/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/trae/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/trae/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/uipath/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/uipath/index.js +155 -0
- package/node_modules/tokenjuice/dist/hosts/vscode-copilot/index.d.ts +32 -0
- package/node_modules/tokenjuice/dist/hosts/vscode-copilot/index.js +416 -0
- package/node_modules/tokenjuice/dist/hosts/warp/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/warp/index.js +181 -0
- package/node_modules/tokenjuice/dist/hosts/windsurf/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/windsurf/index.js +99 -0
- package/node_modules/tokenjuice/dist/hosts/zed/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/zed/index.js +68 -0
- package/node_modules/tokenjuice/dist/hosts/zencoder/index.d.ts +23 -0
- package/node_modules/tokenjuice/dist/hosts/zencoder/index.js +227 -0
- package/node_modules/tokenjuice/dist/index.d.ts +214 -0
- package/node_modules/tokenjuice/dist/index.js +113 -0
- package/node_modules/tokenjuice/dist/rules/archive/tar.json +30 -0
- package/node_modules/tokenjuice/dist/rules/archive/unzip.json +30 -0
- package/node_modules/tokenjuice/dist/rules/archive/zip.json +30 -0
- package/node_modules/tokenjuice/dist/rules/build/cmake.json +35 -0
- package/node_modules/tokenjuice/dist/rules/build/dotnet.json +36 -0
- package/node_modules/tokenjuice/dist/rules/build/esbuild.json +35 -0
- package/node_modules/tokenjuice/dist/rules/build/go-build.json +31 -0
- package/node_modules/tokenjuice/dist/rules/build/gradle.json +35 -0
- package/node_modules/tokenjuice/dist/rules/build/maven.json +35 -0
- package/node_modules/tokenjuice/dist/rules/build/msbuild.json +35 -0
- package/node_modules/tokenjuice/dist/rules/build/pnpm-build.json +44 -0
- package/node_modules/tokenjuice/dist/rules/build/swift-build.json +56 -0
- package/node_modules/tokenjuice/dist/rules/build/tsc.json +74 -0
- package/node_modules/tokenjuice/dist/rules/build/tsdown.json +35 -0
- package/node_modules/tokenjuice/dist/rules/build/vite.json +42 -0
- package/node_modules/tokenjuice/dist/rules/build/webpack.json +51 -0
- package/node_modules/tokenjuice/dist/rules/build/xcodebuild.json +80 -0
- package/node_modules/tokenjuice/dist/rules/cloud/aws.json +30 -0
- package/node_modules/tokenjuice/dist/rules/cloud/az.json +30 -0
- package/node_modules/tokenjuice/dist/rules/cloud/flyctl.json +30 -0
- package/node_modules/tokenjuice/dist/rules/cloud/gcloud.json +30 -0
- package/node_modules/tokenjuice/dist/rules/cloud/gh.json +30 -0
- package/node_modules/tokenjuice/dist/rules/cloud/vercel.json +30 -0
- package/node_modules/tokenjuice/dist/rules/database/mongosh.json +30 -0
- package/node_modules/tokenjuice/dist/rules/database/mysql.json +30 -0
- package/node_modules/tokenjuice/dist/rules/database/psql.json +30 -0
- package/node_modules/tokenjuice/dist/rules/database/redis-cli.json +30 -0
- package/node_modules/tokenjuice/dist/rules/database/sqlite3.json +30 -0
- package/node_modules/tokenjuice/dist/rules/devops/docker-build.json +53 -0
- package/node_modules/tokenjuice/dist/rules/devops/docker-compose.json +44 -0
- package/node_modules/tokenjuice/dist/rules/devops/docker-images.json +30 -0
- package/node_modules/tokenjuice/dist/rules/devops/docker-logs.json +43 -0
- package/node_modules/tokenjuice/dist/rules/devops/docker-ps.json +30 -0
- package/node_modules/tokenjuice/dist/rules/devops/helm.json +35 -0
- package/node_modules/tokenjuice/dist/rules/devops/kubectl-describe.json +45 -0
- package/node_modules/tokenjuice/dist/rules/devops/kubectl-get.json +35 -0
- package/node_modules/tokenjuice/dist/rules/devops/kubectl-logs.json +43 -0
- package/node_modules/tokenjuice/dist/rules/devops/pulumi.json +35 -0
- package/node_modules/tokenjuice/dist/rules/devops/terraform.json +35 -0
- package/node_modules/tokenjuice/dist/rules/devops/terragrunt.json +35 -0
- package/node_modules/tokenjuice/dist/rules/filesystem/fd.json +33 -0
- package/node_modules/tokenjuice/dist/rules/filesystem/find.json +42 -0
- package/node_modules/tokenjuice/dist/rules/filesystem/git-ls-files.json +35 -0
- package/node_modules/tokenjuice/dist/rules/filesystem/ls.json +29 -0
- package/node_modules/tokenjuice/dist/rules/filesystem/rg-files.json +34 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/archive/tar.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/archive/unzip.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/archive/zip.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/cmake.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/dotnet.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/esbuild.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/go-build.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/gradle.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/maven.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/msbuild.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/pnpm-build-failure.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/pnpm-build.fixture.json +18 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/swift-build.fixture.json +29 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/tsc.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/tsdown.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/vite.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/webpack.fixture.json +20 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/build/xcodebuild.fixture.json +27 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/cloud/aws.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/cloud/az.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/cloud/flyctl.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/cloud/gcloud.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/cloud/gh.fixture.json +17 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/cloud/vercel.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/database/mongosh.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/database/mysql.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/database/psql.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/database/redis-cli.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/database/sqlite3.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/devops/docker-build.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/devops/docker-compose.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/devops/docker-images.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/devops/docker-logs.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/devops/docker-ps.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/devops/helm.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/devops/kubectl-describe.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/devops/kubectl-get.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/devops/kubectl-logs.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/devops/pulumi.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/devops/terraform.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/devops/terragrunt.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/filesystem/fd.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/filesystem/find.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/filesystem/git-ls-files.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/filesystem/ls.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/filesystem/rg-files.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/generic/fallback.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/generic/help.fixture.json +17 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/git/branch.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/git/diff-name-only.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/git/diff-stat.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/git/diff.fixture.json +26 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/git/log-oneline.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/git/remote-v.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/git/show.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/git/stash-list.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/git/status.fixture.json +17 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/git/worktree-list.fixture.json +17 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/install/bun-install-up-to-date.fixture.json +19 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/install/bun-install.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/install/npm-ci-up-to-date.fixture.json +19 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/install/npm-ci.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/install/npm-install-up-to-date.fixture.json +19 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/install/npm-install.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/install/pnpm-install-up-to-date.fixture.json +19 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/install/pnpm-install.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/install/yarn-install-up-to-date.fixture.json +19 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/install/yarn-install.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/lint/biome.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/lint/eslint.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/lint/oxlint.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/lint/prettier-check.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/media/ffmpeg.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/media/mediainfo.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/network/curl.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/network/dig.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/network/nslookup.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/network/ping.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/network/ssh.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/network/traceroute.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/network/wget.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/observability/free.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/observability/htop.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/observability/iostat.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/observability/top.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/observability/vmstat.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/openclaw/sessions-history.fixture.json +33 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/package/apt-install.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/package/apt-upgrade.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/package/brew-install.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/package/brew-upgrade.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/package/composer.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/package/dnf-install.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/package/fnm.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/package/npm-ls.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/package/yum-install.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/search/git-grep.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/search/grep.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/search/rg.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/service/journalctl.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/service/launchctl.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/service/lsof.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/service/netstat.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/service/pm2.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/service/service.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/service/ss.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/service/systemctl-status.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/system/df.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/system/du.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/system/file.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/system/ps.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/task/env.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/task/just.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/task/make.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/task/mise.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/task/node.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/task/php.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/task/python.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/task/ruby.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/task/uv.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/bun-test.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/cargo-test.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/go-test.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/jest.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/mocha.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/npm-test.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/playwright.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/pnpm-test.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/pytest.fixture.json +19 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/rspec.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/swift-test.fixture.json +30 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/vitest.fixture.json +15 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/tests/yarn-test.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/text/wc.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/transfer/rsync.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/fixtures/transfer/scp.fixture.json +16 -0
- package/node_modules/tokenjuice/dist/rules/generic/fallback.json +32 -0
- package/node_modules/tokenjuice/dist/rules/generic/help.json +25 -0
- package/node_modules/tokenjuice/dist/rules/git/branch.json +29 -0
- package/node_modules/tokenjuice/dist/rules/git/diff-name-only.json +29 -0
- package/node_modules/tokenjuice/dist/rules/git/diff-stat.json +37 -0
- package/node_modules/tokenjuice/dist/rules/git/diff.json +65 -0
- package/node_modules/tokenjuice/dist/rules/git/log-oneline.json +30 -0
- package/node_modules/tokenjuice/dist/rules/git/remote-v.json +29 -0
- package/node_modules/tokenjuice/dist/rules/git/show.json +50 -0
- package/node_modules/tokenjuice/dist/rules/git/stash-list.json +30 -0
- package/node_modules/tokenjuice/dist/rules/git/status.json +54 -0
- package/node_modules/tokenjuice/dist/rules/git/worktree-list.json +31 -0
- package/node_modules/tokenjuice/dist/rules/install/bun-install.json +43 -0
- package/node_modules/tokenjuice/dist/rules/install/npm-ci.json +49 -0
- package/node_modules/tokenjuice/dist/rules/install/npm-install.json +49 -0
- package/node_modules/tokenjuice/dist/rules/install/pnpm-install.json +43 -0
- package/node_modules/tokenjuice/dist/rules/install/yarn-install.json +42 -0
- package/node_modules/tokenjuice/dist/rules/lint/biome.json +35 -0
- package/node_modules/tokenjuice/dist/rules/lint/eslint.json +45 -0
- package/node_modules/tokenjuice/dist/rules/lint/oxlint.json +35 -0
- package/node_modules/tokenjuice/dist/rules/lint/prettier-check.json +34 -0
- package/node_modules/tokenjuice/dist/rules/media/ffmpeg.json +30 -0
- package/node_modules/tokenjuice/dist/rules/media/mediainfo.json +30 -0
- package/node_modules/tokenjuice/dist/rules/network/curl.json +30 -0
- package/node_modules/tokenjuice/dist/rules/network/dig.json +30 -0
- package/node_modules/tokenjuice/dist/rules/network/nslookup.json +30 -0
- package/node_modules/tokenjuice/dist/rules/network/ping.json +35 -0
- package/node_modules/tokenjuice/dist/rules/network/ssh.json +30 -0
- package/node_modules/tokenjuice/dist/rules/network/traceroute.json +30 -0
- package/node_modules/tokenjuice/dist/rules/network/wget.json +30 -0
- package/node_modules/tokenjuice/dist/rules/observability/free.json +30 -0
- package/node_modules/tokenjuice/dist/rules/observability/htop.json +30 -0
- package/node_modules/tokenjuice/dist/rules/observability/iostat.json +30 -0
- package/node_modules/tokenjuice/dist/rules/observability/top.json +30 -0
- package/node_modules/tokenjuice/dist/rules/observability/vmstat.json +30 -0
- package/node_modules/tokenjuice/dist/rules/openclaw/sessions-history.json +59 -0
- package/node_modules/tokenjuice/dist/rules/package/apt-install.json +36 -0
- package/node_modules/tokenjuice/dist/rules/package/apt-upgrade.json +36 -0
- package/node_modules/tokenjuice/dist/rules/package/brew-install.json +31 -0
- package/node_modules/tokenjuice/dist/rules/package/brew-upgrade.json +31 -0
- package/node_modules/tokenjuice/dist/rules/package/composer.json +35 -0
- package/node_modules/tokenjuice/dist/rules/package/dnf-install.json +31 -0
- package/node_modules/tokenjuice/dist/rules/package/fnm.json +35 -0
- package/node_modules/tokenjuice/dist/rules/package/npm-ls.json +31 -0
- package/node_modules/tokenjuice/dist/rules/package/yum-install.json +31 -0
- package/node_modules/tokenjuice/dist/rules/search/git-grep.json +30 -0
- package/node_modules/tokenjuice/dist/rules/search/grep.json +38 -0
- package/node_modules/tokenjuice/dist/rules/search/rg.json +38 -0
- package/node_modules/tokenjuice/dist/rules/service/journalctl.json +42 -0
- package/node_modules/tokenjuice/dist/rules/service/launchctl.json +41 -0
- package/node_modules/tokenjuice/dist/rules/service/lsof.json +29 -0
- package/node_modules/tokenjuice/dist/rules/service/netstat.json +29 -0
- package/node_modules/tokenjuice/dist/rules/service/pm2.json +35 -0
- package/node_modules/tokenjuice/dist/rules/service/service.json +46 -0
- package/node_modules/tokenjuice/dist/rules/service/ss.json +29 -0
- package/node_modules/tokenjuice/dist/rules/service/systemctl-status.json +45 -0
- package/node_modules/tokenjuice/dist/rules/system/df.json +29 -0
- package/node_modules/tokenjuice/dist/rules/system/du.json +29 -0
- package/node_modules/tokenjuice/dist/rules/system/file.json +30 -0
- package/node_modules/tokenjuice/dist/rules/system/ps.json +29 -0
- package/node_modules/tokenjuice/dist/rules/task/env.json +31 -0
- package/node_modules/tokenjuice/dist/rules/task/just.json +30 -0
- package/node_modules/tokenjuice/dist/rules/task/make.json +30 -0
- package/node_modules/tokenjuice/dist/rules/task/mise.json +35 -0
- package/node_modules/tokenjuice/dist/rules/task/node.json +30 -0
- package/node_modules/tokenjuice/dist/rules/task/php.json +30 -0
- package/node_modules/tokenjuice/dist/rules/task/python.json +30 -0
- package/node_modules/tokenjuice/dist/rules/task/ruby.json +30 -0
- package/node_modules/tokenjuice/dist/rules/task/uv.json +35 -0
- package/node_modules/tokenjuice/dist/rules/tests/bun-test.json +56 -0
- package/node_modules/tokenjuice/dist/rules/tests/cargo-test.json +41 -0
- package/node_modules/tokenjuice/dist/rules/tests/go-test.json +49 -0
- package/node_modules/tokenjuice/dist/rules/tests/jest.json +41 -0
- package/node_modules/tokenjuice/dist/rules/tests/mocha.json +35 -0
- package/node_modules/tokenjuice/dist/rules/tests/npm-test.json +56 -0
- package/node_modules/tokenjuice/dist/rules/tests/playwright.json +37 -0
- package/node_modules/tokenjuice/dist/rules/tests/pnpm-test.json +56 -0
- package/node_modules/tokenjuice/dist/rules/tests/pytest.json +54 -0
- package/node_modules/tokenjuice/dist/rules/tests/rspec.json +31 -0
- package/node_modules/tokenjuice/dist/rules/tests/swift-test.json +66 -0
- package/node_modules/tokenjuice/dist/rules/tests/vitest.json +56 -0
- package/node_modules/tokenjuice/dist/rules/tests/yarn-test.json +56 -0
- package/node_modules/tokenjuice/dist/rules/text/wc.json +35 -0
- package/node_modules/tokenjuice/dist/rules/tokenjuice-rule.schema.json +155 -0
- package/node_modules/tokenjuice/dist/rules/transfer/rsync.json +30 -0
- package/node_modules/tokenjuice/dist/rules/transfer/scp.json +30 -0
- package/node_modules/tokenjuice/dist/types.d.ts +212 -0
- package/node_modules/tokenjuice/dist/types.js +1 -0
- package/node_modules/tokenjuice/package.json +80 -0
- package/npm-shrinkwrap.json +39 -0
- package/openclaw.plugin.json +16 -0
- package/package.json +55 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { lstat, readFile, realpath, stat, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
3
|
+
import { collectMarkerDelimitedBlockIssues, inspectMarkerDelimitedBlock, installMarkerDelimitedBlock, removeMarkerDelimitedBlock, uninstallMarkerDelimitedBlock, } from "../shared/marker-instructions.js";
|
|
4
|
+
import { buildTokenjuiceGuidanceBullets, TOKENJUICE_FULL_COMMAND, TOKENJUICE_RAW_COMMAND, TOKENJUICE_WRAP_COMMAND, } from "../shared/instruction-guidance.js";
|
|
5
|
+
import { buildInstructionDoctorReportFields, instructionDoctorStatusFromIssues, } from "../shared/instruction-doctor.js";
|
|
6
|
+
import { collectGuidanceIssues, readInstructionFile } from "../shared/instruction-file.js";
|
|
7
|
+
const TOKENJUICE_AGENTLINK_FIX_COMMAND = "tokenjuice install agentlink";
|
|
8
|
+
const TOKENJUICE_AGENTLINK_SYNC_COMMAND = "agentlink sync";
|
|
9
|
+
const TOKENJUICE_AGENTLINK_BEGIN = "<!-- tokenjuice:agentlink begin -->";
|
|
10
|
+
const TOKENJUICE_AGENTLINK_END = "<!-- tokenjuice:agentlink end -->";
|
|
11
|
+
const TOKENJUICE_AGENTLINK_ADVISORY = "Agentlink support is beta and source-instruction based; Agentlink symlinks AGENTS.md into downstream tool files, but each tool still owns command execution. Run `agentlink sync` after install or uninstall.";
|
|
12
|
+
function getExplicitProjectDir(options = {}) {
|
|
13
|
+
return options.projectDir || process.env.AGENTLINK_PROJECT_DIR;
|
|
14
|
+
}
|
|
15
|
+
async function hasGitMetadata(dir) {
|
|
16
|
+
try {
|
|
17
|
+
await stat(join(dir, ".git"));
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function findGitRoot(startDir) {
|
|
25
|
+
let current = resolve(startDir);
|
|
26
|
+
while (true) {
|
|
27
|
+
if (await hasGitMetadata(current)) {
|
|
28
|
+
return current;
|
|
29
|
+
}
|
|
30
|
+
const parent = dirname(current);
|
|
31
|
+
if (parent === current) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
current = parent;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async function resolveProjectDir(options = {}) {
|
|
38
|
+
const explicitProjectDir = getExplicitProjectDir(options);
|
|
39
|
+
if (explicitProjectDir) {
|
|
40
|
+
return resolve(explicitProjectDir);
|
|
41
|
+
}
|
|
42
|
+
return (await findGitRoot(process.cwd())) ?? process.cwd();
|
|
43
|
+
}
|
|
44
|
+
function stripInlineComment(value) {
|
|
45
|
+
let quote;
|
|
46
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
47
|
+
const char = value[index];
|
|
48
|
+
if ((char === '"' || char === "'") && (index === 0 || value[index - 1] !== "\\")) {
|
|
49
|
+
quote = quote === char ? undefined : quote ?? char;
|
|
50
|
+
}
|
|
51
|
+
if (char === "#" && quote === undefined) {
|
|
52
|
+
return value.slice(0, index).trim();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return value.trim();
|
|
56
|
+
}
|
|
57
|
+
function unquoteYamlScalar(value) {
|
|
58
|
+
const trimmed = stripInlineComment(value);
|
|
59
|
+
if (trimmed.length >= 2 &&
|
|
60
|
+
((trimmed.startsWith('"') && trimmed.endsWith('"')) || (trimmed.startsWith("'") && trimmed.endsWith("'")))) {
|
|
61
|
+
return trimmed.slice(1, -1);
|
|
62
|
+
}
|
|
63
|
+
return trimmed;
|
|
64
|
+
}
|
|
65
|
+
function parseAgentlinkSourceConfig(configText) {
|
|
66
|
+
for (const line of configText.split(/\r?\n/u)) {
|
|
67
|
+
const match = /^\s*source\s*:\s*(.+?)\s*$/u.exec(line);
|
|
68
|
+
if (!match) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const source = unquoteYamlScalar(match[1] ?? "");
|
|
72
|
+
return source || undefined;
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
function isInsideOrEqual(parentDir, childPath) {
|
|
77
|
+
const relativePath = relative(parentDir, childPath);
|
|
78
|
+
return relativePath === "" || (!relativePath.startsWith("..") && !isAbsolute(relativePath));
|
|
79
|
+
}
|
|
80
|
+
function resolveAgentlinkSourcePath(projectDir, source) {
|
|
81
|
+
const sourcePath = resolve(projectDir, source);
|
|
82
|
+
if (isAbsolute(source) || source === "~" || source.startsWith("~/") || !isInsideOrEqual(projectDir, sourcePath)) {
|
|
83
|
+
throw new Error(`cannot use Agentlink source ${source}; tokenjuice only writes project .agentlink.yaml sources inside ${projectDir}`);
|
|
84
|
+
}
|
|
85
|
+
return sourcePath;
|
|
86
|
+
}
|
|
87
|
+
async function readAgentlinkConfigSource(projectDir) {
|
|
88
|
+
try {
|
|
89
|
+
const configText = await readFile(join(projectDir, ".agentlink.yaml"), "utf8");
|
|
90
|
+
return parseAgentlinkSourceConfig(configText);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function realpathExistingAncestor(path) {
|
|
97
|
+
let current = path;
|
|
98
|
+
while (true) {
|
|
99
|
+
try {
|
|
100
|
+
return await realpath(current);
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
if (error.code !== "ENOENT") {
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
const parent = dirname(current);
|
|
107
|
+
if (parent === current) {
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
current = parent;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async function resolveSafeProjectWriteTarget(filePath, projectDir) {
|
|
115
|
+
const realParentDir = await realpathExistingAncestor(dirname(filePath));
|
|
116
|
+
if (!isInsideOrEqual(projectDir, realParentDir)) {
|
|
117
|
+
throw new Error(`cannot use Agentlink source ${filePath}; tokenjuice will not write through instruction directories outside ${projectDir}`);
|
|
118
|
+
}
|
|
119
|
+
let stats;
|
|
120
|
+
try {
|
|
121
|
+
stats = await lstat(filePath);
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
if (error.code === "ENOENT") {
|
|
125
|
+
return { filePath, followedSymlink: false };
|
|
126
|
+
}
|
|
127
|
+
throw error;
|
|
128
|
+
}
|
|
129
|
+
if (!stats.isSymbolicLink()) {
|
|
130
|
+
return { filePath, followedSymlink: false };
|
|
131
|
+
}
|
|
132
|
+
const targetPath = await realpath(filePath);
|
|
133
|
+
if (!isInsideOrEqual(projectDir, targetPath)) {
|
|
134
|
+
throw new Error(`cannot use Agentlink source ${filePath}; tokenjuice will not follow instruction symlinks outside ${projectDir}`);
|
|
135
|
+
}
|
|
136
|
+
return { filePath: targetPath, followedSymlink: true };
|
|
137
|
+
}
|
|
138
|
+
async function getDefaultInstructionsTarget(options = {}) {
|
|
139
|
+
const projectDir = await resolveProjectDir(options);
|
|
140
|
+
const realProjectDir = await realpath(projectDir).catch(() => projectDir);
|
|
141
|
+
const configuredSource = await readAgentlinkConfigSource(projectDir);
|
|
142
|
+
const sourcePath = configuredSource ? resolveAgentlinkSourcePath(realProjectDir, configuredSource) : join(projectDir, "AGENTS.md");
|
|
143
|
+
const target = await resolveSafeProjectWriteTarget(sourcePath, realProjectDir);
|
|
144
|
+
return {
|
|
145
|
+
instructionsPath: target.filePath,
|
|
146
|
+
preserveEmptyFileOnUninstall: configuredSource !== undefined || target.followedSymlink,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
async function getDefaultInstructionsPath(options = {}) {
|
|
150
|
+
return (await getDefaultInstructionsTarget(options)).instructionsPath;
|
|
151
|
+
}
|
|
152
|
+
async function getDoctorFallbackInstructionsPath(options = {}) {
|
|
153
|
+
try {
|
|
154
|
+
return join(await resolveProjectDir(options), "AGENTS.md");
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return join(process.cwd(), "AGENTS.md");
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function formatErrorMessage(error) {
|
|
161
|
+
return error instanceof Error ? error.message : String(error);
|
|
162
|
+
}
|
|
163
|
+
const TOKENJUICE_AGENTLINK_BLOCK = [
|
|
164
|
+
TOKENJUICE_AGENTLINK_BEGIN,
|
|
165
|
+
"## tokenjuice terminal output compaction",
|
|
166
|
+
"",
|
|
167
|
+
...buildTokenjuiceGuidanceBullets({
|
|
168
|
+
wrapBullet: "- When Agentlink syncs this AGENTS.md into AI coding tool instruction files, prefer `tokenjuice wrap -- <command>` for terminal commands likely to produce long output.",
|
|
169
|
+
}),
|
|
170
|
+
"- After editing this source instruction file, run `agentlink sync` so downstream tool instruction files point at the updated source.",
|
|
171
|
+
TOKENJUICE_AGENTLINK_END,
|
|
172
|
+
].join("\n");
|
|
173
|
+
const TOKENJUICE_AGENTLINK_BLOCK_CONFIG = {
|
|
174
|
+
beginMarker: TOKENJUICE_AGENTLINK_BEGIN,
|
|
175
|
+
endMarker: TOKENJUICE_AGENTLINK_END,
|
|
176
|
+
block: TOKENJUICE_AGENTLINK_BLOCK,
|
|
177
|
+
};
|
|
178
|
+
function getTokenjuiceBlockText(text) {
|
|
179
|
+
const beginIndex = text.indexOf(TOKENJUICE_AGENTLINK_BEGIN);
|
|
180
|
+
if (beginIndex === -1) {
|
|
181
|
+
return "";
|
|
182
|
+
}
|
|
183
|
+
const endIndex = text.indexOf(TOKENJUICE_AGENTLINK_END, beginIndex + TOKENJUICE_AGENTLINK_BEGIN.length);
|
|
184
|
+
if (endIndex === -1) {
|
|
185
|
+
return text.slice(beginIndex);
|
|
186
|
+
}
|
|
187
|
+
return text.slice(beginIndex, endIndex + TOKENJUICE_AGENTLINK_END.length);
|
|
188
|
+
}
|
|
189
|
+
function countMarker(text, marker) {
|
|
190
|
+
return text.split(marker).length - 1;
|
|
191
|
+
}
|
|
192
|
+
function hasMalformedMarkerStructure(text, completeBlockCount) {
|
|
193
|
+
const beginCount = countMarker(text, TOKENJUICE_AGENTLINK_BEGIN);
|
|
194
|
+
const endCount = countMarker(text, TOKENJUICE_AGENTLINK_END);
|
|
195
|
+
return beginCount !== endCount || beginCount !== completeBlockCount || endCount !== completeBlockCount;
|
|
196
|
+
}
|
|
197
|
+
export async function installAgentlinkInstructions(instructionsPath, options = {}) {
|
|
198
|
+
const resolvedInstructionsPath = instructionsPath ?? (await getDefaultInstructionsPath(options));
|
|
199
|
+
const existing = await readInstructionFile(resolvedInstructionsPath);
|
|
200
|
+
const markerState = inspectMarkerDelimitedBlock(existing.text, TOKENJUICE_AGENTLINK_BLOCK_CONFIG);
|
|
201
|
+
if (existing.exists && hasMalformedMarkerStructure(existing.text, markerState.completeBlockCount)) {
|
|
202
|
+
throw new Error(`cannot safely repair malformed tokenjuice markers in ${resolvedInstructionsPath}; remove the dangling marker manually, then rerun tokenjuice install agentlink`);
|
|
203
|
+
}
|
|
204
|
+
const result = await installMarkerDelimitedBlock(resolvedInstructionsPath, TOKENJUICE_AGENTLINK_BLOCK_CONFIG);
|
|
205
|
+
return {
|
|
206
|
+
instructionsPath: result.filePath,
|
|
207
|
+
syncCommand: TOKENJUICE_AGENTLINK_SYNC_COMMAND,
|
|
208
|
+
...(result.backupPath ? { backupPath: result.backupPath } : {}),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
export async function uninstallAgentlinkInstructions(instructionsPath, options = {}) {
|
|
212
|
+
const target = instructionsPath
|
|
213
|
+
? { instructionsPath, preserveEmptyFileOnUninstall: false }
|
|
214
|
+
: await getDefaultInstructionsTarget(options);
|
|
215
|
+
const resolvedInstructionsPath = target.instructionsPath;
|
|
216
|
+
const existing = await readInstructionFile(resolvedInstructionsPath);
|
|
217
|
+
const markerState = inspectMarkerDelimitedBlock(existing.text, TOKENJUICE_AGENTLINK_BLOCK_CONFIG);
|
|
218
|
+
if (existing.exists && hasMalformedMarkerStructure(existing.text, markerState.completeBlockCount)) {
|
|
219
|
+
throw new Error(`cannot safely uninstall malformed tokenjuice markers in ${resolvedInstructionsPath}; remove the dangling marker manually, then rerun tokenjuice uninstall agentlink`);
|
|
220
|
+
}
|
|
221
|
+
if (target.preserveEmptyFileOnUninstall) {
|
|
222
|
+
const removed = removeMarkerDelimitedBlock(existing.text, TOKENJUICE_AGENTLINK_BLOCK_CONFIG);
|
|
223
|
+
if (!removed.removed) {
|
|
224
|
+
return { instructionsPath: resolvedInstructionsPath, removed: false, syncCommand: TOKENJUICE_AGENTLINK_SYNC_COMMAND };
|
|
225
|
+
}
|
|
226
|
+
await writeFile(resolvedInstructionsPath, removed.text.trim() ? `${removed.text.trim()}\n` : "", "utf8");
|
|
227
|
+
return { instructionsPath: resolvedInstructionsPath, removed: true, syncCommand: TOKENJUICE_AGENTLINK_SYNC_COMMAND };
|
|
228
|
+
}
|
|
229
|
+
const result = await uninstallMarkerDelimitedBlock(resolvedInstructionsPath, TOKENJUICE_AGENTLINK_BLOCK_CONFIG);
|
|
230
|
+
return { instructionsPath: result.filePath, removed: result.removed, syncCommand: TOKENJUICE_AGENTLINK_SYNC_COMMAND };
|
|
231
|
+
}
|
|
232
|
+
export async function doctorAgentlinkInstructions(instructionsPath, options = {}) {
|
|
233
|
+
let resolvedInstructionsPath;
|
|
234
|
+
try {
|
|
235
|
+
resolvedInstructionsPath = instructionsPath ?? (await getDefaultInstructionsPath(options));
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
return {
|
|
239
|
+
instructionsPath: await getDoctorFallbackInstructionsPath(options),
|
|
240
|
+
syncCommand: TOKENJUICE_AGENTLINK_SYNC_COMMAND,
|
|
241
|
+
...buildInstructionDoctorReportFields({
|
|
242
|
+
status: "broken",
|
|
243
|
+
issues: [`cannot resolve Agentlink instruction source: ${formatErrorMessage(error)}`],
|
|
244
|
+
advisory: TOKENJUICE_AGENTLINK_ADVISORY,
|
|
245
|
+
fixCommand: "fix .agentlink.yaml source to point inside the project, then run tokenjuice install agentlink",
|
|
246
|
+
}),
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
const existing = await readInstructionFile(resolvedInstructionsPath);
|
|
250
|
+
const markerState = inspectMarkerDelimitedBlock(existing.text, TOKENJUICE_AGENTLINK_BLOCK_CONFIG);
|
|
251
|
+
if (!existing.exists || (!markerState.hasBegin && !markerState.hasEnd)) {
|
|
252
|
+
return {
|
|
253
|
+
instructionsPath: resolvedInstructionsPath,
|
|
254
|
+
syncCommand: TOKENJUICE_AGENTLINK_SYNC_COMMAND,
|
|
255
|
+
...buildInstructionDoctorReportFields({
|
|
256
|
+
status: "disabled",
|
|
257
|
+
issues: ["tokenjuice Agentlink instructions are not installed"],
|
|
258
|
+
advisory: TOKENJUICE_AGENTLINK_ADVISORY,
|
|
259
|
+
fixCommand: TOKENJUICE_AGENTLINK_FIX_COMMAND,
|
|
260
|
+
}),
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
const markerIssues = collectMarkerDelimitedBlockIssues(markerState, {
|
|
264
|
+
configuredLabel: "Agentlink instructions",
|
|
265
|
+
repairCommand: TOKENJUICE_AGENTLINK_FIX_COMMAND,
|
|
266
|
+
});
|
|
267
|
+
const hasMalformedMarkers = hasMalformedMarkerStructure(existing.text, markerState.completeBlockCount);
|
|
268
|
+
const issues = [
|
|
269
|
+
...markerIssues,
|
|
270
|
+
...(hasMalformedMarkers && markerIssues.length === 0
|
|
271
|
+
? [
|
|
272
|
+
"configured Agentlink instructions have malformed tokenjuice markers; remove unmatched tokenjuice markers, then run tokenjuice install agentlink",
|
|
273
|
+
]
|
|
274
|
+
: []),
|
|
275
|
+
...collectGuidanceIssues(getTokenjuiceBlockText(existing.text), {
|
|
276
|
+
required: [
|
|
277
|
+
{
|
|
278
|
+
requiredText: TOKENJUICE_WRAP_COMMAND,
|
|
279
|
+
missingIssue: "configured Agentlink instructions are missing tokenjuice wrap guidance",
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
requiredText: TOKENJUICE_RAW_COMMAND,
|
|
283
|
+
missingIssue: "configured Agentlink instructions are missing the raw escape hatch",
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
requiredText: "agentlink sync",
|
|
287
|
+
missingIssue: "configured Agentlink instructions are missing sync guidance",
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
forbidden: [
|
|
291
|
+
{
|
|
292
|
+
forbiddenText: TOKENJUICE_FULL_COMMAND,
|
|
293
|
+
presentIssue: "configured Agentlink instructions still suggest the full escape hatch",
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
}),
|
|
297
|
+
];
|
|
298
|
+
return {
|
|
299
|
+
instructionsPath: resolvedInstructionsPath,
|
|
300
|
+
syncCommand: TOKENJUICE_AGENTLINK_SYNC_COMMAND,
|
|
301
|
+
...buildInstructionDoctorReportFields({
|
|
302
|
+
status: instructionDoctorStatusFromIssues(issues),
|
|
303
|
+
issues,
|
|
304
|
+
advisory: TOKENJUICE_AGENTLINK_ADVISORY,
|
|
305
|
+
fixCommand: hasMalformedMarkers
|
|
306
|
+
? "remove unmatched tokenjuice markers from AGENTS.md, then run tokenjuice install agentlink"
|
|
307
|
+
: TOKENJUICE_AGENTLINK_FIX_COMMAND,
|
|
308
|
+
}),
|
|
309
|
+
};
|
|
310
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type AgentloomRuleOptions = {
|
|
2
|
+
projectDir?: string;
|
|
3
|
+
};
|
|
4
|
+
export type InstallAgentloomRuleResult = {
|
|
5
|
+
rulePath: string;
|
|
6
|
+
backupPath?: string;
|
|
7
|
+
};
|
|
8
|
+
export type UninstallAgentloomRuleResult = {
|
|
9
|
+
rulePath: string;
|
|
10
|
+
removed: boolean;
|
|
11
|
+
syncCommand: string;
|
|
12
|
+
};
|
|
13
|
+
export type AgentloomDoctorReport = {
|
|
14
|
+
rulePath: string;
|
|
15
|
+
status: "ok" | "warn" | "broken" | "disabled";
|
|
16
|
+
issues: string[];
|
|
17
|
+
advisories: string[];
|
|
18
|
+
fixCommand: string;
|
|
19
|
+
checkedPaths: string[];
|
|
20
|
+
missingPaths: string[];
|
|
21
|
+
};
|
|
22
|
+
export declare function installAgentloomRule(rulePath?: string, options?: AgentloomRuleOptions): Promise<InstallAgentloomRuleResult>;
|
|
23
|
+
export declare function uninstallAgentloomRule(rulePath?: string, options?: AgentloomRuleOptions): Promise<UninstallAgentloomRuleResult>;
|
|
24
|
+
export declare function doctorAgentloomRule(rulePath?: string, options?: AgentloomRuleOptions): Promise<AgentloomDoctorReport>;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { stat } from "node:fs/promises";
|
|
2
|
+
import { dirname, join, resolve } from "node:path";
|
|
3
|
+
import { buildTokenjuiceGuidanceBullets, TOKENJUICE_FULL_COMMAND, TOKENJUICE_RAW_COMMAND, TOKENJUICE_WRAP_COMMAND } from "../shared/instruction-guidance.js";
|
|
4
|
+
import { collectGuidanceIssues, readInstructionFile, removeInstructionFile, writeInstructionFile } from "../shared/instruction-file.js";
|
|
5
|
+
import { buildInstructionDoctorReportFields, instructionDoctorStatusFromIssues, } from "../shared/instruction-doctor.js";
|
|
6
|
+
const TOKENJUICE_AGENTLOOM_FIX_COMMAND = "tokenjuice install agentloom";
|
|
7
|
+
const TOKENJUICE_AGENTLOOM_RULE_MARKER = "tokenjuice terminal output compaction";
|
|
8
|
+
const TOKENJUICE_AGENTLOOM_ADVISORY = "Agentloom support is beta and rule-based; run `agentloom sync` after install so provider-native configs receive the rule.";
|
|
9
|
+
function parseLeadingFrontmatter(text) {
|
|
10
|
+
const frontmatterStart = text.match(/^---\r?\n/u);
|
|
11
|
+
if (!frontmatterStart) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const endIndex = text.search(/\r?\n---(?:\r?\n|$)/u);
|
|
15
|
+
if (endIndex === -1) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const fields = new Map();
|
|
19
|
+
const frontmatter = text.slice(frontmatterStart[0].length, endIndex);
|
|
20
|
+
for (const line of frontmatter.split(/\r?\n/u)) {
|
|
21
|
+
const match = line.match(/^([A-Za-z][\w-]*):\s*(.*?)\s*$/u);
|
|
22
|
+
if (!match) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const key = match[1];
|
|
26
|
+
const rawValue = match[2];
|
|
27
|
+
if (key === undefined || rawValue === undefined) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const value = rawValue.replace(/^["']|["']$/gu, "");
|
|
31
|
+
fields.set(key.trim(), value);
|
|
32
|
+
}
|
|
33
|
+
return fields;
|
|
34
|
+
}
|
|
35
|
+
function getExplicitProjectDir(options = {}) {
|
|
36
|
+
return options.projectDir || process.env.AGENTLOOM_PROJECT_DIR;
|
|
37
|
+
}
|
|
38
|
+
async function hasGitMetadata(dir) {
|
|
39
|
+
try {
|
|
40
|
+
await stat(join(dir, ".git"));
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async function findGitRoot(startDir) {
|
|
48
|
+
let current = resolve(startDir);
|
|
49
|
+
while (true) {
|
|
50
|
+
if (await hasGitMetadata(current)) {
|
|
51
|
+
return current;
|
|
52
|
+
}
|
|
53
|
+
const parent = dirname(current);
|
|
54
|
+
if (parent === current) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
current = parent;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async function resolveProjectDir(options = {}) {
|
|
61
|
+
const explicitProjectDir = getExplicitProjectDir(options);
|
|
62
|
+
if (explicitProjectDir) {
|
|
63
|
+
return resolve(explicitProjectDir);
|
|
64
|
+
}
|
|
65
|
+
return (await findGitRoot(process.cwd())) ?? process.cwd();
|
|
66
|
+
}
|
|
67
|
+
async function getDefaultRulePath(options = {}) {
|
|
68
|
+
return join(await resolveProjectDir(options), ".agents", "rules", "tokenjuice-agentloom.md");
|
|
69
|
+
}
|
|
70
|
+
const TOKENJUICE_AGENTLOOM_RULE = [
|
|
71
|
+
"---",
|
|
72
|
+
`name: ${TOKENJUICE_AGENTLOOM_RULE_MARKER}`,
|
|
73
|
+
`description: ${TOKENJUICE_AGENTLOOM_RULE_MARKER}`,
|
|
74
|
+
"alwaysApply: true",
|
|
75
|
+
"---",
|
|
76
|
+
"",
|
|
77
|
+
"# tokenjuice terminal output compaction",
|
|
78
|
+
"",
|
|
79
|
+
...buildTokenjuiceGuidanceBullets({
|
|
80
|
+
wrapBullet: `- When Agentloom syncs this rule into provider-native coding-agent configs, prefer \`${TOKENJUICE_WRAP_COMMAND}\` for terminal commands likely to produce long output.`,
|
|
81
|
+
}),
|
|
82
|
+
"- After editing this source rule, run `agentloom sync` so provider-native configs receive the updated guidance.",
|
|
83
|
+
"",
|
|
84
|
+
].join("\n");
|
|
85
|
+
export async function installAgentloomRule(rulePath, options = {}) {
|
|
86
|
+
const resolvedRulePath = rulePath ?? (await getDefaultRulePath(options));
|
|
87
|
+
const existing = await readInstructionFile(resolvedRulePath);
|
|
88
|
+
if (existing.exists && existing.text === TOKENJUICE_AGENTLOOM_RULE) {
|
|
89
|
+
return { rulePath: resolvedRulePath };
|
|
90
|
+
}
|
|
91
|
+
const result = await writeInstructionFile(resolvedRulePath, TOKENJUICE_AGENTLOOM_RULE);
|
|
92
|
+
return {
|
|
93
|
+
rulePath: result.filePath,
|
|
94
|
+
...(result.backupPath ? { backupPath: result.backupPath } : {}),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export async function uninstallAgentloomRule(rulePath, options = {}) {
|
|
98
|
+
const resolvedRulePath = rulePath ?? (await getDefaultRulePath(options));
|
|
99
|
+
const result = await removeInstructionFile(resolvedRulePath);
|
|
100
|
+
return { rulePath: result.filePath, removed: result.removed, syncCommand: "agentloom sync" };
|
|
101
|
+
}
|
|
102
|
+
export async function doctorAgentloomRule(rulePath, options = {}) {
|
|
103
|
+
const resolvedRulePath = rulePath ?? (await getDefaultRulePath(options));
|
|
104
|
+
const existing = await readInstructionFile(resolvedRulePath);
|
|
105
|
+
if (!existing.exists) {
|
|
106
|
+
return {
|
|
107
|
+
rulePath: resolvedRulePath,
|
|
108
|
+
...buildInstructionDoctorReportFields({
|
|
109
|
+
status: "disabled",
|
|
110
|
+
issues: ["tokenjuice Agentloom rule is not installed"],
|
|
111
|
+
advisory: TOKENJUICE_AGENTLOOM_ADVISORY,
|
|
112
|
+
fixCommand: TOKENJUICE_AGENTLOOM_FIX_COMMAND,
|
|
113
|
+
}),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
const issues = collectGuidanceIssues(existing.text, {
|
|
117
|
+
required: [
|
|
118
|
+
{
|
|
119
|
+
requiredText: TOKENJUICE_AGENTLOOM_RULE_MARKER,
|
|
120
|
+
missingIssue: "configured Agentloom rule file does not look like the tokenjuice rule",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
requiredText: TOKENJUICE_WRAP_COMMAND,
|
|
124
|
+
missingIssue: "configured Agentloom rule file is missing tokenjuice wrap guidance",
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
requiredText: TOKENJUICE_RAW_COMMAND,
|
|
128
|
+
missingIssue: "configured Agentloom rule file is missing the raw escape hatch",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
requiredText: "agentloom sync",
|
|
132
|
+
missingIssue: "configured Agentloom rule file is missing sync guidance",
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
forbidden: [
|
|
136
|
+
{
|
|
137
|
+
forbiddenText: TOKENJUICE_FULL_COMMAND,
|
|
138
|
+
presentIssue: "configured Agentloom rule file still suggests the full escape hatch",
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
});
|
|
142
|
+
const frontmatter = parseLeadingFrontmatter(existing.text);
|
|
143
|
+
if (frontmatter?.get("name") !== TOKENJUICE_AGENTLOOM_RULE_MARKER) {
|
|
144
|
+
issues.push("configured Agentloom rule file is missing required name frontmatter");
|
|
145
|
+
}
|
|
146
|
+
if (frontmatter?.get("description") !== TOKENJUICE_AGENTLOOM_RULE_MARKER) {
|
|
147
|
+
issues.push("configured Agentloom rule file is missing description frontmatter");
|
|
148
|
+
}
|
|
149
|
+
if (frontmatter?.get("alwaysApply") !== "true") {
|
|
150
|
+
issues.push("configured Agentloom rule file is missing alwaysApply frontmatter");
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
rulePath: resolvedRulePath,
|
|
154
|
+
...buildInstructionDoctorReportFields({
|
|
155
|
+
status: instructionDoctorStatusFromIssues(issues),
|
|
156
|
+
issues,
|
|
157
|
+
advisory: TOKENJUICE_AGENTLOOM_ADVISORY,
|
|
158
|
+
fixCommand: TOKENJUICE_AGENTLOOM_FIX_COMMAND,
|
|
159
|
+
}),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type AgentsCliMemoryOptions = {
|
|
2
|
+
configDir?: string;
|
|
3
|
+
};
|
|
4
|
+
export type InstallAgentsCliMemoryResult = {
|
|
5
|
+
instructionsPath: string;
|
|
6
|
+
backupPath?: string;
|
|
7
|
+
syncCommand: string;
|
|
8
|
+
};
|
|
9
|
+
export type UninstallAgentsCliMemoryResult = {
|
|
10
|
+
instructionsPath: string;
|
|
11
|
+
removed: boolean;
|
|
12
|
+
syncCommand: string;
|
|
13
|
+
};
|
|
14
|
+
export type AgentsCliDoctorReport = {
|
|
15
|
+
instructionsPath: string;
|
|
16
|
+
syncCommand: string;
|
|
17
|
+
status: "ok" | "warn" | "broken" | "disabled";
|
|
18
|
+
issues: string[];
|
|
19
|
+
advisories: string[];
|
|
20
|
+
fixCommand: string;
|
|
21
|
+
checkedPaths: string[];
|
|
22
|
+
missingPaths: string[];
|
|
23
|
+
};
|
|
24
|
+
export declare function installAgentsCliMemory(instructionsPath?: string, options?: AgentsCliMemoryOptions): Promise<InstallAgentsCliMemoryResult>;
|
|
25
|
+
export declare function uninstallAgentsCliMemory(instructionsPath?: string, options?: AgentsCliMemoryOptions): Promise<UninstallAgentsCliMemoryResult>;
|
|
26
|
+
export declare function doctorAgentsCliMemory(instructionsPath?: string, options?: AgentsCliMemoryOptions): Promise<AgentsCliDoctorReport>;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { homedir } from "node:os";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
|
+
import { collectMarkerDelimitedBlockIssues, inspectMarkerDelimitedBlock, installMarkerDelimitedBlock, uninstallMarkerDelimitedBlock, } from "../shared/marker-instructions.js";
|
|
4
|
+
import { buildTokenjuiceGuidanceBullets, TOKENJUICE_FULL_COMMAND, TOKENJUICE_RAW_COMMAND, TOKENJUICE_WRAP_COMMAND, } from "../shared/instruction-guidance.js";
|
|
5
|
+
import { buildInstructionDoctorReportFields, instructionDoctorStatusFromIssues, } from "../shared/instruction-doctor.js";
|
|
6
|
+
import { collectGuidanceIssues, readInstructionFile } from "../shared/instruction-file.js";
|
|
7
|
+
const TOKENJUICE_AGENTS_CLI_FIX_COMMAND = "tokenjuice install agents-cli";
|
|
8
|
+
const TOKENJUICE_AGENTS_CLI_BEGIN = "<!-- tokenjuice:agents-cli begin -->";
|
|
9
|
+
const TOKENJUICE_AGENTS_CLI_END = "<!-- tokenjuice:agents-cli end -->";
|
|
10
|
+
const TOKENJUICE_AGENTS_CLI_ADVISORY = "agents-cli support is beta and memory-based; agents-cli syncs memory into downstream harness configs, but each harness still owns command execution.";
|
|
11
|
+
function getAgentsCliConfigDir(options = {}) {
|
|
12
|
+
return resolve(options.configDir || process.env.AGENTS_CLI_HOME || join(homedir(), ".agents"));
|
|
13
|
+
}
|
|
14
|
+
function getDefaultInstructionsPath(options = {}) {
|
|
15
|
+
return join(getAgentsCliConfigDir(options), "memory", "AGENTS.md");
|
|
16
|
+
}
|
|
17
|
+
const TOKENJUICE_AGENTS_CLI_BLOCK = [
|
|
18
|
+
TOKENJUICE_AGENTS_CLI_BEGIN,
|
|
19
|
+
"## tokenjuice terminal output compaction",
|
|
20
|
+
"",
|
|
21
|
+
...buildTokenjuiceGuidanceBullets({
|
|
22
|
+
wrapBullet: "- When agents-cli syncs this memory into coding-agent harnesses, prefer `tokenjuice wrap -- <command>` for terminal commands likely to produce long output.",
|
|
23
|
+
}),
|
|
24
|
+
"- After editing this memory file, run `agents sync` so downstream harness configs receive the updated guidance.",
|
|
25
|
+
TOKENJUICE_AGENTS_CLI_END,
|
|
26
|
+
].join("\n");
|
|
27
|
+
const TOKENJUICE_AGENTS_CLI_BLOCK_CONFIG = {
|
|
28
|
+
beginMarker: TOKENJUICE_AGENTS_CLI_BEGIN,
|
|
29
|
+
endMarker: TOKENJUICE_AGENTS_CLI_END,
|
|
30
|
+
block: TOKENJUICE_AGENTS_CLI_BLOCK,
|
|
31
|
+
};
|
|
32
|
+
function getTokenjuiceBlockText(text) {
|
|
33
|
+
const beginIndex = text.indexOf(TOKENJUICE_AGENTS_CLI_BEGIN);
|
|
34
|
+
if (beginIndex === -1) {
|
|
35
|
+
return "";
|
|
36
|
+
}
|
|
37
|
+
const endIndex = text.indexOf(TOKENJUICE_AGENTS_CLI_END, beginIndex + TOKENJUICE_AGENTS_CLI_BEGIN.length);
|
|
38
|
+
if (endIndex === -1) {
|
|
39
|
+
return text.slice(beginIndex);
|
|
40
|
+
}
|
|
41
|
+
return text.slice(beginIndex, endIndex + TOKENJUICE_AGENTS_CLI_END.length);
|
|
42
|
+
}
|
|
43
|
+
function countMarker(text, marker) {
|
|
44
|
+
return text.split(marker).length - 1;
|
|
45
|
+
}
|
|
46
|
+
function hasMalformedMarkerStructure(text, completeBlockCount) {
|
|
47
|
+
const beginCount = countMarker(text, TOKENJUICE_AGENTS_CLI_BEGIN);
|
|
48
|
+
const endCount = countMarker(text, TOKENJUICE_AGENTS_CLI_END);
|
|
49
|
+
return beginCount !== endCount || beginCount !== completeBlockCount || endCount !== completeBlockCount;
|
|
50
|
+
}
|
|
51
|
+
export async function installAgentsCliMemory(instructionsPath, options = {}) {
|
|
52
|
+
const resolvedInstructionsPath = instructionsPath ?? getDefaultInstructionsPath(options);
|
|
53
|
+
const existing = await readInstructionFile(resolvedInstructionsPath);
|
|
54
|
+
const markerState = inspectMarkerDelimitedBlock(existing.text, TOKENJUICE_AGENTS_CLI_BLOCK_CONFIG);
|
|
55
|
+
if (existing.exists && hasMalformedMarkerStructure(existing.text, markerState.completeBlockCount)) {
|
|
56
|
+
throw new Error(`cannot safely repair malformed tokenjuice markers in ${resolvedInstructionsPath}; remove the dangling marker manually, then rerun tokenjuice install agents-cli`);
|
|
57
|
+
}
|
|
58
|
+
const result = await installMarkerDelimitedBlock(resolvedInstructionsPath, TOKENJUICE_AGENTS_CLI_BLOCK_CONFIG);
|
|
59
|
+
return {
|
|
60
|
+
instructionsPath: result.filePath,
|
|
61
|
+
syncCommand: "agents sync",
|
|
62
|
+
...(result.backupPath ? { backupPath: result.backupPath } : {}),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export async function uninstallAgentsCliMemory(instructionsPath, options = {}) {
|
|
66
|
+
const resolvedInstructionsPath = instructionsPath ?? getDefaultInstructionsPath(options);
|
|
67
|
+
const existing = await readInstructionFile(resolvedInstructionsPath);
|
|
68
|
+
const markerState = inspectMarkerDelimitedBlock(existing.text, TOKENJUICE_AGENTS_CLI_BLOCK_CONFIG);
|
|
69
|
+
if (existing.exists && hasMalformedMarkerStructure(existing.text, markerState.completeBlockCount)) {
|
|
70
|
+
throw new Error(`cannot safely uninstall malformed tokenjuice markers in ${resolvedInstructionsPath}; remove the dangling marker manually, then rerun tokenjuice uninstall agents-cli`);
|
|
71
|
+
}
|
|
72
|
+
const result = await uninstallMarkerDelimitedBlock(resolvedInstructionsPath, TOKENJUICE_AGENTS_CLI_BLOCK_CONFIG);
|
|
73
|
+
return { instructionsPath: result.filePath, removed: result.removed, syncCommand: "agents sync" };
|
|
74
|
+
}
|
|
75
|
+
export async function doctorAgentsCliMemory(instructionsPath, options = {}) {
|
|
76
|
+
const resolvedInstructionsPath = instructionsPath ?? getDefaultInstructionsPath(options);
|
|
77
|
+
const existing = await readInstructionFile(resolvedInstructionsPath);
|
|
78
|
+
const markerState = inspectMarkerDelimitedBlock(existing.text, TOKENJUICE_AGENTS_CLI_BLOCK_CONFIG);
|
|
79
|
+
if (!existing.exists || (!markerState.hasBegin && !markerState.hasEnd)) {
|
|
80
|
+
return {
|
|
81
|
+
instructionsPath: resolvedInstructionsPath,
|
|
82
|
+
syncCommand: "agents sync",
|
|
83
|
+
...buildInstructionDoctorReportFields({
|
|
84
|
+
status: "disabled",
|
|
85
|
+
issues: ["tokenjuice agents-cli memory is not installed"],
|
|
86
|
+
advisory: TOKENJUICE_AGENTS_CLI_ADVISORY,
|
|
87
|
+
fixCommand: TOKENJUICE_AGENTS_CLI_FIX_COMMAND,
|
|
88
|
+
}),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const markerIssues = collectMarkerDelimitedBlockIssues(markerState, {
|
|
92
|
+
configuredLabel: "agents-cli memory",
|
|
93
|
+
repairCommand: TOKENJUICE_AGENTS_CLI_FIX_COMMAND,
|
|
94
|
+
});
|
|
95
|
+
const hasMalformedMarkers = hasMalformedMarkerStructure(existing.text, markerState.completeBlockCount);
|
|
96
|
+
const issues = [
|
|
97
|
+
...markerIssues,
|
|
98
|
+
...(hasMalformedMarkers && markerIssues.length === 0
|
|
99
|
+
? ["configured agents-cli memory has malformed tokenjuice markers; remove unmatched tokenjuice markers, then run tokenjuice install agents-cli"]
|
|
100
|
+
: []),
|
|
101
|
+
...collectGuidanceIssues(getTokenjuiceBlockText(existing.text), {
|
|
102
|
+
required: [
|
|
103
|
+
{
|
|
104
|
+
requiredText: TOKENJUICE_WRAP_COMMAND,
|
|
105
|
+
missingIssue: "configured agents-cli memory is missing tokenjuice wrap guidance",
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
requiredText: TOKENJUICE_RAW_COMMAND,
|
|
109
|
+
missingIssue: "configured agents-cli memory is missing the raw escape hatch",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
requiredText: "agents sync",
|
|
113
|
+
missingIssue: "configured agents-cli memory is missing sync guidance",
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
forbidden: [
|
|
117
|
+
{
|
|
118
|
+
forbiddenText: TOKENJUICE_FULL_COMMAND,
|
|
119
|
+
presentIssue: "configured agents-cli memory still suggests the full escape hatch",
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
}),
|
|
123
|
+
];
|
|
124
|
+
return {
|
|
125
|
+
instructionsPath: resolvedInstructionsPath,
|
|
126
|
+
syncCommand: "agents sync",
|
|
127
|
+
...buildInstructionDoctorReportFields({
|
|
128
|
+
status: instructionDoctorStatusFromIssues(issues),
|
|
129
|
+
issues,
|
|
130
|
+
advisory: TOKENJUICE_AGENTS_CLI_ADVISORY,
|
|
131
|
+
fixCommand: hasMalformedMarkers
|
|
132
|
+
? "remove unmatched tokenjuice markers from agents-cli memory, then run tokenjuice install agents-cli"
|
|
133
|
+
: TOKENJUICE_AGENTS_CLI_FIX_COMMAND,
|
|
134
|
+
}),
|
|
135
|
+
};
|
|
136
|
+
}
|