@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,469 @@
|
|
|
1
|
+
import { chmod, lstat, mkdir, mkdtemp, rename, rm, writeFile } from "node:fs/promises";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
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_TABBY_FIX_COMMAND = "tokenjuice install tabby";
|
|
8
|
+
const TOKENJUICE_TABBY_BEGIN = "# tokenjuice:tabby begin";
|
|
9
|
+
const TOKENJUICE_TABBY_END = "# tokenjuice:tabby end";
|
|
10
|
+
const TOKENJUICE_TABBY_ADVISORY = "Tabby support is beta and system-prompt based; it guides answer behavior through ~/.tabby/config.toml but does not intercept tool output.";
|
|
11
|
+
const TOML_ANSWER_KEY = String.raw `(?:"answer"|'answer'|answer)`;
|
|
12
|
+
const TOML_SYSTEM_PROMPT_KEY = String.raw `(?:"system_prompt"|'system_prompt'|system_prompt)`;
|
|
13
|
+
const DOTTED_ANSWER_KEY_PATTERN = new RegExp(String.raw `^\s*${TOML_ANSWER_KEY}\s*\.\s*(?:"[^"]+"|'[^']+'|[^=\s]+)\s*=`, "u");
|
|
14
|
+
const DOTTED_SYSTEM_PROMPT_PATTERN = new RegExp(String.raw `^\s*${TOML_ANSWER_KEY}\s*\.\s*${TOML_SYSTEM_PROMPT_KEY}(?:\s*=|\s*\.)`, "u");
|
|
15
|
+
const ANSWER_SYSTEM_PROMPT_TABLE_PATTERN = new RegExp(String.raw `^\s*\[\[?\s*${TOML_ANSWER_KEY}\s*\.\s*${TOML_SYSTEM_PROMPT_KEY}(?:\s*[\].])`, "u");
|
|
16
|
+
const INLINE_ANSWER_TABLE_PATTERN = new RegExp(String.raw `^\s*${TOML_ANSWER_KEY}\s*=\s*\{`, "u");
|
|
17
|
+
const ROOT_ANSWER_ASSIGNMENT_PATTERN = new RegExp(String.raw `^\s*${TOML_ANSWER_KEY}\s*=`, "u");
|
|
18
|
+
const ANSWER_ARRAY_TABLE_PATTERN = new RegExp(String.raw `^\s*\[\[\s*${TOML_ANSWER_KEY}\s*\]\]`, "u");
|
|
19
|
+
const SYSTEM_PROMPT_NAMESPACE_PATTERN = new RegExp(String.raw `^\s*${TOML_SYSTEM_PROMPT_KEY}(?:\s*=|\s*\.)`, "u");
|
|
20
|
+
function getTabbyConfigDir(options = {}) {
|
|
21
|
+
return resolve(options.configDir || process.env.TABBY_CONFIG_DIR || process.env.TABBY_ROOT || process.env.TABBY_HOME || join(homedir(), ".tabby"));
|
|
22
|
+
}
|
|
23
|
+
function getDefaultConfigPath(options = {}) {
|
|
24
|
+
return join(getTabbyConfigDir(options), "config.toml");
|
|
25
|
+
}
|
|
26
|
+
async function findTabbyConfigSymlink(configPath, includeInstallSidecars = false) {
|
|
27
|
+
const candidates = [
|
|
28
|
+
{ label: "config directory", path: dirname(configPath) },
|
|
29
|
+
{ label: "config file", path: configPath },
|
|
30
|
+
...(includeInstallSidecars
|
|
31
|
+
? [
|
|
32
|
+
{ label: "config backup", path: `${configPath}.bak` },
|
|
33
|
+
{ label: "config sidecar", path: `${configPath}.tmp` },
|
|
34
|
+
]
|
|
35
|
+
: []),
|
|
36
|
+
];
|
|
37
|
+
for (const candidate of candidates) {
|
|
38
|
+
try {
|
|
39
|
+
const stats = await lstat(candidate.path);
|
|
40
|
+
if (stats.isSymbolicLink()) {
|
|
41
|
+
return candidate;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if (!["ENOENT", "ENOTDIR"].includes(error.code ?? "")) {
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
async function assertNoTabbyConfigSymlink(configPath, operation, includeInstallSidecars = false) {
|
|
53
|
+
const symlink = await findTabbyConfigSymlink(configPath, includeInstallSidecars);
|
|
54
|
+
if (symlink) {
|
|
55
|
+
throw new Error(`cannot safely ${operation} Tabby config through symlinked ${symlink.label} ${symlink.path}; replace it with a regular path, then rerun tokenjuice ${operation} tabby`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async function getExistingFileMode(filePath, existing) {
|
|
59
|
+
if (!existing.exists) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
return (await lstat(filePath)).mode & 0o777;
|
|
63
|
+
}
|
|
64
|
+
async function writeTabbyConfigAtomically(filePath, text, mode) {
|
|
65
|
+
const fileMode = mode ?? 0o600;
|
|
66
|
+
await mkdir(dirname(filePath), { recursive: true, mode: 0o700 });
|
|
67
|
+
const tempDir = await mkdtemp(join(dirname(filePath), ".tokenjuice-"));
|
|
68
|
+
const tempPath = join(tempDir, "write");
|
|
69
|
+
try {
|
|
70
|
+
await writeFile(tempPath, text, { encoding: "utf8", flag: "wx", mode: fileMode });
|
|
71
|
+
await chmod(tempPath, fileMode);
|
|
72
|
+
await rename(tempPath, filePath);
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async function chooseTabbyBackupPath(filePath) {
|
|
79
|
+
for (let index = 0;; index += 1) {
|
|
80
|
+
const candidate = index === 0 ? `${filePath}.bak` : `${filePath}.bak.${index}`;
|
|
81
|
+
try {
|
|
82
|
+
const stats = await lstat(candidate);
|
|
83
|
+
if (stats.isSymbolicLink()) {
|
|
84
|
+
throw new Error(`cannot safely install Tabby config through symlinked config backup ${candidate}; replace it with a regular path, then rerun tokenjuice install tabby`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
if (error.code === "ENOENT") {
|
|
89
|
+
return candidate;
|
|
90
|
+
}
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async function writeTabbyConfigFile(filePath, text, existing) {
|
|
96
|
+
const mode = await getExistingFileMode(filePath, existing);
|
|
97
|
+
let backupPath;
|
|
98
|
+
if (existing.exists) {
|
|
99
|
+
backupPath = await chooseTabbyBackupPath(filePath);
|
|
100
|
+
await writeFile(backupPath, existing.text, { encoding: "utf8", flag: "wx", mode: mode ?? 0o600 });
|
|
101
|
+
await chmod(backupPath, mode ?? 0o600);
|
|
102
|
+
}
|
|
103
|
+
await writeTabbyConfigAtomically(filePath, text, mode);
|
|
104
|
+
return {
|
|
105
|
+
configPath: filePath,
|
|
106
|
+
...(backupPath ? { backupPath } : {}),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function getStructuralMarkerLines(text, marker) {
|
|
110
|
+
const lines = text.split("\n");
|
|
111
|
+
const structureLines = getTomlStructureLines(lines);
|
|
112
|
+
return {
|
|
113
|
+
lines,
|
|
114
|
+
markerLines: structureLines.flatMap((line, index) => (line.trim() === marker ? [index] : [])),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function findTokenjuiceBlockLineRange(text) {
|
|
118
|
+
const begin = getStructuralMarkerLines(text, TOKENJUICE_TABBY_BEGIN);
|
|
119
|
+
const end = getStructuralMarkerLines(text, TOKENJUICE_TABBY_END);
|
|
120
|
+
if (begin.markerLines.length !== 1 || end.markerLines.length !== 1 || end.markerLines[0] < begin.markerLines[0]) {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
lines: begin.lines,
|
|
125
|
+
start: begin.markerLines[0],
|
|
126
|
+
end: end.markerLines[0] + 1,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function hasUnsafeMarkerStructure(text) {
|
|
130
|
+
const begin = getStructuralMarkerLines(text, TOKENJUICE_TABBY_BEGIN);
|
|
131
|
+
const end = getStructuralMarkerLines(text, TOKENJUICE_TABBY_END);
|
|
132
|
+
const beginCount = begin.markerLines.length;
|
|
133
|
+
const endCount = end.markerLines.length;
|
|
134
|
+
return beginCount !== endCount || beginCount > 1 || endCount > 1 || (beginCount === 1 && end.markerLines[0] < begin.markerLines[0]);
|
|
135
|
+
}
|
|
136
|
+
function hasStructuralTokenjuiceMarker(text) {
|
|
137
|
+
return getStructuralMarkerLines(text, TOKENJUICE_TABBY_BEGIN).markerLines.length > 0 || getStructuralMarkerLines(text, TOKENJUICE_TABBY_END).markerLines.length > 0;
|
|
138
|
+
}
|
|
139
|
+
function hasTokenjuiceBlock(text) {
|
|
140
|
+
return Boolean(findTokenjuiceBlockLineRange(text));
|
|
141
|
+
}
|
|
142
|
+
function getTokenjuiceBlockText(text) {
|
|
143
|
+
const range = findTokenjuiceBlockLineRange(text);
|
|
144
|
+
if (!range) {
|
|
145
|
+
return "";
|
|
146
|
+
}
|
|
147
|
+
return range.lines.slice(range.start, range.end).join("\n");
|
|
148
|
+
}
|
|
149
|
+
function removeTokenjuiceBlock(text) {
|
|
150
|
+
const range = findTokenjuiceBlockLineRange(text);
|
|
151
|
+
if (!range) {
|
|
152
|
+
return { text, removed: false };
|
|
153
|
+
}
|
|
154
|
+
const before = range.lines.slice(0, range.start);
|
|
155
|
+
const after = range.lines.slice(range.end);
|
|
156
|
+
const needsBoundaryBlank = before.length > 0 && after.length > 0 && before.at(-1) !== "" && after[0] !== "";
|
|
157
|
+
const next = [...before, ...(needsBoundaryBlank ? [""] : []), ...after];
|
|
158
|
+
return {
|
|
159
|
+
text: next.join("\n"),
|
|
160
|
+
removed: true,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function readTableName(line) {
|
|
164
|
+
const match = /^\s*\[([^\]\n]+)\]\s*(?:#.*)?$/u.exec(line);
|
|
165
|
+
const name = match?.[1]?.trim();
|
|
166
|
+
if (name === '"answer"' || name === "'answer'") {
|
|
167
|
+
return "answer";
|
|
168
|
+
}
|
|
169
|
+
return name;
|
|
170
|
+
}
|
|
171
|
+
function isEscaped(text, index) {
|
|
172
|
+
let slashCount = 0;
|
|
173
|
+
for (let cursor = index - 1; cursor >= 0 && text[cursor] === "\\"; cursor -= 1) {
|
|
174
|
+
slashCount += 1;
|
|
175
|
+
}
|
|
176
|
+
return slashCount % 2 === 1;
|
|
177
|
+
}
|
|
178
|
+
function findTomlMultilineClose(line, delimiter, fromIndex) {
|
|
179
|
+
let searchIndex = fromIndex;
|
|
180
|
+
while (searchIndex < line.length) {
|
|
181
|
+
const closeIndex = line.indexOf(delimiter, searchIndex);
|
|
182
|
+
if (closeIndex === -1) {
|
|
183
|
+
return -1;
|
|
184
|
+
}
|
|
185
|
+
if (delimiter === "'''" || !isEscaped(line, closeIndex)) {
|
|
186
|
+
return closeIndex;
|
|
187
|
+
}
|
|
188
|
+
searchIndex = closeIndex + 1;
|
|
189
|
+
}
|
|
190
|
+
return -1;
|
|
191
|
+
}
|
|
192
|
+
function updateTomlMultilineState(line, state) {
|
|
193
|
+
let index = 0;
|
|
194
|
+
let inBasicString = false;
|
|
195
|
+
let inLiteralString = false;
|
|
196
|
+
while (index < line.length) {
|
|
197
|
+
if (state.delimiter) {
|
|
198
|
+
const closeIndex = findTomlMultilineClose(line, state.delimiter, index);
|
|
199
|
+
if (closeIndex === -1) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
index = closeIndex + state.delimiter.length;
|
|
203
|
+
state.delimiter = undefined;
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
const next = line.slice(index, index + 3);
|
|
207
|
+
const char = line[index];
|
|
208
|
+
if (inBasicString) {
|
|
209
|
+
if (char === "\"" && !isEscaped(line, index)) {
|
|
210
|
+
inBasicString = false;
|
|
211
|
+
}
|
|
212
|
+
index += 1;
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
if (inLiteralString) {
|
|
216
|
+
if (char === "'") {
|
|
217
|
+
inLiteralString = false;
|
|
218
|
+
}
|
|
219
|
+
index += 1;
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
if (char === "#") {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (next === "\"\"\"" || next === "'''") {
|
|
226
|
+
const closeIndex = findTomlMultilineClose(line, next, index + next.length);
|
|
227
|
+
if (closeIndex === -1) {
|
|
228
|
+
state.delimiter = next;
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
index = closeIndex + next.length;
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
if (char === "\"") {
|
|
235
|
+
inBasicString = true;
|
|
236
|
+
}
|
|
237
|
+
else if (char === "'") {
|
|
238
|
+
inLiteralString = true;
|
|
239
|
+
}
|
|
240
|
+
index += 1;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
function getTomlStructureLines(lines) {
|
|
244
|
+
const state = { delimiter: undefined };
|
|
245
|
+
return lines.map((line) => {
|
|
246
|
+
const structuralLine = state.delimiter ? "" : line;
|
|
247
|
+
updateTomlMultilineState(line, state);
|
|
248
|
+
return structuralLine;
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
function isTomlTableHeader(line) {
|
|
252
|
+
return /^\s*(?:\[[^\]\n]+\]|\[\[[^\]\n]+\]\])\s*(?:#.*)?$/u.test(line);
|
|
253
|
+
}
|
|
254
|
+
function findAnswerTableRange(lines) {
|
|
255
|
+
const structureLines = getTomlStructureLines(lines);
|
|
256
|
+
const start = structureLines.findIndex((line) => readTableName(line) === "answer");
|
|
257
|
+
if (start === -1) {
|
|
258
|
+
return undefined;
|
|
259
|
+
}
|
|
260
|
+
const nextTableOffset = structureLines.slice(start + 1).findIndex((line) => isTomlTableHeader(line));
|
|
261
|
+
return {
|
|
262
|
+
start,
|
|
263
|
+
end: nextTableOffset === -1 ? lines.length : start + 1 + nextTableOffset,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function getRootLines(lines) {
|
|
267
|
+
const structureLines = getTomlStructureLines(lines);
|
|
268
|
+
const firstTableIndex = structureLines.findIndex((line) => isTomlTableHeader(line));
|
|
269
|
+
return firstTableIndex === -1 ? structureLines : structureLines.slice(0, firstTableIndex);
|
|
270
|
+
}
|
|
271
|
+
function hasUserOwnedSystemPrompt(text) {
|
|
272
|
+
const lines = text.split("\n");
|
|
273
|
+
const structureLines = getTomlStructureLines(lines);
|
|
274
|
+
if (getRootLines(lines).some((line) => DOTTED_SYSTEM_PROMPT_PATTERN.test(line)) || structureLines.some((line) => ANSWER_SYSTEM_PROMPT_TABLE_PATTERN.test(line))) {
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
const range = findAnswerTableRange(lines);
|
|
278
|
+
if (!range) {
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
return structureLines.slice(range.start + 1, range.end).some((line) => SYSTEM_PROMPT_NAMESPACE_PATTERN.test(line));
|
|
282
|
+
}
|
|
283
|
+
function hasDottedAnswerKey(text) {
|
|
284
|
+
return getRootLines(text.split("\n")).some((line) => DOTTED_ANSWER_KEY_PATTERN.test(line));
|
|
285
|
+
}
|
|
286
|
+
function hasInlineAnswerTable(text) {
|
|
287
|
+
return getRootLines(text.split("\n")).some((line) => INLINE_ANSWER_TABLE_PATTERN.test(line));
|
|
288
|
+
}
|
|
289
|
+
function hasRootAnswerAssignment(text) {
|
|
290
|
+
return getRootLines(text.split("\n")).some((line) => ROOT_ANSWER_ASSIGNMENT_PATTERN.test(line));
|
|
291
|
+
}
|
|
292
|
+
function hasAnswerArrayTable(text) {
|
|
293
|
+
return getTomlStructureLines(text.split("\n")).some((line) => ANSWER_ARRAY_TABLE_PATTERN.test(line));
|
|
294
|
+
}
|
|
295
|
+
const TOKENJUICE_TABBY_PROMPT = [
|
|
296
|
+
"tokenjuice terminal output compaction",
|
|
297
|
+
"",
|
|
298
|
+
...buildTokenjuiceGuidanceBullets({
|
|
299
|
+
wrapBullet: "- When asking Tabby to run or suggest terminal commands, prefer `tokenjuice wrap -- <command>` for commands likely to produce long output.",
|
|
300
|
+
}),
|
|
301
|
+
].join("\n");
|
|
302
|
+
function createSystemPromptBlock(mode) {
|
|
303
|
+
return [
|
|
304
|
+
TOKENJUICE_TABBY_BEGIN,
|
|
305
|
+
`${mode === "dotted" ? "answer.system_prompt" : "system_prompt"} = """`,
|
|
306
|
+
TOKENJUICE_TABBY_PROMPT,
|
|
307
|
+
"\"\"\"",
|
|
308
|
+
TOKENJUICE_TABBY_END,
|
|
309
|
+
].join("\n");
|
|
310
|
+
}
|
|
311
|
+
function installTokenjuiceBlock(text) {
|
|
312
|
+
const withoutTokenjuice = removeTokenjuiceBlock(text).text.trimEnd();
|
|
313
|
+
const lines = withoutTokenjuice ? withoutTokenjuice.split("\n") : [];
|
|
314
|
+
const answerRange = findAnswerTableRange(lines);
|
|
315
|
+
if (!answerRange) {
|
|
316
|
+
if (!hasDottedAnswerKey(withoutTokenjuice)) {
|
|
317
|
+
return `${withoutTokenjuice}${withoutTokenjuice ? "\n\n" : ""}[answer]\n${createSystemPromptBlock("table")}\n`;
|
|
318
|
+
}
|
|
319
|
+
const structureLines = getTomlStructureLines(lines);
|
|
320
|
+
const firstTableIndex = structureLines.findIndex((line) => isTomlTableHeader(line));
|
|
321
|
+
if (firstTableIndex === -1) {
|
|
322
|
+
return `${withoutTokenjuice}${withoutTokenjuice ? "\n\n" : ""}${createSystemPromptBlock("dotted")}\n`;
|
|
323
|
+
}
|
|
324
|
+
const before = lines.slice(0, firstTableIndex).join("\n").trimEnd();
|
|
325
|
+
const after = lines.slice(firstTableIndex).join("\n").trimStart();
|
|
326
|
+
return `${before}${before ? "\n\n" : ""}${createSystemPromptBlock("dotted")}\n\n${after}\n`;
|
|
327
|
+
}
|
|
328
|
+
const block = createSystemPromptBlock("inline").split("\n");
|
|
329
|
+
const needsLeadingBlank = answerRange.end > answerRange.start + 1 && lines[answerRange.end - 1] !== "";
|
|
330
|
+
const next = [
|
|
331
|
+
...lines.slice(0, answerRange.end),
|
|
332
|
+
...(needsLeadingBlank ? [""] : []),
|
|
333
|
+
...block,
|
|
334
|
+
...((answerRange.end < lines.length && lines[answerRange.end] !== "") ? [""] : []),
|
|
335
|
+
...lines.slice(answerRange.end),
|
|
336
|
+
];
|
|
337
|
+
return `${next.join("\n").trimEnd()}\n`;
|
|
338
|
+
}
|
|
339
|
+
export async function installTabbySystemPrompt(configPath, options = {}) {
|
|
340
|
+
const resolvedConfigPath = configPath ?? getDefaultConfigPath(options);
|
|
341
|
+
await assertNoTabbyConfigSymlink(resolvedConfigPath, "install", true);
|
|
342
|
+
const existing = await readInstructionFile(resolvedConfigPath);
|
|
343
|
+
if (existing.exists && hasUnsafeMarkerStructure(existing.text)) {
|
|
344
|
+
throw new Error(`cannot safely repair malformed tokenjuice Tabby markers in ${resolvedConfigPath}; remove the dangling marker manually, then rerun tokenjuice install tabby`);
|
|
345
|
+
}
|
|
346
|
+
const withoutTokenjuice = removeTokenjuiceBlock(existing.text).text;
|
|
347
|
+
if (hasInlineAnswerTable(withoutTokenjuice)) {
|
|
348
|
+
throw new Error(`cannot install Tabby guidance because ${resolvedConfigPath} defines answer as an inline TOML table; convert it to an [answer] table or root answer.* dotted keys, then rerun tokenjuice install tabby`);
|
|
349
|
+
}
|
|
350
|
+
if (hasRootAnswerAssignment(withoutTokenjuice)) {
|
|
351
|
+
throw new Error(`cannot install Tabby guidance because ${resolvedConfigPath} defines answer as a root TOML value; convert it to an [answer] table or root answer.* dotted keys, then rerun tokenjuice install tabby`);
|
|
352
|
+
}
|
|
353
|
+
if (hasAnswerArrayTable(withoutTokenjuice)) {
|
|
354
|
+
throw new Error(`cannot install Tabby guidance because ${resolvedConfigPath} defines answer as an array of TOML tables; convert it to one [answer] table or root answer.* dotted keys, then rerun tokenjuice install tabby`);
|
|
355
|
+
}
|
|
356
|
+
if (hasUserOwnedSystemPrompt(withoutTokenjuice)) {
|
|
357
|
+
throw new Error(`cannot install Tabby guidance because ${resolvedConfigPath} already defines [answer].system_prompt; merge tokenjuice guidance manually or remove that setting, then rerun tokenjuice install tabby`);
|
|
358
|
+
}
|
|
359
|
+
return writeTabbyConfigFile(resolvedConfigPath, installTokenjuiceBlock(existing.text), existing);
|
|
360
|
+
}
|
|
361
|
+
export async function uninstallTabbySystemPrompt(configPath, options = {}) {
|
|
362
|
+
const resolvedConfigPath = configPath ?? getDefaultConfigPath(options);
|
|
363
|
+
await assertNoTabbyConfigSymlink(resolvedConfigPath, "uninstall");
|
|
364
|
+
const existing = await readInstructionFile(resolvedConfigPath);
|
|
365
|
+
if (!existing.exists) {
|
|
366
|
+
return { configPath: resolvedConfigPath, removed: false };
|
|
367
|
+
}
|
|
368
|
+
if (hasUnsafeMarkerStructure(existing.text)) {
|
|
369
|
+
throw new Error(`cannot safely uninstall malformed tokenjuice Tabby markers in ${resolvedConfigPath}; remove the dangling marker manually, then rerun tokenjuice uninstall tabby`);
|
|
370
|
+
}
|
|
371
|
+
const result = removeTokenjuiceBlock(existing.text);
|
|
372
|
+
if (result.removed) {
|
|
373
|
+
if (result.text.trim()) {
|
|
374
|
+
await writeTabbyConfigFile(resolvedConfigPath, result.text.endsWith("\n") ? result.text : `${result.text}\n`, existing);
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
await rm(resolvedConfigPath, { force: true });
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return { configPath: resolvedConfigPath, removed: result.removed };
|
|
381
|
+
}
|
|
382
|
+
export async function doctorTabbySystemPrompt(configPath, options = {}) {
|
|
383
|
+
const resolvedConfigPath = configPath ?? getDefaultConfigPath(options);
|
|
384
|
+
const symlink = await findTabbyConfigSymlink(resolvedConfigPath);
|
|
385
|
+
if (symlink) {
|
|
386
|
+
return {
|
|
387
|
+
configPath: resolvedConfigPath,
|
|
388
|
+
hasTokenjuiceMarker: false,
|
|
389
|
+
...buildInstructionDoctorReportFields({
|
|
390
|
+
status: "broken",
|
|
391
|
+
issues: [`cannot safely inspect Tabby config through symlinked ${symlink.label} ${symlink.path}; replace it with a regular path, then rerun tokenjuice doctor tabby`],
|
|
392
|
+
advisory: TOKENJUICE_TABBY_ADVISORY,
|
|
393
|
+
fixCommand: TOKENJUICE_TABBY_FIX_COMMAND,
|
|
394
|
+
}),
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
const existing = await readInstructionFile(resolvedConfigPath);
|
|
398
|
+
const hasMarker = hasStructuralTokenjuiceMarker(existing.text);
|
|
399
|
+
if (existing.exists && hasUnsafeMarkerStructure(existing.text)) {
|
|
400
|
+
return {
|
|
401
|
+
configPath: resolvedConfigPath,
|
|
402
|
+
hasTokenjuiceMarker: hasMarker,
|
|
403
|
+
...buildInstructionDoctorReportFields({
|
|
404
|
+
status: "broken",
|
|
405
|
+
issues: ["configured Tabby config has unmatched or duplicate tokenjuice markers"],
|
|
406
|
+
advisory: TOKENJUICE_TABBY_ADVISORY,
|
|
407
|
+
fixCommand: "remove unmatched tokenjuice Tabby markers from config.toml, then run tokenjuice install tabby",
|
|
408
|
+
}),
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
if (!existing.exists || !hasTokenjuiceBlock(existing.text)) {
|
|
412
|
+
const issues = ["tokenjuice Tabby system prompt is not installed"];
|
|
413
|
+
const usesInlineAnswerTable = existing.exists && hasInlineAnswerTable(existing.text);
|
|
414
|
+
if (usesInlineAnswerTable) {
|
|
415
|
+
issues.push("configured Tabby answer settings use an inline TOML table; tokenjuice will not rewrite it automatically");
|
|
416
|
+
}
|
|
417
|
+
else if (existing.exists && hasRootAnswerAssignment(existing.text)) {
|
|
418
|
+
issues.push("configured Tabby answer settings use a root TOML value; tokenjuice will not rewrite it automatically");
|
|
419
|
+
}
|
|
420
|
+
else if (existing.exists && hasAnswerArrayTable(existing.text)) {
|
|
421
|
+
issues.push("configured Tabby answer settings use an array of TOML tables; tokenjuice will not rewrite it automatically");
|
|
422
|
+
}
|
|
423
|
+
if (existing.exists && hasUserOwnedSystemPrompt(existing.text)) {
|
|
424
|
+
issues.push("configured Tabby [answer].system_prompt is user-owned; tokenjuice will not overwrite it automatically");
|
|
425
|
+
}
|
|
426
|
+
return {
|
|
427
|
+
configPath: resolvedConfigPath,
|
|
428
|
+
hasTokenjuiceMarker: hasMarker,
|
|
429
|
+
...buildInstructionDoctorReportFields({
|
|
430
|
+
status: "disabled",
|
|
431
|
+
issues,
|
|
432
|
+
advisory: TOKENJUICE_TABBY_ADVISORY,
|
|
433
|
+
fixCommand: TOKENJUICE_TABBY_FIX_COMMAND,
|
|
434
|
+
}),
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
const collisionIssues = hasUserOwnedSystemPrompt(removeTokenjuiceBlock(existing.text).text)
|
|
438
|
+
? ["configured Tabby [answer].system_prompt also exists outside tokenjuice markers"]
|
|
439
|
+
: [];
|
|
440
|
+
const guidanceIssues = collectGuidanceIssues(getTokenjuiceBlockText(existing.text), {
|
|
441
|
+
required: [
|
|
442
|
+
{
|
|
443
|
+
requiredText: TOKENJUICE_WRAP_COMMAND,
|
|
444
|
+
missingIssue: "configured Tabby system prompt is missing tokenjuice wrap guidance",
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
requiredText: TOKENJUICE_RAW_COMMAND,
|
|
448
|
+
missingIssue: "configured Tabby system prompt is missing the raw escape hatch",
|
|
449
|
+
},
|
|
450
|
+
],
|
|
451
|
+
forbidden: [
|
|
452
|
+
{
|
|
453
|
+
forbiddenText: TOKENJUICE_FULL_COMMAND,
|
|
454
|
+
presentIssue: "configured Tabby system prompt still suggests the full escape hatch",
|
|
455
|
+
},
|
|
456
|
+
],
|
|
457
|
+
});
|
|
458
|
+
const issues = [...collisionIssues, ...guidanceIssues];
|
|
459
|
+
return {
|
|
460
|
+
configPath: resolvedConfigPath,
|
|
461
|
+
hasTokenjuiceMarker: hasMarker,
|
|
462
|
+
...buildInstructionDoctorReportFields({
|
|
463
|
+
status: instructionDoctorStatusFromIssues(issues),
|
|
464
|
+
issues,
|
|
465
|
+
advisory: TOKENJUICE_TABBY_ADVISORY,
|
|
466
|
+
fixCommand: TOKENJUICE_TABBY_FIX_COMMAND,
|
|
467
|
+
}),
|
|
468
|
+
};
|
|
469
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type TabnineInstructionsOptions = {
|
|
2
|
+
projectDir?: string;
|
|
3
|
+
};
|
|
4
|
+
export type InstallTabnineInstructionsResult = {
|
|
5
|
+
instructionsPath: string;
|
|
6
|
+
backupPath?: string;
|
|
7
|
+
};
|
|
8
|
+
export type UninstallTabnineInstructionsResult = {
|
|
9
|
+
instructionsPath: string;
|
|
10
|
+
removed: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type TabnineDoctorReport = {
|
|
13
|
+
instructionsPath: string;
|
|
14
|
+
status: "ok" | "warn" | "broken" | "disabled";
|
|
15
|
+
issues: string[];
|
|
16
|
+
advisories: string[];
|
|
17
|
+
fixCommand: string;
|
|
18
|
+
checkedPaths: string[];
|
|
19
|
+
missingPaths: string[];
|
|
20
|
+
};
|
|
21
|
+
export declare function installTabnineInstructions(instructionsPath?: string, options?: TabnineInstructionsOptions): Promise<InstallTabnineInstructionsResult>;
|
|
22
|
+
export declare function uninstallTabnineInstructions(instructionsPath?: string, options?: TabnineInstructionsOptions): Promise<UninstallTabnineInstructionsResult>;
|
|
23
|
+
export declare function doctorTabnineInstructions(instructionsPath?: string, options?: TabnineInstructionsOptions): Promise<TabnineDoctorReport>;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { stat } from "node:fs/promises";
|
|
2
|
+
import { dirname, 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_TABNINE_FIX_COMMAND = "tokenjuice install tabnine";
|
|
8
|
+
const TOKENJUICE_TABNINE_BEGIN = "<!-- tokenjuice:tabnine begin -->";
|
|
9
|
+
const TOKENJUICE_TABNINE_END = "<!-- tokenjuice:tabnine end -->";
|
|
10
|
+
const TOKENJUICE_TABNINE_ADVISORY = "Tabnine support is beta and instruction-based; it guides command usage through project TABNINE.md but does not intercept tool output.";
|
|
11
|
+
function getExplicitProjectDir(options = {}) {
|
|
12
|
+
return options.projectDir || process.env.TABNINE_PROJECT_DIR;
|
|
13
|
+
}
|
|
14
|
+
async function hasGitMetadata(dir) {
|
|
15
|
+
try {
|
|
16
|
+
await stat(join(dir, ".git"));
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function findGitRoot(startDir) {
|
|
24
|
+
let current = resolve(startDir);
|
|
25
|
+
while (true) {
|
|
26
|
+
if (await hasGitMetadata(current)) {
|
|
27
|
+
return current;
|
|
28
|
+
}
|
|
29
|
+
const parent = dirname(current);
|
|
30
|
+
if (parent === current) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
current = parent;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function resolveProjectDir(options = {}) {
|
|
37
|
+
const explicitProjectDir = getExplicitProjectDir(options);
|
|
38
|
+
if (explicitProjectDir) {
|
|
39
|
+
return resolve(explicitProjectDir);
|
|
40
|
+
}
|
|
41
|
+
return (await findGitRoot(process.cwd())) ?? process.cwd();
|
|
42
|
+
}
|
|
43
|
+
async function getDefaultInstructionsPath(options = {}) {
|
|
44
|
+
return join(await resolveProjectDir(options), "TABNINE.md");
|
|
45
|
+
}
|
|
46
|
+
const TOKENJUICE_TABNINE_BLOCK = [
|
|
47
|
+
TOKENJUICE_TABNINE_BEGIN,
|
|
48
|
+
"## tokenjuice terminal output compaction",
|
|
49
|
+
"",
|
|
50
|
+
...buildTokenjuiceGuidanceBullets({
|
|
51
|
+
wrapBullet: "- When running terminal commands through Tabnine CLI, prefer `tokenjuice wrap -- <command>` for commands likely to produce long output.",
|
|
52
|
+
}),
|
|
53
|
+
TOKENJUICE_TABNINE_END,
|
|
54
|
+
].join("\n");
|
|
55
|
+
const TOKENJUICE_TABNINE_BLOCK_CONFIG = {
|
|
56
|
+
beginMarker: TOKENJUICE_TABNINE_BEGIN,
|
|
57
|
+
endMarker: TOKENJUICE_TABNINE_END,
|
|
58
|
+
block: TOKENJUICE_TABNINE_BLOCK,
|
|
59
|
+
};
|
|
60
|
+
function getTokenjuiceBlockText(text) {
|
|
61
|
+
const beginIndex = text.indexOf(TOKENJUICE_TABNINE_BEGIN);
|
|
62
|
+
if (beginIndex === -1) {
|
|
63
|
+
return "";
|
|
64
|
+
}
|
|
65
|
+
const endIndex = text.indexOf(TOKENJUICE_TABNINE_END, beginIndex + TOKENJUICE_TABNINE_BEGIN.length);
|
|
66
|
+
if (endIndex === -1) {
|
|
67
|
+
return text.slice(beginIndex);
|
|
68
|
+
}
|
|
69
|
+
return text.slice(beginIndex, endIndex + TOKENJUICE_TABNINE_END.length);
|
|
70
|
+
}
|
|
71
|
+
function countMarker(text, marker) {
|
|
72
|
+
return text.split(marker).length - 1;
|
|
73
|
+
}
|
|
74
|
+
function hasMalformedMarkerStructure(text, completeBlockCount) {
|
|
75
|
+
const beginCount = countMarker(text, TOKENJUICE_TABNINE_BEGIN);
|
|
76
|
+
const endCount = countMarker(text, TOKENJUICE_TABNINE_END);
|
|
77
|
+
return beginCount !== endCount || beginCount !== completeBlockCount || endCount !== completeBlockCount;
|
|
78
|
+
}
|
|
79
|
+
export async function installTabnineInstructions(instructionsPath, options = {}) {
|
|
80
|
+
const resolvedInstructionsPath = instructionsPath ?? (await getDefaultInstructionsPath(options));
|
|
81
|
+
const existing = await readInstructionFile(resolvedInstructionsPath);
|
|
82
|
+
const markerState = inspectMarkerDelimitedBlock(existing.text, TOKENJUICE_TABNINE_BLOCK_CONFIG);
|
|
83
|
+
if (existing.exists && hasMalformedMarkerStructure(existing.text, markerState.completeBlockCount)) {
|
|
84
|
+
throw new Error(`cannot safely repair malformed tokenjuice markers in ${resolvedInstructionsPath}; remove the dangling marker manually, then rerun tokenjuice install tabnine`);
|
|
85
|
+
}
|
|
86
|
+
const result = await installMarkerDelimitedBlock(resolvedInstructionsPath, TOKENJUICE_TABNINE_BLOCK_CONFIG);
|
|
87
|
+
return {
|
|
88
|
+
instructionsPath: result.filePath,
|
|
89
|
+
...(result.backupPath ? { backupPath: result.backupPath } : {}),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export async function uninstallTabnineInstructions(instructionsPath, options = {}) {
|
|
93
|
+
const resolvedInstructionsPath = instructionsPath ?? (await getDefaultInstructionsPath(options));
|
|
94
|
+
const existing = await readInstructionFile(resolvedInstructionsPath);
|
|
95
|
+
const markerState = inspectMarkerDelimitedBlock(existing.text, TOKENJUICE_TABNINE_BLOCK_CONFIG);
|
|
96
|
+
if (existing.exists && hasMalformedMarkerStructure(existing.text, markerState.completeBlockCount)) {
|
|
97
|
+
throw new Error(`cannot safely uninstall malformed tokenjuice markers in ${resolvedInstructionsPath}; remove the dangling marker manually, then rerun tokenjuice uninstall tabnine`);
|
|
98
|
+
}
|
|
99
|
+
const result = await uninstallMarkerDelimitedBlock(resolvedInstructionsPath, TOKENJUICE_TABNINE_BLOCK_CONFIG);
|
|
100
|
+
return { instructionsPath: result.filePath, removed: result.removed };
|
|
101
|
+
}
|
|
102
|
+
export async function doctorTabnineInstructions(instructionsPath, options = {}) {
|
|
103
|
+
const resolvedInstructionsPath = instructionsPath ?? (await getDefaultInstructionsPath(options));
|
|
104
|
+
const existing = await readInstructionFile(resolvedInstructionsPath);
|
|
105
|
+
const markerState = inspectMarkerDelimitedBlock(existing.text, TOKENJUICE_TABNINE_BLOCK_CONFIG);
|
|
106
|
+
if (!existing.exists || (!markerState.hasBegin && !markerState.hasEnd)) {
|
|
107
|
+
return {
|
|
108
|
+
instructionsPath: resolvedInstructionsPath,
|
|
109
|
+
...buildInstructionDoctorReportFields({
|
|
110
|
+
status: "disabled",
|
|
111
|
+
issues: ["tokenjuice Tabnine instructions are not installed"],
|
|
112
|
+
advisory: TOKENJUICE_TABNINE_ADVISORY,
|
|
113
|
+
fixCommand: TOKENJUICE_TABNINE_FIX_COMMAND,
|
|
114
|
+
}),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const markerIssues = collectMarkerDelimitedBlockIssues(markerState, {
|
|
118
|
+
configuredLabel: "Tabnine instructions",
|
|
119
|
+
repairCommand: TOKENJUICE_TABNINE_FIX_COMMAND,
|
|
120
|
+
});
|
|
121
|
+
const hasMalformedMarkers = hasMalformedMarkerStructure(existing.text, markerState.completeBlockCount);
|
|
122
|
+
const issues = [
|
|
123
|
+
...markerIssues,
|
|
124
|
+
...(hasMalformedMarkers ? ["configured Tabnine instructions have malformed tokenjuice markers"] : []),
|
|
125
|
+
...collectGuidanceIssues(getTokenjuiceBlockText(existing.text), {
|
|
126
|
+
required: [
|
|
127
|
+
{
|
|
128
|
+
requiredText: TOKENJUICE_WRAP_COMMAND,
|
|
129
|
+
missingIssue: "configured Tabnine instructions are missing tokenjuice wrap guidance",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
requiredText: TOKENJUICE_RAW_COMMAND,
|
|
133
|
+
missingIssue: "configured Tabnine instructions are missing the raw escape hatch",
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
forbidden: [
|
|
137
|
+
{
|
|
138
|
+
forbiddenText: TOKENJUICE_FULL_COMMAND,
|
|
139
|
+
presentIssue: "configured Tabnine instructions still suggest the full escape hatch",
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
}),
|
|
143
|
+
];
|
|
144
|
+
return {
|
|
145
|
+
instructionsPath: resolvedInstructionsPath,
|
|
146
|
+
...buildInstructionDoctorReportFields({
|
|
147
|
+
status: instructionDoctorStatusFromIssues(issues),
|
|
148
|
+
issues,
|
|
149
|
+
advisory: TOKENJUICE_TABNINE_ADVISORY,
|
|
150
|
+
fixCommand: hasMalformedMarkers
|
|
151
|
+
? "remove unmatched tokenjuice markers from TABNINE.md, then run tokenjuice install tabnine"
|
|
152
|
+
: TOKENJUICE_TABNINE_FIX_COMMAND,
|
|
153
|
+
}),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type TraeRuleOptions = {
|
|
2
|
+
projectDir?: string;
|
|
3
|
+
};
|
|
4
|
+
export type InstallTraeRuleResult = {
|
|
5
|
+
rulePath: string;
|
|
6
|
+
backupPath?: string;
|
|
7
|
+
};
|
|
8
|
+
export type UninstallTraeRuleResult = {
|
|
9
|
+
rulePath: string;
|
|
10
|
+
removed: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type TraeDoctorReport = {
|
|
13
|
+
rulePath: string;
|
|
14
|
+
status: "ok" | "warn" | "broken" | "disabled";
|
|
15
|
+
issues: string[];
|
|
16
|
+
advisories: string[];
|
|
17
|
+
fixCommand: string;
|
|
18
|
+
checkedPaths: string[];
|
|
19
|
+
missingPaths: string[];
|
|
20
|
+
};
|
|
21
|
+
export declare function installTraeRule(rulePath?: string, options?: TraeRuleOptions): Promise<InstallTraeRuleResult>;
|
|
22
|
+
export declare function uninstallTraeRule(rulePath?: string, options?: TraeRuleOptions): Promise<UninstallTraeRuleResult>;
|
|
23
|
+
export declare function doctorTraeRule(rulePath?: string, options?: TraeRuleOptions): Promise<TraeDoctorReport>;
|