@covia/covia-sdk 1.11.0 → 1.12.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.mts CHANGED
@@ -735,6 +735,35 @@ declare class MemoryManager {
735
735
  forget(number: number, path?: string): Promise<MemoryChange>;
736
736
  }
737
737
 
738
+ interface DLFSManagerVenue extends VenueRequestContext {
739
+ lastKnownStatus?: StatusData;
740
+ }
741
+ declare class DLFSManager {
742
+ private venue;
743
+ private dlfsSupported;
744
+ constructor(venue: DLFSManagerVenue);
745
+ /** A job-free DLFS metadata GET that rejects when the endpoint is unavailable. */
746
+ private dlfsGet;
747
+ /**
748
+ * List the caller's DLFS drives, vault included. **Job-free** on covia
749
+ * venues serving `GET /api/v1/dlfs/drives` (covia#253).
750
+ */
751
+ listDrives(): Promise<DLFSDrivesResult>;
752
+ /**
753
+ * List one directory of a drive. **Job-free** on covia venues serving
754
+ * `GET /api/v1/dlfs/list` (covia#253). Own drives by bare name only —
755
+ * cross-user DID-URL drive addressing isn't supported by this manager.
756
+ */
757
+ list(drive: string, path?: string): Promise<DLFSListResult>;
758
+ /**
759
+ * Job-free file content — `GET /api/v1/content/dlfs/<drive>/<path>`, the
760
+ * same route the venue's generic asset-content resolver already serves
761
+ * (DLFSAdapter implements ContentProvider). Real streamed bytes with a
762
+ * correct Content-Type, not the JSON/base64 shape `dlfs:read` returns.
763
+ */
764
+ getContent(drive: string, path: string): Promise<ReadableStream<Uint8Array>>;
765
+ }
766
+
738
767
  /**
739
768
  * Resolve a non-DID venue id into the ordered list of base URLs that
740
769
  * {@link Venue.connect} will try in turn. Explicit `http(s)://` inputs are
@@ -789,6 +818,7 @@ declare class Venue implements VenueInterface {
789
818
  private _secrets?;
790
819
  private _skills?;
791
820
  private _memory?;
821
+ private _dlfs?;
792
822
  get adapters(): AdapterManager;
793
823
  get agents(): AgentManager;
794
824
  get jobs(): JobManager;
@@ -799,6 +829,7 @@ declare class Venue implements VenueInterface {
799
829
  get secrets(): SecretManager;
800
830
  get skills(): SkillManager;
801
831
  get memory(): MemoryManager;
832
+ get dlfs(): DLFSManager;
802
833
  constructor(options?: VenueOptions);
803
834
  /**
804
835
  * Connect to a venue, validating it with `GET {base}/api/v1/status`. If the
@@ -1483,6 +1514,19 @@ interface SecretExtractResult {
1483
1514
  name: string;
1484
1515
  value: string;
1485
1516
  }
1517
+ interface DLFSEntry {
1518
+ name: string;
1519
+ type: "file" | "directory";
1520
+ size?: number;
1521
+ modified?: string;
1522
+ }
1523
+ interface DLFSDrivesResult {
1524
+ drives: string[];
1525
+ }
1526
+ interface DLFSListResult {
1527
+ entries: DLFSEntry[];
1528
+ warnings?: string[];
1529
+ }
1486
1530
  interface FunctionInfo {
1487
1531
  name: string;
1488
1532
  id: string;
@@ -1890,4 +1934,4 @@ declare function grant(ownerPrivateKey: Uint8Array, audienceDID: string, withRes
1890
1934
  */
1891
1935
  declare function relayDelegation(privateKey: Uint8Array, venueDID: string, lifetimeSeconds: number, caps?: UCANCapability[]): string;
1892
1936
 
1893
- 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 AssetListItem, type AssetListOptions, AssetManager, type AssetMetadata, type AssetMetadataStore, AssetNotFoundError, type AssetPinResult, type AssetSummary, 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 ExpandedAssetList, 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, type MyAssetList, 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 };
1937
+ 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 AssetListItem, type AssetListOptions, AssetManager, type AssetMetadata, type AssetMetadataStore, AssetNotFoundError, type AssetPinResult, type AssetSummary, Auth, BasicAuth, BearerAuth, ChatSession, type ConnectionAttempt, type ContentDetails, type ContentHashResult, CoviaConnectionError, type CoviaConnectionErrorOptions, CoviaError, CoviaTimeoutError, type Credentials, CredentialsHTTP, type DIDDocument, type DIDURL, type DLFSDrivesResult, type DLFSEntry, type DLFSListResult, DLFSManager, DataAsset, Ed25519Auth, type ExpandedAssetList, 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, type MyAssetList, 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 };
package/dist/index.d.ts CHANGED
@@ -735,6 +735,35 @@ declare class MemoryManager {
735
735
  forget(number: number, path?: string): Promise<MemoryChange>;
736
736
  }
