agent-afk 5.352.0 → 5.353.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.
Files changed (32) hide show
  1. package/dist/agent/auth/credential-resolver.d.ts +6 -1
  2. package/dist/agent/file-checkpoint/git-snapshot.diff.d.ts +2 -0
  3. package/dist/agent/memory/index.d.ts +1 -1
  4. package/dist/agent/providers/anthropic-direct/build-dispatcher.d.ts +2 -0
  5. package/dist/agent/providers/anthropic-direct/provider-runtime.d.ts +1 -0
  6. package/dist/agent/providers/openai-compatible/index.d.ts +1 -0
  7. package/dist/agent/providers/openai-compatible/responses-translate.d.ts +1 -0
  8. package/dist/agent/providers/openai-compatible/system-prompt-wiring.d.ts +1 -1
  9. package/dist/agent/providers/openai-compatible/translate.d.ts +1 -0
  10. package/dist/agent/session/ledger-lifecycle.d.ts +1 -0
  11. package/dist/agent/session/session-id-trace.d.ts +1 -1
  12. package/dist/agent/session/session-meta.d.ts +1 -0
  13. package/dist/agent/tools/dispatcher.batch-process.d.ts +2 -0
  14. package/dist/agent/tools/dispatcher.d.ts +5 -46
  15. package/dist/agent/tools/dispatcher.execute-batch.d.ts +2 -0
  16. package/dist/agent/tools/dispatcher.ledger.d.ts +13 -0
  17. package/dist/agent/tools/dispatcher.options.d.ts +49 -0
  18. package/dist/agent/tools/repeat-failure-guard.d.ts +1 -1
  19. package/dist/agent/trace/events.d.ts +2 -0
  20. package/dist/agent/trace/events.session-phase.d.ts +1 -0
  21. package/dist/agent/trace/receipt.d.ts +1 -0
  22. package/dist/agent/trace/receipt.subagents-by-model.d.ts +11 -0
  23. package/dist/agent/trace/receipt.types.d.ts +2 -0
  24. package/dist/agent/trace/types.session-phase.d.ts +1 -0
  25. package/dist/agent/types/config-types.d.ts +1 -0
  26. package/dist/agent/usage.billing.d.ts +1 -1
  27. package/dist/cli/auth-wizard.describe-source.d.ts +3 -2
  28. package/dist/cli.mjs +449 -449
  29. package/dist/index.mjs +377 -377
  30. package/dist/telegram/session-context.d.ts +1 -0
  31. package/dist/telegram.mjs +395 -395
  32. package/package.json +1 -1
@@ -1,9 +1,14 @@
1
1
  import { type ProviderRouteHints } from '../providers/index.js';
2
2
  export declare function loadAnthropicCredential(): string | undefined;
3
+ export type CredentialSourceId = 'ANTHROPIC_API_KEY' | 'CLAUDE_CODE_OAUTH_TOKEN' | 'claude-code-keychain' | 'claude-code-session-refresh';
4
+ export interface AnthropicCredential {
5
+ token: string;
6
+ source: CredentialSourceId;
7
+ }
8
+ export declare function resolveAnthropicCredential(): AnthropicCredential | undefined;
3
9
  export declare function preloadClaudeKeychainOAuth(provider: string): Promise<string | undefined>;
4
10
  export declare function _resetRefreshedClaudeCodeOauthToken(): void;
5
11
  export declare function setRefreshedClaudeCodeOauthToken(token: string): void;
6
- export declare function hasProcessLocalRefreshedToken(): boolean;
7
12
  export declare function loadOpenAICredential(): string | undefined;
8
13
  export declare function loadXaiApiKey(): string | undefined;
9
14
  export declare function resolveCredentialForModel(model: string | undefined, hints?: ProviderRouteHints): string | undefined;
@@ -22,6 +22,8 @@ export declare function classifyEntry(e: RawEntry): Classified;
22
22
  export declare function parseCatFileBatch(buf: Buffer, count: number): Buffer[] | null;
23
23
  export declare const MAX_BLOB_BYTES: number;
24
24
  export declare function _setMaxBlobBytesForTests(value: number | undefined): void;
25
+ export declare const MAX_AGGREGATE_BLOB_BYTES: number;
26
+ export declare function _setMaxAggregateBlobBytesForTests(value: number | undefined): void;
25
27
  export declare function parseBatchCheck(buf: Buffer, count: number): number[] | null;
