@covia/covia-sdk 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/index.d.mts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +19 -0
- package/dist/index.mjs +19 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -337,6 +337,10 @@ await venue.agents.message("my-agent", { event: "update" });
|
|
|
337
337
|
await venue.agents.trigger("my-agent");
|
|
338
338
|
const state = await venue.agents.query("my-agent");
|
|
339
339
|
|
|
340
|
+
// Session-scoped chat — mints a session on the first call, continue by echoing sessionId
|
|
341
|
+
const first = await venue.agents.chat("my-agent", "hi");
|
|
342
|
+
const follow = await venue.agents.chat("my-agent", "and now?", first.sessionId);
|
|
343
|
+
|
|
340
344
|
// Lifecycle
|
|
341
345
|
const agents = await venue.agents.list();
|
|
342
346
|
await venue.agents.suspend("my-agent");
|
|
@@ -351,6 +355,7 @@ await venue.agents.delete("my-agent");
|
|
|
351
355
|
| `agents.create(input)` | `AgentCreateResult` | Create an agent |
|
|
352
356
|
| `agents.request(id, input?, wait?)` | `AgentRequestResult` | Send request to agent |
|
|
353
357
|
| `agents.message(id, message)` | `AgentMessageResult` | Send a message |
|
|
358
|
+
| `agents.chat(id, message, sessionId?)` | `AgentChatResult` | Session-scoped chat — awaits next response on the session |
|
|
354
359
|
| `agents.trigger(id)` | `AgentTriggerResult` | Trigger agent execution |
|
|
355
360
|
| `agents.query(id)` | `AgentQueryResult` | Query agent state |
|
|
356
361
|
| `agents.list(includeTerminated?)` | `AgentListResult` | List agents |
|
package/dist/index.d.mts
CHANGED
|
@@ -219,6 +219,23 @@ declare class AgentManager {
|
|
|
219
219
|
create(input: AgentCreateInput): Promise<AgentCreateResult>;
|
|
220
220
|
request(agentId: string, input?: any, wait?: boolean | number): Promise<AgentRequestResult>;
|
|
221
221
|
message(agentId: string, message: any): Promise<AgentMessageResult>;
|
|
222
|
+
/**
|
|
223
|
+
* Send a message to an agent and synchronously await its next response on the session.
|
|
224
|
+
*
|
|
225
|
+
* Session lifecycle:
|
|
226
|
+
* - Omit `sessionId` on the first call — the server mints a new session and returns
|
|
227
|
+
* its id in the result. Capture it.
|
|
228
|
+
* - Pass the returned `sessionId` on every subsequent call to continue the conversation.
|
|
229
|
+
* - An unknown `sessionId` is rejected (the server will not silently mint one); omit
|
|
230
|
+
* the field entirely to start a new session.
|
|
231
|
+
*
|
|
232
|
+
* Concurrency: only one chat may be in flight per session. Concurrent calls on the
|
|
233
|
+
* same session are rejected by the venue.
|
|
234
|
+
*
|
|
235
|
+
* Blocking: always blocks until the agent produces its next response on the session.
|
|
236
|
+
* No polling required.
|
|
237
|
+
*/
|
|
238
|
+
chat(agentId: string, message: any, sessionId?: string): Promise<AgentChatResult>;
|
|
222
239
|
trigger(agentId: string): Promise<AgentTriggerResult>;
|
|
223
240
|
query(agentId: string): Promise<AgentQueryResult>;
|
|
224
241
|
list(includeTerminated?: boolean): Promise<AgentListResult>;
|
|
@@ -678,6 +695,16 @@ interface AgentMessageResult {
|
|
|
678
695
|
agentId: string;
|
|
679
696
|
delivered: boolean;
|
|
680
697
|
}
|
|
698
|
+
interface AgentChatInput {
|
|
699
|
+
agentId: string;
|
|
700
|
+
message: any;
|
|
701
|
+
sessionId?: string;
|
|
702
|
+
}
|
|
703
|
+
interface AgentChatResult {
|
|
704
|
+
agentId: string;
|
|
705
|
+
sessionId: string;
|
|
706
|
+
response: any;
|
|
707
|
+
}
|
|
681
708
|
interface AgentTriggerInput {
|
|
682
709
|
agentId: string;
|
|
683
710
|
}
|
|
@@ -1010,4 +1037,4 @@ declare function decodePublicKey(multikey: string): Uint8Array;
|
|
|
1010
1037
|
*/
|
|
1011
1038
|
declare function didFromPublicKey(publicKey: Uint8Array): string;
|
|
1012
1039
|
|
|
1013
|
-
export { type AdapterInfo, type AdaptersResult, type AgentCancelTaskInput, type AgentCard, type AgentCreateInput, type AgentCreateResult, type AgentDeleteInput, type AgentDeleteResult, type AgentListInput, type AgentListResult, AgentManager, type AgentMessageInput, type AgentMessageResult, type AgentQueryInput, type AgentQueryResult, 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, AssetNotFoundError, Auth, BearerAuth, type ContentDetails, type ContentHashResult, CoviaConnectionError, CoviaError, CoviaTimeoutError, type Credentials, CredentialsHTTP, type DIDDocument, DataAsset, type FunctionInfo, type FunctionsResult, Grid, GridError, type InvokeOptions, type InvokePayload, Job, JobFailedError, JobManager, type JobMetadata, JobNotFoundError, JobStatus, KeyPairAuth, type MCPDiscovery, NoAuth, NotFoundError, Operation, type OperationDetails, type OperationInfo, OperationManager, type OperationPayload, RunStatus, type SSEEvent, type SecretExtractInput, type SecretExtractResult, SecretManager, type SecretSetInput, type SecretSetResult, type StatsData, type StatusData, type UCANAttenuation, type UCANIssueInput, type UCANIssueResult, UCANManager, Venue, type VenueConstructor, type VenueData, type VenueInterface, type VenueOptions, type WorkspaceAppendInput, type WorkspaceAppendResult, type WorkspaceDeleteInput, type WorkspaceDeleteResult, type WorkspaceListInput, type WorkspaceListResult, WorkspaceManager, type WorkspaceReadInput, type WorkspaceReadResult, type WorkspaceSliceInput, type WorkspaceSliceResult, type WorkspaceWriteInput, type WorkspaceWriteResult, createSSEEvent, decodePublicKey, didFromPublicKey, encodePublicKey, fetchStreamWithError, fetchWithError, generateKeyPair, getAssetIdFromPath, getAssetIdFromVenueId, getParsedAssetId, hexToPrivateKey, isJobComplete, isJobFinished, isJobPaused, logger, parseSSEStream, privateKeyToHex };
|
|
1040
|
+
export { type AdapterInfo, type AdaptersResult, type AgentCancelTaskInput, type AgentCard, type AgentChatInput, type AgentChatResult, type AgentCreateInput, type AgentCreateResult, type AgentDeleteInput, type AgentDeleteResult, type AgentListInput, type AgentListResult, AgentManager, type AgentMessageInput, type AgentMessageResult, type AgentQueryInput, type AgentQueryResult, 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, AssetNotFoundError, Auth, BearerAuth, type ContentDetails, type ContentHashResult, CoviaConnectionError, CoviaError, CoviaTimeoutError, type Credentials, CredentialsHTTP, type DIDDocument, DataAsset, type FunctionInfo, type FunctionsResult, Grid, GridError, type InvokeOptions, type InvokePayload, Job, JobFailedError, JobManager, type JobMetadata, JobNotFoundError, JobStatus, KeyPairAuth, type MCPDiscovery, NoAuth, NotFoundError, Operation, type OperationDetails, type OperationInfo, OperationManager, type OperationPayload, RunStatus, type SSEEvent, type SecretExtractInput, type SecretExtractResult, SecretManager, type SecretSetInput, type SecretSetResult, type StatsData, type StatusData, type UCANAttenuation, type UCANIssueInput, type UCANIssueResult, UCANManager, Venue, type VenueConstructor, type VenueData, type VenueInterface, type VenueOptions, type WorkspaceAppendInput, type WorkspaceAppendResult, type WorkspaceDeleteInput, type WorkspaceDeleteResult, type WorkspaceListInput, type WorkspaceListResult, WorkspaceManager, type WorkspaceReadInput, type WorkspaceReadResult, type WorkspaceSliceInput, type WorkspaceSliceResult, type WorkspaceWriteInput, type WorkspaceWriteResult, createSSEEvent, decodePublicKey, didFromPublicKey, encodePublicKey, fetchStreamWithError, fetchWithError, generateKeyPair, getAssetIdFromPath, getAssetIdFromVenueId, getParsedAssetId, hexToPrivateKey, isJobComplete, isJobFinished, isJobPaused, logger, parseSSEStream, privateKeyToHex };
|
package/dist/index.d.ts
CHANGED
|
@@ -219,6 +219,23 @@ declare class AgentManager {
|
|
|
219
219
|
create(input: AgentCreateInput): Promise<AgentCreateResult>;
|
|
220
220
|
request(agentId: string, input?: any, wait?: boolean | number): Promise<AgentRequestResult>;
|
|
221
221
|
message(agentId: string, message: any): Promise<AgentMessageResult>;
|
|
222
|
+
/**
|
|
223
|
+
* Send a message to an agent and synchronously await its next response on the session.
|
|
224
|
+
*
|
|
225
|
+
* Session lifecycle:
|
|
226
|
+
* - Omit `sessionId` on the first call — the server mints a new session and returns
|
|
227
|
+
* its id in the result. Capture it.
|
|
228
|
+
* - Pass the returned `sessionId` on every subsequent call to continue the conversation.
|
|
229
|
+
* - An unknown `sessionId` is rejected (the server will not silently mint one); omit
|
|
230
|
+
* the field entirely to start a new session.
|
|
231
|
+
*
|
|
232
|
+
* Concurrency: only one chat may be in flight per session. Concurrent calls on the
|
|
233
|
+
* same session are rejected by the venue.
|
|
234
|
+
*
|
|
235
|
+
* Blocking: always blocks until the agent produces its next response on the session.
|
|
236
|
+
* No polling required.
|
|
237
|
+
*/
|
|
238
|
+
chat(agentId: string, message: any, sessionId?: string): Promise<AgentChatResult>;
|
|
222
239
|
trigger(agentId: string): Promise<AgentTriggerResult>;
|
|
223
240
|
query(agentId: string): Promise<AgentQueryResult>;
|
|
224
241
|
list(includeTerminated?: boolean): Promise<AgentListResult>;
|
|
@@ -678,6 +695,16 @@ interface AgentMessageResult {
|
|
|
678
695
|
agentId: string;
|
|
679
696
|
delivered: boolean;
|
|
680
697
|
}
|
|
698
|
+
interface AgentChatInput {
|
|
699
|
+
agentId: string;
|
|
700
|
+
message: any;
|
|
701
|
+
sessionId?: string;
|
|
702
|
+
}
|
|
703
|
+
interface AgentChatResult {
|
|
704
|
+
agentId: string;
|
|
705
|
+
sessionId: string;
|
|
706
|
+
response: any;
|
|
707
|
+
}
|
|
681
708
|
interface AgentTriggerInput {
|
|
682
709
|
agentId: string;
|
|
683
710
|
}
|
|
@@ -1010,4 +1037,4 @@ declare function decodePublicKey(multikey: string): Uint8Array;
|
|
|
1010
1037
|
*/
|
|
1011
1038
|
declare function didFromPublicKey(publicKey: Uint8Array): string;
|
|
1012
1039
|
|
|
1013
|
-
export { type AdapterInfo, type AdaptersResult, type AgentCancelTaskInput, type AgentCard, type AgentCreateInput, type AgentCreateResult, type AgentDeleteInput, type AgentDeleteResult, type AgentListInput, type AgentListResult, AgentManager, type AgentMessageInput, type AgentMessageResult, type AgentQueryInput, type AgentQueryResult, 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, AssetNotFoundError, Auth, BearerAuth, type ContentDetails, type ContentHashResult, CoviaConnectionError, CoviaError, CoviaTimeoutError, type Credentials, CredentialsHTTP, type DIDDocument, DataAsset, type FunctionInfo, type FunctionsResult, Grid, GridError, type InvokeOptions, type InvokePayload, Job, JobFailedError, JobManager, type JobMetadata, JobNotFoundError, JobStatus, KeyPairAuth, type MCPDiscovery, NoAuth, NotFoundError, Operation, type OperationDetails, type OperationInfo, OperationManager, type OperationPayload, RunStatus, type SSEEvent, type SecretExtractInput, type SecretExtractResult, SecretManager, type SecretSetInput, type SecretSetResult, type StatsData, type StatusData, type UCANAttenuation, type UCANIssueInput, type UCANIssueResult, UCANManager, Venue, type VenueConstructor, type VenueData, type VenueInterface, type VenueOptions, type WorkspaceAppendInput, type WorkspaceAppendResult, type WorkspaceDeleteInput, type WorkspaceDeleteResult, type WorkspaceListInput, type WorkspaceListResult, WorkspaceManager, type WorkspaceReadInput, type WorkspaceReadResult, type WorkspaceSliceInput, type WorkspaceSliceResult, type WorkspaceWriteInput, type WorkspaceWriteResult, createSSEEvent, decodePublicKey, didFromPublicKey, encodePublicKey, fetchStreamWithError, fetchWithError, generateKeyPair, getAssetIdFromPath, getAssetIdFromVenueId, getParsedAssetId, hexToPrivateKey, isJobComplete, isJobFinished, isJobPaused, logger, parseSSEStream, privateKeyToHex };
|
|
1040
|
+
export { type AdapterInfo, type AdaptersResult, type AgentCancelTaskInput, type AgentCard, type AgentChatInput, type AgentChatResult, type AgentCreateInput, type AgentCreateResult, type AgentDeleteInput, type AgentDeleteResult, type AgentListInput, type AgentListResult, AgentManager, type AgentMessageInput, type AgentMessageResult, type AgentQueryInput, type AgentQueryResult, 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, AssetNotFoundError, Auth, BearerAuth, type ContentDetails, type ContentHashResult, CoviaConnectionError, CoviaError, CoviaTimeoutError, type Credentials, CredentialsHTTP, type DIDDocument, DataAsset, type FunctionInfo, type FunctionsResult, Grid, GridError, type InvokeOptions, type InvokePayload, Job, JobFailedError, JobManager, type JobMetadata, JobNotFoundError, JobStatus, KeyPairAuth, type MCPDiscovery, NoAuth, NotFoundError, Operation, type OperationDetails, type OperationInfo, OperationManager, type OperationPayload, RunStatus, type SSEEvent, type SecretExtractInput, type SecretExtractResult, SecretManager, type SecretSetInput, type SecretSetResult, type StatsData, type StatusData, type UCANAttenuation, type UCANIssueInput, type UCANIssueResult, UCANManager, Venue, type VenueConstructor, type VenueData, type VenueInterface, type VenueOptions, type WorkspaceAppendInput, type WorkspaceAppendResult, type WorkspaceDeleteInput, type WorkspaceDeleteResult, type WorkspaceListInput, type WorkspaceListResult, WorkspaceManager, type WorkspaceReadInput, type WorkspaceReadResult, type WorkspaceSliceInput, type WorkspaceSliceResult, type WorkspaceWriteInput, type WorkspaceWriteResult, createSSEEvent, decodePublicKey, didFromPublicKey, encodePublicKey, fetchStreamWithError, fetchWithError, generateKeyPair, getAssetIdFromPath, getAssetIdFromVenueId, getParsedAssetId, hexToPrivateKey, isJobComplete, isJobFinished, isJobPaused, logger, parseSSEStream, privateKeyToHex };
|
package/dist/index.js
CHANGED
|
@@ -1350,6 +1350,25 @@ var AgentManager = class {
|
|
|
1350
1350
|
async message(agentId, message) {
|
|
1351
1351
|
return this.venue.operations.run("v/ops/agent/message", { agentId, message });
|
|
1352
1352
|
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Send a message to an agent and synchronously await its next response on the session.
|
|
1355
|
+
*
|
|
1356
|
+
* Session lifecycle:
|
|
1357
|
+
* - Omit `sessionId` on the first call — the server mints a new session and returns
|
|
1358
|
+
* its id in the result. Capture it.
|
|
1359
|
+
* - Pass the returned `sessionId` on every subsequent call to continue the conversation.
|
|
1360
|
+
* - An unknown `sessionId` is rejected (the server will not silently mint one); omit
|
|
1361
|
+
* the field entirely to start a new session.
|
|
1362
|
+
*
|
|
1363
|
+
* Concurrency: only one chat may be in flight per session. Concurrent calls on the
|
|
1364
|
+
* same session are rejected by the venue.
|
|
1365
|
+
*
|
|
1366
|
+
* Blocking: always blocks until the agent produces its next response on the session.
|
|
1367
|
+
* No polling required.
|
|
1368
|
+
*/
|
|
1369
|
+
async chat(agentId, message, sessionId) {
|
|
1370
|
+
return this.venue.operations.run("v/ops/agent/chat", { agentId, message, sessionId });
|
|
1371
|
+
}
|
|
1353
1372
|
async trigger(agentId) {
|
|
1354
1373
|
return this.venue.operations.run("v/ops/agent/trigger", { agentId });
|
|
1355
1374
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1348,6 +1348,25 @@ var AgentManager = class {
|
|
|
1348
1348
|
async message(agentId, message) {
|
|
1349
1349
|
return this.venue.operations.run("v/ops/agent/message", { agentId, message });
|
|
1350
1350
|
}
|
|
1351
|
+
/**
|
|
1352
|
+
* Send a message to an agent and synchronously await its next response on the session.
|
|
1353
|
+
*
|
|
1354
|
+
* Session lifecycle:
|
|
1355
|
+
* - Omit `sessionId` on the first call — the server mints a new session and returns
|
|
1356
|
+
* its id in the result. Capture it.
|
|
1357
|
+
* - Pass the returned `sessionId` on every subsequent call to continue the conversation.
|
|
1358
|
+
* - An unknown `sessionId` is rejected (the server will not silently mint one); omit
|
|
1359
|
+
* the field entirely to start a new session.
|
|
1360
|
+
*
|
|
1361
|
+
* Concurrency: only one chat may be in flight per session. Concurrent calls on the
|
|
1362
|
+
* same session are rejected by the venue.
|
|
1363
|
+
*
|
|
1364
|
+
* Blocking: always blocks until the agent produces its next response on the session.
|
|
1365
|
+
* No polling required.
|
|
1366
|
+
*/
|
|
1367
|
+
async chat(agentId, message, sessionId) {
|
|
1368
|
+
return this.venue.operations.run("v/ops/agent/chat", { agentId, message, sessionId });
|
|
1369
|
+
}
|
|
1351
1370
|
async trigger(agentId) {
|
|
1352
1371
|
return this.venue.operations.run("v/ops/agent/trigger", { agentId });
|
|
1353
1372
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@covia/covia-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Typescript library for covia-ai",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"test": "jest",
|
|
23
23
|
"test:unit": "jest src/__tests__/",
|
|
24
24
|
"test:integration": "jest venue.test.ts",
|
|
25
|
-
"prepublishOnly": "npm run build && npm test",
|
|
25
|
+
"prepublishOnly": "npm run build && npm run test:unit",
|
|
26
26
|
"prepare": "npm run build"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|