@lightsage/mcp 0.4.28 → 0.4.30
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 +1810 -664
- package/bin/mcp-server.js.map +47 -24
- package/esm/funcs/evalResultsList.d.ts +16 -0
- package/esm/funcs/evalResultsList.d.ts.map +1 -0
- package/esm/funcs/evalResultsList.js +91 -0
- package/esm/funcs/evalResultsList.js.map +1 -0
- package/esm/funcs/evalResultsSummary.d.ts +16 -0
- package/esm/funcs/evalResultsSummary.d.ts.map +1 -0
- package/esm/funcs/evalResultsSummary.js +87 -0
- package/esm/funcs/evalResultsSummary.js.map +1 -0
- package/esm/funcs/evalRunsList.d.ts +1 -1
- package/esm/funcs/evalRunsList.js +1 -1
- package/esm/funcs/promptsScheduleRetrieve.d.ts +15 -0
- package/esm/funcs/promptsScheduleRetrieve.d.ts.map +1 -0
- package/esm/funcs/promptsScheduleRetrieve.js +72 -0
- package/esm/funcs/promptsScheduleRetrieve.js.map +1 -0
- package/esm/funcs/promptsScheduleUpdate.d.ts +16 -0
- package/esm/funcs/promptsScheduleUpdate.d.ts.map +1 -0
- package/esm/funcs/promptsScheduleUpdate.js +83 -0
- package/esm/funcs/promptsScheduleUpdate.js.map +1 -0
- package/esm/funcs/promptsTargetsList.d.ts +1 -1
- package/esm/funcs/promptsTargetsList.js +1 -1
- 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 +9 -1
- package/esm/mcp-server/server.js.map +1 -1
- package/esm/mcp-server/tools/evalResultsList.d.ts +7 -0
- package/esm/mcp-server/tools/evalResultsList.d.ts.map +1 -0
- package/esm/mcp-server/tools/evalResultsList.js +35 -0
- package/esm/mcp-server/tools/evalResultsList.js.map +1 -0
- package/esm/mcp-server/tools/evalResultsSummary.d.ts +7 -0
- package/esm/mcp-server/tools/evalResultsSummary.d.ts.map +1 -0
- package/esm/mcp-server/tools/evalResultsSummary.js +35 -0
- package/esm/mcp-server/tools/evalResultsSummary.js.map +1 -0
- package/esm/mcp-server/tools/evalRunsList.js +1 -1
- package/esm/mcp-server/tools/evalRunsList.js.map +1 -1
- package/esm/mcp-server/tools/promptsScheduleRetrieve.d.ts +3 -0
- package/esm/mcp-server/tools/promptsScheduleRetrieve.d.ts.map +1 -0
- package/esm/mcp-server/tools/promptsScheduleRetrieve.js +30 -0
- package/esm/mcp-server/tools/promptsScheduleRetrieve.js.map +1 -0
- package/esm/mcp-server/tools/promptsScheduleUpdate.d.ts +7 -0
- package/esm/mcp-server/tools/promptsScheduleUpdate.d.ts.map +1 -0
- package/esm/mcp-server/tools/promptsScheduleUpdate.js +35 -0
- package/esm/mcp-server/tools/promptsScheduleUpdate.js.map +1 -0
- package/esm/mcp-server/tools/promptsTargetsList.js +1 -1
- package/esm/mcp-server/tools/promptsTargetsList.js.map +1 -1
- package/esm/models/createv2evalrequest.js +1 -1
- package/esm/models/createv2evalrequest.js.map +1 -1
- package/esm/models/createv2evalrunrequest.js +1 -1
- package/esm/models/createv2evalrunrequest.js.map +1 -1
- package/esm/models/evaltemplateruntime.js +1 -1
- package/esm/models/evaltemplateruntime.js.map +1 -1
- package/esm/models/graderdefinition.d.ts +6 -0
- package/esm/models/graderdefinition.d.ts.map +1 -1
- package/esm/models/graderdefinition.js +28 -1
- package/esm/models/graderdefinition.js.map +1 -1
- package/esm/models/updatev2promptschedulerequest.d.ts +27 -0
- package/esm/models/updatev2promptschedulerequest.d.ts.map +1 -0
- package/esm/models/updatev2promptschedulerequest.js +27 -0
- package/esm/models/updatev2promptschedulerequest.js.map +1 -0
- package/esm/models/v2evalresultsfailedcheck.d.ts +9 -0
- package/esm/models/v2evalresultsfailedcheck.d.ts.map +1 -0
- package/esm/models/v2evalresultsfailedcheck.js +12 -0
- package/esm/models/v2evalresultsfailedcheck.js.map +1 -0
- package/esm/models/v2evalresultslistitem.d.ts +35 -0
- package/esm/models/v2evalresultslistitem.d.ts.map +1 -0
- package/esm/models/v2evalresultslistitem.js +34 -0
- package/esm/models/v2evalresultslistitem.js.map +1 -0
- package/esm/models/v2evalresultslistop.d.ts +33 -0
- package/esm/models/v2evalresultslistop.d.ts.map +1 -0
- package/esm/models/v2evalresultslistop.js +34 -0
- package/esm/models/v2evalresultslistop.js.map +1 -0
- package/esm/models/v2evalresultslistresponse.d.ts +10 -0
- package/esm/models/v2evalresultslistresponse.d.ts.map +1 -0
- package/esm/models/v2evalresultslistresponse.js +13 -0
- package/esm/models/v2evalresultslistresponse.js.map +1 -0
- package/esm/models/v2evalresultssummary.d.ts +14 -0
- package/esm/models/v2evalresultssummary.d.ts.map +1 -0
- package/esm/models/v2evalresultssummary.js +18 -0
- package/esm/models/v2evalresultssummary.js.map +1 -0
- package/esm/models/v2evalresultssummaryagent.d.ts +9 -0
- package/esm/models/v2evalresultssummaryagent.d.ts.map +1 -0
- package/esm/models/v2evalresultssummaryagent.js +12 -0
- package/esm/models/v2evalresultssummaryagent.js.map +1 -0
- package/esm/models/v2evalresultssummaryeval.d.ts +13 -0
- package/esm/models/v2evalresultssummaryeval.d.ts.map +1 -0
- package/esm/models/v2evalresultssummaryeval.js +16 -0
- package/esm/models/v2evalresultssummaryeval.js.map +1 -0
- package/esm/models/v2evalresultssummaryevalagent.d.ts +9 -0
- package/esm/models/v2evalresultssummaryevalagent.d.ts.map +1 -0
- package/esm/models/v2evalresultssummaryevalagent.js +12 -0
- package/esm/models/v2evalresultssummaryevalagent.js.map +1 -0
- package/esm/models/v2evalresultssummaryfigures.d.ts +12 -0
- package/esm/models/v2evalresultssummaryfigures.d.ts.map +1 -0
- package/esm/models/v2evalresultssummaryfigures.js +15 -0
- package/esm/models/v2evalresultssummaryfigures.js.map +1 -0
- package/esm/models/v2evalresultssummaryrange.d.ts +10 -0
- package/esm/models/v2evalresultssummaryrange.d.ts.map +1 -0
- package/esm/models/v2evalresultssummaryrange.js +13 -0
- package/esm/models/v2evalresultssummaryrange.js.map +1 -0
- package/esm/models/v2evalresultssummaryretrieveop.d.ts +11 -0
- package/esm/models/v2evalresultssummaryretrieveop.d.ts.map +1 -0
- package/esm/models/v2evalresultssummaryretrieveop.js +17 -0
- package/esm/models/v2evalresultssummaryretrieveop.js.map +1 -0
- package/esm/models/v2promptrunfrequency.d.ts +40 -0
- package/esm/models/v2promptrunfrequency.d.ts.map +1 -0
- package/esm/models/v2promptrunfrequency.js +38 -0
- package/esm/models/v2promptrunfrequency.js.map +1 -0
- package/esm/models/v2promptrunfrequencyinput.d.ts +47 -0
- package/esm/models/v2promptrunfrequencyinput.d.ts.map +1 -0
- package/esm/models/v2promptrunfrequencyinput.js +45 -0
- package/esm/models/v2promptrunfrequencyinput.js.map +1 -0
- package/esm/models/v2promptrunjobresponse.d.ts +1 -1
- package/esm/models/v2promptschedule.d.ts +31 -0
- package/esm/models/v2promptschedule.d.ts.map +1 -0
- package/esm/models/v2promptschedule.js +29 -0
- package/esm/models/v2promptschedule.js.map +1 -0
- package/esm/models/v2promptscheduleupdateop.d.ts +6 -0
- package/esm/models/v2promptscheduleupdateop.d.ts.map +1 -0
- package/esm/models/v2promptscheduleupdateop.js +12 -0
- package/esm/models/v2promptscheduleupdateop.js.map +1 -0
- package/esm/models/v2prompttarget.d.ts +6 -2
- package/esm/models/v2prompttarget.d.ts.map +1 -1
- package/esm/models/v2prompttarget.js +5 -3
- package/esm/models/v2prompttarget.js.map +1 -1
- package/esm/models/v2prompttargetinput.d.ts +10 -6
- package/esm/models/v2prompttargetinput.d.ts.map +1 -1
- package/esm/models/v2prompttargetinput.js +9 -6
- package/esm/models/v2prompttargetinput.js.map +1 -1
- package/esm/models/v2setupcommandoutput.js +1 -1
- package/esm/models/v2setupcommandoutput.js.map +1 -1
- package/esm/tool-names.d.ts.map +1 -1
- package/esm/tool-names.js +18 -2
- package/esm/tool-names.js.map +1 -1
- package/lib/feedback.js +2 -2
- package/lib/tool-overrides.js +196 -8
- package/package.json +1 -1
- package/src/funcs/evalResultsList.ts +153 -0
- package/src/funcs/evalResultsSummary.ts +150 -0
- package/src/funcs/evalRunsList.ts +1 -1
- package/src/funcs/promptsScheduleRetrieve.ts +124 -0
- package/src/funcs/promptsScheduleUpdate.ts +145 -0
- package/src/funcs/promptsTargetsList.ts +1 -1
- 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 +9 -1
- package/src/mcp-server/tools/evalResultsList.ts +43 -0
- package/src/mcp-server/tools/evalResultsSummary.ts +43 -0
- package/src/mcp-server/tools/evalRunsList.ts +1 -1
- package/src/mcp-server/tools/promptsScheduleRetrieve.ts +36 -0
- package/src/mcp-server/tools/promptsScheduleUpdate.ts +43 -0
- package/src/mcp-server/tools/promptsTargetsList.ts +1 -1
- package/src/models/createv2evalrequest.ts +1 -1
- package/src/models/createv2evalrunrequest.ts +1 -1
- package/src/models/evaltemplateruntime.ts +1 -1
- package/src/models/graderdefinition.ts +53 -19
- package/src/models/updatev2promptschedulerequest.ts +56 -0
- package/src/models/v2evalresultsfailedcheck.ts +24 -0
- package/src/models/v2evalresultslistitem.ts +70 -0
- package/src/models/v2evalresultslistop.ts +74 -0
- package/src/models/v2evalresultslistresponse.ts +28 -0
- package/src/models/v2evalresultssummary.ts +43 -0
- package/src/models/v2evalresultssummaryagent.ts +26 -0
- package/src/models/v2evalresultssummaryeval.ts +38 -0
- package/src/models/v2evalresultssummaryevalagent.ts +26 -0
- package/src/models/v2evalresultssummaryfigures.ts +38 -0
- package/src/models/v2evalresultssummaryrange.ts +26 -0
- package/src/models/v2evalresultssummaryretrieveop.ts +40 -0
- package/src/models/v2promptrunfrequency.ts +78 -0
- package/src/models/v2promptrunfrequencyinput.ts +76 -0
- package/src/models/v2promptschedule.ts +60 -0
- package/src/models/v2promptscheduleupdateop.ts +25 -0
- package/src/models/v2prompttarget.ts +8 -4
- package/src/models/v2prompttargetinput.ts +18 -11
- package/src/models/v2setupcommandoutput.ts +1 -1
- package/src/tool-names.ts +18 -2
- package/test/tool-overrides.test.js +121 -3
|
@@ -22,7 +22,9 @@ export const V2PromptTargetKind$zodSchema = z.enum([
|
|
|
22
22
|
]);
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Deprecated: how often prompts run is set per answer engine or harness with `PATCH /v2/prompts/schedule`. On input only `daily` is accepted; any other value returns `400`. On output this is the frequency of the target's answer engine or harness.
|
|
26
|
+
*
|
|
27
|
+
* @deprecated enum: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
26
28
|
*/
|
|
27
29
|
export const V2PromptTargetFrequency = {
|
|
28
30
|
Daily: "daily",
|
|
@@ -31,7 +33,9 @@ export const V2PromptTargetFrequency = {
|
|
|
31
33
|
Manual: "manual",
|
|
32
34
|
} as const;
|
|
33
35
|
/**
|
|
34
|
-
*
|
|
36
|
+
* Deprecated: how often prompts run is set per answer engine or harness with `PATCH /v2/prompts/schedule`. On input only `daily` is accepted; any other value returns `400`. On output this is the frequency of the target's answer engine or harness.
|
|
37
|
+
*
|
|
38
|
+
* @deprecated enum: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
35
39
|
*/
|
|
36
40
|
export type V2PromptTargetFrequency = ClosedEnum<
|
|
37
41
|
typeof V2PromptTargetFrequency
|
|
@@ -43,7 +47,7 @@ export const V2PromptTargetFrequency$zodSchema = z.enum([
|
|
|
43
47
|
"weekly",
|
|
44
48
|
"manual",
|
|
45
49
|
]).describe(
|
|
46
|
-
"
|
|
50
|
+
"Deprecated: how often prompts run is set per answer engine or harness with `PATCH /v2/prompts/schedule`. On input only `daily` is accepted; any other value returns `400`. On output this is the frequency of the target's answer engine or harness.",
|
|
47
51
|
);
|
|
48
52
|
|
|
49
53
|
export type V2PromptTarget = {
|
|
@@ -66,7 +70,7 @@ export const V2PromptTarget$zodSchema: z.ZodType<V2PromptTarget> = z.object({
|
|
|
66
70
|
"Answer engine identifier for answer-engine targets.",
|
|
67
71
|
),
|
|
68
72
|
frequency: V2PromptTargetFrequency$zodSchema.describe(
|
|
69
|
-
"
|
|
73
|
+
"Deprecated: how often prompts run is set per answer engine or harness with `PATCH /v2/prompts/schedule`. On input only `daily` is accepted; any other value returns `400`. On output this is the frequency of the target's answer engine or harness.",
|
|
70
74
|
),
|
|
71
75
|
id: z.string(),
|
|
72
76
|
kind: V2PromptTargetKind$zodSchema,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import * as z from "zod";
|
|
7
7
|
import { ClosedEnum } from "../types/enums.js";
|
|
8
8
|
|
|
9
|
-
export const
|
|
9
|
+
export const V2PromptTargetInputAnswerEngine = {
|
|
10
10
|
Chatgpt: "chatgpt",
|
|
11
11
|
GoogleAiOverviews: "google-ai-overviews",
|
|
12
12
|
GoogleAiMode: "google-ai-mode",
|
|
@@ -15,9 +15,11 @@ export const AnswerEngine = {
|
|
|
15
15
|
Claude: "claude",
|
|
16
16
|
MicrosoftCopilot: "microsoft-copilot",
|
|
17
17
|
} as const;
|
|
18
|
-
export type
|
|
18
|
+
export type V2PromptTargetInputAnswerEngine = ClosedEnum<
|
|
19
|
+
typeof V2PromptTargetInputAnswerEngine
|
|
20
|
+
>;
|
|
19
21
|
|
|
20
|
-
export const
|
|
22
|
+
export const V2PromptTargetInputAnswerEngine$zodSchema = z.enum([
|
|
21
23
|
"chatgpt",
|
|
22
24
|
"google-ai-overviews",
|
|
23
25
|
"google-ai-mode",
|
|
@@ -28,7 +30,9 @@ export const AnswerEngine$zodSchema = z.enum([
|
|
|
28
30
|
]);
|
|
29
31
|
|
|
30
32
|
/**
|
|
31
|
-
*
|
|
33
|
+
* Deprecated: how often prompts run is set per answer engine or harness with `PATCH /v2/prompts/schedule`. On input only `daily` is accepted; any other value returns `400`. On output this is the frequency of the target's answer engine or harness.
|
|
34
|
+
*
|
|
35
|
+
* @deprecated enum: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
32
36
|
*/
|
|
33
37
|
export const V2PromptTargetInputFrequency = {
|
|
34
38
|
Daily: "daily",
|
|
@@ -37,7 +41,9 @@ export const V2PromptTargetInputFrequency = {
|
|
|
37
41
|
Manual: "manual",
|
|
38
42
|
} as const;
|
|
39
43
|
/**
|
|
40
|
-
*
|
|
44
|
+
* Deprecated: how often prompts run is set per answer engine or harness with `PATCH /v2/prompts/schedule`. On input only `daily` is accepted; any other value returns `400`. On output this is the frequency of the target's answer engine or harness.
|
|
45
|
+
*
|
|
46
|
+
* @deprecated enum: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
41
47
|
*/
|
|
42
48
|
export type V2PromptTargetInputFrequency = ClosedEnum<
|
|
43
49
|
typeof V2PromptTargetInputFrequency
|
|
@@ -49,11 +55,11 @@ export const V2PromptTargetInputFrequency$zodSchema = z.enum([
|
|
|
49
55
|
"weekly",
|
|
50
56
|
"manual",
|
|
51
57
|
]).describe(
|
|
52
|
-
"
|
|
58
|
+
"Deprecated: how often prompts run is set per answer engine or harness with `PATCH /v2/prompts/schedule`. On input only `daily` is accepted; any other value returns `400`. On output this is the frequency of the target's answer engine or harness.",
|
|
53
59
|
);
|
|
54
60
|
|
|
55
61
|
export type V2PromptTargetInput = {
|
|
56
|
-
answer_engine?:
|
|
62
|
+
answer_engine?: V2PromptTargetInputAnswerEngine | null | undefined;
|
|
57
63
|
agent?: string | null | undefined;
|
|
58
64
|
frequency?: V2PromptTargetInputFrequency | undefined;
|
|
59
65
|
};
|
|
@@ -63,10 +69,11 @@ export const V2PromptTargetInput$zodSchema: z.ZodType<V2PromptTargetInput> = z
|
|
|
63
69
|
agent: z.string().nullable().optional().describe(
|
|
64
70
|
"Runnable agent from `GET /v2/agents`, a coding-agent harness and model such as `claude-code:claude-opus-5-5`. Set this or `answer_engine`, not both.",
|
|
65
71
|
),
|
|
66
|
-
answer_engine:
|
|
67
|
-
|
|
68
|
-
|
|
72
|
+
answer_engine: V2PromptTargetInputAnswerEngine$zodSchema.nullable()
|
|
73
|
+
.optional().describe(
|
|
74
|
+
"Answer engine to run the topic's prompts on. Set this or `agent`, not both.",
|
|
75
|
+
),
|
|
69
76
|
frequency: V2PromptTargetInputFrequency$zodSchema.default("daily").describe(
|
|
70
|
-
"
|
|
77
|
+
"Deprecated: how often prompts run is set per answer engine or harness with `PATCH /v2/prompts/schedule`. On input only `daily` is accepted; any other value returns `400`. On output this is the frequency of the target's answer engine or harness.",
|
|
71
78
|
),
|
|
72
79
|
});
|
|
@@ -26,6 +26,6 @@ export const V2SetupCommandOutput$zodSchema: z.ZodType<V2SetupCommandOutput> = z
|
|
|
26
26
|
"True when earlier output was cut off.",
|
|
27
27
|
),
|
|
28
28
|
status: z.string().nullable().optional().describe(
|
|
29
|
-
"`succeeded` for a completed command.",
|
|
29
|
+
"`succeeded` for a completed command; `failed` for a CLI install that failed, after which the run went on and the agent could install the CLI itself.",
|
|
30
30
|
),
|
|
31
31
|
});
|
package/src/tool-names.ts
CHANGED
|
@@ -58,12 +58,20 @@ export const toolNames: Array<{ name: string; description: string }>= [
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"name": "prompts-targets-list",
|
|
61
|
-
"description": "List Targets\n\nReturns the answer engines and coding agents that run the organization's prompts on schedule, with each target's topic
|
|
61
|
+
"description": "List Targets\n\nReturns the answer engines and coding agents that run the organization's prompts on schedule, with each target's topic. Provide `topic_id` to list one topic's targets. How often each one runs is set with `PATCH /v2/prompts/schedule`."
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
"name": "prompts-targets-set",
|
|
65
65
|
"description": "Set Targets\n\nSets 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."
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"name": "prompts-schedule-retrieve",
|
|
69
|
+
"description": "Get Prompt Schedule\n\nReturns whether scheduled prompt runs are on, when the daily run starts, the organization's default frequency, and how often each answer engine and coding-agent harness runs. The same settings as Settings > Schedules in the app."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "prompts-schedule-update",
|
|
73
|
+
"description": "Update Prompt Schedule\n\nTurns scheduled prompt runs on or off, sets the organization's default frequency, and sets answer engines or coding-agent harnesses differently from it. Only what you send changes. Daily is recommended: running less often leaves less data to analyze and work out how to improve. Choose which engines and agents run each topic's prompts with `PUT /v2/prompts/targets`."
|
|
74
|
+
},
|
|
67
75
|
{
|
|
68
76
|
"name": "prompts-runs-list",
|
|
69
77
|
"description": "List Prompt Runs\n\nReturns stored prompt runs with limit-and-offset pagination, without exposing raw runtime or provider configuration. Filter by prompt, platform, or date range."
|
|
@@ -282,7 +290,15 @@ export const toolNames: Array<{ name: string; description: string }>= [
|
|
|
282
290
|
},
|
|
283
291
|
{
|
|
284
292
|
"name": "eval-runs-list",
|
|
285
|
-
"description": "List Runs\n\nReturns custom eval runs, ordered newest first, with lifecycle state and progress. Includes scheduled, onboarding, and pull request runs and runs started in the Lightsage app, as well as runs started through `POST /v2/eval-runs`."
|
|
293
|
+
"description": "List Runs\n\nReturns custom eval runs, ordered newest first, with lifecycle state and progress. Includes scheduled, onboarding, and pull request runs and runs started in the Lightsage app, as well as runs started through `POST /v2/eval-runs`. This lists runs and their status only: to see how evals did across runs, use `GET /v2/eval-results/summary` and `GET /v2/eval-results` instead of retrieving runs one at a time."
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"name": "eval-results-summary",
|
|
297
|
+
"description": "Retrieve Summary\n\nStart here for any question about how evals are doing. Returns, in one call, totals for the last `days` days and the same number of days before: for every eval and every agent (harness and model), the attempts, pass rate, average agent time and average tool calls, and how the pass rate changed. Answers which evals got worse and which agents fail most without retrieving runs one at a time. To see the individual results behind these figures and the judge's reasons, use `GET /v2/eval-results`."
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"name": "eval-results-list",
|
|
301
|
+
"description": "List Results\n\nLists eval results across runs, newest first: one per attempt by one agent, with the checks the judge failed and its reasons. Filter by `eval_id`, `agent` and `result` (use `result=failed` to see why evals fail). Each result has a `run_id` to pass to `GET /v2/eval-runs/{run_id}/trace` for the agent's step-by-step log. For totals across evals and agents, use `GET /v2/eval-results/summary` first."
|
|
286
302
|
},
|
|
287
303
|
{
|
|
288
304
|
"name": "agent-preference-competitors-list",
|
|
@@ -9,9 +9,13 @@ const { createConsoleLogger } = await import(
|
|
|
9
9
|
"../esm/mcp-server/console-logger.js"
|
|
10
10
|
);
|
|
11
11
|
const { createMCPServer } = await import("../esm/mcp-server/server.js");
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const {
|
|
13
|
+
ANNOTATION_OVERRIDES,
|
|
14
|
+
DESCRIPTION_EDITS,
|
|
15
|
+
SECRET_INPUT_FIELDS,
|
|
16
|
+
TOOL_RENAMES,
|
|
17
|
+
applyToolOverrides,
|
|
18
|
+
} = await import("../lib/tool-overrides.js");
|
|
15
19
|
|
|
16
20
|
async function listTools(allowedTools) {
|
|
17
21
|
const { server } = createMCPServer({
|
|
@@ -83,3 +87,117 @@ test("every listed tool that overwrites or stops work is marked destructive", as
|
|
|
83
87
|
);
|
|
84
88
|
}
|
|
85
89
|
});
|
|
90
|
+
|
|
91
|
+
function* stringMapInputs(schema, path) {
|
|
92
|
+
if (!schema || typeof schema !== "object") return;
|
|
93
|
+
for (const [key, value] of Object.entries(schema.properties ?? {})) {
|
|
94
|
+
const isMap = value?.type === "object" && !value.properties &&
|
|
95
|
+
value.additionalProperties;
|
|
96
|
+
if (SECRET_INPUT_FIELDS.includes(key) && isMap) yield `${path}.${key}`;
|
|
97
|
+
yield* stringMapInputs(value, `${path}.${key}`);
|
|
98
|
+
}
|
|
99
|
+
for (const key of ["anyOf", "oneOf", "allOf"]) {
|
|
100
|
+
for (const option of schema[key] ?? []) yield* stringMapInputs(option, path);
|
|
101
|
+
}
|
|
102
|
+
if (schema.items) yield* stringMapInputs(schema.items, `${path}[]`);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
test("no listed tool takes secret environment variables or headers", async () => {
|
|
106
|
+
const tools = await listTools(undefined);
|
|
107
|
+
const found = [...tools.values()].flatMap((tool) => [
|
|
108
|
+
...stringMapInputs(tool.inputSchema, tool.name),
|
|
109
|
+
]);
|
|
110
|
+
assert.deepEqual(found, []);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
test("no listed tool description or input asks about secrets", async () => {
|
|
114
|
+
const tools = await listTools(undefined);
|
|
115
|
+
const pattern = /secret|credential|password|`env`/i;
|
|
116
|
+
for (const tool of tools.values()) {
|
|
117
|
+
assert.doesNotMatch(tool.description ?? "", pattern, tool.name);
|
|
118
|
+
assert.doesNotMatch(JSON.stringify(tool.inputSchema), pattern, tool.name);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
test("no listed tool sends the model to curl or another HTTP client", async () => {
|
|
123
|
+
const tools = await listTools(undefined);
|
|
124
|
+
for (const tool of tools.values()) {
|
|
125
|
+
assert.doesNotMatch(tool.description ?? "", /curl|HTTP client/i, tool.name);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
test("runs that spend credits ask for confirmation", async () => {
|
|
130
|
+
const tools = await listTools(undefined);
|
|
131
|
+
for (const name of ["prompts-run", "evals-run"]) {
|
|
132
|
+
assert.equal(tools.get(name).annotations.destructiveHint, true, name);
|
|
133
|
+
assert.equal(tools.get(name).annotations.openWorldHint, true, name);
|
|
134
|
+
}
|
|
135
|
+
assert.match(tools.get("evals-run").description, /isolated Lightsage sandbox/);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
test("Library tools that track the customer's own site are open-world", async () => {
|
|
139
|
+
const tools = await listTools(undefined);
|
|
140
|
+
for (const name of ["library-pages-create", "library-redirects-create"]) {
|
|
141
|
+
assert.equal(tools.get(name).annotations.openWorldHint, true, name);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test("the feedback tool does not mention secrets", async () => {
|
|
146
|
+
const { registerFeedbackTool } = await import("../lib/feedback.js");
|
|
147
|
+
const { server } = createMCPServer({
|
|
148
|
+
logger: createConsoleLogger("error"),
|
|
149
|
+
dynamic: false,
|
|
150
|
+
serverURL: "https://api.lightsage.com",
|
|
151
|
+
getSDK: () => {
|
|
152
|
+
throw new Error("not called when listing tools");
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
registerFeedbackTool(server);
|
|
156
|
+
const tool = server._registeredTools.send_feedback;
|
|
157
|
+
const text = tool.description + JSON.stringify(tool.inputSchema.shape.feedback.description);
|
|
158
|
+
assert.doesNotMatch(text, /secret|credential|password|api key/i);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
test("description edits still match the generated descriptions", async () => {
|
|
162
|
+
const { server } = createMCPServer({
|
|
163
|
+
logger: createConsoleLogger("error"),
|
|
164
|
+
dynamic: false,
|
|
165
|
+
serverURL: "https://api.lightsage.com",
|
|
166
|
+
getSDK: () => {
|
|
167
|
+
throw new Error("not called when listing tools");
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
const tools = server._registeredTools;
|
|
171
|
+
for (const [name, edits] of Object.entries(DESCRIPTION_EDITS)) {
|
|
172
|
+
for (const [from] of edits) {
|
|
173
|
+
assert.ok(tools[name]?.description?.includes(from), `${name}: ${from}`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
test("eval runs still accept saved and inline MCP servers", async () => {
|
|
179
|
+
const { server } = createMCPServer({
|
|
180
|
+
logger: createConsoleLogger("error"),
|
|
181
|
+
dynamic: false,
|
|
182
|
+
serverURL: "https://api.lightsage.com",
|
|
183
|
+
getSDK: () => {
|
|
184
|
+
throw new Error("not called when parsing");
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
applyToolOverrides(server);
|
|
188
|
+
const schema = server._registeredTools["evals-run"].inputSchema;
|
|
189
|
+
const parsed = schema.parse({
|
|
190
|
+
request: {
|
|
191
|
+
eval_id: "11111111-1111-1111-1111-111111111111",
|
|
192
|
+
env: { OPENAI_API_KEY: "sk-test" },
|
|
193
|
+
mcps: [
|
|
194
|
+
{ name: "docs", type: "http", url: "https://example.com/mcp",
|
|
195
|
+
headers: { Authorization: "Bearer x" } },
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
assert.equal(parsed.request.eval_id, "11111111-1111-1111-1111-111111111111");
|
|
200
|
+
assert.equal(parsed.request.env, undefined);
|
|
201
|
+
assert.equal(parsed.request.mcps[0].url, "https://example.com/mcp");
|
|
202
|
+
assert.equal(parsed.request.mcps[0].headers, undefined);
|
|
203
|
+
});
|