oc-pilot 0.108.0 → 0.110.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/dist/mcp.js CHANGED
@@ -1458,6 +1458,49 @@ const TOOLS = [
1458
1458
  },
1459
1459
  },
1460
1460
  },
1461
+ {
1462
+ name: "chronos",
1463
+ description: "Read a file's commit chronicle: fixes, reverts, incidents, security markers, churn, antibodies and vaccines, then score it as [HOTSPOT]. Offline and read-only.",
1464
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
1465
+ inputSchema: {
1466
+ type: "object",
1467
+ additionalProperties: false,
1468
+ required: ["file"],
1469
+ properties: {
1470
+ file: { type: "string", description: "Repository-relative file to inspect" },
1471
+ limit: { type: "integer", minimum: 1, maximum: 200 },
1472
+ since: { type: "string", description: "Git date limit, e.g. 2025-01-01" },
1473
+ fail_on_hotspot: { type: "boolean" },
1474
+ ...RESULT_PROPERTIES,
1475
+ },
1476
+ },
1477
+ },
1478
+ {
1479
+ name: "beacon",
1480
+ description: "Create, verify and render a signed verification beacon for HEAD: commit, tree, tool version, agent, model, checks, commands and digest. Supports HMAC and ssh-keygen signatures; verify detects tampering and unattributed manifests. Actions: stamp, verify, render, clear. stamp/clear write and need --allow-write.",
1481
+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
1482
+ inputSchema: {
1483
+ type: "object",
1484
+ additionalProperties: false,
1485
+ required: ["action"],
1486
+ properties: {
1487
+ action: { type: "string", enum: ["stamp", "verify", "render", "clear"] },
1488
+ checks: { type: "array", description: "Checks as name=pass|warn|fail|skip", items: { type: "string" } },
1489
+ commands: { type: "array", description: "Commands that produced the checks", items: { type: "string" } },
1490
+ agent: { type: "string" },
1491
+ model: { type: "string" },
1492
+ prompt_hash: { type: "string" },
1493
+ key: { type: "string", description: "HMAC key file for stamp/verify" },
1494
+ ssh_key: { type: "string", description: "ssh-keygen key file for stamp" },
1495
+ allowed_signers: { type: "string", description: "allowed_signers file for SSH verify" },
1496
+ identity: { type: "string", description: "Signer identity for SSH verify" },
1497
+ require_signature: { type: "boolean", description: "Fail verify on an unsigned beacon" },
1498
+ markdown: { type: "boolean", description: "Render as a PR comment" },
1499
+ force: { type: "boolean", description: "Confirm clear" },
1500
+ ...RESULT_PROPERTIES,
1501
+ },
1502
+ },
1503
+ },
1461
1504
  {
1462
1505
  name: "apoptosis",
1463
1506
  description: "Scan functions marked /* @lifespan: 30d */ and report [Senescent] when the marker is older than the lifespan and the symbol has no references. With action=apply and confirm=true, comment the senescent functions out in a shadow git worktree, run tests and land the diff only if the suite is green. Apply writes files and needs --allow-write.",
@@ -1742,6 +1785,22 @@ const PROMPTS = [
1742
1785
  { name: "context", description: "Where the code came from", required: false },
1743
1786
  ],
1744
1787
  },
1788
+ {
1789
+ name: "read-the-chronicle",
1790
+ title: "Read the file chronicle",
1791
+ description: "Inspect the fix, revert and incident history of a file, count its antibodies and vaccines and decide whether it is a hotspot.",
1792
+ arguments: [
1793
+ { name: "context", description: "Why the file is under review", required: false },
1794
+ ],
1795
+ },
1796
+ {
1797
+ name: "stamp-the-beacon",
1798
+ title: "Stamp a signed verification beacon",
1799
+ description: "Record the commit, tool version, agent, model, commands and real checks in a digest-bound beacon, sign it and verify the signature before sharing it.",
1800
+ arguments: [
1801
+ { name: "context", description: "What the verification covers", required: false },
1802
+ ],
1803
+ },
1745
1804
  {
1746
1805
  name: "prune-senescent-code",
1747
1806
  title: "Prune senescent AI code",
@@ -4005,6 +4064,63 @@ async function callCuckoo(input, cwd) {
4005
4064
  }
4006
4065
  return toToolResult(await runCli(args, cwd));
4007
4066
  }