737
737
 
738
+ interface DLFSManagerVenue extends VenueRequestContext {
739
+ lastKnownStatus?: StatusData;
740
+ }
741
+ declare class DLFSManager {
742
+ private venue;
743
+ private dlfsSupported;
744
+ constructor(venue: DLFSManagerVenue);
745
+ /** A job-free DLFS metadata GET that rejects when the endpoint is unavailable. */
746
+ private dlfsGet;
747
+ /**
748
+ * List the caller's DLFS drives, vault included. **Job-free** on covia
749
+ * venues serving `GET /api/v1/dlfs/drives` (covia#253).
750
+ */
751
+ listDrives(): Promise<DLFSDrivesResult>;
752
+ /**
753
+ * List one directory of a drive. **Job-free** on covia venues serving
754
+ * `GET /api/v1/dlfs/list` (covia#253). Own drives by bare name only —
755
+ * cross-user DID-URL drive addressing isn't supported by this manager.
756
+ */
757
+ list(drive: string, path?: string): Promise<DLFSListResult>;
758
+ /**
759
+ * Job-free file content — `GET /api/v1/content/dlfs/<drive>/<path>`, the
760
+ * same route the venue's generic asset-content resolver already serves
761
+ * (DLFSAdapter implements ContentProvider). Real streamed bytes with a
762
+ * correct Content-Type, not the JSON/base64 shape `dlfs:read` returns.
763
+ */
764
+ getContent(drive: string, path: string): Promise<ReadableStream<Uint8Array>>;
765
+ }
766
+
738
767
  /**
739
768
  * Resolve a non-DID venue id into the ordered list of base URLs that
740
769
  * {@link Venue.connect} will try in turn. Explicit `http(s)://` inputs are
@@ -789,6 +818,7 @@ declare class Venue implements VenueInterface {
789
818
  private _secrets?;
790
819
  private _skills?;
791
820
  private _memory?;
821
+ private _dlfs?;
792
822
  get adapters(): AdapterManager;
793
823
  get agents(): AgentManager;
794
824
  get jobs(): JobManager;
@@ -799,6 +829,7 @@ declare class Venue implements VenueInterface {
799
829
  get secrets(): SecretManager;
800
830
  get skills(): SkillManager;
801
831
  get memory(): MemoryManager;
832
+ get dlfs(): DLFSManager;
802
833
  constructor(options?: VenueOptions);
803
834
  /**
804
835
  * Connect to a venue, validating it with `GET {base}/api/v1/status`. If the
@@ -1483,6 +1514,19 @@ interface SecretExtractResult {
1483
1514
  name: string;
1484
1515
  value: string;
1485
1516
  }
1517
+ interface DLFSEntry {
1518
+ name: string;
1519
+ type: "file" | "directory";
1520
+ size?: number;
1521
+ modified?: string;
1522
+ }
1523
+ interface DLFSDrivesResult {
1524
+ drives: string[];
1525
+ }
1526
+ interface DLFSListResult {
1527
+ entries: DLFSEntry[];
1528
+ warnings?: string[];
1529
+ }
1486
1530
  interface FunctionInfo {
1487
1531
  name: string;
1488
1532
  id: string;
@@ -1890,4 +1934,4 @@ declare function grant(ownerPrivateKey: Uint8Array, audienceDID: string, withRes
1890
1934
  */
1891
1935
  declare function relayDelegation(privateKey: Uint8Array, venueDID: string, lifetimeSeconds: number, caps?: UCANCapability[]): string;
1892
1936
 
1893
- 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 AssetListItem, type AssetListOptions, AssetManager, type AssetMetadata, type AssetMetadataStore, AssetNotFoundError, type AssetPinResult, type AssetSummary, 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 ExpandedAssetList, 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, type MyAssetList, 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 };
1937
+ 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 AssetListItem, type AssetListOptions, AssetManager, type AssetMetadata, type AssetMetadataStore, AssetNotFoundError, type AssetPinResult, type AssetSummary, Auth, BasicAuth, BearerAuth, ChatSession, type ConnectionAttempt, type ContentDetails, type ContentHashResult, CoviaConnectionError, type CoviaConnectionErrorOptions, CoviaError, CoviaTimeoutError, type Credentials, CredentialsHTTP, type DIDDocument, type DIDURL, type DLFSDrivesResult, type DLFSEntry, type DLFSListResult, DLFSManager, DataAsset, Ed25519Auth, type ExpandedAssetList, 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, type MyAssetList, 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 };
package/dist/index.js CHANGED
@@ -2798,6 +2798,59 @@ var MemoryManager = class {
2798
2798
  }
2799
2799
  };
2800
2800
 
