当前位置: 首页 > news >正文

CANN / cannbot-skills 代理文档

AGENTS.md — cannbot-insight

【免费下载链接】cannbot-skillsCANNBot 是面向 CANN 开发的用于提升开发效率的系列智能体,本仓库为其提供可复用的 Skills 模块。项目地址: https://gitcode.com/cann/cannbot-skills

Project

CANNBot-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 Stack

  • Ink 7.0.6+ React 19.2.7 (ESM required:"type": "module"in package.json)
  • Commander.jsfor command parsing
  • string-width+cli-truncatefor CJK character width handling
  • Run withtsx(not ts-node) due to yoga-layout top-level await

Key Decisions (PoC Verified)

  • No third-party Ink components— ink-table/ink-select/ink-spinner all incompatible with Ink v7
  • Self-implement all components: DataTable, Spinner (10 lines), TextInput (30 lines)
  • Dual render strategy: ink-testing-library for tests (has lastFrame), Ink native render for production
  • stdin handling:resume() + setRawMode(true)before Ink render, restore on exit
  • Pagination over virtual scroll: pageSize=20, n/p keys (Ink re-renders full tree anyway)
  • CLI types useApiprefix(ApiSessionListItem) to distinguish from shared types

Architecture

src/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, TextInput

Dev Commands (CLI)

CommandNotes
npx 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 statistics
npm run test:cliCLI tests (uses ink-testing-library)

CLI Constraints

  • Ink v7 native render() has no lastFrame/frames/output— only ink-testing-library provides these
  • ESM strict: Cannot use require(), must use import
  • CJ width: Chinese characters = 2 columns, use string-width for all text measurement
  • No PTY in tests: TUI E2E tests only run manually, CI runs component tests only
  • Version: Import from@/lib/version, never hardcode

Dev Commands

CommandNotes
./start.shAuto port (21025+), kills existing dev server via.next/dev/lockPID, runsprisma migrate dev+next dev
./start.sh -uSame but also runsnpm installfirst
npm run devRuns on default port 3000 — prefer./start.shinstead
npm run buildStandardnext build
npm run testvitest run— 187 tests (web)
npm run test:cliCLI frontend tests
npm run linteslint(flat config,eslint.config.mjs) — run after edits to verify

Architecture

Data Flow

opencode 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),仅供参考

http://www.jsqmd.com/news/1129846/

相关文章:

  • activerecord-multi-tenant 终极指南:如何在 Rails 应用中轻松实现多租户架构
  • 初学者指南:在Linux系统上运行MiniMax-M3-NVFP4的5个关键步骤
  • WavTap开发者指南:深入了解音频捕获的实现原理
  • CANN/asc-devkit:设置L1 3D格式Feature矩阵
  • 计算机视觉实战:使用SageMaker Studio Lab训练图像分类模型的完整指南
  • FineTuningLLMs部署实战:GGUF格式转换与本地服务完整教程
  • SageMaker Studio Lab环境配置终极教程:Conda环境创建与管理详解
  • CANN/ops-math掩码缩放算子
  • 天赐范式第94天:从断裂到新技术的“内燃机“——TDP-CP与DRR-R方法论边界规范
  • 换手机数据迁移太麻烦?这款iPhone、安卓和平板电脑互传工具,一键搞定不丢数据!
  • Halcon函数封装实战:从工业视觉流程到可复用算子库
  • Subliminal:终极iOS集成测试框架完整指南
  • JMeter阶梯线程组实战:精准模拟真实业务负载模型
  • Twitter API Client认证详解:OAuth 1.0与OAuth 2.0完整实现指南
  • 从入门到精通:vb-android-app-quality项目的多渠道构建与测试策略
  • RESPX安全测试:使用模拟库进行API安全测试的实践方法
  • Opslane最佳实践:10个技巧提升AI并行开发效率
  • 如何快速上手Subliminal:10分钟搭建iOS自动化测试环境
  • Riffusion音乐API对接实战:低成本高效生成AI音乐
  • CANN CLI前端评审决策
  • CANN/asc-devkit SIMD uint16转uint32函数
  • CANN/cann-recipes-infer:Qwen3-MoE优化
  • Vue-Croppa跨浏览器兼容性:确保在所有设备上正常工作
  • pysimdjson实战:大数据JSON处理的5个技巧
  • CSM社区精选:玩家分享的最佳多人城市建设案例
  • R语言array详解:多维数据结构与向量化运算基础
  • 终极WebPShop指南:如何在Photoshop中实现专业级WebP图像压缩与动画制作
  • Weather Extension for Andromeda
  • CANN社区任务-SpSM算子开发
  • 5 分钟上手 Swift Protobuf:最新官方仓库使用教程