@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,76 @@
1
+ import { T as ToolRegistry } from './registry-CEpl9Jq0.js';
2
+ import { b as RetrievedSource, K as KnowledgeRetriever } from './rag-BakFRE-u.js';
3
+
4
+ interface SupportDraftInput {
5
+ conversationId: string;
6
+ customerMessage: string;
7
+ retrievedSources?: RetrievedSource[];
8
+ }
9
+ interface SupportDraftOutput {
10
+ draft: string;
11
+ citations: string[];
12
+ needsHumanReview: boolean;
13
+ }
14
+ interface HumanEscalationInput {
15
+ conversationId: string;
16
+ summary: string;
17
+ priority: "low" | "normal" | "high" | "urgent";
18
+ reason: string;
19
+ }
20
+ interface HumanEscalationOutput {
21
+ queued: boolean;
22
+ escalationId: string;
23
+ message: string;
24
+ }
25
+ interface SalesLeadSummaryInput {
26
+ conversationId: string;
27
+ company?: string;
28
+ contact?: string;
29
+ problem: string;
30
+ desiredOutcome?: string;
31
+ urgency?: "low" | "normal" | "high";
32
+ budgetRange?: string;
33
+ currentStack?: string;
34
+ }
35
+ interface SalesLeadSummaryOutput {
36
+ summary: string;
37
+ qualification: "low" | "medium" | "high";
38
+ recommendedNextStep: string;
39
+ }
40
+ interface InternalOpsDraftInput {
41
+ requestId: string;
42
+ requester?: string;
43
+ workflow: string;
44
+ requestedAction: string;
45
+ context?: string;
46
+ }
47
+ interface InternalOpsDraftOutput {
48
+ draft: string;
49
+ risk: "low" | "medium" | "high";
50
+ requiresApproval: boolean;
51
+ }
52
+ type SupportDraftHandler = (input: SupportDraftInput) => Promise<SupportDraftOutput>;
53
+ type HumanEscalationHandler = (input: HumanEscalationInput) => Promise<HumanEscalationOutput>;
54
+ type SalesLeadSummaryHandler = (input: SalesLeadSummaryInput) => Promise<SalesLeadSummaryOutput>;
55
+ type InternalOpsDraftHandler = (input: InternalOpsDraftInput) => Promise<InternalOpsDraftOutput>;
56
+ interface SupportRagToolRegistryOptions {
57
+ retriever?: KnowledgeRetriever;
58
+ supportDraft?: SupportDraftHandler;
59
+ humanEscalation?: HumanEscalationHandler;
60
+ }
61
+ interface SalesIntakeToolRegistryOptions {
62
+ leadSummary?: SalesLeadSummaryHandler;
63
+ }
64
+ interface InternalOpsToolRegistryOptions {
65
+ opsDraft?: InternalOpsDraftHandler;
66
+ }
67
+ declare function createNoToolRegistry(): ToolRegistry;
68
+ declare function createCodingToolRegistry(): ToolRegistry;
69
+ declare function createPublicWebToolRegistry(source?: ToolRegistry): ToolRegistry;
70
+ declare function createCustomerSupportToolRegistry(source?: ToolRegistry): ToolRegistry;
71
+ declare function createSupportRagToolRegistry(options?: SupportRagToolRegistryOptions): ToolRegistry;
72
+ declare function createSalesIntakeToolRegistry(options?: SalesIntakeToolRegistryOptions): ToolRegistry;
73
+ declare function createInternalOpsToolRegistry(options?: InternalOpsToolRegistryOptions): ToolRegistry;
74
+ declare function createRagToolRegistry(retriever?: KnowledgeRetriever): ToolRegistry;
75
+
76
+ export { type HumanEscalationHandler as H, type InternalOpsDraftHandler as I, type SupportDraftHandler as S, type HumanEscalationInput as a, type HumanEscalationOutput as b, type SupportDraftInput as c, type SupportDraftOutput as d, type SupportRagToolRegistryOptions as e, createCodingToolRegistry as f, createCustomerSupportToolRegistry as g, createNoToolRegistry as h, createPublicWebToolRegistry as i, createRagToolRegistry as j, createSupportRagToolRegistry as k, type InternalOpsDraftInput as l, type InternalOpsDraftOutput as m, type InternalOpsToolRegistryOptions as n, type SalesIntakeToolRegistryOptions as o, type SalesLeadSummaryHandler as p, type SalesLeadSummaryInput as q, type SalesLeadSummaryOutput as r, createInternalOpsToolRegistry as s, createSalesIntakeToolRegistry as t };
@@ -0,0 +1,31 @@
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 };
@@ -0,0 +1,115 @@
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 };
@@ -0,0 +1,54 @@
1
+ import { E as EventLog, G as RuntimeEventType, F as RuntimeEvent, K as RuntimeSessionStore, J as RuntimeSessionCreateOptions, I as RuntimeSession } from '../agent-runtime-DeLcB0Ie.js';
2
+ export { A as AGENT_MODES, d as AgentArtifact, e as AgentArtifactKind, f as AgentBudget, g as AgentCapability, h as AgentGateDefinition, i as AgentGateKind, j as AgentGraphDefinition, k as AgentGraphEdge, l as AgentGraphNode, m as AgentGraphValidationIssue, n as AgentGraphValidationResult, o as AgentModeDefinition, p as AgentModeId, q as AgentRole, r as AgentRunResult, s as AgentRunStatus, t as AgentRuntime, u as AgentRuntimeOptions, v as AgentRuntimeSnapshot, B as AgentTask, D as DEFAULT_WORKFLOWS, w as PermissionDecision, x as PermissionPolicy, y as ProviderRegistry, z as ProviderRuntimeSelection, R as ReasoningEffort, H as RuntimeMode, N as RuntimeToolExecutionInput, O as RuntimeToolExecutionResult, Q as RuntimeTurnContext, T as RuntimeTurnInput, U as RuntimeTurnResult, V as RuntimeTurnRunner, W as RuntimeTurnStreamEvent, X as SharedWorkspaceState, Y as SharedWorkspaceStateSnapshot, Z as WorkflowCatalog, _ as WorkflowDefinition, $ as WorkflowEngine, a0 as WorkflowHandler, a1 as WorkflowPlan, a2 as WorkflowRegistry, a3 as WorkflowRetryPolicy, a4 as WorkflowRisk, a5 as WorkflowRunContext, a6 as WorkflowRunInput, a7 as WorkflowRunResult, a8 as WorkflowRunStatus, a9 as WorkflowStepDefinition, aa as createAgentArtifact, ab as createAgentRuntime, ad as createProviderRegistry, ae as createSummaryArtifact, af as createWorkflowCatalog, ag as createWorkflowEngine, ah as createWorkflowRegistry, ai as getAgentMode, aj as isAgentMode, ak as listAgentModes, al as normalizeAgentRunResult, am as validateAgentCapabilities, an as validateAgentGraph, ao as workflowToAgentGraph } from '../agent-runtime-DeLcB0Ie.js';
3
+ export { A as AgentSurface, D as DefaultPermissionPolicy, a as DefaultRuntimeTurnRunner, E as ExtensionRisk, F as FileEventLog, b as FileRuntimeSessionStore, I as InMemoryEventLog, c as InMemoryRuntimeSessionStore, M as McpToolPolicy, R as RecipeManifest, d as RecipeStep, e as RuntimeHttpServerOptions, S as SkillManifest, T as ToolCallingRuntimeTurnRunner, f as ToolCallingRuntimeTurnRunnerOptions, g as createDefaultRuntimeTurnRunner, h as createEventLog, i as createFileEventLog, j as createFileRuntimeSessionStore, k as createMcpToolPolicy, l as createPermissionPolicy, m as createRuntimeHttpServer, n as createRuntimeSessionStore, o as createToolCallingRuntimeTurnRunner } from '../extension-manifests-DcvOnrp3.js';
4
+ export { A as AgentActionMode, a as AgentBlueprint, b as AgentDeploymentSurface, c as AgentMaturity, d as AgentPreset, e as AgentRuntimeFactoryOptions, f as ApprovalPolicy, B as BlueprintAgent, G as GuardrailConfig, g as GuardrailFinding, h as GuardrailResult, i as GuardrailSeverity, j as GuardrailStage, M as MemoryConfig, O as ObservabilityConfig, S as SecretRedactionConfig, T as TopicBoundaryConfig, k as createAgentFromBlueprint, l as createBaseBlueprint, m as createSafeToolRegistry, n as defaultPublicGuardrails, o as mapActionModeToRuntimeMode, r as redactSecrets, p as runGuardrails, v as validateStructuredOutput } from '../blueprints-BWcCJfnN.js';
5
+ export { I as InMemoryKnowledgeDocument, a as InMemoryKnowledgeRetriever, K as KnowledgeRetriever, R as RetrievalOptions, b as RetrievedSource, c as createInMemoryKnowledgeRetriever, f as formatRetrievedSourcesForPrompt } from '../rag-BakFRE-u.js';
6
+ import '../registry-CEpl9Jq0.js';
7
+ import 'zod';
8
+ import 'node:http';
9
+
10
+ interface PostgresQueryClient {
11
+ query<T = unknown>(sql: string, params?: unknown[]): Promise<{
12
+ rows: T[];
13
+ rowCount?: number | null;
14
+ }>;
15
+ }
16
+ interface PostgresRuntimeStoreOptions {
17
+ tenantId?: string;
18
+ }
19
+ declare class PostgresRuntimeSessionStore implements RuntimeSessionStore {
20
+ private readonly client;
21
+ private readonly options;
22
+ private sessions;
23
+ constructor(client: PostgresQueryClient, options?: PostgresRuntimeStoreOptions);
24
+ create(options?: RuntimeSessionCreateOptions): RuntimeSession;
25
+ get(id: string): RuntimeSession | undefined;
26
+ update(session: RuntimeSession): RuntimeSession;
27
+ list(): RuntimeSession[];
28
+ delete(id: string): boolean;
29
+ }
30
+ /**
31
+ * Async helper for hosted products that need to inspect persisted sessions.
32
+ * RuntimeSessionStore remains sync for local runtime compatibility.
33
+ */
34
+ declare function createPostgresRuntimeSessionQueries(client: PostgresQueryClient, options?: PostgresRuntimeStoreOptions): {
35
+ get(id: string): Promise<RuntimeSession | undefined>;
36
+ list(): Promise<RuntimeSession[]>;
37
+ };
38
+ declare class PostgresEventLog implements EventLog {
39
+ private readonly client;
40
+ private readonly options;
41
+ private events;
42
+ constructor(client: PostgresQueryClient, options?: PostgresRuntimeStoreOptions);
43
+ record(type: RuntimeEventType, data?: Record<string, unknown>): RuntimeEvent;
44
+ list(): RuntimeEvent[];
45
+ count(): number;
46
+ clear(): void;
47
+ }
48
+ declare function createPostgresRuntimeSessionStore(client: PostgresQueryClient, options?: PostgresRuntimeStoreOptions): RuntimeSessionStore;
49
+ declare function createPostgresEventLog(client: PostgresQueryClient, options?: PostgresRuntimeStoreOptions): EventLog;
50
+ declare function listPostgresRuntimeEvents(client: PostgresQueryClient, options?: PostgresRuntimeStoreOptions & {
51
+ sessionId?: string;
52
+ }): Promise<RuntimeEvent[]>;
53
+
54
+ export { EventLog, PostgresEventLog, type PostgresQueryClient, PostgresRuntimeSessionStore, type PostgresRuntimeStoreOptions, RuntimeEvent, RuntimeEventType, RuntimeSession, RuntimeSessionCreateOptions, RuntimeSessionStore, createPostgresEventLog, createPostgresRuntimeSessionQueries, createPostgresRuntimeSessionStore, listPostgresRuntimeEvents };