@standardagents/builder 0.19.3 → 0.20.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/runtime.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { e as ThreadEnv, h as ThreadMetadata, M as Message, l as FileRecord, F as FlowState, n as FileStats, G as GrepResult, m as AttachmentRef, r as MessageContent, E as Env, g as ThreadInstance } from './index-Dx1js-H1.js';
2
- export { A as Agent, f as BuilderThreadEndpointHandler, B as Controller, a as ControllerContext, j as FlowResult, p as ImageContentPart, I as ImageMetadata, L as LLMResponse, q as MultimodalContent, R as RequestContext, S as StorageBackend, k as TelemetryEvent, o as TextContentPart, b as ThreadEndpointContext, T as ToolCall, i as ToolResult, c as createThreadEndpointHandler, d as defineController } from './index-Dx1js-H1.js';
1
+ import { e as ThreadEnv, h as ThreadMetadata, M as Message, l as FileRecord, F as FlowState, n as FileStats, G as GrepResult, m as AttachmentRef, r as MessageContent, E as Env, g as ThreadInstance } from './index-Bug9ATQX.js';
2
+ export { A as Agent, f as BuilderThreadEndpointHandler, B as Controller, a as ControllerContext, j as FlowResult, p as ImageContentPart, I as ImageMetadata, L as LLMResponse, q as MultimodalContent, R as RequestContext, S as StorageBackend, k as TelemetryEvent, o as TextContentPart, b as ThreadEndpointContext, T as ToolCall, i as ToolResult, c as createThreadEndpointHandler, d as defineController } from './index-Bug9ATQX.js';
3
3
  import { CodeExecutionOptions, CodeExecutionResult, SubagentRegistryEntry, InjectMessageInput, QueueMessageInput, ModelDefinition as ModelDefinition$1, ToolArgs, PromptTextPart, PromptEnvPart, VariableDefinition, SubpromptConfig as SubpromptConfig$1, PromptToolConfig as PromptToolConfig$1, SubagentToolConfig as SubagentToolConfig$1, ReasoningConfig, SideConfig as SideConfig$1, LLMProviderInterface, ContentPart, TextPart, ImagePart, FilePart, NamespaceContext, DefinitionLoader } from '@standardagents/spec';
4
4
  export { AgentType, DefinitionLoader, GlobalNamespaceContext, HookSignatures, ImageContent, ModelCapabilities, ModelProvider, NamespaceContext, PackageSignature, PackedExports, PackedMeta, PackedMetadata, PackedNamespaceContext, PromptInput, PromptTextPart, ProviderAssistantMessage, ProviderError, ProviderErrorCode, ProviderFactory, ProviderFactoryConfig, ProviderFinishReason, ProviderGeneratedImage, ProviderMessage, ProviderMessageContent, ModelCapabilities as ProviderModelCapabilities, ProviderReasoningDetail, ProviderRequest, ProviderResponse, ProviderStreamChunk, ProviderSystemMessage, ProviderTool, ProviderToolCallPart, ProviderToolMessage, ProviderToolResultContent, ProviderUsage, ProviderUserMessage, ReasoningConfig, StructuredPrompt, TextContent, Tool, ToolArgs, ToolArgsNode, ToolArgsRawShape, ToolContent, belongsToPackage, defineAgent, defineHook, defineModel, definePrompt, defineTool, isPacked, isVisibleInNamespace, mapReasoningLevel } from '@standardagents/spec';
5
5
  import { DurableObject, WorkerEntrypoint } from 'cloudflare:workers';
@@ -362,6 +362,17 @@ declare class DurableThread<Env extends ThreadEnv = ThreadEnv> extends DurableOb
362
362
  upsertChildRegistry(_threadId: string, entry: SubagentRegistryEntry): Promise<void>;
363
363
  updateChildRegistryStatus(_threadId: string, reference: string, status: string): Promise<void>;
364
364
  removeChildRegistry(_threadId: string, reference: string): Promise<void>;
365
+ /**
366
+ * Persist the invocation arguments supplied when this subagent thread was
367
+ * created. These are hydrated into prompt-interpolation context on every
368
+ * activation of either side, so they survive for the life of the thread.
369
+ */
370
+ setSubagentArguments(_threadId: string, args: Record<string, unknown>): Promise<void>;
371
+ /**
372
+ * Read the persisted invocation arguments for this subagent thread.
373
+ * Returns an empty object when none were stored.
374
+ */
375
+ getSubagentArguments(_threadId: string): Promise<Record<string, unknown>>;
365
376
  private asOptionalString;
366
377
  private asOptionalBoolean;
367
378
  private getThreadNameFromTags;
@@ -915,6 +926,8 @@ declare class DurableThread<Env extends ThreadEnv = ThreadEnv> extends DurableOb
915
926
  * the alarm chain. All errors are caught and logged.
916
927
  */
917
928
  alarm(): Promise<void>;
929
+ private normalizePlainRecord;
930
+ private buildExecutionArguments;
918
931
  /**
919
932
  * Internal method: Execute a flow (called by alarm queue)
920
933
  * This is the actual execution logic, separate from the public execute() RPC method
@@ -1279,10 +1292,13 @@ interface PendingSubagentEnvRequestPayload {
1279
1292
  parent_communication: 'implicit' | 'explicit';
1280
1293
  initial_message_content: string;
1281
1294
  initial_message_attachments: PendingSubagentAttachmentRef[];
1295
+ initial_arguments?: Record<string, unknown>;
1282
1296
  initial_agent_name?: string | null;
1283
1297
  agent_title?: string | null;
1284
1298
  agent_description?: string | null;
1285
1299
  spawn_group_id?: string | null;
1300
+ /** Invocation arguments persisted for the life of the child thread. */
1301
+ arguments?: Record<string, unknown>;
1286
1302
  }
1287
1303
  interface PendingSubagentEnvRequest {
1288
1304
  request_id: string;
@@ -1370,6 +1386,10 @@ declare class DurableAgentBuilder<Env extends AgentBuilderEnv = AgentBuilderEnv>
1370
1386
  private eventSockets;
1371
1387
  constructor(ctx: DurableObjectState, env: Env);
1372
1388
  private normalizeEnvRecord;
1389
+ private normalizePlainObject;
1390
+ private hasInitialArguments;
1391
+ private buildSubagentThreadProperties;
1392
+ private buildSubagentInitialArgumentsMessage;
1373
1393
  private normalizeEnvTypeRecord;
1374
1394
  private extractEnvTypeRecord;
1375
1395
  private withEnvTypeRecord;