TokenDanceCode is a local command-line Coding Agent / harness for personal developers. This worktree is the Rust rewrite branch. Keep the scope narrow and explicit: it is not a cloud platform, IDE plugin, marketplace, persistent team-agent system, or AgentHub replacement.
- GitHub:
TokenDanceLab/TokenDanceCode - Public packages:
@tokendance/code-core,@tokendance/code-sdk,@tokendance/code-cli - Command:
tokendance - Runtime: Rust 1.95+ for active code; Node.js/pnpm remains only for npm wrapper and legacy TS contract checks.
- Package manager: Cargo first, pnpm 10+ for npm packaging scripts.
- Primary shell target: Windows PowerShell
- This repository is independent from the TokenDance workspace root. Check and commit status inside this repository.
- Use repository-local
.worktrees/for isolated work. Do not create sibling worktrees outside the repo. - Do not commit generated state:
.env,.tokendance/,.worktrees/, virtualenvs, build outputs, caches, logs, or local transcripts. - Keep public docs secret-free. Use placeholder keys such as
your-api-key; never include real provider keys, local account details, private server paths, or production logs. - If the root worktree is behind
origin/master, do not treat missing files there as lost progress. Inspectorigin/masteror create a clean worktree from it first. - Use
rg/rg --filesfor repository search and file discovery. Fall back only whenrgcannot answer the query. - Parallel work should use repo-local worktrees and scoped ownership. Do not let two workers edit the same module family unless the coordinator explicitly owns the merge.
TokenDanceCode focuses on:
- interactive terminal Coding Agent sessions;
- local repository reading, editing, shell execution, diff/review, task/todo, transcript, memory, resume, subagent, and worktree workflows;
- provider-neutral runtime architecture with OpenAI Responses, OpenAI Chat Completions / TokenDance Gateway, and Anthropic-compatible Messages support;
- AgentHub-consumable SDK facade, event mapping, remote approval bridge, and package manifest metadata.
Do not describe TokenDanceCode as:
- a hosted service;
- a team collaboration product;
- an AgentHub replacement;
- an IDE plugin;
- a marketplace or plugin platform;
- a production SaaS product with billing, accounts, dashboard, or cloud sync.
README.mdis the public entry point: positioning, install, model configuration, commands, project structure, current maturity, and docs map.docs/产品功能需求文档.mdowns product requirements and non-goals.docs/架构设计文档.mdowns runtime boundaries and data flow.docs/开发流程文档.mdowns the current TypeScript development loop.docs/端到端验收清单.mdowns manual acceptance checks.docs/并行推进计划.mdowns maintainer workstream planning and the next candidate queue.docs/并行执行状态.mdis a public progress log with user-visible changes, merge commits, and verification summaries. Do not add agent IDs, private paths, token-bearing commands, or local operator runbooks.- If behavior changes, update the smallest complete set of README plus the owning docs in the same pass.
- Active branch:
codex/rust-rewrite. - Release candidate branch:
release/npm-first. - Current public status: Rust rewrite scaffold is not release-ready. Do not publish npm or GitHub releases until Rust release gates are implemented and verified.
- Current AgentHub contract target: SDK manifest
agenthub-sdk.v1,agent.streamschema version2, and terminal failure frames viarun.agent.resultwithsuccess=false. - Current privacy boundary: project root
.envis ignored and not loaded by default; examples must point users to controlled shell env, SDKenv, or user-global~/.tokendance/.env.
Use docs/rust-rewrite-architecture.md before launching broad workers. Current highest-value slices are:
- core runtime parity: session, transcript, context builder, compact, hooks;
- provider parity: OpenAI Responses, OpenAI-compatible Gateway, Anthropic-compatible Messages;
- CLI parity: command registry,
run --json,--stream-json, doctor/config/gateway/auth/session/transcript/quality; - SDK parity: AgentHub event mapping, approval bridge, OIDC helper, same-session guard;
- npm release wrapper and privacy scan.
Use these from the repository root after code or docs changes:
cargo fmt --all -- --check
cargo test --workspace
cargo run -p tokendance-cli -- --version
cargo run -p tokendance-cli -- doctor --json
pnpm verifynpm publish --tag next is a separate manual release-owner action after version, package contents, dist-tag, npm login, and license intent are reviewed. Do not put publish into verification scripts.