@corbat-tech/coco 2.37.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,99 @@
1
+ import { ap as ProviderType, P as ProviderConfig, L as LLMProvider, E as EventLog, V as RuntimeTurnRunner, t as AgentRuntime, I as RuntimeSession, T as RuntimeTurnInput, U as RuntimeTurnResult } from './agent-runtime-DeLcB0Ie.js';
2
+ import { T as ToolRegistry } from './registry-CEpl9Jq0.js';
3
+ import { z } from 'zod';
4
+
5
+ type GuardrailSeverity = "info" | "warning" | "blocked";
6
+ type GuardrailStage = "input" | "output" | "tool";
7
+ interface GuardrailFinding {
8
+ id: string;
9
+ stage: GuardrailStage;
10
+ severity: GuardrailSeverity;
11
+ message: string;
12
+ redacted?: boolean;
13
+ }
14
+ interface GuardrailResult {
15
+ allowed: boolean;
16
+ content: string;
17
+ findings: GuardrailFinding[];
18
+ }
19
+ interface SecretRedactionConfig {
20
+ enabled: boolean;
21
+ replacement?: string;
22
+ }
23
+ interface TopicBoundaryConfig {
24
+ allowedTopics?: string[];
25
+ blockedTopics?: string[];
26
+ }
27
+ interface GuardrailConfig {
28
+ maxInputChars?: number;
29
+ maxOutputChars?: number;
30
+ secretRedaction?: SecretRedactionConfig;
31
+ promptInjectionDetection?: boolean;
32
+ topicBoundary?: TopicBoundaryConfig;
33
+ }
34
+ declare const defaultPublicGuardrails: GuardrailConfig;
35
+ declare function redactSecrets(content: string, config?: SecretRedactionConfig): {
36
+ content: string;
37
+ findings: GuardrailFinding[];
38
+ };
39
+ declare function runGuardrails(stage: GuardrailStage, content: string, config?: GuardrailConfig): GuardrailResult;
40
+ declare function validateStructuredOutput(output: unknown, schema: z.ZodTypeAny | undefined): GuardrailFinding[];
41
+
42
+ type AgentDeploymentSurface = "cli" | "web" | "whatsapp" | "slack" | "api" | "internal";
43
+ type AgentActionMode = "ask" | "draft" | "act" | "review";
44
+ type AgentMaturity = "experimental" | "beta" | "stable";
45
+ interface MemoryConfig {
46
+ enabled: boolean;
47
+ retention?: "session" | "short-term" | "long-term";
48
+ }
49
+ interface ApprovalPolicy {
50
+ requireHumanForExternalActions: boolean;
51
+ requireHumanForSensitiveData?: boolean;
52
+ }
53
+ interface ObservabilityConfig {
54
+ logEvents: boolean;
55
+ redactSensitiveData: boolean;
56
+ estimateCost?: boolean;
57
+ }
58
+ interface AgentBlueprint {
59
+ id: string;
60
+ name: string;
61
+ description: string;
62
+ surface: AgentDeploymentSurface;
63
+ defaultMode: AgentActionMode;
64
+ maturity: AgentMaturity;
65
+ instructions: string;
66
+ allowedTools: string[];
67
+ guardrails: GuardrailConfig;
68
+ memory: MemoryConfig;
69
+ approval: ApprovalPolicy;
70
+ observability: ObservabilityConfig;
71
+ outputSchema?: unknown;
72
+ }
73
+ interface AgentRuntimeFactoryOptions {
74
+ providerType: ProviderType;
75
+ model?: string;
76
+ providerConfig?: ProviderConfig;
77
+ provider?: LLMProvider;
78
+ toolRegistry?: ToolRegistry;
79
+ eventLog?: EventLog;
80
+ turnRunner?: RuntimeTurnRunner;
81
+ }
82
+ interface AgentPreset<TConfig = unknown> {
83
+ id: string;
84
+ name: string;
85
+ createBlueprint(config: TConfig): AgentBlueprint;
86
+ createRuntime(config: TConfig & AgentRuntimeFactoryOptions): Promise<AgentRuntime>;
87
+ }
88
+ interface BlueprintAgent {
89
+ blueprint: AgentBlueprint;
90
+ runtime: AgentRuntime;
91
+ createSession(metadata?: Record<string, unknown>): RuntimeSession;
92
+ runTurn(input: RuntimeTurnInput): Promise<RuntimeTurnResult>;
93
+ }
94
+ declare function mapActionModeToRuntimeMode(mode: AgentActionMode): "ask" | "build" | "review";
95
+ declare function createSafeToolRegistry(allowedTools: string[], source?: ToolRegistry): ToolRegistry;
96
+ declare function createAgentFromBlueprint(blueprint: AgentBlueprint, options: AgentRuntimeFactoryOptions): Promise<BlueprintAgent>;
97
+ declare function createBaseBlueprint(input: Omit<AgentBlueprint, "guardrails" | "memory" | "approval" | "observability"> & Partial<Pick<AgentBlueprint, "guardrails" | "memory" | "approval" | "observability">>): AgentBlueprint;
98
+
99
+ export { type AgentActionMode as A, type BlueprintAgent as B, type GuardrailConfig as G, type MemoryConfig as M, type ObservabilityConfig as O, type SecretRedactionConfig as S, type TopicBoundaryConfig as T, type AgentBlueprint as a, type AgentDeploymentSurface as b, type AgentMaturity as c, type AgentPreset as d, type AgentRuntimeFactoryOptions as e, type ApprovalPolicy as f, type GuardrailFinding as g, type GuardrailResult as h, type GuardrailSeverity as i, type GuardrailStage as j, createAgentFromBlueprint as k, createBaseBlueprint as l, createSafeToolRegistry as m, defaultPublicGuardrails as n, mapActionModeToRuntimeMode as o, runGuardrails as p, redactSecrets as r, validateStructuredOutput as v };