feat(aop): unify agent transport end to end#62
Merged
Conversation
Introduce core/tool (shared tool contracts) and core/node (shared web connectivity) to break cross-package dependencies: - core/tool: ToolDefinition, Result, Executor, Tool interfaces with zero project dependencies. Renamed from core/toolapi with simplified names (tool.Definition, tool.Result, tool.Executor, tool.Tool). - core/node: shared WebSocket connectivity extracted from pkg/webagent (1400→612 lines). Defines ConnectConfig + ChatHandler interface so both runner and agent connect to web via the same node.Connect(). - pkg/agent no longer imports pkg/commands (Config.Tools is now tool.Executor interface; LoopCommand accepts injected io.Writer). - pkg/commands no longer imports pkg/agent/provider (types come from core/tool via aliases; pkg/tools/* need zero changes). - cmd/runner no longer imports pkg/webagent (uses core/node directly). - core/config no longer imports pkg/webproto (FetchRemoteConfig moved to pkg/webagent where the web dependency belongs). - pkg/agent/probe no longer imports pkg/webproto (uses own ProbeConfig; pkg/web converts DistributeConfig at the boundary). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Agent Output Protocol (AOP): - New pkg/aop/ package: Go types, agent.Event→AOP conversion, JSONL writer - All event serialization paths switched to AOP v1 format - Delete pkg/agent/event_json.go (old MarshalJSON no longer needed) - Web hub forwardAgentEvent consumes AOP events directly - Harness/timeline adapted to parse AOP JSONL Chat unification: - Local viewer component forks deleted (6 files) - src/viewer/index.ts now re-exports from @cyber/viewer - All chat rendering uses upstream viewer ChatPanel with variant/slot system - aiscan-specific features (scan cards, eval badge, agent_joined) via extension registry Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Drop the webproto envelope from the stdio transport: stdin takes a single StdioRequest and stdout is raw AOP JSONL, matching the unified transport direction. Removes the now-unused aop writer and webagent pipeline, and updates web/frontend panels accordingly. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The bespoke pkg/cairnrunner protocol was a functional subset of the existing webagent/webproto protocol. cmd/runner now connects as a tool-only node through webagent.RunToolNode (no LLM provider, agent loop, or IOA dependency); cairn's server absorbs the remaining envelope differences. webproto gains ExecResult (structured exec completion) and an optional stream field on exec output messages, both additive for existing consumers. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Runs RunToolNode against a mock hub speaking the register/connected + exec + file.read dialect the cairn bridge now implements, asserting the handshake identity, streamed exec output/result envelope, base64 file reads, and tool.data call-ID correlation. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Lets the agent bound long-running commands explicitly instead of relying solely on the 300s default. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The agent core now emits AOP natively (message/message.delta parts, status+ext for eval/compact/token-budget/llm-request), replacing the private agent.Event model and every boundary converter. stdio becomes a persistent multi-session AOP host; the web hub dispatches user messages as AOP, persists complete message events only, and replays history over SSE; TUI, webagent, scan, and harness consume the raw stream. The frontend reduces AOP directly — legacy chat timeline fallbacks, ChatPayload, ResponseFormat, and the text event type are gone. Also fixes compact/eval events previously emitted without a session id, and stamps per-session seq numbers for replay dedup. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Author
|
本次改动已按统一语义方案完成收敛,核心模型为: 标识语义:
主要变化:
新增/补强的回归覆盖包括:
验证结果:
已知的 |
wuchulonly
force-pushed
the
feat/aop-single-transport
branch
from
July 24, 2026 12:41
bb07182 to
7c369ae
Compare
wuchulonly
force-pushed
the
feat/aop-single-transport
branch
from
July 24, 2026 12:45
7c369ae to
8871ea4
Compare
Exercise common scanner workflows through the real command registry with deterministic HTTP, Redis, POC, file, stdin, crawl, and passive-query fixtures. Fix zombie stdout-only runs so the upstream result channel is drained.
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
event: aopSSE framesDepends on chainreactors/cyber-ui#6.
Validation
go test ./pkg/aop ./pkg/webnpm run buildinweb/frontendGenerated web/static assets and unrelated local worktree changes are intentionally excluded.