agent-afk 5.84.12 → 5.84.14
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/providers/anthropic-direct/loop/throttle-signals.d.ts +1 -1
- package/dist/agent/providers/anthropic-direct/stream-completeness.d.ts +3 -0
- package/dist/agent/providers/shared/first-byte-timeout.d.ts +5 -0
- package/dist/agent/subagent/constants.d.ts +8 -0
- package/dist/agent/subagent/fork-types.d.ts +38 -0
- package/dist/agent/subagent.d.ts +5 -45
- package/dist/cli.mjs +446 -446
- package/dist/index.mjs +164 -164
- package/dist/telegram.mjs +222 -222
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ProviderEvent } from '../../../provider.js';
|
|
2
2
|
import type { RunTurnInput } from '../types.js';
|
|
3
|
-
export declare function awaitCreateWithThrottleSignals(createPromise: Promise<AsyncIterable<unknown>>, input: RunTurnInput): AsyncGenerator<ProviderEvent, AsyncIterable<unknown>, void>;
|
|
3
|
+
export declare function awaitCreateWithThrottleSignals(createPromise: Promise<AsyncIterable<unknown>>, input: RunTurnInput, onThrottle?: (retryAfterMs: number | undefined) => void): AsyncGenerator<ProviderEvent, AsyncIterable<unknown>, void>;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
export declare const DEFAULT_MODEL_TTFB_TIMEOUT_MS = 180000;
|
|
2
2
|
export declare function resolveTtfbTimeoutMs(): number;
|
|
3
3
|
export declare const TTFB_TIMEOUT_MESSAGE = "model_ttfb_timeout";
|
|
4
|
+
export declare const TTFB_THROTTLE_SLACK_MS = 30000;
|
|
5
|
+
export declare const SDK_HONORED_RETRY_AFTER_CEILING_MS = 60000;
|
|
6
|
+
export declare const SDK_MAX_DEFAULT_BACKOFF_MS = 8000;
|
|
7
|
+
export declare function throttleExtensionMs(retryAfterMs: number | undefined): number | undefined;
|
|
4
8
|
export declare function isTtfbTimeoutError(err: unknown): boolean;
|
|
5
9
|
export interface FirstByteTimeoutHandle {
|
|
6
10
|
readonly signal: AbortSignal;
|
|
7
11
|
timedOut(): boolean;
|
|
8
12
|
firstByteSeen(): void;
|
|
13
|
+
extend(ms: number): void;
|
|
9
14
|
dispose(): void;
|
|
10
15
|
}
|
|
11
16
|
export declare function armFirstByteTimeout(baseSignal: AbortSignal, timeoutMs: number): FirstByteTimeoutHandle;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AgentConfig } from '../types.js';
|
|
2
|
+
export declare const DENY_ELICITATION: NonNullable<AgentConfig['onElicitation']>;
|
|
3
|
+
export declare const SUBAGENT_DEFAULT_MAX_TOOL_USE_ITERATIONS = 50;
|
|
4
|
+
export declare const SUBAGENT_DEFAULT_TIMEOUT_MS: number;
|
|
5
|
+
export declare function resolveSubagentTimeoutMs(): number;
|
|
6
|
+
export declare const SUBAGENT_DEFAULT_IDLE_TIMEOUT_MS: number;
|
|
7
|
+
export declare function resolveSubagentIdleTimeoutMs(): number;
|
|
8
|
+
export declare const SUBAGENT_BACKGROUND_TIMEOUT_MS: number;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ZodType } from 'zod';
|
|
2
|
+
import type { CanUseTool } from '../types/sdk-types.js';
|
|
3
|
+
import type { HookRegistry } from '../hooks.js';
|
|
4
|
+
import type { AgentConfig, IAgentSession } from '../types.js';
|
|
5
|
+
import type { SubagentProgressSink } from '../types/session-types.js';
|
|
6
|
+
import type { TraceWriter } from '../trace/index.js';
|
|
7
|
+
import type { Surface } from '../awareness/types.js';
|
|
8
|
+
import type { PhaseRole } from '../tools/nesting.js';
|
|
9
|
+
export interface ForkParent {
|
|
10
|
+
sessionId?: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ForkSubagentOptions<T = unknown> {
|
|
14
|
+
parent: Pick<IAgentSession, 'sessionId'> & Partial<Pick<IAgentSession, 'getInputStreamRef' | 'abortSignal' | 'hookRegistry'>>;
|
|
15
|
+
config: AgentConfig;
|
|
16
|
+
idPrefix?: string;
|
|
17
|
+
outputSchema?: ZodType<T>;
|
|
18
|
+
agentType: string;
|
|
19
|
+
resolvedAgentType?: string;
|
|
20
|
+
parentId?: string;
|
|
21
|
+
promptHead?: string;
|
|
22
|
+
denyElicitations?: boolean;
|
|
23
|
+
phaseRole?: PhaseRole;
|
|
24
|
+
}
|
|
25
|
+
export interface SubagentManagerOptions {
|
|
26
|
+
canUseTool?: CanUseTool;
|
|
27
|
+
parentAbortSignal?: AbortSignal;
|
|
28
|
+
hookRegistry?: HookRegistry;
|
|
29
|
+
progressSink?: SubagentProgressSink;
|
|
30
|
+
apiKey?: string;
|
|
31
|
+
baseUrl?: string;
|
|
32
|
+
parentModel?: string;
|
|
33
|
+
cwd?: string;
|
|
34
|
+
parentReadRoots?: string[];
|
|
35
|
+
traceWriter?: TraceWriter;
|
|
36
|
+
surface?: Surface;
|
|
37
|
+
onSubagentSucceeded?: (usage: import('./result.js').SubagentTrace['usage'], costUsd: number | undefined) => void;
|
|
38
|
+
}
|
package/dist/agent/subagent.d.ts
CHANGED
|
@@ -1,53 +1,13 @@
|
|
|
1
|
-
import type { CanUseTool } from './types/sdk-types.js';
|
|
2
|
-
import type { ZodType } from 'zod';
|
|
3
1
|
import { type ChildAbortedListener } from './abort-graph.js';
|
|
4
|
-
import type {
|
|
5
|
-
import type { AgentConfig, IAgentSession } from './types.js';
|
|
6
|
-
import type { SubagentProgressSink } from './types/session-types.js';
|
|
7
|
-
import type { AbortOrigin, TraceWriter } from './trace/index.js';
|
|
8
|
-
import type { Surface } from './awareness/types.js';
|
|
2
|
+
import type { AbortOrigin } from './trace/index.js';
|
|
9
3
|
import { type ReadScopeInputs } from './subagent-read-scope.js';
|
|
10
|
-
import { type PhaseRole } from './tools/nesting.js';
|
|
11
4
|
import { type SubagentHandle } from './subagent/handle.js';
|
|
12
5
|
import type { SubagentStatus, SubagentResult, SubagentTrace } from './subagent/result.js';
|
|
13
6
|
export type { SubagentStatus, SubagentResult, SubagentTrace, SubagentHandle };
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export declare const SUBAGENT_DEFAULT_IDLE_TIMEOUT_MS: number;
|
|
19
|
-
export declare function resolveSubagentIdleTimeoutMs(): number;
|
|
20
|
-
export declare const SUBAGENT_BACKGROUND_TIMEOUT_MS: number;
|
|
21
|
-
export interface ForkParent {
|
|
22
|
-
sessionId?: string;
|
|
23
|
-
id?: string;
|
|
24
|
-
}
|
|
25
|
-
export interface ForkSubagentOptions<T = unknown> {
|
|
26
|
-
parent: Pick<IAgentSession, 'sessionId'> & Partial<Pick<IAgentSession, 'getInputStreamRef' | 'abortSignal' | 'hookRegistry'>>;
|
|
27
|
-
config: AgentConfig;
|
|
28
|
-
idPrefix?: string;
|
|
29
|
-
outputSchema?: ZodType<T>;
|
|
30
|
-
agentType: string;
|
|
31
|
-
resolvedAgentType?: string;
|
|
32
|
-
parentId?: string;
|
|
33
|
-
promptHead?: string;
|
|
34
|
-
denyElicitations?: boolean;
|
|
35
|
-
phaseRole?: PhaseRole;
|
|
36
|
-
}
|
|
37
|
-
export interface SubagentManagerOptions {
|
|
38
|
-
canUseTool?: CanUseTool;
|
|
39
|
-
parentAbortSignal?: AbortSignal;
|
|
40
|
-
hookRegistry?: HookRegistry;
|
|
41
|
-
progressSink?: SubagentProgressSink;
|
|
42
|
-
apiKey?: string;
|
|
43
|
-
baseUrl?: string;
|
|
44
|
-
parentModel?: string;
|
|
45
|
-
cwd?: string;
|
|
46
|
-
parentReadRoots?: string[];
|
|
47
|
-
traceWriter?: TraceWriter;
|
|
48
|
-
surface?: Surface;
|
|
49
|
-
onSubagentSucceeded?: (usage: import('./subagent/result.js').SubagentTrace['usage'], costUsd: number | undefined) => void;
|
|
50
|
-
}
|
|
7
|
+
import { DENY_ELICITATION, SUBAGENT_DEFAULT_MAX_TOOL_USE_ITERATIONS, SUBAGENT_DEFAULT_TIMEOUT_MS, SUBAGENT_DEFAULT_IDLE_TIMEOUT_MS, SUBAGENT_BACKGROUND_TIMEOUT_MS, resolveSubagentTimeoutMs, resolveSubagentIdleTimeoutMs } from './subagent/constants.js';
|
|
8
|
+
import type { ForkParent, ForkSubagentOptions, SubagentManagerOptions } from './subagent/fork-types.js';
|
|
9
|
+
export { DENY_ELICITATION, SUBAGENT_DEFAULT_MAX_TOOL_USE_ITERATIONS, SUBAGENT_DEFAULT_TIMEOUT_MS, SUBAGENT_DEFAULT_IDLE_TIMEOUT_MS, SUBAGENT_BACKGROUND_TIMEOUT_MS, resolveSubagentTimeoutMs, resolveSubagentIdleTimeoutMs, };
|
|
10
|
+
export type { ForkParent, ForkSubagentOptions, SubagentManagerOptions };
|
|
51
11
|
export declare class SubagentManager {
|
|
52
12
|
private readonly active;
|
|
53
13
|
private readonly parentCanUseTool;
|