@lightsage/mcp 0.4.1 → 0.4.3

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.
Files changed (158) hide show
  1. package/README.md +2 -2
  2. package/bin/mcp-server.js +527 -153
  3. package/bin/mcp-server.js.map +31 -22
  4. package/esm/funcs/promptsRun.d.ts +21 -0
  5. package/esm/funcs/promptsRun.d.ts.map +1 -0
  6. package/esm/funcs/promptsRun.js +88 -0
  7. package/esm/funcs/promptsRun.js.map +1 -0
  8. package/esm/funcs/promptsRunStatus.d.ts +19 -0
  9. package/esm/funcs/promptsRunStatus.d.ts.map +1 -0
  10. package/esm/funcs/promptsRunStatus.js +91 -0
  11. package/esm/funcs/promptsRunStatus.js.map +1 -0
  12. package/esm/funcs/promptsV2PromptsRetrieve.d.ts +1 -1
  13. package/esm/funcs/promptsV2PromptsRetrieve.js +1 -1
  14. package/esm/funcs/promptsV2PromptsUpdate.d.ts +1 -1
  15. package/esm/funcs/promptsV2PromptsUpdate.js +1 -1
  16. package/esm/landing-page.js +1 -1
  17. package/esm/lib/config.d.ts +2 -2
  18. package/esm/lib/config.js +2 -2
  19. package/esm/mcp-server/mcp-server.js +1 -1
  20. package/esm/mcp-server/server.d.ts.map +1 -1
  21. package/esm/mcp-server/server.js +5 -1
  22. package/esm/mcp-server/server.js.map +1 -1
  23. package/esm/mcp-server/tools/promptsRun.d.ts +7 -0
  24. package/esm/mcp-server/tools/promptsRun.d.ts.map +1 -0
  25. package/esm/mcp-server/tools/promptsRun.js +40 -0
  26. package/esm/mcp-server/tools/promptsRun.js.map +1 -0
  27. package/esm/mcp-server/tools/promptsRunStatus.d.ts +7 -0
  28. package/esm/mcp-server/tools/promptsRunStatus.d.ts.map +1 -0
  29. package/esm/mcp-server/tools/promptsRunStatus.js +38 -0
  30. package/esm/mcp-server/tools/promptsRunStatus.js.map +1 -0
  31. package/esm/mcp-server/tools/promptsV2PromptsRetrieve.js +1 -1
  32. package/esm/mcp-server/tools/promptsV2PromptsRetrieve.js.map +1 -1
  33. package/esm/mcp-server/tools/promptsV2PromptsUpdate.js +1 -1
  34. package/esm/mcp-server/tools/promptsV2PromptsUpdate.js.map +1 -1
  35. package/esm/models/createv2promptrequest.d.ts +2 -0
  36. package/esm/models/createv2promptrequest.d.ts.map +1 -1
  37. package/esm/models/createv2promptrequest.js +3 -0
  38. package/esm/models/createv2promptrequest.js.map +1 -1
  39. package/esm/models/createv2promptrunrequest.d.ts +7 -0
  40. package/esm/models/createv2promptrunrequest.d.ts.map +1 -0
  41. package/esm/models/createv2promptrunrequest.js +10 -0
  42. package/esm/models/createv2promptrunrequest.js.map +1 -0
  43. package/esm/models/updatev2promptrequest.d.ts +2 -0
  44. package/esm/models/updatev2promptrequest.d.ts.map +1 -1
  45. package/esm/models/updatev2promptrequest.js +3 -0
  46. package/esm/models/updatev2promptrequest.js.map +1 -1
  47. package/esm/models/v2evalrunscreateop.d.ts +3 -3
  48. package/esm/models/v2evalrunscreateop.d.ts.map +1 -1
  49. package/esm/models/v2evalrunscreateop.js +2 -2
  50. package/esm/models/v2evalrunscreateop.js.map +1 -1
  51. package/esm/models/v2listpromptsresponse.d.ts +8 -0
  52. package/esm/models/v2listpromptsresponse.d.ts.map +1 -0
  53. package/esm/models/v2listpromptsresponse.js +11 -0
  54. package/esm/models/v2listpromptsresponse.js.map +1 -0
  55. package/esm/models/v2promptbatchresponse.d.ts +10 -0
  56. package/esm/models/v2promptbatchresponse.d.ts.map +1 -0
  57. package/esm/models/v2promptbatchresponse.js +13 -0
  58. package/esm/models/v2promptbatchresponse.js.map +1 -0
  59. package/esm/models/{publicprompt.d.ts → v2promptresponse.d.ts} +9 -7
  60. package/esm/models/v2promptresponse.d.ts.map +1 -0
  61. package/esm/models/{publicprompt.js → v2promptresponse.js} +8 -6
  62. package/esm/models/v2promptresponse.js.map +1 -0
  63. package/esm/models/v2promptrundetail.d.ts +6 -0
  64. package/esm/models/v2promptrundetail.d.ts.map +1 -1
  65. package/esm/models/v2promptrundetail.js +7 -0
  66. package/esm/models/v2promptrundetail.js.map +1 -1
  67. package/esm/models/v2promptrunjobresponse.d.ts +46 -0
  68. package/esm/models/v2promptrunjobresponse.d.ts.map +1 -0
  69. package/esm/models/v2promptrunjobresponse.js +49 -0
  70. package/esm/models/v2promptrunjobresponse.js.map +1 -0
  71. package/esm/models/v2promptrunscreateop.d.ts +40 -0
  72. package/esm/models/v2promptrunscreateop.d.ts.map +1 -0
  73. package/esm/models/v2promptrunscreateop.js +33 -0
  74. package/esm/models/v2promptrunscreateop.js.map +1 -0
  75. package/esm/models/v2promptrunsettings.d.ts +26 -0
  76. package/esm/models/v2promptrunsettings.d.ts.map +1 -0
  77. package/esm/models/v2promptrunsettings.js +26 -0
  78. package/esm/models/v2promptrunsettings.js.map +1 -0
  79. package/esm/models/v2promptrunsettingsinput.d.ts +20 -0
  80. package/esm/models/v2promptrunsettingsinput.d.ts.map +1 -0
  81. package/esm/models/v2promptrunsettingsinput.js +23 -0
  82. package/esm/models/v2promptrunsettingsinput.js.map +1 -0
  83. package/esm/models/v2promptrunstatusretrieveop.d.ts +24 -0
  84. package/esm/models/v2promptrunstatusretrieveop.d.ts.map +1 -0
  85. package/esm/models/v2promptrunstatusretrieveop.js +23 -0
  86. package/esm/models/v2promptrunstatusretrieveop.js.map +1 -0
  87. package/esm/models/v2promptrunsummary.d.ts +6 -0
  88. package/esm/models/v2promptrunsummary.d.ts.map +1 -1
  89. package/esm/models/v2promptrunsummary.js +7 -0
  90. package/esm/models/v2promptrunsummary.js.map +1 -1
  91. package/esm/models/v2promptscreateop.d.ts +2 -2
  92. package/esm/models/v2promptscreateop.d.ts.map +1 -1
  93. package/esm/models/v2promptscreateop.js +2 -2
  94. package/esm/models/v2promptscreateop.js.map +1 -1
  95. package/esm/models/v2promptslistop.d.ts +2 -2
  96. package/esm/models/v2promptslistop.d.ts.map +1 -1
  97. package/esm/models/v2promptslistop.js +2 -2
  98. package/esm/models/v2promptslistop.js.map +1 -1
  99. package/esm/models/v2promptsretrieveop.d.ts +2 -2
  100. package/esm/models/v2promptsretrieveop.d.ts.map +1 -1
  101. package/esm/models/v2promptsretrieveop.js +2 -2
  102. package/esm/models/v2promptsretrieveop.js.map +1 -1
  103. package/esm/models/v2promptsupdateop.d.ts +2 -2
  104. package/esm/models/v2promptsupdateop.d.ts.map +1 -1
  105. package/esm/models/v2promptsupdateop.js +2 -2
  106. package/esm/models/v2promptsupdateop.js.map +1 -1
  107. package/esm/models/validationerror.d.ts +4 -0
  108. package/esm/models/validationerror.d.ts.map +1 -1
  109. package/esm/models/validationerror.js +3 -0
  110. package/esm/models/validationerror.js.map +1 -1
  111. package/esm/tool-names.d.ts.map +1 -1
  112. package/esm/tool-names.js +10 -2
  113. package/esm/tool-names.js.map +1 -1
  114. package/package.json +9 -4
  115. package/src/funcs/promptsRun.ts +150 -0
  116. package/src/funcs/promptsRunStatus.ts +156 -0
  117. package/src/funcs/promptsV2PromptsRetrieve.ts +1 -1
  118. package/src/funcs/promptsV2PromptsUpdate.ts +1 -1
  119. package/src/landing-page.ts +1 -1
  120. package/src/lib/config.ts +2 -2
  121. package/src/mcp-server/mcp-server.ts +1 -1
  122. package/src/mcp-server/server.ts +5 -1
  123. package/src/mcp-server/tools/promptsRun.ts +48 -0
  124. package/src/mcp-server/tools/promptsRunStatus.ts +46 -0
  125. package/src/mcp-server/tools/promptsV2PromptsRetrieve.ts +1 -1
  126. package/src/mcp-server/tools/promptsV2PromptsUpdate.ts +1 -1
  127. package/src/models/createv2promptrequest.ts +9 -0
  128. package/src/models/createv2promptrunrequest.ts +22 -0
  129. package/src/models/updatev2promptrequest.ts +9 -0
  130. package/src/models/v2evalrunscreateop.ts +12 -4
  131. package/src/models/v2listpromptsresponse.ts +21 -0
  132. package/src/models/v2promptbatchresponse.ts +27 -0
  133. package/src/models/{publicprompt.ts → v2promptresponse.ts} +29 -21
  134. package/src/models/v2promptrundetail.ts +21 -0
  135. package/src/models/v2promptrunjobresponse.ts +97 -0
  136. package/src/models/v2promptrunscreateop.ts +100 -0
  137. package/src/models/v2promptrunsettings.ts +50 -0
  138. package/src/models/v2promptrunsettingsinput.ts +47 -0
  139. package/src/models/v2promptrunstatusretrieveop.ts +64 -0
  140. package/src/models/v2promptrunsummary.ts +21 -0
  141. package/src/models/v2promptscreateop.ts +5 -5
  142. package/src/models/v2promptslistop.ts +5 -5
  143. package/src/models/v2promptsretrieveop.ts +6 -3
  144. package/src/models/v2promptsupdateop.ts +6 -3
  145. package/src/models/validationerror.ts +8 -0
  146. package/src/tool-names.ts +10 -2
  147. package/esm/models/listpromptsresponse.d.ts +0 -8
  148. package/esm/models/listpromptsresponse.d.ts.map +0 -1
  149. package/esm/models/listpromptsresponse.js +0 -12
  150. package/esm/models/listpromptsresponse.js.map +0 -1
  151. package/esm/models/publicprompt.d.ts.map +0 -1
  152. package/esm/models/publicprompt.js.map +0 -1
  153. package/esm/models/publicpromptbatchresponse.d.ts +0 -10
  154. package/esm/models/publicpromptbatchresponse.d.ts.map +0 -1
  155. package/esm/models/publicpromptbatchresponse.js +0 -13
  156. package/esm/models/publicpromptbatchresponse.js.map +0 -1
  157. package/src/models/listpromptsresponse.ts +0 -15
  158. package/src/models/publicpromptbatchresponse.ts +0 -25
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 7c803001c7a9
3
+ * @generated-id: 6495adbd118e
4
4
  */
