@covia/covia-sdk 1.7.3 → 1.8.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 +22 -5
- package/dist/index.d.ts +22 -5
- package/dist/index.js +15 -3
- package/dist/index.mjs +15 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -367,6 +367,13 @@ declare class AgentManager {
|
|
|
367
367
|
* No polling required.
|
|
368
368
|
*/
|
|
369
369
|
chat(agentId: string, message: unknown, sessionId?: string): Promise<AgentChatResult>;
|
|
370
|
+
/**
|
|
371
|
+
* Set (or clear, by omitting `title` / passing an empty string) a
|
|
372
|
+
* session's free-form human-facing title — persisted on the venue in
|
|
373
|
+
* the session's own metadata, visible to every client and party in the
|
|
374
|
+
* session (not a per-browser local override).
|
|
375
|
+
*/
|
|
376
|
+
renameSession(agentId: string, sessionId: string, title?: string): Promise<AgentRenameSessionResult>;
|
|
370
377
|
trigger(agentId: string): Promise<AgentTriggerResult>;
|
|
371
378
|
/**
|
|
372
379
|
* List the caller's agents. **Job-free** on covia ≥ 0.4: goes through
|
|
@@ -1083,6 +1090,12 @@ interface AgentSuspendResult {
|
|
|
1083
1090
|
agentId: string;
|
|
1084
1091
|
status: string;
|
|
1085
1092
|
}
|
|
1093
|
+
interface AgentRenameSessionResult {
|
|
1094
|
+
agentId: string;
|
|
1095
|
+
sessionId: string;
|
|
1096
|
+
/** Absent when the title was cleared (an omitted/blank title on the call). */
|
|
1097
|
+
title?: string;
|
|
1098
|
+
}
|
|
1086
1099
|
interface AgentResumeInput {
|
|
1087
1100
|
agentId: string;
|
|
1088
1101
|
autoWake?: boolean;
|
|
@@ -1645,16 +1658,20 @@ interface UCANCapability {
|
|
|
1645
1658
|
/** The did:key DID for a private key. */
|
|
1646
1659
|
declare function didFor(privateKey: Uint8Array): string;
|
|
1647
1660
|
/**
|
|
1648
|
-
* Mint a UCAN as an EdDSA JWT
|
|
1649
|
-
* `privateKey` (iss = its did:key).
|
|
1661
|
+
* Mint a UCAN as an EdDSA JWT in the Convex UCAN JWT profile:
|
|
1662
|
+
* `{iss, aud, ucv, att, prf, exp}` signed by `privateKey` (iss = its did:key).
|
|
1663
|
+
* From Convex 0.8.11 venues parse only this profile: the `ucv` claim and the
|
|
1664
|
+
* `att`/`prf` arrays are always present, and the `exp` key is always present —
|
|
1665
|
+
* explicitly `null` for a non-expiring token (UCAN v0.10.0; an absent `exp`
|
|
1666
|
+
* is malformed).
|
|
1650
1667
|
*
|
|
1651
1668
|
* @param privateKey 32-byte Ed25519 private key (the issuer)
|
|
1652
1669
|
* @param audienceDID who receives the token (`aud`)
|
|
1653
1670
|
* @param att capabilities delegated (empty array = pure identity token)
|
|
1654
|
-
* @param lifetimeSeconds validity window
|
|
1671
|
+
* @param lifetimeSeconds validity window, or `null` for a non-expiring token
|
|
1655
1672
|
* @param proofs parent UCAN JWT strings (`prf`) for delegation chains
|
|
1656
1673
|
*/
|
|
1657
|
-
declare function createUCANJWT(privateKey: Uint8Array, audienceDID: string, att: UCANCapability[], lifetimeSeconds: number, proofs?: string[]): string;
|
|
1674
|
+
declare function createUCANJWT(privateKey: Uint8Array, audienceDID: string, att: UCANCapability[], lifetimeSeconds: number | null, proofs?: string[]): string;
|
|
1658
1675
|
/**
|
|
1659
1676
|
* Mint an **identity token**: a UCAN with an EMPTY attenuation list, audienced
|
|
1660
1677
|
* to `venueDID`. Pure proof of identity — it grants nothing, and being
|
|
@@ -1680,4 +1697,4 @@ declare function grant(ownerPrivateKey: Uint8Array, audienceDID: string, withRes
|
|
|
1680
1697
|
*/
|
|
1681
1698
|
declare function relayDelegation(privateKey: Uint8Array, venueDID: string, lifetimeSeconds: number, caps?: UCANCapability[]): string;
|
|
1682
1699
|
|
|
1683
|
-
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 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -367,6 +367,13 @@ declare class AgentManager {
|
|
|
367
367
|
* No polling required.
|
|
368
368
|
*/
|
|
369
369
|
chat(agentId: string, message: unknown, sessionId?: string): Promise<AgentChatResult>;
|
|
370
|
+
/**
|
|
371
|
+
* Set (or clear, by omitting `title` / passing an empty string) a
|
|
372
|
+
* session's free-form human-facing title — persisted on the venue in
|
|
373
|
+
* the session's own metadata, visible to every client and party in the
|
|
374
|
+
* session (not a per-browser local override).
|
|
375
|
+
*/
|
|
376
|
+
renameSession(agentId: string, sessionId: string, title?: string): Promise<AgentRenameSessionResult>;
|
|
370
377
|
trigger(agentId: string): Promise<AgentTriggerResult>;
|
|
371
378
|
/**
|
|
372
379
|
* List the caller's agents. **Job-free** on covia ≥ 0.4: goes through
|
|
@@ -1083,6 +1090,12 @@ interface AgentSuspendResult {
|
|
|
1083
1090
|
agentId: string;
|
|
1084
1091
|
status: string;
|
|
1085
1092
|
}
|
|
1093
|
+
interface AgentRenameSessionResult {
|
|
1094
|
+
agentId: string;
|
|
1095
|
+
sessionId: string;
|
|
1096
|
+
/** Absent when the title was cleared (an omitted/blank title on the call). */
|
|
1097
|
+
title?: string;
|
|
1098
|
+
}
|
|
1086
1099
|
interface AgentResumeInput {
|
|
1087
1100
|
agentId: string;
|
|
1088
1101
|
autoWake?: boolean;
|
|
@@ -1645,16 +1658,20 @@ interface UCANCapability {
|
|
|
1645
1658
|
/** The did:key DID for a private key. */
|
|
1646
1659
|
declare function didFor(privateKey: Uint8Array): string;
|
|
1647
1660
|
/**
|
|
1648
|
-
* Mint a UCAN as an EdDSA JWT
|
|
1649
|
-
* `privateKey` (iss = its did:key).
|
|
1661
|
+
* Mint a UCAN as an EdDSA JWT in the Convex UCAN JWT profile:
|
|
1662
|
+
* `{iss, aud, ucv, att, prf, exp}` signed by `privateKey` (iss = its did:key).
|
|
1663
|
+
* From Convex 0.8.11 venues parse only this profile: the `ucv` claim and the
|
|
1664
|
+
* `att`/`prf` arrays are always present, and the `exp` key is always present —
|
|
1665
|
+
* explicitly `null` for a non-expiring token (UCAN v0.10.0; an absent `exp`
|
|
1666
|
+
* is malformed).
|
|
1650
1667
|
*
|
|
1651
1668
|
* @param privateKey 32-byte Ed25519 private key (the issuer)
|
|
1652
1669
|
* @param audienceDID who receives the token (`aud`)
|
|
1653
1670
|
* @param att capabilities delegated (empty array = pure identity token)
|
|
1654
|
-
* @param lifetimeSeconds validity window
|
|
1671
|
+
* @param lifetimeSeconds validity window, or `null` for a non-expiring token
|
|
1655
1672
|
* @param proofs parent UCAN JWT strings (`prf`) for delegation chains
|
|
1656
1673
|
*/
|
|
1657
|
-
declare function createUCANJWT(privateKey: Uint8Array, audienceDID: string, att: UCANCapability[], lifetimeSeconds: number, proofs?: string[]): string;
|
|
1674
|
+
declare function createUCANJWT(privateKey: Uint8Array, audienceDID: string, att: UCANCapability[], lifetimeSeconds: number | null, proofs?: string[]): string;
|
|
1658
1675
|
/**
|
|
1659
1676
|
* Mint an **identity token**: a UCAN with an EMPTY attenuation list, audienced
|
|
1660
1677
|
* to `venueDID`. Pure proof of identity — it grants nothing, and being
|
|
@@ -1680,4 +1697,4 @@ declare function grant(ownerPrivateKey: Uint8Array, audienceDID: string, withRes
|
|
|
1680
1697
|
*/
|
|
1681
1698
|
declare function relayDelegation(privateKey: Uint8Array, venueDID: string, lifetimeSeconds: number, caps?: UCANCapability[]): string;
|
|
1682
1699
|
|
|
1683
|
-
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 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -77,7 +77,8 @@ var JobFailedError = class extends CoviaError {
|
|
|
77
77
|
const status = jobData.status ?? "unknown";
|
|
78
78
|
let msg = `Job ${id} ${status}`;
|
|
79
79
|
const output = jobData.output;
|
|
80
|
-
const
|
|
80
|
+
const outputErrText = output && typeof output === "object" && "error" in output ? output.error : void 0;
|
|
81
|
+
const errText = typeof jobData.error === "string" ? jobData.error : outputErrText;
|
|
81
82
|
if (typeof errText === "string") {
|
|
82
83
|
msg += `: ${errText}`;
|
|
83
84
|
}
|
|
@@ -1682,6 +1683,15 @@ var AgentManager = class {
|
|
|
1682
1683
|
async chat(agentId, message, sessionId) {
|
|
1683
1684
|
return this.venue.operations.run("v/ops/agent/chat", { agentId, message, sessionId });
|
|
1684
1685
|
}
|
|
1686
|
+
/**
|
|
1687
|
+
* Set (or clear, by omitting `title` / passing an empty string) a
|
|
1688
|
+
* session's free-form human-facing title — persisted on the venue in
|
|
1689
|
+
* the session's own metadata, visible to every client and party in the
|
|
1690
|
+
* session (not a per-browser local override).
|
|
1691
|
+
*/
|
|
1692
|
+
async renameSession(agentId, sessionId, title) {
|
|
1693
|
+
return this.venue.operations.run("v/ops/agent/rename-session", { agentId, sessionId, title });
|
|
1694
|
+
}
|
|
1685
1695
|
async trigger(agentId) {
|
|
1686
1696
|
return this.venue.operations.run("v/ops/agent/trigger", { agentId });
|
|
1687
1697
|
}
|
|
@@ -2903,6 +2913,7 @@ var Grid = class {
|
|
|
2903
2913
|
// src/crypto/ucan.ts
|
|
2904
2914
|
var encoder2 = new TextEncoder();
|
|
2905
2915
|
var VENUE_RELAY = "venue/relay";
|
|
2916
|
+
var UCV_VERSION = "0.10.0";
|
|
2906
2917
|
function didFor(privateKey) {
|
|
2907
2918
|
return `did:key:${encodePublicKey(getPublicKey2(privateKey))}`;
|
|
2908
2919
|
}
|
|
@@ -2913,10 +2924,11 @@ function createUCANJWT(privateKey, audienceDID, att, lifetimeSeconds, proofs = [
|
|
|
2913
2924
|
const claims = {
|
|
2914
2925
|
iss: `did:key:${multikey}`,
|
|
2915
2926
|
aud: audienceDID,
|
|
2927
|
+
ucv: UCV_VERSION,
|
|
2916
2928
|
att,
|
|
2917
|
-
|
|
2929
|
+
prf: proofs,
|
|
2930
|
+
exp: lifetimeSeconds === null ? null : nowSecs + lifetimeSeconds
|
|
2918
2931
|
};
|
|
2919
|
-
if (proofs.length) claims.prf = proofs;
|
|
2920
2932
|
const signingInput = `${base64UrlEncode(encoder2.encode(header))}.${base64UrlEncode(encoder2.encode(JSON.stringify(claims)))}`;
|
|
2921
2933
|
const signature = sign(encoder2.encode(signingInput), privateKey);
|
|
2922
2934
|
return `${signingInput}.${base64UrlEncode(signature)}`;
|
package/dist/index.mjs
CHANGED
|
@@ -75,7 +75,8 @@ var JobFailedError = class extends CoviaError {
|
|
|
75
75
|
const status = jobData.status ?? "unknown";
|
|
76
76
|
let msg = `Job ${id} ${status}`;
|
|
77
77
|
const output = jobData.output;
|
|
78
|
-
const
|
|
78
|
+
const outputErrText = output && typeof output === "object" && "error" in output ? output.error : void 0;
|
|
79
|
+
const errText = typeof jobData.error === "string" ? jobData.error : outputErrText;
|
|
79
80
|
if (typeof errText === "string") {
|
|
80
81
|
msg += `: ${errText}`;
|
|
81
82
|
}
|
|
@@ -1680,6 +1681,15 @@ var AgentManager = class {
|
|
|
1680
1681
|
async chat(agentId, message, sessionId) {
|
|
1681
1682
|
return this.venue.operations.run("v/ops/agent/chat", { agentId, message, sessionId });
|
|
1682
1683
|
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Set (or clear, by omitting `title` / passing an empty string) a
|
|
1686
|
+
* session's free-form human-facing title — persisted on the venue in
|
|
1687
|
+
* the session's own metadata, visible to every client and party in the
|
|
1688
|
+
* session (not a per-browser local override).
|
|
1689
|
+
*/
|
|
1690
|
+
async renameSession(agentId, sessionId, title) {
|
|
1691
|
+
return this.venue.operations.run("v/ops/agent/rename-session", { agentId, sessionId, title });
|
|
1692
|
+
}
|
|
1683
1693
|
async trigger(agentId) {
|
|
1684
1694
|
return this.venue.operations.run("v/ops/agent/trigger", { agentId });
|
|
1685
1695
|
}
|
|
@@ -2901,6 +2911,7 @@ var Grid = class {
|
|
|
2901
2911
|
// src/crypto/ucan.ts
|
|
2902
2912
|
var encoder2 = new TextEncoder();
|
|
2903
2913
|
var VENUE_RELAY = "venue/relay";
|
|
2914
|
+
var UCV_VERSION = "0.10.0";
|
|
2904
2915
|
function didFor(privateKey) {
|
|
2905
2916
|
return `did:key:${encodePublicKey(getPublicKey2(privateKey))}`;
|
|
2906
2917
|
}
|
|
@@ -2911,10 +2922,11 @@ function createUCANJWT(privateKey, audienceDID, att, lifetimeSeconds, proofs = [
|
|
|
2911
2922
|
const claims = {
|
|
2912
2923
|
iss: `did:key:${multikey}`,
|
|
2913
2924
|
aud: audienceDID,
|
|
2925
|
+
ucv: UCV_VERSION,
|
|
2914
2926
|
att,
|
|
2915
|
-
|
|
2927
|
+
prf: proofs,
|
|
2928
|
+
exp: lifetimeSeconds === null ? null : nowSecs + lifetimeSeconds
|
|
2916
2929
|
};
|
|
2917
|
-
if (proofs.length) claims.prf = proofs;
|
|
2918
2930
|
const signingInput = `${base64UrlEncode(encoder2.encode(header))}.${base64UrlEncode(encoder2.encode(JSON.stringify(claims)))}`;
|
|
2919
2931
|
const signature = sign(encoder2.encode(signingInput), privateKey);
|
|
2920
2932
|
return `${signingInput}.${base64UrlEncode(signature)}`;
|