@covia/covia-sdk 1.1.0 → 1.2.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/index.d.ts CHANGED
@@ -2,6 +2,7 @@ declare class Job {
2
2
  id: string;
3
3
  venue: VenueInterface;
4
4
  metadata: JobMetadata;
5
+ private _jobs;
5
6
  constructor(id: string, venue: VenueInterface, metadata: JobMetadata);
6
7
  /**
7
8
  * Whether the job has reached a terminal state
@@ -47,15 +48,42 @@ declare class Job {
47
48
  */
48
49
  stream(): AsyncGenerator<SSEEvent>;
49
50
  /**
50
- * Cancels the execution of the job
51
- * @returns {Promise<number>}
51
+ * Whether the job is paused (PAUSED, INPUT_REQUIRED, or AUTH_REQUIRED)
52
52
  */
53
- cancelJob(): Promise<number>;
53
+ get isPaused(): boolean;
54
+ /**
55
+ * Whether the job requires user input
56
+ */
57
+ get needsInput(): boolean;
58
+ /**
59
+ * Whether the job requires authentication
60
+ */
61
+ get needsAuth(): boolean;
62
+ /**
63
+ * Send a message to the running job
64
+ * @param message - Message payload
65
+ * @returns {Promise<any>}
66
+ */
67
+ sendMessage(message: any): Promise<any>;
68
+ /**
69
+ * Pause the job
70
+ * @returns {Promise<JobMetadata>} Updated job metadata
71
+ */
72
+ pause(): Promise<JobMetadata>;
73
+ /**
74
+ * Resume the job
75
+ * @returns {Promise<JobMetadata>} Updated job metadata
76
+ */
77
+ resume(): Promise<JobMetadata>;
78
+ /**
79
+ * Cancel the job
80
+ * @returns {Promise<JobMetadata>} Updated job metadata
81
+ */
82
+ cancel(): Promise<JobMetadata>;
54
83
  /**
55
84
  * Delete the job
56
- * @returns {Promise<number>}
57
85
  */
58
- deleteJob(): Promise<number>;
86
+ delete(): Promise<void>;
59
87
  }
60
88
 
