@blazingagents/sdk 0.4.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(),
@@ -32,7 +32,8 @@ export declare const sessionsListResponseSchema: z.ZodObject<{
32
32
  /**
33
33
  * `GET /v1/sessions/latest` list item — one per Agent: the Agent's most
34
34
  * recently updated Session (optionally among one end user's Sessions).
35
- * Carries `agentId` because the list spans the whole Tenant.
35
+ * Carries `agentId` and the Agent's current model, Thinking level, and status,
36
+ * independently of the Session's pinned Version.
36
37
  */
37
38
  export declare const latestSessionListItemSchema: z.ZodObject<{
38
39
  agentVersion: z.ZodNullable<z.ZodNumber>;
@@ -44,6 +45,12 @@ export declare const latestSessionListItemSchema: z.ZodObject<{
44
45
  createdAt: z.ZodISODateTime;
45
46
  updatedAt: z.ZodISODateTime;
46
47
  agentId: z.ZodString;
48
+ model: z.ZodNullable<z.ZodString>;
49
+ thinkingLevel: z.ZodNullable<z.ZodString>;
50
+ status: z.ZodEnum<{
51
+ active: "active";
52
+ disabled: "disabled";
53
+ }>;
47
54
  }, z.core.$strip>;
48
55
  export declare const latestSessionsListResponseSchema: z.ZodObject<{
49
56
  data: z.ZodArray<z.ZodObject<{
@@ -56,6 +63,12 @@ export declare const latestSessionsListResponseSchema: z.ZodObject<{
56
63
  createdAt: z.ZodISODateTime;
57
64
  updatedAt: z.ZodISODateTime;
58
65
  agentId: z.ZodString;
66
+ model: z.ZodNullable<z.ZodString>;
67
+ thinkingLevel: z.ZodNullable<z.ZodString>;
68
+ status: z.ZodEnum<{
69
+ active: "active";
70
+ disabled: "disabled";
71
+ }>;
59
72
  }, z.core.$strip>>;
60
73
  nextCursor: z.ZodNullable<z.ZodString>;
61
74
  }, z.core.$strip>;
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import { paginatedResponseSchema } from "../api.js";
3
3
  import { agentIdSchema, sessionIdSchema } from "../ids.js";
4
4
  import { DEFAULT_SESSION_MESSAGES_LIMIT, MAX_SESSION_MESSAGES_LIMIT, } from "../limitations.js";
5
- import { agentVersionNumberSchema } from "./agents.js";
5
+ import { agentSchema, agentVersionNumberSchema } from "./agents.js";
6
6
  import { metadataSchema, userIdSchema } from "./attribution.js";
7
7
  /**
8
8
  * `GET /v1/agents/{agentId}/sessions` list item — the public wire shape:
@@ -27,10 +27,16 @@ export const sessionsListResponseSchema = paginatedResponseSchema(sessionListIte
27
27
  /**
28
28
  * `GET /v1/sessions/latest` list item — one per Agent: the Agent's most
29
29
  * recently updated Session (optionally among one end user's Sessions).
30
- * Carries `agentId` because the list spans the whole Tenant.
30
+ * Carries `agentId` and the Agent's current model, Thinking level, and status,
31
+ * independently of the Session's pinned Version.
31
32
  */
32
33
  export const latestSessionListItemSchema = sessionListItemSchema
33
- .extend({ agentId: agentIdSchema })
34
+ .extend({
35
+ agentId: agentIdSchema,
36
+ model: agentSchema.shape.model,
37
+ thinkingLevel: agentSchema.shape.thinkingLevel,
38
+ status: agentSchema.shape.status,
39
+ })
34
40
  .strip();
35
41
  export const latestSessionsListResponseSchema = paginatedResponseSchema(latestSessionListItemSchema);
36
42
  /**
@@ -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
- // Stryker disable next-line ConditionalExpression: URL serialization omits an undefined query value.
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazingagents/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "TypeScript SDK for the Blazing Agents API",
5
5
  "homepage": "https://docs.blazingagents.com",
6
6
  "bugs": {