agent-afk 5.358.0 → 5.360.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.
@@ -7,9 +7,21 @@ export interface GithubPollerOptions {
7
7
  pollIntervalMs?: number;
8
8
  queueDir?: string;
9
9
  stateDir?: string;
10
+ telemetryPath?: string;
10
11
  ghRunner?: GhRunner;
11
12
  }
12
13
  export type GhRunner = (path: string, extraArgs?: string[]) => Promise<unknown>;
14
+ export interface GithubPollerTickRecord {
15
+ timestamp: string;
16
+ surface: 'github-event-poller';
17
+ repo: string;
18
+ events: GithubEventType[];
19
+ fetched: number;
20
+ enqueued: number;
21
+ skipped: number;
22
+ fetchError?: string;
23
+ tickError?: string;
24
+ }
13
25
  export declare const MAX_SEEN_FOR_TESTS = 10000;
14
26
  export declare function _pruneSeen(seen: Set<string>): Set<string>;
15
27
  export declare function renderCommand(template: string, eventType: GithubEventType, repo: string, eventId: string, payloadSummary: string): string;
@@ -20,6 +32,7 @@ export declare class GithubEventPoller {
20
32
  private readonly pollIntervalMs;
21
33
  private readonly queueDir;
22
34
  private readonly stateDir;
35
+ private readonly telemetryPath;
23
36
  private readonly run;
24
37
  private timer;
25
38
  private polling;
@@ -11,3 +11,4 @@ export interface PrepareDispatchModelResult extends ResolvedChildModel {
11
11
  apiKey: string | undefined;
12
12
  }
13
13
  export declare function prepareDispatchModel(input: DispatchModelPreparationInput): PrepareDispatchModelResult;
14
+ export declare function resolveChildMaxDepth(ctxMaxDepth: number | undefined): number;
@@ -42,7 +42,7 @@ export declare function emitPreToolUseBlock(blockedTool: string, reason: string,
42
42
  export declare function resetDenialBreaker(state: PreDispatchGateMutableState): void;
43
43
  export { applyHookBlockRepeatGate as applyHookBlockRepeat } from './dispatcher.hook-block-repeat-gate.js';
44
44
  export declare function resetProgressBreakers(state: PreDispatchGateMutableState): void;
45
- export declare function accountDenialBreakerPostGate(call: ToolCall, blockReason: string | undefined, blockResult: ToolResult, deps: PreDispatchGateDeps): ToolResult;
45
+ export declare function accountDenialBreakerPostGate(call: ToolCall, blockReason: string | undefined, blockResult: ToolResult, deps: PreDispatchGateDeps): Promise<ToolResult>;
46
46
  export declare function replayObserveSuspectedLoopPostGate(call: ToolCall, deps: PreDispatchGateDeps): void;
47
47
  export interface RunPreDispatchGatesOpts {
48
48
  parallelSafe?: boolean;
@@ -0,0 +1,7 @@
1
+ import type { ToolHandler } from '../types.js';
2
+ export interface ArtifactPublishHandlerOptions {
3
+ cwd?: string;
4
+ storeDir?: string;
5
+ indexPath?: string;
6
+ }
7
+ export declare function createArtifactPublishHandler(opts?: ArtifactPublishHandlerOptions): ToolHandler;
@@ -3,6 +3,6 @@ type Verdict = {
3
3
  destructive: boolean;
4
4
  reason?: string;
5
5
  };
6
- export declare function destructiveGitSegmentReason(argv: readonly string[], depth?: number): string | null;
7
- export declare function classifyDestructiveGit(command: string, depth?: number): Verdict;
6
+ export declare function destructiveGitSegmentReason(argv: readonly string[], depth?: number, literal?: boolean): string | null;
7
+ export declare function classifyDestructiveGit(command: string, depth?: number, literalParent?: boolean): Verdict;
8
8
  export {};
@@ -0,0 +1,14 @@
1
+ export type HereString = {
2
+ text: string | null;
3
+ io: string;
4
+ raw: string;
5
+ end: number;
6
+ position: number;
7
+ };
8
+ export declare function hereStringAt(command: string, start: number, position: number, io: string): HereString | null;
9
+ export declare function restoreHereStrings(header: string, words: readonly HereString[]): string;
10
+ export declare function continuedHereStringPipeline(words: readonly HereString[], preceding: string, header: string): boolean;
11
+ export declare function collectHereStrings(words: readonly HereString[], preceding: string, pipeline: (position: number) => {
12
+ context: string;
13
+ kind: string;
14
+ }, scripts: string[]): string | undefined;
@@ -0,0 +1 @@
1
+ export declare function isLiteralCommand(command: string): boolean;
@@ -2,4 +2,5 @@ import type { AnthropicToolDef } from './types.js';
2
2
  export declare const artifactGetTool: AnthropicToolDef;
3
3
  export declare const artifactListTool: AnthropicToolDef;
4
4
  export declare const artifactReadTool: AnthropicToolDef;
5
- export declare const artifactToolSchemas: readonly [AnthropicToolDef, AnthropicToolDef, AnthropicToolDef];
5
+ export declare const artifactPublishTool: AnthropicToolDef;
6
+ export declare const artifactToolSchemas: readonly [AnthropicToolDef, AnthropicToolDef, AnthropicToolDef, AnthropicToolDef];
@@ -764,6 +764,8 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
764
764
  compose_recovery_decision: "compose_recovery_decision";
765
765
  compose_leaf_tools_stripped: "compose_leaf_tools_stripped";
766
766
  hook_block_repeat_tripped: "hook_block_repeat_tripped";
767
+ denial_circuit_breaker_tripped: "denial_circuit_breaker_tripped";
768
+ endpoint_semaphore_wait: "endpoint_semaphore_wait";
767
769
  billing_settled: "billing_settled";
768
770
  subagent_model_fallback: "subagent_model_fallback";
769
771
  model_fallback: "model_fallback";
@@ -771,6 +773,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
771
773
  continuation_settle_degraded: "continuation_settle_degraded";
772
774
  prompt_fragment_sizes: "prompt_fragment_sizes";
773
775
  ratelimit_unified_state: "ratelimit_unified_state";
776
+ auth_retry_outcome: "auth_retry_outcome";
774
777
  }>;
775
778
  durationMs: z.ZodOptional<z.ZodNumber>;
776
779
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -1259,6 +1262,8 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1259
1262
  compose_recovery_decision: "compose_recovery_decision";
1260
1263
  compose_leaf_tools_stripped: "compose_leaf_tools_stripped";
1261
1264
  hook_block_repeat_tripped: "hook_block_repeat_tripped";
1265
+ denial_circuit_breaker_tripped: "denial_circuit_breaker_tripped";
1266
+ endpoint_semaphore_wait: "endpoint_semaphore_wait";
1262
1267
  billing_settled: "billing_settled";
1263
1268
  subagent_model_fallback: "subagent_model_fallback";
1264
1269
  model_fallback: "model_fallback";
@@ -1266,6 +1271,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1266
1271
  continuation_settle_degraded: "continuation_settle_degraded";
1267
1272
  prompt_fragment_sizes: "prompt_fragment_sizes";
1268
1273
  ratelimit_unified_state: "ratelimit_unified_state";
1274
+ auth_retry_outcome: "auth_retry_outcome";
1269
1275
  }>;
1270
1276
  durationMs: z.ZodOptional<z.ZodNumber>;
1271
1277
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -50,6 +50,8 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
50
50
  compose_recovery_decision: "compose_recovery_decision";
51
51
  compose_leaf_tools_stripped: "compose_leaf_tools_stripped";
52
52
  hook_block_repeat_tripped: "hook_block_repeat_tripped";
53
+ denial_circuit_breaker_tripped: "denial_circuit_breaker_tripped";
54
+ endpoint_semaphore_wait: "endpoint_semaphore_wait";
53
55
  billing_settled: "billing_settled";
54
56
  subagent_model_fallback: "subagent_model_fallback";
55
57
  model_fallback: "model_fallback";
@@ -57,6 +59,7 @@ export declare const SessionPhaseNameSchema: z.ZodEnum<{
57
59
  continuation_settle_degraded: "continuation_settle_degraded";
58
60
  prompt_fragment_sizes: "prompt_fragment_sizes";
59
61
  ratelimit_unified_state: "ratelimit_unified_state";
62
+ auth_retry_outcome: "auth_retry_outcome";
60
63
  }>;
61
64
  export declare const SessionPhasePayloadSchema: z.ZodObject<{
62
65
  phase: z.ZodEnum<{
@@ -110,6 +113,8 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
110
113
  compose_recovery_decision: "compose_recovery_decision";
111
114
  compose_leaf_tools_stripped: "compose_leaf_tools_stripped";
112
115
  hook_block_repeat_tripped: "hook_block_repeat_tripped";
116
+ denial_circuit_breaker_tripped: "denial_circuit_breaker_tripped";
117
+ endpoint_semaphore_wait: "endpoint_semaphore_wait";
113
118
  billing_settled: "billing_settled";
114
119
  subagent_model_fallback: "subagent_model_fallback";
115
120
  model_fallback: "model_fallback";
@@ -117,6 +122,7 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
117
122
  continuation_settle_degraded: "continuation_settle_degraded";
118
123
  prompt_fragment_sizes: "prompt_fragment_sizes";
119
124
  ratelimit_unified_state: "ratelimit_unified_state";
125
+ auth_retry_outcome: "auth_retry_outcome";
120
126
  }>;
121
127
  durationMs: z.ZodOptional<z.ZodNumber>;
122
128
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
@@ -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' | 'context_pressure_wind_down' | 'catalog_model_upgrade' | 'interrupt_halt' | 'rate_limit' | 'ttfb_timeout' | 'usage_limit_pause' | 'usage_limit_resume' | 'credential_swap' | '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' | 'thinking_block_dropped' | 'background_process_started' | 'background_process_settled' | 'compose_recovery_decision' | 'compose_leaf_tools_stripped' | 'hook_block_repeat_tripped' | 'endpoint_semaphore_wait' | 'billing_settled' | 'subagent_model_fallback' | 'model_fallback' | 'round_cap_notice_dropped' | 'continuation_settle_degraded' | 'prompt_fragment_sizes' | 'ratelimit_unified_state';
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' | 'credential_swap' | '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' | 'thinking_block_dropped' | 'background_process_started' | 'background_process_settled' | 'compose_recovery_decision' | 'compose_leaf_tools_stripped' | 'hook_block_repeat_tripped' | 'denial_circuit_breaker_tripped' | 'endpoint_semaphore_wait' | 'billing_settled' | 'subagent_model_fallback' | 'model_fallback' | 'round_cap_notice_dropped' | 'continuation_settle_degraded' | 'prompt_fragment_sizes' | 'ratelimit_unified_state' | 'auth_retry_outcome';
2
2
  export interface SessionPhasePayload {
3
3
  phase: SessionPhaseName;
4
4
  durationMs?: number;
@@ -0,0 +1,31 @@
1
+ import type { ExecFileFn } from './worktree-sweep.js';
2
+ export interface InventoryRow {
3
+ path: string;
4
+ repoRoot: string;
5
+ branch: string;
6
+ owner: 'interactive' | 'diagnose' | 'unknown';
7
+ ageMs: number;
8
+ verdict: string;
9
+ lockReason?: string;
10
+ blocker: string;
11
+ diskKb?: number;
12
+ }
13
+ export interface RepoSummary {
14
+ repoRoot: string;
15
+ rows: InventoryRow[];
16
+ totalDiskKb?: number;
17
+ warnings: string[];
18
+ contested: boolean;
19
+ }
20
+ export interface InventoryResult {
21
+ repos: RepoSummary[];
22
+ totalRows: number;
23
+ totalDiskKb?: number;
24
+ unregisteredRoots: string[];
25
+ }
26
+ export interface InventoryOptions {
27
+ execFile?: ExecFileFn;
28
+ includeSize?: boolean;
29
+ extraRoots?: string[];
30
+ }
31
+ export declare function runInventory(options?: InventoryOptions): Promise<InventoryResult>;
@@ -27,6 +27,9 @@ interface SweepCandidateSummary {
27
27
  verdict: WorktreeVerdict;
28
28
  owner: 'interactive' | 'diagnose' | 'unknown';
29
29
  ageMs: number;
30
+ branch: string;
31
+ lockReason?: string;
32
+ blocker: string;
30
33
  }
31
34
  export interface SweepResult {
32
35
  removed: string[];
@@ -99,7 +99,7 @@ Dispatch one sub-agent per site in this layer, all in parallel, each in a worktr
99
99
  - The `diff_applied` for that site
100
100
  - The `failure_reason`
101
101
  - The current layer number and which layers (if any) already completed successfully
102
- - Recommendation: "Revert layer N changes manually (e.g. `git diff > saved.patch` then `git checkout -- .` to discard, or `git switch -c rescue-<name>` to preserve), then diagnose with `/diagnose`."
102
+ - Recommendation: "Preserve layer N changes with `git diff > saved.patch` or `git switch -c rescue-<name>`, then diagnose with `/diagnose`. Child sessions must not use checkout/restore to discard changes. If restoring one file is intentional, use `git show <ref>:<path> > <path>` (quote paths and preserve local edits first; this overwrites the file), or report the requirement to the caller."
103
103
 
104
104
  ---
105
105