opencode-agentic-engine 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +499 -0
  3. package/dist/agents/agent-runtime.d.ts +51 -0
  4. package/dist/agents/agent-runtime.d.ts.map +1 -0
  5. package/dist/agents/coordinator.d.ts +84 -0
  6. package/dist/agents/coordinator.d.ts.map +1 -0
  7. package/dist/agents/orchestrator.d.ts +56 -0
  8. package/dist/agents/orchestrator.d.ts.map +1 -0
  9. package/dist/agents/role-registry.d.ts +71 -0
  10. package/dist/agents/role-registry.d.ts.map +1 -0
  11. package/dist/core/agent-loop.d.ts +39 -0
  12. package/dist/core/agent-loop.d.ts.map +1 -0
  13. package/dist/core/config.d.ts +76 -0
  14. package/dist/core/config.d.ts.map +1 -0
  15. package/dist/core/error-analyzer.d.ts +37 -0
  16. package/dist/core/error-analyzer.d.ts.map +1 -0
  17. package/dist/core/executor.d.ts +73 -0
  18. package/dist/core/executor.d.ts.map +1 -0
  19. package/dist/core/git.d.ts +38 -0
  20. package/dist/core/git.d.ts.map +1 -0
  21. package/dist/core/intent-parser.d.ts +26 -0
  22. package/dist/core/intent-parser.d.ts.map +1 -0
  23. package/dist/core/llm.d.ts +90 -0
  24. package/dist/core/llm.d.ts.map +1 -0
  25. package/dist/core/model-registry.d.ts +65 -0
  26. package/dist/core/model-registry.d.ts.map +1 -0
  27. package/dist/core/navigator.d.ts +28 -0
  28. package/dist/core/navigator.d.ts.map +1 -0
  29. package/dist/core/parallel.d.ts +63 -0
  30. package/dist/core/parallel.d.ts.map +1 -0
  31. package/dist/core/planner.d.ts +19 -0
  32. package/dist/core/planner.d.ts.map +1 -0
  33. package/dist/core/task-classifier.d.ts +24 -0
  34. package/dist/core/task-classifier.d.ts.map +1 -0
  35. package/dist/core/tech-debt-scorer.d.ts +20 -0
  36. package/dist/core/tech-debt-scorer.d.ts.map +1 -0
  37. package/dist/core/verifier.d.ts +43 -0
  38. package/dist/core/verifier.d.ts.map +1 -0
  39. package/dist/drift/checkpoints.d.ts +23 -0
  40. package/dist/drift/checkpoints.d.ts.map +1 -0
  41. package/dist/drift/context-compressor.d.ts +28 -0
  42. package/dist/drift/context-compressor.d.ts.map +1 -0
  43. package/dist/drift/dependency-tracker.d.ts +75 -0
  44. package/dist/drift/dependency-tracker.d.ts.map +1 -0
  45. package/dist/drift/hallucination-guard.d.ts +25 -0
  46. package/dist/drift/hallucination-guard.d.ts.map +1 -0
  47. package/dist/drift/pattern-discovery.d.ts +138 -0
  48. package/dist/drift/pattern-discovery.d.ts.map +1 -0
  49. package/dist/evaluation/live-evaluator.d.ts +71 -0
  50. package/dist/evaluation/live-evaluator.d.ts.map +1 -0
  51. package/dist/evolution/continuous-evolution.d.ts +92 -0
  52. package/dist/evolution/continuous-evolution.d.ts.map +1 -0
  53. package/dist/evolution/self-evolver.d.ts +85 -0
  54. package/dist/evolution/self-evolver.d.ts.map +1 -0
  55. package/dist/index.d.ts +16 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +22069 -0
  58. package/dist/index.js.map +7 -0
  59. package/dist/memory/episodic-store.d.ts +40 -0
  60. package/dist/memory/episodic-store.d.ts.map +1 -0
  61. package/dist/memory/local-embedder.d.ts +17 -0
  62. package/dist/memory/local-embedder.d.ts.map +1 -0
  63. package/dist/memory/persistence.d.ts +17 -0
  64. package/dist/memory/persistence.d.ts.map +1 -0
  65. package/dist/memory/schema-version.d.ts +29 -0
  66. package/dist/memory/schema-version.d.ts.map +1 -0
  67. package/dist/memory/session-store.d.ts +50 -0
  68. package/dist/memory/session-store.d.ts.map +1 -0
  69. package/dist/memory/skill-format.d.ts +51 -0
  70. package/dist/memory/skill-format.d.ts.map +1 -0
  71. package/dist/memory/skill-store.d.ts +30 -0
  72. package/dist/memory/skill-store.d.ts.map +1 -0
  73. package/dist/memory/skill-training.d.ts +37 -0
  74. package/dist/memory/skill-training.d.ts.map +1 -0
  75. package/dist/memory/vector-store.d.ts +67 -0
  76. package/dist/memory/vector-store.d.ts.map +1 -0
  77. package/dist/observability/dashboard.d.ts +34 -0
  78. package/dist/observability/dashboard.d.ts.map +1 -0
  79. package/dist/observability/trace-logger.d.ts +27 -0
  80. package/dist/observability/trace-logger.d.ts.map +1 -0
  81. package/package.json +57 -0
