@blazingagents/sdk 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -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(),
|
|
@@ -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;
|