agent-afk 5.87.1 → 5.88.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.
@@ -0,0 +1,6 @@
1
+ import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
2
+ export interface ImageBlockAttachment {
3
+ readonly mediaType: 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp';
4
+ readonly bytes: Buffer;
5
+ }
6
+ export declare function appendImageBlocks(blocks: ContentBlockParam[], attachments: readonly ImageBlockAttachment[] | undefined): void;
@@ -1,4 +1,5 @@
1
1
  import type { ZodType } from 'zod';
2
+ import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
2
3
  import { AbortGraph } from '../abort-graph.js';
3
4
  import type { HookRegistry } from '../hooks.js';
4
5
  import type { IAgentSession, Message } from '../types.js';
@@ -9,8 +10,8 @@ export interface SubagentHandle<T = unknown> {
9
10
  readonly id: string;
10
11
  readonly status: SubagentStatus;
11
12
  readonly session: IAgentSession;
12
- run(prompt: string): Promise<Message>;
13
- runToResult(prompt: string): Promise<SubagentResult<T>>;
13
+ run(prompt: string | ContentBlockParam[]): Promise<Message>;
14
+ runToResult(prompt: string | ContentBlockParam[]): Promise<SubagentResult<T>>;
14
15
  runInBackground(prompt: string, onResult?: (result: SubagentResult<T>) => void, onProgress?: (event: OutputEvent) => void): void;
15
16
  cancel(): Promise<void>;
16
17
  teardown(options?: {
@@ -48,9 +49,9 @@ export declare class SubagentHandleImpl<T> implements SubagentHandle<T> {
48
49
  private lastStopReason;
49
50
  constructor(id: string, session: IAgentSession, controller: AbortController, abortGraph: AbortGraph, outputSchema: ZodType<T> | undefined, timeoutMs: number, hookRegistry: HookRegistry | undefined, onTerminal: () => void, parentInputStreamRef?: ReturnType<IAgentSession["getInputStreamRef"]> | undefined, parentAbortSignal?: AbortSignal | undefined, agentType?: string | undefined, progressSink?: SubagentProgressSink, parentId?: string, traceWriter?: TraceWriter | undefined, onSubagentSucceeded?: ((usage: SubagentTrace["usage"], costUsd: number | undefined) => void) | undefined, idleTimeoutMs?: number);
50
51
  get status(): SubagentStatus;
51
- run(prompt: string, sinkOverride?: SubagentProgressSink): Promise<Message>;
52
+ run(prompt: string | ContentBlockParam[], sinkOverride?: SubagentProgressSink): Promise<Message>;
52
53
  private streamToFinalMessage;
53
- runToResult(prompt: string, sinkOverride?: SubagentProgressSink): Promise<SubagentResult<T>>;
54
+ runToResult(prompt: string | ContentBlockParam[], sinkOverride?: SubagentProgressSink): Promise<SubagentResult<T>>;
54
55
  runInBackground(prompt: string, onResult?: (result: SubagentResult<T>) => void, onProgress?: (event: OutputEvent) => void): void;
55
56
  cancel(): Promise<void>;
56
57
  teardown(options?: {
@@ -0,0 +1,9 @@
1
+ import type { ImageBlockAttachment } from '../../content/image-blocks.js';
2
+ export declare const MAX_SUBAGENT_ATTACHMENT_COUNT = 8;
3
+ export declare const MAX_SUBAGENT_ATTACHMENT_BYTES: number;
4
+ export interface ResolveSubagentAttachmentsArgs {
5
+ paths: readonly string[];
6
+ resolveBase: string | undefined;
7
+ readRoots: string[] | undefined;
8
+ }
9
+ export declare function resolveSubagentAttachments(args: ResolveSubagentAttachmentsArgs): Promise<ImageBlockAttachment[]>;
@@ -1,3 +1,4 @@
1
+ import type { ContentBlockParam } from '@anthropic-ai/sdk/resources';
1
2
  import type { BackgroundAgentRegistry } from '../../background-registry.js';
2
3
  import type { SubagentManager } from '../../subagent.js';
3
4
  import type { TraceOrigin, TraceActor } from '../../session/session-identity.js';
@@ -11,7 +12,8 @@ export interface PromotionTrigger {
11
12
  export interface RunForegroundArgs {
12
13
  handle: ForkedHandle;
13
14
  signal: AbortSignal;
14
- prompt: string;
15
+ prompt: string | ContentBlockParam[];
16
+ backgroundPrompt: string;
15
17
  idPrefix: string | undefined;
16
18
  model: string | undefined;
17
19
  parentModel?: string;
@@ -1,6 +1,7 @@
1
1
  export type AgentExecutionMode = 'foreground' | 'background';
2
2
  export interface AgentInput {
3
3
  prompt: string;
4
+ attachments?: string[];
4
5
  model?: string;
5
6
  max_turns?: number;
6
7
  max_turns_explicit: boolean;