agent-afk 5.177.2 → 5.181.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.
- package/dist/agent/daemon/handoff-store.d.ts +27 -0
- package/dist/agent/daemon/task-lifecycle.d.ts +1 -1
- package/dist/agent/effect-ledger/classifier.d.ts +5 -0
- package/dist/agent/effect-ledger/hook.d.ts +4 -0
- package/dist/agent/effect-ledger/idempotency.d.ts +1 -0
- package/dist/agent/effect-ledger/index.d.ts +6 -0
- package/dist/agent/effect-ledger/store.d.ts +13 -0
- package/dist/agent/effect-ledger/types.d.ts +32 -0
- package/dist/agent/facets/schema.d.ts +9 -9
- package/dist/agent/hooks.d.ts +1 -0
- package/dist/agent/mcp/client.d.ts +7 -2
- package/dist/agent/mcp/config-loader.d.ts +3 -0
- package/dist/agent/mcp/env-containment.d.ts +9 -0
- package/dist/agent/mcp/env.d.ts +16 -2
- package/dist/agent/mcp/manager.d.ts +3 -0
- package/dist/agent/mcp/transport.d.ts +2 -1
- package/dist/agent/mcp/types.d.ts +1 -0
- package/dist/agent/provider.d.ts +5 -0
- package/dist/agent/providers/anthropic-direct/types.d.ts +1 -1
- package/dist/agent/providers/shared/event-relay.d.ts +1 -0
- package/dist/agent/providers/shared/tool-activity.d.ts +1 -0
- package/dist/agent/tools/dispatcher.batch-process.d.ts +1 -0
- package/dist/agent/tools/dispatcher.d.ts +2 -1
- package/dist/agent/tools/handlers/index.d.ts +2 -1
- package/dist/agent/tools/handlers/json-query.d.ts +3 -0
- package/dist/agent/tools/schemas.d.ts +1 -0
- package/dist/agent/tools/schemas.json-query.d.ts +2 -0
- package/dist/agent/types/session-types.d.ts +4 -0
- package/dist/cli/commands/interactive/tool-lane-format.d.ts +4 -0
- package/dist/cli/commands/interactive/tool-lane.d.ts +2 -0
- package/dist/cli/display.d.ts +1 -0
- package/dist/cli/terminal-compositor.d.ts +1 -0
- package/dist/cli/terminal-compositor.lifecycle.d.ts +3 -0
- package/dist/cli.mjs +668 -663
- package/dist/index.mjs +241 -240
- package/dist/paths.d.ts +2 -0
- package/dist/telegram.mjs +314 -311
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type HandoffRequestType = 'ask_question' | 'mcp' | 'path_approval';
|
|
2
|
+
export interface HandoffRoute {
|
|
3
|
+
chatId: number;
|
|
4
|
+
threadId?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface UpdateHandoffResult {
|
|
7
|
+
won: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface HandoffRecord {
|
|
10
|
+
taskId: string;
|
|
11
|
+
sessionId: string;
|
|
12
|
+
question: Record<string, unknown>;
|
|
13
|
+
requestType: HandoffRequestType;
|
|
14
|
+
route?: HandoffRoute;
|
|
15
|
+
elicitId?: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
status: 'pending' | 'answered' | 'expired' | 'cancelled';
|
|
18
|
+
answer?: unknown;
|
|
19
|
+
answeredAt?: string;
|
|
20
|
+
answerSource?: string;
|
|
21
|
+
originalCommand: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function writeHandoff(record: HandoffRecord, handoffsDir?: string): Promise<void>;
|
|
24
|
+
export declare function readHandoff(taskId: string, handoffsDir?: string): Promise<HandoffRecord | null>;
|
|
25
|
+
export declare function deleteHandoff(taskId: string, handoffsDir?: string): Promise<void>;
|
|
26
|
+
export declare function listPendingHandoffs(handoffsDir?: string): Promise<HandoffRecord[]>;
|
|
27
|
+
export declare function updateHandoffAnswer(taskId: string, answer: unknown, source: string, handoffsDir?: string): Promise<UpdateHandoffResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TaskState = 'queued' | 'leased' | 'running' | 'succeeded' | 'failed' | 'retrying' | 'dead-letter';
|
|
1
|
+
export type TaskState = 'queued' | 'leased' | 'running' | 'waiting_human_input' | 'succeeded' | 'failed' | 'retrying' | 'dead-letter';
|
|
2
2
|
export interface TaskRecord {
|
|
3
3
|
id: string;
|
|
4
4
|
command: string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { EffectStore } from './store.js';
|
|
2
|
+
import type { HookHandler } from '../hooks.js';
|
|
3
|
+
export declare function createEffectLedgerPostHook(store?: EffectStore): HookHandler;
|
|
4
|
+
export declare function createEffectLedgerPreHook(pendingIds: Map<string, string>, store?: EffectStore): HookHandler;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function computeIdempotencyKey(operationType: string, args: unknown): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { EffectStore } from './store.js';
|
|
2
|
+
export { classifyToolCall } from './classifier.js';
|
|
3
|
+
export { computeIdempotencyKey } from './idempotency.js';
|
|
4
|
+
export { createEffectLedgerPostHook, createEffectLedgerPreHook } from './hook.js';
|
|
5
|
+
export type { EffectRecord, EffectStatus, EffectQuery, PendingEffectInput, ExecuteEffectInput, } from './types.js';
|
|
6
|
+
export type { Classification } from './classifier.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EffectRecord, EffectQuery, PendingEffectInput, ExecuteEffectInput } from './types.js';
|
|
2
|
+
export declare class EffectStore {
|
|
3
|
+
private readonly path;
|
|
4
|
+
private cachedRecords;
|
|
5
|
+
constructor(path?: string);
|
|
6
|
+
private readCached;
|
|
7
|
+
private invalidateCache;
|
|
8
|
+
writePending(input: PendingEffectInput): EffectRecord;
|
|
9
|
+
updateStatus(input: ExecuteEffectInput): Promise<EffectRecord>;
|
|
10
|
+
findByIdempotencyKey(key: string, sessionId?: string): Promise<EffectRecord | null>;
|
|
11
|
+
query(filters?: EffectQuery): Promise<EffectRecord[]>;
|
|
12
|
+
all(): Promise<EffectRecord[]>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type EffectStatus = 'pending' | 'executed' | 'confirmed' | 'failed' | 'ambiguous';
|
|
2
|
+
export interface EffectRecord {
|
|
3
|
+
v: 1;
|
|
4
|
+
id: string;
|
|
5
|
+
idempotencyKey: string;
|
|
6
|
+
operationType: string;
|
|
7
|
+
args: unknown;
|
|
8
|
+
status: EffectStatus;
|
|
9
|
+
sessionId?: string;
|
|
10
|
+
taskId?: string;
|
|
11
|
+
timestamp: number;
|
|
12
|
+
result?: unknown;
|
|
13
|
+
reconciledAt?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface EffectQuery {
|
|
16
|
+
sessionId?: string;
|
|
17
|
+
operationType?: string;
|
|
18
|
+
status?: EffectStatus;
|
|
19
|
+
idempotencyKey?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface PendingEffectInput {
|
|
22
|
+
idempotencyKey: string;
|
|
23
|
+
operationType: string;
|
|
24
|
+
args: unknown;
|
|
25
|
+
sessionId?: string;
|
|
26
|
+
taskId?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ExecuteEffectInput {
|
|
29
|
+
id: string;
|
|
30
|
+
status: Exclude<EffectStatus, 'pending'>;
|
|
31
|
+
result?: unknown;
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const FACET_VERSION =
|
|
2
|
+
export declare const FACET_VERSION = 3;
|
|
3
3
|
export declare const ToolEventInputSchema: z.ZodObject<{
|
|
4
4
|
toolName: z.ZodString;
|
|
5
5
|
toolUseId: z.ZodOptional<z.ZodString>;
|
|
@@ -79,10 +79,10 @@ export declare const WorldChangesSchema: z.ZodObject<{
|
|
|
79
79
|
mutated: z.ZodBoolean;
|
|
80
80
|
}, z.core.$strip>;
|
|
81
81
|
export declare const TokenBreakdownSchema: z.ZodObject<{
|
|
82
|
-
input: z.ZodNumber
|
|
83
|
-
output: z.ZodNumber
|
|
84
|
-
cache_read: z.ZodNumber
|
|
85
|
-
cache_creation: z.ZodNumber
|
|
82
|
+
input: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
output: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
cache_read: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
cache_creation: z.ZodOptional<z.ZodNumber>;
|
|
86
86
|
cost_usd: z.ZodNumber;
|
|
87
87
|
}, z.core.$strip>;
|
|
88
88
|
export type TokenBreakdown = z.infer<typeof TokenBreakdownSchema>;
|
|
@@ -142,10 +142,10 @@ export declare const SessionFacetSchema: z.ZodObject<{
|
|
|
142
142
|
mutated: z.ZodBoolean;
|
|
143
143
|
}, z.core.$strip>;
|
|
144
144
|
token_breakdown: z.ZodOptional<z.ZodObject<{
|
|
145
|
-
input: z.ZodNumber
|
|
146
|
-
output: z.ZodNumber
|
|
147
|
-
cache_read: z.ZodNumber
|
|
148
|
-
cache_creation: z.ZodNumber
|
|
145
|
+
input: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
output: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
cache_read: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
cache_creation: z.ZodOptional<z.ZodNumber>;
|
|
149
149
|
cost_usd: z.ZodNumber;
|
|
150
150
|
}, z.core.$strip>>;
|
|
151
151
|
decisions: z.ZodArray<z.ZodString>;
|
package/dist/agent/hooks.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type Tool as McpTool } from '@modelcontextprotocol/sdk/types.js';
|
|
1
|
+
import { type CallToolResult, type Tool as McpTool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
import { UnauthorizedError } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
3
3
|
import type { ToolResult } from '../tools/types.js';
|
|
4
4
|
import type { McpServerConfig } from './types.js';
|
|
5
|
+
import type { McpServerLayer } from './env-containment.js';
|
|
5
6
|
export interface McpClientConnectResult {
|
|
6
7
|
tools: McpTool[];
|
|
7
8
|
serverInfo: {
|
|
@@ -12,12 +13,14 @@ export interface McpClientConnectResult {
|
|
|
12
13
|
export declare class McpClient {
|
|
13
14
|
private readonly serverName;
|
|
14
15
|
private readonly config;
|
|
16
|
+
private readonly layer;
|
|
17
|
+
private readonly trustedAllowSecretEnv;
|
|
15
18
|
private client;
|
|
16
19
|
private connected;
|
|
17
20
|
private pendingAuthTransport;
|
|
18
21
|
onTransportError?: (err: Error) => void;
|
|
19
22
|
onToolListChanged?: () => void;
|
|
20
|
-
constructor(serverName: string, config: McpServerConfig);
|
|
23
|
+
constructor(serverName: string, config: McpServerConfig, layer?: McpServerLayer, trustedAllowSecretEnv?: readonly string[]);
|
|
21
24
|
connect(): Promise<McpClientConnectResult>;
|
|
22
25
|
listTools(): Promise<McpTool[]>;
|
|
23
26
|
refreshTools(): Promise<McpTool[]>;
|
|
@@ -25,4 +28,6 @@ export declare class McpClient {
|
|
|
25
28
|
finishAuth(authorizationCode: string): Promise<void>;
|
|
26
29
|
disconnect(): Promise<void>;
|
|
27
30
|
}
|
|
31
|
+
declare function normalizeCallToolResult(result: CallToolResult): ToolResult;
|
|
28
32
|
export { UnauthorizedError };
|
|
33
|
+
export { normalizeCallToolResult };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { McpServerConfig } from './types.js';
|
|
2
|
+
import type { McpServerLayer } from './env-containment.js';
|
|
2
3
|
export interface McpConfigFile {
|
|
3
4
|
mcpServers?: Record<string, McpServerConfig>;
|
|
4
5
|
}
|
|
@@ -6,6 +7,8 @@ export interface LoadedMcpConfig {
|
|
|
6
7
|
mcpServers: Record<string, McpServerConfig>;
|
|
7
8
|
sources: string[];
|
|
8
9
|
warnings: string[];
|
|
10
|
+
serverLayers: Record<string, McpServerLayer>;
|
|
11
|
+
userAllowSecretEnv: Record<string, string[]>;
|
|
9
12
|
}
|
|
10
13
|
export declare function getMcpConfigPath(): string;
|
|
11
14
|
export declare function getProjectMcpConfigPath(cwd?: string): string | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type McpServerLayer = 'project' | 'user-global' | 'plugin' | 'cli';
|
|
2
|
+
export declare function isSecretPattern(varName: string): boolean;
|
|
3
|
+
export declare function isDangerousInherited(varName: string): boolean;
|
|
4
|
+
export interface SecretCheckResult {
|
|
5
|
+
allowed: boolean;
|
|
6
|
+
warning?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function checkSecretExpansion(varName: string, layer: McpServerLayer, serverName: string, allowSecretEnv?: readonly string[]): SecretCheckResult;
|
|
9
|
+
export declare function scrubDangerousEnv(base: Record<string, string>): string[];
|
package/dist/agent/mcp/env.d.ts
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
|
+
import { type McpServerLayer } from './env-containment.js';
|
|
1
2
|
export interface EnvExpansionResult<T> {
|
|
2
3
|
value: T;
|
|
3
4
|
missing: string[];
|
|
5
|
+
blocked: string[];
|
|
4
6
|
}
|
|
5
|
-
export declare function expandEnvString(input: string, source?: NodeJS.ProcessEnv): EnvExpansionResult<string>;
|
|
6
|
-
export declare function expandEnvRecord(input: Record<string, string> | undefined, source?: NodeJS.ProcessEnv): EnvExpansionResult<Record<string, string
|
|
7
|
+
export declare function expandEnvString(input: string, source?: NodeJS.ProcessEnv): Omit<EnvExpansionResult<string>, 'blocked'>;
|
|
8
|
+
export declare function expandEnvRecord(input: Record<string, string> | undefined, source?: NodeJS.ProcessEnv): Omit<EnvExpansionResult<Record<string, string>>, 'blocked'>;
|
|
9
|
+
export interface EnvExpansionContext {
|
|
10
|
+
layer: McpServerLayer;
|
|
11
|
+
serverName: string;
|
|
12
|
+
allowSecretEnv?: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
export declare function expandEnvStringForLayer(input: string, ctx: EnvExpansionContext, source?: NodeJS.ProcessEnv, warn?: (msg: string) => void): EnvExpansionResult<string>;
|
|
15
|
+
export declare function expandEnvRecordForLayer(input: Record<string, string> | undefined, ctx: EnvExpansionContext, source?: NodeJS.ProcessEnv, warn?: (msg: string) => void): EnvExpansionResult<Record<string, string>>;
|
|
16
|
+
export declare function expandHeadersForLayer(headers: Record<string, string> | undefined, ctx: EnvExpansionContext, source?: NodeJS.ProcessEnv, warn?: (msg: string) => void): {
|
|
17
|
+
headers: Record<string, string>;
|
|
18
|
+
missing: string[];
|
|
19
|
+
blocked: string[];
|
|
20
|
+
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { AnthropicToolDef, ToolHandler } from '../tools/types.js';
|
|
2
2
|
import type { McpClientState, McpServerConfig } from './types.js';
|
|
3
3
|
import type { TraceSink } from '../trace/index.js';
|
|
4
|
+
import type { McpServerLayer } from './env-containment.js';
|
|
4
5
|
export interface McpManagerInitOptions {
|
|
5
6
|
warnings?: string[];
|
|
6
7
|
traceWriter?: TraceSink;
|
|
8
|
+
serverLayers?: Record<string, McpServerLayer>;
|
|
9
|
+
userAllowSecretEnv?: Record<string, string[]>;
|
|
7
10
|
}
|
|
8
11
|
export declare class McpManager {
|
|
9
12
|
private readonly records;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
2
2
|
import type { OAuthClientProvider } from '@modelcontextprotocol/sdk/client/auth.js';
|
|
3
3
|
import type { McpServerConfig } from './types.js';
|
|
4
|
+
import { type McpServerLayer } from './env-containment.js';
|
|
4
5
|
export declare function expandHeaders(headers: Record<string, string> | undefined, source?: NodeJS.ProcessEnv): {
|
|
5
6
|
headers: Record<string, string>;
|
|
6
7
|
missing: string[];
|
|
@@ -9,4 +10,4 @@ export interface CreateTransportResult {
|
|
|
9
10
|
transport: Transport;
|
|
10
11
|
isSSE: boolean;
|
|
11
12
|
}
|
|
12
|
-
export declare function createTransport(serverName: string, config: McpServerConfig, oauthProvider?: OAuthClientProvider): CreateTransportResult;
|
|
13
|
+
export declare function createTransport(serverName: string, config: McpServerConfig, oauthProvider?: OAuthClientProvider, layer?: McpServerLayer, trustedAllowSecretEnv?: readonly string[]): CreateTransportResult;
|
|
@@ -10,6 +10,7 @@ export interface McpServerConfig {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
alwaysLoad?: boolean;
|
|
12
12
|
timeout?: number;
|
|
13
|
+
allowSecretEnv?: string[];
|
|
13
14
|
}
|
|
14
15
|
export type McpClientStatus = 'connecting' | 'connected' | 'error' | 'disabled' | 'oauth_pending';
|
|
15
16
|
export interface McpClientState {
|
package/dist/agent/provider.d.ts
CHANGED
|
@@ -100,6 +100,11 @@ export type ProviderEvent = {
|
|
|
100
100
|
incomplete?: boolean;
|
|
101
101
|
incompleteReason?: string;
|
|
102
102
|
failureClass?: ToolFailureClass;
|
|
103
|
+
} | {
|
|
104
|
+
type: 'tool.activity';
|
|
105
|
+
activeCount: number;
|
|
106
|
+
activeToolUseIds: string[];
|
|
107
|
+
sessionId?: string;
|
|
103
108
|
} | {
|
|
104
109
|
type: 'tool.diff';
|
|
105
110
|
toolUseId: string;
|
|
@@ -46,7 +46,7 @@ export interface AnthropicToolDef {
|
|
|
46
46
|
}
|
|
47
47
|
export interface ToolDispatcherLike {
|
|
48
48
|
execute(call: ToolCall): Promise<ToolResult>;
|
|
49
|
-
executeBatch?(calls: ToolCall[]): Promise<ToolResult[]>;
|
|
49
|
+
executeBatch?(calls: ToolCall[], onActivity?: (activeIds: readonly string[]) => void): Promise<ToolResult[]>;
|
|
50
50
|
setResolveBase?(cwd: string): void;
|
|
51
51
|
setAllowAll?(allow: boolean): void;
|
|
52
52
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function relayWhilePending<E, R>(start: (emit: (event: E) => void) => Promise<R>): AsyncGenerator<E, R, void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ToolActivityReporter = (activeIds: readonly string[]) => void;
|
|
@@ -13,6 +13,7 @@ export interface BatchExecDeps {
|
|
|
13
13
|
subagentExecutor: SubagentExecutor | undefined;
|
|
14
14
|
sessionId: string | undefined;
|
|
15
15
|
maxConcurrentSafeCalls: number;
|
|
16
|
+
onActivity?: (activeIds: readonly string[]) => void;
|
|
16
17
|
}
|
|
17
18
|
export declare function reconcileOutcomes(settled: PromiseSettledResult<{
|
|
18
19
|
result: ToolResult;
|
|
@@ -7,6 +7,7 @@ import type { SubagentExecutor } from './subagent-executor.js';
|
|
|
7
7
|
import type { SkillExecutor } from './skill-executor.js';
|
|
8
8
|
import type { ComposeExecutor } from './compose-executor.js';
|
|
9
9
|
import type { ToolHandler, ConcurrencyClassifier } from './types.js';
|
|
10
|
+
import type { ToolActivityReporter } from '../providers/shared/tool-activity.js';
|
|
10
11
|
import type { SpawnedPidRegistry } from './handlers/pid-registry.js';
|
|
11
12
|
import { type ToolPermissionConfig } from './permissions.js';
|
|
12
13
|
import type { CanUseTool } from '../types/sdk-types.js';
|
|
@@ -93,7 +94,7 @@ export declare class SessionToolDispatcher implements ToolDispatcher {
|
|
|
93
94
|
private runCanUseTool;
|
|
94
95
|
private runPreDispatchGates;
|
|
95
96
|
execute(call: ToolCall): Promise<ToolResult>;
|
|
96
|
-
executeBatch(calls: ToolCall[]): Promise<ToolResult[]>;
|
|
97
|
+
executeBatch(calls: ToolCall[], onActivity?: ToolActivityReporter): Promise<ToolResult[]>;
|
|
97
98
|
private executeCore;
|
|
98
99
|
private applyOutputCap;
|
|
99
100
|
private executeCoreInner;
|
|
@@ -24,5 +24,6 @@ import { waitForHandler } from './wait-for.js';
|
|
|
24
24
|
import { patchApplyHandler } from './patch-apply.js';
|
|
25
25
|
import { testRunHandler } from './test-run.js';
|
|
26
26
|
import { getFacetHandler } from './get-facet.js';
|
|
27
|
+
import { jsonQueryHandler, createJsonQueryHandler } from './json-query.js';
|
|
27
28
|
export declare function createBuiltinHandlers(permissionMode?: string, cwd?: string): Map<string, ToolHandler>;
|
|
28
|
-
export { bashHandler, readFileHandler, extractDocumentHandler, writeFileHandler, editFileHandler, globHandler, grepHandler, listDirectoryHandler, sendTelegramHandler, webScrapeHandler, webRequestHandler, createScheduleHandler, listSchedulesHandler, getScheduleHistoryHandler, cancelScheduleHandler, terminalFontSizeHandler, createWorktreeHandler, configGetHandler, configSetHandler, askQuestionHandler, waitForHandler, patchApplyHandler, browserOpenHandler, browserObserveHandler, browserActHandler, browserScreenshotHandler, browserCloseHandler, testRunHandler, getFacetHandler, };
|
|
29
|
+
export { bashHandler, readFileHandler, extractDocumentHandler, writeFileHandler, editFileHandler, globHandler, grepHandler, listDirectoryHandler, sendTelegramHandler, webScrapeHandler, webRequestHandler, createScheduleHandler, listSchedulesHandler, getScheduleHistoryHandler, cancelScheduleHandler, terminalFontSizeHandler, createWorktreeHandler, configGetHandler, configSetHandler, askQuestionHandler, waitForHandler, patchApplyHandler, browserOpenHandler, browserObserveHandler, browserActHandler, browserScreenshotHandler, browserCloseHandler, testRunHandler, getFacetHandler, jsonQueryHandler, createJsonQueryHandler, };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AnthropicToolDef } from './types.js';
|
|
2
2
|
export { waitForTool } from './schemas.wait-for.js';
|
|
3
|
+
export { jsonQueryTool } from './schemas.json-query.js';
|
|
3
4
|
export declare const bashTool: AnthropicToolDef;
|
|
4
5
|
export declare const readFileTool: AnthropicToolDef;
|
|
5
6
|
export declare const extractDocumentTool: AnthropicToolDef;
|
|
@@ -12,4 +12,8 @@ export declare const GROUP_THRESHOLD_LEAF = 3;
|
|
|
12
12
|
export declare function inProgressVerb(toolName: string): string;
|
|
13
13
|
export declare function formatOutcome(chunk: ToolResultChunk, homeDir?: string, maxPreview?: number, toolName?: string): string;
|
|
14
14
|
export declare function batchBadge(chunk: ToolResultChunk | undefined): string;
|
|
15
|
+
export declare function activeToolBadge(toolUseId: string, activeTools: {
|
|
16
|
+
activeCount: number;
|
|
17
|
+
toolUseIds: Set<string>;
|
|
18
|
+
} | null): string;
|
|
15
19
|
export declare function formatToolResultLine(chunk: ToolResultChunk, toolPrefix?: string, homeDir?: string, toolName?: string): string;
|
|
@@ -9,6 +9,7 @@ export declare class ToolLane {
|
|
|
9
9
|
private order;
|
|
10
10
|
private agentIdStack;
|
|
11
11
|
private lastElapsedSecond;
|
|
12
|
+
private activeTools;
|
|
12
13
|
addStart(toolUseId: string, toolName: string, toolInput: string): void;
|
|
13
14
|
addStartWithAgentContext(toolUseId: string, toolName: string, toolInput: string, agentContext: string | undefined, maxWidth?: number): void;
|
|
14
15
|
mergeAgentLabel(parentToolUseId: string, label: string, maxWidth?: number): boolean;
|
|
@@ -16,6 +17,7 @@ export declare class ToolLane {
|
|
|
16
17
|
setAgentResultSummary(toolUseId: string, summary: string): void;
|
|
17
18
|
setThinkingTail(toolUseId: string, tail: string | undefined): void;
|
|
18
19
|
addResult(toolUseId: string, chunk: ToolResultChunk): void;
|
|
20
|
+
notifyToolActivity(activeCount: number, activeToolUseIds: string[]): void;
|
|
19
21
|
addDiff(toolUseId: string, diff: DiffPayload): void;
|
|
20
22
|
addPreviewDiff(toolUseId: string, diff: DiffPayload): void;
|
|
21
23
|
upsertTextChild(toolUseId: string, agentContext: string, text: string): void;
|
package/dist/cli/display.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare function padDisplayRight(text: string, width: number): string;
|
|
|
5
5
|
export declare function padDisplayLeft(text: string, width: number): string;
|
|
6
6
|
export declare function padDisplay(text: string, width: number, align?: 'left' | 'right' | 'center'): string;
|
|
7
7
|
export declare function truncateDisplayWidth(text: string, maxWidth: number, ellipsis?: string): string;
|
|
8
|
+
export declare function suffixDisplayWidth(text: string, maxWidth: number, ellipsis?: string): string;
|
|
8
9
|
export declare function previousGraphemeIndex(text: string, index: number): number;
|
|
9
10
|
export declare function nextGraphemeIndex(text: string, index: number): number;
|
|
10
11
|
export interface CursorMetrics {
|
|
@@ -105,6 +105,7 @@ export declare class TerminalCompositor {
|
|
|
105
105
|
setInputMode(mode: CompositorInputMode): void;
|
|
106
106
|
getInputMode(): CompositorInputMode;
|
|
107
107
|
arm(): Promise<void>;
|
|
108
|
+
endTurn(): void;
|
|
108
109
|
disarm(): void;
|
|
109
110
|
setOverlay(text: string): void;
|
|
110
111
|
setSpinner(config: {
|
|
@@ -33,10 +33,13 @@ export interface LifecycleHost {
|
|
|
33
33
|
readonly committedBand: string[];
|
|
34
34
|
readonly committedBandMeta: BandRowMeta[];
|
|
35
35
|
readonly committedBandTopRow: number;
|
|
36
|
+
readonly committedBandBottomRow: number;
|
|
36
37
|
readonly committedBandPaintedRows: number;
|
|
37
38
|
bandGeometryStale: boolean;
|
|
39
|
+
clearCommittedBand(): void;
|
|
38
40
|
}
|
|
39
41
|
export declare function suspendInput(self: LifecycleHost): void;
|
|
40
42
|
export declare function resumeInput(self: LifecycleHost): void;
|
|
41
43
|
export declare function arm(self: LifecycleHost & KeyDispatchHost): Promise<void>;
|
|
42
44
|
export declare function disarm(self: LifecycleHost): void;
|
|
45
|
+
export declare function endTurnFlush(self: LifecycleHost): void;
|