@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,129 @@
|
|
|
1
|
+
// /review (owner 2026-11-19, card 1dfwh7kfzxw), como o /review do Claude Code e do Codex: revisão independente do diff.
|
|
2
|
+
// /review revisa o que não foi commitado (com os arquivos novos); /review <branch> [foco] revisa tudo desde a base com o
|
|
3
|
+
// branch (commits e o que não foi commitado). O primeiro termo é sempre o branch. O diff vai para um arquivo temporário e o
|
|
4
|
+
// agente principal chama o subagente "revisor", que só lê (read, grep, find, ls, sem MCP) e não vê a conversa.
|
|
5
|
+
// Só em pasta confiável: o git lê a configuração do repositório e ela pode rodar programas (textconv, fsmonitor).
|
|
6
|
+
import { t } from "./pink-i18n.ts";
|
|
7
|
+
import { spawnSync } 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 MAX_DIFF = 2 * 1024 * 1024; // diff maior que isso vai cortado (o revisor lê os arquivos para o resto)
|
|
13
|
+
const MAX_UNTRACKED = 200;
|
|
14
|
+
const MAX_NAME = 200;
|
|
15
|
+
const STALE_MS = 24 * 60 * 60 * 1000;
|
|
16
|
+
const PREFIX = "pink-review-";
|
|
17
|
+
// shortcut: árvore vazia do SHA-1, para repositório ainda sem commit; repositório SHA-256 sem commit cai no erro do git diff
|
|
18
|
+
const EMPTY_TREE = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
19
|
+
|
|
20
|
+
type Git = (args: string[], cwd: string) => { ok: boolean; out: string; err: string };
|
|
21
|
+
// configuração do repositório que roda programa fica desligada; no Windows o git não é procurado na pasta do projeto
|
|
22
|
+
export const SAFE_CONFIG = ["-c", "core.fsmonitor=", "-c", "core.pager=cat", "-c", "core.quotePath=false"];
|
|
23
|
+
export const git: Git = (args, cwd) => {
|
|
24
|
+
const run = spawnSync("git", [...SAFE_CONFIG, ...args], {
|
|
25
|
+
cwd,
|
|
26
|
+
encoding: "utf8",
|
|
27
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
28
|
+
windowsHide: true,
|
|
29
|
+
env: { ...process.env, NoDefaultCurrentDirectoryInExePath: "1", GIT_OPTIONAL_LOCKS: "0" },
|
|
30
|
+
});
|
|
31
|
+
return { ok: run.status === 0, out: run.stdout ?? "", err: (run.stderr || run.error?.message || "").trim() };
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// branch, tag ou commit: sem "-" no começo (viraria opção do git), sem espaço, controle ou intervalo (..); o git valida o resto
|
|
35
|
+
export const validRef = (ref: string) => /^[^-\s\x00-\x1f][^\s\x00-\x1f]*$/u.test(ref) && !ref.includes("..");
|
|
36
|
+
|
|
37
|
+
// nome de arquivo vem de quem fez o commit e entra numa mensagem com voz de usuário: sem controle e curto
|
|
38
|
+
export const cleanName = (name: string) => {
|
|
39
|
+
const clean = name.replace(/[\x00-\x1f\x7f]/g, "?");
|
|
40
|
+
return clean.length > MAX_NAME ? `${clean.slice(0, MAX_NAME)}…` : clean;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
type Found = { error?: string; empty?: boolean; diff?: string; files?: string[]; extra?: number; label?: string; root?: string };
|
|
44
|
+
|
|
45
|
+
export function collect(cwd: string, base: string | undefined, run: Git = git): Found {
|
|
46
|
+
const top = run(["rev-parse", "--show-toplevel"], cwd);
|
|
47
|
+
if (!top.ok) return { error: t("Esta pasta não é um repositório git.", "Esta carpeta no es un repositorio git.", "This folder is not a git repository.") };
|
|
48
|
+
const root = path.resolve(top.out.trim()); // caminhos do diff e do ls-files ficam relativos à raiz
|
|
49
|
+
let from = "HEAD";
|
|
50
|
+
let label = t("mudanças não commitadas", "cambios sin commit", "uncommitted changes");
|
|
51
|
+
if (base) {
|
|
52
|
+
if (!validRef(base)) return { error: t(`Referência inválida: ${base}`, `Referencia no válida: ${base}`, `Invalid reference: ${base}`) };
|
|
53
|
+
const mergeBase = run(["merge-base", base, "HEAD"], root);
|
|
54
|
+
if (!mergeBase.ok) return { error: t(`Não achei a base com ${base}: ${mergeBase.err || "referência desconhecida"}`, `No encontré la base con ${base}: ${mergeBase.err || "referencia desconocida"}`, `Could not find the base with ${base}: ${mergeBase.err || "unknown reference"}`) };
|
|
55
|
+
from = mergeBase.out.trim();
|
|
56
|
+
label = t(`mudanças desde ${base}`, `cambios desde ${base}`, `changes since ${base}`);
|
|
57
|
+
} else if (!run(["rev-parse", "--verify", "--quiet", "HEAD"], root).ok) from = EMPTY_TREE;
|
|
58
|
+
const diff = run(["diff", "--no-color", "--no-ext-diff", "--no-textconv", from, "--"], root);
|
|
59
|
+
if (!diff.ok) return { error: t(`git diff falhou: ${diff.err}`, `git diff falló: ${diff.err}`, `git diff failed: ${diff.err}`) };
|
|
60
|
+
const names = run(["diff", "--name-only", "--no-textconv", from, "--"], root).out.split(/\r?\n/).filter(Boolean);
|
|
61
|
+
const untracked = run(["ls-files", "--others", "--exclude-standard"], root).out.split(/\r?\n/).filter(Boolean);
|
|
62
|
+
if (!diff.out.trim() && !untracked.length) return { error: t(`Nada para revisar (${label}).`, `Nada que revisar (${label}).`, `Nothing to review (${label}).`), empty: true };
|
|
63
|
+
const files = [...names.map(cleanName), ...untracked.slice(0, MAX_UNTRACKED).map((file) => `${cleanName(file)} [novo, fora do git]`)];
|
|
64
|
+
let text = diff.out;
|
|
65
|
+
if (text.length > MAX_DIFF) text = `${text.slice(0, MAX_DIFF)}\n[diff cortado em ${MAX_DIFF / 1024 / 1024} MB: leia os arquivos da lista para o resto]\n`;
|
|
66
|
+
return { diff: text, files, extra: Math.max(0, untracked.length - MAX_UNTRACKED), label, root };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function reviewPrompt(diffFile: string, found: Found, focus = "") {
|
|
70
|
+
const files = found.files ?? [];
|
|
71
|
+
const more = files.length - 50 + (found.extra ?? 0);
|
|
72
|
+
const list = files.slice(0, 50).map((file) => `- ${file}`).join("\n") + (more > 0 ? `\n- … e mais ${more} arquivo(s) não listados` : "");
|
|
73
|
+
const task = `Revise as ${found.label} do repositório em ${found.root}; os caminhos abaixo são relativos a essa pasta. O diff está em ${diffFile}; os arquivos marcados como novos não estão no diff, leia direto. Arquivos:\n${list}${focus ? `\nFoco pedido: ${focus}` : ""}`;
|
|
74
|
+
return [
|
|
75
|
+
`Faça uma revisão independente das ${found.label}: chame a ferramenta subagent com agent "revisor" (só leitura) e exatamente esta tarefa, sem acrescentar sua opinião sobre o código:`,
|
|
76
|
+
"",
|
|
77
|
+
task,
|
|
78
|
+
"",
|
|
79
|
+
"Depois mostre os achados como o revisor devolveu (gravidade, arquivo:linha, problema, correção). Não corrija nada: pergunte quais eu quero corrigir.",
|
|
80
|
+
].join("\n");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// diff de sessão que caiu sem session_shutdown não fica para sempre no temporário
|
|
84
|
+
export function sweepStale(tmp = os.tmpdir(), now = Date.now()) {
|
|
85
|
+
let names: string[] = [];
|
|
86
|
+
try {
|
|
87
|
+
names = fs.readdirSync(tmp).filter((name) => name.startsWith(PREFIX));
|
|
88
|
+
} catch {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
for (const name of names) {
|
|
92
|
+
const dir = path.join(tmp, name);
|
|
93
|
+
try {
|
|
94
|
+
if (now - fs.statSync(dir).mtimeMs > STALE_MS) fs.rmSync(dir, { recursive: true, force: true });
|
|
95
|
+
} catch {}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export default function (pink: any) {
|
|
100
|
+
if (process.env.PINK_SUBAGENT) return; // subagente não abre outro subagente
|
|
101
|
+
const dirs: string[] = [];
|
|
102
|
+
pink.on("session_start", async () => sweepStale());
|
|
103
|
+
pink.registerCommand("review", {
|
|
104
|
+
description: t("Revisão independente (subagente só leitura) do que não foi commitado, ou de tudo desde um branch: /review [branch] [foco]", "Revisión independiente (subagente solo lectura) de lo no confirmado, o de todo desde una rama: /review [rama] [foco]", "Independent review (read-only subagent) of uncommitted changes, or of everything since a branch: /review [branch] [focus]"),
|
|
105
|
+
handler: async (args: string, ctx: any) => {
|
|
106
|
+
if (ctx?.isProjectTrusted?.() !== true) return ctx.ui.notify(t("Pasta não confiável: o /review fica desligado (o git do projeto poderia rodar programas dele). Confie na pasta para usar.", "Carpeta no confiable: /review está desactivado (el git del proyecto podría ejecutar programas suyos). Confía en la carpeta para usarlo.", "Untrusted folder: /review is disabled (the project's git could run its programs). Trust the folder to use it."), "error");
|
|
107
|
+
const [base, ...rest] = String(args ?? "").trim().split(/\s+/).filter(Boolean);
|
|
108
|
+
const found = collect(ctx?.cwd ?? process.cwd(), base);
|
|
109
|
+
if (found.error) return ctx.ui.notify(found.error, found.empty ? "info" : "error");
|
|
110
|
+
let file: string;
|
|
111
|
+
try {
|
|
112
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), PREFIX));
|
|
113
|
+
dirs.push(dir);
|
|
114
|
+
file = path.join(dir, "diff.patch");
|
|
115
|
+
fs.writeFileSync(file, found.diff ?? "");
|
|
116
|
+
} catch (error) {
|
|
117
|
+
return ctx.ui.notify(t(`Não consegui gravar o diff no temporário: ${(error as Error)?.message ?? error}`, `No pude guardar el diff en el temporal: ${(error as Error)?.message ?? error}`, `Could not write the diff to the temp folder: ${(error as Error)?.message ?? error}`), "error");
|
|
118
|
+
}
|
|
119
|
+
ctx.ui.notify(`Revisando ${found.label}: ${(found.files?.length ?? 0) + (found.extra ?? 0)} arquivo(s).`, "info");
|
|
120
|
+
const prompt = reviewPrompt(file, found, rest.join(" "));
|
|
121
|
+
// agente trabalhando: entra na fila em vez de ser recusado
|
|
122
|
+
if (ctx?.isIdle?.() === false) pink.sendUserMessage?.(prompt, { deliverAs: "followUp" });
|
|
123
|
+
else pink.sendUserMessage?.(prompt);
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
pink.on("session_shutdown", async () => {
|
|
127
|
+
for (const dir of dirs.splice(0)) fs.rmSync(dir, { recursive: true, force: true });
|
|
128
|
+
});
|
|
129
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// Regras por tipo de arquivo (owner 2026-11-19, card 1dfwh7kfzxv), como as rules do Cursor e o steering do Kiro: arquivos .md
|
|
2
|
+
// com globs no frontmatter, em <pasta do agente>/rules (da pessoa) e em .pink/rules (do projeto, só em pasta confiável).
|
|
3
|
+
// A regra entra no contexto uma vez por sessão, no resultado do read/write/edit de um arquivo que casa com o glob; assim o
|
|
4
|
+
// AGENTS.md não cresce com instrução que só vale para um tipo de arquivo. /regras lista as regras e quais já entraram.
|
|
5
|
+
import { t } from "./pink-i18n.ts";
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import os from "node:os";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
|
|
10
|
+
export const MAX_RULE = 16 * 1024; // regra maior que isso não entra (avisa no /regras)
|
|
11
|
+
const TOOLS = new Set(["read", "write", "edit"]);
|
|
12
|
+
|
|
13
|
+
export const agentDir = (env = process.env) => env.PINK_CODING_AGENT_DIR || path.join(os.homedir(), ".pink", "agent");
|
|
14
|
+
|
|
15
|
+
const MAX_GLOB = 200;
|
|
16
|
+
const MAX_STARS = 8; // limita o backtracking de padrões como *a*a*a*a no caminho quente
|
|
17
|
+
|
|
18
|
+
// glob simples: ** (qualquer profundidade), * e ? (sem /), {a,b}; sem / no padrão casa com o nome em qualquer pasta.
|
|
19
|
+
// Sem diferenciar maiúsculas, também no Linux e no macOS. Glob torto (chave aberta, longo, * demais) lança erro.
|
|
20
|
+
export function globToRegExp(raw: string): RegExp {
|
|
21
|
+
const glob = raw.replace(/(?:\*\*\/)+/g, "**/");
|
|
22
|
+
if (glob.length > MAX_GLOB || (glob.match(/\*/g) ?? []).length > MAX_STARS) throw new Error(t(`glob inválido: ${raw}`, `glob no válido: ${raw}`, `invalid glob: ${raw}`));
|
|
23
|
+
let out = "";
|
|
24
|
+
let depth = 0;
|
|
25
|
+
for (let i = 0; i < glob.length; i++) {
|
|
26
|
+
const c = glob[i];
|
|
27
|
+
if (c === "*") {
|
|
28
|
+
if (glob[i + 1] === "*") {
|
|
29
|
+
const slash = glob[i + 2] === "/";
|
|
30
|
+
out += slash ? "(?:.*/)?" : ".*";
|
|
31
|
+
i += slash ? 2 : 1;
|
|
32
|
+
} else out += "[^/]*";
|
|
33
|
+
} else if (c === "?") out += "[^/]";
|
|
34
|
+
else if (c === "{") {
|
|
35
|
+
depth++;
|
|
36
|
+
out += "(?:";
|
|
37
|
+
} else if (c === "}" && depth > 0) {
|
|
38
|
+
depth--;
|
|
39
|
+
out += ")";
|
|
40
|
+
} else if (c === "," && depth > 0) out += "|";
|
|
41
|
+
else out += c.replace(/[.+^$()|[\]\\]/g, "\\$&");
|
|
42
|
+
}
|
|
43
|
+
if (depth) throw new Error(t(`glob inválido: ${raw}`, `glob no válido: ${raw}`, `invalid glob: ${raw}`));
|
|
44
|
+
return new RegExp(`^${out}$`, "i");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const cleanGlob = (glob: string) => glob.trim().replace(/^\.?\//, "");
|
|
48
|
+
|
|
49
|
+
export function validGlobs(globs: string[]): boolean {
|
|
50
|
+
try {
|
|
51
|
+
for (const glob of globs) globToRegExp(cleanGlob(glob));
|
|
52
|
+
return true;
|
|
53
|
+
} catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function matches(globs: string[], relative: string): boolean {
|
|
59
|
+
const file = relative.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
60
|
+
const base = file.slice(file.lastIndexOf("/") + 1);
|
|
61
|
+
return globs.some((glob) => {
|
|
62
|
+
const clean = cleanGlob(glob);
|
|
63
|
+
if (!clean) return false;
|
|
64
|
+
try {
|
|
65
|
+
return globToRegExp(clean).test(clean.includes("/") ? file : base);
|
|
66
|
+
} catch {
|
|
67
|
+
return false; // um glob torto não derruba as outras regras
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// frontmatter: globs (ou paths, como no Claude Code) em lista "a, b", [a, b] ou linhas "- a"; description opcional
|
|
73
|
+
export function parseRule(text: string): { globs: string[]; description: string; body: string } | undefined {
|
|
74
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/.exec(text.replace(/^/, ""));
|
|
75
|
+
if (!match) return undefined;
|
|
76
|
+
const lines = match[1].split(/\r?\n/);
|
|
77
|
+
const unquote = (value: string) => value.trim().replace(/^["']|["']$/g, "").trim();
|
|
78
|
+
let globs: string[] = [];
|
|
79
|
+
let description = "";
|
|
80
|
+
for (let i = 0; i < lines.length; i++) {
|
|
81
|
+
const field = /^(\w+):\s*(.*)$/.exec(lines[i]);
|
|
82
|
+
if (!field) continue;
|
|
83
|
+
const [, key, raw] = field;
|
|
84
|
+
if (key === "description") description = unquote(raw);
|
|
85
|
+
if (key !== "globs" && key !== "paths") continue;
|
|
86
|
+
const value = raw.trim();
|
|
87
|
+
if (value) globs = value.replace(/^\[|\]$/g, "").split(/,(?![^{]*\})/).map(unquote);
|
|
88
|
+
else while (i + 1 < lines.length && /^\s*-\s+/.test(lines[i + 1])) globs.push(unquote(lines[++i].replace(/^\s*-\s+/, "")));
|
|
89
|
+
}
|
|
90
|
+
globs = globs.filter(Boolean);
|
|
91
|
+
if (!globs.length) return undefined;
|
|
92
|
+
return { globs, description, body: match[2].trim() };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export type Rule = { id: string; file: string; origin: "pessoa" | "projeto"; globs: string[]; description: string; body: string; tooBig: boolean };
|
|
96
|
+
|
|
97
|
+
// regra grande demais: só o começo, para mostrar globs no /regras sem ler um arquivo enorme inteiro
|
|
98
|
+
function readHead(file: string, size = 4096): string {
|
|
99
|
+
const fd = fs.openSync(file, "r");
|
|
100
|
+
try {
|
|
101
|
+
const buffer = Buffer.alloc(size);
|
|
102
|
+
return buffer.subarray(0, fs.readSync(fd, buffer, 0, size, 0)).toString("utf8");
|
|
103
|
+
} finally {
|
|
104
|
+
fs.closeSync(fd);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// shortcut: lê as pastas de regras a cada leitura/edição; cachear por mtime se virar centenas de regras
|
|
109
|
+
export function loadRules(cwd: string, trusted: boolean, env = process.env): { rules: Rule[]; invalid: string[] } {
|
|
110
|
+
const rules: Rule[] = [];
|
|
111
|
+
const invalid: string[] = [];
|
|
112
|
+
const dirs: [string, Rule["origin"]][] = [[path.join(agentDir(env), "rules"), "pessoa"]];
|
|
113
|
+
if (trusted) dirs.push([path.join(cwd, ".pink", "rules"), "projeto"]);
|
|
114
|
+
let realRoot = cwd;
|
|
115
|
+
try {
|
|
116
|
+
realRoot = fs.realpathSync(cwd);
|
|
117
|
+
} catch {}
|
|
118
|
+
for (const [dir, origin] of dirs) {
|
|
119
|
+
let names: string[];
|
|
120
|
+
try {
|
|
121
|
+
names = fs.readdirSync(dir).filter((name) => name.toLowerCase().endsWith(".md")).sort();
|
|
122
|
+
} catch {
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
for (const name of names) {
|
|
126
|
+
const file = path.join(dir, name);
|
|
127
|
+
try {
|
|
128
|
+
const stat = fs.statSync(file);
|
|
129
|
+
if (!stat.isFile()) continue;
|
|
130
|
+
// regra do projeto que aponta (link simbólico, pasta ligada) para fora do projeto não entra
|
|
131
|
+
if (origin === "projeto") {
|
|
132
|
+
const inside = path.relative(realRoot, fs.realpathSync(file));
|
|
133
|
+
if (!inside || inside === ".." || inside.startsWith(`..${path.sep}`) || path.isAbsolute(inside)) {
|
|
134
|
+
invalid.push(file);
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const tooBig = stat.size > MAX_RULE;
|
|
139
|
+
const parsed = parseRule(tooBig ? readHead(file) : fs.readFileSync(file, "utf8"));
|
|
140
|
+
if (!parsed || !validGlobs(parsed.globs)) {
|
|
141
|
+
invalid.push(file);
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
rules.push({ id: `${origin}:${file.toLowerCase()}`, file, origin, ...parsed, body: tooBig ? "" : parsed.body, tooBig });
|
|
145
|
+
} catch {
|
|
146
|
+
invalid.push(file);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return { rules, invalid };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function createRules({ load = loadRules } = {}) {
|
|
154
|
+
const shown = new Set<string>();
|
|
155
|
+
function onResult(event: any, ctx: any) {
|
|
156
|
+
if (event?.isError || !TOOLS.has(event?.toolName)) return undefined;
|
|
157
|
+
const target = event.input?.path ?? event.input?.file_path;
|
|
158
|
+
if (typeof target !== "string" || !target) return undefined;
|
|
159
|
+
const root = path.resolve(ctx?.cwd ?? process.cwd());
|
|
160
|
+
const relative = path.relative(root, path.resolve(root, target));
|
|
161
|
+
if (!relative || relative === ".." || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) return undefined; // fora do projeto
|
|
162
|
+
const { rules } = load(root, ctx?.isProjectTrusted?.() === true);
|
|
163
|
+
const fresh = rules.filter((rule) => !rule.tooBig && rule.body && !shown.has(rule.id) && matches(rule.globs, relative));
|
|
164
|
+
if (!fresh.length) return undefined;
|
|
165
|
+
const notes = fresh.map((rule) => {
|
|
166
|
+
shown.add(rule.id);
|
|
167
|
+
const where = rule.origin === "projeto" ? path.relative(root, rule.file) : rule.file;
|
|
168
|
+
return `Regra (${rule.origin}, ${where}) para ${rule.globs.join(", ")}; vale para os arquivos que casam com isso:\n${rule.body}`;
|
|
169
|
+
});
|
|
170
|
+
// devolver content sem structuredContent apagaria o dele
|
|
171
|
+
return { content: [...(event.content ?? []), { type: "text", text: notes.join("\n\n") }], structuredContent: event.structuredContent };
|
|
172
|
+
}
|
|
173
|
+
function list(ctx: any): string {
|
|
174
|
+
const root = path.resolve(ctx?.cwd ?? process.cwd());
|
|
175
|
+
const trusted = ctx?.isProjectTrusted?.() === true;
|
|
176
|
+
const { rules, invalid } = load(root, trusted);
|
|
177
|
+
const lines = rules.length ? [t("Regras por tipo de arquivo:", "Reglas por tipo de archivo:", "Rules by file type:")] : [t("Nenhuma regra. Crie .md com globs no frontmatter em:", "Ninguna regla. Crea .md con globs en el frontmatter en:", "No rules. Create .md files with globs in the frontmatter in:"), ` ${path.join(agentDir(), "rules")} ${t("(suas)", "(las tuyas)", "(yours)")}`, t(" .pink/rules (do projeto)", " .pink/rules (del proyecto)", " .pink/rules (project)")];
|
|
178
|
+
for (const rule of rules) {
|
|
179
|
+
const state = rule.tooBig ? t(`grande demais (máx. ${MAX_RULE / 1024} KB), não entra`, `demasiado grande (máx. ${MAX_RULE / 1024} KB), no entra`, `too large (max ${MAX_RULE / 1024} KB), not included`) : shown.has(rule.id) ? t("já no contexto", "ya en el contexto", "already in context") : t("espera um arquivo que case", "espera un archivo que coincida", "waiting for a matching file");
|
|
180
|
+
lines.push(` ${rule.globs.join(", ")} · ${rule.origin} · ${state}${rule.description ? ` · ${rule.description}` : ""}`, ` ${rule.file}`);
|
|
181
|
+
}
|
|
182
|
+
for (const file of invalid) lines.push(` ${t("sem globs/paths, glob inválido ou fora do projeto, ignorada:", "sin globs/paths, glob no válido o fuera del proyecto, ignorada:", "no globs/paths, invalid glob or outside the project, skipped:")} ${file}`);
|
|
183
|
+
if (!trusted) lines.push(t("Pasta não confiável: as regras do projeto (.pink/rules) ficam de fora.", "Carpeta no confiable: las reglas del proyecto (.pink/rules) quedan fuera.", "Untrusted folder: project rules (.pink/rules) are left out."));
|
|
184
|
+
return lines.join("\n");
|
|
185
|
+
}
|
|
186
|
+
return { onResult, list, reset: () => shown.clear(), shown };
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// também no subagente: ele edita arquivos e precisa das mesmas regras
|
|
190
|
+
export default function (pink: any) {
|
|
191
|
+
const rules = createRules();
|
|
192
|
+
pink.on("tool_result", async (event: any, ctx: any) => rules.onResult(event, ctx));
|
|
193
|
+
// contexto novo (sessão, compactação, outro ramo): a regra precisa entrar de novo
|
|
194
|
+
for (const name of ["session_start", "session_compact", "session_tree"]) pink.on(name, async () => rules.reset());
|
|
195
|
+
pink.registerCommand("regras", {
|
|
196
|
+
description: t("Lista as regras por tipo de arquivo (globs) e quais já entraram no contexto", "Lista las reglas por tipo de archivo (globs) y cuáles ya entraron en el contexto", "Lists the rules by file type (globs) and which ones are already in context"),
|
|
197
|
+
handler: async (_args: string, ctx: any) => ctx.ui.notify(rules.list(ctx), "info"),
|
|
198
|
+
});
|
|
199
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// Pink sandbox helper (card 1dfwh7kfzxu, owner 2026-11-19): runs a command under a write-restricted token, as Codex does
|
|
2
|
+
// on Windows. Usage: pink-sandbox.exe <SID> -- <program> [args...] | pink-sandbox.exe --grant|--revoke|--has <SID> <folder>
|
|
3
|
+
// Writes need the normal check AND a check against the restricting SIDs (the Pink SID, the logon SID and Everyone), so
|
|
4
|
+
// the command writes only where the Pink SID was granted (the project and the sandbox temp folder, by pink-sandbox.ts) or
|
|
5
|
+
// where Everyone can already write (known limit). Reads and network are untouched. The child runs in a Job Object that
|
|
6
|
+
// kills the whole tree when this process ends. Compiled on first use with the csc.exe that ships with Windows.
|
|
7
|
+
using System;
|
|
8
|
+
using System.Collections.Generic;
|
|
9
|
+
using System.ComponentModel;
|
|
10
|
+
using System.Runtime.InteropServices;
|
|
11
|
+
using System.Security.Principal;
|
|
12
|
+
using System.Text;
|
|
13
|
+
|
|
14
|
+
static class PinkSandbox
|
|
15
|
+
{
|
|
16
|
+
const uint TOKEN_ASSIGN_PRIMARY = 0x1, TOKEN_DUPLICATE = 0x2, TOKEN_QUERY = 0x8, TOKEN_ADJUST_DEFAULT = 0x80, TOKEN_ADJUST_SESSIONID = 0x100;
|
|
17
|
+
const uint DISABLE_MAX_PRIVILEGE = 0x1, WRITE_RESTRICTED = 0x8;
|
|
18
|
+
const int TokenGroups = 2, TokenDefaultDacl = 6;
|
|
19
|
+
const uint SE_GROUP_LOGON_ID = 0xC0000000;
|
|
20
|
+
const uint CREATE_SUSPENDED = 0x4, CREATE_UNICODE_ENVIRONMENT = 0x400;
|
|
21
|
+
const uint STARTF_USESTDHANDLES = 0x100;
|
|
22
|
+
const int JobObjectExtendedLimitInformation = 9, JobObjectBasicUIRestrictions = 4;
|
|
23
|
+
// no windows of other processes (keys, messages), clipboard, global atoms, desktop, system settings, logoff
|
|
24
|
+
const uint JOB_UI_ALL = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80;
|
|
25
|
+
const uint JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE = 0x2000;
|
|
26
|
+
const uint INFINITE = 0xFFFFFFFF;
|
|
27
|
+
|
|
28
|
+
[StructLayout(LayoutKind.Sequential)] struct SID_AND_ATTRIBUTES { public IntPtr Sid; public uint Attributes; }
|
|
29
|
+
[StructLayout(LayoutKind.Sequential)] struct TOKEN_DEFAULT_DACL { public IntPtr DefaultDacl; }
|
|
30
|
+
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
|
31
|
+
struct STARTUPINFO
|
|
32
|
+
{
|
|
33
|
+
public int cb; public string lpReserved, lpDesktop, lpTitle;
|
|
34
|
+
public int dwX, dwY, dwXSize, dwYSize, dwXCountChars, dwYCountChars, dwFillAttribute, dwFlags;
|
|
35
|
+
public short wShowWindow, cbReserved2; public IntPtr lpReserved2, hStdInput, hStdOutput, hStdError;
|
|
36
|
+
}
|
|
37
|
+
[StructLayout(LayoutKind.Sequential)] struct PROCESS_INFORMATION { public IntPtr hProcess, hThread; public int dwProcessId, dwThreadId; }
|
|
38
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
39
|
+
struct JOBOBJECT_BASIC_LIMIT_INFORMATION
|
|
40
|
+
{
|
|
41
|
+
public long PerProcessUserTimeLimit, PerJobUserTimeLimit; public uint LimitFlags;
|
|
42
|
+
public UIntPtr MinimumWorkingSetSize, MaximumWorkingSetSize; public uint ActiveProcessLimit;
|
|
43
|
+
public UIntPtr Affinity; public uint PriorityClass, SchedulingClass;
|
|
44
|
+
}
|
|
45
|
+
[StructLayout(LayoutKind.Sequential)] struct IO_COUNTERS { public ulong a, b, c, d, e, f; }
|
|
46
|
+
[StructLayout(LayoutKind.Sequential)]
|
|
47
|
+
struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION
|
|
48
|
+
{
|
|
49
|
+
public JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation; public IO_COUNTERS IoInfo;
|
|
50
|
+
public UIntPtr ProcessMemoryLimit, JobMemoryLimit, PeakProcessMemoryUsed, PeakJobMemoryUsed;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[DllImport("kernel32.dll")] static extern IntPtr GetCurrentProcess();
|
|
54
|
+
[DllImport("kernel32.dll")] static extern IntPtr GetStdHandle(int n);
|
|
55
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool CloseHandle(IntPtr h);
|
|
56
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern uint ResumeThread(IntPtr h);
|
|
57
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern uint WaitForSingleObject(IntPtr h, uint ms);
|
|
58
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool GetExitCodeProcess(IntPtr h, out uint code);
|
|
59
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool TerminateProcess(IntPtr h, uint code);
|
|
60
|
+
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] static extern IntPtr CreateJobObject(IntPtr a, string name);
|
|
61
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool SetInformationJobObject(IntPtr job, int cls, ref JOBOBJECT_EXTENDED_LIMIT_INFORMATION info, int len);
|
|
62
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool SetInformationJobObject(IntPtr job, int cls, ref uint uiRestrictions, int len);
|
|
63
|
+
[DllImport("kernel32.dll", SetLastError = true)] static extern bool AssignProcessToJobObject(IntPtr job, IntPtr process);
|
|
64
|
+
[DllImport("advapi32.dll", SetLastError = true)] static extern bool OpenProcessToken(IntPtr process, uint access, out IntPtr token);
|
|
65
|
+
[DllImport("advapi32.dll", SetLastError = true)] static extern bool GetTokenInformation(IntPtr token, int cls, IntPtr buffer, int length, out int needed);
|
|
66
|
+
[DllImport("advapi32.dll", SetLastError = true)] static extern bool SetTokenInformation(IntPtr token, int cls, ref TOKEN_DEFAULT_DACL info, int length);
|
|
67
|
+
[DllImport("advapi32.dll", SetLastError = true)]
|
|
68
|
+
static extern bool CreateRestrictedToken(IntPtr existing, uint flags, uint disableCount, IntPtr disable, uint deleteCount, IntPtr delete, uint restrictCount, SID_AND_ATTRIBUTES[] restrict, out IntPtr newToken);
|
|
69
|
+
[DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)] static extern bool ConvertStringSidToSid(string sid, out IntPtr psid);
|
|
70
|
+
[DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)] static extern bool ConvertSidToStringSid(IntPtr psid, out string sid);
|
|
71
|
+
[DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
|
72
|
+
static extern bool ConvertStringSecurityDescriptorToSecurityDescriptor(string sddl, uint revision, out IntPtr sd, out uint size);
|
|
73
|
+
[DllImport("advapi32.dll", SetLastError = true)] static extern bool GetSecurityDescriptorDacl(IntPtr sd, out bool present, out IntPtr dacl, out bool defaulted);
|
|
74
|
+
[DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
|
75
|
+
static extern bool CreateProcessAsUser(IntPtr token, string app, StringBuilder cmd, IntPtr pa, IntPtr ta, bool inherit, uint flags, IntPtr env, string cwd, ref STARTUPINFO si, out PROCESS_INFORMATION pi);
|
|
76
|
+
|
|
77
|
+
static void Check(bool ok, string what) { if (!ok) throw new Win32Exception(Marshal.GetLastWin32Error(), what); }
|
|
78
|
+
|
|
79
|
+
// Microsoft C runtime argv rules: quote when needed, double backslashes before a quote
|
|
80
|
+
public static string Quote(string arg)
|
|
81
|
+
{
|
|
82
|
+
if (arg.Length > 0 && arg.IndexOfAny(new[] { ' ', '\t', '\n', '\v', '"' }) < 0) return arg;
|
|
83
|
+
var sb = new StringBuilder("\"");
|
|
84
|
+
for (int i = 0; i < arg.Length; i++)
|
|
85
|
+
{
|
|
86
|
+
int slashes = 0;
|
|
87
|
+
while (i < arg.Length && arg[i] == '\\') { slashes++; i++; }
|
|
88
|
+
if (i == arg.Length) { sb.Append('\\', slashes * 2); break; }
|
|
89
|
+
if (arg[i] == '"') sb.Append('\\', slashes * 2 + 1).Append('"');
|
|
90
|
+
else sb.Append('\\', slashes).Append(arg[i]);
|
|
91
|
+
}
|
|
92
|
+
return sb.Append('"').ToString();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
static string LogonSid(IntPtr token)
|
|
96
|
+
{
|
|
97
|
+
int needed;
|
|
98
|
+
GetTokenInformation(token, TokenGroups, IntPtr.Zero, 0, out needed);
|
|
99
|
+
IntPtr buffer = Marshal.AllocHGlobal(needed);
|
|
100
|
+
try
|
|
101
|
+
{
|
|
102
|
+
Check(GetTokenInformation(token, TokenGroups, buffer, needed, out needed), "GetTokenInformation");
|
|
103
|
+
int count = Marshal.ReadInt32(buffer);
|
|
104
|
+
int size = Marshal.SizeOf(typeof(SID_AND_ATTRIBUTES));
|
|
105
|
+
for (int i = 0; i < count; i++)
|
|
106
|
+
{
|
|
107
|
+
var group = (SID_AND_ATTRIBUTES)Marshal.PtrToStructure(new IntPtr(buffer.ToInt64() + IntPtr.Size + i * size), typeof(SID_AND_ATTRIBUTES));
|
|
108
|
+
if ((group.Attributes & SE_GROUP_LOGON_ID) == SE_GROUP_LOGON_ID)
|
|
109
|
+
{
|
|
110
|
+
string sid;
|
|
111
|
+
Check(ConvertSidToStringSid(group.Sid, out sid), "ConvertSidToStringSid");
|
|
112
|
+
return sid;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
finally { Marshal.FreeHGlobal(buffer); }
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
static IntPtr Sid(string text) { IntPtr sid; Check(ConvertStringSidToSid(text, out sid), "ConvertStringSidToSid " + text); return sid; }
|
|
121
|
+
|
|
122
|
+
// icacls does not take a SID that maps to no account; .NET does. Inheritable, so it reaches what is created later too.
|
|
123
|
+
static int Acl(string mode, string sid, string dir)
|
|
124
|
+
{
|
|
125
|
+
var identity = new SecurityIdentifier(sid);
|
|
126
|
+
var security = System.IO.Directory.GetAccessControl(dir);
|
|
127
|
+
var rule = new System.Security.AccessControl.FileSystemAccessRule(identity, System.Security.AccessControl.FileSystemRights.Modify,
|
|
128
|
+
System.Security.AccessControl.InheritanceFlags.ContainerInherit | System.Security.AccessControl.InheritanceFlags.ObjectInherit,
|
|
129
|
+
System.Security.AccessControl.PropagationFlags.None, System.Security.AccessControl.AccessControlType.Allow);
|
|
130
|
+
bool has = false, denied = false;
|
|
131
|
+
foreach (System.Security.AccessControl.FileSystemAccessRule existing in security.GetAccessRules(true, false, typeof(SecurityIdentifier)))
|
|
132
|
+
{
|
|
133
|
+
if (existing.IdentityReference.Value != sid) continue;
|
|
134
|
+
if (existing.AccessControlType == System.Security.AccessControl.AccessControlType.Allow) has = true;
|
|
135
|
+
else denied = true;
|
|
136
|
+
}
|
|
137
|
+
if (mode == "--deny" && denied) return 0;
|
|
138
|
+
if (mode == "--has") return has ? 0 : 1;
|
|
139
|
+
if (mode == "--grant") { if (!has) { security.AddAccessRule(rule); System.IO.Directory.SetAccessControl(dir, security); } return 0; }
|
|
140
|
+
if (mode == "--deny")
|
|
141
|
+
{
|
|
142
|
+
// folders whose content runs later outside the sandbox (git hooks, project extensions): read yes, write no
|
|
143
|
+
security.AddAccessRule(new System.Security.AccessControl.FileSystemAccessRule(identity,
|
|
144
|
+
System.Security.AccessControl.FileSystemRights.Write | System.Security.AccessControl.FileSystemRights.Delete | System.Security.AccessControl.FileSystemRights.DeleteSubdirectoriesAndFiles | System.Security.AccessControl.FileSystemRights.ChangePermissions | System.Security.AccessControl.FileSystemRights.TakeOwnership,
|
|
145
|
+
System.Security.AccessControl.InheritanceFlags.ContainerInherit | System.Security.AccessControl.InheritanceFlags.ObjectInherit,
|
|
146
|
+
System.Security.AccessControl.PropagationFlags.None, System.Security.AccessControl.AccessControlType.Deny));
|
|
147
|
+
System.IO.Directory.SetAccessControl(dir, security);
|
|
148
|
+
return 0;
|
|
149
|
+
}
|
|
150
|
+
security.PurgeAccessRules(identity); // --revoke: tira a permissão e a negação do Pink
|
|
151
|
+
System.IO.Directory.SetAccessControl(dir, security);
|
|
152
|
+
return 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
static int Main(string[] args)
|
|
156
|
+
{
|
|
157
|
+
if (args.Length == 3 && (args[0] == "--grant" || args[0] == "--revoke" || args[0] == "--has" || args[0] == "--deny"))
|
|
158
|
+
{
|
|
159
|
+
try { return Acl(args[0], args[1], args[2]); }
|
|
160
|
+
catch (Exception error) { Console.Error.WriteLine("pink-sandbox: " + error.Message); return 126; }
|
|
161
|
+
}
|
|
162
|
+
int dash = Array.IndexOf(args, "--");
|
|
163
|
+
if (args.Length < 3 || dash != 1 || !args[0].StartsWith("S-1-"))
|
|
164
|
+
{
|
|
165
|
+
Console.Error.WriteLine("usage: pink-sandbox.exe <SID> -- <program> [args...]");
|
|
166
|
+
return 125;
|
|
167
|
+
}
|
|
168
|
+
try
|
|
169
|
+
{
|
|
170
|
+
string pinkSid = args[0];
|
|
171
|
+
IntPtr token;
|
|
172
|
+
Check(OpenProcessToken(GetCurrentProcess(), TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_QUERY | TOKEN_ADJUST_DEFAULT | TOKEN_ADJUST_SESSIONID, out token), "OpenProcessToken");
|
|
173
|
+
string logon = LogonSid(token);
|
|
174
|
+
var restrict = new List<SID_AND_ATTRIBUTES> { new SID_AND_ATTRIBUTES { Sid = Sid(pinkSid) }, new SID_AND_ATTRIBUTES { Sid = Sid("S-1-1-0") } };
|
|
175
|
+
if (logon != null) restrict.Add(new SID_AND_ATTRIBUTES { Sid = Sid(logon) });
|
|
176
|
+
IntPtr restricted;
|
|
177
|
+
Check(CreateRestrictedToken(token, DISABLE_MAX_PRIVILEGE | WRITE_RESTRICTED, 0, IntPtr.Zero, 0, IntPtr.Zero, (uint)restrict.Count, restrict.ToArray(), out restricted), "CreateRestrictedToken");
|
|
178
|
+
// objects the child creates without an inherited ACL (pipes, its own process) must pass the restricted write check
|
|
179
|
+
string user = WindowsIdentity.GetCurrent().User.Value;
|
|
180
|
+
string sddl = "D:(A;;GA;;;" + user + ")(A;;GA;;;" + pinkSid + ")(A;;GA;;;SY)" + (logon != null ? "(A;;GA;;;" + logon + ")" : "");
|
|
181
|
+
IntPtr sd; uint sdSize; bool present, defaulted; IntPtr dacl;
|
|
182
|
+
Check(ConvertStringSecurityDescriptorToSecurityDescriptor(sddl, 1, out sd, out sdSize), "ConvertStringSecurityDescriptorToSecurityDescriptor");
|
|
183
|
+
Check(GetSecurityDescriptorDacl(sd, out present, out dacl, out defaulted), "GetSecurityDescriptorDacl");
|
|
184
|
+
var defaultDacl = new TOKEN_DEFAULT_DACL { DefaultDacl = dacl };
|
|
185
|
+
Check(SetTokenInformation(restricted, TokenDefaultDacl, ref defaultDacl, Marshal.SizeOf(typeof(TOKEN_DEFAULT_DACL))), "SetTokenInformation");
|
|
186
|
+
|
|
187
|
+
IntPtr job = CreateJobObject(IntPtr.Zero, null);
|
|
188
|
+
Check(job != IntPtr.Zero, "CreateJobObject");
|
|
189
|
+
var limits = new JOBOBJECT_EXTENDED_LIMIT_INFORMATION();
|
|
190
|
+
limits.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
|
|
191
|
+
Check(SetInformationJobObject(job, JobObjectExtendedLimitInformation, ref limits, Marshal.SizeOf(typeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION))), "SetInformationJobObject");
|
|
192
|
+
uint ui = JOB_UI_ALL;
|
|
193
|
+
Check(SetInformationJobObject(job, JobObjectBasicUIRestrictions, ref ui, sizeof(uint)), "SetInformationJobObject UI");
|
|
194
|
+
|
|
195
|
+
var command = new StringBuilder();
|
|
196
|
+
for (int i = 2; i < args.Length; i++) command.Append(i > 2 ? " " : "").Append(Quote(args[i]));
|
|
197
|
+
var si = new STARTUPINFO { cb = Marshal.SizeOf(typeof(STARTUPINFO)), dwFlags = (int)STARTF_USESTDHANDLES, hStdInput = GetStdHandle(-10), hStdOutput = GetStdHandle(-11), hStdError = GetStdHandle(-12) };
|
|
198
|
+
PROCESS_INFORMATION pi;
|
|
199
|
+
// the program is an absolute path (resolved by pink-sandbox.ts): no search in the project folder
|
|
200
|
+
Check(CreateProcessAsUser(restricted, args[2], command, IntPtr.Zero, IntPtr.Zero, true, CREATE_SUSPENDED | CREATE_UNICODE_ENVIRONMENT, IntPtr.Zero, Environment.CurrentDirectory, ref si, out pi), "CreateProcessAsUser");
|
|
201
|
+
if (!AssignProcessToJobObject(job, pi.hProcess))
|
|
202
|
+
{
|
|
203
|
+
int error = Marshal.GetLastWin32Error();
|
|
204
|
+
TerminateProcess(pi.hProcess, 126);
|
|
205
|
+
throw new Win32Exception(error, "AssignProcessToJobObject");
|
|
206
|
+
}
|
|
207
|
+
ResumeThread(pi.hThread);
|
|
208
|
+
CloseHandle(pi.hThread);
|
|
209
|
+
WaitForSingleObject(pi.hProcess, INFINITE);
|
|
210
|
+
uint code;
|
|
211
|
+
GetExitCodeProcess(pi.hProcess, out code);
|
|
212
|
+
return (int)code;
|
|
213
|
+
}
|
|
214
|
+
catch (Exception error)
|
|
215
|
+
{
|
|
216
|
+
Console.Error.WriteLine("pink-sandbox: " + error.Message);
|
|
217
|
+
return 126;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|