@asterxsk/kiln 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +3 -18
- package/agent/extensions/AGENTS.md +68 -68
- package/agent/extensions/ask-user/install.ps1 +4 -0
- package/agent/extensions/ask-user/install.sh +3 -0
- package/agent/extensions/background-terminals/install.ps1 +4 -0
- package/agent/extensions/background-terminals/install.sh +3 -0
- package/agent/extensions/destructive/install.ps1 +4 -0
- package/agent/extensions/destructive/install.sh +3 -0
- package/agent/extensions/file-search/install.ps1 +4 -0
- package/agent/extensions/file-search/install.sh +3 -0
- package/agent/extensions/goal/install.ps1 +4 -0
- package/agent/extensions/goal/install.sh +3 -0
- package/agent/extensions/herdr-agent-state.ts +257 -0
- package/agent/extensions/kiln-update/README.md +25 -0
- package/agent/extensions/kiln-update/index.ts +99 -0
- package/agent/extensions/kiln-update/install.ps1 +27 -0
- package/agent/extensions/kiln-update/install.sh +24 -0
- package/agent/extensions/modelconf/install.ps1 +4 -0
- package/agent/extensions/modelconf/install.sh +3 -0
- package/agent/extensions/shared/install.ps1 +4 -0
- package/agent/extensions/shared/install.sh +3 -0
- package/agent/extensions/skillsconf/install.ps1 +4 -0
- package/agent/extensions/skillsconf/install.sh +3 -0
- package/agent/extensions/statusline/install.ps1 +4 -0
- package/agent/extensions/statusline/install.sh +3 -0
- package/agent/extensions/subagents/install.ps1 +4 -0
- package/agent/extensions/subagents/install.sh +3 -0
- package/agent/extensions/taste/index.ts +443 -0
- package/agent/extensions/taste/install.ps1 +27 -0
- package/agent/extensions/taste/install.sh +24 -0
- package/agent/extensions/todo/install.ps1 +4 -0
- package/agent/extensions/todo/install.sh +3 -0
- package/agent/extensions/trim-context/install.ps1 +4 -0
- package/agent/extensions/trim-context/install.sh +3 -0
- package/agent/version.txt +1 -0
- package/agent.bak.20260905-190020/AGENTS.md +67 -0
- package/agent.bak.20260905-190020/README.md +5 -0
- package/agent.bak.20260905-190020/extensions/ask-user/index.ts +418 -0
- package/agent.bak.20260905-190020/extensions/ask-user/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/ask-user/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/ask-user/package-lock.json +769 -0
- package/agent.bak.20260905-190020/extensions/ask-user/package.json +19 -0
- package/agent.bak.20260905-190020/extensions/ask-user/prompt.ts +45 -0
- package/agent.bak.20260905-190020/extensions/ask-user/tsconfig.json +7 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/docs/implementation-guide.md +942 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/index.ts +629 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/package-lock.json +769 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/package.json +17 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/src/domain.ts +87 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/src/manager.ts +907 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/src/output.ts +84 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/src/prompt.ts +142 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/src/result-delivery.ts +27 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/src/runtime.ts +36 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/src/ui/output-view.ts +79 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/src/ui/ps.ts +621 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/src/widget-order.ts +121 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/test/manager.test.ts +735 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/test/output.test.ts +109 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/test/prompt.test.ts +125 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/test/ps.test.ts +82 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/test/result-delivery.test.ts +44 -0
- package/agent.bak.20260905-190020/extensions/background-terminals/tsconfig.json +7 -0
- package/agent.bak.20260905-190020/extensions/destructive/README.md +34 -0
- package/agent.bak.20260905-190020/extensions/destructive/index.ts +124 -0
- package/agent.bak.20260905-190020/extensions/destructive/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/destructive/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/file-search/index.ts +459 -0
- package/agent.bak.20260905-190020/extensions/file-search/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/file-search/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/file-search/package-lock.json +2253 -0
- package/agent.bak.20260905-190020/extensions/file-search/package.json +23 -0
- package/agent.bak.20260905-190020/extensions/file-search/src/args.ts +122 -0
- package/agent.bak.20260905-190020/extensions/file-search/src/binaries.ts +422 -0
- package/agent.bak.20260905-190020/extensions/file-search/src/output.ts +126 -0
- package/agent.bak.20260905-190020/extensions/file-search/src/process.ts +146 -0
- package/agent.bak.20260905-190020/extensions/file-search/src/prompt.ts +52 -0
- package/agent.bak.20260905-190020/extensions/file-search/test/index.spec.ts +443 -0
- package/agent.bak.20260905-190020/extensions/file-search/tsconfig.json +7 -0
- package/agent.bak.20260905-190020/extensions/goal/README.md +50 -0
- package/agent.bak.20260905-190020/extensions/goal/index.ts +155 -0
- package/agent.bak.20260905-190020/extensions/goal/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/goal/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/kiln-update/README.md +25 -0
- package/agent.bak.20260905-190020/extensions/kiln-update/index.ts +99 -0
- package/agent.bak.20260905-190020/extensions/kiln-update/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/kiln-update/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/modelconf/PLAN.md +915 -0
- package/agent.bak.20260905-190020/extensions/modelconf/README.md +66 -0
- package/agent.bak.20260905-190020/extensions/modelconf/index.ts +296 -0
- package/agent.bak.20260905-190020/extensions/modelconf/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/modelconf/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/modelconf/package-lock.json +1809 -0
- package/agent.bak.20260905-190020/extensions/modelconf/package.json +13 -0
- package/agent.bak.20260905-190020/extensions/modelconf/src/fuzzy.ts +26 -0
- package/agent.bak.20260905-190020/extensions/modelconf/src/glob.ts +13 -0
- package/agent.bak.20260905-190020/extensions/modelconf/src/persistence.test.ts +46 -0
- package/agent.bak.20260905-190020/extensions/modelconf/src/persistence.ts +164 -0
- package/agent.bak.20260905-190020/extensions/modelconf/src/ui/ModelConfView.test.ts +75 -0
- package/agent.bak.20260905-190020/extensions/modelconf/src/ui/ModelConfView.ts +1101 -0
- package/agent.bak.20260905-190020/extensions/modelconf/tsconfig.json +15 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/CHANGELOG.md +690 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/LICENSE +21 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/README.md +470 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/SECURITY.md +5 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/activity.ts +101 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/auth-fetch.ts +148 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/banner.png +0 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/brightdata-unlocker.ts +272 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/chrome-cookies.ts +669 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/content-find.ts +139 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/credential-source.ts +191 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/data-uri-sanitize.ts +406 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/datalab-pdf-extract.ts +568 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/declared-web-links.ts +173 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/evidence/CONTRACT-EVIDENCE.md +496 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/evidence/contract-probe.mjs +140 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/exa.ts +526 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/extract.ts +1196 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/feature-config.ts +29 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/fetch-params.ts +111 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/gemini-adc.ts +298 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/gemini-api.ts +353 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/gemini-pdf-extract.ts +108 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/gemini-search.ts +21 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/gemini-url-context.ts +128 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/gemini-web-config.ts +101 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/gemini-web.ts +487 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/github-api.ts +197 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/github-extract.ts +746 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/github-issue-pr.ts +700 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/index.ts +1737 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/package-lock.json +5808 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/package.json +64 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/page-query.ts +96 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/pdf-extract.ts +409 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/pi-web-fetch-demo.mp4 +0 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/promise-try.d.ts +7 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/query-rewrite.ts +51 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/render-search-error.ts +170 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/rsc-extract.ts +338 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/search-types.ts +20 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/source-check.ts +282 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/ssrf-protection.ts +526 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/storage.ts +521 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/summary-model-scope.ts +125 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/auth-fetch.test.mjs +208 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/brightdata-unlocker.test.mjs +840 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/chrome-cookie-extraction.test.mjs +441 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/config-path.test.mjs +283 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/content-find.test.mjs +25 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/credential-source.test.mjs +118 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/data-uri-sanitize.test.mjs +210 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/datalab-pdf-extract.test.mjs +552 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/declared-web-links.test.mjs +212 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/fetch-answer-storage.test.mjs +40 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/fetch-cache-storage.test.mjs +334 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/fetch-content-domain-policy.test.mjs +95 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/fetch-modes.test.mjs +53 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/fetch-not-found-guidance.test.mjs +92 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/fetch-params.test.mjs +86 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/fetch-render-call.test.mjs +34 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/fetch-routing.test.mjs +173 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/gemini-adc-auth.test.mjs +257 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/gemini-api-transport.test.mjs +170 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/gemini-pdf-extract.test.mjs +133 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/gemini-web-cookie-opt-in.test.mjs +178 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/gemini-web-header-overflow.test.mjs +148 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/get-search-content.test.mjs +223 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/github-extract.test.mjs +378 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/github-issue-pr.test.mjs +565 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/inline-content-config.test.mjs +99 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/lazy-extract-load.test.mjs +118 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/local-video-oversize.test.mjs +52 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/package-typebox-dependency.test.mjs +50 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/page-query.test.mjs +51 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/pdf-config.test.mjs +140 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/pdf-extract.test.mjs +500 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/proxy-transport.test.mjs +286 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/query-rewrite.test.mjs +52 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/rsc-fallback.test.mjs +102 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/search-error-render.test.mjs +152 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/search-providers.test.mjs +274 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/source-check.test.mjs +179 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/ssrf-allow-ranges-config.test.mjs +205 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/ssrf-protection.test.mjs +456 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/summary-model-scope.test.mjs +106 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/tool-registration-config.test.mjs +182 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/web-search-answer-render.test.mjs +66 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/test/youtube-extract-errors.test.mjs +64 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/tsconfig.json +11 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/utils.ts +451 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/video-extract.ts +392 -0
- package/agent.bak.20260905-190020/extensions/pi-web-access/youtube-extract.ts +328 -0
- package/agent.bak.20260905-190020/extensions/shared/activity-status.ts +31 -0
- package/agent.bak.20260905-190020/extensions/shared/child-session.ts +148 -0
- package/agent.bak.20260905-190020/extensions/shared/context-utilization.ts +47 -0
- package/agent.bak.20260905-190020/extensions/shared/dashboard-state.ts +99 -0
- package/agent.bak.20260905-190020/extensions/shared/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/shared/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/shared/test/child-session.test.ts +270 -0
- package/agent.bak.20260905-190020/extensions/shared/test/context-utilization.test.ts +48 -0
- package/agent.bak.20260905-190020/extensions/shared/test/tool-call-timeout.test.ts +117 -0
- package/agent.bak.20260905-190020/extensions/shared/test/widget-order.test.ts +167 -0
- package/agent.bak.20260905-190020/extensions/shared/tool-call-timeout.ts +104 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/README.md +74 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/index.ts +92 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/package-lock.json +1809 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/package.json +18 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/src/delete-skill.test.ts +64 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/src/delete-skill.ts +45 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/src/filter.test.ts +80 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/src/filter.ts +74 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/src/fuzzy.ts +26 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/src/persistence.test.ts +72 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/src/persistence.ts +169 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/src/ui/SkillConfView.test.ts +337 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/src/ui/SkillConfView.ts +758 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/src/ui/text-input.ts +91 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/src/ui/tui-helpers.ts +144 -0
- package/agent.bak.20260905-190020/extensions/skillsconf/tsconfig.json +15 -0
- package/agent.bak.20260905-190020/extensions/statusline/index.ts +282 -0
- package/agent.bak.20260905-190020/extensions/statusline/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/statusline/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/subagents/docs/design-plan.md +568 -0
- package/agent.bak.20260905-190020/extensions/subagents/docs/effect-v4-extension-guide.md +354 -0
- package/agent.bak.20260905-190020/extensions/subagents/docs/effect-v4-notes.md +571 -0
- package/agent.bak.20260905-190020/extensions/subagents/index.ts +826 -0
- package/agent.bak.20260905-190020/extensions/subagents/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/subagents/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/subagents/package-lock.json +2244 -0
- package/agent.bak.20260905-190020/extensions/subagents/package.json +19 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/backend.ts +73 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/backends/claude.ts +701 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/backends/codex.ts +1060 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/backends/pi.ts +575 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/backends/stub.ts +300 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/by-the-way.ts +21 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/domain.ts +253 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/format.ts +74 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/manager.ts +736 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/prompt.ts +92 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/result-delivery.ts +20 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/runtime.ts +53 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/ui/takeover.ts +583 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/ui/transcript.ts +201 -0
- package/agent.bak.20260905-190020/extensions/subagents/src/widget-order.ts +121 -0
- package/agent.bak.20260905-190020/extensions/subagents/test/by-the-way.test.ts +29 -0
- package/agent.bak.20260905-190020/extensions/subagents/test/claude.test.ts +119 -0
- package/agent.bak.20260905-190020/extensions/subagents/test/codex.test.ts +102 -0
- package/agent.bak.20260905-190020/extensions/subagents/test/context-usage.test.ts +107 -0
- package/agent.bak.20260905-190020/extensions/subagents/test/manager.test.ts +276 -0
- package/agent.bak.20260905-190020/extensions/subagents/test/result-delivery.test.ts +27 -0
- package/agent.bak.20260905-190020/extensions/subagents/test/takeover.test.ts +29 -0
- package/agent.bak.20260905-190020/extensions/subagents/tsconfig.json +7 -0
- package/agent.bak.20260905-190020/extensions/taste/index.ts +443 -0
- package/agent.bak.20260905-190020/extensions/taste/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/taste/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/todo/AGENTS.md +38 -0
- package/agent.bak.20260905-190020/extensions/todo/LICENSE +21 -0
- package/agent.bak.20260905-190020/extensions/todo/config.ts +55 -0
- package/agent.bak.20260905-190020/extensions/todo/index.ts +151 -0
- package/agent.bak.20260905-190020/extensions/todo/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/todo/install.sh +21 -0
- package/agent.bak.20260905-190020/extensions/todo/locales/de.json +17 -0
- package/agent.bak.20260905-190020/extensions/todo/locales/en.json +15 -0
- package/agent.bak.20260905-190020/extensions/todo/locales/es.json +17 -0
- package/agent.bak.20260905-190020/extensions/todo/locales/fr.json +17 -0
- package/agent.bak.20260905-190020/extensions/todo/locales/pt-BR.json +17 -0
- package/agent.bak.20260905-190020/extensions/todo/locales/pt.json +17 -0
- package/agent.bak.20260905-190020/extensions/todo/locales/ru.json +17 -0
- package/agent.bak.20260905-190020/extensions/todo/locales/uk.json +17 -0
- package/agent.bak.20260905-190020/extensions/todo/locales/zh.json +17 -0
- package/agent.bak.20260905-190020/extensions/todo/package-lock.json +3358 -0
- package/agent.bak.20260905-190020/extensions/todo/package.json +67 -0
- package/agent.bak.20260905-190020/extensions/todo/state/i18n-bridge.ts +64 -0
- package/agent.bak.20260905-190020/extensions/todo/state/invariants.ts +20 -0
- package/agent.bak.20260905-190020/extensions/todo/state/replay.ts +38 -0
- package/agent.bak.20260905-190020/extensions/todo/state/selectors.ts +107 -0
- package/agent.bak.20260905-190020/extensions/todo/state/state-reducer.ts +326 -0
- package/agent.bak.20260905-190020/extensions/todo/state/state.ts +18 -0
- package/agent.bak.20260905-190020/extensions/todo/state/store.ts +82 -0
- package/agent.bak.20260905-190020/extensions/todo/state/task-graph.ts +57 -0
- package/agent.bak.20260905-190020/extensions/todo/todo-overlay.ts +204 -0
- package/agent.bak.20260905-190020/extensions/todo/todo.ts +155 -0
- package/agent.bak.20260905-190020/extensions/todo/tool/response-envelope.ts +109 -0
- package/agent.bak.20260905-190020/extensions/todo/tool/types.ts +206 -0
- package/agent.bak.20260905-190020/extensions/todo/view/format.ts +177 -0
- package/agent.bak.20260905-190020/extensions/todo/widget-order.ts +121 -0
- package/agent.bak.20260905-190020/extensions/trim-context/README.md +54 -0
- package/agent.bak.20260905-190020/extensions/trim-context/index.ts +487 -0
- package/agent.bak.20260905-190020/extensions/trim-context/install.ps1 +23 -0
- package/agent.bak.20260905-190020/extensions/trim-context/install.sh +21 -0
- package/agent.bak.20260905-190020/keybindings.json +7 -0
- package/bin/kiln.js +588 -471
- package/package.json +27 -27
- package/agent/install.ps1 +0 -637
- package/agent/install.sh +0 -620
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pi-taste — local "taste" learning, no npx / no network.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors Command Code's Taste but entirely on-disk:
|
|
5
|
+
* - Learns preferences from each completed request via the active local model.
|
|
6
|
+
* - Stores them as markdown at two scopes:
|
|
7
|
+
* Global : ~/.pi/agent/extensions/taste/taste.md (applies to ALL projects)
|
|
8
|
+
* Project: <cwd>/.pi/taste/taste.md (this codebase only)
|
|
9
|
+
* - Feeds high-confidence learnings back into the system prompt each turn.
|
|
10
|
+
*
|
|
11
|
+
* Confidence system: new learning = newConfidence (0.40); a repeat (same
|
|
12
|
+
* category + normalized text) raises confidence by repeatIncrement (0.10),
|
|
13
|
+
* capped at 0.95. Only learnings >= applyThreshold (0.60) are injected.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
17
|
+
import { CONFIG_DIR_NAME } from "@earendil-works/pi-coding-agent";
|
|
18
|
+
import { uuidv7 } from "@earendil-works/pi-ai";
|
|
19
|
+
import * as fs from "node:fs";
|
|
20
|
+
import * as path from "node:path";
|
|
21
|
+
import * as os from "node:os";
|
|
22
|
+
|
|
23
|
+
// ---- Paths -------------------------------------------------------------
|
|
24
|
+
// Global taste lives INSIDE this extension's folder (per user request).
|
|
25
|
+
const EXT_DIR = path.join(os.homedir(), ".pi", "agent", "extensions", "taste");
|
|
26
|
+
const GLOBAL_TASTE = path.join(EXT_DIR, "taste.md");
|
|
27
|
+
const GLOBAL_SETTINGS = path.join(EXT_DIR, "settings.json");
|
|
28
|
+
|
|
29
|
+
const projectTasteFile = (cwd: string) =>
|
|
30
|
+
path.join(cwd, CONFIG_DIR_NAME, "taste", "taste.md");
|
|
31
|
+
const projectSettingsFile = (cwd: string) =>
|
|
32
|
+
path.join(cwd, CONFIG_DIR_NAME, "taste", "settings.json");
|
|
33
|
+
|
|
34
|
+
// ---- Settings ----------------------------------------------------------
|
|
35
|
+
interface Settings {
|
|
36
|
+
learning: boolean;
|
|
37
|
+
applyThreshold: number;
|
|
38
|
+
newConfidence: number;
|
|
39
|
+
repeatIncrement: number;
|
|
40
|
+
minPromptLength: number;
|
|
41
|
+
minIntervalMs: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const DEFAULTS: Settings = {
|
|
45
|
+
learning: true,
|
|
46
|
+
applyThreshold: 0.6,
|
|
47
|
+
newConfidence: 0.4,
|
|
48
|
+
repeatIncrement: 0.1,
|
|
49
|
+
minPromptLength: 20,
|
|
50
|
+
minIntervalMs: 15000,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
function loadSettings(file: string): Settings {
|
|
54
|
+
try {
|
|
55
|
+
if (fs.existsSync(file)) {
|
|
56
|
+
return { ...DEFAULTS, ...JSON.parse(fs.readFileSync(file, "utf8")) };
|
|
57
|
+
}
|
|
58
|
+
} catch {
|
|
59
|
+
/* corrupt settings -> defaults */
|
|
60
|
+
}
|
|
61
|
+
return { ...DEFAULTS };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ---- Taste data model --------------------------------------------------
|
|
65
|
+
interface Item {
|
|
66
|
+
text: string;
|
|
67
|
+
confidence: number;
|
|
68
|
+
}
|
|
69
|
+
type Taste = Map<string, Item[]>;
|
|
70
|
+
|
|
71
|
+
const normalize = (s: string) =>
|
|
72
|
+
s.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
|
|
73
|
+
|
|
74
|
+
function parseTaste(text: string): Taste {
|
|
75
|
+
const taste: Taste = new Map();
|
|
76
|
+
let category = "Other";
|
|
77
|
+
for (const line of text.split(/\r?\n/)) {
|
|
78
|
+
const h = line.match(/^#\s+(.+?)\s*$/);
|
|
79
|
+
if (h) {
|
|
80
|
+
category = h[1].trim() || "Other";
|
|
81
|
+
if (!taste.has(category)) taste.set(category, []);
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const b = line.match(
|
|
85
|
+
/^-\s+(.*?)\s*\.\s*Confidence:\s*([0-9]+(?:\.[0-9]+)?)\s*$/i,
|
|
86
|
+
);
|
|
87
|
+
if (b) {
|
|
88
|
+
const items = taste.get(category) ?? [];
|
|
89
|
+
items.push({ text: b[1].trim(), confidence: parseFloat(b[2]) });
|
|
90
|
+
taste.set(category, items);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return taste;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function serializeTaste(taste: Taste): string {
|
|
97
|
+
const lines: string[] = [];
|
|
98
|
+
for (const [category, items] of taste) {
|
|
99
|
+
if (items.length === 0) continue;
|
|
100
|
+
lines.push(`# ${category}`);
|
|
101
|
+
for (const it of [...items].sort((a, b) => b.confidence - a.confidence)) {
|
|
102
|
+
lines.push(`- ${it.text}. Confidence: ${it.confidence.toFixed(2)}`);
|
|
103
|
+
}
|
|
104
|
+
lines.push("");
|
|
105
|
+
}
|
|
106
|
+
return lines.join("\n").trimEnd() + "\n";
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Merge one learning; returns true if the file should be rewritten. */
|
|
110
|
+
function mergeLearning(
|
|
111
|
+
taste: Taste,
|
|
112
|
+
category: string,
|
|
113
|
+
preference: string,
|
|
114
|
+
s: Settings,
|
|
115
|
+
): boolean {
|
|
116
|
+
const cat = category.trim() || "Other";
|
|
117
|
+
const norm = normalize(preference);
|
|
118
|
+
if (!norm) return false;
|
|
119
|
+
|
|
120
|
+
const items = taste.get(cat) ?? [];
|
|
121
|
+
const existing = items.find((i) => normalize(i.text) === norm);
|
|
122
|
+
if (existing) {
|
|
123
|
+
const before = existing.confidence;
|
|
124
|
+
existing.confidence = Math.min(
|
|
125
|
+
0.95,
|
|
126
|
+
+(existing.confidence + s.repeatIncrement).toFixed(2),
|
|
127
|
+
);
|
|
128
|
+
return existing.confidence !== before;
|
|
129
|
+
}
|
|
130
|
+
items.push({ text: preference.trim(), confidence: s.newConfidence });
|
|
131
|
+
taste.set(cat, items);
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function readTaste(file: string): Taste {
|
|
136
|
+
try {
|
|
137
|
+
if (fs.existsSync(file)) return parseTaste(fs.readFileSync(file, "utf8"));
|
|
138
|
+
} catch {
|
|
139
|
+
/* unreadable -> empty */
|
|
140
|
+
}
|
|
141
|
+
return new Map();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function writeTaste(file: string, taste: Taste): void {
|
|
145
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
146
|
+
fs.writeFileSync(file, serializeTaste(taste), "utf8");
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function safeDelete(file: string): void {
|
|
150
|
+
try {
|
|
151
|
+
if (fs.existsSync(file)) fs.unlinkSync(file);
|
|
152
|
+
} catch {
|
|
153
|
+
/* ignore */
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// ---- Apply: build the system-prompt section ----------------------------
|
|
158
|
+
function tasteToLines(taste: Taste, threshold: number): string[] {
|
|
159
|
+
const out: string[] = [];
|
|
160
|
+
for (const [cat, items] of taste) {
|
|
161
|
+
const applied = items.filter((i) => i.confidence >= threshold);
|
|
162
|
+
if (applied.length === 0) continue;
|
|
163
|
+
out.push(`**${cat}**`);
|
|
164
|
+
for (const it of [...applied].sort((a, b) => b.confidence - a.confidence)) {
|
|
165
|
+
out.push(`- ${it.text}. (conf ${it.confidence.toFixed(2)})`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return out;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function buildTasteSection(
|
|
172
|
+
gTaste: Taste,
|
|
173
|
+
pTaste: Taste,
|
|
174
|
+
gThresh: number,
|
|
175
|
+
pThresh: number,
|
|
176
|
+
): string {
|
|
177
|
+
const gLines = tasteToLines(gTaste, gThresh);
|
|
178
|
+
const pLines = tasteToLines(pTaste, pThresh);
|
|
179
|
+
if (gLines.length === 0 && pLines.length === 0) return "";
|
|
180
|
+
|
|
181
|
+
const parts = [
|
|
182
|
+
"## Your learned taste (pi-taste)",
|
|
183
|
+
"",
|
|
184
|
+
"Preferences learned from your past requests. Follow them unless the current request clearly overrides.",
|
|
185
|
+
"",
|
|
186
|
+
];
|
|
187
|
+
if (gLines.length) {
|
|
188
|
+
parts.push("### Global preferences (all projects)");
|
|
189
|
+
parts.push(...gLines, "");
|
|
190
|
+
}
|
|
191
|
+
if (pLines.length) {
|
|
192
|
+
parts.push("### This project");
|
|
193
|
+
parts.push(...pLines, "");
|
|
194
|
+
}
|
|
195
|
+
return parts.join("\n").trimEnd();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// ---- Learn: extract preferences via the active local model ------------
|
|
199
|
+
interface RawLearning {
|
|
200
|
+
category?: string;
|
|
201
|
+
preference?: string;
|
|
202
|
+
scope?: "global" | "project";
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const EXTRACT_PROMPT = `You are a coding-preference extractor. Given a user's coding request and the assistant's outcome, extract DURABLE preferences about how this user likes to work.
|
|
206
|
+
|
|
207
|
+
Rules:
|
|
208
|
+
- Extract only preferences clearly evidenced by the request or the resulting choices: tooling, libraries, language style, architecture, testing, git/commit style, documentation, or communication/format.
|
|
209
|
+
- Do NOT extract task-specific facts (file names, bug locations, one-off decisions).
|
|
210
|
+
- For each, set scope:
|
|
211
|
+
- "global" if it applies to ANY software project regardless of language/stack (e.g. "prefer pnpm", "write concise commit messages").
|
|
212
|
+
- "project" if it is specific to THIS codebase (its languages, frameworks, conventions, file layout).
|
|
213
|
+
- Choose a short category from: CLI, TypeScript, JavaScript, Python, Rust, Go, Architecture, Testing, Git, Documentation, Style, Tooling, Communication, Other.
|
|
214
|
+
|
|
215
|
+
Return ONLY minified JSON: an array of {"category":string,"preference":string,"scope":"global"|"project"}. No markdown fences, no commentary. If nothing durable, return [].`;
|
|
216
|
+
|
|
217
|
+
function parseLearnings(text: string): RawLearning[] {
|
|
218
|
+
let t = text.trim();
|
|
219
|
+
const fence = t.match(/```(?:json)?\s*([\s\S]*?)```/i);
|
|
220
|
+
if (fence) t = fence[1].trim();
|
|
221
|
+
try {
|
|
222
|
+
const parsed = JSON.parse(t);
|
|
223
|
+
if (!Array.isArray(parsed)) return [];
|
|
224
|
+
return parsed
|
|
225
|
+
.filter(
|
|
226
|
+
(x) =>
|
|
227
|
+
x &&
|
|
228
|
+
typeof x.preference === "string" &&
|
|
229
|
+
x.preference.trim().length > 0,
|
|
230
|
+
)
|
|
231
|
+
.map((x) => ({
|
|
232
|
+
category: typeof x.category === "string" ? x.category : "Other",
|
|
233
|
+
preference: x.preference,
|
|
234
|
+
scope: x.scope === "global" ? "global" : "project",
|
|
235
|
+
}));
|
|
236
|
+
} catch {
|
|
237
|
+
return [];
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function lastAssistantText(ctx: ExtensionContext): string {
|
|
242
|
+
const entries = ctx.sessionManager.getEntries();
|
|
243
|
+
for (let i = entries.length - 1; i >= 0; i--) {
|
|
244
|
+
const e = entries[i];
|
|
245
|
+
if (e.type === "message" && e.message?.role === "assistant") {
|
|
246
|
+
const c = e.message.content;
|
|
247
|
+
if (typeof c === "string") return c;
|
|
248
|
+
if (Array.isArray(c)) {
|
|
249
|
+
return c
|
|
250
|
+
.filter((p: any) => p?.type === "text")
|
|
251
|
+
.map((p: any) => p.text)
|
|
252
|
+
.join("\n");
|
|
253
|
+
}
|
|
254
|
+
return "";
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return "";
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
async function extractLearnings(
|
|
261
|
+
ctx: ExtensionContext,
|
|
262
|
+
userPrompt: string,
|
|
263
|
+
assistantText: string,
|
|
264
|
+
): Promise<RawLearning[]> {
|
|
265
|
+
if (!ctx.model) return [];
|
|
266
|
+
if (!ctx.modelRegistry.hasConfiguredAuth(ctx.model)) return [];
|
|
267
|
+
|
|
268
|
+
const context = {
|
|
269
|
+
messages: [
|
|
270
|
+
{
|
|
271
|
+
role: "user" as const,
|
|
272
|
+
content: [
|
|
273
|
+
{
|
|
274
|
+
type: "text" as const,
|
|
275
|
+
text:
|
|
276
|
+
EXTRACT_PROMPT +
|
|
277
|
+
`\n\nUSER REQUEST:\n${userPrompt}\n\nASSISTANT OUTCOME:\n${assistantText}`,
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
timestamp: Date.now(),
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
} as any;
|
|
284
|
+
|
|
285
|
+
const res = await ctx.modelRegistry.complete(ctx.model, context, {
|
|
286
|
+
reasoningEffort: "low",
|
|
287
|
+
cacheRetention: "none",
|
|
288
|
+
sessionId: uuidv7(),
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
const text = res.content
|
|
292
|
+
.filter((c: any) => c.type === "text")
|
|
293
|
+
.map((c: any) => c.text)
|
|
294
|
+
.join("");
|
|
295
|
+
return parseLearnings(text);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// ---- Wiring ------------------------------------------------------------
|
|
299
|
+
export default function (pi: ExtensionAPI) {
|
|
300
|
+
let lastUserPrompt = "";
|
|
301
|
+
let lastLearnAt = 0;
|
|
302
|
+
let pendingLearn: Promise<void> | null = null;
|
|
303
|
+
// True only between a genuine user `input` and that turn's `agent_settled`.
|
|
304
|
+
// Synthetic re-runs (auto-compaction, retries) emit no `input`, so this
|
|
305
|
+
// stays false and we never learn preferences from a system-generated prompt.
|
|
306
|
+
let freshInput = false;
|
|
307
|
+
|
|
308
|
+
// A genuine user submission arms learning. Extension-injected messages
|
|
309
|
+
// (source "extension") are excluded so we don't learn the taste of our own
|
|
310
|
+
// meta-prompts (e.g. review-subagent instructions).
|
|
311
|
+
pi.on("input", (event) => {
|
|
312
|
+
if (event.source !== "extension") freshInput = true;
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// Apply: inject learned taste before each agent run.
|
|
316
|
+
pi.on("before_agent_start", (event, ctx) => {
|
|
317
|
+
if (freshInput) lastUserPrompt = event.prompt ?? "";
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
const gSettings = loadSettings(GLOBAL_SETTINGS);
|
|
321
|
+
const pSettings = loadSettings(projectSettingsFile(ctx.cwd));
|
|
322
|
+
const gTaste = readTaste(GLOBAL_TASTE);
|
|
323
|
+
const pTaste = readTaste(projectTasteFile(ctx.cwd));
|
|
324
|
+
|
|
325
|
+
const section = buildTasteSection(
|
|
326
|
+
gTaste,
|
|
327
|
+
pTaste,
|
|
328
|
+
gSettings.applyThreshold,
|
|
329
|
+
pSettings.applyThreshold,
|
|
330
|
+
);
|
|
331
|
+
if (!section) return;
|
|
332
|
+
return { systemPrompt: event.systemPrompt + "\n\n" + section };
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
// Learn: after a request fully settles (no retry/compact/follow-up left).
|
|
336
|
+
pi.on("agent_settled", async (_event, ctx) => {
|
|
337
|
+
const gSettings = loadSettings(GLOBAL_SETTINGS);
|
|
338
|
+
const pSettings = loadSettings(projectSettingsFile(ctx.cwd));
|
|
339
|
+
if (!gSettings.learning && !pSettings.learning) return;
|
|
340
|
+
if (!freshInput) return; // synthetic re-run (e.g. auto-compaction) — skip
|
|
341
|
+
freshInput = false; // this genuine turn is now being consumed
|
|
342
|
+
|
|
343
|
+
const prompt = lastUserPrompt.trim();
|
|
344
|
+
if (!prompt || prompt.length < gSettings.minPromptLength) return;
|
|
345
|
+
if (prompt.startsWith("/taste")) return; // don't learn from our own command
|
|
346
|
+
|
|
347
|
+
// Rate-limit window follows whichever scope is actually learning.
|
|
348
|
+
const interval = gSettings.learning
|
|
349
|
+
? gSettings.minIntervalMs
|
|
350
|
+
: pSettings.minIntervalMs;
|
|
351
|
+
if (Date.now() - lastLearnAt < interval) return;
|
|
352
|
+
|
|
353
|
+
const assistantText = lastAssistantText(ctx);
|
|
354
|
+
if (!assistantText) return;
|
|
355
|
+
|
|
356
|
+
const learnings = await extractLearnings(ctx, prompt, assistantText);
|
|
357
|
+
if (learnings.length === 0) return;
|
|
358
|
+
|
|
359
|
+
// Only consume the cooldown once we actually learned something.
|
|
360
|
+
lastLearnAt = Date.now();
|
|
361
|
+
|
|
362
|
+
const task = (async () => {
|
|
363
|
+
let wrote = false;
|
|
364
|
+
for (const l of learnings) {
|
|
365
|
+
const isGlobal = l.scope === "global";
|
|
366
|
+
const settings = isGlobal ? gSettings : pSettings;
|
|
367
|
+
if (!settings.learning) continue;
|
|
368
|
+
const file = isGlobal ? GLOBAL_TASTE : projectTasteFile(ctx.cwd);
|
|
369
|
+
const taste = readTaste(file);
|
|
370
|
+
if (mergeLearning(taste, l.category ?? "Other", l.preference ?? "", settings)) {
|
|
371
|
+
writeTaste(file, taste);
|
|
372
|
+
wrote = true;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (wrote && ctx.hasUI) {
|
|
376
|
+
ctx.ui.notify(
|
|
377
|
+
`TASTE learned ${learnings.length} preference(s)`,
|
|
378
|
+
"info",
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
})();
|
|
382
|
+
pendingLearn = task;
|
|
383
|
+
await task;
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
// Flush any in-flight learning so it isn't lost on exit.
|
|
387
|
+
pi.on("session_shutdown", async () => {
|
|
388
|
+
if (pendingLearn) {
|
|
389
|
+
try {
|
|
390
|
+
await pendingLearn;
|
|
391
|
+
} catch {
|
|
392
|
+
/* ignore */
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
// /taste — view or reset learnings.
|
|
398
|
+
pi.registerCommand("taste", {
|
|
399
|
+
description:
|
|
400
|
+
"Show or reset learned taste. Usage: /taste [reset [global|project]]",
|
|
401
|
+
handler: async (args, ctx) => {
|
|
402
|
+
const parts = args.trim().split(/\s+/).filter(Boolean);
|
|
403
|
+
if (parts[0] === "reset") {
|
|
404
|
+
const scope = parts[1];
|
|
405
|
+
if (scope === "global") {
|
|
406
|
+
safeDelete(GLOBAL_TASTE);
|
|
407
|
+
ctx.ui.notify("Cleared global taste.", "info");
|
|
408
|
+
} else if (scope === "project") {
|
|
409
|
+
safeDelete(projectTasteFile(ctx.cwd));
|
|
410
|
+
ctx.ui.notify("Cleared project taste.", "info");
|
|
411
|
+
} else if (!scope) {
|
|
412
|
+
safeDelete(GLOBAL_TASTE);
|
|
413
|
+
safeDelete(projectTasteFile(ctx.cwd));
|
|
414
|
+
ctx.ui.notify("Cleared global + project taste.", "info");
|
|
415
|
+
} else {
|
|
416
|
+
ctx.ui.notify(
|
|
417
|
+
`Unknown scope '${scope}'. Use 'global' or 'project'.`,
|
|
418
|
+
"warning",
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
const g = readTaste(GLOBAL_TASTE);
|
|
425
|
+
const p = readTaste(projectTasteFile(ctx.cwd));
|
|
426
|
+
const gSettings = loadSettings(GLOBAL_SETTINGS);
|
|
427
|
+
const pSettings = loadSettings(projectSettingsFile(ctx.cwd));
|
|
428
|
+
const count = (t: Taste) =>
|
|
429
|
+
[...t.values()].reduce((n, a) => n + a.length, 0);
|
|
430
|
+
const applied = (t: Taste, th: number) =>
|
|
431
|
+
[...t.values()].flat().filter((i) => i.confidence >= th).length;
|
|
432
|
+
|
|
433
|
+
ctx.ui.notify(
|
|
434
|
+
[
|
|
435
|
+
`TASTE — global : ${count(g)} prefs (${applied(g, gSettings.applyThreshold)} applied) → ${GLOBAL_TASTE}`,
|
|
436
|
+
`TASTE — project: ${count(p)} prefs (${applied(p, pSettings.applyThreshold)} applied) → ${projectTasteFile(ctx.cwd)}`,
|
|
437
|
+
`Run '/taste reset [global|project]' to clear.`,
|
|
438
|
+
].join("\n"),
|
|
439
|
+
"info",
|
|
440
|
+
);
|
|
441
|
+
},
|
|
442
|
+
});
|
|
443
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env pwsh
|
|
2
|
+
# Per-extension installer — Windows / PowerShell
|
|
3
|
+
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
|
+
$ErrorActionPreference = "Stop"
|
|
5
|
+
$extDir = $PSScriptRoot
|
|
6
|
+
if (-not $extDir) { $extDir = Split-Path -Parent $MyInvocation.MyCommand.Path }
|
|
7
|
+
if (-not (Test-Path "$extDir/package.json")) {
|
|
8
|
+
Write-Host " - no package.json — skipping" -ForegroundColor DarkGray
|
|
9
|
+
exit 0
|
|
10
|
+
}
|
|
11
|
+
if (-not (Get-Command npm -ErrorAction SilentlyContinue)) {
|
|
12
|
+
Write-Host " x npm not found — install Node.js 22+" -ForegroundColor Red
|
|
13
|
+
exit 1
|
|
14
|
+
}
|
|
15
|
+
if (Test-Path "$extDir/package-lock.json") {
|
|
16
|
+
Write-Host " - npm ci" -ForegroundColor DarkGray
|
|
17
|
+
npm --prefix $extDir ci --no-audit --no-fund
|
|
18
|
+
} else {
|
|
19
|
+
Write-Host " - npm install" -ForegroundColor DarkGray
|
|
20
|
+
npm --prefix $extDir install --no-audit --no-fund
|
|
21
|
+
}
|
|
22
|
+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
|
23
|
+
Write-Host " + done" -ForegroundColor Green
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Per-extension installer — macOS / Linux
|
|
3
|
+
# Installs npm dependencies for this extension. No-op if no package.json.
|
|
4
|
+
set -eu
|
|
5
|
+
EXT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
6
|
+
if [ ! -f "$EXT_DIR/package.json" ]; then
|
|
7
|
+
echo " · no package.json — skipping"
|
|
8
|
+
exit 0
|
|
9
|
+
fi
|
|
10
|
+
if ! command -v npm >/dev/null 2>&1; then
|
|
11
|
+
echo " ✖ npm not found — install Node.js 22+" >&2
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
if [ -f "$EXT_DIR/package-lock.json" ]; then
|
|
15
|
+
echo " · npm ci"
|
|
16
|
+
npm --prefix "$EXT_DIR" ci --no-audit --no-fund
|
|
17
|
+
else
|
|
18
|
+
echo " · npm install"
|
|
19
|
+
npm --prefix "$EXT_DIR" install --no-audit --no-fund
|
|
20
|
+
fi
|
|
21
|
+
echo " ✓ done"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Todo Extension
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Provides a persistent todo list with overlay widget, slash command, and LLM-callable tool. Todos are tracked across sessions and displayed in a dedicated UI overlay. Supports i18n via optional `@juicesharp/rpiv-i18n` SDK.
|
|
5
|
+
|
|
6
|
+
## Ownership
|
|
7
|
+
- `index.ts` — extension entry, event handlers, overlay lifecycle
|
|
8
|
+
- `todo.ts` — todo tool and command registration
|
|
9
|
+
- `todo-overlay.ts` — TUI overlay widget for todo display
|
|
10
|
+
- `state/` — state management, replay, i18n bridge
|
|
11
|
+
|
|
12
|
+
## Local Contracts
|
|
13
|
+
- Registers tool: `todo` (tool name preserved for session history compatibility)
|
|
14
|
+
- Registers command: `/todos`
|
|
15
|
+
- Widget key: `rpiv-todos` (preserved for compatibility)
|
|
16
|
+
- State replayed from branch on `session_start`, `session_compact`, `session_tree`
|
|
17
|
+
- `replaceState(sessionId, state)` and `replayFromBranch()` from state modules — the store is keyed by `ctx.sessionManager.getSessionId()` so each session (main or in-process subagent) has an independent todo cell; `dropState(sessionId)` on `session_shutdown` prunes ended sessions
|
|
18
|
+
- Handles stale ctx errors during auto-compaction gracefully
|
|
19
|
+
- Batch items support `as` labels (on create) and `refs` (on subsequent items) for creating and referencing tasks in one call
|
|
20
|
+
|
|
21
|
+
## Work Guidance
|
|
22
|
+
- Todo state is session-branch-based and replayed on session events
|
|
23
|
+
- Overlay constructed lazily at first `session_start` with UI
|
|
24
|
+
- `hideCompletedTasksFromPreviousTurn()` called on `agent_start`
|
|
25
|
+
- i18n strings registered once at module init (soft optional peer dependency)
|
|
26
|
+
- Auto-clear: when no active tasks remain (all completed, deleted, or empty), the state resets to empty automatically at `agent_end` and after replay on `session_start`/`session_compact`/`session_tree`. This prevents stale completed tasks from persisting across turns. The clear is in-memory only — session lifecycle handlers re-apply it after branch replay so the empty state survives compaction and session transitions.
|
|
27
|
+
- Tool execution triggers overlay update via `tool_execution_end` event
|
|
28
|
+
- Overlay indentation: task prefix is `" └ "` (first line, └ at col 3) and `" "` (continuation, text at col 5), and the overflow summary line also starts with `" └"`. This aligns the `└` tree glyph one column after the first letter of the spinner phrase (the spinner occupies 2 columns, e.g. `"✻ "`), so the todo overlay sits under the phrase rather than under the spinner animation character
|
|
29
|
+
|
|
30
|
+
## Verification
|
|
31
|
+
- Add todo: use `/todos` command or `todo` tool
|
|
32
|
+
- Verify overlay: check widget displays in TUI
|
|
33
|
+
- Test session persistence: `/new` then verify todos still shown
|
|
34
|
+
- Test compaction: trigger compact, verify todos replay correctly
|
|
35
|
+
- Trigger the agent spinner with at least one todo visible; confirm the `└` glyph in each todo line (and the `+N more` summary line) sits ONE COLUMN AFTER the first letter of the spinner phrase — not under the spinner animation character itself
|
|
36
|
+
|
|
37
|
+
## Child DOX Index
|
|
38
|
+
None
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 juicesharp
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Self-contained config utilities — inlined from @juicesharp/rpiv-config so
|
|
7
|
+
// this extension has zero npm dependencies and can be freely edited.
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
export interface GuidanceFields {
|
|
11
|
+
promptSnippet?: string;
|
|
12
|
+
promptGuidelines?: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function configPath(name: string, file: string = "config.json"): string {
|
|
16
|
+
return join(homedir(), ".config", name, file);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function loadJsonConfig<T>(path: string): T {
|
|
20
|
+
if (!existsSync(path)) return {} as T;
|
|
21
|
+
try {
|
|
22
|
+
const parsed = JSON.parse(readFileSync(path, "utf-8")) as unknown;
|
|
23
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return {} as T;
|
|
24
|
+
return parsed as T;
|
|
25
|
+
} catch {
|
|
26
|
+
return {} as T;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function validateGuidanceFields(fields: unknown): GuidanceFields {
|
|
31
|
+
if (!fields || typeof fields !== "object") return {};
|
|
32
|
+
const g = fields as Record<string, unknown>;
|
|
33
|
+
const result: GuidanceFields = {};
|
|
34
|
+
if (typeof g.promptSnippet === "string" && g.promptSnippet.length > 0) {
|
|
35
|
+
result.promptSnippet = g.promptSnippet;
|
|
36
|
+
}
|
|
37
|
+
if (
|
|
38
|
+
Array.isArray(g.promptGuidelines) &&
|
|
39
|
+
g.promptGuidelines.length > 0 &&
|
|
40
|
+
g.promptGuidelines.every((s) => typeof s === "string" && s.length > 0)
|
|
41
|
+
) {
|
|
42
|
+
result.promptGuidelines = g.promptGuidelines;
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const CONFIG_PATH = configPath("rpiv-todo");
|
|
48
|
+
|
|
49
|
+
interface TodoConfig {
|
|
50
|
+
guidance?: GuidanceFields;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function loadConfig(): TodoConfig {
|
|
54
|
+
return loadJsonConfig<TodoConfig>(CONFIG_PATH);
|
|
55
|
+
}
|