agent-afk 5.356.0 → 5.357.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/dist/agent/auth/credential-resolver.d.ts +2 -1
- package/dist/agent/dag-subagent.d.ts +1 -0
- package/dist/agent/lsp/client-handlers.d.ts +4 -0
- package/dist/agent/lsp/client.d.ts +9 -0
- package/dist/agent/lsp/diagnostics-store.d.ts +1 -0
- package/dist/agent/lsp/document-sync.d.ts +3 -1
- package/dist/agent/lsp/install.d.ts +10 -0
- package/dist/agent/lsp/pool.d.ts +1 -0
- package/dist/agent/lsp/query.d.ts +1 -0
- package/dist/agent/prompt-experiment.d.ts +2 -0
- package/dist/agent/providers/anthropic-direct/build-dispatcher.d.ts +2 -0
- package/dist/agent/providers/anthropic-direct/provider-options.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/provider-runtime.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query/compact-handler.d.ts +1 -1
- package/dist/agent/providers/anthropic-direct/query-maintenance.d.ts +1 -1
- package/dist/agent/providers/anthropic-direct/query-runtime.d.ts +1 -1
- package/dist/agent/providers/anthropic-direct/query-turn-driver.d.ts +1 -1
- package/dist/agent/providers/index.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/compact.d.ts +1 -1
- package/dist/agent/providers/openai-compatible/index.dispatcher-opts.d.ts +4 -2
- package/dist/agent/providers/openai-compatible/index.options.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/query/compact-handler.d.ts +1 -1
- package/dist/agent/providers/shared/compaction.d.ts +1 -0
- package/dist/agent/providers/shared/compaction.summarizer-input.d.ts +4 -1
- package/dist/agent/providers/shared/lsp-install-eligibility.d.ts +2 -0
- package/dist/agent/session/ledger-lifecycle.d.ts +2 -0
- package/dist/agent/session/provider-lifecycle.d.ts +2 -1
- package/dist/agent/session/wire-executors.d.ts +2 -1
- package/dist/agent/subagent/identity-preamble.d.ts +1 -1
- package/dist/agent/subagent/identity-preamble.worktree.d.ts +3 -0
- package/dist/agent/tool-category.d.ts +2 -1
- package/dist/agent/tools/compose-input-parse.d.ts +1 -0
- package/dist/agent/tools/dispatcher.d.ts +4 -2
- package/dist/agent/tools/dispatcher.handler-context.d.ts +4 -0
- package/dist/agent/tools/dispatcher.ledger.d.ts +6 -1
- package/dist/agent/tools/dispatcher.options.d.ts +2 -0
- package/dist/agent/tools/dispatcher.pre-dispatch-gates.bash.d.ts +6 -0
- package/dist/agent/tools/dispatcher.pre-dispatch-gates.d.ts +1 -0
- package/dist/agent/tools/handlers/grep.pipe-retry.d.ts +2 -2
- package/dist/agent/tools/handlers/lsp-diagnostics.d.ts +2 -2
- package/dist/agent/tools/handlers/lsp-install-consent.d.ts +3 -0
- package/dist/agent/tools/handlers/lsp-refactor-actions.d.ts +21 -0
- package/dist/agent/tools/handlers/lsp-refactor-input.d.ts +16 -0
- package/dist/agent/tools/handlers/lsp-refactor-symbols.d.ts +10 -0
- package/dist/agent/tools/handlers/lsp-refactor.d.ts +4 -0
- package/dist/agent/tools/handlers/lsp-server.d.ts +15 -0
- package/dist/agent/tools/handlers/lsp-symbols.d.ts +2 -1
- package/dist/agent/tools/handlers/lsp-workspace-edit-parse.d.ts +19 -0
- package/dist/agent/tools/handlers/lsp-workspace-edit.d.ts +18 -0
- package/dist/agent/tools/handlers/patch-apply-engine.d.ts +1 -1
- package/dist/agent/tools/handlers/patch-apply-guard.d.ts +2 -0
- package/dist/agent/tools/handlers/worktree.create-note.d.ts +1 -0
- package/dist/agent/tools/nesting.d.ts +1 -0
- package/dist/agent/tools/readonly-bash.destructive-git.d.ts +8 -0
- package/dist/agent/tools/readonly-bash.destructive-git.heredoc.d.ts +7 -0
- package/dist/agent/tools/readonly-bash.destructive-git.nested.d.ts +5 -0
- package/dist/agent/tools/readonly-bash.tokenizer.d.ts +5 -0
- package/dist/agent/tools/subagent/input-parse.d.ts +1 -0
- package/dist/agent/tools/subagent-executor.execute-once.helpers.d.ts +1 -1
- package/dist/agent/tools/types.d.ts +1 -0
- package/dist/agent/trace/emit.d.ts +2 -1
- package/dist/agent/trace/events.compaction.d.ts +2 -0
- package/dist/agent/trace/events.d.ts +2 -0
- package/dist/agent/trace/types.compaction.d.ts +36 -0
- package/dist/agent/trace/types.d.ts +2 -34
- package/dist/agent/trace/writer.d.ts +2 -1
- package/dist/agent/types/config-types.d.ts +1 -0
- package/dist/agent/worktree/isolated-slug.d.ts +11 -0
- package/dist/agent/worktree/worktree-scratch.d.ts +13 -0
- package/dist/agent/worktree/worktree-sweep.classify.d.ts +1 -0
- package/dist/bundled-plugins/awa-bundled/skills/diagnose/SKILL.md +1 -1
- package/dist/bundled-plugins/awa-bundled/skills/refactor/SKILL.md +1 -1
- package/dist/bundled-plugins/awa-bundled/skills/ship/SKILL.md +17 -8
- package/dist/cli/slash/plugin-skills/state.d.ts +1 -0
- package/dist/cli.mjs +672 -654
- package/dist/config/env.d.ts +14 -0
- package/dist/config/env.prompt-experiment.d.ts +15 -0
- package/dist/index.mjs +491 -473
- package/dist/remote/remote-subagent-handle.d.ts +5 -2
- package/dist/telegram.mjs +533 -516
- package/package.json +1 -1
|
@@ -7,7 +7,8 @@ export interface AnthropicCredential {
|
|
|
7
7
|
}
|
|
8
8
|
export declare function resolveAnthropicCredential(): AnthropicCredential | undefined;
|
|
9
9
|
export declare function resolveAnthropicCredentialFromEnv(): AnthropicCredential | undefined;
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function lastResolvedAnthropicSource(): CredentialSourceId | undefined;
|
|
11
|
+
export declare function lastResolvedAnthropicMatchesToken(key: string): boolean;
|
|
11
12
|
export declare function _resetLastResolvedAnthropicCredential(): void;
|
|
12
13
|
export declare function preloadClaudeKeychainOAuth(provider: string): Promise<string | undefined>;
|
|
13
14
|
export declare function _resetRefreshedClaudeCodeOauthToken(): void;
|
|
@@ -38,6 +38,10 @@ export declare const CLIENT_CAPABILITIES: {
|
|
|
38
38
|
};
|
|
39
39
|
readonly codeAction: {
|
|
40
40
|
readonly dynamicRegistration: false;
|
|
41
|
+
readonly dataSupport: true;
|
|
42
|
+
readonly resolveSupport: {
|
|
43
|
+
readonly properties: readonly ["edit", "command"];
|
|
44
|
+
};
|
|
41
45
|
readonly codeActionLiteralSupport: {
|
|
42
46
|
readonly codeActionKind: {
|
|
43
47
|
readonly valueSet: readonly ["", "quickfix", "refactor", "source", "source.organizeImports"];
|
|
@@ -29,6 +29,8 @@ export declare class LspClient {
|
|
|
29
29
|
private disposing;
|
|
30
30
|
private holds;
|
|
31
31
|
private initialized;
|
|
32
|
+
serverCapabilities: Record<string, unknown>;
|
|
33
|
+
private workspaceEditHandler;
|
|
32
34
|
private readonly exited;
|
|
33
35
|
private readonly docUses;
|
|
34
36
|
private constructor();
|
|
@@ -41,6 +43,12 @@ export declare class LspClient {
|
|
|
41
43
|
get lastActivityAt(): number;
|
|
42
44
|
onExit(cb: () => void): () => void;
|
|
43
45
|
request<R = unknown>(method: string, params: unknown, opts?: RequestOptions): Promise<R>;
|
|
46
|
+
withWorkspaceEditHandler<T>(handler: (edit: unknown) => Promise<{
|
|
47
|
+
applied: boolean;
|
|
48
|
+
failureReason?: string;
|
|
49
|
+
}>, fn: () => Promise<T>): Promise<T>;
|
|
50
|
+
documentVersion(uri: string): number | undefined;
|
|
51
|
+
documentContents(): ReadonlyMap<string, string>;
|
|
44
52
|
notify(method: string, params: unknown): void;
|
|
45
53
|
syncFile(filePath: string, content?: string): Promise<FileSync | null>;
|
|
46
54
|
useDocument(uri: string): () => void;
|
|
@@ -48,6 +56,7 @@ export declare class LspClient {
|
|
|
48
56
|
get openDocuments(): string[];
|
|
49
57
|
get pid(): number | undefined;
|
|
50
58
|
dispose(): Promise<void>;
|
|
59
|
+
killSync(): void;
|
|
51
60
|
private doDispose;
|
|
52
61
|
private touch;
|
|
53
62
|
private markDead;
|
|
@@ -12,6 +12,7 @@ export declare class DiagnosticsStore {
|
|
|
12
12
|
private readonly waiters;
|
|
13
13
|
constructor(settleMs?: number);
|
|
14
14
|
get seq(): number;
|
|
15
|
+
current(uri: string, version: number): readonly unknown[];
|
|
15
16
|
record(params: unknown): void;
|
|
16
17
|
waitFor(uri: string, version: number | undefined, afterSeq: number, timeoutMs: number, signal?: AbortSignal): Promise<PublishedDiagnostics | null>;
|
|
17
18
|
}
|
|
@@ -9,8 +9,10 @@ export interface SyncResult {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class DocumentSync {
|
|
11
11
|
private readonly docs;
|
|
12
|
-
private
|
|
12
|
+
private nextVersion;
|
|
13
|
+
private readonly lastVersions;
|
|
13
14
|
version(uri: string): number | undefined;
|
|
15
|
+
contents(): ReadonlyMap<string, string>;
|
|
14
16
|
openUris(): string[];
|
|
15
17
|
closeAllExcept(keep: ReadonlySet<string>): Array<{
|
|
16
18
|
readonly method: 'textDocument/didClose';
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { EnsureInstalledResult, EnsureInstalledFn } from './server-spec.js';
|
|
2
2
|
import { type GrantStore } from './install.grants.js';
|
|
3
3
|
import { type NpmExecFn } from './install.npm.js';
|
|
4
|
+
export declare function installLockPath(language: string, serversDir?: string): string;
|
|
5
|
+
export declare function acquireInstallLock(language: string, signal?: AbortSignal, opts?: {
|
|
6
|
+
serversDir?: string;
|
|
7
|
+
pid?: number;
|
|
8
|
+
nowMs?: () => number;
|
|
9
|
+
pollMs?: number;
|
|
10
|
+
corruptGraceMs?: number;
|
|
11
|
+
openFn?: (path: string, flags: string) => Promise<import('node:fs/promises').FileHandle>;
|
|
12
|
+
}): Promise<() => Promise<void>>;
|
|
4
13
|
export interface InstallDeps {
|
|
5
14
|
grantStore?: GrantStore;
|
|
6
15
|
execFn?: NpmExecFn;
|
|
@@ -8,6 +17,7 @@ export interface InstallDeps {
|
|
|
8
17
|
platform?: string;
|
|
9
18
|
locateCli?: () => string | undefined;
|
|
10
19
|
inFlightMap?: Map<string, Promise<EnsureInstalledResult>>;
|
|
20
|
+
lockFn?: (language: string, signal?: AbortSignal) => Promise<() => Promise<void>>;
|
|
11
21
|
}
|
|
12
22
|
export declare function inFlightKey(language: string, interactive: boolean): string;
|
|
13
23
|
export declare function createEnsureInstalled(deps?: InstallDeps): EnsureInstalledFn;
|
package/dist/agent/lsp/pool.d.ts
CHANGED
|
@@ -15,4 +15,5 @@ export interface QueryContext {
|
|
|
15
15
|
remainingMs(): number;
|
|
16
16
|
}
|
|
17
17
|
export declare function withPooledFile<T>(spec: ServerSpec, filePath: string, content: string, opts: PooledQueryOptions, fn: (ctx: QueryContext) => Promise<T>): Promise<T>;
|
|
18
|
+
export declare function withPooledWorkspace<T>(spec: ServerSpec, opts: PooledQueryOptions, fn: (ctx: Pick<QueryContext, 'client' | 'remainingMs'>) => Promise<T>): Promise<T>;
|
|
18
19
|
export declare function awaitSyncDiagnostics(ctx: QueryContext, signal?: AbortSignal): Promise<PublishedDiagnostics | null>;
|
|
@@ -37,6 +37,7 @@ export interface BuildDispatcherOptions {
|
|
|
37
37
|
detachRegistry?: import('../../tools/detach-registry.js').DetachableToolRegistry;
|
|
38
38
|
processJobs?: import('../../shell-jobs/process-jobs.js').ProcessJobRegistry;
|
|
39
39
|
isNonInteractive?: boolean;
|
|
40
|
+
lspInstallAllowed?: boolean;
|
|
40
41
|
}
|
|
41
42
|
export interface BuildDispatcherDeps {
|
|
42
43
|
memoryStore: MemoryStore;
|
|
@@ -46,6 +47,7 @@ export interface BuildDispatcherDeps {
|
|
|
46
47
|
readOnlyMemory: boolean;
|
|
47
48
|
readOnlyState: boolean;
|
|
48
49
|
readOnlyBash: boolean;
|
|
50
|
+
blockDestructiveGit: boolean;
|
|
49
51
|
customTools: readonly CustomToolDef[];
|
|
50
52
|
mcpManager: import('../../mcp/index.js').McpManager | undefined;
|
|
51
53
|
schemas: readonly AnthropicToolDef[];
|
|
@@ -38,6 +38,7 @@ export interface AnthropicDirectProviderOptions {
|
|
|
38
38
|
readOnlyMemory?: boolean;
|
|
39
39
|
readOnlyState?: boolean;
|
|
40
40
|
readOnlyBash?: boolean;
|
|
41
|
+
blockDestructiveGit?: boolean;
|
|
41
42
|
mcpManager?: import('../../mcp/index.js').McpManager;
|
|
42
43
|
customTools?: import('../../tools/custom-tool.js').CustomToolDef[];
|
|
43
44
|
}
|
|
@@ -24,6 +24,7 @@ export declare class AnthropicDirectProvider implements ModelProvider {
|
|
|
24
24
|
private readonly readOnlyMemory;
|
|
25
25
|
private readonly readOnlyState;
|
|
26
26
|
private readonly readOnlyBash;
|
|
27
|
+
private readonly blockDestructiveGit;
|
|
27
28
|
private readonly mcpManager;
|
|
28
29
|
private readonly customTools;
|
|
29
30
|
private readonly fastModeController?;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProviderCompactResult } from '../../../provider.js';
|
|
2
|
-
import type { CompactionTrigger } from '../../../trace/types.js';
|
|
2
|
+
import type { CompactionTrigger } from '../../../trace/types.compaction.js';
|
|
3
3
|
import type { SessionState } from './session-state.js';
|
|
4
4
|
import type { AbortCoordinator } from '../../shared/abort-coordinator.js';
|
|
5
5
|
import type { RetryLayer } from './retry-layer.js';
|
|
@@ -8,7 +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
|
+
trigger?: import('../../trace/types.compaction.js').CompactionTrigger;
|
|
12
12
|
}): Promise<ProviderCompactResult>;
|
|
13
13
|
export declare function queryRewindTargets(state: SessionState): RewindTarget[];
|
|
14
14
|
export declare function rewindQueryConversation(state: SessionState, abort: AbortCoordinator, turnIndex: number): ProviderRewindConversationResult;
|
|
@@ -1,5 +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
|
+
import type { CompactionTrigger } from '../../trace/types.compaction.js';
|
|
3
3
|
import type { AnthropicDirectQueryOptions } from './query-options.js';
|
|
4
4
|
import type { JournalMessage } from '../../journal/index.js';
|
|
5
5
|
export type { AnthropicDirectQueryOptions } from './query-options.js';
|
|
@@ -35,6 +35,6 @@ export interface TurnDriverContext {
|
|
|
35
35
|
readonly cwd: string;
|
|
36
36
|
composeSystem(): ContentBlockParam[] | null;
|
|
37
37
|
makeInterruptedTurnEvent(): ProviderEvent;
|
|
38
|
-
compact(trigger?: import('../../trace/types.js').CompactionTrigger): Promise<ProviderCompactResult>;
|
|
38
|
+
compact(trigger?: import('../../trace/types.compaction.js').CompactionTrigger): Promise<ProviderCompactResult>;
|
|
39
39
|
}
|
|
40
40
|
export declare function driveTurns(ctx: TurnDriverContext): AsyncGenerator<ProviderEvent, void, void>;
|
|
@@ -13,6 +13,7 @@ export declare function resolveProvider(model: string | undefined, hints?: Provi
|
|
|
13
13
|
canUseTool?: import('../types/sdk-types.js').CanUseTool;
|
|
14
14
|
executors?: import('../session/session-executors.js').ProviderExecutorOpts;
|
|
15
15
|
mcpManager?: import('../mcp/index.js').McpManager;
|
|
16
|
+
blockDestructiveGit?: boolean;
|
|
16
17
|
}): ModelProvider;
|
|
17
18
|
export { anthropicDirectProvider };
|
|
18
19
|
export { AnthropicDirectProvider } from './anthropic-direct/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProviderCompactResult } from '../../provider.js';
|
|
2
2
|
import type { TraceSink } from '../../trace/index.js';
|
|
3
|
-
import type { CompactionTrigger } from '../../trace/types.js';
|
|
3
|
+
import type { CompactionTrigger } from '../../trace/types.compaction.js';
|
|
4
4
|
import { readShrinkFraction, type CompactionOps, type MicrocompactOps, type MicrocompactOptions, type MicrocompactResult } from '../shared/compaction.js';
|
|
5
5
|
export { readShrinkFraction };
|
|
6
6
|
import type { OpenAIMessage } from './messages.js';
|
|
@@ -21,12 +21,14 @@ export interface BuildDispatcherOpts {
|
|
|
21
21
|
headless?: boolean;
|
|
22
22
|
hookRegistry?: import('../../hooks.js').HookRegistry;
|
|
23
23
|
planExitControls?: PlanExitControls;
|
|
24
|
+
lspInstallAllowed?: boolean;
|
|
24
25
|
}
|
|
25
26
|
export declare function sessionRegistryOpts(src: {
|
|
26
27
|
detachRegistry?: BuildDispatcherOpts['detachRegistry'];
|
|
27
28
|
processJobs?: BuildDispatcherOpts['processJobs'];
|
|
28
29
|
}): Pick<BuildDispatcherOpts, 'detachRegistry' | 'processJobs'>;
|
|
29
|
-
export declare function headlessSignalOpts(src: Pick<BuildDispatcherOpts, 'headless'>): {
|
|
30
|
+
export declare function headlessSignalOpts(src: Pick<BuildDispatcherOpts, 'headless' | 'lspInstallAllowed'>): {
|
|
30
31
|
isNonInteractive?: true;
|
|
32
|
+
lspInstallAllowed?: true;
|
|
31
33
|
};
|
|
32
|
-
export declare function interactivityOpts(config: Pick<AgentConfig, 'isNonInteractive' | 'surface'>): Pick<BuildDispatcherOpts, 'isNonInteractive' | 'headless'>;
|
|
34
|
+
export declare function interactivityOpts(config: Pick<AgentConfig, 'isNonInteractive' | 'surface' | 'lspInstallAllowed' | 'depth' | 'parentSessionId' | 'subagentId'>): Pick<BuildDispatcherOpts, 'isNonInteractive' | 'headless' | 'lspInstallAllowed'>;
|
|
@@ -25,6 +25,7 @@ export interface OpenAICompatibleProviderOptions extends ChildSessionOptions {
|
|
|
25
25
|
surface?: string;
|
|
26
26
|
readOnlyMemory?: boolean;
|
|
27
27
|
readOnlyBash?: boolean;
|
|
28
|
+
blockDestructiveGit?: boolean;
|
|
28
29
|
tools?: ToolDispatcher;
|
|
29
30
|
mcpManager?: import('../../mcp/index.js').McpManager;
|
|
30
31
|
customTools?: import('../../tools/custom-tool.js').CustomToolDef[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import OpenAI from 'openai';
|
|
2
|
-
import type { CompactionTrigger } from '../../../../agent/trace/types.js';
|
|
2
|
+
import type { CompactionTrigger } from '../../../../agent/trace/types.compaction.js';
|
|
3
3
|
import type { ProviderCompactResult, ProviderUsage } from '../../../provider.js';
|
|
4
4
|
import type { OpenAIJournalWiring } from './journal-wiring.js';
|
|
5
5
|
import type { OpenAIMessage } from '../messages.js';
|
|
@@ -5,4 +5,7 @@ export declare const TOOL_ARGS_EXCERPT_CHARS = 600;
|
|
|
5
5
|
export declare const TOOL_RESULT_EXCERPT_CHARS = 1500;
|
|
6
6
|
export declare function excerptHeadTail(text: string, maxChars: number): string;
|
|
7
7
|
export declare function summarizerInputCharBudget(model: string, subscriptionPath?: boolean): number;
|
|
8
|
-
export declare function capTranscriptForSummarizer(transcript: string, maxChars: number | undefined):
|
|
8
|
+
export declare function capTranscriptForSummarizer(transcript: string, maxChars: number | undefined): {
|
|
9
|
+
transcript: string;
|
|
10
|
+
charsDropped: number;
|
|
11
|
+
};
|
|
@@ -4,7 +4,7 @@ import { QueryInputStream } from './input-iterable.js';
|
|
|
4
4
|
import type { AccountingAccumulator } from './accounting-accumulator.js';
|
|
5
5
|
import type { SessionShutdown } from './session-shutdown.js';
|
|
6
6
|
import type { AgentConfig } from '../types.js';
|
|
7
|
-
import type { ProviderQuery, ProviderEvent, ProviderUserTurn } from '../provider.js';
|
|
7
|
+
import type { ModelProvider, ProviderQuery, ProviderEvent, ProviderUserTurn } from '../provider.js';
|
|
8
8
|
import type { HookRegistry } from '../hooks.js';
|
|
9
9
|
import type { TransformDeps } from './stream-consumer.js';
|
|
10
10
|
export interface ProviderLifecycleResult {
|
|
@@ -17,6 +17,7 @@ export interface ProviderQueryResult {
|
|
|
17
17
|
providerQuery: ProviderQuery;
|
|
18
18
|
providerIterator: AsyncIterator<ProviderEvent>;
|
|
19
19
|
}
|
|
20
|
+
export declare function bareProviderResolver(config: AgentConfig): (m: string | undefined) => ModelProvider;
|
|
20
21
|
export declare function rebuildProviderQuery(config: AgentConfig, promptIterable: AsyncIterable<ProviderUserTurn>): ProviderQueryResult;
|
|
21
22
|
export declare function buildProviderLifecycle(config: AgentConfig): ProviderLifecycleResult;
|
|
22
23
|
export declare class ProviderInitializer {
|
|
@@ -2,7 +2,7 @@ import { SubagentManager } from '../subagent.js';
|
|
|
2
2
|
import { SubagentExecutor } from '../tools/subagent-executor.js';
|
|
3
3
|
import { SkillExecutor } from '../tools/skill-executor.js';
|
|
4
4
|
import { ComposeExecutor } from '../tools/compose-executor.js';
|
|
5
|
-
import { ContinuationRegistry } from '../subagent/continuation-registry.js';
|
|
5
|
+
import { ContinuationRegistry, type ContinuationLimits } from '../subagent/continuation-registry.js';
|
|
6
6
|
import type { SubagentExecutorContext } from '../tools/subagent-executor.js';
|
|
7
7
|
import type { BackgroundAgentRegistry } from '../background-registry.js';
|
|
8
8
|
import type { TraceSink } from '../trace/writer.js';
|
|
@@ -45,4 +45,5 @@ export interface WiredExecutors {
|
|
|
45
45
|
composeExecutor: ComposeExecutor;
|
|
46
46
|
continuationRegistry: ContinuationRegistry;
|
|
47
47
|
}
|
|
48
|
+
export declare function buildContinuationRegistry(limits?: ContinuationLimits): ContinuationRegistry;
|
|
48
49
|
export declare function wireExecutors(opts: WireExecutorsOptions): WiredExecutors;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentConfig } from '../types/config-types.js';
|
|
2
|
-
export
|
|
2
|
+
export { WORKTREE_STASH_RULE, worktreeScratchRule } from './identity-preamble.worktree.js';
|
|
3
3
|
export interface SubagentIdentityFacts {
|
|
4
4
|
isNonInteractive: boolean | undefined;
|
|
5
5
|
depth: number | undefined;
|
|
@@ -7,5 +7,6 @@ export declare const DAG_TOOLS: Set<string>;
|
|
|
7
7
|
export declare const NESTING_TOOLS: Set<string>;
|
|
8
8
|
export declare const READ_ONLY_PHASE_TOOLS: readonly string[];
|
|
9
9
|
export declare const STREAM_CUT_RETRY_SAFE_TOOLS: readonly string[];
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function isCodeSymbolsMutation(name: string, input: unknown): boolean;
|
|
11
|
+
export declare function categorizeTool(name: string, input?: unknown): ToolCategory;
|
|
11
12
|
export declare function dispatchTagForCategory(cat: ToolCategory): string | undefined;
|
|
@@ -4,7 +4,7 @@ import type { ToolDispatcher } from '../providers/anthropic-direct/tool-dispatch
|
|
|
4
4
|
import type { ToolCall, ToolResult } from '../providers/anthropic-direct/types.js';
|
|
5
5
|
import type { ToolActivityReporter } from '../providers/shared/tool-activity.js';
|
|
6
6
|
import { type GrantSnapshot } from './grant-manager.js';
|
|
7
|
-
import {
|
|
7
|
+
import { type ToolCallLedgerReader } from './dispatcher.ledger.js';
|
|
8
8
|
import { FileCheckpointWiring } from './dispatcher.file-checkpoint.js';
|
|
9
9
|
export { defaultConcurrencyClassifier } from './dispatch-batching.js';
|
|
10
10
|
export declare const REPEAT_CIRCUIT_BREAKER_THRESHOLD = 8;
|
|
@@ -33,8 +33,10 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
|
|
|
33
33
|
private readonly subagentId;
|
|
34
34
|
private readonly sessionGrantManager;
|
|
35
35
|
private readonly isNonInteractive;
|
|
36
|
+
private readonly lspInstallAllowed;
|
|
36
37
|
private readonly traceWriter;
|
|
37
38
|
private readonly readOnlyBash;
|
|
39
|
+
private readonly blockDestructiveGit;
|
|
38
40
|
private readonly maxOutputBytes;
|
|
39
41
|
private readonly spawnedPidRegistry;
|
|
40
42
|
private readonly userAttention;
|
|
@@ -47,7 +49,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
|
|
|
47
49
|
private readonly toolHealthMonitor;
|
|
48
50
|
private readonly strategyNudger;
|
|
49
51
|
private readonly _toolCallLedger;
|
|
50
|
-
get toolCallLedger():
|
|
52
|
+
get toolCallLedger(): ToolCallLedgerReader;
|
|
51
53
|
private readonly _getMcpServerStates;
|
|
52
54
|
private readonly grantManager;
|
|
53
55
|
constructor(opts: SessionToolDispatcherOptions);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ToolCall } from '../providers/anthropic-direct/types.js';
|
|
2
|
+
import type { ToolHandlerContext } from './types.js';
|
|
3
|
+
import type { SessionToolDispatcherOptions } from './dispatcher.js';
|
|
4
|
+
export declare function callHandlerContext(base: ToolHandlerContext, call: ToolCall, options: Pick<SessionToolDispatcherOptions, 'bashOutputTailReporter' | 'traceWriter' | 'userAttention' | 'detachRegistry' | 'processJobs'>): ToolHandlerContext;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { ToolCall, ToolResult } from '../providers/anthropic-direct/types.js';
|
|
2
2
|
import { type RepeatFailureGuard } from './repeat-failure-guard.js';
|
|
3
3
|
import { ToolCallLedger, type LedgerHistory } from './tool-call-ledger.js';
|
|
4
|
-
export
|
|
4
|
+
export interface ToolCallLedgerReader {
|
|
5
|
+
readonly currentRound: number;
|
|
6
|
+
readonly ledger: ToolCallLedger;
|
|
7
|
+
lookup(call: ToolCall): LedgerHistory;
|
|
8
|
+
}
|
|
9
|
+
export declare class ToolCallLedgerWiring implements ToolCallLedgerReader {
|
|
5
10
|
readonly ledger: ToolCallLedger;
|
|
6
11
|
private round;
|
|
7
12
|
constructor(ledger?: ToolCallLedger);
|
|
@@ -37,8 +37,10 @@ export interface SessionToolDispatcherOptions {
|
|
|
37
37
|
subagentId?: string;
|
|
38
38
|
sessionGrantManager?: GrantManager;
|
|
39
39
|
isNonInteractive?: boolean;
|
|
40
|
+
lspInstallAllowed?: boolean;
|
|
40
41
|
traceWriter?: TraceSink;
|
|
41
42
|
readOnlyBash?: boolean;
|
|
43
|
+
blockDestructiveGit?: boolean;
|
|
42
44
|
maxOutputBytes?: number;
|
|
43
45
|
spawnedPidRegistry?: SpawnedPidRegistry;
|
|
44
46
|
userAttention?: UserAttention;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PreDispatchGateDeps } from './dispatcher.pre-dispatch-gates.js';
|
|
2
|
+
import type { ToolCall } from '../providers/anthropic-direct/types.js';
|
|
3
|
+
export type BashGateFlags = Pick<PreDispatchGateDeps, 'readOnlyBash' | 'blockDestructiveGit'>;
|
|
4
|
+
export declare function checkDestructiveGitBash(call: ToolCall, flags: BashGateFlags): string | undefined;
|
|
5
|
+
export declare function checkReadOnlyBash(call: ToolCall, flags: BashGateFlags): string | undefined;
|
|
6
|
+
export declare function bashCommandDenialReason(call: ToolCall, flags: BashGateFlags): string | undefined;
|
|
@@ -25,6 +25,7 @@ export interface PreDispatchGateDeps {
|
|
|
25
25
|
permissions: ToolPermissionConfig | undefined;
|
|
26
26
|
canUseTool: CanUseTool | undefined;
|
|
27
27
|
readOnlyBash: boolean;
|
|
28
|
+
blockDestructiveGit: boolean;
|
|
28
29
|
repeatFailureGuard: RepeatFailureGuard;
|
|
29
30
|
sessionId: string | undefined;
|
|
30
31
|
parentSessionId: string | undefined;
|
|
@@ -2,5 +2,5 @@ import type { SpawnOptions } from 'child_process';
|
|
|
2
2
|
import { type GrepSettleResult } from './_rg-exit2.js';
|
|
3
3
|
export declare function hasUnescapedBackslashPipe(pattern: string): boolean;
|
|
4
4
|
export declare function rewriteBackslashPipe(pattern: string): string;
|
|
5
|
-
export declare function runPipeRetry(originalPattern: string, rgPath: string, rgArgs: string[], spawnOptions: SpawnOptions, searchPath: string, signal: AbortSignal, scanCapBytes: number): Promise<GrepSettleResult>;
|
|
6
|
-
export declare function handlePipeRetry(originalPattern: string, rgPath: string, rgArgs: string[], effectiveCwd: string | undefined, searchPath: string, signal: AbortSignal, scanCapBytes: number, settle: (result: GrepSettleResult) => void): void;
|
|
5
|
+
export declare function runPipeRetry(originalPattern: string, rewrittenPattern: string, rgPath: string, rgArgs: string[], spawnOptions: SpawnOptions, searchPath: string, signal: AbortSignal, scanCapBytes: number): Promise<GrepSettleResult>;
|
|
6
|
+
export declare function handlePipeRetry(originalPattern: string, rewrittenPattern: string, rgPath: string, rgArgs: string[], effectiveCwd: string | undefined, searchPath: string, signal: AbortSignal, scanCapBytes: number, settle: (result: GrepSettleResult) => void): void;
|
|
@@ -5,6 +5,6 @@ export interface LspDiagnostic {
|
|
|
5
5
|
col: number;
|
|
6
6
|
}
|
|
7
7
|
export declare function isLspDiagnosticsEnabled(): boolean;
|
|
8
|
-
export declare function queryLspDiagnostics(filePath: string, serverCmd?: readonly string[], signal?: AbortSignal): Promise<LspDiagnostic[]>;
|
|
8
|
+
export declare function queryLspDiagnostics(filePath: string, serverCmd?: readonly string[], sessionRoot?: string, signal?: AbortSignal): Promise<LspDiagnostic[]>;
|
|
9
9
|
export declare function formatDiagnostics(filePath: string, diags: LspDiagnostic[]): string;
|
|
10
|
-
export declare function appendLspDiagnostics(filePath: string, serverCmd?: readonly string[], signal?: AbortSignal): Promise<string>;
|
|
10
|
+
export declare function appendLspDiagnostics(filePath: string, serverCmd?: readonly string[], sessionRoot?: string, signal?: AbortSignal): Promise<string>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { QueryContext } from '../../lsp/query.js';
|
|
2
|
+
import type { ToolHandlerContext, ToolResult } from '../types.js';
|
|
3
|
+
import type { LspRefactorInput } from './lsp-refactor-input.js';
|
|
4
|
+
export interface RefactorEnvironment {
|
|
5
|
+
context?: ToolHandlerContext;
|
|
6
|
+
cwd: string;
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
expectedContents: ReadonlyMap<string, string>;
|
|
9
|
+
requestStartedAt: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function requestSnapshot(client: Pick<QueryContext['client'], 'documentContents'>): Promise<Pick<RefactorEnvironment, 'expectedContents' | 'requestStartedAt'>>;
|
|
12
|
+
export declare function editOptions(ctx: QueryContext, env: RefactorEnvironment): {
|
|
13
|
+
client: import("../../lsp/client.js").LspClient;
|
|
14
|
+
documentVersion: (uri: string) => number | undefined;
|
|
15
|
+
context?: ToolHandlerContext;
|
|
16
|
+
cwd: string;
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
expectedContents: ReadonlyMap<string, string>;
|
|
19
|
+
requestStartedAt: number;
|
|
20
|
+
};
|
|
21
|
+
export declare function codeActions(input: LspRefactorInput, ctx: QueryContext, env: RefactorEnvironment): Promise<ToolResult>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const REFACTOR_COMMANDS: readonly ["rename", "document_symbols", "workspace_symbols", "code_actions"];
|
|
2
|
+
export type RefactorCommand = typeof REFACTOR_COMMANDS[number];
|
|
3
|
+
export interface LspRefactorInput {
|
|
4
|
+
subcommand: RefactorCommand;
|
|
5
|
+
file_path?: string;
|
|
6
|
+
line?: number;
|
|
7
|
+
col?: number;
|
|
8
|
+
end_line?: number;
|
|
9
|
+
end_col?: number;
|
|
10
|
+
new_name?: string;
|
|
11
|
+
query?: string;
|
|
12
|
+
apply?: boolean;
|
|
13
|
+
action_index?: number;
|
|
14
|
+
action_title?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function validateRefactorInput(input: LspRefactorInput): string | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ToolHandlerContext } from '../types.js';
|
|
2
|
+
export declare function record(value: unknown): Record<string, unknown> | undefined;
|
|
3
|
+
export declare function symbolRows(raw: unknown, uri: string | undefined, context?: ToolHandlerContext, cwd?: string): {
|
|
4
|
+
name: string;
|
|
5
|
+
kind: number;
|
|
6
|
+
file_path: string;
|
|
7
|
+
line: number;
|
|
8
|
+
col: number;
|
|
9
|
+
depth: number;
|
|
10
|
+
}[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ToolHandlerContext, ToolResult } from '../types.js';
|
|
2
|
+
import { type LspRefactorInput } from './lsp-refactor-input.js';
|
|
3
|
+
export type { LspRefactorInput } from './lsp-refactor-input.js';
|
|
4
|
+
export declare function handleLspRefactor(input: LspRefactorInput, context?: ToolHandlerContext, cwd?: string, serverCmd?: readonly string[], signal?: AbortSignal): Promise<ToolResult>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InstallContext, ServerSpec } from '../../lsp/server-spec.js';
|
|
2
|
+
export interface LspServerOptions {
|
|
3
|
+
sessionRoot?: string;
|
|
4
|
+
serverCmd?: readonly string[];
|
|
5
|
+
installContext?: InstallContext;
|
|
6
|
+
}
|
|
7
|
+
export type LspServerResult = {
|
|
8
|
+
kind: 'resolved';
|
|
9
|
+
spec: ServerSpec;
|
|
10
|
+
root: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'unavailable';
|
|
13
|
+
error: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function resolveLspServer(filePath: string, options?: LspServerOptions): Promise<LspServerResult>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ToolHandlerContext } from '../types.js';
|
|
2
2
|
import { DEFAULT_LSP_CMD } from '../../lsp/typescript-default.js';
|
|
3
|
+
import type { InstallContext } from '../../lsp/server-spec.js';
|
|
3
4
|
export interface LspLocation {
|
|
4
5
|
filePath: string;
|
|
5
6
|
line: number;
|
|
@@ -13,7 +14,7 @@ export type SymbolSubcommand = 'definition' | 'references';
|
|
|
13
14
|
export { DEFAULT_LSP_CMD };
|
|
14
15
|
export declare function parseLocation(raw: unknown): LspLocation | null;
|
|
15
16
|
export declare function isLspSymbolsEnabled(): boolean;
|
|
16
|
-
export declare function queryLspSymbol(filePath: string, subcommand: SymbolSubcommand, line: number, col: number, rootDir?: string, serverCmd?: readonly string[], signal?: AbortSignal): Promise<LspSymbolResult>;
|
|
17
|
+
export declare function queryLspSymbol(filePath: string, subcommand: SymbolSubcommand, line: number, col: number, rootDir?: string, serverCmd?: readonly string[], signal?: AbortSignal, installContext?: InstallContext): Promise<LspSymbolResult>;
|
|
17
18
|
export declare function formatSymbolResult(filePath: string, subcommand: SymbolSubcommand, line: number, col: number, result: LspSymbolResult): string;
|
|
18
19
|
export declare function handleCodeSymbols(input: {
|
|
19
20
|
file_path: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface Position {
|
|
2
|
+
line: number;
|
|
3
|
+
character: number;
|
|
4
|
+
}
|
|
5
|
+
interface TextEdit {
|
|
6
|
+
range: {
|
|
7
|
+
start: Position;
|
|
8
|
+
end: Position;
|
|
9
|
+
};
|
|
10
|
+
newText: string;
|
|
11
|
+
}
|
|
12
|
+
export interface WorkspaceDocument {
|
|
13
|
+
uri: string;
|
|
14
|
+
version?: number | null;
|
|
15
|
+
edits: TextEdit[];
|
|
16
|
+
}
|
|
17
|
+
export declare function workspaceDocuments(value: unknown): WorkspaceDocument[];
|
|
18
|
+
export declare function applyTextEdits(text: string, edits: readonly TextEdit[]): string;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LspClient } from '../../lsp/client.js';
|
|
2
|
+
import type { ToolHandlerContext, ToolResult } from '../types.js';
|
|
3
|
+
import { type PatchFileChange } from './patch-validate.js';
|
|
4
|
+
export interface WorkspaceEditOptions {
|
|
5
|
+
cwd: string;
|
|
6
|
+
context?: ToolHandlerContext;
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
dryRun?: boolean;
|
|
9
|
+
client?: Pick<LspClient, 'syncFile'>;
|
|
10
|
+
documentVersion?: (uri: string) => number | undefined;
|
|
11
|
+
expectedContents: ReadonlyMap<string, string>;
|
|
12
|
+
requestStartedAt: number;
|
|
13
|
+
writtenContents?: ReadonlyMap<string, string>;
|
|
14
|
+
onApplied?: (written: ReadonlyMap<string, string>) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function fileClockNow(): Promise<number>;
|
|
17
|
+
export declare function convertWorkspaceEdit(edit: unknown, options: WorkspaceEditOptions): Promise<PatchFileChange[]>;
|
|
18
|
+
export declare function applyWorkspaceEdit(edit: unknown, options: WorkspaceEditOptions): Promise<ToolResult>;
|
|
@@ -11,4 +11,4 @@ export interface PatchApplyResult {
|
|
|
11
11
|
}>;
|
|
12
12
|
errors: ValidationError[];
|
|
13
13
|
}
|
|
14
|
-
export declare function applyPatch(changes: PatchFileChange[], fileContents: Map<string, string | null>, resolveBase: string | undefined, dryRun: boolean): Promise<PatchApplyResult>;
|
|
14
|
+
export declare function applyPatch(changes: PatchFileChange[], fileContents: Map<string, string | null>, resolveBase: string | undefined, dryRun: boolean, guard?: (path: string) => Promise<void>): Promise<PatchApplyResult>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { ManagedWorktreeInfo } from './worktree-managed.js';
|
|
2
2
|
export declare function detectInstallCommand(worktreePath: string): Promise<string>;
|
|
3
|
+
export declare function scratchDirNote(worktreePath: string): string;
|
|
3
4
|
export declare function buildCreateNote(info: ManagedWorktreeInfo): Promise<string>;
|