@lightsage/mcp 0.4.2 → 0.4.4
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 +2 -2
- package/bin/mcp-server.js +456 -135
- package/bin/mcp-server.js.map +19 -12
- package/esm/funcs/promptsRun.d.ts +21 -0
- package/esm/funcs/promptsRun.d.ts.map +1 -0
- package/esm/funcs/promptsRun.js +88 -0
- package/esm/funcs/promptsRun.js.map +1 -0
- package/esm/funcs/promptsRunStatus.d.ts +19 -0
- package/esm/funcs/promptsRunStatus.d.ts.map +1 -0
- package/esm/funcs/promptsRunStatus.js +91 -0
- package/esm/funcs/promptsRunStatus.js.map +1 -0
- package/esm/landing-page.js +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.d.ts.map +1 -1
- package/esm/mcp-server/server.js +5 -1
- package/esm/mcp-server/server.js.map +1 -1
- package/esm/mcp-server/tools/promptsRun.d.ts +7 -0
- package/esm/mcp-server/tools/promptsRun.d.ts.map +1 -0
- package/esm/mcp-server/tools/promptsRun.js +40 -0
- package/esm/mcp-server/tools/promptsRun.js.map +1 -0
- package/esm/mcp-server/tools/promptsRunStatus.d.ts +7 -0
- package/esm/mcp-server/tools/promptsRunStatus.d.ts.map +1 -0
- package/esm/mcp-server/tools/promptsRunStatus.js +38 -0
- package/esm/mcp-server/tools/promptsRunStatus.js.map +1 -0
- package/esm/models/createv2promptrunrequest.d.ts +7 -0
- package/esm/models/createv2promptrunrequest.d.ts.map +1 -0
- package/esm/models/createv2promptrunrequest.js +10 -0
- package/esm/models/createv2promptrunrequest.js.map +1 -0
- package/esm/models/evaltemplate.js +3 -3
- package/esm/models/evaltemplate.js.map +1 -1
- package/esm/models/v2evalrunscreateop.d.ts +3 -3
- package/esm/models/v2evalrunscreateop.d.ts.map +1 -1
- package/esm/models/v2evalrunscreateop.js +2 -2
- package/esm/models/v2evalrunscreateop.js.map +1 -1
- package/esm/models/v2promptrunjobresponse.d.ts +46 -0
- package/esm/models/v2promptrunjobresponse.d.ts.map +1 -0
- package/esm/models/v2promptrunjobresponse.js +49 -0
- package/esm/models/v2promptrunjobresponse.js.map +1 -0
- package/esm/models/v2promptrunscreateop.d.ts +40 -0
- package/esm/models/v2promptrunscreateop.d.ts.map +1 -0
- package/esm/models/v2promptrunscreateop.js +33 -0
- package/esm/models/v2promptrunscreateop.js.map +1 -0
- package/esm/models/v2promptrunstatusretrieveop.d.ts +24 -0
- package/esm/models/v2promptrunstatusretrieveop.d.ts.map +1 -0
- package/esm/models/v2promptrunstatusretrieveop.js +23 -0
- package/esm/models/v2promptrunstatusretrieveop.js.map +1 -0
- package/esm/models/v2visibilitycurrentretrieveop.js +1 -1
- package/esm/models/v2visibilitycurrentretrieveop.js.map +1 -1
- package/esm/models/v2visibilityoverviewretrieveop.js +1 -1
- package/esm/models/v2visibilityoverviewretrieveop.js.map +1 -1
- package/esm/models/v2visibilitypromptsretrieveop.js +1 -1
- package/esm/models/v2visibilitypromptsretrieveop.js.map +1 -1
- package/esm/tool-names.d.ts.map +1 -1
- package/esm/tool-names.js +8 -0
- package/esm/tool-names.js.map +1 -1
- package/package.json +9 -4
- package/src/funcs/promptsRun.ts +150 -0
- package/src/funcs/promptsRunStatus.ts +156 -0
- package/src/landing-page.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/promptsRun.ts +48 -0
- package/src/mcp-server/tools/promptsRunStatus.ts +46 -0
- package/src/models/createv2promptrunrequest.ts +22 -0
- package/src/models/evaltemplate.ts +3 -3
- package/src/models/v2evalrunscreateop.ts +12 -4
- package/src/models/v2promptrunjobresponse.ts +97 -0
- package/src/models/v2promptrunscreateop.ts +100 -0
- package/src/models/v2promptrunstatusretrieveop.ts +64 -0
- package/src/models/v2visibilitycurrentretrieveop.ts +1 -1
- package/src/models/v2visibilityoverviewretrieveop.ts +1 -1
- package/src/models/v2visibilitypromptsretrieveop.ts +1 -1
- package/src/tool-names.ts +8 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: c7035627e653
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { LightsageMcpCore } from "../core.js";
|
|
7
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import {
|
|
23
|
+
V2PromptRunStatusRetrieveRequest,
|
|
24
|
+
V2PromptRunStatusRetrieveRequest$zodSchema,
|
|
25
|
+
} from "../models/v2promptrunstatusretrieveop.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get Prompt Run Status
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Return status and progress for a queued prompt run.
|
|
34
|
+
*
|
|
35
|
+
* Poll this endpoint until `status` is `completed`, `failed`, or `cancelled`.
|
|
36
|
+
* Individual stored results are available from `GET /v2/prompts/runs`.
|
|
37
|
+
*/
|
|
38
|
+
export function promptsRunStatus(
|
|
39
|
+
client$: LightsageMcpCore,
|
|
40
|
+
request: V2PromptRunStatusRetrieveRequest,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): APIPromise<
|
|
43
|
+
Result<
|
|
44
|
+
Response,
|
|
45
|
+
| APIError
|
|
46
|
+
| SDKValidationError
|
|
47
|
+
| UnexpectedClientError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| RequestAbortedError
|
|
50
|
+
| RequestTimeoutError
|
|
51
|
+
| ConnectionError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client$,
|
|
56
|
+
request,
|
|
57
|
+
options,
|
|
58
|
+
));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function $do(
|
|
62
|
+
client$: LightsageMcpCore,
|
|
63
|
+
request: V2PromptRunStatusRetrieveRequest,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<
|
|
66
|
+
[
|
|
67
|
+
Result<
|
|
68
|
+
Response,
|
|
69
|
+
| APIError
|
|
70
|
+
| SDKValidationError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| InvalidRequestError
|
|
73
|
+
| RequestAbortedError
|
|
74
|
+
| RequestTimeoutError
|
|
75
|
+
| ConnectionError
|
|
76
|
+
>,
|
|
77
|
+
APICall,
|
|
78
|
+
]
|
|
79
|
+
> {
|
|
80
|
+
const parsed$ = safeParse(
|
|
81
|
+
request,
|
|
82
|
+
(value$) => V2PromptRunStatusRetrieveRequest$zodSchema.parse(value$),
|
|
83
|
+
"Input validation failed",
|
|
84
|
+
);
|
|
85
|
+
if (!parsed$.ok) {
|
|
86
|
+
return [parsed$, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const payload$ = parsed$.value;
|
|
89
|
+
const body$ = null;
|
|
90
|
+
|
|
91
|
+
const pathParams$ = {
|
|
92
|
+
run_id: encodeSimple("run_id", payload$.run_id, {
|
|
93
|
+
explode: false,
|
|
94
|
+
charEncoding: "percent",
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
const path$ = pathToFunc("/v2/prompts/runs/{run_id}/status")(
|
|
98
|
+
pathParams$,
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
const headers$ = new Headers(compactMap({
|
|
102
|
+
Accept: "application/json",
|
|
103
|
+
}));
|
|
104
|
+
const securityInput = await extractSecurity(client$._options.security);
|
|
105
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
106
|
+
|
|
107
|
+
const context = {
|
|
108
|
+
options: client$._options,
|
|
109
|
+
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
110
|
+
operationID: "v2_prompt_run_status_retrieve",
|
|
111
|
+
oAuth2Scopes: null,
|
|
112
|
+
resolvedSecurity: requestSecurity,
|
|
113
|
+
securitySource: client$._options.security,
|
|
114
|
+
retryConfig: options?.retries
|
|
115
|
+
|| client$._options.retryConfig
|
|
116
|
+
|| { strategy: "none" },
|
|
117
|
+
retryCodes: options?.retryCodes || [
|
|
118
|
+
"429",
|
|
119
|
+
"500",
|
|
120
|
+
"502",
|
|
121
|
+
"503",
|
|
122
|
+
"504",
|
|
123
|
+
],
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const requestRes = client$._createRequest(context, {
|
|
127
|
+
security: requestSecurity,
|
|
128
|
+
method: "GET",
|
|
129
|
+
baseURL: options?.serverURL,
|
|
130
|
+
path: path$,
|
|
131
|
+
headers: headers$,
|
|
132
|
+
body: body$,
|
|
133
|
+
userAgent: client$._options.userAgent,
|
|
134
|
+
timeoutMs: options?.timeoutMs || client$._options.timeoutMs
|
|
135
|
+
|| -1,
|
|
136
|
+
}, options);
|
|
137
|
+
if (!requestRes.ok) {
|
|
138
|
+
return [requestRes, { status: "invalid" }];
|
|
139
|
+
}
|
|
140
|
+
const req$ = requestRes.value;
|
|
141
|
+
|
|
142
|
+
const doResult = await client$._do(req$, {
|
|
143
|
+
context,
|
|
144
|
+
errorCodes: [],
|
|
145
|
+
retryConfig: context.retryConfig,
|
|
146
|
+
retryCodes: context.retryCodes,
|
|
147
|
+
});
|
|
148
|
+
if (!doResult.ok) {
|
|
149
|
+
return [doResult, { status: "request-error", request: req$ }];
|
|
150
|
+
}
|
|
151
|
+
return [doResult, {
|
|
152
|
+
status: "complete",
|
|
153
|
+
"request": req$,
|
|
154
|
+
response: doResult.value,
|
|
155
|
+
}];
|
|
156
|
+
}
|
package/src/landing-page.ts
CHANGED
|
@@ -931,7 +931,7 @@ http_headers = { "lightsage-api-key-auth" = "YOUR_LIGHTSAGE_API_KEY_AUTH" }`;
|
|
|
931
931
|
<h1>Instructions</h1>
|
|
932
932
|
<p>One-click installation for Claude Desktop users</p>
|
|
933
933
|
<div class="instruction-item">
|
|
934
|
-
<a href="https://github.com/lightsagehq/mcp/releases/download/v0.4.
|
|
934
|
+
<a href="https://github.com/lightsagehq/mcp/releases/download/v0.4.4/mcp-server.mcpb" download="mcp-server.mcpb" class="action-button header-action" style="display: inline-flex; margin-bottom: 16px;">
|
|
935
935
|
📥 Download MCP Bundle
|
|
936
936
|
</a>
|
|
937
937
|
</div>
|
package/src/lib/config.ts
CHANGED
|
@@ -66,7 +66,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
66
66
|
export const SDK_METADATA = {
|
|
67
67
|
language: "typescript",
|
|
68
68
|
openapiDocVersion: "1.0.0",
|
|
69
|
-
sdkVersion: "0.4.
|
|
70
|
-
genVersion: "2.
|
|
71
|
-
userAgent: "speakeasy-sdk/mcp-typescript 0.4.
|
|
69
|
+
sdkVersion: "0.4.4",
|
|
70
|
+
genVersion: "2.943.0",
|
|
71
|
+
userAgent: "speakeasy-sdk/mcp-typescript 0.4.4 2.943.0 1.0.0 @lightsage/mcp",
|
|
72
72
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -48,6 +48,8 @@ import { tool$evalTemplatesV2EvalTemplatesUpdate } from "./tools/evalTemplatesV2
|
|
|
48
48
|
import { tool$mcpServersV2MCPServersList } from "./tools/mcpServersV2MCPServersList.js";
|
|
49
49
|
import { tool$opportunitiesV2OpportunitiesList } from "./tools/opportunitiesV2OpportunitiesList.js";
|
|
50
50
|
import { tool$opportunitiesV2OpportunitiesRetrieve } from "./tools/opportunitiesV2OpportunitiesRetrieve.js";
|
|
51
|
+
import { tool$promptsRun } from "./tools/promptsRun.js";
|
|
52
|
+
import { tool$promptsRunStatus } from "./tools/promptsRunStatus.js";
|
|
51
53
|
import { tool$promptsV2PromptRunsList } from "./tools/promptsV2PromptRunsList.js";
|
|
52
54
|
import { tool$promptsV2PromptRunsRetrieve } from "./tools/promptsV2PromptRunsRetrieve.js";
|
|
53
55
|
import { tool$promptsV2PromptsCreate } from "./tools/promptsV2PromptsCreate.js";
|
|
@@ -96,7 +98,7 @@ export function createMCPServer(deps: {
|
|
|
96
98
|
sizes: ["any"],
|
|
97
99
|
}],
|
|
98
100
|
name: "LightsageMcp",
|
|
99
|
-
version: "0.4.
|
|
101
|
+
version: "0.4.4",
|
|
100
102
|
});
|
|
101
103
|
|
|
102
104
|
const getClient = deps.getSDK || (() =>
|
|
@@ -158,6 +160,8 @@ export function createMCPServer(deps: {
|
|
|
158
160
|
tool(tool$promptsV2PromptsRetrieve);
|
|
159
161
|
tool(tool$promptsV2PromptsUpdate);
|
|
160
162
|
tool(tool$promptsV2PromptsDelete);
|
|
163
|
+
tool(tool$promptsRun);
|
|
164
|
+
tool(tool$promptsRunStatus);
|
|
161
165
|
tool(tool$opportunitiesV2OpportunitiesList);
|
|
162
166
|
tool(tool$opportunitiesV2OpportunitiesRetrieve);
|
|
163
167
|
tool(tool$tasksV2TasksList);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: e0ae54886903
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { promptsRun } from "../../funcs/promptsRun.js";
|
|
7
|
+
import { CreateV2PromptRunRequest$zodSchema } from "../../models/createv2promptrunrequest.js";
|
|
8
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
9
|
+
|
|
10
|
+
const args = {
|
|
11
|
+
request: CreateV2PromptRunRequest$zodSchema,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool$promptsRun: ToolDefinition<typeof args> = {
|
|
15
|
+
name: "prompts-run",
|
|
16
|
+
description: `Run Prompts
|
|
17
|
+
|
|
18
|
+
Queue saved prompts using the organization's configured targets.
|
|
19
|
+
|
|
20
|
+
Provide \`prompt_ids\` to run selected prompts, or omit them to run all active
|
|
21
|
+
prompts. Saved prompt run settings apply to coding-agent targets. The
|
|
22
|
+
response returns a run ID to poll with
|
|
23
|
+
\`GET /v2/prompts/runs/{run_id}/status\`.`,
|
|
24
|
+
annotations: {
|
|
25
|
+
"title": "",
|
|
26
|
+
"destructiveHint": false,
|
|
27
|
+
"idempotentHint": false,
|
|
28
|
+
"openWorldHint": false,
|
|
29
|
+
"readOnlyHint": false,
|
|
30
|
+
},
|
|
31
|
+
args,
|
|
32
|
+
tool: async (client, args, ctx) => {
|
|
33
|
+
const [result] = await promptsRun(
|
|
34
|
+
client,
|
|
35
|
+
args.request,
|
|
36
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
37
|
+
).$inspect();
|
|
38
|
+
|
|
39
|
+
if (!result.ok) {
|
|
40
|
+
return {
|
|
41
|
+
content: [{ type: "text", text: result.error.message }],
|
|
42
|
+
isError: true,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return formatResult(result.value);
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 6ee310f41b65
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { promptsRunStatus } from "../../funcs/promptsRunStatus.js";
|
|
7
|
+
import { V2PromptRunStatusRetrieveRequest$zodSchema } from "../../models/v2promptrunstatusretrieveop.js";
|
|
8
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
9
|
+
|
|
10
|
+
const args = {
|
|
11
|
+
request: V2PromptRunStatusRetrieveRequest$zodSchema,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool$promptsRunStatus: ToolDefinition<typeof args> = {
|
|
15
|
+
name: "prompts-run-status",
|
|
16
|
+
description: `Get Prompt Run Status
|
|
17
|
+
|
|
18
|
+
Return status and progress for a queued prompt run.
|
|
19
|
+
|
|
20
|
+
Poll this endpoint until \`status\` is \`completed\`, \`failed\`, or \`cancelled\`.
|
|
21
|
+
Individual stored results are available from \`GET /v2/prompts/runs\`.`,
|
|
22
|
+
annotations: {
|
|
23
|
+
"title": "",
|
|
24
|
+
"destructiveHint": false,
|
|
25
|
+
"idempotentHint": false,
|
|
26
|
+
"openWorldHint": false,
|
|
27
|
+
"readOnlyHint": true,
|
|
28
|
+
},
|
|
29
|
+
args,
|
|
30
|
+
tool: async (client, args, ctx) => {
|
|
31
|
+
const [result] = await promptsRunStatus(
|
|
32
|
+
client,
|
|
33
|
+
args.request,
|
|
34
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
35
|
+
).$inspect();
|
|
36
|
+
|
|
37
|
+
if (!result.ok) {
|
|
38
|
+
return {
|
|
39
|
+
content: [{ type: "text", text: result.error.message }],
|
|
40
|
+
isError: true,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return formatResult(result.value);
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: b7b72bfe20d1
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
|
|
8
|
+
export type CreateV2PromptRunRequest = {
|
|
9
|
+
prompt_ids?: Array<string> | null | undefined;
|
|
10
|
+
force?: boolean | undefined;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const CreateV2PromptRunRequest$zodSchema: z.ZodType<
|
|
14
|
+
CreateV2PromptRunRequest
|
|
15
|
+
> = z.object({
|
|
16
|
+
force: z.boolean().default(false).describe(
|
|
17
|
+
"Run even when a prompt already ran today on the configured platform and model.",
|
|
18
|
+
),
|
|
19
|
+
prompt_ids: z.array(z.string()).nullable().optional().describe(
|
|
20
|
+
"Prompt IDs from `GET /v2/prompts`. Omit this field to run all active prompts.",
|
|
21
|
+
),
|
|
22
|
+
});
|
|
@@ -110,9 +110,9 @@ export const EvalTemplate$zodSchema: z.ZodType<EvalTemplate> = z.object({
|
|
|
110
110
|
competitor_ids: z.array(z.string()).optional().describe(
|
|
111
111
|
"Competitor IDs that create additional variants when `competitors` is included.",
|
|
112
112
|
),
|
|
113
|
-
created_at: z.
|
|
113
|
+
created_at: z.string(),
|
|
114
114
|
created_by: z.string().nullable().optional(),
|
|
115
|
-
deleted_at: z.
|
|
115
|
+
deleted_at: z.string().nullable().optional(),
|
|
116
116
|
description: z.string().nullable().optional().describe(
|
|
117
117
|
"Optional guidance describing when to use the template.",
|
|
118
118
|
),
|
|
@@ -149,6 +149,6 @@ export const EvalTemplate$zodSchema: z.ZodType<EvalTemplate> = z.object({
|
|
|
149
149
|
target_keys: z.array(z.string()).optional().describe(
|
|
150
150
|
"Runnable target keys copied when `targets` is included, such as `agent:codex:gpt-5.6-terra`.",
|
|
151
151
|
),
|
|
152
|
-
updated_at: z.
|
|
152
|
+
updated_at: z.string(),
|
|
153
153
|
version: z.int(),
|
|
154
154
|
});
|
|
@@ -23,9 +23,15 @@ export const V2EvalRunsCreateForbiddenResponseBody$zodSchema: z.ZodType<
|
|
|
23
23
|
"The requested coding agent is unavailable on the organization's current plan.",
|
|
24
24
|
);
|
|
25
25
|
|
|
26
|
-
export type
|
|
26
|
+
export type V2EvalRunsCreateDetail = {
|
|
27
|
+
error: string;
|
|
28
|
+
required: number;
|
|
29
|
+
balance: number;
|
|
30
|
+
};
|
|
27
31
|
|
|
28
|
-
export const
|
|
32
|
+
export const V2EvalRunsCreateDetail$zodSchema: z.ZodType<
|
|
33
|
+
V2EvalRunsCreateDetail
|
|
34
|
+
> = z.object({
|
|
29
35
|
balance: z.number().describe("The organization's current credit balance."),
|
|
30
36
|
error: z.string(),
|
|
31
37
|
required: z.number().describe("Usage-based credits the requested run needs."),
|
|
@@ -34,12 +40,14 @@ export const Detail$zodSchema: z.ZodType<Detail> = z.object({
|
|
|
34
40
|
/**
|
|
35
41
|
* The organization does not currently have enough credits for the requested run.
|
|
36
42
|
*/
|
|
37
|
-
export type V2EvalRunsCreatePaymentRequiredResponseBody = {
|
|
43
|
+
export type V2EvalRunsCreatePaymentRequiredResponseBody = {
|
|
44
|
+
detail: V2EvalRunsCreateDetail;
|
|
45
|
+
};
|
|
38
46
|
|
|
39
47
|
export const V2EvalRunsCreatePaymentRequiredResponseBody$zodSchema: z.ZodType<
|
|
40
48
|
V2EvalRunsCreatePaymentRequiredResponseBody
|
|
41
49
|
> = z.object({
|
|
42
|
-
detail: z.lazy(() =>
|
|
50
|
+
detail: z.lazy(() => V2EvalRunsCreateDetail$zodSchema),
|
|
43
51
|
}).describe(
|
|
44
52
|
"The organization does not currently have enough credits for the requested run.",
|
|
45
53
|
);
|
|
@@ -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,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
|
+
]);
|
|
@@ -25,7 +25,7 @@ export const V2VisibilityCurrentRetrieveRequest$zodSchema: z.ZodType<
|
|
|
25
25
|
"Inclusive range end; defaults to today.",
|
|
26
26
|
).optional(),
|
|
27
27
|
start_date: z.string().date().describe(
|
|
28
|
-
"Inclusive range start; defaults to 30 days before the end date.",
|
|
28
|
+
"Inclusive range start; defaults to 30 days before the end date. The range may span at most 90 days.",
|
|
29
29
|
).optional(),
|
|
30
30
|
});
|
|
31
31
|
|
|
@@ -25,7 +25,7 @@ export const V2VisibilityOverviewRetrieveRequest$zodSchema: z.ZodType<
|
|
|
25
25
|
"Inclusive range end; defaults to today.",
|
|
26
26
|
).optional(),
|
|
27
27
|
start_date: z.string().date().describe(
|
|
28
|
-
"Inclusive range start; defaults to 30 days before the end date.",
|
|
28
|
+
"Inclusive range start; defaults to 30 days before the end date. The range may span at most 90 days.",
|
|
29
29
|
).optional(),
|
|
30
30
|
});
|
|
31
31
|
|
|
@@ -25,7 +25,7 @@ export const V2VisibilityPromptsRetrieveRequest$zodSchema: z.ZodType<
|
|
|
25
25
|
"Inclusive range end; defaults to today.",
|
|
26
26
|
).optional(),
|
|
27
27
|
start_date: z.string().date().describe(
|
|
28
|
-
"Inclusive range start; defaults to 30 days before the end date.",
|
|
28
|
+
"Inclusive range start; defaults to 30 days before the end date. The range may span at most 90 days.",
|
|
29
29
|
).optional(),
|
|
30
30
|
});
|
|
31
31
|
|