@agentfield/sdk 0.1.42 → 0.1.43
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 +37 -3
- package/dist/index.js +590 -56
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -165,8 +165,10 @@ declare class AgentFieldClient {
|
|
|
165
165
|
private readonly http;
|
|
166
166
|
private readonly config;
|
|
167
167
|
private readonly defaultHeaders;
|
|
168
|
+
private didAuthenticator;
|
|
168
169
|
constructor(config: AgentConfig);
|
|
169
|
-
register(payload: any): Promise<
|
|
170
|
+
register(payload: any): Promise<any>;
|
|
171
|
+
getNode(nodeId: string): Promise<any>;
|
|
170
172
|
heartbeat(status?: 'starting' | 'ready' | 'degraded' | 'offline'): Promise<HealthStatus>;
|
|
171
173
|
execute<T = any>(target: string, input: any, metadata?: {
|
|
172
174
|
runId?: string;
|
|
@@ -200,6 +202,9 @@ declare class AgentFieldClient {
|
|
|
200
202
|
private sanitizeHeaders;
|
|
201
203
|
private mergeHeaders;
|
|
202
204
|
private buildExecutionHeaders;
|
|
205
|
+
setDIDCredentials(did: string, privateKeyJwk: string): void;
|
|
206
|
+
get didAuthConfigured(): boolean;
|
|
207
|
+
getDID(): string | undefined;
|
|
203
208
|
sendNote(message: string, tags: string[], agentNodeId: string, metadata: {
|
|
204
209
|
runId?: string;
|
|
205
210
|
executionId?: string;
|
|
@@ -263,7 +268,7 @@ declare class ExecutionContext {
|
|
|
263
268
|
|
|
264
269
|
interface DIDIdentity {
|
|
265
270
|
did: string;
|
|
266
|
-
privateKeyJwk
|
|
271
|
+
privateKeyJwk?: string;
|
|
267
272
|
publicKeyJwk: string;
|
|
268
273
|
derivationPath: string;
|
|
269
274
|
componentType: string;
|
|
@@ -469,6 +474,8 @@ interface ReasonerOptions {
|
|
|
469
474
|
outputSchema?: any;
|
|
470
475
|
trackWorkflow?: boolean;
|
|
471
476
|
memoryConfig?: any;
|
|
477
|
+
/** Force control-plane verification instead of local verification for this reasoner. */
|
|
478
|
+
requireRealtimeValidation?: boolean;
|
|
472
479
|
}
|
|
473
480
|
|
|
474
481
|
declare class SkillContext<TInput = any> {
|
|
@@ -513,6 +520,8 @@ interface SkillOptions {
|
|
|
513
520
|
description?: string;
|
|
514
521
|
inputSchema?: any;
|
|
515
522
|
outputSchema?: any;
|
|
523
|
+
/** Force control-plane verification instead of local verification for this skill. */
|
|
524
|
+
requireRealtimeValidation?: boolean;
|
|
516
525
|
}
|
|
517
526
|
|
|
518
527
|
type DeploymentType = 'long_running' | 'serverless';
|
|
@@ -531,8 +540,16 @@ interface AgentConfig {
|
|
|
531
540
|
heartbeatIntervalMs?: number;
|
|
532
541
|
defaultHeaders?: Record<string, string | number | boolean | undefined>;
|
|
533
542
|
apiKey?: string;
|
|
543
|
+
did?: string;
|
|
544
|
+
privateKeyJwk?: string;
|
|
534
545
|
mcp?: MCPConfig;
|
|
535
546
|
deploymentType?: DeploymentType;
|
|
547
|
+
/** Enable decentralized local verification of incoming DID signatures. */
|
|
548
|
+
localVerification?: boolean;
|
|
549
|
+
/** Cache refresh interval for local verification in seconds (default: 300). */
|
|
550
|
+
verificationRefreshInterval?: number;
|
|
551
|
+
/** Agent-level tags for tag-based authorization policies. */
|
|
552
|
+
tags?: string[];
|
|
536
553
|
}
|
|
537
554
|
interface AIConfig {
|
|
538
555
|
provider?: 'openai' | 'anthropic' | 'google' | 'mistral' | 'groq' | 'xai' | 'deepseek' | 'cohere' | 'openrouter' | 'ollama';
|
|
@@ -754,6 +771,8 @@ declare class Agent {
|
|
|
754
771
|
private readonly memoryWatchers;
|
|
755
772
|
private readonly mcpClientRegistry?;
|
|
756
773
|
private readonly mcpToolRegistrar?;
|
|
774
|
+
private readonly localVerifier?;
|
|
775
|
+
private readonly realtimeValidationFunctions;
|
|
757
776
|
constructor(config: AgentConfig);
|
|
758
777
|
reasoner<TInput = any, TOutput = any>(name: string, handler: ReasonerHandler<TInput, TOutput>, options?: ReasonerOptions): this;
|
|
759
778
|
skill<TInput = any, TOutput = any>(name: string, handler: SkillHandler<TInput, TOutput>, options?: SkillOptions): this;
|
|
@@ -797,6 +816,7 @@ declare class Agent {
|
|
|
797
816
|
private runReasoner;
|
|
798
817
|
private runSkill;
|
|
799
818
|
private registerWithControlPlane;
|
|
819
|
+
private waitForApproval;
|
|
800
820
|
private startHeartbeat;
|
|
801
821
|
private health;
|
|
802
822
|
private mcpStatus;
|
|
@@ -804,6 +824,20 @@ declare class Agent {
|
|
|
804
824
|
private parseTarget;
|
|
805
825
|
}
|
|
806
826
|
|
|
827
|
+
declare const HEADER_CALLER_DID = "X-Caller-DID";
|
|
828
|
+
declare const HEADER_DID_SIGNATURE = "X-DID-Signature";
|
|
829
|
+
declare const HEADER_DID_TIMESTAMP = "X-DID-Timestamp";
|
|
830
|
+
declare const HEADER_DID_NONCE = "X-DID-Nonce";
|
|
831
|
+
declare class DIDAuthenticator {
|
|
832
|
+
private _did?;
|
|
833
|
+
private _privateKey?;
|
|
834
|
+
constructor(did?: string, privateKeyJwk?: string);
|
|
835
|
+
get isConfigured(): boolean;
|
|
836
|
+
get did(): string | undefined;
|
|
837
|
+
signRequest(body: Buffer | Uint8Array): Record<string, string>;
|
|
838
|
+
setCredentials(did: string, privateKeyJwk: string): void;
|
|
839
|
+
}
|
|
840
|
+
|
|
807
841
|
/**
|
|
808
842
|
* Manages DID registration and identity package storage for an agent.
|
|
809
843
|
*
|
|
@@ -946,4 +980,4 @@ declare class StatelessRateLimiter {
|
|
|
946
980
|
executeWithRetry<T>(fn: () => Promise<T>): Promise<T>;
|
|
947
981
|
}
|
|
948
982
|
|
|
949
|
-
export { AIClient, type AIConfig, type AIEmbeddingOptions, type AIRequestOptions, type AIStream, Agent, type AgentCapability, type AgentConfig, type AgentHandler, AgentRouter, type AgentRouterOptions, type AgentState, type AuditTrailExport, type AuditTrailFilters, type Awaitable, type CompactCapability, type CompactDiscoveryResponse, 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 ExecutionMetadata, type GenerateCredentialOptions, type GenerateCredentialParams, type HealthStatus, MCPClient, MCPClientRegistry, type MCPConfig, type MCPHealthSummary, type MCPServerConfig, type MCPTool, MCPToolRegistrar, type MCPToolRegistrarOptions, type MCPToolRegistration, type MemoryChangeEvent, MemoryClient, type MemoryConfig, MemoryEventClient, type MemoryEventHandler, MemoryInterface, type MemoryRequestMetadata, type MemoryRequestOptions, type MemoryScope, type MemoryWatchHandler, RateLimitError, type RateLimiterOptions, type ReasonerCapability, ReasonerContext, type ReasonerDefinition, type ReasonerHandler, type ReasonerOptions, type ServerlessAdapter, type ServerlessEvent, type ServerlessResponse, type SkillCapability, SkillContext, type SkillDefinition, type SkillHandler, type SkillOptions, StatelessRateLimiter, type VectorSearchOptions, type VectorSearchResult, type WorkflowCredential, type WorkflowMetadata, type WorkflowProgressOptions, WorkflowReporter, type ZodSchema, getCurrentContext, getCurrentSkillContext };
|
|
983
|
+
export { AIClient, type AIConfig, type AIEmbeddingOptions, type AIRequestOptions, type AIStream, Agent, type AgentCapability, type AgentConfig, type AgentHandler, AgentRouter, type AgentRouterOptions, type AgentState, type AuditTrailExport, type AuditTrailFilters, type Awaitable, 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 ExecutionMetadata, type GenerateCredentialOptions, type GenerateCredentialParams, HEADER_CALLER_DID, HEADER_DID_NONCE, HEADER_DID_SIGNATURE, HEADER_DID_TIMESTAMP, type HealthStatus, MCPClient, MCPClientRegistry, type MCPConfig, type MCPHealthSummary, type MCPServerConfig, type MCPTool, MCPToolRegistrar, type MCPToolRegistrarOptions, type MCPToolRegistration, type MemoryChangeEvent, MemoryClient, type MemoryConfig, MemoryEventClient, type MemoryEventHandler, MemoryInterface, type MemoryRequestMetadata, type MemoryRequestOptions, type MemoryScope, type MemoryWatchHandler, RateLimitError, type RateLimiterOptions, type ReasonerCapability, ReasonerContext, type ReasonerDefinition, type ReasonerHandler, type ReasonerOptions, type ServerlessAdapter, type ServerlessEvent, type ServerlessResponse, type SkillCapability, SkillContext, type SkillDefinition, type SkillHandler, type SkillOptions, StatelessRateLimiter, type VectorSearchOptions, type VectorSearchResult, type WorkflowCredential, type WorkflowMetadata, type WorkflowProgressOptions, WorkflowReporter, type ZodSchema, getCurrentContext, getCurrentSkillContext };
|