agent-afk 5.123.5 → 5.123.7

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.
@@ -1,6 +1,7 @@
1
1
  import type { ElicitationRequest, ElicitationResult } from './types/sdk-types.js';
2
2
  export type ElicitationHandler = (request: ElicitationRequest, options: {
3
3
  signal: AbortSignal;
4
+ sessionId?: string;
4
5
  }) => Promise<ElicitationResult>;
5
6
  declare class ElicitationRouter {
6
7
  private handler;
@@ -18,6 +18,7 @@ export interface WireExecutorsOptions {
18
18
  systemPrompt?: string;
19
19
  baseUrl?: string;
20
20
  openaiBaseUrl?: string;
21
+ xaiBaseUrl?: string;
21
22
  cwd?: string;
22
23
  nestedCwd?: string;
23
24
  traceWriter?: TraceSink;
@@ -27,7 +27,7 @@ export interface CreateChildProviderFactoryOptions {
27
27
  }
28
28
  export declare function createChildProviderFactory(opts?: CreateChildProviderFactoryOptions): (args: ChildProviderFactoryArgs) => ModelProvider;
29
29
  export declare function buildReadOnlyReconProvider(model: AgentModelInput | undefined, openaiBaseUrl?: string, allowedTools?: readonly string[]): ModelProvider;
30
- export declare function createChildSkillExecutorFactory(defaultModel: AgentModelInput, apiKey: string | undefined, childProviderFactory: (args: ChildProviderFactoryArgs) => ModelProvider, baseUrl?: string, traceWriter?: TraceSink, backgroundRegistry?: BackgroundAgentRegistry, cwd?: string, resolveApiKeyForModel?: (model: string) => string | undefined, surface?: Surface, defaultSubagentModel?: AgentModelInput, agentRegistry?: AgentRegistry, openaiBaseUrl?: string): (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string, inheritedReadScope?: ReadScopeInputs, skillDispatchName?: string) => SkillExecutor;
30
+ export declare function createChildSkillExecutorFactory(defaultModel: AgentModelInput, apiKey: string | undefined, childProviderFactory: (args: ChildProviderFactoryArgs) => ModelProvider, baseUrl?: string, traceWriter?: TraceSink, backgroundRegistry?: BackgroundAgentRegistry, cwd?: string, resolveApiKeyForModel?: (model: string) => string | undefined, surface?: Surface, defaultSubagentModel?: AgentModelInput, agentRegistry?: AgentRegistry, openaiBaseUrl?: string, xaiBaseUrl?: string): (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string, inheritedReadScope?: ReadScopeInputs, skillDispatchName?: string) => SkillExecutor;
31
31
  export type PhaseRole = 'read-only' | 'read-write';
32
32
  export declare function buildSkillRestrictedProvider(allowedTools: string[], model: AgentModelInput | undefined, readOnlyBash?: boolean, openaiBaseUrl?: string): ModelProvider;
33
33
  export declare function buildPhaseRestrictedProvider(_role: 'read-only', model: AgentModelInput | undefined): ModelProvider;
@@ -16,6 +16,7 @@ export interface SkillExecutorContext {
16
16
  resolveApiKeyForModel?: (model: string) => string | undefined;
17
17
  baseUrl?: string;
18
18
  openaiBaseUrl?: string;
19
+ xaiBaseUrl?: string;
19
20
  pluginConfigs?: SdkPluginConfig[];
20
21
  depth?: number;
21
22
  maxDepth?: number;
@@ -22,7 +22,7 @@ export interface BuildChildConfigArgs {
22
22
  currentCwd: string | undefined;
23
23
  childInheritedReadRoots?: string[];
24
24
  signal: AbortSignal;
25
- defaultConfig: Pick<AgentConfig, 'apiKey' | 'systemPrompt' | 'baseUrl' | 'openaiBaseUrl' | 'skillDispatchName'>;
25
+ defaultConfig: Pick<AgentConfig, 'apiKey' | 'systemPrompt' | 'baseUrl' | 'openaiBaseUrl' | 'xaiBaseUrl' | 'skillDispatchName'>;
26
26
  resolveApiKeyForModel?: (model: string) => string | undefined;
27
27
  defaultSubagentModel?: AgentModelInput;
28
28
  childProviderFactory?: (args: ChildProviderFactoryArgs) => ModelProvider;
@@ -18,7 +18,7 @@ export type { AgentExecutionMode };
18
18
  export interface SubagentExecutorContext {
19
19
  subagentManager: SubagentManager;
20
20
  parentSession: Pick<IAgentSession, 'sessionId' | 'getInputStreamRef' | 'abortSignal'> & Partial<Pick<IAgentSession, 'hookRegistry'>>;
21
- defaultConfig: Pick<AgentConfig, 'apiKey' | 'systemPrompt' | 'baseUrl' | 'openaiBaseUrl' | 'skillDispatchName'>;
21
+ defaultConfig: Pick<AgentConfig, 'apiKey' | 'systemPrompt' | 'baseUrl' | 'openaiBaseUrl' | 'xaiBaseUrl' | 'skillDispatchName'>;
22
22
  surface?: Surface;
23
23
  resolveApiKeyForModel?: (model: string) => string | undefined;
24
24
  defaultSubagentModel?: AgentModelInput;
@@ -0,0 +1,41 @@
1
+ import type { Writer } from '../slash/types.js';
2
+ import type { TerminalCompositor } from '../terminal-compositor.js';
3
+ import type { OverlayComposer } from './overlay-composer.js';
4
+ import type { ToolLane } from '../commands/interactive/tool-lane.js';
5
+ import type { CommitCoordinator } from './commit-coordinator.js';
6
+ import type { StreamingMarkdownRenderer } from '../markdown-stream.js';
7
+ export interface DisposeCtx {
8
+ out: Writer;
9
+ isTTY: boolean;
10
+ ownsCompositor: boolean;
11
+ compositorRef: {
12
+ current: TerminalCompositor | null;
13
+ };
14
+ overlayComposerRef: {
15
+ current: OverlayComposer | null;
16
+ };
17
+ toolLane: ToolLane;
18
+ streamingMarkdownRef: {
19
+ current: StreamingMarkdownRenderer | null;
20
+ };
21
+ subagentMarkdown: Map<string, StreamingMarkdownRenderer>;
22
+ lastProgressByTask: Map<string, ProgressEvent>;
23
+ coordinator: CommitCoordinator;
24
+ resizeUnsubRef: {
25
+ current: (() => void) | null;
26
+ };
27
+ pauseTickIntervalRef: {
28
+ current: ReturnType<typeof setInterval> | null;
29
+ };
30
+ softStoppingRef: {
31
+ current: boolean;
32
+ };
33
+ priorOnCancelRef: {
34
+ current: (() => void) | undefined;
35
+ };
36
+ borrowedCompositorRef: {
37
+ current: TerminalCompositor | null;
38
+ };
39
+ }
40
+ import type { ProgressEvent } from '../../agent/types.js';
41
+ export declare function disposeRenderer(ctx: DisposeCtx): Promise<void>;
@@ -0,0 +1,24 @@
1
+ import type { Writer } from '../slash/types.js';
2
+ import type { IHistoryRing } from '../input/types.js';
3
+ import type { AutocompleteState } from '../input/autocomplete-state.js';
4
+ import type { TerminalCompositor } from '../terminal-compositor.js';
5
+ export interface StreamRendererOptions {
6
+ out: Writer;
7
+ thinkingMode?: 'off' | 'summary' | 'live' | 'digest';
8
+ verbose?: boolean;
9
+ onCancel?: () => void;
10
+ onBackground?: () => void;
11
+ forceNonTty?: boolean;
12
+ activeSkillName?: string;
13
+ history?: IHistoryRing;
14
+ autocompleteState?: AutocompleteState;
15
+ promptText?: string;
16
+ scrollRegion?: {
17
+ withFullScrollRegion<T>(fn: () => T): T;
18
+ getExtraRows(): number;
19
+ };
20
+ captureMode?: boolean;
21
+ reducedMotion?: boolean;
22
+ compositor?: TerminalCompositor;
23
+ onStageChange?: (stage: import('../commands/interactive/loop-stage.js').LoopStage, signals?: import('../commands/interactive/loop-stage.js').StageSignals) => void;
24
+ }
@@ -0,0 +1,37 @@
1
+ import type { OutputEvent, SubagentProgressMeta, ProgressEvent } from '../../agent/types.js';
2
+ import type { Writer } from '../slash/types.js';
3
+ import type { TerminalCompositor } from '../terminal-compositor.js';
4
+ import type { OverlayComposer } from './overlay-composer.js';
5
+ import type { ToolLane } from '../commands/interactive/tool-lane.js';
6
+ import type { ThinkingLane } from '../commands/interactive/thinking-lane.js';
7
+ import type { StreamingMarkdownRenderer } from '../markdown-stream.js';
8
+ import type { StageTrackerState } from '../commands/interactive/loop-stage.js';
9
+ import type { CommitCoordinator } from './commit-coordinator.js';
10
+ import type { ChildActivityTracker } from './child-activity-select.js';
11
+ import type { InFlightToolTracker } from '../input/work-derived-verb.js';
12
+ import type { OrchestratorCtx } from './stream-renderer-orchestrator.js';
13
+ import type { LoopStage, StageSignals } from '../commands/interactive/loop-stage.js';
14
+ import { type SourceState } from './stream-renderer-source.js';
15
+ export interface ProcessCtx {
16
+ out: Writer;
17
+ isTTY: boolean;
18
+ compositor: TerminalCompositor | null;
19
+ overlayComposer: OverlayComposer | null;
20
+ toolLane: ToolLane;
21
+ thinkingLane: ThinkingLane;
22
+ streamingMarkdownRef: {
23
+ current: StreamingMarkdownRenderer | null;
24
+ };
25
+ stageTracker: StageTrackerState;
26
+ coordinator: CommitCoordinator;
27
+ childActivity: ChildActivityTracker;
28
+ inFlightTools: InFlightToolTracker;
29
+ sources: Map<string, SourceState>;
30
+ subagentMarkdown: Map<string, StreamingMarkdownRenderer>;
31
+ lastProgressByTask: Map<string, ProgressEvent>;
32
+ thinkingMode: 'off' | 'summary' | 'live' | 'digest';
33
+ activeSkillName: string | undefined;
34
+ onStageChange: ((stage: LoopStage, signals?: StageSignals) => void) | undefined;
35
+ buildOrchestratorCtx: () => OrchestratorCtx;
36
+ }
37
+ export declare function processEvent(ctx: ProcessCtx, event: OutputEvent, meta?: SubagentProgressMeta): void;
@@ -1,29 +1,8 @@
1
1
  import type { OutputEvent, SubagentProgressMeta } from '../../agent/types.js';
2
2
  import type { Message } from '../../agent/types/message-types.js';
3
- import type { Writer } from '../slash/types.js';
4
3
  import { TerminalCompositor } from '../terminal-compositor.js';
5
- import type { IHistoryRing } from '../input/types.js';
6
- import type { AutocompleteState } from '../input/autocomplete-state.js';
7
- export interface StreamRendererOptions {
8
- out: Writer;
9
- thinkingMode?: 'off' | 'summary' | 'live' | 'digest';
10
- verbose?: boolean;
11
- onCancel?: () => void;
12
- onBackground?: () => void;
13
- forceNonTty?: boolean;
14
- activeSkillName?: string;
15
- history?: IHistoryRing;
16
- autocompleteState?: AutocompleteState;
17
- promptText?: string;
18
- scrollRegion?: {
19
- withFullScrollRegion<T>(fn: () => T): T;
20
- getExtraRows(): number;
21
- };
22
- captureMode?: boolean;
23
- reducedMotion?: boolean;
24
- compositor?: TerminalCompositor;
25
- onStageChange?: (stage: import('../commands/interactive/loop-stage.js').LoopStage, signals?: import('../commands/interactive/loop-stage.js').StageSignals) => void;
26
- }
4
+ export type { StreamRendererOptions } from './stream-renderer-options.js';
5
+ import type { StreamRendererOptions } from './stream-renderer-options.js';
27
6
  export declare class StreamRenderer {
28
7
  private readonly out;
29
8
  private readonly thinkingMode;