diff --git a/.omc/project-memory.json b/.omc/project-memory.json deleted file mode 100644 index d784276fe..000000000 --- a/.omc/project-memory.json +++ /dev/null @@ -1,211 +0,0 @@ -{ - "version": "1.0.0", - "lastScanned": 1776228576231, - "projectRoot": "D:\\source_codespace\\geroge\\costrict-repo\\csc", - "techStack": { - "languages": [ - { - "name": "JavaScript/TypeScript", - "version": null, - "confidence": "high", - "markers": [ - "package.json" - ] - }, - { - "name": "TypeScript", - "version": null, - "confidence": "high", - "markers": [ - "tsconfig.json" - ] - } - ], - "frameworks": [ - { - "name": "react", - "version": "19.2.4", - "category": "frontend" - } - ], - "packageManager": "npm", - "runtime": null - }, - "build": { - "buildCommand": "npm run build", - "testCommand": "npm test", - "lintCommand": "npm run lint", - "devCommand": "npm run dev", - "scripts": { - "prebuild": "bun run scripts/generate-skills.ts", - "build": "bun run build.ts", - "dev": "bun run scripts/dev.ts", - "dev:inspect": "bun run scripts/dev-debug.ts", - "prepublishOnly": "bun run build", - "lint": "biome lint src/", - "lint:fix": "biome lint --fix src/", - "format": "biome format --write src/", - "prepare": "git config core.hooksPath .githooks", - "test": "bun test", - "check:unused": "knip-bun", - "health": "bun run scripts/health-check.ts", - "postinstall": "node scripts/postinstall.cjs && node scripts/setup-chrome-mcp.mjs", - "docs:dev": "npx mintlify dev", - "generate:skills": "bun run scripts/generate-skills.ts", - "rcs": "bun run scripts/rcs.ts" - } - }, - "conventions": { - "namingStyle": null, - "importStyle": null, - "testPattern": null, - "fileOrganization": "type-based" - }, - "structure": { - "isMonorepo": true, - "workspaces": [ - "packages/*", - "packages/@ant/*" - ], - "mainDirectories": [ - "docs", - "scripts", - "src", - "tests" - ], - "gitBranches": { - "defaultBranch": "main", - "branchingStrategy": null - } - }, - "customNotes": [], - "directoryMap": { - "docs": { - "path": "docs", - "purpose": "Documentation", - "fileCount": 7, - "lastAccessed": 1776228576189, - "keyFiles": [ - "auto-updater.md", - "config-list.md", - "external-dependencies.md", - "favicon.svg", - "lsp-integration.md" - ] - }, - "learn": { - "path": "learn", - "purpose": null, - "fileCount": 5, - "lastAccessed": 1776228576191, - "keyFiles": [ - "LEARN.md", - "phase-1-qa.md", - "phase-1-startup-flow.md", - "phase-2-conversation-loop.md", - "phase-2-qa.md" - ] - }, - "packages": { - "path": "packages", - "purpose": null, - "fileCount": 0, - "lastAccessed": 1776228576207, - "keyFiles": [] - }, - "scripts": { - "path": "scripts", - "purpose": "Build/utility scripts", - "fileCount": 10, - "lastAccessed": 1776228576208, - "keyFiles": [ - "defines.ts", - "dev-debug.ts", - "dev.ts", - "download-ripgrep.ts", - "generate-skills.ts" - ] - }, - "src": { - "path": "src", - "purpose": "Source code", - "fileCount": 17, - "lastAccessed": 1776228576208, - "keyFiles": [ - "commands.ts", - "context.ts", - "cost-tracker.ts", - "costHook.ts", - "dialogLaunchers.tsx" - ] - }, - "tests": { - "path": "tests", - "purpose": "Test files", - "fileCount": 0, - "lastAccessed": 1776228576209, - "keyFiles": [] - }, - "vendor": { - "path": "vendor", - "purpose": "Third-party code", - "fileCount": 0, - "lastAccessed": 1776228576209, - "keyFiles": [] - }, - "src\\components": { - "path": "src\\components", - "purpose": "UI components", - "fileCount": 116, - "lastAccessed": 1776228576211, - "keyFiles": [ - "AgentProgressLine.tsx", - "AntModelSwitchCallout.tsx", - "App.tsx" - ] - }, - "tests\\mocks": { - "path": "tests\\mocks", - "purpose": "Mock data", - "fileCount": 2, - "lastAccessed": 1776228576211, - "keyFiles": [ - "api-responses.ts", - "file-system.ts" - ] - } - }, - "hotPaths": [ - { - "path": "package.json", - "accessCount": 6, - "lastAccessed": 1776308709974, - "type": "file" - }, - { - "path": "README.md", - "accessCount": 2, - "lastAccessed": 1776307986506, - "type": "file" - }, - { - "path": "src", - "accessCount": 1, - "lastAccessed": 1776228747216, - "type": "directory" - }, - { - "path": "C:\\Users\\SXF-Admin\\.claude\\projects\\D--source-codespace-geroge-costrict-repo-csc\\memory\\project_windows_bun_command.md", - "accessCount": 1, - "lastAccessed": 1776229520309, - "type": "file" - }, - { - "path": "C:\\Users\\SXF-Admin\\.claude\\projects\\D--source-codespace-geroge-costrict-repo-csc\\memory\\feedback_bun_install_in_session.md", - "accessCount": 1, - "lastAccessed": 1776229520323, - "type": "file" - } - ], - "userDirectives": [] -} \ No newline at end of file diff --git a/.omc/state/agent-replay-593ef472-4143-4340-9c2d-4070ffea907f.jsonl b/.omc/state/agent-replay-593ef472-4143-4340-9c2d-4070ffea907f.jsonl deleted file mode 100644 index 87b74e63e..000000000 --- a/.omc/state/agent-replay-593ef472-4143-4340-9c2d-4070ffea907f.jsonl +++ /dev/null @@ -1,2 +0,0 @@ -{"t":0,"agent":"a1b51bb","agent_type":"unknown","event":"agent_stop","success":true} -{"t":0,"agent":"a920562","agent_type":"unknown","event":"agent_stop","success":true} diff --git a/.omc/state/agent-replay-749dc8f9-6034-4b83-8221-33ac46fe84fb.jsonl b/.omc/state/agent-replay-749dc8f9-6034-4b83-8221-33ac46fe84fb.jsonl deleted file mode 100644 index 0eed0c057..000000000 --- a/.omc/state/agent-replay-749dc8f9-6034-4b83-8221-33ac46fe84fb.jsonl +++ /dev/null @@ -1 +0,0 @@ -{"t":0,"agent":"a795097","agent_type":"unknown","event":"agent_stop","success":true} diff --git a/.omc/state/mission-state.json b/.omc/state/mission-state.json deleted file mode 100644 index d1ebd89ff..000000000 --- a/.omc/state/mission-state.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "updatedAt": "2026-04-14T03:12:55.493Z", - "missions": [ - { - "id": "session:6b38dce5-cce2-421d-846e-30cf6cd497ff:none", - "source": "session", - "name": "none", - "objective": "Session mission", - "createdAt": "2026-04-09T04:02:32.303Z", - "updatedAt": "2026-04-09T04:02:53.818Z", - "status": "done", - "workerCount": 1, - "taskCounts": { - "total": 1, - "pending": 0, - "blocked": 0, - "inProgress": 0, - "completed": 1, - "failed": 0 - }, - "agents": [ - { - "name": "Explore:a21eb81", - "role": "Explore", - "ownership": "a21eb8181c593206b", - "status": "done", - "currentStep": null, - "latestUpdate": "completed", - "completedSummary": null, - "updatedAt": "2026-04-09T04:02:53.818Z" - } - ], - "timeline": [ - { - "id": "session-start:a21eb8181c593206b:2026-04-09T04:02:32.303Z", - "at": "2026-04-09T04:02:32.303Z", - "kind": "update", - "agent": "Explore:a21eb81", - "detail": "started Explore:a21eb81", - "sourceKey": "session-start:a21eb8181c593206b" - }, - { - "id": "session-stop:a21eb8181c593206b:2026-04-09T04:02:53.818Z", - "at": "2026-04-09T04:02:53.818Z", - "kind": "completion", - "agent": "Explore:a21eb81", - "detail": "completed", - "sourceKey": "session-stop:a21eb8181c593206b" - } - ] - }, - { - "id": "session:d0afd455-d4ab-400a-97f2-9401ba20e404:none", - "source": "session", - "name": "none", - "objective": "Session mission", - "createdAt": "2026-04-09T07:00:16.685Z", - "updatedAt": "2026-04-09T08:54:13.110Z", - "status": "done", - "workerCount": 8, - "taskCounts": { - "total": 8, - "pending": 0, - "blocked": 0, - "inProgress": 0, - "completed": 8, - "failed": 0 - }, - "agents": [ - { - "name": "Explore:aadbd2f", - "role": "Explore", - "ownership": "aadbd2fa1ad722276", - "status": "done", - "currentStep": null, - "latestUpdate": "completed", - "completedSummary": null, - "updatedAt": "2026-04-09T08:22:45.475Z" - }, - { - "name": "Explore:ad1ac07", - "role": "Explore", - "ownership": "ad1ac07efc41075ce", - "status": "done", - "currentStep": null, - "latestUpdate": "completed", - "completedSummary": null, - "updatedAt": "2026-04-09T07:09:14.177Z" - }, - { - "name": "Explore:a3f3288", - "role": "Explore", - "ownership": "a3f328865e99cb7ba", - "status": "done", - "currentStep": null, - "latestUpdate": "completed", - "completedSummary": null, - "updatedAt": "2026-04-09T07:11:13.121Z" - }, - { - "name": "Explore:a409c86", - "role": "Explore", - "ownership": "a409c8643a205e3e4", - "status": "done", - "currentStep": null, - "latestUpdate": "completed", - "completedSummary": null, - "updatedAt": "2026-04-09T07:12:46.725Z" - }, - { - "name": "Explore:aca6a8a", - "role": "Explore", - "ownership": "aca6a8a47201b2e54", - "status": "done", - "currentStep": null, - "latestUpdate": "completed", - "completedSummary": null, - "updatedAt": "2026-04-09T08:41:39.815Z" - }, - { - "name": "Explore:a18f456", - "role": "Explore", - "ownership": "a18f4561762d2ca34", - "status": "done", - "currentStep": null, - "latestUpdate": "completed", - "completedSummary": null, - "updatedAt": "2026-04-09T08:48:12.718Z" - }, - { - "name": "executor:ab56987", - "role": "executor", - "ownership": "ab569870c605c758e", - "status": "done", - "currentStep": null, - "latestUpdate": "completed", - "completedSummary": null, - "updatedAt": "2026-04-09T08:50:46.342Z" - }, - { - "name": "executor:a6fa402", - "role": "executor", - "ownership": "a6fa40274d2ac6090", - "status": "done", - "currentStep": null, - "latestUpdate": "completed", - "completedSummary": null, - "updatedAt": "2026-04-09T08:54:13.110Z" - } - ], - "timeline": [ - { - "id": "session-start:ab569870c605c758e:2026-04-09T08:48:43.190Z", - "at": "2026-04-09T08:48:43.190Z", - "kind": "update", - "agent": "executor:ab56987", - "detail": "started executor:ab56987", - "sourceKey": "session-start:ab569870c605c758e" - }, - { - "id": "session-stop:ab569870c605c758e:2026-04-09T08:50:46.342Z", - "at": "2026-04-09T08:50:46.342Z", - "kind": "completion", - "agent": "executor:ab56987", - "detail": "completed", - "sourceKey": "session-stop:ab569870c605c758e" - }, - { - "id": "session-start:a6fa40274d2ac6090:2026-04-09T08:51:49.072Z", - "at": "2026-04-09T08:51:49.072Z", - "kind": "update", - "agent": "executor:a6fa402", - "detail": "started executor:a6fa402", - "sourceKey": "session-start:a6fa40274d2ac6090" - }, - { - "id": "session-stop:a6fa40274d2ac6090:2026-04-09T08:54:13.110Z", - "at": "2026-04-09T08:54:13.110Z", - "kind": "completion", - "agent": "executor:a6fa402", - "detail": "completed", - "sourceKey": "session-stop:a6fa40274d2ac6090" - } - ] - }, - { - "id": "session:0375b005-04be-4064-90ad-ac7b5bdf56df:none", - "source": "session", - "name": "none", - "objective": "Session mission", - "createdAt": "2026-04-14T03:06:26.214Z", - "updatedAt": "2026-04-14T03:12:55.493Z", - "status": "done", - "workerCount": 1, - "taskCounts": { - "total": 1, - "pending": 0, - "blocked": 0, - "inProgress": 0, - "completed": 1, - "failed": 0 - }, - "agents": [ - { - "name": "general-purpose:a9f2b75", - "role": "general-purpose", - "ownership": "a9f2b750c9c123748", - "status": "done", - "currentStep": null, - "latestUpdate": "completed", - "completedSummary": null, - "updatedAt": "2026-04-14T03:12:55.493Z" - } - ], - "timeline": [ - { - "id": "session-start:a9f2b750c9c123748:2026-04-14T03:06:26.214Z", - "at": "2026-04-14T03:06:26.214Z", - "kind": "update", - "agent": "general-purpose:a9f2b75", - "detail": "started general-purpose:a9f2b75", - "sourceKey": "session-start:a9f2b750c9c123748" - }, - { - "id": "session-start:a9f2b750c9c123748:2026-04-14T03:08:27.269Z", - "at": "2026-04-14T03:08:27.269Z", - "kind": "update", - "agent": "general-purpose:a9f2b75", - "detail": "started general-purpose:a9f2b75", - "sourceKey": "session-start:a9f2b750c9c123748" - }, - { - "id": "session-stop:a9f2b750c9c123748:2026-04-14T03:12:55.493Z", - "at": "2026-04-14T03:12:55.493Z", - "kind": "completion", - "agent": "general-purpose:a9f2b75", - "detail": "completed", - "sourceKey": "session-stop:a9f2b750c9c123748" - } - ] - } - ] -} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f03c671c..0e682c01f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [4.0.6] - 2026-04-16 + +### 新功能 + +- 去除了运行时bun的依赖 + ## [4.0.5] - 2026-04-15 ### 新功能 diff --git a/package.json b/package.json index 51ebd40eb..633556ee7 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "@costrict/csc", - "version": "4.0.5-3", + "version": "4.0.6", - "description": "CSC — 多模型终端 AI 编程助手,支持 Anthropic/OpenAI/Gemini/Grok 等多种 API 端点", + "description": "CSC — CoStrict多模型终端 AI 编程助手,支持 Anthropic/OpenAI/Gemini/Grok 等多种 API 端点", "type": "module", "author": "claude-code-best ", "repository": { @@ -65,6 +65,7 @@ }, "dependencies": { "@claude-code-best/mcp-chrome-bridge": "^2.0.7", + "undici": "^7.24.6", "ws": "^8.20.0", "yaml": "^2.8.3" }, @@ -189,7 +190,6 @@ "turndown": "^7.2.2", "type-fest": "^5.5.0", "typescript": "^6.0.2", - "undici": "^7.24.6", "url-handler-napi": "workspace:*", "usehooks-ts": "^3.1.1", "vscode-jsonrpc": "^8.2.1", diff --git a/scripts/defines.ts b/scripts/defines.ts index 404dc3425..08541f2d0 100644 --- a/scripts/defines.ts +++ b/scripts/defines.ts @@ -7,7 +7,7 @@ */ export function getMacroDefines(): Record { return { - "MACRO.VERSION": JSON.stringify("4.0.5.1"), + "MACRO.VERSION": JSON.stringify("4.0.6"), "MACRO.BUILD_TIME": JSON.stringify(new Date().toISOString()), "MACRO.FEEDBACK_CHANNEL": JSON.stringify(""), "MACRO.ISSUES_EXPLAINER": JSON.stringify(""), diff --git a/src/components/ConsoleOAuthFlow.tsx b/src/components/ConsoleOAuthFlow.tsx index 73ba8d0a5..d66cc58f7 100644 --- a/src/components/ConsoleOAuthFlow.tsx +++ b/src/components/ConsoleOAuthFlow.tsx @@ -17,7 +17,6 @@ import { getSettings_DEPRECATED, updateSettingsForSource } from '../utils/settin import { Select } from './CustomSelect/select.js'; import { Spinner } from './Spinner.js'; import TextInput from './TextInput.js'; -import { ModelPicker } from './ModelPicker.js'; import { useSetAppState } from '../state/AppState.js'; type Props = { @@ -1260,25 +1259,43 @@ function OAuthStatusMessage({ case 'costrict_model_select': { const sortedModels = [...oauthStatus.models].sort((a, b) => a.id.localeCompare(b.id)); + // 直接使用已获取的模型列表渲染选项,避免通用 ModelPicker 因 getAPIProvider() 竞态 + // 导致显示标准 Anthropic 模型列表而非 CoStrict 动态模型 + const costrictOptions = sortedModels.map(m => ({ + value: m.id, + label: m.name ?? m.id, + description: + m.id === 'Auto' + ? `${Math.round(((m as any).creditDiscount ?? 0) * 100)}% discount` + : `${(m as any).creditConsumption ?? '?'}x credit`, + })); return ( - { - const selected = model ?? sortedModels[0]?.id ?? ''; - process.env.COSTRICT_MODEL = selected; - setAppState(prev => ({ ...prev, mainLoopModel: selected, mainLoopModelForSession: null })); - setOAuthStatus({ state: 'success' }); - void onDone(); - }} - onCancel={() => { - const selected = sortedModels[0]?.id ?? ''; - process.env.COSTRICT_MODEL = selected; - setAppState(prev => ({ ...prev, mainLoopModel: selected, mainLoopModelForSession: null })); - setOAuthStatus({ state: 'success' }); - void onDone(); - }} - /> + + + + Select model + + Login successful. Select a CoStrict model to use: + + +