flavor-code 1.2.1
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/LICENSE +21 -0
- package/README.md +1081 -0
- package/dist/agent/loop.d.ts +31 -0
- package/dist/agent/message-queue.d.ts +19 -0
- package/dist/agent/planner.d.ts +28 -0
- package/dist/agent/subagents.d.ts +50 -0
- package/dist/agent/task-plan.d.ts +60 -0
- package/dist/agent/task-tools.d.ts +11 -0
- package/dist/agent/types.d.ts +117 -0
- package/dist/app-WC2XXGLM.js +3185 -0
- package/dist/app-WC2XXGLM.js.map +1 -0
- package/dist/auth/oauth-config.d.ts +4 -0
- package/dist/auth/oauth.d.ts +21 -0
- package/dist/auth/store.d.ts +15 -0
- package/dist/auth/types.d.ts +33 -0
- package/dist/chunk-BU64GNXE.js +15771 -0
- package/dist/chunk-BU64GNXE.js.map +1 -0
- package/dist/chunk-DM64TM4Z.js +124 -0
- package/dist/chunk-DM64TM4Z.js.map +1 -0
- package/dist/chunk-JZ322RCJ.js +40 -0
- package/dist/chunk-JZ322RCJ.js.map +1 -0
- package/dist/chunk-M744K7MK.js +246 -0
- package/dist/chunk-M744K7MK.js.map +1 -0
- package/dist/chunk-MVIMQEQT.js +692 -0
- package/dist/chunk-MVIMQEQT.js.map +1 -0
- package/dist/chunk-VOCZVFP7.js +153 -0
- package/dist/chunk-VOCZVFP7.js.map +1 -0
- package/dist/chunk-XS2JU6S3.js +35557 -0
- package/dist/chunk-XS2JU6S3.js.map +1 -0
- package/dist/claude-ink-ZL4UZMFY.js +27 -0
- package/dist/claude-ink-ZL4UZMFY.js.map +1 -0
- package/dist/cli.js +915 -0
- package/dist/cli.js.map +1 -0
- package/dist/codeisland/activate.mjs +74 -0
- package/dist/codeisland/bridge.mjs +97 -0
- package/dist/codeisland/flavor-plugin.json +27 -0
- package/dist/config/load.d.ts +19 -0
- package/dist/config/protected-file.d.ts +15 -0
- package/dist/config/schema.d.ts +176 -0
- package/dist/config/secret-envelope.d.ts +8 -0
- package/dist/context/compaction.d.ts +44 -0
- package/dist/context/manager.d.ts +65 -0
- package/dist/context/summarizer.d.ts +15 -0
- package/dist/desktop/main.js +17778 -0
- package/dist/desktop/main.js.map +1 -0
- package/dist/desktop/preload.cjs +90 -0
- package/dist/desktop/preload.cjs.map +1 -0
- package/dist/desktop-renderer/assets/index-C66pDvHs.js +144 -0
- package/dist/desktop-renderer/assets/index-C66pDvHs.js.map +1 -0
- package/dist/desktop-renderer/assets/index-Cm_ktmXm.css +1 -0
- package/dist/desktop-renderer/index.html +16 -0
- package/dist/devtools-SXJBSV2N.js +3 -0
- package/dist/devtools-SXJBSV2N.js.map +1 -0
- package/dist/execution/docker.d.ts +29 -0
- package/dist/execution/factory.d.ts +3 -0
- package/dist/execution/types.d.ts +18 -0
- package/dist/goal/classifier.d.ts +12 -0
- package/dist/goal/orchestrator.d.ts +34 -0
- package/dist/goal/planner.d.ts +9 -0
- package/dist/goal/store.d.ts +9 -0
- package/dist/goal/types.d.ts +190 -0
- package/dist/hallucination/confidence.d.ts +12 -0
- package/dist/hallucination/evidence-ledger.d.ts +29 -0
- package/dist/hallucination/guard.d.ts +27 -0
- package/dist/hallucination/messages.d.ts +10 -0
- package/dist/hallucination/retry-monitor.d.ts +19 -0
- package/dist/hallucination/sliding-window.d.ts +13 -0
- package/dist/hallucination/types.d.ts +49 -0
- package/dist/harness/local.d.ts +54 -0
- package/dist/hooks/bus.d.ts +9 -0
- package/dist/hooks/types.d.ts +105 -0
- package/dist/ide/client.d.ts +35 -0
- package/dist/incidents/reporter.d.ts +38 -0
- package/dist/init/project.d.ts +25 -0
- package/dist/load-WQGNTCHC.js +20 -0
- package/dist/load-WQGNTCHC.js.map +1 -0
- package/dist/loop/budget.d.ts +11 -0
- package/dist/loop/isolation.d.ts +21 -0
- package/dist/loop/orchestrator.d.ts +82 -0
- package/dist/loop/store.d.ts +13 -0
- package/dist/loop/types.d.ts +142 -0
- package/dist/loop/verifier.d.ts +13 -0
- package/dist/mcp/client.d.ts +66 -0
- package/dist/mcp/sdk.d.ts +27 -0
- package/dist/memory/coordinator.d.ts +32 -0
- package/dist/memory/extractor.d.ts +15 -0
- package/dist/memory/intent.d.ts +2 -0
- package/dist/memory/retrieval.d.ts +13 -0
- package/dist/memory/review.d.ts +36 -0
- package/dist/memory/similarity.d.ts +5 -0
- package/dist/memory/store.d.ts +58 -0
- package/dist/memory/types.d.ts +37 -0
- package/dist/models/anthropic.d.ts +24 -0
- package/dist/models/cache-profile.d.ts +23 -0
- package/dist/models/openai.d.ts +24 -0
- package/dist/models/registry.d.ts +16 -0
- package/dist/models/structured.d.ts +75 -0
- package/dist/models/types.d.ts +93 -0
- package/dist/permissions/classifier.d.ts +9 -0
- package/dist/permissions/engine.d.ts +28 -0
- package/dist/plugins/host.d.ts +15 -0
- package/dist/plugins/types.d.ts +136 -0
- package/dist/production.d.ts +59 -0
- package/dist/prompts/system.d.ts +28 -0
- package/dist/rpc/schema.d.ts +61 -0
- package/dist/rpc/server.d.ts +54 -0
- package/dist/sdk/index.d.ts +19 -0
- package/dist/sdk/index.js +53 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/session/checkpoint.d.ts +25 -0
- package/dist/session/store.d.ts +154 -0
- package/dist/session/tree.d.ts +31 -0
- package/dist/skills/builtin-loop.d.ts +12 -0
- package/dist/skills/registry.d.ts +47 -0
- package/dist/skills/tool.d.ts +9 -0
- package/dist/sleep/organizer.d.ts +37 -0
- package/dist/tools/ask-user-question.d.ts +49 -0
- package/dist/tools/file-diff.d.ts +9 -0
- package/dist/tools/files.d.ts +49 -0
- package/dist/tools/lsp.d.ts +77 -0
- package/dist/tools/managed.d.ts +59 -0
- package/dist/tools/runtime.d.ts +58 -0
- package/dist/tools/search.d.ts +76 -0
- package/dist/tools/shell.d.ts +37 -0
- package/dist/tools/task-output.d.ts +53 -0
- package/dist/tools/todo-write.d.ts +35 -0
- package/dist/tools/types.d.ts +56 -0
- package/dist/trace/recorder.d.ts +14 -0
- package/dist/trace/replay.d.ts +3 -0
- package/dist/trace/schema.d.ts +26 -0
- package/dist/ui/commands.d.ts +67 -0
- package/dist/ui/session.d.ts +126 -0
- package/dist/ui/transcript.d.ts +89 -0
- package/dist/utils/async.d.ts +5 -0
- package/dist/utils/envUtils.d.ts +1 -0
- package/dist/utils/error.d.ts +2 -0
- package/dist/utils/execFileNoThrow.d.ts +13 -0
- package/dist/utils/intl.d.ts +18 -0
- package/dist/utils/json.d.ts +44 -0
- package/dist/utils/log.d.ts +28 -0
- package/dist/utils/redact.d.ts +10 -0
- package/dist/utils/usage-summary.d.ts +34 -0
- package/dist/utils/version.d.ts +6 -0
- package/package.json +124 -0
- package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +4797 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ContextManager } from "../context/manager.js";
|
|
2
|
+
import type { HallucinationGuard } from "../hallucination/guard.js";
|
|
3
|
+
import type { HookBus } from "../hooks/bus.js";
|
|
4
|
+
import type { ModelRegistry } from "../models/registry.js";
|
|
5
|
+
import { type ModelTool } from "../models/types.js";
|
|
6
|
+
import type { ToolRuntime } from "../tools/runtime.js";
|
|
7
|
+
import type { AgentEvent, AgentRunRequest } from "./types.js";
|
|
8
|
+
export interface AgentLoopOptions {
|
|
9
|
+
registry: ModelRegistry;
|
|
10
|
+
modelId: string;
|
|
11
|
+
fallbackModelId?: string;
|
|
12
|
+
context: ContextManager;
|
|
13
|
+
runtime: ToolRuntime;
|
|
14
|
+
hooks: HookBus;
|
|
15
|
+
tools: readonly ModelTool[];
|
|
16
|
+
maxIterations?: number;
|
|
17
|
+
softLimitFactor?: number;
|
|
18
|
+
extendIterations?: number;
|
|
19
|
+
maxExtensions?: number;
|
|
20
|
+
hasActiveProgress?(): boolean;
|
|
21
|
+
agent?: "main" | "subagent";
|
|
22
|
+
hallucinationGuard?: HallucinationGuard;
|
|
23
|
+
}
|
|
24
|
+
export declare class AgentLoop {
|
|
25
|
+
#private;
|
|
26
|
+
constructor(options: AgentLoopOptions);
|
|
27
|
+
get modelId(): string;
|
|
28
|
+
setModel(modelId: string): void;
|
|
29
|
+
setFallbackModel(modelId: string): void;
|
|
30
|
+
run(request: AgentRunRequest): AsyncIterable<AgentEvent>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type AgentQueueKind = "steer" | "followUp";
|
|
2
|
+
export type AgentQueueMode = "one-at-a-time" | "all";
|
|
3
|
+
export interface AgentQueueSnapshot {
|
|
4
|
+
steering: readonly string[];
|
|
5
|
+
followUp: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
export interface AgentMessageQueueOptions {
|
|
8
|
+
steeringMode?: AgentQueueMode;
|
|
9
|
+
followUpMode?: AgentQueueMode;
|
|
10
|
+
}
|
|
11
|
+
export declare class AgentMessageQueue {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(options?: AgentMessageQueueOptions);
|
|
14
|
+
get hasPending(): boolean;
|
|
15
|
+
enqueue(kind: AgentQueueKind, message: string): void;
|
|
16
|
+
drain(kind: AgentQueueKind): string[];
|
|
17
|
+
snapshot(): AgentQueueSnapshot;
|
|
18
|
+
clear(): AgentQueueSnapshot;
|
|
19
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { HookBus } from "../hooks/bus.js";
|
|
3
|
+
export declare const TaskNodeSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
description: z.ZodString;
|
|
6
|
+
dependencies: z.ZodArray<z.ZodString>;
|
|
7
|
+
expectedOutputs: z.ZodArray<z.ZodString>;
|
|
8
|
+
verification: z.ZodArray<z.ZodString>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export declare const TaskGraphSchema: z.ZodObject<{
|
|
11
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
description: z.ZodString;
|
|
14
|
+
dependencies: z.ZodArray<z.ZodString>;
|
|
15
|
+
expectedOutputs: z.ZodArray<z.ZodString>;
|
|
16
|
+
verification: z.ZodArray<z.ZodString>;
|
|
17
|
+
}, z.core.$strict>>;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export type TaskNode = z.infer<typeof TaskNodeSchema>;
|
|
20
|
+
export type TaskGraph = z.infer<typeof TaskGraphSchema>;
|
|
21
|
+
export interface TaskPlannerOptions {
|
|
22
|
+
hooks: HookBus;
|
|
23
|
+
}
|
|
24
|
+
export declare class TaskPlanner {
|
|
25
|
+
#private;
|
|
26
|
+
constructor(options: TaskPlannerOptions);
|
|
27
|
+
plan(input: unknown, signal?: AbortSignal): Promise<TaskGraph>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { HookBus } from "../hooks/bus.js";
|
|
3
|
+
import { type ModelMessage } from "../models/types.js";
|
|
4
|
+
import { type TaskGraph, type TaskNode } from "./planner.js";
|
|
5
|
+
export declare const SubagentResultSchema: z.ZodObject<{
|
|
6
|
+
taskId: z.ZodString;
|
|
7
|
+
status: z.ZodEnum<{
|
|
8
|
+
blocked: "blocked";
|
|
9
|
+
completed: "completed";
|
|
10
|
+
failed: "failed";
|
|
11
|
+
}>;
|
|
12
|
+
summary: z.ZodString;
|
|
13
|
+
filesChanged: z.ZodArray<z.ZodString>;
|
|
14
|
+
commandsRun: z.ZodArray<z.ZodObject<{
|
|
15
|
+
command: z.ZodString;
|
|
16
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
17
|
+
summary: z.ZodString;
|
|
18
|
+
}, z.core.$strict>>;
|
|
19
|
+
verification: z.ZodArray<z.ZodObject<{
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
passed: z.ZodBoolean;
|
|
22
|
+
details: z.ZodString;
|
|
23
|
+
}, z.core.$strict>>;
|
|
24
|
+
artifacts: z.ZodArray<z.ZodString>;
|
|
25
|
+
risks: z.ZodArray<z.ZodString>;
|
|
26
|
+
suggestedNextSteps: z.ZodArray<z.ZodString>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export type SubagentResult = z.infer<typeof SubagentResultSchema>;
|
|
29
|
+
export type SubagentState = "pending" | "running" | "completed" | "failed" | "blocked" | "cancelled";
|
|
30
|
+
export interface SubagentExecution {
|
|
31
|
+
attempt: 1 | 2;
|
|
32
|
+
signal: AbortSignal;
|
|
33
|
+
}
|
|
34
|
+
export interface SubagentSchedulerOptions {
|
|
35
|
+
maxSubagents?: number;
|
|
36
|
+
hooks: HookBus;
|
|
37
|
+
execute(task: TaskNode, execution: SubagentExecution): Promise<unknown>;
|
|
38
|
+
onResult?(result: SubagentResult): void | Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
export interface SubagentRunResult {
|
|
41
|
+
states: Record<string, SubagentState>;
|
|
42
|
+
results: Record<string, SubagentResult>;
|
|
43
|
+
}
|
|
44
|
+
export declare function subagentResultFromTaskOutput(taskId: string, output: unknown): SubagentResult | undefined;
|
|
45
|
+
export declare function parseFinalSubagentMessage(messages: readonly ModelMessage[]): unknown;
|
|
46
|
+
export declare class SubagentScheduler {
|
|
47
|
+
#private;
|
|
48
|
+
constructor(options: SubagentSchedulerOptions);
|
|
49
|
+
run(input: TaskGraph, externalSignal?: AbortSignal): Promise<SubagentRunResult>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const PlanTaskStatusSchema: z.ZodEnum<{
|
|
3
|
+
blocked: "blocked";
|
|
4
|
+
cancelled: "cancelled";
|
|
5
|
+
completed: "completed";
|
|
6
|
+
failed: "failed";
|
|
7
|
+
in_progress: "in_progress";
|
|
8
|
+
pending: "pending";
|
|
9
|
+
}>;
|
|
10
|
+
export declare const PlanTaskSchema: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
subject: z.ZodString;
|
|
13
|
+
activeForm: z.ZodString;
|
|
14
|
+
status: z.ZodEnum<{
|
|
15
|
+
blocked: "blocked";
|
|
16
|
+
cancelled: "cancelled";
|
|
17
|
+
completed: "completed";
|
|
18
|
+
failed: "failed";
|
|
19
|
+
in_progress: "in_progress";
|
|
20
|
+
pending: "pending";
|
|
21
|
+
}>;
|
|
22
|
+
dependencies: z.ZodArray<z.ZodString>;
|
|
23
|
+
result: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
export declare const TaskPlanSchema: z.ZodObject<{
|
|
26
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
subject: z.ZodString;
|
|
29
|
+
activeForm: z.ZodString;
|
|
30
|
+
status: z.ZodEnum<{
|
|
31
|
+
blocked: "blocked";
|
|
32
|
+
cancelled: "cancelled";
|
|
33
|
+
completed: "completed";
|
|
34
|
+
failed: "failed";
|
|
35
|
+
in_progress: "in_progress";
|
|
36
|
+
pending: "pending";
|
|
37
|
+
}>;
|
|
38
|
+
dependencies: z.ZodArray<z.ZodString>;
|
|
39
|
+
result: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.core.$strict>>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
export declare const TaskUpdateInputSchema: z.ZodObject<{
|
|
43
|
+
taskId: z.ZodString;
|
|
44
|
+
status: z.ZodEnum<{
|
|
45
|
+
blocked: "blocked";
|
|
46
|
+
cancelled: "cancelled";
|
|
47
|
+
completed: "completed";
|
|
48
|
+
failed: "failed";
|
|
49
|
+
in_progress: "in_progress";
|
|
50
|
+
pending: "pending";
|
|
51
|
+
}>;
|
|
52
|
+
result: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
export type PlanTaskStatus = z.infer<typeof PlanTaskStatusSchema>;
|
|
55
|
+
export type PlanTask = z.infer<typeof PlanTaskSchema>;
|
|
56
|
+
export type TaskPlan = z.infer<typeof TaskPlanSchema>;
|
|
57
|
+
export type TaskUpdateInput = z.infer<typeof TaskUpdateInputSchema>;
|
|
58
|
+
export declare function updatePlanTask(plan: TaskPlan, input: TaskUpdateInput): TaskPlan;
|
|
59
|
+
export declare function activateNextReadyTask(plan: TaskPlan): TaskPlan;
|
|
60
|
+
export declare function normalizeAbandonedPlan(plan: TaskPlan): TaskPlan;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type TaskPlan, type TaskUpdateInput } from "./task-plan.js";
|
|
2
|
+
import type { ToolDefinition } from "../tools/types.js";
|
|
3
|
+
export declare const MAIN_TASK_TOOL_NAMES: Set<string>;
|
|
4
|
+
export interface TaskPlanToolOptions {
|
|
5
|
+
getPlan(): TaskPlan | undefined;
|
|
6
|
+
commit(plan: TaskPlan, operation: "replace" | "update"): void | Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createTaskPlanTools(options: TaskPlanToolOptions): readonly [
|
|
9
|
+
ToolDefinition<TaskPlan>,
|
|
10
|
+
ToolDefinition<TaskUpdateInput>
|
|
11
|
+
];
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { ModelMessage, ProviderErrorCode } from "../models/types.js";
|
|
2
|
+
import type { ToolResult } from "../tools/types.js";
|
|
3
|
+
import type { TaskGraph } from "./planner.js";
|
|
4
|
+
import type { SubagentState } from "./subagents.js";
|
|
5
|
+
import type { TaskPlan } from "./task-plan.js";
|
|
6
|
+
export interface AgentRunRequest {
|
|
7
|
+
prompt: string;
|
|
8
|
+
/** Optional rich initial user message. Text-only routing continues to use prompt. */
|
|
9
|
+
initialUserMessage?: Extract<ModelMessage, {
|
|
10
|
+
role: "user";
|
|
11
|
+
}>;
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
/** Prompt-scoped system context, such as a matched skill body. It is never stored. */
|
|
14
|
+
additionalContext?: string;
|
|
15
|
+
/** Messages supplied while a tool batch is running, injected before the next model call. */
|
|
16
|
+
getSteeringMessages?(): readonly string[];
|
|
17
|
+
}
|
|
18
|
+
export type AgentErrorCode = ProviderErrorCode | "iteration_limit" | "incomplete_stream";
|
|
19
|
+
export interface AgentError {
|
|
20
|
+
code: AgentErrorCode;
|
|
21
|
+
message: string;
|
|
22
|
+
}
|
|
23
|
+
export interface TaskSnapshot {
|
|
24
|
+
plan?: TaskPlan;
|
|
25
|
+
subagents: {
|
|
26
|
+
graph?: TaskGraph;
|
|
27
|
+
states: Record<string, SubagentState>;
|
|
28
|
+
/** Unix-ms timestamp captured when each subagent transitioned to "running". */
|
|
29
|
+
startedAt?: Record<string, number>;
|
|
30
|
+
/** Frozen elapsed-ms captured when each subagent reached a terminal state. */
|
|
31
|
+
elapsedMs?: Record<string, number>;
|
|
32
|
+
};
|
|
33
|
+
foregroundTaskId?: string;
|
|
34
|
+
}
|
|
35
|
+
export type AgentEvent = {
|
|
36
|
+
type: "model-start";
|
|
37
|
+
id: string;
|
|
38
|
+
} | {
|
|
39
|
+
type: "model-end";
|
|
40
|
+
id: string;
|
|
41
|
+
} | {
|
|
42
|
+
type: "text";
|
|
43
|
+
text: string;
|
|
44
|
+
} | {
|
|
45
|
+
type: "tool-start";
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
input: unknown;
|
|
49
|
+
label?: string;
|
|
50
|
+
hint?: string;
|
|
51
|
+
} | {
|
|
52
|
+
type: "tool-end";
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
result: ToolResult;
|
|
56
|
+
label?: string;
|
|
57
|
+
hint?: string;
|
|
58
|
+
} | {
|
|
59
|
+
type: "tasks";
|
|
60
|
+
snapshot: TaskSnapshot;
|
|
61
|
+
} | {
|
|
62
|
+
type: "tasks-cleared";
|
|
63
|
+
} | {
|
|
64
|
+
type: "usage";
|
|
65
|
+
inputTokens: number;
|
|
66
|
+
outputTokens: number;
|
|
67
|
+
totalInputTokens: number;
|
|
68
|
+
totalOutputTokens: number;
|
|
69
|
+
cacheReadTokens?: number;
|
|
70
|
+
cacheCreationTokens?: number;
|
|
71
|
+
} | {
|
|
72
|
+
type: "model-retry";
|
|
73
|
+
attempt: number;
|
|
74
|
+
maxAttempts: number;
|
|
75
|
+
delayMs: number;
|
|
76
|
+
} | {
|
|
77
|
+
type: "structured-output-retry";
|
|
78
|
+
tool: string;
|
|
79
|
+
modelId: string;
|
|
80
|
+
attempt: number;
|
|
81
|
+
maxAttempts: number;
|
|
82
|
+
delayMs: number;
|
|
83
|
+
error: string;
|
|
84
|
+
} | {
|
|
85
|
+
type: "loop-progress";
|
|
86
|
+
loopId: string;
|
|
87
|
+
phase: "resolved" | "cycle" | "verification" | "budget" | "terminal";
|
|
88
|
+
state: "running" | "completed" | "failed" | "cancelled" | "info";
|
|
89
|
+
message: string;
|
|
90
|
+
} | {
|
|
91
|
+
type: "compact-progress";
|
|
92
|
+
progress: number;
|
|
93
|
+
} | {
|
|
94
|
+
type: "compacted";
|
|
95
|
+
} | {
|
|
96
|
+
type: "notice";
|
|
97
|
+
message: string;
|
|
98
|
+
} | {
|
|
99
|
+
type: "warning";
|
|
100
|
+
message: string;
|
|
101
|
+
} | {
|
|
102
|
+
type: "limit_reached";
|
|
103
|
+
iteration: number;
|
|
104
|
+
maxIterations: number;
|
|
105
|
+
extended: boolean;
|
|
106
|
+
} | {
|
|
107
|
+
type: "done";
|
|
108
|
+
usage: {
|
|
109
|
+
inputTokens: number;
|
|
110
|
+
outputTokens: number;
|
|
111
|
+
cacheReadTokens?: number;
|
|
112
|
+
cacheCreationTokens?: number;
|
|
113
|
+
};
|
|
114
|
+
} | {
|
|
115
|
+
type: "error";
|
|
116
|
+
error: AgentError;
|
|
117
|
+
};
|