@corbat-tech/coco 2.37.0 → 2.39.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.
@@ -0,0 +1,147 @@
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 };