61
89
  declare abstract class Asset {
@@ -64,23 +92,20 @@ declare abstract class Asset {
64
92
  metadata: AssetMetadata;
65
93
  status?: RunStatus;
66
94
  error?: string;
95
+ private _assets;
96
+ private _operations;
67
97
  constructor(id: AssetID, venue: VenueInterface, metadata?: AssetMetadata);
68
98
  /**
69
99
  * Get asset metadata
70
100
  * @returns {Promise<AssetMetadata>}
71
101
  */
72
102
  getMetadata(): Promise<AssetMetadata>;
73
- /**
74
- * Read stream from asset
75
- * @param reader - ReadableStreamDefaultReader
76
- */
77
- readStream(reader: ReadableStreamDefaultReader<Uint8Array>): Promise<void>;
78
103
  /**
79
104
  * Put content to asset
80
105
  * @param content - Content to upload
81
- * @returns {Promise<ReadableStream<Uint8Array> | null>}
106
+ * @returns {Promise<ContentHashResult>} The content hash returned by the server
82
107
  */
83
- putContent(content: BodyInit): Promise<ReadableStream<Uint8Array> | null>;
108
+ putContent(content: BodyInit): Promise<ContentHashResult>;
84
109
  /**
85
110
  * Get asset content
86
111
  * @returns {Promise<ReadableStream<Uint8Array> | null>}
@@ -100,7 +125,7 @@ declare abstract class Asset {
100
125
  /**
101
126
  * Execute the operation
102
127
  * @param input - Operation input parameters
103
- * @returns {Promise<any>}
128
+ * @returns {Promise<Job>}
104
129
  */
105
130
  invoke(input: any): Promise<Job>;
106
131
  }
@@ -139,29 +164,43 @@ declare class BearerAuth extends Auth {
139
164
  apply(headers: Record<string, string>): void;
140
165
  }
141
166
  /**
142
- * HTTP Basic authentication.
143
- * Adds `Authorization: Basic <base64(username:password)>` to every request.
144
- */
145
- declare class BasicAuth extends Auth {
146
- private _encoded;
147
- constructor(username: string, password: string);
148
- apply(headers: Record<string, string>): void;
149
- }
150
- /**
151
- * Custom auth that sets the X-Covia-User header for user identity tracking.
167
+ * Ed25519 keypair authentication (self-issued EdDSA JWT).
168
+ * Generates a fresh short-lived JWT for every request, signed with the
169
+ * client's Ed25519 private key. The server verifies the signature and
170
+ * extracts the caller's DID from the `sub` claim.
171
+ *
172
+ * Example:
173
+ * const auth = KeyPairAuth.generate();
174
+ * console.log(auth.getDID()); // did:key:z6Mk...
175
+ * const venue = await Grid.connect("https://venue.covia.ai", auth);
152
176
  */
153
- declare class CoviaUserAuth extends Auth {
154
- private _userId;
155
- constructor(userId: string);
177
+ declare class KeyPairAuth extends Auth {
178
+ private _privateKey;
179
+ private _publicKey;
180
+ private _did;
181
+ private _lifetime;
182
+ /**
183
+ * @param privateKey - 32-byte Ed25519 private key
184
+ * @param tokenLifetimeSeconds - JWT lifetime in seconds (default 300 = 5 min)
185
+ */
186
+ constructor(privateKey: Uint8Array, tokenLifetimeSeconds?: number);
156
187
  apply(headers: Record<string, string>): void;
157
- }
158
- /** @deprecated Use Auth subclasses instead (NoAuth, BearerAuth, BasicAuth, CoviaUserAuth). */
188
+ /** The caller's DID derived from the public key. */
189
+ getDID(): string;
190
+ /** The 32-byte Ed25519 public key. */
191
+ getPublicKey(): Uint8Array;
192
+ /** Generate a new random keypair and return a KeyPairAuth instance. */
193
+ static generate(tokenLifetimeSeconds?: number): KeyPairAuth;
194
+ /** Create from a hex-encoded private key string. */
195
+ static fromHex(privateKeyHex: string, tokenLifetimeSeconds?: number): KeyPairAuth;
196
+ }
197
+ /** @deprecated Use Auth subclasses instead (NoAuth, BearerAuth, KeyPairAuth). */
159
198
  interface Credentials {
160
199
  venueId: string;
161
200
  apiKey: string;
162
201
  userId: string;
163
202
  }
164
- /** @deprecated Use Auth subclasses instead (NoAuth, BearerAuth, BasicAuth, CoviaUserAuth). */
203
+ /** @deprecated Use Auth subclasses instead (NoAuth, BearerAuth, KeyPairAuth). */
165
204
  declare class CredentialsHTTP implements Credentials {
166
205
  venueId: string;
167
206
  apiKey: string;
@@ -169,11 +208,203 @@ declare class CredentialsHTTP implements Credentials {
169
208
  constructor(venueId: string, apiKey: string, userId: string);
170
209
  }
171
210
 
211
+ interface AgentManagerVenue {
212
+ operations: {
213
+ run(assetId: string, input: any): Promise<any>;
214
+ };
215
+ }
216
+ declare class AgentManager {
217
+ private venue;
218
+ constructor(venue: AgentManagerVenue);
219
+ create(input: AgentCreateInput): Promise<AgentCreateResult>;
220
+ request(agentId: string, input?: any, wait?: boolean | number): Promise<AgentRequestResult>;
221
+ message(agentId: string, message: any): Promise<AgentMessageResult>;
222
+ trigger(agentId: string): Promise<AgentTriggerResult>;
223
+ query(agentId: string): Promise<AgentQueryResult>;
224
+ list(includeTerminated?: boolean): Promise<AgentListResult>;
225
+ delete(agentId: string, remove?: boolean): Promise<AgentDeleteResult>;
226
+ suspend(agentId: string): Promise<AgentSuspendResult>;
227
+ resume(agentId: string, autoWake?: boolean): Promise<AgentSuspendResult>;
228
+ update(input: AgentUpdateInput): Promise<any>;
229
+ cancelTask(agentId: string, taskId: string): Promise<any>;
230
+ }
231
+
232
+ interface JobManagerVenue {
233
+ baseUrl: string;
234
+ auth: {
235
+ apply(headers: Record<string, string>): void;
236
+ };
237
+ }
238
+ declare class JobManager {
239
+ private venue;
240
+ constructor(venue: JobManagerVenue);
241
+ list(): Promise<string[]>;
242
+ get(jobId: string): Promise<Job>;
243
+ cancel(jobId: string): Promise<JobMetadata>;
244
+ delete(jobId: string): Promise<void>;
245
+ pause(jobId: string): Promise<JobMetadata>;
246
+ resume(jobId: string): Promise<JobMetadata>;
247
+ sendMessage(jobId: string, message: any): Promise<any>;
248
+ stream(jobId: string): AsyncGenerator<SSEEvent>;
249
+ private _buildHeaders;
250
+ }
251
+
252
+ interface AssetManagerVenue {
253
+ baseUrl: string;
254
+ auth: {
255
+ apply(headers: Record<string, string>): void;
256
+ };
257
+ }
258
+ declare class AssetManager {
259
+ private venue;
260
+ constructor(venue: AssetManagerVenue);
261
+ /**
262
+ * Get asset by ID
263
+ * @param assetId - Asset identifier
264
+ * @returns Returns either an Operation or DataAsset based on the asset's metadata
265
+ */
266
+ get(assetId: AssetID): Promise<Asset>;
267
+ /**
268
+ * List assets with pagination support
269
+ * @param options - Pagination options (offset, limit)
270
+ */
271
+ list(options?: AssetListOptions): Promise<AssetList>;
272
+ /**
273
+ * Register a new asset
274
+ * @param assetData - Asset configuration
275
+ */
276
+ register(assetData: any): Promise<Asset>;
277
+ /**
278
+ * Get asset metadata
279
+ * @param assetId - Asset identifier
280
+ */
281
+ getMetadata(assetId: string): Promise<AssetMetadata>;
282
+ /**
283
+ * Put content to asset
284
+ * @param assetId - Asset identifier
285
+ * @param content - Content to upload
286
+ * @returns The content hash returned by the server
287
+ */
288
+ putContent(assetId: string, content: BodyInit): Promise<ContentHashResult>;
289
+ /**
290
+ * Get asset content
291
+ * @param assetId - Asset identifier
292
+ */
293
+ getContent(assetId: string): Promise<ReadableStream<Uint8Array> | null>;
294
+ /**
295
+ * Clear the asset cache.
296
+ */
297
+ clearCache(): void;
298
+ private _buildHeaders;
299
+ }
300
+
301
+ interface OperationManagerVenue {
302
+ baseUrl: string;
303
+ auth: {
304
+ apply(headers: Record<string, string>): void;
305
+ };
306
+ }
307
+ declare class OperationManager {
308
+ private venue;
309
+ constructor(venue: OperationManagerVenue);
310
+ /**
311
+ * List all named operations available on this venue
312
+ */
313
+ list(): Promise<OperationInfo[]>;
314
+ /**
315
+ * Get details of a named operation
316
+ * @param name - Operation name (e.g., "test:echo")
317
+ */
318
+ get(name: string): Promise<OperationInfo>;
319
+ /**
320
+ * Execute an operation and wait for the result
321
+ * @param assetId - Operation asset ID or named operation
322
+ * @param input - Operation input parameters
323
+ * @param options - Invoke options (e.g., ucans)
324
+ */
325
+ run(assetId: string, input: any, options?: InvokeOptions): Promise<any>;
326
+ /**
327
+ * Execute an operation and return a Job for tracking
328
+ * @param assetId - Operation asset ID or named operation
329
+ * @param input - Operation input parameters
330
+ * @param options - Invoke options (e.g., ucans)
331
+ */
332
+ invoke(assetId: string, input: any, options?: InvokeOptions): Promise<Job>;
333
+ private _buildHeaders;
334
+ }
335
+
336
+ interface WorkspaceManagerVenue {
337
+ operations: {
338
+ run(assetId: string, input: any): Promise<any>;
339
+ };
340
+ }
341
+ declare class WorkspaceManager {
342
+ private venue;
343
+ constructor(venue: WorkspaceManagerVenue);
344
+ read(path: string, maxSize?: number): Promise<WorkspaceReadResult>;
345
+ write(path: string, value: any): Promise<WorkspaceWriteResult>;
346
+ delete(path: string): Promise<WorkspaceDeleteResult>;
347
+ append(path: string, value: any): Promise<WorkspaceAppendResult>;
348
+ list(path?: string, limit?: number, offset?: number): Promise<WorkspaceListResult>;
349
+ slice(path: string, offset?: number, limit?: number): Promise<WorkspaceSliceResult>;
350
+ functions(): Promise<FunctionsResult>;
351
+ describe(name: string): Promise<any>;
352
+ adapters(): Promise<AdaptersResult>;
353
+ }
354
+
355
+ interface UCANManagerVenue {
356
+ operations: {
357
+ run(assetId: string, input: any): Promise<any>;
358
+ };
359
+ }
360
+ declare class UCANManager {
361
+ private venue;
362
+ constructor(venue: UCANManagerVenue);
363
+ issue(aud: string, att: UCANAttenuation[], exp: number): Promise<UCANIssueResult>;
364
+ }
365
+
366
+ interface SecretManagerVenue {
367
+ operations: {
368
+ run(assetId: string, input: any): Promise<any>;
369
+ };
370
+ listSecrets(): Promise<string[]>;
371
+ putSecret(name: string, value: string): Promise<void>;
372
+ deleteSecret(name: string): Promise<void>;
373
+ }
374
+ declare class SecretManager {
375
+ private venue;
376
+ constructor(venue: SecretManagerVenue);
377
+ set(name: string, value: string): Promise<SecretSetResult>;
378
+ /**
379
+ * Extract a secret value by name.
380
+ * NOTE: This operation requires a UCAN capability grant. The backend
381
+ * may reject requests that lack the appropriate capability proof.
382
+ */
383
+ extract(name: string): Promise<SecretExtractResult>;
384
+ list(): Promise<string[]>;
385
+ put(name: string, value: string): Promise<void>;
386
+ delete(name: string): Promise<void>;
387
+ }
388
+
172
389
  declare class Venue implements VenueInterface {
173
390
  baseUrl: string;
174
391
  venueId: string;
175
392
  auth: Auth;
176
393
  metadata: VenueData;
394
+ private _agents?;
395
+ private _jobs?;
396
+ private _assets?;
397
+ private _operations?;
398
+ private _workspace?;
399
+ private _ucan?;
400
+ private _secrets?;
401
+ get agents(): AgentManager;
402
+ get jobs(): JobManager;
403
+ get assets(): AssetManager;
404
+ get operations(): OperationManager;
405
+ get workspace(): WorkspaceManager;
406
+ get ucan(): UCANManager;
407
+ get secrets(): SecretManager;
177
408
  constructor(options?: VenueOptions);
178
409
  /**
179
410
  * Static method to connect to a venue
@@ -183,24 +414,13 @@ declare class Venue implements VenueInterface {
183
414
  */
184
415
  static connect(venueId: string | Venue, auth?: Auth): Promise<Venue>;
185
416
  /**
186
- * Register a new asset
187
- * @param assetData - Asset configuration
188
- * @returns {Promise<Asset>}
189
- */
190
- register(assetData: any): Promise<Asset>;
191
- /**
192
- * Read stream from asset
193
- * @param reader - ReadableStreamDefaultReader
194
- */
195
- readStream(reader: ReadableStreamDefaultReader<Uint8Array>): Promise<void>;
196
- /**
197
- * Get asset by ID
417
+ * Get asset by ID (convenience delegate to venue.assets.get)
198
418
  * @param assetId - Asset identifier
199
419
  * @returns {Promise<Asset>} Returns either an Operation or DataAsset based on the asset's metadata
200
420
  */
201
421
  getAsset(assetId: AssetID): Promise<Asset>;
202
422
  /**
203
- * List assets with pagination support
423
+ * List assets with pagination support (convenience delegate to venue.assets.list)
204
424
  * @param options - Pagination options (offset, limit)
205
425
  * @returns {Promise<AssetList>} Paginated list of asset IDs with metadata
206
426
  */
@@ -217,33 +437,26 @@ declare class Venue implements VenueInterface {
217
437
  */
218
438
  getJob(jobId: string): Promise<Job>;
219
439
  /**
220
- * Cancel job by ID
221
- * @param jobId - Job identifier
222
- * @returns {Promise<number>}
223
- */
224
- cancelJob(jobId: string): Promise<number>;
225
- /**
226
- * Delete job by ID
227
- * @param jobId - Job identifier
228
- * @returns {Promise<number>}
229
- */
230
- deleteJob(jobId: string): Promise<number>;
440
+ * List secret names
441
+ * @returns {Promise<string[]>}
442
+ */
443
+ listSecrets(): Promise<string[]>;
231
444
  /**
232
- * Get venue status
233
- * @returns {Promise<StatusData>}
445
+ * Store a secret value
446
+ * @param name - Secret name
447
+ * @param value - Secret value
234
448
  */
235
- status(): Promise<StatusData>;
449
+ putSecret(name: string, value: string): Promise<void>;
236
450
  /**
237
- * List all named operations available on this venue
238
- * @returns {Promise<OperationInfo[]>}
451
+ * Delete a secret
452
+ * @param name - Secret name
239
453
  */
240
- listOperations(): Promise<OperationInfo[]>;
454
+ deleteSecret(name: string): Promise<void>;
241
455
  /**
242
- * Get details of a named operation
243
- * @param name - Operation name (e.g., "test:echo")
244
- * @returns {Promise<OperationInfo>}
456
+ * Get venue status
457
+ * @returns {Promise<StatusData>}
245
458
  */
246
- getOperation(name: string): Promise<OperationInfo>;
459
+ status(): Promise<StatusData>;
247
460
  /**
248
461
  * Get the full DID document for this venue
249
462
  * @returns {Promise<DIDDocument>}
@@ -259,40 +472,6 @@ declare class Venue implements VenueInterface {
259
472
  * @returns {Promise<AgentCard>}
260
473
  */
261
474
  agentCard(): Promise<AgentCard>;
262
- /**
263
- * Get asset metadata
264
- * @returns {Promise<AssetMetadata>}
265
- */
266
- getMetadata(assetId: string): Promise<AssetMetadata>;
267
- /**
268
- * Put content to asset
269
- * @param content - Content to upload
270
- * @returns {Promise<ReadableStream<Uint8Array> | null>}
271
- */
272
- putContent(assetId: string, content: BodyInit): Promise<ReadableStream<Uint8Array> | null>;
273
- /**
274
- * Get asset content
275
- * @returns {Promise<ReadableStream<Uint8Array> | null>}
276
- */
277
- getContent(assetId: string): Promise<ReadableStream<Uint8Array> | null>;
278
- /**
279
- * Execute the operation
280
- * @param input - Operation input parameters
281
- * @returns {Promise<any>}
282
- */
283
- run(assetId: string, input: any): Promise<any>;
284
- /**
285
- * Execute the operation
286
- * @param input - Operation input parameters
287
- * @returns {Promise<Job>}
288
- */
289
- invoke(assetId: string, input: any): Promise<Job>;
290
- /**
291
- * Stream server-sent events for a job.
292
- * @param jobId - Job identifier
293
- * @returns AsyncGenerator yielding SSEEvent objects
294
- */
295
- streamJobEvents(jobId: string): AsyncGenerator<SSEEvent>;
296
475
  /**
297
476
  * Close the venue and release resources.
298
477
  * Clears cached asset data for this venue.
@@ -316,30 +495,25 @@ interface VenueConstructor {
316
495
  new (): VenueInterface;
317
496
  connect(venueId: string | Venue, auth?: Auth): Promise<Venue>;
318
497
  }
498
+ interface InvokeOptions {
499
+ ucans?: string[];
500
+ }
319
501
  interface VenueInterface {
320
502
  baseUrl: string;
321
503
  venueId: string;
322
504
  metadata: VenueData;
323
- cancelJob(jobId: string): Promise<number>;
324
- deleteJob(jobId: string): Promise<number>;
505
+ auth: Auth;
325
506
  status(): Promise<StatusData>;
326
507
  getJob(jobId: string): Promise<Job>;
327
508
  listJobs(): Promise<string[]>;
328
509
  getAsset(assetId: AssetID): Promise<Asset>;
329
- register(assetData: any): Promise<Asset>;
330
- getMetadata(assetId: string): Promise<AssetMetadata>;
331
- readStream(reader: ReadableStreamDefaultReader<Uint8Array>): Promise<void>;
332
- putContent(assetId: string, content: BodyInit): Promise<ReadableStream<Uint8Array> | null>;
333
- getContent(assetId: string): Promise<ReadableStream<Uint8Array> | null>;
334
- run(assetId: string, input: any): Promise<any>;
335
- invoke(assetId: string, input: any): Promise<Job>;
336
510
  listAssets(options?: AssetListOptions): Promise<AssetList>;
337
- listOperations(): Promise<OperationInfo[]>;
338
- getOperation(name: string): Promise<OperationInfo>;
339
511
  didDocument(): Promise<DIDDocument>;
340
512
  mcpDiscovery(): Promise<MCPDiscovery>;
341
513
  agentCard(): Promise<AgentCard>;
342
- streamJobEvents(jobId: string): AsyncGenerator<SSEEvent>;
514
+ listSecrets(): Promise<string[]>;
515
+ putSecret(name: string, value: string): Promise<void>;
516
+ deleteSecret(name: string): Promise<void>;
343
517
  close(): void;
344
518
  }
345
519
  type AssetID = string;
@@ -375,6 +549,9 @@ interface ContentDetails {
375
549
  interface OperationPayload {
376
550
  [key: string]: any;
377
551
  }
552
+ interface ContentHashResult {
553
+ hash: string;
554
+ }
378
555
  interface JobMetadata {
379
556
  name?: string;
380
557
  status?: RunStatus;
@@ -382,7 +559,9 @@ interface JobMetadata {
382
559
  updated?: string;
383
560
  input?: any;
384
561
  output?: any;
385
- op?: string;
562
+ operation?: string;
563
+ caller?: string;
564
+ error?: string;
386
565
  [key: string]: any;
387
566
  }
388
567
  interface InvokePayload {
@@ -467,6 +646,195 @@ interface SSEEvent {
467
646
  /** Parse the event data as JSON. */
468
647
  json: () => any;
469
648
  }
649
+ declare enum AgentStatus {
650
+ SLEEPING = "SLEEPING",
651
+ RUNNING = "RUNNING",
652
+ SUSPENDED = "SUSPENDED",
653
+ TERMINATED = "TERMINATED"
654
+ }
655
+ interface AgentCreateInput {
656
+ agentId: string;
657
+ config?: Record<string, any>;
658
+ state?: Record<string, any>;
659
+ overwrite?: boolean;
660
+ }
661
+ interface AgentCreateResult {
662
+ agentId: string;
663
+ status: string;
664
+ created: boolean;
665
+ }
666
+ interface AgentRequestInput {
667
+ agentId: string;
668
+ input?: any;
669
+ wait?: boolean | number;
670
+ }
671
+ interface AgentRequestResult {
672
+ id: string;
673
+ status: string;
674
+ output?: any;
675
+ }
676
+ interface AgentMessageInput {
677
+ agentId: string;
678
+ message: any;
679
+ }
680
+ interface AgentMessageResult {
681
+ agentId: string;
682
+ delivered: boolean;
683
+ }
684
+ interface AgentTriggerInput {
685
+ agentId: string;
686
+ }
687
+ interface AgentTriggerResult {
688
+ agentId: string;
689
+ status: string;
690
+ result?: any;
691
+ taskResults?: any[];
692
+ }
693
+ interface AgentQueryInput {
694
+ agentId: string;
695
+ }
696
+ interface AgentQueryResult {
697
+ agentId: string;
698
+ status: string;
699
+ state?: Record<string, any>;
700
+ config?: Record<string, any>;
701
+ tasks?: any[];
702
+ [key: string]: any;
703
+ }
704
+ interface AgentListInput {
705
+ includeTerminated?: boolean;
706
+ }
707
+ interface AgentListResult {
708
+ agents: Array<{
709
+ agentId: string;
710
+ status: string;
711
+ tasks: number;
712
+ }>;
713
+ }
714
+ interface AgentDeleteInput {
715
+ agentId: string;
716
+ remove?: boolean;
717
+ }
718
+ interface AgentDeleteResult {
719
+ agentId: string;
720
+ status: string;
721
+ removed?: boolean;
722
+ }
723
+ interface AgentSuspendResult {
724
+ agentId: string;
725
+ status: string;
726
+ }
727
+ interface AgentResumeInput {
728
+ agentId: string;
729
+ autoWake?: boolean;
730
+ }
731
+ interface AgentUpdateInput {
732
+ agentId: string;
733
+ config?: Record<string, any>;
734
+ state?: Record<string, any>;
735
+ }
736
+ interface AgentCancelTaskInput {
737
+ agentId: string;
738
+ taskId: string;
739
+ }
740
+ interface WorkspaceReadInput {
741
+ path: string;
742
+ maxSize?: number;
743
+ }
744
+ interface WorkspaceReadResult {
745
+ exists: boolean;
746
+ value?: any;
747
+ truncated?: boolean;
748
+ size?: number;
749
+ }
750
+ interface WorkspaceWriteInput {
751
+ path: string;
752
+ value: any;
753
+ }
754
+ interface WorkspaceWriteResult {
755
+ written: boolean;
756
+ }
757
+ interface WorkspaceDeleteInput {
758
+ path: string;
759
+ }
760
+ interface WorkspaceDeleteResult {
761
+ deleted: boolean;
762
+ }
763
+ interface WorkspaceAppendInput {
764
+ path: string;
765
+ value: any;
766
+ }
767
+ interface WorkspaceAppendResult {
768
+ appended: boolean;
769
+ }
770
+ interface WorkspaceListInput {
771
+ path?: string;
772
+ limit?: number;
773
+ offset?: number;
774
+ }
775
+ interface WorkspaceListResult {
776
+ exists: boolean;
777
+ type: string;
778
+ count?: number;
779
+ keys?: string[];
780
+ values?: any[];
781
+ offset?: number;
782
+ }
783
+ interface WorkspaceSliceInput {
784
+ path: string;
785
+ offset?: number;
786
+ limit?: number;
787
+ }
788
+ interface WorkspaceSliceResult {
789
+ exists: boolean;
790
+ type: string;
791
+ values: any[];
792
+ count: number;
793
+ offset: number;
794
+ }
795
+ interface UCANAttenuation {
796
+ with: string;
797
+ can: string;
798
+ }
799
+ interface UCANIssueInput {
800
+ aud: string;
801
+ att: UCANAttenuation[];
802
+ exp: number;
803
+ }
804
+ interface UCANIssueResult {
805
+ [key: string]: any;
806
+ }
807
+ interface SecretSetInput {
808
+ name: string;
809
+ value: string;
810
+ }
811
+ interface SecretSetResult {
812
+ name: string;
813
+ stored: boolean;
814
+ }
815
+ interface SecretExtractInput {
816
+ name: string;
817
+ }
818
+ interface SecretExtractResult {
819
+ name: string;
820
+ value: string;
821
+ }
822
+ interface FunctionInfo {
823
+ name: string;
824
+ id: string;
825
+ description?: string;
826
+ }
827
+ interface FunctionsResult {
828
+ functions: FunctionInfo[];
829
+ }
830
+ interface AdapterInfo {
831
+ name: string;
832
+ description?: string;
833
+ operations: string[];
834
+ }
835
+ interface AdaptersResult {
836
+ adapters: AdapterInfo[];
837
+ }
470
838
  declare class CoviaError extends Error {
471
839
  code: number | null;
472
840
  constructor(message: string, code?: number | null);
@@ -588,7 +956,7 @@ declare class Grid {
588
956
  /**
589
957
  * Static method to connect to a venue
590
958
  * @param venueId - Can be a HTTP base URL, DNS name, or existing Venue instance
591
- * @param auth - Optional authentication provider (BearerAuth, BasicAuth, etc.)
959
+ * @param auth - Optional authentication provider (BearerAuth, KeyPairAuth, etc.)
592
960
  * @returns {Promise<Venue>} A new Venue instance configured appropriately
593
961
  */
594
962
  static connect(venueId: string, auth?: Auth): Promise<Venue>;
@@ -602,4 +970,47 @@ declare class DataAsset extends Asset {
602
970
  constructor(id: AssetID, venue: VenueInterface, metadata?: AssetMetadata);
603
971
  }
604
972
 
605
- export { type AgentCard, Asset, type AssetID, type AssetList, type AssetListOptions, type AssetMetadata, AssetNotFoundError, Auth, BasicAuth, BearerAuth, type ContentDetails, CoviaConnectionError, CoviaError, CoviaTimeoutError, CoviaUserAuth, type Credentials, CredentialsHTTP, type DIDDocument, DataAsset, Grid, GridError, type InvokePayload, Job, JobFailedError, type JobMetadata, JobNotFoundError, JobStatus, type MCPDiscovery, NoAuth, NotFoundError, Operation, type OperationDetails, type OperationInfo, type OperationPayload, RunStatus, type SSEEvent, type StatsData, type StatusData, Venue, type VenueConstructor, type VenueData, type VenueInterface, type VenueOptions, createSSEEvent, fetchStreamWithError, fetchWithError, getAssetIdFromPath, getAssetIdFromVenueId, getParsedAssetId, isJobComplete, isJobFinished, isJobPaused, logger, parseSSEStream };
973
+ /**
974
+ * Ed25519 keypair generation and utility functions.
975
+ */
976
+ /**
977
+ * Generate a random Ed25519 keypair.
978
+ * @returns Object with privateKey (32 bytes) and publicKey (32 bytes)
979
+ */
980
+ declare function generateKeyPair(): {
981
+ privateKey: Uint8Array;
982
+ publicKey: Uint8Array;
983
+ };
984
+ /**
985
+ * Convert a private key to hex string for storage.
986
+ */
987
+ declare function privateKeyToHex(key: Uint8Array): string;
988
+ /**
989
+ * Convert a hex string back to a private key Uint8Array.
990
+ */
991
+ declare function hexToPrivateKey(hex: string): Uint8Array;
992
+
993
+ /**
994
+ * Multikey encoding for Ed25519 public keys.
995
+ * Follows the did:key spec with multicodec prefix 0xed01 for Ed25519.
996
+ */
997
+ /**
998
+ * Encode an Ed25519 public key as a multikey string (z-prefixed base58-btc).
999
+ * @param publicKey - 32-byte Ed25519 public key
1000
+ * @returns Multikey string like "z6MkhaXgBZD..."
1001
+ */
1002
+ declare function encodePublicKey(publicKey: Uint8Array): string;
1003
+ /**
1004
+ * Decode a multikey string back to a 32-byte Ed25519 public key.
1005
+ * @param multikey - Multikey string starting with "z"
1006
+ * @returns 32-byte Ed25519 public key
1007
+ */
1008
+ declare function decodePublicKey(multikey: string): Uint8Array;
1009
+ /**
1010
+ * Create a did:key DID from an Ed25519 public key.
1011
+ * @param publicKey - 32-byte Ed25519 public key
1012
+ * @returns DID string like "did:key:z6MkhaXgBZD..."
1013
+ */
1014
+ declare function didFromPublicKey(publicKey: Uint8Array): string;
1015
+
1016
+ export { type AdapterInfo, type AdaptersResult, type AgentCancelTaskInput, type AgentCard, type AgentCreateInput, type AgentCreateResult, type AgentDeleteInput, type AgentDeleteResult, type AgentListInput, type AgentListResult, AgentManager, type AgentMessageInput, type AgentMessageResult, type AgentQueryInput, type AgentQueryResult, type AgentRequestInput, type AgentRequestResult, type AgentResumeInput, AgentStatus, type AgentSuspendResult, type AgentTriggerInput, type AgentTriggerResult, type AgentUpdateInput, Asset, type AssetID, type AssetList, type AssetListOptions, AssetManager, type AssetMetadata, AssetNotFoundError, Auth, BearerAuth, type ContentDetails, type ContentHashResult, CoviaConnectionError, CoviaError, CoviaTimeoutError, type Credentials, CredentialsHTTP, type DIDDocument, DataAsset, type FunctionInfo, type FunctionsResult, Grid, GridError, type InvokeOptions, type InvokePayload, Job, JobFailedError, JobManager, type JobMetadata, JobNotFoundError, JobStatus, KeyPairAuth, type MCPDiscovery, NoAuth, NotFoundError, Operation, type OperationDetails, type OperationInfo, OperationManager, type OperationPayload, RunStatus, type SSEEvent, type SecretExtractInput, type SecretExtractResult, SecretManager, type SecretSetInput, type SecretSetResult, type StatsData, type StatusData, type UCANAttenuation, type UCANIssueInput, type UCANIssueResult, UCANManager, Venue, type VenueConstructor, type VenueData, type VenueInterface, type VenueOptions, type WorkspaceAppendInput, type WorkspaceAppendResult, type WorkspaceDeleteInput, type WorkspaceDeleteResult, type WorkspaceListInput, type WorkspaceListResult, WorkspaceManager, type WorkspaceReadInput, type WorkspaceReadResult, type WorkspaceSliceInput, type WorkspaceSliceResult, type WorkspaceWriteInput, type WorkspaceWriteResult, createSSEEvent, decodePublicKey, didFromPublicKey, encodePublicKey, fetchStreamWithError, fetchWithError, generateKeyPair, getAssetIdFromPath, getAssetIdFromVenueId, getParsedAssetId, hexToPrivateKey, isJobComplete, isJobFinished, isJobPaused, logger, parseSSEStream, privateKeyToHex };