agent-afk 5.24.0 → 5.25.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/providers/anthropic-direct/loop.d.ts +1 -1
- package/dist/agent/providers/anthropic-direct/query/cwd-dependents.d.ts +37 -0
- package/dist/agent/providers/anthropic-direct/query/presence-lifecycle.d.ts +13 -0
- package/dist/agent/providers/anthropic-direct/query/token-resolution.d.ts +6 -0
- package/dist/agent/providers/openai-compatible/query/dispatch-append.d.ts +15 -0
- package/dist/agent/providers/shared/tool-loop-cap.d.ts +5 -0
- package/dist/cli/commands/interactive/bootstrap.d.ts +1 -0
- package/dist/cli/elicitation/field-validation.d.ts +35 -0
- package/dist/cli/shared-helpers.d.ts +2 -0
- package/dist/cli.mjs +492 -492
- package/dist/config/env.d.ts +1 -0
- package/dist/index.mjs +189 -189
- package/dist/telegram.mjs +240 -240
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProviderEvent } from '../../provider.js';
|
|
2
2
|
import type { AnthropicToolDef, RunTurnInput, WireToolDef } from './types.js';
|
|
3
|
-
export
|
|
3
|
+
export { DEFAULT_MAX_TOOL_USE_ITERATIONS } from '../shared/tool-loop-cap.js';
|
|
4
4
|
export declare function toWireTool(tool: AnthropicToolDef): WireToolDef;
|
|
5
5
|
export declare const OVERLOAD_MAX_RETRIES = 3;
|
|
6
6
|
export declare function isTransientServerError(err: Error): boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AgentConfig } from '../../../types/config-types.js';
|
|
2
|
+
import type { SubagentExecutor } from '../../../tools/subagent-executor.js';
|
|
3
|
+
import type { SkillExecutor } from '../../../tools/skill-executor.js';
|
|
4
|
+
import type { ComposeExecutor } from '../../../tools/compose-executor.js';
|
|
5
|
+
import type { ToolDispatcher } from '../tool-dispatcher.js';
|
|
6
|
+
import { type RuntimeStateSource } from '../../../awareness/index.js';
|
|
7
|
+
export type CwdDependentsFactory = (newCwd: string) => {
|
|
8
|
+
userSystem: string;
|
|
9
|
+
dispatcher: ToolDispatcher;
|
|
10
|
+
};
|
|
11
|
+
export interface CwdDependentsFactoryArgs {
|
|
12
|
+
stableSystemPrefix: string[];
|
|
13
|
+
config: AgentConfig;
|
|
14
|
+
surface: string;
|
|
15
|
+
runtimeStateSource: RuntimeStateSource;
|
|
16
|
+
getCurrentCwd: () => string | undefined;
|
|
17
|
+
setCurrentCwd: (cwd: string) => void;
|
|
18
|
+
getCurrentPermissionMode: () => string;
|
|
19
|
+
sharedReadRoots: string[] | undefined;
|
|
20
|
+
sharedWriteRoots: string[] | undefined;
|
|
21
|
+
subagentExecutor: SubagentExecutor | undefined;
|
|
22
|
+
skillExecutor: SkillExecutor | undefined;
|
|
23
|
+
composeExecutor: ComposeExecutor | undefined;
|
|
24
|
+
buildDispatcher: (permissionMode: string, opts: {
|
|
25
|
+
cwd?: string;
|
|
26
|
+
env?: Record<string, string>;
|
|
27
|
+
readRoots?: string[];
|
|
28
|
+
writeRoots?: string[];
|
|
29
|
+
sessionId?: string;
|
|
30
|
+
parentSessionId?: string;
|
|
31
|
+
traceWriter?: AgentConfig['traceWriter'];
|
|
32
|
+
runtimeStateSource?: RuntimeStateSource;
|
|
33
|
+
hookRegistry?: AgentConfig['hookRegistry'];
|
|
34
|
+
planExitControls?: AgentConfig['planExitControls'];
|
|
35
|
+
}) => ToolDispatcher;
|
|
36
|
+
}
|
|
37
|
+
export declare function createCwdDependentsFactory(args: CwdDependentsFactoryArgs): CwdDependentsFactory;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type RuntimeStateSource } from '../../../awareness/index.js';
|
|
2
|
+
export interface PresenceLifecycleArgs {
|
|
3
|
+
depth: number | undefined;
|
|
4
|
+
parentSessionId: string | undefined;
|
|
5
|
+
sessionId: string | undefined;
|
|
6
|
+
currentPresenceSessionId: string | null;
|
|
7
|
+
runtimeStateSource: RuntimeStateSource;
|
|
8
|
+
surface: string;
|
|
9
|
+
cwd: string | undefined;
|
|
10
|
+
providerName: string;
|
|
11
|
+
model: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function registerPresenceLifecycle(args: PresenceLifecycleArgs): string | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TraceWriter } from '../../../trace/index.js';
|
|
2
|
+
import type { ProviderEvent } from '../../../provider.js';
|
|
3
|
+
import type { ToolDispatcher } from '../../anthropic-direct/tool-dispatcher.js';
|
|
4
|
+
import type { OpenAIMessage } from '../messages.js';
|
|
5
|
+
import type { StreamState } from '../translate.js';
|
|
6
|
+
export interface DispatchAndAppendInput {
|
|
7
|
+
state: StreamState;
|
|
8
|
+
signal: AbortSignal;
|
|
9
|
+
vision: boolean;
|
|
10
|
+
toolDispatcher: ToolDispatcher | undefined;
|
|
11
|
+
traceWriter: TraceWriter | undefined;
|
|
12
|
+
priorTurns: OpenAIMessage[];
|
|
13
|
+
sessionId: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function dispatchAndAppendToolCalls({ state, signal, vision, toolDispatcher, traceWriter, priorTurns, sessionId, }: DispatchAndAppendInput): AsyncGenerator<ProviderEvent>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const TOOL_USE_LOOP_CAPPED = "tool_use_loop_capped";
|
|
2
|
+
export declare const DEFAULT_MAX_TOOL_USE_ITERATIONS = 0;
|
|
3
|
+
export declare const WIND_DOWN_NOTE: string;
|
|
4
|
+
export declare function resolveMaxToolIterations(configured: number | undefined): number;
|
|
5
|
+
export declare function shouldWindDown(completedRounds: number, maxIterations: number): boolean;
|
|
@@ -14,6 +14,7 @@ interface BuildAgentSessionDeps {
|
|
|
14
14
|
thinking: ThinkingConfig | undefined;
|
|
15
15
|
effort: EffortLevel | undefined;
|
|
16
16
|
maxOutputTokens: number | undefined;
|
|
17
|
+
maxToolUseIterations: number | undefined;
|
|
17
18
|
providerFactory: (model: string | undefined) => ModelProvider;
|
|
18
19
|
hookRegistry: HookRegistry;
|
|
19
20
|
traceWriter: TraceWriter | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface NumberValidationOptions {
|
|
2
|
+
allowSkip: boolean;
|
|
3
|
+
min?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
emptyError: string;
|
|
6
|
+
}
|
|
7
|
+
export type NumberValidationOutcome = {
|
|
8
|
+
ok: true;
|
|
9
|
+
skip: true;
|
|
10
|
+
} | {
|
|
11
|
+
ok: true;
|
|
12
|
+
skip: false;
|
|
13
|
+
value: number;
|
|
14
|
+
} | {
|
|
15
|
+
ok: false;
|
|
16
|
+
error: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function validateNumberField(input: string, opts: NumberValidationOptions): NumberValidationOutcome;
|
|
19
|
+
export interface TextValidationOptions {
|
|
20
|
+
allowSkip: boolean;
|
|
21
|
+
minLength?: number;
|
|
22
|
+
maxLength?: number;
|
|
23
|
+
emptyError: string;
|
|
24
|
+
}
|
|
25
|
+
export type TextValidationOutcome = {
|
|
26
|
+
ok: true;
|
|
27
|
+
skip: true;
|
|
28
|
+
} | {
|
|
29
|
+
ok: true;
|
|
30
|
+
skip: false;
|
|
31
|
+
} | {
|
|
32
|
+
ok: false;
|
|
33
|
+
error: string;
|
|
34
|
+
};
|
|
35
|
+
export declare function validateTextField(input: string, opts: TextValidationOptions): TextValidationOutcome;
|
|
@@ -23,6 +23,8 @@ export declare function getMaxBudgetUsd(): number | undefined;
|
|
|
23
23
|
export declare function getTaskBudget(): number | undefined;
|
|
24
24
|
export declare function parseMaxOutputTokens(raw: string | undefined): number | undefined;
|
|
25
25
|
export declare function getMaxOutputTokens(): number | undefined;
|
|
26
|
+
export declare function parseMaxToolUseIterations(raw: string | undefined): number | undefined;
|
|
27
|
+
export declare function getMaxToolUseIterations(): number | undefined;
|
|
26
28
|
export declare function parseProvider(raw: string | undefined, opts?: {
|
|
27
29
|
subagentExecutor?: import('../agent/tools/subagent-executor.js').SubagentExecutor;
|
|
28
30
|
skillExecutor?: import('../agent/tools/skill-executor.js').SkillExecutor;
|