@corbat-tech/coco 2.36.0 → 2.38.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,113 @@
1
+ import { V as RuntimeTurnRunner, T as RuntimeTurnInput, Q as RuntimeTurnContext, U as RuntimeTurnResult, E as EventLog, G as RuntimeEventType, F as RuntimeEvent, t as AgentRuntime, x as PermissionPolicy, H as RuntimeMode, w as PermissionDecision, K as RuntimeSessionStore, J as RuntimeSessionCreateOptions, I as RuntimeSession } from './agent-runtime-DeLcB0Ie.js';
2
+ import { Server } from 'node:http';
3
+ import { a as ToolDefinition } from './registry-CEpl9Jq0.js';
4
+
5
+ declare class DefaultRuntimeTurnRunner implements RuntimeTurnRunner {
6
+ run(input: RuntimeTurnInput, context: RuntimeTurnContext): Promise<RuntimeTurnResult>;
7
+ }
8
+ declare function createDefaultRuntimeTurnRunner(): RuntimeTurnRunner;
9
+
10
+ interface ToolCallingRuntimeTurnRunnerOptions {
11
+ maxToolIterations?: number;
12
+ }
13
+ /**
14
+ * Runtime turn runner that executes provider-requested tools through the
15
+ * reusable runtime permission and event pipeline.
16
+ */
17
+ declare class ToolCallingRuntimeTurnRunner implements RuntimeTurnRunner {
18
+ private readonly maxToolIterations;
19
+ constructor(options?: ToolCallingRuntimeTurnRunnerOptions);
20
+ run(input: RuntimeTurnInput, context: RuntimeTurnContext): Promise<RuntimeTurnResult>;
21
+ }
22
+ declare function createToolCallingRuntimeTurnRunner(options?: ToolCallingRuntimeTurnRunnerOptions): RuntimeTurnRunner;
23
+
24
+ declare class InMemoryEventLog implements EventLog {
25
+ private events;
26
+ record(type: RuntimeEventType, data?: Record<string, unknown>): RuntimeEvent;
27
+ list(): RuntimeEvent[];
28
+ count(): number;
29
+ clear(): void;
30
+ }
31
+ declare class FileEventLog implements EventLog {
32
+ private readonly filePath;
33
+ private memory;
34
+ private writable;
35
+ constructor(filePath: string);
36
+ record(type: RuntimeEventType, data?: Record<string, unknown>): RuntimeEvent;
37
+ list(): RuntimeEvent[];
38
+ count(): number;
39
+ clear(): void;
40
+ }
41
+ declare function createEventLog(): EventLog;
42
+ declare function createFileEventLog(filePath: string): EventLog;
43
+
44
+ interface RuntimeHttpServerOptions {
45
+ maxBodyBytes?: number;
46
+ }
47
+ declare function createRuntimeHttpServer(runtime: AgentRuntime, options?: RuntimeHttpServerOptions): Server;
48
+
49
+ declare class DefaultPermissionPolicy implements PermissionPolicy {
50
+ canExecuteTool(mode: RuntimeMode, tool: ToolDefinition): PermissionDecision;
51
+ canExecuteToolInput(mode: RuntimeMode, tool: ToolDefinition, input: Record<string, unknown>): PermissionDecision;
52
+ }
53
+ declare function createPermissionPolicy(): PermissionPolicy;
54
+
55
+ declare class InMemoryRuntimeSessionStore implements RuntimeSessionStore {
56
+ private sessions;
57
+ create(options?: RuntimeSessionCreateOptions): RuntimeSession;
58
+ get(id: string): RuntimeSession | undefined;
59
+ update(session: RuntimeSession): RuntimeSession;
60
+ list(): RuntimeSession[];
61
+ delete(id: string): boolean;
62
+ }
63
+ declare class FileRuntimeSessionStore implements RuntimeSessionStore {
64
+ private readonly filePath;
65
+ private sessions;
66
+ constructor(filePath: string);
67
+ create(options?: RuntimeSessionCreateOptions): RuntimeSession;
68
+ get(id: string): RuntimeSession | undefined;
69
+ update(session: RuntimeSession): RuntimeSession;
70
+ list(): RuntimeSession[];
71
+ delete(id: string): boolean;
72
+ private readSessionsFromDisk;
73
+ private persist;
74
+ }
75
+ declare function createRuntimeSessionStore(): RuntimeSessionStore;
76
+ declare function createFileRuntimeSessionStore(filePath: string): RuntimeSessionStore;
77
+
78
+ type ExtensionRisk = "read-only" | "write" | "network" | "destructive" | "secrets-sensitive";
79
+ type AgentSurface = "coco" | "claude" | "codex" | "gemini" | "opencode";
80
+ interface SkillManifest {
81
+ name: string;
82
+ description: string;
83
+ triggers: string[];
84
+ requiredTools: string[];
85
+ risk: ExtensionRisk;
86
+ compatibleAgents: AgentSurface[];
87
+ sourcePath?: string;
88
+ }
89
+ interface RecipeStep {
90
+ id: string;
91
+ description: string;
92
+ requiredTools?: string[];
93
+ check?: string;
94
+ }
95
+ interface RecipeManifest {
96
+ name: string;
97
+ description: string;
98
+ inputs: string[];
99
+ suggestedModels?: string[];
100
+ steps: RecipeStep[];
101
+ checks: string[];
102
+ risk: ExtensionRisk;
103
+ }
104
+ interface McpToolPolicy {
105
+ server: string;
106
+ tool: string;
107
+ risk: ExtensionRisk;
108
+ requiresConfirmation: boolean;
109
+ allowedModes: string[];
110
+ }
111
+ declare function createMcpToolPolicy(server: string, tool: string, risk: ExtensionRisk, allowedModes?: string[]): McpToolPolicy;
112
+
113
+ export { type AgentSurface 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, DefaultRuntimeTurnRunner as a, FileRuntimeSessionStore as b, InMemoryRuntimeSessionStore as c, type RecipeStep as d, type RuntimeHttpServerOptions as e, type ToolCallingRuntimeTurnRunnerOptions as f, createDefaultRuntimeTurnRunner as g, createEventLog as h, createFileEventLog as i, createFileRuntimeSessionStore as j, createMcpToolPolicy as k, createPermissionPolicy as l, createRuntimeHttpServer as m, createRuntimeSessionStore as n, createToolCallingRuntimeTurnRunner as o };