@lightsage/mcp 0.4.24 → 0.4.26

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 (105) hide show
  1. package/README.md +2 -2
  2. package/api/mcp.js +0 -2
  3. package/bin/mcp-server.js +1041 -288
  4. package/bin/mcp-server.js.map +29 -27
  5. package/esm/funcs/pluginEvalsResultsList.d.ts +1 -1
  6. package/esm/funcs/pluginEvalsResultsList.js +1 -1
  7. package/esm/landing-page.js +1 -1
  8. package/esm/lib/config.d.ts +2 -2
  9. package/esm/lib/config.js +2 -2
  10. package/esm/mcp-server/mcp-server.js +1 -1
  11. package/esm/mcp-server/server.js +1 -1
  12. package/esm/mcp-server/tools/pluginEvalsResultsList.js +1 -1
  13. package/esm/mcp-server/tools/pluginEvalsResultsList.js.map +1 -1
  14. package/esm/models/createevaltemplaterequest.d.ts +2 -2
  15. package/esm/models/createevaltemplaterequest.d.ts.map +1 -1
  16. package/esm/models/createevaltemplaterequest.js +1 -1
  17. package/esm/models/createevaltemplaterequest.js.map +1 -1
  18. package/esm/models/createv2agentpreferenceevalrequest.d.ts +1 -0
  19. package/esm/models/createv2agentpreferenceevalrequest.d.ts.map +1 -1
  20. package/esm/models/createv2agentpreferenceevalrequest.js +1 -0
  21. package/esm/models/createv2agentpreferenceevalrequest.js.map +1 -1
  22. package/esm/models/createv2evalrequest.d.ts +1 -0
  23. package/esm/models/createv2evalrequest.d.ts.map +1 -1
  24. package/esm/models/createv2evalrequest.js +1 -0
  25. package/esm/models/createv2evalrequest.js.map +1 -1
  26. package/esm/models/createv2repositoryrequest.d.ts.map +1 -1
  27. package/esm/models/createv2repositoryrequest.js +1 -1
  28. package/esm/models/createv2repositoryrequest.js.map +1 -1
  29. package/esm/models/evaltemplate.d.ts +2 -2
  30. package/esm/models/evaltemplate.d.ts.map +1 -1
  31. package/esm/models/evaltemplate.js +1 -1
  32. package/esm/models/evaltemplate.js.map +1 -1
  33. package/esm/models/publicpluginevalresultsdownload.d.ts +1 -0
  34. package/esm/models/publicpluginevalresultsdownload.d.ts.map +1 -1
  35. package/esm/models/publicpluginevalresultsdownload.js +2 -1
  36. package/esm/models/publicpluginevalresultsdownload.js.map +1 -1
  37. package/esm/models/updateevaltemplaterequest.d.ts +2 -2
  38. package/esm/models/updateevaltemplaterequest.d.ts.map +1 -1
  39. package/esm/models/updateevaltemplaterequest.js +1 -1
  40. package/esm/models/updateevaltemplaterequest.js.map +1 -1
  41. package/esm/models/updatev2agentpreferenceevalrequest.d.ts +1 -0
  42. package/esm/models/updatev2agentpreferenceevalrequest.d.ts.map +1 -1
  43. package/esm/models/updatev2agentpreferenceevalrequest.js +1 -0
  44. package/esm/models/updatev2agentpreferenceevalrequest.js.map +1 -1
  45. package/esm/models/updatev2evalrequest.d.ts +1 -0
  46. package/esm/models/updatev2evalrequest.d.ts.map +1 -1
  47. package/esm/models/updatev2evalrequest.js +1 -0
  48. package/esm/models/updatev2evalrequest.js.map +1 -1
  49. package/esm/models/v2agent.d.ts +2 -0
  50. package/esm/models/v2agent.d.ts.map +1 -1
  51. package/esm/models/v2agent.js +2 -0
  52. package/esm/models/v2agent.js.map +1 -1
  53. package/esm/models/v2agentpreferenceeval.d.ts +1 -0
  54. package/esm/models/v2agentpreferenceeval.d.ts.map +1 -1
  55. package/esm/models/v2agentpreferenceeval.js +1 -0
  56. package/esm/models/v2agentpreferenceeval.js.map +1 -1
  57. package/esm/models/v2eval.d.ts +1 -0
  58. package/esm/models/v2eval.d.ts.map +1 -1
  59. package/esm/models/v2eval.js +1 -0
  60. package/esm/models/v2eval.js.map +1 -1
  61. package/esm/models/v2evalresultsummary.d.ts +1 -0
  62. package/esm/models/v2evalresultsummary.d.ts.map +1 -1
  63. package/esm/models/v2evalresultsummary.js +1 -0
  64. package/esm/models/v2evalresultsummary.js.map +1 -1
  65. package/esm/models/v2promptrundetail.d.ts +1 -0
  66. package/esm/models/v2promptrundetail.d.ts.map +1 -1
  67. package/esm/models/v2promptrundetail.js +3 -2
  68. package/esm/models/v2promptrundetail.js.map +1 -1
  69. package/esm/models/v2promptrunsummary.d.ts +1 -0
  70. package/esm/models/v2promptrunsummary.d.ts.map +1 -1
  71. package/esm/models/v2promptrunsummary.js +3 -2
  72. package/esm/models/v2promptrunsummary.js.map +1 -1
  73. package/esm/models/v2repository.d.ts +19 -0
  74. package/esm/models/v2repository.d.ts.map +1 -1
  75. package/esm/models/v2repository.js +15 -0
  76. package/esm/models/v2repository.js.map +1 -1
  77. package/esm/tool-names.js +1 -1
  78. package/esm/tool-names.js.map +1 -1
  79. package/lib/tool-overrides.js +11 -1
  80. package/package.json +3 -2
  81. package/src/funcs/pluginEvalsResultsList.ts +1 -1
  82. package/src/landing-page.ts +1 -1
  83. package/src/lib/config.ts +2 -2
  84. package/src/mcp-server/mcp-server.ts +1 -1
  85. package/src/mcp-server/server.ts +1 -1
  86. package/src/mcp-server/tools/pluginEvalsResultsList.ts +1 -1
  87. package/src/models/createevaltemplaterequest.ts +4 -4
  88. package/src/models/createv2agentpreferenceevalrequest.ts +4 -0
  89. package/src/models/createv2evalrequest.ts +4 -0
  90. package/src/models/createv2repositoryrequest.ts +3 -1
  91. package/src/models/evaltemplate.ts +4 -4
  92. package/src/models/publicpluginevalresultsdownload.ts +5 -1
  93. package/src/models/updateevaltemplaterequest.ts +4 -2
  94. package/src/models/updatev2agentpreferenceevalrequest.ts +4 -0
  95. package/src/models/updatev2evalrequest.ts +4 -0
  96. package/src/models/v2agent.ts +12 -1
  97. package/src/models/v2agentpreferenceeval.ts +4 -0
  98. package/src/models/v2eval.ts +4 -0
  99. package/src/models/v2evalresultsummary.ts +4 -0
  100. package/src/models/v2promptrundetail.ts +6 -2
  101. package/src/models/v2promptrunsummary.ts +6 -2
  102. package/src/models/v2repository.ts +29 -0
  103. package/src/tool-names.ts +1 -1
  104. package/test/simulations.test.js +17 -15
  105. package/test/tool-overrides.test.js +15 -0
