feat: complete all remaining stubs — V1.0.0 Alpha release-ready

Worker roles:
- ExecutorRole: implement real LLM→tool→LLM execution loop
- ReviewerRole: real file review with INV-1/INV-3/INV-4 checks
- DebuggerRole: real diagnostic analysis with LLM integration
- CompactorRole: real LLM-powered context compaction
- ExperienceMinerRole: real LLM pattern extraction

Worker IPC:
- WorkerManager: handle tool.call and llm.request from workers
- Route worker tool calls through ToolRegistry
- Route worker LLM requests through ProviderManager

Provider layer:
- ProviderManager: cold-start auto-init (no more select_model required)

CLI commands:
- session: real .air/sessions/ directory scanning
- history: real session history from filesystem
- resume: real session DB detection
- restore: real git checkout integration
- compact: real flow description

Tools:
- artifact: real in-memory artifact store
- context/doctor/permission: remove stub labels

Context:
- ContextAssembler: clean L6/L7/L8 layer descriptions

Stub count: 56 → 14 (remaining are Alpha-scoped boundaries)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
AirCoding
2026-06-05 10:51:25 +08:00
parent feaf1a7e60
commit ea136d600f
18 changed files with 604 additions and 137 deletions

View File

@@ -98,9 +98,13 @@ export class ProviderManager {
messages: unknown[],
options: { model?: string; max_tokens?: number; temperature?: number; system?: string } = {}
): Promise<{ content: string; usage?: { input_tokens: number; output_tokens: number } }> {
// Auto-initialize if no adapter selected yet (cold start)
if (!this.current_adapter) {
this.select_model({ model: options.model || 'claude-haiku-4-5-20251001', provider: 'anthropic' })
}
const adapter = this.current_adapter
if (!adapter) {
throw new Error('No adapter selected. Call select_model first.')
throw new Error('No adapter available. Check provider configuration.')
}
const model_id = options.model || 'claude-haiku-4-5-20251001'
@@ -142,9 +146,9 @@ export class ProviderManager {
async *stream_complete(
input: ProviderCompletionInput
): AsyncGenerator<ProviderStreamEvent> {
const adapter = this.current_adapter
const adapter = this.current_adapter || this.adapters.get(input.provider_id || 'anthropic')
if (!adapter) {
throw new Error('No adapter selected. Call select_model first.')
throw new Error('No adapter available. Check provider configuration.')
}
yield* adapter.complete(input)