26
28
  export declare function diffWithCtx(options: DiffOptions, ctx: GitCtx): Promise<DiffResult>;
27
29
  export {};
@@ -1,6 +1,6 @@
1
1
  export { MemoryStore } from './memory-store.js';
2
2
  export { estimateTokens } from './estimate-tokens.js';
3
- export { loadHotMemory, injectHotMemory, injectEpisodeRecall, scoredEpisodes } from './memory-loader.js';
3
+ export { loadHotMemory, injectHotMemory, injectEpisodeRecall, scoredEpisodes, EPISODE_RECALL_CAP } from './memory-loader.js';
4
4
  export type { InjectEpisodeRecallOptions, ScoredEpisode } from './memory-loader.js';
5
5
  export { injectGoalPrompt } from '../goals/inject.js';
6
6
  export { createMemorySessionEndHook, createChildMemoryHotBlockHook } from './memory-hooks.js';
@@ -13,6 +13,7 @@ import type { CustomToolDef } from '../../tools/custom-tool.js';
13
13
  import type { GrantManager } from '../../tools/grant-manager.js';
14
14
  import type { RuntimeStateSource } from '../../awareness/index.js';
15
15
  import type { SpawnedPidRegistry } from '../../tools/handlers/pid-registry.js';
16
+ import type { ToolCallLedgerWiring } from '../../tools/dispatcher.ledger.js';
16
17
  import { SessionToolDispatcher } from '../../tools/dispatcher.js';
17
18
  import type { ToolPermissionConfig } from '../../tools/permissions.js';