5
5
 
6
6
  import * as z from "zod";
@@ -17,11 +17,15 @@ import {
17
17
  PublicPromptTopic,
18
18
  PublicPromptTopic$zodSchema,
19
19
  } from "./publicprompttopic.js";
20
+ import {
21
+ V2PromptRunSettings,
22
+ V2PromptRunSettings$zodSchema,
23
+ } from "./v2promptrunsettings.js";
20
24
 
21
25
  /**
22
26
  * The prompt lifecycle status. Only `active` prompts run on schedule.
23
27
  */
24
- export const PublicPromptStatus = {
28
+ export const V2PromptResponseStatus = {
25
29
  Active: "active",
26
30
  Inactive: "inactive",
27
31
  Archived: "archived",
@@ -29,9 +33,9 @@ export const PublicPromptStatus = {
29
33
  /**
30
34
  * The prompt lifecycle status. Only `active` prompts run on schedule.
31
35
  */
32
- export type PublicPromptStatus = ClosedEnum<typeof PublicPromptStatus>;
36
+ export type V2PromptResponseStatus = ClosedEnum<typeof V2PromptResponseStatus>;
33
37
 
34
- export const PublicPromptStatus$zodSchema = z.enum([
38
+ export const V2PromptResponseStatus$zodSchema = z.enum([
35
39
  "active",
36
40
  "inactive",
37
41
  "archived",
@@ -39,32 +43,36 @@ export const PublicPromptStatus$zodSchema = z.enum([
39
43
  "The prompt lifecycle status. Only `active` prompts run on schedule.",
40
44
  );
41
45
 
42
- export type PublicPrompt = {
46
+ export type V2PromptResponse = {
43
47
  id: string;
44
48
  topic_id: string;
45
49
  text: string;
46
50
  language_id?: string | null | undefined;
47
51
  region_id?: string | null | undefined;
48
- status: PublicPromptStatus;
52
+ status: V2PromptResponseStatus;
49
53
  topic?: PublicPromptTopic | null | undefined;
50
54
  platforms?: Array<PublicPromptPlatform> | undefined;
51
55
  tags?: Array<PublicPromptTag> | undefined;
52
56
  created_at?: string | null | undefined;
53
57
  updated_at?: string | null | undefined;
58
+ run_settings?: V2PromptRunSettings | undefined;
54
59
  };
55
60
 
56
- export const PublicPrompt$zodSchema: z.ZodType<PublicPrompt> = z.object({
57
- created_at: z.string().nullable().optional(),
58
- id: z.string(),
59
- language_id: z.string().nullable().optional(),
60
- platforms: z.array(PublicPromptPlatform$zodSchema).optional(),
61
- region_id: z.string().nullable().optional(),
62
- status: PublicPromptStatus$zodSchema.describe(
63
- "The prompt lifecycle status. Only `active` prompts run on schedule.",
64
- ),
65
- tags: z.array(PublicPromptTag$zodSchema).optional(),
66
- text: z.string(),
67
- topic: PublicPromptTopic$zodSchema.nullable().optional(),
68
- topic_id: z.string(),
69
- updated_at: z.string().nullable().optional(),
70
- });
61
+ export const V2PromptResponse$zodSchema: z.ZodType<V2PromptResponse> = z.object(
62
+ {
63
+ created_at: z.string().nullable().optional(),
64
+ id: z.string(),
65
+ language_id: z.string().nullable().optional(),
66
+ platforms: z.array(PublicPromptPlatform$zodSchema).optional(),
67
+ region_id: z.string().nullable().optional(),
68
+ run_settings: V2PromptRunSettings$zodSchema.optional(),
69
+ status: V2PromptResponseStatus$zodSchema.describe(
70
+ "The prompt lifecycle status. Only `active` prompts run on schedule.",
71
+ ),
72
+ tags: z.array(PublicPromptTag$zodSchema).optional(),
73
+ text: z.string(),
74
+ topic: PublicPromptTopic$zodSchema.nullable().optional(),
75
+ topic_id: z.string(),
76
+ updated_at: z.string().nullable().optional(),
77
+ },
78
+ );
@@ -5,6 +5,10 @@
5
5
 
6
6
  import * as z from "zod";
7
7
  import { ClosedEnum } from "../types/enums.js";
8
+ import {
9
+ SearchGroundingMode,
10
+ SearchGroundingMode$zodSchema,
11
+ } from "./searchgroundingmode.js";
8
12
  import {
9
13
  V2PromptRunCitation,
10
14
  V2PromptRunCitation$zodSchema,
@@ -48,6 +52,11 @@ export type V2PromptRunDetail = {
48
52
  is_brand_mentioned?: boolean | null | undefined;
49
53
  citation_count?: number | undefined;
50
54
  tool_call_count?: number | null | undefined;
55
+ search_grounding?: SearchGroundingMode | null | undefined;
56
+ web_retrieval_observed?: boolean | null | undefined;
57
+ search_observed?: boolean | null | undefined;
58
+ grounding_qualified?: boolean | null | undefined;
59
+ grounding_qualification_reason?: string | null | undefined;
51
60
  created_at?: string | null | undefined;
52
61
  response?: string | null | undefined;
53
62
  mentions?: Array<V2PromptRunMention> | undefined;
@@ -65,6 +74,10 @@ export const V2PromptRunDetail$zodSchema: z.ZodType<V2PromptRunDetail> = z
65
74
  "Sanitized interleaved text and tool-call trace captured for this run. It interleaves the agent's `text` turns with `tool_call` turns, so its length is not a tool-call count; use `tool_calls` or `tool_call_count`.",
66
75
  ),
67
76
  created_at: z.string().nullable().optional(),
77
+ grounding_qualification_reason: z.string().nullable().optional(),
78
+ grounding_qualified: z.boolean().nullable().optional().describe(
79
+ "Whether the run satisfied the requested web access mode. Null means the default mode was used or isolation could not be proven.",
80
+ ),
68
81
  harness: z.string().nullable().optional().describe(
69
82
  "Coding-agent harness for agent runs; otherwise the answer platform identifier.",
70
83
  ),
@@ -80,6 +93,11 @@ export const V2PromptRunDetail$zodSchema: z.ZodType<V2PromptRunDetail> = z
80
93
  response: z.string().nullable().optional(),
81
94
  response_preview: z.string().nullable().optional(),
82
95
  run_date: z.string(),
96
+ search_grounding: SearchGroundingMode$zodSchema.nullable().optional()
97
+ .describe(
98
+ "Web access mode requested for this run. Null for runs recorded before web access was tracked.",
99
+ ),
100
+ search_observed: z.boolean().nullable().optional(),
83
101
  target_kind: V2PromptRunDetailTargetKind$zodSchema.nullable().optional(),
84
102
  tool_call_count: z.int().nullable().optional().describe(
85
103
  "Coding-agent tool invocations, counting a call and its result once. Matches the length of `tool_calls` on the detail response; null for answer-engine runs.",
@@ -87,4 +105,7 @@ export const V2PromptRunDetail$zodSchema: z.ZodType<V2PromptRunDetail> = z
87
105
  tool_calls: z.array(z.record(z.string(), z.any())).optional().describe(
88
106
  "Sanitized coding-agent tool invocations captured for this run, one entry per invocation with its result merged in.",
89
107
  ),
108
+ web_retrieval_observed: z.boolean().nullable().optional().describe(
109
+ "Whether the coding agent was observed searching or fetching from the web. Null when not measured, including answer-engine runs.",
110
+ ),
90
111
  });
@@ -0,0 +1,97 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 4ccfac1e4b39
4
+ */
5
+
6
+ import * as z from "zod";
7
+ import { ClosedEnum } from "../types/enums.js";
8
+ import {
9
+ PublicEvalRunProgress,
10
+ PublicEvalRunProgress$zodSchema,
11
+ } from "./publicevalrunprogress.js";
12
+
13
+ export const V2PromptRunJobResponseStatusEnum = {
14
+ Pending: "pending",
15
+ Running: "running",
16
+ Summarizing: "summarizing",
17
+ Completed: "completed",
18
+ Failed: "failed",
19
+ Cancelled: "cancelled",
20
+ Interrupted: "interrupted",
21
+ } as const;
22
+ export type V2PromptRunJobResponseStatusEnum = ClosedEnum<
23
+ typeof V2PromptRunJobResponseStatusEnum
24
+ >;
25
+
26
+ export const V2PromptRunJobResponseStatusEnum$zodSchema = z.enum([
27
+ "pending",
28
+ "running",
29
+ "summarizing",
30
+ "completed",
31
+ "failed",
32
+ "cancelled",
33
+ "interrupted",
34
+ ]);
35
+
36
+ /**
37
+ * Terminal values: `completed`, `failed`, and `cancelled`. Recoverable interruptions are reported as `running` with stage `retrying`.
38
+ */
39
+ export type Status = V2PromptRunJobResponseStatusEnum | string;
40
+
41
+ export const Status$zodSchema: z.ZodType<Status> = z.union([
42
+ V2PromptRunJobResponseStatusEnum$zodSchema,
43
+ z.string(),
44
+ ]).describe(
45
+ "Terminal values: `completed`, `failed`, and `cancelled`. Recoverable interruptions are reported as `running` with stage `retrying`.",
46
+ );
47
+
48
+ export type V2PromptRunJobResponse = {
49
+ id: string;
50
+ job_id: string;
51
+ type?: "prompts" | undefined;
52
+ source_type?: "prompts" | undefined;
53
+ status: V2PromptRunJobResponseStatusEnum | string;
54
+ stage?: string | null | undefined;
55
+ dispatch_id?: string | null | undefined;
56
+ progress?: PublicEvalRunProgress | undefined;
57
+ estimated_cost?: number | null | undefined;
58
+ eval_count?: number | null | undefined;
59
+ model_count?: number | null | undefined;
60
+ error?: string | null | undefined;
61
+ created_at?: string | null | undefined;
62
+ started_at?: string | null | undefined;
63
+ completed_at?: string | null | undefined;
64
+ };
65
+
66
+ export const V2PromptRunJobResponse$zodSchema: z.ZodType<
67
+ V2PromptRunJobResponse
68
+ > = z.object({
69
+ completed_at: z.string().nullable().optional().describe(
70
+ "Can be set while `status` is still `summarizing`; use `status` to detect completion.",
71
+ ),
72
+ created_at: z.string().nullable().optional(),
73
+ dispatch_id: z.string().nullable().optional(),
74
+ error: z.string().nullable().optional(),
75
+ estimated_cost: z.number().nullable().optional().describe(
76
+ "The estimated credit cost for prompt jobs or estimated USD cost for API Performance jobs. Null when no estimate is available.",
77
+ ),
78
+ eval_count: z.int().nullable().optional(),
79
+ id: z.string().describe(
80
+ "Run ID to poll with `GET /v2/prompts/runs/{run_id}/status`.",
81
+ ),
82
+ job_id: z.string().describe("Parent job ID. It currently matches `id`."),
83
+ model_count: z.int().nullable().optional(),
84
+ progress: PublicEvalRunProgress$zodSchema.optional(),
85
+ source_type: z.literal("prompts").default("prompts").optional(),
86
+ stage: z.string().nullable().optional().describe(
87
+ "Current lifecycle stage, including `retrying` while interrupted child jobs wait to be reclaimed.",
88
+ ),
89
+ started_at: z.string().nullable().optional(),
90
+ status: z.union([
91
+ V2PromptRunJobResponseStatusEnum$zodSchema,
92
+ z.string(),
93
+ ]).describe(
94
+ "Terminal values: `completed`, `failed`, and `cancelled`. Recoverable interruptions are reported as `running` with stage `retrying`.",
95
+ ),
96
+ type: z.literal("prompts").default("prompts").optional(),
97
+ });
@@ -0,0 +1,100 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 54866e0df895
4
+ */
5
+
6
+ import * as z from "zod";
7
+ import {
8
+ HTTPValidationError,
9
+ HTTPValidationError$zodSchema,
10
+ } from "./httpvalidationerror.js";
11
+ import {
12
+ V2PromptRunJobResponse,
13
+ V2PromptRunJobResponse$zodSchema,
14
+ } from "./v2promptrunjobresponse.js";
15
+
16
+ /**
17
+ * The background queue is temporarily unavailable.
18
+ */
19
+ export type V2PromptRunsCreateServiceUnavailableResponseBody = {
20
+ detail: string;
21
+ };
22
+
23
+ export const V2PromptRunsCreateServiceUnavailableResponseBody$zodSchema:
24
+ z.ZodType<V2PromptRunsCreateServiceUnavailableResponseBody> = z.object({
25
+ detail: z.string(),
26
+ }).describe("The background queue is temporarily unavailable.");
27
+
28
+ /**
29
+ * One or more configured targets are unavailable on the organization's current plan.
30
+ */
31
+ export type V2PromptRunsCreateForbiddenResponseBody = { detail: string };
32
+
33
+ export const V2PromptRunsCreateForbiddenResponseBody$zodSchema: z.ZodType<
34
+ V2PromptRunsCreateForbiddenResponseBody
35
+ > = z.object({
36
+ detail: z.string(),
37
+ }).describe(
38
+ "One or more configured targets are unavailable on the organization's current plan.",
39
+ );
40
+
41
+ export type V2PromptRunsCreateDetail = {
42
+ error: string;
43
+ required: number;
44
+ balance: number;
45
+ };
46
+
47
+ export const V2PromptRunsCreateDetail$zodSchema: z.ZodType<
48
+ V2PromptRunsCreateDetail
49
+ > = z.object({
50
+ balance: z.number().describe("The organization's current credit balance."),
51
+ error: z.string(),
52
+ required: z.number().describe("Usage-based credits the requested run needs."),
53
+ });
54
+
55
+ /**
56
+ * The organization does not currently have enough credits for the requested run.
57
+ */
58
+ export type V2PromptRunsCreatePaymentRequiredResponseBody = {
59
+ detail: V2PromptRunsCreateDetail;
60
+ };
61
+
62
+ export const V2PromptRunsCreatePaymentRequiredResponseBody$zodSchema: z.ZodType<
63
+ V2PromptRunsCreatePaymentRequiredResponseBody
64
+ > = z.object({
65
+ detail: z.lazy(() => V2PromptRunsCreateDetail$zodSchema),
66
+ }).describe(
67
+ "The organization does not currently have enough credits for the requested run.",
68
+ );
69
+
70
+ /**
71
+ * No runnable configured targets were found for the selected prompts.
72
+ */
73
+ export type V2PromptRunsCreateBadRequestResponseBody = { detail: string };
74
+
75
+ export const V2PromptRunsCreateBadRequestResponseBody$zodSchema: z.ZodType<
76
+ V2PromptRunsCreateBadRequestResponseBody
77
+ > = z.object({
78
+ detail: z.string(),
79
+ }).describe(
80
+ "No runnable configured targets were found for the selected prompts.",
81
+ );
82
+
83
+ export type V2PromptRunsCreateResponse =
84
+ | V2PromptRunJobResponse
85
+ | V2PromptRunsCreateBadRequestResponseBody
86
+ | V2PromptRunsCreatePaymentRequiredResponseBody
87
+ | V2PromptRunsCreateForbiddenResponseBody
88
+ | V2PromptRunsCreateServiceUnavailableResponseBody
89
+ | HTTPValidationError;
90
+
91
+ export const V2PromptRunsCreateResponse$zodSchema: z.ZodType<
92
+ V2PromptRunsCreateResponse
93
+ > = z.union([
94
+ V2PromptRunJobResponse$zodSchema,
95
+ z.lazy(() => V2PromptRunsCreateBadRequestResponseBody$zodSchema),
96
+ z.lazy(() => V2PromptRunsCreatePaymentRequiredResponseBody$zodSchema),
97
+ z.lazy(() => V2PromptRunsCreateForbiddenResponseBody$zodSchema),
98
+ z.lazy(() => V2PromptRunsCreateServiceUnavailableResponseBody$zodSchema),
99
+ HTTPValidationError$zodSchema,
100
+ ]);
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: cc46063d455b
4
+ */
5
+
6
+ import * as z from "zod";
7
+ import { ClosedEnum } from "../types/enums.js";
8
+ import {
9
+ SearchGroundingMode,
10
+ SearchGroundingMode$zodSchema,
11
+ } from "./searchgroundingmode.js";
12
+
13
+ /**
14
+ * Whether coding-agent runs append "Use web search." to the prompt. `both` runs the prompt once without and once with the instruction. Ignored when `search_grounding` is `disabled`. Answer engines always receive the prompt as written.
15
+ */
16
+ export const V2PromptRunSettingsWebSearchInstruction = {
17
+ Omit: "omit",
18
+ Append: "append",
19
+ Both: "both",
20
+ } as const;
21
+ /**
22
+ * Whether coding-agent runs append "Use web search." to the prompt. `both` runs the prompt once without and once with the instruction. Ignored when `search_grounding` is `disabled`. Answer engines always receive the prompt as written.
23
+ */
24
+ export type V2PromptRunSettingsWebSearchInstruction = ClosedEnum<
25
+ typeof V2PromptRunSettingsWebSearchInstruction
26
+ >;
27
+
28
+ export const V2PromptRunSettingsWebSearchInstruction$zodSchema = z.enum([
29
+ "omit",
30
+ "append",
31
+ "both",
32
+ ]).describe(
33
+ "Whether coding-agent runs append \"Use web search.\" to the prompt. `both` runs the prompt once without and once with the instruction. Ignored when `search_grounding` is `disabled`. Answer engines always receive the prompt as written.",
34
+ );
35
+
36
+ export type V2PromptRunSettings = {
37
+ search_grounding?: SearchGroundingMode | undefined;
38
+ web_search_instruction?: V2PromptRunSettingsWebSearchInstruction | undefined;
39
+ };
40
+
41
+ export const V2PromptRunSettings$zodSchema: z.ZodType<V2PromptRunSettings> = z
42
+ .object({
43
+ search_grounding: SearchGroundingMode$zodSchema.optional().describe(
44
+ "Requested web-retrieval behavior for an eval run.",
45
+ ),
46
+ web_search_instruction: V2PromptRunSettingsWebSearchInstruction$zodSchema
47
+ .default("omit").describe(
48
+ "Whether coding-agent runs append \"Use web search.\" to the prompt. `both` runs the prompt once without and once with the instruction. Ignored when `search_grounding` is `disabled`. Answer engines always receive the prompt as written.",
49
+ ),
50
+ });
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 7dee5732ac7a
4
+ */
5
+
6
+ import * as z from "zod";
7
+ import { ClosedEnum } from "../types/enums.js";
8
+ import {
9
+ SearchGroundingMode,
10
+ SearchGroundingMode$zodSchema,
11
+ } from "./searchgroundingmode.js";
12
+
13
+ export const V2PromptRunSettingsInputWebSearchInstruction = {
14
+ Omit: "omit",
15
+ Append: "append",
16
+ Both: "both",
17
+ } as const;
18
+ export type V2PromptRunSettingsInputWebSearchInstruction = ClosedEnum<
19
+ typeof V2PromptRunSettingsInputWebSearchInstruction
20
+ >;
21
+
22
+ export const V2PromptRunSettingsInputWebSearchInstruction$zodSchema = z.enum([
23
+ "omit",
24
+ "append",
25
+ "both",
26
+ ]);
27
+
28
+ export type V2PromptRunSettingsInput = {
29
+ search_grounding?: SearchGroundingMode | null | undefined;
30
+ web_search_instruction?:
31
+ | V2PromptRunSettingsInputWebSearchInstruction
32
+ | null
33
+ | undefined;
34
+ };
35
+
36
+ export const V2PromptRunSettingsInput$zodSchema: z.ZodType<
37
+ V2PromptRunSettingsInput
38
+ > = z.object({
39
+ search_grounding: SearchGroundingMode$zodSchema.nullable().optional()
40
+ .describe(
41
+ "Web access for coding-agent runs of this prompt. `disabled` blocks web access in the agent sandbox, `enabled` requires the agent to retrieve from the web, and `default` leaves the choice to the agent. Answer engines are not affected. An eval-run target that sets `search_grounding` overrides this setting.",
42
+ ),
43
+ web_search_instruction: V2PromptRunSettingsInputWebSearchInstruction$zodSchema
44
+ .nullable().optional().describe(
45
+ "Whether coding-agent runs append \"Use web search.\" to the prompt. `both` runs the prompt once without and once with the instruction. Ignored when `search_grounding` is `disabled`. Answer engines always receive the prompt as written.",
46
+ ),
47
+ });
@@ -0,0 +1,64 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ * @generated-id: 8f9c98c256bf
4
+ */
5
+
6
+ import * as z from "zod";
7
+ import {
8
+ HTTPValidationError,
9
+ HTTPValidationError$zodSchema,
10
+ } from "./httpvalidationerror.js";
11
+ import {
12
+ V2PromptRunJobResponse,
13
+ V2PromptRunJobResponse$zodSchema,
14
+ } from "./v2promptrunjobresponse.js";
15
+
16
+ export type V2PromptRunStatusRetrieveRequest = { run_id: string };
17
+
18
+ export const V2PromptRunStatusRetrieveRequest$zodSchema: z.ZodType<
19
+ V2PromptRunStatusRetrieveRequest
20
+ > = z.object({
21
+ run_id: z.string().describe(
22
+ "Run ID returned by `POST /v2/prompts/runs`, not a stored prompt result ID.",
23
+ ),
24
+ });
25
+
26
+ /**
27
+ * The prompt run job does not exist or is not visible to this API key.
28
+ */
29
+ export type V2PromptRunStatusRetrieveNotFoundResponseBody = { detail: string };
30
+
31
+ export const V2PromptRunStatusRetrieveNotFoundResponseBody$zodSchema: z.ZodType<
32
+ V2PromptRunStatusRetrieveNotFoundResponseBody
33
+ > = z.object({
34
+ detail: z.string(),
35
+ }).describe(
36
+ "The prompt run job does not exist or is not visible to this API key.",
37
+ );
38
+
39
+ /**
40
+ * The prompt run ID is not a valid UUID.
41
+ */
42
+ export type V2PromptRunStatusRetrieveBadRequestResponseBody = {
43
+ detail: string;
44
+ };
45
+
46
+ export const V2PromptRunStatusRetrieveBadRequestResponseBody$zodSchema:
47
+ z.ZodType<V2PromptRunStatusRetrieveBadRequestResponseBody> = z.object({
48
+ detail: z.string(),
49
+ }).describe("The prompt run ID is not a valid UUID.");
50
+
51
+ export type V2PromptRunStatusRetrieveResponse =
52
+ | V2PromptRunJobResponse
53
+ | V2PromptRunStatusRetrieveBadRequestResponseBody
54
+ | V2PromptRunStatusRetrieveNotFoundResponseBody
55
+ | HTTPValidationError;
56
+
57
+ export const V2PromptRunStatusRetrieveResponse$zodSchema: z.ZodType<
58
+ V2PromptRunStatusRetrieveResponse
59
+ > = z.union([
60
+ V2PromptRunJobResponse$zodSchema,
61
+ z.lazy(() => V2PromptRunStatusRetrieveBadRequestResponseBody$zodSchema),
62
+ z.lazy(() => V2PromptRunStatusRetrieveNotFoundResponseBody$zodSchema),
63
+ HTTPValidationError$zodSchema,
64
+ ]);
@@ -5,6 +5,10 @@
5
5
 
6
6
  import * as z from "zod";
7
7
  import { ClosedEnum } from "../types/enums.js";
8
+ import {
9
+ SearchGroundingMode,
10
+ SearchGroundingMode$zodSchema,
11
+ } from "./searchgroundingmode.js";
8
12
  import {
9
13
  V2PromptRunPlatform,
10
14
  V2PromptRunPlatform$zodSchema,
@@ -40,6 +44,11 @@ export type V2PromptRunSummary = {
40
44
  is_brand_mentioned?: boolean | null | undefined;
41
45
  citation_count?: number | undefined;
42
46
  tool_call_count?: number | null | undefined;
47
+ search_grounding?: SearchGroundingMode | null | undefined;
48
+ web_retrieval_observed?: boolean | null | undefined;
49
+ search_observed?: boolean | null | undefined;
50
+ grounding_qualified?: boolean | null | undefined;
51
+ grounding_qualification_reason?: string | null | undefined;
43
52
  created_at?: string | null | undefined;
44
53
  };
45
54
 
@@ -47,6 +56,10 @@ export const V2PromptRunSummary$zodSchema: z.ZodType<V2PromptRunSummary> = z
47
56
  .object({
48
57
  citation_count: z.int().default(0),
49
58
  created_at: z.string().nullable().optional(),
59
+ grounding_qualification_reason: z.string().nullable().optional(),
60
+ grounding_qualified: z.boolean().nullable().optional().describe(
61
+ "Whether the run satisfied the requested web access mode. Null means the default mode was used or isolation could not be proven.",
62
+ ),
50
63
  harness: z.string().nullable().optional().describe(
51
64
  "Coding-agent harness for agent runs; otherwise the answer platform identifier.",
52
65
  ),
@@ -60,8 +73,16 @@ export const V2PromptRunSummary$zodSchema: z.ZodType<V2PromptRunSummary> = z
60
73
  prompt_id: z.string(),
61
74
  response_preview: z.string().nullable().optional(),
62
75
  run_date: z.string(),
76
+ search_grounding: SearchGroundingMode$zodSchema.nullable().optional()
77
+ .describe(
78
+ "Web access mode requested for this run. Null for runs recorded before web access was tracked.",
79
+ ),
80
+ search_observed: z.boolean().nullable().optional(),
63
81
  target_kind: V2PromptRunSummaryTargetKind$zodSchema.nullable().optional(),
64
82
  tool_call_count: z.int().nullable().optional().describe(
65
83
  "Coding-agent tool invocations, counting a call and its result once. Matches the length of `tool_calls` on the detail response; null for answer-engine runs.",
66
84
  ),
85
+ web_retrieval_observed: z.boolean().nullable().optional().describe(
86
+ "Whether the coding agent was observed searching or fetching from the web. Null when not measured, including answer-engine runs.",
87
+ ),
67
88
  });
@@ -9,17 +9,17 @@ import {
9
9
  HTTPValidationError$zodSchema,
10
10
  } from "./httpvalidationerror.js";
11
11
  import {
12
- PublicPromptBatchResponse,
13
- PublicPromptBatchResponse$zodSchema,
14
- } from "./publicpromptbatchresponse.js";
12
+ V2PromptBatchResponse,
13
+ V2PromptBatchResponse$zodSchema,
14
+ } from "./v2promptbatchresponse.js";
15
15
 
16
16
  export type V2PromptsCreateResponse =
17
- | PublicPromptBatchResponse
17
+ | V2PromptBatchResponse
18
18
  | HTTPValidationError;
19
19
 
20
20
  export const V2PromptsCreateResponse$zodSchema: z.ZodType<
21
21
  V2PromptsCreateResponse
22
22
  > = z.union([
23
- PublicPromptBatchResponse$zodSchema,
23
+ V2PromptBatchResponse$zodSchema,
24
24
  HTTPValidationError$zodSchema,
25
25
  ]);
@@ -10,9 +10,9 @@ import {
10
10
  HTTPValidationError$zodSchema,
11
11
  } from "./httpvalidationerror.js";
12
12
  import {
13
- ListPromptsResponse,
14
- ListPromptsResponse$zodSchema,
15
- } from "./listpromptsresponse.js";
13
+ V2ListPromptsResponse,
14
+ V2ListPromptsResponse$zodSchema,
15
+ } from "./v2listpromptsresponse.js";
16
16
 
17
17
  export const V2PromptsListStatus = {
18
18
  Active: "active",
@@ -40,10 +40,10 @@ export const V2PromptsListRequest$zodSchema: z.ZodType<V2PromptsListRequest> = z
40
40
  topic_id: z.string().describe("Optional prompt topic ID.").optional(),
41
41
  });
42
42
 
43
- export type V2PromptsListResponse = ListPromptsResponse | HTTPValidationError;
43
+ export type V2PromptsListResponse = V2ListPromptsResponse | HTTPValidationError;
44
44
 
45
45
  export const V2PromptsListResponse$zodSchema: z.ZodType<V2PromptsListResponse> =
46
46
  z.union([
47
- ListPromptsResponse$zodSchema,
47
+ V2ListPromptsResponse$zodSchema,
48
48
  HTTPValidationError$zodSchema,
49
49
  ]);
@@ -8,7 +8,10 @@ import {
8
8
  HTTPValidationError,
9
9
  HTTPValidationError$zodSchema,
10
10
  } from "./httpvalidationerror.js";
11
- import { PublicPrompt, PublicPrompt$zodSchema } from "./publicprompt.js";
11
+ import {
12
+ V2PromptResponse,
13
+ V2PromptResponse$zodSchema,
14
+ } from "./v2promptresponse.js";
12
15
 
13
16
  export type V2PromptsRetrieveRequest = { prompt_id: string };
14
17
 
@@ -18,11 +21,11 @@ export const V2PromptsRetrieveRequest$zodSchema: z.ZodType<
18
21
  prompt_id: z.string(),
19
22
  });
20
23
 
21
- export type V2PromptsRetrieveResponse = PublicPrompt | HTTPValidationError;
24
+ export type V2PromptsRetrieveResponse = V2PromptResponse | HTTPValidationError;
22
25
 
23
26
  export const V2PromptsRetrieveResponse$zodSchema: z.ZodType<
24
27
  V2PromptsRetrieveResponse
25
28
  > = z.union([
26
- PublicPrompt$zodSchema,
29
+ V2PromptResponse$zodSchema,
27
30
  HTTPValidationError$zodSchema,
28
31
  ]);
@@ -8,11 +8,14 @@ import {
8
8
  HTTPValidationError,
9
9
  HTTPValidationError$zodSchema,
10
10
  } from "./httpvalidationerror.js";
11
- import { PublicPrompt, PublicPrompt$zodSchema } from "./publicprompt.js";
12
11
  import {
13
12
  UpdateV2PromptRequest,
14
13
  UpdateV2PromptRequest$zodSchema,
15
14
  } from "./updatev2promptrequest.js";
15
+ import {
16
+ V2PromptResponse,
17
+ V2PromptResponse$zodSchema,
18
+ } from "./v2promptresponse.js";
16
19
 
17
20
  export type V2PromptsUpdateRequest = {
18
21
  prompt_id: string;
@@ -26,11 +29,11 @@ export const V2PromptsUpdateRequest$zodSchema: z.ZodType<
26
29
  prompt_id: z.string(),
27
30
  });
28
31
 
29
- export type V2PromptsUpdateResponse = PublicPrompt | HTTPValidationError;
32
+ export type V2PromptsUpdateResponse = V2PromptResponse | HTTPValidationError;
30
33
 
31
34
  export const V2PromptsUpdateResponse$zodSchema: z.ZodType<
32
35
  V2PromptsUpdateResponse
33
36
  > = z.union([
34
- PublicPrompt$zodSchema,
37
+ V2PromptResponse$zodSchema,
35
38
  HTTPValidationError$zodSchema,
36
39
  ]);