@covia/covia-sdk 1.9.1 → 1.10.1
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 +28 -2
- package/dist/index.d.ts +28 -2
- package/dist/index.js +31 -3
- package/dist/index.mjs +31 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -466,6 +466,13 @@ declare class AssetManager {
|
|
|
466
466
|
* @param options - Pagination options (offset, limit)
|
|
467
467
|
*/
|
|
468
468
|
list(options?: AssetListOptions): Promise<AssetList>;
|
|
469
|
+
/**
|
|
470
|
+
* List the authenticated caller's own assets — the per-user a/ namespace
|
|
471
|
+
* populated by `store`/`pin`, distinct from the venue-wide catalog `list()`
|
|
472
|
+
* reads. Job-free (a plain GET, not an operation invocation).
|
|
473
|
+
* @param options - Pagination options (offset, limit)
|
|
474
|
+
*/
|
|
475
|
+
listMine(options?: AssetListOptions): Promise<MyAssetList>;
|
|
469
476
|
/**
|
|
470
477
|
* Register a new asset
|
|
471
478
|
* @param assetData - Asset configuration
|
|
@@ -685,7 +692,14 @@ interface SkillManagerVenue {
|
|
|
685
692
|
declare class SkillManager {
|
|
686
693
|
private venue;
|
|
687
694
|
constructor(venue: SkillManagerVenue);
|
|
688
|
-
/**
|
|
695
|
+
/**
|
|
696
|
+
* Return every skill asset directly contained at `path`. A single entry
|
|
697
|
+
* that fails to resolve (e.g. a legacy bare-string alias the plain assets
|
|
698
|
+
* endpoint can't follow — see covia-ai/frontend#229) is skipped rather
|
|
699
|
+
* than failing the whole listing: one broken skill must not take down
|
|
700
|
+
* every other skill at this location, the same "don't discard what was
|
|
701
|
+
* already collected" principle this method already applies across pages.
|
|
702
|
+
*/
|
|
689
703
|
list(path: string): Promise<Skill[]>;
|
|
690
704
|
/** Return the ordinary asset at exactly `path`, with typed skill metadata. */
|
|
691
705
|
get(path: string): Promise<Skill>;
|
|
@@ -1033,6 +1047,18 @@ interface AssetList {
|
|
|
1033
1047
|
offset: number;
|
|
1034
1048
|
limit: number;
|
|
1035
1049
|
}
|
|
1050
|
+
interface AssetSummary {
|
|
1051
|
+
id: string;
|
|
1052
|
+
name?: string;
|
|
1053
|
+
type?: string;
|
|
1054
|
+
description?: string;
|
|
1055
|
+
}
|
|
1056
|
+
interface MyAssetList {
|
|
1057
|
+
items: AssetSummary[];
|
|
1058
|
+
total: number;
|
|
1059
|
+
offset: number;
|
|
1060
|
+
limit: number;
|
|
1061
|
+
}
|
|
1036
1062
|
interface MCPDiscovery {
|
|
1037
1063
|
mcp_version?: string;
|
|
1038
1064
|
server_url?: string;
|
|
@@ -1840,4 +1866,4 @@ declare function grant(ownerPrivateKey: Uint8Array, audienceDID: string, withRes
|
|
|
1840
1866
|
*/
|
|
1841
1867
|
declare function relayDelegation(privateKey: Uint8Array, venueDID: string, lifetimeSeconds: number, caps?: UCANCapability[]): string;
|
|
1842
1868
|
|
|
1843
|
-
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 };
|
|
1869
|
+
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, 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 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
|
@@ -466,6 +466,13 @@ declare class AssetManager {
|
|
|
466
466
|
* @param options - Pagination options (offset, limit)
|
|
467
467
|
*/
|
|
468
468
|
list(options?: AssetListOptions): Promise<AssetList>;
|
|
469
|
+
/**
|
|
470
|
+
* List the authenticated caller's own assets — the per-user a/ namespace
|
|
471
|
+
* populated by `store`/`pin`, distinct from the venue-wide catalog `list()`
|
|
472
|
+
* reads. Job-free (a plain GET, not an operation invocation).
|
|
473
|
+
* @param options - Pagination options (offset, limit)
|
|
474
|
+
*/
|
|
475
|
+
listMine(options?: AssetListOptions): Promise<MyAssetList>;
|
|
469
476
|
/**
|
|
470
477
|
* Register a new asset
|
|
471
478
|
* @param assetData - Asset configuration
|
|
@@ -685,7 +692,14 @@ interface SkillManagerVenue {
|
|
|
685
692
|
declare class SkillManager {
|
|
686
693
|
private venue;
|
|
687
694
|
constructor(venue: SkillManagerVenue);
|
|
688
|
-
/**
|
|
695
|
+
/**
|
|
696
|
+
* Return every skill asset directly contained at `path`. A single entry
|
|
697
|
+
* that fails to resolve (e.g. a legacy bare-string alias the plain assets
|
|
698
|
+
* endpoint can't follow — see covia-ai/frontend#229) is skipped rather
|
|
699
|
+
* than failing the whole listing: one broken skill must not take down
|
|
700
|
+
* every other skill at this location, the same "don't discard what was
|
|
701
|
+
* already collected" principle this method already applies across pages.
|
|
702
|
+
*/
|
|
689
703
|
list(path: string): Promise<Skill[]>;
|
|
690
704
|
/** Return the ordinary asset at exactly `path`, with typed skill metadata. */
|
|
691
705
|
get(path: string): Promise<Skill>;
|
|
@@ -1033,6 +1047,18 @@ interface AssetList {
|
|
|
1033
1047
|
offset: number;
|
|
1034
1048
|
limit: number;
|
|
1035
1049
|
}
|
|
1050
|
+
interface AssetSummary {
|
|
1051
|
+
id: string;
|
|
1052
|
+
name?: string;
|
|
1053
|
+
type?: string;
|
|
1054
|
+
description?: string;
|
|
1055
|
+
}
|
|
1056
|
+
interface MyAssetList {
|
|
1057
|
+
items: AssetSummary[];
|
|
1058
|
+
total: number;
|
|
1059
|
+
offset: number;
|
|
1060
|
+
limit: number;
|
|
1061
|
+
}
|
|
1036
1062
|
interface MCPDiscovery {
|
|
1037
1063
|
mcp_version?: string;
|
|
1038
1064
|
server_url?: string;
|
|
@@ -1840,4 +1866,4 @@ declare function grant(ownerPrivateKey: Uint8Array, audienceDID: string, withRes
|
|
|
1840
1866
|
*/
|
|
1841
1867
|
declare function relayDelegation(privateKey: Uint8Array, venueDID: string, lifetimeSeconds: number, caps?: UCANCapability[]): string;
|
|
1842
1868
|
|
|
1843
|
-
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 };
|
|
1869
|
+
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, 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 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
|
@@ -2327,6 +2327,25 @@ var AssetManager = class {
|
|
|
2327
2327
|
{ contentType: null }
|
|
2328
2328
|
);
|
|
2329
2329
|
}
|
|
2330
|
+
/**
|
|
2331
|
+
* List the authenticated caller's own assets — the per-user a/ namespace
|
|
2332
|
+
* populated by `store`/`pin`, distinct from the venue-wide catalog `list()`
|
|
2333
|
+
* reads. Job-free (a plain GET, not an operation invocation).
|
|
2334
|
+
* @param options - Pagination options (offset, limit)
|
|
2335
|
+
*/
|
|
2336
|
+
async listMine(options = {}) {
|
|
2337
|
+
const params = new URLSearchParams();
|
|
2338
|
+
params.set("scope", "own");
|
|
2339
|
+
params.set("offset", String(options.offset ?? 0));
|
|
2340
|
+
if (options.limit !== void 0) {
|
|
2341
|
+
params.set("limit", String(options.limit));
|
|
2342
|
+
}
|
|
2343
|
+
return venueJson(
|
|
2344
|
+
this.venue,
|
|
2345
|
+
`/api/v1/assets?${params.toString()}`,
|
|
2346
|
+
{ contentType: null }
|
|
2347
|
+
);
|
|
2348
|
+
}
|
|
2330
2349
|
/**
|
|
2331
2350
|
* Register a new asset
|
|
2332
2351
|
* @param assetData - Asset configuration
|
|
@@ -2662,7 +2681,14 @@ var SkillManager = class {
|
|
|
2662
2681
|
constructor(venue) {
|
|
2663
2682
|
this.venue = venue;
|
|
2664
2683
|
}
|
|
2665
|
-
/**
|
|
2684
|
+
/**
|
|
2685
|
+
* Return every skill asset directly contained at `path`. A single entry
|
|
2686
|
+
* that fails to resolve (e.g. a legacy bare-string alias the plain assets
|
|
2687
|
+
* endpoint can't follow — see covia-ai/frontend#229) is skipped rather
|
|
2688
|
+
* than failing the whole listing: one broken skill must not take down
|
|
2689
|
+
* every other skill at this location, the same "don't discard what was
|
|
2690
|
+
* already collected" principle this method already applies across pages.
|
|
2691
|
+
*/
|
|
2666
2692
|
async list(path) {
|
|
2667
2693
|
const location = path.replace(/\/+$/, "");
|
|
2668
2694
|
const skills = [];
|
|
@@ -2674,10 +2700,12 @@ var SkillManager = class {
|
|
|
2674
2700
|
throw new CoviaError(`Skill listing at ${location} disappeared mid-listing`);
|
|
2675
2701
|
}
|
|
2676
2702
|
const keys = page.keys ?? [];
|
|
2677
|
-
const
|
|
2703
|
+
const results = await Promise.allSettled(
|
|
2678
2704
|
keys.map((key) => this.get(`${location}/${key}`))
|
|
2679
2705
|
);
|
|
2680
|
-
|
|
2706
|
+
for (const result of results) {
|
|
2707
|
+
if (result.status === "fulfilled") skills.push(result.value);
|
|
2708
|
+
}
|
|
2681
2709
|
const nextOffset = (page.offset ?? offset) + keys.length;
|
|
2682
2710
|
if (keys.length === 0 || nextOffset >= (page.count ?? nextOffset)) break;
|
|
2683
2711
|
if (nextOffset <= offset) {
|
package/dist/index.mjs
CHANGED
|
@@ -2325,6 +2325,25 @@ var AssetManager = class {
|
|
|
2325
2325
|
{ contentType: null }
|
|
2326
2326
|
);
|
|
2327
2327
|
}
|
|
2328
|
+
/**
|
|
2329
|
+
* List the authenticated caller's own assets — the per-user a/ namespace
|
|
2330
|
+
* populated by `store`/`pin`, distinct from the venue-wide catalog `list()`
|
|
2331
|
+
* reads. Job-free (a plain GET, not an operation invocation).
|
|
2332
|
+
* @param options - Pagination options (offset, limit)
|
|
2333
|
+
*/
|
|
2334
|
+
async listMine(options = {}) {
|
|
2335
|
+
const params = new URLSearchParams();
|
|
2336
|
+
params.set("scope", "own");
|
|
2337
|
+
params.set("offset", String(options.offset ?? 0));
|
|
2338
|
+
if (options.limit !== void 0) {
|
|
2339
|
+
params.set("limit", String(options.limit));
|
|
2340
|
+
}
|
|
2341
|
+
return venueJson(
|
|
2342
|
+
this.venue,
|
|
2343
|
+
`/api/v1/assets?${params.toString()}`,
|
|
2344
|
+
{ contentType: null }
|
|
2345
|
+
);
|
|
2346
|
+
}
|
|
2328
2347
|
/**
|
|
2329
2348
|
* Register a new asset
|
|
2330
2349
|
* @param assetData - Asset configuration
|
|
@@ -2660,7 +2679,14 @@ var SkillManager = class {
|
|
|
2660
2679
|
constructor(venue) {
|
|
2661
2680
|
this.venue = venue;
|
|
2662
2681
|
}
|
|
2663
|
-
/**
|
|
2682
|
+
/**
|
|
2683
|
+
* Return every skill asset directly contained at `path`. A single entry
|
|
2684
|
+
* that fails to resolve (e.g. a legacy bare-string alias the plain assets
|
|
2685
|
+
* endpoint can't follow — see covia-ai/frontend#229) is skipped rather
|
|
2686
|
+
* than failing the whole listing: one broken skill must not take down
|
|
2687
|
+
* every other skill at this location, the same "don't discard what was
|
|
2688
|
+
* already collected" principle this method already applies across pages.
|
|
2689
|
+
*/
|
|
2664
2690
|
async list(path) {
|
|
2665
2691
|
const location = path.replace(/\/+$/, "");
|
|
2666
2692
|
const skills = [];
|
|
@@ -2672,10 +2698,12 @@ var SkillManager = class {
|
|
|
2672
2698
|
throw new CoviaError(`Skill listing at ${location} disappeared mid-listing`);
|
|
2673
2699
|
}
|
|
2674
2700
|
const keys = page.keys ?? [];
|
|
2675
|
-
const
|
|
2701
|
+
const results = await Promise.allSettled(
|
|
2676
2702
|
keys.map((key) => this.get(`${location}/${key}`))
|
|
2677
2703
|
);
|
|
2678
|
-
|
|
2704
|
+
for (const result of results) {
|
|
2705
|
+
if (result.status === "fulfilled") skills.push(result.value);
|
|
2706
|
+
}
|
|
2679
2707
|
const nextOffset = (page.offset ?? offset) + keys.length;
|
|
2680
2708
|
if (keys.length === 0 || nextOffset >= (page.count ?? nextOffset)) break;
|
|
2681
2709
|
if (nextOffset <= offset) {
|