@codetelemetry/mcp 0.5.0 → 0.7.0
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 +35 -5
- package/dist/src/client/cli.js +1 -1
- package/dist/src/client/workspaces.d.ts +1 -1
- package/dist/src/client/workspaces.js +7 -4
- package/dist/src/mcpServer.js +1 -1
- package/dist/src/tools.js +49 -5
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
- package/tool-manifest.json +198 -6
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ deterministic (see [Releases & discovery](#releases--discovery)):
|
|
|
31
31
|
```json
|
|
32
32
|
{
|
|
33
33
|
"mcpServers": {
|
|
34
|
-
"codetelemetry": { "command": "npx", "args": ["-y", "--package=@codetelemetry/mcp@0.
|
|
34
|
+
"codetelemetry": { "command": "npx", "args": ["-y", "--package=@codetelemetry/mcp@0.7.0", "codetelemetry-mcp"] }
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
```
|
|
@@ -45,7 +45,7 @@ sessions without local setup, or **Connect my coding tool** to record your own w
|
|
|
45
45
|
Run the project connection command from the repository you choose:
|
|
46
46
|
|
|
47
47
|
```sh
|
|
48
|
-
npx -y @codetelemetry/connect@0.3.
|
|
48
|
+
npx -y @codetelemetry/connect@0.3.2 join --organization-id tm_example --client codex --project .
|
|
49
49
|
# For Claude Code, use --client claude.
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -67,9 +67,9 @@ verification. **My sessions** is scoped to your authenticated ingest ownership;
|
|
|
67
67
|
Optional history import uses the saved project and credentials, without a key argument:
|
|
68
68
|
|
|
69
69
|
```sh
|
|
70
|
-
npx -y @codetelemetry/connect@0.3.
|
|
70
|
+
npx -y @codetelemetry/connect@0.3.2 import --workspace <name> --preview
|
|
71
71
|
# Choose numbers from that preview; no session content uploads until confirmation:
|
|
72
|
-
npx -y @codetelemetry/connect@0.3.
|
|
72
|
+
npx -y @codetelemetry/connect@0.3.2 import --workspace <name> --select 1,2 --confirm
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
Preview is local-only and defaults to the last 30 days. It keeps at most 100 session
|
|
@@ -204,6 +204,10 @@ contexts use the established scope-v1 device flow.
|
|
|
204
204
|
| `seed_grader_config` | Inspect local agent instructions, selected skills, and project task files; return source text and command-check candidates for the user's requested grading focus. Reads files without running commands or uploading them. |
|
|
205
205
|
| `publish_grader_config` | Publish the reviewed draft as a new policy version using its exact revision. Completes setup through MCP; historical scores remain unchanged. |
|
|
206
206
|
| `write_grader_config_artifact` | Write selected checks as Terraform JSON or a standalone Pulumi YAML program, choosing the format from repository context. Refuses overwrites; runs no commands. |
|
|
207
|
+
| `discover_grader_checks` | Discover common checks from recorded repository history; returns an asynchronous run ID. |
|
|
208
|
+
| `backtest_grader_checks` | Backtest candidate IDs or saved draft checks using pinned evidence and the live evaluator. |
|
|
209
|
+
| `get_grader_run` | Read progress, coverage, candidates and paged results, plus the current draft revision. |
|
|
210
|
+
| `save_grader_draft` | Save selected backtested candidates with revision protection; preserves unrelated checks and does not publish. |
|
|
207
211
|
| `get_grader_config` | Read a page of the workspace's Grader draft, its revision, and published version. |
|
|
208
212
|
| `update_grader_config` | Add, update, or remove selected draft checks while preserving others. Records the user's requested instruction features and rejects stale revisions. Use publish_grader_config with the returned revision to apply it to future scoring. |
|
|
209
213
|
| `get_github_pr_gate` | Read the workspace's GitHub PR gate as its settings page shows it: the policy, trusted repositories, the GitHub Actions workflow file to commit, the check to require, outstanding steps, and recent decisions. |
|
|
@@ -219,6 +223,27 @@ the user merges) → once it has run, the user requires
|
|
|
219
223
|
`codetelemetry/validation` from GitHub Actions on the default branch (`howTo`
|
|
220
224
|
gives the `gh api` ruleset command to run with their permission).
|
|
221
225
|
|
|
226
|
+
## Discover and backtest the Grader
|
|
227
|
+
|
|
228
|
+
For history-based setup, call `discover_grader_checks` with the recorded
|
|
229
|
+
`repository` label and requested `features`. The service defaults to 30 days of
|
|
230
|
+
PR-producing sessions; `cohort: "substantive"` includes all observed work.
|
|
231
|
+
Poll `get_grader_run`, follow `nextCursor`, and review candidate IDs, package
|
|
232
|
+
scope, ambiguities and coverage. Call `backtest_grader_checks` with the discovery
|
|
233
|
+
ID and selected candidate IDs, then poll the new run. Completion and final
|
|
234
|
+
edit-to-push timing are separate verdicts. Unknown and partial evidence remain
|
|
235
|
+
explicit. To backtest existing configuration, follow `draftChecksCursor` from
|
|
236
|
+
`get_grader_run` for saved check IDs/names and the current `draftRevision`, then
|
|
237
|
+
pass that revision, selected `checkIds` and `repository` to `backtest_grader_checks`.
|
|
238
|
+
|
|
239
|
+
Save selected candidates with `save_grader_draft`, passing the backtest ID and
|
|
240
|
+
current `draftRevision` from `get_grader_run` as `expectedRevision`. Saving
|
|
241
|
+
preserves unrelated checks and does not publish or change enforcement. Runs
|
|
242
|
+
expire after 24 hours. Scans, normalization and evaluation run on the service;
|
|
243
|
+
this workflow needs no checkout, shell, custom scripts or client matcher JSON.
|
|
244
|
+
The backend must support the Grader history routes before these tools can run.
|
|
245
|
+
Existing local seeding and direct configuration remain available below.
|
|
246
|
+
|
|
222
247
|
## Seed and update the Grader
|
|
223
248
|
|
|
224
249
|
Ask, for example: **"Use AGENTS.md and our security-review skill to grade unit
|
|
@@ -244,7 +269,12 @@ explain prose requirements the deterministic Grader cannot establish. Invoking a
|
|
|
244
269
|
skill can be checked; compliance with all its written guidance cannot be inferred
|
|
245
270
|
from invocation alone. Review inferred commands and adapt local working-directory
|
|
246
271
|
matchers if your sessions run at another path. Pass `repositoryId` from session
|
|
247
|
-
metadata to scope checks to the recorded repository.
|
|
272
|
+
metadata to scope checks to the recorded repository. Give a check `issues`
|
|
273
|
+
(`["owner/repo#N"]`, lowercase) to make it a task check: it is required only for a
|
|
274
|
+
pull request that GitHub reports closes one of those issues, and it adds to the
|
|
275
|
+
organization and repository checks. The PR gate reads GitHub's closing-issue
|
|
276
|
+
references; when a repository has task checks, unknown or unmapped linkage fails
|
|
277
|
+
closed.
|
|
248
278
|
|
|
249
279
|
The agent then reads `get_grader_config` (follow `nextOffset` for remaining checks)
|
|
250
280
|
and sends selected `upsertChecks` and/or `removeCheckIds` to
|
package/dist/src/client/cli.js
CHANGED
|
@@ -463,7 +463,7 @@ export async function run(argv) {
|
|
|
463
463
|
result.previewSessions.forEach((session, i) => out(`${i + 1}. ${session.source} ${session.sessionId} · ${new Date(session.endMs).toISOString()} · ${session.events} events`));
|
|
464
464
|
if (result.remaining)
|
|
465
465
|
out(`${result.remaining} additional sessions remain; narrow --since for another preview.`);
|
|
466
|
-
out(`Import selected numbers: npx -y @codetelemetry/connect@0.3.
|
|
466
|
+
out(`Import selected numbers: npx -y @codetelemetry/connect@0.3.2 import --workspace ${flags.workspace} --select 1,2 --confirm`);
|
|
467
467
|
}
|
|
468
468
|
else
|
|
469
469
|
out(`Imported ${result.totals.sessions} sessions; ${result.remaining} remain. ${result.errors.slice(0, 3).join(" ")}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { KeyScope } from "./connectivity.ts";
|
|
2
|
-
export declare const WORKSPACE_MCP_PACKAGE = "@codetelemetry/mcp@0.
|
|
2
|
+
export declare const WORKSPACE_MCP_PACKAGE = "@codetelemetry/mcp@0.7.0";
|
|
3
3
|
export declare const MAX_WORKSPACE_BYTES: number;
|
|
4
4
|
export declare const MAX_WORKSPACES = 64;
|
|
5
5
|
export type WorkspaceBinding = {
|
|
@@ -3,16 +3,19 @@ import os from "node:os";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createHash, randomBytes } from "node:crypto";
|
|
5
5
|
import { buildOtelSection } from "./codexConfig.js";
|
|
6
|
-
import { repositoryHookSource, quotedCommand, REPOSITORY_HOOK_FILE } from "./repositoryHook.js";
|
|
6
|
+
import { repositoryHookSource, quotedCommand, REPOSITORY_HOOK_FILE, REPOSITORY_HOOK_STATE_FILE } from "./repositoryHook.js";
|
|
7
7
|
import { looksLikeKey } from "./keys.js";
|
|
8
|
-
export const WORKSPACE_MCP_PACKAGE = "@codetelemetry/mcp@0.
|
|
8
|
+
export const WORKSPACE_MCP_PACKAGE = "@codetelemetry/mcp@0.7.0";
|
|
9
9
|
export const MAX_WORKSPACE_BYTES = 64 * 1024;
|
|
10
10
|
export const MAX_WORKSPACES = 64;
|
|
11
|
+
const isContextFile = (name) => /^[a-z][a-z0-9_-]{0,63}\.json$/.test(name) && name !== REPOSITORY_HOOK_STATE_FILE;
|
|
11
12
|
export function workspaceName(value) {
|
|
12
13
|
if (typeof value !== "string" ||
|
|
13
14
|
looksLikeKey(value) ||
|
|
14
15
|
!/^[a-z][a-z0-9_-]{0,63}$/.test(value))
|
|
15
16
|
throw new Error("Workspace name must be 1–64 lowercase letters, digits, underscores or hyphens, starting with a letter.");
|
|
17
|
+
if (`${value}.json` === REPOSITORY_HOOK_STATE_FILE)
|
|
18
|
+
throw new Error("Workspace name is reserved for repository-hook state.");
|
|
16
19
|
return value;
|
|
17
20
|
}
|
|
18
21
|
export function workspaceOrigin(value) {
|
|
@@ -334,7 +337,7 @@ export function saveWorkspace(context) {
|
|
|
334
337
|
fs.mkdirSync(workspaceHome(), { recursive: true, mode: 0o700 });
|
|
335
338
|
noLinks(workspaceHome());
|
|
336
339
|
if (!fs.existsSync(file) &&
|
|
337
|
-
workspaceEntries().filter(
|
|
340
|
+
workspaceEntries().filter(isContextFile)
|
|
338
341
|
.length >= MAX_WORKSPACES)
|
|
339
342
|
throw new Error("Workspace store is full; remove unused contexts before continuing.");
|
|
340
343
|
writeWorkspaceFile(file, checked);
|
|
@@ -350,7 +353,7 @@ export function listWorkspaces() {
|
|
|
350
353
|
const names = workspaceEntries();
|
|
351
354
|
if (names.length > MAX_WORKSPACES * 3)
|
|
352
355
|
throw new Error("Workspace store exceeds its entry bound.");
|
|
353
|
-
const files = names.filter(
|
|
356
|
+
const files = names.filter(isContextFile);
|
|
354
357
|
if (files.length > MAX_WORKSPACES)
|
|
355
358
|
throw new Error("Workspace store exceeds 64 contexts.");
|
|
356
359
|
return files
|
package/dist/src/mcpServer.js
CHANGED
|
@@ -30,7 +30,7 @@ export function buildServer(ctx) {
|
|
|
30
30
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: manifestEntries(TOOLS) }));
|
|
31
31
|
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
32
32
|
const result = await callTool(req.params.name, (req.params.arguments ?? {}), ctx);
|
|
33
|
-
if (["workspace_context", "bootstrap_workspace", "interpret_session", "read_session_events", "compare_sessions", "plan_next_session", "seed_grader_config", "get_grader_config", "update_grader_config", "publish_grader_config", "write_grader_config_artifact"].includes(req.params.name))
|
|
33
|
+
if (["workspace_context", "bootstrap_workspace", "interpret_session", "read_session_events", "compare_sessions", "plan_next_session", "discover_grader_checks", "backtest_grader_checks", "get_grader_run", "save_grader_draft", "seed_grader_config", "get_grader_config", "update_grader_config", "publish_grader_config", "write_grader_config_artifact"].includes(req.params.name))
|
|
34
34
|
return boundedToolResponse(result);
|
|
35
35
|
return {
|
|
36
36
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
package/dist/src/tools.js
CHANGED
|
@@ -421,19 +421,22 @@ const GRADER_CHECK_PROP = obj({
|
|
|
421
421
|
evidenceRequirement: { type: "string", enum: ["coverage_increase"] },
|
|
422
422
|
createdFromActivityId: { type: "string", maxLength: 512 },
|
|
423
423
|
components: { type: "array", minItems: 1, maxItems: 8, items: obj({ name: { type: "string", minLength: 1, maxLength: 120 }, matcherRule: GRADER_MATCHER_PROP, requireSuccess: { type: "boolean" } }, ["name", "matcherRule", "requireSuccess"]) },
|
|
424
|
-
|
|
424
|
+
issues: { type: "array", minItems: 1, maxItems: 20, uniqueItems: true, items: { type: "string", minLength: 3, maxLength: 220, pattern: "^[a-z0-9][a-z0-9-]{0,38}/[a-z0-9._-]{1,100}#[1-9][0-9]{0,9}$" }, description: "Task scope: the GitHub issues (lowercase owner/repo#number) this check is required for. It applies only when the pull request being judged closes one of them, as GitHub reports it, and adds to organization and repository checks; it never applies outside a pull request. Issue and PR text never select it." },
|
|
425
|
+
linkage: { type: "string", enum: ["signadot"], description: "Links a three-component composite to recorded sandbox readiness, an exact routing key and declared endpoint, and a positive validation result. May be required before push after the final edit. Keep it when re-saving a check read from get_grader_config; dropping it leaves an unlinked composite." },
|
|
425
426
|
}, ["id", "name", "category", "weight", "satisfactionMode", "minimumOccurrences", "aggregationMode", "enabled"]);
|
|
426
427
|
function graderSchemaValid(value, schema) {
|
|
427
428
|
if (schema.enum && !schema.enum.includes(value))
|
|
428
429
|
return false;
|
|
429
430
|
if (schema.type === "string")
|
|
430
431
|
return typeof value === "string" && value.length >= (schema.minLength ?? 0) && value.length <= (schema.maxLength ?? Infinity) && (!schema.pattern || new RegExp(schema.pattern).test(value));
|
|
432
|
+
if (schema.type === "integer")
|
|
433
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= (schema.minimum ?? -Infinity) && value <= (schema.maximum ?? Infinity);
|
|
431
434
|
if (schema.type === "number")
|
|
432
435
|
return typeof value === "number" && Number.isFinite(value) && value >= (schema.minimum ?? -Infinity) && value <= (schema.maximum ?? Infinity);
|
|
433
436
|
if (schema.type === "boolean")
|
|
434
437
|
return typeof value === "boolean";
|
|
435
438
|
if (schema.type === "array")
|
|
436
|
-
return Array.isArray(value) && value.length >= (schema.minItems ?? 0) && value.length <= (schema.maxItems ?? Infinity) && value.every(item => graderSchemaValid(item, schema.items));
|
|
439
|
+
return Array.isArray(value) && value.length >= (schema.minItems ?? 0) && value.length <= (schema.maxItems ?? Infinity) && (!schema.uniqueItems || new Set(value).size === value.length) && value.every(item => graderSchemaValid(item, schema.items));
|
|
437
440
|
if (schema.type === "object") {
|
|
438
441
|
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
439
442
|
return false;
|
|
@@ -458,7 +461,7 @@ function graderMatcherValid(value) {
|
|
|
458
461
|
return Object.keys(node).length === 1 && visit(node.not, depth + 1);
|
|
459
462
|
if (++conditions > 64 || Object.keys(node).some(key => !["field", "operator", "value"].includes(key)))
|
|
460
463
|
return false;
|
|
461
|
-
if (!["source", "toolNamespace", "toolName", "operation", "executable", "packageScript", "packageScriptFamily", "normalizedArguments", "workingDirectory", "outcome", "exactFingerprint", "familyFingerprint"].includes(node.field) || !["equals", "in", "contains", "startsWith", "exists"].includes(node.operator))
|
|
464
|
+
if (!["source", "toolNamespace", "toolName", "operation", "executable", "packageScript", "packageScriptFamily", "normalizedArguments", "workingDirectory", "repositoryRelativeWorkingDirectory", "outcome", "exactFingerprint", "familyFingerprint"].includes(node.field) || !["equals", "in", "contains", "startsWith", "exists"].includes(node.operator))
|
|
462
465
|
return false;
|
|
463
466
|
if (node.operator === "exists")
|
|
464
467
|
return node.value === undefined;
|
|
@@ -474,7 +477,7 @@ function graderCheckValid(value) {
|
|
|
474
477
|
return false;
|
|
475
478
|
if (value.components?.some((part) => !part.matcherRule?.include || !graderMatcherValid(part.matcherRule)))
|
|
476
479
|
return false;
|
|
477
|
-
if (value.linkage !== undefined && (value.satisfactionMode !== "composite" || value.components?.length !== 3
|
|
480
|
+
if (value.linkage !== undefined && (value.satisfactionMode !== "composite" || value.components?.length !== 3))
|
|
478
481
|
return false;
|
|
479
482
|
return value.satisfactionMode === "composite" ? Boolean(value.components?.length) : Boolean(value.matcherRule?.include || value.detectorRule?.include);
|
|
480
483
|
}
|
|
@@ -517,7 +520,48 @@ async function requestGrader(ctx, operation, body) {
|
|
|
517
520
|
note: update ? "Saved the Grader draft. Use publish_grader_config with this revision to apply it to future scoring when the user wants publication. Existing published versions and scores are unchanged."
|
|
518
521
|
: "Read every page needed before changing or publishing existing checks. Use revision as expectedRevision when saving or publishing. Draft checks affect scoring after publish_grader_config." };
|
|
519
522
|
}
|
|
523
|
+
const GRADER_RUN_SELECTION = {
|
|
524
|
+
repository: { type: "string", minLength: 1, maxLength: 512, description: "Recorded repository label, as returned by search_sessions." },
|
|
525
|
+
features: { type: "string", minLength: 1, maxLength: 4000, description: "Grading focus, for example common tests and static analysis before pushing." },
|
|
526
|
+
days: { type: "integer", minimum: 1, maximum: 30, description: "History window; defaults to 30 days." },
|
|
527
|
+
cohort: { type: "string", enum: ["pull_requests", "substantive"], description: "Defaults to PR-producing sessions. substantive includes all sessions with observed work." },
|
|
528
|
+
};
|
|
529
|
+
const GRADER_RUN_ID = { type: "string", pattern: "^[a-f0-9-]{36}$" };
|
|
530
|
+
const GRADER_RUN_IDS = { type: "array", minItems: 1, maxItems: 30, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 128 } };
|
|
531
|
+
const GRADER_RUN_TOOLS = [
|
|
532
|
+
{ name: "discover_grader_checks", title: "Discover Grader checks from history", route: "discover", required: ["repository", "features"], properties: GRADER_RUN_SELECTION,
|
|
533
|
+
description: "Discover common validation checks for a recorded repository and grading focus. The service selects PR-producing sessions (default), scans bounded canonical history asynchronously and ranks exact normalized commands by distinct sessions. Returns a runId; poll get_grader_run for candidates, package scope, provenance, ambiguities and coverage. No local files or scripts. Partial evidence never proves an absence. Does not change the Grader." },
|
|
534
|
+
{ name: "backtest_grader_checks", title: "Backtest Grader checks", route: "backtest", required: [], properties: { ...GRADER_RUN_SELECTION, discoveryId: GRADER_RUN_ID, candidateIds: GRADER_RUN_IDS, draftRevision: { type: "string", pattern: "^[a-f0-9]{64}$" }, checkIds: GRADER_RUN_IDS },
|
|
535
|
+
description: "Start an asynchronous backtest using discoveryId plus candidateIds, or draftRevision plus checkIds and repository (optional days/cohort/features). Uses pinned recorded evidence and the live Grader evaluator. Poll get_grader_run for completion and after-last-edit/before-push timing separately, per-session evidence, unknown outcomes and coverage limits. Does not publish or rewrite historical scores." },
|
|
536
|
+
{ name: "get_grader_run", title: "Read Grader discovery or backtest progress", route: "runs", required: ["runId"], properties: { runId: GRADER_RUN_ID, cursor: { type: "string", minLength: 1, maxLength: 32 } },
|
|
537
|
+
description: "Poll a Grader run and follow returned cursors for bounded result pages. Returns progress, pinned window/cohort/evaluator, ranked candidates or check summaries and per-session evidence. Follow summaryCursor for remaining check summaries, or draftChecksCursor to discover saved check IDs/names for backtesting with the returned draftRevision. Runs expire after 24 hours. Report partial, unknown and stale evidence explicitly; do not treat missing telemetry as a failed check. Access is checked on every call." },
|
|
538
|
+
{ name: "save_grader_draft", title: "Save selected backtested Grader checks", route: "save-draft", required: ["backtestId", "candidateIds", "expectedRevision"], properties: { backtestId: GRADER_RUN_ID, candidateIds: GRADER_RUN_IDS, expectedRevision: { type: "string", pattern: "^[a-f0-9]{64}$" } },
|
|
539
|
+
description: "Save selected candidates from a completed backtest into the Grader draft, preserving unrelated checks. Use current draftRevision from get_grader_run, or read get_grader_config, for expectedRevision. Refuses changed revisions and unresolved package or operand ambiguities. Returns saved check IDs and a new draft revision. Requires Grader write permission. Does not publish, change enforcement or rewrite stored scores. Never automatically retry an uncertain save; read the draft first." },
|
|
540
|
+
];
|
|
541
|
+
async function requestGraderRun(ctx, route, args) {
|
|
542
|
+
if (!ctx.session.hasKey())
|
|
543
|
+
return NO_KEY;
|
|
544
|
+
try {
|
|
545
|
+
const result = await graderConfigRequest({ key: ctx.session.useKey(), url: `${endpointsFor(ctx).agentGraderUrl}/${route}`, body: args, fetchImpl: ctx.fetchImpl });
|
|
546
|
+
if (result.ok)
|
|
547
|
+
return { ...result.config, ok: true };
|
|
548
|
+
const uncertain = route === "save-draft" && (result.httpStatus >= 500 || result.httpStatus < 300);
|
|
549
|
+
return { ok: false, error: uncertain ? "save_uncertain" : result.error ?? (result.httpStatus === 404 ? "not_supported" : "grader_unavailable"), message: uncertain ? "Read get_grader_config before retrying; the draft save may have completed." : result.message ?? "The Grader run request failed." };
|
|
550
|
+
}
|
|
551
|
+
catch {
|
|
552
|
+
return { ok: false, error: route === "save-draft" ? "save_uncertain" : route === "runs" ? "grader_unavailable" : "start_uncertain", message: route === "save-draft" ? "Read get_grader_config before retrying; the draft save may have completed." : "The Grader request could not be confirmed. Do not automatically repeat a start request." };
|
|
553
|
+
}
|
|
554
|
+
}
|
|
520
555
|
export const TOOLS = [
|
|
556
|
+
...GRADER_RUN_TOOLS.map(tool => ({
|
|
557
|
+
name: tool.name, title: tool.title, description: tool.description,
|
|
558
|
+
inputSchema: obj(tool.properties, [...tool.required]),
|
|
559
|
+
async handler(args, ctx) {
|
|
560
|
+
if (!graderSchemaValid(args, obj(tool.properties, [...tool.required])))
|
|
561
|
+
return { ok: false, error: "bad_input", message: "Pass only the fields in this Grader tool's schema." };
|
|
562
|
+
return requestGraderRun(ctx, tool.route, args);
|
|
563
|
+
},
|
|
564
|
+
})),
|
|
521
565
|
...workspaceTools,
|
|
522
566
|
{
|
|
523
567
|
name: "authenticate",
|
|
@@ -1589,7 +1633,7 @@ export const TOOLS = [
|
|
|
1589
1633
|
{
|
|
1590
1634
|
name: "update_grader_config",
|
|
1591
1635
|
title: "Update the Grader draft",
|
|
1592
|
-
description: "Save selected instruction/skill-derived checks to the authenticated workspace's Grader draft. features records which instruction features the user wants graded. Use seed_grader_config to inspect sources, then get_grader_config to obtain expectedRevision. upsertChecks add or update by id, preserving unmentioned checks; removeCheckIds removes only named checks. Checks use the dashboard's ValidationCheck shape and deterministic matcherRule (source, executable, packageScript, normalizedArguments, toolNamespace/toolName, operation, workingDirectory, etc.). For example, a skill check can require source=agent_tool, toolName=Skill, and operation=<skill name>; do not equate invoking a skill with complying with all its prose. Match only observable evidence, keep rationale/source in description, and apply repositoryId/environment scope when appropriate. The backend validates checks and refuses stale revisions with conflict; read again before retrying any uncertain save. After saving, use write_grader_config_artifact to leave selected checks as Terraform or Pulumi when requested. This saves a draft; use publish_grader_config with the returned revision to apply it when the user wants publication.",
|
|
1636
|
+
description: "Save selected instruction/skill-derived checks to the authenticated workspace's Grader draft. features records which instruction features the user wants graded. Use seed_grader_config to inspect sources, then get_grader_config to obtain expectedRevision. upsertChecks add or update by id, preserving unmentioned checks; removeCheckIds removes only named checks. Checks use the dashboard's ValidationCheck shape and deterministic matcherRule (source, executable, packageScript, normalizedArguments, toolNamespace/toolName, operation, workingDirectory, etc.). For example, a skill check can require source=agent_tool, toolName=Skill, and operation=<skill name>; do not equate invoking a skill with complying with all its prose. Match only observable evidence, keep rationale/source in description, and apply repositoryId/environment scope when appropriate. Use issues for checks that only one GitHub issue's pull request must pass (task scope). The backend validates checks and refuses stale revisions with conflict; read again before retrying any uncertain save. After saving, use write_grader_config_artifact to leave selected checks as Terraform or Pulumi when requested. This saves a draft; use publish_grader_config with the returned revision to apply it when the user wants publication.",
|
|
1593
1637
|
inputSchema: obj({
|
|
1594
1638
|
expectedRevision: { type: "string", pattern: "^[a-f0-9]{64}$", description: "revision from get_grader_config; prevents overwriting a changed draft." },
|
|
1595
1639
|
features: GRADER_FEATURES_PROP,
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const MCP_SERVER_NAME = "codetelemetry";
|
|
2
|
-
export declare const MCP_SERVER_VERSION = "0.
|
|
2
|
+
export declare const MCP_SERVER_VERSION = "0.7.0";
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const MCP_SERVER_NAME = "codetelemetry";
|
|
2
|
-
export const MCP_SERVER_VERSION = "0.
|
|
2
|
+
export const MCP_SERVER_VERSION = "0.7.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codetelemetry/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "CodeTelemetry MCP server \u2014 lets a coding agent onboard a user end to end: authenticate (device code), obtain an ingest key, write the Claude Code OTEL config, send a test event, and confirm telemetry landed \u2014 then search, read, interpret and compare the user's own coding sessions, plan the next one, and size tasks, plans and Linear issues from that history. The plaintext key never enters the model's context.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/tool-manifest.json
CHANGED
|
@@ -1,9 +1,175 @@
|
|
|
1
1
|
{
|
|
2
2
|
"serverName": "codetelemetry",
|
|
3
|
-
"serverVersion": "0.
|
|
4
|
-
"registryHash": "
|
|
5
|
-
"toolCount":
|
|
3
|
+
"serverVersion": "0.7.0",
|
|
4
|
+
"registryHash": "eebf2611c67780abfae82ff19098d5b9cff943aebbc9fae45b60e37ccd836a61",
|
|
5
|
+
"toolCount": 34,
|
|
6
6
|
"tools": [
|
|
7
|
+
{
|
|
8
|
+
"name": "discover_grader_checks",
|
|
9
|
+
"title": "Discover Grader checks from history",
|
|
10
|
+
"description": "Discover common validation checks for a recorded repository and grading focus. The service selects PR-producing sessions (default), scans bounded canonical history asynchronously and ranks exact normalized commands by distinct sessions. Returns a runId; poll get_grader_run for candidates, package scope, provenance, ambiguities and coverage. No local files or scripts. Partial evidence never proves an absence. Does not change the Grader.",
|
|
11
|
+
"inputSchema": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"minLength": 1,
|
|
17
|
+
"maxLength": 512,
|
|
18
|
+
"description": "Recorded repository label, as returned by search_sessions."
|
|
19
|
+
},
|
|
20
|
+
"features": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"maxLength": 4000,
|
|
24
|
+
"description": "Grading focus, for example common tests and static analysis before pushing."
|
|
25
|
+
},
|
|
26
|
+
"days": {
|
|
27
|
+
"type": "integer",
|
|
28
|
+
"minimum": 1,
|
|
29
|
+
"maximum": 30,
|
|
30
|
+
"description": "History window; defaults to 30 days."
|
|
31
|
+
},
|
|
32
|
+
"cohort": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"enum": [
|
|
35
|
+
"pull_requests",
|
|
36
|
+
"substantive"
|
|
37
|
+
],
|
|
38
|
+
"description": "Defaults to PR-producing sessions. substantive includes all sessions with observed work."
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"required": [
|
|
42
|
+
"repository",
|
|
43
|
+
"features"
|
|
44
|
+
],
|
|
45
|
+
"additionalProperties": false
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "backtest_grader_checks",
|
|
50
|
+
"title": "Backtest Grader checks",
|
|
51
|
+
"description": "Start an asynchronous backtest using discoveryId plus candidateIds, or draftRevision plus checkIds and repository (optional days/cohort/features). Uses pinned recorded evidence and the live Grader evaluator. Poll get_grader_run for completion and after-last-edit/before-push timing separately, per-session evidence, unknown outcomes and coverage limits. Does not publish or rewrite historical scores.",
|
|
52
|
+
"inputSchema": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"properties": {
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"minLength": 1,
|
|
58
|
+
"maxLength": 512,
|
|
59
|
+
"description": "Recorded repository label, as returned by search_sessions."
|
|
60
|
+
},
|
|
61
|
+
"features": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"minLength": 1,
|
|
64
|
+
"maxLength": 4000,
|
|
65
|
+
"description": "Grading focus, for example common tests and static analysis before pushing."
|
|
66
|
+
},
|
|
67
|
+
"days": {
|
|
68
|
+
"type": "integer",
|
|
69
|
+
"minimum": 1,
|
|
70
|
+
"maximum": 30,
|
|
71
|
+
"description": "History window; defaults to 30 days."
|
|
72
|
+
},
|
|
73
|
+
"cohort": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"enum": [
|
|
76
|
+
"pull_requests",
|
|
77
|
+
"substantive"
|
|
78
|
+
],
|
|
79
|
+
"description": "Defaults to PR-producing sessions. substantive includes all sessions with observed work."
|
|
80
|
+
},
|
|
81
|
+
"discoveryId": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"pattern": "^[a-f0-9-]{36}$"
|
|
84
|
+
},
|
|
85
|
+
"candidateIds": {
|
|
86
|
+
"type": "array",
|
|
87
|
+
"minItems": 1,
|
|
88
|
+
"maxItems": 30,
|
|
89
|
+
"uniqueItems": true,
|
|
90
|
+
"items": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"minLength": 1,
|
|
93
|
+
"maxLength": 128
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"draftRevision": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
99
|
+
},
|
|
100
|
+
"checkIds": {
|
|
101
|
+
"type": "array",
|
|
102
|
+
"minItems": 1,
|
|
103
|
+
"maxItems": 30,
|
|
104
|
+
"uniqueItems": true,
|
|
105
|
+
"items": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"minLength": 1,
|
|
108
|
+
"maxLength": 128
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"additionalProperties": false
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "get_grader_run",
|
|
117
|
+
"title": "Read Grader discovery or backtest progress",
|
|
118
|
+
"description": "Poll a Grader run and follow returned cursors for bounded result pages. Returns progress, pinned window/cohort/evaluator, ranked candidates or check summaries and per-session evidence. Follow summaryCursor for remaining check summaries, or draftChecksCursor to discover saved check IDs/names for backtesting with the returned draftRevision. Runs expire after 24 hours. Report partial, unknown and stale evidence explicitly; do not treat missing telemetry as a failed check. Access is checked on every call.",
|
|
119
|
+
"inputSchema": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"properties": {
|
|
122
|
+
"runId": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"pattern": "^[a-f0-9-]{36}$"
|
|
125
|
+
},
|
|
126
|
+
"cursor": {
|
|
127
|
+
"type": "string",
|
|
128
|
+
"minLength": 1,
|
|
129
|
+
"maxLength": 32
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"required": [
|
|
133
|
+
"runId"
|
|
134
|
+
],
|
|
135
|
+
"additionalProperties": false
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "save_grader_draft",
|
|
140
|
+
"title": "Save selected backtested Grader checks",
|
|
141
|
+
"description": "Save selected candidates from a completed backtest into the Grader draft, preserving unrelated checks. Use current draftRevision from get_grader_run, or read get_grader_config, for expectedRevision. Refuses changed revisions and unresolved package or operand ambiguities. Returns saved check IDs and a new draft revision. Requires Grader write permission. Does not publish, change enforcement or rewrite stored scores. Never automatically retry an uncertain save; read the draft first.",
|
|
142
|
+
"inputSchema": {
|
|
143
|
+
"type": "object",
|
|
144
|
+
"properties": {
|
|
145
|
+
"backtestId": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"pattern": "^[a-f0-9-]{36}$"
|
|
148
|
+
},
|
|
149
|
+
"candidateIds": {
|
|
150
|
+
"type": "array",
|
|
151
|
+
"minItems": 1,
|
|
152
|
+
"maxItems": 30,
|
|
153
|
+
"uniqueItems": true,
|
|
154
|
+
"items": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"minLength": 1,
|
|
157
|
+
"maxLength": 128
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"expectedRevision": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"required": [
|
|
166
|
+
"backtestId",
|
|
167
|
+
"candidateIds",
|
|
168
|
+
"expectedRevision"
|
|
169
|
+
],
|
|
170
|
+
"additionalProperties": false
|
|
171
|
+
}
|
|
172
|
+
},
|
|
7
173
|
{
|
|
8
174
|
"name": "bootstrap_workspace",
|
|
9
175
|
"title": "Create or resume a workspace setup",
|
|
@@ -1314,12 +1480,25 @@
|
|
|
1314
1480
|
"additionalProperties": false
|
|
1315
1481
|
}
|
|
1316
1482
|
},
|
|
1483
|
+
"issues": {
|
|
1484
|
+
"type": "array",
|
|
1485
|
+
"minItems": 1,
|
|
1486
|
+
"maxItems": 20,
|
|
1487
|
+
"uniqueItems": true,
|
|
1488
|
+
"items": {
|
|
1489
|
+
"type": "string",
|
|
1490
|
+
"minLength": 3,
|
|
1491
|
+
"maxLength": 220,
|
|
1492
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,38}/[a-z0-9._-]{1,100}#[1-9][0-9]{0,9}$"
|
|
1493
|
+
},
|
|
1494
|
+
"description": "Task scope: the GitHub issues (lowercase owner/repo#number) this check is required for. It applies only when the pull request being judged closes one of them, as GitHub reports it, and adds to organization and repository checks; it never applies outside a pull request. Issue and PR text never select it."
|
|
1495
|
+
},
|
|
1317
1496
|
"linkage": {
|
|
1318
1497
|
"type": "string",
|
|
1319
1498
|
"enum": [
|
|
1320
1499
|
"signadot"
|
|
1321
1500
|
],
|
|
1322
|
-
"description": "Links a three-component composite
|
|
1501
|
+
"description": "Links a three-component composite to recorded sandbox readiness, an exact routing key and declared endpoint, and a positive validation result. May be required before push after the final edit. Keep it when re-saving a check read from get_grader_config; dropping it leaves an unlinked composite."
|
|
1323
1502
|
}
|
|
1324
1503
|
},
|
|
1325
1504
|
"required": [
|
|
@@ -1368,7 +1547,7 @@
|
|
|
1368
1547
|
{
|
|
1369
1548
|
"name": "update_grader_config",
|
|
1370
1549
|
"title": "Update the Grader draft",
|
|
1371
|
-
"description": "Save selected instruction/skill-derived checks to the authenticated workspace's Grader draft. features records which instruction features the user wants graded. Use seed_grader_config to inspect sources, then get_grader_config to obtain expectedRevision. upsertChecks add or update by id, preserving unmentioned checks; removeCheckIds removes only named checks. Checks use the dashboard's ValidationCheck shape and deterministic matcherRule (source, executable, packageScript, normalizedArguments, toolNamespace/toolName, operation, workingDirectory, etc.). For example, a skill check can require source=agent_tool, toolName=Skill, and operation=<skill name>; do not equate invoking a skill with complying with all its prose. Match only observable evidence, keep rationale/source in description, and apply repositoryId/environment scope when appropriate. The backend validates checks and refuses stale revisions with conflict; read again before retrying any uncertain save. After saving, use write_grader_config_artifact to leave selected checks as Terraform or Pulumi when requested. This saves a draft; use publish_grader_config with the returned revision to apply it when the user wants publication.",
|
|
1550
|
+
"description": "Save selected instruction/skill-derived checks to the authenticated workspace's Grader draft. features records which instruction features the user wants graded. Use seed_grader_config to inspect sources, then get_grader_config to obtain expectedRevision. upsertChecks add or update by id, preserving unmentioned checks; removeCheckIds removes only named checks. Checks use the dashboard's ValidationCheck shape and deterministic matcherRule (source, executable, packageScript, normalizedArguments, toolNamespace/toolName, operation, workingDirectory, etc.). For example, a skill check can require source=agent_tool, toolName=Skill, and operation=<skill name>; do not equate invoking a skill with complying with all its prose. Match only observable evidence, keep rationale/source in description, and apply repositoryId/environment scope when appropriate. Use issues for checks that only one GitHub issue's pull request must pass (task scope). The backend validates checks and refuses stale revisions with conflict; read again before retrying any uncertain save. After saving, use write_grader_config_artifact to leave selected checks as Terraform or Pulumi when requested. This saves a draft; use publish_grader_config with the returned revision to apply it when the user wants publication.",
|
|
1372
1551
|
"inputSchema": {
|
|
1373
1552
|
"type": "object",
|
|
1374
1553
|
"properties": {
|
|
@@ -1576,12 +1755,25 @@
|
|
|
1576
1755
|
"additionalProperties": false
|
|
1577
1756
|
}
|
|
1578
1757
|
},
|
|
1758
|
+
"issues": {
|
|
1759
|
+
"type": "array",
|
|
1760
|
+
"minItems": 1,
|
|
1761
|
+
"maxItems": 20,
|
|
1762
|
+
"uniqueItems": true,
|
|
1763
|
+
"items": {
|
|
1764
|
+
"type": "string",
|
|
1765
|
+
"minLength": 3,
|
|
1766
|
+
"maxLength": 220,
|
|
1767
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,38}/[a-z0-9._-]{1,100}#[1-9][0-9]{0,9}$"
|
|
1768
|
+
},
|
|
1769
|
+
"description": "Task scope: the GitHub issues (lowercase owner/repo#number) this check is required for. It applies only when the pull request being judged closes one of them, as GitHub reports it, and adds to organization and repository checks; it never applies outside a pull request. Issue and PR text never select it."
|
|
1770
|
+
},
|
|
1579
1771
|
"linkage": {
|
|
1580
1772
|
"type": "string",
|
|
1581
1773
|
"enum": [
|
|
1582
1774
|
"signadot"
|
|
1583
1775
|
],
|
|
1584
|
-
"description": "Links a three-component composite
|
|
1776
|
+
"description": "Links a three-component composite to recorded sandbox readiness, an exact routing key and declared endpoint, and a positive validation result. May be required before push after the final edit. Keep it when re-saving a check read from get_grader_config; dropping it leaves an unlinked composite."
|
|
1585
1777
|
}
|
|
1586
1778
|
},
|
|
1587
1779
|
"required": [
|