fix: tsc 0 errors + depcruise 0 violations + all GA blockers closed

Changes (37 files, +1159/-587):
- tsconfig: moduleResolution bundler + paths alias for bun:sqlite
- bun-sqlite.ts: type shim replacing stale declare module .d.ts
- All 7 tool files: ToolDefinition alignment (version, output_schema,
  ToolPermissionSpec read_paths/write_paths, ToolCall.call_id)
- 2 adapters: ProviderAdapter implements + ProviderCapabilityMatrix shape
  (provider_kind, enabled, quality_tier, cost_tier, conversion)
- PathClassifier: 9 categories aligned (credential_store, project_air_*)
- CommandRiskAnalyzer: remove unused imports
- Recovery: Database field + scanOrphanReferences FK-off 8 invariants
- Scheduler: rebuild_from_db from session DB tasks
- ProjectionStore: 20+ event types, subscribe, rebuild from repos
- MigrationRunner: constructor accepts optional db_path
- e2e.ts: replaced hardcoded  with 14 real test/check gates
- wiring.ts: eventIngestor.ingest (durable path, INV-2)
- init.ts: ToolRegistry+PermissionEngine path (INV-3)
- TUI: local ProjectionClient (INV-4)
- MainAgent: classify_via_llm with real ProviderManager invocation
- WorkerMessage: kind/session_id/agent_id/correlation_id (contracts §10)
- WorkerProcess exit code 4 = parent_cancelled

Validation gates:
- tsc --noEmit: 0 errors
- depcruise: 0 violations (28 modules)
- tests: 169/169 pass

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
AirCoding
2026-06-04 11:43:19 +08:00
parent 223ff1bc7c
commit ea7cf427dd
37 changed files with 1182 additions and 610 deletions

View File

@@ -12,8 +12,10 @@ import type { ToolDefinition, ToolCall, ToolResultEnvelope, ISOTimeString } from
export const shell_run: ToolDefinition = {
name: 'shell.run',
category: 'execute',
category: 'shell',
description: 'Run a shell command',
version: 1,
output_schema: { type: 'object', properties: {}, required: [] },
input_schema: {
type: 'object',
properties: {
@@ -24,7 +26,7 @@ export const shell_run: ToolDefinition = {
},
required: ['command']
},
permissions: { read: false, write: false, network: true },
permissions: { network: true },
streaming: true
}
@@ -43,11 +45,9 @@ export function createShellExecutor(project_root: string) {
// Emit command.started event
yield {
call_id: call.id,
tool_name: 'shell.run',
type: 'text',
content: { event: 'command.started', command, cwd },
metadata: { timestamp, streaming: true }
status: 'ok',
output: { event: 'command.started', command, cwd },
metadata: { timestamp, streaming: true, call_id: call.call_id, tool_name: 'shell.run' }
}
// Execute command
@@ -97,10 +97,8 @@ export function createShellExecutor(project_root: string) {
// Emit command.completed event
yield {
call_id: call.id,
tool_name: 'shell.run',
type: final_code === 0 ? 'text' : 'error',
content: {
status: final_code === 0 ? 'ok' : 'error',
output: {
event: 'command.completed',
exit_code: final_code,
stdout: stdout.slice(-50000), // Last 50KB