@covia/covia-sdk 1.12.0 → 1.13.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
@@ -764,6 +764,45 @@ declare class DLFSManager {
764
764
  getContent(drive: string, path: string): Promise<ReadableStream<Uint8Array>>;
765
765
  }
766
766
 
767
+ interface UserManagerVenue extends VenueRequestContext {
768
+ operations: OperationRunner;
769
+ lastKnownStatus?: StatusData;
770
+ }
771
+ declare class UserManager {
772
+ private venue;
773
+ private usersSupported;
774
+ constructor(venue: UserManagerVenue);
775
+ /** A job-free users GET that rejects when the endpoint is unavailable. */
776
+ private usersGet;
777
+ /**
778
+ * List registered venue users. **Job-free** on covia venues serving
779
+ * `GET /api/v1/users` (covia#255) — synchronous, no Job persisted.
780
+ * Operator-only: throws a `GridError` with `statusCode` 403 for a
781
+ * signed-in caller that is not the venue itself and holds no venue-issued
782
+ * delegation over `<venueDID>/users` — that is an expected, common
783
+ * outcome to branch on, not a bug.
784
+ */
785
+ list(): Promise<UserListResult>;
786
+ /**
787
+ * Get one registered user. The caller's own DID needs no operator
788
+ * authority; any other DID does (403 otherwise).
789
+ */
790
+ info(did: string): Promise<UserInfo>;
791
+ /**
792
+ * List a venue-managed user's authenticators, active and revoked
793
+ * tombstones alike — revocation is a status transition in place, never a
794
+ * deletion. The caller's own DID needs no operator authority; any other
795
+ * DID does (403 otherwise).
796
+ */
797
+ listAuthenticators(did: string): Promise<AuthenticationKeysResult>;
798
+ /**
799
+ * Revoke one of a venue-managed user's authenticators. A mutation, so —
800
+ * unlike the reads above — this goes through `operations.run` and mints a
801
+ * Job, matching every other write in this SDK (e.g. `SecretManager.set`).
802
+ */
803
+ revokeAuthenticator(key: string, did?: string, ucans?: string[]): Promise<AuthenticatorRevokeResult>;
804
+ }
805
+
767
806
  /**
768
807
  * Resolve a non-DID venue id into the ordered list of base URLs that
769
808
  * {@link Venue.connect} will try in turn. Explicit `http(s)://` inputs are
@@ -819,6 +858,7 @@ declare class Venue implements VenueInterface {
819
858
  private _skills?;
820
859
  private _memory?;
821
860
  private _dlfs?;
861
+ private _users?;
822
862
  get adapters(): AdapterManager;
823
863
  get agents(): AgentManager;
824
864
  get jobs(): JobManager;
@@ -830,6 +870,7 @@ declare class Venue implements VenueInterface {
830
870
  get skills(): SkillManager;
831
871
  get memory(): MemoryManager;
832
872
  get dlfs(): DLFSManager;
873
+ get users(): UserManager;
833
874
  constructor(options?: VenueOptions);
834
875
  /**
835
876
  * Connect to a venue, validating it with `GET {base}/api/v1/status`. If the
@@ -1074,6 +1115,12 @@ interface StatusData {
1074
1115
  /** Venue platform version (e.g. "0.3.0"). Absent on venues before 0.3. */
1075
1116
  version?: string;
1076
1117
  stats?: StatsData;
1118
+ /** Curated admission-policy fields (#255) — safe to state to any caller.
1119
+ * Absent on venues before this shipped; treat as unknown, not false. */
1120
+ access?: {
1121
+ public: boolean;
1122
+ userAutoCreate: boolean;
1123
+ };
1077
1124
  }
