agent-afk 5.245.0 → 5.247.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.
@@ -0,0 +1,32 @@
1
+ import type { ExecFn } from './gh.js';
2
+ export declare const LABEL_HUMAN_REVIEWED = "human-reviewed";
3
+ export declare const LABEL_AGENT_REVIEWED = "agent-reviewed";
4
+ export declare const LABEL_AUTO_MERGED = "auto-merged";
5
+ export declare const ALL_REVIEW_LABELS: readonly ["human-reviewed", "agent-reviewed", "auto-merged"];
6
+ export type ReviewLabel = (typeof ALL_REVIEW_LABELS)[number];
7
+ export declare const BOT_LOGINS: ReadonlySet<string>;
8
+ export interface PrReview {
9
+ author: {
10
+ login: string;
11
+ };
12
+ state: string;
13
+ submittedAt: string;
14
+ }
15
+ export type ReviewClassification = {
16
+ label: typeof LABEL_HUMAN_REVIEWED;
17
+ humanLogins: string[];
18
+ } | {
19
+ label: typeof LABEL_AGENT_REVIEWED;
20
+ botLogins: string[];
21
+ } | {
22
+ label: typeof LABEL_AUTO_MERGED;
23
+ };
24
+ export declare function isBotLogin(login: string): boolean;
25
+ export declare function classifyReviews(reviews: PrReview[], autoMerged?: boolean): ReviewClassification;
26
+ export declare function fetchPrReviews(pr: string, execFn?: ExecFn): Promise<PrReview[]>;
27
+ export declare function ensureLabelExists(label: ReviewLabel, execFn?: ExecFn): Promise<void>;
28
+ export declare function applyReviewLabel(pr: string, label: ReviewLabel, execFn?: ExecFn): Promise<void>;
29
+ export declare function labelPrReviewCoverage(pr: string, opts?: {
30
+ autoMerged?: boolean;
31
+ execFn?: ExecFn;
32
+ }): Promise<ReviewLabel>;
@@ -201,7 +201,43 @@ export interface ProviderContextUsage {
201
201
  tools?: unknown[];
202
202
  agents?: unknown[];
203
203
  isAutoCompactEnabled?: boolean;
204
- apiUsage?: Record<string, unknown> | null;
204
+ totalTokens?: number;
205
+ maxTokens?: number;
206
+ percentage?: number;
207
+ autoCompactThreshold?: number;
208
+ categories?: {
209
+ name: string;
210
+ tokens: number;
211
+ color: string;
212
+ isDeferred?: boolean;
213
+ }[];
214
+ systemTools?: {
215
+ name: string;
216
+ tokens: number;
217
+ }[];
218
+ mcpTools?: {
219
+ name: string;
220
+ serverName: string;
221
+ tokens: number;
222
+ isLoaded?: boolean;
223
+ }[];
224
+ skills?: {
225
+ includedSkills: number;
226
+ totalSkills: number;
227
+ tokens: number;
228
+ };
229
+ slashCommands?: {
230
+ includedCommands: number;
231
+ totalCommands: number;
232
+ tokens: number;
233
+ };
234
+ apiUsage?: {
235
+ input_tokens: number;
236
+ output_tokens: number;
237
+ cache_creation_input_tokens: number;
238
+ cache_read_input_tokens: number;
239
+ context_window_tokens?: number;
240
+ } | null;
205
241
  [key: string]: unknown;
206
242
  }
