@corbat-tech/coco 2.39.0 → 2.41.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corbat-tech/coco",
3
- "version": "2.39.0",
3
+ "version": "2.41.0",
4
4
  "description": "Autonomous Coding Agent with Self-Review, Quality Convergence, and Production-Ready Output",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,147 +0,0 @@
1
- import { R as EventLog, $ as AgentTask, g as AgentCapability, O as AgentTraceContext, al as ToolRiskManifest, G as AgentRunResult, ab as RuntimeTurnRunner, a9 as RuntimeTurnInput, a8 as RuntimeTurnContext, aa as RuntimeTurnResult, a1 as RuntimeEventType, a0 as RuntimeEvent, I as AgentRuntime, X as PermissionPolicy, a2 as RuntimeMode, W as PermissionDecision, a5 as RuntimeSessionStore, a4 as RuntimeSessionCreateOptions, a3 as RuntimeSession } from './agent-runtime-DJY9FzL_.js';
2
- import { Server } from 'node:http';
3
- import { a as ToolDefinition } from './registry-CEpl9Jq0.js';
4
-
5
- interface AgentRunnerExecutionInput {
6
- task: AgentTask;
7
- capability: AgentCapability;
8
- trace?: AgentTraceContext;
9
- toolRiskManifest?: ToolRiskManifest;
10
- }
11
- interface AgentRunnerExecutionContext {
12
- task: AgentTask;
13
- capability: AgentCapability;
14
- trace: AgentTraceContext;
15
- assertToolAllowed(toolName: string): void;
16
- }
17
- type AgentRunnerExecutor = (context: AgentRunnerExecutionContext) => Promise<AgentRunnerRawResult>;
18
- interface AgentRunnerRawResult {
19
- output: string;
20
- success?: boolean;
21
- turns?: number;
22
- toolsUsed?: string[];
23
- inputTokens?: number;
24
- outputTokens?: number;
25
- error?: string;
26
- metadata?: Record<string, unknown>;
27
- }
28
- interface AgentRunnerOptions {
29
- eventLog?: EventLog;
30
- executor?: AgentRunnerExecutor;
31
- }
32
- declare class AgentRunner {
33
- private readonly options;
34
- constructor(options?: AgentRunnerOptions);
35
- run(input: AgentRunnerExecutionInput): Promise<AgentRunResult>;
36
- }
37
- declare function createAgentRunner(options?: AgentRunnerOptions): AgentRunner;
38
-
39
- declare class DefaultRuntimeTurnRunner implements RuntimeTurnRunner {
40
- run(input: RuntimeTurnInput, context: RuntimeTurnContext): Promise<RuntimeTurnResult>;
41
- }
42
- declare function createDefaultRuntimeTurnRunner(): RuntimeTurnRunner;
43
-
44
- interface ToolCallingRuntimeTurnRunnerOptions {
45
- maxToolIterations?: number;
46
- }
47
- /**
48
- * Runtime turn runner that executes provider-requested tools through the
49
- * reusable runtime permission and event pipeline.
50
- */
51
- declare class ToolCallingRuntimeTurnRunner implements RuntimeTurnRunner {
52
- private readonly maxToolIterations;
53
- constructor(options?: ToolCallingRuntimeTurnRunnerOptions);
54
- run(input: RuntimeTurnInput, context: RuntimeTurnContext): Promise<RuntimeTurnResult>;
55
- }
56
- declare function createToolCallingRuntimeTurnRunner(options?: ToolCallingRuntimeTurnRunnerOptions): RuntimeTurnRunner;
57
-
58
- declare class InMemoryEventLog implements EventLog {
59
- private events;
60
- record(type: RuntimeEventType, data?: Record<string, unknown>): RuntimeEvent;
61
- list(): RuntimeEvent[];
62
- count(): number;
63
- clear(): void;
64
- }
65
- declare class FileEventLog implements EventLog {
66
- private readonly filePath;
67
- private memory;
68
- private writable;
69
- constructor(filePath: string);
70
- record(type: RuntimeEventType, data?: Record<string, unknown>): RuntimeEvent;
71
- list(): RuntimeEvent[];
72
- count(): number;
73
- clear(): void;
74
- }
75
- declare function createEventLog(): EventLog;
76
- declare function createFileEventLog(filePath: string): EventLog;
77
-
78
- interface RuntimeHttpServerOptions {
79
- maxBodyBytes?: number;
80
- }
81
- declare function createRuntimeHttpServer(runtime: AgentRuntime, options?: RuntimeHttpServerOptions): Server;
82
-
83
- declare class DefaultPermissionPolicy implements PermissionPolicy {
84
- canExecuteTool(mode: RuntimeMode, tool: ToolDefinition): PermissionDecision;
85
- canExecuteToolInput(mode: RuntimeMode, tool: ToolDefinition, input: Record<string, unknown>): PermissionDecision;
86
- }
87
- declare function createPermissionPolicy(): PermissionPolicy;
88
-
89
- declare class InMemoryRuntimeSessionStore implements RuntimeSessionStore {
90
- private sessions;
91
- create(options?: RuntimeSessionCreateOptions): RuntimeSession;
92
- get(id: string): RuntimeSession | undefined;
93
- update(session: RuntimeSession): RuntimeSession;
94
- list(): RuntimeSession[];
95
- delete(id: string): boolean;
96
- }
97
- declare class FileRuntimeSessionStore implements RuntimeSessionStore {
98
- private readonly filePath;
99
- private sessions;
100
- constructor(filePath: string);
101
- create(options?: RuntimeSessionCreateOptions): RuntimeSession;
102
- get(id: string): RuntimeSession | undefined;
103
- update(session: RuntimeSession): RuntimeSession;
104
- list(): RuntimeSession[];
105
- delete(id: string): boolean;
106
- private readSessionsFromDisk;
107
- private persist;
108
- }
109
- declare function createRuntimeSessionStore(): RuntimeSessionStore;
110
- declare function createFileRuntimeSessionStore(filePath: string): RuntimeSessionStore;
111
-
112
- type ExtensionRisk = "read-only" | "write" | "network" | "destructive" | "secrets-sensitive";
113
- type AgentSurface = "coco" | "claude" | "codex" | "gemini" | "opencode";
114
- interface SkillManifest {
115
- name: string;
116
- description: string;
117
- triggers: string[];
118
- requiredTools: string[];
119
- risk: ExtensionRisk;
120
- compatibleAgents: AgentSurface[];
121
- sourcePath?: string;
122
- }
123
- interface RecipeStep {
124
- id: string;
125
- description: string;
126
- requiredTools?: string[];
127
- check?: string;
128
- }
129
- interface RecipeManifest {
130
- name: string;
131
- description: string;
132
- inputs: string[];
133
- suggestedModels?: string[];
134
- steps: RecipeStep[];
135
- checks: string[];
136
- risk: ExtensionRisk;
137
- }
138
- interface McpToolPolicy {
139
- server: string;
140
- tool: string;
141
- risk: ExtensionRisk;
142
- requiresConfirmation: boolean;
143
- allowedModes: string[];
144
- }
145
- declare function createMcpToolPolicy(server: string, tool: string, risk: ExtensionRisk, allowedModes?: string[]): McpToolPolicy;
146
-
147
- export { AgentRunner as A, DefaultPermissionPolicy as D, type ExtensionRisk as E, FileEventLog as F, InMemoryEventLog as I, type McpToolPolicy as M, type RecipeManifest as R, type SkillManifest as S, ToolCallingRuntimeTurnRunner as T, type AgentRunnerExecutionContext as a, type AgentRunnerExecutionInput as b, type AgentRunnerExecutor as c, type AgentRunnerOptions as d, type AgentRunnerRawResult as e, type AgentSurface as f, DefaultRuntimeTurnRunner as g, FileRuntimeSessionStore as h, InMemoryRuntimeSessionStore as i, type RecipeStep as j, type RuntimeHttpServerOptions as k, type ToolCallingRuntimeTurnRunnerOptions as l, createAgentRunner as m, createDefaultRuntimeTurnRunner as n, createEventLog as o, createFileEventLog as p, createFileRuntimeSessionStore as q, createMcpToolPolicy as r, createPermissionPolicy as s, createRuntimeHttpServer as t, createRuntimeSessionStore as u, createToolCallingRuntimeTurnRunner as v };
@@ -1,31 +0,0 @@
1
- interface RetrievedSource {
2
- id: string;
3
- title: string;
4
- content: string;
5
- url?: string;
6
- score: number;
7
- metadata?: Record<string, unknown>;
8
- }
9
- interface RetrievalOptions {
10
- limit?: number;
11
- minScore?: number;
12
- }
13
- interface KnowledgeRetriever {
14
- search(query: string, options?: RetrievalOptions): Promise<RetrievedSource[]>;
15
- }
16
- interface InMemoryKnowledgeDocument {
17
- id: string;
18
- title: string;
19
- content: string;
20
- url?: string;
21
- metadata?: Record<string, unknown>;
22
- }
23
- declare class InMemoryKnowledgeRetriever implements KnowledgeRetriever {
24
- private readonly documents;
25
- constructor(documents: InMemoryKnowledgeDocument[]);
26
- search(query: string, options?: RetrievalOptions): Promise<RetrievedSource[]>;
27
- }
28
- declare function createInMemoryKnowledgeRetriever(documents: InMemoryKnowledgeDocument[]): KnowledgeRetriever;
29
- declare function formatRetrievedSourcesForPrompt(sources: RetrievedSource[]): string;
30
-
31
- export { type InMemoryKnowledgeDocument as I, type KnowledgeRetriever as K, type RetrievalOptions as R, InMemoryKnowledgeRetriever as a, type RetrievedSource as b, createInMemoryKnowledgeRetriever as c, formatRetrievedSourcesForPrompt as f };
@@ -1,115 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- /**
4
- * Tool Registry for Corbat-Coco
5
- * Central management of all available tools
6
- */
7
-
8
- /**
9
- * Tool definition
10
- */
11
- interface ToolDefinition<TInput = unknown, TOutput = unknown> {
12
- name: string;
13
- description: string;
14
- category: ToolCategory;
15
- parameters: z.ZodType<TInput, any, any>;
16
- execute: (params: TInput) => Promise<TOutput>;
17
- }
18
- /**
19
- * Tool categories
20
- */
21
- type ToolCategory = "file" | "bash" | "git" | "test" | "quality" | "build" | "deploy" | "config" | "web" | "search" | "memory" | "document";
22
- /**
23
- * Tool execution result
24
- */
25
- interface ToolResult<T = unknown> {
26
- success: boolean;
27
- data?: T;
28
- error?: string;
29
- duration: number;
30
- }
31
- /**
32
- * Progress callback for long-running operations
33
- */
34
- type ProgressCallback = (progress: ProgressInfo) => void;
35
- /**
36
- * Progress information
37
- */
38
- interface ProgressInfo {
39
- /** Current step or phase name */
40
- phase: string;
41
- /** Progress percentage (0-100), null if indeterminate */
42
- percent: number | null;
43
- /** Human-readable message */
44
- message?: string;
45
- /** Estimated time remaining in ms, null if unknown */
46
- estimatedTimeRemaining?: number | null;
47
- /** Additional metadata */
48
- metadata?: Record<string, unknown>;
49
- }
50
- /**
51
- * Options for tool execution
52
- */
53
- interface ExecuteOptions {
54
- /** Progress callback for long operations */
55
- onProgress?: ProgressCallback;
56
- /** Abort signal for cancellation */
57
- signal?: AbortSignal;
58
- }
59
- /**
60
- * Tool registry
61
- */
62
- declare class ToolRegistry {
63
- private tools;
64
- private logger;
65
- /**
66
- * Register a tool
67
- */
68
- register<TInput, TOutput>(tool: ToolDefinition<TInput, TOutput>): void;
69
- /**
70
- * Unregister a tool
71
- */
72
- unregister(name: string): boolean;
73
- /**
74
- * Get a tool by name
75
- */
76
- get<TInput = unknown, TOutput = unknown>(name: string): ToolDefinition<TInput, TOutput> | undefined;
77
- /**
78
- * Check if a tool exists
79
- */
80
- has(name: string): boolean;
81
- /**
82
- * Get all tools
83
- */
84
- getAll(): ToolDefinition[];
85
- /**
86
- * Get tools by category
87
- */
88
- getByCategory(category: ToolCategory): ToolDefinition[];
89
- /**
90
- * Execute a tool
91
- */
92
- execute<TInput, TOutput>(name: string, params: TInput, options?: ExecuteOptions): Promise<ToolResult<TOutput>>;
93
- /**
94
- * Get tool definitions for LLM (simplified format)
95
- */
96
- getToolDefinitionsForLLM(): Array<{
97
- name: string;
98
- description: string;
99
- input_schema: Record<string, unknown>;
100
- }>;
101
- }
102
- /**
103
- * Get the global tool registry
104
- */
105
- declare function getToolRegistry(): ToolRegistry;
106
- /**
107
- * Create a new tool registry
108
- */
109
- declare function createToolRegistry(): ToolRegistry;
110
- /**
111
- * Helper to create a tool definition with type safety
112
- */
113
- declare function defineTool<TInput, TOutput>(definition: ToolDefinition<TInput, TOutput>): ToolDefinition<TInput, TOutput>;
114
-
115
- export { ToolRegistry as T, type ToolDefinition as a, type ToolCategory as b, createToolRegistry as c, type ToolResult as d, defineTool as e, getToolRegistry as g };