agent-afk 5.282.5 → 5.282.7
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/facets/schema.d.ts +17 -1
- package/dist/agent/facets/yield-probe.d.ts +2 -1
- package/dist/agent/outcomes/artifacts.d.ts +2 -0
- package/dist/agent/outcomes/terminal-state.d.ts +21 -0
- package/dist/agent/providers/anthropic-direct/loop/network-termination.d.ts +1 -1
- package/dist/agent/providers/openai-compatible/query/stream-drive.stream-error.d.ts +7 -3
- package/dist/agent/providers/openai-compatible/query/turn-driver.context-window.d.ts +2 -0
- package/dist/agent/providers/shared/network-termination.d.ts +1 -0
- package/dist/agent/trace/events.d.ts +2 -0
- package/dist/agent/trace/events.session-phase.d.ts +2 -0
- package/dist/agent/trace/types.d.ts +1 -1
- package/dist/cli/commands/interactive/terminal-state.d.ts +2 -20
- package/dist/cli.mjs +312 -312
- package/dist/improve/schemas.d.ts +2 -2
- package/dist/index.mjs +131 -127
- package/dist/telegram.mjs +155 -151
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const FACET_VERSION =
|
|
2
|
+
export declare const FACET_VERSION = 7;
|
|
3
3
|
export declare const ToolEventInputSchema: z.ZodObject<{
|
|
4
4
|
toolName: z.ZodString;
|
|
5
5
|
toolUseId: z.ZodOptional<z.ZodString>;
|
|
@@ -57,12 +57,19 @@ export declare const StoredSessionInputSchema: z.ZodObject<{
|
|
|
57
57
|
export type StoredSessionInput = z.infer<typeof StoredSessionInputSchema>;
|
|
58
58
|
export type ToolEventInput = z.infer<typeof ToolEventInputSchema>;
|
|
59
59
|
export declare const FacetOutcomeSchema: z.ZodEnum<{
|
|
60
|
+
unknown: "unknown";
|
|
60
61
|
aborted: "aborted";
|
|
61
62
|
fully_achieved: "fully_achieved";
|
|
62
63
|
partially_achieved: "partially_achieved";
|
|
63
64
|
not_achieved: "not_achieved";
|
|
64
65
|
}>;
|
|
65
66
|
export type FacetOutcome = z.infer<typeof FacetOutcomeSchema>;
|
|
67
|
+
export declare const FacetOutcomeSourceSchema: z.ZodEnum<{
|
|
68
|
+
none: "none";
|
|
69
|
+
terminal_state: "terminal_state";
|
|
70
|
+
structural: "structural";
|
|
71
|
+
}>;
|
|
72
|
+
export type FacetOutcomeSource = z.infer<typeof FacetOutcomeSourceSchema>;
|
|
66
73
|
export declare const SubagentPersistenceSchema: z.ZodEnum<{
|
|
67
74
|
unknown: "unknown";
|
|
68
75
|
not_persisted: "not_persisted";
|
|
@@ -99,6 +106,7 @@ export declare const YieldTrackingSchema: z.ZodObject<{
|
|
|
99
106
|
is_scheduled_session: z.ZodBoolean;
|
|
100
107
|
produced_pr: z.ZodNullable<z.ZodBoolean>;
|
|
101
108
|
pr_merged: z.ZodNullable<z.ZodBoolean>;
|
|
109
|
+
pr_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
102
110
|
}, z.core.$strip>;
|
|
103
111
|
export type YieldTracking = z.infer<typeof YieldTrackingSchema>;
|
|
104
112
|
export declare const SubagentToolSummarySchema: z.ZodObject<{
|
|
@@ -147,15 +155,22 @@ export declare const SessionFacetSchema: z.ZodObject<{
|
|
|
147
155
|
label: z.ZodOptional<z.ZodString>;
|
|
148
156
|
}, z.core.$strip>>;
|
|
149
157
|
tool_errors: z.ZodNumber;
|
|
158
|
+
tool_errors_total: z.ZodNumber;
|
|
150
159
|
tool_error_categories: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
151
160
|
friction_counts: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
152
161
|
friction_detail: z.ZodString;
|
|
153
162
|
outcome: z.ZodEnum<{
|
|
163
|
+
unknown: "unknown";
|
|
154
164
|
aborted: "aborted";
|
|
155
165
|
fully_achieved: "fully_achieved";
|
|
156
166
|
partially_achieved: "partially_achieved";
|
|
157
167
|
not_achieved: "not_achieved";
|
|
158
168
|
}>;
|
|
169
|
+
outcome_source: z.ZodEnum<{
|
|
170
|
+
none: "none";
|
|
171
|
+
terminal_state: "terminal_state";
|
|
172
|
+
structural: "structural";
|
|
173
|
+
}>;
|
|
159
174
|
primary_success: z.ZodString;
|
|
160
175
|
world_changes: z.ZodObject<{
|
|
161
176
|
files_written: z.ZodNumber;
|
|
@@ -182,6 +197,7 @@ export declare const SessionFacetSchema: z.ZodObject<{
|
|
|
182
197
|
is_scheduled_session: z.ZodBoolean;
|
|
183
198
|
produced_pr: z.ZodNullable<z.ZodBoolean>;
|
|
184
199
|
pr_merged: z.ZodNullable<z.ZodBoolean>;
|
|
200
|
+
pr_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
185
201
|
}, z.core.$strip>;
|
|
186
202
|
decisions: z.ZodArray<z.ZodString>;
|
|
187
203
|
evidence_pointers: z.ZodArray<z.ZodString>;
|
|
@@ -7,5 +7,6 @@ export type ExecFnYield = (file: string, args: string[], opts?: {
|
|
|
7
7
|
}>;
|
|
8
8
|
export declare function getCurrentBranch(execFn: ExecFnYield, cwd?: string): Promise<string | null>;
|
|
9
9
|
export declare function queryPrState(execFn: ExecFnYield, branch: string, cwd?: string): Promise<'merged' | 'open' | 'closed' | 'none' | 'error'>;
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function queryPrStateByUrl(execFn: ExecFnYield, prUrl: string, cwd?: string): Promise<'merged' | 'open' | 'closed' | 'error'>;
|
|
11
|
+
export declare function patchYieldFields(sessionId: string, produced_pr: boolean, pr_merged: boolean | null, cacheDir?: string, pr_url?: string | null): void;
|
|
11
12
|
export declare function writeFacetYield(sessionId: string, execFn: ExecFnYield, cwd?: string): Promise<void>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type TerminalKind = 'done' | 'blocked' | 'asking' | 'interrupted';
|
|
2
|
+
export interface TerminalState {
|
|
3
|
+
kind: TerminalKind;
|
|
4
|
+
whatWasDone?: string;
|
|
5
|
+
evidence?: string;
|
|
6
|
+
whatChanged?: string;
|
|
7
|
+
deferred?: string;
|
|
8
|
+
whatBlocks?: string;
|
|
9
|
+
unblockCondition?: string;
|
|
10
|
+
alreadyDone?: string;
|
|
11
|
+
question?: string;
|
|
12
|
+
assumption?: string;
|
|
13
|
+
followup?: string;
|
|
14
|
+
whatWasInProgress?: string;
|
|
15
|
+
stateLocation?: string;
|
|
16
|
+
resumeRequires?: string;
|
|
17
|
+
rawBody: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const TAIL_LINES = 40;
|
|
20
|
+
export declare function findTerminalStateHeadingOffset(text: string): number;
|
|
21
|
+
export declare function parseTerminalState(text: string): TerminalState | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { isMidStreamNetworkTermination } from '../../shared/network-termination.js';
|
|
2
2
|
export declare function isMidStreamCut(err: unknown): boolean;
|
|
@@ -2,19 +2,23 @@ export interface RetryAction {
|
|
|
2
2
|
kind: 'retry';
|
|
3
3
|
delay: number;
|
|
4
4
|
source: 'stream';
|
|
5
|
-
reason: 'stall_timeout' | 'ttfb_timeout' | 'retry-after' | 'backoff';
|
|
5
|
+
reason: 'stall_timeout' | 'ttfb_timeout' | 'retry-after' | 'backoff' | 'network_termination';
|
|
6
6
|
attempt: number;
|
|
7
|
+
errorCode?: string;
|
|
7
8
|
}
|
|
8
9
|
export interface FatalAction {
|
|
9
10
|
kind: 'fatal';
|
|
10
11
|
error: Error;
|
|
11
12
|
}
|
|
13
|
+
export interface AcceptAction {
|
|
14
|
+
kind: 'accept';
|
|
15
|
+
}
|
|
12
16
|
export interface FallThroughAction {
|
|
13
17
|
kind: 'fall-through';
|
|
14
18
|
error: unknown;
|
|
15
19
|
}
|
|
16
|
-
export type StreamErrorAction = RetryAction | FatalAction | FallThroughAction;
|
|
17
|
-
export declare function classifyStreamError(err: unknown, contentYieldedThisAttempt: boolean, streamRetries: number, stallMs: number): {
|
|
20
|
+
export type StreamErrorAction = RetryAction | FatalAction | AcceptAction | FallThroughAction;
|
|
21
|
+
export declare function classifyStreamError(err: unknown, contentYieldedThisAttempt: boolean, streamRetries: number, stallMs: number, stallTimedOut?: boolean, ttfbTimedOut?: boolean, terminalFinishReason?: string | null, usageReceived?: boolean): {
|
|
18
22
|
action: StreamErrorAction;
|
|
19
23
|
newStreamRetries: number;
|
|
20
24
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isMidStreamNetworkTermination(err: unknown): boolean;
|
|
@@ -724,6 +724,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
724
724
|
gate_shape: "gate_shape";
|
|
725
725
|
session_id_assigned: "session_id_assigned";
|
|
726
726
|
many_image_degraded: "many_image_degraded";
|
|
727
|
+
stream_accepted_after_drop: "stream_accepted_after_drop";
|
|
727
728
|
}>;
|
|
728
729
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
729
730
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -1102,6 +1103,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1102
1103
|
gate_shape: "gate_shape";
|
|
1103
1104
|
session_id_assigned: "session_id_assigned";
|
|
1104
1105
|
many_image_degraded: "many_image_degraded";
|
|
1106
|
+
stream_accepted_after_drop: "stream_accepted_after_drop";
|
|
1105
1107
|
}>;
|
|
1106
1108
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
1107
1109
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -28,6 +28,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
|
|
|
28
28
|
gate_shape: "gate_shape";
|
|
29
29
|
session_id_assigned: "session_id_assigned";
|
|
30
30
|
many_image_degraded: "many_image_degraded";
|
|
31
|
+
stream_accepted_after_drop: "stream_accepted_after_drop";
|
|
31
32
|
}>;
|
|
32
33
|
export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
33
34
|
phase: z.ZodEnum<{
|
|
@@ -59,6 +60,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
|
|
|
59
60
|
gate_shape: "gate_shape";
|
|
60
61
|
session_id_assigned: "session_id_assigned";
|
|
61
62
|
many_image_degraded: "many_image_degraded";
|
|
63
|
+
stream_accepted_after_drop: "stream_accepted_after_drop";
|
|
62
64
|
}>;
|
|
63
65
|
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
64
66
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
@@ -178,7 +178,7 @@ export interface BrowserEventPayload {
|
|
|
178
178
|
};
|
|
179
179
|
durationMs: number;
|
|
180
180
|
}
|
|
181
|
-
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';
|
|
181
|
+
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';
|
|
182
182
|
export interface SessionPhasePayload {
|
|
183
183
|
phase: SessionPhaseName;
|
|
184
184
|
durationMs?: number;
|
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
export type TerminalKind
|
|
2
|
-
export
|
|
3
|
-
kind: TerminalKind;
|
|
4
|
-
whatWasDone?: string;
|
|
5
|
-
evidence?: string;
|
|
6
|
-
whatChanged?: string;
|
|
7
|
-
deferred?: string;
|
|
8
|
-
whatBlocks?: string;
|
|
9
|
-
unblockCondition?: string;
|
|
10
|
-
alreadyDone?: string;
|
|
11
|
-
question?: string;
|
|
12
|
-
assumption?: string;
|
|
13
|
-
followup?: string;
|
|
14
|
-
whatWasInProgress?: string;
|
|
15
|
-
stateLocation?: string;
|
|
16
|
-
resumeRequires?: string;
|
|
17
|
-
rawBody: string;
|
|
18
|
-
}
|
|
19
|
-
export declare function findTerminalStateHeadingOffset(text: string): number;
|
|
20
|
-
export declare function parseTerminalState(text: string): TerminalState | null;
|
|
1
|
+
export type { TerminalKind, TerminalState } from '../../../agent/outcomes/terminal-state.js';
|
|
2
|
+
export { parseTerminalState, findTerminalStateHeadingOffset, } from '../../../agent/outcomes/terminal-state.js';
|