@corbat-tech/coco 2.35.0 → 2.37.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 +7 -0
- package/dist/cli/index.js +1124 -109
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +451 -1
- package/dist/index.js +2436 -59
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { Server } from 'node:http';
|
|
2
3
|
import { Logger, ILogObj } from 'tslog';
|
|
3
4
|
|
|
4
5
|
declare const VERSION: string;
|
|
@@ -957,6 +958,10 @@ type ProjectType = "cli" | "api" | "web_app" | "library" | "service" | "full_sta
|
|
|
957
958
|
type ThinkingMode = "off" | "auto" | "low" | "medium" | "high" | {
|
|
958
959
|
budget: number;
|
|
959
960
|
};
|
|
961
|
+
/**
|
|
962
|
+
* Whether this provider/model uses effort buckets (OpenAI) or token budgets (Anthropic, Gemini).
|
|
963
|
+
*/
|
|
964
|
+
type ThinkingKind = "effort" | "budget";
|
|
960
965
|
|
|
961
966
|
/**
|
|
962
967
|
* LLM Provider types for Corbat-Coco
|
|
@@ -3136,6 +3141,75 @@ declare class TaskError extends CocoError {
|
|
|
3136
3141
|
});
|
|
3137
3142
|
}
|
|
3138
3143
|
|
|
3144
|
+
/**
|
|
3145
|
+
* Provider and model catalog.
|
|
3146
|
+
*
|
|
3147
|
+
* This is the source of truth for model IDs, defaults, context windows,
|
|
3148
|
+
* pricing metadata, and provider capabilities. Endpoint adapters still own
|
|
3149
|
+
* request/response conversion, but they should read model metadata from here.
|
|
3150
|
+
*/
|
|
3151
|
+
|
|
3152
|
+
type ModelStatus = "current" | "legacy" | "deprecated" | "experimental";
|
|
3153
|
+
type ModelCapability = "streaming" | "tool-use" | "vision" | "reasoning-effort" | "adaptive-thinking" | "thinking-budget" | "openai-responses" | "openai-chat" | "anthropic-messages" | "gemini-generate-content";
|
|
3154
|
+
interface ProviderSource {
|
|
3155
|
+
name: string;
|
|
3156
|
+
url: string;
|
|
3157
|
+
verifiedAt: string;
|
|
3158
|
+
}
|
|
3159
|
+
interface ModelPricing {
|
|
3160
|
+
inputPerMillion: number;
|
|
3161
|
+
outputPerMillion: number;
|
|
3162
|
+
}
|
|
3163
|
+
interface ModelCatalogEntry {
|
|
3164
|
+
id: string;
|
|
3165
|
+
name: string;
|
|
3166
|
+
description?: string;
|
|
3167
|
+
contextWindow: number;
|
|
3168
|
+
maxOutputTokens?: number;
|
|
3169
|
+
recommended?: boolean;
|
|
3170
|
+
status: ModelStatus;
|
|
3171
|
+
capabilities: ModelCapability[];
|
|
3172
|
+
pricing?: ModelPricing;
|
|
3173
|
+
source: ProviderSource;
|
|
3174
|
+
}
|
|
3175
|
+
interface ProviderCatalogEntry {
|
|
3176
|
+
id: ProviderType;
|
|
3177
|
+
defaultModel: string;
|
|
3178
|
+
models: ModelCatalogEntry[];
|
|
3179
|
+
}
|
|
3180
|
+
|
|
3181
|
+
/**
|
|
3182
|
+
* Runtime compatibility view derived from the static provider catalog.
|
|
3183
|
+
*
|
|
3184
|
+
* The catalog records what a model is; this module records how Coco should use it
|
|
3185
|
+
* safely at runtime, including endpoint selection and reasoning/tooling limits.
|
|
3186
|
+
*/
|
|
3187
|
+
|
|
3188
|
+
type ProviderEndpointStrategy = "anthropic-messages" | "openai-responses" | "openai-chat" | "gemini-generate-content";
|
|
3189
|
+
type ModelCompatibilityStatus = ModelStatus | "unverified";
|
|
3190
|
+
interface ProviderRuntimeCapability {
|
|
3191
|
+
provider: ProviderType;
|
|
3192
|
+
model: string;
|
|
3193
|
+
catalogModel?: ModelCatalogEntry;
|
|
3194
|
+
status: ModelCompatibilityStatus;
|
|
3195
|
+
endpoint: ProviderEndpointStrategy;
|
|
3196
|
+
supportsStreaming: boolean;
|
|
3197
|
+
supportsToolUse: boolean;
|
|
3198
|
+
supportsVision: boolean;
|
|
3199
|
+
supportsReasoning: boolean;
|
|
3200
|
+
reasoningKinds: ThinkingKind[];
|
|
3201
|
+
defaultReasoning: ThinkingMode;
|
|
3202
|
+
contextWindow: number;
|
|
3203
|
+
maxOutputTokens?: number;
|
|
3204
|
+
sourceUrl?: string;
|
|
3205
|
+
restrictions: string[];
|
|
3206
|
+
}
|
|
3207
|
+
interface ProviderProbeResult extends ProviderRuntimeCapability {
|
|
3208
|
+
available: boolean | "not-checked";
|
|
3209
|
+
checkedAt: string;
|
|
3210
|
+
error?: string;
|
|
3211
|
+
}
|
|
3212
|
+
|
|
3139
3213
|
/**
|
|
3140
3214
|
* Provider exports for Corbat-Coco
|
|
3141
3215
|
*/
|
|
@@ -3253,6 +3327,382 @@ declare class ToolRegistry {
|
|
|
3253
3327
|
*/
|
|
3254
3328
|
declare function createToolRegistry(): ToolRegistry;
|
|
3255
3329
|
|
|
3330
|
+
/** Catalog-backed provider/model registry used by runtime consumers. */
|
|
3331
|
+
declare class ProviderRegistry {
|
|
3332
|
+
listProviders(): ProviderCatalogEntry[];
|
|
3333
|
+
getProvider(provider: ProviderType): ProviderCatalogEntry;
|
|
3334
|
+
listModels(provider: ProviderType): ModelCatalogEntry[];
|
|
3335
|
+
getModel(provider: ProviderType, model: string): ModelCatalogEntry | undefined;
|
|
3336
|
+
getDefaultModel(provider: ProviderType): string;
|
|
3337
|
+
getRecommendedModel(provider: ProviderType): ModelCatalogEntry;
|
|
3338
|
+
getCapability(provider: ProviderType, model?: string): ProviderRuntimeCapability;
|
|
3339
|
+
createProvider(provider: ProviderType, config?: ProviderConfig): Promise<LLMProvider>;
|
|
3340
|
+
probe(provider: ProviderType, model: string | undefined, checkAvailability?: () => Promise<boolean>): Promise<ProviderProbeResult>;
|
|
3341
|
+
}
|
|
3342
|
+
declare function createProviderRegistry(): ProviderRegistry;
|
|
3343
|
+
|
|
3344
|
+
/**
|
|
3345
|
+
* Agent mode registry.
|
|
3346
|
+
*
|
|
3347
|
+
* Modes describe the intended control flow for a runtime turn without changing
|
|
3348
|
+
* the provider interface. CLI, headless, and embedders share this registry.
|
|
3349
|
+
*/
|
|
3350
|
+
type AgentModeId = "ask" | "plan" | "build" | "debug" | "review" | "architect";
|
|
3351
|
+
interface AgentModeDefinition {
|
|
3352
|
+
id: AgentModeId;
|
|
3353
|
+
label: string;
|
|
3354
|
+
description: string;
|
|
3355
|
+
readOnly: boolean;
|
|
3356
|
+
preferredTools: string[];
|
|
3357
|
+
requiresVerification: boolean;
|
|
3358
|
+
}
|
|
3359
|
+
declare const AGENT_MODES: Record<AgentModeId, AgentModeDefinition>;
|
|
3360
|
+
declare function getAgentMode(mode: AgentModeId): AgentModeDefinition;
|
|
3361
|
+
declare function listAgentModes(): AgentModeDefinition[];
|
|
3362
|
+
declare function isAgentMode(value: string): value is AgentModeId;
|
|
3363
|
+
|
|
3364
|
+
type ReasoningEffort = "auto" | "low" | "medium" | "high" | "max";
|
|
3365
|
+
type RuntimeMode = AgentModeId;
|
|
3366
|
+
interface AgentRuntimeOptions {
|
|
3367
|
+
providerType: ProviderType;
|
|
3368
|
+
model?: string;
|
|
3369
|
+
providerConfig?: ProviderConfig;
|
|
3370
|
+
provider?: LLMProvider;
|
|
3371
|
+
toolRegistry?: ToolRegistry;
|
|
3372
|
+
/** Legacy CLI session store passthrough. Runtime APIs use runtimeSessionStore. */
|
|
3373
|
+
sessionStore?: unknown;
|
|
3374
|
+
runtimeSessionStore?: RuntimeSessionStore;
|
|
3375
|
+
workflowEngine?: WorkflowEngine;
|
|
3376
|
+
permissionPolicy?: PermissionPolicy;
|
|
3377
|
+
eventLog?: EventLog;
|
|
3378
|
+
eventLogPath?: string;
|
|
3379
|
+
turnRunner?: RuntimeTurnRunner;
|
|
3380
|
+
/**
|
|
3381
|
+
* Publish provider/tools into Coco's legacy process-global subagent bridge.
|
|
3382
|
+
* CLI/headless use this for compatibility; embedders should leave it false.
|
|
3383
|
+
*/
|
|
3384
|
+
publishToGlobalBridge?: boolean;
|
|
3385
|
+
}
|
|
3386
|
+
interface AgentRuntimeSnapshot {
|
|
3387
|
+
provider: {
|
|
3388
|
+
type: ProviderType;
|
|
3389
|
+
model: string;
|
|
3390
|
+
capability: ProviderRuntimeCapability;
|
|
3391
|
+
};
|
|
3392
|
+
tools: {
|
|
3393
|
+
count: number;
|
|
3394
|
+
names: string[];
|
|
3395
|
+
};
|
|
3396
|
+
modes: AgentModeDefinition[];
|
|
3397
|
+
}
|
|
3398
|
+
type RuntimeEventType = "runtime.initialized" | "provider.attached" | "provider.created" | "provider.updated" | "turn.started" | "turn.completed" | "turn.cancelled" | "turn.failed" | "tool.started" | "tool.completed" | "tool.allowed" | "tool.blocked" | "tool.skipped" | "workflow.planned" | "workflow.started" | "workflow.completed" | "workflow.failed" | "session.created" | "session.updated" | "checkpoint.created" | "error";
|
|
3399
|
+
interface RuntimeEvent {
|
|
3400
|
+
id: string;
|
|
3401
|
+
type: RuntimeEventType;
|
|
3402
|
+
timestamp: string;
|
|
3403
|
+
data: Record<string, unknown>;
|
|
3404
|
+
}
|
|
3405
|
+
interface EventLog {
|
|
3406
|
+
record(type: RuntimeEventType, data?: Record<string, unknown>): RuntimeEvent;
|
|
3407
|
+
list(): RuntimeEvent[];
|
|
3408
|
+
count(): number;
|
|
3409
|
+
clear(): void;
|
|
3410
|
+
}
|
|
3411
|
+
interface PermissionDecision {
|
|
3412
|
+
allowed: boolean;
|
|
3413
|
+
reason?: string;
|
|
3414
|
+
requiresConfirmation?: boolean;
|
|
3415
|
+
risk: "read-only" | "write" | "network" | "destructive" | "secrets-sensitive";
|
|
3416
|
+
}
|
|
3417
|
+
interface PermissionPolicy {
|
|
3418
|
+
canExecuteTool(mode: RuntimeMode, tool: ToolDefinition): PermissionDecision;
|
|
3419
|
+
canExecuteToolInput?(mode: RuntimeMode, tool: ToolDefinition, input: Record<string, unknown>): PermissionDecision;
|
|
3420
|
+
}
|
|
3421
|
+
interface ProviderRuntimeSelection {
|
|
3422
|
+
provider: ProviderType;
|
|
3423
|
+
model: string;
|
|
3424
|
+
thinking?: ThinkingMode;
|
|
3425
|
+
}
|
|
3426
|
+
interface RuntimeSession {
|
|
3427
|
+
id: string;
|
|
3428
|
+
createdAt: string;
|
|
3429
|
+
updatedAt: string;
|
|
3430
|
+
mode: RuntimeMode;
|
|
3431
|
+
messages: Message[];
|
|
3432
|
+
instructions?: string;
|
|
3433
|
+
metadata: Record<string, unknown>;
|
|
3434
|
+
}
|
|
3435
|
+
interface RuntimeSessionCreateOptions {
|
|
3436
|
+
id?: string;
|
|
3437
|
+
mode?: RuntimeMode;
|
|
3438
|
+
instructions?: string;
|
|
3439
|
+
metadata?: Record<string, unknown>;
|
|
3440
|
+
messages?: Message[];
|
|
3441
|
+
}
|
|
3442
|
+
interface RuntimeSessionStore {
|
|
3443
|
+
create(options?: RuntimeSessionCreateOptions): RuntimeSession;
|
|
3444
|
+
get(id: string): RuntimeSession | undefined;
|
|
3445
|
+
update(session: RuntimeSession): RuntimeSession;
|
|
3446
|
+
list(): RuntimeSession[];
|
|
3447
|
+
delete(id: string): boolean;
|
|
3448
|
+
}
|
|
3449
|
+
interface RuntimeTurnInput {
|
|
3450
|
+
content: string;
|
|
3451
|
+
sessionId?: string;
|
|
3452
|
+
mode?: RuntimeMode;
|
|
3453
|
+
options?: ChatOptions;
|
|
3454
|
+
metadata?: Record<string, unknown>;
|
|
3455
|
+
}
|
|
3456
|
+
interface RuntimeTurnResult {
|
|
3457
|
+
sessionId: string;
|
|
3458
|
+
content: string;
|
|
3459
|
+
usage: {
|
|
3460
|
+
inputTokens: number;
|
|
3461
|
+
outputTokens: number;
|
|
3462
|
+
estimated?: boolean;
|
|
3463
|
+
};
|
|
3464
|
+
model: string;
|
|
3465
|
+
mode: RuntimeMode;
|
|
3466
|
+
}
|
|
3467
|
+
type RuntimeTurnStreamEvent = {
|
|
3468
|
+
type: "text";
|
|
3469
|
+
sessionId: string;
|
|
3470
|
+
text: string;
|
|
3471
|
+
} | {
|
|
3472
|
+
type: "done";
|
|
3473
|
+
sessionId: string;
|
|
3474
|
+
result: RuntimeTurnResult;
|
|
3475
|
+
} | {
|
|
3476
|
+
type: "error";
|
|
3477
|
+
sessionId: string;
|
|
3478
|
+
error: string;
|
|
3479
|
+
};
|
|
3480
|
+
interface RuntimeTurnContext {
|
|
3481
|
+
runtime: unknown;
|
|
3482
|
+
session: RuntimeSession;
|
|
3483
|
+
provider: LLMProvider;
|
|
3484
|
+
toolRegistry: ToolRegistry;
|
|
3485
|
+
permissionPolicy: PermissionPolicy;
|
|
3486
|
+
eventLog: EventLog;
|
|
3487
|
+
}
|
|
3488
|
+
interface RuntimeTurnRunner {
|
|
3489
|
+
run(input: RuntimeTurnInput, context: RuntimeTurnContext): Promise<RuntimeTurnResult>;
|
|
3490
|
+
}
|
|
3491
|
+
interface RuntimeToolExecutionInput {
|
|
3492
|
+
sessionId?: string;
|
|
3493
|
+
mode?: RuntimeMode;
|
|
3494
|
+
toolName: string;
|
|
3495
|
+
input: Record<string, unknown>;
|
|
3496
|
+
confirmed?: boolean;
|
|
3497
|
+
metadata?: Record<string, unknown>;
|
|
3498
|
+
}
|
|
3499
|
+
interface RuntimeToolExecutionResult {
|
|
3500
|
+
toolName: string;
|
|
3501
|
+
success: boolean;
|
|
3502
|
+
output?: unknown;
|
|
3503
|
+
error?: string;
|
|
3504
|
+
duration: number;
|
|
3505
|
+
decision: PermissionDecision;
|
|
3506
|
+
}
|
|
3507
|
+
|
|
3508
|
+
type WorkflowRisk = "read-only" | "write" | "network" | "destructive" | "secrets-sensitive";
|
|
3509
|
+
interface WorkflowStepDefinition {
|
|
3510
|
+
id: string;
|
|
3511
|
+
description: string;
|
|
3512
|
+
requiredTools: string[];
|
|
3513
|
+
risk: WorkflowRisk;
|
|
3514
|
+
}
|
|
3515
|
+
interface WorkflowDefinition {
|
|
3516
|
+
id: string;
|
|
3517
|
+
name: string;
|
|
3518
|
+
description: string;
|
|
3519
|
+
inputSchema: string;
|
|
3520
|
+
steps: WorkflowStepDefinition[];
|
|
3521
|
+
checks: string[];
|
|
3522
|
+
outputKind: "markdown" | "json" | "patch" | "pull-request" | "release";
|
|
3523
|
+
replayable: boolean;
|
|
3524
|
+
}
|
|
3525
|
+
interface WorkflowPlan {
|
|
3526
|
+
id: string;
|
|
3527
|
+
workflowId: string;
|
|
3528
|
+
input: Record<string, unknown>;
|
|
3529
|
+
status: "planned";
|
|
3530
|
+
createdAt: string;
|
|
3531
|
+
}
|
|
3532
|
+
/** Descriptive catalog of reusable workflow definitions; it does not execute workflows. */
|
|
3533
|
+
declare class WorkflowCatalog {
|
|
3534
|
+
private workflows;
|
|
3535
|
+
constructor(workflows?: WorkflowDefinition[]);
|
|
3536
|
+
register(workflow: WorkflowDefinition): void;
|
|
3537
|
+
get(id: string): WorkflowDefinition | undefined;
|
|
3538
|
+
list(): WorkflowDefinition[];
|
|
3539
|
+
createPlan(workflowId: string, input: Record<string, unknown>, eventLog?: EventLog): WorkflowPlan;
|
|
3540
|
+
}
|
|
3541
|
+
declare const DEFAULT_WORKFLOWS: WorkflowDefinition[];
|
|
3542
|
+
declare const WorkflowRegistry: typeof WorkflowCatalog;
|
|
3543
|
+
declare function createWorkflowCatalog(workflows?: WorkflowDefinition[]): WorkflowCatalog;
|
|
3544
|
+
declare function createWorkflowRegistry(workflows?: WorkflowDefinition[]): WorkflowCatalog;
|
|
3545
|
+
|
|
3546
|
+
type WorkflowRunStatus = "completed" | "failed";
|
|
3547
|
+
interface WorkflowRunInput {
|
|
3548
|
+
workflowId: string;
|
|
3549
|
+
input: Record<string, unknown>;
|
|
3550
|
+
plan?: WorkflowPlan;
|
|
3551
|
+
}
|
|
3552
|
+
interface WorkflowRunResult {
|
|
3553
|
+
id: string;
|
|
3554
|
+
workflowId: string;
|
|
3555
|
+
status: WorkflowRunStatus;
|
|
3556
|
+
output: unknown;
|
|
3557
|
+
startedAt: string;
|
|
3558
|
+
completedAt: string;
|
|
3559
|
+
error?: string;
|
|
3560
|
+
}
|
|
3561
|
+
interface WorkflowRunContext {
|
|
3562
|
+
workflow: WorkflowDefinition;
|
|
3563
|
+
plan: WorkflowPlan;
|
|
3564
|
+
eventLog: EventLog;
|
|
3565
|
+
}
|
|
3566
|
+
type WorkflowHandler = (input: Record<string, unknown>, context: WorkflowRunContext) => Promise<unknown>;
|
|
3567
|
+
declare class WorkflowEngine {
|
|
3568
|
+
private readonly catalog;
|
|
3569
|
+
private readonly eventLog;
|
|
3570
|
+
private handlers;
|
|
3571
|
+
constructor(catalog?: WorkflowCatalog, eventLog?: EventLog);
|
|
3572
|
+
registerHandler(workflowId: string, handler: WorkflowHandler): void;
|
|
3573
|
+
createPlan(workflowId: string, input: Record<string, unknown>): WorkflowPlan;
|
|
3574
|
+
run(request: WorkflowRunInput): Promise<WorkflowRunResult>;
|
|
3575
|
+
}
|
|
3576
|
+
declare function createWorkflowEngine(catalog?: WorkflowCatalog, eventLog?: EventLog): WorkflowEngine;
|
|
3577
|
+
|
|
3578
|
+
/**
|
|
3579
|
+
* Reusable runtime facade for wiring providers, tools, permissions, sessions,
|
|
3580
|
+
* and observability. It does not own the CLI loop; CLI/headless are adapters on
|
|
3581
|
+
* top of this boundary.
|
|
3582
|
+
*/
|
|
3583
|
+
declare class AgentRuntime {
|
|
3584
|
+
private readonly options;
|
|
3585
|
+
readonly providerRegistry: ProviderRegistry;
|
|
3586
|
+
readonly toolRegistry: ToolRegistry;
|
|
3587
|
+
readonly sessionStore: unknown;
|
|
3588
|
+
readonly runtimeSessionStore: RuntimeSessionStore;
|
|
3589
|
+
readonly workflowEngine: WorkflowEngine;
|
|
3590
|
+
readonly permissionPolicy: PermissionPolicy;
|
|
3591
|
+
readonly eventLog: EventLog;
|
|
3592
|
+
readonly turnRunner: RuntimeTurnRunner;
|
|
3593
|
+
private providerType;
|
|
3594
|
+
private model;
|
|
3595
|
+
private provider?;
|
|
3596
|
+
constructor(options: AgentRuntimeOptions);
|
|
3597
|
+
initialize(): Promise<void>;
|
|
3598
|
+
getModel(): string;
|
|
3599
|
+
updateProvider(providerType: ProviderType, model: string | undefined, provider: LLMProvider): void;
|
|
3600
|
+
private publishToGlobalBridge;
|
|
3601
|
+
snapshot(): AgentRuntimeSnapshot;
|
|
3602
|
+
createSession(options?: RuntimeSessionCreateOptions): RuntimeSession;
|
|
3603
|
+
getSession(sessionId: string): RuntimeSession | undefined;
|
|
3604
|
+
listSessions(): RuntimeSession[];
|
|
3605
|
+
runTurn(input: RuntimeTurnInput): Promise<RuntimeTurnResult>;
|
|
3606
|
+
streamTurn(input: RuntimeTurnInput): AsyncIterable<RuntimeTurnStreamEvent>;
|
|
3607
|
+
executeTool(input: RuntimeToolExecutionInput): Promise<RuntimeToolExecutionResult>;
|
|
3608
|
+
assertToolAllowed(mode: RuntimeMode, toolName: string, input?: Record<string, unknown>): boolean;
|
|
3609
|
+
}
|
|
3610
|
+
declare function createAgentRuntime(options: AgentRuntimeOptions): Promise<AgentRuntime>;
|
|
3611
|
+
|
|
3612
|
+
declare class DefaultRuntimeTurnRunner implements RuntimeTurnRunner {
|
|
3613
|
+
run(input: RuntimeTurnInput, context: RuntimeTurnContext): Promise<RuntimeTurnResult>;
|
|
3614
|
+
}
|
|
3615
|
+
declare function createDefaultRuntimeTurnRunner(): RuntimeTurnRunner;
|
|
3616
|
+
|
|
3617
|
+
declare class InMemoryEventLog implements EventLog {
|
|
3618
|
+
private events;
|
|
3619
|
+
record(type: RuntimeEventType, data?: Record<string, unknown>): RuntimeEvent;
|
|
3620
|
+
list(): RuntimeEvent[];
|
|
3621
|
+
count(): number;
|
|
3622
|
+
clear(): void;
|
|
3623
|
+
}
|
|
3624
|
+
declare class FileEventLog implements EventLog {
|
|
3625
|
+
private readonly filePath;
|
|
3626
|
+
private memory;
|
|
3627
|
+
private writable;
|
|
3628
|
+
constructor(filePath: string);
|
|
3629
|
+
record(type: RuntimeEventType, data?: Record<string, unknown>): RuntimeEvent;
|
|
3630
|
+
list(): RuntimeEvent[];
|
|
3631
|
+
count(): number;
|
|
3632
|
+
clear(): void;
|
|
3633
|
+
}
|
|
3634
|
+
declare function createEventLog(): EventLog;
|
|
3635
|
+
declare function createFileEventLog(filePath: string): EventLog;
|
|
3636
|
+
|
|
3637
|
+
interface RuntimeHttpServerOptions {
|
|
3638
|
+
maxBodyBytes?: number;
|
|
3639
|
+
}
|
|
3640
|
+
declare function createRuntimeHttpServer(runtime: AgentRuntime, options?: RuntimeHttpServerOptions): Server;
|
|
3641
|
+
|
|
3642
|
+
declare class DefaultPermissionPolicy implements PermissionPolicy {
|
|
3643
|
+
canExecuteTool(mode: RuntimeMode, tool: ToolDefinition): PermissionDecision;
|
|
3644
|
+
canExecuteToolInput(mode: RuntimeMode, tool: ToolDefinition, input: Record<string, unknown>): PermissionDecision;
|
|
3645
|
+
}
|
|
3646
|
+
declare function createPermissionPolicy(): PermissionPolicy;
|
|
3647
|
+
|
|
3648
|
+
declare class InMemoryRuntimeSessionStore implements RuntimeSessionStore {
|
|
3649
|
+
private sessions;
|
|
3650
|
+
create(options?: RuntimeSessionCreateOptions): RuntimeSession;
|
|
3651
|
+
get(id: string): RuntimeSession | undefined;
|
|
3652
|
+
update(session: RuntimeSession): RuntimeSession;
|
|
3653
|
+
list(): RuntimeSession[];
|
|
3654
|
+
delete(id: string): boolean;
|
|
3655
|
+
}
|
|
3656
|
+
declare class FileRuntimeSessionStore implements RuntimeSessionStore {
|
|
3657
|
+
private readonly filePath;
|
|
3658
|
+
private sessions;
|
|
3659
|
+
constructor(filePath: string);
|
|
3660
|
+
create(options?: RuntimeSessionCreateOptions): RuntimeSession;
|
|
3661
|
+
get(id: string): RuntimeSession | undefined;
|
|
3662
|
+
update(session: RuntimeSession): RuntimeSession;
|
|
3663
|
+
list(): RuntimeSession[];
|
|
3664
|
+
delete(id: string): boolean;
|
|
3665
|
+
private readSessionsFromDisk;
|
|
3666
|
+
private persist;
|
|
3667
|
+
}
|
|
3668
|
+
declare function createRuntimeSessionStore(): RuntimeSessionStore;
|
|
3669
|
+
declare function createFileRuntimeSessionStore(filePath: string): RuntimeSessionStore;
|
|
3670
|
+
|
|
3671
|
+
type ExtensionRisk = "read-only" | "write" | "network" | "destructive" | "secrets-sensitive";
|
|
3672
|
+
type AgentSurface = "coco" | "claude" | "codex" | "gemini" | "opencode";
|
|
3673
|
+
interface SkillManifest {
|
|
3674
|
+
name: string;
|
|
3675
|
+
description: string;
|
|
3676
|
+
triggers: string[];
|
|
3677
|
+
requiredTools: string[];
|
|
3678
|
+
risk: ExtensionRisk;
|
|
3679
|
+
compatibleAgents: AgentSurface[];
|
|
3680
|
+
sourcePath?: string;
|
|
3681
|
+
}
|
|
3682
|
+
interface RecipeStep {
|
|
3683
|
+
id: string;
|
|
3684
|
+
description: string;
|
|
3685
|
+
requiredTools?: string[];
|
|
3686
|
+
check?: string;
|
|
3687
|
+
}
|
|
3688
|
+
interface RecipeManifest {
|
|
3689
|
+
name: string;
|
|
3690
|
+
description: string;
|
|
3691
|
+
inputs: string[];
|
|
3692
|
+
suggestedModels?: string[];
|
|
3693
|
+
steps: RecipeStep[];
|
|
3694
|
+
checks: string[];
|
|
3695
|
+
risk: ExtensionRisk;
|
|
3696
|
+
}
|
|
3697
|
+
interface McpToolPolicy {
|
|
3698
|
+
server: string;
|
|
3699
|
+
tool: string;
|
|
3700
|
+
risk: ExtensionRisk;
|
|
3701
|
+
requiresConfirmation: boolean;
|
|
3702
|
+
allowedModes: string[];
|
|
3703
|
+
}
|
|
3704
|
+
declare function createMcpToolPolicy(server: string, tool: string, risk: ExtensionRisk, allowedModes?: string[]): McpToolPolicy;
|
|
3705
|
+
|
|
3256
3706
|
/**
|
|
3257
3707
|
* Tool exports for Corbat-Coco
|
|
3258
3708
|
*/
|
|
@@ -3300,4 +3750,4 @@ interface SystemProxyConfig {
|
|
|
3300
3750
|
*/
|
|
3301
3751
|
declare function installProxyDispatcher(resolveSystem?: () => SystemProxyConfig | null): string | null;
|
|
3302
3752
|
|
|
3303
|
-
export { ADRGenerator, AnthropicProvider, ArchitectureGenerator, type Backlog, BacklogGenerator, CICDGenerator, type ChatOptions, type ChatResponse, type CocoConfig, CocoError, CodeGenerator, CodeReviewer, CompleteExecutor, ConfigError, ConvergeExecutor, DiscoveryEngine, DockerGenerator, DocsGenerator, type Epic, type LLMProvider, type Message, OrchestrateExecutor, type Orchestrator, type OrchestratorConfig, OutputExecutor, type Phase, type PhaseContext, PhaseError, type PhaseExecutor, type PhaseResult, type Progress, type ProjectState, type QualityDimensions, type QualityScores, type QualityThresholds, SessionManager, SpecificationGenerator, type Sprint, type Story, type Task, TaskError, type TaskHistory, TaskIterator, type TaskVersion, ToolRegistry, VERSION, configExists, createADRGenerator, createAnthropicProvider, createArchitectureGenerator, createBacklogGenerator, createCICDGenerator, createCodeGenerator, createCodeReviewer, createCompleteExecutor, createConvergeExecutor, createDefaultConfig, createDiscoveryEngine, createDockerGenerator, createDocsGenerator, createFullToolRegistry, createLogger, createOrchestrateExecutor, createOrchestrator, createOutputExecutor, createProvider, createSessionManager, createSpecificationGenerator, createTaskIterator, createToolRegistry, installProxyDispatcher, loadConfig, registerAllTools, saveConfig };
|
|
3753
|
+
export { ADRGenerator, AGENT_MODES, type AgentModeDefinition, type AgentModeId, AgentRuntime, type AgentRuntimeOptions, type AgentRuntimeSnapshot, type AgentSurface, AnthropicProvider, ArchitectureGenerator, type Backlog, BacklogGenerator, CICDGenerator, type ChatOptions, type ChatResponse, type CocoConfig, CocoError, CodeGenerator, CodeReviewer, CompleteExecutor, ConfigError, ConvergeExecutor, DEFAULT_WORKFLOWS, DefaultPermissionPolicy, DefaultRuntimeTurnRunner, DiscoveryEngine, DockerGenerator, DocsGenerator, type Epic, type EventLog, type ExtensionRisk, FileEventLog, FileRuntimeSessionStore, InMemoryEventLog, InMemoryRuntimeSessionStore, type LLMProvider, type McpToolPolicy, type Message, OrchestrateExecutor, type Orchestrator, type OrchestratorConfig, OutputExecutor, type PermissionDecision, type PermissionPolicy, type Phase, type PhaseContext, PhaseError, type PhaseExecutor, type PhaseResult, type Progress, type ProjectState, ProviderRegistry, type ProviderRuntimeSelection, type QualityDimensions, type QualityScores, type QualityThresholds, type ReasoningEffort, type RecipeManifest, type RecipeStep, type RuntimeEvent, type RuntimeEventType, type RuntimeHttpServerOptions, type RuntimeMode, type RuntimeSession, type RuntimeSessionCreateOptions, type RuntimeSessionStore, type RuntimeToolExecutionInput, type RuntimeToolExecutionResult, type RuntimeTurnContext, type RuntimeTurnInput, type RuntimeTurnResult, type RuntimeTurnRunner, type RuntimeTurnStreamEvent, SessionManager, type SkillManifest, SpecificationGenerator, type Sprint, type Story, type Task, TaskError, type TaskHistory, TaskIterator, type TaskVersion, ToolRegistry, VERSION, WorkflowCatalog, type WorkflowDefinition, WorkflowEngine, type WorkflowHandler, type WorkflowPlan, WorkflowRegistry, type WorkflowRisk, type WorkflowRunContext, type WorkflowRunInput, type WorkflowRunResult, type WorkflowRunStatus, type WorkflowStepDefinition, configExists, createADRGenerator, createAgentRuntime, createAnthropicProvider, createArchitectureGenerator, createBacklogGenerator, createCICDGenerator, createCodeGenerator, createCodeReviewer, createCompleteExecutor, createConvergeExecutor, createDefaultConfig, createDefaultRuntimeTurnRunner, createDiscoveryEngine, createDockerGenerator, createDocsGenerator, createEventLog, createFileEventLog, createFileRuntimeSessionStore, createFullToolRegistry, createLogger, createMcpToolPolicy, createOrchestrateExecutor, createOrchestrator, createOutputExecutor, createPermissionPolicy, createProvider, createProviderRegistry, createRuntimeHttpServer, createRuntimeSessionStore, createSessionManager, createSpecificationGenerator, createTaskIterator, createToolRegistry, createWorkflowCatalog, createWorkflowEngine, createWorkflowRegistry, getAgentMode, installProxyDispatcher, isAgentMode, listAgentModes, loadConfig, registerAllTools, saveConfig };
|