@blazingagents/sdk 0.19.0 → 0.21.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 +17 -1
- package/dist/approvals.d.ts +4 -12
- package/dist/approvals.js +12 -13
- package/dist/chat-transport.d.ts +18 -1
- package/dist/chat-transport.js +16 -0
- package/dist/client.d.ts +28 -5
- package/dist/client.js +39 -7
- package/dist/contracts/api.d.ts +40 -6
- package/dist/contracts/api.js +30 -2
- package/dist/contracts/entities/agent-tools.d.ts +5 -2
- package/dist/contracts/entities/agent-tools.js +5 -2
- package/dist/contracts/entities/agents.d.ts +4 -0
- package/dist/contracts/entities/agents.js +9 -0
- package/dist/contracts/entities/chat.d.ts +11 -10
- package/dist/contracts/entities/chat.js +11 -7
- package/dist/contracts/entities/mcp-connections.d.ts +3 -1
- package/dist/contracts/entities/mcp-connections.js +3 -1
- package/dist/contracts/entities/prompts.d.ts +13 -0
- package/dist/contracts/entities/prompts.js +13 -0
- package/dist/contracts/entities/session-inputs.d.ts +29 -87
- package/dist/contracts/entities/session-inputs.js +21 -19
- package/dist/contracts/entities/sessions.d.ts +27 -17
- package/dist/contracts/entities/sessions.js +23 -8
- package/dist/contracts/entities/skills.d.ts +3 -0
- package/dist/contracts/entities/skills.js +3 -0
- package/dist/contracts/entities/tasks.d.ts +1 -0
- package/dist/contracts/entities/usage.d.ts +4 -1
- package/dist/contracts/entities/usage.js +7 -1
- package/dist/contracts/entities/workspaces.d.ts +17 -6
- package/dist/contracts/entities/workspaces.js +3 -7
- package/dist/contracts/ids.d.ts +31 -0
- package/dist/contracts/ids.js +34 -0
- package/dist/contracts/index.d.ts +7 -6
- package/dist/contracts/index.js +4 -4
- package/dist/contracts/utils.d.ts +10 -0
- package/dist/contracts/utils.js +10 -0
- package/dist/direct-chat-transport.d.ts +30 -3
- package/dist/direct-chat-transport.js +40 -35
- package/dist/errors.d.ts +9 -0
- package/dist/errors.js +9 -0
- package/dist/functions.d.ts +35 -2
- package/dist/functions.js +60 -4
- package/dist/generation.d.ts +34 -2
- package/dist/generation.js +97 -19
- package/dist/http.d.ts +26 -0
- package/dist/http.js +43 -0
- package/dist/index.d.ts +4 -4
- package/dist/relay.d.ts +26 -3
- package/dist/relay.js +25 -10
- package/dist/resources/agents.d.ts +5 -0
- package/dist/resources/agents.js +38 -0
- package/dist/resources/artifacts.d.ts +2 -0
- package/dist/resources/artifacts.js +14 -0
- package/dist/resources/chat-connections.d.ts +5 -0
- package/dist/resources/chat-connections.js +32 -0
- package/dist/resources/chat-deliveries.d.ts +2 -0
- package/dist/resources/chat-deliveries.js +5 -0
- package/dist/resources/mcp-connections.d.ts +5 -0
- package/dist/resources/mcp-connections.js +26 -0
- package/dist/resources/memories.d.ts +2 -0
- package/dist/resources/memories.js +17 -0
- package/dist/resources/merchant-bindings.d.ts +2 -0
- package/dist/resources/merchant-bindings.js +11 -0
- package/dist/resources/merchant-connection.d.ts +2 -0
- package/dist/resources/merchant-connection.js +14 -0
- package/dist/resources/merchant-usage-events.d.ts +2 -0
- package/dist/resources/merchant-usage-events.js +20 -0
- package/dist/resources/prompts.d.ts +5 -0
- package/dist/resources/prompts.js +20 -0
- package/dist/resources/providers.d.ts +2 -0
- package/dist/resources/providers.js +23 -0
- package/dist/resources/sessions.d.ts +2 -0
- package/dist/resources/sessions.js +42 -39
- package/dist/resources/skills.d.ts +5 -0
- package/dist/resources/skills.js +35 -0
- package/dist/resources/tasks.d.ts +2 -0
- package/dist/resources/tasks.js +32 -0
- package/dist/resources/tenant.d.ts +2 -0
- package/dist/resources/tenant.js +8 -0
- package/dist/resources/usage.d.ts +2 -0
- package/dist/resources/usage.js +14 -0
- package/dist/resources/workspaces.d.ts +5 -0
- package/dist/resources/workspaces.js +20 -0
- package/dist/types.d.ts +691 -48
- package/package.json +1 -1
package/dist/resources/agents.js
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { agentResponseSchema, agentsResponseSchema, } from "../contracts/entities/agents.js";
|
|
2
2
|
import { mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, } from "../contracts/entities/mcp-connections.js";
|
|
3
3
|
import { requestJson } from "../http.js";
|
|
4
|
+
/**
|
|
5
|
+
* Builds the Agents operations using the shared HTTP configuration.
|
|
6
|
+
* @param config - Shared authentication and transport configuration.
|
|
7
|
+
* @returns The configured resource client.
|
|
8
|
+
*/
|
|
4
9
|
export function createAgentsResource(config) {
|
|
10
|
+
/**
|
|
11
|
+
* Updates agents.
|
|
12
|
+
*/
|
|
5
13
|
const update = async ({ agentId, abortSignal, ...body }) => requestJson(config, `/v1/agents/${agentId}`, {
|
|
6
14
|
json: body,
|
|
7
15
|
signal: abortSignal,
|
|
8
16
|
method: "PUT",
|
|
9
17
|
}, agentResponseSchema);
|
|
10
18
|
return {
|
|
19
|
+
/**
|
|
20
|
+
* Creates agents.
|
|
21
|
+
*/
|
|
11
22
|
async create({ abortSignal, ...body }) {
|
|
12
23
|
return await requestJson(config, "/v1/agents", {
|
|
13
24
|
json: body,
|
|
@@ -15,6 +26,9 @@ export function createAgentsResource(config) {
|
|
|
15
26
|
method: "POST",
|
|
16
27
|
}, agentResponseSchema);
|
|
17
28
|
},
|
|
29
|
+
/**
|
|
30
|
+
* Lists one page of agents.
|
|
31
|
+
*/
|
|
18
32
|
async list(options = {}) {
|
|
19
33
|
return await requestJson(config, "/v1/agents", {
|
|
20
34
|
signal: options.abortSignal,
|
|
@@ -26,22 +40,40 @@ export function createAgentsResource(config) {
|
|
|
26
40
|
},
|
|
27
41
|
}, agentsResponseSchema);
|
|
28
42
|
},
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves agents.
|
|
45
|
+
*/
|
|
29
46
|
async get({ agentId, abortSignal }) {
|
|
30
47
|
return await requestJson(config, `/v1/agents/${agentId}`, { signal: abortSignal }, agentResponseSchema);
|
|
31
48
|
},
|
|
49
|
+
/**
|
|
50
|
+
* Disables agents.
|
|
51
|
+
*/
|
|
32
52
|
async disable({ agentId, abortSignal }) {
|
|
33
53
|
return await requestJson(config, `/v1/agents/${agentId}/disable`, { method: "POST", signal: abortSignal }, agentResponseSchema);
|
|
34
54
|
},
|
|
55
|
+
/**
|
|
56
|
+
* Enables agents.
|
|
57
|
+
*/
|
|
35
58
|
async enable({ agentId, abortSignal }) {
|
|
36
59
|
return await requestJson(config, `/v1/agents/${agentId}/enable`, { method: "POST", signal: abortSignal }, agentResponseSchema);
|
|
37
60
|
},
|
|
61
|
+
/**
|
|
62
|
+
* Lists the Agent MCP attachments.
|
|
63
|
+
*/
|
|
38
64
|
async listMcpAttachments({ agentId, abortSignal }) {
|
|
39
65
|
return await requestJson(config, `/v1/agents/${agentId}/mcp-attachments`, { signal: abortSignal }, mcpAttachmentsResponseSchema);
|
|
40
66
|
},
|
|
41
67
|
update,
|
|
68
|
+
/**
|
|
69
|
+
* Updates one Agent MCP attachment.
|
|
70
|
+
*/
|
|
42
71
|
async updateMcpAttachment({ agentId, mcpConnectionId, abortSignal, ...body }) {
|
|
43
72
|
return await requestJson(config, `/v1/agents/${agentId}/mcp-attachments/${mcpConnectionId}`, { json: body, method: "PATCH", signal: abortSignal }, mcpAttachmentResponseSchema);
|
|
44
73
|
},
|
|
74
|
+
/**
|
|
75
|
+
* Deletes agents.
|
|
76
|
+
*/
|
|
45
77
|
async delete({ agentId, includeArtifacts, abortSignal }) {
|
|
46
78
|
await requestJson(config, `/v1/agents/${agentId}`, {
|
|
47
79
|
method: "DELETE",
|
|
@@ -49,6 +81,9 @@ export function createAgentsResource(config) {
|
|
|
49
81
|
signal: abortSignal,
|
|
50
82
|
});
|
|
51
83
|
},
|
|
84
|
+
/**
|
|
85
|
+
* Uploads an Agent avatar as multipart form data.
|
|
86
|
+
*/
|
|
52
87
|
async uploadAvatar({ agentId, file, abortSignal }) {
|
|
53
88
|
const form = new FormData();
|
|
54
89
|
form.append("file", file);
|
|
@@ -58,6 +93,9 @@ export function createAgentsResource(config) {
|
|
|
58
93
|
method: "POST",
|
|
59
94
|
}, agentResponseSchema);
|
|
60
95
|
},
|
|
96
|
+
/**
|
|
97
|
+
* Removes the Agent avatar.
|
|
98
|
+
*/
|
|
61
99
|
async removeAvatar({ agentId, abortSignal }) {
|
|
62
100
|
return await requestJson(config, `/v1/agents/${agentId}/avatar`, { method: "DELETE", signal: abortSignal }, agentResponseSchema);
|
|
63
101
|
},
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ArtifactsResource, HttpConfig } from "../types.ts";
|
|
2
2
|
/**
|
|
3
3
|
* `client.artifacts` — Tenant-level metadata and direct download URLs.
|
|
4
|
+
* @param config - Shared authentication and transport configuration.
|
|
5
|
+
* @returns The configured resource client.
|
|
4
6
|
*/
|
|
5
7
|
export declare function createArtifactsResource(config: HttpConfig): ArtifactsResource;
|
|
@@ -2,15 +2,26 @@ import { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsLis
|
|
|
2
2
|
import { requestJson } from "../http.js";
|
|
3
3
|
/**
|
|
4
4
|
* `client.artifacts` — Tenant-level metadata and direct download URLs.
|
|
5
|
+
* @param config - Shared authentication and transport configuration.
|
|
6
|
+
* @returns The configured resource client.
|
|
5
7
|
*/
|
|
6
8
|
export function createArtifactsResource(config) {
|
|
7
9
|
return {
|
|
10
|
+
/**
|
|
11
|
+
* Creates a temporary Artifact download URL.
|
|
12
|
+
*/
|
|
8
13
|
async createDownloadUrl({ artifactId, abortSignal }) {
|
|
9
14
|
return await requestJson(config, `/v1/artifacts/${artifactId}/download-url`, { method: "POST", signal: abortSignal }, artifactDownloadUrlResponseSchema);
|
|
10
15
|
},
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves artifacts.
|
|
18
|
+
*/
|
|
11
19
|
async get({ artifactId, abortSignal }) {
|
|
12
20
|
return await requestJson(config, `/v1/artifacts/${artifactId}`, { signal: abortSignal }, artifactListItemSchema);
|
|
13
21
|
},
|
|
22
|
+
/**
|
|
23
|
+
* Lists one page of artifacts.
|
|
24
|
+
*/
|
|
14
25
|
async list({ abortSignal, ...options } = {}) {
|
|
15
26
|
return await requestJson(config, "/v1/artifacts", {
|
|
16
27
|
signal: abortSignal,
|
|
@@ -21,6 +32,9 @@ export function createArtifactsResource(config) {
|
|
|
21
32
|
},
|
|
22
33
|
}, artifactsListResponseSchema);
|
|
23
34
|
},
|
|
35
|
+
/**
|
|
36
|
+
* Deletes artifacts.
|
|
37
|
+
*/
|
|
24
38
|
async delete({ artifactId, abortSignal }) {
|
|
25
39
|
await requestJson(config, `/v1/artifacts/${artifactId}`, {
|
|
26
40
|
method: "DELETE",
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import type { ChatConnectionsResource, HttpConfig } from "../types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Builds the Chat Connections operations using the shared HTTP configuration.
|
|
4
|
+
* @param config - Shared authentication and transport configuration.
|
|
5
|
+
* @returns The configured resource client.
|
|
6
|
+
*/
|
|
2
7
|
export declare function createChatConnectionsResource(config: HttpConfig): ChatConnectionsResource;
|
|
@@ -1,31 +1,63 @@
|
|
|
1
1
|
import { chatConnectionSchema, chatConnectionsResponseSchema, } from "../contracts/entities/chat-connections.js";
|
|
2
2
|
import { requestJson } from "../http.js";
|
|
3
|
+
/**
|
|
4
|
+
* Builds the Chat Connections operations using the shared HTTP configuration.
|
|
5
|
+
* @param config - Shared authentication and transport configuration.
|
|
6
|
+
* @returns The configured resource client.
|
|
7
|
+
*/
|
|
3
8
|
export function createChatConnectionsResource(config) {
|
|
4
9
|
return {
|
|
10
|
+
/**
|
|
11
|
+
* Lists one page of chat connections.
|
|
12
|
+
*/
|
|
5
13
|
async list({ abortSignal } = {}) {
|
|
6
14
|
return await requestJson(config, "/v1/chat-connections", { signal: abortSignal }, chatConnectionsResponseSchema);
|
|
7
15
|
},
|
|
16
|
+
/**
|
|
17
|
+
* Creates chat connections.
|
|
18
|
+
*/
|
|
8
19
|
async create({ abortSignal, ...body }) {
|
|
9
20
|
return await requestJson(config, "/v1/chat-connections", { signal: abortSignal, method: "POST", json: body }, chatConnectionSchema);
|
|
10
21
|
},
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves chat connections.
|
|
24
|
+
*/
|
|
11
25
|
async get({ chatConnectionId, abortSignal }) {
|
|
12
26
|
return await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}`, { signal: abortSignal, method: "GET" }, chatConnectionSchema);
|
|
13
27
|
},
|
|
28
|
+
/**
|
|
29
|
+
* Updates chat connections.
|
|
30
|
+
*/
|
|
14
31
|
async update({ chatConnectionId, abortSignal, ...body }) {
|
|
15
32
|
return await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}`, { signal: abortSignal, method: "PATCH", json: body }, chatConnectionSchema);
|
|
16
33
|
},
|
|
34
|
+
/**
|
|
35
|
+
* Replaces the Chat Connection credentials.
|
|
36
|
+
*/
|
|
17
37
|
async rotateCredentials({ chatConnectionId, abortSignal, ...body }) {
|
|
18
38
|
return await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}/credentials`, { signal: abortSignal, method: "POST", json: body }, chatConnectionSchema);
|
|
19
39
|
},
|
|
40
|
+
/**
|
|
41
|
+
* Checks the Chat Connection health.
|
|
42
|
+
*/
|
|
20
43
|
async checkHealth({ chatConnectionId, abortSignal }) {
|
|
21
44
|
return await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}/health`, { signal: abortSignal, method: "POST" }, chatConnectionSchema);
|
|
22
45
|
},
|
|
46
|
+
/**
|
|
47
|
+
* Enables chat connections.
|
|
48
|
+
*/
|
|
23
49
|
async enable({ chatConnectionId, abortSignal }) {
|
|
24
50
|
return await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}/enable`, { signal: abortSignal, method: "POST" }, chatConnectionSchema);
|
|
25
51
|
},
|
|
52
|
+
/**
|
|
53
|
+
* Disables chat connections.
|
|
54
|
+
*/
|
|
26
55
|
async disable({ chatConnectionId, abortSignal }) {
|
|
27
56
|
return await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}/disable`, { signal: abortSignal, method: "POST" }, chatConnectionSchema);
|
|
28
57
|
},
|
|
58
|
+
/**
|
|
59
|
+
* Deletes chat connections.
|
|
60
|
+
*/
|
|
29
61
|
async delete({ chatConnectionId, abortSignal }) {
|
|
30
62
|
await requestJson(config, `/v1/chat-connections/${encodeURIComponent(chatConnectionId)}`, { signal: abortSignal, method: "DELETE" });
|
|
31
63
|
},
|
|
@@ -2,5 +2,7 @@ import type { ChatDeliveriesResource, HttpConfig } from "../types.ts";
|
|
|
2
2
|
/**
|
|
3
3
|
* `client.chatDeliveries` — `GET /v1/chat-deliveries`, the Tenant-wide
|
|
4
4
|
* delivery feed across all Chat Connections, newest first.
|
|
5
|
+
* @param config - Shared authentication and transport configuration.
|
|
6
|
+
* @returns The configured resource client.
|
|
5
7
|
*/
|
|
6
8
|
export declare function createChatDeliveriesResource(config: HttpConfig): ChatDeliveriesResource;
|
|
@@ -3,9 +3,14 @@ import { requestJson } from "../http.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* `client.chatDeliveries` — `GET /v1/chat-deliveries`, the Tenant-wide
|
|
5
5
|
* delivery feed across all Chat Connections, newest first.
|
|
6
|
+
* @param config - Shared authentication and transport configuration.
|
|
7
|
+
* @returns The configured resource client.
|
|
6
8
|
*/
|
|
7
9
|
export function createChatDeliveriesResource(config) {
|
|
8
10
|
return {
|
|
11
|
+
/**
|
|
12
|
+
* Lists one page of chat deliveries.
|
|
13
|
+
*/
|
|
9
14
|
async list({ abortSignal, status, ...query } = {}) {
|
|
10
15
|
return await requestJson(config, "/v1/chat-deliveries", {
|
|
11
16
|
query: {
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import type { HttpConfig, McpConnectionsResource } from "../types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Builds the Mcp Connections operations using the shared HTTP configuration.
|
|
4
|
+
* @param config - Shared authentication and transport configuration.
|
|
5
|
+
* @returns The configured resource client.
|
|
6
|
+
*/
|
|
2
7
|
export declare function createMcpConnectionsResource(config: HttpConfig): McpConnectionsResource;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionsResponseSchema, mcpConnectionTestResponseSchema, reconnectMcpConnectionBodySchema, updateMcpConnectionBodySchema, } from "../contracts/entities/mcp-connections.js";
|
|
2
2
|
import { requestJson } from "../http.js";
|
|
3
|
+
/**
|
|
4
|
+
* Builds the Mcp Connections operations using the shared HTTP configuration.
|
|
5
|
+
* @param config - Shared authentication and transport configuration.
|
|
6
|
+
* @returns The configured resource client.
|
|
7
|
+
*/
|
|
3
8
|
export function createMcpConnectionsResource(config) {
|
|
4
9
|
const create = (async ({ abortSignal, ...body }) => requestJson(config, "/v1/mcp-connections", {
|
|
5
10
|
json: body,
|
|
@@ -7,16 +12,28 @@ export function createMcpConnectionsResource(config) {
|
|
|
7
12
|
method: "POST",
|
|
8
13
|
}, mcpConnectionResponseSchema));
|
|
9
14
|
return {
|
|
15
|
+
/**
|
|
16
|
+
* Starts OAuth authorization for mcp connections.
|
|
17
|
+
*/
|
|
10
18
|
async connect({ mcpConnectionId, abortSignal }) {
|
|
11
19
|
return await requestJson(config, `/v1/mcp-connections/${mcpConnectionId}/connect`, { method: "POST", signal: abortSignal }, mcpConnectionOauthConnectResponseSchema);
|
|
12
20
|
},
|
|
13
21
|
create,
|
|
22
|
+
/**
|
|
23
|
+
* Lists one page of mcp connections.
|
|
24
|
+
*/
|
|
14
25
|
async list({ abortSignal } = {}) {
|
|
15
26
|
return await requestJson(config, "/v1/mcp-connections", { signal: abortSignal }, mcpConnectionsResponseSchema);
|
|
16
27
|
},
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves mcp connections.
|
|
30
|
+
*/
|
|
17
31
|
async get({ mcpConnectionId, abortSignal }) {
|
|
18
32
|
return await requestJson(config, `/v1/mcp-connections/${mcpConnectionId}`, { signal: abortSignal }, mcpConnectionResponseSchema);
|
|
19
33
|
},
|
|
34
|
+
/**
|
|
35
|
+
* Updates mcp connections.
|
|
36
|
+
*/
|
|
20
37
|
async update({ mcpConnectionId, abortSignal, ...body }) {
|
|
21
38
|
return await requestJson(config, `/v1/mcp-connections/${mcpConnectionId}`, {
|
|
22
39
|
json: updateMcpConnectionBodySchema.parse(body),
|
|
@@ -24,15 +41,24 @@ export function createMcpConnectionsResource(config) {
|
|
|
24
41
|
method: "PATCH",
|
|
25
42
|
}, mcpConnectionResponseSchema);
|
|
26
43
|
},
|
|
44
|
+
/**
|
|
45
|
+
* Deletes mcp connections.
|
|
46
|
+
*/
|
|
27
47
|
async delete({ mcpConnectionId, abortSignal }) {
|
|
28
48
|
await requestJson(config, `/v1/mcp-connections/${mcpConnectionId}`, {
|
|
29
49
|
method: "DELETE",
|
|
30
50
|
signal: abortSignal,
|
|
31
51
|
});
|
|
32
52
|
},
|
|
53
|
+
/**
|
|
54
|
+
* Tests mcp connections.
|
|
55
|
+
*/
|
|
33
56
|
async test({ mcpConnectionId, abortSignal }) {
|
|
34
57
|
return await requestJson(config, `/v1/mcp-connections/${mcpConnectionId}/test`, { method: "POST", signal: abortSignal }, mcpConnectionTestResponseSchema);
|
|
35
58
|
},
|
|
59
|
+
/**
|
|
60
|
+
* Reconnects mcp connections.
|
|
61
|
+
*/
|
|
36
62
|
async reconnect({ mcpConnectionId, abortSignal, ...body }) {
|
|
37
63
|
return await requestJson(config, `/v1/mcp-connections/${mcpConnectionId}/reconnect`, {
|
|
38
64
|
json: reconnectMcpConnectionBodySchema.parse(body),
|
|
@@ -3,5 +3,7 @@ import type { HttpConfig, MemoriesResource } from "../types.ts";
|
|
|
3
3
|
* `client.memories` — CRUD and query over `/v1/agents/:agentId/memories`.
|
|
4
4
|
* Memories are Agent-nested; `userId` is stamped at creation and immutable,
|
|
5
5
|
* while list can filter it (including explicit `''`) or full-text search.
|
|
6
|
+
* @param config - Shared authentication and transport configuration.
|
|
7
|
+
* @returns The configured resource client.
|
|
6
8
|
*/
|
|
7
9
|
export declare function createMemoriesResource(config: HttpConfig): MemoriesResource;
|
|
@@ -4,9 +4,14 @@ import { requestJson } from "../http.js";
|
|
|
4
4
|
* `client.memories` — CRUD and query over `/v1/agents/:agentId/memories`.
|
|
5
5
|
* Memories are Agent-nested; `userId` is stamped at creation and immutable,
|
|
6
6
|
* while list can filter it (including explicit `''`) or full-text search.
|
|
7
|
+
* @param config - Shared authentication and transport configuration.
|
|
8
|
+
* @returns The configured resource client.
|
|
7
9
|
*/
|
|
8
10
|
export function createMemoriesResource(config) {
|
|
9
11
|
return {
|
|
12
|
+
/**
|
|
13
|
+
* Lists one page of memories.
|
|
14
|
+
*/
|
|
10
15
|
async list({ agentId, abortSignal, ...options }) {
|
|
11
16
|
return await requestJson(config, `/v1/agents/${agentId}/memories`, {
|
|
12
17
|
signal: abortSignal,
|
|
@@ -18,15 +23,27 @@ export function createMemoriesResource(config) {
|
|
|
18
23
|
},
|
|
19
24
|
}, memoriesListResponseSchema);
|
|
20
25
|
},
|
|
26
|
+
/**
|
|
27
|
+
* Creates memories.
|
|
28
|
+
*/
|
|
21
29
|
async create({ agentId, abortSignal, ...body }) {
|
|
22
30
|
return await requestJson(config, `/v1/agents/${agentId}/memories`, { json: body, signal: abortSignal, method: "POST" }, memoryResponseSchema);
|
|
23
31
|
},
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves memories.
|
|
34
|
+
*/
|
|
24
35
|
async get({ agentId, memoryId, abortSignal }) {
|
|
25
36
|
return await requestJson(config, `/v1/agents/${agentId}/memories/${memoryId}`, { signal: abortSignal }, memoryResponseSchema);
|
|
26
37
|
},
|
|
38
|
+
/**
|
|
39
|
+
* Updates memories.
|
|
40
|
+
*/
|
|
27
41
|
async update({ agentId, memoryId, abortSignal, ...body }) {
|
|
28
42
|
return await requestJson(config, `/v1/agents/${agentId}/memories/${memoryId}`, { json: body, signal: abortSignal, method: "PATCH" }, memoryResponseSchema);
|
|
29
43
|
},
|
|
44
|
+
/**
|
|
45
|
+
* Deletes memories.
|
|
46
|
+
*/
|
|
30
47
|
async delete({ agentId, memoryId, abortSignal }) {
|
|
31
48
|
await requestJson(config, `/v1/agents/${agentId}/memories/${memoryId}`, { method: "DELETE", signal: abortSignal });
|
|
32
49
|
},
|
|
@@ -4,5 +4,7 @@ import type { HttpConfig, MerchantBindingsResource } from "../types.ts";
|
|
|
4
4
|
* `/v1/merchant-connection/bindings`. `put` upserts the end user's provider
|
|
5
5
|
* customer; the server validates the customer with the provider before
|
|
6
6
|
* storing.
|
|
7
|
+
* @param config - Shared authentication and transport configuration.
|
|
8
|
+
* @returns The configured resource client.
|
|
7
9
|
*/
|
|
8
10
|
export declare function createMerchantBindingsResource(config: HttpConfig): MerchantBindingsResource;
|
|
@@ -5,15 +5,26 @@ import { requestJson } from "../http.js";
|
|
|
5
5
|
* `/v1/merchant-connection/bindings`. `put` upserts the end user's provider
|
|
6
6
|
* customer; the server validates the customer with the provider before
|
|
7
7
|
* storing.
|
|
8
|
+
* @param config - Shared authentication and transport configuration.
|
|
9
|
+
* @returns The configured resource client.
|
|
8
10
|
*/
|
|
9
11
|
export function createMerchantBindingsResource(config) {
|
|
10
12
|
return {
|
|
13
|
+
/**
|
|
14
|
+
* Lists one page of merchant bindings.
|
|
15
|
+
*/
|
|
11
16
|
async list({ abortSignal, ...query } = {}) {
|
|
12
17
|
return await requestJson(config, "/v1/merchant-connection/bindings", { query, signal: abortSignal }, merchantBindingsResponseSchema);
|
|
13
18
|
},
|
|
19
|
+
/**
|
|
20
|
+
* Validates and saves merchant bindings.
|
|
21
|
+
*/
|
|
14
22
|
async put({ userId, abortSignal, ...body }) {
|
|
15
23
|
return await requestJson(config, `/v1/merchant-connection/bindings/${encodeURIComponent(userId)}`, { json: body, method: "PUT", signal: abortSignal }, merchantBindingResponseSchema);
|
|
16
24
|
},
|
|
25
|
+
/**
|
|
26
|
+
* Deletes merchant bindings.
|
|
27
|
+
*/
|
|
17
28
|
async delete({ userId, abortSignal }) {
|
|
18
29
|
await requestJson(config, `/v1/merchant-connection/bindings/${encodeURIComponent(userId)}`, { method: "DELETE", signal: abortSignal });
|
|
19
30
|
},
|
|
@@ -3,5 +3,7 @@ import type { HttpConfig, MerchantConnectionResource } from "../types.ts";
|
|
|
3
3
|
* `client.merchantConnection` — get/create/update/retire over
|
|
4
4
|
* `/v1/merchant-connection`. One connection per tenant; `credential` is
|
|
5
5
|
* write-only and never returned.
|
|
6
|
+
* @param config - Shared authentication and transport configuration.
|
|
7
|
+
* @returns The configured resource client.
|
|
6
8
|
*/
|
|
7
9
|
export declare function createMerchantConnectionResource(config: HttpConfig): MerchantConnectionResource;
|
|
@@ -4,18 +4,32 @@ import { requestJson } from "../http.js";
|
|
|
4
4
|
* `client.merchantConnection` — get/create/update/retire over
|
|
5
5
|
* `/v1/merchant-connection`. One connection per tenant; `credential` is
|
|
6
6
|
* write-only and never returned.
|
|
7
|
+
* @param config - Shared authentication and transport configuration.
|
|
8
|
+
* @returns The configured resource client.
|
|
7
9
|
*/
|
|
8
10
|
export function createMerchantConnectionResource(config) {
|
|
9
11
|
return {
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves merchant connection.
|
|
14
|
+
*/
|
|
10
15
|
async get({ abortSignal } = {}) {
|
|
11
16
|
return await requestJson(config, "/v1/merchant-connection", { signal: abortSignal }, merchantConnectionResponseSchema);
|
|
12
17
|
},
|
|
18
|
+
/**
|
|
19
|
+
* Creates merchant connection.
|
|
20
|
+
*/
|
|
13
21
|
async create({ abortSignal, ...body }) {
|
|
14
22
|
return await requestJson(config, "/v1/merchant-connection", { json: body, method: "POST", signal: abortSignal }, merchantConnectionResponseSchema);
|
|
15
23
|
},
|
|
24
|
+
/**
|
|
25
|
+
* Updates merchant connection.
|
|
26
|
+
*/
|
|
16
27
|
async update({ abortSignal, ...body }) {
|
|
17
28
|
return await requestJson(config, "/v1/merchant-connection", { json: body, method: "PATCH", signal: abortSignal }, merchantConnectionResponseSchema);
|
|
18
29
|
},
|
|
30
|
+
/**
|
|
31
|
+
* Retires merchant connection.
|
|
32
|
+
*/
|
|
19
33
|
async retire({ abortSignal } = {}) {
|
|
20
34
|
await requestJson(config, "/v1/merchant-connection", {
|
|
21
35
|
method: "DELETE",
|
|
@@ -3,5 +3,7 @@ import type { HttpConfig, MerchantUsageEventsResource } from "../types.ts";
|
|
|
3
3
|
* `client.merchantUsageEvents` — the immutable usage-event ledger over
|
|
4
4
|
* `/v1/merchant-usage-events`, plus the delivery-health `summary` aggregate
|
|
5
5
|
* and the per-event operator actions `retry`/`release`/`discard`.
|
|
6
|
+
* @param config - Shared authentication and transport configuration.
|
|
7
|
+
* @returns The configured resource client.
|
|
6
8
|
*/
|
|
7
9
|
export declare function createMerchantUsageEventsResource(config: HttpConfig): MerchantUsageEventsResource;
|
|
@@ -4,24 +4,44 @@ import { requestJson } from "../http.js";
|
|
|
4
4
|
* `client.merchantUsageEvents` — the immutable usage-event ledger over
|
|
5
5
|
* `/v1/merchant-usage-events`, plus the delivery-health `summary` aggregate
|
|
6
6
|
* and the per-event operator actions `retry`/`release`/`discard`.
|
|
7
|
+
* @param config - Shared authentication and transport configuration.
|
|
8
|
+
* @returns The configured resource client.
|
|
7
9
|
*/
|
|
8
10
|
export function createMerchantUsageEventsResource(config) {
|
|
9
11
|
return {
|
|
12
|
+
/**
|
|
13
|
+
* Lists one page of merchant usage events.
|
|
14
|
+
*/
|
|
10
15
|
async list({ abortSignal, ...query } = {}) {
|
|
11
16
|
return await requestJson(config, "/v1/merchant-usage-events", { query, signal: abortSignal }, merchantUsageEventsResponseSchema);
|
|
12
17
|
},
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves merchant usage events.
|
|
20
|
+
*/
|
|
13
21
|
async get({ eventId, abortSignal }) {
|
|
14
22
|
return await requestJson(config, `/v1/merchant-usage-events/${encodeURIComponent(eventId)}`, { signal: abortSignal }, merchantUsageEventResponseSchema);
|
|
15
23
|
},
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves merchant usage delivery totals for the selected day range.
|
|
26
|
+
*/
|
|
16
27
|
async summary({ abortSignal, ...query } = {}) {
|
|
17
28
|
return await requestJson(config, "/v1/merchant-usage-events/summary", { query, signal: abortSignal }, merchantUsageSummaryResponseSchema);
|
|
18
29
|
},
|
|
30
|
+
/**
|
|
31
|
+
* Retries delivery of merchant usage events.
|
|
32
|
+
*/
|
|
19
33
|
async retry({ eventId, abortSignal }) {
|
|
20
34
|
return await requestJson(config, `/v1/merchant-usage-events/${encodeURIComponent(eventId)}/retry`, { method: "POST", signal: abortSignal }, merchantUsageEventResponseSchema);
|
|
21
35
|
},
|
|
36
|
+
/**
|
|
37
|
+
* Releases merchant usage events.
|
|
38
|
+
*/
|
|
22
39
|
async release({ eventId, abortSignal }) {
|
|
23
40
|
return await requestJson(config, `/v1/merchant-usage-events/${encodeURIComponent(eventId)}/release`, { method: "POST", signal: abortSignal }, merchantUsageEventResponseSchema);
|
|
24
41
|
},
|
|
42
|
+
/**
|
|
43
|
+
* Discards merchant usage events.
|
|
44
|
+
*/
|
|
25
45
|
async discard({ eventId, abortSignal }) {
|
|
26
46
|
return await requestJson(config, `/v1/merchant-usage-events/${encodeURIComponent(eventId)}/discard`, { method: "POST", signal: abortSignal }, merchantUsageEventResponseSchema);
|
|
27
47
|
},
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import type { HttpConfig, PromptsResource } from "../types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Builds the Prompts operations using the shared HTTP configuration.
|
|
4
|
+
* @param config - Shared authentication and transport configuration.
|
|
5
|
+
* @returns The configured resource client.
|
|
6
|
+
*/
|
|
2
7
|
export declare function createPromptsResource(config: HttpConfig): PromptsResource;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { promptResponseSchema, promptsResponseSchema, } from "../contracts/entities/prompts.js";
|
|
2
2
|
import { requestJson } from "../http.js";
|
|
3
|
+
/**
|
|
4
|
+
* Builds the Prompts operations using the shared HTTP configuration.
|
|
5
|
+
* @param config - Shared authentication and transport configuration.
|
|
6
|
+
* @returns The configured resource client.
|
|
7
|
+
*/
|
|
3
8
|
export function createPromptsResource(config) {
|
|
4
9
|
return {
|
|
10
|
+
/**
|
|
11
|
+
* Creates prompts.
|
|
12
|
+
*/
|
|
5
13
|
async create({ abortSignal, ...body }) {
|
|
6
14
|
return await requestJson(config, "/v1/prompts", {
|
|
7
15
|
json: body,
|
|
@@ -9,15 +17,24 @@ export function createPromptsResource(config) {
|
|
|
9
17
|
method: "POST",
|
|
10
18
|
}, promptResponseSchema);
|
|
11
19
|
},
|
|
20
|
+
/**
|
|
21
|
+
* Lists one page of prompts.
|
|
22
|
+
*/
|
|
12
23
|
async list({ userId, agentId, cursor, limit, abortSignal } = {}) {
|
|
13
24
|
return await requestJson(config, "/v1/prompts", {
|
|
14
25
|
signal: abortSignal,
|
|
15
26
|
query: { userId, agentId, cursor, limit },
|
|
16
27
|
}, promptsResponseSchema);
|
|
17
28
|
},
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves prompts.
|
|
31
|
+
*/
|
|
18
32
|
async get({ promptId, abortSignal }) {
|
|
19
33
|
return await requestJson(config, `/v1/prompts/${promptId}`, { signal: abortSignal }, promptResponseSchema);
|
|
20
34
|
},
|
|
35
|
+
/**
|
|
36
|
+
* Updates prompts.
|
|
37
|
+
*/
|
|
21
38
|
async update({ promptId, abortSignal, ...body }) {
|
|
22
39
|
return await requestJson(config, `/v1/prompts/${promptId}`, {
|
|
23
40
|
json: body,
|
|
@@ -25,6 +42,9 @@ export function createPromptsResource(config) {
|
|
|
25
42
|
method: "PATCH",
|
|
26
43
|
}, promptResponseSchema);
|
|
27
44
|
},
|
|
45
|
+
/**
|
|
46
|
+
* Deletes prompts.
|
|
47
|
+
*/
|
|
28
48
|
async delete({ promptId, abortSignal }) {
|
|
29
49
|
await requestJson(config, `/v1/prompts/${promptId}`, {
|
|
30
50
|
method: "DELETE",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { HttpConfig, ProvidersResource } from "../types.ts";
|
|
2
2
|
/**
|
|
3
3
|
* `client.providers` — CRUD and cost-free model discovery.
|
|
4
|
+
* @param config - Shared authentication and transport configuration.
|
|
5
|
+
* @returns The configured resource client.
|
|
4
6
|
*/
|
|
5
7
|
export declare function createProvidersResource(config: HttpConfig): ProvidersResource;
|
|
@@ -2,9 +2,14 @@ import { providerModelsResponseSchema, providerResponseSchema, providersResponse
|
|
|
2
2
|
import { requestJson } from "../http.js";
|
|
3
3
|
/**
|
|
4
4
|
* `client.providers` — CRUD and cost-free model discovery.
|
|
5
|
+
* @param config - Shared authentication and transport configuration.
|
|
6
|
+
* @returns The configured resource client.
|
|
5
7
|
*/
|
|
6
8
|
export function createProvidersResource(config) {
|
|
7
9
|
return {
|
|
10
|
+
/**
|
|
11
|
+
* Creates providers.
|
|
12
|
+
*/
|
|
8
13
|
async create({ abortSignal, ...body }) {
|
|
9
14
|
return await requestJson(config, "/v1/providers", {
|
|
10
15
|
json: body,
|
|
@@ -12,18 +17,33 @@ export function createProvidersResource(config) {
|
|
|
12
17
|
method: "POST",
|
|
13
18
|
}, providerResponseSchema);
|
|
14
19
|
},
|
|
20
|
+
/**
|
|
21
|
+
* Lists one page of providers.
|
|
22
|
+
*/
|
|
15
23
|
async list({ abortSignal } = {}) {
|
|
16
24
|
return await requestJson(config, "/v1/providers", { signal: abortSignal }, providersResponseSchema);
|
|
17
25
|
},
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves providers.
|
|
28
|
+
*/
|
|
18
29
|
async get({ providerId, abortSignal }) {
|
|
19
30
|
return await requestJson(config, `/v1/providers/${providerId}`, { signal: abortSignal }, providerResponseSchema);
|
|
20
31
|
},
|
|
32
|
+
/**
|
|
33
|
+
* Lists models exposed by the Provider.
|
|
34
|
+
*/
|
|
21
35
|
async listModels({ providerId, abortSignal }) {
|
|
22
36
|
return await requestJson(config, `/v1/providers/${providerId}/models`, { signal: abortSignal }, providerModelsResponseSchema);
|
|
23
37
|
},
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves supported thinking levels for a Provider model.
|
|
40
|
+
*/
|
|
24
41
|
async getThinkingLevels({ providerId, model, abortSignal }) {
|
|
25
42
|
return await requestJson(config, `/v1/providers/${providerId}/thinking-levels`, { signal: abortSignal, query: { model } }, thinkingLevelsResponseSchema);
|
|
26
43
|
},
|
|
44
|
+
/**
|
|
45
|
+
* Updates providers.
|
|
46
|
+
*/
|
|
27
47
|
async update({ providerId, abortSignal, ...body }) {
|
|
28
48
|
return await requestJson(config, `/v1/providers/${providerId}`, {
|
|
29
49
|
json: body,
|
|
@@ -31,6 +51,9 @@ export function createProvidersResource(config) {
|
|
|
31
51
|
method: "PATCH",
|
|
32
52
|
}, providerResponseSchema);
|
|
33
53
|
},
|
|
54
|
+
/**
|
|
55
|
+
* Deletes providers.
|
|
56
|
+
*/
|
|
34
57
|
async delete({ providerId, abortSignal, ...options }) {
|
|
35
58
|
await requestJson(config, `/v1/providers/${providerId}`, {
|
|
36
59
|
method: "DELETE",
|
|
@@ -4,5 +4,7 @@ import type { HttpConfig, SessionsResource } from "../types.ts";
|
|
|
4
4
|
* `/v1/agents/:agentId/sessions`. Pagination is manual: the SDK returns
|
|
5
5
|
* the page as-is (`{ data, nextCursor }` verbatim); the caller passes
|
|
6
6
|
* `nextCursor` back as `cursor` on the next call.
|
|
7
|
+
* @param config - Shared authentication and transport configuration.
|
|
8
|
+
* @returns The configured resource client.
|
|
7
9
|
*/
|
|
8
10
|
export declare function createSessionsResource(config: HttpConfig): SessionsResource;
|