@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.
- package/README.md +149 -13
- package/dist/adapters/index.d.ts +37 -0
- package/dist/adapters/index.js +46 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/agent-runtime-DJY9FzL_.d.ts +969 -0
- package/dist/blueprints-DYgm3K65.d.ts +99 -0
- package/dist/cli/index.js +1078 -169
- package/dist/cli/index.js.map +1 -1
- package/dist/extension-manifests-CAQQILhE.d.ts +147 -0
- package/dist/index-Dp1o8c9g.d.ts +2807 -0
- package/dist/index.d.ts +25 -913
- package/dist/index.js +1900 -101
- package/dist/index.js.map +1 -1
- package/dist/presets/index.d.ts +39 -0
- package/dist/presets/index.js +27050 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/profiles-BcyL-gQ9.d.ts +76 -0
- package/dist/rag-BakFRE-u.d.ts +31 -0
- package/dist/registry-CEpl9Jq0.d.ts +115 -0
- package/dist/runtime/index.d.ts +54 -0
- package/dist/runtime/index.js +27584 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/index.js +18751 -0
- package/dist/tools/index.js.map +1 -0
- package/package.json +9 -3
|
@@ -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 { R as EventLog, a1 as RuntimeEventType, a0 as RuntimeEvent, a5 as RuntimeSessionStore, a4 as RuntimeSessionCreateOptions, a3 as RuntimeSession } from '../agent-runtime-DJY9FzL_.js';
|
|
2
|
+
export { A as AGENT_MODES, d as AgentArtifact, e as AgentArtifactKind, f as AgentBudget, g as AgentCapability, h as AgentCard, i as AgentDefinition, j as AgentGateDefinition, k as AgentGateKind, l as AgentGraphDefinition, m as AgentGraphEdge, n as AgentGraphEngine, o as AgentGraphEngineOptions, p as AgentGraphNode, q as AgentGraphNodeExecution, r as AgentGraphNodeExecutor, s as AgentGraphRunInput, t as AgentGraphRunResult, u as AgentGraphRunStatus, v as AgentGraphValidationIssue, w as AgentGraphValidationResult, x as AgentGuardrailPolicy, y as AgentHandoff, z as AgentMessage, B as AgentMessageRole, D as AgentModeDefinition, E as AgentModeId, F as AgentRole, G as AgentRunResult, H as AgentRunStatus, I as AgentRuntime, J as AgentRuntimeOptions, K as AgentRuntimeSnapshot, $ as AgentTask, N as AgentToolPolicyDecision, O as AgentTraceContext, Q as DEFAULT_WORKFLOWS, T as FileSharedWorkspaceStore, U as InMemorySharedWorkspaceStore, V as LegacyAgentRoleMapping, W as PermissionDecision, X as PermissionPolicy, Y as ProviderRegistry, Z as ProviderRuntimeSelection, _ as ReasoningEffort, a2 as RuntimeMode, a6 as RuntimeToolExecutionInput, a7 as RuntimeToolExecutionResult, a8 as RuntimeTurnContext, a9 as RuntimeTurnInput, aa as RuntimeTurnResult, ab as RuntimeTurnRunner, ac as RuntimeTurnStreamEvent, ad as SharedWorkspaceProvenance, ae as SharedWorkspaceRecord, af as SharedWorkspaceRecordKind, ag as SharedWorkspaceState, ah as SharedWorkspaceStateSnapshot, ai as SharedWorkspaceStore, aj as SharedWorkspaceWriteInput, ak as ToolRiskLevel, al as ToolRiskManifest, am as ToolRiskManifestEntry, an as WorkflowCatalog, ao as WorkflowDefinition, ap as WorkflowEngine, aq as WorkflowHandler, ar as WorkflowPlan, as as WorkflowRegistry, at as WorkflowRetryPolicy, au as WorkflowRisk, av as WorkflowRunContext, aw as WorkflowRunInput, ax as WorkflowRunResult, ay as WorkflowRunStatus, az as WorkflowStepDefinition, aA as createAgentArtifact, aB as createAgentGraphEngine, aC as createAgentRuntime, aD as createAgentTraceContext, aF as createProviderRegistry, aG as createSummaryArtifact, aH as createWorkflowCatalog, aI as createWorkflowEngine, aJ as createWorkflowRegistry, aK as evaluateAgentToolPolicy, aL as getAgentMode, aM as isAgentMode, aN as listAgentModes, aO as listLegacyAgentRoleMappings, aP as mapLegacyAgentRole, aQ as normalizeAgentRunResult, aR as validateAgentCapabilities, aS as validateAgentGraph, aT as workflowToAgentGraph } from '../agent-runtime-DJY9FzL_.js';
|
|
3
|
+
export { A as AgentRunner, a as AgentRunnerExecutionContext, b as AgentRunnerExecutionInput, c as AgentRunnerExecutor, d as AgentRunnerOptions, e as AgentRunnerRawResult, f as AgentSurface, D as DefaultPermissionPolicy, g as DefaultRuntimeTurnRunner, E as ExtensionRisk, F as FileEventLog, h as FileRuntimeSessionStore, I as InMemoryEventLog, i as InMemoryRuntimeSessionStore, M as McpToolPolicy, R as RecipeManifest, j as RecipeStep, k as RuntimeHttpServerOptions, S as SkillManifest, T as ToolCallingRuntimeTurnRunner, l as ToolCallingRuntimeTurnRunnerOptions, m as createAgentRunner, n as createDefaultRuntimeTurnRunner, o as createEventLog, p as createFileEventLog, q as createFileRuntimeSessionStore, r as createMcpToolPolicy, s as createPermissionPolicy, t as createRuntimeHttpServer, u as createRuntimeSessionStore, v as createToolCallingRuntimeTurnRunner } from '../extension-manifests-CAQQILhE.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-DYgm3K65.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 };
|