agent-afk 5.302.13 → 5.303.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/dist/agent/dag-subagent.d.ts +3 -0
- package/dist/agent/dag-subagent.dispatch.d.ts +3 -0
- package/dist/agent/dag-subagent.recovery.d.ts +4 -0
- package/dist/agent/journal/journal-file.d.ts +1 -0
- package/dist/agent/journal/types.d.ts +1 -0
- package/dist/agent/model-limits.d.ts +2 -2
- package/dist/agent/outcomes/schema.d.ts +1 -1
- package/dist/agent/provider.d.ts +2 -0
- package/dist/agent/providers/anthropic-direct/loop/connection-create.d.ts +19 -0
- package/dist/agent/providers/anthropic-direct/loop/round-request.d.ts +2 -11
- package/dist/agent/providers/openai-compatible/catalog-awareness.d.ts +14 -0
- package/dist/agent/providers/openai-compatible/models-catalog.d.ts +11 -0
- package/dist/agent/providers/openai-compatible/query/context-overflow.d.ts +1 -1
- package/dist/agent/providers/openai-compatible/query/context-pressure.d.ts +4 -0
- package/dist/agent/providers/openai-compatible/query/stream-drive.connection.d.ts +1 -1
- package/dist/agent/providers/openai-compatible/query/stream-drive.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/query/turn-iteration.d.ts +2 -1
- package/dist/agent/providers/shared/connection-loop-lag.d.ts +4 -0
- package/dist/agent/providers/shared/connection-retry-budget.d.ts +10 -0
- package/dist/agent/providers/shared/context-pressure.d.ts +7 -0
- package/dist/agent/providers/shared/tool-loop-cap.d.ts +1 -0
- package/dist/agent/subagent/capped-handoff.d.ts +26 -0
- package/dist/agent/subagent/result.d.ts +2 -1
- package/dist/agent/tools/compose-agent-resolve.d.ts +1 -0
- package/dist/agent/tools/compose-node-results.d.ts +14 -0
- package/dist/agent/tools/subagent-executor.notices.d.ts +4 -0
- package/dist/agent/trace/events.d.ts +12 -0
- package/dist/agent/trace/events.session-phase.d.ts +12 -0
- package/dist/agent/trace/types.d.ts +6 -0
- package/dist/agent/trace/types.session-phase.d.ts +1 -1
- package/dist/agent/types/session-types.d.ts +2 -0
- package/dist/cli.mjs +364 -356
- package/dist/config/env.d.ts +23 -0
- package/dist/config/env.model.d.ts +23 -0
- package/dist/index.mjs +158 -152
- package/dist/telegram.mjs +189 -181
- package/package.json +1 -1
|
@@ -7,7 +7,9 @@ import type { JournalParent } from './subagent/fork-types.js';
|
|
|
7
7
|
import { type DAGEdge, type DAGRunResult } from './dag.js';
|
|
8
8
|
import type { DelegationBudget } from './tools/delegation-budget.js';
|
|
9
9
|
import type { ImageBlockAttachment } from './content/image-blocks.js';
|
|
10
|
+
import type { TraceSink } from './trace/index.js';
|
|
10
11
|
export interface SubagentDAGNode {
|
|
12
|
+
replaySafe?: boolean;
|
|
11
13
|
id: string;
|
|
12
14
|
systemPrompt: string;
|
|
13
15
|
promptBuilder: (inputs: Record<string, unknown>) => string;
|
|
@@ -32,6 +34,7 @@ export interface SubagentDAGNode {
|
|
|
32
34
|
resolvedAttachments?: ImageBlockAttachment[];
|
|
33
35
|
}
|
|
34
36
|
export interface SubagentDAGOptions {
|
|
37
|
+
traceWriter?: TraceSink;
|
|
35
38
|
manager: SubagentManager;
|
|
36
39
|
parentSession: Pick<IAgentSession, 'sessionId' | 'abortSignal'> & JournalParent;
|
|
37
40
|
nodes: SubagentDAGNode[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SubagentDAGNode, SubagentDAGOptions } from './dag-subagent.js';
|
|
2
|
+
import type { SubagentResult } from './subagent/result.js';
|
|
3
|
+
export declare function dispatchDagNode(originalSpec: SubagentDAGNode, inputs: Record<string, unknown>, nodeSignal: AbortSignal, options: SubagentDAGOptions, softDeadlineForNode: number, isolationCounter: number): Promise<SubagentResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SubagentResult } from './subagent/result.js';
|
|
2
|
+
import type { TraceSink } from './trace/index.js';
|
|
3
|
+
export declare function isComposeReplaySafe(tools: readonly string[] | undefined): boolean;
|
|
4
|
+
export declare function recoverDagNode(id: string, dispatch: () => Promise<SubagentResult>, signal: AbortSignal, sideEffectFree: boolean, traceWriter?: TraceSink): Promise<SubagentResult>;
|
|
@@ -26,6 +26,7 @@ export declare class JournalFileWriter {
|
|
|
26
26
|
private len;
|
|
27
27
|
constructor(shared: JournalSessionShared, subagentId?: string | undefined);
|
|
28
28
|
get length(): number;
|
|
29
|
+
get path(): string | undefined;
|
|
29
30
|
get isClosed(): boolean;
|
|
30
31
|
record(input: JournalRecordInput): void;
|
|
31
32
|
private recordUnsafe;
|
|
@@ -121,6 +121,7 @@ export type JournalRecordInput = Omit<Extract<JournalRecord, {
|
|
|
121
121
|
kind: 'mark';
|
|
122
122
|
}>, 'v' | 'ts'>;
|
|
123
123
|
export interface MessageJournal {
|
|
124
|
+
readonly path?: string;
|
|
124
125
|
readonly length: number;
|
|
125
126
|
append(index: number, message: JournalMessage): void;
|
|
126
127
|
truncate(length: number, reason?: JournalTruncateReason): void;
|
|
@@ -3,5 +3,5 @@ export declare const MODEL_MAX_OUTPUT_TOKENS: Record<string, number>;
|
|
|
3
3
|
export declare function maxOutputTokensForKnown(model: ClaudeModel | string): number | undefined;
|
|
4
4
|
export declare function maxOutputTokensFor(model: ClaudeModel | string): number;
|
|
5
5
|
export declare const MODEL_CONTEXT_LIMITS: Record<string, number>;
|
|
6
|
-
export declare function contextLimitFor(model: ClaudeModel | string): number;
|
|
7
|
-
export declare function autoCompactLimitFor(model: ClaudeModel | string): number;
|
|
6
|
+
export declare function contextLimitFor(model: ClaudeModel | string, subscriptionPath?: boolean): number;
|
|
7
|
+
export declare function autoCompactLimitFor(model: ClaudeModel | string, subscriptionPath?: boolean): number;
|
|
@@ -56,9 +56,9 @@ export declare const VerifiedOutcomeSchema: z.ZodObject<{
|
|
|
56
56
|
self_report: z.ZodEnum<{
|
|
57
57
|
done: "done";
|
|
58
58
|
blocked: "blocked";
|
|
59
|
+
none: "none";
|
|
59
60
|
asking: "asking";
|
|
60
61
|
interrupted: "interrupted";
|
|
61
|
-
none: "none";
|
|
62
62
|
}>;
|
|
63
63
|
artifacts: z.ZodObject<{
|
|
64
64
|
commits: z.ZodArray<z.ZodString>;
|
package/dist/agent/provider.d.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AnthropicMessagesCreateParams } from '../types.js';
|
|
2
|
+
export declare class ConnectionOverloadExhaustedError extends Error {
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
5
|
+
export interface ConnectionRetryInfo {
|
|
6
|
+
attempt: number;
|
|
7
|
+
delayMs: number;
|
|
8
|
+
error: Error;
|
|
9
|
+
}
|
|
10
|
+
export interface ConnectionLifecycleInfo {
|
|
11
|
+
phase: 'connection_failure' | 'connection_recovered' | 'connection_budget_exhausted';
|
|
12
|
+
metadata: Record<string, string | number | boolean>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createWithRetry(client: {
|
|
15
|
+
messages: {
|
|
16
|
+
create(params: unknown, opts: unknown): unknown;
|
|
17
|
+
};
|
|
18
|
+
baseURL?: string;
|
|
19
|
+
}, params: AnthropicMessagesCreateParams, headers: Record<string, string>, requestSignal: AbortSignal, turnSignal: AbortSignal, onConnectionRetry?: (info: ConnectionRetryInfo) => void, onLifecycle?: (info: ConnectionLifecycleInfo) => void): Promise<AsyncIterable<unknown>>;
|
|
@@ -2,19 +2,10 @@ import type { ProviderEvent } from '../../../provider.js';
|
|
|
2
2
|
import type { AnthropicMessagesCreateParams, AnthropicToolDef, RunTurnInput, WireToolDef } from '../types.js';
|
|
3
3
|
import { type FirstByteTimeoutHandle } from '../../shared/first-byte-timeout.js';
|
|
4
4
|
import { type StreamStallHandle } from '../../shared/stream-stall-timeout.js';
|
|
5
|
-
import {
|
|
5
|
+
import type { RoundRetryBudget } from './retry-budget.js';
|
|
6
6
|
import type { TurnAccumulator } from './turn-accumulator.js';
|
|
7
7
|
export declare function toWireTool(tool: AnthropicToolDef): WireToolDef;
|
|
8
|
-
export
|
|
9
|
-
messages: {
|
|
10
|
-
create(params: unknown, opts: unknown): unknown;
|
|
11
|
-
};
|
|
12
|
-
}, params: AnthropicMessagesCreateParams, headers: Record<string, string>, requestSignal: AbortSignal, turnSignal: AbortSignal, onConnectionRetry?: (info: ConnectionRetryInfo) => void): Promise<AsyncIterable<unknown>>;
|
|
13
|
-
export interface ConnectionRetryInfo {
|
|
14
|
-
attempt: number;
|
|
15
|
-
delayMs: number;
|
|
16
|
-
error: Error;
|
|
17
|
-
}
|
|
8
|
+
export { createWithRetry, type ConnectionRetryInfo } from './connection-create.js';
|
|
18
9
|
export interface OpenRoundTransport {
|
|
19
10
|
kind: 'opened';
|
|
20
11
|
events: AsyncIterable<unknown>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type CatalogReaderDeps } from './models-catalog.js';
|
|
2
|
+
import type { TraceSink } from '../../trace/index.js';
|
|
3
|
+
export declare function availableCatalogModels(deps?: CatalogReaderDeps): {
|
|
4
|
+
slug: string;
|
|
5
|
+
priority: number | undefined;
|
|
6
|
+
contextWindow: number | undefined;
|
|
7
|
+
maxContextWindow: number | undefined;
|
|
8
|
+
effectiveInputLimit: number | undefined;
|
|
9
|
+
upgrade: {
|
|
10
|
+
model: string;
|
|
11
|
+
migration_markdown?: string;
|
|
12
|
+
} | undefined;
|
|
13
|
+
}[];
|
|
14
|
+
export declare function catalogUpgradeNotice(model: string | undefined, trace?: TraceSink, deps?: CatalogReaderDeps): string | undefined;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
export interface CatalogModel {
|
|
2
2
|
slug: string;
|
|
3
|
+
context_window?: number;
|
|
4
|
+
effective_context_window_percent?: number;
|
|
5
|
+
max_context_window?: number;
|
|
6
|
+
visibility?: string;
|
|
7
|
+
supported_in_api?: boolean;
|
|
8
|
+
priority?: number;
|
|
9
|
+
upgrade?: {
|
|
10
|
+
model: string;
|
|
11
|
+
migration_markdown?: string;
|
|
12
|
+
};
|
|
3
13
|
service_tiers?: Array<{
|
|
4
14
|
id: string;
|
|
5
15
|
name?: string;
|
|
@@ -10,6 +20,7 @@ export interface CatalogModel {
|
|
|
10
20
|
export interface CatalogReaderDeps {
|
|
11
21
|
homedir?: () => string;
|
|
12
22
|
readFile?: (path: string) => string | null;
|
|
23
|
+
revision?: (path: string) => string | undefined;
|
|
13
24
|
}
|
|
14
25
|
export declare function resetCatalogCache(): void;
|
|
15
26
|
export declare function loadModelsCatalog(deps?: CatalogReaderDeps): Map<string, CatalogModel>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ProviderUsage } from '../../../provider.js';
|
|
2
|
-
export declare function checkContextOverflow(lastUsage: Partial<ProviderUsage> | null, currentModel: string, maxOutputTokens: number | undefined, configuredModel: string): Error | null;
|
|
2
|
+
export declare function checkContextOverflow(lastUsage: Partial<ProviderUsage> | null, currentModel: string, maxOutputTokens: number | undefined, configuredModel: string, subscriptionPath?: boolean): Error | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TurnDriverContext } from './turn-driver.js';
|
|
2
|
+
export declare const WIND_DOWN_MAX_OUTPUT_TOKENS = 4096;
|
|
3
|
+
export declare function windDownForContextPressure(ctx: TurnDriverContext, appendedAt: number): boolean;
|
|
4
|
+
export declare function canSynthesizeUnderPressure(ctx: TurnDriverContext, appendedAt: number): boolean;
|
|
@@ -6,4 +6,4 @@ export type ConnectionOutcome<TEvent> = {
|
|
|
6
6
|
ok: false;
|
|
7
7
|
error: unknown;
|
|
8
8
|
};
|
|
9
|
-
export declare function runConnectionPhase<TEvent>(createStream: (signal: AbortSignal) => Promise<AsyncIterable<TEvent>>, streamSignal: AbortSignal, userSignal: AbortSignal, traceWriter: TraceSink | undefined, resolvedModel: string): Promise<ConnectionOutcome<TEvent>>;
|
|
9
|
+
export declare function runConnectionPhase<TEvent>(createStream: (signal: AbortSignal) => Promise<AsyncIterable<TEvent>>, streamSignal: AbortSignal, userSignal: AbortSignal, traceWriter: TraceSink | undefined, resolvedModel: string, endpoint?: string): Promise<ConnectionOutcome<TEvent>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import OpenAI from 'openai';
|
|
2
|
+
import { CONTEXT_PRESSURE_WIND_DOWN } from '../../shared/context-pressure.js';
|
|
2
3
|
import type { AgentConfig } from '../../../types/config-types.js';
|
|
3
4
|
import type { ProviderEvent, ProviderUsage } from '../../../provider.js';
|
|
4
5
|
import { type OpenAIMessage } from '../messages.js';
|
|
@@ -37,4 +38,4 @@ export interface FinishTurnContext {
|
|
|
37
38
|
}
|
|
38
39
|
export declare function finishTurn(ctx: FinishTurnContext, accumulatedUsage: ProviderUsage, turnStartTime: number): Generator<ProviderEvent>;
|
|
39
40
|
export declare function pushUserTurn(ctx: IterationContext, content: import('../../../provider.js').ProviderUserTurn['content']): void;
|
|
40
|
-
export declare function runIteration(ctx: IterationContext, controller: AbortController, vision: boolean, windDown: typeof TOOL_USE_LOOP_CAPPED | typeof SOFT_DEADLINE_WIND_DOWN | null): AsyncGenerator<ProviderEvent, IterationResult | null>;
|
|
41
|
+
export declare function runIteration(ctx: IterationContext, controller: AbortController, vision: boolean, windDown: typeof TOOL_USE_LOOP_CAPPED | typeof SOFT_DEADLINE_WIND_DOWN | typeof CONTEXT_PRESSURE_WIND_DOWN | null): AsyncGenerator<ProviderEvent, IterationResult | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const CONNECT_WAIT_CAP_MS = 8000;
|
|
2
|
+
export declare function connectRetryBudgetMs(): number | undefined;
|
|
3
|
+
export declare class ConnectionRetryBudget {
|
|
4
|
+
readonly startedAt: number;
|
|
5
|
+
readonly budgetMs: number | undefined;
|
|
6
|
+
elapsedMs(): number;
|
|
7
|
+
canRetry(attempt: number, legacyMax: number): boolean;
|
|
8
|
+
delay(legacyDelay: number, baseMs: number, attempt: number): number;
|
|
9
|
+
}
|
|
10
|
+
export declare function connectionFailureMetadata(error: unknown, budget: ConnectionRetryBudget, endpoint?: string): Record<string, string | number | boolean>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TraceSink } from '../../trace/index.js';
|
|
2
|
+
export declare const CONTEXT_PRESSURE_WIND_DOWN = "context_pressure_wind_down";
|
|
3
|
+
export declare const CONTEXT_PRESSURE_NOTE = "Context capacity is nearly exhausted. Do not request tools. Return partial findings, saved work, and remaining steps now.";
|
|
4
|
+
export declare function projectedContextTokens(lastRoundTokens: number, appendedBytes: number): number;
|
|
5
|
+
export declare function contextGuardFraction(route: 'codex-subscription' | 'anthropic' | 'openai-api'): number | null;
|
|
6
|
+
export declare function contextPressure(lastRoundTokens: number, appendedBytes: number, limit: number, fraction?: number): boolean;
|
|
7
|
+
export declare function traceContextPressure(trace: TraceSink | undefined, projected: number, limit: number, fraction?: number): void;
|
|
@@ -4,3 +4,4 @@ export declare const WIND_DOWN_NOTE: string;
|
|
|
4
4
|
export declare function resolveMaxToolIterations(configured: number | undefined): number;
|
|
5
5
|
export declare function shouldWindDown(completedRounds: number, maxIterations: number): boolean;
|
|
6
6
|
export declare function formatRoundLabel(round: number, maxIterations: number): string;
|
|
7
|
+
export declare function roundDeliveryNotice(completedRounds: number, budget: number): string | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Message, IAgentSession, OutputEvent } from '../types.js';
|
|
2
|
+
import type { SubagentHandleImpl } from './handle.js';
|
|
3
|
+
import { TOOL_USE_LOOP_CAPPED } from '../providers/shared/tool-loop-cap.js';
|
|
4
|
+
export declare function isNarrationOnly(text: string): boolean;
|
|
5
|
+
export declare class CappedHandoffAccumulator {
|
|
6
|
+
private priorText;
|
|
7
|
+
private roundText;
|
|
8
|
+
private lastMessage;
|
|
9
|
+
private roundsUsed;
|
|
10
|
+
private budget;
|
|
11
|
+
private historyLengthAtStart;
|
|
12
|
+
setHistoryBaseline(length: number): void;
|
|
13
|
+
onEvent(event: OutputEvent): void;
|
|
14
|
+
finish(finalMessage: Message | undefined, session: IAgentSession): Message;
|
|
15
|
+
}
|
|
16
|
+
export declare function emitSuccessfulHandoff<T>(handle: SubagentHandleImpl<T>, message: Message, startTime: number): Promise<void>;
|
|
17
|
+
export interface CappedHandoff {
|
|
18
|
+
incomplete: true;
|
|
19
|
+
incompleteReason: typeof TOOL_USE_LOOP_CAPPED;
|
|
20
|
+
roundsUsed?: number;
|
|
21
|
+
budget?: number;
|
|
22
|
+
journalPath?: string;
|
|
23
|
+
salvaged?: true;
|
|
24
|
+
}
|
|
25
|
+
export declare function cappedHandoffFields(message: Message, stopReason: string | undefined): Partial<CappedHandoff>;
|
|
26
|
+
export declare function salvageCappedMessage(finalMessage: Message | undefined, buffered: string, priorText: string, fields: Omit<CappedHandoff, 'incomplete' | 'incompleteReason'>): Message;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ZodError, ZodType } from 'zod';
|
|
2
2
|
import type { Message } from '../types.js';
|
|
3
|
+
import { type CappedHandoff } from './capped-handoff.js';
|
|
3
4
|
import { type Signal } from '../signal-block.js';
|
|
4
5
|
export type SubagentStatus = 'idle' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
5
6
|
export declare const STREAM_INCOMPLETE = "stream_incomplete";
|
|
@@ -33,7 +34,7 @@ export interface SubagentTrace {
|
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
export declare function createEmptyTrace(): SubagentTrace;
|
|
36
|
-
export interface SubagentResult<T = unknown> {
|
|
37
|
+
export interface SubagentResult<T = unknown> extends Partial<CappedHandoff> {
|
|
37
38
|
id: string;
|
|
38
39
|
status: SubagentStatus;
|
|
39
40
|
message?: Message;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SubagentDAGNode } from '../dag-subagent.js';
|
|
2
|
+
type BuildResult = SubagentDAGNode | {
|
|
3
|
+
attachmentError: true;
|
|
4
|
+
nodeId: string;
|
|
5
|
+
error: Error;
|
|
6
|
+
};
|
|
7
|
+
export declare function splitComposeNodeResults(results: BuildResult[]): {
|
|
8
|
+
dagNodes: SubagentDAGNode[];
|
|
9
|
+
attachmentErrors: Array<{
|
|
10
|
+
id: string;
|
|
11
|
+
error: Error;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ToolResult } from '../providers/anthropic-direct/types.js';
|
|
2
|
+
import type { TraceSink } from '../trace/index.js';
|
|
3
|
+
export declare function withCatalogNotice(result: Promise<ToolResult>, model: string, trace: TraceSink | undefined): Promise<ToolResult>;
|
|
4
|
+
export declare function addForegroundNotices(result: ToolResult, model: string, attachments: boolean, name: string | undefined, prompt: string, writable: boolean, usage: string | undefined, trace: TraceSink | undefined): void;
|
|
@@ -613,6 +613,8 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
613
613
|
loop_start: "loop_start";
|
|
614
614
|
loop_end: "loop_end";
|
|
615
615
|
model_ttfb: "model_ttfb";
|
|
616
|
+
context_pressure_wind_down: "context_pressure_wind_down";
|
|
617
|
+
catalog_model_upgrade: "catalog_model_upgrade";
|
|
616
618
|
interrupt_halt: "interrupt_halt";
|
|
617
619
|
rate_limit: "rate_limit";
|
|
618
620
|
ttfb_timeout: "ttfb_timeout";
|
|
@@ -633,6 +635,9 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
633
635
|
stream_accepted_after_drop: "stream_accepted_after_drop";
|
|
634
636
|
connection_retry: "connection_retry";
|
|
635
637
|
connection_retry_exhausted: "connection_retry_exhausted";
|
|
638
|
+
connection_failure: "connection_failure";
|
|
639
|
+
connection_recovered: "connection_recovered";
|
|
640
|
+
connection_budget_exhausted: "connection_budget_exhausted";
|
|
636
641
|
usage_notice: "usage_notice";
|
|
637
642
|
tool_degraded: "tool_degraded";
|
|
638
643
|
strategy_nudge_fired: "strategy_nudge_fired";
|
|
@@ -642,6 +647,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
642
647
|
orphan_repair: "orphan_repair";
|
|
643
648
|
background_process_started: "background_process_started";
|
|
644
649
|
background_process_settled: "background_process_settled";
|
|
650
|
+
compose_recovery_decision: "compose_recovery_decision";
|
|
645
651
|
}>;
|
|
646
652
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
647
653
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -1026,6 +1032,8 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1026
1032
|
loop_start: "loop_start";
|
|
1027
1033
|
loop_end: "loop_end";
|
|
1028
1034
|
model_ttfb: "model_ttfb";
|
|
1035
|
+
context_pressure_wind_down: "context_pressure_wind_down";
|
|
1036
|
+
catalog_model_upgrade: "catalog_model_upgrade";
|
|
1029
1037
|
interrupt_halt: "interrupt_halt";
|
|
1030
1038
|
rate_limit: "rate_limit";
|
|
1031
1039
|
ttfb_timeout: "ttfb_timeout";
|
|
@@ -1046,6 +1054,9 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1046
1054
|
stream_accepted_after_drop: "stream_accepted_after_drop";
|
|
1047
1055
|
connection_retry: "connection_retry";
|
|
1048
1056
|
connection_retry_exhausted: "connection_retry_exhausted";
|
|
1057
|
+
connection_failure: "connection_failure";
|
|
1058
|
+
connection_recovered: "connection_recovered";
|
|
1059
|
+
connection_budget_exhausted: "connection_budget_exhausted";
|
|
1049
1060
|
usage_notice: "usage_notice";
|
|
1050
1061
|
tool_degraded: "tool_degraded";
|
|
1051
1062
|
strategy_nudge_fired: "strategy_nudge_fired";
|
|
@@ -1055,6 +1066,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1055
1066
|
orphan_repair: "orphan_repair";
|
|
1056
1067
|
background_process_started: "background_process_started";
|
|
1057
1068
|
background_process_settled: "background_process_settled";
|
|
1069
|
+
compose_recovery_decision: "compose_recovery_decision";
|
|
1058
1070
|
}>;
|
|
1059
1071
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
1060
1072
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -11,6 +11,8 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
|
|
|
11
11
|
loop_start: "loop_start";
|
|
12
12
|
loop_end: "loop_end";
|
|
13
13
|
model_ttfb: "model_ttfb";
|
|
14
|
+
context_pressure_wind_down: "context_pressure_wind_down";
|
|
15
|
+
catalog_model_upgrade: "catalog_model_upgrade";
|
|
14
16
|
interrupt_halt: "interrupt_halt";
|
|
15
17
|
rate_limit: "rate_limit";
|
|
16
18
|
ttfb_timeout: "ttfb_timeout";
|
|
@@ -31,6 +33,9 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
|
|
|
31
33
|
stream_accepted_after_drop: "stream_accepted_after_drop";
|
|
32
34
|
connection_retry: "connection_retry";
|
|
33
35
|
connection_retry_exhausted: "connection_retry_exhausted";
|
|
36
|
+
connection_failure: "connection_failure";
|
|
37
|
+
connection_recovered: "connection_recovered";
|
|
38
|
+
connection_budget_exhausted: "connection_budget_exhausted";
|
|
34
39
|
usage_notice: "usage_notice";
|
|
35
40
|
tool_degraded: "tool_degraded";
|
|
36
41
|
strategy_nudge_fired: "strategy_nudge_fired";
|
|
@@ -40,6 +45,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
|
|
|
40
45
|
orphan_repair: "orphan_repair";
|
|
41
46
|
background_process_started: "background_process_started";
|
|
42
47
|
background_process_settled: "background_process_settled";
|
|
48
|
+
compose_recovery_decision: "compose_recovery_decision";
|
|
43
49
|
}>;
|
|
44
50
|
export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
45
51
|
phase: z.ZodEnum<{
|
|
@@ -54,6 +60,8 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
|
54
60
|
loop_start: "loop_start";
|
|
55
61
|
loop_end: "loop_end";
|
|
56
62
|
model_ttfb: "model_ttfb";
|
|
63
|
+
context_pressure_wind_down: "context_pressure_wind_down";
|
|
64
|
+
catalog_model_upgrade: "catalog_model_upgrade";
|
|
57
65
|
interrupt_halt: "interrupt_halt";
|
|
58
66
|
rate_limit: "rate_limit";
|
|
59
67
|
ttfb_timeout: "ttfb_timeout";
|
|
@@ -74,6 +82,9 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
|
74
82
|
stream_accepted_after_drop: "stream_accepted_after_drop";
|
|
75
83
|
connection_retry: "connection_retry";
|
|
76
84
|
connection_retry_exhausted: "connection_retry_exhausted";
|
|
85
|
+
connection_failure: "connection_failure";
|
|
86
|
+
connection_recovered: "connection_recovered";
|
|
87
|
+
connection_budget_exhausted: "connection_budget_exhausted";
|
|
77
88
|
usage_notice: "usage_notice";
|
|
78
89
|
tool_degraded: "tool_degraded";
|
|
79
90
|
strategy_nudge_fired: "strategy_nudge_fired";
|
|
@@ -83,6 +94,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
|
83
94
|
orphan_repair: "orphan_repair";
|
|
84
95
|
background_process_started: "background_process_started";
|
|
85
96
|
background_process_settled: "background_process_settled";
|
|
97
|
+
compose_recovery_decision: "compose_recovery_decision";
|
|
86
98
|
}>;
|
|
87
99
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
88
100
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -55,6 +55,12 @@ export interface SubagentStartedPayload {
|
|
|
55
55
|
maxToolUseIterations?: number;
|
|
56
56
|
}
|
|
57
57
|
export interface SubagentSucceededPayload {
|
|
58
|
+
incomplete?: true;
|
|
59
|
+
incompleteReason?: string;
|
|
60
|
+
roundsUsed?: number;
|
|
61
|
+
budget?: number;
|
|
62
|
+
journalPath?: string;
|
|
63
|
+
salvaged?: true;
|
|
58
64
|
transition: 'succeeded';
|
|
59
65
|
subagentId: string;
|
|
60
66
|
durationMs: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery' | 'gate_shape' | 'session_id_assigned' | 'many_image_degraded' | 'stream_accepted_after_drop' | 'connection_retry' | 'connection_retry_exhausted' | 'usage_notice' | 'tool_degraded' | 'strategy_nudge_fired' | 'stop_inject_dropped' | 'stop_hook_continuation' | 'stop_hook_cap_reached' | 'orphan_repair' | 'background_process_started' | 'background_process_settled';
|
|
1
|
+
export type SessionPhaseName = 'bootstrap_start' | 'bootstrap_done' | 'session_init_start' | 'session_init_done' | 'mcp_connect_start' | 'mcp_connect_done' | 'mcp_server_start' | 'mcp_server_done' | 'loop_start' | 'loop_end' | 'model_ttfb' | 'context_pressure_wind_down' | 'catalog_model_upgrade' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'overload_pause' | 'overload_resume' | 'idle_watchdog_fired' | 'pause_extension_granted' | 'suspected_loop' | 'compaction_disabled' | 'boot_warning' | 'workspace_subscribed' | 'workspace_delivery' | 'gate_shape' | 'session_id_assigned' | 'many_image_degraded' | 'stream_accepted_after_drop' | 'connection_retry' | 'connection_retry_exhausted' | 'connection_failure' | 'connection_recovered' | 'connection_budget_exhausted' | 'usage_notice' | 'tool_degraded' | 'strategy_nudge_fired' | 'stop_inject_dropped' | 'stop_hook_continuation' | 'stop_hook_cap_reached' | 'orphan_repair' | 'background_process_started' | 'background_process_settled' | 'compose_recovery_decision';
|
|
2
2
|
export interface SessionPhasePayload {
|
|
3
3
|
phase: SessionPhaseName;
|
|
4
4
|
durationMs?: number;
|