@agentfield/sdk 0.1.92-rc.1 → 0.1.92-rc.10

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/index.d.ts CHANGED
@@ -273,14 +273,6 @@ interface ExecutionStatusUpdate {
273
273
  progress?: number;
274
274
  statusReason?: string;
275
275
  }
276
- interface RestartExecutionOptions {
277
- scope?: 'workflow' | 'execution';
278
- reuse?: 'succeeded-before' | 'all-succeeded' | 'none';
279
- fork?: boolean;
280
- reason?: string;
281
- input?: Record<string, unknown>;
282
- context?: Record<string, unknown>;
283
- }
284
276
  declare class AgentFieldClient {
285
277
  private readonly http;
286
278
  private readonly config;
@@ -302,11 +294,7 @@ declare class AgentFieldClient {
302
294
  targetDid?: string;
303
295
  agentNodeDid?: string;
304
296
  agentNodeId?: string;
305
- replaySourceRunId?: string;
306
- replayBeforeExecutionId?: string;
307
- replayMode?: string;
308
297
  }): Promise<T>;
309
- restartExecution(executionId: string, options?: RestartExecutionOptions): Promise<any>;
310
298
  publishWorkflowEvent(event: {
311
299
  executionId: string;
312
300
  runId: string;
@@ -381,9 +369,6 @@ interface ExecutionMetadata {
381
369
  callerDid?: string;
382
370
  targetDid?: string;
383
371
  agentNodeDid?: string;
384
- replaySourceRunId?: string;
385
- replayBeforeExecutionId?: string;
386
- replayMode?: string;
387
372
  }
388
373
  declare class ExecutionContext {
389
374
  readonly input: any;
@@ -1100,6 +1085,45 @@ declare class HarnessRunner {
1100
1085
  private sleep;
1101
1086
  }
1102
1087
 
1088
+ interface SessionDefinition {
1089
+ name: string;
1090
+ provider: string;
1091
+ transport: string;
1092
+ model?: string;
1093
+ modalities: string[];
1094
+ voice?: string;
1095
+ tools: string[];
1096
+ tags: string[];
1097
+ proposed_tags: string[];
1098
+ approved_tags: string[];
1099
+ metadata: Record<string, unknown>;
1100
+ }
1101
+ interface SessionOptions {
1102
+ provider: string;
1103
+ transport: string;
1104
+ model?: string;
1105
+ modalities?: string[];
1106
+ voice?: string;
1107
+ tools?: string[];
1108
+ tags?: string[];
1109
+ metadata?: Record<string, unknown>;
1110
+ }
1111
+ interface SessionTurn {
1112
+ text?: string;
1113
+ transcript?: string;
1114
+ audio?: unknown;
1115
+ audioFormat?: string;
1116
+ channel?: string;
1117
+ metadata?: Record<string, unknown>;
1118
+ }
1119
+ declare class RealtimeSession {
1120
+ readonly sessionId: string;
1121
+ readonly definition: SessionDefinition;
1122
+ constructor(sessionId: string, definition: SessionDefinition);
1123
+ input(): Promise<SessionTurn>;
1124
+ }
1125
+ declare function buildSessionDefinition(name: string, options: SessionOptions): SessionDefinition;
1126
+
1103
1127
  declare class Agent {
1104
1128
  readonly config: AgentConfig;
1105
1129
  readonly app: express.Express;
@@ -1116,6 +1140,7 @@ declare class Agent {
1116
1140
  private readonly memoryWatchers;
1117
1141
  private readonly localVerifier?;
1118
1142
  private readonly realtimeValidationFunctions;
1143
+ private readonly sessions;
1119
1144
  private readonly processLogRing;
1120
1145
  private readonly executionLogger;
1121
1146
  /** Tracks an AbortController per in-flight execution_id so the
@@ -1127,6 +1152,8 @@ declare class Agent {
1127
1152
  reasoner<TInput = any, TOutput = any>(name: string, handler: ReasonerHandler<TInput, TOutput>, options?: ReasonerOptions): this;
1128
1153
  skill<TInput = any, TOutput = any>(name: string, handler: SkillHandler<TInput, TOutput>, options?: SkillOptions): this;
1129
1154
  includeRouter(router: AgentRouter): void;
1155
+ session(name: string, options: SessionOptions, handler: (session: RealtimeSession) => Promise<unknown> | unknown): this;
1156
+ sessionDefinitions(): SessionDefinition[];
1130
1157
  handler(adapter?: (event: any, context?: any) => ServerlessEvent): AgentHandler;
1131
1158
  watchMemory(pattern: string | string[], handler: MemoryWatchHandler, options?: {
1132
1159
  scope?: string;
@@ -1944,4 +1971,23 @@ declare class ApprovalClient {
1944
1971
  waitForApproval(executionId: string, opts?: WaitForApprovalOptions): Promise<ApprovalStatusResponse>;
1945
1972
  }
1946
1973
 
1947
- export { ACTIVE_STATUSES, AIClient, type AIConfig, type AIEmbeddingOptions, type AIRequestOptions, type AIStream, type AIToolRequestOptions, Agent, type AgentCapability, type AgentConfig, type AgentHandler, AgentRouter, type AgentRouterOptions, type AgentState, ApprovalClient, type ApprovalRequestResponse, type ApprovalStatusResponse, Audio, type AudioOutput, type AudioRequest, type AuditTrailExport, type AuditTrailFilters, type Awaitable, CANONICAL_STATUSES, type CompactCapability, type CompactDiscoveryResponse, DIDAuthenticator, type DIDIdentity, type DIDIdentityPackage, type DIDRegistrationRequest, type DIDRegistrationResponse, type DeploymentType, DidClient, DidInterface, DidManager, type DiscoveryFormat, type DiscoveryOptions, type DiscoveryPagination, type DiscoveryResponse, type DiscoveryResult, ExecutionContext, type ExecutionCredential, type ExecutionLogAttributes, type ExecutionLogBatchPayload, type ExecutionLogContext, type ExecutionLogEmitOptions, type ExecutionLogEntry, type ExecutionLogLevel, type ExecutionLogTransport, type ExecutionLogTransportPayload, type ExecutionLogWireEntry, ExecutionLogger, type ExecutionLoggerOptions, type ExecutionMetadata, ExecutionStatus, type ExecutionStatusValue, File, type FileOutput, type GenerateCredentialOptions, type GenerateCredentialParams, HEADER_CALLER_DID, HEADER_DID_NONCE, HEADER_DID_SIGNATURE, HEADER_DID_TIMESTAMP, type HarnessConfig, type HarnessOptions, type HarnessProvider, type HarnessResult, HarnessRunner, type HealthStatus, Image, type ImageOutput, type ImageRequest, type MediaProvider, MediaProviderError, type MediaResponse, MediaRouter, type MemoryChangeEvent, MemoryClient, MemoryClientBase, type MemoryConfig, MemoryEventClient, type MemoryEventHandler, type MemoryEventHistoryOptions, MemoryInterface, type MemoryRequestMetadata, type MemoryRequestOptions, type MemoryScope, type MemoryWatchHandler, type Metrics, type MultimodalContent, MultimodalResponse, OpenRouterMediaProvider, type OpenRouterMediaProviderOptions, RateLimitError, type RateLimiterOptions, type RawExecutionContext, type RawResult, type ReasonerCapability, ReasonerContext, type ReasonerDefinition, type ReasonerHandler, type ReasonerOptions, type RequestApprovalPayload, SUPPORTED_PROVIDERS, type ServerlessAdapter, type ServerlessEvent, type ServerlessResponse, type SkillCapability, SkillContext, type SkillDefinition, type SkillHandler, type SkillOptions, StatelessRateLimiter, TERMINAL_STATUSES, Text, type ToolCallConfig, type ToolCallRecord, type ToolCallTrace, type ToolsOption, type VectorSearchOptions, type VectorSearchResult, Video, type VideoFrameImage, type VideoInputReference, type VideoRequest, type WaitForApprovalOptions, type WorkflowCredential, type WorkflowMetadata, type WorkflowProgressOptions, WorkflowReporter, type ZodSchema, audioFromBase64, audioFromBuffer, audioFromFile, audioFromUrl, buildProvider, buildToolConfig, capabilitiesToTools, capabilityToMetadataTool, capabilityToTool, createExecutionLogger, createHarnessResult, createMetrics, createMultimodalResponse, createRawResult, executeToolCallLoop, fileFromBase64, fileFromBuffer, fileFromPath, fileFromUrl, getCurrentContext, getCurrentSkillContext, imageFromBase64, imageFromBuffer, imageFromFile, imageFromUrl, isActive, isExecutionLogBatchPayload, isTerminal, normalizeExecutionLogEntry, normalizeStatus, serializeExecutionLogEntry, text, videoFromBase64, videoFromBuffer, videoFromFile, videoFromUrl };
1974
+ declare const SUPPORTED_SESSION_TRANSPORTS: {
1975
+ readonly openai: readonly ["webrtc", "websocket"];
1976
+ readonly openrouter: readonly ["audio_turns"];
1977
+ };
1978
+ type SessionProvider = keyof typeof SUPPORTED_SESSION_TRANSPORTS;
1979
+ type SessionTransport = (typeof SUPPORTED_SESSION_TRANSPORTS)[SessionProvider][number];
1980
+ interface SessionTransportCapability {
1981
+ provider: SessionProvider;
1982
+ transport: SessionTransport;
1983
+ }
1984
+ declare class SessionTransportError extends Error {
1985
+ readonly provider: string;
1986
+ readonly transport: string;
1987
+ readonly supported: readonly string[];
1988
+ constructor(provider: string, transport: string, supported: readonly string[]);
1989
+ }
1990
+ declare function normalizeSessionTransportValue(value: string): string;
1991
+ declare function validateSessionTransport(provider: string, transport: string): SessionTransportCapability;
1992
+
1993
+ export { ACTIVE_STATUSES, AIClient, type AIConfig, type AIEmbeddingOptions, type AIRequestOptions, type AIStream, type AIToolRequestOptions, Agent, type AgentCapability, type AgentConfig, type AgentHandler, AgentRouter, type AgentRouterOptions, type AgentState, ApprovalClient, type ApprovalRequestResponse, type ApprovalStatusResponse, Audio, type AudioOutput, type AudioRequest, type AuditTrailExport, type AuditTrailFilters, type Awaitable, CANONICAL_STATUSES, type CompactCapability, type CompactDiscoveryResponse, DIDAuthenticator, type DIDIdentity, type DIDIdentityPackage, type DIDRegistrationRequest, type DIDRegistrationResponse, type DeploymentType, DidClient, DidInterface, DidManager, type DiscoveryFormat, type DiscoveryOptions, type DiscoveryPagination, type DiscoveryResponse, type DiscoveryResult, ExecutionContext, type ExecutionCredential, type ExecutionLogAttributes, type ExecutionLogBatchPayload, type ExecutionLogContext, type ExecutionLogEmitOptions, type ExecutionLogEntry, type ExecutionLogLevel, type ExecutionLogTransport, type ExecutionLogTransportPayload, type ExecutionLogWireEntry, ExecutionLogger, type ExecutionLoggerOptions, type ExecutionMetadata, ExecutionStatus, type ExecutionStatusValue, File, type FileOutput, type GenerateCredentialOptions, type GenerateCredentialParams, HEADER_CALLER_DID, HEADER_DID_NONCE, HEADER_DID_SIGNATURE, HEADER_DID_TIMESTAMP, type HarnessConfig, type HarnessOptions, type HarnessProvider, type HarnessResult, HarnessRunner, type HealthStatus, Image, type ImageOutput, type ImageRequest, type MediaProvider, MediaProviderError, type MediaResponse, MediaRouter, type MemoryChangeEvent, MemoryClient, MemoryClientBase, type MemoryConfig, MemoryEventClient, type MemoryEventHandler, type MemoryEventHistoryOptions, MemoryInterface, type MemoryRequestMetadata, type MemoryRequestOptions, type MemoryScope, type MemoryWatchHandler, type Metrics, type MultimodalContent, MultimodalResponse, OpenRouterMediaProvider, type OpenRouterMediaProviderOptions, RateLimitError, type RateLimiterOptions, type RawExecutionContext, type RawResult, RealtimeSession, type ReasonerCapability, ReasonerContext, type ReasonerDefinition, type ReasonerHandler, type ReasonerOptions, type RequestApprovalPayload, SUPPORTED_PROVIDERS, SUPPORTED_SESSION_TRANSPORTS, type ServerlessAdapter, type ServerlessEvent, type ServerlessResponse, type SessionDefinition, type SessionOptions, type SessionProvider, type SessionTransport, type SessionTransportCapability, SessionTransportError, type SessionTurn, type SkillCapability, SkillContext, type SkillDefinition, type SkillHandler, type SkillOptions, StatelessRateLimiter, TERMINAL_STATUSES, Text, type ToolCallConfig, type ToolCallRecord, type ToolCallTrace, type ToolsOption, type VectorSearchOptions, type VectorSearchResult, Video, type VideoFrameImage, type VideoInputReference, type VideoRequest, type WaitForApprovalOptions, type WorkflowCredential, type WorkflowMetadata, type WorkflowProgressOptions, WorkflowReporter, type ZodSchema, audioFromBase64, audioFromBuffer, audioFromFile, audioFromUrl, buildProvider, buildSessionDefinition, buildToolConfig, capabilitiesToTools, capabilityToMetadataTool, capabilityToTool, createExecutionLogger, createHarnessResult, createMetrics, createMultimodalResponse, createRawResult, executeToolCallLoop, fileFromBase64, fileFromBuffer, fileFromPath, fileFromUrl, getCurrentContext, getCurrentSkillContext, imageFromBase64, imageFromBuffer, imageFromFile, imageFromUrl, isActive, isExecutionLogBatchPayload, isTerminal, normalizeExecutionLogEntry, normalizeSessionTransportValue, normalizeStatus, serializeExecutionLogEntry, text, validateSessionTransport, videoFromBase64, videoFromBuffer, videoFromFile, videoFromUrl };
package/dist/index.js CHANGED
@@ -27,8 +27,13 @@ import { readFile } from 'fs/promises';
27
27
 
28
28
  var __defProp = Object.defineProperty;
29
29
  var __getOwnPropNames = Object.getOwnPropertyNames;
30
- var __esm = (fn, res) => function __init() {
31
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
30
+ var __esm = (fn, res, err) => function __init() {
31
+ if (err) throw err[0];
32
+ try {
33
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
34
+ } catch (e) {
35
+ throw err = [e], e;
36
+ }
32
37
  };
33
38
  var __export = (target, all) => {
34
39
  for (var name in all)
@@ -813,6 +818,7 @@ var init_runner = __esm({
813
818
  constructor(config) {
814
819
  this.config = config;
815
820
  }
821
+ config;
816
822
  async run(prompt, options = {}) {
817
823
  const { schema, ...rest } = options;
818
824
  const resolved = this.resolveOptions(this.config, rest);
@@ -2323,9 +2329,6 @@ var AgentFieldClient = class {
2323
2329
  if (metadata?.targetDid) headers["X-Target-DID"] = metadata.targetDid;
2324
2330
  if (metadata?.agentNodeDid) headers["X-Agent-Node-DID"] = metadata.agentNodeDid;
2325
2331
  if (metadata?.agentNodeId) headers["X-Agent-Node-ID"] = metadata.agentNodeId;
2326
- if (metadata?.replaySourceRunId) headers["X-AgentField-Replay-Source-Run-ID"] = metadata.replaySourceRunId;
2327
- if (metadata?.replayBeforeExecutionId) headers["X-AgentField-Replay-Before-Execution-ID"] = metadata.replayBeforeExecutionId;
2328
- if (metadata?.replayMode) headers["X-AgentField-Replay-Mode"] = metadata.replayMode;
2329
2332
  const bodyStr = JSON.stringify({ input });
2330
2333
  const authHeaders = this.didAuthenticator.signRequest(Buffer.from(bodyStr));
2331
2334
  try {
@@ -2352,44 +2355,6 @@ var AgentFieldClient = class {
2352
2355
  throw err;
2353
2356
  }
2354
2357
  }
2355
- async restartExecution(executionId, options = {}) {
2356
- if (!executionId) {
2357
- throw new Error("executionId is required");
2358
- }
2359
- const body = {
2360
- scope: options.scope ?? "workflow",
2361
- reuse: options.reuse ?? "succeeded-before",
2362
- fork: options.fork,
2363
- reason: options.reason,
2364
- input: options.input,
2365
- context: options.context
2366
- };
2367
- const bodyStr = JSON.stringify(body);
2368
- const authHeaders = this.didAuthenticator.signRequest(Buffer.from(bodyStr));
2369
- try {
2370
- const res = await this.http.post(
2371
- `/api/v1/executions/${encodeURIComponent(executionId)}/restart`,
2372
- bodyStr,
2373
- { headers: this.mergeHeaders({ "Content-Type": "application/json", ...authHeaders }) }
2374
- );
2375
- return res.data;
2376
- } catch (err) {
2377
- const respData = err?.response?.data;
2378
- if (respData) {
2379
- const status = err.response.status;
2380
- const msg = respData.message || respData.error || JSON.stringify(respData);
2381
- const enriched = Object.assign(
2382
- new Error(`restart execution ${executionId} failed (${status}): ${msg}`),
2383
- {
2384
- status,
2385
- responseData: respData
2386
- }
2387
- );
2388
- throw enriched;
2389
- }
2390
- throw err;
2391
- }
2392
- }
2393
2358
  async publishWorkflowEvent(event) {
2394
2359
  const payload = {
2395
2360
  execution_id: event.executionId,
@@ -2586,9 +2551,6 @@ var AgentFieldClient = class {
2586
2551
  if (metadata.targetDid) headers["x-target-did"] = metadata.targetDid;
2587
2552
  if (metadata.agentNodeDid) headers["x-agent-node-did"] = metadata.agentNodeDid;
2588
2553
  if (metadata.agentNodeId) headers["x-agent-node-id"] = metadata.agentNodeId;
2589
- if (metadata.replaySourceRunId) headers["x-agentfield-replay-source-run-id"] = metadata.replaySourceRunId;
2590
- if (metadata.replayBeforeExecutionId) headers["x-agentfield-replay-before-execution-id"] = metadata.replayBeforeExecutionId;
2591
- if (metadata.replayMode) headers["x-agentfield-replay-mode"] = metadata.replayMode;
2592
2554
  return headers;
2593
2555
  }
2594
2556
  setDIDCredentials(did, privateKeyJwk) {
@@ -3849,6 +3811,83 @@ function registerAgentfieldLogsRoute(app, ring) {
3849
3811
  });
3850
3812
  }
3851
3813
 
3814
+ // src/sessionTransport.ts
3815
+ var SUPPORTED_SESSION_TRANSPORTS = {
3816
+ openai: ["webrtc", "websocket"],
3817
+ openrouter: ["audio_turns"]
3818
+ };
3819
+ var SessionTransportError = class extends Error {
3820
+ provider;
3821
+ transport;
3822
+ supported;
3823
+ constructor(provider, transport, supported) {
3824
+ const supportedDisplay = supported.length > 0 ? supported.join(", ") : "none";
3825
+ super(
3826
+ `Unsupported session transport '${transport}' for provider '${provider}'. Supported transports: ${supportedDisplay}. AgentField does not infer or switch providers; set provider and transport explicitly.`
3827
+ );
3828
+ this.name = "SessionTransportError";
3829
+ this.provider = provider;
3830
+ this.transport = transport;
3831
+ this.supported = supported;
3832
+ }
3833
+ };
3834
+ function normalizeSessionTransportValue(value) {
3835
+ return value.trim().toLowerCase().replace(/-/g, "_");
3836
+ }
3837
+ function validateSessionTransport(provider, transport) {
3838
+ const normalizedProvider = normalizeSessionTransportValue(provider);
3839
+ const normalizedTransport = normalizeSessionTransportValue(transport);
3840
+ if (!normalizedProvider) {
3841
+ throw new Error("Session provider is required; AgentField does not infer providers.");
3842
+ }
3843
+ if (!normalizedTransport) {
3844
+ throw new Error("Session transport is required; AgentField does not infer transports.");
3845
+ }
3846
+ const supported = SUPPORTED_SESSION_TRANSPORTS[normalizedProvider];
3847
+ if (!supported) {
3848
+ const known = Object.keys(SUPPORTED_SESSION_TRANSPORTS).sort().join(", ");
3849
+ throw new Error(
3850
+ `Unknown session provider '${provider}'. Known providers: ${known}. Register provider capabilities before using a custom session provider.`
3851
+ );
3852
+ }
3853
+ if (!supported.includes(normalizedTransport)) {
3854
+ throw new SessionTransportError(normalizedProvider, normalizedTransport, supported);
3855
+ }
3856
+ return {
3857
+ provider: normalizedProvider,
3858
+ transport: normalizedTransport
3859
+ };
3860
+ }
3861
+
3862
+ // src/session.ts
3863
+ var RealtimeSession = class {
3864
+ sessionId;
3865
+ definition;
3866
+ constructor(sessionId, definition) {
3867
+ this.sessionId = sessionId;
3868
+ this.definition = definition;
3869
+ }
3870
+ async input() {
3871
+ throw new Error("session.input() is populated by the AgentField control plane transport adapter");
3872
+ }
3873
+ };
3874
+ function buildSessionDefinition(name, options) {
3875
+ const capability = validateSessionTransport(options.provider, options.transport);
3876
+ return {
3877
+ name,
3878
+ provider: capability.provider,
3879
+ transport: capability.transport,
3880
+ model: options.model,
3881
+ modalities: options.modalities ?? ["audio", "text"],
3882
+ voice: options.voice,
3883
+ tools: options.tools ?? [],
3884
+ tags: options.tags ?? [],
3885
+ proposed_tags: options.tags ?? [],
3886
+ approved_tags: [],
3887
+ metadata: options.metadata ?? {}
3888
+ };
3889
+ }
3890
+
3852
3891
  // src/agent/Agent.ts
3853
3892
  var TargetNotFoundError = class extends Error {
3854
3893
  };
@@ -3885,6 +3924,7 @@ var Agent = class {
3885
3924
  memoryWatchers = [];
3886
3925
  localVerifier;
3887
3926
  realtimeValidationFunctions = /* @__PURE__ */ new Set();
3927
+ sessions = /* @__PURE__ */ new Map();
3888
3928
  processLogRing = new ProcessLogRing();
3889
3929
  executionLogger;
3890
3930
  /** Tracks an AbortController per in-flight execution_id so the
@@ -3949,6 +3989,13 @@ var Agent = class {
3949
3989
  this.reasoners.includeRouter(router);
3950
3990
  this.skills.includeRouter(router);
3951
3991
  }
3992
+ session(name, options, handler) {
3993
+ this.sessions.set(name, { definition: buildSessionDefinition(name, options), handler });
3994
+ return this;
3995
+ }
3996
+ sessionDefinitions() {
3997
+ return Array.from(this.sessions.values()).map((entry) => entry.definition);
3998
+ }
3952
3999
  handler(adapter) {
3953
4000
  return async (event, res) => {
3954
4001
  if (res && typeof res === "object" && typeof res.setHeader === "function") {
@@ -4296,10 +4343,7 @@ var Agent = class {
4296
4343
  callerDid: parentMetadata?.callerDid,
4297
4344
  targetDid: parentMetadata?.targetDid,
4298
4345
  agentNodeDid: parentMetadata?.agentNodeDid,
4299
- agentNodeId: this.config.nodeId,
4300
- replaySourceRunId: parentMetadata?.replaySourceRunId,
4301
- replayBeforeExecutionId: parentMetadata?.replayBeforeExecutionId,
4302
- replayMode: parentMetadata?.replayMode
4346
+ agentNodeId: this.config.nodeId
4303
4347
  });
4304
4348
  this.executionLogger.system("agent.call.completed", "Remote agent call completed", {
4305
4349
  target,
@@ -4565,10 +4609,7 @@ var Agent = class {
4565
4609
  reasonerId: overrides?.reasonerId ?? normalized["x-reasoner-id"],
4566
4610
  callerDid: overrides?.callerDid ?? normalized["x-caller-did"],
4567
4611
  targetDid: overrides?.targetDid ?? normalized["x-target-did"],
4568
- agentNodeDid: overrides?.agentNodeDid ?? normalized["x-agent-node-did"] ?? normalized["x-agent-did"],
4569
- replaySourceRunId: overrides?.replaySourceRunId ?? normalized["x-agentfield-replay-source-run-id"],
4570
- replayBeforeExecutionId: overrides?.replayBeforeExecutionId ?? normalized["x-agentfield-replay-before-execution-id"],
4571
- replayMode: overrides?.replayMode ?? normalized["x-agentfield-replay-mode"]
4612
+ agentNodeDid: overrides?.agentNodeDid ?? normalized["x-agent-node-did"] ?? normalized["x-agent-did"]
4572
4613
  };
4573
4614
  }
4574
4615
  handleHttpRequest(req, res) {
@@ -4751,7 +4792,8 @@ var Agent = class {
4751
4792
  version: this.config.version,
4752
4793
  deployment_type: deploymentType,
4753
4794
  reasoners: this.reasonerDefinitions(),
4754
- skills: this.skillDefinitions()
4795
+ skills: this.skillDefinitions(),
4796
+ sessions: this.sessionDefinitions()
4755
4797
  };
4756
4798
  }
4757
4799
  async executeInvocation(params) {
@@ -5036,7 +5078,8 @@ var Agent = class {
5036
5078
  sdk: {
5037
5079
  language: "typescript",
5038
5080
  version: AGENTFIELD_TS_SDK_VERSION
5039
- }
5081
+ },
5082
+ sessions: this.sessionDefinitions()
5040
5083
  }
5041
5084
  }
5042
5085
  });
@@ -6575,6 +6618,6 @@ function sleep2(ms) {
6575
6618
  return new Promise((resolve2) => setTimeout(resolve2, ms));
6576
6619
  }
6577
6620
 
6578
- export { ACTIVE_STATUSES, AIClient, Agent, AgentRouter, ApprovalClient, Audio, CANONICAL_STATUSES, DIDAuthenticator, DidClient, DidInterface, DidManager, ExecutionContext, ExecutionLogger, ExecutionStatus, File, HEADER_CALLER_DID, HEADER_DID_NONCE, HEADER_DID_SIGNATURE, HEADER_DID_TIMESTAMP, HarnessRunner, Image, MediaProviderError, MediaRouter, MemoryClient, MemoryClientBase, MemoryEventClient, MemoryInterface, MultimodalResponse, OpenRouterMediaProvider, RateLimitError, ReasonerContext, SUPPORTED_PROVIDERS, SkillContext, StatelessRateLimiter, TERMINAL_STATUSES, Text, Video, WorkflowReporter, audioFromBase64, audioFromBuffer, audioFromFile, audioFromUrl, buildProvider, buildToolConfig, capabilitiesToTools, capabilityToMetadataTool, capabilityToTool, createExecutionLogger, createHarnessResult, createMetrics, createMultimodalResponse, createRawResult, executeToolCallLoop, fileFromBase64, fileFromBuffer, fileFromPath, fileFromUrl, getCurrentContext, getCurrentSkillContext, imageFromBase64, imageFromBuffer, imageFromFile, imageFromUrl, isActive, isExecutionLogBatchPayload, isTerminal, normalizeExecutionLogEntry, normalizeStatus, serializeExecutionLogEntry, text, videoFromBase64, videoFromBuffer, videoFromFile, videoFromUrl };
6621
+ export { ACTIVE_STATUSES, AIClient, Agent, AgentRouter, ApprovalClient, Audio, CANONICAL_STATUSES, DIDAuthenticator, DidClient, DidInterface, DidManager, ExecutionContext, ExecutionLogger, ExecutionStatus, File, HEADER_CALLER_DID, HEADER_DID_NONCE, HEADER_DID_SIGNATURE, HEADER_DID_TIMESTAMP, HarnessRunner, Image, MediaProviderError, MediaRouter, MemoryClient, MemoryClientBase, MemoryEventClient, MemoryInterface, MultimodalResponse, OpenRouterMediaProvider, RateLimitError, RealtimeSession, ReasonerContext, SUPPORTED_PROVIDERS, SUPPORTED_SESSION_TRANSPORTS, SessionTransportError, SkillContext, StatelessRateLimiter, TERMINAL_STATUSES, Text, Video, WorkflowReporter, audioFromBase64, audioFromBuffer, audioFromFile, audioFromUrl, buildProvider, buildSessionDefinition, buildToolConfig, capabilitiesToTools, capabilityToMetadataTool, capabilityToTool, createExecutionLogger, createHarnessResult, createMetrics, createMultimodalResponse, createRawResult, executeToolCallLoop, fileFromBase64, fileFromBuffer, fileFromPath, fileFromUrl, getCurrentContext, getCurrentSkillContext, imageFromBase64, imageFromBuffer, imageFromFile, imageFromUrl, isActive, isExecutionLogBatchPayload, isTerminal, normalizeExecutionLogEntry, normalizeSessionTransportValue, normalizeStatus, serializeExecutionLogEntry, text, validateSessionTransport, videoFromBase64, videoFromBuffer, videoFromFile, videoFromUrl };
6579
6622
  //# sourceMappingURL=index.js.map
6580
6623
  //# sourceMappingURL=index.js.map