2801
+ // src/DLFSManager.ts
2802
+ var DLFSManager = class {
2803
+ constructor(venue) {
2804
+ this.venue = venue;
2805
+ // Whether this venue serves GET /api/v1/dlfs/* — flipped on a route-missing
2806
+ // 404 so a pre-#253 venue pays the probe once, not one failed GET per read.
2807
+ this.dlfsSupported = true;
2808
+ }
2809
+ /** A job-free DLFS metadata GET that rejects when the endpoint is unavailable. */
2810
+ async dlfsGet(path) {
2811
+ if (!this.dlfsSupported) throw new UnsupportedVenueFeatureError("venue DLFS browsing");
2812
+ try {
2813
+ return await venueJson(this.venue, `/api/v1/dlfs${path}`);
2814
+ } catch (e) {
2815
+ if (!(e instanceof NotFoundError)) throw e;
2816
+ if (!ROUTE_MISSING_404.test(e.message)) throw e;
2817
+ this.dlfsSupported = false;
2818
+ throw new UnsupportedVenueFeatureError("venue DLFS browsing");
2819
+ }
2820
+ }
2821
+ /**
2822
+ * List the caller's DLFS drives, vault included. **Job-free** on covia
2823
+ * venues serving `GET /api/v1/dlfs/drives` (covia#253).
2824
+ */
2825
+ async listDrives() {
2826
+ return this.dlfsGet("/drives");
2827
+ }
2828
+ /**
2829
+ * List one directory of a drive. **Job-free** on covia venues serving
2830
+ * `GET /api/v1/dlfs/list` (covia#253). Own drives by bare name only —
2831
+ * cross-user DID-URL drive addressing isn't supported by this manager.
2832
+ */
2833
+ async list(drive, path) {
2834
+ const qs = new URLSearchParams({ drive, ...path ? { path } : {} });
2835
+ return this.dlfsGet(`/list?${qs}`);
2836
+ }
2837
+ /**
2838
+ * Job-free file content — `GET /api/v1/content/dlfs/<drive>/<path>`, the
2839
+ * same route the venue's generic asset-content resolver already serves
2840
+ * (DLFSAdapter implements ContentProvider). Real streamed bytes with a
2841
+ * correct Content-Type, not the JSON/base64 shape `dlfs:read` returns.
2842
+ */
2843
+ async getContent(drive, path) {
2844
+ const segments = path.split("/").filter(Boolean).map(encodeURIComponent).join("/");
2845
+ const response = await venueStream(
2846
+ this.venue,
2847
+ `/api/v1/content/dlfs/${encodeURIComponent(drive)}/${segments}`
2848
+ );
2849
+ if (!response.body) throw new Error("Empty response body for DLFS content read");
2850
+ return response.body;
2851
+ }
2852
+ };
2853
+
2801
2854
  // src/Agent.ts
