feat(aircoding): AirCoding V2 baseline — deterministic multi-agent architecture

Forked from OpenCode v1.17.4 with multi-agent system:
- 5 agents: aircoding, scheduler, worker, architect, reviewer
- Deterministic DAG scheduling engine (coordinator_tick)
- Tool whitelists as hard enforcement
- AirCoding validation plugin
- System prompt injection for routing
- V1 requirements: C4 docs, ADR, AGENTS.md, debug-log.md
- Design documents in docs/
This commit is contained in:
airlongdian
2026-06-13 21:41:54 +08:00
commit af3016fe27
5757 changed files with 1170017 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import { GlobalBus, type GlobalEvent } from "@/bus/global"
import { Cause, Effect } from "effect"
export function waitGlobalBusEvent(input: {
timeout?: number
message?: string
predicate: (event: GlobalEvent) => boolean
}) {
return Effect.callback<GlobalEvent, unknown>((resume) => {
const cleanup = () => GlobalBus.off("event", handler)
const handler = (event: GlobalEvent) => {
try {
if (!input.predicate(event)) return
cleanup()
resume(Effect.succeed(event))
} catch (error) {
cleanup()
resume(Effect.fail(error))
}
}
GlobalBus.on("event", handler)
return Effect.sync(cleanup)
}).pipe(
Effect.timeout(input.timeout ?? 10_000),
Effect.mapError((error) =>
Cause.isTimeoutError(error) ? new Error(input.message ?? "timed out waiting for global bus event") : error,
),
)
}