agent-afk 5.353.0 → 5.354.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.
- package/README.md +1 -1
- package/dist/agent/auth/credential-resolver.d.ts +6 -1
- package/dist/agent/awareness/types.d.ts +11 -2
- package/dist/agent/file-checkpoint/git-snapshot.diff.d.ts +3 -0
- package/dist/agent/providers/anthropic-direct/build-dispatcher.d.ts +2 -0
- package/dist/agent/providers/anthropic-direct/provider-runtime.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query/compact-handler.d.ts +2 -0
- package/dist/agent/providers/anthropic-direct/query-maintenance.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query-runtime.d.ts +2 -1
- package/dist/agent/providers/anthropic-direct/query-turn-driver.d.ts +1 -1
- package/dist/agent/providers/openai-compatible/compact.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/index.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/system-prompt-wiring.d.ts +1 -1
- package/dist/agent/providers/shared/compaction.d.ts +2 -2
- package/dist/agent/providers/shared/compaction.summarizer-input.d.ts +8 -0
- package/dist/agent/tools/dispatch-preparation.d.ts +4 -5
- package/dist/agent/tools/dispatcher.batch-process.d.ts +2 -0
- package/dist/agent/tools/dispatcher.d.ts +6 -46
- package/dist/agent/tools/dispatcher.execute-batch.d.ts +2 -0
- package/dist/agent/tools/dispatcher.ledger.d.ts +13 -0
- package/dist/agent/tools/dispatcher.options.d.ts +49 -0
- package/dist/agent/tools/repeat-failure-guard.d.ts +1 -1
- package/dist/agent/usage.billing.d.ts +1 -1
- package/dist/changelog.d.ts +0 -1
- package/dist/cli/auth-wizard.describe-source.d.ts +3 -2
- package/dist/cli/commands/interactive/tool-lane-diff-cap.d.ts +6 -0
- package/dist/cli/input/input-surface.d.ts +1 -0
- package/dist/cli/slash/commands/bgsub.d.ts +1 -0
- package/dist/cli/terminal-compositor.d.ts +2 -0
- package/dist/cli/terminal-compositor.input-dispatch.d.ts +2 -0
- package/dist/cli/terminal-compositor.reset.d.ts +1 -0
- package/dist/cli/terminal-compositor.types.d.ts +1 -0
- package/dist/cli.mjs +533 -544
- package/dist/config/env.d.ts +2 -2
- package/dist/config/env.ui.d.ts +2 -2
- package/dist/index.mjs +402 -411
- package/dist/insights/aggregators/subagent-outcomes.d.ts +2 -11
- package/dist/insights/index.d.ts +0 -1
- package/dist/telegram.mjs +433 -442
- package/package.json +7 -1
- package/dist/cli/slash/commands/changelog.d.ts +0 -2
package/README.md
CHANGED
|
@@ -263,7 +263,7 @@ With containment on (`default`), a file tool (read/write/edit/list/glob/grep) ta
|
|
|
263
263
|
|
|
264
264
|
## Changelog
|
|
265
265
|
|
|
266
|
-
Recent releases at [`CHANGELOG.md`](CHANGELOG.md)
|
|
266
|
+
Recent releases at [`CHANGELOG.md`](CHANGELOG.md).
|
|
267
267
|
|
|
268
268
|
## Follow Along
|
|
269
269
|
|
|
@@ -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;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { CompactUsageEntry } from '../usage/usage-formatter.js';
|
|
2
|
-
import type { SubagentOutcomeSummaryEntry } from '../../insights/aggregators/subagent-outcomes.js';
|
|
3
2
|
export type Surface = 'cli' | 'repl' | 'daemon' | 'telegram' | 'subagent' | 'web' | 'sdk' | 'unknown';
|
|
4
3
|
export type PhaseRole = 'read-only' | 'read-write';
|
|
5
4
|
export type SubagentStatusLiteValue = 'idle' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
@@ -66,7 +65,17 @@ export interface RuntimeSnapshot {
|
|
|
66
65
|
};
|
|
67
66
|
subagentOutcomeSummary?: SubagentOutcomeSummaryEntry[];
|
|
68
67
|
}
|
|
69
|
-
export
|
|
68
|
+
export interface SubagentOutcomeSummaryEntry {
|
|
69
|
+
model: string;
|
|
70
|
+
agentType: string;
|
|
71
|
+
depth: number;
|
|
72
|
+
count: number;
|
|
73
|
+
successRate: number;
|
|
74
|
+
capHitRate: number;
|
|
75
|
+
timeoutRate: number;
|
|
76
|
+
p50Ms: number;
|
|
77
|
+
p95Ms: number;
|
|
78
|
+
}
|
|
70
79
|
export type RuntimeView = 'self' | 'tools' | 'subagents' | 'workspace' | 'hooks' | 'all';
|
|
71
80
|
export interface RuntimeStateSource {
|
|
72
81
|
getHooks?(): import('./hooks-source.js').RuntimeHooks;
|
|
@@ -7,6 +7,7 @@ export interface RawEntry {
|
|
|
7
7
|
status: string;
|
|
8
8
|
gitPath: string;
|
|
9
9
|
}
|
|
10
|
+
export declare function formatBlobBytes(bytes: number): string;
|
|
10
11
|
export declare function parseRawDiff(buf: Buffer, onNonUtf8Path?: (rawPath: Buffer) => void): RawEntry[] | null;
|
|
11
12
|
export declare function toAbsPath(repoRoot: string, gitPath: string): string;
|
|
12
13
|
type Classified = {
|
|
@@ -22,6 +23,8 @@ export declare function classifyEntry(e: RawEntry): Classified;
|
|
|
22
23
|
export declare function parseCatFileBatch(buf: Buffer, count: number): Buffer[] | null;
|
|
23
24
|
export declare const MAX_BLOB_BYTES: number;
|
|
24
25
|
export declare function _setMaxBlobBytesForTests(value: number | undefined): void;
|
|
26
|
+
export declare const MAX_AGGREGATE_BLOB_BYTES: number;
|
|
27
|
+
export declare function _setMaxAggregateBlobBytesForTests(value: number | undefined): void;
|
|
25
28
|
export declare function parseBatchCheck(buf: Buffer, count: number): number[] | null;
|
|
26
29
|
export declare function diffWithCtx(options: DiffOptions, ctx: GitCtx): Promise<DiffResult>;
|
|
27
30
|
export {};
|
|
@@ -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;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProviderCompactResult } from '../../../provider.js';
|
|
2
|
+
import type { CompactionTrigger } from '../../../trace/types.js';
|
|
2
3
|
import type { SessionState } from './session-state.js';
|
|
3
4
|
import type { AbortCoordinator } from '../../shared/abort-coordinator.js';
|
|
4
5
|
import type { RetryLayer } from './retry-layer.js';
|
|
@@ -8,5 +9,6 @@ export interface CompactHandlerDeps {
|
|
|
8
9
|
retry: RetryLayer;
|
|
9
10
|
initSessionId: string;
|
|
10
11
|
traceWriter?: import('../../../trace/index.js').TraceSink;
|
|
12
|
+
trigger?: CompactionTrigger;
|
|
11
13
|
}
|
|
12
14
|
export declare function compactHistory(deps: CompactHandlerDeps): Promise<ProviderCompactResult>;
|
|
@@ -8,6 +8,7 @@ export declare function compactQueryHistory(options: {
|
|
|
8
8
|
retry: RetryLayer;
|
|
9
9
|
initSessionId: string;
|
|
10
10
|
traceWriter?: import('../../trace/index.js').TraceSink;
|
|
11
|
+
trigger?: import('../../trace/types.js').CompactionTrigger;
|
|
11
12
|
}): Promise<ProviderCompactResult>;
|
|
12
13
|
export declare function queryRewindTargets(state: SessionState): RewindTarget[];
|
|
13
14
|
export declare function rewindQueryConversation(state: SessionState, abort: AbortCoordinator, turnIndex: number): ProviderRewindConversationResult;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProviderAccountInfo, ProviderAgentInfo, ProviderCommandInfo, ProviderCompactResult, ProviderContextUsage, ProviderEvent, ProviderMcpServerStatus, ProviderModelInfo, ProviderQuery, ProviderRewindConversationResult, ProviderRewindResult, RewindTarget } from '../../provider.js';
|
|
2
|
+
import type { CompactionTrigger } from '../../trace/types.js';
|
|
2
3
|
import type { AnthropicDirectQueryOptions } from './query-options.js';
|
|
3
4
|
import type { JournalMessage } from '../../journal/index.js';
|
|
4
5
|
export type { AnthropicDirectQueryOptions } from './query-options.js';
|
|
@@ -60,7 +61,7 @@ export declare class AnthropicDirectQuery implements ProviderQuery {
|
|
|
60
61
|
rewindFiles(userMessageId: string, options?: {
|
|
61
62
|
dryRun?: boolean;
|
|
62
63
|
}): Promise<ProviderRewindResult>;
|
|
63
|
-
compact(): Promise<ProviderCompactResult>;
|
|
64
|
+
compact(trigger?: CompactionTrigger): Promise<ProviderCompactResult>;
|
|
64
65
|
listRewindTargets(): RewindTarget[];
|
|
65
66
|
journalSnapshot(): JournalMessage[] | undefined;
|
|
66
67
|
rewindConversation(turnIndex: number): Promise<ProviderRewindConversationResult>;
|
|
@@ -34,6 +34,6 @@ export interface TurnDriverContext {
|
|
|
34
34
|
readonly cwd: string;
|
|
35
35
|
composeSystem(): ContentBlockParam[] | null;
|
|
36
36
|
makeInterruptedTurnEvent(): ProviderEvent;
|
|
37
|
-
compact(): Promise<ProviderCompactResult>;
|
|
37
|
+
compact(trigger?: import('../../trace/types.js').CompactionTrigger): Promise<ProviderCompactResult>;
|
|
38
38
|
}
|
|
39
39
|
export declare function driveTurns(ctx: TurnDriverContext): AsyncGenerator<ProviderEvent, void, void>;
|
|
@@ -19,5 +19,6 @@ export interface CompactOpenAIHistoryDeps {
|
|
|
19
19
|
traceWriter?: TraceSink;
|
|
20
20
|
usedFraction?: number;
|
|
21
21
|
shrinkAtFraction?: number;
|
|
22
|
+
summarizerInputMaxChars?: number;
|
|
22
23
|
}
|
|
23
24
|
export declare function compactOpenAIHistory(deps: CompactOpenAIHistoryDeps): Promise<ProviderCompactResult>;
|
|
@@ -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;
|
|
@@ -26,7 +26,7 @@ export interface SystemPromptWiringResult {
|
|
|
26
26
|
goalPrompt: string;
|
|
27
27
|
manifest: string;
|
|
28
28
|
agentTypeListing: string;
|
|
29
|
-
episodeRecall: string
|
|
29
|
+
episodeRecall: string;
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
export declare function buildSystemPromptWiring(args: SystemPromptWiringArgs): SystemPromptWiringResult;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { ProviderCompactResult } from '../../provider.js';
|
|
2
2
|
import { type RetryInfo } from './transient-retry.js';
|
|
3
|
-
export
|
|
3
|
+
export { COMPACT_SUMMARY_MAX_TOKENS, COMPACT_SYSTEM_PROMPT, TOOL_ARGS_EXCERPT_CHARS, TOOL_RESULT_EXCERPT_CHARS, capTranscriptForSummarizer, excerptHeadTail, summarizerInputCharBudget, wrapTranscriptForSummary, } from './compaction.summarizer-input.js';
|
|
4
4
|
export declare const COMPACT_SUMMARY_HEADER = "[Compacted summary of earlier conversation]";
|
|
5
5
|
export declare const COMPACT_ACK_TEXT = "Acknowledged. Continuing from the summary above.";
|
|
6
|
-
export declare function wrapTranscriptForSummary(transcript: string): string;
|
|
7
6
|
export declare const DEFAULT_COMPACT_TIMEOUT_MS = 60000;
|
|
8
7
|
export declare const DEFAULT_COMPACT_SHRINK_THRESHOLD = 0.7;
|
|
9
8
|
export declare const DEFAULT_COMPACT_KEEP_LAST_TURNS = 2;
|
|
@@ -70,6 +69,7 @@ export interface CompactionCoreDeps<M> {
|
|
|
70
69
|
isAborted(): boolean;
|
|
71
70
|
abortInFlight?(): void;
|
|
72
71
|
timeoutMs?: number;
|
|
72
|
+
summarizerInputMaxChars?: number;
|
|
73
73
|
onSuccess?(info: CompactionSuccess<M>): void;
|
|
74
74
|
onRetry?(info: RetryInfo): void;
|
|
75
75
|
onExhausted?(info: RetryInfo): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const COMPACT_SYSTEM_PROMPT: string;
|
|
2
|
+
export declare function wrapTranscriptForSummary(transcript: string): string;
|
|
3
|
+
export declare const COMPACT_SUMMARY_MAX_TOKENS = 2000;
|
|
4
|
+
export declare const TOOL_ARGS_EXCERPT_CHARS = 600;
|
|
5
|
+
export declare const TOOL_RESULT_EXCERPT_CHARS = 1500;
|
|
6
|
+
export declare function excerptHeadTail(text: string, maxChars: number): string;
|
|
7
|
+
export declare function summarizerInputCharBudget(model: string, subscriptionPath?: boolean): number;
|
|
8
|
+
export declare function capTranscriptForSummarizer(transcript: string, maxChars: number | undefined): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ResolveChildModelOpts } from '../subagent/resolve-child-model.js';
|
|
1
|
+
import { type ResolveChildModelOpts, type ResolvedChildModel } from '../subagent/resolve-child-model.js';
|
|
2
2
|
export type DispatchCredentialPolicy = 'skip-openai-resolution' | 'resolve-then-omit-openai';
|
|
3
3
|
export interface DispatchModelPreparationInput {
|
|
4
4
|
modelIntent: ResolveChildModelOpts;
|
|
@@ -6,9 +6,8 @@ export interface DispatchModelPreparationInput {
|
|
|
6
6
|
resolveApiKeyForModel?: (model: string) => string | undefined;
|
|
7
7
|
parentApiKey?: string;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export interface PrepareDispatchModelResult extends ResolvedChildModel {
|
|
10
10
|
isOpenAI: boolean;
|
|
11
11
|
apiKey: string | undefined;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
12
|
+
}
|
|
13
|
+
export declare function prepareDispatchModel(input: DispatchModelPreparationInput): PrepareDispatchModelResult;
|
|
@@ -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
|
|
12
|
-
import {
|
|
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
|
-
|
|
25
|
-
|
|
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,8 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
|
|
|
88
46
|
private readonly repeatFailureGuard;
|
|
89
47
|
private readonly toolHealthMonitor;
|
|
90
48
|
private readonly strategyNudger;
|
|
49
|
+
private readonly _toolCallLedger;
|
|
50
|
+
get toolCallLedger(): ToolCallLedgerWiring;
|
|
91
51
|
private readonly _getMcpServerStates;
|
|
92
52
|
private readonly grantManager;
|
|
93
53
|
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):
|
|
12
|
+
note(call: ToolCall, result: ToolResult): string;
|
|
13
13
|
streakFor(call: ToolCall): number;
|
|
14
14
|
}
|
|
@@ -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;
|
package/dist/changelog.d.ts
CHANGED
|
@@ -9,5 +9,4 @@ export declare function formatEntries(commits: CommitEntry[], options?: {
|
|
|
9
9
|
}): string;
|
|
10
10
|
export declare function getExistingUnreleased(changelog: string): string;
|
|
11
11
|
export declare function updateAndStampChangelog(repoRoot: string, newEntries: string, version: string, date: string): void;
|
|
12
|
-
export declare function updateChangelog(repoRoot: string, newEntries: string): void;
|
|
13
12
|
export declare function stampRelease(repoRoot: string, version: string, date: string): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export type CredentialSourceId
|
|
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;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type DiffCapState = 'compact' | 'expanded' | 'full';
|
|
2
|
+
export declare function currentDiffCap(): number;
|
|
3
|
+
export declare function cycleDiffCap(): DiffCapState;
|
|
4
|
+
export declare function resetDiffCap(): void;
|
|
5
|
+
export declare function getDiffCapState(): DiffCapState;
|
|
6
|
+
export declare function diffCapHint(): string;
|
|
@@ -32,6 +32,7 @@ export interface InputSurfaceArmOpts {
|
|
|
32
32
|
onShiftTab?: () => void;
|
|
33
33
|
onOpenEditor?: () => void;
|
|
34
34
|
onOpenOutputViewer?: () => void;
|
|
35
|
+
onCycleDiffCap?: () => void;
|
|
35
36
|
scrollRegion?: CompositorScrollRegionGuard;
|
|
36
37
|
stdout?: NodeJS.WriteStream;
|
|
37
38
|
stdin?: NodeJS.ReadStream;
|
|
@@ -8,4 +8,5 @@ export declare const bgsubCmd: SlashCommand;
|
|
|
8
8
|
export declare const bgsubStatusCmd: SlashCommand;
|
|
9
9
|
export declare const bgsubJoinCmd: SlashCommand;
|
|
10
10
|
export declare const bgsubCancelCmd: SlashCommand;
|
|
11
|
+
export declare const bgsubListCmd: SlashCommand;
|
|
11
12
|
export declare const bgsubCommands: readonly SlashCommand[];
|
|
@@ -27,6 +27,7 @@ export declare class TerminalCompositor {
|
|
|
27
27
|
onTaskView?: () => boolean;
|
|
28
28
|
onOpenEditor?: () => void;
|
|
29
29
|
onOpenOutputViewer?: () => void;
|
|
30
|
+
onCycleDiffCap?: () => void;
|
|
30
31
|
readonly promptTextFn: (buffer: string) => string;
|
|
31
32
|
readonly history?: IHistoryRing;
|
|
32
33
|
readonly autocompleteState?: AutocompleteState;
|
|
@@ -52,6 +53,7 @@ export declare class TerminalCompositor {
|
|
|
52
53
|
suspendCommitQueue: string[];
|
|
53
54
|
canceled: boolean;
|
|
54
55
|
backgrounded: boolean;
|
|
56
|
+
pendingChordKey: string | undefined;
|
|
55
57
|
paused: boolean;
|
|
56
58
|
wasRaw: boolean;
|
|
57
59
|
stdinClaim: StdinClaimHandle | null;
|
|
@@ -48,8 +48,10 @@ export interface KeyDispatchHost {
|
|
|
48
48
|
readonly onTaskView?: () => boolean;
|
|
49
49
|
readonly onOpenEditor?: () => void;
|
|
50
50
|
readonly onOpenOutputViewer?: () => void;
|
|
51
|
+
readonly onCycleDiffCap?: () => void;
|
|
51
52
|
readonly onSubmit?: (payload: SubmissionPayload) => void;
|
|
52
53
|
readonly cprPending: boolean;
|
|
54
|
+
pendingChordKey: string | undefined;
|
|
53
55
|
}
|
|
54
56
|
export declare function applyEdit(self: KeyDispatchHost, next: InputCoreState): boolean;
|
|
55
57
|
export declare function dispatchKey(self: KeyDispatchHost, char: string | undefined, key: KeyInfo): void;
|
|
@@ -42,6 +42,7 @@ export interface ResetStateHost {
|
|
|
42
42
|
readonly pasteRegistry: Map<string, string>;
|
|
43
43
|
clipboardFailureMsg: string | null;
|
|
44
44
|
modeNotice: string | null;
|
|
45
|
+
pendingChordKey: string | undefined;
|
|
45
46
|
readonly autocompleteState?: AutocompleteState;
|
|
46
47
|
resizeUnsub: (() => void) | null;
|
|
47
48
|
resizeImmediateUnsub: (() => void) | null;
|
|
@@ -68,6 +68,7 @@ export interface TerminalCompositorOptions {
|
|
|
68
68
|
onShiftTab?: () => void;
|
|
69
69
|
onTaskView?: () => boolean;
|
|
70
70
|
onOpenEditor?: () => void;
|
|
71
|
+
onCycleDiffCap?: () => void;
|
|
71
72
|
onOpenOutputViewer?: () => void;
|
|
72
73
|
onSubmit?: (payload: SubmissionPayload) => void;
|
|
73
74
|
promptText?: string | ((buffer: string) => string);
|