@@ -14,6 +14,7 @@ export type UpdateV2AgentPreferenceEvalRequest = {
14
14
  prompts?: Array<string> | null | undefined;
15
15
  agent?: Array<string> | null | undefined;
16
16
  persona?: string | undefined;
17
+ repository?: string | undefined;
17
18
  search_grounding?: SearchGroundingMode | null | undefined;
18
19
  runs?: number | undefined;
19
20
  tags?: Array<string> | null | undefined;
@@ -32,6 +33,9 @@ export const UpdateV2AgentPreferenceEvalRequest$zodSchema: z.ZodType<
32
33
  prompts: z.array(z.string()).nullable().optional().describe(
33
34
  "Buying or build questions the agent answers by choosing between your company and the competitor. CLI clients expose this as repeatable `--prompt`.",
34
35
  ),
36
+ repository: z.string().optional().describe(
37
+ "Replacement starting repository: a saved repository ID or a built-in alias. Pass null to start from an empty workspace; omit it to keep the saved repository.",
38
+ ),
35
39
  runs: z.int().optional(),
36
40
  search_grounding: SearchGroundingMode$zodSchema.nullable().optional(),
37
41
  tags: z.array(z.string()).nullable().optional(),
@@ -39,6 +39,7 @@ export type UpdateV2EvalRequest = {
39
39
  mcps?: Array<V2InlineMcpDefinition | V2SavedMcpReference> | null | undefined;
40
40
  setup_commands?: Array<string> | null | undefined;
41
41
  cleanup_commands?: Array<string> | null | undefined;
42
+ repository?: string | undefined;
42
43
  search_grounding?: SearchGroundingMode | null | undefined;
43
44
  runs?: number | undefined;
44
45
  tags?: Array<string> | null | undefined;
@@ -68,6 +69,9 @@ export const UpdateV2EvalRequest$zodSchema: z.ZodType<UpdateV2EvalRequest> = z
68
69
  "Replacement eval persona. Pass null to clear it; omit it to leave the saved value unchanged.",
69
70
  ),
70
71
  prompts: z.array(z.string()).nullable().optional(),
72
+ repository: z.string().optional().describe(
73
+ "Replacement starting repository: a saved repository ID or a built-in alias. Pass null to start from an empty workspace; omit it to keep the saved repository.",
74
+ ),
71
75
  runs: z.int().optional(),
72
76
  search_grounding: SearchGroundingMode$zodSchema.nullable().optional()
73
77
  .describe(
@@ -5,11 +5,22 @@
5
5
 
6
6
  import * as z from "zod";
7
7
 
8
- export type V2Agent = { id: string; name: string };
8
+ export type V2Agent = {
9
+ id: string;
10
+ name: string;
11
+ harness: string;
12
+ model: string;
13
+ };
9
14
 
10
15
  export const V2Agent$zodSchema: z.ZodType<V2Agent> = z.object({
16
+ harness: z.string().describe(
17
+ "The coding-agent harness, such as `claude-code`.",
18
+ ),
11
19
  id: z.string().describe(
12
20
  "Runnable agent ID combining the harness and model, such as `claude-code:claude-opus-4-8`.",
13
21
  ),
22
+ model: z.string().describe(
23
+ "The model the harness runs, such as `anthropic/claude-sonnet-5.5`.",
24
+ ),
14
25
  name: z.string().describe("Human-readable harness and model name."),
15
26
  });
@@ -21,6 +21,7 @@ export type V2AgentPreferenceEval = {
21
21
  judges?: Array<string> | undefined;
22
22
  agent?: Array<string> | undefined;
23
23
  persona?: string | null | undefined;
24
+ repository?: string | null | undefined;
24
25
  search_grounding?: SearchGroundingMode | undefined;
25
26
  runs?: number | undefined;
26
27
  tags?: Array<string> | undefined;
@@ -45,6 +46,9 @@ export const V2AgentPreferenceEval$zodSchema: z.ZodType<V2AgentPreferenceEval> =
45
46
  name: z.string(),
46
47
  persona: z.string().nullable().optional(),
47
48
  prompts: z.array(z.string()).optional(),
49
+ repository: z.string().nullable().optional().describe(
50
+ "Saved repository ID or built-in alias every run starts from; null for an empty workspace.",
51
+ ),
48
52
  runs: z.int().default(1),
49
53
  search_grounding: SearchGroundingMode$zodSchema.optional().describe(
50
54
  "Requested web-retrieval behavior for an eval run.",
@@ -51,6 +51,7 @@ export type V2Eval = {
51
51
  mcps?: Array<V2InlineMcpDefinition | V2SavedMcpReference> | undefined;
52
52
  setup_commands?: Array<string> | undefined;
53
53
  cleanup_commands?: Array<string> | undefined;
54
+ repository?: string | null | undefined;
54
55
  search_grounding?: SearchGroundingMode | undefined;
55
56
  runs?: number | undefined;
56
57
  tags?: Array<string> | undefined;
@@ -78,6 +79,9 @@ export const V2Eval$zodSchema: z.ZodType<V2Eval> = z.object({
78
79
  name: z.string(),
79
80
  persona: z.string().nullable().optional(),
80
81
  prompts: z.array(z.string()).optional(),
82
+ repository: z.string().nullable().optional().describe(
83
+ "Saved repository ID or built-in alias every run starts from; null for an empty workspace.",
84
+ ),
81
85
  runs: z.int().default(1),
82
86
  search_grounding: SearchGroundingMode$zodSchema.optional().describe(
83
87
  "Requested web-retrieval behavior for an eval run.",
@@ -33,6 +33,7 @@ export type V2EvalResultSummary = {
33
33
  id: string;
34
34
  eval_id?: string | null | undefined;
35
35
  agent?: string | null | undefined;
36
+ agent_version?: string | null | undefined;
36
37
  prompt?: string | null | undefined;
37
38
  prompt_index?: number | undefined;
38
39
  repeat_index?: number | undefined;
@@ -58,6 +59,9 @@ export const V2EvalResultSummary$zodSchema: z.ZodType<V2EvalResultSummary> = z
58
59
  agent: z.string().nullable().optional().describe(
59
60
  "Runnable agent combining the harness and model.",
60
61
  ),
62
+ agent_version: z.string().nullable().optional().describe(
63
+ "Version of the coding agent that ran this attempt, as reported by the agent itself, for example `2.1.293` for Claude Code or `0.154.0` for Codex. Cursor reports its SDK version with the CLI build in brackets. Null for text models, for attempts that did not start an agent, and for attempts before agent versions were recorded.",
64
+ ),
61
65
  created_at: z.string().nullable().optional(),
62
66
  environment: PublicEvalRunEnvironment$zodSchema.nullable().optional()
63
67
  .describe(
@@ -45,6 +45,7 @@ export type V2PromptRunDetail = {
45
45
  prompt?: V2PromptRunPrompt | null | undefined;
46
46
  platform?: V2PromptRunPlatform | null | undefined;
47
47
  target_kind?: V2PromptRunDetailTargetKind | null | undefined;
48
+ agent?: string | null | undefined;
48
49
  harness?: string | null | undefined;
49
50
  model_id?: string | null | undefined;
50
51
  run_date: string;
@@ -67,6 +68,9 @@ export type V2PromptRunDetail = {
67
68
 
68
69
  export const V2PromptRunDetail$zodSchema: z.ZodType<V2PromptRunDetail> = z
69
70
  .object({
71
+ agent: z.string().nullable().optional().describe(
72
+ "The agent from `GET /v2/agents` that ran a coding-agent prompt, such as `claude-code:claude-sonnet-5-5`; null for answer engines.",
73
+ ),
70
74
  citation_count: z.int().default(0),
71
75
  citations: z.array(V2PromptRunCitation$zodSchema).optional(),
72
76
  conversation_turns: z.array(z.record(z.string(), z.any())).optional()
@@ -79,13 +83,13 @@ export const V2PromptRunDetail$zodSchema: z.ZodType<V2PromptRunDetail> = z
79
83
  "Whether the run satisfied the requested web access mode. Null means the default mode was used or isolation could not be proven.",
80
84
  ),
81
85
  harness: z.string().nullable().optional().describe(
82
- "Coding-agent harness for agent runs; otherwise the answer platform identifier.",
86
+ "Deprecated for coding agents: use `agent`. Coding-agent harness for agent runs; otherwise the answer platform identifier.",
83
87
  ),
84
88
  id: z.string(),
85
89
  is_brand_mentioned: z.boolean().nullable().optional(),
86
90
  mentions: z.array(V2PromptRunMention$zodSchema).optional(),
87
91
  model_id: z.string().nullable().optional().describe(
88
- "Public model ID. Internal hosting providers are never returned.",
92
+ "Deprecated for coding agents: use `agent`. Public model ID. Internal hosting providers are never returned.",
89
93
  ),
90
94
  platform: V2PromptRunPlatform$zodSchema.nullable().optional(),
91
95
  prompt: V2PromptRunPrompt$zodSchema.nullable().optional(),
@@ -37,6 +37,7 @@ export type V2PromptRunSummary = {
37
37
  prompt?: V2PromptRunPrompt | null | undefined;
38
38
  platform?: V2PromptRunPlatform | null | undefined;
39
39
  target_kind?: V2PromptRunSummaryTargetKind | null | undefined;
40
+ agent?: string | null | undefined;
40
41
  harness?: string | null | undefined;
41
42
  model_id?: string | null | undefined;
42
43
  run_date: string;
@@ -54,6 +55,9 @@ export type V2PromptRunSummary = {
54
55
 
55
56
  export const V2PromptRunSummary$zodSchema: z.ZodType<V2PromptRunSummary> = z
56
57
  .object({
58
+ agent: z.string().nullable().optional().describe(
59
+ "The agent from `GET /v2/agents` that ran a coding-agent prompt, such as `claude-code:claude-sonnet-5-5`; null for answer engines.",
60
+ ),
57
61
  citation_count: z.int().default(0),
58
62
  created_at: z.string().nullable().optional(),
59
63
  grounding_qualification_reason: z.string().nullable().optional(),
@@ -61,12 +65,12 @@ export const V2PromptRunSummary$zodSchema: z.ZodType<V2PromptRunSummary> = z
61
65
  "Whether the run satisfied the requested web access mode. Null means the default mode was used or isolation could not be proven.",
62
66
  ),
63
67
  harness: z.string().nullable().optional().describe(
64
- "Coding-agent harness for agent runs; otherwise the answer platform identifier.",
68
+ "Deprecated for coding agents: use `agent`. Coding-agent harness for agent runs; otherwise the answer platform identifier.",
65
69
  ),
66
70
  id: z.string(),
67
71
  is_brand_mentioned: z.boolean().nullable().optional(),
68
72
  model_id: z.string().nullable().optional().describe(
69
- "Public model ID. Internal hosting providers are never returned.",
73
+ "Deprecated for coding agents: use `agent`. Public model ID. Internal hosting providers are never returned.",
70
74
  ),
71
75
  platform: V2PromptRunPlatform$zodSchema.nullable().optional(),
72
76
  prompt: V2PromptRunPrompt$zodSchema.nullable().optional(),
@@ -52,6 +52,27 @@ export const V2RepositoryFramework$zodSchema = z.enum([
52
52
  "custom",
53
53
  ]);
54
54
 
55
+ /**
56
+ * How runs clone the repository: `public` without credentials, or `github_app` through your organization's Lightsage GitHub App installation, which is how private repositories are reached. `lost` means it was saved as private but the GitHub App can no longer read it, so runs using it fail until access is restored.
57
+ */
58
+ export const Access = {
59
+ Public: "public",
60
+ GithubApp: "github_app",
61
+ Lost: "lost",
62
+ } as const;
63
+ /**
64
+ * How runs clone the repository: `public` without credentials, or `github_app` through your organization's Lightsage GitHub App installation, which is how private repositories are reached. `lost` means it was saved as private but the GitHub App can no longer read it, so runs using it fail until access is restored.
65
+ */
66
+ export type Access = ClosedEnum<typeof Access>;
67
+
68
+ export const Access$zodSchema = z.enum([
69
+ "public",
70
+ "github_app",
71
+ "lost",
72
+ ]).describe(
73
+ "How runs clone the repository: `public` without credentials, or `github_app` through your organization's Lightsage GitHub App installation, which is how private repositories are reached. `lost` means it was saved as private but the GitHub App can no longer read it, so runs using it fail until access is restored.",
74
+ );
75
+
55
76
  export type V2Repository = {
56
77
  id: string;
57
78
  kind: V2RepositoryKind;
@@ -62,11 +83,16 @@ export type V2Repository = {
62
83
  install_steps?: Array<string> | undefined;
63
84
  framework?: V2RepositoryFramework | undefined;
64
85
  enabled: boolean;
86
+ access?: Access | undefined;
87
+ private?: boolean | undefined;
65
88
  created_at?: string | null | undefined;
66
89
  updated_at?: string | null | undefined;
67
90
  };
68
91
 
69
92
  export const V2Repository$zodSchema: z.ZodType<V2Repository> = z.object({
93
+ access: Access$zodSchema.default("public").describe(
94
+ "How runs clone the repository: `public` without credentials, or `github_app` through your organization's Lightsage GitHub App installation, which is how private repositories are reached. `lost` means it was saved as private but the GitHub App can no longer read it, so runs using it fail until access is restored.",
95
+ ),
70
96
  created_at: z.string().nullable().optional(),
71
97
  enabled: z.boolean(),
72
98
  framework: V2RepositoryFramework$zodSchema.default("custom"),
@@ -78,6 +104,9 @@ export const V2Repository$zodSchema: z.ZodType<V2Repository> = z.object({
78
104
  "Whether the repository is a read-only built-in template or an organization-owned saved repository.",
79
105
  ),
80
106
  name: z.string(),
107
+ private: z.boolean().default(false).describe(
108
+ "Whether the repository is private on GitHub.",
109
+ ),
81
110
  ref: z.string(),
82
111
  repo_url: z.string(),
83
112
  subdir: z.string().default(""),
package/src/tool-names.ts CHANGED
@@ -266,7 +266,7 @@ export const toolNames: Array<{ name: string; description: string }>= [
266
266
  },
267
267
  {
268
268
  "name": "plugin-evals-results-list",
269
- "description": "List Plugin Eval Results\n\nReturns a day's plugin eval results, one per plugin with results that day. Each has a `download_url` for a zip of every run with and without the plugin installed, plus the insights report written from them. Call `download_url` with the same API key. Returns 404 when no results exist for the date."
269
+ "description": "List Plugin Eval Results\n\nReturns a day's plugin eval results, one per plugin with results that day. Each has a `download_url` for a zip of every run with and without the plugin installed, plus the insights report written from them. The link works without an API key until `expires_at` (15 minutes), so fetch it with any HTTP client, for example `curl -o results.zip \"<download_url>\"`. Returns 404 when no results exist for the date."
270
270
  },
271
271
  {
272
272
  "name": "agents-list",
@@ -169,21 +169,23 @@ test("MCP tools forward canonical eval resources unchanged", async () => {
169
169
  );
170
170
  assert.equal(runResult.isError, undefined);
171
171
 
172
- assert.deepEqual(requests, [
173
- {
174
- method: "POST",
175
- url: "/v2/evals",
176
- apiKey: "ls_simulation_test",
177
- // The schema fills in include_env_vars' default (true) on create.
178
- body: { ...createRequest, include_env_vars: true },
179
- },
180
- {
181
- method: "POST",
182
- url: "/v2/eval-runs",
183
- apiKey: "ls_simulation_test",
184
- body: runRequest,
185
- },
186
- ]);
172
+ // Every field the caller sent arrives unchanged. The schema may add
173
+ // documented defaults (for example include_env_vars on create), so extra
174
+ // fields are allowed; this test checks forwarding, not the schema.
175
+ assert.deepEqual(
176
+ requests.map(({ method, url, apiKey }) => ({ method, url, apiKey })),
177
+ [
178
+ { method: "POST", url: "/v2/evals", apiKey: "ls_simulation_test" },
179
+ { method: "POST", url: "/v2/eval-runs", apiKey: "ls_simulation_test" },
180
+ ],
181
+ );
182
+ for (const [index, request] of [createRequest, runRequest].entries()) {
183
+ const body = requests[index].body;
184
+ const forwarded = Object.fromEntries(
185
+ Object.keys(request).map((key) => [key, body[key]]),
186
+ );
187
+ assert.deepEqual(forwarded, request, `${requests[index].url} forwards its fields`);
188
+ }
187
189
  } finally {
188
190
  server.close();
189
191
  }
@@ -68,3 +68,18 @@ test("tools without overrides keep their generated hints", async () => {
68
68
  const tools = await listTools(["prompts-list"]);
69
69
  assert.equal(tools.get("prompts-list").annotations.readOnlyHint, true);
70
70
  });
71
+
72
+ test("every listed tool that overwrites or stops work is marked destructive", async () => {
73
+ const tools = await listTools(undefined);
74
+ const overwriting = [...tools.keys()].filter((name) =>
75
+ /-(update|set|cancel|delete)$/.test(name)
76
+ );
77
+ assert.ok(overwriting.length > 0);
78
+ for (const name of overwriting) {
79
+ assert.equal(
80
+ tools.get(name).annotations?.destructiveHint,
81
+ true,
82
+ `${name} should be destructive`,
83
+ );
84
+ }
85
+ });