@lightsage/mcp 0.4.18 → 0.4.19
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/api/mcp.js +4 -1
- package/bin/mcp-server.js +440 -116
- package/bin/mcp-server.js.map +23 -14
- package/esm/funcs/agentsList.d.ts +1 -1
- package/esm/funcs/agentsList.js +1 -1
- package/esm/funcs/promptsRun.d.ts +2 -1
- package/esm/funcs/promptsRun.d.ts.map +1 -1
- package/esm/funcs/promptsRun.js +2 -1
- package/esm/funcs/promptsRun.js.map +1 -1
- package/esm/funcs/promptsTargetsList.d.ts +16 -0
- package/esm/funcs/promptsTargetsList.d.ts.map +1 -0
- package/esm/funcs/promptsTargetsList.js +86 -0
- package/esm/funcs/promptsTargetsList.js.map +1 -0
- package/esm/funcs/promptsTargetsSet.d.ts +16 -0
- package/esm/funcs/promptsTargetsSet.d.ts.map +1 -0
- package/esm/funcs/promptsTargetsSet.js +83 -0
- package/esm/funcs/promptsTargetsSet.js.map +1 -0
- package/esm/landing-page.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- 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/agentsList.js +1 -1
- package/esm/mcp-server/tools/agentsList.js.map +1 -1
- package/esm/mcp-server/tools/promptsRun.d.ts.map +1 -1
- package/esm/mcp-server/tools/promptsRun.js +2 -1
- package/esm/mcp-server/tools/promptsRun.js.map +1 -1
- package/esm/mcp-server/tools/promptsTargetsList.d.ts +7 -0
- package/esm/mcp-server/tools/promptsTargetsList.d.ts.map +1 -0
- package/esm/mcp-server/tools/promptsTargetsList.js +35 -0
- package/esm/mcp-server/tools/promptsTargetsList.js.map +1 -0
- package/esm/mcp-server/tools/promptsTargetsSet.d.ts +7 -0
- package/esm/mcp-server/tools/promptsTargetsSet.d.ts.map +1 -0
- package/esm/mcp-server/tools/promptsTargetsSet.js +35 -0
- package/esm/mcp-server/tools/promptsTargetsSet.js.map +1 -0
- package/esm/models/createv2promptrunrequest.js +1 -1
- package/esm/models/createv2promptrunrequest.js.map +1 -1
- package/esm/models/evaltemplateschedule.d.ts +4 -4
- package/esm/models/evaltemplateschedule.d.ts.map +1 -1
- package/esm/models/evaltemplateschedule.js +4 -3
- package/esm/models/evaltemplateschedule.js.map +1 -1
- package/esm/models/setv2prompttargetsrequest.d.ts +8 -0
- package/esm/models/setv2prompttargetsrequest.d.ts.map +1 -0
- package/esm/models/setv2prompttargetsrequest.js +11 -0
- package/esm/models/setv2prompttargetsrequest.js.map +1 -0
- package/esm/models/setv2prompttargetsresponse.d.ts +9 -0
- package/esm/models/setv2prompttargetsresponse.d.ts.map +1 -0
- package/esm/models/setv2prompttargetsresponse.js +12 -0
- package/esm/models/setv2prompttargetsresponse.js.map +1 -0
- package/esm/models/v2prompttarget.d.ts +44 -0
- package/esm/models/v2prompttarget.d.ts.map +1 -0
- package/esm/models/v2prompttarget.js +41 -0
- package/esm/models/v2prompttarget.js.map +1 -0
- package/esm/models/v2prompttargetinput.d.ts +47 -0
- package/esm/models/v2prompttargetinput.d.ts.map +1 -0
- package/esm/models/v2prompttargetinput.js +45 -0
- package/esm/models/v2prompttargetinput.js.map +1 -0
- package/esm/models/v2prompttargetslistop.d.ts +10 -0
- package/esm/models/v2prompttargetslistop.d.ts.map +1 -0
- package/esm/models/v2prompttargetslistop.js +15 -0
- package/esm/models/v2prompttargetslistop.js.map +1 -0
- package/esm/models/v2prompttargetsresponse.d.ts +8 -0
- package/esm/models/v2prompttargetsresponse.d.ts.map +1 -0
- package/esm/models/v2prompttargetsresponse.js +11 -0
- package/esm/models/v2prompttargetsresponse.js.map +1 -0
- package/esm/models/v2prompttargetssetop.d.ts +6 -0
- package/esm/models/v2prompttargetssetop.d.ts.map +1 -0
- package/esm/models/v2prompttargetssetop.js +12 -0
- package/esm/models/v2prompttargetssetop.js.map +1 -0
- package/esm/tool-names.d.ts.map +1 -1
- package/esm/tool-names.js +10 -2
- package/esm/tool-names.js.map +1 -1
- package/lib/feedback.js +47 -0
- package/lib/tracker.js +4 -2
- package/package.json +5 -4
- package/src/funcs/agentsList.ts +1 -1
- package/src/funcs/promptsRun.ts +2 -1
- package/src/funcs/promptsTargetsList.ts +148 -0
- package/src/funcs/promptsTargetsSet.ts +145 -0
- package/src/landing-page.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/agentsList.ts +1 -1
- package/src/mcp-server/tools/promptsRun.ts +2 -1
- package/src/mcp-server/tools/promptsTargetsList.ts +43 -0
- package/src/mcp-server/tools/promptsTargetsSet.ts +43 -0
- package/src/models/createv2promptrunrequest.ts +1 -1
- package/src/models/evaltemplateschedule.ts +8 -7
- package/src/models/setv2prompttargetsrequest.ts +26 -0
- package/src/models/setv2prompttargetsresponse.ts +23 -0
- package/src/models/v2prompttarget.ts +79 -0
- package/src/models/v2prompttargetinput.ts +72 -0
- package/src/models/v2prompttargetslistop.ts +33 -0
- package/src/models/v2prompttargetsresponse.ts +19 -0
- package/src/models/v2prompttargetssetop.ts +25 -0
- package/src/tool-names.ts +10 -2
- package/test/tracker.test.js +83 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 053c9d85cd77
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { LightsageMcpCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery } 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
|
+
V2PromptTargetsListRequest,
|
|
24
|
+
V2PromptTargetsListRequest$zodSchema,
|
|
25
|
+
} from "../models/v2prompttargetslistop.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* List Targets
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Returns the answer engines and coding agents that run the organization's prompts on schedule, with each target's topic and frequency. Provide `topic_id` to list one topic's targets.
|
|
34
|
+
*/
|
|
35
|
+
export function promptsTargetsList(
|
|
36
|
+
client$: LightsageMcpCore,
|
|
37
|
+
request?: V2PromptTargetsListRequest | undefined,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
Response,
|
|
42
|
+
| APIError
|
|
43
|
+
| SDKValidationError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client$,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client$: LightsageMcpCore,
|
|
60
|
+
request?: V2PromptTargetsListRequest | undefined,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
Response,
|
|
66
|
+
| APIError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed$ = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value$) => V2PromptTargetsListRequest$zodSchema.optional().parse(value$),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed$.ok) {
|
|
83
|
+
return [parsed$, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload$ = parsed$.value;
|
|
86
|
+
const body$ = null;
|
|
87
|
+
const path$ = pathToFunc("/v2/prompts/targets")();
|
|
88
|
+
const query$ = encodeFormQuery({
|
|
89
|
+
"topic_id": payload$?.topic_id,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const headers$ = new Headers(compactMap({
|
|
93
|
+
Accept: "application/json",
|
|
94
|
+
}));
|
|
95
|
+
const securityInput = await extractSecurity(client$._options.security);
|
|
96
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
97
|
+
|
|
98
|
+
const context = {
|
|
99
|
+
options: client$._options,
|
|
100
|
+
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
101
|
+
operationID: "v2_prompt_targets_list",
|
|
102
|
+
oAuth2Scopes: null,
|
|
103
|
+
resolvedSecurity: requestSecurity,
|
|
104
|
+
securitySource: client$._options.security,
|
|
105
|
+
retryConfig: options?.retries
|
|
106
|
+
|| client$._options.retryConfig
|
|
107
|
+
|| { strategy: "none" },
|
|
108
|
+
retryCodes: options?.retryCodes || [
|
|
109
|
+
"429",
|
|
110
|
+
"500",
|
|
111
|
+
"502",
|
|
112
|
+
"503",
|
|
113
|
+
"504",
|
|
114
|
+
],
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const requestRes = client$._createRequest(context, {
|
|
118
|
+
security: requestSecurity,
|
|
119
|
+
method: "GET",
|
|
120
|
+
baseURL: options?.serverURL,
|
|
121
|
+
path: path$,
|
|
122
|
+
headers: headers$,
|
|
123
|
+
query: query$,
|
|
124
|
+
body: body$,
|
|
125
|
+
userAgent: client$._options.userAgent,
|
|
126
|
+
timeoutMs: options?.timeoutMs || client$._options.timeoutMs
|
|
127
|
+
|| -1,
|
|
128
|
+
}, options);
|
|
129
|
+
if (!requestRes.ok) {
|
|
130
|
+
return [requestRes, { status: "invalid" }];
|
|
131
|
+
}
|
|
132
|
+
const req$ = requestRes.value;
|
|
133
|
+
|
|
134
|
+
const doResult = await client$._do(req$, {
|
|
135
|
+
context,
|
|
136
|
+
errorCodes: [],
|
|
137
|
+
retryConfig: context.retryConfig,
|
|
138
|
+
retryCodes: context.retryCodes,
|
|
139
|
+
});
|
|
140
|
+
if (!doResult.ok) {
|
|
141
|
+
return [doResult, { status: "request-error", request: req$ }];
|
|
142
|
+
}
|
|
143
|
+
return [doResult, {
|
|
144
|
+
status: "complete",
|
|
145
|
+
"request": req$,
|
|
146
|
+
response: doResult.value,
|
|
147
|
+
}];
|
|
148
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 1b39d535380b
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { LightsageMcpCore } from "../core.js";
|
|
7
|
+
import { encodeJSON } 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
|
+
SetV2PromptTargetsRequest,
|
|
24
|
+
SetV2PromptTargetsRequest$zodSchema,
|
|
25
|
+
} from "../models/setv2prompttargetsrequest.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Set Targets
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Sets which answer engines and coding agents run a topic's prompts on schedule, the same way the prompt editor does. The list replaces the topic's targets: targets you leave out stop running. Every prompt in the topic is set to exactly these platforms; you can still narrow one prompt afterwards with `platform_ids`. Name coding agents with IDs from `GET /v2/agents`, and list a harness more than once to run it on several models. To pick agents for a single run without changing the schedule, pass `agent` to `POST /v2/prompts/runs` instead.
|
|
34
|
+
*/
|
|
35
|
+
export function promptsTargetsSet(
|
|
36
|
+
client$: LightsageMcpCore,
|
|
37
|
+
request: SetV2PromptTargetsRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
Response,
|
|
42
|
+
| APIError
|
|
43
|
+
| SDKValidationError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client$,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client$: LightsageMcpCore,
|
|
60
|
+
request: SetV2PromptTargetsRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
Response,
|
|
66
|
+
| APIError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed$ = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value$) => SetV2PromptTargetsRequest$zodSchema.parse(value$),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed$.ok) {
|
|
83
|
+
return [parsed$, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload$ = parsed$.value;
|
|
86
|
+
const body$ = encodeJSON("body", payload$, { explode: true });
|
|
87
|
+
const path$ = pathToFunc("/v2/prompts/targets")();
|
|
88
|
+
|
|
89
|
+
const headers$ = new Headers(compactMap({
|
|
90
|
+
"Content-Type": "application/json",
|
|
91
|
+
Accept: "application/json",
|
|
92
|
+
}));
|
|
93
|
+
const securityInput = await extractSecurity(client$._options.security);
|
|
94
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
95
|
+
|
|
96
|
+
const context = {
|
|
97
|
+
options: client$._options,
|
|
98
|
+
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
99
|
+
operationID: "v2_prompt_targets_set",
|
|
100
|
+
oAuth2Scopes: null,
|
|
101
|
+
resolvedSecurity: requestSecurity,
|
|
102
|
+
securitySource: client$._options.security,
|
|
103
|
+
retryConfig: options?.retries
|
|
104
|
+
|| client$._options.retryConfig
|
|
105
|
+
|| { strategy: "none" },
|
|
106
|
+
retryCodes: options?.retryCodes || [
|
|
107
|
+
"429",
|
|
108
|
+
"500",
|
|
109
|
+
"502",
|
|
110
|
+
"503",
|
|
111
|
+
"504",
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const requestRes = client$._createRequest(context, {
|
|
116
|
+
security: requestSecurity,
|
|
117
|
+
method: "PUT",
|
|
118
|
+
baseURL: options?.serverURL,
|
|
119
|
+
path: path$,
|
|
120
|
+
headers: headers$,
|
|
121
|
+
body: body$,
|
|
122
|
+
userAgent: client$._options.userAgent,
|
|
123
|
+
timeoutMs: options?.timeoutMs || client$._options.timeoutMs
|
|
124
|
+
|| -1,
|
|
125
|
+
}, options);
|
|
126
|
+
if (!requestRes.ok) {
|
|
127
|
+
return [requestRes, { status: "invalid" }];
|
|
128
|
+
}
|
|
129
|
+
const req$ = requestRes.value;
|
|
130
|
+
|
|
131
|
+
const doResult = await client$._do(req$, {
|
|
132
|
+
context,
|
|
133
|
+
errorCodes: [],
|
|
134
|
+
retryConfig: context.retryConfig,
|
|
135
|
+
retryCodes: context.retryCodes,
|
|
136
|
+
});
|
|
137
|
+
if (!doResult.ok) {
|
|
138
|
+
return [doResult, { status: "request-error", request: req$ }];
|
|
139
|
+
}
|
|
140
|
+
return [doResult, {
|
|
141
|
+
status: "complete",
|
|
142
|
+
"request": req$,
|
|
143
|
+
response: doResult.value,
|
|
144
|
+
}];
|
|
145
|
+
}
|
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.19/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.
|
|
69
|
+
sdkVersion: "0.4.19",
|
|
70
70
|
genVersion: "2.948.4",
|
|
71
|
-
userAgent: "speakeasy-sdk/mcp-typescript 0.4.
|
|
71
|
+
userAgent: "speakeasy-sdk/mcp-typescript 0.4.19 2.948.4 1.0.0 @lightsage/mcp",
|
|
72
72
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -68,6 +68,8 @@ import { tool$promptsRunCancel } from "./tools/promptsRunCancel.js";
|
|
|
68
68
|
import { tool$promptsRunsList } from "./tools/promptsRunsList.js";
|
|
69
69
|
import { tool$promptsRunsRetrieve } from "./tools/promptsRunsRetrieve.js";
|
|
70
70
|
import { tool$promptsRunStatus } from "./tools/promptsRunStatus.js";
|
|
71
|
+
import { tool$promptsTargetsList } from "./tools/promptsTargetsList.js";
|
|
72
|
+
import { tool$promptsTargetsSet } from "./tools/promptsTargetsSet.js";
|
|
71
73
|
import { tool$promptsTopicsCreate } from "./tools/promptsTopicsCreate.js";
|
|
72
74
|
import { tool$promptsTopicsDelete } from "./tools/promptsTopicsDelete.js";
|
|
73
75
|
import { tool$promptsTopicsList } from "./tools/promptsTopicsList.js";
|
|
@@ -112,7 +114,7 @@ export function createMCPServer(deps: {
|
|
|
112
114
|
sizes: ["any"],
|
|
113
115
|
}],
|
|
114
116
|
name: "LightsageMcp",
|
|
115
|
-
version: "0.4.
|
|
117
|
+
version: "0.4.19",
|
|
116
118
|
});
|
|
117
119
|
|
|
118
120
|
const getClient = deps.getSDK || (() =>
|
|
@@ -170,6 +172,8 @@ export function createMCPServer(deps: {
|
|
|
170
172
|
tool(tool$promptsTopicsCreate);
|
|
171
173
|
tool(tool$promptsTopicsUpdate);
|
|
172
174
|
tool(tool$promptsTopicsDelete);
|
|
175
|
+
tool(tool$promptsTargetsList);
|
|
176
|
+
tool(tool$promptsTargetsSet);
|
|
173
177
|
tool(tool$promptsRunsList);
|
|
174
178
|
tool(tool$promptsRunsRetrieve);
|
|
175
179
|
tool(tool$promptsRetrieve);
|
|
@@ -10,7 +10,7 @@ export const tool$agentsList: ToolDefinition = {
|
|
|
10
10
|
name: "agents-list",
|
|
11
11
|
description: `List Agents
|
|
12
12
|
|
|
13
|
-
Returns the coding-agent harness-and-model combinations your plan can run, as single agent IDs. Pass them as \`agent\` to \`POST /v2/prompts/runs\` to see how coding agents answer your prompts, with mentions and citations; to \`POST /v2/agent-preference/evals\` to see whether agents recommend your company over one competitor; or to \`POST /v2/evals\` and \`POST /v2/eval-runs\` to measure how well agents complete tasks with your product.`,
|
|
13
|
+
Returns the coding-agent harness-and-model combinations your plan can run, as single agent IDs. Pass them as \`agent\` to \`POST /v2/prompts/runs\` to see how coding agents answer your prompts, with mentions and citations, or to \`PUT /v2/prompts/targets\` to run them on a schedule; to \`POST /v2/agent-preference/evals\` to see whether agents recommend your company over one competitor; or to \`POST /v2/evals\` and \`POST /v2/eval-runs\` to measure how well agents complete tasks with your product.`,
|
|
14
14
|
annotations: {
|
|
15
15
|
"title": "",
|
|
16
16
|
"destructiveHint": false,
|
|
@@ -18,7 +18,8 @@ export const tool$promptsRun: ToolDefinition<typeof args> = {
|
|
|
18
18
|
Queue saved prompts on answer engines and coding agents.
|
|
19
19
|
|
|
20
20
|
Provide \`prompt_ids\` to run selected prompts, or omit them to run all active
|
|
21
|
-
prompts. By default the run uses the organization's configured targets
|
|
21
|
+
prompts. By default the run uses the organization's configured targets,
|
|
22
|
+
listed by \`GET /v2/prompts/targets\`.
|
|
22
23
|
Provide \`agent\` with IDs from \`GET /v2/agents\` to run the prompts on
|
|
23
24
|
specific coding-agent harnesses and models instead, for example to compare
|
|
24
25
|
how several coding tools answer the same developer question. Results
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ea463f944d6c
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { promptsTargetsList } from "../../funcs/promptsTargetsList.js";
|
|
7
|
+
import { V2PromptTargetsListRequest$zodSchema } from "../../models/v2prompttargetslistop.js";
|
|
8
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
9
|
+
|
|
10
|
+
const args = {
|
|
11
|
+
request: V2PromptTargetsListRequest$zodSchema.optional(),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool$promptsTargetsList: ToolDefinition<typeof args> = {
|
|
15
|
+
name: "prompts-targets-list",
|
|
16
|
+
description: `List Targets
|
|
17
|
+
|
|
18
|
+
Returns the answer engines and coding agents that run the organization's prompts on schedule, with each target's topic and frequency. Provide \`topic_id\` to list one topic's targets.`,
|
|
19
|
+
annotations: {
|
|
20
|
+
"title": "",
|
|
21
|
+
"destructiveHint": false,
|
|
22
|
+
"idempotentHint": false,
|
|
23
|
+
"openWorldHint": false,
|
|
24
|
+
"readOnlyHint": true,
|
|
25
|
+
},
|
|
26
|
+
args,
|
|
27
|
+
tool: async (client, args, ctx) => {
|
|
28
|
+
const [result] = await promptsTargetsList(
|
|
29
|
+
client,
|
|
30
|
+
args.request,
|
|
31
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
32
|
+
).$inspect();
|
|
33
|
+
|
|
34
|
+
if (!result.ok) {
|
|
35
|
+
return {
|
|
36
|
+
content: [{ type: "text", text: result.error.message }],
|
|
37
|
+
isError: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return formatResult(result.value);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f1ffd3b02650
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { promptsTargetsSet } from "../../funcs/promptsTargetsSet.js";
|
|
7
|
+
import { SetV2PromptTargetsRequest$zodSchema } from "../../models/setv2prompttargetsrequest.js";
|
|
8
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
9
|
+
|
|
10
|
+
const args = {
|
|
11
|
+
request: SetV2PromptTargetsRequest$zodSchema,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool$promptsTargetsSet: ToolDefinition<typeof args> = {
|
|
15
|
+
name: "prompts-targets-set",
|
|
16
|
+
description: `Set Targets
|
|
17
|
+
|
|
18
|
+
Sets which answer engines and coding agents run a topic's prompts on schedule, the same way the prompt editor does. The list replaces the topic's targets: targets you leave out stop running. Every prompt in the topic is set to exactly these platforms; you can still narrow one prompt afterwards with \`platform_ids\`. Name coding agents with IDs from \`GET /v2/agents\`, and list a harness more than once to run it on several models. To pick agents for a single run without changing the schedule, pass \`agent\` to \`POST /v2/prompts/runs\` instead.`,
|
|
19
|
+
annotations: {
|
|
20
|
+
"title": "",
|
|
21
|
+
"destructiveHint": false,
|
|
22
|
+
"idempotentHint": false,
|
|
23
|
+
"openWorldHint": false,
|
|
24
|
+
"readOnlyHint": false,
|
|
25
|
+
},
|
|
26
|
+
args,
|
|
27
|
+
tool: async (client, args, ctx) => {
|
|
28
|
+
const [result] = await promptsTargetsSet(
|
|
29
|
+
client,
|
|
30
|
+
args.request,
|
|
31
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
32
|
+
).$inspect();
|
|
33
|
+
|
|
34
|
+
if (!result.ok) {
|
|
35
|
+
return {
|
|
36
|
+
content: [{ type: "text", text: result.error.message }],
|
|
37
|
+
isError: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return formatResult(result.value);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -15,7 +15,7 @@ export const CreateV2PromptRunRequest$zodSchema: z.ZodType<
|
|
|
15
15
|
CreateV2PromptRunRequest
|
|
16
16
|
> = z.object({
|
|
17
17
|
agent: z.array(z.string()).nullable().optional().describe(
|
|
18
|
-
"Runnable agents from `GET /v2/agents`, each a coding-agent harness and model such as `claude-code:claude-opus-5-5`. Every selected prompt runs once on each agent, so you can compare how several coding tools and models answer the same question. When set, this run uses only these agents instead of the organization's configured targets, including answer engines. Omit it to use the configured targets
|
|
18
|
+
"Runnable agents from `GET /v2/agents`, each a coding-agent harness and model such as `claude-code:claude-opus-5-5`. Every selected prompt runs once on each agent, so you can compare how several coding tools and models answer the same question. When set, this run uses only these agents instead of the organization's configured targets, including answer engines, and saves nothing. Omit it to use the configured targets; change those with `PUT /v2/prompts/targets`. CLI clients expose repeatable `--agent`.",
|
|
19
19
|
),
|
|
20
20
|
force: z.boolean().default(false).describe(
|
|
21
21
|
"Run even when a prompt already ran today on the same platform and model.",
|
|
@@ -9,7 +9,7 @@ import { ClosedEnum } from "../types/enums.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* Schedule cadence used when `enabled` is true.
|
|
11
11
|
*/
|
|
12
|
-
export const
|
|
12
|
+
export const EvalTemplateScheduleFrequency = {
|
|
13
13
|
Daily: "daily",
|
|
14
14
|
EveryOtherDay: "every_other_day",
|
|
15
15
|
Weekly: "weekly",
|
|
@@ -17,9 +17,11 @@ export const Frequency = {
|
|
|
17
17
|
/**
|
|
18
18
|
* Schedule cadence used when `enabled` is true.
|
|
19
19
|
*/
|
|
20
|
-
export type
|
|
20
|
+
export type EvalTemplateScheduleFrequency = ClosedEnum<
|
|
21
|
+
typeof EvalTemplateScheduleFrequency
|
|
22
|
+
>;
|
|
21
23
|
|
|
22
|
-
export const
|
|
24
|
+
export const EvalTemplateScheduleFrequency$zodSchema = z.enum([
|
|
23
25
|
"daily",
|
|
24
26
|
"every_other_day",
|
|
25
27
|
"weekly",
|
|
@@ -30,7 +32,7 @@ export const Frequency$zodSchema = z.enum([
|
|
|
30
32
|
*/
|
|
31
33
|
export type EvalTemplateSchedule = {
|
|
32
34
|
enabled?: boolean | undefined;
|
|
33
|
-
frequency?:
|
|
35
|
+
frequency?: EvalTemplateScheduleFrequency | undefined;
|
|
34
36
|
};
|
|
35
37
|
|
|
36
38
|
export const EvalTemplateSchedule$zodSchema: z.ZodType<EvalTemplateSchedule> = z
|
|
@@ -38,7 +40,6 @@ export const EvalTemplateSchedule$zodSchema: z.ZodType<EvalTemplateSchedule> = z
|
|
|
38
40
|
enabled: z.boolean().default(false).describe(
|
|
39
41
|
"Whether each eval created from the template receives a schedule.",
|
|
40
42
|
),
|
|
41
|
-
frequency:
|
|
42
|
-
"Schedule cadence used when `enabled` is true.",
|
|
43
|
-
),
|
|
43
|
+
frequency: EvalTemplateScheduleFrequency$zodSchema.default("weekly")
|
|
44
|
+
.describe("Schedule cadence used when `enabled` is true."),
|
|
44
45
|
}).describe("Schedule copied into every eval created from the template.");
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 483b0230664b
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
import {
|
|
8
|
+
V2PromptTargetInput,
|
|
9
|
+
V2PromptTargetInput$zodSchema,
|
|
10
|
+
} from "./v2prompttargetinput.js";
|
|
11
|
+
|
|
12
|
+
export type SetV2PromptTargetsRequest = {
|
|
13
|
+
topic_id: string;
|
|
14
|
+
targets: Array<V2PromptTargetInput>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const SetV2PromptTargetsRequest$zodSchema: z.ZodType<
|
|
18
|
+
SetV2PromptTargetsRequest
|
|
19
|
+
> = z.object({
|
|
20
|
+
targets: z.array(V2PromptTargetInput$zodSchema).describe(
|
|
21
|
+
"The complete set of answer engines and coding agents for the topic. Targets you leave out stop running. List an agent harness more than once to run it on several models.",
|
|
22
|
+
),
|
|
23
|
+
topic_id: z.string().describe(
|
|
24
|
+
"Prompt topic ID from `GET /v2/prompts/topics`.",
|
|
25
|
+
),
|
|
26
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 91889a594979
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
import { V2PromptTarget, V2PromptTarget$zodSchema } from "./v2prompttarget.js";
|
|
8
|
+
|
|
9
|
+
export type SetV2PromptTargetsResponse = {
|
|
10
|
+
data?: Array<V2PromptTarget> | undefined;
|
|
11
|
+
count: number;
|
|
12
|
+
updated_prompt_count: number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const SetV2PromptTargetsResponse$zodSchema: z.ZodType<
|
|
16
|
+
SetV2PromptTargetsResponse
|
|
17
|
+
> = z.object({
|
|
18
|
+
count: z.int(),
|
|
19
|
+
data: z.array(V2PromptTarget$zodSchema).optional(),
|
|
20
|
+
updated_prompt_count: z.int().describe(
|
|
21
|
+
"Prompts in the topic whose platforms were set to match the targets.",
|
|
22
|
+
),
|
|
23
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: bcbdf1e69dc7
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
8
|
+
import {
|
|
9
|
+
V2PromptRunTopic,
|
|
10
|
+
V2PromptRunTopic$zodSchema,
|
|
11
|
+
} from "./v2promptruntopic.js";
|
|
12
|
+
|
|
13
|
+
export const V2PromptTargetKind = {
|
|
14
|
+
AnswerEngine: "answer_engine",
|
|
15
|
+
CodingAgent: "coding_agent",
|
|
16
|
+
} as const;
|
|
17
|
+
export type V2PromptTargetKind = ClosedEnum<typeof V2PromptTargetKind>;
|
|
18
|
+
|
|
19
|
+
export const V2PromptTargetKind$zodSchema = z.enum([
|
|
20
|
+
"answer_engine",
|
|
21
|
+
"coding_agent",
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* How often this target runs on schedule. `manual` keeps it for runs you start yourself. Frequencies other than `daily` require custom prompt scheduling on the organization.
|
|
26
|
+
*/
|
|
27
|
+
export const V2PromptTargetFrequency = {
|
|
28
|
+
Daily: "daily",
|
|
29
|
+
EveryOtherDay: "every_other_day",
|
|
30
|
+
Weekly: "weekly",
|
|
31
|
+
Manual: "manual",
|
|
32
|
+
} as const;
|
|
33
|
+
/**
|
|
34
|
+
* How often this target runs on schedule. `manual` keeps it for runs you start yourself. Frequencies other than `daily` require custom prompt scheduling on the organization.
|
|
35
|
+
*/
|
|
36
|
+
export type V2PromptTargetFrequency = ClosedEnum<
|
|
37
|
+
typeof V2PromptTargetFrequency
|
|
38
|
+
>;
|
|
39
|
+
|
|
40
|
+
export const V2PromptTargetFrequency$zodSchema = z.enum([
|
|
41
|
+
"daily",
|
|
42
|
+
"every_other_day",
|
|
43
|
+
"weekly",
|
|
44
|
+
"manual",
|
|
45
|
+
]).describe(
|
|
46
|
+
"How often this target runs on schedule. `manual` keeps it for runs you start yourself. Frequencies other than `daily` require custom prompt scheduling on the organization.",
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
export type V2PromptTarget = {
|
|
50
|
+
id: string;
|
|
51
|
+
topic?: V2PromptRunTopic | null | undefined;
|
|
52
|
+
kind: V2PromptTargetKind;
|
|
53
|
+
answer_engine?: string | null | undefined;
|
|
54
|
+
agent?: string | null | undefined;
|
|
55
|
+
name: string;
|
|
56
|
+
frequency: V2PromptTargetFrequency;
|
|
57
|
+
next_run_at?: string | null | undefined;
|
|
58
|
+
last_run_at?: string | null | undefined;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const V2PromptTarget$zodSchema: z.ZodType<V2PromptTarget> = z.object({
|
|
62
|
+
agent: z.string().nullable().optional().describe(
|
|
63
|
+
"Agent ID from `GET /v2/agents` for coding-agent targets.",
|
|
64
|
+
),
|
|
65
|
+
answer_engine: z.string().nullable().optional().describe(
|
|
66
|
+
"Answer engine identifier for answer-engine targets.",
|
|
67
|
+
),
|
|
68
|
+
frequency: V2PromptTargetFrequency$zodSchema.describe(
|
|
69
|
+
"How often this target runs on schedule. `manual` keeps it for runs you start yourself. Frequencies other than `daily` require custom prompt scheduling on the organization.",
|
|
70
|
+
),
|
|
71
|
+
id: z.string(),
|
|
72
|
+
kind: V2PromptTargetKind$zodSchema,
|
|
73
|
+
last_run_at: z.string().nullable().optional(),
|
|
74
|
+
name: z.string().describe("Human-readable answer engine or agent name."),
|
|
75
|
+
next_run_at: z.string().nullable().optional(),
|
|
76
|
+
topic: V2PromptRunTopic$zodSchema.nullable().optional().describe(
|
|
77
|
+
"Topic the target runs for. Null means it runs for every topic.",
|
|
78
|
+
),
|
|
79
|
+
});
|