18
19
  export interface BuildDispatcherOptions {
@@ -31,6 +32,7 @@ export interface BuildDispatcherOptions {
31
32
  hookRegistry?: HookRegistry;
32
33
  planExitControls?: PlanExitControls;
33
34
  spawnedPidRegistry?: SpawnedPidRegistry;
35
+ toolCallLedger?: ToolCallLedgerWiring;
34
36
  bashOutputTailReporter?: (toolUseId: string) => (tail: string | undefined) => void;
35
37
  detachRegistry?: import('../../tools/detach-registry.js').DetachableToolRegistry;
36
38
  processJobs?: import('../../shell-jobs/process-jobs.js').ProcessJobRegistry;
@@ -33,6 +33,7 @@ export declare class AnthropicDirectProvider implements ModelProvider {
33
33
  private _presenceSessionId;
34
34
  private _mintedSessionId;
35
35
  private readonly _spawnedPidRegistry;
36
+ private readonly _toolCallLedger;
36
37
  private get memoryStore();
37
38
  private get stateStore();
38
39
  private readonly _injectedMemoryStore;
@@ -18,6 +18,7 @@ export declare class OpenAICompatibleProvider implements ModelProvider {
18
18
  private _presenceSessionId;
19
19
  private _mintedSessionId;
20
20
  private readonly _spawnedPidRegistry;
21
+ private readonly _toolCallLedger;
21
22
  constructor(opts?: OpenAICompatibleProviderOptions);
22
23
  setEndpointDefaults(defaults: {
23
24
  baseURL?: string;
@@ -22,6 +22,7 @@ export interface ResponsesStreamEvent {
22
22
  total_tokens?: number;
23
23
  input_tokens_details?: {
24
24
  cached_tokens?: number;
25
+ cache_write_tokens?: number;
25
26
  };
26
27
  };
27
28
  incomplete_details?: {
@@ -26,7 +26,7 @@ export interface SystemPromptWiringResult {
26
26
  goalPrompt: string;
27
27
  manifest: string;
28
28
  agentTypeListing: string;
29
- episodeRecall: string | undefined;
29
+ episodeRecall: string;
30
30
  };
31
31
  }
32
32
  export declare function buildSystemPromptWiring(args: SystemPromptWiringArgs): SystemPromptWiringResult;
@@ -27,6 +27,7 @@ export interface OpenAIChunk {
27
27
  total_tokens?: number;
28
28
  prompt_tokens_details?: {
29
29
  cached_tokens?: number;
30
+ cache_write_tokens?: number;
30
31
  };
31
32
  };
32
33
  }
@@ -10,6 +10,7 @@ export interface LedgerEnsureContext {
10
10
  model?: string;
11
11
  cwd?: string;
12
12
  };
13
+ credentialSource?: string | undefined;
13
14
  }
14
15
  export declare class LedgerLifecycle {
15
16
  private writer;
@@ -1,2 +1,2 @@
1
1
  import type { TraceSink } from '../trace/index.js';
2
- export declare function emitSessionIdAssigned(writer: TraceSink | undefined, sessionId: string, priorSessionId: string | undefined): Promise<void>;
2
+ export declare function emitSessionIdAssigned(writer: TraceSink | undefined, sessionId: string, priorSessionId: string | undefined, credentialSource?: string | undefined): Promise<void>;
@@ -9,6 +9,7 @@ export interface SessionMeta {
9
9
  startedAt?: number;
10
10
  afkVersion?: string;
11
11
  forkedFrom?: string;
12
+ credentialSource?: string;
12
13
  gitHead?: GitHeadSnapshot | null;
13
14
  }
14
15
  export interface GitHeadSnapshot {
@@ -1,4 +1,5 @@
1
1
  import type { RepeatFailureGuard } from './repeat-failure-guard.js';
2
+ import { type ToolCallLedgerWiring } from './dispatcher.ledger.js';
2
3
  import type { ToolCall, ToolResult } from '../providers/anthropic-direct/types.js';
3
4
  import type { SubagentExecutor } from './subagent-executor.js';
4
5
  import type { Batch } from './dispatch-batching.js';
@@ -11,6 +12,7 @@ export interface IndexedCall {
11
12
  }
12
13
  export interface BatchExecDeps {
13
14
  repeatFailureGuard: RepeatFailureGuard;
15
+ toolCallLedger: ToolCallLedgerWiring;
14
16
  repeatBreakerExemptTools: ReadonlySet<string>;
15
17
  executeCore: (call: ToolCall) => Promise<ToolResult>;
16
18
  subagentExecutor: SubagentExecutor | undefined;
@@ -1,58 +1,16 @@
1
1
  import { DEFAULT_MAX_CONCURRENT_SAFE_TOOL_CALLS, resolveMaxConcurrentSafeToolCalls } from '../../config/concurrency.js';
2
- import type { HookRegistry } from '../hooks.js';
3
2
  import type { AnthropicToolDef } from '../providers/anthropic-direct/types.js';
4
3
  import type { ToolDispatcher } from '../providers/anthropic-direct/tool-dispatcher.js';
5
4
  import type { ToolCall, ToolResult } from '../providers/anthropic-direct/types.js';
6
- import type { SubagentExecutor } from './subagent-executor.js';
7
- import type { SkillExecutor } from './skill-executor.js';
8
- import type { ComposeExecutor } from './compose-executor.js';
9
- import type { ToolHandler, ConcurrencyClassifier } from './types.js';
10
5
  import type { ToolActivityReporter } from '../providers/shared/tool-activity.js';
11
- import type { SpawnedPidRegistry } from './handlers/pid-registry.js';
12
- import { type ToolPermissionConfig } from './permissions.js';
13
- import type { CanUseTool } from '../types/sdk-types.js';
14
- import { type GrantSnapshot, type GrantManager } from './grant-manager.js';
15
- import type { TraceSink } from '../trace/index.js';
16
- import { type GetMcpServerStates } from './dispatcher.mcp-states.js';
17
- import { type UserAttention } from './user-yield.js';
18
- import { type DetachableToolRegistry } from './detach-bash.js';
19
- import type { ProcessJobRegistry } from '../shell-jobs/process-jobs.js';
6
+ import { type GrantSnapshot } from './grant-manager.js';
7
+ import { ToolCallLedgerWiring } from './dispatcher.ledger.js';
20
8
  import { FileCheckpointWiring } from './dispatcher.file-checkpoint.js';
21
9
  export { defaultConcurrencyClassifier } from './dispatch-batching.js';
22
10
  export declare const REPEAT_CIRCUIT_BREAKER_THRESHOLD = 8;
23
11
  export { DEFAULT_MAX_CONCURRENT_SAFE_TOOL_CALLS, resolveMaxConcurrentSafeToolCalls };
24
- export interface SessionToolDispatcherOptions {
25
- handlers: Map<string, ToolHandler>;
26
- schemas: AnthropicToolDef[];
27
- hookRegistry: HookRegistry | undefined;
28
- permissions?: ToolPermissionConfig;
29
- canUseTool?: CanUseTool;
30
- subagentExecutor?: SubagentExecutor;
31
- skillExecutor?: SkillExecutor;
32
- composeExecutor?: ComposeExecutor;
33
- concurrencyClassifier?: ConcurrencyClassifier;
34
- maxConcurrentSafeCalls?: number;
35
- cwd?: string;
36
- readRoots?: string[];
37
- writeRoots?: string[];
38
- allowAll?: boolean;
39
- env?: Record<string, string>;
40
- getMcpServerStates?: GetMcpServerStates;
41
- sessionId?: string;
42
- parentSessionId?: string;
43
- rootSessionId?: string;
44
- subagentId?: string;
45
- sessionGrantManager?: GrantManager;
46
- isNonInteractive?: boolean;
47
- traceWriter?: TraceSink;
48
- readOnlyBash?: boolean;
49
- maxOutputBytes?: number;
50
- spawnedPidRegistry?: SpawnedPidRegistry;
51
- userAttention?: UserAttention;
52
- bashOutputTailReporter?: (toolUseId: string) => (tail: string | undefined) => void;
53
- detachRegistry?: DetachableToolRegistry;
54
- processJobs?: ProcessJobRegistry;
55
- }
12
+ import type { SessionToolDispatcherOptions } from './dispatcher.options.js';
13
+ export type { SessionToolDispatcherOptions } from './dispatcher.options.js';
56
14
  export declare class SessionToolDispatcher implements ToolDispatcher {
57
15
  private readonly handlers;
58
16
  private readonly schemas;
@@ -88,6 +46,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
88
46
  private readonly repeatFailureGuard;
89
47
  private readonly toolHealthMonitor;
90
48
  private readonly strategyNudger;
49
+ readonly toolCallLedger: ToolCallLedgerWiring;
91
50
  private readonly _getMcpServerStates;
92
51
  private readonly grantManager;
93
52
  constructor(opts: SessionToolDispatcherOptions);
@@ -3,6 +3,7 @@ import type { TraceSink } from '../trace/index.js';
3
3
  import type { ToolCall, ToolResult } from '../providers/anthropic-direct/types.js';
4
4
  import type { ToolActivityReporter } from '../providers/shared/tool-activity.js';
5
5
  import type { RepeatFailureGuard } from './repeat-failure-guard.js';
6
+ import type { ToolCallLedgerWiring } from './dispatcher.ledger.js';
6
7
  import type { SubagentExecutor } from './subagent-executor.js';
7
8
  import type { ConcurrencyClassifier } from './types.js';
8
9
  import type { ToolHealthMonitor } from './tool-health-monitor.js';
@@ -13,6 +14,7 @@ export interface ExecuteBatchDeps {
13
14
  runPreDispatchGates: (call: ToolCall, opts?: RunPreDispatchGatesOpts) => Promise<ToolResult | null>;
14
15
  resetDenialBreaker: () => void;
15
16
  repeatFailureGuard: RepeatFailureGuard;
17
+ toolCallLedger: ToolCallLedgerWiring;
16
18
  repeatBreakerExemptTools: ReadonlySet<string>;
17
19
  executeCore: (call: ToolCall) => Promise<ToolResult>;
18
20
  subagentExecutor: SubagentExecutor | undefined;
@@ -0,0 +1,13 @@
1
+ import type { ToolCall, ToolResult } from '../providers/anthropic-direct/types.js';
2
+ import { type RepeatFailureGuard } from './repeat-failure-guard.js';
3
+ import { ToolCallLedger, type LedgerHistory } from './tool-call-ledger.js';
4
+ export declare class ToolCallLedgerWiring {
5
+ readonly ledger: ToolCallLedger;
6
+ private round;
7
+ constructor(ledger?: ToolCallLedger);
8
+ get currentRound(): number;
9
+ beginRound(): void;
10
+ record(toolName: string, inputHash: string, result: ToolResult): void;
11
+ lookup(call: ToolCall): LedgerHistory;
12
+ }
13
+ export declare function noteSettledOutcome(guard: RepeatFailureGuard, wiring: ToolCallLedgerWiring, call: ToolCall, result: ToolResult): void;
@@ -0,0 +1,49 @@
1
+ import type { HookRegistry } from '../hooks.js';
2
+ import type { AnthropicToolDef } from '../providers/anthropic-direct/types.js';
3
+ import type { SubagentExecutor } from './subagent-executor.js';
4
+ import type { SkillExecutor } from './skill-executor.js';
5
+ import type { ComposeExecutor } from './compose-executor.js';
6
+ import type { ToolHandler, ConcurrencyClassifier } from './types.js';
7
+ import type { SpawnedPidRegistry } from './handlers/pid-registry.js';
8
+ import type { ToolPermissionConfig } from './permissions.js';
9
+ import type { CanUseTool } from '../types/sdk-types.js';
10
+ import type { GrantManager } from './grant-manager.js';
11
+ import type { TraceSink } from '../trace/index.js';
12
+ import type { GetMcpServerStates } from './dispatcher.mcp-states.js';
13
+ import type { UserAttention } from './user-yield.js';
14
+ import type { DetachableToolRegistry } from './detach-bash.js';
15
+ import type { ProcessJobRegistry } from '../shell-jobs/process-jobs.js';
16
+ import type { ToolCallLedgerWiring } from './dispatcher.ledger.js';
17
+ export interface SessionToolDispatcherOptions {
18
+ handlers: Map<string, ToolHandler>;
19
+ schemas: AnthropicToolDef[];
20
+ hookRegistry: HookRegistry | undefined;
21
+ permissions?: ToolPermissionConfig;
22
+ canUseTool?: CanUseTool;
23
+ subagentExecutor?: SubagentExecutor;
24
+ skillExecutor?: SkillExecutor;
25
+ composeExecutor?: ComposeExecutor;
26
+ concurrencyClassifier?: ConcurrencyClassifier;
27
+ maxConcurrentSafeCalls?: number;
28
+ cwd?: string;
29
+ readRoots?: string[];
30
+ writeRoots?: string[];
31
+ allowAll?: boolean;
32
+ env?: Record<string, string>;
33
+ getMcpServerStates?: GetMcpServerStates;
34
+ sessionId?: string;
35
+ parentSessionId?: string;
36
+ rootSessionId?: string;
37
+ subagentId?: string;
38
+ sessionGrantManager?: GrantManager;
39
+ isNonInteractive?: boolean;
40
+ traceWriter?: TraceSink;
41
+ readOnlyBash?: boolean;
42
+ maxOutputBytes?: number;
43
+ spawnedPidRegistry?: SpawnedPidRegistry;
44
+ userAttention?: UserAttention;
45
+ bashOutputTailReporter?: (toolUseId: string) => (tail: string | undefined) => void;
46
+ detachRegistry?: DetachableToolRegistry;
47
+ processJobs?: ProcessJobRegistry;
48
+ toolCallLedger?: ToolCallLedgerWiring;
49
+ }
@@ -9,6 +9,6 @@ export declare function repeatFailureFingerprint(call: ToolCall): string;
9
9
  export declare class RepeatFailureGuard {
10
10
  private readonly streaks;
11
11
  check(call: ToolCall): RepeatFailureVerdict | null;
12
- note(call: ToolCall, result: ToolResult): void;
12
+ note(call: ToolCall, result: ToolResult): string;
13
13
  streakFor(call: ToolCall): number;
14
14
  }
@@ -782,6 +782,7 @@ export declare const TraceEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject
782
782
  sessionId: z.ZodOptional<z.ZodString>;
783
783
  priorSessionId: z.ZodOptional<z.ZodString>;
784
784
  afkVersion: z.ZodOptional<z.ZodString>;
785
+ credentialSource: z.ZodOptional<z.ZodString>;
785
786
  }, z.core.$strip>;
786
787
  }, z.core.$strip>], "kind">;
787
788
  export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1270,6 +1271,7 @@ export declare const TraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1270
1271
  sessionId: z.ZodOptional<z.ZodString>;
1271
1272
  priorSessionId: z.ZodOptional<z.ZodString>;
1272
1273
  afkVersion: z.ZodOptional<z.ZodString>;
1274
+ credentialSource: z.ZodOptional<z.ZodString>;
1273
1275
  }, z.core.$strip>;
1274
1276
  }, z.core.$strip>, z.ZodObject<{
1275
1277
  ts: z.ZodString;
@@ -132,4 +132,5 @@ export declare const SessionPhasePayloadSchema: z.ZodObject<{
132
132
  sessionId: z.ZodOptional<z.ZodString>;
133
133
  priorSessionId: z.ZodOptional<z.ZodString>;
134
134
  afkVersion: z.ZodOptional<z.ZodString>;
135
+ credentialSource: z.ZodOptional<z.ZodString>;
135
136
  }, z.core.$strip>;
@@ -5,6 +5,7 @@ export { renderReceiptMarkdown };
5
5
  export { RECEIPT_SCHEMA_VERSION, type ReceiptMeta, type ReceiptToolFailure, type RunReceipt } from './receipt.types.js';
6
6
  import { type ReceiptMeta, type RunReceipt } from './receipt.types.js';
7
7
  export { extractJournalSummary, type JournalSummary } from './receipt.journal.js';
8
+ export { type SubagentModelEntry, type SubagentsByModel } from './receipt.subagents-by-model.js';
8
9
  export declare function parseTraceJsonl(raw: string): TraceEvent[];
9
10
  export declare function receiptPathsFor(tracePath: string): {
10
11
  label: string;
@@ -0,0 +1,11 @@
1
+ import type { TraceEvent } from './types.js';
2
+ export interface SubagentModelEntry {
3
+ started: number;
4
+ succeeded: number;
5
+ failed: number;
6
+ cancelled: number;
7
+ costUsd: number;
8
+ requested: string[];
9
+ }
10
+ export type SubagentsByModel = Record<string, SubagentModelEntry>;
11
+ export declare function buildSubagentsByModel(events: TraceEvent[]): SubagentsByModel | undefined;
@@ -2,6 +2,7 @@ import type { CostTokens, SessionCostSource } from './cost.js';
2
2
  import type { JournalSummary } from './receipt.journal.js';
3
3
  import type { OutcomesV1 } from '../outcomes/outcomes-v1.schema.js';
4
4
  import type { ClosureReason, ToolFailureClass, TraceEventKind } from './types.js';
5
+ import type { SubagentsByModel } from './receipt.subagents-by-model.js';
5
6
  export declare const RECEIPT_SCHEMA_VERSION: 3;
6
7
  export interface ReceiptToolFailure {
7
8
  toolUseId: string;
@@ -53,6 +54,7 @@ export interface RunReceipt {
53
54
  succeeded: number;
54
55
  failed: number;
55
56
  cancelled: number;
57
+ byModel?: SubagentsByModel;
56
58
  };
57
59
  cost: {
58
60
  finalCostUsd?: number;
@@ -10,4 +10,5 @@ export interface SessionPhasePayload {
10
10
  sessionId?: string;
11
11
  priorSessionId?: string;
12
12
  afkVersion?: string;
13
+ credentialSource?: string;
13
14
  }
@@ -90,6 +90,7 @@ export interface AgentConfig {
90
90
  drainSubagents?: (reason: string) => Promise<unknown>;
91
91
  getPendingChildTerminalWrites?: () => readonly Promise<void>[];
92
92
  getPendingChildBillingStreams?: () => readonly Promise<void>[];
93
+ credentialSource?: string;
93
94
  isSubagentFork?: true;
94
95
  hasWorkspacePreamble?: true;
95
96
  provider?: ModelProvider;
@@ -12,7 +12,7 @@ export declare function anthropicBilling(u: {
12
12
  cache_read_input_tokens?: number | null;
13
13
  cache_creation_input_tokens?: number | null;
14
14
  }): BillingUsage;
15
- export declare function openAICompatibleBilling(promptTokens: number, cachedTokens: number, completionTokens: number): BillingUsage;
15
+ export declare function openAICompatibleBilling(promptTokens: number, cachedTokens: number, completionTokens: number, cacheWriteTokens?: number): BillingUsage;
16
16
  export declare function sumBillingUsage(a: BillingUsage | undefined, b: BillingUsage | undefined): BillingUsage | undefined;
17
17
  export declare function billingToUsageFields(b: BillingUsage | undefined): Record<string, unknown>;
18
18
  export declare function billingFromUsageRecord(u: Record<string, unknown> | undefined): BillingUsage | undefined;
@@ -1,3 +1,4 @@
1
- export declare function describeCredentialSource(): string;
2
- export type CredentialSourceId = 'ANTHROPIC_API_KEY' | 'CLAUDE_CODE_OAUTH_TOKEN' | 'claude-code-keychain' | 'claude-code-session-refresh';
1
+ import { type CredentialSourceId } from '../agent/auth/credential-resolver.js';
2
+ export type { CredentialSourceId };
3
+ export declare function describeCredentialSource(source?: CredentialSourceId | null): string;
3
4
  export declare function credentialSourceId(): CredentialSourceId | null;