@@ -0,0 +1,28 @@
1
+ export interface ModuleInfo {
2
+ path: string;
3
+ name: string;
4
+ ext: string;
5
+ size: number;
6
+ exports: string[];
7
+ imports: string[];
8
+ }
9
+ export interface ProjectIndex {
10
+ root: string;
11
+ modules: ModuleInfo[];
12
+ language: "typescript" | "javascript" | "python" | "unknown";
13
+ hasTests: boolean;
14
+ testDir: string | null;
15
+ srcDir: string | null;
16
+ }
17
+ export declare class CodebaseNavigator {
18
+ private index;
19
+ scan(root: string): Promise<ProjectIndex>;
20
+ findRelevantFiles(taskDescription: string, maxFiles?: number): string[];
21
+ getTestFiles(sourceFile: string): string[];
22
+ getSummary(): string;
23
+ private groupByDir;
24
+ private findDir;
25
+ private walk;
26
+ private detectLanguage;
27
+ }
28
+ //# sourceMappingURL=navigator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigator.d.ts","sourceRoot":"","sources":["../../src/core/navigator.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,QAAQ,EAAE,YAAY,GAAG,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAA;IAC5D,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,KAAK,CAA4B;IAEnC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAiB/C,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,SAAK,GAAG,MAAM,EAAE;IAgCnE,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE;IAoB1C,UAAU,IAAI,MAAM;IAgBpB,OAAO,CAAC,UAAU;YASJ,OAAO;YAWP,IAAI;IA4ClB,OAAO,CAAC,cAAc;CAQvB"}
@@ -0,0 +1,63 @@
1
+ import type { Subtask } from "./intent-parser.js";
2
+ import type { LLMEngine } from "./llm.js";
3
+ export interface ParallelPlan {
4
+ phases: Phase[];
5
+ maxParallelism: number;
6
+ }
7
+ export interface Phase {
8
+ index: number;
9
+ steps: Subtask[];
10
+ canRunInParallel: boolean;
11
+ }
12
+ export interface ParallelExecutionResult {
13
+ stepId: string;
14
+ success: boolean;
15
+ output?: string;
16
+ error?: string;
17
+ filesModified: string[];
18
+ }
19
+ export type StepRunner = (step: Subtask) => Promise<ParallelExecutionResult>;
20
+ export interface LLMStepRunnerOptions {
21
+ llmEngine: LLMEngine;
22
+ projectDir: string;
23
+ planGoal: string;
24
+ sessionId: string;
25
+ opencodePath?: string;
26
+ verbose?: boolean;
27
+ }
28
+ export interface ConcurrentExecutionReport {
29
+ phaseResults: Array<{
30
+ phaseIndex: number;
31
+ steps: Array<{
32
+ id: string;
33
+ description: string;
34
+ }>;
35
+ results: ParallelExecutionResult[];
36
+ }>;
37
+ totalSteps: number;
38
+ completedSteps: number;
39
+ failedSteps: number;
40
+ totalDurationMs: number;
41
+ summary: string;
42
+ }
43
+ export declare class ParallelExecutor {
44
+ analyzeParallelism(subtasks: Subtask[]): ParallelPlan;
45
+ executePhase(phase: Phase, runner: StepRunner, abortOnFailure?: boolean): Promise<ParallelExecutionResult[]>;
46
+ executeAll(plan: ParallelPlan, runner: StepRunner, abortOnFailure?: boolean): Promise<ParallelExecutionResult[]>;
47
+ suggestParallelTasks(subtasks: Subtask[], currentlyCompleted: string[]): {
48
+ taskId: string;
49
+ parallelGroup: number;
50
+ }[];
51
+ detectConflicts(parallelTasks: string[], modifiedFiles: Map<string, string[]>): Array<{
52
+ taskA: string;
53
+ taskB: string;
54
+ conflictingFile: string;
55
+ }>;
56
+ llmStepRunner(opts: LLMStepRunnerOptions): StepRunner;
57
+ executePlanConcurrently(plan: ParallelPlan, stepRunner: StepRunner, abortOnFailure?: boolean): Promise<{
58
+ results: ParallelExecutionResult[];
59
+ durationMs: number;
60
+ }>;
61
+ executeWithSubprocessSpawn(step: Subtask, opencodePath: string, projectDir: string, sessionId: string): Promise<ParallelExecutionResult>;
62
+ }
63
+ //# sourceMappingURL=parallel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallel.d.ts","sourceRoot":"","sources":["../../src/core/parallel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAKzC,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB;AAED,MAAM,MAAM,UAAU,GAAG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E,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,CAAC;IAuBhJ,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,UAAU;IAuC/C,uBAAuB,CAC3B,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,UAAU,EACtB,cAAc,UAAQ,GACrB,OAAO,CAAC;QAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAMhE,0BAA0B,CAC9B,IAAI,EAAE,OAAO,EACb,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,uBAAuB,CAAC;CAoCpC"}
@@ -0,0 +1,19 @@
1
+ import type { TaskIntent, Subtask } from "./intent-parser.js";
2
+ import type { LLMEngine } from "./llm.js";
3
+ export interface DecompositionRule {
4
+ pattern: RegExp | string;
5
+ keywords: string[];
6
+ template: (context: string) => Subtask[];
7
+ }
8
+ export declare class Planner {
9
+ private rules;
10
+ decompose(goal: string, relevantFiles: string[]): {
11
+ intent: TaskIntent;
12
+ autoGenerated: boolean;
13
+ };
14
+ registerRule(rule: DecompositionRule): void;
15
+ getRules(): DecompositionRule[];
16
+ decomposeWithLLM(llm: LLMEngine, goal: string, codebaseSummary: string): Promise<TaskIntent>;
17
+ suggestSubtask(id: string, description: string, dependsOn?: string[]): Subtask;
18
+ }
19
+ //# sourceMappingURL=planner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../src/core/planner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,EAAE,CAAA;CACzC;AAED,qBAAa,OAAO;IAClB,OAAO,CAAC,KAAK,CAoGZ;IAED,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG;QAAE,MAAM,EAAE,UAAU,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE;IAwBhG,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI;IAI3C,QAAQ,IAAI,iBAAiB,EAAE;IAIzB,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAmBlG,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAM,EAAO,GAAG,OAAO;CAGnF"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Task Type Classifier
3
+ *
4
+ * Automatically detects task type from description for capability-aware model selection.
5
+ */
6
+ export declare enum TaskType {
7
+ CODING = "coding",
8
+ REASONING = "reasoning",
9
+ TESTING = "testing",
10
+ DOCUMENTATION = "documentation",
11
+ DEBUGGING = "debugging"
12
+ }
13
+ /**
14
+ * Detect task type from description using keyword matching.
15
+ *
16
+ * @param description Task description or action text
17
+ * @returns Detected task type (defaults to CODING if no match)
18
+ */
19
+ export declare function detectTaskType(description: string): TaskType;
20
+ /**
21
+ * Get human-readable label for task type.
22
+ */
23
+ export declare function getTaskTypeLabel(type: TaskType): string;
24
+ //# sourceMappingURL=task-classifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-classifier.d.ts","sourceRoot":"","sources":["../../src/core/task-classifier.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,oBAAY,QAAQ;IAClB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,SAAS,cAAc;CACxB;AA8BD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAc5D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CASvD"}
@@ -0,0 +1,20 @@
1
+ export interface DebtScore {
2
+ overall: "low" | "medium" | "high" | "critical";
3
+ breakdown: DebtCategory[];
4
+ totalIssues: number;
5
+ suggestion: string;
6
+ }
7
+ export interface DebtCategory {
8
+ category: string;
9
+ score: number;
10
+ issues: string[];
11
+ }
12
+ export declare class TechDebtScorer {
13
+ score(planGoal: string, filesChanged: string[], fileContents: Map<string, string>): DebtScore;
14
+ private analyzeCoupling;
15
+ private analyzeSize;
16
+ private analyzeScope;
17
+ private analyzePatterns;
18
+ private generateSuggestion;
19
+ }
20
+ //# sourceMappingURL=tech-debt-scorer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tech-debt-scorer.d.ts","sourceRoot":"","sources":["../../src/core/tech-debt-scorer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAA;IAC/C,SAAS,EAAE,YAAY,EAAE,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,qBAAa,cAAc;IACzB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS;IAmC7F,OAAO,CAAC,eAAe;IAoBvB,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,eAAe;IAsBvB,OAAO,CAAC,kBAAkB;CAM3B"}
@@ -0,0 +1,43 @@
1
+ import type { LLMEngine } from "./llm.js";
2
+ export type SupportedLanguage = "typescript" | "python" | "go" | "rust" | "javascript" | "unknown";
3
+ export interface VerificationResult {
4
+ passed: boolean;
5
+ stepId: string;
6
+ checks: CheckResult[];
7
+ errors: string[];
8
+ }
9
+ export interface CheckResult {
10
+ name: string;
11
+ passed: boolean;
12
+ output: string;
13
+ }
14
+ export interface LanguageConfig {
15
+ compileCmd: (projectDir: string) => {
16
+ bin: string;
17
+ args: string[];
18
+ timeout: number;
19
+ };
20
+ testCmd: (projectDir: string, testPattern?: string) => {
21
+ bin: string;
22
+ args: string[];
23
+ timeout: number;
24
+ };
25
+ fileExts: string[];
26
+ testFileExts: string[];
27
+ }
28
+ export declare class Verifier {
29
+ private detectedLang;
30
+ private llm;
31
+ setLLM(llm: LLMEngine): void;
32
+ hasLLM(): boolean;
33
+ verifySemantic(stepId: string, intent: string, changedFiles: string[], projectDir: string): Promise<CheckResult>;
34
+ verifyAllDeep(stepId: string, projectDir: string, intent?: string, changedFiles?: string[], requireSemanticCheck?: boolean): Promise<VerificationResult>;
35
+ detectLanguage(projectDir: string): SupportedLanguage;
36
+ getLanguage(): SupportedLanguage;
37
+ verifyCompile(projectDir: string): CheckResult;
38
+ verifyTests(projectDir: string, testPattern?: string): CheckResult;
39
+ verifyLint(projectDir: string): CheckResult;
40
+ verifyAll(stepId: string, projectDir: string): VerificationResult;
41
+ verifyRelated(stepId: string, projectDir: string, changedFiles: string[]): VerificationResult;
42
+ }
43
+ //# sourceMappingURL=verifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../../src/core/verifier.ts"],"names":[],"mappings":"AA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,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE,oBAAoB,UAAQ,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAwB5J,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB;IA0BrD,WAAW,IAAI,iBAAiB;IAIhC,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW;IA2B9C,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,SAAK,GAAG,WAAW;IA2B9D,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW;IAiC3C,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,kBAAkB;IAqBjE,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,kBAAkB;CA4D9F"}
@@ -0,0 +1,23 @@
1
+ export interface Checkpoint {
2
+ id: string;
3
+ type: "warning" | "review" | "block";
4
+ description: string;
5
+ context: string;
6
+ timestamp: string;
7
+ acknowledged: boolean;
8
+ }
9
+ export declare class CheckpointSystem {
10
+ private checkpoints;
11
+ private blockEnforcement;
12
+ enableBlockEnforcement(enabled: boolean): void;
13
+ isBlocked(): {
14
+ blocked: boolean;
15
+ reason?: string;
16
+ };
17
+ evaluate(stepId: string, action: string, filesModified: string[]): Checkpoint[];
18
+ acknowledge(stepId: string, checkpointId: string): boolean;
19
+ acknowledgeAll(stepId: string): number;
20
+ getUnacknowledged(): Checkpoint[];
21
+ hasBlockers(): boolean;
22
+ }
23
+ //# sourceMappingURL=checkpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoints.d.ts","sourceRoot":"","sources":["../../src/drift/checkpoints.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;IACpC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,OAAO,CAAA;CACtB;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,gBAAgB,CAAO;IAE/B,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAI9C,SAAS,IAAI;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IAalD,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE;IAoG/E,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO;IAW1D,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAatC,iBAAiB,IAAI,UAAU,EAAE;IAQjC,WAAW,IAAI,OAAO;CAGvB"}
@@ -0,0 +1,28 @@
1
+ import type { LLMEngine } from "../core/llm.js";
2
+ export interface ContextSummary {
3
+ planSummary: string;
4
+ decisions: string[];
5
+ fileChanges: string[];
6
+ invariants: string[];
7
+ openItems: string[];
8
+ estimatedTokens: number;
9
+ }
10
+ export declare class ContextCompressor {
11
+ private windowSize;
12
+ private summaryInterval;
13
+ private llm;
14
+ setLLM(llm: LLMEngine): void;
15
+ compress(planSummary: string, turns: Array<{
16
+ role: string;
17
+ content: string;
18
+ }>, decisions: string[], fileChanges: string[]): ContextSummary;
19
+ compressWithLLM(planGoal: string, turns: Array<{
20
+ role: string;
21
+ content: string;
22
+ }>, decisions: string[], fileChanges: string[]): Promise<ContextSummary>;
23
+ shouldCompress(turnCount: number, currentTokensEstimate: number, maxTokens?: number): boolean;
24
+ compressToPrompt(summary: ContextSummary): string;
25
+ private extractKeyInfo;
26
+ private estimateTokens;
27
+ }
28
+ //# sourceMappingURL=context-compressor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-compressor.d.ts","sourceRoot":"","sources":["../../src/drift/context-compressor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAAI;IACtB,OAAO,CAAC,eAAe,CAAI;IAC3B,OAAO,CAAC,GAAG,CAAyB;IAEpC,MAAM,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI;IAI5B,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,cAAc;IAsBpI,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC;IAsB7J,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,SAAS,SAAU,GAAG,OAAO;IAI9F,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM;IA4BjD,OAAO,CAAC,cAAc;IAuCtB,OAAO,CAAC,cAAc;CAIvB"}
@@ -0,0 +1,75 @@
1
+ export interface FileChange {
2
+ file: string;
3
+ stepId: string;
4
+ changeType: "create" | "modify" | "delete";
5
+ timestamp: number;
6
+ }
7
+ export interface DependencyEdge {
8
+ from: string;
9
+ to: string;
10
+ relation: "imports" | "extends" | "type-ref";
11
+ }
12
+ export interface PropagationAnalysis {
13
+ likelyCulprit: string | null;
14
+ affectedSteps: string[];
15
+ propagationPath: string[];
16
+ suggestion: string;
17
+ rootCauseConfidence: number;
18
+ }
19
+ export interface ImpactAnalysis {
20
+ file: string;
21
+ impactedFiles: string[];
22
+ impactedSteps: string[];
23
+ risk: "low" | "medium" | "high";
24
+ }
25
+ export declare class DependencyTracker {
26
+ private fileChanges;
27
+ private dependencies;
28
+ private stepFiles;
29
+ private fileGraph;
30
+ /**
31
+ * Parse import/require statements from file content.
32
+ * Supports: import x from "y", import { x } from "y", import * as x from "y",
33
+ * const x = require("y"), dynamic import(), re-exports.
34
+ */
35
+ parseImports(content: string): string[];
36
+ /**
37
+ * Resolve a relative import specifier to possible filesystem paths.
38
+ */
39
+ resolveImportPath(sourceFile: string, specifier: string): string[];
40
+ /**
41
+ * Scan a batch of files and build the file-level dependency graph.
42
+ * Only processes relative imports (local files), skips npm packages.
43
+ *
44
+ * @param files Record<absoluteFilePath, fileContent>
45
+ * @param projectDir Project root for computing relative paths
46
+ */
47
+ scanFiles(files: Record<string, string>, projectDir: string): void;
48
+ /**
49
+ * Get files that directly import the given file (via file-level graph).
50
+ */
51
+ getFileDependents(filePath: string): string[];
52
+ /**
53
+ * Incrementally update the file graph for a single file (e.g., after creation/modification).
54
+ * Re-parses imports and replaces the entry in the graph.
55
+ */
56
+ updateFile(absPath: string, content: string, projectDir: string): void;
57
+ /**
58
+ * Get files that a given file directly imports (via file-level graph).
59
+ */
60
+ getFileImports(filePath: string): string[];
61
+ /**
62
+ * Traverse transitive dependents (A imports B imports C → change C impacts A).
63
+ */
64
+ private getTransitiveDependents;
65
+ recordChange(sessionId: string, stepId: string, files: string[]): void;
66
+ addDependency(from: string, to: string, relation: DependencyEdge["relation"]): void;
67
+ getDependencies(module: string): DependencyEdge[];
68
+ getDependents(module: string): DependencyEdge[];
69
+ analyzeImpact(sessionId: string, changedFiles: string[]): ImpactAnalysis[];
70
+ getFilesChangedByStep(sessionId: string, stepId: string): string[];
71
+ getFilesChangedByPreviousSteps(sessionId: string, currentStepId: string, planSteps: string[]): string[];
72
+ analyzeErrorPropagation(sessionId: string, failingStepId: string, error: string, planSteps: string[]): PropagationAnalysis;
73
+ clear(sessionId?: string): void;
74
+ }
75
+ //# sourceMappingURL=dependency-tracker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependency-tracker.d.ts","sourceRoot":"","sources":["../../src/drift/dependency-tracker.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAC1C,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;CAC7C;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,mBAAmB,EAAE,MAAM,CAAA;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;CAChC;AAED,qBAA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AC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAevG,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,mBAAmB;IA6F1H,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;CAWhC"}
@@ -0,0 +1,25 @@
1
+ export interface HallucinationCheck {
2
+ passed: boolean;
3
+ claims: ClaimResult[];
4
+ summary: string;
5
+ }
6
+ export interface ClaimResult {
7
+ claim: string;
8
+ type: "file_exists" | "function_exists" | "import_valid" | "api_signature";
9
+ verified: boolean;
10
+ actual?: string;
11
+ expected?: string;
12
+ }
13
+ export declare class HallucinationGuard {
14
+ private worktree;
15
+ constructor(worktree: string);
16
+ check(executionOutput: string, modifiedFiles: string[]): HallucinationCheck;
17
+ private resolveSafe;
18
+ private extractFileClaims;
19
+ private extractFunctionClaims;
20
+ private extractImportClaims;
21
+ private extractApiSignatureClaims;
22
+ private verifyApiSignature;
23
+ private functionExists;
24
+ }
25
+ //# sourceMappingURL=hallucination-guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hallucination-guard.d.ts","sourceRoot":"","sources":["../../src/drift/hallucination-guard.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,aAAa,GAAG,iBAAiB,GAAG,cAAc,GAAG,eAAe,CAAA;IAC1E,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAQ;gBAEZ,QAAQ,EAAE,MAAM;IAI5B,KAAK,CAAC,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAmE3E,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,yBAAyB;IAkBjC,OAAO,CAAC,kBAAkB;IAoC1B,OAAO,CAAC,cAAc;CAavB"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * PatternDiscovery — cross-session pattern analysis for self-evolving agents.
3
+ *
4
+ * Analyzes episodic memory, error history, file changes, and skill usage
5
+ * across sessions to identify recurring issues, systemic improvements,
6
+ * and actionable recommendations.
7
+ *
8
+ * Aligns with the paper's vision of agents that learn from collective
9
+ * experience rather than operating in isolation.
10
+ */
11
+ import type { Episode } from "../memory/episodic-store.js";
12
+ import type { StepResult } from "../evolution/continuous-evolution.js";
13
+ export interface ErrorPattern {
14
+ /** Error category (compile, type, import, test, runtime) */
15
+ category: string;
16
+ /** Number of distinct sessions where this error occurred */
17
+ sessionCount: number;
18
+ /** Total occurrences across all sessions */
19
+ totalOccurrences: number;
20
+ /** Percentage of sessions that experienced this error */
21
+ sessionAffinity: number;
22
+ /** Most recent occurrence timestamp */
23
+ lastOccurrence: string;
24
+ /** Actionable suggestion */
25
+ suggestion: string;
26
+ /** Example session IDs */
27
+ sampleSessions: string[];
28
+ }
29
+ export interface FilePattern {
30
+ /** File path (relative) */
31
+ filePath: string;
32
+ /** Number of sessions where this file was modified */
33
+ sessionCount: number;
34
+ /** Total modifications across sessions */
35
+ totalChanges: number;
36
+ /** Files frequently changed together with this one (co-change frequency) */
37
+ coChangedFiles: Array<{
38
+ filePath: string;
39
+ coOccurrences: number;
40
+ }>;
41
+ /** Whether this file is a "hot spot" (frequently changed, high risk) */
42
+ isHotSpot: boolean;
43
+ /** Suggestion */
44
+ suggestion: string;
45
+ }
46
+ export interface SessionOutcomePattern {
47
+ /** Description of the pattern */
48
+ description: string;
49
+ /** Outcome statistics for sessions matching this pattern */
50
+ outcomeStats: {
51
+ total: number;
52
+ success: number;
53
+ partial: number;
54
+ failed: number;
55
+ };
56
+ /** Number of sessions matching */
57
+ matchingSessions: number;
58
+ /** Success rate among matching sessions */
59
+ successRate: number;
60
+ /** Tags or characteristics common to these sessions */
61
+ commonTags: string[];
62
+ /** Trend over time */
63
+ trend: "improving" | "degrading" | "stable";
64
+ /** Actionable insight */
65
+ insight: string;
66
+ }
67
+ export interface SkillEffectiveness {
68
+ /** Skill name */
69
+ skillName: string;
70
+ /** Current success rate (0-1) */
71
+ successRate: number;
72
+ /** Usage count */
73
+ usageCount: number;
74
+ /** Success rate trend: recent 5 vs overall */
75
+ recentTrend: "improving" | "degrading" | "stable" | "insufficient_data";
76
+ /** Whether this skill should be reviewed or promoted */
77
+ status: "healthy" | "needs_review" | "underperforming" | "highly_effective";
78
+ /** Suggestion */
79
+ suggestion: string;
80
+ }
81
+ export interface Recommendation {
82
+ /** Priority level */
83
+ priority: "high" | "medium" | "low";
84
+ /** Category of recommendation */
85
+ category: "error_prevention" | "architecture" | "testing" | "process" | "skill" | "infrastructure";
86
+ /** Human-readable description */
87
+ description: string;
88
+ /** Concrete action to take */
89
+ action: string;
90
+ /** Number of sessions affected by this issue */
91
+ affectedSessions: number;
92
+ }
93
+ export interface PatternReport {
94
+ /** When the analysis was generated */
95
+ timestamp: string;
96
+ /** Number of sessions analyzed */
97
+ totalSessions: number;
98
+ /** Error patterns found */
99
+ errorPatterns: ErrorPattern[];
100
+ /** File change patterns found */
101
+ filePatterns: FilePattern[];
102
+ /** Session outcome patterns found */
103
+ sessionPatterns: SessionOutcomePattern[];
104
+ /** Skill effectiveness analysis */
105
+ skillEffectiveness: SkillEffectiveness[];
106
+ /** Actionable recommendations */
107
+ recommendations: Recommendation[];
108
+ }
109
+ export declare class PatternDiscovery {
110
+ /**
111
+ * Generate a comprehensive pattern report from session data.
112
+ *
113
+ * @param episodes All recorded episodes (cross-session memory)
114
+ * @param stepResults Step execution results (from ContinuousEvolution)
115
+ * @param skills Known skills with usage stats
116
+ * @param options Analysis options
117
+ */
118
+ analyze(episodes: Episode[], stepResults?: StepResult[], skills?: Array<{
119
+ name: string;
120
+ successRate: number;
121
+ usageCount: number;
122
+ }>, options?: {
123
+ minSessions?: number;
124
+ hotSpotThreshold?: number;
125
+ }): PatternReport;
126
+ private analyzeErrors;
127
+ private analyzeFiles;
128
+ private analyzeSessionOutcomes;
129
+ private analyzeSkills;
130
+ private generateRecommendations;
131
+ private inferCategory;
132
+ private suggestErrorFix;
133
+ private suggestFileAction;
134
+ private countOutcomes;
135
+ private groupByTags;
136
+ private computeTrend;
137
+ }
138
+ //# sourceMappingURL=pattern-discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pattern-discovery.d.ts","sourceRoot":"","sources":["../../src/drift/pattern-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AAItE,MAAM,WAAW,YAAY;IAC3B,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAA;IAChB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,gBAAgB,EAAE,MAAM,CAAA;IACxB,yDAAyD;IACzD,eAAe,EAAE,MAAM,CAAA;IACvB,uCAAuC;IACvC,cAAc,EAAE,MAAM,CAAA;IACtB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,0BAA0B;IAC1B,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,sDAAsD;IACtD,YA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iBAAiB;IAWzB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,YAAY;CAerB"}
@@ -0,0 +1,71 @@
1
+ export interface LiveEvalDimension {
2
+ score: number;
3
+ weight: number;
4
+ target: number;
5
+ detail: string;
6
+ }
7
+ export interface LiveEvalScore {
8
+ overall: number;
9
+ dimensions: Record<string, LiveEvalDimension>;
10
+ totalSteps: number;
11
+ totalErrors: number;
12
+ recoveredErrors: number;
13
+ totalDelegations: number;
14
+ successfulDelegations: number;
15
+ /**
16
+ * SWE-bench-style: berapa % task yang success dari total
17
+ * EvoClaw-style: composite weighted score
18
+ */
19
+ sweBenchScore: number;
20
+ evoClawScore: number;
21
+ }
22
+ export declare class LiveEvaluator {
23
+ private stepResults;
24
+ private errorRecoveries;
25
+ private navigations;
26
+ private delegations;
27
+ private skillLookups;
28
+ feedStepResult(step: {
29
+ stepId: string;
30
+ success: boolean;
31
+ sessionId?: string;
32
+ }): void;
33
+ feedErrorRecovery(errorId: string, recovered: boolean): void;
34
+ feedNavigation(query: string, resultsCount: number): void;
35
+ feedDelegation(taskId: string, role: string, success: boolean): void;
36
+ feedSkillLookup(found: boolean): void;
37
+ /**
38
+ * Task success rate (SWE-bench style).
39
+ * Berapa % step yang sukses dari total.
40
+ */
41
+ computeTaskSuccess(): number;
42
+ /**
43
+ * Error recovery rate.
44
+ * Berapa % error yang berhasil pulih (retry sukses setelah error).
45
+ */
46
+ computeErrorRecovery(): number;
47
+ /**
48
+ * Context stability score.
49
+ * Navigasi yang fokus (≤10 results) mengindikasikan pemahaman codebase yang baik.
50
+ */
51
+ computeContextStability(): number;
52
+ /**
53
+ * Multi-agent coordination rate.
54
+ * Berapa % delegasi yang sukses.
55
+ */
56
+ computeMultiAgent(): number;
57
+ /**
58
+ * Skill reuse rate.
59
+ * Berapa % lookup skill yang berhasil ditemukan.
60
+ */
61
+ computeSkillReuse(): number;
62
+ /**
63
+ * Compute overall live evaluation score.
64
+ */
65
+ computeScore(): LiveEvalScore;
66
+ /**
67
+ * Generate human-readable report.
68
+ */
69
+ formatReport(includeTips?: boolean): string;
70
+ }
71
+ //# sourceMappingURL=live-evaluator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live-evaluator.d.ts","sourceRoot":"","sources":["../../src/evaluation/live-evaluator.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IAC7C,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,qBAAqB,EAAE,MAAM,CAAA;IAC7B;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,WAAW,CAAsE;IACzF,OAAO,CAAC,eAAe,CAAqD;IAC5E,OAAO,CAAC,WAAW,CAAuE;IAC1F,OAAO,CAAC,WAAW,CAAgE;IACnF,OAAO,CAAC,YAAY,CAAgC;IAIpD,cAAc,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAIpF,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI;IAI5D,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAIzD,cAAc,CAAC,MAAM,EAAE,MAAM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