├── Kiro-account-manager ├── LICENSE ├── src │ ├── renderer │ │ ├── src │ │ │ ├── services │ │ │ │ └── kiro-api.ts │ │ │ ├── env.d.ts │ │ │ ├── store │ │ │ │ └── index.ts │ │ │ ├── components │ │ │ │ ├── layout │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Sidebar.tsx │ │ │ │ ├── kiro │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── SteeringEditor.tsx │ │ │ │ │ └── McpServerEditor.tsx │ │ │ │ ├── index.ts │ │ │ │ ├── pages │ │ │ │ │ └── index.ts │ │ │ │ ├── ui │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── progress.tsx │ │ │ │ │ ├── badge.tsx │ │ │ │ │ ├── Toggle.tsx │ │ │ │ │ ├── alert.tsx │ │ │ │ │ ├── button.tsx │ │ │ │ │ ├── card.tsx │ │ │ │ │ └── Select.tsx │ │ │ │ ├── accounts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── AccountGrid.tsx │ │ │ │ │ ├── AccountManager.tsx │ │ │ │ │ ├── ExportDialog.tsx │ │ │ │ │ ├── AccountFilter.tsx │ │ │ │ │ ├── GroupManageDialog.tsx │ │ │ │ │ ├── AccountDetailDialog.tsx │ │ │ │ │ └── EditAccountDialog.tsx │ │ │ │ ├── Versions.tsx │ │ │ │ └── UpdateDialog.tsx │ │ │ ├── assets │ │ │ │ ├── 交流群.png │ │ │ │ ├── 微信支付.png │ │ │ │ ├── 支付宝支付.png │ │ │ │ ├── Kiro Logo.png │ │ │ │ ├── author-avatar.png │ │ │ │ ├── kiro-high-resolution-logo-transparent.png │ │ │ │ ├── base.css │ │ │ │ ├── wavy-lines.svg │ │ │ │ ├── main.css │ │ │ │ └── electron.svg │ │ │ ├── main.tsx │ │ │ ├── lib │ │ │ │ └── utils.ts │ │ │ ├── types │ │ │ │ ├── machineId.ts │ │ │ │ └── account.ts │ │ │ ├── App.tsx │ │ │ └── styles │ │ │ │ └── globals.css │ │ └── index.html │ ├── main │ │ └── machineId.ts │ └── preload │ │ └── index.d.ts ├── .kiro │ └── settings │ │ └── mcp.json ├── .gitignore ├── .vscode │ ├── extensions.json │ ├── settings.json │ └── launch.json ├── .prettierrc.yaml ├── .prettierignore ├── build │ ├── icon.icns │ ├── icon.ico │ ├── icon.png │ └── entitlements.mac.plist ├── resources │ ├── 主页.png │ ├── 关于.png │ ├── 设置.png │ ├── icon.ico │ ├── icon.png │ ├── 主题色.png │ ├── 账户管理.png │ ├── icon.icns │ ├── 机器码管理.png │ ├── kiro-high-resolution-logo-grayscale.png │ ├── kiro-high-resolution-logo-transparent.ico │ ├── kiro-high-resolution-logo-transparent.png │ └── kiro-high-resolution-logo-grayscale-transparent.png ├── tsconfig.json ├── .editorconfig ├── tsconfig.node.json ├── tsconfig.web.json ├── electron.vite.config.ts ├── eslint.config.mjs ├── docs │ ├── CHANGELOG-v1.2.7.md │ └── CHANGELOG-v1.2.5.md ├── electron-builder.yml └── package.json ├── LICENSE ├── .gitignore ├── README.md └── .github └── workflows └── build.yml /Kiro-account-manager/LICENSE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/services/kiro-api.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Kiro-account-manager/.kiro/settings/mcp.json: -------------------------------------------------------------------------------- 1 | { 2 | "mcpServers": {} 3 | } -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/store/index.ts: -------------------------------------------------------------------------------- 1 | export { useAccountsStore } from './accounts' 2 | -------------------------------------------------------------------------------- /Kiro-account-manager/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | out 4 | .DS_Store 5 | .eslintcache 6 | *.log* 7 | -------------------------------------------------------------------------------- /Kiro-account-manager/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["dbaeumer.vscode-eslint"] 3 | } 4 | -------------------------------------------------------------------------------- /Kiro-account-manager/.prettierrc.yaml: -------------------------------------------------------------------------------- 1 | singleQuote: true 2 | semi: false 3 | printWidth: 100 4 | trailingComma: none 5 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/layout/index.ts: -------------------------------------------------------------------------------- 1 | export { Sidebar, type PageType } from './Sidebar' 2 | -------------------------------------------------------------------------------- /Kiro-account-manager/.prettierignore: -------------------------------------------------------------------------------- 1 | out 2 | dist 3 | pnpm-lock.yaml 4 | LICENSE.md 5 | tsconfig.json 6 | tsconfig.*.json 7 | -------------------------------------------------------------------------------- /Kiro-account-manager/build/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/build/icon.icns -------------------------------------------------------------------------------- /Kiro-account-manager/build/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/build/icon.ico -------------------------------------------------------------------------------- /Kiro-account-manager/build/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/build/icon.png -------------------------------------------------------------------------------- /Kiro-account-manager/resources/主页.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/主页.png -------------------------------------------------------------------------------- /Kiro-account-manager/resources/关于.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/关于.png -------------------------------------------------------------------------------- /Kiro-account-manager/resources/设置.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/设置.png -------------------------------------------------------------------------------- /Kiro-account-manager/resources/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/icon.ico -------------------------------------------------------------------------------- /Kiro-account-manager/resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/icon.png -------------------------------------------------------------------------------- /Kiro-account-manager/resources/主题色.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/主题色.png -------------------------------------------------------------------------------- /Kiro-account-manager/resources/账户管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/账户管理.png -------------------------------------------------------------------------------- /Kiro-account-manager/resources/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/icon.icns -------------------------------------------------------------------------------- /Kiro-account-manager/resources/机器码管理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/机器码管理.png -------------------------------------------------------------------------------- /Kiro-account-manager/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [{ "path": "./tsconfig.node.json" }, { "path": "./tsconfig.web.json" }] 4 | } 5 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/assets/交流群.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/src/renderer/src/assets/交流群.png -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/assets/微信支付.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/src/renderer/src/assets/微信支付.png -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/assets/支付宝支付.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/src/renderer/src/assets/支付宝支付.png -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/kiro/index.ts: -------------------------------------------------------------------------------- 1 | export { SteeringEditor } from './SteeringEditor' 2 | export { McpServerEditor } from './McpServerEditor' 3 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/assets/Kiro Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/src/renderer/src/assets/Kiro Logo.png -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/assets/author-avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/src/renderer/src/assets/author-avatar.png -------------------------------------------------------------------------------- /Kiro-account-manager/resources/kiro-high-resolution-logo-grayscale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/kiro-high-resolution-logo-grayscale.png -------------------------------------------------------------------------------- /Kiro-account-manager/resources/kiro-high-resolution-logo-transparent.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/kiro-high-resolution-logo-transparent.ico -------------------------------------------------------------------------------- /Kiro-account-manager/resources/kiro-high-resolution-logo-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/kiro-high-resolution-logo-transparent.png -------------------------------------------------------------------------------- /Kiro-account-manager/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/index.ts: -------------------------------------------------------------------------------- 1 | // UI 组件 2 | export * from './ui' 3 | 4 | // 账号管理组件 5 | export * from './accounts' 6 | 7 | // 其他组件 8 | export { default as Versions } from './Versions' 9 | -------------------------------------------------------------------------------- /Kiro-account-manager/resources/kiro-high-resolution-logo-grayscale-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/resources/kiro-high-resolution-logo-grayscale-transparent.png -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/assets/kiro-high-resolution-logo-transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chaogei/Kiro-account-manager/HEAD/Kiro-account-manager/src/renderer/src/assets/kiro-high-resolution-logo-transparent.png -------------------------------------------------------------------------------- /Kiro-account-manager/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@electron-toolkit/tsconfig/tsconfig.node.json", 3 | "include": ["electron.vite.config.*", "src/main/**/*", "src/preload/**/*"], 4 | "compilerOptions": { 5 | "composite": true, 6 | "types": ["electron-vite/node"] 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/pages/index.ts: -------------------------------------------------------------------------------- 1 | export { HomePage } from './HomePage' 2 | export { AboutPage } from './AboutPage' 3 | export { SettingsPage } from './SettingsPage' 4 | export { MachineIdPage } from './MachineIdPage' 5 | export { KiroSettingsPage } from './KiroSettingsPage' 6 | -------------------------------------------------------------------------------- /Kiro-account-manager/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[typescript]": { 3 | "editor.defaultFormatter": "esbenp.prettier-vscode" 4 | }, 5 | "[javascript]": { 6 | "editor.defaultFormatter": "esbenp.prettier-vscode" 7 | }, 8 | "[json]": { 9 | "editor.defaultFormatter": "esbenp.prettier-vscode" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/main.tsx: -------------------------------------------------------------------------------- 1 | import './styles/globals.css' 2 | 3 | import { StrictMode } from 'react' 4 | import { createRoot } from 'react-dom/client' 5 | import App from './App' 6 | 7 | createRoot(document.getElementById('root')!).render( 8 | 9 | 10 | 11 | ) 12 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/ui/index.ts: -------------------------------------------------------------------------------- 1 | export { Button, buttonVariants } from './button' 2 | export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from './card' 3 | export { Progress } from './progress' 4 | export { Badge, badgeVariants } from './badge' 5 | export { Alert, AlertTitle, AlertDescription } from './alert' 6 | export { Toggle } from './Toggle' 7 | export { Select } from './Select' 8 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/accounts/index.ts: -------------------------------------------------------------------------------- 1 | export { AccountCard } from './AccountCard' 2 | export { AccountGrid } from './AccountGrid' 3 | export { AccountFilterPanel } from './AccountFilter' 4 | export { AccountToolbar } from './AccountToolbar' 5 | export { AddAccountDialog } from './AddAccountDialog' 6 | export { EditAccountDialog } from './EditAccountDialog' 7 | export { AccountDetailDialog } from './AccountDetailDialog' 8 | export { AccountManager } from './AccountManager' 9 | -------------------------------------------------------------------------------- /Kiro-account-manager/build/entitlements.mac.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.cs.allow-jit 6 | 7 | com.apple.security.cs.allow-unsigned-executable-memory 8 | 9 | com.apple.security.cs.allow-dyld-environment-variables 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/Versions.tsx: -------------------------------------------------------------------------------- 1 | import { useState } from 'react' 2 | 3 | function Versions(): React.JSX.Element { 4 | const [versions] = useState(window.electron.process.versions) 5 | 6 | return ( 7 | 12 | ) 13 | } 14 | 15 | export default Versions 16 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Kiro 6 | 7 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Kiro-account-manager/tsconfig.web.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@electron-toolkit/tsconfig/tsconfig.web.json", 3 | "include": [ 4 | "src/renderer/src/env.d.ts", 5 | "src/renderer/src/**/*", 6 | "src/renderer/src/**/*.tsx", 7 | "src/preload/*.d.ts" 8 | ], 9 | "compilerOptions": { 10 | "composite": true, 11 | "jsx": "react-jsx", 12 | "baseUrl": ".", 13 | "paths": { 14 | "@renderer/*": [ 15 | "src/renderer/src/*" 16 | ], 17 | "@/*": [ 18 | "src/renderer/src/*" 19 | ] 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Kiro-account-manager/electron.vite.config.ts: -------------------------------------------------------------------------------- 1 | import { resolve } from 'path' 2 | import { defineConfig, externalizeDepsPlugin } from 'electron-vite' 3 | import react from '@vitejs/plugin-react' 4 | import tailwindcss from '@tailwindcss/vite' 5 | 6 | export default defineConfig({ 7 | main: { 8 | plugins: [externalizeDepsPlugin()] 9 | }, 10 | preload: { 11 | plugins: [externalizeDepsPlugin()] 12 | }, 13 | renderer: { 14 | resolve: { 15 | alias: { 16 | '@renderer': resolve('src/renderer/src'), 17 | '@': resolve('src/renderer/src') 18 | } 19 | }, 20 | plugins: [react(), tailwindcss()] 21 | } 22 | }) 23 | -------------------------------------------------------------------------------- /Kiro-account-manager/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Debug Main Process", 6 | "type": "node", 7 | "request": "launch", 8 | "cwd": "${workspaceRoot}", 9 | "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite", 10 | "windows": { 11 | "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite.cmd" 12 | }, 13 | "runtimeArgs": ["--sourcemap"], 14 | "env": { 15 | "REMOTE_DEBUGGING_PORT": "9222" 16 | } 17 | }, 18 | { 19 | "name": "Debug Renderer Process", 20 | "port": 9222, 21 | "request": "attach", 22 | "type": "chrome", 23 | "webRoot": "${workspaceFolder}/src/renderer", 24 | "timeout": 60000, 25 | "presentation": { 26 | "hidden": true 27 | } 28 | } 29 | ], 30 | "compounds": [ 31 | { 32 | "name": "Debug All", 33 | "configurations": ["Debug Main Process", "Debug Renderer Process"], 34 | "presentation": { 35 | "order": 1 36 | } 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /Kiro-account-manager/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'eslint/config' 2 | import tseslint from '@electron-toolkit/eslint-config-ts' 3 | import eslintConfigPrettier from '@electron-toolkit/eslint-config-prettier' 4 | import eslintPluginReact from 'eslint-plugin-react' 5 | import eslintPluginReactHooks from 'eslint-plugin-react-hooks' 6 | import eslintPluginReactRefresh from 'eslint-plugin-react-refresh' 7 | 8 | export default defineConfig( 9 | { ignores: ['**/node_modules', '**/dist', '**/out'] }, 10 | tseslint.configs.recommended, 11 | eslintPluginReact.configs.flat.recommended, 12 | eslintPluginReact.configs.flat['jsx-runtime'], 13 | { 14 | settings: { 15 | react: { 16 | version: 'detect' 17 | } 18 | } 19 | }, 20 | { 21 | files: ['**/*.{ts,tsx}'], 22 | plugins: { 23 | 'react-hooks': eslintPluginReactHooks, 24 | 'react-refresh': eslintPluginReactRefresh 25 | }, 26 | rules: { 27 | ...eslintPluginReactHooks.configs.recommended.rules, 28 | ...eslintPluginReactRefresh.configs.vite.rules 29 | } 30 | }, 31 | eslintConfigPrettier 32 | ) 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 chaogei666 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/ui/progress.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import { cn } from '@/lib/utils' 3 | 4 | interface ProgressProps extends React.HTMLAttributes { 5 | value?: number 6 | max?: number 7 | indicatorClassName?: string 8 | } 9 | 10 | const Progress = React.forwardRef( 11 | ({ className, value = 0, max = 100, indicatorClassName, ...props }, ref) => { 12 | const percentage = Math.min(100, Math.max(0, (value / max) * 100)) 13 | 14 | return ( 15 |
20 |
80 && 'bg-warning', 24 | percentage > 95 && 'bg-destructive', 25 | indicatorClassName 26 | )} 27 | style={{ transform: `translateX(-${100 - percentage}%)` }} 28 | /> 29 |
30 | ) 31 | } 32 | ) 33 | Progress.displayName = 'Progress' 34 | 35 | export { Progress } 36 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/ui/badge.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import { cva, type VariantProps } from 'class-variance-authority' 3 | import { cn } from '@/lib/utils' 4 | 5 | const badgeVariants = cva( 6 | 'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', 7 | { 8 | variants: { 9 | variant: { 10 | default: 'border-transparent bg-primary text-primary-foreground shadow', 11 | secondary: 'border-transparent bg-secondary text-secondary-foreground', 12 | destructive: 'border-transparent bg-destructive text-destructive-foreground shadow', 13 | outline: 'text-foreground', 14 | success: 'border-transparent bg-success text-white shadow' 15 | } 16 | }, 17 | defaultVariants: { 18 | variant: 'default' 19 | } 20 | } 21 | ) 22 | 23 | export interface BadgeProps 24 | extends React.HTMLAttributes, 25 | VariantProps {} 26 | 27 | function Badge({ className, variant, ...props }: BadgeProps): React.ReactNode { 28 | return
29 | } 30 | 31 | export { Badge, badgeVariants } 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | kiro网页解码分析/2cee0feff6bd91b6cb21.js 2 | kiro网页解码分析/5fc29c15ad252c0cd4c1.js 3 | kiro网页解码分析/6b22da50a77e5b477c7c.js 4 | kiro网页解码分析/36f7e9e4dc3a99855283.js 5 | kiro网页解码分析/61a6485cd7fd5f4edf23.js 6 | kiro网页解码分析/70c9ee36465cebc8ae79.js 7 | kiro网页解码分析/079b243476c702d0c8bc.js 8 | kiro网页解码分析/80d1c66fc0410347940b.js 9 | kiro网页解码分析/656ffd87a448474eb636a22ae4e6db975f9c64f25b154ae38035db04fbb3677d.js 10 | kiro网页解码分析/3858af3eb422fc9ff23d.js 11 | kiro网页解码分析/4230973e1dcf99c7f8f8.js 12 | kiro网页解码分析/auth.js 13 | kiro网页解码分析/b84fa5923c23578c3ccc.js 14 | kiro网页解码分析/be0bf1555584b8a5f7fd.js 15 | kiro网页解码分析/bfe741df70a85ebf5586.js 16 | kiro网页解码分析/c7884003de1bad6da336.js 17 | kiro网页解码分析/cf876673391b3559eb63.js 18 | kiro网页解码分析/client-kiro-internal.js 19 | kiro网页解码分析/d78cf78333f69e09aaea.js 20 | kiro网页解码分析/dbd685f96aa7960412bb.js 21 | kiro网页解码分析/eb09d127e3c32cae3e2a.js 22 | kiro网页解码分析/efa5af3cf91b1c5f80a3.js 23 | kiro网页解码分析/main.js 24 | kiro网页解码分析/main.js.back 25 | kiro网页解码分析/panorama-nav-init.js 26 | kiro网页解码分析/sdk.js 27 | kiro网页解码分析/shortbread.js 28 | kiro网页解码分析/vendor.js 29 | test/kiro_client_auth.py 30 | test/kiro_full_auth.py 31 | test/kiro_oauth_login.py 32 | test/kiro_sso_auth.py 33 | test/kiro_usage_api.py 34 | test/__pycache__/kiro_full_auth.cpython-39.pyc 35 | test/__pycache__/kiro_sso_auth.cpython-39.pyc 36 | docs/CodeWhispererRuntimeService API.md 37 | docs/Kiro API.md 38 | kiro_token.json 39 | Kiro.code-workspace 40 | -------------------------------------------------------------------------------- /Kiro-account-manager/docs/CHANGELOG-v1.2.7.md: -------------------------------------------------------------------------------- 1 | # Kiro 账户管理器 v1.2.7 更新说明 2 | 3 | 发布日期:2024-12-09 4 | 5 | ## 🎨 界面美化 6 | 7 | ### 全局页面美化 8 | - **统一页面头部设计**:所有页面采用渐变背景 + 模糊光效 + 主题色标题 9 | - **统一卡片样式**:所有卡片添加悬停阴影效果和图标背景框 10 | - **颜色主题化**:移除所有硬编码颜色,统一使用主题变量,确保深色/浅色模式和主题色切换时颜色一致 11 | 12 | ### 新增自定义 UI 组件 13 | - **Toggle 开关组件**:替换原生 checkbox,提供平滑动画和主题色支持 14 | - **Select 下拉组件**:替换原生 select,支持选项描述、勾选标记和主题色高亮 15 | 16 | ### 美化的页面 17 | - **首页 (HomePage)**:头部渐变、统计卡片悬停效果、特色功能卡片主题化 18 | - **账户管理 (AccountManager)**:头部渐变背景和图标 19 | - **设置页面 (SettingsPage)**:头部渐变、所有卡片图标统一样式、检查间隔布局优化 20 | - **Kiro 设置 (KiroSettingsPage)**:头部渐变、Toggle 开关、Select 下拉框、通知设置分组 21 | - **关于页面 (AboutPage)**:头部渐变、所有卡片图标统一样式、功能列表颜色统一 22 | 23 | ## 🔧 功能优化 24 | 25 | ### OIDC 凭证批量导入 26 | - **支持 GitHub 和 Google 账号**:批量导入时可通过 `provider` 字段指定账号类型 27 | - **自动识别认证方式**:根据 provider 自动设置正确的 `authMethod` (IdC/social) 和 `idp` 28 | - **更新帮助文本**:添加 GitHub/Google 示例和说明 29 | 30 | ### 批量导入 JSON 格式示例 31 | ```json 32 | [ 33 | { 34 | "refreshToken": "xxx", 35 | "clientId": "xxx", 36 | "clientSecret": "xxx", 37 | "provider": "BuilderId" 38 | }, 39 | { 40 | "refreshToken": "yyy", 41 | "provider": "Github" 42 | }, 43 | { 44 | "refreshToken": "zzz", 45 | "provider": "Google" 46 | } 47 | ] 48 | ``` 49 | 50 | ## 📁 新增文件 51 | 52 | - `src/renderer/src/components/ui/Toggle.tsx` - 自定义开关组件 53 | - `src/renderer/src/components/ui/Select.tsx` - 自定义下拉选择组件 54 | 55 | ## 🐛 修复 56 | 57 | - 修复设置页面检查间隔下拉框布局问题 58 | - 修复 Kiro 设置页面上下下拉框宽度不一致问题 59 | - 统一设置页面和 Kiro 设置页面的宽度设置 60 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/ui/Toggle.tsx: -------------------------------------------------------------------------------- 1 | import { cn } from '../../lib/utils' 2 | 3 | interface ToggleProps { 4 | checked: boolean 5 | onChange: (checked: boolean) => void 6 | disabled?: boolean 7 | size?: 'sm' | 'md' 8 | } 9 | 10 | export function Toggle({ checked, onChange, disabled = false, size = 'md' }: ToggleProps) { 11 | const sizes = { 12 | sm: { track: 'w-8 h-4', thumb: 'w-3 h-3', translate: 'translate-x-4' }, 13 | md: { track: 'w-11 h-6', thumb: 'w-5 h-5', translate: 'translate-x-5' } 14 | } 15 | 16 | const s = sizes[size] 17 | 18 | return ( 19 | 42 | ) 43 | } 44 | -------------------------------------------------------------------------------- /Kiro-account-manager/docs/CHANGELOG-v1.2.5.md: -------------------------------------------------------------------------------- 1 | # Kiro 账户管理器 v1.2.5 更新日志 2 | 3 | **发布日期**: 2025-12-09 4 | 5 | --- 6 | 7 | ## 🎨 主题系统升级 8 | 9 | ### 主题颜色扩展 10 | - 主题颜色从 **13 个增加到 21 个**,提供更丰富的个性化选择 11 | - 按色系分组显示,便于用户快速定位喜欢的颜色: 12 | - **蓝色系**: 天空蓝、靛蓝、清新青、晴空蓝、水鸭蓝 13 | - **紫红系**: 优雅紫、紫罗兰、洋红、粉红、玫瑰红 14 | - **暖色系**: 热情红、活力橙、琥珀金、明黄 15 | - **绿色系**: 翠绿、草绿、青柠 16 | - **中性色**: 石板灰、锌灰、暖灰、中性灰 17 | 18 | ### 主题选择器优化 19 | - 新增 **收缩/展开** 功能,收缩时显示当前选中颜色 20 | - 点击即可展开完整的主题选择面板 21 | - 减少页面占用空间,界面更整洁 22 | 23 | --- 24 | 25 | ## 📊 主页增强 26 | 27 | ### 额度统计卡片 28 | - 新增 **额度统计** 模块,实时汇总所有有效账号的用量数据 29 | - 显示内容: 30 | - 总额度 31 | - 已使用 32 | - 剩余额度 33 | - 使用率百分比 34 | - 可视化进度条,根据使用率变色: 35 | - 🟢 绿色: < 50% 36 | - 🟡 黄色: 50% - 80% 37 | - 🔴 红色: > 80% 38 | 39 | --- 40 | 41 | ## 💾 导出功能升级 42 | 43 | ### 多格式导出支持 44 | - 新增导出格式选择弹窗,支持 4 种导出格式: 45 | - **JSON**: 完整数据,可用于导入恢复 46 | - **TXT**: 纯文本格式,便于阅读 47 | - **CSV**: Excel 兼容格式,支持中文 48 | - **剪贴板**: 直接复制到剪贴板 49 | 50 | ### 导出选项 51 | - JSON 格式可选择是否包含凭证信息(Token 等敏感数据) 52 | - 支持多选账号导出,选中账号时只导出选中的 53 | - 设置页面和账户管理页面共用相同的导出组件 54 | 55 | --- 56 | 57 | ## 🔧 机器码管理优化 58 | 59 | ### 当前机器码卡片 60 | - 新增 **最后修改时间** 显示,与原始机器码备份布局保持一致 61 | 62 | ### 账户机器码管理弹窗 63 | - 新增 **搜索功能**,支持按邮箱、昵称、机器码搜索 64 | - 搜索无结果时显示友好提示 65 | 66 | --- 67 | 68 | ## 🐛 问题修复 69 | 70 | - 修复部分主题颜色切换无效的问题 71 | - 补全所有新增主题的 CSS 变量定义 72 | - 修复 `applyTheme` 函数未包含新主题类名的问题 73 | 74 | --- 75 | 76 | ## 📝 技术改进 77 | 78 | - 主题配置重构为分组结构,便于维护和扩展 79 | - 导出功能组件化,提高代码复用性 80 | - 优化额度统计使用 `useMemo` 提升性能 81 | 82 | --- 83 | 84 | **完整版本**: 1.2.5 85 | **兼容性**: Windows / macOS / Linux 86 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/assets/base.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --ev-c-white: #ffffff; 3 | --ev-c-white-soft: #f8f8f8; 4 | --ev-c-white-mute: #f2f2f2; 5 | 6 | --ev-c-black: #1b1b1f; 7 | --ev-c-black-soft: #222222; 8 | --ev-c-black-mute: #282828; 9 | 10 | --ev-c-gray-1: #515c67; 11 | --ev-c-gray-2: #414853; 12 | --ev-c-gray-3: #32363f; 13 | 14 | --ev-c-text-1: rgba(255, 255, 245, 0.86); 15 | --ev-c-text-2: rgba(235, 235, 245, 0.6); 16 | --ev-c-text-3: rgba(235, 235, 245, 0.38); 17 | 18 | --ev-button-alt-border: transparent; 19 | --ev-button-alt-text: var(--ev-c-text-1); 20 | --ev-button-alt-bg: var(--ev-c-gray-3); 21 | --ev-button-alt-hover-border: transparent; 22 | --ev-button-alt-hover-text: var(--ev-c-text-1); 23 | --ev-button-alt-hover-bg: var(--ev-c-gray-2); 24 | } 25 | 26 | :root { 27 | --color-background: var(--ev-c-black); 28 | --color-background-soft: var(--ev-c-black-soft); 29 | --color-background-mute: var(--ev-c-black-mute); 30 | 31 | --color-text: var(--ev-c-text-1); 32 | } 33 | 34 | *, 35 | *::before, 36 | *::after { 37 | box-sizing: border-box; 38 | margin: 0; 39 | font-weight: normal; 40 | } 41 | 42 | ul { 43 | list-style: none; 44 | } 45 | 46 | body { 47 | min-height: 100vh; 48 | color: var(--color-text); 49 | background: var(--color-background); 50 | line-height: 1.6; 51 | font-family: 52 | Inter, 53 | -apple-system, 54 | BlinkMacSystemFont, 55 | 'Segoe UI', 56 | Roboto, 57 | Oxygen, 58 | Ubuntu, 59 | Cantarell, 60 | 'Fira Sans', 61 | 'Droid Sans', 62 | 'Helvetica Neue', 63 | sans-serif; 64 | text-rendering: optimizeLegibility; 65 | -webkit-font-smoothing: antialiased; 66 | -moz-osx-font-smoothing: grayscale; 67 | } 68 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/ui/alert.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import { cva, type VariantProps } from 'class-variance-authority' 3 | import { cn } from '@/lib/utils' 4 | 5 | const alertVariants = cva( 6 | 'relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7', 7 | { 8 | variants: { 9 | variant: { 10 | default: 'bg-background text-foreground', 11 | destructive: 12 | 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive' 13 | } 14 | }, 15 | defaultVariants: { 16 | variant: 'default' 17 | } 18 | } 19 | ) 20 | 21 | const Alert = React.forwardRef< 22 | HTMLDivElement, 23 | React.HTMLAttributes & VariantProps 24 | >(({ className, variant, ...props }, ref) => ( 25 |
26 | )) 27 | Alert.displayName = 'Alert' 28 | 29 | const AlertTitle = React.forwardRef>( 30 | ({ className, ...props }, ref) => ( 31 |
32 | ) 33 | ) 34 | AlertTitle.displayName = 'AlertTitle' 35 | 36 | const AlertDescription = React.forwardRef< 37 | HTMLParagraphElement, 38 | React.HTMLAttributes 39 | >(({ className, ...props }, ref) => ( 40 |
41 | )) 42 | AlertDescription.displayName = 'AlertDescription' 43 | 44 | export { Alert, AlertTitle, AlertDescription } 45 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/assets/wavy-lines.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/ui/button.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import { cva, type VariantProps } from 'class-variance-authority' 3 | import { cn } from '@/lib/utils' 4 | 5 | const buttonVariants = cva( 6 | 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', 7 | { 8 | variants: { 9 | variant: { 10 | default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90', 11 | destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90', 12 | outline: 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground', 13 | secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80', 14 | ghost: 'hover:bg-accent hover:text-accent-foreground', 15 | link: 'text-primary underline-offset-4 hover:underline' 16 | }, 17 | size: { 18 | default: 'h-9 px-4 py-2', 19 | sm: 'h-8 rounded-md px-3 text-xs', 20 | lg: 'h-10 rounded-md px-8', 21 | icon: 'h-9 w-9' 22 | } 23 | }, 24 | defaultVariants: { 25 | variant: 'default', 26 | size: 'default' 27 | } 28 | } 29 | ) 30 | 31 | export interface ButtonProps 32 | extends React.ButtonHTMLAttributes, 33 | VariantProps { 34 | asChild?: boolean 35 | } 36 | 37 | const Button = React.forwardRef( 38 | ({ className, variant, size, ...props }, ref) => { 39 | return ( 40 | 56 | 57 | {/* Dropdown */} 58 | {isOpen && ( 59 |
60 | {options.map((option) => ( 61 | 89 | ))} 90 |
91 | )} 92 |
93 | ) 94 | } 95 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/assets/main.css: -------------------------------------------------------------------------------- 1 | @import './base.css'; 2 | 3 | body { 4 | display: flex; 5 | align-items: center; 6 | justify-content: center; 7 | overflow: hidden; 8 | background-image: url('./wavy-lines.svg'); 9 | background-size: cover; 10 | user-select: none; 11 | } 12 | 13 | code { 14 | font-weight: 600; 15 | padding: 3px 5px; 16 | border-radius: 2px; 17 | background-color: var(--color-background-mute); 18 | font-family: 19 | ui-monospace, 20 | SFMono-Regular, 21 | SF Mono, 22 | Menlo, 23 | Consolas, 24 | Liberation Mono, 25 | monospace; 26 | font-size: 85%; 27 | } 28 | 29 | #root { 30 | display: flex; 31 | align-items: center; 32 | justify-content: center; 33 | flex-direction: column; 34 | margin-bottom: 80px; 35 | } 36 | 37 | .logo { 38 | margin-bottom: 20px; 39 | -webkit-user-drag: none; 40 | height: 128px; 41 | width: 128px; 42 | will-change: filter; 43 | transition: filter 300ms; 44 | } 45 | 46 | .logo:hover { 47 | filter: drop-shadow(0 0 1.2em #6988e6aa); 48 | } 49 | 50 | .creator { 51 | font-size: 14px; 52 | line-height: 16px; 53 | color: var(--ev-c-text-2); 54 | font-weight: 600; 55 | margin-bottom: 10px; 56 | } 57 | 58 | .text { 59 | font-size: 28px; 60 | color: var(--ev-c-text-1); 61 | font-weight: 700; 62 | line-height: 32px; 63 | text-align: center; 64 | margin: 0 10px; 65 | padding: 16px 0; 66 | } 67 | 68 | .tip { 69 | font-size: 16px; 70 | line-height: 24px; 71 | color: var(--ev-c-text-2); 72 | font-weight: 600; 73 | } 74 | 75 | .react { 76 | background: -webkit-linear-gradient(315deg, #087ea4 55%, #7c93ee); 77 | background-clip: text; 78 | -webkit-background-clip: text; 79 | -webkit-text-fill-color: transparent; 80 | font-weight: 700; 81 | } 82 | 83 | .ts { 84 | background: -webkit-linear-gradient(315deg, #3178c6 45%, #f0dc4e); 85 | background-clip: text; 86 | -webkit-background-clip: text; 87 | -webkit-text-fill-color: transparent; 88 | font-weight: 700; 89 | } 90 | 91 | .actions { 92 | display: flex; 93 | padding-top: 32px; 94 | margin: -6px; 95 | flex-wrap: wrap; 96 | justify-content: flex-start; 97 | } 98 | 99 | .action { 100 | flex-shrink: 0; 101 | padding: 6px; 102 | } 103 | 104 | .action a { 105 | cursor: pointer; 106 | text-decoration: none; 107 | display: inline-block; 108 | border: 1px solid transparent; 109 | text-align: center; 110 | font-weight: 600; 111 | white-space: nowrap; 112 | border-radius: 20px; 113 | padding: 0 20px; 114 | line-height: 38px; 115 | font-size: 14px; 116 | border-color: var(--ev-button-alt-border); 117 | color: var(--ev-button-alt-text); 118 | background-color: var(--ev-button-alt-bg); 119 | } 120 | 121 | .action a:hover { 122 | border-color: var(--ev-button-alt-hover-border); 123 | color: var(--ev-button-alt-hover-text); 124 | background-color: var(--ev-button-alt-hover-bg); 125 | } 126 | 127 | .versions { 128 | position: absolute; 129 | bottom: 30px; 130 | margin: 0 auto; 131 | padding: 15px 0; 132 | font-family: 'Menlo', 'Lucida Console', monospace; 133 | display: inline-flex; 134 | overflow: hidden; 135 | align-items: center; 136 | border-radius: 22px; 137 | background-color: #202127; 138 | backdrop-filter: blur(24px); 139 | } 140 | 141 | .versions li { 142 | display: block; 143 | float: left; 144 | border-right: 1px solid var(--ev-c-gray-1); 145 | padding: 0 20px; 146 | font-size: 14px; 147 | line-height: 14px; 148 | opacity: 0.8; 149 | &:last-child { 150 | border: none; 151 | } 152 | } 153 | 154 | @media (max-width: 720px) { 155 | .text { 156 | font-size: 20px; 157 | } 158 | } 159 | 160 | @media (max-width: 620px) { 161 | .versions { 162 | display: none; 163 | } 164 | } 165 | 166 | @media (max-width: 350px) { 167 | .tip, 168 | .actions { 169 | display: none; 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/layout/Sidebar.tsx: -------------------------------------------------------------------------------- 1 | import { Home, Users, Settings, Info, ChevronLeft, ChevronRight, Fingerprint, Sparkles } from 'lucide-react' 2 | import { cn } from '@/lib/utils' 3 | import kiroLogo from '@/assets/kiro-high-resolution-logo-transparent.png' 4 | import kiroLogoSmall from '@/assets/Kiro Logo.svg' 5 | import { useAccountsStore } from '@/store/accounts' 6 | 7 | export type PageType = 'home' | 'accounts' | 'machineId' | 'kiroSettings' | 'settings' | 'about' 8 | 9 | interface SidebarProps { 10 | currentPage: PageType 11 | onPageChange: (page: PageType) => void 12 | collapsed: boolean 13 | onToggleCollapse: () => void 14 | } 15 | 16 | const menuItems: { id: PageType; label: string; icon: React.ElementType }[] = [ 17 | { id: 'home', label: '主页', icon: Home }, 18 | { id: 'accounts', label: '账户管理', icon: Users }, 19 | { id: 'machineId', label: '机器码', icon: Fingerprint }, 20 | { id: 'kiroSettings', label: 'Kiro 设置', icon: Sparkles }, 21 | { id: 'settings', label: '设置', icon: Settings }, 22 | { id: 'about', label: '关于', icon: Info }, 23 | ] 24 | 25 | export function Sidebar({ currentPage, onPageChange, collapsed, onToggleCollapse }: SidebarProps) { 26 | const { darkMode } = useAccountsStore() 27 | 28 | return ( 29 |
35 | {/* Logo */} 36 |
37 | {collapsed ? ( 38 | Kiro 43 | ) : ( 44 | <> 45 | Kiro 50 | 账户管理器 51 | 52 | )} 53 |
54 | 55 | {/* Menu Items */} 56 | 83 | 84 | {/* Collapse Toggle */} 85 |
86 | 100 |
101 |
102 | ) 103 | } 104 | -------------------------------------------------------------------------------- /Kiro-account-manager/src/renderer/src/components/kiro/SteeringEditor.tsx: -------------------------------------------------------------------------------- 1 | import { useState, useEffect } from 'react' 2 | import { createPortal } from 'react-dom' 3 | import { Button } from '../ui' 4 | import { X, Save, RefreshCw } from 'lucide-react' 5 | 6 | interface SteeringEditorProps { 7 | filename: string 8 | onClose: () => void 9 | onSaved?: () => void 10 | } 11 | 12 | export function SteeringEditor({ filename, onClose, onSaved }: SteeringEditorProps) { 13 | const [content, setContent] = useState('') 14 | const [loading, setLoading] = useState(true) 15 | const [saving, setSaving] = useState(false) 16 | const [error, setError] = useState(null) 17 | const [modified, setModified] = useState(false) 18 | 19 | useEffect(() => { 20 | loadContent() 21 | }, [filename]) 22 | 23 | const loadContent = async () => { 24 | setLoading(true) 25 | setError(null) 26 | try { 27 | const result = await window.api.readKiroSteeringFile(filename) 28 | if (result.success && result.content !== undefined) { 29 | setContent(result.content) 30 | setModified(false) 31 | } else { 32 | setError(result.error || '读取文件失败') 33 | } 34 | } catch (err) { 35 | setError('读取文件失败') 36 | console.error(err) 37 | } finally { 38 | setLoading(false) 39 | } 40 | } 41 | 42 | const saveContent = async () => { 43 | setSaving(true) 44 | setError(null) 45 | try { 46 | const result = await window.api.saveKiroSteeringFile(filename, content) 47 | if (result.success) { 48 | setModified(false) 49 | onSaved?.() 50 | } else { 51 | setError(result.error || '保存文件失败') 52 | } 53 | } catch (err) { 54 | setError('保存文件失败') 55 | console.error(err) 56 | } finally { 57 | setSaving(false) 58 | } 59 | } 60 | 61 | const handleClose = () => { 62 | if (modified) { 63 | if (confirm('文件已修改,确定要关闭吗?未保存的更改将丢失。')) { 64 | onClose() 65 | } 66 | } else { 67 | onClose() 68 | } 69 | } 70 | 71 | const handleChange = (value: string) => { 72 | setContent(value) 73 | setModified(true) 74 | } 75 | 76 | return createPortal( 77 |
78 | {/* Backdrop */} 79 |
83 | 84 | {/* Dialog */} 85 |
86 | {/* Header */} 87 |
88 |
89 |

编辑 Steering 文件

90 | {filename} 91 | {modified && ● 已修改} 92 |
93 |
94 | 97 | 106 | 109 |
110 |
111 | 112 | {/* Error */} 113 | {error && ( 114 |
115 | {error} 116 |
117 | )} 118 | 119 | {/* Editor */} 120 |
121 | {loading ? ( 122 |
123 | 124 |
125 | ) : ( 126 |