jackwener/maka-agent

refactor(runtime): extract computer-use wire codec and contract types from computer-use-tools.ts

已关闭

#1,405 创建于 2026年7月23日

 (2 条评论) (0 个反应) (1 位负责人)TypeScript (0 个派生)github user discovery
enhancementgood first issue

仓库指标

星标
 (1 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Part of #1084 (second-pass sink-file and boundary governance). Scope re-verified against current main (computer-use-tools.ts, 1836 lines).

Scope

  • Extract the wire-protocol codec into computer-use-codec.ts, mirroring the existing openai-computer-codec.ts pattern: the computerParams zod discriminated union (~L230+), snapshotComputerParams (~L469), adaptToCuAction (~L496), and summarize (~L590) if its call surface allows.
  • Move the contract types into computer-use-types.ts so adapters stop importing the implementation file: CuRunResult, CuDispatchBackend, CuDispatchOutcome, CuDispatchEvidence, CuScreenshot, CuObservation, CuSemanticAction, CuRunContext, and the overlay hooks.
  • buildComputerUseTools stays in computer-use-tools.ts.

Invariants

Same as #1084: behavior-neutral; keep @maka/runtime public exports stable via re-exports; no reverse imports from new leaf files; flat PR off main.

Verification

Typecheck/build + existing computer-use tests.

贡献者指南