You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(runtime): extract computer-use wire codec and contract types from computer-use-tools.ts #1405
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.
My plan is: split computer-use-tools.ts along the seam the issue describes — computer-use-types.ts (the 13 Cu* contract types + overlay hooks, pure leaf), computer-use-codec.ts (the computerParams zod union + snapshotComputerParams + adaptToCuAction + summarize and its helpers, depending only on types), and retain buildComputerUseTools in computer-use-tools.ts.
A few implementation notes: computerParams and summarize are currently module-private — they'll become exports on the codec so buildComputerUseTools can import them back. The shared coordinate/text zod helpers move with computerParams to the codec; computerWireParams (stays in tools) imports them back (one-way). summarizeEvidence is also called directly at L907 inside buildComputerUseTools, so it'll be exported from the codec too. index.ts re-exports will point at the new locations so @maka/runtime's public surface is unchanged, and openai-computer-loop.ts keeps working via tools.ts re-exports. Behavior-neutral; verifying with typecheck/build + the existing computer-use test suite.
Activity
chinawch007 commentedon Jul 25, 2026
I'd like to claim this task.
My plan is: split computer-use-tools.ts along the seam the issue describes — computer-use-types.ts (the 13 Cu* contract types + overlay hooks, pure leaf), computer-use-codec.ts (the computerParams zod union + snapshotComputerParams + adaptToCuAction + summarize and its helpers, depending only on types), and retain buildComputerUseTools in computer-use-tools.ts.
A few implementation notes: computerParams and summarize are currently module-private — they'll become exports on the codec so buildComputerUseTools can import them back. The shared coordinate/text zod helpers move with computerParams to the codec; computerWireParams (stays in tools) imports them back (one-way). summarizeEvidence is also called directly at L907 inside buildComputerUseTools, so it'll be exported from the codec too. index.ts re-exports will point at the new locations so @maka/runtime's public surface is unchanged, and openai-computer-loop.ts keeps working via tools.ts re-exports. Behavior-neutral; verifying with typecheck/build + the existing computer-use test suite.
chinawch007 commentedon Jul 26, 2026
Implemented in PR #1507 : split
computer-use-tools.tsintocomputer-use-types.ts(13 pure contract types, zero-dep leaf) +computer-use-codec.ts(computerParamszod union,adaptToCuAction,summarize, mirroring theopenai-computer-codec.tspattern) + retainedbuildComputerUseToolsin tools.ts. Behavior-neutral;@maka/runtimepublic surface unchanged via re-exports. Verified with typecheck/build + 2554 runtime tests (0 fail).refactor(runtime): extract computer-use wire codec and contract types (…
refactor(runtime): extract computer-use wire codec and contract types (…
Astro-Han commentedon Aug 2, 2026
Extracted in #1507. computer-use-codec.ts and the contract types are on main, and @maka/runtime keeps its public exports through re-export.