Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.
feat: implement Ink-based TUI for interactive agent management and terminal interface
Salman Qureshi823d3ebb4866
diff --git a/package-lock.json b/package-lock.jsonindex e6c412da..bd989e02 100644--- a/package-lock.json+++ b/package-lock.json@@ -17,12 +17,19 @@"chalk": "^5.4.0","commander": "^12.1.0","dotenv": "^16.4.7",+ "figures": "^6.1.0","grammy": "^1.42.0",+ "ink": "^5.2.1",+ "ink-select-input": "^6.2.0",+ "ink-spinner": "^5.0.0",+ "ink-text-input": "^6.0.0","js-tiktoken": "^1.0.19","marked": "^14.1.4","node-cron": "^3.0.3","ollama-ai-provider": "^1.2.0","pino": "^9.6.0",+ "react": "^18.3.1",+ "react-dom": "^18.3.1","yaml": "^2.7.0","zod": "^3.25.76"},@@ -33,7 +40,7 @@"@types/better-sqlite3": "^7.6.13","@types/node": "^22.13.0","@types/node-cron": "^3.0.11",- "@types/react": "^18.3.0",+ "@types/react": "^18.3.28","tsup": "^8.4.0","typescript": "^5.7.0","vitest": "^3.0.0"@@ -253,6 +260,18 @@"zod": "^3.23.8"}},+ "node_modules/@alcalzone/ansi-tokenize": {+ "version": "0.1.3",+ "resolved": "https://registry.npmjs.org/@alcalzone/ansi-tokenize/-/ansi-tokenize-0.1.3.tgz",+ "integrity": "sha512-3yWxPTq3UQ/FY9p1ErPxIyfT64elWaMvM9lIHnaqpyft63tkxodF5aUElYHrdisWve5cETkh1+KBw1yJuW0aRw==",+ "dependencies": {+ "ansi-styles": "^6.2.1",+ "is-fullwidth-code-point": "^4.0.0"+ },+ "engines": {+ "node": ">=14.13.1"+ }+ },"node_modules/@esbuild/aix-ppc64": {"version": "0.27.7","resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz",@@ -1117,13 +1136,13 @@"version": "15.7.15","resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz","integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==",- "dev": true+ "devOptional": true},"node_modules/@types/react": {"version": "18.3.28","resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.28.tgz","integrity": "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw==",- "dev": true,+ "devOptional": true,"dependencies": {"@types/prop-types": "*","csstype": "^3.2.2"@@ -1316,6 +1335,42 @@"zod": "^3.25.76 || ^4.1.8"}},+ "node_modules/ansi-escapes": {+ "version": "7.3.0",+ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz",+ "integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==",+ "dependencies": {+ "environment": "^1.0.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/ansi-regex": {+ "version": "6.2.2",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"+ }+ },+ "node_modules/ansi-styles": {+ "version": "6.2.3",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",+ "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },"node_modules/any-promise": {"version": "1.3.0","resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",@@ -1339,6 +1394,17 @@"node": ">=8.0.0"}},+ "node_modules/auto-bind": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-5.0.1.tgz",+ "integrity": "sha512-ooviqdwwgfIfNmDwo94wlshcdzfO64XV0Cg6oDsDYBJfITDz1EngD2z7DkbvCWn+XIMsIqW27sEVF6qcpJrRcg==",+ "engines": {+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/base64-js": {"version": "1.5.1","resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",@@ -1501,6 +1567,83 @@"license": "ISC","optional": true},+ "node_modules/cli-boxes": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz",+ "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==",+ "engines": {+ "node": ">=10"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/cli-cursor": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz",+ "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==",+ "dependencies": {+ "restore-cursor": "^4.0.0"+ },+ "engines": {+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/cli-spinners": {+ "version": "2.9.2",+ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz",+ "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==",+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/cli-truncate": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz",+ "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==",+ "dependencies": {+ "slice-ansi": "^5.0.0",+ "string-width": "^7.0.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/cli-truncate/node_modules/slice-ansi": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz",+ "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==",+ "dependencies": {+ "ansi-styles": "^6.0.0",+ "is-fullwidth-code-point": "^4.0.0"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/slice-ansi?sponsor=1"+ }+ },+ "node_modules/code-excerpt": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-4.0.0.tgz",+ "integrity": "sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==",+ "dependencies": {+ "convert-to-spaces": "^2.0.1"+ },+ "engines": {+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"+ }+ },"node_modules/commander": {"version": "12.1.0","resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",@@ -1524,11 +1667,19 @@"node": "^14.18.0 || >=16.10.0"}},+ "node_modules/convert-to-spaces": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-2.0.1.tgz",+ "integrity": "sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==",+ "engines": {+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"+ }+ },"node_modules/csstype": {"version": "3.2.3","resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz","integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",- "dev": true+ "devOptional": true},"node_modules/debug": {"version": "4.4.3",@@ -1602,6 +1753,11 @@"url": "https://dotenvx.com"}},+ "node_modules/emoji-regex": {+ "version": "10.6.0",+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",+ "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="+ },"node_modules/end-of-stream": {"version": "1.4.5","resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",@@ -1612,12 +1768,28 @@"once": "^1.4.0"}},+ "node_modules/environment": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz",+ "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/es-module-lexer": {"version": "1.7.0","resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz","integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==","dev": true},+ "node_modules/es-toolkit": {+ "version": "1.46.1",+ "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.46.1.tgz",+ "integrity": "sha512-5eNtXOs3tbfxXOj04tjjseeWkRWaoCjdEI+96DgwzZoe6c9juL49pXlzAFTI72aWC9Y8p7168g6XIKjh7k6pyQ=="+ },"node_modules/esbuild": {"version": "0.27.7","resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz",@@ -1659,6 +1831,14 @@"@esbuild/win32-x64": "0.27.7"}},+ "node_modules/escape-string-regexp": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",+ "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",+ "engines": {+ "node": ">=8"+ }+ },"node_modules/estree-walker": {"version": "3.0.3","resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",@@ -1721,6 +1901,20 @@}}},+ "node_modules/figures": {+ "version": "6.1.0",+ "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz",+ "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==",+ "dependencies": {+ "is-unicode-supported": "^2.0.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/file-uri-to-path": {"version": "1.0.0","resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",@@ -1760,6 +1954,17 @@"node": "^8.16.0 || ^10.6.0 || >=11.0.0"}},+ "node_modules/get-east-asian-width": {+ "version": "1.5.0",+ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.5.0.tgz",+ "integrity": "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/github-from-package": {"version": "0.0.0","resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",@@ -1802,6 +2007,17 @@"license": "BSD-3-Clause","optional": true},+ "node_modules/indent-string": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz",+ "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/inherits": {"version": "2.0.4","resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",@@ -1816,6 +2032,136 @@"license": "ISC","optional": true},+ "node_modules/ink": {+ "version": "5.2.1",+ "resolved": "https://registry.npmjs.org/ink/-/ink-5.2.1.tgz",+ "integrity": "sha512-BqcUyWrG9zq5HIwW6JcfFHsIYebJkWWb4fczNah1goUO0vv5vneIlfwuS85twyJ5hYR/y18FlAYUxrO9ChIWVg==",+ "dependencies": {+ "@alcalzone/ansi-tokenize": "^0.1.3",+ "ansi-escapes": "^7.0.0",+ "ansi-styles": "^6.2.1",+ "auto-bind": "^5.0.1",+ "chalk": "^5.3.0",+ "cli-boxes": "^3.0.0",+ "cli-cursor": "^4.0.0",+ "cli-truncate": "^4.0.0",+ "code-excerpt": "^4.0.0",+ "es-toolkit": "^1.22.0",+ "indent-string": "^5.0.0",+ "is-in-ci": "^1.0.0",+ "patch-console": "^2.0.0",+ "react-reconciler": "^0.29.0",+ "scheduler": "^0.23.0",+ "signal-exit": "^3.0.7",+ "slice-ansi": "^7.1.0",+ "stack-utils": "^2.0.6",+ "string-width": "^7.2.0",+ "type-fest": "^4.27.0",+ "widest-line": "^5.0.0",+ "wrap-ansi": "^9.0.0",+ "ws": "^8.18.0",+ "yoga-layout": "~3.2.1"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "@types/react": ">=18.0.0",+ "react": ">=18.0.0",+ "react-devtools-core": "^4.19.1"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "react-devtools-core": {+ "optional": true+ }+ }+ },+ "node_modules/ink-select-input": {+ "version": "6.2.0",+ "resolved": "https://registry.npmjs.org/ink-select-input/-/ink-select-input-6.2.0.tgz",+ "integrity": "sha512-304fZXxkpYxJ9si5lxRCaX01GNlmPBgOZumXXRnPYbHW/iI31cgQynqk2tRypGLOF1cMIwPUzL2LSm6q4I5rQQ==",+ "dependencies": {+ "figures": "^6.1.0",+ "to-rotated": "^1.0.0"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "ink": ">=5.0.0",+ "react": ">=18.0.0"+ }+ },+ "node_modules/ink-spinner": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/ink-spinner/-/ink-spinner-5.0.0.tgz",+ "integrity": "sha512-EYEasbEjkqLGyPOUc8hBJZNuC5GvXGMLu0w5gdTNskPc7Izc5vO3tdQEYnzvshucyGCBXc86ig0ujXPMWaQCdA==",+ "dependencies": {+ "cli-spinners": "^2.7.0"+ },+ "engines": {+ "node": ">=14.16"+ },+ "peerDependencies": {+ "ink": ">=4.0.0",+ "react": ">=18.0.0"+ }+ },+ "node_modules/ink-text-input": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/ink-text-input/-/ink-text-input-6.0.0.tgz",+ "integrity": "sha512-Fw64n7Yha5deb1rHY137zHTAbSTNelUKuB5Kkk2HACXEtwIHBCf9OH2tP/LQ9fRYTl1F0dZgbW0zPnZk6FA9Lw==",+ "dependencies": {+ "chalk": "^5.3.0",+ "type-fest": "^4.18.2"+ },+ "engines": {+ "node": ">=18"+ },+ "peerDependencies": {+ "ink": ">=5",+ "react": ">=18"+ }+ },+ "node_modules/is-fullwidth-code-point": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz",+ "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/is-in-ci": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/is-in-ci/-/is-in-ci-1.0.0.tgz",+ "integrity": "sha512-eUuAjybVTHMYWm/U+vBO1sY/JOCgoPCXRxzdju0K+K0BiGW0SChEL1MLC0PoCIR1OlPo5YAp8HuQoUlsWEICwg==",+ "bin": {+ "is-in-ci": "cli.js"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/is-unicode-supported": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",+ "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/joycon": {"version": "3.1.1","resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz",@@ -1833,6 +2179,11 @@"base64-js": "^1.5.1"}},+ "node_modules/js-tokens": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="+ },"node_modules/json-schema": {"version": "0.4.0","resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",@@ -1865,6 +2216,17 @@"node": "^12.20.0 || ^14.13.1 || >=16.0.0"}},+ "node_modules/loose-envify": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",+ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",+ "dependencies": {+ "js-tokens": "^3.0.0 || ^4.0.0"+ },+ "bin": {+ "loose-envify": "cli.js"+ }+ },"node_modules/loupe": {"version": "3.2.1","resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz",@@ -1891,6 +2253,14 @@"node": ">= 18"}},+ "node_modules/mimic-fn": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",+ "engines": {+ "node": ">=6"+ }+ },"node_modules/mimic-response": {"version": "3.1.0","resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",@@ -2065,12 +2435,34 @@"wrappy": "1"}},+ "node_modules/onetime": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",+ "dependencies": {+ "mimic-fn": "^2.1.0"+ },+ "engines": {+ "node": ">=6"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/partial-json": {"version": "0.1.7","resolved": "https://registry.npmjs.org/partial-json/-/partial-json-0.1.7.tgz","integrity": "sha512-Njv/59hHaokb/hRUjce3Hdv12wd60MtM9Z5Olmn+nehe0QDAsRtRbJPvJ0Z91TusF0SuZRIvnM+S4l6EIP8leA==","license": "MIT"},+ "node_modules/patch-console": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/patch-console/-/patch-console-2.0.0.tgz",+ "integrity": "sha512-0YNdUceMdaQwoKce1gatDScmMo5pu/tfABfnzEqeG0gtTmd7mh/WcwgUjtAeOU7N8nFFlbQBnFK2gXW5fGvmMA==",+ "engines": {+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"+ }+ },"node_modules/pathe": {"version": "2.0.3","resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",@@ -2303,6 +2695,44 @@"rc": "cli.js"}},+ "node_modules/react": {+ "version": "18.3.1",+ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",+ "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",+ "dependencies": {+ "loose-envify": "^1.1.0"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/react-dom": {+ "version": "18.3.1",+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",+ "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",+ "dependencies": {+ "loose-envify": "^1.1.0",+ "scheduler": "^0.23.2"+ },+ "peerDependencies": {+ "react": "^18.3.1"+ }+ },+ "node_modules/react-reconciler": {+ "version": "0.29.2",+ "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.29.2.tgz",+ "integrity": "sha512-zZQqIiYgDCTP/f1N/mAR10nJGrPD2ZR+jDSEsKWJHYC7Cm2wodlwbR3upZRdC3cjIjSlTLNVyO7Iu0Yy7t2AYg==",+ "dependencies": {+ "loose-envify": "^1.1.0",+ "scheduler": "^0.23.2"+ },+ "engines": {+ "node": ">=0.10.0"+ },+ "peerDependencies": {+ "react": "^18.3.1"+ }+ },"node_modules/readable-stream": {"version": "3.6.2","resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",@@ -2348,6 +2778,21 @@"node": ">=8"}},+ "node_modules/restore-cursor": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz",+ "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==",+ "dependencies": {+ "onetime": "^5.1.0",+ "signal-exit": "^3.0.2"+ },+ "engines": {+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/rollup": {"version": "4.60.2","resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.2.tgz",@@ -2421,6 +2866,14 @@"node": ">=10"}},+ "node_modules/scheduler": {+ "version": "0.23.2",+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",+ "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==",+ "dependencies": {+ "loose-envify": "^1.1.0"+ }+ },"node_modules/secure-json-parse": {"version": "2.7.0","resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz",@@ -2445,6 +2898,11 @@"integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==","dev": true},+ "node_modules/signal-exit": {+ "version": "3.0.7",+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="+ },"node_modules/simple-concat": {"version": "1.0.1","resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",@@ -2492,6 +2950,35 @@"simple-concat": "^1.0.0"}},+ "node_modules/slice-ansi": {+ "version": "7.1.2",+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz",+ "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==",+ "dependencies": {+ "ansi-styles": "^6.2.1",+ "is-fullwidth-code-point": "^5.0.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/chalk/slice-ansi?sponsor=1"+ }+ },+ "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz",+ "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==",+ "dependencies": {+ "get-east-asian-width": "^1.3.1"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/sonic-boom": {"version": "4.2.1","resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.1.tgz",@@ -2526,6 +3013,17 @@"node": ">= 10.x"}},+ "node_modules/stack-utils": {+ "version": "2.0.6",+ "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz",+ "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==",+ "dependencies": {+ "escape-string-regexp": "^2.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },"node_modules/stackback": {"version": "0.0.2","resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",@@ -2548,6 +3046,36 @@"safe-buffer": "~5.2.0"}},+ "node_modules/string-width": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",+ "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",+ "dependencies": {+ "emoji-regex": "^10.3.0",+ "get-east-asian-width": "^1.0.0",+ "strip-ansi": "^7.1.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/strip-ansi": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",+ "dependencies": {+ "ansi-regex": "^6.2.2"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"+ }+ },"node_modules/strip-json-comments": {"version": "2.0.1","resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",@@ -2721,6 +3249,17 @@"node": ">=14.0.0"}},+ "node_modules/to-rotated": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/to-rotated/-/to-rotated-1.0.0.tgz",+ "integrity": "sha512-KsEID8AfgUy+pxVRLsWp0VzCa69wxzUDZnzGbyIST/bcgcrMvTYoFBX/QORH4YApoD89EDuUovx4BTdpOn319Q==",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/tr46": {"version": "0.0.3","resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",@@ -2806,6 +3345,17 @@"node": "*"}},+ "node_modules/type-fest": {+ "version": "4.41.0",+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz",+ "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==",+ "engines": {+ "node": ">=16"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/typescript": {"version": "5.9.3","resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",@@ -3501,6 +4051,36 @@"node": ">=8"}},+ "node_modules/widest-line": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-5.0.0.tgz",+ "integrity": "sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA==",+ "dependencies": {+ "string-width": "^7.0.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/wrap-ansi": {+ "version": "9.0.2",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz",+ "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==",+ "dependencies": {+ "ansi-styles": "^6.2.1",+ "string-width": "^7.0.0",+ "strip-ansi": "^7.1.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"+ }+ },"node_modules/wrappy": {"version": "1.0.2","resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",@@ -3508,6 +4088,26 @@"license": "ISC","optional": true},+ "node_modules/ws": {+ "version": "8.20.0",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",+ "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==",+ "engines": {+ "node": ">=10.0.0"+ },+ "peerDependencies": {+ "bufferutil": "^4.0.1",+ "utf-8-validate": ">=5.0.2"+ },+ "peerDependenciesMeta": {+ "bufferutil": {+ "optional": true+ },+ "utf-8-validate": {+ "optional": true+ }+ }+ },"node_modules/yaml": {"version": "2.8.3","resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz",@@ -3522,6 +4122,11 @@"url": "https://github.com/sponsors/eemeli"}},+ "node_modules/yoga-layout": {+ "version": "3.2.1",+ "resolved": "https://registry.npmjs.org/yoga-layout/-/yoga-layout-3.2.1.tgz",+ "integrity": "sha512-0LPOt3AxKqMdFBZA3HBAt/t/8vIKq7VaQYbuA8WxCgung+p9TVyKRYdpvCb80HcdTN2NkbIKbhNwKUfm3tQywQ=="+ },"node_modules/zod": {"version": "3.25.76","resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",@@ -3667,6 +4272,15 @@"secure-json-parse": "^2.7.0"}},+ "@alcalzone/ansi-tokenize": {+ "version": "0.1.3",+ "resolved": "https://registry.npmjs.org/@alcalzone/ansi-tokenize/-/ansi-tokenize-0.1.3.tgz",+ "integrity": "sha512-3yWxPTq3UQ/FY9p1ErPxIyfT64elWaMvM9lIHnaqpyft63tkxodF5aUElYHrdisWve5cETkh1+KBw1yJuW0aRw==",+ "requires": {+ "ansi-styles": "^6.2.1",+ "is-fullwidth-code-point": "^4.0.0"+ }+ },"@esbuild/aix-ppc64": {"version": "0.27.7","resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz",@@ -4134,13 +4748,13 @@"version": "15.7.15","resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz","integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==",- "dev": true+ "devOptional": true},"@types/react": {"version": "18.3.28","resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.28.tgz","integrity": "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw==",- "dev": true,+ "devOptional": true,"requires": {"@types/prop-types": "*","csstype": "^3.2.2"@@ -4271,6 +4885,24 @@}}},+ "ansi-escapes": {+ "version": "7.3.0",+ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz",+ "integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==",+ "requires": {+ "environment": "^1.0.0"+ }+ },+ "ansi-regex": {+ "version": "6.2.2",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="+ },+ "ansi-styles": {+ "version": "6.2.3",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",+ "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg=="+ },"any-promise": {"version": "1.3.0","resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",@@ -4288,6 +4920,11 @@"resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz","integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ=="},+ "auto-bind": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-5.0.1.tgz",+ "integrity": "sha512-ooviqdwwgfIfNmDwo94wlshcdzfO64XV0Cg6oDsDYBJfITDz1EngD2z7DkbvCWn+XIMsIqW27sEVF6qcpJrRcg=="+ },"base64-js": {"version": "1.5.1","resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",@@ -4387,6 +5024,52 @@"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==","optional": true},+ "cli-boxes": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz",+ "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g=="+ },+ "cli-cursor": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz",+ "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==",+ "requires": {+ "restore-cursor": "^4.0.0"+ }+ },+ "cli-spinners": {+ "version": "2.9.2",+ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz",+ "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg=="+ },+ "cli-truncate": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz",+ "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==",+ "requires": {+ "slice-ansi": "^5.0.0",+ "string-width": "^7.0.0"+ },+ "dependencies": {+ "slice-ansi": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz",+ "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==",+ "requires": {+ "ansi-styles": "^6.0.0",+ "is-fullwidth-code-point": "^4.0.0"+ }+ }+ }+ },+ "code-excerpt": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-4.0.0.tgz",+ "integrity": "sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==",+ "requires": {+ "convert-to-spaces": "^2.0.1"+ }+ },"commander": {"version": "12.1.0","resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",@@ -4404,11 +5087,16 @@"integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==","dev": true},+ "convert-to-spaces": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-2.0.1.tgz",+ "integrity": "sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ=="+ },"csstype": {"version": "3.2.3","resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz","integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",- "dev": true+ "devOptional": true},"debug": {"version": "4.4.3",@@ -4450,6 +5138,11 @@"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz","integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow=="},+ "emoji-regex": {+ "version": "10.6.0",+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",+ "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="+ },"end-of-stream": {"version": "1.4.5","resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",@@ -4459,12 +5152,22 @@"once": "^1.4.0"}},+ "environment": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz",+ "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q=="+ },"es-module-lexer": {"version": "1.7.0","resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz","integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==","dev": true},+ "es-toolkit": {+ "version": "1.46.1",+ "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.46.1.tgz",+ "integrity": "sha512-5eNtXOs3tbfxXOj04tjjseeWkRWaoCjdEI+96DgwzZoe6c9juL49pXlzAFTI72aWC9Y8p7168g6XIKjh7k6pyQ=="+ },"esbuild": {"version": "0.27.7","resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz",@@ -4499,6 +5202,11 @@"@esbuild/win32-x64": "0.27.7"}},+ "escape-string-regexp": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",+ "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w=="+ },"estree-walker": {"version": "3.0.3","resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",@@ -4537,6 +5245,14 @@"dev": true,"requires": {}},+ "figures": {+ "version": "6.1.0",+ "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz",+ "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==",+ "requires": {+ "is-unicode-supported": "^2.0.0"+ }+ },"file-uri-to-path": {"version": "1.0.0","resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",@@ -4567,6 +5283,11 @@"dev": true,"optional": true},+ "get-east-asian-width": {+ "version": "1.5.0",+ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.5.0.tgz",+ "integrity": "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA=="+ },"github-from-package": {"version": "0.0.0","resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",@@ -4590,6 +5311,11 @@"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==","optional": true},+ "indent-string": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz",+ "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg=="+ },"inherits": {"version": "2.0.4","resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",@@ -4602,6 +5328,78 @@"integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==","optional": true},+ "ink": {+ "version": "5.2.1",+ "resolved": "https://registry.npmjs.org/ink/-/ink-5.2.1.tgz",+ "integrity": "sha512-BqcUyWrG9zq5HIwW6JcfFHsIYebJkWWb4fczNah1goUO0vv5vneIlfwuS85twyJ5hYR/y18FlAYUxrO9ChIWVg==",+ "requires": {+ "@alcalzone/ansi-tokenize": "^0.1.3",+ "ansi-escapes": "^7.0.0",+ "ansi-styles": "^6.2.1",+ "auto-bind": "^5.0.1",+ "chalk": "^5.3.0",+ "cli-boxes": "^3.0.0",+ "cli-cursor": "^4.0.0",+ "cli-truncate": "^4.0.0",+ "code-excerpt": "^4.0.0",+ "es-toolkit": "^1.22.0",+ "indent-string": "^5.0.0",+ "is-in-ci": "^1.0.0",+ "patch-console": "^2.0.0",+ "react-reconciler": "^0.29.0",+ "scheduler": "^0.23.0",+ "signal-exit": "^3.0.7",+ "slice-ansi": "^7.1.0",+ "stack-utils": "^2.0.6",+ "string-width": "^7.2.0",+ "type-fest": "^4.27.0",+ "widest-line": "^5.0.0",+ "wrap-ansi": "^9.0.0",+ "ws": "^8.18.0",+ "yoga-layout": "~3.2.1"+ }+ },+ "ink-select-input": {+ "version": "6.2.0",+ "resolved": "https://registry.npmjs.org/ink-select-input/-/ink-select-input-6.2.0.tgz",+ "integrity": "sha512-304fZXxkpYxJ9si5lxRCaX01GNlmPBgOZumXXRnPYbHW/iI31cgQynqk2tRypGLOF1cMIwPUzL2LSm6q4I5rQQ==",+ "requires": {+ "figures": "^6.1.0",+ "to-rotated": "^1.0.0"+ }+ },+ "ink-spinner": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/ink-spinner/-/ink-spinner-5.0.0.tgz",+ "integrity": "sha512-EYEasbEjkqLGyPOUc8hBJZNuC5GvXGMLu0w5gdTNskPc7Izc5vO3tdQEYnzvshucyGCBXc86ig0ujXPMWaQCdA==",+ "requires": {+ "cli-spinners": "^2.7.0"+ }+ },+ "ink-text-input": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/ink-text-input/-/ink-text-input-6.0.0.tgz",+ "integrity": "sha512-Fw64n7Yha5deb1rHY137zHTAbSTNelUKuB5Kkk2HACXEtwIHBCf9OH2tP/LQ9fRYTl1F0dZgbW0zPnZk6FA9Lw==",+ "requires": {+ "chalk": "^5.3.0",+ "type-fest": "^4.18.2"+ }+ },+ "is-fullwidth-code-point": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz",+ "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ=="+ },+ "is-in-ci": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/is-in-ci/-/is-in-ci-1.0.0.tgz",+ "integrity": "sha512-eUuAjybVTHMYWm/U+vBO1sY/JOCgoPCXRxzdju0K+K0BiGW0SChEL1MLC0PoCIR1OlPo5YAp8HuQoUlsWEICwg=="+ },+ "is-unicode-supported": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",+ "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ=="+ },"joycon": {"version": "3.1.1","resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz",@@ -4616,6 +5414,11 @@"base64-js": "^1.5.1"}},+ "js-tokens": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="+ },"json-schema": {"version": "0.4.0","resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",@@ -4639,6 +5442,14 @@"integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==","dev": true},+ "loose-envify": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",+ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",+ "requires": {+ "js-tokens": "^3.0.0 || ^4.0.0"+ }+ },"loupe": {"version": "3.2.1","resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz",@@ -4659,6 +5470,11 @@"resolved": "https://registry.npmjs.org/marked/-/marked-14.1.4.tgz","integrity": "sha512-vkVZ8ONmUdPnjCKc5uTRvmkRbx4EAi2OkTOXmfTDhZz3OFqMNBM1oTTWwTr4HY4uAEojhzPf+Fy8F1DWa3Sndg=="},+ "mimic-fn": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="+ },"mimic-response": {"version": "3.1.0","resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",@@ -4771,11 +5587,24 @@"wrappy": "1"}},+ "onetime": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",+ "requires": {+ "mimic-fn": "^2.1.0"+ }+ },"partial-json": {"version": "0.1.7","resolved": "https://registry.npmjs.org/partial-json/-/partial-json-0.1.7.tgz","integrity": "sha512-Njv/59hHaokb/hRUjce3Hdv12wd60MtM9Z5Olmn+nehe0QDAsRtRbJPvJ0Z91TusF0SuZRIvnM+S4l6EIP8leA=="},+ "patch-console": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/patch-console/-/patch-console-2.0.0.tgz",+ "integrity": "sha512-0YNdUceMdaQwoKce1gatDScmMo5pu/tfABfnzEqeG0gtTmd7mh/WcwgUjtAeOU7N8nFFlbQBnFK2gXW5fGvmMA=="+ },"pathe": {"version": "2.0.3","resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",@@ -4920,6 +5749,32 @@"strip-json-comments": "~2.0.1"}},+ "react": {+ "version": "18.3.1",+ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",+ "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",+ "requires": {+ "loose-envify": "^1.1.0"+ }+ },+ "react-dom": {+ "version": "18.3.1",+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",+ "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",+ "requires": {+ "loose-envify": "^1.1.0",+ "scheduler": "^0.23.2"+ }+ },+ "react-reconciler": {+ "version": "0.29.2",+ "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.29.2.tgz",+ "integrity": "sha512-zZQqIiYgDCTP/f1N/mAR10nJGrPD2ZR+jDSEsKWJHYC7Cm2wodlwbR3upZRdC3cjIjSlTLNVyO7Iu0Yy7t2AYg==",+ "requires": {+ "loose-envify": "^1.1.0",+ "scheduler": "^0.23.2"+ }+ },"readable-stream": {"version": "3.6.2","resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",@@ -4948,6 +5803,15 @@"integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==","dev": true},+ "restore-cursor": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz",+ "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==",+ "requires": {+ "onetime": "^5.1.0",+ "signal-exit": "^3.0.2"+ }+ },"rollup": {"version": "4.60.2","resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.2.tgz",@@ -4994,6 +5858,14 @@"resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz","integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA=="},+ "scheduler": {+ "version": "0.23.2",+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",+ "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==",+ "requires": {+ "loose-envify": "^1.1.0"+ }+ },"secure-json-parse": {"version": "2.7.0","resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz",@@ -5011,6 +5883,11 @@"integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==","dev": true},+ "signal-exit": {+ "version": "3.0.7",+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="+ },"simple-concat": {"version": "1.0.1","resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",@@ -5028,6 +5905,25 @@"simple-concat": "^1.0.0"}},+ "slice-ansi": {+ "version": "7.1.2",+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz",+ "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==",+ "requires": {+ "ansi-styles": "^6.2.1",+ "is-fullwidth-code-point": "^5.0.0"+ },+ "dependencies": {+ "is-fullwidth-code-point": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz",+ "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==",+ "requires": {+ "get-east-asian-width": "^1.3.1"+ }+ }+ }+ },"sonic-boom": {"version": "4.2.1","resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.1.tgz",@@ -5053,6 +5949,14 @@"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz","integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg=="},+ "stack-utils": {+ "version": "2.0.6",+ "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz",+ "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==",+ "requires": {+ "escape-string-regexp": "^2.0.0"+ }+ },"stackback": {"version": "0.0.2","resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",@@ -5074,6 +5978,24 @@"safe-buffer": "~5.2.0"}},+ "string-width": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",+ "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",+ "requires": {+ "emoji-regex": "^10.3.0",+ "get-east-asian-width": "^1.0.0",+ "strip-ansi": "^7.1.0"+ }+ },+ "strip-ansi": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",+ "requires": {+ "ansi-regex": "^6.2.2"+ }+ },"strip-json-comments": {"version": "2.0.1","resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",@@ -5211,6 +6133,11 @@"integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==","dev": true},+ "to-rotated": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/to-rotated/-/to-rotated-1.0.0.tgz",+ "integrity": "sha512-KsEID8AfgUy+pxVRLsWp0VzCa69wxzUDZnzGbyIST/bcgcrMvTYoFBX/QORH4YApoD89EDuUovx4BTdpOn319Q=="+ },"tr46": {"version": "0.0.3","resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",@@ -5262,6 +6189,11 @@"safe-buffer": "^5.0.1"}},+ "type-fest": {+ "version": "4.41.0",+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz",+ "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="+ },"typescript": {"version": "5.9.3","resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",@@ -5592,17 +6524,46 @@"stackback": "0.0.2"}},+ "widest-line": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-5.0.0.tgz",+ "integrity": "sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA==",+ "requires": {+ "string-width": "^7.0.0"+ }+ },+ "wrap-ansi": {+ "version": "9.0.2",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz",+ "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==",+ "requires": {+ "ansi-styles": "^6.2.1",+ "string-width": "^7.0.0",+ "strip-ansi": "^7.1.0"+ }+ },"wrappy": {"version": "1.0.2","resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz","integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==","optional": true},+ "ws": {+ "version": "8.20.0",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",+ "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==",+ "requires": {}+ },"yaml": {"version": "2.8.3","resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz","integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg=="},+ "yoga-layout": {+ "version": "3.2.1",+ "resolved": "https://registry.npmjs.org/yoga-layout/-/yoga-layout-3.2.1.tgz",+ "integrity": "sha512-0LPOt3AxKqMdFBZA3HBAt/t/8vIKq7VaQYbuA8WxCgung+p9TVyKRYdpvCb80HcdTN2NkbIKbhNwKUfm3tQywQ=="+ },"zod": {"version": "3.25.76","resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",diff --git a/package.json b/package.jsonindex 710dc595..e7846c60 100644--- a/package.json+++ b/package.json@@ -62,12 +62,19 @@"chalk": "^5.4.0","commander": "^12.1.0","dotenv": "^16.4.7",+ "figures": "^6.1.0","grammy": "^1.42.0",+ "ink": "^5.2.1",+ "ink-select-input": "^6.2.0",+ "ink-spinner": "^5.0.0",+ "ink-text-input": "^6.0.0","js-tiktoken": "^1.0.19","marked": "^14.1.4","node-cron": "^3.0.3","ollama-ai-provider": "^1.2.0","pino": "^9.6.0",+ "react": "^18.3.1",+ "react-dom": "^18.3.1","yaml": "^2.7.0","zod": "^3.25.76"},@@ -78,7 +85,7 @@"@types/better-sqlite3": "^7.6.13","@types/node": "^22.13.0","@types/node-cron": "^3.0.11",- "@types/react": "^18.3.0",+ "@types/react": "^18.3.28","tsup": "^8.4.0","typescript": "^5.7.0","vitest": "^3.0.0"diff --git a/src/channels/cli.ts b/src/channels/cli.tsindex bb382200..464d1776 100644--- a/src/channels/cli.ts+++ b/src/channels/cli.ts@@ -1,305 +1,277 @@-import readline from 'node:readline';-import fs from 'node:fs';-import path from 'node:path';-import chalk from 'chalk';+import React from 'react';+import { render } from 'ink';import type { ChannelMessage } from '../types/channel.js';import { BaseChannel, type PermissionMode } from './base.js';import { logger } from '../utils/logger.js';-import { renderMarkdown } from '../utils/markdown.js';import { formatToolStep, formatToolResult } from '../utils/tool-label.js';-import {- ArrowSelectCancelledError,- selectWithArrowKeys,- type ArrowSelectOption,-} from '../utils/arrow-select.js';--const USER_PROMPT = ' You: ';-const SPINNER_FRAMES = ['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'];--function agentName(name: string, suffix?: string): string {- return chalk.cyan(` ${name}:`) + (suffix ?? '');+import type { ChatMessage, ToolStep, PermissionPromptState, SidebarSection, SkillInfo, SubAgentInfo, ProviderInfo, TokenInfo, AppMode } from '../ui/types.js';+import { TuiApp } from '../ui/App.js';++export interface TuiState {+ mode: AppMode;+ chatMessages: ChatMessage[];+ toolSteps: ToolStep[];+ isThinking: boolean;+ permissionPrompt: PermissionPromptState | null;+ agentName: string;+ version: string;+ provider: ProviderInfo | null;+ tokenInfo: TokenInfo | null;+ skills: SkillInfo[];+ subAgents: SubAgentInfo[];+ sidebarSections: SidebarSection[];+ programmingMode: import('../core/programming-mode.js').ProgrammingModeState;+ projectContext: string | null;+ permissionMode: PermissionMode;}+const defaultState: TuiState = {+ mode: 'splash',+ chatMessages: [],+ toolSteps: [],+ isThinking: false,+ permissionPrompt: null,+ agentName: 'Mercury',+ version: '1.1.5',+ provider: null,+ tokenInfo: null,+ skills: [],+ subAgents: [],+ sidebarSections: [],+ programmingMode: 'off',+ projectContext: null,+ permissionMode: 'ask-me',+};+export class CLIChannel extends BaseChannel {readonly type = 'cli' as const;- private rl: readline.Interface | null = null;private agentName: string;+ private inkInstance: ReturnType<typeof render> | null = null;+ private inputHandler: ((text: string) => void) | null = null;+ private permissionResolver: ((value: string | boolean) => void) | null = null;private menuDepth = 0;private menuAbortController: AbortController | null = null;- private outputInProgress = 0;- private streamActive = false;- private streamToolLines = 0;- private turnHeaderPrinted = false;private stepCount = 0;private stepStartTime = 0;- private spinnerFrame = 0;- private spinnerTimer: ReturnType<typeof setInterval> | null = null;- private spinnerLine = '';+ private state: TuiState = { ...defaultState };+ private spotifyClient: any = null;constructor(agentName: string = 'Mercury') {super();this.agentName = agentName;+ this.state.agentName = agentName;}setAgentName(name: string): void {this.agentName = name;+ this.update({ agentName: name });}async start(): Promise<void> {- this.createInterface();this.ready = true;- logger.info('CLI channel started');+ logger.info('CLI channel started (Ink TUI)');}- private createInterface(): void {- this.rl = readline.createInterface({- input: process.stdin,- output: process.stdout,- });- this.rl.setPrompt(USER_PROMPT);-- this.rl.on('line', (line) => {- const trimmed = line.trim();- if (!trimmed) {- this.showPrompt();- return;- }+ async stop(): Promise<void> {+ this.inkInstance?.unmount();+ this.inkInstance = null;+ this.ready = false;+ }- const msg: ChannelMessage = {- id: Date.now().toString(36),- channelId: 'cli',- channelType: 'cli',- senderId: 'owner',- content: trimmed,- timestamp: Date.now(),- };- this.emit(msg);- });+ private update(partial: Partial<TuiState>): void {+ this.state = { ...this.state, ...partial };+ this.rerender();}- async stop(): Promise<void> {- this.rl?.close();- this.rl = null;- this.ready = false;+ private rerender(): void {+ if (!this.inkInstance) return;+ this.inkInstance.rerender(+ React.createElement(TuiApp, {+ state: this.state,+ onInput: (text: string) => { this.inputHandler?.(text); },+ onPermissionResolve: (value: string | boolean) => {+ if (this.permissionResolver) {+ this.permissionResolver(value);+ this.permissionResolver = null;+ }+ this.update({ permissionPrompt: null });+ },+ spotifyClient: this.spotifyClient,+ }),+ );}- async send(content: string, _targetId?: string, elapsedMs?: number): Promise<void> {- this.closeActiveMenu();- this.beginOutput();- this.turnHeaderPrinted = false;- const timeStr = elapsedMs != null ? chalk.dim(` (${(elapsedMs / 1000).toFixed(1)}s)`) : '';+ mountTUI(onInput: (text: string) => void, spotifyClient?: any): void {+ this.spotifyClient = spotifyClient ?? null;- const block = this.formatBlock(this.agentName, timeStr, content);- for (const line of block) {- console.log(line);- }+ this.inputHandler = (text: string) => {+ const trimmed = text.trim();+ if (trimmed === '/chat' || trimmed === '/c') {+ this.update({ mode: 'chat' });+ return;+ }+ if (trimmed === '/code' || trimmed === '/coding') {+ this.update({ mode: 'coding' });+ return;+ }+ if (trimmed === '/menu' || trimmed === '/m') {+ this.update({ mode: 'menu' });+ return;+ }+ if (trimmed === '/spotify' || trimmed === '/s') {+ this.update({ mode: 'spotify' });+ return;+ }+ if (trimmed === '/splash') {+ this.update({ mode: 'splash' });+ return;+ }+ onInput(trimmed);+ };++ this.inkInstance = render(+ React.createElement(TuiApp, {+ state: this.state,+ onInput: (text: string) => { this.inputHandler?.(text); },+ onPermissionResolve: (value: string | boolean) => {+ if (this.permissionResolver) {+ this.permissionResolver(value);+ this.permissionResolver = null;+ }+ this.update({ permissionPrompt: null });+ },+ spotifyClient: this.spotifyClient,+ }),+ { exitOnCtrlC: false, patchConsole: false },+ );+ }- this.endOutput();+ async send(content: string, _targetId?: string, _elapsedMs?: number): Promise<void> {+ const msg: ChatMessage = {+ id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),+ role: 'agent',+ content,+ timestamp: Date.now(),+ };+ this.update({+ chatMessages: [...this.state.chatMessages, msg],+ isThinking: false,+ });}async sendFile(filePath: string, _targetId?: string): Promise<void> {- this.closeActiveMenu();- this.beginOutput();+ const fs = await import('node:fs');+ const path = await import('node:path');const resolved = path.resolve(filePath);+ let content = '';if (!fs.existsSync(resolved)) {- console.log(chalk.red(` File not found: ${filePath}`));- this.endOutput();- return;- }- const stat = fs.statSync(resolved);- const sizeStr = stat.size > 1024 * 1024- ? `${(stat.size / (1024 * 1024)).toFixed(1)}MB`- : stat.size > 1024- ? `${(stat.size / 1024).toFixed(1)}KB`- : `${stat.size}B`;-- const block = this.formatBlock(this.agentName, chalk.dim(' (file)'), [- chalk.dim(`path: ${resolved}`),- chalk.dim(`size: ${sizeStr}`),- ].join('\n'));- for (const line of block) {- console.log(line);+ content = `File not found: ${filePath}`;+ } else {+ const stat = fs.statSync(resolved);+ const sizeStr = stat.size > 1024 * 1024+ ? `${(stat.size / (1024 * 1024)).toFixed(1)}MB`+ : stat.size > 1024+ ? `${(stat.size / 1024).toFixed(1)}KB`+ : `${stat.size}B`;+ content = `path: ${resolved}\nsize: ${sizeStr}`;}-- this.endOutput();+ const msg: ChatMessage = {+ id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),+ role: 'agent',+ content,+ timestamp: Date.now(),+ };+ this.update({+ chatMessages: [...this.state.chatMessages, msg],+ });}async sendToolFeedback(toolName: string, args: Record<string, any>): Promise<void> {const label = formatToolStep(toolName, args);- if (this.streamActive) {- this.streamToolLines++;- process.stdout.write(chalk.dim(`\n ${label}\n`));- } else {- this.stopSpinner();- if (!this.turnHeaderPrinted) {- this.turnHeaderPrinted = true;- console.log('');- console.log(agentName(this.agentName, ''));- console.log('');- }- this.stepCount += 1;- this.stepStartTime = Date.now();- const stepPrefix = chalk.dim(` ${this.stepCount}.`);- console.log(`${stepPrefix} ${chalk.dim(label)}`);- this.startSpinner();- }+ const step: ToolStep = {+ id: `step-${Date.now()}-${this.stepCount}`,+ toolName,+ label,+ status: 'running',+ };+ this.stepCount += 1;+ this.stepStartTime = Date.now();+ this.update({+ toolSteps: [...this.state.toolSteps, step],+ isThinking: true,+ });}sendStepDone(toolName: string, result: unknown): void {- if (this.streamActive) {- const summary = formatToolResult(toolName, result);- if (summary) {- process.stdout.write(chalk.dim(` ${summary}\n`));- this.streamToolLines++;+ const toolSteps = this.state.toolSteps.map((step) => {+ if (step.status === 'running') {+ const elapsed = this.stepStartTime ? (Date.now() - this.stepStartTime) / 1000 : 0;+ const summary = formatToolResult(toolName, result);+ return { ...step, status: 'done' as const, elapsed, result: summary || undefined };}- return;- }- this.stopSpinner();- const elapsed = ((Date.now() - this.stepStartTime) / 1000).toFixed(1);- const summary = formatToolResult(toolName, result);- if (summary) {- console.log(chalk.dim(` ${summary} (${elapsed}s)`));- } else {- process.stdout.write(chalk.dim(` ${elapsed}s\n`));- }- }-- private startSpinner(): void {- if (!process.stdout.isTTY) return;- this.spinnerFrame = 0;- this.spinnerLine = '';- this.spinnerTimer = setInterval(() => {- const frame = SPINNER_FRAMES[this.spinnerFrame % SPINNER_FRAMES.length];- const elapsed = ((Date.now() - this.stepStartTime) / 1000).toFixed(0);- this.spinnerLine = chalk.dim(` ${frame} Step ${this.stepCount} · ${elapsed}s`);- process.stdout.write(`\x1b[2K\r${this.spinnerLine}`);- this.spinnerFrame++;- }, 80);- }-- private stopSpinner(): void {- if (this.spinnerTimer) {- clearInterval(this.spinnerTimer);- this.spinnerTimer = null;- }- if (this.spinnerLine) {- process.stdout.write('\x1b[2K\r');- this.spinnerLine = '';- }+ return step;+ });+ this.update({ toolSteps });}async stream(content: AsyncIterable<string>, _targetId?: string): Promise<string> {- this.closeActiveMenu();- this.beginOutput();- this.streamActive = true;- this.streamToolLines = 0;- this.stepCount = 0;- this.turnHeaderPrinted = false;-- if (!process.stdout.isTTY) {- process.stdout.write(chalk.cyan(` ${this.agentName}: `));- let full = '';- for await (const chunk of content) {- process.stdout.write(chunk);- full += chunk;- }- this.streamActive = false;- console.log('\n');- this.endOutput();- return full;- }-- const startTime = Date.now();- const headerLines = ['', chalk.cyan(` ${this.agentName}:`), ''];- for (const line of headerLines) {- console.log(line);- }-- const indent = ' ';- const cols = process.stdout.columns || 80;- const contentCols = Math.max(1, cols - indent.length);- let visualLines = headerLines.length;- let pendingIndent = true;- let lineLen = 0;-+ const msgId = Date.now().toString(36) + Math.random().toString(36).slice(2, 6);let full = '';+ let lastRender = 0;++ const initialMsg: ChatMessage = {+ id: msgId,+ role: 'agent',+ content: '',+ timestamp: Date.now(),+ streaming: true,+ };++ this.update({+ chatMessages: [...this.state.chatMessages, initialMsg],+ isThinking: true,+ });+for await (const chunk of content) {full += chunk;- for (let i = 0; i < chunk.length; i++) {- const ch = chunk[i];- if (ch === '\n') {- visualLines += Math.max(1, Math.ceil((lineLen + indent.length) / cols));- process.stdout.write('\n');- lineLen = 0;- pendingIndent = true;- } else {- if (pendingIndent) {- process.stdout.write(indent);- pendingIndent = false;- }- process.stdout.write(ch);- lineLen++;- }+ const now = Date.now();+ if (now - lastRender >= 50) {+ this.update({+ chatMessages: this.state.chatMessages.map((m) =>+ m.id === msgId ? { ...m, content: full, streaming: true } : m,+ ),+ });+ lastRender = now;}}- if (lineLen > 0) {- visualLines += Math.max(1, Math.ceil((lineLen + indent.length) / cols));- process.stdout.write('\n');- } else {- visualLines += 1;- }- this.streamActive = false;- process.stdout.write(`\x1b[${visualLines}A`);- process.stdout.write('\x1b[J');-- if (full.trim()) {- const block = this.formatBlock(this.agentName, '', full);- for (const line of block) {- console.log(line);- }- const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);- console.log(chalk.dim(' ' + '─'.repeat(50 - elapsed.length - 4) + ' ' + elapsed + 's'));- }+ this.update({+ chatMessages: this.state.chatMessages.map((m) =>+ m.id === msgId ? { ...m, content: full, streaming: false } : m,+ ),+ isThinking: false,+ });- this.endOutput();return full;}async typing(_targetId?: string): Promise<void> {- this.stopSpinner();- if (process.stdout.isTTY) {- process.stdout.write(chalk.dim(` ${this.agentName} is thinking...\r`));- }+ this.update({ isThinking: true });}- showPrompt(): void {- if (this.rl) {- process.stdout.write('\x1b[2K\r');- process.stdout.write(chalk.yellow(USER_PROMPT));- }- }+ showPrompt(): void {}- private formatBlock(name: string, suffix: string, content: string): string[] {- const header = agentName(name, suffix);- const body = renderMarkdown(content)- .split('\n')- .map((line: string) => ` ${line}`)- .join('\n');- return ['', header, '', body, ''];- }-- async withMenu<T>(runner: (select: (title: string, options: ArrowSelectOption[]) => Promise<string>) => Promise<T>): Promise<T | undefined> {+ async withMenu<T>(runner: (select: (title: string, options: Array<{ value: string; label: string }>) => Promise<string>) => Promise<T>): Promise<T | undefined> {this.menuDepth += 1;+ const { selectWithArrowKeys } = await import('../utils/arrow-select.js');this.menuAbortController = new AbortController();- this.suspendPrompt();try {return await runner((title, options) => selectWithArrowKeys(title, options, {signal: this.menuAbortController?.signal,}));} catch (error) {- if (error instanceof ArrowSelectCancelledError) {+ if (error instanceof Error && error.name === 'ArrowSelectCancelledError') {return undefined;}throw error;@@ -308,12 +280,6 @@ export class CLIChannel extends BaseChannel {if (this.menuDepth === 0) {this.menuAbortController = null;}- if (this.menuDepth === 0) {- this.resumePrompt();- if (this.outputInProgress === 0) {- this.showPrompt();- }- }}}@@ -323,95 +289,111 @@ export class CLIChannel extends BaseChannel {}}- private beginOutput(): void {- this.outputInProgress += 1;+ async prompt(question: string): Promise<string> {+ return new Promise((resolve) => {+ this.permissionResolver = (val) => resolve(String(val));+ this.update({+ permissionPrompt: {+ type: 'ask',+ message: question,+ resolve: () => {},+ },+ });+ });}- private endOutput(): void {- this.outputInProgress = Math.max(0, this.outputInProgress - 1);- if (this.menuDepth === 0 && this.outputInProgress === 0) {- this.showPrompt();- }- }+ async askPermissionMode(): Promise<PermissionMode> {+ if (!process.stdout.isTTY) return 'ask-me';- private suspendPrompt(): void {- if (!this.rl) return;- process.stdout.write('\n');- this.rl.close();- this.rl = null;+ return new Promise((resolve) => {+ this.permissionResolver = (val) => resolve(val as PermissionMode);+ this.update({+ permissionPrompt: {+ type: 'mode',+ message: 'Choose how Mercury handles risky actions this session.',+ options: [+ { value: 'ask-me', label: 'Ask Me — confirm before file writes, shell commands, and scope changes' },+ { value: 'allow-all', label: 'Allow All — auto-approve everything (scopes, commands, loop continuation)' },+ ],+ resolve: () => {},+ },+ });+ });}- private resumePrompt(): void {- if (!this.ready || this.rl) return;- this.createInterface();+ async askPermission(prompt: string): Promise<string> {+ return new Promise((resolve) => {+ this.permissionResolver = (val) => resolve(String(val));+ this.update({+ permissionPrompt: {+ type: 'ask',+ message: prompt,+ resolve: () => {},+ },+ });+ });}- async prompt(question: string): Promise<string> {+ async askToContinue(question: string, _targetId?: string): Promise<boolean> {return new Promise((resolve) => {- this.rl?.question(question, (answer) => resolve(answer.trim()));+ this.permissionResolver = (val) => resolve(Boolean(val));+ this.update({+ permissionPrompt: {+ type: 'continue',+ message: question,+ resolve: () => {},+ },+ });});}- async askPermissionMode(): Promise<PermissionMode> {- if (!process.stdout.isTTY) return 'ask-me';+ clearPermissionPrompt(): void {+ this.update({ permissionPrompt: null });+ }- this.suspendPrompt();+ setSkills(skills: SkillInfo[]): void {+ this.update({ skills });+ }- console.log('');- console.log(chalk.bold(' Permission Mode'));- console.log(chalk.dim(' Choose how Mercury handles risky actions this session.'));- console.log('');+ setProvider(name: string, model: string, badge?: string): void {+ this.update({ provider: { name, model, badge } });+ }- const options: ArrowSelectOption[] = [- { value: 'ask-me', label: 'Ask Me — confirm before file writes, shell commands, and scope changes' },- { value: 'allow-all', label: 'Allow All — auto-approve everything (scopes, commands, loop continuation)' },- ];+ setTokenInfo(used: number, budget: number, percentage: number): void {+ this.update({ tokenInfo: { used, budget, percentage } });+ }- try {- const selected = await selectWithArrowKeys('Select permission mode:', options, {- helperText: '↑↓ to move, Enter to select',- });+ setSubAgents(agents: SubAgentInfo[]): void {+ this.update({ subAgents: agents });+ }- if (selected === 'allow-all') {- console.log('');- console.log(chalk.yellow(' ⚠ Allow All active for this session:'));- console.log(chalk.dim(' • All directory scopes auto-approved'));- console.log(chalk.dim(' • All shell commands auto-approved (except blocked)'));- console.log(chalk.dim(' • Loop detection will auto-continue'));- console.log(chalk.dim(' • Resets on restart'));- console.log('');- } else {- console.log('');- console.log(chalk.dim(' Confirm-before-act mode active.'));- console.log('');- }+ setSidebarSections(sections: SidebarSection[]): void {+ this.update({ sidebarSections: sections });+ }- return selected as PermissionMode;- } catch {- return 'ask-me';- } finally {- this.resumePrompt();- }+ setMode(mode: AppMode): void {+ this.update({ mode });}- async askPermission(prompt: string): Promise<string> {- return new Promise((resolve) => {- console.log('');- console.log(chalk.yellow(` ⚠ ${prompt}`));- this.rl?.question(chalk.yellow(' > '), (answer) => {- resolve(answer.trim());- });- });+ initSplash(agentName: string, version: string): void {+ this.update({ agentName, version, mode: 'splash' });}- async askToContinue(question: string, _targetId?: string): Promise<boolean> {- return new Promise((resolve) => {- console.log('');- console.log(chalk.yellow(` ⚠ ${question}`));- this.rl?.question(chalk.yellow(' Continue? [y/N] '), (answer) => {- const val = answer.trim().toLowerCase();- resolve(val === 'y' || val === 'yes');- });+ sendUserMessage(content: string): void {+ const userMsg: ChatMessage = {+ id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),+ role: 'user',+ content,+ timestamp: Date.now(),+ };+ this.update({ chatMessages: [...this.state.chatMessages, userMsg] });+ this.emit({+ id: userMsg.id,+ channelId: 'cli',+ channelType: 'cli',+ senderId: 'owner',+ content,+ timestamp: userMsg.timestamp,});}}\ No newline at end of filediff --git a/src/channels/registry.ts b/src/channels/registry.tsindex 9768c541..8116adf0 100644--- a/src/channels/registry.ts+++ b/src/channels/registry.ts@@ -16,6 +16,10 @@ export class ChannelRegistry {}}+ getCliChannel(): CLIChannel | undefined {+ return this.channels.get('cli') as CLIChannel | undefined;+ }+register(type: ChannelType, channel: Channel): void {channel.onMessage((msg) => this.handleIncomingMessage(msg));this.channels.set(type, channel);diff --git a/src/index.ts b/src/index.tsindex e28cb60f..6ab70556 100644--- a/src/index.ts+++ b/src/index.ts@@ -1040,9 +1040,7 @@ async function runAgent(isDaemon: boolean = false): Promise<void> {const name = config.identity.name;if (!isDaemon) {- banner();- console.log(chalk.white(` ${name} is waking up...`));- console.log('');+ logger.info(`${name} is waking up...`);} else {logger.info(`${name} is waking up (daemon mode)...`);}@@ -1071,10 +1069,7 @@ async function runAgent(isDaemon: boolean = false): Promise<void> {const marker = key === defaultProvider ? ' ← default' : '';return `${label}: ${model}${marker}`;});-- console.log('');- console.log(chalk.bgMagenta.black.bold(` ⚡ ${getProviderLabel(defaultProvider)} · ${defaultModel} `));- console.log(chalk.dim(` Providers: ${providerSummary.join(' · ')}`));+ logger.info({ providers: providerSummary, default: getProviderLabel(defaultProvider) }, 'Providers loaded');} else {logger.info({ providers: available, default: defaultProvider }, 'Providers loaded');}@@ -1082,7 +1077,7 @@ async function runAgent(isDaemon: boolean = false): Promise<void> {const skillLoader = new SkillLoader();const skills = skillLoader.discover();if (!isDaemon) {- console.log(chalk.dim(` Skills: ${skills.length > 0 ? skills.map(s => s.name).join(', ') : 'none installed'}`));+ logger.info(`Skills: ${skills.length > 0 ? skills.map(s => s.name).join(', ') : 'none installed'}`);}const scheduler = new Scheduler(config);@@ -1098,7 +1093,7 @@ async function runAgent(isDaemon: boolean = false): Promise<void> {try {userMemory = new UserMemoryStore(config);if (!isDaemon) {- console.log(chalk.dim(` Second brain: enabled (${userMemory.getSummary().total} existing memories)`));+ logger.info(`Second brain: enabled (${userMemory.getSummary().total} existing memories)`);} else {logger.info({ total: userMemory.getSummary().total }, 'Second brain loaded');}@@ -1196,8 +1191,9 @@ async function runAgent(isDaemon: boolean = false): Promise<void> {agent.setSupervisor(supervisor);}+ let spotifyClient: SpotifyClient | undefined;if (config.spotify.clientId && config.spotify.clientSecret) {- const spotifyClient = new SpotifyClient(config);+ spotifyClient = new SpotifyClient(config);capabilities.setSpotifyClient(spotifyClient);capabilities.registerSpotifyTools();agent.setSpotifyClient(spotifyClient);@@ -1211,11 +1207,8 @@ async function runAgent(isDaemon: boolean = false): Promise<void> {const accountName = spotifyClient.getAccountName();const label = accountName ? ` as ${accountName}` : '';logger.info(`Spotify connected${label} (token available)`);- if (!isDaemon) {- console.log(chalk.green(` Spotify: connected${label}`));- }- } else if (!isDaemon) {- console.log(chalk.dim(' Spotify: not connected — run /spotify auth to link your account'));+ } else {+ logger.info('Spotify: not connected — run /spotify auth to link your account');}}@@ -1255,22 +1248,35 @@ async function runAgent(isDaemon: boolean = false): Promise<void> {if (!isDaemon) {if (config.identity.creator) {- console.log(chalk.dim(` Creator: ${config.identity.creator}`));+ logger.info(`Creator: ${config.identity.creator}`);+ }++ const cliChannel = channels.getCliChannel();+ if (cliChannel) {+ await channels.startAll();++ const skillInfos = skills.map((s) => ({ name: s.name, description: s.description, loaded: true }));+ cliChannel.initSplash(name, pkgVersion);+ cliChannel.setSkills(skillInfos);+ cliChannel.setProvider(getProviderLabel(defaultProvider), defaultModel);++ const budgetStatus = tokenBudget.getStatusText();+ cliChannel.setTokenInfo(tokenBudget.getDailyUsed(), tokenBudget.getBudget(), Math.round(tokenBudget.getUsagePercentage()));++ cliChannel.mountTUI((inputText: string) => {+ cliChannel.sendUserMessage(inputText);+ }, spotifyClient);+ } else {+ await channels.startAll();}- hr();const mode = cliChannel && await cliChannel.askPermissionMode?.();if (mode === 'allow-all') {capabilities.permissions.setAutoApproveAll(true);capabilities.permissions.addTempScope('/', true, true);}-- console.log('');- console.log(chalk.green(` ${name} is live. Type a message and press Enter.`));- console.log(chalk.dim(' Ctrl+C to exit · /help for commands'));- console.log('');- cliChannel?.showPrompt();} else {+ await channels.startAll();logger.info({ channels: activeCh, tools: toolNames }, 'Mercury is live (daemon mode)');}diff --git a/src/ui/App.tsx b/src/ui/App.tsxnew file mode 100644index 00000000..3bffadc4--- /dev/null+++ b/src/ui/App.tsx@@ -0,0 +1,502 @@+import React from 'react';+import { Box, Text, useApp, useInput } from 'ink';+import type { TuiState } from '../channels/cli.js';+import type { AppMode, ChatMessage, ToolStep, SubAgentInfo, PermissionPromptState, SidebarSection } from './types.js';+import type { PermissionMode } from '../channels/base.js';+import type { ProgrammingModeState } from '../core/programming-mode.js';+import { renderMarkdown } from '../utils/markdown.js';+import { PLAYER_CONTROLS, formatNowPlaying } from '../spotify/ui.js';+import type { SpotifyClient } from '../spotify/client.js';+import type { SubAgentStatus } from '../types/agent.js';++const MERCURY_LOGO = [+ ' __ _____________ ________ ________ __',+ ' / |/ / ____/ __ \\/ ____/ / / / __ \\/ < /',+ ' / /|_/ / __/ / /_/ / / / / / / /_/ /\\ / ',+ ' / / / / /___/ _, _/ /___/ /_/ / _, _/ / / ',+ '/_/ /_/_____/_/ |_|\\____/\\____/_/ |_| /_/ ',+];++const STATUS_ICONS: Record<string, { icon: string; color: string }> = {+ pending: { icon: '🔵', color: 'blue' },+ running: { icon: '🟢', color: 'green' },+ paused: { icon: '🟡', color: 'yellow' },+ completed: { icon: '✅', color: 'green' },+ failed: { icon: '❌', color: 'red' },+ halted: { icon: '⛔', color: 'red' },+};++export interface TuiAppProps {+ state: TuiState;+ onInput: (text: string) => void;+ onPermissionResolve: (value: string | boolean) => void;+ spotifyClient?: SpotifyClient | null;+}++export function TuiApp({ state, onInput, onPermissionResolve, spotifyClient }: TuiAppProps) {+ const { exit } = useApp();+ const [input, setInput] = React.useState('');+ const [permIdx, setPermIdx] = React.useState(0);+ const [menuIdx, setMenuIdx] = React.useState(0);+ const [spotifyIdx, setSpotifyIdx] = React.useState(6);+ const [splashPhase, setSplashPhase] = React.useState<'logo' | 'skills' | 'provider' | 'ready'>('logo');+ const [skillsLoaded, setSkillsLoaded] = React.useState(0);+ const [spotifyNow, setSpotifyNow] = React.useState('');++ React.useEffect(() => {+ if (state.mode !== 'splash') return;+ if (splashPhase === 'logo') {+ const t = setTimeout(() => setSplashPhase('skills'), 400);+ return () => clearTimeout(t);+ }+ }, [state.mode, splashPhase]);++ React.useEffect(() => {+ if (state.mode !== 'splash') return;+ if (splashPhase === 'skills') {+ if (skillsLoaded >= state.skills.length) {+ const t = setTimeout(() => setSplashPhase('provider'), 300);+ return () => clearTimeout(t);+ }+ const t = setTimeout(() => setSkillsLoaded((i) => i + 1), 80);+ return () => clearTimeout(t);+ }+ }, [state.mode, splashPhase, skillsLoaded, state.skills.length]);++ React.useEffect(() => {+ if (state.mode !== 'splash') return;+ if (splashPhase === 'provider') {+ const t = setTimeout(() => setSplashPhase('ready'), 500);+ return () => clearTimeout(t);+ }+ }, [state.mode, splashPhase]);++ React.useEffect(() => {+ if (state.mode !== 'splash') return;+ if (splashPhase === 'ready') {+ const t = setTimeout(() => onInput('/chat'), 600);+ return () => clearTimeout(t);+ }+ }, [state.mode, splashPhase]);++ React.useEffect(() => {+ if (state.mode === 'spotify' && spotifyClient) {+ const refresh = async () => {+ try {+ const data = await spotifyClient.getCurrentlyPlaying();+ setSpotifyNow(formatNowPlaying(data));+ } catch {+ setSpotifyNow('Nothing playing');+ }+ };+ refresh();+ const interval = setInterval(refresh, 5000);+ return () => clearInterval(interval);+ }+ }, [state.mode, spotifyClient]);++ useInput((ch, key) => {+ if (key.ctrl && (key as any).name === 'c') {+ process.kill(process.pid, 'SIGINT');+ return;+ }++ if (state.permissionPrompt) {+ if (state.permissionPrompt.type === 'continue') {+ if (ch === 'y' || ch === 'Y') onPermissionResolve(true);+ else if (ch === 'n' || ch === 'N') onPermissionResolve(false);+ return;+ }+ if (state.permissionPrompt.type === 'ask') {+ if (key.return) onPermissionResolve('');+ return;+ }+ const options = state.permissionPrompt.options || [];+ if (key.upArrow) setPermIdx((i) => Math.max(0, i - 1));+ else if (key.downArrow) setPermIdx((i) => Math.min(options.length - 1, i + 1));+ else if (key.return) {+ if (options[permIdx]) onPermissionResolve(options[permIdx].value);+ } else if (key.escape) {+ onPermissionResolve(state.permissionPrompt.type === 'mode' ? 'ask-me' : false);+ }+ return;+ }++ if (state.mode === 'menu') {+ if (key.upArrow) setMenuIdx((i) => Math.max(0, i - 1));+ else if (key.downArrow) setMenuIdx((i) => Math.min(5, i + 1));+ else if (key.return) {+ const modes: AppMode[] = ['menu', 'coding', 'chat', 'spotify', 'chat', 'chat'];+ onInput('/' + modes[menuIdx]);+ setMenuIdx(0);+ }+ else if (key.escape) onInput('/chat');+ return;+ }++ if (state.mode === 'spotify') {+ if (key.upArrow) setSpotifyIdx((i) => Math.max(0, i - 1));+ else if (key.downArrow) setSpotifyIdx((i) => Math.min(PLAYER_CONTROLS.length - 1, i + 1));+ else if (key.return) {+ const action = PLAYER_CONTROLS[spotifyIdx];+ if (action && spotifyClient && action.value !== 'exit') {+ import('../spotify/ui.js').then(({ handlePlayerAction }) => {+ handlePlayerAction(action.value, spotifyClient).then(() => {+ spotifyClient.getCurrentlyPlaying().then((data: any) => {+ setSpotifyNow(formatNowPlaying(data));+ }).catch(() => {});+ }).catch(() => {});+ });+ }+ if (action?.value === 'exit') onInput('/chat');+ } else if (key.escape) onInput('/chat');+ return;+ }++ if (state.mode === 'splash') {+ if (key.return) onInput('/chat');+ return;+ }++ if (key.escape) {+ if (state.mode === 'coding') {+ onInput('/chat');+ }+ return;+ }++ if (key.return) {+ const trimmed = input.trim();+ if (trimmed) {+ onInput(trimmed);+ setInput('');+ }+ return;+ }++ if (key.backspace || key.delete) {+ setInput((prev) => prev.slice(0, -1));+ return;+ }++ if (key.ctrl || key.meta) return;+ if (ch && ch.length === 1 && !key.escape) {+ setInput((prev) => prev + ch);+ }+ });++ if (state.mode === 'splash') {+ return (+ <Box flexDirection="column" alignItems="center" paddingY={1}>+ <Box flexDirection="column" alignItems="center">+ {MERCURY_LOGO.map((line, i) => <Text key={i} bold color="cyan">{line}</Text>)}+ </Box>+ <Box marginTop={1}><Text dimColor>an AI agent for personal tasks</Text></Box>+ <Box><Text dimColor>v{state.version} · by Cosmic Stack · mercury.cosmicstack.org</Text></Box>+ {splashPhase !== 'logo' && (+ <Box flexDirection="column" marginTop={1} width={50}>+ <Text bold color="cyan">Skills</Text>+ {state.skills.slice(0, skillsLoaded).map((skill, i) => (+ <Box key={i}>+ <Text color="green">✓</Text>+ <Text> {skill.name}</Text>+ <Text dimColor> — {skill.description}</Text>+ </Box>+ ))}+ {skillsLoaded < state.skills.length && <Text dimColor> loading...</Text>}+ </Box>+ )}+ {(splashPhase === 'provider' || splashPhase === 'ready') && state.provider && (+ <Box flexDirection="column" marginTop={1} width={50}>+ <Text bold color="magenta">Provider</Text>+ <Text>⚡ {state.provider.name} · {state.provider.model}</Text>+ </Box>+ )}+ {splashPhase === 'ready' && <Box marginTop={1}><Text bold color="green">✓ Mercury is live</Text></Box>}+ </Box>+ );+ }++ const showInput = !state.permissionPrompt && !state.isThinking && (state.mode === 'chat' || state.mode === 'coding');++ return (+ <Box flexDirection="column" flexGrow={1}>+ <StatusBarView state={state} />+ {state.mode === 'spotify' ? <SpotifyBody activeIdx={spotifyIdx} nowPlaying={spotifyNow} /> : null}+ {state.mode === 'menu' ? <MenuBody menuIdx={menuIdx} /> : null}+ {state.mode === 'coding' ? <CodingBody state={state} /> : null}+ {state.mode === 'chat' ? (+ <ChatBody state={state} />+ ) : null}+ {state.permissionPrompt && (+ <PermPromptView prompt={state.permissionPrompt} activeIdx={permIdx} />+ )}+ {showInput && (+ <InputBox input={input} agentName={state.agentName} />+ )}+ </Box>+ );+}++function StatusBarView({ state }: { state: TuiState }) {+ const modeColor = state.programmingMode === 'execute' ? 'green' : state.programmingMode === 'plan' ? 'yellow' : 'gray';+ const modeLabel = state.programmingMode === 'off' ? '' : ` ${state.programmingMode.toUpperCase()}`;+ let tokenBar = '';+ if (state.tokenInfo) {+ const filled = Math.min(20, Math.round(state.tokenInfo.percentage / 5));+ tokenBar = `[${'█'.repeat(filled)}${'░'.repeat(20 - filled)}] ${state.tokenInfo.percentage}%`;+ }+ const providerBadge = state.provider ? `⚡ ${state.provider.name} · ${state.provider.model}` : '⚡ No provider';++ return (+ <Box flexDirection="column">+ <Box paddingX={1} paddingBottom={0}>+ <Box flexGrow={1}>+ <Text bold color="cyan">{state.agentName}</Text>+ {state.programmingMode !== 'off' && <Text> <Text color={modeColor} bold>{modeLabel}</Text></Text>}+ {state.projectContext && <Text> <Text color="gray">|</Text> <Text color="blue">{state.projectContext}</Text></Text>}+ <Text> <Text color="gray">|</Text> <Text color="green">{state.permissionMode === 'allow-all' ? '🔓' : '🔒'}</Text></Text>+ </Box>+ <Text color="magenta">{providerBadge}</Text>+ </Box>+ <Box paddingX={1}>+ <Text color="gray">{'─'.repeat(50)}</Text>+ </Box>+ {state.tokenInfo && (+ <Box paddingX={1}>+ <Text color="cyan">Tokens </Text>+ <Text>{tokenBar}</Text>+ <Text color="gray"> {state.tokenInfo.used.toLocaleString()}/{state.tokenInfo.budget.toLocaleString()}</Text>+ </Box>+ )}+ </Box>+ );+}++function ChatBody({ state }: { state: TuiState }) {+ return (+ <Box flexDirection="row" flexGrow={1}>+ {state.sidebarSections.length > 0 && <SidebarView sections={state.sidebarSections} />}+ <Box flexDirection="column" flexGrow={1}>+ <ChatMessagesView messages={state.chatMessages} agentName={state.agentName} />+ {state.toolSteps.length > 0 && <ToolStepsView steps={state.toolSteps} />}+ {state.isThinking && <Box marginTop={1} marginLeft={2}><Text dimColor>{state.agentName} is thinking...</Text></Box>}+ {state.subAgents.length > 0 && <AgentPanelView agents={state.subAgents} />}+ </Box>+ </Box>+ );+}++function CodingBody({ state }: { state: TuiState }) {+ const modeLabels: Record<ProgrammingModeState, { label: string; color: string }> = {+ off: { label: 'OFF', color: 'gray' },+ plan: { label: 'PLAN', color: 'yellow' },+ execute: { label: 'EXECUTE', color: 'green' },+ };+ const modeInfo = modeLabels[state.programmingMode];+ const fileSection = state.sidebarSections.find((s) => s.title === 'Files');++ return (+ <Box flexDirection="row" flexGrow={1}>+ <Box flexDirection="column" width={26} paddingX={1}>+ <Text color="gray">{'─'.repeat(24)}</Text>+ <Text bold color="cyan">Workspace</Text>+ <Box marginTop={1}>+ <Text color={modeInfo.color} bold>{modeInfo.label}</Text>+ <Text> mode</Text>+ </Box>+ {state.projectContext && <Box><Text dimColor>Project: {state.projectContext}</Text></Box>}+ {fileSection && (+ <Box flexDirection="column" marginTop={1}>+ <Text bold color="cyan">{fileSection.title}</Text>+ {fileSection.items.slice(0, 10).map((item, i) => (+ <Box key={i}><Text>{item.icon} </Text><Text color={item.active ? 'white' : 'gray'}>{item.label}</Text></Box>+ ))}+ </Box>+ )}+ {state.subAgents.length > 0 && <AgentPanelView agents={state.subAgents} />}+ </Box>+ <Box flexDirection="column" flexGrow={1}>+ <ChatMessagesView messages={state.chatMessages} agentName={state.agentName} />+ {state.toolSteps.length > 0 && <ToolStepsView steps={state.toolSteps} />}+ {state.isThinking && <Box marginTop={1} marginLeft={2}><Text dimColor>{state.agentName} is thinking...</Text></Box>}+ </Box>+ </Box>+ );+}++function MenuBody({ menuIdx }: { menuIdx: number }) {+ const menuOptions: Array<{ label: string; mode: AppMode; icon: string }> = [+ { label: 'Status', mode: 'menu', icon: '📊' },+ { label: 'Coding Mode', mode: 'coding', icon: '💻' },+ { label: 'Memory', mode: 'chat', icon: '🧠' },+ { label: 'Spotify Player', mode: 'spotify', icon: '🎵' },+ { label: 'Permissions', mode: 'chat', icon: '🔒' },+ { label: 'Back to Chat', mode: 'chat', icon: '💬' },+ ];++ return (+ <Box flexDirection="column" flexGrow={1} paddingX={1}>+ <Text bold color="cyan">Menu</Text>+ {menuOptions.map((opt, i) => (+ <Box key={i}>+ <Text>{i === menuIdx ? '●' : '·'} </Text>+ <Text color={i === menuIdx ? 'cyan' : 'gray'}>{opt.icon} {opt.label}</Text>+ </Box>+ ))}+ <Box marginTop={1}><Text dimColor>↑↓ navigate · Enter select · Esc back</Text></Box>+ </Box>+ );+}++function SpotifyBody({ activeIdx, nowPlaying }: { activeIdx: number; nowPlaying: string }) {+ return (+ <Box flexDirection="column" flexGrow={1} paddingX={1}>+ <Box marginBottom={1} paddingX={1}>+ <Text color="green">{'─'.repeat(30)}</Text>+ <Box flexDirection="column">+ <Text bold color="green">Now Playing</Text>+ <Text>{nowPlaying || 'Nothing playing'}</Text>+ </Box>+ </Box>+ <Box flexDirection="column">+ <Text bold color="cyan">Controls</Text>+ {PLAYER_CONTROLS.map((control, i) => (+ <Box key={control.value}>+ <Text>{i === activeIdx ? '●' : '·'} </Text>+ <Text color={i === activeIdx ? 'green' : 'gray'}>{control.label}</Text>+ </Box>+ ))}+ </Box>+ <Box marginTop={1}><Text dimColor>↑↓ navigate · Enter select · Esc exit player</Text></Box>+ </Box>+ );+}++function ChatMessagesView({ messages, agentName }: { messages: ChatMessage[]; agentName: string }) {+ if (messages.length === 0) return null;+ const visible = messages.slice(-200);+ return (+ <Box flexDirection="column" flexGrow={1} paddingX={1}>+ {visible.map((msg) => {+ const roleColor = msg.role === 'user' ? 'yellow' : msg.role === 'system' ? 'gray' : 'cyan';+ const prefix = msg.role === 'user' ? 'You' : msg.role === 'system' ? 'System' : agentName;+ const rendered = renderMarkdown(msg.content);+ return (+ <Box key={msg.id} flexDirection="column" marginBottom={1}>+ <Box>+ <Text bold color={roleColor}>{prefix}:</Text>+ {msg.streaming && <Text dimColor> (streaming...)</Text>}+ </Box>+ <Box marginLeft={2} flexDirection="column">+ <Text>{rendered}</Text>+ </Box>+ </Box>+ );+ })}+ </Box>+ );+}++function ToolStepsView({ steps }: { steps: ToolStep[] }) {+ const visible = steps.slice(-6);+ return (+ <Box flexDirection="column" marginLeft={2} marginTop={1}>+ {visible.map((step) => (+ <Box key={step.id}>+ <Text dimColor>{step.label}</Text>+ {step.status === 'running' && <Text color="yellow"> ⠋</Text>}+ {step.status === 'done' && step.elapsed != null && <Text dimColor> ({step.elapsed.toFixed(1)}s)</Text>}+ {step.status === 'done' && step.result && <Text dimColor> · {step.result}</Text>}+ {step.status === 'error' && <Text color="red"> ✗</Text>}+ </Box>+ ))}+ </Box>+ );+}++function AgentPanelView({ agents }: { agents: SubAgentInfo[] }) {+ if (agents.length === 0) return null;+ return (+ <Box flexDirection="column" marginTop={1} paddingX={1}>+ <Text color="gray">{'─'.repeat(30)}</Text>+ <Text bold color="cyan">Agents</Text>+ {agents.map((agent) => {+ const cfg = STATUS_ICONS[agent.status] || STATUS_ICONS.pending;+ const elapsed = ((Date.now() - agent.startedAt) / 1000).toFixed(0);+ const taskPreview = agent.task.length > 40 ? agent.task.slice(0, 37) + '...' : agent.task;+ return (+ <Box key={agent.id} flexDirection="column">+ <Box><Text>{cfg.icon} </Text><Text bold color={cfg.color}>{agent.id}</Text><Text dimColor> {taskPreview}</Text></Box>+ <Box marginLeft={3}><Text dimColor>{agent.status} · {elapsed}s</Text></Box>+ </Box>+ );+ })}+ </Box>+ );+}++function SidebarView({ sections }: { sections: SidebarSection[] }) {+ if (sections.length === 0) return null;+ return (+ <Box flexDirection="column" width={24} paddingX={1}>+ <Text color="gray">{'─'.repeat(22)}</Text>+ {sections.map((section, si) => (+ <Box key={si} flexDirection="column" marginBottom={si < sections.length - 1 ? 1 : 0}>+ <Text bold color="cyan">{section.title}</Text>+ {section.items.map((item, ii) => (+ <Box key={ii}><Text>{item.icon} </Text><Text color={item.active ? 'white' : 'gray'}>{item.label}</Text></Box>+ ))}+ </Box>+ ))}+ </Box>+ );+}++function PermPromptView({ prompt, activeIdx }: { prompt: PermissionPromptState; activeIdx: number }) {+ const options = prompt.options || [];++ if (prompt.type === 'continue') {+ return (+ <Box flexDirection="column" marginTop={1} paddingX={1}>+ <Box><Text color="yellow">⚠ </Text><Text>{prompt.message}</Text></Box>+ <Text dimColor> [y/N]</Text>+ </Box>+ );+ }++ if (prompt.type === 'ask') {+ return (+ <Box flexDirection="column" marginTop={1} paddingX={1}>+ <Box><Text color="yellow">⚠ </Text><Text>{prompt.message}</Text></Box>+ <Text dimColor> Type your answer and press Enter</Text>+ </Box>+ );+ }++ return (+ <Box flexDirection="column" marginTop={1} paddingX={1}>+ <Box><Text bold color="yellow">⚠ {prompt.message}</Text></Box>+ {options.map((opt, i) => (+ <Box key={opt.value}>+ <Text>{i === activeIdx ? '●' : '·'} </Text>+ <Text color={i === activeIdx ? 'cyan' : 'gray'}>{opt.label}</Text>+ </Box>+ ))}+ <Text dimColor> ↑↓ to navigate, Enter to select</Text>+ </Box>+ );+}++function InputBox({ input, agentName }: { input: string; agentName: string }) {+ return (+ <Box flexDirection="column">+ <Text color="dim">{'─'.repeat(60)}</Text>+ <Box paddingX={1}>+ <Text color="yellow" bold>{'>'} </Text>+ <Text>{input}</Text>+ <Text dimColor>█</Text>+ </Box>+ </Box>+ );+}\ No newline at end of filediff --git a/src/ui/index.ts b/src/ui/index.tsnew file mode 100644index 00000000..37e4e322--- /dev/null+++ b/src/ui/index.ts@@ -0,0 +1,2 @@+export { TuiApp } from './App.js';+export type { MercuryAppState, AppMode, ChatMessage, ToolStep, SubAgentInfo, SkillInfo, PermissionPromptState, SidebarSection, SidebarItem, ProviderInfo, TokenInfo } from './types.js';\ No newline at end of filediff --git a/src/ui/types.ts b/src/ui/types.tsnew file mode 100644index 00000000..0afd887b--- /dev/null+++ b/src/ui/types.ts@@ -0,0 +1,85 @@+import type { ProgrammingModeState } from '../core/programming-mode.js';+import type { SubAgentStatus } from '../types/agent.js';+import type { PermissionMode } from '../channels/base.js';++export type AppMode = 'splash' | 'chat' | 'coding' | 'spotify' | 'menu';++export interface ChatMessage {+ id: string;+ role: 'user' | 'agent' | 'system';+ content: string;+ timestamp: number;+ streaming?: boolean;+}++export interface ToolStep {+ id: string;+ toolName: string;+ label: string;+ status: 'running' | 'done' | 'error';+ elapsed?: number;+ result?: string;+}++export interface SubAgentInfo {+ id: string;+ task: string;+ status: SubAgentStatus;+ progress?: string;+ startedAt: number;+}++export interface SidebarSection {+ title: string;+ items: SidebarItem[];+}++export interface SidebarItem {+ icon: string;+ label: string;+ detail?: string;+ active?: boolean;+}++export interface SkillInfo {+ name: string;+ description: string;+ loaded: boolean;+}++export interface ProviderInfo {+ name: string;+ model: string;+ badge?: string;+}++export interface TokenInfo {+ used: number;+ budget: number;+ percentage: number;+}++export interface MercuryAppState {+ mode: AppMode;+ programmingMode: ProgrammingModeState;+ projectContext: string | null;+ permissionMode: PermissionMode;+ chatMessages: ChatMessage[];+ toolSteps: ToolStep[];+ subAgents: SubAgentInfo[];+ skills: SkillInfo[];+ provider: ProviderInfo | null;+ tokenInfo: TokenInfo | null;+ sidebarSections: SidebarSection[];+ agentName: string;+ version: string;+ isThinking: boolean;+ permissionPrompt: PermissionPromptState | null;+}++export interface PermissionPromptState {+ type: 'mode' | 'ask' | 'continue';+ message: string;+ options?: Array<{ value: string; label: string }>;+ resolve: (value: string | boolean) => void;+}\ No newline at end of filediff --git a/tsup.config.ts b/tsup.config.tsindex 4bc56419..d9b65be7 100644--- a/tsup.config.ts+++ b/tsup.config.ts@@ -11,8 +11,6 @@ export default defineConfig({minify: false,banner: { js: "#!/usr/bin/env node" },external: [- "react",- "ink","grammy","better-sqlite3",],