agent-afk 5.312.9 → 5.313.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/memory/memory-evidence.d.ts +4 -0
- package/dist/agent/providers/anthropic-direct/loop/stream-consumer.d.ts +25 -1
- package/dist/agent/tools/compose-executor.manager.d.ts +9 -0
- package/dist/agent/tools/compose-executor.node-build.d.ts +25 -0
- package/dist/agent/tools/compose-executor.preflight.d.ts +40 -0
- package/dist/agent/tools/compose-executor.settle.d.ts +19 -0
- package/dist/agent/tools/handlers/_output-cap.d.ts +2 -1
- package/dist/agent/tools/subagent/foreground-handoff.d.ts +22 -0
- package/dist/agent/tools/subagent/foreground-promotion.d.ts +1 -1
- package/dist/agent/types/message-types.d.ts +1 -0
- package/dist/cli/terminal-compositor.input-dispatch.enter.submit.d.ts +3 -0
- package/dist/cli.mjs +372 -373
- package/dist/index.mjs +187 -188
- package/dist/telegram.mjs +198 -199
- package/package.json +1 -1
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { FactCategory, FactVerification } from './types.js';
|
|
2
2
|
export declare const CODEBASE_FACT_CATEGORIES: ReadonlySet<FactCategory>;
|
|
3
3
|
export declare const UNVERIFIED_TAG = "[unverified]";
|
|
4
|
+
export declare const AUTO_REFLECTED_TAG = "[auto-reflected]";
|
|
5
|
+
export declare const AUTO_REFLECTED_CATEGORIES: ReadonlySet<FactCategory>;
|
|
4
6
|
export declare function isCodebaseFactCategory(category: FactCategory): boolean;
|
|
5
7
|
export declare function evidenceGateEnabled(): boolean;
|
|
6
8
|
export declare function requiresEvidence(category: FactCategory): boolean;
|
|
7
9
|
export declare function normalizeEvidence(evidence: string | null | undefined): string | null;
|
|
8
10
|
export declare function verificationStatus(category: FactCategory, evidence: string | null | undefined): FactVerification;
|
|
9
11
|
export declare function applyUnverifiedTag(content: string, status: FactVerification): string;
|
|
12
|
+
export declare function isAutoReflectedCategory(category: FactCategory): boolean;
|
|
13
|
+
export declare function applyAutoReflectedTag(content: string, category: FactCategory): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProviderEvent } from '../../../provider.js';
|
|
2
|
-
import type { RunTurnInput } from '../types.js';
|
|
2
|
+
import type { RunTurnInput, TurnResult } from '../types.js';
|
|
3
3
|
import type { FirstByteTimeoutHandle } from '../../shared/first-byte-timeout.js';
|
|
4
4
|
import { type StreamStallHandle } from '../../shared/stream-stall-timeout.js';
|
|
5
5
|
import type { RoundRetryBudget } from './retry-budget.js';
|
|
@@ -15,4 +15,28 @@ export interface StreamConsumerContext {
|
|
|
15
15
|
stallTimeoutMs: number;
|
|
16
16
|
requestStartedAt: number;
|
|
17
17
|
}
|
|
18
|
+
export interface StreamRoundState {
|
|
19
|
+
turnResult: TurnResult | null;
|
|
20
|
+
translatorErrored: boolean;
|
|
21
|
+
retryTtfb: boolean;
|
|
22
|
+
retryOverload: boolean;
|
|
23
|
+
retryStreamIncomplete: boolean;
|
|
24
|
+
overloadExhausted: boolean;
|
|
25
|
+
ttfbEmitted: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function handleFirstByteIfNeeded(state: StreamRoundState, input: RunTurnInput, ttfb: FirstByteTimeoutHandle, requestStartedAt: number): void;
|
|
28
|
+
export declare function handleInBandError(state: StreamRoundState, errorEvent: Extract<ProviderEvent, {
|
|
29
|
+
type: 'error';
|
|
30
|
+
}>, input: RunTurnInput, ttfb: FirstByteTimeoutHandle, stall: StreamStallHandle, stallTimeoutMs: number, retry: RoundRetryBudget): {
|
|
31
|
+
action: 'break';
|
|
32
|
+
} | {
|
|
33
|
+
action: 'yield-and-break';
|
|
34
|
+
yieldEvent: ProviderEvent;
|
|
35
|
+
};
|
|
36
|
+
export declare function handleCatchError(state: StreamRoundState, err: unknown, input: RunTurnInput, turn: TurnAccumulator, ttfb: FirstByteTimeoutHandle, stall: StreamStallHandle, stallTimeoutMs: number, retry: RoundRetryBudget): {
|
|
37
|
+
done: true;
|
|
38
|
+
yieldEvent?: ProviderEvent;
|
|
39
|
+
} | {
|
|
40
|
+
done: false;
|
|
41
|
+
};
|
|
18
42
|
export declare function consumeRoundStream({ events, input, turn, retry, ttfb, stall, stallTimeoutMs, requestStartedAt, }: StreamConsumerContext): AsyncGenerator<ProviderEvent, RoundOutcome, void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SubagentManager } from '../subagent.js';
|
|
2
|
+
import type { ComposeExecutorContext } from './compose-executor.context.js';
|
|
3
|
+
export interface CreateComposeManagerArgs {
|
|
4
|
+
ctx: ComposeExecutorContext;
|
|
5
|
+
signal: AbortSignal;
|
|
6
|
+
currentCwd: string | undefined;
|
|
7
|
+
nodeReadRoots: string[] | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare function createComposeManager(args: CreateComposeManagerArgs): SubagentManager;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SubagentDAGNode } from '../dag-subagent.js';
|
|
2
|
+
import type { ComposeNodeInput } from './compose-input-parse.js';
|
|
3
|
+
import { type ResolvedComposeAgent } from './compose-agent-resolve.js';
|
|
4
|
+
import type { ComposeExecutorContext } from './compose-executor.context.js';
|
|
5
|
+
export type ComposeNodeBuildResult = SubagentDAGNode | {
|
|
6
|
+
attachmentError: true;
|
|
7
|
+
nodeId: string;
|
|
8
|
+
error: Error;
|
|
9
|
+
};
|
|
10
|
+
export interface BuildComposeDagNodeArgs {
|
|
11
|
+
node: ComposeNodeInput;
|
|
12
|
+
index: number;
|
|
13
|
+
resolvedAgent: ResolvedComposeAgent;
|
|
14
|
+
totalNodes: number;
|
|
15
|
+
composeToolUseId: string;
|
|
16
|
+
ctx: ComposeExecutorContext;
|
|
17
|
+
currentCwd: string | undefined;
|
|
18
|
+
nodeReadRoots: string[] | undefined;
|
|
19
|
+
maxToolRoundsPerNode: number | undefined;
|
|
20
|
+
depth: number;
|
|
21
|
+
maxDepth: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function buildComposeUpstreamPrompt(prompt: string, inputs: Record<string, unknown>): string;
|
|
24
|
+
export declare function resolveComposeNodeApiKey(nodeModel: string, ctx: Pick<ComposeExecutorContext, 'resolveApiKeyForModel' | 'apiKey'>): string | undefined;
|
|
25
|
+
export declare function buildComposeDagNode(args: BuildComposeDagNodeArgs): Promise<ComposeNodeBuildResult>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ComposeInput } from './compose-input-parse.js';
|
|
2
|
+
import { deriveOrigin, actorFromDepth } from '../session/session-identity.js';
|
|
3
|
+
import { runSubagentDAG, type SubagentDAGNode } from '../dag-subagent.js';
|
|
4
|
+
import type { SubagentManager } from '../subagent.js';
|
|
5
|
+
import type { ToolCall, ToolResult } from './types.js';
|
|
6
|
+
import type { ComposeExecutorContext } from './compose-executor.context.js';
|
|
7
|
+
export type ComposeRoutingIdentity = {
|
|
8
|
+
origin: ReturnType<typeof deriveOrigin>;
|
|
9
|
+
actor: ReturnType<typeof actorFromDepth>;
|
|
10
|
+
} | Record<string, never>;
|
|
11
|
+
export interface ComposePreflightOk {
|
|
12
|
+
ok: true;
|
|
13
|
+
parsed: ComposeInput;
|
|
14
|
+
parseWarnings: string[];
|
|
15
|
+
identity: ComposeRoutingIdentity;
|
|
16
|
+
depth: number;
|
|
17
|
+
maxDepth: number;
|
|
18
|
+
maxToolRoundsPerNode: number | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare function preflightComposeCall(call: ToolCall, ctx: ComposeExecutorContext): ComposePreflightOk | {
|
|
21
|
+
ok: false;
|
|
22
|
+
result: ToolResult;
|
|
23
|
+
};
|
|
24
|
+
export interface StartComposeDagArgs {
|
|
25
|
+
manager: SubagentManager;
|
|
26
|
+
ctx: ComposeExecutorContext;
|
|
27
|
+
parsed: ComposeInput;
|
|
28
|
+
dagNodes: SubagentDAGNode[];
|
|
29
|
+
dagEdges: Array<{
|
|
30
|
+
from: string;
|
|
31
|
+
to: string;
|
|
32
|
+
}>;
|
|
33
|
+
currentCwd: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
export declare function startComposeDag(args: StartComposeDagArgs): ReturnType<typeof runSubagentDAG>;
|
|
36
|
+
export declare function recordComposeCompleted(identity: ComposeRoutingIdentity, parentSessionId: ComposeExecutorContext['parentSession']['sessionId'], parsed: ComposeInput, result: {
|
|
37
|
+
outputs: Record<string, unknown>;
|
|
38
|
+
failed: unknown[];
|
|
39
|
+
skipped: unknown[];
|
|
40
|
+
}, startedAt: number): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { formatDAGResult } from './compose-executor.format.js';
|
|
2
|
+
import { prependUsageNotice } from './usage-notice.js';
|
|
3
|
+
type ComposeRunResult = Parameters<typeof formatDAGResult>[0];
|
|
4
|
+
export declare function updateComposeWaveUnits(composeWaveId: string | undefined, result: ComposeRunResult): void;
|
|
5
|
+
export interface BuildComposeResultContentArgs {
|
|
6
|
+
result: ComposeRunResult;
|
|
7
|
+
spillSessionId: string;
|
|
8
|
+
callId: string;
|
|
9
|
+
parseWarnings: string[];
|
|
10
|
+
usageNotice: Parameters<typeof prependUsageNotice>[0];
|
|
11
|
+
}
|
|
12
|
+
export declare function buildComposeResultContent(args: BuildComposeResultContentArgs): string;
|
|
13
|
+
export declare function filterComposeEdges<E extends {
|
|
14
|
+
from: string;
|
|
15
|
+
to: string;
|
|
16
|
+
}>(edges: E[] | undefined, attachmentErrors: Array<{
|
|
17
|
+
id: string;
|
|
18
|
+
}>): E[];
|
|
19
|
+
export {};
|
|
@@ -5,4 +5,5 @@ export declare function capForModel(text: string): {
|
|
|
5
5
|
content: string;
|
|
6
6
|
truncated: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare
|
|
8
|
+
export declare function isOutputCapKill(content: string): boolean;
|
|
9
|
+
export declare const HARD_CAP_KILL_NOTE: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RunForegroundArgs, PromotedSubagentInfo } from './foreground-promotion.js';
|
|
2
|
+
import type { ToolResult } from '../types.js';
|
|
3
|
+
import type { QueuedNoteClaim } from './queued-note.js';
|
|
4
|
+
import { type BackgroundDelivery } from './background-delivery.js';
|
|
5
|
+
import { type teardownIsolatedWorktree } from '../handlers/worktree-managed.js';
|
|
6
|
+
type RunPromise = ReturnType<RunForegroundArgs['handle']['runToResult']>;
|
|
7
|
+
export declare function foregroundPromotionPayload(job: {
|
|
8
|
+
jobId: string;
|
|
9
|
+
subagentId: string;
|
|
10
|
+
label: string;
|
|
11
|
+
}, delivery: BackgroundDelivery | undefined): Record<string, unknown>;
|
|
12
|
+
export declare function reportPreservedForegroundWorktree(worktreePath: string, outcome: Awaited<ReturnType<typeof teardownIsolatedWorktree>>): void;
|
|
13
|
+
export declare function prepareForegroundRun(args: RunForegroundArgs): {
|
|
14
|
+
abortListener: () => void;
|
|
15
|
+
startedAt: number;
|
|
16
|
+
promotionSignal: Promise<QueuedNoteClaim | undefined>;
|
|
17
|
+
resolveJob: (info: PromotedSubagentInfo | null) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare function emitForegroundRejection(args: Pick<RunForegroundArgs, 'identity' | 'handle' | 'idPrefix' | 'parentSessionId' | 'depth'>, err: unknown, startedAt: number): void;
|
|
20
|
+
export declare function foregroundCompletionResult(args: Pick<RunForegroundArgs, 'handle' | 'identity' | 'parentSessionId' | 'depth' | 'model' | 'parentModel' | 'idPrefix'>, result: Awaited<RunPromise>, startedAt: number): ToolResult;
|
|
21
|
+
export declare function adoptForegroundRun(args: Pick<RunForegroundArgs, 'handle' | 'backgroundPrompt' | 'model' | 'parentSessionId' | 'budgetRelease'>, registry: NonNullable<RunForegroundArgs['registry']>, runPromise: RunPromise, isoTd: RunForegroundArgs['isolationTeardown']): import("../../background-registry.types.js").BackgroundJob;
|
|
22
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
|
|
2
2
|
import type { BackgroundAgentRegistry } from '../../background-registry.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { BackgroundDelivery } from './background-delivery.js';
|
|
4
4
|
import type { SubagentManager } from '../../subagent.js';
|
|
5
5
|
import type { TraceOrigin, TraceActor } from '../../session/session-identity.js';
|
|
6
6
|
import type { TraceSink } from '../../trace/index.js';
|