@covia/covia-sdk 1.8.0 → 1.9.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/README.md +98 -33
- package/dist/index.d.mts +188 -60
- package/dist/index.d.ts +188 -60
- package/dist/index.js +499 -155
- package/dist/index.mjs +496 -156
- package/package.json +9 -4
package/dist/index.d.mts
CHANGED
|
@@ -20,6 +20,10 @@ declare class Agent {
|
|
|
20
20
|
}): Promise<unknown>;
|
|
21
21
|
cancelTask(taskId: string): Promise<unknown>;
|
|
22
22
|
info(): Promise<AgentInfoResult>;
|
|
23
|
+
/** Page this agent's sessions through the job-free workspace Values API. */
|
|
24
|
+
listSessions(options?: AgentSessionListOptions): Promise<AgentSessionPage>;
|
|
25
|
+
/** Read one session through the job-free workspace Values API. */
|
|
26
|
+
getSession(sessionId: string): Promise<AgentSession>;
|
|
23
27
|
/**
|
|
24
28
|
* Fork this agent into a new agent.
|
|
25
29
|
* @param agentId - ID for the new forked agent
|
|
@@ -215,7 +219,7 @@ declare class NoAuth extends Auth {
|
|
|
215
219
|
* Adds `Authorization: Bearer <token>` to every request.
|
|
216
220
|
*
|
|
217
221
|
* Example:
|
|
218
|
-
* const venue = await Grid.connect("https://venue.
|
|
222
|
+
* const venue = await Grid.connect("https://your-venue.example.com", new BearerAuth("my-token"));
|
|
219
223
|
*/
|
|
220
224
|
declare class BearerAuth extends Auth {
|
|
221
225
|
private _token;
|
|
@@ -227,7 +231,7 @@ declare class BearerAuth extends Auth {
|
|
|
227
231
|
* Adds `Authorization: Basic <base64(username:password)>` to every request.
|
|
228
232
|
*
|
|
229
233
|
* Example:
|
|
230
|
-
* const venue = await Grid.connect("https://venue.
|
|
234
|
+
* const venue = await Grid.connect("https://your-venue.example.com", new BasicAuth("admin", "s3cret"));
|
|
231
235
|
*/
|
|
232
236
|
declare class BasicAuth extends Auth {
|
|
233
237
|
private _username;
|
|
@@ -244,7 +248,7 @@ declare class BasicAuth extends Auth {
|
|
|
244
248
|
* Example:
|
|
245
249
|
* const auth = Ed25519Auth.generate();
|
|
246
250
|
* console.log(auth.getDID()); // did:key:z6Mk...
|
|
247
|
-
* const venue = await Grid.connect("https://venue.
|
|
251
|
+
* const venue = await Grid.connect("https://your-venue.example.com", auth);
|
|
248
252
|
*/
|
|
249
253
|
declare class Ed25519Auth extends Auth {
|
|
250
254
|
private _privateKey;
|
|
@@ -306,9 +310,8 @@ interface AdapterManagerVenue {
|
|
|
306
310
|
* Adapter introspection for a venue.
|
|
307
311
|
*
|
|
308
312
|
* Reads go through the workspace manager, so they are job-free (`GET
|
|
309
|
-
* /api/v1/values/*`, covia #177) on 0.3+ venues
|
|
310
|
-
*
|
|
311
|
-
* every other workspace-backed read gets, rather than a hand-rolled fetch.
|
|
313
|
+
* /api/v1/values/*`, covia #177) on 0.3+ venues. Older venues reject rather
|
|
314
|
+
* than turning a metadata read into a persisted job.
|
|
312
315
|
*/
|
|
313
316
|
declare class AdapterManager {
|
|
314
317
|
private venue;
|
|
@@ -328,25 +331,31 @@ declare class AdapterManager {
|
|
|
328
331
|
get(name: string): Promise<AdapterInfo | null>;
|
|
329
332
|
}
|
|
330
333
|
|
|
331
|
-
interface
|
|
334
|
+
interface VenueRequestContext {
|
|
332
335
|
baseUrl: string;
|
|
333
336
|
venueId: string;
|
|
334
337
|
auth: {
|
|
335
338
|
apply(headers: Record<string, string>, audience?: string): void;
|
|
336
339
|
};
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
interface AgentManagerVenue extends VenueRequestContext {
|
|
337
343
|
operations: OperationRunner;
|
|
344
|
+
workspace: {
|
|
345
|
+
read(path: string, maxSize?: number): Promise<WorkspaceReadResult>;
|
|
346
|
+
slice(path: string, offset?: number, limit?: number): Promise<WorkspaceSliceResult>;
|
|
347
|
+
};
|
|
338
348
|
lastKnownStatus?: StatusData;
|
|
339
349
|
}
|
|
340
350
|
declare class AgentManager {
|
|
341
351
|
private venue;
|
|
342
352
|
private agentsGetSupported;
|
|
343
353
|
constructor(venue: AgentManagerVenue);
|
|
344
|
-
private _headers;
|
|
345
354
|
/** Whether the venue serves `GET /api/v1/agents`: no if a probe already
|
|
346
355
|
* 404'd, or if the venue's last known status identifies it as pre-0.4. */
|
|
347
356
|
private supportsAgentsGet;
|
|
348
|
-
/** A job-free agents GET
|
|
349
|
-
private
|
|
357
|
+
/** A job-free agents GET that rejects when the endpoint is unavailable. */
|
|
358
|
+
private agentsGet;
|
|
350
359
|
create(input: AgentCreateInput): Promise<AgentCreateResult>;
|
|
351
360
|
request(agentId: string, input?: unknown, wait?: boolean | number): Promise<AgentRequestResult>;
|
|
352
361
|
message(agentId: string, message: unknown): Promise<AgentMessageResult>;
|
|
@@ -378,7 +387,7 @@ declare class AgentManager {
|
|
|
378
387
|
/**
|
|
379
388
|
* List the caller's agents. **Job-free** on covia ≥ 0.4: goes through
|
|
380
389
|
* `GET /api/v1/agents` (covia#180) — synchronous, no Job persisted. Older
|
|
381
|
-
* venues
|
|
390
|
+
* venues reject rather than silently creating a persisted Job.
|
|
382
391
|
*/
|
|
383
392
|
list(includeTerminated?: boolean): Promise<AgentListResult>;
|
|
384
393
|
delete(agentId: string, remove?: boolean): Promise<AgentDeleteResult>;
|
|
@@ -387,21 +396,24 @@ declare class AgentManager {
|
|
|
387
396
|
update(input: AgentUpdateInput): Promise<unknown>;
|
|
388
397
|
cancelTask(agentId: string, taskId: string): Promise<unknown>;
|
|
389
398
|
/** Agent info. **Job-free** on covia ≥ 0.4 (`GET /api/v1/agents/{id}`,
|
|
390
|
-
* covia#180); older venues
|
|
399
|
+
* covia#180); older venues require an explicit compatibility opt-in. */
|
|
391
400
|
info(agentId: string): Promise<AgentInfoResult>;
|
|
401
|
+
/**
|
|
402
|
+
* Page an agent's sessions directly from `g/<agentId>/sessions`.
|
|
403
|
+
* This is a job-free Values read; session adapter-specific fields remain
|
|
404
|
+
* available on each record's `value` while common runtime fields are typed.
|
|
405
|
+
*/
|
|
406
|
+
listSessions(agentId: string, options?: AgentSessionListOptions): Promise<AgentSessionPage>;
|
|
407
|
+
/** Read one agent session directly from the workspace Values surface. */
|
|
408
|
+
getSession(agentId: string, sessionId: string): Promise<AgentSession>;
|
|
409
|
+
private _readLargeSession;
|
|
392
410
|
fork(input: AgentForkInput): Promise<AgentForkResult>;
|
|
393
411
|
context(agentId: string, task?: unknown): Promise<string>;
|
|
394
412
|
completeTask(result?: unknown): Promise<AgentCompleteTaskResult>;
|
|
395
413
|
failTask(error: string): Promise<AgentFailTaskResult>;
|
|
396
414
|
}
|
|
397
415
|
|
|
398
|
-
|
|
399
|
-
baseUrl: string;
|
|
400
|
-
venueId: string;
|
|
401
|
-
auth: {
|
|
402
|
-
apply(headers: Record<string, string>, audience?: string): void;
|
|
403
|
-
};
|
|
404
|
-
}
|
|
416
|
+
type JobManagerVenue = VenueRequestContext;
|
|
405
417
|
declare class JobManager {
|
|
406
418
|
private venue;
|
|
407
419
|
constructor(venue: JobManagerVenue);
|
|
@@ -413,19 +425,14 @@ declare class JobManager {
|
|
|
413
425
|
resume(jobId: string): Promise<JobMetadata>;
|
|
414
426
|
sendMessage(jobId: string, message: unknown): Promise<unknown>;
|
|
415
427
|
stream(jobId: string): AsyncGenerator<SSEEvent>;
|
|
416
|
-
private _buildHeaders;
|
|
417
428
|
}
|
|
418
429
|
|
|
419
|
-
interface AssetManagerVenue {
|
|
420
|
-
baseUrl: string;
|
|
421
|
-
venueId: string;
|
|
422
|
-
auth: {
|
|
423
|
-
apply(headers: Record<string, string>, audience?: string): void;
|
|
424
|
-
};
|
|
430
|
+
interface AssetManagerVenue extends VenueRequestContext {
|
|
425
431
|
operations: OperationRunner;
|
|
426
432
|
}
|
|
427
433
|
declare class AssetManager {
|
|
428
434
|
private venue;
|
|
435
|
+
private cache;
|
|
429
436
|
constructor(venue: AssetManagerVenue);
|
|
430
437
|
/**
|
|
431
438
|
* Get an asset by lattice address.
|
|
@@ -476,15 +483,11 @@ declare class AssetManager {
|
|
|
476
483
|
* Clear the asset cache.
|
|
477
484
|
*/
|
|
478
485
|
clearCache(): void;
|
|
479
|
-
|
|
486
|
+
/** Clear the explicitly configured cross-session metadata store. */
|
|
487
|
+
clearPersistentCache(): void;
|
|
480
488
|
}
|
|
481
489
|
|
|
482
|
-
interface OperationManagerVenue {
|
|
483
|
-
baseUrl: string;
|
|
484
|
-
venueId: string;
|
|
485
|
-
auth: {
|
|
486
|
-
apply(headers: Record<string, string>, audience?: string): void;
|
|
487
|
-
};
|
|
490
|
+
interface OperationManagerVenue extends VenueRequestContext {
|
|
488
491
|
privateJobs?: boolean;
|
|
489
492
|
}
|
|
490
493
|
declare class OperationManager {
|
|
@@ -503,7 +506,7 @@ declare class OperationManager {
|
|
|
503
506
|
* Execute an operation and wait for the result
|
|
504
507
|
* @param assetId - Operation asset ID or named operation
|
|
505
508
|
* @param input - Operation input parameters
|
|
506
|
-
* @param options -
|
|
509
|
+
* @param options - Execution options (e.g., ucans or private execution)
|
|
507
510
|
*/
|
|
508
511
|
run<T = unknown>(assetId: string, input?: unknown, options?: InvokeOptions): Promise<T>;
|
|
509
512
|
/**
|
|
@@ -522,15 +525,9 @@ declare class OperationManager {
|
|
|
522
525
|
* @param options - Invoke options (e.g., ucans)
|
|
523
526
|
*/
|
|
524
527
|
invoke(assetId: string, input?: unknown, options?: InvokeOptions): Promise<Job>;
|
|
525
|
-
private _buildHeaders;
|
|
526
528
|
}
|
|
527
529
|
|
|
528
|
-
interface WorkspaceManagerVenue {
|
|
529
|
-
baseUrl: string;
|
|
530
|
-
venueId: string;
|
|
531
|
-
auth: {
|
|
532
|
-
apply(headers: Record<string, string>, audience?: string): void;
|
|
533
|
-
};
|
|
530
|
+
interface WorkspaceManagerVenue extends VenueRequestContext {
|
|
534
531
|
operations: OperationRunner;
|
|
535
532
|
lastKnownStatus?: StatusData;
|
|
536
533
|
}
|
|
@@ -547,23 +544,15 @@ interface WorkspaceManagerVenue {
|
|
|
547
544
|
* `operations.run`) — a mutation *should* leave an audit record.
|
|
548
545
|
*
|
|
549
546
|
* Paths resolve against the caller's own DID unless fully qualified
|
|
550
|
-
* (`<DID>/w/...`).
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
*
|
|
554
|
-
* the common case — never need this and stay fully job-free.
|
|
555
|
-
*
|
|
556
|
-
* Venues that predate the `/values` routes (< covia 0.3) are accommodated
|
|
557
|
-
* here, not in application code: a 404 from the GET surface can only mean the
|
|
558
|
-
* route is missing (an absent path is `200 {exists:false}`), so reads fall
|
|
559
|
-
* back to the invoke path and the venue is remembered as pre-0.3 for the rest
|
|
560
|
-
* of this manager's lifetime.
|
|
547
|
+
* (`<DID>/w/...`). Reads that require proof tokens, multi-path inspection, or
|
|
548
|
+
* a pre-0.3 venue cannot use the Values GET surface and reject by default.
|
|
549
|
+
* Applications may explicitly invoke the corresponding operation when
|
|
550
|
+
* creating a persisted job is intended.
|
|
561
551
|
*/
|
|
562
552
|
declare class WorkspaceManager {
|
|
563
553
|
private venue;
|
|
564
554
|
private valuesSupported;
|
|
565
555
|
constructor(venue: WorkspaceManagerVenue);
|
|
566
|
-
private _headers;
|
|
567
556
|
/** GET a job-free `/api/v1/values/{op}` read; omit undefined params. */
|
|
568
557
|
private _values;
|
|
569
558
|
/**
|
|
@@ -573,8 +562,9 @@ declare class WorkspaceManager {
|
|
|
573
562
|
* connect/`status()` may populate the status after this manager exists.
|
|
574
563
|
*/
|
|
575
564
|
private supportsValues;
|
|
576
|
-
|
|
577
|
-
|
|
565
|
+
private unsupported;
|
|
566
|
+
/** A job-free Values read that rejects when the endpoint is unavailable. */
|
|
567
|
+
private valuesRead;
|
|
578
568
|
read(path: string, maxSize?: number, ucans?: string[]): Promise<WorkspaceReadResult>;
|
|
579
569
|
list(path?: string, limit?: number, offset?: number, ucans?: string[]): Promise<WorkspaceListResult>;
|
|
580
570
|
slice(path: string, offset?: number, limit?: number, ucans?: string[]): Promise<WorkspaceSliceResult>;
|
|
@@ -650,6 +640,67 @@ declare class SecretManager {
|
|
|
650
640
|
delete(name: string): Promise<void>;
|
|
651
641
|
}
|
|
652
642
|
|
|
643
|
+
/** Agent behaviour optionally attached to otherwise ordinary asset metadata. */
|
|
644
|
+
interface SkillFacet {
|
|
645
|
+
tools?: readonly string[];
|
|
646
|
+
context?: readonly unknown[];
|
|
647
|
+
}
|
|
648
|
+
/** Metadata view exposed when an asset is being used as a skill. */
|
|
649
|
+
type SkillMetadata = AssetMetadata & {
|
|
650
|
+
skill?: SkillFacet;
|
|
651
|
+
};
|
|
652
|
+
/** A skill is an ordinary Asset viewed with its optional skill metadata facet. */
|
|
653
|
+
type Skill = Asset & {
|
|
654
|
+
metadata: SkillMetadata;
|
|
655
|
+
};
|
|
656
|
+
interface SkillManagerVenue {
|
|
657
|
+
workspace: {
|
|
658
|
+
list(path?: string, limit?: number, offset?: number): Promise<WorkspaceListResult>;
|
|
659
|
+
};
|
|
660
|
+
assets: {
|
|
661
|
+
get(path: string): Promise<Asset>;
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Thin, job-free convenience over workspace collections and ordinary assets.
|
|
666
|
+
*
|
|
667
|
+
* Skill discovery, precedence and search are application policy. This manager
|
|
668
|
+
* only lists the asset objects at one location or gets the asset at one path.
|
|
669
|
+
*/
|
|
670
|
+
declare class SkillManager {
|
|
671
|
+
private venue;
|
|
672
|
+
constructor(venue: SkillManagerVenue);
|
|
673
|
+
/** Return every skill asset directly contained at `path`. */
|
|
674
|
+
list(path: string): Promise<Skill[]>;
|
|
675
|
+
/** Return the ordinary asset at exactly `path`, with typed skill metadata. */
|
|
676
|
+
get(path: string): Promise<Skill>;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
interface MemoryManagerVenue {
|
|
680
|
+
workspace: {
|
|
681
|
+
read(path: string, maxSize?: number): Promise<WorkspaceReadResult>;
|
|
682
|
+
slice(path: string, offset?: number, limit?: number): Promise<WorkspaceSliceResult>;
|
|
683
|
+
};
|
|
684
|
+
operations: OperationRunner;
|
|
685
|
+
}
|
|
686
|
+
/** Structured access to the venue's conventional per-user memory list. */
|
|
687
|
+
declare class MemoryManager {
|
|
688
|
+
private venue;
|
|
689
|
+
constructor(venue: MemoryManagerVenue);
|
|
690
|
+
/**
|
|
691
|
+
* Read memory directly from the workspace Values surface. This is job-free;
|
|
692
|
+
* unlike `v/ops/memory {command:'recall'}`, it returns structured entries
|
|
693
|
+
* rather than an LLM-oriented numbered text block.
|
|
694
|
+
*/
|
|
695
|
+
list(path?: string): Promise<MemoryEntry[]>;
|
|
696
|
+
/** Append a memory entry. Mutations intentionally remain audited Jobs. */
|
|
697
|
+
remember(text: string, path?: string): Promise<MemoryChange>;
|
|
698
|
+
/** Replace a 1-based memory entry. Mutations intentionally remain audited Jobs. */
|
|
699
|
+
update(number: number, text: string, path?: string): Promise<MemoryChange>;
|
|
700
|
+
/** Remove a 1-based memory entry. Mutations intentionally remain audited Jobs. */
|
|
701
|
+
forget(number: number, path?: string): Promise<MemoryChange>;
|
|
702
|
+
}
|
|
703
|
+
|
|
653
704
|
/**
|
|
654
705
|
* Resolve a non-DID venue id into the ordered list of base URLs that
|
|
655
706
|
* {@link Venue.connect} will try in turn. Explicit `http(s)://` inputs are
|
|
@@ -660,7 +711,13 @@ declare class SecretManager {
|
|
|
660
711
|
*/
|
|
661
712
|
declare function venueBaseUrlCandidates(venueId: string): string[];
|
|
662
713
|
declare class Venue implements VenueInterface {
|
|
663
|
-
|
|
714
|
+
private _closed;
|
|
715
|
+
/** Whether this handle has been closed and should not be reused by Grid. */
|
|
716
|
+
get closed(): boolean;
|
|
717
|
+
/**
|
|
718
|
+
* Connection-level private-jobs mode — see {@link setPrivate}.
|
|
719
|
+
* @deprecated Pass `{ private: true }` to `operations.run()` instead.
|
|
720
|
+
*/
|
|
664
721
|
privateJobs: boolean;
|
|
665
722
|
/**
|
|
666
723
|
* Puts this connection in **private-jobs mode**: every subsequent
|
|
@@ -670,7 +727,10 @@ declare class Venue implements VenueInterface {
|
|
|
670
727
|
*
|
|
671
728
|
* Because a completed private job is immediately forgotten, results are
|
|
672
729
|
* collected through the invoke `wait` window rather than polling — so
|
|
673
|
-
|
|
730
|
+
* private mode works with `run()`; a poll-style `invoke()` throws.
|
|
731
|
+
*
|
|
732
|
+
* @deprecated Pass `{ private: true }` to `operations.run()` instead. The
|
|
733
|
+
* per-call option avoids mutable connection-wide execution state.
|
|
674
734
|
*/
|
|
675
735
|
setPrivate(enabled: boolean): void;
|
|
676
736
|
baseUrl: string;
|
|
@@ -693,6 +753,8 @@ declare class Venue implements VenueInterface {
|
|
|
693
753
|
private _workspace?;
|
|
694
754
|
private _ucan?;
|
|
695
755
|
private _secrets?;
|
|
756
|
+
private _skills?;
|
|
757
|
+
private _memory?;
|
|
696
758
|
get adapters(): AdapterManager;
|
|
697
759
|
get agents(): AgentManager;
|
|
698
760
|
get jobs(): JobManager;
|
|
@@ -701,6 +763,8 @@ declare class Venue implements VenueInterface {
|
|
|
701
763
|
get workspace(): WorkspaceManager;
|
|
702
764
|
get ucan(): UCANManager;
|
|
703
765
|
get secrets(): SecretManager;
|
|
766
|
+
get skills(): SkillManager;
|
|
767
|
+
get memory(): MemoryManager;
|
|
704
768
|
constructor(options?: VenueOptions);
|
|
705
769
|
/**
|
|
706
770
|
* Connect to a venue, validating it with `GET {base}/api/v1/status`. If the
|
|
@@ -814,7 +878,6 @@ declare class Venue implements VenueInterface {
|
|
|
814
878
|
* Disposable support — allows `using venue = await Grid.connect(...)` in TS 5.2+.
|
|
815
879
|
*/
|
|
816
880
|
[Symbol.dispose](): void;
|
|
817
|
-
private _buildHeaders;
|
|
818
881
|
}
|
|
819
882
|
|
|
820
883
|
interface VenueOptions {
|
|
@@ -832,6 +895,8 @@ interface VenueConstructor {
|
|
|
832
895
|
}
|
|
833
896
|
interface InvokeOptions {
|
|
834
897
|
ucans?: string[];
|
|
898
|
+
/** Execute this run as a memory-only private job. Only supported by `run()`. */
|
|
899
|
+
private?: boolean;
|
|
835
900
|
}
|
|
836
901
|
/**
|
|
837
902
|
* The venue's operation-execution surface, as the typed managers consume it.
|
|
@@ -1118,6 +1183,37 @@ interface AgentInfoResult {
|
|
|
1118
1183
|
tasks?: number;
|
|
1119
1184
|
error?: string;
|
|
1120
1185
|
}
|
|
1186
|
+
/** Metadata stored on a conversational agent session. Venues may add fields. */
|
|
1187
|
+
interface AgentSessionMetadata {
|
|
1188
|
+
id?: string;
|
|
1189
|
+
parties?: string[];
|
|
1190
|
+
title?: string;
|
|
1191
|
+
status?: string;
|
|
1192
|
+
created?: number;
|
|
1193
|
+
started?: number;
|
|
1194
|
+
lastActivity?: number;
|
|
1195
|
+
turns?: number;
|
|
1196
|
+
turnCount?: number;
|
|
1197
|
+
[key: string]: unknown;
|
|
1198
|
+
}
|
|
1199
|
+
/** A session record read directly from `g/<agentId>/sessions`. */
|
|
1200
|
+
interface AgentSession {
|
|
1201
|
+
id: string;
|
|
1202
|
+
metadata: AgentSessionMetadata;
|
|
1203
|
+
pending: unknown[];
|
|
1204
|
+
frames: unknown[];
|
|
1205
|
+
wakeTime?: number;
|
|
1206
|
+
}
|
|
1207
|
+
interface AgentSessionListOptions {
|
|
1208
|
+
offset?: number;
|
|
1209
|
+
limit?: number;
|
|
1210
|
+
}
|
|
1211
|
+
interface AgentSessionPage {
|
|
1212
|
+
items: AgentSession[];
|
|
1213
|
+
total: number;
|
|
1214
|
+
offset: number;
|
|
1215
|
+
limit: number;
|
|
1216
|
+
}
|
|
1121
1217
|
interface AgentForkInput {
|
|
1122
1218
|
sourceId: string;
|
|
1123
1219
|
agentId: string;
|
|
@@ -1260,6 +1356,18 @@ interface WorkspaceAggregateResult {
|
|
|
1260
1356
|
* Σ(group counts) == count. */
|
|
1261
1357
|
groups?: Record<string, GroupCount>;
|
|
1262
1358
|
}
|
|
1359
|
+
interface MemoryEntry {
|
|
1360
|
+
/** 1-based position used by the venue memory mutation operation. */
|
|
1361
|
+
number: number;
|
|
1362
|
+
text: string;
|
|
1363
|
+
createdAt?: number;
|
|
1364
|
+
updatedAt?: number;
|
|
1365
|
+
}
|
|
1366
|
+
/** Position affected by a memory mutation and the resulting list size. */
|
|
1367
|
+
interface MemoryChange {
|
|
1368
|
+
number: number;
|
|
1369
|
+
count: number;
|
|
1370
|
+
}
|
|
1263
1371
|
interface UCANAttenuation {
|
|
1264
1372
|
with: string;
|
|
1265
1373
|
can: string;
|
|
@@ -1346,6 +1454,15 @@ interface ConnectionAttempt {
|
|
|
1346
1454
|
readonly method: string;
|
|
1347
1455
|
readonly error: CoviaError;
|
|
1348
1456
|
}
|
|
1457
|
+
/**
|
|
1458
|
+
* Raised when a requested read has no job-free transport on the connected
|
|
1459
|
+
* venue. Callers may explicitly invoke the corresponding operation when
|
|
1460
|
+
* creating a persisted job is the intended action.
|
|
1461
|
+
*/
|
|
1462
|
+
declare class UnsupportedVenueFeatureError extends CoviaError {
|
|
1463
|
+
readonly feature: string;
|
|
1464
|
+
constructor(feature: string);
|
|
1465
|
+
}
|
|
1349
1466
|
interface CoviaConnectionErrorOptions {
|
|
1350
1467
|
/** Exact request target for a single transport failure. */
|
|
1351
1468
|
url?: string;
|
|
@@ -1391,7 +1508,6 @@ declare class JobFailedError extends CoviaError {
|
|
|
1391
1508
|
jobData: JobMetadata;
|
|
1392
1509
|
constructor(jobData: JobMetadata);
|
|
1393
1510
|
}
|
|
1394
|
-
/** Raised when a requested resource is not found (404). */
|
|
1395
1511
|
/** HTTP 429 from the venue — a rate limit or concurrent-job cap. Carries the
|
|
1396
1512
|
* server's Retry-After hint (seconds). Thrown only after the SDK's bounded
|
|
1397
1513
|
* automatic retries are exhausted. */
|
|
@@ -1399,6 +1515,7 @@ declare class RateLimitError extends GridError {
|
|
|
1399
1515
|
retryAfterSeconds: number;
|
|
1400
1516
|
constructor(message: string, retryAfterSeconds: number, body?: unknown);
|
|
1401
1517
|
}
|
|
1518
|
+
/** Raised when a requested resource is not found (404). */
|
|
1402
1519
|
declare class NotFoundError extends GridError {
|
|
1403
1520
|
constructor(message: string);
|
|
1404
1521
|
}
|
|
@@ -1412,6 +1529,12 @@ declare class JobNotFoundError extends NotFoundError {
|
|
|
1412
1529
|
jobId: string;
|
|
1413
1530
|
constructor(jobId: string);
|
|
1414
1531
|
}
|
|
1532
|
+
/** Raised when an exact agent-session lookup finds no session. */
|
|
1533
|
+
declare class AgentSessionNotFoundError extends CoviaError {
|
|
1534
|
+
readonly agentId: string;
|
|
1535
|
+
readonly sessionId: string;
|
|
1536
|
+
constructor(agentId: string, sessionId: string);
|
|
1537
|
+
}
|
|
1415
1538
|
|
|
1416
1539
|
/** Parse a Retry-After header (delta-seconds or HTTP-date) to ms from now. */
|
|
1417
1540
|
declare function parseRetryAfterMs(header: string | null, nowMs: number): number;
|
|
@@ -1613,6 +1736,11 @@ declare function generateKeyPair(): {
|
|
|
1613
1736
|
declare function privateKeyToHex(key: Uint8Array): string;
|
|
1614
1737
|
/**
|
|
1615
1738
|
* Convert a hex string back to a private key Uint8Array.
|
|
1739
|
+
*
|
|
1740
|
+
* Strict by design: this is an identity primitive that round-trips through
|
|
1741
|
+
* storage, and lax parsing would turn a corrupted stored key into a
|
|
1742
|
+
* *different valid key* (a new DID) with no error. Accepts exactly 64 hex
|
|
1743
|
+
* chars, with an optional `0x` prefix.
|
|
1616
1744
|
*/
|
|
1617
1745
|
declare function hexToPrivateKey(hex: string): Uint8Array;
|
|
1618
1746
|
|
|
@@ -1697,4 +1825,4 @@ declare function grant(ownerPrivateKey: Uint8Array, audienceDID: string, withRes
|
|
|
1697
1825
|
*/
|
|
1698
1826
|
declare function relayDelegation(privateKey: Uint8Array, venueDID: string, lifetimeSeconds: number, caps?: UCANCapability[]): string;
|
|
1699
1827
|
|
|
1700
|
-
export { type AdapterInfo, AdapterManager, type AdaptersResult, Agent, type AgentCancelTaskInput, type AgentCard, type AgentChatInput, type AgentChatResult, type AgentCompleteTaskResult, type AgentContextInput, type AgentCreateInput, type AgentCreateResult, type AgentDeleteInput, type AgentDeleteResult, type AgentFailTaskResult, type AgentForkInput, type AgentForkResult, type AgentInfoResult, type AgentListInput, type AgentListResult, AgentManager, type AgentMessageInput, type AgentMessageResult, type AgentRenameSessionResult, 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, type AssetMetadataStore, AssetNotFoundError, type AssetPinResult, Auth, BasicAuth, BearerAuth, ChatSession, type ConnectionAttempt, type ContentDetails, type ContentHashResult, CoviaConnectionError, type CoviaConnectionErrorOptions, CoviaError, CoviaTimeoutError, type Credentials, CredentialsHTTP, type DIDDocument, type DIDURL, DataAsset, Ed25519Auth, type FunctionInfo, type FunctionsResult, Grid, GridError, type GroupCount, type InvokeOptions, type InvokePayload, Job, JobFailedError, JobManager, type JobMetadata, JobNotFoundError, JobStatus, KeyPairAuth, type MCPDiscovery, Namespace, NoAuth, NotFoundError, Operation, type OperationDetails, type OperationInfo, OperationManager, type OperationPayload, type OperationRunner, RateLimitError, RunStatus, type SSEEvent, type SecretExtractInput, type SecretExtractResult, SecretManager, type SecretSetInput, type SecretSetResult, type StatsData, type StatusData, type UCANAttenuation, type UCANCapability, type UCANIssueInput, type UCANIssueResult, UCANManager, type UCANVerifyResult, VENUE_RELAY, Venue, type VenueConstructor, type VenueData, VenueIdentityChangedError, type VenueInterface, type VenueOptions, type WorkspaceAggregateResult, type WorkspaceAppendInput, type WorkspaceAppendResult, type WorkspaceCopyResult, type WorkspaceCountResult, type WorkspaceDeleteInput, type WorkspaceDeleteResult, type WorkspaceInspectInput, type WorkspaceInspectResult, type WorkspaceListInput, type WorkspaceListResult, WorkspaceManager, type WorkspaceReadInput, type WorkspaceReadResult, type WorkspaceSliceInput, type WorkspaceSliceResult, type WorkspaceWriteInput, type WorkspaceWriteResult, assetHash, createSSEEvent, createUCANJWT, decodePublicKey, didFor, didFromPublicKey, didMethod, didUrl, encodePublicKey, fetchStreamWithError, fetchWithError, generateKeyPair, getAssetIdFromPath, getAssetIdFromVenueId, getAssetMetadataStore, getParsedAssetId, grant, hexToPrivateKey, identityToken, isDid, isJobComplete, isJobFinished, isJobPaused, logger, parseDidUrl, parseRetryAfterMs, parseSSEStream, privateKeyToHex, relayDelegation, retryDelayMs, setAssetMetadataStore, venueBaseUrlCandidates };
|
|
1828
|
+
export { type AdapterInfo, AdapterManager, type AdaptersResult, Agent, type AgentCancelTaskInput, type AgentCard, type AgentChatInput, type AgentChatResult, type AgentCompleteTaskResult, type AgentContextInput, type AgentCreateInput, type AgentCreateResult, type AgentDeleteInput, type AgentDeleteResult, type AgentFailTaskResult, type AgentForkInput, type AgentForkResult, type AgentInfoResult, type AgentListInput, type AgentListResult, AgentManager, type AgentMessageInput, type AgentMessageResult, type AgentRenameSessionResult, type AgentRequestInput, type AgentRequestResult, type AgentResumeInput, type AgentSession, type AgentSessionListOptions, type AgentSessionMetadata, AgentSessionNotFoundError, type AgentSessionPage, AgentStatus, type AgentSuspendResult, type AgentTriggerInput, type AgentTriggerResult, type AgentUpdateInput, Asset, type AssetID, type AssetList, type AssetListOptions, AssetManager, type AssetMetadata, type AssetMetadataStore, AssetNotFoundError, type AssetPinResult, Auth, BasicAuth, BearerAuth, ChatSession, type ConnectionAttempt, type ContentDetails, type ContentHashResult, CoviaConnectionError, type CoviaConnectionErrorOptions, CoviaError, CoviaTimeoutError, type Credentials, CredentialsHTTP, type DIDDocument, type DIDURL, DataAsset, Ed25519Auth, type FunctionInfo, type FunctionsResult, Grid, GridError, type GroupCount, type InvokeOptions, type InvokePayload, Job, JobFailedError, JobManager, type JobMetadata, JobNotFoundError, JobStatus, KeyPairAuth, type MCPDiscovery, type MemoryChange, type MemoryEntry, MemoryManager, Namespace, NoAuth, NotFoundError, Operation, type OperationDetails, type OperationInfo, OperationManager, type OperationPayload, type OperationRunner, RateLimitError, RunStatus, type SSEEvent, type SecretExtractInput, type SecretExtractResult, SecretManager, type SecretSetInput, type SecretSetResult, type Skill, type SkillFacet, SkillManager, type SkillMetadata, type StatsData, type StatusData, type UCANAttenuation, type UCANCapability, type UCANIssueInput, type UCANIssueResult, UCANManager, type UCANVerifyResult, UnsupportedVenueFeatureError, VENUE_RELAY, Venue, type VenueConstructor, type VenueData, VenueIdentityChangedError, type VenueInterface, type VenueOptions, type WorkspaceAggregateResult, type WorkspaceAppendInput, type WorkspaceAppendResult, type WorkspaceCopyResult, type WorkspaceCountResult, type WorkspaceDeleteInput, type WorkspaceDeleteResult, type WorkspaceInspectInput, type WorkspaceInspectResult, type WorkspaceListInput, type WorkspaceListResult, WorkspaceManager, type WorkspaceReadInput, type WorkspaceReadResult, type WorkspaceSliceInput, type WorkspaceSliceResult, type WorkspaceWriteInput, type WorkspaceWriteResult, assetHash, createSSEEvent, createUCANJWT, decodePublicKey, didFor, didFromPublicKey, didMethod, didUrl, encodePublicKey, fetchStreamWithError, fetchWithError, generateKeyPair, getAssetIdFromPath, getAssetIdFromVenueId, getAssetMetadataStore, getParsedAssetId, grant, hexToPrivateKey, identityToken, isDid, isJobComplete, isJobFinished, isJobPaused, logger, parseDidUrl, parseRetryAfterMs, parseSSEStream, privateKeyToHex, relayDelegation, retryDelayMs, setAssetMetadataStore, venueBaseUrlCandidates };
|