@lightsage/mcp 0.4.2 → 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 (64) hide show
  1. package/README.md +2 -2
  2. package/bin/mcp-server.js +449 -128
  3. package/bin/mcp-server.js.map +15 -8
  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/landing-page.js +1 -1
  13. package/esm/lib/config.d.ts +2 -2
  14. package/esm/lib/config.js +2 -2
  15. package/esm/mcp-server/mcp-server.js +1 -1
  16. package/esm/mcp-server/server.d.ts.map +1 -1
  17. package/esm/mcp-server/server.js +5 -1
  18. package/esm/mcp-server/server.js.map +1 -1
  19. package/esm/mcp-server/tools/promptsRun.d.ts +7 -0
  20. package/esm/mcp-server/tools/promptsRun.d.ts.map +1 -0
  21. package/esm/mcp-server/tools/promptsRun.js +40 -0
  22. package/esm/mcp-server/tools/promptsRun.js.map +1 -0
  23. package/esm/mcp-server/tools/promptsRunStatus.d.ts +7 -0
  24. package/esm/mcp-server/tools/promptsRunStatus.d.ts.map +1 -0
  25. package/esm/mcp-server/tools/promptsRunStatus.js +38 -0
  26. package/esm/mcp-server/tools/promptsRunStatus.js.map +1 -0
  27. package/esm/models/createv2promptrunrequest.d.ts +7 -0
  28. package/esm/models/createv2promptrunrequest.d.ts.map +1 -0
  29. package/esm/models/createv2promptrunrequest.js +10 -0
  30. package/esm/models/createv2promptrunrequest.js.map +1 -0
  31. package/esm/models/v2evalrunscreateop.d.ts +3 -3
  32. package/esm/models/v2evalrunscreateop.d.ts.map +1 -1
  33. package/esm/models/v2evalrunscreateop.js +2 -2
  34. package/esm/models/v2evalrunscreateop.js.map +1 -1
  35. package/esm/models/v2promptrunjobresponse.d.ts +46 -0
  36. package/esm/models/v2promptrunjobresponse.d.ts.map +1 -0
  37. package/esm/models/v2promptrunjobresponse.js +49 -0
  38. package/esm/models/v2promptrunjobresponse.js.map +1 -0
  39. package/esm/models/v2promptrunscreateop.d.ts +40 -0
  40. package/esm/models/v2promptrunscreateop.d.ts.map +1 -0
  41. package/esm/models/v2promptrunscreateop.js +33 -0
  42. package/esm/models/v2promptrunscreateop.js.map +1 -0
  43. package/esm/models/v2promptrunstatusretrieveop.d.ts +24 -0
  44. package/esm/models/v2promptrunstatusretrieveop.d.ts.map +1 -0
  45. package/esm/models/v2promptrunstatusretrieveop.js +23 -0
  46. package/esm/models/v2promptrunstatusretrieveop.js.map +1 -0
  47. package/esm/tool-names.d.ts.map +1 -1
  48. package/esm/tool-names.js +8 -0
  49. package/esm/tool-names.js.map +1 -1
  50. package/package.json +9 -4
  51. package/src/funcs/promptsRun.ts +150 -0
  52. package/src/funcs/promptsRunStatus.ts +156 -0
  53. package/src/landing-page.ts +1 -1
  54. package/src/lib/config.ts +2 -2
  55. package/src/mcp-server/mcp-server.ts +1 -1
  56. package/src/mcp-server/server.ts +5 -1
  57. package/src/mcp-server/tools/promptsRun.ts +48 -0
  58. package/src/mcp-server/tools/promptsRunStatus.ts +46 -0
  59. package/src/models/createv2promptrunrequest.ts +22 -0
  60. package/src/models/v2evalrunscreateop.ts +12 -4
  61. package/src/models/v2promptrunjobresponse.ts +97 -0
  62. package/src/models/v2promptrunscreateop.ts +100 -0
  63. package/src/models/v2promptrunstatusretrieveop.ts +64 -0
  64. package/src/tool-names.ts +8 -0
@@ -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
+ });
@@ -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 Detail = { error: string; required: number; balance: number };
26
+ export type V2EvalRunsCreateDetail = {
27
+ error: string;
28
+ required: number;
29
+ balance: number;
30
+ };
27
31
 
28
- export const Detail$zodSchema: z.ZodType<Detail> = z.object({
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 = { detail: Detail };
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(() => Detail$zodSchema),
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
+ ]);
package/src/tool-names.ts CHANGED
@@ -68,6 +68,14 @@ export const toolNames: Array<{ name: string; description: string }>= [
68
68
  "name": "prompts-v2-prompts-delete",
69
69
  "description": "Delete Prompt\n\nArchives the prompt and excludes it from normal listings while preserving its historical run data."
70
70
  },
71
+ {
72
+ "name": "prompts-run",
73
+ "description": "Run Prompts\n\nQueue saved prompts using the organization's configured targets.\n\nProvide `prompt_ids` to run selected prompts, or omit them to run all active\nprompts. Saved prompt run settings apply to coding-agent targets. The\nresponse returns a run ID to poll with\n`GET /v2/prompts/runs/{run_id}/status`."
74
+ },
75
+ {
76
+ "name": "prompts-run-status",
77
+ "description": "Get Prompt Run Status\n\nReturn status and progress for a queued prompt run.\n\nPoll this endpoint until `status` is `completed`, `failed`, or `cancelled`.\nIndividual stored results are available from `GET /v2/prompts/runs`."
78
+ },
71
79
  {
72
80
  "name": "opportunities-v2-opportunities-list",
73
81
  "description": "List Opportunities\n\nReturns ranked opportunities computed from stored prompt visibility results. Each includes an `execution_prompt` with context for an AI agent. Default window is 30 days."