207
243
  export interface ProviderMcpServerStatus {
@@ -152,13 +152,13 @@ export type AccountInfo = {
152
152
  };
153
153
  export type AgentInfo = {
154
154
  name: string;
155
- description: string;
155
+ description?: string;
156
156
  model?: string;
157
157
  };
158
158
  export type ModelInfo = {
159
159
  value: string;
160
- displayName: string;
161
- description: string;
160
+ displayName?: string;
161
+ description?: string;
162
162
  supportsEffort?: boolean;
163
163
  supportedEffortLevels?: EffortLevel[];
164
164
  supportsAdaptiveThinking?: boolean;
@@ -1,9 +1,9 @@
1
- import type { AccountInfo, AgentInfo, ApiKeySource, McpServerStatus, ModelInfo, PermissionMode, SDKControlGetContextUsageResponse, SDKStatus } from './sdk-types.js';
1
+ import type { AccountInfo, AgentInfo, ApiKeySource, ModelInfo, PermissionMode, SDKStatus } from './sdk-types.js';
2
2
  import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
3
3
  import type { AgentModelInput } from './model-types.js';
4
4
  import type { InputStreamRef } from './permission-types.js';
5
5
  import type { Message, MessageChunk, ResponseMetadata, SendMessageOptions, StructuredMessageOptions } from './message-types.js';
6
- import type { ProviderCommandInfo, ProviderCompactResult, ProviderQuery, ProviderRewindConversationResult, RewindTarget } from '../provider.js';
6
+ import type { ProviderCommandInfo, ProviderCompactResult, ProviderContextUsage, ProviderMcpServerStatus, ProviderQuery, ProviderRewindConversationResult, RewindTarget } from '../provider.js';
7
7
  import type { HookRegistry } from '../hooks.js';
8
8
  import type { ZodType } from 'zod';
9
9
  export type SessionState = 'idle' | 'processing' | 'streaming' | 'compacting' | 'closed';
@@ -162,8 +162,8 @@ export interface IAgentSession {
162
162
  supportedCommands(): Promise<ProviderCommandInfo[]>;
163
163
  supportedModels(): Promise<ModelInfo[]>;
164
164
  supportedAgents(): Promise<AgentInfo[]>;
165
- getContextUsage(): Promise<SDKControlGetContextUsageResponse>;
166
- mcpServerStatus(): Promise<McpServerStatus[]>;
165
+ getContextUsage(): Promise<ProviderContextUsage>;
166
+ mcpServerStatus(): Promise<ProviderMcpServerStatus[]>;
167
167
  accountInfo(): Promise<AccountInfo>;
168
168
  rewindFiles?(userMessageId: string, options?: {
169
169
  dryRun?: boolean;
@@ -125,7 +125,7 @@ gh pr create \
125
125
  PR bodies are markdown: they routinely carry backticks (inline code), `$(...)`, and quotes. **Never** inline the body as `--body "$(cat <<'EOF' … EOF)"` — the shell parses backticks/`$(` inside the command substitution before `gh` ever runs, so the call fails (or worse, opens the PR with a truncated/garbled body and you don't notice). `--body-file` reads the file verbatim: no shell quoting, no escaping. Only `--title` stays inline — keep it a single plain line with no backticks.
126
126
 
127
127
  **Phase 8b — Fix-of-fix detection (runs immediately after the PR URL is returned by Phase 8).**
128
- Scan the PR title and body for cross-references to other PRs. If any referenced PR was merged within the last 7 days, apply the `fix-of-fix` label and record a structured metadata block.
128
+ Scan the PR title and body for cross-references to other PRs. If any referenced PR was merged within the last 7 days, apply the `fix-of-fix` label.
129
129
 
130
130
  ```
131
131
  # 1. Extract referenced PR numbers from the PR body using the patterns:
@@ -141,19 +141,6 @@ gh label create fix-of-fix \
141
141
  --description "PR that fixes a bug introduced by a recently-merged PR (merged within 7 days)" \
142
142
  --color D93F0B --force
143
143
  gh pr edit <current-PR-number> --add-label fix-of-fix
144
- #
145
- # 4. Append a machine-readable cross-reference section to the PR body:
146
- gh pr edit <current-PR-number> --body-file <updated-body-file>
147
- ```
148
-
149
- Structured metadata to append (only when fix-of-fix is detected):
150
-
151
- ```markdown
152
- ## Cross-references
153
-
154
- <!-- fix-of-fix: true -->
155
- <!-- referenced-prs: <N1>, <N2>, ... -->
156
- Recently-merged PRs referenced by this fix: #N1, #N2, …
157
144
  ```
158
145
 
159
146
  **Skip gracefully** when `gh` is unavailable or any step fails — the PR is already open and that is the deliverable. Never abort Phase 8b failure back to the user as a blocking error; log a one-line note instead (e.g. `fix-of-fix detection skipped: <reason>`).
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerApproveSubcommand(improve: Command): void;
@@ -0,0 +1 @@
1
+ export declare function formatAgeDays(createdAt: string, now?: Date): string;
@@ -1,5 +1,5 @@
1
1
  import type { ToolEntry, Entry } from './tool-lane-render.js';
2
- declare function formatAgentSummary(agent: ToolEntry, children: Entry[], childMap: Map<string, Entry[]>, homeDir?: string, ancestorIsLast?: readonly boolean[]): string;
2
+ declare function formatAgentSummary(agent: ToolEntry, children: Entry[], childMap: Map<string, Entry[]>, homeDir?: string, ancestorIsLast?: readonly boolean[], compact?: boolean): string;
3
3
  declare function formatAgentHeader(agent: ToolEntry, ancestorIsLast?: readonly boolean[]): string;
4
- declare function formatAgentChildren(agent: ToolEntry, children: Entry[], childMap: Map<string, Entry[]>, homeDir?: string, ancestorIsLast?: readonly boolean[]): string[];
4
+ declare function formatAgentChildren(agent: ToolEntry, children: Entry[], childMap: Map<string, Entry[]>, homeDir?: string, ancestorIsLast?: readonly boolean[], compact?: boolean): string[];
5
5
  export { formatAgentSummary, formatAgentHeader, formatAgentChildren };
@@ -0,0 +1,4 @@
1
+ import type { Entry, Glyphs } from './tool-lane-render.js';
2
+ import { addResultSummarySynthetic, assignConnectors } from './tool-lane-render-grouping.js';
3
+ export declare function renderCompactFlushChildren(children: Entry[], childMap: Map<string, Entry[]>, homeDir?: string, agentResultSummary?: string, cols?: number, ancestorIsLast?: readonly boolean[], g?: Readonly<Glyphs>): string[];
4
+ export { addResultSummarySynthetic, assignConnectors };
@@ -12,6 +12,7 @@ export declare class ToolLane {
12
12
  private lastElapsedSecond;
13
13
  private activeTools;
14
14
  flash: ToolLaneFlash | null;
15
+ compactScrollback: boolean;
15
16
  addStart(toolUseId: string, toolName: string, toolInput: string): void;
16
17
  addStartWithAgentContext(toolUseId: string, toolName: string, toolInput: string, agentContext: string | undefined, maxWidth?: number): void;
17
18
  mergeAgentLabel(parentToolUseId: string, label: string, maxWidth?: number): boolean;
@@ -15,7 +15,7 @@ interface ContextUsageSource {
15
15
  totalTokens?: number;
16
16
  maxTokens?: number;
17
17
  autoCompactThreshold?: number;
18
- isAutoCompactEnabled: boolean;
18
+ isAutoCompactEnabled?: boolean;
19
19
  [key: string]: unknown;
20
20
  }>;
21
21
  }