From 8549a4aa53661e80b28f0e862bc36f49e5a4274a Mon Sep 17 00:00:00 2001 From: abearxiong Date: Thu, 15 Jan 2026 09:17:07 +0800 Subject: [PATCH] feat: migrate from inquirer to @inquirer/prompts for interactive prompts - Replaced inquirer with @inquirer/prompts in various command files for improved prompt handling. - Updated confirmation and input prompts in commands such as app, config, deploy, login, and others. - Added a new command 'cc' for switching between Claude code models with appropriate configurations. - Enhanced user experience by ensuring prompts are more streamlined and consistent across the application. --- package.json | 13 +- pnpm-lock.yaml | 521 +++++++++++++++++++++-------- src/command/app/front-app/index.ts | 16 +- src/command/cc.ts | 120 +++++++ src/command/config.ts | 66 ++-- src/command/deploy.ts | 40 +-- src/command/login.ts | 29 +- src/command/ls-token.ts | 13 +- src/command/npm.ts | 28 +- src/command/proxy.ts | 1 - src/command/publish.ts | 2 +- src/command/router.ts | 27 +- src/index.ts | 1 + src/module/download/install.ts | 16 +- src/program.ts | 1 + 15 files changed, 585 insertions(+), 309 deletions(-) create mode 100644 src/command/cc.ts diff --git a/package.json b/package.json index a7b0396..8d01e32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/cli", - "version": "0.0.78", + "version": "0.0.80", "description": "envision 命令行工具", "type": "module", "basename": "/root/cli", @@ -41,9 +41,11 @@ ], "author": "abearxiong", "dependencies": { + "@inquirer/prompts": "^8.2.0", "@kevisual/app": "^0.0.2", "@kevisual/context": "^0.0.4", "@kevisual/hot-api": "^0.0.3", + "@kevisual/use-config": "^1.0.26", "@nut-tree-fork/nut-js": "^4.2.6", "eventemitter3": "^5.0.1", "lowdb": "^7.0.1", @@ -57,13 +59,13 @@ "@kevisual/dts": "^0.0.3", "@kevisual/load": "^0.0.6", "@kevisual/logger": "^0.0.4", - "@kevisual/query": "0.0.33", + "@kevisual/query": "0.0.35", "@kevisual/query-login": "0.0.7", - "@types/bun": "^1.3.5", + "@types/bun": "^1.3.6", "@types/crypto-js": "^4.2.2", "@types/jsonwebtoken": "^9.0.10", "@types/micromatch": "^4.0.10", - "@types/node": "^25.0.3", + "@types/node": "^25.0.8", "@types/semver": "^7.7.1", "chalk": "^5.6.2", "commander": "^14.0.2", @@ -72,10 +74,9 @@ "filesize": "^11.0.13", "form-data": "^4.0.5", "ignore": "^7.0.5", - "inquirer": "^13.1.0", "jsonwebtoken": "^9.0.3", "tar": "^7.5.2", - "zustand": "^5.0.9" + "zustand": "^5.0.10" }, "engines": { "node": ">=22.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index faee78f..683f606 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@inquirer/prompts': + specifier: ^8.2.0 + version: 8.2.0(@types/node@25.0.8) '@kevisual/app': specifier: ^0.0.2 version: 0.0.2(dotenv@17.2.3) @@ -17,6 +20,9 @@ importers: '@kevisual/hot-api': specifier: ^0.0.3 version: 0.0.3(dotenv@17.2.3) + '@kevisual/use-config': + specifier: ^1.0.26 + version: 1.0.26(dotenv@17.2.3) '@nut-tree-fork/nut-js': specifier: ^4.2.6 version: 4.2.6 @@ -52,14 +58,14 @@ importers: specifier: ^0.0.4 version: 0.0.4 '@kevisual/query': - specifier: 0.0.33 - version: 0.0.33 + specifier: 0.0.35 + version: 0.0.35 '@kevisual/query-login': specifier: 0.0.7 - version: 0.0.7(@kevisual/query@0.0.33) + version: 0.0.7(@kevisual/query@0.0.35) '@types/bun': - specifier: ^1.3.5 - version: 1.3.5 + specifier: ^1.3.6 + version: 1.3.6 '@types/crypto-js': specifier: ^4.2.2 version: 4.2.2 @@ -70,8 +76,8 @@ importers: specifier: ^4.0.10 version: 4.0.10 '@types/node': - specifier: ^25.0.3 - version: 25.0.3 + specifier: ^25.0.8 + version: 25.0.8 '@types/semver': specifier: ^7.7.1 version: 7.7.1 @@ -96,9 +102,6 @@ importers: ignore: specifier: ^7.0.5 version: 7.0.5 - inquirer: - specifier: ^13.1.0 - version: 13.1.0(@types/node@25.0.3) jsonwebtoken: specifier: ^9.0.3 version: 9.0.3 @@ -106,8 +109,8 @@ importers: specifier: ^7.5.2 version: 7.5.2 zustand: - specifier: ^5.0.9 - version: 5.0.9(@types/react@19.2.7)(react@19.2.3) + specifier: ^5.0.10 + version: 5.0.10(@types/react@19.2.7)(react@19.2.3) assistant: dependencies: @@ -219,16 +222,16 @@ importers: dependencies: '@astrojs/mdx': specifier: ^4.3.13 - version: 4.3.13(astro@5.16.6(@types/node@25.0.3)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2)) + version: 4.3.13(astro@5.16.6(@types/node@25.0.8)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2)) '@astrojs/react': specifier: ^4.4.2 - version: 4.4.2(@types/node@25.0.3)(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(jiti@2.6.1)(lightningcss@1.30.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 4.4.2(@types/node@25.0.8)(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(jiti@2.6.1)(lightningcss@1.30.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) '@astrojs/sitemap': specifier: ^3.6.0 version: 3.6.0 '@astrojs/vue': specifier: ^5.1.3 - version: 5.1.3(@types/node@25.0.3)(astro@5.16.6(@types/node@25.0.3)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2))(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(vue@3.5.26(typescript@5.8.2)) + version: 5.1.3(@types/node@25.0.8)(astro@5.16.6(@types/node@25.0.8)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2))(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(vue@3.5.26(typescript@5.8.2)) '@kevisual/api': specifier: ^0.0.5 version: 0.0.5 @@ -252,7 +255,7 @@ importers: version: 1.2.4(@types/react@19.2.7)(react@19.2.3) '@tailwindcss/vite': specifier: ^4.1.18 - version: 4.1.18(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2)) + version: 4.1.18(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2)) '@uiw/react-md-editor': specifier: ^4.0.11 version: 4.0.11(@types/react@19.2.7)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) @@ -261,7 +264,7 @@ importers: version: 6.1.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3) astro: specifier: ^5.16.6 - version: 5.16.6(@types/node@25.0.3)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2) + version: 5.16.6(@types/node@25.0.8)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2) class-variance-authority: specifier: ^0.7.1 version: 0.7.1 @@ -929,8 +932,12 @@ packages: resolution: {integrity: sha512-SYLX05PwJVnW+WVegZt1T4Ip1qba1ik+pNJPDiqvk6zS5Y/i8PhRzLpGEtVd7sW0G8cMtkD8t4AZYhQwm8vnww==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} - '@inquirer/checkbox@5.0.3': - resolution: {integrity: sha512-xtQP2eXMFlOcAhZ4ReKP2KZvDIBb1AnCfZ81wWXG3DXLVH0f0g4obE0XDPH+ukAEMRcZT0kdX2AS1jrWGXbpxw==} + '@inquirer/ansi@2.0.3': + resolution: {integrity: sha512-g44zhR3NIKVs0zUesa4iMzExmZpLUdTLRMCStqX3GE5NT6VkPcxQGJ+uC8tDgBUC/vB1rUhUd55cOf++4NZcmw==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + + '@inquirer/checkbox@5.0.4': + resolution: {integrity: sha512-DrAMU3YBGMUAp6ArwTIp/25CNDtDbxk7UjIrrtM25JVVrlVYlVzHh5HR1BDFu9JMyUoZ4ZanzeaHqNDttf3gVg==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' @@ -938,8 +945,8 @@ packages: '@types/node': optional: true - '@inquirer/confirm@6.0.3': - resolution: {integrity: sha512-lyEvibDFL+NA5R4xl8FUmNhmu81B+LDL9L/MpKkZlQDJZXzG8InxiqYxiAlQYa9cqLLhYqKLQwZqXmSTqCLjyw==} + '@inquirer/confirm@6.0.4': + resolution: {integrity: sha512-WdaPe7foUnoGYvXzH4jp4wH/3l+dBhZ3uwhKjXjwdrq5tEIFaANxj6zrGHxLdsIA0yKM0kFPVcEalOZXBB5ISA==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' @@ -956,8 +963,8 @@ packages: '@types/node': optional: true - '@inquirer/editor@5.0.3': - resolution: {integrity: sha512-wYyQo96TsAqIciP/r5D3cFeV8h4WqKQ/YOvTg5yOfP2sqEbVVpbxPpfV3LM5D0EP4zUI3EZVHyIUIllnoIa8OQ==} + '@inquirer/core@11.1.1': + resolution: {integrity: sha512-hV9o15UxX46OyQAtaoMqAOxGR8RVl1aZtDx1jHbCtSJy1tBdTfKxLPKf7utsE4cRy4tcmCQ4+vdV+ca+oNxqNA==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' @@ -965,8 +972,8 @@ packages: '@types/node': optional: true - '@inquirer/expand@5.0.3': - resolution: {integrity: sha512-2oINvuL27ujjxd95f6K2K909uZOU2x1WiAl7Wb1X/xOtL8CgQ1kSxzykIr7u4xTkXkXOAkCuF45T588/YKee7w==} + '@inquirer/editor@5.0.4': + resolution: {integrity: sha512-QI3Jfqcv6UO2/VJaEFONH8Im1ll++Xn/AJTBn9Xf+qx2M+H8KZAdQ5sAe2vtYlo+mLW+d7JaMJB4qWtK4BG3pw==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' @@ -974,8 +981,17 @@ packages: '@types/node': optional: true - '@inquirer/external-editor@2.0.2': - resolution: {integrity: sha512-X/fMXK7vXomRWEex1j8mnj7s1mpnTeP4CO/h2gysJhHLT2WjBnLv4ZQEGpm/kcYI8QfLZ2fgW+9kTKD+jeopLg==} + '@inquirer/expand@5.0.4': + resolution: {integrity: sha512-0I/16YwPPP0Co7a5MsomlZLpch48NzYfToyqYAOWtBmaXSB80RiNQ1J+0xx2eG+Wfxt0nHtpEWSRr6CzNVnOGg==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/external-editor@2.0.3': + resolution: {integrity: sha512-LgyI7Agbda74/cL5MvA88iDpvdXI2KuMBCGRkbCl2Dg1vzHeOgs+s0SDcXV7b+WZJrv2+ERpWSM65Fpi9VfY3w==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' @@ -987,8 +1003,12 @@ packages: resolution: {integrity: sha512-qXm6EVvQx/FmnSrCWCIGtMHwqeLgxABP8XgcaAoywsL0NFga9gD5kfG0gXiv80GjK9Hsoz4pgGwF/+CjygyV9A==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} - '@inquirer/input@5.0.3': - resolution: {integrity: sha512-4R0TdWl53dtp79Vs6Df2OHAtA2FVNqya1hND1f5wjHWxZJxwDMSNB1X5ADZJSsQKYAJ5JHCTO+GpJZ42mK0Otw==} + '@inquirer/figures@2.0.3': + resolution: {integrity: sha512-y09iGt3JKoOCBQ3w4YrSJdokcD8ciSlMIWsD+auPu+OZpfxLuyz+gICAQ6GCBOmJJt4KEQGHuZSVff2jiNOy7g==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + + '@inquirer/input@5.0.4': + resolution: {integrity: sha512-4B3s3jvTREDFvXWit92Yc6jF1RJMDy2VpSqKtm4We2oVU65YOh2szY5/G14h4fHlyQdpUmazU5MPCFZPRJ0AOw==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' @@ -996,8 +1016,8 @@ packages: '@types/node': optional: true - '@inquirer/number@4.0.3': - resolution: {integrity: sha512-TjQLe93GGo5snRlu83JxE38ZPqj5ZVggL+QqqAF2oBA5JOJoxx25GG3EGH/XN/Os5WOmKfO8iLVdCXQxXRZIMQ==} + '@inquirer/number@4.0.4': + resolution: {integrity: sha512-CmMp9LF5HwE+G/xWsC333TlCzYYbXMkcADkKzcawh49fg2a1ryLc7JL1NJYYt1lJ+8f4slikNjJM9TEL/AljYQ==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' @@ -1005,8 +1025,8 @@ packages: '@types/node': optional: true - '@inquirer/password@5.0.3': - resolution: {integrity: sha512-rCozGbUMAHedTeYWEN8sgZH4lRCdgG/WinFkit6ZPsp8JaNg2T0g3QslPBS5XbpORyKP/I+xyBO81kFEvhBmjA==} + '@inquirer/password@5.0.4': + resolution: {integrity: sha512-ZCEPyVYvHK4W4p2Gy6sTp9nqsdHQCfiPXIP9LbJVW4yCinnxL/dDDmPaEZVysGrj8vxVReRnpfS2fOeODe9zjg==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' @@ -1014,8 +1034,8 @@ packages: '@types/node': optional: true - '@inquirer/prompts@8.1.0': - resolution: {integrity: sha512-LsZMdKcmRNF5LyTRuZE5nWeOjganzmN3zwbtNfcs6GPh3I2TsTtF1UYZlbxVfhxd+EuUqLGs/Lm3Xt4v6Az1wA==} + '@inquirer/prompts@8.2.0': + resolution: {integrity: sha512-rqTzOprAj55a27jctS3vhvDDJzYXsr33WXTjODgVOru21NvBo9yIgLIAf7SBdSV0WERVly3dR6TWyp7ZHkvKFA==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' @@ -1023,8 +1043,8 @@ packages: '@types/node': optional: true - '@inquirer/rawlist@5.1.0': - resolution: {integrity: sha512-yUCuVh0jW026Gr2tZlG3kHignxcrLKDR3KBp+eUgNz+BAdSeZk0e18yt2gyBr+giYhj/WSIHCmPDOgp1mT2niQ==} + '@inquirer/rawlist@5.2.0': + resolution: {integrity: sha512-CciqGoOUMrFo6HxvOtU5uL8fkjCmzyeB6fG7O1vdVAZVSopUBYECOwevDBlqNLyyYmzpm2Gsn/7nLrpruy9RFg==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' @@ -1032,8 +1052,8 @@ packages: '@types/node': optional: true - '@inquirer/search@4.0.3': - resolution: {integrity: sha512-lzqVw0YwuKYetk5VwJ81Ba+dyVlhseHPx9YnRKQgwXdFS0kEavCz2gngnNhnMIxg8+j1N/rUl1t5s1npwa7bqg==} + '@inquirer/search@4.1.0': + resolution: {integrity: sha512-EAzemfiP4IFvIuWnrHpgZs9lAhWDA0GM3l9F4t4mTQ22IFtzfrk8xbkMLcAN7gmVML9O/i+Hzu8yOUyAaL6BKA==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' @@ -1041,8 +1061,8 @@ packages: '@types/node': optional: true - '@inquirer/select@5.0.3': - resolution: {integrity: sha512-M+ynbwS0ecQFDYMFrQrybA0qL8DV0snpc4kKevCCNaTpfghsRowRY7SlQBeIYNzHqXtiiz4RG9vTOeb/udew7w==} + '@inquirer/select@5.0.4': + resolution: {integrity: sha512-s8KoGpPYMEQ6WXc0dT9blX2NtIulMdLOO3LA1UKOiv7KFWzlJ6eLkEYTDBIi+JkyKXyn8t/CD6TinxGjyLt57g==} engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} peerDependencies: '@types/node': '>=18' @@ -1059,6 +1079,15 @@ packages: '@types/node': optional: true + '@inquirer/type@4.0.3': + resolution: {integrity: sha512-cKZN7qcXOpj1h+1eTTcGDVLaBIHNMT1Rz9JqJP5MnEJ0JhgVWllx7H/tahUp5YEK1qaByH2Itb8wLG/iScD5kw==} + engines: {node: '>=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -1317,6 +1346,9 @@ packages: '@kevisual/query@0.0.33': resolution: {integrity: sha512-3w74bcLpwV3z483eg8n0DgkftfjWC6iLONXBvfyjW6IZf6jMOuouFaM4Rk+uEsTgElU6XGMKseNTp6dlQdWYkg==} + '@kevisual/query@0.0.35': + resolution: {integrity: sha512-80dyy2LMCmEC72g+X4QWUKlZErhawQPgnGSBNR4yhrBcFgHIJQ14LR1Z+bS5S1I7db+1PDNpaxBTjIaoYoXunw==} + '@kevisual/registry@0.0.1': resolution: {integrity: sha512-//OHu9m4JDrMjgP8o8dcjZd3D3IAUkRVlkTSviouZEH7r5m7mccA3Hvzw0XJ/lelx6exC6LWsyv6c4uV0Dp+gw==} @@ -1340,6 +1372,11 @@ packages: peerDependencies: dotenv: ^17 + '@kevisual/use-config@1.0.26': + resolution: {integrity: sha512-e5jgEALn4Pb5ReXnqVkK0XyQdRXLyciqmLFY7XVDyXCu7ieh6gxDCb41rsSfBj5ofpG8jH6afOlgWqt2A4BcWg==} + peerDependencies: + dotenv: ^17 + '@kevisual/video-tools@0.0.13': resolution: {integrity: sha512-bbAMTQznmlm70csVX5nQTeV+TsZw4BohYoYxcUsCi/slKZry2pWQaJgN3uKT0ovkZzLp1bogBEcBHmeP3wxXiw==} @@ -2101,6 +2138,9 @@ packages: '@types/bun@1.3.5': resolution: {integrity: sha512-RnygCqNrd3srIPEWBd5LFeUYG7plCoH2Yw9WaZGyNmdTEei+gWaHqydbaIRkIkcbXwhBT94q78QljxN0Sk838w==} + '@types/bun@1.3.6': + resolution: {integrity: sha512-uWCv6FO/8LcpREhenN1d1b6fcspAB+cefwD7uti8C8VffIv0Um08TKMn98FynpTiU38+y2dUO55T11NgDt8VAA==} + '@types/crypto-js@4.2.2': resolution: {integrity: sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==} @@ -2155,6 +2195,9 @@ packages: '@types/node@25.0.3': resolution: {integrity: sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA==} + '@types/node@25.0.8': + resolution: {integrity: sha512-powIePYMmC3ibL0UJ2i2s0WIbq6cg6UyVFQxSCpaPxxzAaziRfimGivjdF943sSGV6RADVbk0Nvlm5P/FB44Zg==} + '@types/prismjs@1.26.5': resolution: {integrity: sha512-AUZTa7hQ2KY5L7AmtSiqxlhWxb4ina0yd8hNbl4TWuqnv/pFP0nDMb3YrfSBf4hJVGLh2YEIBfKaBW/9UEl6IQ==} @@ -2524,6 +2567,9 @@ packages: bun-types@1.3.5: resolution: {integrity: sha512-inmAYe2PFLs0SUbFOWSVD24sg1jFlMPxOjOSSCYqUgn4Hsc3rDc7dFvfVYjFPNHtov6kgUeulV4SxbuIV/stPw==} + bun-types@1.3.6: + resolution: {integrity: sha512-OlFwHcnNV99r//9v5IIOgQ9Uk37gZqrNMCcqEaExdkVq3Avwqok1bJFmvGMCkCE0FqzdY8VMOZpfpR3lwI+CsQ==} + bundle-name@4.1.0: resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} engines: {node: '>=18'} @@ -3387,8 +3433,8 @@ packages: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} - iconv-lite@0.7.0: - resolution: {integrity: sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==} + iconv-lite@0.7.2: + resolution: {integrity: sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==} engines: {node: '>=0.10.0'} idb-keyval@6.2.1: @@ -5294,6 +5340,24 @@ packages: zod@3.25.76: resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==} + zustand@5.0.10: + resolution: {integrity: sha512-U1AiltS1O9hSy3rul+Ub82ut2fqIAefiSuwECWt6jlMVUGejvf+5omLcRBSzqbRagSM3hQZbtzdeRc6QVScXTg==} + engines: {node: '>=12.20.0'} + peerDependencies: + '@types/react': '>=18.0.0' + immer: '>=9.0.6' + react: '>=18.0.0' + use-sync-external-store: '>=1.2.0' + peerDependenciesMeta: + '@types/react': + optional: true + immer: + optional: true + react: + optional: true + use-sync-external-store: + optional: true + zustand@5.0.9: resolution: {integrity: sha512-ALBtUj0AfjJt3uNRQoL1tL2tMvj6Gp/6e39dnfT6uzpelGru8v1tPOGBzayOWbPJvujM8JojDk3E1LxeFisBNg==} engines: {node: '>=12.20.0'} @@ -5395,12 +5459,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@astrojs/mdx@4.3.13(astro@5.16.6(@types/node@25.0.3)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2))': + '@astrojs/mdx@4.3.13(astro@5.16.6(@types/node@25.0.8)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2))': dependencies: '@astrojs/markdown-remark': 6.3.10 '@mdx-js/mdx': 3.1.1 acorn: 8.15.0 - astro: 5.16.6(@types/node@25.0.3)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2) + astro: 5.16.6(@types/node@25.0.8)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2) es-module-lexer: 1.7.0 estree-util-visit: 2.0.0 hast-util-to-html: 9.0.5 @@ -5418,15 +5482,15 @@ snapshots: dependencies: prismjs: 1.30.0 - '@astrojs/react@4.4.2(@types/node@25.0.3)(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(jiti@2.6.1)(lightningcss@1.30.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@astrojs/react@4.4.2(@types/node@25.0.8)(@types/react-dom@19.2.3(@types/react@19.2.7))(@types/react@19.2.7)(jiti@2.6.1)(lightningcss@1.30.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: '@types/react': 19.2.7 '@types/react-dom': 19.2.3(@types/react@19.2.7) - '@vitejs/plugin-react': 4.7.0(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2)) + '@vitejs/plugin-react': 4.7.0(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2)) react: 19.2.3 react-dom: 19.2.3(react@19.2.3) ultrahtml: 1.6.0 - vite: 6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2) + vite: 6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2) transitivePeerDependencies: - '@types/node' - jiti @@ -5459,14 +5523,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@astrojs/vue@5.1.3(@types/node@25.0.3)(astro@5.16.6(@types/node@25.0.3)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2))(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(vue@3.5.26(typescript@5.8.2))': + '@astrojs/vue@5.1.3(@types/node@25.0.8)(astro@5.16.6(@types/node@25.0.8)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2))(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(vue@3.5.26(typescript@5.8.2))': dependencies: - '@vitejs/plugin-vue': 5.2.1(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2)) - '@vitejs/plugin-vue-jsx': 4.2.0(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2)) + '@vitejs/plugin-vue': 5.2.1(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2)) + '@vitejs/plugin-vue-jsx': 4.2.0(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2)) '@vue/compiler-sfc': 3.5.25 - astro: 5.16.6(@types/node@25.0.3)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2) - vite: 6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2) - vite-plugin-vue-devtools: 7.7.9(rollup@4.43.0)(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2)) + astro: 5.16.6(@types/node@25.0.8)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2) + vite: 6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2) + vite-plugin-vue-devtools: 7.7.9(rollup@4.43.0)(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2)) vue: 3.5.26(typescript@5.8.2) transitivePeerDependencies: - '@nuxt/kit' @@ -5984,22 +6048,40 @@ snapshots: '@inquirer/ansi@2.0.2': {} - '@inquirer/checkbox@5.0.3(@types/node@25.0.3)': + '@inquirer/ansi@2.0.3': {} + + '@inquirer/checkbox@5.0.4(@types/node@25.0.3)': dependencies: - '@inquirer/ansi': 2.0.2 - '@inquirer/core': 11.1.0(@types/node@25.0.3) - '@inquirer/figures': 2.0.2 - '@inquirer/type': 4.0.2(@types/node@25.0.3) + '@inquirer/ansi': 2.0.3 + '@inquirer/core': 11.1.1(@types/node@25.0.3) + '@inquirer/figures': 2.0.3 + '@inquirer/type': 4.0.3(@types/node@25.0.3) optionalDependencies: '@types/node': 25.0.3 - '@inquirer/confirm@6.0.3(@types/node@25.0.3)': + '@inquirer/checkbox@5.0.4(@types/node@25.0.8)': dependencies: - '@inquirer/core': 11.1.0(@types/node@25.0.3) - '@inquirer/type': 4.0.2(@types/node@25.0.3) + '@inquirer/ansi': 2.0.3 + '@inquirer/core': 11.1.1(@types/node@25.0.8) + '@inquirer/figures': 2.0.3 + '@inquirer/type': 4.0.3(@types/node@25.0.8) + optionalDependencies: + '@types/node': 25.0.8 + + '@inquirer/confirm@6.0.4(@types/node@25.0.3)': + dependencies: + '@inquirer/core': 11.1.1(@types/node@25.0.3) + '@inquirer/type': 4.0.3(@types/node@25.0.3) optionalDependencies: '@types/node': 25.0.3 + '@inquirer/confirm@6.0.4(@types/node@25.0.8)': + dependencies: + '@inquirer/core': 11.1.1(@types/node@25.0.8) + '@inquirer/type': 4.0.3(@types/node@25.0.8) + optionalDependencies: + '@types/node': 25.0.8 + '@inquirer/core@11.1.0(@types/node@25.0.3)': dependencies: '@inquirer/ansi': 2.0.2 @@ -6012,95 +6094,212 @@ snapshots: optionalDependencies: '@types/node': 25.0.3 - '@inquirer/editor@5.0.3(@types/node@25.0.3)': + '@inquirer/core@11.1.1(@types/node@25.0.3)': dependencies: - '@inquirer/core': 11.1.0(@types/node@25.0.3) - '@inquirer/external-editor': 2.0.2(@types/node@25.0.3) - '@inquirer/type': 4.0.2(@types/node@25.0.3) + '@inquirer/ansi': 2.0.3 + '@inquirer/figures': 2.0.3 + '@inquirer/type': 4.0.3(@types/node@25.0.3) + cli-width: 4.1.0 + mute-stream: 3.0.0 + signal-exit: 4.1.0 + wrap-ansi: 9.0.2 optionalDependencies: '@types/node': 25.0.3 - '@inquirer/expand@5.0.3(@types/node@25.0.3)': + '@inquirer/core@11.1.1(@types/node@25.0.8)': dependencies: - '@inquirer/core': 11.1.0(@types/node@25.0.3) - '@inquirer/type': 4.0.2(@types/node@25.0.3) + '@inquirer/ansi': 2.0.3 + '@inquirer/figures': 2.0.3 + '@inquirer/type': 4.0.3(@types/node@25.0.8) + cli-width: 4.1.0 + mute-stream: 3.0.0 + signal-exit: 4.1.0 + wrap-ansi: 9.0.2 + optionalDependencies: + '@types/node': 25.0.8 + + '@inquirer/editor@5.0.4(@types/node@25.0.3)': + dependencies: + '@inquirer/core': 11.1.1(@types/node@25.0.3) + '@inquirer/external-editor': 2.0.3(@types/node@25.0.3) + '@inquirer/type': 4.0.3(@types/node@25.0.3) optionalDependencies: '@types/node': 25.0.3 - '@inquirer/external-editor@2.0.2(@types/node@25.0.3)': + '@inquirer/editor@5.0.4(@types/node@25.0.8)': + dependencies: + '@inquirer/core': 11.1.1(@types/node@25.0.8) + '@inquirer/external-editor': 2.0.3(@types/node@25.0.8) + '@inquirer/type': 4.0.3(@types/node@25.0.8) + optionalDependencies: + '@types/node': 25.0.8 + + '@inquirer/expand@5.0.4(@types/node@25.0.3)': + dependencies: + '@inquirer/core': 11.1.1(@types/node@25.0.3) + '@inquirer/type': 4.0.3(@types/node@25.0.3) + optionalDependencies: + '@types/node': 25.0.3 + + '@inquirer/expand@5.0.4(@types/node@25.0.8)': + dependencies: + '@inquirer/core': 11.1.1(@types/node@25.0.8) + '@inquirer/type': 4.0.3(@types/node@25.0.8) + optionalDependencies: + '@types/node': 25.0.8 + + '@inquirer/external-editor@2.0.3(@types/node@25.0.3)': dependencies: chardet: 2.1.1 - iconv-lite: 0.7.0 + iconv-lite: 0.7.2 optionalDependencies: '@types/node': 25.0.3 + '@inquirer/external-editor@2.0.3(@types/node@25.0.8)': + dependencies: + chardet: 2.1.1 + iconv-lite: 0.7.2 + optionalDependencies: + '@types/node': 25.0.8 + '@inquirer/figures@2.0.2': {} - '@inquirer/input@5.0.3(@types/node@25.0.3)': + '@inquirer/figures@2.0.3': {} + + '@inquirer/input@5.0.4(@types/node@25.0.3)': dependencies: - '@inquirer/core': 11.1.0(@types/node@25.0.3) - '@inquirer/type': 4.0.2(@types/node@25.0.3) + '@inquirer/core': 11.1.1(@types/node@25.0.3) + '@inquirer/type': 4.0.3(@types/node@25.0.3) optionalDependencies: '@types/node': 25.0.3 - '@inquirer/number@4.0.3(@types/node@25.0.3)': + '@inquirer/input@5.0.4(@types/node@25.0.8)': dependencies: - '@inquirer/core': 11.1.0(@types/node@25.0.3) - '@inquirer/type': 4.0.2(@types/node@25.0.3) + '@inquirer/core': 11.1.1(@types/node@25.0.8) + '@inquirer/type': 4.0.3(@types/node@25.0.8) + optionalDependencies: + '@types/node': 25.0.8 + + '@inquirer/number@4.0.4(@types/node@25.0.3)': + dependencies: + '@inquirer/core': 11.1.1(@types/node@25.0.3) + '@inquirer/type': 4.0.3(@types/node@25.0.3) optionalDependencies: '@types/node': 25.0.3 - '@inquirer/password@5.0.3(@types/node@25.0.3)': + '@inquirer/number@4.0.4(@types/node@25.0.8)': dependencies: - '@inquirer/ansi': 2.0.2 - '@inquirer/core': 11.1.0(@types/node@25.0.3) - '@inquirer/type': 4.0.2(@types/node@25.0.3) + '@inquirer/core': 11.1.1(@types/node@25.0.8) + '@inquirer/type': 4.0.3(@types/node@25.0.8) + optionalDependencies: + '@types/node': 25.0.8 + + '@inquirer/password@5.0.4(@types/node@25.0.3)': + dependencies: + '@inquirer/ansi': 2.0.3 + '@inquirer/core': 11.1.1(@types/node@25.0.3) + '@inquirer/type': 4.0.3(@types/node@25.0.3) optionalDependencies: '@types/node': 25.0.3 - '@inquirer/prompts@8.1.0(@types/node@25.0.3)': + '@inquirer/password@5.0.4(@types/node@25.0.8)': dependencies: - '@inquirer/checkbox': 5.0.3(@types/node@25.0.3) - '@inquirer/confirm': 6.0.3(@types/node@25.0.3) - '@inquirer/editor': 5.0.3(@types/node@25.0.3) - '@inquirer/expand': 5.0.3(@types/node@25.0.3) - '@inquirer/input': 5.0.3(@types/node@25.0.3) - '@inquirer/number': 4.0.3(@types/node@25.0.3) - '@inquirer/password': 5.0.3(@types/node@25.0.3) - '@inquirer/rawlist': 5.1.0(@types/node@25.0.3) - '@inquirer/search': 4.0.3(@types/node@25.0.3) - '@inquirer/select': 5.0.3(@types/node@25.0.3) + '@inquirer/ansi': 2.0.3 + '@inquirer/core': 11.1.1(@types/node@25.0.8) + '@inquirer/type': 4.0.3(@types/node@25.0.8) + optionalDependencies: + '@types/node': 25.0.8 + + '@inquirer/prompts@8.2.0(@types/node@25.0.3)': + dependencies: + '@inquirer/checkbox': 5.0.4(@types/node@25.0.3) + '@inquirer/confirm': 6.0.4(@types/node@25.0.3) + '@inquirer/editor': 5.0.4(@types/node@25.0.3) + '@inquirer/expand': 5.0.4(@types/node@25.0.3) + '@inquirer/input': 5.0.4(@types/node@25.0.3) + '@inquirer/number': 4.0.4(@types/node@25.0.3) + '@inquirer/password': 5.0.4(@types/node@25.0.3) + '@inquirer/rawlist': 5.2.0(@types/node@25.0.3) + '@inquirer/search': 4.1.0(@types/node@25.0.3) + '@inquirer/select': 5.0.4(@types/node@25.0.3) optionalDependencies: '@types/node': 25.0.3 - '@inquirer/rawlist@5.1.0(@types/node@25.0.3)': + '@inquirer/prompts@8.2.0(@types/node@25.0.8)': dependencies: - '@inquirer/core': 11.1.0(@types/node@25.0.3) - '@inquirer/type': 4.0.2(@types/node@25.0.3) + '@inquirer/checkbox': 5.0.4(@types/node@25.0.8) + '@inquirer/confirm': 6.0.4(@types/node@25.0.8) + '@inquirer/editor': 5.0.4(@types/node@25.0.8) + '@inquirer/expand': 5.0.4(@types/node@25.0.8) + '@inquirer/input': 5.0.4(@types/node@25.0.8) + '@inquirer/number': 4.0.4(@types/node@25.0.8) + '@inquirer/password': 5.0.4(@types/node@25.0.8) + '@inquirer/rawlist': 5.2.0(@types/node@25.0.8) + '@inquirer/search': 4.1.0(@types/node@25.0.8) + '@inquirer/select': 5.0.4(@types/node@25.0.8) + optionalDependencies: + '@types/node': 25.0.8 + + '@inquirer/rawlist@5.2.0(@types/node@25.0.3)': + dependencies: + '@inquirer/core': 11.1.1(@types/node@25.0.3) + '@inquirer/type': 4.0.3(@types/node@25.0.3) optionalDependencies: '@types/node': 25.0.3 - '@inquirer/search@4.0.3(@types/node@25.0.3)': + '@inquirer/rawlist@5.2.0(@types/node@25.0.8)': dependencies: - '@inquirer/core': 11.1.0(@types/node@25.0.3) - '@inquirer/figures': 2.0.2 - '@inquirer/type': 4.0.2(@types/node@25.0.3) + '@inquirer/core': 11.1.1(@types/node@25.0.8) + '@inquirer/type': 4.0.3(@types/node@25.0.8) + optionalDependencies: + '@types/node': 25.0.8 + + '@inquirer/search@4.1.0(@types/node@25.0.3)': + dependencies: + '@inquirer/core': 11.1.1(@types/node@25.0.3) + '@inquirer/figures': 2.0.3 + '@inquirer/type': 4.0.3(@types/node@25.0.3) optionalDependencies: '@types/node': 25.0.3 - '@inquirer/select@5.0.3(@types/node@25.0.3)': + '@inquirer/search@4.1.0(@types/node@25.0.8)': dependencies: - '@inquirer/ansi': 2.0.2 - '@inquirer/core': 11.1.0(@types/node@25.0.3) - '@inquirer/figures': 2.0.2 - '@inquirer/type': 4.0.2(@types/node@25.0.3) + '@inquirer/core': 11.1.1(@types/node@25.0.8) + '@inquirer/figures': 2.0.3 + '@inquirer/type': 4.0.3(@types/node@25.0.8) + optionalDependencies: + '@types/node': 25.0.8 + + '@inquirer/select@5.0.4(@types/node@25.0.3)': + dependencies: + '@inquirer/ansi': 2.0.3 + '@inquirer/core': 11.1.1(@types/node@25.0.3) + '@inquirer/figures': 2.0.3 + '@inquirer/type': 4.0.3(@types/node@25.0.3) optionalDependencies: '@types/node': 25.0.3 + '@inquirer/select@5.0.4(@types/node@25.0.8)': + dependencies: + '@inquirer/ansi': 2.0.3 + '@inquirer/core': 11.1.1(@types/node@25.0.8) + '@inquirer/figures': 2.0.3 + '@inquirer/type': 4.0.3(@types/node@25.0.8) + optionalDependencies: + '@types/node': 25.0.8 + '@inquirer/type@4.0.2(@types/node@25.0.3)': optionalDependencies: '@types/node': 25.0.3 + '@inquirer/type@4.0.3(@types/node@25.0.3)': + optionalDependencies: + '@types/node': 25.0.3 + + '@inquirer/type@4.0.3(@types/node@25.0.8)': + optionalDependencies: + '@types/node': 25.0.8 + '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2 @@ -6374,7 +6573,7 @@ snapshots: '@kevisual/context': 0.0.4 '@kevisual/query': 0.0.31 '@kevisual/router': 0.0.36 - '@kevisual/use-config': 1.0.21(dotenv@17.2.3) + '@kevisual/use-config': 1.0.26(dotenv@17.2.3) mitt: 3.0.1 transitivePeerDependencies: - dotenv @@ -6386,7 +6585,7 @@ snapshots: '@kevisual/context': 0.0.4 '@kevisual/query': 0.0.32 '@kevisual/router': 0.0.39 - '@kevisual/use-config': 1.0.21(dotenv@17.2.3) + '@kevisual/use-config': 1.0.26(dotenv@17.2.3) mitt: 3.0.1 nanoid: 5.1.6 transitivePeerDependencies: @@ -6427,7 +6626,7 @@ snapshots: '@kevisual/ai': 0.0.16 '@kevisual/query': 0.0.31 '@kevisual/router': 0.0.33 - '@kevisual/use-config': 1.0.21(dotenv@17.2.3) + '@kevisual/use-config': 1.0.26(dotenv@17.2.3) '@nut-tree-fork/nut-js': 4.2.6 archiver: 7.0.1 dayjs: 1.11.19 @@ -6492,6 +6691,12 @@ snapshots: '@kevisual/query': 0.0.33 dotenv: 17.2.3 + '@kevisual/query-login@0.0.7(@kevisual/query@0.0.35)': + dependencies: + '@kevisual/cache': 0.0.3 + '@kevisual/query': 0.0.35 + dotenv: 17.2.3 + '@kevisual/query@0.0.30': {} '@kevisual/query@0.0.31': {} @@ -6500,6 +6705,10 @@ snapshots: '@kevisual/query@0.0.33': {} + '@kevisual/query@0.0.35': + dependencies: + tslib: 2.8.1 + '@kevisual/registry@0.0.1(typescript@5.8.2)': dependencies: class-variance-authority: 0.7.1 @@ -6557,12 +6766,17 @@ snapshots: '@kevisual/load': 0.0.6 dotenv: 17.2.3 + '@kevisual/use-config@1.0.26(dotenv@17.2.3)': + dependencies: + '@kevisual/load': 0.0.6 + dotenv: 17.2.3 + '@kevisual/video-tools@0.0.13(dotenv@17.2.3)(supports-color@10.2.2)': dependencies: '@gradio/client': 2.0.1 '@kevisual/ai': 0.0.19 '@kevisual/router': 0.0.51(supports-color@10.2.2) - '@kevisual/use-config': 1.0.21(dotenv@17.2.3) + '@kevisual/use-config': 1.0.26(dotenv@17.2.3) '@kevisual/video': 0.0.2 crypto-js: 4.2.0 dayjs: 1.11.19 @@ -7455,12 +7669,12 @@ snapshots: '@tailwindcss/oxide-win32-arm64-msvc': 4.1.18 '@tailwindcss/oxide-win32-x64-msvc': 4.1.18 - '@tailwindcss/vite@4.1.18(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2))': + '@tailwindcss/vite@4.1.18(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2))': dependencies: '@tailwindcss/node': 4.1.18 '@tailwindcss/oxide': 4.1.18 tailwindcss: 4.1.18 - vite: 6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2) + vite: 6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2) '@tokenizer/token@0.3.0': {} @@ -7493,6 +7707,10 @@ snapshots: dependencies: bun-types: 1.3.5 + '@types/bun@1.3.6': + dependencies: + bun-types: 1.3.6 + '@types/crypto-js@4.2.2': {} '@types/debug@4.1.12': @@ -7507,7 +7725,7 @@ snapshots: '@types/fontkit@2.0.8': dependencies: - '@types/node': 25.0.3 + '@types/node': 25.0.8 '@types/hast@2.3.10': dependencies: @@ -7520,7 +7738,7 @@ snapshots: '@types/jsonwebtoken@9.0.10': dependencies: '@types/ms': 0.7.34 - '@types/node': 25.0.3 + '@types/node': 25.0.8 '@types/lodash-es@4.17.12': dependencies: @@ -7552,6 +7770,10 @@ snapshots: dependencies: undici-types: 7.16.0 + '@types/node@25.0.8': + dependencies: + undici-types: 7.16.0 + '@types/prismjs@1.26.5': {} '@types/react-dom@19.2.3(@types/react@19.2.7)': @@ -7566,13 +7788,13 @@ snapshots: '@types/sax@1.2.7': dependencies: - '@types/node': 25.0.3 + '@types/node': 25.0.8 '@types/semver@7.7.1': {} '@types/send@1.2.1': dependencies: - '@types/node': 25.0.3 + '@types/node': 25.0.8 '@types/trusted-types@2.0.7': {} @@ -7582,7 +7804,7 @@ snapshots: '@types/ws@8.18.1': dependencies: - '@types/node': 25.0.3 + '@types/node': 25.0.8 '@uiw/copy-to-clipboard@1.0.19': {} @@ -7621,7 +7843,7 @@ snapshots: '@ungap/structured-clone@1.3.0': {} - '@vitejs/plugin-react@4.7.0(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2))': + '@vitejs/plugin-react@4.7.0(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2))': dependencies: '@babel/core': 7.28.5 '@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/core@7.28.5) @@ -7629,24 +7851,24 @@ snapshots: '@rolldown/pluginutils': 1.0.0-beta.27 '@types/babel__core': 7.20.5 react-refresh: 0.17.0 - vite: 6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2) + vite: 6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@4.2.0(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2))': + '@vitejs/plugin-vue-jsx@4.2.0(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2))': dependencies: '@babel/core': 7.28.5 '@babel/plugin-transform-typescript': 7.28.5(@babel/core@7.28.5) '@rolldown/pluginutils': 1.0.0-beta.55 '@vue/babel-plugin-jsx': 1.5.0(@babel/core@7.28.5) - vite: 6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2) + vite: 6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2) vue: 3.5.26(typescript@5.8.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue@5.2.1(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2))': + '@vitejs/plugin-vue@5.2.1(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2))': dependencies: - vite: 6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2) + vite: 6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2) vue: 3.5.26(typescript@5.8.2) '@vue/babel-helper-vue-transform-on@1.5.0': {} @@ -7738,14 +7960,14 @@ snapshots: '@vue/compiler-dom': 3.5.26 '@vue/shared': 3.5.26 - '@vue/devtools-core@7.7.9(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2))': + '@vue/devtools-core@7.7.9(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2))': dependencies: '@vue/devtools-kit': 7.7.9 '@vue/devtools-shared': 7.7.9 mitt: 3.0.1 nanoid: 5.1.6 pathe: 2.0.3 - vite-hot-client: 2.1.0(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2)) + vite-hot-client: 2.1.0(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2)) vue: 3.5.26(typescript@5.8.2) transitivePeerDependencies: - vite @@ -7944,7 +8166,7 @@ snapshots: astring@1.9.0: {} - astro@5.16.6(@types/node@25.0.3)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2): + astro@5.16.6(@types/node@25.0.8)(idb-keyval@6.2.2)(jiti@2.6.1)(lightningcss@1.30.2)(rollup@4.43.0)(typescript@5.8.2): dependencies: '@astrojs/compiler': 2.13.0 '@astrojs/internal-helpers': 0.7.5 @@ -8001,8 +8223,8 @@ snapshots: unist-util-visit: 5.0.0 unstorage: 1.17.3(idb-keyval@6.2.2) vfile: 6.0.3 - vite: 6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2) - vitefu: 1.1.1(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2)) + vite: 6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2) + vitefu: 1.1.1(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2)) xxhash-wasm: 1.1.0 yargs-parser: 21.1.1 yocto-spinner: 0.2.3 @@ -8139,7 +8361,11 @@ snapshots: bun-types@1.3.5: dependencies: - '@types/node': 25.0.3 + '@types/node': 25.0.8 + + bun-types@1.3.6: + dependencies: + '@types/node': 25.0.8 bundle-name@4.1.0: dependencies: @@ -8160,7 +8386,7 @@ snapshots: centra@2.7.0: dependencies: - follow-redirects: 1.15.9(debug@4.3.7) + follow-redirects: 1.15.9(debug@4.3.7(supports-color@10.2.2)) transitivePeerDependencies: - debug @@ -9128,7 +9354,7 @@ snapshots: dependencies: safer-buffer: 2.1.2 - iconv-lite@0.7.0: + iconv-lite@0.7.2: dependencies: safer-buffer: 2.1.2 @@ -9156,7 +9382,7 @@ snapshots: dependencies: '@inquirer/ansi': 2.0.2 '@inquirer/core': 11.1.0(@types/node@25.0.3) - '@inquirer/prompts': 8.1.0(@types/node@25.0.3) + '@inquirer/prompts': 8.2.0(@types/node@25.0.3) '@inquirer/type': 4.0.2(@types/node@25.0.3) mute-stream: 3.0.0 run-async: 4.0.6 @@ -11232,11 +11458,11 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.3 - vite-hot-client@2.1.0(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2)): + vite-hot-client@2.1.0(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2)): dependencies: - vite: 6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2) + vite: 6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2) - vite-plugin-inspect@0.8.9(rollup@4.43.0)(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2)): + vite-plugin-inspect@0.8.9(rollup@4.43.0)(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2)): dependencies: '@antfu/utils': 0.7.10 '@rollup/pluginutils': 5.3.0(rollup@4.43.0) @@ -11247,28 +11473,28 @@ snapshots: perfect-debounce: 1.0.0 picocolors: 1.1.1 sirv: 3.0.2 - vite: 6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2) + vite: 6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2) transitivePeerDependencies: - rollup - supports-color - vite-plugin-vue-devtools@7.7.9(rollup@4.43.0)(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2)): + vite-plugin-vue-devtools@7.7.9(rollup@4.43.0)(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2)): dependencies: - '@vue/devtools-core': 7.7.9(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2)) + '@vue/devtools-core': 7.7.9(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2))(vue@3.5.26(typescript@5.8.2)) '@vue/devtools-kit': 7.7.9 '@vue/devtools-shared': 7.7.9 execa: 9.6.1 sirv: 3.0.2 - vite: 6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2) - vite-plugin-inspect: 0.8.9(rollup@4.43.0)(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2)) - vite-plugin-vue-inspector: 5.3.2(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2)) + vite: 6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2) + vite-plugin-inspect: 0.8.9(rollup@4.43.0)(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2)) + vite-plugin-vue-inspector: 5.3.2(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2)) transitivePeerDependencies: - '@nuxt/kit' - rollup - supports-color - vue - vite-plugin-vue-inspector@5.3.2(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2)): + vite-plugin-vue-inspector@5.3.2(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2)): dependencies: '@babel/core': 7.28.5 '@babel/plugin-proposal-decorators': 7.28.0(@babel/core@7.28.5) @@ -11279,11 +11505,11 @@ snapshots: '@vue/compiler-dom': 3.5.25 kolorist: 1.8.0 magic-string: 0.30.17 - vite: 6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2) + vite: 6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2) transitivePeerDependencies: - supports-color - vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2): + vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2): dependencies: esbuild: 0.25.12 fdir: 6.5.0(picomatch@4.0.2) @@ -11292,14 +11518,14 @@ snapshots: rollup: 4.43.0 tinyglobby: 0.2.15 optionalDependencies: - '@types/node': 25.0.3 + '@types/node': 25.0.8 fsevents: 2.3.3 jiti: 2.6.1 lightningcss: 1.30.2 - vitefu@1.1.1(vite@6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2)): + vitefu@1.1.1(vite@6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2)): optionalDependencies: - vite: 6.4.1(@types/node@25.0.3)(jiti@2.6.1)(lightningcss@1.30.2) + vite: 6.4.1(@types/node@25.0.8)(jiti@2.6.1)(lightningcss@1.30.2) vizion@2.2.1: dependencies: @@ -11426,6 +11652,11 @@ snapshots: zod@3.25.76: {} + zustand@5.0.10(@types/react@19.2.7)(react@19.2.3): + optionalDependencies: + '@types/react': 19.2.7 + react: 19.2.3 + zustand@5.0.9(@types/react@19.2.7)(react@19.2.3): optionalDependencies: '@types/react': 19.2.7 diff --git a/src/command/app/front-app/index.ts b/src/command/app/front-app/index.ts index 951ea51..1d53dad 100644 --- a/src/command/app/front-app/index.ts +++ b/src/command/app/front-app/index.ts @@ -10,7 +10,7 @@ import { fileIsExist } from '@/uitls/file.ts'; import fs from 'fs'; import { getConfig } from '@/module/get-config.ts'; import path from 'path'; -import inquirer from 'inquirer'; +import { confirm } from '@inquirer/prompts'; import { baseURL, getUrl } from '@/module/query.ts'; export const appCommand = new Command('app').description('app 命令').action(() => { console.log('app'); @@ -99,15 +99,11 @@ const uninstallAppCommand = new Command('uninstall') if (!checkPath) { console.error(chalk.red('path is error, 请输入正确的路径')); } else { - const answer = await inquirer.prompt([ - { - type: 'confirm', - name: 'confirm', - message: `确定要删除 ${_path} 吗?`, - default: false, - }, - ]); - if (answer.confirm) { + const confirmed = await confirm({ + message: `确定要删除 ${_path} 吗?`, + default: false, + }); + if (confirmed) { fs.rmSync(_path, { recursive: true }); console.log(chalk.green('删除成功', _path)); } diff --git a/src/command/cc.ts b/src/command/cc.ts new file mode 100644 index 0000000..83b2512 --- /dev/null +++ b/src/command/cc.ts @@ -0,0 +1,120 @@ +import { program, Command } from '@/program.ts'; +import { chalk } from '../module/chalk.ts'; +import path from 'node:path'; +import { spawn } from 'node:child_process'; +import { useKey } from '@kevisual/use-config'; +import os from 'node:os' +import fs from 'node:fs'; +import { select } from '@inquirer/prompts'; + +const MODELS = ['minimax', 'glm'] as const; +type Model = typeof MODELS[number]; + +const changeMinimax = (token?: string) => { + const auth_token = token || useKey("MINIMAX_API_KEY") + return { + "env": { + "ANTHROPIC_AUTH_TOKEN": auth_token, + "ANTHROPIC_BASE_URL": "https://api.minimaxi.com/anthropic", + "ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMax-M2.1", + "ANTHROPIC_DEFAULT_OPUS_MODEL": "MiniMax-M2.1", + "ANTHROPIC_DEFAULT_SONNET_MODEL": "MiniMax-M2.1", + "ANTHROPIC_MODEL": "MiniMax-M2.1", + "API_TIMEOUT_MS": "3000000", + "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1 + } + } +} +const changeGLM = (token?: string) => { + const auth_token = token || useKey('ZHIPU_API_KEY') + return { + "env": { + "ANTHROPIC_AUTH_TOKEN": auth_token, + "ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic", + "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.7", + "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-4.7", + "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-4.7", + "ANTHROPIC_MODEL": "glm-4.7" + } + } +} + +/** + * 跳过登录检查,在~/.claude.json的配置中添加字段 "hasCompletedOnboarding": true + */ +const changeNoCheck = () => { + const homeDir = os.homedir(); + const claudeConfigPath = path.join(homeDir, '.claude.json'); + + let claudeConfig = {}; + if (fs.existsSync(claudeConfigPath)) { + const content = fs.readFileSync(claudeConfigPath, 'utf-8'); + try { + claudeConfig = JSON.parse(content); + } catch { + claudeConfig = {}; + } + } + + claudeConfig = { + ...claudeConfig, + hasCompletedOnboarding: true + }; + + fs.writeFileSync(claudeConfigPath, JSON.stringify(claudeConfig, null, 2)); +} + +const modelConfig: Record object> = { + minimax: changeMinimax, + glm: changeGLM, +}; + +const readOrCreateConfig = (configPath: string): Record => { + if (fs.existsSync(configPath)) { + const content = fs.readFileSync(configPath, 'utf-8'); + try { + return JSON.parse(content); + } catch { + return {}; + } + } + return {}; +}; + +const saveConfig = (configPath: string, config: Record) => { + fs.writeFileSync(configPath, JSON.stringify(config, null, 2)); +}; + +export const command = new Command('cc') + .description('切换claude code模型,支持GLM4.7和Minimax') + .option('-m, --models ', `选择模型: ${MODELS.join(' | ')}`) + .action(async (options) => { + const configPath = path.join(os.homedir(), '.claude/settings.json'); + + // 读取或创建配置 + const config = readOrCreateConfig(configPath); + + // 如果没有指定模型,使用 inquire 选择 + let selectedModel: Model; + if (options.models && MODELS.includes(options.models as Model)) { + selectedModel = options.models as Model; + } else { + selectedModel = await select({ + message: '请选择模型:', + choices: MODELS, + }); + } + + // 更新配置 + const updateConfig = modelConfig[selectedModel](); + Object.assign(config, updateConfig); + + // 保存配置 + saveConfig(configPath, config); + changeNoCheck(); + + console.log(`已切换到模型: ${chalk.green(selectedModel)}`); + console.log(`配置已保存到: ${configPath}`); + }); + +program.addCommand(command) \ No newline at end of file diff --git a/src/command/config.ts b/src/command/config.ts index 59c1ff0..8242443 100644 --- a/src/command/config.ts +++ b/src/command/config.ts @@ -3,7 +3,7 @@ import { checkFileExists, getConfig, writeConfig } from '@/module/index.ts'; import path from 'path'; import fs from 'fs'; import { chalk } from '@/module/chalk.ts'; -import inquirer from 'inquirer'; +import { confirm, input } from '@inquirer/prompts'; // 设置工作目录 const setWorkdir = async (options: { workdir: string }) => { @@ -24,15 +24,11 @@ const setWorkdir = async (options: { workdir: string }) => { console.log('路径不存在'); fs.mkdirSync(finalPath, { recursive: true }); } - const answers = await inquirer.prompt([ - { - type: 'confirm', - name: 'confirm', - message: `Are you sure you want to set the workdir to: ${finalPath}?`, - default: false, - }, - ]); - if (answers.confirm) { + const confirmed = await confirm({ + message: `Are you sure you want to set the workdir to: ${finalPath}?`, + default: false, + }); + if (confirmed) { flag = true; config.workdir = finalPath; console.log(chalk.green(`set workdir success:`, finalPath)); @@ -81,15 +77,11 @@ const command = new Command('config') console.log('路径不存在'); fs.mkdirSync(finalPath, { recursive: true }); } - const answers = await inquirer.prompt([ - { - type: 'confirm', - name: 'confirm', - message: `Are you sure you want to set the workdir to: ${finalPath}?`, - default: false, - }, - ]); - if (answers.confirm) { + const confirmed = await confirm({ + message: `Are you sure you want to set the workdir to: ${finalPath}?`, + default: false, + }); + if (confirmed) { flag = true; config.workdir = finalPath; console.log(chalk.green(`set workdir success:`, finalPath)); @@ -100,15 +92,11 @@ const command = new Command('config') if (options.set) { const key = options.set; let value = options.value; - const answer = await inquirer.prompt([ - { - type: 'input', - name: 'value', + if (!value) { + value = await input({ message: `Enter your ${key}:(current: ${config[key]})`, - when: () => !value, - }, - ]); - value = answer.value || value; + }); + } if (key && value) { flag = true; config[key] = value; @@ -138,16 +126,10 @@ const setCommand = new Command('set') return; } let flag = false; - const answer = await inquirer.prompt([ - { - type: 'input', - name: 'value', + if (value === 'not_input') { + value = await input({ message: `Enter your ${key}:(current: ${config[key]})`, - when: () => value === 'not_input', - }, - ]); - if (value === 'not_input' && !answer.value) { - value = ''; + }); } if (key === 'workdir') { await setWorkdir({ workdir: value }); @@ -192,15 +174,11 @@ const getCommand = new Command('get') .action(async (key) => { const config = getConfig(); const keys = Object.keys(config); - const answer = await inquirer.prompt([ - { - type: 'input', - name: 'key', + if (!key) { + key = await input({ message: `Enter your key:(keys: ${JSON.stringify(keys)})`, - when: () => !key, - }, - ]); - key = answer.key || key; + }); + } if (config[key]) { console.log(chalk.green(`get ${key}:`)); diff --git a/src/command/deploy.ts b/src/command/deploy.ts index b9e368f..6d52e0d 100644 --- a/src/command/deploy.ts +++ b/src/command/deploy.ts @@ -4,7 +4,7 @@ import path from 'path'; import fs from 'fs'; import FormData from 'form-data'; import { getBaseURL, query, storage } from '@/module/query.ts'; -import inquirer from 'inquirer'; +import { input, confirm } from '@inquirer/prompts'; import chalk from 'chalk'; import { upload } from '@/module/download/upload.ts'; import { getHash } from '@/uitls/hash.ts'; @@ -60,23 +60,15 @@ const command = new Command('deploy') key = pkgInfo?.appKey || ''; } logger.debug('start deploy'); - if (!version || !key) { - const answers = await inquirer.prompt([ - { - type: 'input', - name: 'version', - message: 'Enter your version:', - when: () => !version, - }, - { - type: 'input', - name: 'key', - message: 'Enter your key:', - when: () => !key, - }, - ]); - version = answers.version || version; - key = answers.key || key; + if (!version) { + version = await input({ + message: 'Enter your version:', + }); + } + if (!key) { + key = await input({ + message: 'Enter your key:', + }); } const pwd = process.cwd(); const directory = path.join(pwd, filePath); @@ -110,14 +102,10 @@ const command = new Command('deploy') logger.debug('upload Files Key', key, version); if (!yes) { // 确认是否上传 - const confirm = await inquirer.prompt([ - { - type: 'confirm', - name: 'confirm', - message: 'Do you want to upload these files?', - }, - ]); - if (!confirm.confirm) { + const confirmed = await confirm({ + message: 'Do you want to upload these files?', + }); + if (!confirmed) { return; } } diff --git a/src/command/login.ts b/src/command/login.ts index 7a12c28..01f16aa 100644 --- a/src/command/login.ts +++ b/src/command/login.ts @@ -1,6 +1,6 @@ import { program, Command } from '@/program.ts'; import { getConfig, getEnvToken } from '@/module/get-config.ts'; -import inquirer from 'inquirer'; +import { input, password } from '@inquirer/prompts'; import { loginInCommand } from '@/module/login/login-by-web.ts'; import { queryLogin, storage } from '@/module/query.ts'; import chalk from 'chalk'; @@ -28,24 +28,15 @@ const loginCommand = new Command('login') return; } // 如果没有传递参数,则通过交互式输入 - if (!username || !password) { - const answers = await inquirer.prompt([ - { - type: 'input', - name: 'username', - message: 'Enter your username:', - when: () => !username, // 当 username 为空时,提示用户输入 - }, - { - type: 'password', - name: 'password', - message: 'Enter your password:', - mask: '*', // 隐藏输入的字符 - when: () => !password, // 当 password 为空时,提示用户输入 - }, - ]); - username = answers.username || username; - password = answers.password || password; + if (!username) { + username = await input({ + message: 'Enter your username:', + }); + } + if (!password) { + password = await password({ + message: 'Enter your password:', + }); } const token = storage.getItem('token'); if (token) { diff --git a/src/command/ls-token.ts b/src/command/ls-token.ts index 626f406..9805ea4 100644 --- a/src/command/ls-token.ts +++ b/src/command/ls-token.ts @@ -1,7 +1,7 @@ import { program as app, Command } from '@/program.ts'; import { getConfig, getEnvToken, writeConfig } from '@/module/index.ts'; import { queryLogin, storage } from '@/module/query.ts'; -import inquirer from 'inquirer'; +import { input } from '@inquirer/prompts'; import util from 'util'; function isNumeric(str: string) { return /^-?\d+\.?\d*$/.test(str); @@ -136,14 +136,9 @@ const setBaseURL = new Command('set') const config = getConfig(); let baseURL = opt.baseURL; if (!baseURL) { - const answers = await inquirer.prompt([ - { - type: 'input', - name: 'baseURL', - message: `Enter your baseURL:(current: ${config.baseURL})`, - }, - ]); - baseURL = answers.baseURL; + baseURL = await input({ + message: `Enter your baseURL:(current: ${config.baseURL})`, + }); if (!baseURL) { console.log('baseURL is required'); return; diff --git a/src/command/npm.ts b/src/command/npm.ts index c1a2816..314ed1d 100644 --- a/src/command/npm.ts +++ b/src/command/npm.ts @@ -5,7 +5,7 @@ import { spawn } from 'child_process'; import { fileIsExist } from '@/uitls/file.ts'; import { getConfig } from '@/module/get-config.ts'; import fs from 'fs'; -import inquirer from 'inquirer'; +import { select, confirm } from '@inquirer/prompts'; import { checkPnpm } from '@/uitls/npm.ts'; const parseIfJson = (str: string) => { try { @@ -21,10 +21,8 @@ const publish = new Command('publish') .option('-t, --tag', 'tag') .description('publish npm') .action(async (registry, options) => { - const answer = await inquirer.prompt([ - { - type: 'list', - name: 'publish', + if (!registry) { + registry = await select({ message: 'Select the registry to publish', choices: [ { @@ -36,10 +34,8 @@ const publish = new Command('publish') value: 'npm', }, ], - when: !registry, - }, - ]); - registry = registry || answer.publish; + }); + } const config = getConfig(); let cmd = ''; const execPath = process.cwd(); @@ -149,15 +145,11 @@ const npmrc = new Command('set') if (options.force) { writeFlag = true; } else { - const answer = await inquirer.prompt([ - { - type: 'confirm', - name: 'confirm', - message: `Are you sure you want to overwrite the .npmrc file?`, - default: false, - }, - ]); - if (answer.confirm) { + const confirmed = await confirm({ + message: `Are you sure you want to overwrite the .npmrc file?`, + default: false, + }); + if (confirmed) { writeFlag = true; } } diff --git a/src/command/proxy.ts b/src/command/proxy.ts index 9904bd1..871d9a9 100644 --- a/src/command/proxy.ts +++ b/src/command/proxy.ts @@ -1,6 +1,5 @@ import { program, Command } from '@/program.ts'; import { chalk } from '@/module/chalk.ts'; -import inquirer from 'inquirer'; const command = new Command('proxy') .description('执行代理相关的命令') diff --git a/src/command/publish.ts b/src/command/publish.ts index f172641..1b64b88 100644 --- a/src/command/publish.ts +++ b/src/command/publish.ts @@ -6,7 +6,7 @@ import { getConfig, query } from '@/module/index.ts'; import { fileIsExist } from '@/uitls/file.ts'; import { chalk } from '@/module/chalk.ts'; import * as backServices from '@/query/services/index.ts'; -import inquirer from 'inquirer'; +import { select, input } from '@inquirer/prompts'; import { logger } from '@/module/logger.ts'; // 查找文件(忽略大小写) async function findFileInsensitive(targetFile: string): Promise { diff --git a/src/command/router.ts b/src/command/router.ts index c1add52..637c111 100644 --- a/src/command/router.ts +++ b/src/command/router.ts @@ -1,5 +1,5 @@ import { program, Command } from '@/program.ts'; -import inquirer from 'inquirer'; +import { input } from '@inquirer/prompts'; import { query } from '../module/index.ts'; import chalk from 'chalk'; import util from 'util'; @@ -15,27 +15,14 @@ const command = new Command('service') let { path, key } = options; // 如果没有传递参数,则通过交互式输入 if (!path) { - const answers = await inquirer.prompt([ - { - type: 'input', - name: 'path', - required: true, - message: 'Enter your path:', - when: () => !path, // 当 username 为空时,提示用户输入 - }, - ]); - path = answers.path || path; + path = await input({ + message: 'Enter your path:', + }); } if (!key) { - const answers = await inquirer.prompt([ - { - type: 'input', - required: false, - name: 'key', - message: 'Enter your key:', - }, - ]); - key = answers.key || key; + key = await input({ + message: 'Enter your key:', + }); } const res = await query.post({ path, key }); if (res?.code === 200) { diff --git a/src/index.ts b/src/index.ts index f558d9d..499110e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,6 +17,7 @@ import './command/gist/index.ts'; import './command/config-remote.ts'; import './command/config-secret-remote.ts'; import './command/ai.ts'; +import './command/cc.ts' // program.parse(process.argv); export const runParser = async (argv: string[]) => { diff --git a/src/module/download/install.ts b/src/module/download/install.ts index 3d133e3..bf58f1a 100644 --- a/src/module/download/install.ts +++ b/src/module/download/install.ts @@ -5,7 +5,7 @@ import { chalk } from '../chalk.ts'; import { Result } from '@kevisual/query'; import { fileIsExist } from '@/uitls/file.ts'; import { glob } from 'fast-glob'; -import inquirer from 'inquirer'; +import { confirm } from '@inquirer/prompts'; import { getEnvToken } from '../get-config.ts'; type DownloadTask = { @@ -80,15 +80,11 @@ const checkDelete = async (opts?: { force?: boolean; dir?: string; yes?: boolean try { if (fileIsExist(dir)) { const files = await glob(`${dir}/**/*`, { onlyFiles: true }); - const answers = await inquirer.prompt([ - { - type: 'confirm', - name: 'confirm', - message: `是否你需要删除 【${opts?.dir}】 目录下的文件. [${files.length}] 个?`, - when: () => files.length > 0 && !yes, // 当 username 为空时,提示用户输入 - }, - ]); - if (answers?.confirm || yes) { + const shouldConfirm = files.length > 0 && !yes; + const confirmed = shouldConfirm ? await confirm({ + message: `是否你需要删除 【${opts?.dir}】 目录下的文件. [${files.length}] 个?`, + }) : false; + if (confirmed || yes) { fs.rmSync(dir, { recursive: true }); console.log(chalk.green('删除成功', dir)); } else { diff --git a/src/program.ts b/src/program.ts index 4cf2d1e..a9267ba 100644 --- a/src/program.ts +++ b/src/program.ts @@ -1,6 +1,7 @@ import { program, Command } from 'commander'; import fs from 'fs'; import { useContextKey } from '@kevisual/context' + // 将多个子命令加入主程序中 const version = useContextKey('version', () => { let version = '0.0.64';