1078
1125
  interface StatsData {
1079
1126
  assets?: number;
@@ -1527,6 +1574,50 @@ interface DLFSListResult {
1527
1574
  entries: DLFSEntry[];
1528
1575
  warnings?: string[];
1529
1576
  }
1577
+ interface UserSummary {
1578
+ did: string;
1579
+ registered: boolean;
1580
+ /** True for a venue-managed named account (a did:web identity minted from
1581
+ * a username); false/absent for a plain registered DID. */
1582
+ managed?: boolean;
1583
+ meta?: Record<string, unknown>;
1584
+ }
1585
+ interface UserListResult {
1586
+ users: UserSummary[];
1587
+ total: number;
1588
+ }
1589
+ interface UserInfo {
1590
+ did: string;
1591
+ registered: boolean;
1592
+ managed?: boolean;
1593
+ meta?: Record<string, unknown>;
1594
+ }
1595
+ /** One authenticator's lifecycle record. Revocation is a status transition
1596
+ * in place — a revoked entry is retained forever, never deleted, so the
1597
+ * key's full add/revoke history stays visible as an audit tombstone. */
1598
+ interface AuthenticationKeyEntry {
1599
+ status: "active" | "revoked";
1600
+ /** Epoch millis. */
1601
+ addedAt: number;
1602
+ /** Actor DID that added this key. */
1603
+ addedBy: string;
1604
+ label?: string;
1605
+ /** Epoch millis, present only once status is "revoked". */
1606
+ revokedAt?: number;
1607
+ /** Actor DID that revoked this key, present only once status is "revoked". */
1608
+ revokedBy?: string;
1609
+ }
1610
+ /** Keyed by the authenticator's own `did:key:...` string. */
1611
+ type AuthenticationKeysMap = Record<string, AuthenticationKeyEntry>;
1612
+ interface AuthenticationKeysResult {
1613
+ did: string;
1614
+ authenticationKeys: AuthenticationKeysMap;
1615
+ }
1616
+ interface AuthenticatorRevokeResult {
1617
+ did: string;
1618
+ key: string;
1619
+ revoked: boolean;
1620
+ }
1530
1621
  interface FunctionInfo {
1531
1622
  name: string;
1532
1623
  id: string;
@@ -1934,4 +2025,4 @@ declare function grant(ownerPrivateKey: Uint8Array, audienceDID: string, withRes
1934
2025
  */
1935
2026
  declare function relayDelegation(privateKey: Uint8Array, venueDID: string, lifetimeSeconds: number, caps?: UCANCapability[]): string;
1936
2027
 
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 };
2028
+ 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, type AuthenticationKeyEntry, type AuthenticationKeysMap, type AuthenticationKeysResult, type AuthenticatorRevokeResult, 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, type UserInfo, type UserListResult, UserManager, type UserSummary, 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
@@ -764,6 +764,45 @@ declare class DLFSManager {
764
764
  getContent(drive: string, path: string): Promise<ReadableStream<Uint8Array>>;
765
765
  }
766
766
 
767
+ interface UserManagerVenue extends VenueRequestContext {
768
+ operations: OperationRunner;
769
+ lastKnownStatus?: StatusData;
770
+ }
771
+ declare class UserManager {
772
+ private venue;
773
+ private usersSupported;
774
+ constructor(venue: UserManagerVenue);
775
+ /** A job-free users GET that rejects when the endpoint is unavailable. */
776
+ private usersGet;
777
+ /**
778
+ * List registered venue users. **Job-free** on covia venues serving
779
+ * `GET /api/v1/users` (covia#255) — synchronous, no Job persisted.
780
+ * Operator-only: throws a `GridError` with `statusCode` 403 for a
781
+ * signed-in caller that is not the venue itself and holds no venue-issued
782
+ * delegation over `<venueDID>/users` — that is an expected, common
783
+ * outcome to branch on, not a bug.
784
+ */
785
+ list(): Promise<UserListResult>;
786
+ /**
787
+ * Get one registered user. The caller's own DID needs no operator
788
+ * authority; any other DID does (403 otherwise).
789
+ */
790
+ info(did: string): Promise<UserInfo>;
791
+ /**
792
+ * List a venue-managed user's authenticators, active and revoked
793
+ * tombstones alike — revocation is a status transition in place, never a
794
+ * deletion. The caller's own DID needs no operator authority; any other
795
+ * DID does (403 otherwise).
796
+ */
797
+ listAuthenticators(did: string): Promise<AuthenticationKeysResult>;
798
+ /**
799
+ * Revoke one of a venue-managed user's authenticators. A mutation, so —
800
+ * unlike the reads above — this goes through `operations.run` and mints a
801
+ * Job, matching every other write in this SDK (e.g. `SecretManager.set`).
802
+ */
803
+ revokeAuthenticator(key: string, did?: string, ucans?: string[]): Promise<AuthenticatorRevokeResult>;
804
+ }
805
+
767
806
  /**
768
807
  * Resolve a non-DID venue id into the ordered list of base URLs that
769
808
  * {@link Venue.connect} will try in turn. Explicit `http(s)://` inputs are
@@ -819,6 +858,7 @@ declare class Venue implements VenueInterface {
819
858
  private _skills?;
820
859
  private _memory?;
821
860
  private _dlfs?;
861
+ private _users?;
822
862
  get adapters(): AdapterManager;
823
863
  get agents(): AgentManager;
824
864
  get jobs(): JobManager;
@@ -830,6 +870,7 @@ declare class Venue implements VenueInterface {
830
870
  get skills(): SkillManager;
831
871
  get memory(): MemoryManager;
832
872
  get dlfs(): DLFSManager;
873
+ get users(): UserManager;
833
874
  constructor(options?: VenueOptions);
834
875
  /**
835
876
  * Connect to a venue, validating it with `GET {base}/api/v1/status`. If the
@@ -1074,6 +1115,12 @@ interface StatusData {
1074
1115
  /** Venue platform version (e.g. "0.3.0"). Absent on venues before 0.3. */
1075
1116
  version?: string;
1076
1117
  stats?: StatsData;
1118
+ /** Curated admission-policy fields (#255) — safe to state to any caller.
1119
+ * Absent on venues before this shipped; treat as unknown, not false. */
1120
+ access?: {
1121
+ public: boolean;
1122
+ userAutoCreate: boolean;
1123
+ };
1077
1124
  }
1078
1125
  interface StatsData {
1079
1126
  assets?: number;
@@ -1527,6 +1574,50 @@ interface DLFSListResult {
1527
1574
  entries: DLFSEntry[];
1528
1575
  warnings?: string[];
1529
1576
  }
1577
+ interface UserSummary {
1578
+ did: string;
1579
+ registered: boolean;
1580
+ /** True for a venue-managed named account (a did:web identity minted from
1581
+ * a username); false/absent for a plain registered DID. */
1582
+ managed?: boolean;
1583
+ meta?: Record<string, unknown>;
1584
+ }
1585
+ interface UserListResult {
1586
+ users: UserSummary[];
1587
+ total: number;
1588
+ }
1589
+ interface UserInfo {
1590
+ did: string;
1591
+ registered: boolean;
1592
+ managed?: boolean;
1593
+ meta?: Record<string, unknown>;
1594
+ }
1595
+ /** One authenticator's lifecycle record. Revocation is a status transition
1596
+ * in place — a revoked entry is retained forever, never deleted, so the
1597
+ * key's full add/revoke history stays visible as an audit tombstone. */
1598
+ interface AuthenticationKeyEntry {
1599
+ status: "active" | "revoked";
1600
+ /** Epoch millis. */
1601
+ addedAt: number;
1602
+ /** Actor DID that added this key. */
1603
+ addedBy: string;
1604
+ label?: string;
1605
+ /** Epoch millis, present only once status is "revoked". */
1606
+ revokedAt?: number;
1607
+ /** Actor DID that revoked this key, present only once status is "revoked". */
1608
+ revokedBy?: string;
1609
+ }
1610
+ /** Keyed by the authenticator's own `did:key:...` string. */
1611
+ type AuthenticationKeysMap = Record<string, AuthenticationKeyEntry>;
1612
+ interface AuthenticationKeysResult {
1613
+ did: string;
1614
+ authenticationKeys: AuthenticationKeysMap;
1615
+ }
1616
+ interface AuthenticatorRevokeResult {
1617
+ did: string;
1618
+ key: string;
1619
+ revoked: boolean;
1620
+ }
1530
1621
  interface FunctionInfo {
1531
1622
  name: string;
1532
1623
  id: string;
@@ -1934,4 +2025,4 @@ declare function grant(ownerPrivateKey: Uint8Array, audienceDID: string, withRes
1934
2025
  */
1935
2026
  declare function relayDelegation(privateKey: Uint8Array, venueDID: string, lifetimeSeconds: number, caps?: UCANCapability[]): string;
1936
2027
 
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 };
2028
+ 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, type AuthenticationKeyEntry, type AuthenticationKeysMap, type AuthenticationKeysResult, type AuthenticatorRevokeResult, 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, type UserInfo, type UserListResult, UserManager, type UserSummary, 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
@@ -2851,6 +2851,68 @@ var DLFSManager = class {
2851
2851
  }
2852
2852
  };
2853
2853
 
2854
+ // src/UserManager.ts
2855
+ var UserManager = class {
2856
+ constructor(venue) {
2857
+ this.venue = venue;
2858
+ // Whether this venue serves GET /api/v1/users — flipped on a route-missing
2859
+ // 404 so a pre-#255 venue pays the probe once, not one failed GET per read.
2860
+ this.usersSupported = true;
2861
+ }
2862
+ /** A job-free users GET that rejects when the endpoint is unavailable. */
2863
+ async usersGet(path) {
2864
+ if (!this.usersSupported) throw new UnsupportedVenueFeatureError("venue users");
2865
+ try {
2866
+ return await venueJson(this.venue, `/api/v1/users${path}`);
2867
+ } catch (e) {
2868
+ if (!(e instanceof NotFoundError)) throw e;
2869
+ const routeMissing = path === "" || ROUTE_MISSING_404.test(e.message);
2870
+ if (!routeMissing) throw e;
2871
+ this.usersSupported = false;
2872
+ throw new UnsupportedVenueFeatureError("venue users");
2873
+ }
2874
+ }
2875
+ /**
2876
+ * List registered venue users. **Job-free** on covia venues serving
2877
+ * `GET /api/v1/users` (covia#255) — synchronous, no Job persisted.
2878
+ * Operator-only: throws a `GridError` with `statusCode` 403 for a
2879
+ * signed-in caller that is not the venue itself and holds no venue-issued
2880
+ * delegation over `<venueDID>/users` — that is an expected, common
2881
+ * outcome to branch on, not a bug.
2882
+ */
2883
+ async list() {
2884
+ return this.usersGet("");
2885
+ }
2886
+ /**
2887
+ * Get one registered user. The caller's own DID needs no operator
2888
+ * authority; any other DID does (403 otherwise).
2889
+ */
2890
+ async info(did) {
2891
+ return this.usersGet(`/${encodeURIComponent(did)}`);
2892
+ }
2893
+ /**
2894
+ * List a venue-managed user's authenticators, active and revoked
2895
+ * tombstones alike — revocation is a status transition in place, never a
2896
+ * deletion. The caller's own DID needs no operator authority; any other
2897
+ * DID does (403 otherwise).
2898
+ */
2899
+ async listAuthenticators(did) {
2900
+ return this.usersGet(`/${encodeURIComponent(did)}/authentications`);
2901
+ }
2902
+ /**
2903
+ * Revoke one of a venue-managed user's authenticators. A mutation, so —
2904
+ * unlike the reads above — this goes through `operations.run` and mints a
2905
+ * Job, matching every other write in this SDK (e.g. `SecretManager.set`).
2906
+ */
2907
+ async revokeAuthenticator(key, did, ucans) {
2908
+ return this.venue.operations.run(
2909
+ "v/ops/user/authentication-revoke",
2910
+ { did, key },
2911
+ { ucans }
2912
+ );
2913
+ }
2914
+ };
2915
+
2854
2916
  // src/Agent.ts
2855
2917
  var Agent = class _Agent {
2856
2918
  constructor(id, venue) {
@@ -3052,6 +3114,9 @@ var Venue = class _Venue {
3052
3114
  get dlfs() {
3053
3115
  return this._dlfs ?? (this._dlfs = new DLFSManager(this));
3054
3116
  }
3117
+ get users() {
3118
+ return this._users ?? (this._users = new UserManager(this));
3119
+ }
3055
3120
  /**
3056
3121
  * Connect to a venue, validating it with `GET {base}/api/v1/status`. If the
3057
3122
  * venue is auth-gated (status answers 401/403 — public access disabled), the
@@ -3422,6 +3487,7 @@ exports.SecretManager = SecretManager;
3422
3487
  exports.SkillManager = SkillManager;
3423
3488
  exports.UCANManager = UCANManager;
3424
3489
  exports.UnsupportedVenueFeatureError = UnsupportedVenueFeatureError;
3490
+ exports.UserManager = UserManager;
3425
3491
  exports.VENUE_RELAY = VENUE_RELAY;
3426
3492
  exports.Venue = Venue;
3427
3493
  exports.VenueIdentityChangedError = VenueIdentityChangedError;
package/dist/index.mjs CHANGED
@@ -2849,6 +2849,68 @@ var DLFSManager = class {
2849
2849
  }
2850
2850
  };
2851
2851
 
2852
+ // src/UserManager.ts
2853
+ var UserManager = class {
2854
+ constructor(venue) {
2855
+ this.venue = venue;
2856
+ // Whether this venue serves GET /api/v1/users — flipped on a route-missing
2857
+ // 404 so a pre-#255 venue pays the probe once, not one failed GET per read.
2858
+ this.usersSupported = true;
2859
+ }
2860
+ /** A job-free users GET that rejects when the endpoint is unavailable. */
2861
+ async usersGet(path) {
2862
+ if (!this.usersSupported) throw new UnsupportedVenueFeatureError("venue users");
2863
+ try {
2864
+ return await venueJson(this.venue, `/api/v1/users${path}`);
2865
+ } catch (e) {
2866
+ if (!(e instanceof NotFoundError)) throw e;
2867
+ const routeMissing = path === "" || ROUTE_MISSING_404.test(e.message);
2868
+ if (!routeMissing) throw e;
2869
+ this.usersSupported = false;
2870
+ throw new UnsupportedVenueFeatureError("venue users");
2871
+ }
2872
+ }
2873
+ /**
2874
+ * List registered venue users. **Job-free** on covia venues serving
2875
+ * `GET /api/v1/users` (covia#255) — synchronous, no Job persisted.
2876
+ * Operator-only: throws a `GridError` with `statusCode` 403 for a
2877
+ * signed-in caller that is not the venue itself and holds no venue-issued
2878
+ * delegation over `<venueDID>/users` — that is an expected, common
2879
+ * outcome to branch on, not a bug.
2880
+ */
2881
+ async list() {
2882
+ return this.usersGet("");
2883
+ }
2884
+ /**
2885
+ * Get one registered user. The caller's own DID needs no operator
2886
+ * authority; any other DID does (403 otherwise).
2887
+ */
2888
+ async info(did) {
2889
+ return this.usersGet(`/${encodeURIComponent(did)}`);
2890
+ }
2891
+ /**
2892
+ * List a venue-managed user's authenticators, active and revoked
2893
+ * tombstones alike — revocation is a status transition in place, never a
2894
+ * deletion. The caller's own DID needs no operator authority; any other
2895
+ * DID does (403 otherwise).
2896
+ */
2897
+ async listAuthenticators(did) {
2898
+ return this.usersGet(`/${encodeURIComponent(did)}/authentications`);
2899
+ }
2900
+ /**
2901
+ * Revoke one of a venue-managed user's authenticators. A mutation, so —
2902
+ * unlike the reads above — this goes through `operations.run` and mints a
2903
+ * Job, matching every other write in this SDK (e.g. `SecretManager.set`).
2904
+ */
2905
+ async revokeAuthenticator(key, did, ucans) {
2906
+ return this.venue.operations.run(
2907
+ "v/ops/user/authentication-revoke",
2908
+ { did, key },
2909
+ { ucans }
2910
+ );
2911
+ }
2912
+ };
2913
+
2852
2914
  // src/Agent.ts
2853
2915
  var Agent = class _Agent {
2854
2916
  constructor(id, venue) {
@@ -3050,6 +3112,9 @@ var Venue = class _Venue {
3050
3112
  get dlfs() {
3051
3113
  return this._dlfs ?? (this._dlfs = new DLFSManager(this));
3052
3114
  }
3115
+ get users() {
3116
+ return this._users ?? (this._users = new UserManager(this));
3117
+ }
3053
3118
  /**
3054
3119
  * Connect to a venue, validating it with `GET {base}/api/v1/status`. If the
3055
3120
  * venue is auth-gated (status answers 401/403 — public access disabled), the
@@ -3381,4 +3446,4 @@ function relayDelegation(privateKey, venueDID, lifetimeSeconds, caps = []) {
3381
3446
  (*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) *)
3382
3447
  */
3383
3448
 
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 };
3449
+ 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, UserManager, 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.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Typescript library for covia-ai",
5
5
  "packageManager": "pnpm@11.9.0",
6
6
  "main": "./dist/index.js",