agent-afk 5.313.7 → 5.313.9

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.
@@ -5,7 +5,7 @@ import type { AgentModelInput } from '../../types.js';
5
5
  import type { AgentConfig } from '../../types/config-types.js';
6
6
  import type { MessageJournal } from '../../journal/types.js';
7
7
  import type { JournalParent } from '../../subagent/fork-types.js';
8
- import { createStubParentSession, type ChildProviderFactoryArgs } from '../nesting.js';
8
+ import { createStubParentSession } from '../nesting.js';
9
9
  import type { RegisteredAgent } from '../../agents/index.js';
10
10
  import type { AgentRegistry } from '../../agents/index.js';
11
11
  import type { SkillExecutor } from '../skill-executor.js';
@@ -13,6 +13,7 @@ import type { Surface } from '../../awareness/types.js';
13
13
  import type { TraceSink } from '../../trace/index.js';
14
14
  import type { SubagentExecutor, SubagentExecutorContext } from '../subagent-executor.js';
15
15
  import type { AgentInput } from './input-parse.js';
16
+ import type { ChildProviderFactoryArgs } from '../nesting.js';
16
17
  export type ChildParentSession = ReturnType<typeof createStubParentSession> & {
17
18
  sessionId: string | undefined;
18
19
  messageJournal?: MessageJournal;
@@ -0,0 +1,48 @@
1
+ import { resolveAgentToolAccess } from '../../agents/index.js';
2
+ import { SubagentManager } from '../../subagent.js';
3
+ import type { RegisteredAgent, AgentRegistry } from '../../agents/index.js';
4
+ import type { AgentModelInput } from '../../types.js';
5
+ import type { AgentConfig } from '../../types/config-types.js';
6
+ import type { SubagentExecutor, SubagentExecutorContext } from '../subagent-executor.js';
7
+ import type { AgentInput } from './input-parse.js';
8
+ import type { BuildChildConfigArgs, ChildParentSession } from './child-config.js';
9
+ export interface ResolvedChildModel {
10
+ childModel: string;
11
+ childIsOpenAI: boolean;
12
+ }
13
+ export declare function resolveChildModelAndProvider(parsed: Pick<AgentInput, 'model'>, namedAgent: RegisteredAgent | undefined, defaultSubagentModel: AgentModelInput, parentModel: AgentModelInput | undefined): ResolvedChildModel;
14
+ export interface ResolvedChildToolAccess {
15
+ resolvedAccess: ReturnType<typeof resolveAgentToolAccess> | undefined;
16
+ effectiveAllowedTools: string[] | undefined;
17
+ effectiveReadOnlyBash: boolean;
18
+ childWriteCapable: boolean;
19
+ childSideEffectFree: boolean;
20
+ }
21
+ export declare function resolveChildToolAccess(namedAgent: RegisteredAgent | undefined, cageAllowedTools: string[] | undefined, cageReadOnlyBash: boolean | undefined, agentRegistry: AgentRegistry | undefined): ResolvedChildToolAccess;
22
+ export interface ResolvedChildBudgets {
23
+ effectiveMaxTurns: number;
24
+ effectiveMaxToolUseIterations: number;
25
+ }
26
+ export declare function resolveChildBudgets(parsed: Pick<AgentInput, 'max_turns' | 'max_turns_explicit' | 'max_tool_use_iterations' | 'max_tool_use_iterations_explicit'>, namedAgent: RegisteredAgent | undefined): ResolvedChildBudgets;
27
+ export declare function resolveChildCredential(childModel: string, resolveApiKeyForModel: ((model: string) => string | undefined) | undefined, parentApiKey: string | undefined): string | undefined;
28
+ export declare function buildBaseChildConfig(parsed: Pick<AgentInput, 'cwd' | 'writeRoots' | 'readRoots'>, namedAgent: RegisteredAgent | undefined, defaultConfig: SubagentExecutorContext['defaultConfig'], childModel: string, childIsOpenAI: boolean, resolvedChildApiKey: string | undefined, effectiveMaxTurns: number, effectiveMaxToolUseIterations: number, depth: number, maxDepth: number): AgentConfig;
29
+ export interface WireChildNestingResult {
30
+ childParentSession: ChildParentSession | undefined;
31
+ childManager: SubagentManager | undefined;
32
+ }
33
+ interface WireChildNestingArgs {
34
+ args: BuildChildConfigArgs;
35
+ childConfig: AgentConfig;
36
+ effectiveAllowedTools: string[] | undefined;
37
+ effectiveReadOnlyBash: boolean;
38
+ resolvedAccess: ReturnType<typeof resolveAgentToolAccess> | undefined;
39
+ depth: number;
40
+ maxDepth: number;
41
+ signal: AbortSignal;
42
+ currentCwd: string | undefined;
43
+ createChildExecutor: (ctx: SubagentExecutorContext) => SubagentExecutor;
44
+ }
45
+ export declare function wireChildNesting(w: WireChildNestingArgs): WireChildNestingResult;
46
+ export declare function buildNestedChildManager(args: Pick<BuildChildConfigArgs, 'childInheritedReadRoots' | 'traceWriter' | 'surface' | 'workspaceStore' | 'parentRootSessionId' | 'hookRegistry'>, signal: AbortSignal, currentCwd: string | undefined): SubagentManager;
47
+ export declare function nestedExecutorInherits(args: Pick<BuildChildConfigArgs, 'traceWriter' | 'workspaceStore' | 'hookRegistry'>): Pick<SubagentExecutorContext, 'traceWriter' | 'workspaceStore' | 'hookRegistry'>;
48
+ export {};
@@ -0,0 +1,65 @@
1
+ import type { AgentSession } from '../../agent/session.js';
2
+ import type { AgentModelInput } from '../../agent/types.js';
3
+ import { parseThinking, parseEffort } from '../shared-helpers.js';
4
+ import { setupWorktree } from './interactive/worktree.js';
5
+ import { resolveResumeTarget, resumeConfigFor } from '../resume-session.js';
6
+ import { createSessionStats } from '../slash/session-stats.js';
7
+ import { type PostTarget } from '../slash/_lib/review-post.js';
8
+ import type { MemoryStore } from '../../agent/memory/index.js';
9
+ import type { StateStore } from '../../agent/state/state-store.js';
10
+ import type { WorkspaceStore } from '../../agent/workspace/workspace-store.js';
11
+ import type { McpManager } from '../../agent/mcp/index.js';
12
+ export interface ChatActionOptions {
13
+ model: AgentModelInput;
14
+ stream: boolean;
15
+ format: string;
16
+ maxTurns: string;
17
+ thinking?: string;
18
+ effort?: string;
19
+ theme?: 'dark' | 'light' | 'umber' | 'auto';
20
+ maxBudgetUsd?: string;
21
+ taskBudget?: string;
22
+ maxOutputTokens?: string;
23
+ provider?: string;
24
+ dumpPrompt?: string | boolean;
25
+ worktree?: string | true;
26
+ worktreeBase?: string;
27
+ mcpConfig?: string;
28
+ resume?: string;
29
+ continue?: boolean;
30
+ sessionId?: string;
31
+ post?: string;
32
+ postPr?: string;
33
+ dangerouslySkipPermissions?: boolean;
34
+ }
35
+ export declare function resolvePostTargets(post: string | undefined): PostTarget[];
36
+ export declare function resolveModelOptions(options: Pick<ChatActionOptions, 'thinking' | 'effort' | 'maxBudgetUsd' | 'taskBudget' | 'maxOutputTokens'>): {
37
+ thinking: ReturnType<typeof parseThinking>;
38
+ effort: ReturnType<typeof parseEffort>;
39
+ maxBudgetUsd: number | undefined;
40
+ taskBudget: number | undefined;
41
+ maxOutputTokens: number | undefined;
42
+ maxToolUseIterations: number | undefined;
43
+ };
44
+ export declare function resolveResumeConfig(options: Pick<ChatActionOptions, 'resume' | 'continue' | 'sessionId' | 'model'>, resumeTarget: ReturnType<typeof resolveResumeTarget>, stats: ReturnType<typeof createSessionStats>): {
45
+ resumeConfig: ReturnType<typeof resumeConfigFor>;
46
+ shouldPersist: boolean;
47
+ persistId: string | undefined;
48
+ };
49
+ export declare function buildMaybePublish(postTargets: PostTarget[], postPr: string | undefined): (reviewText: string, errored: boolean) => Promise<void>;
50
+ export declare function runSessionTeardown(params: {
51
+ shouldPersist: boolean;
52
+ stats: ReturnType<typeof createSessionStats>;
53
+ persistId: string | undefined;
54
+ encounteredError: boolean;
55
+ session: AgentSession | null;
56
+ receiptTracePath: string | undefined;
57
+ mcpManagerRef: McpManager | undefined;
58
+ teardownStores: {
59
+ sharedMemoryStore: MemoryStore;
60
+ sharedStateStore: StateStore;
61
+ workspaceStore: WorkspaceStore | undefined;
62
+ } | undefined;
63
+ worktreeHandle: Awaited<ReturnType<typeof setupWorktree>> | undefined;
64
+ }): Promise<void>;
65
+ export declare function runChatAction(rawMessage: string | undefined, options: ChatActionOptions): Promise<void>;
@@ -0,0 +1,6 @@
1
+ export declare function validateSessionFlags(options: {
2
+ resume?: string;
3
+ continue?: boolean;
4
+ sessionId?: string;
5
+ }): boolean;
6
+ export declare function resolveMessage(rawMessage: string | undefined): Promise<string | null>;