@thothdev/pink 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +90 -0
- package/LICENSE +22 -0
- package/LICENSE-PI.txt +21 -0
- package/NOTICE.md +48 -0
- package/README.md +95 -3
- package/dist/bun/cli.d.ts +5 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +5 -0
- package/dist/bun/cli.js.map +1 -0
- package/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +36 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/bun/runtime-setup.d.ts +2 -0
- package/dist/bun/runtime-setup.d.ts.map +1 -0
- package/dist/bun/runtime-setup.js +12 -0
- package/dist/bun/runtime-setup.js.map +1 -0
- package/dist/bun/sandbox-env-setup.d.ts +2 -0
- package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
- package/dist/bun/sandbox-env-setup.js +4 -0
- package/dist/bun/sandbox-env-setup.js.map +1 -0
- package/dist/bundle/chunks/anthropic-messages-5FHV3XZG.js +6 -0
- package/dist/bundle/chunks/anthropic.js +75 -0
- package/dist/bundle/chunks/azure-openai-responses-KLTRI2FU.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +86 -0
- package/dist/bundle/chunks/chunk-3V45WARH.js +7 -0
- package/dist/bundle/chunks/chunk-4GGCU36O.js +11 -0
- package/dist/bundle/chunks/chunk-5AGIVGSV.js +6 -0
- package/dist/bundle/chunks/chunk-6QGV3IWD.js +6 -0
- package/dist/bundle/chunks/chunk-7CBJINYJ.js +20 -0
- package/dist/bundle/chunks/chunk-7DDKXS2Q.js +2 -0
- package/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
- package/dist/bundle/chunks/chunk-A45IWOC6.js +44 -0
- package/dist/bundle/chunks/chunk-BSS6T6KQ.js +2 -0
- package/dist/bundle/chunks/chunk-CF5GWZHW.js +31 -0
- package/dist/bundle/chunks/chunk-EGE5YVUM.js +82 -0
- package/dist/bundle/chunks/chunk-H76KZMOI.js +2 -0
- package/dist/bundle/chunks/chunk-INGZIYBC.js +4 -0
- package/dist/bundle/chunks/chunk-IUWY2KTF.js +64 -0
- package/dist/bundle/chunks/chunk-JXWJOIH4.js +2 -0
- package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
- package/dist/bundle/chunks/chunk-LPXNMA2W.js +2 -0
- package/dist/bundle/chunks/chunk-LVVZS2NO.js +12 -0
- package/dist/bundle/chunks/chunk-MM3LKT73.js +1222 -0
- package/dist/bundle/chunks/chunk-N43LRJ4N.js +7 -0
- package/dist/bundle/chunks/chunk-NFLURVK3.js +2 -0
- package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
- package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
- package/dist/bundle/chunks/chunk-PMRZO46Y.js +2 -0
- package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
- package/dist/bundle/chunks/chunk-QSDU2SDK.js +16 -0
- package/dist/bundle/chunks/chunk-RDZVAGPR.js +2 -0
- package/dist/bundle/chunks/chunk-RISAW7OQ.js +9 -0
- package/dist/bundle/chunks/chunk-RWO6Q3KK.js +2 -0
- package/dist/bundle/chunks/chunk-T726RZZU.js +131 -0
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
- package/dist/bundle/chunks/chunk-TMTOQ7H7.js +2 -0
- package/dist/bundle/chunks/chunk-TRERZKRC.js +2 -0
- package/dist/bundle/chunks/chunk-UKVNB6C4.js +2 -0
- package/dist/bundle/chunks/chunk-UNXOKDPB.js +2 -0
- package/dist/bundle/chunks/chunk-USJZMAIR.js +2 -0
- package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
- package/dist/bundle/chunks/chunk-Z6I32PHA.js +2 -0
- package/dist/bundle/chunks/cli-MIMUTM5L.js +51 -0
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-7J6REGDV.js +2 -0
- package/dist/bundle/chunks/codemode-worker.js +478 -0
- package/dist/bundle/chunks/easter-egg-3d-RMLF7AC4.js +2 -0
- package/dist/bundle/chunks/execute-MT7QEDSI.js +505 -0
- package/dist/bundle/chunks/github-copilot.js +2 -0
- package/dist/bundle/chunks/google-generative-ai-VPNFZDHO.js +2 -0
- package/dist/bundle/chunks/google-vertex-ZFM23MQ4.js +2 -0
- package/dist/bundle/chunks/https-proxy-agent-LVOO5TPL.js +13 -0
- package/dist/bundle/chunks/image-resize-worker.js +2 -0
- package/dist/bundle/chunks/jiti-loader-GL4HJFAD.js +21 -0
- package/dist/bundle/chunks/jiti-static-loader-2RCDI6B4.js +2 -0
- package/dist/bundle/chunks/kimi-coding.js +2 -0
- package/dist/bundle/chunks/lib-4AVRLBHM.js +9 -0
- package/dist/bundle/chunks/llama-cpp-classify-U4EH6TAM.js +22 -0
- package/dist/bundle/chunks/meta.js +2 -0
- package/dist/bundle/chunks/mistral-conversations-WCAJTBXO.js +5 -0
- package/dist/bundle/chunks/multipart-parser-FMGQ7342.js +3 -0
- package/dist/bundle/chunks/node-AUOGOBCN.js +2 -0
- package/dist/bundle/chunks/node-KCMANYC2.js +16 -0
- package/dist/bundle/chunks/openai-chatgpt.js +75 -0
- package/dist/bundle/chunks/openai-codex-responses-JQR3IK2C.js +10 -0
- package/dist/bundle/chunks/openai-codex.js +75 -0
- package/dist/bundle/chunks/openai-completions-27RKPL37.js +7 -0
- package/dist/bundle/chunks/openai-decisions-MJYPUCLX.js +5 -0
- package/dist/bundle/chunks/openai-responses-I2TBW7OL.js +4 -0
- package/dist/bundle/chunks/openrouter-images-WBAVKHHY.js +2 -0
- package/dist/bundle/chunks/openrouter.js +75 -0
- package/dist/bundle/chunks/pi-messages-S7RKCD5K.js +8 -0
- package/dist/bundle/chunks/radius.js +75 -0
- package/dist/bundle/chunks/runtime-GJOZRI5I.js +2 -0
- package/dist/bundle/chunks/src-QKGKDFSU.js +4 -0
- package/dist/bundle/chunks/typesafe-system-one-4C7ULOVP.js +2 -0
- package/dist/bundle/chunks/virtual-modules-BQKXTZUC.js +2 -0
- package/dist/bundle/chunks/xai.js +2 -0
- package/dist/bundle/cli-runtime.js +3 -0
- package/dist/bundle/cli.js +5 -0
- package/dist/bundle/index.js +2 -0
- package/dist/bundle/rpc-entry.js +3 -0
- package/dist/cli/args.d.ts +62 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +473 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/auth-check.d.ts +19 -0
- package/dist/cli/auth-check.d.ts.map +1 -0
- package/dist/cli/auth-check.js +50 -0
- package/dist/cli/auth-check.js.map +1 -0
- package/dist/cli/auth-command.d.ts +24 -0
- package/dist/cli/auth-command.d.ts.map +1 -0
- package/dist/cli/auth-command.js +103 -0
- package/dist/cli/auth-command.js.map +1 -0
- package/dist/cli/config-selector.d.ts +16 -0
- package/dist/cli/config-selector.d.ts.map +1 -0
- package/dist/cli/config-selector.js +32 -0
- package/dist/cli/config-selector.js.map +1 -0
- package/dist/cli/credential-print.d.ts +13 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +76 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/cli/file-processor.d.ts +15 -0
- package/dist/cli/file-processor.d.ts.map +1 -0
- package/dist/cli/file-processor.js +71 -0
- package/dist/cli/file-processor.js.map +1 -0
- package/dist/cli/initial-message.d.ts +18 -0
- package/dist/cli/initial-message.d.ts.map +1 -0
- package/dist/cli/initial-message.js +22 -0
- package/dist/cli/initial-message.js.map +1 -0
- package/dist/cli/list-models.d.ts +9 -0
- package/dist/cli/list-models.d.ts.map +1 -0
- package/dist/cli/list-models.js +98 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/project-trust.d.ts +10 -0
- package/dist/cli/project-trust.d.ts.map +1 -0
- package/dist/cli/project-trust.js +48 -0
- package/dist/cli/project-trust.js.map +1 -0
- package/dist/cli/session-picker.d.ts +10 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +36 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli/setup.d.ts +2 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +12 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +20 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +193 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +6 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +126 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +534 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +119 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/core/agent-session-runtime.js +317 -0
- package/dist/core/agent-session-runtime.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +86 -0
- package/dist/core/agent-session-services.d.ts.map +1 -0
- package/dist/core/agent-session-services.js +147 -0
- package/dist/core/agent-session-services.js.map +1 -0
- package/dist/core/agent-session.d.ts +935 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +3636 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-guidance.d.ts +5 -0
- package/dist/core/auth-guidance.d.ts.map +1 -0
- package/dist/core/auth-guidance.js +21 -0
- package/dist/core/auth-guidance.js.map +1 -0
- package/dist/core/auth-storage.d.ts +72 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +433 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +32 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +101 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/bug-report-upload.d.ts +12 -0
- package/dist/core/bug-report-upload.d.ts.map +1 -0
- package/dist/core/bug-report-upload.js +22 -0
- package/dist/core/bug-report-upload.js.map +1 -0
- package/dist/core/bug-report.d.ts +184 -0
- package/dist/core/bug-report.d.ts.map +1 -0
- package/dist/core/bug-report.js +292 -0
- package/dist/core/bug-report.js.map +1 -0
- package/dist/core/cache-stats.d.ts +49 -0
- package/dist/core/cache-stats.d.ts.map +1 -0
- package/dist/core/cache-stats.js +112 -0
- package/dist/core/cache-stats.js.map +1 -0
- package/dist/core/cache-warmer.d.ts +103 -0
- package/dist/core/cache-warmer.d.ts.map +1 -0
- package/dist/core/cache-warmer.js +356 -0
- package/dist/core/cache-warmer.js.map +1 -0
- package/dist/core/client-identity.d.ts +8 -0
- package/dist/core/client-identity.d.ts.map +1 -0
- package/dist/core/client-identity.js +15 -0
- package/dist/core/client-identity.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +98 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +250 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +145 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +749 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +7 -0
- package/dist/core/compaction/index.d.ts.map +1 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/index.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +45 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +148 -0
- package/dist/core/compaction/utils.js.map +1 -0
- package/dist/core/crash-log.d.ts +27 -0
- package/dist/core/crash-log.d.ts.map +1 -0
- package/dist/core/crash-log.js +140 -0
- package/dist/core/crash-log.js.map +1 -0
- package/dist/core/defaults.d.ts +4 -0
- package/dist/core/defaults.d.ts.map +1 -0
- package/dist/core/defaults.js +11 -0
- package/dist/core/defaults.js.map +1 -0
- package/dist/core/diagnostics.d.ts +15 -0
- package/dist/core/diagnostics.d.ts.map +1 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/diagnostics.js.map +1 -0
- package/dist/core/event-bus.d.ts +9 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/exec.d.ts +29 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +75 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/experimental.d.ts +2 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +4 -0
- package/dist/core/experimental.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +249 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +37 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +228 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +1076 -0
- package/dist/core/export-html/template.html +56 -0
- package/dist/core/export-html/template.js +1924 -0
- package/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +110 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
- package/dist/core/export-html/vendor/marked.min.js +79 -0
- package/dist/core/extensions/index.d.ts +12 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/index.js +9 -0
- package/dist/core/extensions/index.js.map +1 -0
- package/dist/core/extensions/jiti-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-loader.js +4 -0
- package/dist/core/extensions/jiti-loader.js.map +1 -0
- package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
- package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
- package/dist/core/extensions/jiti-static-loader.js +4 -0
- package/dist/core/extensions/jiti-static-loader.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +23 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +704 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +215 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +1238 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1757 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +48 -0
- package/dist/core/extensions/types.js.map +1 -0
- package/dist/core/extensions/virtual-modules.d.ts +3 -0
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -0
- package/dist/core/extensions/virtual-modules.js +41 -0
- package/dist/core/extensions/virtual-modules.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts +20 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/core/extensions/wrapper.js +22 -0
- package/dist/core/extensions/wrapper.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +64 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +338 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +98 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/key-id-schema.d.ts +6 -0
- package/dist/core/key-id-schema.d.ts.map +1 -0
- package/dist/core/key-id-schema.js +16 -0
- package/dist/core/key-id-schema.js.map +1 -0
- package/dist/core/keybindings-schema.d.ts +4 -0
- package/dist/core/keybindings-schema.d.ts.map +1 -0
- package/dist/core/keybindings-schema.js +16 -0
- package/dist/core/keybindings-schema.js.map +1 -0
- package/dist/core/keybindings.d.ts +560 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +324 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/mcp-servers.d.ts +139 -0
- package/dist/core/mcp-servers.d.ts.map +1 -0
- package/dist/core/mcp-servers.js +232 -0
- package/dist/core/mcp-servers.js.map +1 -0
- package/dist/core/messages.d.ts +77 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +124 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-config.d.ts +2312 -0
- package/dist/core/model-config.d.ts.map +1 -0
- package/dist/core/model-config.js +168 -0
- package/dist/core/model-config.js.map +1 -0
- package/dist/core/model-registry.d.ts +63 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +144 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +137 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +485 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/model-runtime.d.ts +145 -0
- package/dist/core/model-runtime.d.ts.map +1 -0
- package/dist/core/model-runtime.js +767 -0
- package/dist/core/model-runtime.js.map +1 -0
- package/dist/core/models-store.d.ts +22 -0
- package/dist/core/models-store.d.ts.map +1 -0
- package/dist/core/models-store.js +115 -0
- package/dist/core/models-store.js.map +1 -0
- package/dist/core/nested-tool-calls.d.ts +103 -0
- package/dist/core/nested-tool-calls.d.ts.map +1 -0
- package/dist/core/nested-tool-calls.js +179 -0
- package/dist/core/nested-tool-calls.js.map +1 -0
- package/dist/core/output-guard.d.ts +7 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +89 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-manager.d.ts +217 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +2224 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/pi-manifest.d.ts +8 -0
- package/dist/core/pi-manifest.d.ts.map +1 -0
- package/dist/core/pi-manifest.js +26 -0
- package/dist/core/pi-manifest.js.map +1 -0
- package/dist/core/project-trust.d.ts +15 -0
- package/dist/core/project-trust.d.ts.map +1 -0
- package/dist/core/project-trust.js +60 -0
- package/dist/core/project-trust.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +59 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +267 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/provider-composer.d.ts +81 -0
- package/dist/core/provider-composer.d.ts.map +1 -0
- package/dist/core/provider-composer.js +492 -0
- package/dist/core/provider-composer.js.map +1 -0
- package/dist/core/radius.d.ts +7 -0
- package/dist/core/radius.d.ts.map +1 -0
- package/dist/core/radius.js +10 -0
- package/dist/core/radius.js.map +1 -0
- package/dist/core/remote-catalog-provider.d.ts +23 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -0
- package/dist/core/remote-catalog-provider.js +190 -0
- package/dist/core/remote-catalog-provider.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +247 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +230 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +1010 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -0
- package/dist/core/runtime-credentials.js +39 -0
- package/dist/core/runtime-credentials.js.map +1 -0
- package/dist/core/sdk.d.ts +117 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +327 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/session-cwd.d.ts +19 -0
- package/dist/core/session-cwd.d.ts.map +1 -0
- package/dist/core/session-cwd.js +38 -0
- package/dist/core/session-cwd.js.map +1 -0
- package/dist/core/session-export.d.ts +8 -0
- package/dist/core/session-export.d.ts.map +1 -0
- package/dist/core/session-export.js +33 -0
- package/dist/core/session-export.js.map +1 -0
- package/dist/core/session-manager.d.ts +416 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1523 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/settings-defaults.d.ts +66 -0
- package/dist/core/settings-defaults.d.ts.map +1 -0
- package/dist/core/settings-defaults.js +67 -0
- package/dist/core/settings-defaults.js.map +1 -0
- package/dist/core/settings-diagnostics.d.ts +9 -0
- package/dist/core/settings-diagnostics.d.ts.map +1 -0
- package/dist/core/settings-diagnostics.js +21 -0
- package/dist/core/settings-diagnostics.js.map +1 -0
- package/dist/core/settings-manager.d.ts +251 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +1143 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/settings-schema.d.ts +230 -0
- package/dist/core/settings-schema.d.ts.map +1 -0
- package/dist/core/settings-schema.js +291 -0
- package/dist/core/settings-schema.js.map +1 -0
- package/dist/core/skills.d.ts +63 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +412 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +15 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +28 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/source-info.d.ts +26 -0
- package/dist/core/source-info.d.ts.map +1 -0
- package/dist/core/source-info.js +35 -0
- package/dist/core/source-info.js.map +1 -0
- package/dist/core/system-prompt.d.ts +77 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +152 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/telemetry.d.ts +3 -0
- package/dist/core/telemetry.d.ts.map +1 -0
- package/dist/core/telemetry.js +9 -0
- package/dist/core/telemetry.js.map +1 -0
- package/dist/core/timings.d.ts +10 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +41 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +100 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +333 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +101 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +421 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +44 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +147 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-queue.js +52 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +42 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +251 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +41 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +254 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +43 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +129 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +41 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +126 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +63 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +214 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +99 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/powershell.d.ts +16 -0
- package/dist/core/tools/powershell.d.ts.map +1 -0
- package/dist/core/tools/powershell.js +39 -0
- package/dist/core/tools/powershell.js.map +1 -0
- package/dist/core/tools/read.d.ts +55 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +186 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/render-utils.d.ts +50 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +158 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/renderers/bash.d.ts +12 -0
- package/dist/core/tools/renderers/bash.d.ts.map +1 -0
- package/dist/core/tools/renderers/bash.js +89 -0
- package/dist/core/tools/renderers/bash.js.map +1 -0
- package/dist/core/tools/renderers/edit.d.ts +23 -0
- package/dist/core/tools/renderers/edit.d.ts.map +1 -0
- package/dist/core/tools/renderers/edit.js +168 -0
- package/dist/core/tools/renderers/edit.js.map +1 -0
- package/dist/core/tools/renderers/find.d.ts +10 -0
- package/dist/core/tools/renderers/find.d.ts.map +1 -0
- package/dist/core/tools/renderers/find.js +64 -0
- package/dist/core/tools/renderers/find.js.map +1 -0
- package/dist/core/tools/renderers/grep.d.ts +10 -0
- package/dist/core/tools/renderers/grep.d.ts.map +1 -0
- package/dist/core/tools/renderers/grep.js +69 -0
- package/dist/core/tools/renderers/grep.js.map +1 -0
- package/dist/core/tools/renderers/index.d.ts +28 -0
- package/dist/core/tools/renderers/index.d.ts.map +1 -0
- package/dist/core/tools/renderers/index.js +47 -0
- package/dist/core/tools/renderers/index.js.map +1 -0
- package/dist/core/tools/renderers/ls.d.ts +10 -0
- package/dist/core/tools/renderers/ls.d.ts.map +1 -0
- package/dist/core/tools/renderers/ls.js +58 -0
- package/dist/core/tools/renderers/ls.js.map +1 -0
- package/dist/core/tools/renderers/read.d.ts +11 -0
- package/dist/core/tools/renderers/read.d.ts.map +1 -0
- package/dist/core/tools/renderers/read.js +126 -0
- package/dist/core/tools/renderers/read.js.map +1 -0
- package/dist/core/tools/renderers/write.d.ts +10 -0
- package/dist/core/tools/renderers/write.d.ts.map +1 -0
- package/dist/core/tools/renderers/write.js +153 -0
- package/dist/core/tools/renderers/write.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +16 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +38 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +84 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +244 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/write.d.ts +30 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +61 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/core/trust-manager.d.ts +36 -0
- package/dist/core/trust-manager.d.ts.map +1 -0
- package/dist/core/trust-manager.js +204 -0
- package/dist/core/trust-manager.js.map +1 -0
- package/dist/core/usage-totals.d.ts +21 -0
- package/dist/core/usage-totals.d.ts.map +1 -0
- package/dist/core/usage-totals.js +79 -0
- package/dist/core/usage-totals.js.map +1 -0
- package/dist/core/virtual-models.d.ts +117 -0
- package/dist/core/virtual-models.d.ts.map +1 -0
- package/dist/core/virtual-models.js +124 -0
- package/dist/core/virtual-models.js.map +1 -0
- package/dist/extensions/codemode/execute.d.ts +16 -0
- package/dist/extensions/codemode/execute.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.js +740 -0
- package/dist/extensions/codemode/execute.js.map +1 -0
- package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
- package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.lazy.js +3 -0
- package/dist/extensions/codemode/execute.lazy.js.map +1 -0
- package/dist/extensions/codemode/index.d.ts +21 -0
- package/dist/extensions/codemode/index.d.ts.map +1 -0
- package/dist/extensions/codemode/index.js +33 -0
- package/dist/extensions/codemode/index.js.map +1 -0
- package/dist/extensions/codemode/renderer.d.ts +12 -0
- package/dist/extensions/codemode/renderer.d.ts.map +1 -0
- package/dist/extensions/codemode/renderer.js +143 -0
- package/dist/extensions/codemode/renderer.js.map +1 -0
- package/dist/extensions/codemode/tool.d.ts +124 -0
- package/dist/extensions/codemode/tool.d.ts.map +1 -0
- package/dist/extensions/codemode/tool.js +288 -0
- package/dist/extensions/codemode/tool.js.map +1 -0
- package/dist/extensions/codemode/worker.d.ts +7 -0
- package/dist/extensions/codemode/worker.d.ts.map +1 -0
- package/dist/extensions/codemode/worker.js +7 -0
- package/dist/extensions/codemode/worker.js.map +1 -0
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +13 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/llama/client.d.ts +69 -0
- package/dist/extensions/llama/client.d.ts.map +1 -0
- package/dist/extensions/llama/client.js +313 -0
- package/dist/extensions/llama/client.js.map +1 -0
- package/dist/extensions/llama/huggingface.d.ts +23 -0
- package/dist/extensions/llama/huggingface.d.ts.map +1 -0
- package/dist/extensions/llama/huggingface.js +141 -0
- package/dist/extensions/llama/huggingface.js.map +1 -0
- package/dist/extensions/llama/index.d.ts +3 -0
- package/dist/extensions/llama/index.d.ts.map +1 -0
- package/dist/extensions/llama/index.js +219 -0
- package/dist/extensions/llama/index.js.map +1 -0
- package/dist/extensions/llama/provider.d.ts +12 -0
- package/dist/extensions/llama/provider.d.ts.map +1 -0
- package/dist/extensions/llama/provider.js +236 -0
- package/dist/extensions/llama/provider.js.map +1 -0
- package/dist/extensions/llama/ui.d.ts +42 -0
- package/dist/extensions/llama/ui.d.ts.map +1 -0
- package/dist/extensions/llama/ui.js +416 -0
- package/dist/extensions/llama/ui.js.map +1 -0
- package/dist/extensions/mcp/cli.d.ts +21 -0
- package/dist/extensions/mcp/cli.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.js +494 -0
- package/dist/extensions/mcp/cli.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
- package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.lazy.js +3 -0
- package/dist/extensions/mcp/cli.lazy.js.map +1 -0
- package/dist/extensions/mcp/config.d.ts +84 -0
- package/dist/extensions/mcp/config.d.ts.map +1 -0
- package/dist/extensions/mcp/config.js +195 -0
- package/dist/extensions/mcp/config.js.map +1 -0
- package/dist/extensions/mcp/index.d.ts +79 -0
- package/dist/extensions/mcp/index.d.ts.map +1 -0
- package/dist/extensions/mcp/index.js +1205 -0
- package/dist/extensions/mcp/index.js.map +1 -0
- package/dist/extensions/mcp/log.d.ts +16 -0
- package/dist/extensions/mcp/log.d.ts.map +1 -0
- package/dist/extensions/mcp/log.js +66 -0
- package/dist/extensions/mcp/log.js.map +1 -0
- package/dist/extensions/mcp/oauth.d.ts +102 -0
- package/dist/extensions/mcp/oauth.d.ts.map +1 -0
- package/dist/extensions/mcp/oauth.js +428 -0
- package/dist/extensions/mcp/oauth.js.map +1 -0
- package/dist/extensions/mcp/resources.d.ts +36 -0
- package/dist/extensions/mcp/resources.d.ts.map +1 -0
- package/dist/extensions/mcp/resources.js +261 -0
- package/dist/extensions/mcp/resources.js.map +1 -0
- package/dist/extensions/mcp/runtime.d.ts +98 -0
- package/dist/extensions/mcp/runtime.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.js +378 -0
- package/dist/extensions/mcp/runtime.js.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.js +3 -0
- package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
- package/dist/extensions/mcp/tools.d.ts +86 -0
- package/dist/extensions/mcp/tools.d.ts.map +1 -0
- package/dist/extensions/mcp/tools.js +309 -0
- package/dist/extensions/mcp/tools.js.map +1 -0
- package/dist/extensions/mcp/ui.d.ts +60 -0
- package/dist/extensions/mcp/ui.d.ts.map +1 -0
- package/dist/extensions/mcp/ui.js +186 -0
- package/dist/extensions/mcp/ui.js.map +1 -0
- package/dist/extensions/tool-search/index.d.ts +12 -0
- package/dist/extensions/tool-search/index.d.ts.map +1 -0
- package/dist/extensions/tool-search/index.js +15 -0
- package/dist/extensions/tool-search/index.js.map +1 -0
- package/dist/extensions/tool-search/tool.d.ts +71 -0
- package/dist/extensions/tool-search/tool.d.ts.map +1 -0
- package/dist/extensions/tool-search/tool.js +187 -0
- package/dist/extensions/tool-search/tool.js.map +1 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +16 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +827 -0
- package/dist/main.js.map +1 -0
- package/dist/migrations.d.ts +33 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +282 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/index.d.ts +10 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +8 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/bug-report.d.ts +16 -0
- package/dist/modes/interactive/bug-report.d.ts.map +1 -0
- package/dist/modes/interactive/bug-report.js +210 -0
- package/dist/modes/interactive/bug-report.js.map +1 -0
- package/dist/modes/interactive/chat-viewport.d.ts +20 -0
- package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
- package/dist/modes/interactive/chat-viewport.js +28 -0
- package/dist/modes/interactive/chat-viewport.js.map +1 -0
- package/dist/modes/interactive/components/armin.d.ts +37 -0
- package/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/dist/modes/interactive/components/armin.js +335 -0
- package/dist/modes/interactive/components/armin.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +26 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +158 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/auth-url.d.ts +14 -0
- package/dist/modes/interactive/components/auth-url.d.ts.map +1 -0
- package/dist/modes/interactive/components/auth-url.js +37 -0
- package/dist/modes/interactive/components/auth-url.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +38 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +178 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +54 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +17 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +54 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +17 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +55 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +102 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +771 -0
- package/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +30 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +115 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/dist/modes/interactive/components/custom-entry.d.ts +21 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-entry.js +58 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +22 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-message.js +88 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/dist/modes/interactive/components/diff.js +133 -0
- package/dist/modes/interactive/components/diff.js.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.js +40 -0
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -0
- package/dist/modes/interactive/components/easter-egg-3d.d.ts +104 -0
- package/dist/modes/interactive/components/easter-egg-3d.d.ts.map +1 -0
- package/dist/modes/interactive/components/easter-egg-3d.js +1139 -0
- package/dist/modes/interactive/components/easter-egg-3d.js.map +1 -0
- package/dist/modes/interactive/components/easter-egg-3d.lazy.d.ts +6 -0
- package/dist/modes/interactive/components/easter-egg-3d.lazy.d.ts.map +1 -0
- package/dist/modes/interactive/components/easter-egg-3d.lazy.js +23 -0
- package/dist/modes/interactive/components/easter-egg-3d.lazy.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +24 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +103 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts +25 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-input.js +67 -0
- package/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +27 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +87 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.js +109 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +39 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +265 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +33 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +34 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +36 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +54 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +194 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.js +19 -0
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
- package/dist/modes/interactive/components/mermaid.d.ts +11 -0
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
- package/dist/modes/interactive/components/mermaid.js +75 -0
- package/dist/modes/interactive/components/mermaid.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +60 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +361 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +39 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +166 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/pi-logo.d.ts +19 -0
- package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -0
- package/dist/modes/interactive/components/pi-logo.js +37 -0
- package/dist/modes/interactive/components/pi-logo.js.map +1 -0
- package/dist/modes/interactive/components/radius-login-selector.d.ts +15 -0
- package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/radius-login-selector.js +85 -0
- package/dist/modes/interactive/components/radius-login-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +46 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +326 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +155 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +893 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +98 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +753 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-submenu.js +165 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +39 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +18 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +57 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/status-indicator.d.ts +30 -0
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
- package/dist/modes/interactive/components/status-indicator.js +67 -0
- package/dist/modes/interactive/components/status-indicator.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js +50 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/dist/modes/interactive/components/themed-text.d.ts +17 -0
- package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/themed-text.js +29 -0
- package/dist/modes/interactive/components/themed-text.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +23 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.js +109 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +73 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +324 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +94 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +1247 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/trust-selector.d.ts +23 -0
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/trust-selector.js +91 -0
- package/dist/modes/interactive/components/trust-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +114 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +16 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +50 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +48 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.js +66 -0
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/dist/modes/interactive/external-editor.d.ts +12 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -0
- package/dist/modes/interactive/external-editor.js +38 -0
- package/dist/modes/interactive/external-editor.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +485 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +5929 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts +7 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.js +34 -0
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
- package/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -0
- package/dist/modes/interactive/model-search.js +15 -0
- package/dist/modes/interactive/model-search.js.map +1 -0
- package/dist/modes/interactive/program-status-reporter.d.ts +34 -0
- package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
- package/dist/modes/interactive/program-status-reporter.js +110 -0
- package/dist/modes/interactive/program-status-reporter.js.map +1 -0
- package/dist/modes/interactive/session-share.d.ts +18 -0
- package/dist/modes/interactive/session-share.d.ts.map +1 -0
- package/dist/modes/interactive/session-share.js +195 -0
- package/dist/modes/interactive/session-share.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +78 -0
- package/dist/modes/interactive/theme/extra-themes.json +2722 -0
- package/dist/modes/interactive/theme/light.json +78 -0
- package/dist/modes/interactive/theme/pink.json +91 -0
- package/dist/modes/interactive/theme/system-theme.d.ts +55 -0
- package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/system-theme.js +546 -0
- package/dist/modes/interactive/theme/system-theme.js.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +81 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.js +210 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.d.ts +28 -0
- package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.js +105 -0
- package/dist/modes/interactive/theme/theme-schema.js.map +1 -0
- package/dist/modes/interactive/theme/theme-tokens.d.ts +257 -0
- package/dist/modes/interactive/theme/theme-tokens.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-tokens.js +94 -0
- package/dist/modes/interactive/theme/theme-tokens.js.map +1 -0
- package/dist/modes/interactive/theme/theme.d.ts +155 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +905 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/modes/interactive/tui-renderer.d.ts +22 -0
- package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
- package/dist/modes/interactive/tui-renderer.js +67 -0
- package/dist/modes/interactive/tui-renderer.js.map +1 -0
- package/dist/modes/json-event.d.ts +34 -0
- package/dist/modes/json-event.d.ts.map +1 -0
- package/dist/modes/json-event.js +29 -0
- package/dist/modes/json-event.js.map +1 -0
- package/dist/modes/print-mode.d.ts +28 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +146 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/modes/rpc/jsonl.js +49 -0
- package/dist/modes/rpc/jsonl.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +254 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +499 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +655 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +478 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/mux/pink.mjs +1004 -0
- package/dist/package-manager-cli.d.ts +9 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +1002 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/rpc-entry.d.ts +3 -0
- package/dist/rpc-entry.d.ts.map +1 -0
- package/dist/rpc-entry.js +11 -0
- package/dist/rpc-entry.js.map +1 -0
- package/dist/utils/abort.d.ts +5 -0
- package/dist/utils/abort.d.ts.map +1 -0
- package/dist/utils/abort.js +48 -0
- package/dist/utils/abort.js.map +1 -0
- package/dist/utils/ansi.d.ts +10 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +71 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +22 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +165 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/child-process.d.ts +18 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +106 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/clipboard-command.d.ts +7 -0
- package/dist/utils/clipboard-command.d.ts.map +1 -0
- package/dist/utils/clipboard-command.js +48 -0
- package/dist/utils/clipboard-command.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +214 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard.d.ts +6 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +162 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/utils/exif-orientation.d.ts.map +1 -0
- package/dist/utils/exif-orientation.js +157 -0
- package/dist/utils/exif-orientation.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +8 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +27 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/fs-watch.d.ts +5 -0
- package/dist/utils/fs-watch.d.ts.map +1 -0
- package/dist/utils/fs-watch.js +25 -0
- package/dist/utils/fs-watch.js.map +1 -0
- package/dist/utils/git.d.ts +26 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +195 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +22 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +84 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-process.d.ts +18 -0
- package/dist/utils/image-process.d.ts.map +1 -0
- package/dist/utils/image-process.js +83 -0
- package/dist/utils/image-process.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +42 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +129 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +32 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +16 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +96 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +7 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/management-http.d.ts +25 -0
- package/dist/utils/management-http.d.ts.map +1 -0
- package/dist/utils/management-http.js +54 -0
- package/dist/utils/management-http.js.map +1 -0
- package/dist/utils/mime.d.ts +3 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +110 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/open-browser.d.ts +9 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +22 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/output-files.d.ts +15 -0
- package/dist/utils/output-files.d.ts.map +1 -0
- package/dist/utils/output-files.js +30 -0
- package/dist/utils/output-files.js.map +1 -0
- package/dist/utils/paths.d.ts +34 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +115 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/photon.d.ts +21 -0
- package/dist/utils/photon.d.ts.map +1 -0
- package/dist/utils/photon.js +121 -0
- package/dist/utils/photon.js.map +1 -0
- package/dist/utils/pi-user-agent.d.ts +3 -0
- package/dist/utils/pi-user-agent.d.ts.map +1 -0
- package/dist/utils/pi-user-agent.js +6 -0
- package/dist/utils/pi-user-agent.js.map +1 -0
- package/dist/utils/shell.d.ts +32 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +221 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts +13 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +184 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/text.d.ts +8 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +9 -0
- package/dist/utils/text.js.map +1 -0
- package/dist/utils/tool-result-images.d.ts +21 -0
- package/dist/utils/tool-result-images.d.ts.map +1 -0
- package/dist/utils/tool-result-images.js +48 -0
- package/dist/utils/tool-result-images.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +13 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +344 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/dist/utils/version-check.d.ts +19 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +79 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/utils/windows-self-update.d.ts.map +1 -0
- package/dist/utils/windows-self-update.js +77 -0
- package/dist/utils/windows-self-update.js.map +1 -0
- package/dist/utils/wsl.d.ts +3 -0
- package/dist/utils/wsl.d.ts.map +1 -0
- package/dist/utils/wsl.js +15 -0
- package/dist/utils/wsl.js.map +1 -0
- package/dist/utils/zip.d.ts +7 -0
- package/dist/utils/zip.d.ts.map +1 -0
- package/dist/utils/zip.js +60 -0
- package/dist/utils/zip.js.map +1 -0
- package/docs/PINK.md +35 -0
- package/docs/cli-integration.md +106 -0
- package/docs/cli.md +333 -0
- package/docs/codemode.md +230 -0
- package/docs/compaction.md +463 -0
- package/docs/configuration.md +47 -0
- package/docs/custom-provider.md +225 -0
- package/docs/docs.json +216 -0
- package/docs/environment-variables.md +100 -0
- package/docs/extensions.md +400 -0
- package/docs/how-pink-works.md +49 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +39 -0
- package/docs/json.md +226 -0
- package/docs/keybindings.md +194 -0
- package/docs/llama-cpp.md +121 -0
- package/docs/mcp.md +272 -0
- package/docs/message-types.md +279 -0
- package/docs/models-configuration.md +196 -0
- package/docs/models.md +224 -0
- package/docs/nvidia-rtx-llama-cpp.md +96 -0
- package/docs/packages.md +129 -0
- package/docs/prompt-templates.md +59 -0
- package/docs/providers.md +234 -0
- package/docs/quickstart.md +116 -0
- package/docs/rpc-commands.md +860 -0
- package/docs/rpc-extension-ui.md +200 -0
- package/docs/rpc.md +193 -0
- package/docs/sdk.md +147 -0
- package/docs/security.md +96 -0
- package/docs/session-format.md +293 -0
- package/docs/sessions.md +61 -0
- package/docs/settings.md +172 -0
- package/docs/shell-aliases.md +93 -0
- package/docs/skills.md +93 -0
- package/docs/slash-commands.md +58 -0
- package/docs/terminal-setup.md +233 -0
- package/docs/termux.md +117 -0
- package/docs/themes.md +138 -0
- package/docs/tmux.md +55 -0
- package/docs/tui.md +195 -0
- package/docs/usage.md +94 -0
- package/docs/virtual-models.md +114 -0
- package/docs/windows.md +81 -0
- package/examples/README.md +36 -0
- package/examples/extensions/README.md +214 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/border-status-editor.ts +150 -0
- package/examples/extensions/built-in-tool-renderer.ts +225 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +117 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +617 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +405 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/examples/extensions/debug-provider.ts +90 -0
- package/examples/extensions/dirty-repo-guard.ts +56 -0
- package/examples/extensions/doom-overlay/README.md +46 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_pink.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +55 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +81 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +15 -0
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/entry-renderer.ts +41 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/examples/extensions/gondolin/index.ts +531 -0
- package/examples/extensions/gondolin/package-lock.json +185 -0
- package/examples/extensions/gondolin/package.json +19 -0
- package/examples/extensions/handoff.ts +190 -0
- package/examples/extensions/hello.ts +26 -0
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/inline-bash.ts +94 -0
- package/examples/extensions/input-transform-streaming.ts +39 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +196 -0
- package/examples/extensions/jev-router.ts +113 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +353 -0
- package/examples/extensions/modal-editor.ts +85 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +57 -0
- package/examples/extensions/overlay-qa-tests.ts +1450 -0
- package/examples/extensions/overlay-test.ts +153 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +66 -0
- package/examples/extensions/plan-mode/index.ts +394 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +436 -0
- package/examples/extensions/project-trust.ts +64 -0
- package/examples/extensions/prompt-customizer.ts +49 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +118 -0
- package/examples/extensions/question.ts +286 -0
- package/examples/extensions/questionnaire.ts +470 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +118 -0
- package/examples/extensions/sandbox/index.ts +321 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -0
- package/examples/extensions/status-line.ts +32 -0
- package/examples/extensions/structured-output.ts +65 -0
- package/examples/extensions/subagent/README.md +177 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +164 -0
- package/examples/extensions/subagent/background.ts +143 -0
- package/examples/extensions/subagent/external.ts +519 -0
- package/examples/extensions/subagent/index.ts +1058 -0
- package/examples/extensions/subagent/pink-i18n.ts +58 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +199 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1008 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +297 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +195 -0
- package/examples/extensions/widget-placement.ts +9 -0
- package/examples/extensions/with-deps/index.ts +32 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/extensions/working-message-test.ts +25 -0
- package/examples/rpc-client.ts +35 -0
- package/examples/rpc-extension-ui.ts +661 -0
- package/examples/sdk/01-minimal.ts +26 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +75 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +48 -0
- package/examples/sdk/06-extensions.ts +99 -0
- package/examples/sdk/07-context-files.ts +47 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +34 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +52 -0
- package/examples/sdk/12-full-control.ts +74 -0
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/14-codemode-mcp.ts +61 -0
- package/examples/sdk/README.md +141 -0
- package/extensions/pink-agente.ts +157 -0
- package/extensions/pink-context.ts +116 -0
- package/extensions/pink-hooks.ts +175 -0
- package/extensions/pink-i18n.ts +58 -0
- package/extensions/pink-loop.ts +192 -0
- package/extensions/pink-lsp.ts +361 -0
- package/extensions/pink-mcp-server.mjs +69 -0
- package/extensions/pink-memory.ts +233 -0
- package/extensions/pink-natives.ts +207 -0
- package/extensions/pink-notify.ts +107 -0
- package/extensions/pink-permissions.ts +254 -0
- package/extensions/pink-review.ts +129 -0
- package/extensions/pink-rules.ts +199 -0
- package/extensions/pink-sandbox.cs +220 -0
- package/extensions/pink-sandbox.ts +297 -0
- package/extensions/pink-sessions-bus.ts +294 -0
- package/extensions/pink-shell-bg.ts +286 -0
- package/extensions/pink-skill-propose.ts +139 -0
- package/extensions/pink-skills.ts +64 -0
- package/extensions/pink-tela-borda.cs +130 -0
- package/extensions/pink-tela.ts +650 -0
- package/extensions/pink-ui.ts +1604 -0
- package/extensions/pink-web.ts +184 -0
- package/package.json +120 -6
- package/schemas/keybindings.schema.json +393 -0
- package/schemas/models.schema.json +1211 -0
- package/schemas/settings.schema.json +783 -0
- package/schemas/theme.schema.json +365 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
// Ferramentas opcionais do Pink (owner 2026-11-15, card 1dfwh7kffk2), carregadas com a pink-ui. Cada pessoa escolhe no
|
|
2
|
+
// /ferramentas; vem tudo desligado e a escolha fica em <pasta do agente>/pink-tools.json:
|
|
3
|
+
// - Ponytail (MIT, dependência npm fixa): o modo "lazy senior dev", /ponytail e as skills ponytail-*;
|
|
4
|
+
// - RTK: comandos do bash passam pelo `rtk rewrite` (o rtk não vem junto: parte é BUSL; usa o que estiver instalado);
|
|
5
|
+
// - Headroom: o MCP da máquina (127.0.0.1:8789), só se ele se apresentar como headroom;
|
|
6
|
+
// - graphify: o MCP do grafo do projeto (graphify-out/graph.json), só em pasta confiável.
|
|
7
|
+
// Tudo falha aberto: sem a ferramenta, o Pink segue igual.
|
|
8
|
+
import { t } from "./pink-i18n.ts";
|
|
9
|
+
import fs from "node:fs";
|
|
10
|
+
import os from "node:os";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
13
|
+
|
|
14
|
+
export const HEADROOM_MCP = "http://127.0.0.1:8789/mcp";
|
|
15
|
+
export const TOOLS = [
|
|
16
|
+
{ id: "ponytail", label: "Ponytail", what: t("modo lazy senior dev: a menor mudança que resolve (vale depois do /reload)", "modo lazy senior dev: el menor cambio que resuelve (vale después del /reload)", "lazy senior dev mode: the smallest change that solves it (takes effect after /reload)") },
|
|
17
|
+
{ id: "rtk", label: "RTK", what: t("resume a saída dos comandos do bash para gastar menos tokens (precisa do rtk instalado)", "resume la salida de los comandos de bash para gastar menos tokens (necesita rtk instalado)", "summarizes bash command output to spend fewer tokens (needs rtk installed)") },
|
|
18
|
+
{ id: "headroom", label: "Headroom", what: t("MCP de compressão de contexto da máquina (precisa do Headroom no ar)", "MCP de compresión de contexto de la máquina (necesita Headroom en marcha)", "machine-wide context compression MCP (needs Headroom running)") },
|
|
19
|
+
{ id: "graphify", label: "graphify", what: t("MCP do grafo do projeto (precisa de graphify-out/graph.json e do graphify-mcp)", "MCP del grafo del proyecto (necesita graphify-out/graph.json y graphify-mcp)", "project graph MCP (needs graphify-out/graph.json and graphify-mcp)") },
|
|
20
|
+
];
|
|
21
|
+
const RTK_TIMEOUT_MS = 2000;
|
|
22
|
+
|
|
23
|
+
export const agentDir = (env = process.env) => env.PINK_CODING_AGENT_DIR || path.join(os.homedir(), ".pink", "agent");
|
|
24
|
+
|
|
25
|
+
export function readChoices(file, read = fs.readFileSync) {
|
|
26
|
+
try {
|
|
27
|
+
const saved = JSON.parse(read(file, "utf8"));
|
|
28
|
+
return { exists: true, on: Object.fromEntries(TOOLS.map((t) => [t.id, saved?.[t.id] === true])) };
|
|
29
|
+
} catch {
|
|
30
|
+
return { exists: false, on: Object.fromEntries(TOOLS.map((t) => [t.id, false])) };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// a dependência sobe para o node_modules mais próximo (instalação global ou local): procura subindo a partir da extensão
|
|
35
|
+
export function findPackage(fromDir, name, exists = fs.existsSync) {
|
|
36
|
+
for (let dir = fromDir; ; dir = path.dirname(dir)) {
|
|
37
|
+
const candidate = path.join(dir, "node_modules", ...name.split("/"));
|
|
38
|
+
if (exists(path.join(candidate, "package.json"))) return candidate;
|
|
39
|
+
if (path.dirname(dir) === dir) return undefined;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// só executáveis que o pink.exec (spawn sem shell) consegue abrir: no Windows, .exe/.com (um .cmd daria ENOENT).
|
|
44
|
+
// Devolve o caminho absoluto e ignora pastas relativas do PATH (".", "bin"): quem chama roda esse caminho, nunca o nome
|
|
45
|
+
// solto, porque no Windows o spawn procura primeiro na pasta do projeto e um rtk.exe plantado no repositório rodaria.
|
|
46
|
+
export function onPath(name, env = process.env, exists = fs.existsSync, platform = process.platform) {
|
|
47
|
+
const exts = platform === "win32" ? [".exe", ".com"] : [""];
|
|
48
|
+
const absolute = platform === "win32" ? path.win32.isAbsolute : path.posix.isAbsolute;
|
|
49
|
+
for (const raw of String(env.PATH || env.Path || "").split(platform === "win32" ? ";" : ":")) {
|
|
50
|
+
const dir = raw.trim().replace(/^"|"$/g, "");
|
|
51
|
+
if (!dir || !absolute(dir)) continue;
|
|
52
|
+
for (const ext of exts) {
|
|
53
|
+
const file = path.join(dir, name + ext);
|
|
54
|
+
if (exists(file)) return file;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// contrato do `rtk rewrite` (rtk rewrite --help): 0 = use o comando novo; 3 = comando novo, aprovação fica com o host
|
|
61
|
+
// (o Pink não tem gate no Build, então reescreve); 2 = uma regra do rtk negou: bloqueia com a mensagem; 1 ou erro = original
|
|
62
|
+
export async function rtkRewrite(exec, command, signal, bin = "rtk") {
|
|
63
|
+
if (typeof command !== "string" || !command.trim() || command.startsWith("rtk ")) return { command };
|
|
64
|
+
try {
|
|
65
|
+
const result = await exec(bin, ["rewrite", command], { timeout: RTK_TIMEOUT_MS, signal });
|
|
66
|
+
if (result?.killed) return { command };
|
|
67
|
+
if (result?.code === 2) return { command, block: (result.stdout || result.stderr || "").trim() || t("o rtk negou este comando", "rtk negó este comando", "rtk denied this command") };
|
|
68
|
+
if (result?.code !== 0 && result?.code !== 3) return { command };
|
|
69
|
+
return { command: result.stdout?.trim() || command };
|
|
70
|
+
} catch {
|
|
71
|
+
return { command };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// o MCP tem de se apresentar como headroom no initialize: outro programa na porta 8789 não vira fonte de ferramentas
|
|
76
|
+
export async function headroomUp(fetcher = fetch, url = HEADROOM_MCP) {
|
|
77
|
+
try {
|
|
78
|
+
const response = await fetcher(url, {
|
|
79
|
+
method: "POST",
|
|
80
|
+
headers: { "content-type": "application/json", accept: "application/json, text/event-stream" },
|
|
81
|
+
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "initialize", params: { protocolVersion: "2025-03-26", capabilities: {}, clientInfo: { name: "pink", version: "1" } } }),
|
|
82
|
+
signal: AbortSignal.timeout(1500),
|
|
83
|
+
});
|
|
84
|
+
const text = await response.text();
|
|
85
|
+
return /"serverInfo"\s*:\s*\{[^}]*"name"\s*:\s*"[^"]*headroom/i.test(text);
|
|
86
|
+
} catch {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// devolve { graph, bin } (o executável já com caminho absoluto) ou undefined
|
|
92
|
+
export function graphFor(cwd, trusted, env, exists = fs.existsSync, platform = process.platform) {
|
|
93
|
+
const graph = path.join(cwd, "graphify-out", "graph.json");
|
|
94
|
+
const bin = trusted && exists(graph) ? onPath("graphify-mcp", env, exists, platform) : undefined;
|
|
95
|
+
return bin ? { graph, bin } : undefined;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export async function natives(pink, deps) {
|
|
99
|
+
const { env = process.env, exists = fs.existsSync, fetcher = fetch, here, load = (file) => import(pathToFileURL(file).href), read, write = fs.writeFileSync, mkdir = fs.mkdirSync, platform = process.platform } = deps;
|
|
100
|
+
const file = path.join(agentDir(env), "pink-tools.json");
|
|
101
|
+
const choices = readChoices(file, read);
|
|
102
|
+
const on = choices.on;
|
|
103
|
+
const report = { ponytail: false, rtk: false, headroom: false, graphify: false };
|
|
104
|
+
const installed = {
|
|
105
|
+
ponytail: () => Boolean(findPackage(here, "@dietrichgebert/ponytail", exists)),
|
|
106
|
+
rtk: () => Boolean(onPath("rtk", env, exists, platform)),
|
|
107
|
+
headroom: () => headroomUp(fetcher),
|
|
108
|
+
graphify: () => Boolean(onPath("graphify-mcp", env, exists, platform)),
|
|
109
|
+
};
|
|
110
|
+
// um servidor com o mesmo nome no mcp.json tem precedência (o Pink mostra a troca no /mcp); erro de registro não derruba a sessão
|
|
111
|
+
const register = (name, config) => {
|
|
112
|
+
try {
|
|
113
|
+
pink.registerMcpServer?.(name, config);
|
|
114
|
+
return true;
|
|
115
|
+
} catch {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const unregister = (name) => {
|
|
120
|
+
try {
|
|
121
|
+
pink.unregisterMcpServer?.(name);
|
|
122
|
+
} catch {
|
|
123
|
+
// já não estava registrado
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const ponytail = on.ponytail ? findPackage(here, "@dietrichgebert/ponytail", exists) : undefined;
|
|
128
|
+
if (ponytail) {
|
|
129
|
+
try {
|
|
130
|
+
// shortcut: o process.env é global, os filhos do bash herdam; inofensivo (só cala o aviso do Ponytail ao abrir)
|
|
131
|
+
env.PONYTAIL_QUIET_STARTUP ??= "1";
|
|
132
|
+
const extension = await load(path.join(ponytail, "pi-extension", "index.js"));
|
|
133
|
+
extension.default(pink);
|
|
134
|
+
pink.on("resources_discover", async () => ({ skillPaths: [path.join(ponytail, "skills")] }));
|
|
135
|
+
report.ponytail = true;
|
|
136
|
+
} catch {
|
|
137
|
+
// pacote quebrado: o Pink segue sem o Ponytail
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// o caminho do rtk é procurado ao abrir, a cada sessão e ao ligar no /ferramentas (não a cada comando do bash)
|
|
142
|
+
let rtkBin;
|
|
143
|
+
const findRtk = () => { rtkBin = on.rtk && env.PINK_RTK !== "0" ? onPath("rtk", env, exists, platform) : undefined; return Boolean(rtkBin); };
|
|
144
|
+
report.rtk = findRtk();
|
|
145
|
+
pink.on("tool_call", async (event, ctx) => {
|
|
146
|
+
if (event?.toolName !== "bash" || !event.input || !rtkBin) return;
|
|
147
|
+
const result = await rtkRewrite(pink.exec.bind(pink), event.input.command, ctx?.signal, rtkBin);
|
|
148
|
+
if (result.block) return { block: true, reason: `RTK: ${result.block}` };
|
|
149
|
+
event.input.command = result.command;
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// Headroom sem esperar: a sonda não segura o início (servidor registrado depois conecta na hora). Se a pessoa
|
|
153
|
+
// desligar no /ferramentas antes de a sonda voltar, a resposta atrasada não registra de novo.
|
|
154
|
+
const startHeadroom = () => headroomUp(fetcher).then((up) => (report.headroom = Boolean(on.headroom && up && register("headroom", { url: HEADROOM_MCP }))));
|
|
155
|
+
const headroomDone = on.headroom ? startHeadroom() : Promise.resolve();
|
|
156
|
+
|
|
157
|
+
// graphify só depois da confiança na pasta: o grafo de um repositório qualquer vira contexto do modelo
|
|
158
|
+
const syncGraphify = (ctx) => {
|
|
159
|
+
const found = on.graphify ? graphFor(ctx?.cwd ?? process.cwd(), Boolean(ctx?.isProjectTrusted?.()), env, exists, platform) : undefined;
|
|
160
|
+
if (found) report.graphify = register("graphify", { command: found.bin, args: ["--graph", found.graph] });
|
|
161
|
+
else if (report.graphify) {
|
|
162
|
+
unregister("graphify");
|
|
163
|
+
report.graphify = false;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
pink.on("session_start", async (_event, ctx) => {
|
|
167
|
+
report.rtk = findRtk();
|
|
168
|
+
syncGraphify(ctx);
|
|
169
|
+
if (!choices.exists && ctx?.mode === "tui") ctx.ui?.notify?.(t("O Pink tem ferramentas opcionais (Ponytail, RTK, Headroom, graphify): /ferramentas", "Pink tiene herramientas opcionales (Ponytail, RTK, Headroom, graphify): /ferramentas", "Pink has optional tools (Ponytail, RTK, Headroom, graphify): /ferramentas"), "info");
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
pink.registerCommand?.("ferramentas", {
|
|
173
|
+
description: t("Liga ou desliga as ferramentas opcionais (Ponytail, RTK, Headroom, graphify)", "Activa o desactiva las herramientas opcionales (Ponytail, RTK, Headroom, graphify)", "Turns the optional tools on or off (Ponytail, RTK, Headroom, graphify)"),
|
|
174
|
+
handler: async (_args, ctx) => {
|
|
175
|
+
// a sonda do Headroom (até 1,5 s) roda uma vez por abertura do menu, não a cada Enter
|
|
176
|
+
const headroomOnline = await installed.headroom();
|
|
177
|
+
for (;;) {
|
|
178
|
+
const state = (tool) => (tool.id === "headroom" ? (headroomOnline ? t("no ar", "en marcha", "running") : t("fora do ar", "fuera de línea", "offline")) : installed[tool.id]() ? t("instalado", "instalado", "installed") : t("não instalado", "no instalado", "not installed"));
|
|
179
|
+
const rows = TOOLS.map((t) => `${on[t.id] ? "●" : "○"} ${t.label} ${state(t)} · ${t.what}`);
|
|
180
|
+
const picked = await ctx.ui.select(t("Ferramentas do Pink (Enter liga/desliga; Esc sai)", "Herramientas de Pink (Enter activa/desactiva; Esc sale)", "Pink tools (Enter turns on/off; Esc exits)"), [...rows, t("Pronto", "Listo", "Done")]);
|
|
181
|
+
const index = rows.indexOf(picked);
|
|
182
|
+
if (index < 0) break;
|
|
183
|
+
const id = TOOLS[index].id;
|
|
184
|
+
on[id] = !on[id];
|
|
185
|
+
try {
|
|
186
|
+
mkdir(path.dirname(file), { recursive: true });
|
|
187
|
+
write(file, `${JSON.stringify(on, null, 2)}\n`);
|
|
188
|
+
choices.exists = true;
|
|
189
|
+
} catch (error) {
|
|
190
|
+
ctx.ui.notify?.(t(`Não deu para salvar ${file}: ${error?.message ?? error}`, `No se pudo guardar ${file}: ${error?.message ?? error}`, `Could not save ${file}: ${error?.message ?? error}`), "error");
|
|
191
|
+
}
|
|
192
|
+
if (id === "rtk") findRtk();
|
|
193
|
+
if (id === "headroom") {
|
|
194
|
+
if (!on.headroom) { unregister("headroom"); report.headroom = false; }
|
|
195
|
+
else if (!(await startHeadroom())) ctx.ui.notify?.(t("Headroom ligado, mas fora do ar: o MCP entra quando ele estiver rodando (abra o Pink de novo)", "Headroom activado, pero fuera de línea: el MCP entra cuando esté en marcha (vuelve a abrir Pink)", "Headroom is on but offline: the MCP joins once it is running (reopen Pink)"), "warning");
|
|
196
|
+
}
|
|
197
|
+
if (id === "graphify") syncGraphify(ctx);
|
|
198
|
+
if (id === "ponytail") ctx.ui.notify?.(t("O Ponytail liga ou desliga depois do /reload", "Ponytail se activa o desactiva después de /reload", "Ponytail turns on or off after /reload"), "info");
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
return { report, headroomDone, file };
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export default async function (pink) {
|
|
206
|
+
await natives(pink, { here: path.dirname(fileURLToPath(import.meta.url)) });
|
|
207
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Notificação quando o Pink termina (owner 2026-11-17, card 1dfwh7kfmqr), como o Claude Code e o Codex.
|
|
2
|
+
// Só na TUI e só se a janela está sem foco: o terminal avisa foco com CSI ?1004 (Windows Terminal, iTerm2, kitty,
|
|
3
|
+
// WezTerm, Ghostty). Terminal que nunca avisou foco: notifica só pedido longo (>= 20 s).
|
|
4
|
+
// Windows: toast do sistema (pelo PowerShell). macOS: osascript. Linux: notify-send; sem ele, OSC 777.
|
|
5
|
+
// Desligar: /notificacoes (fica salvo em <pasta do agente>/pink-notify.json) ou PINK_NOTIFY=0. Subagente não notifica.
|
|
6
|
+
import { t } from "./pink-i18n.ts";
|
|
7
|
+
import { execFile } from "node:child_process";
|
|
8
|
+
import fs from "node:fs";
|
|
9
|
+
import os from "node:os";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
|
|
12
|
+
export const agentDir = (env = process.env) => env.PINK_CODING_AGENT_DIR || path.join(os.homedir(), ".pink", "agent");
|
|
13
|
+
export const LONG_RUN_MS = 20_000;
|
|
14
|
+
const FOCUS_IN = "\x1b[I", FOCUS_OUT = "\x1b[O";
|
|
15
|
+
// app id do PowerShell: toast de app sem registro no Windows não aparece
|
|
16
|
+
const PS_APP_ID = "{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\WindowsPowerShell\\v1.0\\powershell.exe";
|
|
17
|
+
|
|
18
|
+
// script fixo: título e corpo chegam por variável de ambiente e o XML é escapado pelo próprio PowerShell, nada do texto
|
|
19
|
+
// (nome da pasta) entra no código (Argus N1: ’ e ‘ também fecham string no PowerShell)
|
|
20
|
+
export function windowsToast() {
|
|
21
|
+
const t = "Windows.UI.Notifications";
|
|
22
|
+
const esc = (v) => `[System.Security.SecurityElement]::Escape($env:${v})`;
|
|
23
|
+
return [
|
|
24
|
+
`[${t}.ToastNotificationManager, ${t}, ContentType = WindowsRuntime] > $null`,
|
|
25
|
+
"[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] > $null",
|
|
26
|
+
"$x = New-Object Windows.Data.Xml.Dom.XmlDocument",
|
|
27
|
+
`$x.LoadXml('<toast><visual><binding template="ToastGeneric"><text>' + ${esc("PINK_TOAST_TITLE")} + '</text><text>' + ${esc("PINK_TOAST_BODY")} + '</text></binding></visual></toast>')`,
|
|
28
|
+
`[${t}.ToastNotificationManager]::CreateToastNotifier('${PS_APP_ID}').Show([${t}.ToastNotification]::new($x))`,
|
|
29
|
+
].join("; ");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const plain = (s) => String(s).replace(/[\x00-\x1f\x7f-\x9f;]/g, " ");
|
|
33
|
+
// o comando de notificação de cada sistema: [programa, argumentos, env] ou { osc } para escrever no terminal
|
|
34
|
+
export function notifyCommand(title, body, { platform = process.platform, env = process.env, has = () => false } = {}) {
|
|
35
|
+
if (platform === "win32" || env.WSL_DISTRO_NAME) return ["powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", windowsToast()], { PINK_TOAST_TITLE: plain(title), PINK_TOAST_BODY: plain(body), ...(env.WSL_DISTRO_NAME ? { WSLENV: [env.WSLENV, "PINK_TOAST_TITLE/u:PINK_TOAST_BODY/u"].filter(Boolean).join(":") } : {}) }]; // no WSL só passa o que está no WSLENV
|
|
36
|
+
if (platform === "darwin") return ["osascript", ["-e", `display notification ${JSON.stringify(plain(body))} with title ${JSON.stringify(plain(title))}`]];
|
|
37
|
+
if (has("notify-send")) return ["notify-send", [plain(title), plain(body)]];
|
|
38
|
+
return { osc: `\x1b]777;notify;${plain(title)};${plain(body)}\x07` };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// tira os avisos de foco da entrada e diz o que veio
|
|
42
|
+
export function readFocus(data) {
|
|
43
|
+
let focus;
|
|
44
|
+
const text = String(data);
|
|
45
|
+
const lastIn = text.lastIndexOf(FOCUS_IN), lastOut = text.lastIndexOf(FOCUS_OUT);
|
|
46
|
+
if (lastIn >= 0 || lastOut >= 0) focus = lastIn > lastOut;
|
|
47
|
+
return { focus, rest: text.split(FOCUS_IN).join("").split(FOCUS_OUT).join("") };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function shouldNotify({ on, focused, focusKnown, elapsed }) {
|
|
51
|
+
if (!on) return false;
|
|
52
|
+
return focusKnown ? !focused : elapsed >= LONG_RUN_MS;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function notifyExtension(pink, deps = {}) {
|
|
56
|
+
const { env = process.env, read = fs.readFileSync, write = fs.writeFileSync, mkdir = fs.mkdirSync, out = process.stdout, run = execFile, platform = process.platform, now = Date.now } = deps;
|
|
57
|
+
if (env.PINK_SUBAGENT) return;
|
|
58
|
+
const file = path.join(agentDir(env), "pink-notify.json");
|
|
59
|
+
let on = env.PINK_NOTIFY !== "0";
|
|
60
|
+
try { if (JSON.parse(read(file, "utf8"))?.on === false) on = false; } catch { /* sem arquivo: ligado */ }
|
|
61
|
+
const state = { focused: true, focusKnown: false, start: 0, active: false, unsubscribe: undefined };
|
|
62
|
+
const has = (bin) => String(env.PATH ?? "").split(path.delimiter).some((dir) => dir && fs.existsSync(path.join(dir, bin)));
|
|
63
|
+
const send = (title, body) => {
|
|
64
|
+
const cmd = notifyCommand(title, body, { platform, env, has });
|
|
65
|
+
if (!Array.isArray(cmd)) return void out.write(cmd.osc);
|
|
66
|
+
try { run(cmd[0], cmd[1], { windowsHide: true, timeout: 10_000, env: cmd[2] ? { ...process.env, ...cmd[2] } : process.env }, () => {}); } catch { /* sem notificador: segue sem aviso */ }
|
|
67
|
+
};
|
|
68
|
+
pink.on("session_start", async (_event, ctx) => {
|
|
69
|
+
if (ctx?.mode !== "tui" || state.active) return;
|
|
70
|
+
state.active = true;
|
|
71
|
+
out.write("\x1b[?1004h"); // pede ao terminal os avisos de foco
|
|
72
|
+
if (!state.exitHook) { state.exitHook = true; process.once("exit", () => { if (state.active) out.write("\x1b[?1004l"); }); } // queda sem session_shutdown
|
|
73
|
+
state.unsubscribe = ctx.ui.onTerminalInput?.((data) => {
|
|
74
|
+
const { focus, rest } = readFocus(data);
|
|
75
|
+
if (focus === undefined) return undefined;
|
|
76
|
+
state.focused = focus;
|
|
77
|
+
state.focusKnown = true;
|
|
78
|
+
return rest ? { data: rest } : { consume: true };
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
pink.on("session_shutdown", async () => {
|
|
82
|
+
if (!state.active) return;
|
|
83
|
+
state.active = false;
|
|
84
|
+
state.unsubscribe?.();
|
|
85
|
+
out.write("\x1b[?1004l");
|
|
86
|
+
});
|
|
87
|
+
pink.on("agent_start", async () => { if (!state.start) state.start = now(); });
|
|
88
|
+
pink.on("agent_settled", async (event, ctx) => {
|
|
89
|
+
const elapsed = state.start ? now() - state.start : 0;
|
|
90
|
+
state.start = 0;
|
|
91
|
+
if (!state.active || event?.aborted || !shouldNotify({ on, focused: state.focused, focusKnown: state.focusKnown, elapsed })) return;
|
|
92
|
+
send("Pink", t(`Terminou em ${path.basename(ctx?.cwd ?? process.cwd())}: pronto para o próximo pedido`, `Terminó en ${path.basename(ctx?.cwd ?? process.cwd())}: listo para el próximo pedido`, `Finished in ${path.basename(ctx?.cwd ?? process.cwd())}: ready for the next request`));
|
|
93
|
+
});
|
|
94
|
+
pink.registerCommand?.("notificacoes", {
|
|
95
|
+
description: t("Liga ou desliga a notificação do sistema quando o Pink termina e a janela está sem foco", "Activa o desactiva la notificación del sistema cuando Pink termina y la ventana no tiene el foco", "Turns the system notification on or off when Pink finishes and the window is not focused"),
|
|
96
|
+
handler: async (_args, ctx) => {
|
|
97
|
+
on = !on;
|
|
98
|
+
try { mkdir(path.dirname(file), { recursive: true }); write(file, `${JSON.stringify({ on }, null, 2)}\n`); } catch (error) { ctx.ui.notify?.(t(`Não deu para salvar ${file}: ${error?.message ?? error}`, `No se pudo guardar ${file}: ${error?.message ?? error}`, `Could not save ${file}: ${error?.message ?? error}`), "error"); }
|
|
99
|
+
ctx.ui.notify?.(on ? t("Notificações ligadas", "Notificaciones activadas", "Notifications on") : t("Notificações desligadas", "Notificaciones desactivadas", "Notifications off"), "info");
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
return { state, send, isOn: () => on };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export default function (pink) {
|
|
106
|
+
notifyExtension(pink);
|
|
107
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
// Permissões do Pink (owner 2026-11-17, card 1dfwh7kfmqp), como as regras allow/ask/deny do Claude Code e a aprovação do
|
|
2
|
+
// Codex. Carregada sempre e em primeiro lugar (antes do RTK reescrever o comando), fora do PINK_NO_BUILTIN_UI.
|
|
3
|
+
// - Padrão: pede confirmação antes de comando destrutivo (bash/powershell) e bloqueia edição de segredos e do .git.
|
|
4
|
+
// - Regras em <pasta do agente>/permissions.json e, só em pasta confiável, <projeto>/.pink/permissions.json:
|
|
5
|
+
// { "allow": ["bash(npm test*)"], "ask": ["bash(git push*)"], "deny": ["read(.env*)", "bash(curl*)", "mcp__x"] }
|
|
6
|
+
// "ferramenta" (qualquer chamada dela) ou "ferramenta(padrão)": glob (* e **) sobre cada trecho do comando
|
|
7
|
+
// (bash/powershell, dividido em ; && || | & e quebra de linha) ou sobre o caminho (read/write/edit).
|
|
8
|
+
// Ordem: deny > ask > allow > padrão do Pink. deny/ask valem se QUALQUER trecho casar; allow só se TODOS casarem e o
|
|
9
|
+
// comando não tiver $( ) nem crase.
|
|
10
|
+
// - Sem tela (-p, json, rpc), o que pede confirmação é recusado, com o motivo para o modelo.
|
|
11
|
+
// - Limite de rede de segurança: gravar por bash (echo > .env, cp, sed -i) não passa pela proteção de arquivos, e
|
|
12
|
+
// ofuscação ($(echo rm), eval) escapa do padrão. Isolamento de verdade é o sandbox do sistema, não isto.
|
|
13
|
+
// - /permissoes mostra as regras em uso.
|
|
14
|
+
import { t } from "./pink-i18n.ts";
|
|
15
|
+
import fs from "node:fs";
|
|
16
|
+
import os from "node:os";
|
|
17
|
+
import path from "node:path";
|
|
18
|
+
|
|
19
|
+
export const agentDir = (env = process.env) => env.PINK_CODING_AGENT_DIR || path.join(os.homedir(), ".pink", "agent");
|
|
20
|
+
|
|
21
|
+
const SHELLS = new Set(["bash", "powershell"]);
|
|
22
|
+
const FILES = new Set(["read", "write", "edit"]);
|
|
23
|
+
const SUBST = /\$\(|`|<\(/;
|
|
24
|
+
|
|
25
|
+
const program = (token) => token.split(/[\\/]/).pop().replace(/\.(exe|cmd|bat)$/i, "");
|
|
26
|
+
// trechos do comando, sem aspas, sem VAR=x e sem o prefixo que não muda o que roda (rtk, command, exec, nohup, time);
|
|
27
|
+
// sudo fica, para o allow não liberar "sudo npm test" com a regra de "npm test"
|
|
28
|
+
export function segments(command) {
|
|
29
|
+
return String(command)
|
|
30
|
+
.replace(/\d*>&\d*/g, " ") // 2>&1 não é um trecho
|
|
31
|
+
.split(/\r?\n|&&|\|\||;|\||&|\$\(|`|<\(|\(|\)/)
|
|
32
|
+
.map((s) => s.replace(/["']/g, "").trim())
|
|
33
|
+
.filter(Boolean)
|
|
34
|
+
.map((s) => {
|
|
35
|
+
let tokens = s.split(/\s+/);
|
|
36
|
+
while (tokens.length > 1 && (/^(rtk|command|exec|nohup|time)$/i.test(tokens[0]) || /^\w+=/.test(tokens[0]))) tokens = tokens.slice(1);
|
|
37
|
+
tokens[0] = program(tokens[0]);
|
|
38
|
+
return tokens.join(" ");
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// cada sufixo do trecho, como comando: pega bash -c "rm -rf x", env rm, xargs rm, find -exec rm, sudo curl
|
|
43
|
+
const suffixes = (seg) => {
|
|
44
|
+
const tokens = seg.split(/\s+/);
|
|
45
|
+
return tokens.map((_, i) => { const tail = tokens.slice(i); tail[0] = program(tail[0]); return tail; });
|
|
46
|
+
};
|
|
47
|
+
// git com opções antes do subcomando (git -C dir push): devolve [subcomando, ...resto]
|
|
48
|
+
function gitArgs(tokens) {
|
|
49
|
+
let i = 1;
|
|
50
|
+
while (i < tokens.length && tokens[i].startsWith("-")) i += /^-(C|c)$/.test(tokens[i]) || /^--(git-dir|work-tree)$/.test(tokens[i]) ? 2 : 1;
|
|
51
|
+
return tokens.slice(i);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// comandos que pedem confirmação por padrão: [teste por trecho, motivo]
|
|
55
|
+
export const DEFAULT_ASK = [
|
|
56
|
+
[(t) => /^rm$/i.test(t[0]) && t.some((x) => /^-[a-z]*r/i.test(x) || x === "--recursive"), t("apaga pastas inteiras (rm -r)", "borra carpetas enteras (rm -r)", "deletes whole folders (rm -r)")],
|
|
57
|
+
[(t) => /^sudo$/i.test(t[0]), t("roda como administrador (sudo)", "ejecuta como administrador (sudo)", "runs as administrator (sudo)")],
|
|
58
|
+
[(t) => /^(chmod|chown)$/i.test(t[0]) && t.some((x) => /777/.test(x)), t("abre permissão total (777)", "abre permiso total (777)", "opens full permission (777)")],
|
|
59
|
+
[(t) => /^git$/i.test(t[0]) && /^push$/i.test(gitArgs(t)[0] ?? "") && gitArgs(t).some((x) => /^-[a-z]*f/i.test(x) || /^--force/i.test(x) || /^\+/.test(x)), t("push forçado", "push forzado", "forced push")],
|
|
60
|
+
[(t) => /^git$/i.test(t[0]) && /^reset$/i.test(gitArgs(t)[0] ?? "") && t.includes("--hard"), "git reset --hard"],
|
|
61
|
+
[(t) => /^git$/i.test(t[0]) && /^clean$/i.test(gitArgs(t)[0] ?? "") && gitArgs(t).some((x) => /^-[a-z]*f/i.test(x) || x === "--force"), "git clean -f"],
|
|
62
|
+
[(t) => /^(remove-item|ri|rm|del|erase|rd|rmdir)$/i.test(t[0]) && t.some((x) => /^-r(ecurse)?$/i.test(x)), t("apaga pastas inteiras (Remove-Item -Recurse)", "borra carpetas enteras (Remove-Item -Recurse)", "deletes whole folders (Remove-Item -Recurse)")],
|
|
63
|
+
[(t) => /^(rd|rmdir|del|erase)$/i.test(t[0]) && t.some((x) => /^\/s$/i.test(x)), t("apaga pastas ou arquivos em subpastas (/s)", "borra carpetas o archivos en subcarpetas (/s)", "deletes folders or files in subfolders (/s)")],
|
|
64
|
+
[(t) => /^(mkfs(\.\w+)?|diskpart)$/i.test(t[0]) || (/^format(\.com)?$/i.test(t[0]) && /^[a-z]:/i.test(t[1] ?? "")), t("formata disco", "formatea disco", "formats disk")],
|
|
65
|
+
[(t) => /^dd$/i.test(t[0]) && t.some((x) => /^of=/i.test(x)), t("escreve direto no disco (dd)", "escribe directo en el disco (dd)", "writes directly to the disk (dd)")],
|
|
66
|
+
[(t) => /\bdrop\s+(table|database|schema)\b/i.test(t.join(" ")), t("apaga tabela ou banco (DROP)", "borra tabla o base de datos (DROP)", "deletes table or database (DROP)")],
|
|
67
|
+
];
|
|
68
|
+
const PIPE_RUN = /\b(curl|wget|iwr|irm|invoke-webrequest|invoke-restmethod)\b[\s\S]*\|\s*(sudo\s+)?(sh|bash|zsh|iex|invoke-expression|python3?|node)\b/i;
|
|
69
|
+
|
|
70
|
+
export function defaultAsk(command) {
|
|
71
|
+
if (PIPE_RUN.test(command)) return t("baixa e executa um script", "descarga y ejecuta un script", "downloads and runs a script");
|
|
72
|
+
for (const seg of segments(command)) {
|
|
73
|
+
for (const tail of suffixes(seg)) {
|
|
74
|
+
const hit = DEFAULT_ASK.find(([test]) => test(tail));
|
|
75
|
+
if (hit) return hit[1];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// arquivos que o agente não edita por padrão
|
|
82
|
+
// (e as próprias regras e hooks: o modelo não se dá permissão nem roda código por eles)
|
|
83
|
+
export const DEFAULT_DENY_WRITE = [".env", ".env.*", "**/.env", "**/.env.*", ".git/**", "**/.git/**", "**/*.pem", "**/*.key", "**/id_rsa*", "**/id_ed25519*", "**/.pink/permissions.json", "**/.pink/hooks.json"];
|
|
84
|
+
const AGENT_FILES = ["permissions.json", "hooks.json"];
|
|
85
|
+
|
|
86
|
+
export function globToRegExp(glob, forPath) {
|
|
87
|
+
let out = "";
|
|
88
|
+
for (let i = 0; i < glob.length; i++) {
|
|
89
|
+
const c = glob[i];
|
|
90
|
+
if (c === "*" && glob[i + 1] === "*") {
|
|
91
|
+
i++;
|
|
92
|
+
if (glob[i + 1] === "/") { out += "(?:.*/)?"; i++; } else out += ".*";
|
|
93
|
+
} else if (c === "*") out += forPath ? "[^/]*" : ".*";
|
|
94
|
+
else if (c === "?") out += ".";
|
|
95
|
+
else out += c.replace(/[.+^${}()|[\]\\]/g, "\\$&");
|
|
96
|
+
}
|
|
97
|
+
return new RegExp(`^${out}$`, "is");
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function parseRule(rule) {
|
|
101
|
+
const m = /^\s*([\w.:-]+)\s*(?:\(([\s\S]*)\))?\s*$/.exec(String(rule));
|
|
102
|
+
return m ? { tool: m[1].toLowerCase(), pattern: m[2] } : undefined;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// o alvo da regra: o comando, ou o caminho relativo à pasta (barras normais, sem o @ de menção nem ponto/espaço final)
|
|
106
|
+
export function targetOf(toolName, input, cwd) {
|
|
107
|
+
if (SHELLS.has(toolName)) return String(input?.command ?? "");
|
|
108
|
+
if (FILES.has(toolName)) {
|
|
109
|
+
let raw = String(input?.path ?? input?.file_path ?? "").replace(/^@/, "");
|
|
110
|
+
if (raw === "~" || raw.startsWith("~/") || raw.startsWith("~\\")) raw = path.join(os.homedir(), raw.slice(1));
|
|
111
|
+
raw = raw.replace(/::\$DATA$/i, "").replace(/[. ]+$/, "") || raw;
|
|
112
|
+
const abs = path.resolve(cwd, raw);
|
|
113
|
+
const rel = path.relative(cwd, abs).split(path.sep).join("/");
|
|
114
|
+
return rel.startsWith("..") || path.isAbsolute(rel) ? abs.split(path.sep).join("/") : rel;
|
|
115
|
+
}
|
|
116
|
+
if (toolName === "web_fetch") return String(input?.url ?? "");
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const patternMatches = (pattern, toolName, target) => {
|
|
121
|
+
const forPath = FILES.has(toolName);
|
|
122
|
+
const re = globToRegExp(pattern.trim(), forPath);
|
|
123
|
+
return re.test(target) || (forPath && re.test(target.split("/").pop() ?? ""));
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// kind "allow" exige todos os trechos; "deny"/"ask" basta um
|
|
127
|
+
export function matches(rule, toolName, target, kind = "deny") {
|
|
128
|
+
const parsed = parseRule(rule);
|
|
129
|
+
if (!parsed || parsed.tool !== String(toolName).toLowerCase()) return false;
|
|
130
|
+
if (parsed.pattern === undefined || parsed.pattern.trim() === "*") return true;
|
|
131
|
+
if (target === undefined) return false;
|
|
132
|
+
if (!SHELLS.has(toolName)) return patternMatches(parsed.pattern, toolName, target);
|
|
133
|
+
const parts = segments(target);
|
|
134
|
+
if (kind === "allow") return !SUBST.test(target) && parts.length > 0 && parts.every((seg) => patternMatches(parsed.pattern, toolName, seg));
|
|
135
|
+
return patternMatches(parsed.pattern, toolName, target.trim()) || parts.some((seg) => suffixes(seg).some((tail) => patternMatches(parsed.pattern, toolName, tail.join(" "))));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function loadRules(files, read = fs.readFileSync) {
|
|
139
|
+
const rules = { allow: [], ask: [], deny: [], errors: [] };
|
|
140
|
+
for (const file of files) {
|
|
141
|
+
let text;
|
|
142
|
+
try { text = read(file, "utf8"); } catch { continue; } // arquivo que não existe não é erro
|
|
143
|
+
try {
|
|
144
|
+
const data = JSON.parse(text);
|
|
145
|
+
for (const kind of ["allow", "ask", "deny"]) {
|
|
146
|
+
for (const rule of Array.isArray(data?.[kind]) ? data[kind] : []) {
|
|
147
|
+
if (parseRule(rule)) rules[kind].push(String(rule));
|
|
148
|
+
else rules.errors.push(`${file}: ${t("regra inválida", "regla no válida", "invalid rule")} ${JSON.stringify(rule)}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
} catch (error) {
|
|
152
|
+
rules.errors.push(`${file}: ${error?.message ?? error}`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return rules;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// decide: { action: "allow" | "ask" | "deny", why }
|
|
159
|
+
export function decide(rules, toolName, target) {
|
|
160
|
+
const hit = (kind) => rules[kind].find((rule) => matches(rule, toolName, target, kind));
|
|
161
|
+
let rule;
|
|
162
|
+
if ((rule = hit("deny"))) return { action: "deny", why: t(`regra deny ${rule}`, `regla deny ${rule}`, `deny rule ${rule}`) };
|
|
163
|
+
if ((rule = hit("ask"))) return { action: "ask", why: t(`regra ask ${rule}`, `regla ask ${rule}`, `ask rule ${rule}`) };
|
|
164
|
+
if ((rule = hit("allow"))) return { action: "allow", why: t(`regra allow ${rule}`, `regla allow ${rule}`, `allow rule ${rule}`) };
|
|
165
|
+
if (SHELLS.has(toolName) && target) {
|
|
166
|
+
const danger = defaultAsk(target);
|
|
167
|
+
if (danger) return { action: "ask", why: danger };
|
|
168
|
+
}
|
|
169
|
+
// página com injeção pode mandar "leia o segredo e abra evil/?d=<segredo>": endereço carregando dados pede confirmação
|
|
170
|
+
// shortcut: só olha a query (>= 64 caracteres); dado no caminho passa, confirmar por domínio se virar problema
|
|
171
|
+
if (toolName === "web_fetch" && target && /\?.{64,}/s.test(target)) return { action: "ask", why: t("endereço com muitos dados na query (pode enviar dados para fora)", "dirección con muchos datos en la query (puede enviar datos hacia afuera)", "URL with a lot of data in the query (may send data out)") };
|
|
172
|
+
if ((toolName === "write" || toolName === "edit") && target) {
|
|
173
|
+
const name = target.split("/").pop() ?? "";
|
|
174
|
+
if (DEFAULT_DENY_WRITE.some((glob) => globToRegExp(glob, true).test(target) || globToRegExp(glob, true).test(name)))
|
|
175
|
+
return { action: "deny", why: t("arquivo protegido do Pink (segredo ou .git); libere com allow se for de propósito", "archivo protegido de Pink (secreto o .git); libéralo con allow si es a propósito", "file protected by Pink (secret or .git); allow it if you mean it") };
|
|
176
|
+
}
|
|
177
|
+
return { action: "allow", why: "" };
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const READ_TOOLS = new Set(["read", "grep", "find", "ls", "todowrite", "tool_search"]);
|
|
181
|
+
export function readsOnly(pink, toolName) {
|
|
182
|
+
if (READ_TOOLS.has(toolName)) return true;
|
|
183
|
+
// readOnlyHint é declarado pela própria ferramenta: de servidor MCP não vale (um servidor hostil se diria "só leitura")
|
|
184
|
+
if (toolName.startsWith("mcp__")) return false;
|
|
185
|
+
try {
|
|
186
|
+
return pink.getAllTools?.().find((tool) => tool.name === toolName)?.annotations?.readOnlyHint === true;
|
|
187
|
+
} catch {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export function permissions(pink, deps = {}) {
|
|
193
|
+
const { env = process.env, read = fs.readFileSync } = deps;
|
|
194
|
+
const sessionAllowed = new Set();
|
|
195
|
+
const filesFor = (ctx) => {
|
|
196
|
+
const files = [path.join(agentDir(env), "permissions.json")];
|
|
197
|
+
if (ctx?.isProjectTrusted?.()) files.push(path.join(ctx.cwd ?? process.cwd(), ".pink", "permissions.json"));
|
|
198
|
+
return files;
|
|
199
|
+
};
|
|
200
|
+
let warned = false;
|
|
201
|
+
pink.on("tool_call", async (event, ctx) => {
|
|
202
|
+
const toolName = String(event?.toolName ?? "");
|
|
203
|
+
const target = targetOf(toolName, event?.input, ctx?.cwd ?? process.cwd());
|
|
204
|
+
const rules = loadRules(filesFor(ctx), read);
|
|
205
|
+
if (rules.errors.length) {
|
|
206
|
+
// arquivo de regras quebrado: sem tela, fecha (o deny que a pessoa escreveu não pode sumir em silêncio)
|
|
207
|
+
if (!ctx?.hasUI) return { block: true, reason: t(`Permissões do Pink com erro, nada roda até corrigir: ${rules.errors[0]}`, `Permisos de Pink con error, nada se ejecuta hasta corregir: ${rules.errors[0]}`, `Pink permissions have an error, nothing runs until it is fixed: ${rules.errors[0]}`) };
|
|
208
|
+
if (!warned) { warned = true; ctx.ui.notify?.(t(`Permissões: ${rules.errors[0]}`, `Permisos: ${rules.errors[0]}`, `Permissions: ${rules.errors[0]}`), "warning"); }
|
|
209
|
+
}
|
|
210
|
+
if ((toolName === "write" || toolName === "edit") && target !== undefined) {
|
|
211
|
+
const abs = path.resolve(ctx?.cwd ?? process.cwd(), target).toLowerCase();
|
|
212
|
+
if (AGENT_FILES.some((name) => path.join(agentDir(env), name).toLowerCase() === abs))
|
|
213
|
+
return { block: true, reason: t("Bloqueado pelas permissões do Pink: o agente não edita as próprias regras e hooks (a pessoa edita)", "Bloqueado por los permisos de Pink: el agente no edita sus propias reglas ni hooks (la persona los edita)", "Blocked by Pink permissions: the agent does not edit its own rules and hooks (the person does)") };
|
|
214
|
+
}
|
|
215
|
+
let { action, why } = decide(rules, toolName, target);
|
|
216
|
+
// modo "pergunta tudo" (alt+m, pink-ui): o que só lê segue livre; o resto confirma, mesmo com allow (deny continua valendo)
|
|
217
|
+
if (action === "allow" && globalThis.__pinkPermissionMode === "ask" && !readsOnly(pink, toolName)) {
|
|
218
|
+
action = "ask";
|
|
219
|
+
why = t("modo pergunta tudo (alt+m troca)", "modo pregunta todo (alt+m cambia)", "ask-for-everything mode (alt+m switches)");
|
|
220
|
+
}
|
|
221
|
+
if (action === "allow") return undefined;
|
|
222
|
+
const shown = target ?? toolName;
|
|
223
|
+
if (action === "deny") return { block: true, reason: t(`Bloqueado pelas permissões do Pink: ${why}`, `Bloqueado por los permisos de Pink: ${why}`, `Blocked by Pink permissions: ${why}`) };
|
|
224
|
+
const key = `${toolName}\u0000${shown}`;
|
|
225
|
+
if (sessionAllowed.has(key)) return undefined;
|
|
226
|
+
if (!ctx?.hasUI) return { block: true, reason: t(`Precisa de confirmação e não há tela para pedir (${why}): ${shown}`, `Necesita confirmación y no hay pantalla para pedirla (${why}): ${shown}`, `Needs confirmation and there is no screen to ask (${why}): ${shown}`) };
|
|
227
|
+
const [once, session, deny] = [t("Permitir uma vez", "Permitir una vez", "Allow once"), t("Permitir nesta sessão", "Permitir en esta sesión", "Allow this session"), t("Negar", "Denegar", "Deny")];
|
|
228
|
+
const choice = await ctx.ui.select(t(`Confirmar ${toolName}: ${why}\n\n ${shown}\n`, `Confirmar ${toolName}: ${why}\n\n ${shown}\n`, `Confirm ${toolName}: ${why}\n\n ${shown}\n`), [once, session, deny]);
|
|
229
|
+
if (choice === once) return undefined;
|
|
230
|
+
if (choice === session) { sessionAllowed.add(key); return undefined; }
|
|
231
|
+
return { block: true, reason: t("A pessoa negou esta ação", "La persona denegó esta acción", "The person denied this action") };
|
|
232
|
+
});
|
|
233
|
+
pink.registerCommand?.("permissoes", {
|
|
234
|
+
description: t("Mostra as permissões em uso (regras do usuário, do projeto e o padrão do Pink)", "Muestra los permisos en uso (reglas del usuario, del proyecto y el predeterminado de Pink)", "Shows the permissions in use (user rules, project rules and Pink's default)"),
|
|
235
|
+
handler: async (_args, ctx) => {
|
|
236
|
+
const files = filesFor(ctx);
|
|
237
|
+
const rules = loadRules(files, read);
|
|
238
|
+
const lines = [
|
|
239
|
+
`${t("Arquivos", "Archivos", "Files")}: ${files.join(" · ")}`,
|
|
240
|
+
`deny: ${rules.deny.join(", ") || "-"}`,
|
|
241
|
+
`ask: ${rules.ask.join(", ") || "-"}`,
|
|
242
|
+
`allow: ${rules.allow.join(", ") || "-"}`,
|
|
243
|
+
t(`Padrão: confirma comandos destrutivos (${DEFAULT_ASK.length + 1} tipos) e protege .env, .git e chaves; um allow que casa libera também o padrão`, `Predeterminado: pide confirmación para comandos destructivos (${DEFAULT_ASK.length + 1} tipos) y protege .env, .git y claves; un allow que coincide libera también el predeterminado`, `Default: asks to confirm destructive commands (${DEFAULT_ASK.length + 1} types) and protects .env, .git and keys; a matching allow also releases the default`),
|
|
244
|
+
...rules.errors.map((e) => `${t("Erro", "Error", "Error")}: ${e}`),
|
|
245
|
+
];
|
|
246
|
+
ctx.ui.notify?.(lines.join("\n"), rules.errors.length ? "warning" : "info");
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
return { sessionAllowed };
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export default function (pink) {
|
|
253
|
+
permissions(pink);
|
|
254
|
+
}
|