2802
2855
  var Agent = class _Agent {
2803
2856
  constructor(id, venue) {
@@ -2996,6 +3049,9 @@ var Venue = class _Venue {
2996
3049
  get memory() {
2997
3050
  return this._memory ?? (this._memory = new MemoryManager(this));
2998
3051
  }
3052
+ get dlfs() {
3053
+ return this._dlfs ?? (this._dlfs = new DLFSManager(this));
3054
+ }
2999
3055
  /**
3000
3056
  * Connect to a venue, validating it with `GET {base}/api/v1/status`. If the
3001
3057
  * venue is auth-gated (status answers 401/403 — public access disabled), the
@@ -3343,6 +3399,7 @@ exports.CoviaConnectionError = CoviaConnectionError;
3343
3399
  exports.CoviaError = CoviaError;
3344
3400
  exports.CoviaTimeoutError = CoviaTimeoutError;
3345
3401
  exports.CredentialsHTTP = CredentialsHTTP;
3402
+ exports.DLFSManager = DLFSManager;
3346
3403
  exports.DataAsset = DataAsset;
3347
3404
  exports.Ed25519Auth = Ed25519Auth;
3348
3405
  exports.Grid = Grid;
package/dist/index.mjs CHANGED
@@ -2796,6 +2796,59 @@ var MemoryManager = class {
2796
2796
  }
2797
2797
  };
2798
2798
 
2799
+ // src/DLFSManager.ts
2800
+ var DLFSManager = class {
2801
+ constructor(venue) {
2802
+ this.venue = venue;
2803
+ // Whether this venue serves GET /api/v1/dlfs/* — flipped on a route-missing
2804
+ // 404 so a pre-#253 venue pays the probe once, not one failed GET per read.
2805
+ this.dlfsSupported = true;
2806
+ }
2807
+ /** A job-free DLFS metadata GET that rejects when the endpoint is unavailable. */
2808
+ async dlfsGet(path) {
2809
+ if (!this.dlfsSupported) throw new UnsupportedVenueFeatureError("venue DLFS browsing");
2810
+ try {
2811
+ return await venueJson(this.venue, `/api/v1/dlfs${path}`);
2812
+ } catch (e) {
2813
+ if (!(e instanceof NotFoundError)) throw e;
2814
+ if (!ROUTE_MISSING_404.test(e.message)) throw e;
2815
+ this.dlfsSupported = false;
2816
+ throw new UnsupportedVenueFeatureError("venue DLFS browsing");
2817
+ }
2818
+ }
2819
+ /**
2820
+ * List the caller's DLFS drives, vault included. **Job-free** on covia
2821
+ * venues serving `GET /api/v1/dlfs/drives` (covia#253).
2822
+ */
2823
+ async listDrives() {
2824
+ return this.dlfsGet("/drives");
2825
+ }
2826
+ /**
2827
+ * List one directory of a drive. **Job-free** on covia venues serving
2828
+ * `GET /api/v1/dlfs/list` (covia#253). Own drives by bare name only —
2829
+ * cross-user DID-URL drive addressing isn't supported by this manager.
2830
+ */
2831
+ async list(drive, path) {
2832
+ const qs = new URLSearchParams({ drive, ...path ? { path } : {} });
2833
+ return this.dlfsGet(`/list?${qs}`);
2834
+ }
2835
+ /**
2836
+ * Job-free file content — `GET /api/v1/content/dlfs/<drive>/<path>`, the
2837
+ * same route the venue's generic asset-content resolver already serves
2838
+ * (DLFSAdapter implements ContentProvider). Real streamed bytes with a
2839
+ * correct Content-Type, not the JSON/base64 shape `dlfs:read` returns.
2840
+ */
2841
+ async getContent(drive, path) {
2842
+ const segments = path.split("/").filter(Boolean).map(encodeURIComponent).join("/");
2843
+ const response = await venueStream(
2844
+ this.venue,
2845
+ `/api/v1/content/dlfs/${encodeURIComponent(drive)}/${segments}`
2846
+ );
2847
+ if (!response.body) throw new Error("Empty response body for DLFS content read");
2848
+ return response.body;
2849
+ }
2850
+ };
2851
+
2799
2852
  // src/Agent.ts
2800
2853
  var Agent = class _Agent {
2801
2854
  constructor(id, venue) {
@@ -2994,6 +3047,9 @@ var Venue = class _Venue {
2994
3047
  get memory() {
2995
3048
  return this._memory ?? (this._memory = new MemoryManager(this));
2996
3049
  }
3050
+ get dlfs() {
3051
+ return this._dlfs ?? (this._dlfs = new DLFSManager(this));
3052
+ }
2997
3053
  /**
2998
3054
  * Connect to a venue, validating it with `GET {base}/api/v1/status`. If the
2999
3055
  * venue is auth-gated (status answers 401/403 — public access disabled), the
@@ -3325,4 +3381,4 @@ function relayDelegation(privateKey, venueDID, lifetimeSeconds, caps = []) {
3325
3381
  (*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) *)
3326
3382
  */
3327
3383
 
3328
- export { AdapterManager, Agent, AgentManager, AgentSessionNotFoundError, AgentStatus, Asset, AssetManager, AssetNotFoundError, Auth, BasicAuth, BearerAuth, ChatSession, CoviaConnectionError, CoviaError, CoviaTimeoutError, CredentialsHTTP, DataAsset, Ed25519Auth, Grid, GridError, Job, JobFailedError, JobManager, JobNotFoundError, JobStatus, KeyPairAuth, MemoryManager, Namespace, NoAuth, NotFoundError, Operation, OperationManager, RateLimitError, RunStatus, SecretManager, SkillManager, UCANManager, UnsupportedVenueFeatureError, VENUE_RELAY, Venue, VenueIdentityChangedError, WorkspaceManager, 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 };
3384
+ export { AdapterManager, Agent, AgentManager, AgentSessionNotFoundError, AgentStatus, Asset, AssetManager, AssetNotFoundError, Auth, BasicAuth, BearerAuth, ChatSession, CoviaConnectionError, CoviaError, CoviaTimeoutError, CredentialsHTTP, DLFSManager, DataAsset, Ed25519Auth, Grid, GridError, Job, JobFailedError, JobManager, JobNotFoundError, JobStatus, KeyPairAuth, MemoryManager, Namespace, NoAuth, NotFoundError, Operation, OperationManager, RateLimitError, RunStatus, SecretManager, SkillManager, UCANManager, UnsupportedVenueFeatureError, VENUE_RELAY, Venue, VenueIdentityChangedError, WorkspaceManager, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@covia/covia-sdk",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Typescript library for covia-ai",
5
5
  "packageManager": "pnpm@11.9.0",
6
6
  "main": "./dist/index.js",