4067
+ async function callChronos(input, cwd) {
4068
+ const file = stringArg(input, "file", true);
4069
+ const args = ["chronos", file, "--json"];
4070
+ const limit = integerArg(input, "limit");
4071
+ if (limit !== undefined)
4072
+ args.push("--limit", String(limit));
4073
+ const since = stringArg(input, "since");
4074
+ if (since)
4075
+ args.push("--since", since);
4076
+ if (booleanArg(input, "fail_on_hotspot"))
4077
+ args.push("--fail-on-hotspot");
4078
+ return toToolResult(await runCli(args, cwd));
4079
+ }
4080
+ async function callBeacon(input, cwd) {
4081
+ const action = stringArg(input, "action", true);
4082
+ const args = ["beacon", action, "--json"];
4083
+ if (Array.isArray(input.checks)) {
4084
+ for (const check of input.checks) {
4085
+ if (typeof check === "string")
4086
+ args.push("--check", check);
4087
+ }
4088
+ }
4089
+ if (Array.isArray(input.commands)) {
4090
+ for (const command of input.commands) {
4091
+ if (typeof command === "string")
4092
+ args.push("--command", command);
4093
+ }
4094
+ }
4095
+ const agent = stringArg(input, "agent");
4096
+ if (agent)
4097
+ args.push("--agent", agent);
4098
+ const model = stringArg(input, "model");
4099
+ if (model)
4100
+ args.push("--model", model);
4101
+ const promptHash = stringArg(input, "prompt_hash");
4102
+ if (promptHash)
4103
+ args.push("--prompt-hash", promptHash);
4104
+ const key = stringArg(input, "key");
4105
+ if (key)
4106
+ args.push("--key", key);
4107
+ const sshKey = stringArg(input, "ssh_key");
4108
+ if (sshKey)
4109
+ args.push("--ssh-key", sshKey);
4110
+ const allowedSigners = stringArg(input, "allowed_signers");
4111
+ if (allowedSigners)
4112
+ args.push("--allowed-signers", allowedSigners);
4113
+ const identity = stringArg(input, "identity");
4114
+ if (identity)
4115
+ args.push("--identity", identity);
4116
+ if (booleanArg(input, "require_signature"))
4117
+ args.push("--require-signature");
4118
+ if (booleanArg(input, "markdown"))
4119
+ args.push("--markdown");
4120
+ if (booleanArg(input, "force"))
4121
+ args.push("--force");
4122
+ return toToolResult(await runCli(args, cwd));
4123
+ }
4008
4124
  async function callApoptosis(input, cwd) {
4009
4125
  const action = stringArg(input, "action") ?? "scan";
4010
4126
  const args = ["apoptosis", action, "--json"];
@@ -4235,6 +4351,9 @@ async function dispatchTool(name, input, cwd, readOnly) {
4235
4351
  if (name === "mayday" && stringArg(input, "action") === "rollback") {
4236
4352
  throw new ToolInputError("mayday rollback creates a branch and is disabled in read-only mode; start the MCP server with --allow-write");
4237
4353
  }
4354
+ if (name === "beacon" && ["stamp", "clear"].includes(stringArg(input, "action") ?? "")) {
4355
+ throw new ToolInputError("beacon stamp/clear write .oc-pilot/beacon.json and are disabled in read-only mode; start the MCP server with --allow-write");
4356
+ }
4238
4357
  if (name === "honeypot" && (stringArg(input, "action") === "deploy" || stringArg(input, "action") === "remove")) {
4239
4358
  throw new ToolInputError("honeypot deploy/remove writes files and is disabled in read-only mode; start the MCP server with --allow-write");
4240
4359
  }
@@ -4370,6 +4489,10 @@ async function dispatchTool(name, input, cwd, readOnly) {
4370
4489
  return callHemorrhage(input, cwd);
4371
4490
  case "cuckoo":
4372
4491
  return callCuckoo(input, cwd);
4492
+ case "chronos":
4493
+ return callChronos(input, cwd);
4494
+ case "beacon":
4495
+ return callBeacon(input, cwd);
4373
4496
  case "apoptosis":
4374
4497
  return callApoptosis(input, cwd);
4375
4498
  case "scan_injection":
@@ -4449,6 +4572,17 @@ function summarizeResult(value) {
4449
4572
  if (typeof value.status === "string" && Array.isArray(value.removed) && typeof value.summary === "string") {
4450
4573
  return `oc-pilot: apoptosis ${value.status}, ${String(value.removed.length)} removed`;
4451
4574
  }
4575
+ if (typeof value.status === "string" &&
4576
+ ["valid", "unsigned", "tampered", "unattributed", "missing", "error"].includes(value.status) &&
4577
+ typeof value.summary === "string") {
4578
+ return `oc-pilot: beacon ${value.status}`;
4579
+ }
4580
+ if (typeof value.verdict === "string" && Array.isArray(value.checks) && typeof value.commit === "string") {
4581
+ return `oc-pilot: beacon ${value.verdict}, ${String(value.checks.length)} check(s)`;
4582
+ }
4583
+ if (typeof value.score === "number" && typeof value.hotspot === "boolean" && value.totals && typeof value.totals === "object") {
4584
+ return `oc-pilot: chronos ${String(value.score)}, ${value.hotspot ? "hotspot" : "stable"}`;
4585
+ }
4452
4586
  if (typeof value.status === "string" && Array.isArray(value.capabilities) && typeof value.file === "string") {
4453
4587
  return `oc-pilot: cuckoo ${value.status}, ${String(value.capabilities.length)} capability(ies)`;
4454
4588
  }
@@ -4788,6 +4922,10 @@ function promptBody(name, args) {
4788
4922
  return `Call the oc-pilot "skeptic" tool on the proposed diff. Read the hypothesis reason and the exact status. If it returns bug, stop and quote the failing test output: the generated test fails on the diff and passes on HEAD, so the change is falsified. Fix the code or the test expectation, then rerun; do not delete the test, do not weaken the assertion and do not claim a bug from a test that also fails on HEAD. If it returns clean, say that the hypothesis was rejected, not that the code is proven correct. If it returns unfalsifiable, explain that the test did not distinguish the diff from HEAD. If it returns error, report the infrastructure failure instead of guessing.${suffix}`;
4789
4923
  case "stamp-the-passport":
4790
4924
  return `Call the oc-pilot "passport" tool with action=write after the checks you actually ran, then action=verify. Record only real checks as name=pass|warn|fail|skip, the real agent/model and the commit. If verify returns [PASSPORT STALE] or [PASSPORT TAMPERED], stop: the manifest no longer matches the tree; rewrite it from the current state or investigate the change. Never mark a check as pass without running it, never edit the manifest by hand to hide a mismatch, and never claim that a passport proves correctness: it proves what was recorded and that the files still match. write/clear need --allow-write.${suffix}`;
4925
+ case "stamp-the-beacon":
4926
+ return `Call the oc-pilot "beacon" tool with action=stamp after the checks you actually ran, then action=verify with the same key or allowed_signers. Record only real checks, the real agent/model and the commands. If verify returns [BEACON TAMPERED] or [UNATTRIBUTED], stop: do not share or merge the beacon; re-stamp from the current state or investigate the signature. Never mark an unrun check as pass, never edit the manifest by hand and never claim that a beacon proves correctness: it proves what was recorded and who signed it. stamp/clear need --allow-write.${suffix}`;
4927
+ case "read-the-chronicle":
4928
+ return `Call the oc-pilot "chronos" tool on the file. Read the fix, revert, incident and security counts, the antibodies and vaccines, and the hotspot score. If it returns [HOTSPOT], treat the file as high-risk: inspect the recent fixes and reverts before changing it, add or run a vaccine, and do not refactor it without tests. A low score is not proof that the file is safe. Offline and read-only.${suffix}`;
4791
4929
  case "audit-the-cuckoo":
4792
4930
  return `Call the oc-pilot "cuckoo" tool on the generated or untrusted JS/ESM file. Read every capability: fs, net, child_process, env, exit, require, import. If it returns [CAPABILITY DENIED], do not trust or run the file with real privileges; remove the capability or isolate it behind an explicit allowlist. A clean result covers only this file and this sandbox, not transitive native code or dynamic imports. Offline and read-only.${suffix}`;
4793
4931
  case "stop-the-bleeding":