@blazingagents/sdk 0.5.0 → 0.6.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/contracts/entities/prompts.d.ts +5 -0
- package/dist/contracts/entities/prompts.js +4 -1
- package/dist/contracts/entities/providers.d.ts +16 -3
- package/dist/contracts/entities/providers.js +6 -2
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/resources/prompts.js +2 -3
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ export declare const promptTemplateSchema: z.ZodString;
|
|
|
10
10
|
export declare const promptSchema: z.ZodObject<{
|
|
11
11
|
id: z.ZodString;
|
|
12
12
|
tenantId: z.ZodString;
|
|
13
|
+
agentId: z.ZodNullable<z.ZodString>;
|
|
13
14
|
name: z.ZodString;
|
|
14
15
|
template: z.ZodString;
|
|
15
16
|
variables: z.ZodArray<z.ZodString>;
|
|
@@ -22,6 +23,7 @@ export declare const promptsResponseSchema: z.ZodObject<{
|
|
|
22
23
|
prompts: z.ZodArray<z.ZodObject<{
|
|
23
24
|
id: z.ZodString;
|
|
24
25
|
tenantId: z.ZodString;
|
|
26
|
+
agentId: z.ZodNullable<z.ZodString>;
|
|
25
27
|
name: z.ZodString;
|
|
26
28
|
template: z.ZodString;
|
|
27
29
|
variables: z.ZodArray<z.ZodString>;
|
|
@@ -34,6 +36,7 @@ export declare const promptsResponseSchema: z.ZodObject<{
|
|
|
34
36
|
export declare const promptResponseSchema: z.ZodObject<{
|
|
35
37
|
id: z.ZodString;
|
|
36
38
|
tenantId: z.ZodString;
|
|
39
|
+
agentId: z.ZodNullable<z.ZodString>;
|
|
37
40
|
name: z.ZodString;
|
|
38
41
|
template: z.ZodString;
|
|
39
42
|
variables: z.ZodArray<z.ZodString>;
|
|
@@ -45,10 +48,12 @@ export declare const promptResponseSchema: z.ZodObject<{
|
|
|
45
48
|
export declare const createPromptBodySchema: z.ZodObject<{
|
|
46
49
|
name: z.ZodString;
|
|
47
50
|
template: z.ZodString;
|
|
51
|
+
agentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
52
|
userId: z.ZodDefault<z.ZodString>;
|
|
49
53
|
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
50
54
|
}, z.core.$strict>;
|
|
51
55
|
export declare const updatePromptBodySchema: z.ZodObject<{
|
|
56
|
+
agentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
57
|
name: z.ZodOptional<z.ZodString>;
|
|
53
58
|
template: z.ZodOptional<z.ZodString>;
|
|
54
59
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { promptIdSchema, tenantIdSchema } from "../ids.js";
|
|
2
|
+
import { agentIdSchema, promptIdSchema, tenantIdSchema } from "../ids.js";
|
|
3
3
|
import { MAX_PROMPT_NAME_LENGTH, MAX_PROMPT_TEMPLATE_BYTES, MAX_PROMPT_VARIABLES, } from "../limitations.js";
|
|
4
4
|
import { atLeastOneFieldMessage, hasObjectKeys } from "../utils.js";
|
|
5
5
|
import { metadataSchema, userIdSchema } from "./attribution.js";
|
|
@@ -49,6 +49,7 @@ export const promptSchema = z
|
|
|
49
49
|
.object({
|
|
50
50
|
id: promptIdSchema,
|
|
51
51
|
tenantId: tenantIdSchema,
|
|
52
|
+
agentId: agentIdSchema.nullable(),
|
|
52
53
|
name: promptNameSchema,
|
|
53
54
|
template: promptTemplateSchema,
|
|
54
55
|
variables: z.array(z.string().min(1)),
|
|
@@ -68,12 +69,14 @@ export const createPromptBodySchema = z
|
|
|
68
69
|
.object({
|
|
69
70
|
name: promptNameSchema,
|
|
70
71
|
template: promptTemplateSchema,
|
|
72
|
+
agentId: agentIdSchema.nullable().optional(),
|
|
71
73
|
userId: userIdSchema.default(""),
|
|
72
74
|
metadata: metadataSchema.default({}),
|
|
73
75
|
})
|
|
74
76
|
.strict();
|
|
75
77
|
export const updatePromptBodySchema = z
|
|
76
78
|
.object({
|
|
79
|
+
agentId: agentIdSchema.nullable().optional(),
|
|
77
80
|
name: promptNameSchema.optional(),
|
|
78
81
|
template: promptTemplateSchema.optional(),
|
|
79
82
|
metadata: metadataSchema.optional(),
|
|
@@ -36,7 +36,7 @@ export declare const providerSchema: z.ZodObject<{
|
|
|
36
36
|
updatedAt: z.ZodISODateTime;
|
|
37
37
|
}, z.core.$strict>;
|
|
38
38
|
/**
|
|
39
|
-
* Wire response — `GET /v1/providers
|
|
39
|
+
* Wire response — `GET /v1/providers/{id}` shape per
|
|
40
40
|
* ticket 12: `{ id, name, providerType, baseUrl, keyFragment, createdAt,
|
|
41
41
|
* updatedAt }`. The Vault pointer and tenant id are write-only/internal.
|
|
42
42
|
*/
|
|
@@ -56,6 +56,21 @@ export declare const providerResponseSchema: z.ZodObject<{
|
|
|
56
56
|
createdAt: z.ZodISODateTime;
|
|
57
57
|
updatedAt: z.ZodISODateTime;
|
|
58
58
|
}, z.core.$strip>;
|
|
59
|
+
export declare const providerListItemSchema: z.ZodObject<{
|
|
60
|
+
id: z.ZodString;
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
providerType: z.ZodEnum<{
|
|
63
|
+
anthropic: "anthropic";
|
|
64
|
+
custom: "custom";
|
|
65
|
+
google: "google";
|
|
66
|
+
openai: "openai";
|
|
67
|
+
openrouter: "openrouter";
|
|
68
|
+
vercel_ai_gateway: "vercel_ai_gateway";
|
|
69
|
+
}>;
|
|
70
|
+
createdAt: z.ZodISODateTime;
|
|
71
|
+
updatedAt: z.ZodISODateTime;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
export type ProviderListItem = z.infer<typeof providerListItemSchema>;
|
|
59
74
|
export declare const providersResponseSchema: z.ZodObject<{
|
|
60
75
|
providers: z.ZodArray<z.ZodObject<{
|
|
61
76
|
id: z.ZodString;
|
|
@@ -68,8 +83,6 @@ export declare const providersResponseSchema: z.ZodObject<{
|
|
|
68
83
|
openrouter: "openrouter";
|
|
69
84
|
vercel_ai_gateway: "vercel_ai_gateway";
|
|
70
85
|
}>;
|
|
71
|
-
baseUrl: z.ZodNullable<z.ZodString>;
|
|
72
|
-
keyFragment: z.ZodString;
|
|
73
86
|
createdAt: z.ZodISODateTime;
|
|
74
87
|
updatedAt: z.ZodISODateTime;
|
|
75
88
|
}, z.core.$strip>>;
|
|
@@ -39,7 +39,7 @@ export const providerSchema = z
|
|
|
39
39
|
})
|
|
40
40
|
.strict();
|
|
41
41
|
/**
|
|
42
|
-
* Wire response — `GET /v1/providers
|
|
42
|
+
* Wire response — `GET /v1/providers/{id}` shape per
|
|
43
43
|
* ticket 12: `{ id, name, providerType, baseUrl, keyFragment, createdAt,
|
|
44
44
|
* updatedAt }`. The Vault pointer and tenant id are write-only/internal.
|
|
45
45
|
*/
|
|
@@ -54,9 +54,13 @@ export const providerResponseSchema = z
|
|
|
54
54
|
updatedAt: z.iso.datetime({ offset: true }),
|
|
55
55
|
})
|
|
56
56
|
.strip();
|
|
57
|
+
export const providerListItemSchema = providerResponseSchema.omit({
|
|
58
|
+
baseUrl: true,
|
|
59
|
+
keyFragment: true,
|
|
60
|
+
});
|
|
57
61
|
export const providersResponseSchema = z
|
|
58
62
|
.object({
|
|
59
|
-
providers: z.array(
|
|
63
|
+
providers: z.array(providerListItemSchema),
|
|
60
64
|
})
|
|
61
65
|
.strip();
|
|
62
66
|
export const providerModelsResponseSchema = z
|
|
@@ -8,7 +8,7 @@ export { blazingAgentsChatMessageMetadataSchema, chatModeSchema, chatRequestBody
|
|
|
8
8
|
export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.ts";
|
|
9
9
|
export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.ts";
|
|
10
10
|
export { createPromptBodySchema, promptResponseSchema, promptSchema, promptsResponseSchema, updatePromptBodySchema, } from "./entities/prompts.ts";
|
|
11
|
-
export { createProviderBodySchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.ts";
|
|
11
|
+
export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.ts";
|
|
12
12
|
export type { ToolApprovalDecisionResponse, ToolApprovalsResponse, } from "./entities/sessions.ts";
|
|
13
13
|
export { decideToolApprovalBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionResponseSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.ts";
|
|
14
14
|
export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.ts";
|
package/dist/contracts/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export { blazingAgentsChatMessageMetadataSchema, chatModeSchema, chatRequestBody
|
|
|
8
8
|
export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.js";
|
|
9
9
|
export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.js";
|
|
10
10
|
export { createPromptBodySchema, promptResponseSchema, promptSchema, promptsResponseSchema, updatePromptBodySchema, } from "./entities/prompts.js";
|
|
11
|
-
export { createProviderBodySchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.js";
|
|
11
|
+
export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.js";
|
|
12
12
|
export { decideToolApprovalBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionResponseSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.js";
|
|
13
13
|
export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.js";
|
|
14
14
|
export { createTaskBodySchema, createTaskResponseSchema, createTaskRunBodySchema, createTaskRunResponseSchema, taskListItemSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleKindSchema, taskSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { BlazingAgents } from "./client.ts";
|
|
|
12
12
|
export type { Agent, AgentResponse, AgentsResponse, AgentVersion, AgentVersionsListQuery, AgentVersionsResponse, CreateAgentBody, UpdateAgentBody, } from "./contracts/entities/agents.ts";
|
|
13
13
|
export type { ArtifactDownloadUrlResponse, ArtifactListItem, ArtifactsListResponse, } from "./contracts/entities/artifacts.ts";
|
|
14
14
|
export type { CreateMcpConnectionBody, McpAttachmentResponse, McpAttachmentsResponse, McpConnectionAuthType, McpConnectionOauthConnectResponse, McpConnectionReconnectResult, McpConnectionResponse, McpConnectionStatus, McpConnectionTestResponse, ReconnectMcpConnectionBody, UpdateMcpAttachmentBody, UpdateMcpConnectionBody, } from "./contracts/entities/mcp-connections.ts";
|
|
15
|
-
export type { CreateProviderBody, ProviderModel, ProviderModelsResponse, ProviderResponse, ProvidersResponse, ProviderType, ThinkingLevelsResponse, UpdateProviderBody, } from "./contracts/entities/providers.ts";
|
|
15
|
+
export type { CreateProviderBody, ProviderListItem, ProviderModel, ProviderModelsResponse, ProviderResponse, ProvidersResponse, ProviderType, ThinkingLevelsResponse, UpdateProviderBody, } from "./contracts/entities/providers.ts";
|
|
16
16
|
export type { CreateSkillBody, Skill, SkillArchiveType, SkillCopyResult, SkillCopyResults, SkillDetail, SkillFile, SkillsListResponse, } from "./contracts/entities/skills.ts";
|
|
17
17
|
export type { CreateWorkspaceBody, UpdateWorkspaceBody, Workspace, WorkspaceNetworkPolicy, WorkspacesListResponse, } from "./contracts/entities/workspaces.ts";
|
|
18
18
|
export { BlazingAgentsDirectChatTransport, type BlazingAgentsDirectChatTransportOptions, } from "./direct-chat-transport.ts";
|
|
@@ -13,11 +13,10 @@ export function createPromptsResource(config) {
|
|
|
13
13
|
method: "POST",
|
|
14
14
|
}, promptResponseSchema);
|
|
15
15
|
},
|
|
16
|
-
async list({ userId, abortSignal } = {}) {
|
|
16
|
+
async list({ userId, agentId, abortSignal } = {}) {
|
|
17
17
|
return await requestJson(config, "/v1/prompts", {
|
|
18
18
|
signal: abortSignal,
|
|
19
|
-
|
|
20
|
-
...(userId === undefined ? {} : { query: { userId } }),
|
|
19
|
+
query: { userId, agentId },
|
|
21
20
|
}, promptsResponseSchema);
|
|
22
21
|
},
|
|
23
22
|
async get({ promptId, abortSignal }) {
|
package/dist/types.d.ts
CHANGED
|
@@ -319,6 +319,7 @@ export interface PromptsResource {
|
|
|
319
319
|
} & ResourceRequestOptions): Promise<PromptResponse>;
|
|
320
320
|
list(input?: {
|
|
321
321
|
userId?: string;
|
|
322
|
+
agentId?: string;
|
|
322
323
|
} & ResourceRequestOptions): Promise<PromptsResponse>;
|
|
323
324
|
update(input: UpdatePromptBody & {
|
|
324
325
|
promptId: string;
|