declare const VERSION = "0.1.0"; type ProviderType = 'claude' | 'codex' | 'gemini'; type WorkerCapability = 'code-edit' | 'code-review' | 'security-review' | 'architecture' | 'testing' | 'documentation' | 'ui-design' | 'refactoring' | 'research' | 'general'; type TaskStatus = 'assigned' | 'in_progress' | 'completed' | 'failed'; interface TeamConfig { name: string; task: string; workerCount: number; createdAt: string; } interface WorkerConfig { name: string; role: string; provider: ProviderType; capabilities: WorkerCapability[]; } interface TaskDefinition { id: string; subject: string; description: string; status: TaskStatus; owner: string; dependsOn: string[]; } interface TaskFile { id: string; subject: string; description: string; status: TaskStatus; owner: string; dependsOn: string[]; result?: string; error?: string; createdAt: string; completedAt?: string; } interface TaskFilter { status?: TaskStatus; owner?: string; } interface UnifiedTeamMember { name: string; role: string; provider: ProviderType; capabilities: WorkerCapability[]; alive: boolean; } interface HeartbeatData { workerName: string; teamName: string; provider: ProviderType; lastPollAt: string; currentTaskId?: string; status: 'ready' | 'polling' | 'executing' | 'shutdown'; } interface OutboxMessage { type: 'task_complete' | 'task_failed' | 'heartbeat' | 'error' | 'ready' | 'idle'; taskId?: string; summary?: string; message?: string; error?: string; timestamp: string; } interface RouteResult { delivered: boolean; recipient: string; method: 'sendmessage' | 'inbox'; } declare const TeamPaths: { readonly root: (teamName: string) => string; readonly config: (teamName: string) => string; readonly tasks: (teamName: string) => string; readonly taskFile: (teamName: string, taskId: string) => string; readonly workers: (teamName: string) => string; readonly workerDir: (teamName: string, workerName: string) => string; readonly heartbeat: (teamName: string, workerName: string) => string; readonly inbox: (teamName: string, workerName: string) => string; readonly outbox: (teamName: string, workerName: string) => string; }; declare function absPath(cwd: string, relativePath: string): string; declare function teamStateRoot(cwd: string, teamName: string): string; declare function atomicWriteJson(filePath: string, data: unknown): void; declare function ensureDir(dirPath: string): void; declare function appendLine(filePath: string, line: string): void; interface ModuleBoundary { module: string; paths: string[]; change_level?: ChangeLevel; } interface ContractPolicy { allowed: string[]; forbidden: string[]; migration_required_when: string[]; } interface StateOwnershipPolicy { unchanged: string[]; allowed_new_state: string[]; forbidden: string[]; } interface AutomationProjectionPolicy { graphify?: string[]; openapi_swagger?: string[]; codegen?: string[]; } interface ArchitectureEnvelope { version: string; request_id: string; legal_layer?: { architectural?: Array<{ scope: string; enforcement: string; }>; code?: Array<{ scope: string; enforcement: string; }>; }; module_boundaries: { writable: ModuleBoundary[]; read_only: ModuleBoundary[]; forbidden: ModuleBoundary[]; }; absorption_budget: { max_parallel_slices: number; }; /** Conditions under which AI must stop and request human adjudication. */ escalation_conditions?: string[]; /** What kinds of contract changes are allowed / forbidden / require migration. */ contract_policy?: ContractPolicy; /** State ownership boundaries AI must not cross. */ state_ownership?: StateOwnershipPolicy; /** Declared usage scope for automated projection tools (graphify / openapi / codegen). Use is denied by default if not declared. */ automation_projection_policy?: AutomationProjectionPolicy; } type ChangeLevel = 'L0' | 'L1' | 'L2' | 'L3'; interface EnvelopeValidation { valid: boolean; errors: string[]; } declare function pathMatchesGlob(filePath: string, pattern: string): boolean; interface DeclaredInterface { module: string; source_glob: string; exports: string[]; } interface ArchitectureBaseline { version: string; frozen_at: string; /** * Git revision at freeze time (full 40-char SHA). Written by step-8 freeze * via `git rev-parse HEAD`. Reconcile (step-7) uses this as the interface-diff * baseline to compute per-file added/removed/changed exports. See ADR-0022. * Optional for backward compatibility — when absent, reconcile falls back * to `git rev-list --before= -1`. */ frozen_at_sha?: string; frozen_by_req: string; legal_layer?: ArchitectureEnvelope['legal_layer']; module_boundaries: { writable: ModuleBoundary[]; read_only: ModuleBoundary[]; forbidden: ModuleBoundary[]; }; declared_interfaces: DeclaredInterface[]; absorption_budget: { max_parallel_slices: number; }; } type UpgradeFlag = 'none' | 'L2-escape' | 'L3-rewrite' | 'baseline-breaking'; interface GateChange { gate_id: string; change: string; reason: string; } interface ArchitectureDelta { request_id: string; based_on_baseline: string; delta: { legal_layer?: ArchitectureEnvelope['legal_layer']; module_boundaries?: { writable?: ModuleBoundary[]; read_only?: ModuleBoundary[]; forbidden?: ModuleBoundary[]; }; declared_interfaces?: DeclaredInterface[]; absorption_budget?: { max_parallel_slices: number; }; }; 理由: string; 冲击不变量: string[]; gate_变更: GateChange[]; 升级标记: UpgradeFlag; } declare function loadBaseline(path: string): ArchitectureBaseline; declare function writeBaseline(path: string, baseline: ArchitectureBaseline): void; declare function loadDelta(path: string): ArchitectureDelta; declare function writeDelta(path: string, delta: ArchitectureDelta): void; declare function validateBaseline(baseline: ArchitectureBaseline): EnvelopeValidation; declare function validateDelta(delta: ArchitectureDelta): EnvelopeValidation; declare function mergeBaselineDelta(baseline: ArchitectureBaseline, delta: ArchitectureDelta): ArchitectureBaseline; declare function deriveEnvelope(baseline: ArchitectureBaseline, delta?: ArchitectureDelta): ArchitectureEnvelope; declare function seedBaselineFromEnvelope(envelope: ArchitectureEnvelope, reqId: string): ArchitectureBaseline; declare function freezeBaseline(baseline: ArchitectureBaseline, delta: ArchitectureDelta, frozenAt: string, frozenAtSha?: string): ArchitectureBaseline; interface InferredInterface { module: string; source_glob: string; exports: string[]; } /** * Infer the project's module→export mapping. * * Priority: TypeScript first (flat src/ tree), then Maven/Java multi-module * (pom.xml → src/main/java), then a structured scan of the project * root for common source layouts. * * Returns empty array only when no source files are found in any recognized * layout — never silently returns empty for a real project. */ declare function inferProjectGraph(projectRoot: string): Promise; /** @deprecated kept for diffInterfaces() backward compat with declared_interfaces flow. Use InterfaceFileDiff instead. */ interface InterfaceDiff { module: string; addedExports: string[]; removedExports: string[]; changedSignatures: string[]; } declare function diffInterfaces(declared: DeclaredInterface[], inferred: InferredInterface[]): InterfaceDiff[]; export { type ArchitectureBaseline, type ArchitectureDelta, type DeclaredInterface, type GateChange, type HeartbeatData, type InferredInterface, type OutboxMessage, type ProviderType, type RouteResult, type TaskDefinition, type TaskFile, type TaskFilter, type TaskStatus, type TeamConfig, TeamPaths, type UnifiedTeamMember, type UpgradeFlag, VERSION, type WorkerCapability, type WorkerConfig, absPath, appendLine, atomicWriteJson, deriveEnvelope, diffInterfaces, ensureDir, freezeBaseline, inferProjectGraph, loadBaseline, loadDelta, mergeBaselineDelta, pathMatchesGlob, seedBaselineFromEnvelope, teamStateRoot, validateBaseline, validateDelta, writeBaseline, writeDelta };