Boost: build the wire protocol and a remote engine in packages/boost

未关闭
#64 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript

调研方向

Start with the design in issue #54, then read packages/model/src/engine.ts, packages/payments/src/wallet-ipc.ts, and the fake engine examples in packages/model/test/port.test.ts. Implement the protocol and remote engine in packages/boost with tests for codec, client, server, failures, and an in-memory end-to-end exchange. Done means those tests and the listed privacy, typecheck, lint, test, and guard checks pass, with no network API.

由索引模型根据 Issue 内容生成。

描述

agent-friendly help wanted privacy

Why

Once the protocol is decided, both sides need one tested implementation of it. ADR-010 keeps the cage on the phone, so the computer only answers model requests. Pure code, tested over an in-memory pipe, lets the phone and the desktop app be built in parallel against the same thing.

What to do

In packages/boost (new, if the pairing core hasn't created it yet), pure TypeScript, behind a small duplex byte-stream port (write bytes, receive bytes, closed), shaped like createWalletClient in packages/payments/src/wallet-ipc.ts. The steps below assume the design chose the completion level; follow the design if it chose another.

Tests first:

  1. The codec. The design's message shapes, versioned, with its size limits. Refuse malformed, oversized, unknown-version and out-of-order messages.
  2. The client. boostEngine(stream, options) implements CompletionEngine (packages/model/src/engine.ts). It sends an EngineRequest, streams onToken and onThinking, and resolves an EngineResult with the tool calls unexecuted, the stop reason (stopOf) and stats (engineStats). A stop (signal) cancels at once and rejects, as FR-LOOP-06 says.
  3. The server. serveBoost(stream, engine, options) answers requests with any CompletionEngine, refuses a capability it lacks, and never logs content.
  4. Failures. The link closes mid-stream; a timeout; a capability mismatch, such as another model SHA-256 or profile. Each ends in the outcome the design chose.
  5. End to end. Client and server over an in-memory pipe, with a fake CompletionEngine like the ones in packages/model/test/port.test.ts.

Done when

  • The tests above pass, and they were written first.
  • The gates pass, and the package uses no network API.

How to check

pnpm --filter @hermit/boost test
pnpm check:privacy && pnpm typecheck && pnpm lint && pnpm test
node scripts/guard/check.mjs --patterns scripts/guard/patterns.txt

Depends on

  • Blocked by the design in #54.

Keep in mind

  • Nothing here runs a tool call. The phone's loop and cage do (AGENTS.md rule 4).
  • Send only what the design lists. No device names, contacts, session ids or log entries.
  • Made-up chats in the tests.
  • Open a pull request only once everything under Depends on is accepted or merged, and a maintainer has said so here (AGENTS.md: code for a feature without an accepted issue may be closed).
主要语言
TypeScript
星标
11
派生
0
平均合并
10 分钟
30 天内合并 PR
6

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DojoCodingLabs/hermit 的其他 Issue

查看 DojoCodingLabs/hermit 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。