CANN / cannbot-skills 代理文档

发布时间:2026/7/5 18:28:38

CANN / cannbot-skills 代理文档 AGENTS.md — cannbot-insight【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skillsProjectCANNBot-Insight: Session-level observability tool for LLM coding agents (opencode). Next.js 16 App Router Prisma SQLite. Chinese/English mixed UI. UI version tracked insrc/lib/version.ts(v0.31) —package.jsonversion (0.02) is not the display version.CLI Frontend (New - 2026-06)Adding a CLI frontend alongside the existing web UI. Backend remains unchanged; CLI is a pure API client.Tech StackInk 7.0.6 React 19.2.7 (ESM required:type: modulein package.json)Commander.jsfor command parsingstring-widthcli-truncatefor CJK character width handlingRun withtsx(not ts-node) due to yoga-layout top-level awaitKey Decisions (PoC Verified)No third-party Ink components— ink-table/ink-select/ink-spinner all incompatible with Ink v7Self-implement all components: DataTable, Spinner (10 lines), TextInput (30 lines)Dual render strategy: ink-testing-library for tests (has lastFrame), Ink native render for productionstdin handling:resume() setRawMode(true)before Ink render, restore on exitPagination over virtual scroll: pageSize20, n/p keys (Ink re-renders full tree anyway)CLI types useApiprefix(ApiSessionListItem) to distinguish from shared typesArchitecturesrc/cli/ ├── index.ts # Commander entry point ├── client.ts # API client (15 endpoints) ├── types.ts # Api-prefixed response types ├── errors.ts # Error hierarchy ├── config.ts # Config management ├── commands/ # CLI commands (sessions, session, turn, search, compare, stats, import, delete, config) ├── hooks/ # useApi, useKeyboard, useNavigation, useTable ├── utils/ # format, colors, table (with padEndVisual/truncateVisual) └── tui/ ├── App.tsx # Root component (stdin switching, useMemo client) ├── screens/ # SessionList, SessionDetail, TurnDetail, CompareView, ImportPanel ├── tabs/ # OverviewTab, TurnsTab, WorkflowTab, SubagentsTab, SkillsTab, BridgesTab, ContextTab └── components/ # StatusBar, KeyBar, DataTable, MetricCards, AsciiBar, TreeView, TabBar, Spinner, TextInputDev Commands (CLI)CommandNotesnpx tsx src/cli/index.ts tuiLaunch TUI mode (requires real TTY)npx tsx src/cli/index.ts sessionsList sessions (command mode)npx tsx src/cli/index.ts statsGlobal statisticsnpm run test:cliCLI tests (uses ink-testing-library)CLI ConstraintsInk v7 native render() has no lastFrame/frames/output— only ink-testing-library provides theseESM strict: Cannot use require(), must use importCJ width: Chinese characters 2 columns, use string-width for all text measurementNo PTY in tests: TUI E2E tests only run manually, CI runs component tests onlyVersion: Import from/lib/version, never hardcodeDev CommandsCommandNotes./start.shAuto port (21025), kills existing dev server via.next/dev/lockPID, runsprisma migrate devnext dev./start.sh -uSame but also runsnpm installfirstnpm run devRuns on default port 3000 — prefer./start.shinsteadnpm run buildStandardnext buildnpm run testvitest run— 187 tests (web)npm run test:cliCLI frontend testsnpm run linteslint(flat config,eslint.config.mjs) — run after edits to verifyArchitectureData Flowopencode sessions.db (external) → better-sqlite3 read → opencode-db adapter → normalize → turn-split → bridge-builder → execution-split → merge → contenteditable="false">【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skills创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

相关新闻