chenchenandClaude Opus 4.7 a1529f18c1 feat(manager): wire UI to mcp-server contract instead of local controllers
After reading the Heicode-接口契约文档 v2.2 in
~/Desktop/taijigit/taiji-AI-PAD/Docs/ the right data sources are clear:

  §1 /api/auth/*           — already wired (features/auth/api.ts)
  §4 /api/user/heicode/*   — model balance + usage + logs
  §5 /api/agnet/*          — Agnet platform stub (deployments / audit / etc)
  §6 /api/user/tasks/*     — HeicodeTask intent → followups → card

The first wave UI work (commit 2df233b) used Heicode-local controllers
as the data source (AgnetDeployment.orchestration_plan as a stand-in
for the task object). That was wrong — the contract document is clear
that HeicodeTask (§6) is the canonical user-facing task object, and the
mcp-server stub at §5 is the canonical deployment source.

This commit redirects the data plumbing without touching the UI shells:

1. New lib/heicode-mcp.ts — typed client that calls mcp-server through
   the existing same-origin /api/heicode-auth/* proxy. Implements the
   subset of §4/§5/§6 the Manager UI needs:
     createTaskFromIntent / listHeicodeTasks / getHeicodeTask / answer
     getHeicodeBalance / getHeicodeModels / getHeicodeUsage / getHeicodeLogs
     listMcpAgnetDeployments / listMcpAuditLogs

2. HomeHero (features/dashboard/components/home-hero.tsx):
   - Idea input now POSTs /api/user/tasks/intent and routes the user
     to /tasks/$id once the server returns the new task with its first
     round of follow-ups. Previously it only stashed the idea in
     localStorage which the docs §10 didn't actually require.
   - ContinueTasks + TodayFocus now consume listHeicodeTasks output
     (HeicodeTask.status / status_caption / updated_at:ms) instead of
     AgnetDeployment shape.

3. TaskCardView (features/tasks/task-card-view.tsx):
   - Reads getHeicodeTask(id) from mcp-server (refetch every 15s).
   - When status=configuring renders the open follow-ups from the most
     recent heicode thread entry as clickable option chips; clicking
     POSTs answer to /api/user/tasks/$id/answer and the server-side
     state machine advances. high-risk options get a red badge per §6.
   - When status=running (followups answered, card materialised) the
     four blocks docs §10 任务卡 mandates are rendered from task.card:
     目标 / 第一版范围 / 自动生成 / 待确认上下文.

4. AgnetAuditPage (features/agnet-console/pages.tsx):
   - Switched queryFn from local getAgnetAuditLogs to mcp-server
     listMcpAuditLogs. The redacted-card renderer already accepts any
     {resource_id, allowed_actions, constraints, secret_ref} shape so
     no UI change needed; banner still announces no plaintext.

Notes:
- /wallet refactor to §4 deferred — it pulls multiple legacy series
  from the local NewAPI controllers and the rewrite is a separate
  pass. Manager users see local data for now; the call is identical
  shape so swap is mechanical once we get there.
- Local TS check clean. Not deployed.
- Earlier 2df233b's UI structures (HomeHero shape, TaskCard layout,
  recommendation dialog, audit redacted view) stay verbatim — only
  the data fetching layer moved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 13:33:01 +08:00
2026-05-05 20:44:24 +08:00

Heicode

Heicode 面向多人协作、可追溯交付的软件团队:把需求对齐、实现、验证、发布和持续运营连成一条少断层的链路,并用可编排的智能体角色承接其中可标准化的环节——强调「能复盘、能审计、能按团队规模裁剪」,而不是罗列某一家的工具栈。

下面的目录表仅供工程查阅;不代表对外产品承诺、路线图或你必须采用的集成方式。

这个仓库里有什么(工程布局)

目录 大致含义
cc-haha/ Heicode(终端与桌面客户端及本地服务;此为源码目录名)。
heicode/ Heicode Manager(网关与管理控制台服务端;此为源码目录名)。
website/ 产品介绍站点(Next.js;可 pnpm dev 或 Docker 预览)。
docs/ 愿景与范式;docs/milestones/ 交付里程碑;docs/integration/ Agnet 等平台接口设计。

产品在解决什么问题

  • 协作范式:把瀑布 / 敏捷下的角色分工落到可复述的闸门与智能体承接边界(方向与原则见 docs/vision-heicode-full-stack-agentic-dev.md;编队明细在文档附录)。
  • 交付可追溯:文档、沟通与变更尽量与版本、发布对齐,便于复盘与合规。
  • 工程上:同一仓库便于客户端与服务端同步发版、统一回归,减少「谁和谁版本对不上」的摩擦。

详细愿景与范式

docs/vision-heicode-full-stack-agentic-dev.md

快速启动(开发联调)

# 根依赖(Bun monorepo 根目录)
bun install

# Heicode 客户端本地服务(目录 cc-haha)
cd cc-haha
bun run src/server/index.ts

# 另开终端:桌面端
cd cc-haha/desktop
bun run tauri dev

联调网关时示例:

HEICODE_TAIJIAICLOUD_BASE_URL=http://localhost:3000 bun run src/server/index.ts

Heicode Manager(heicode/)中与 Heicode 登录相关的路由(最小集,以实际代码为准):

  • GET /heicode/oauth/authorize
  • GET /heicode/oauth/session

平台侧能力还包括模型发现(如 GET /v1/models)与 Anthropic Messages 兼容入口等,详见 Heicode Manager(heicode/)与 Heicode 客户端(cc-haha/)各自 README。

官网(Next.js)

cd website && pnpm install && pnpm dev

若根目录提供 docker compose,可按 compose 说明构建预览镜像(以仓库内 docker-compose.yml 为准)。

发版与回归建议

  • 同一版本标签发布客户端与网关镜像。
  • 每次发版至少回归:登录、模型拉取、对话请求。
  • 先在本地 Docker / 本地联调通过,再做外网域名与证书。

相关外部参考(概念)

  • oh-my-claudecode — Claude Code 类工具的高效实践参考。
  • Agnet 平台以实际部署环境与文档为准。

许可证

各子项目许可证见各子目录内 LICENSE(例如 Heicode Manager / heicode/ 侧常见为 AGPLv3)。

S
Description
No description provided
Readme
163 MiB
Languages
TypeScript 89.6%
Go 8.9%
HTML 0.8%
Python 0.2%
Shell 0.2%