clearotron 0.5.0 → 0.5.1-beta.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.
Files changed (123) hide show
  1. package/CONTRIBUTING.md +2 -2
  2. package/INSTALL.md +334 -302
  3. package/QUICKSTART.md +12 -4
  4. package/README.md +12 -7
  5. package/THIRD-PARTY-NOTICES.md +4 -4
  6. package/bin/README.md +14 -11
  7. package/bin/clearotron.mjs +1 -1
  8. package/bin/connect.mjs +73 -25
  9. package/bin/example.mjs +4 -2
  10. package/bin/onboard.mjs +562 -336
  11. package/bin/start.mjs +184 -36
  12. package/bin/update.mjs +26 -13
  13. package/build-info.json +2 -2
  14. package/docs/PORTAL.md +2 -2
  15. package/docs/architecture/02-architecture.md +3 -3
  16. package/docs/architecture/04-configuration-reference.md +1 -2
  17. package/docs/architecture/05-config-governance.md +1 -1
  18. package/docs/architecture/06-operations-runbook.md +1 -1
  19. package/driver/CHANGELOG.md +77 -0
  20. package/driver/README.md +2 -2
  21. package/driver/config-inventory.mjs +20 -11
  22. package/driver/contract-e3-backlog.mjs +27 -27
  23. package/driver/contract-e3-baseline.json +2 -2
  24. package/driver/contract-vocabulary.mjs +1 -1
  25. package/driver/degraded-parts.mjs +67 -3
  26. package/driver/dev-portal.mjs +1 -1
  27. package/driver/digest-queue.mjs +5 -5
  28. package/driver/driver.config.mjs +9 -9
  29. package/driver/engine/CONTRACT.md +1 -1
  30. package/driver/engine/anthropic-agent.mjs +4 -2
  31. package/driver/engine/mcp/band-server.mjs +1 -21
  32. package/driver/engine/mcp/clarivate-propose-tool.mjs +26 -0
  33. package/driver/engine/mcp/clarivate-server.mjs +2 -18
  34. package/driver/engine/mcp/fixture-register-server.mjs +33 -0
  35. package/driver/engine/mcp/gather-config.mjs +48 -7
  36. package/driver/engine/mcp/recording-server.mjs +206 -14
  37. package/driver/engine/mcp/supplemental.mjs +4 -2
  38. package/driver/engine/openai-agent.mjs +3 -1
  39. package/driver/engine/probe.mjs +10 -0
  40. package/driver/filing-goods.mjs +95 -0
  41. package/driver/findings-model.mjs +3 -0
  42. package/driver/gateway.mjs +42 -40
  43. package/driver/knockout-assess-record.mjs +54 -4
  44. package/driver/knockout-correction-record.mjs +342 -0
  45. package/driver/knockout-frame-record.mjs +4 -2
  46. package/driver/knockout-register-read.mjs +705 -0
  47. package/driver/knockout-register-record.mjs +222 -0
  48. package/driver/knockout-review-record.mjs +96 -25
  49. package/driver/narrative-refutation-record.mjs +87 -1
  50. package/driver/order-tables.mjs +23 -0
  51. package/driver/owner-use-check.mjs +5 -2
  52. package/driver/package.json +1 -1
  53. package/driver/partial-payload-baseline.json +8 -0
  54. package/driver/pipeline-knockout.mjs +506 -313
  55. package/driver/pipeline.mjs +179 -86
  56. package/driver/portal-local-auth.mjs +7 -1
  57. package/driver/portal-service.mjs +62 -6
  58. package/driver/progress.mjs +2 -2
  59. package/driver/publish/index.mjs +18 -21
  60. package/driver/publish/knockout.mjs +40 -18
  61. package/driver/publish/render-knockout.mjs +40 -27
  62. package/driver/publish/report-dates.mjs +43 -0
  63. package/driver/recall-reconciliation.mjs +2 -2
  64. package/driver/record-goods.mjs +50 -9
  65. package/driver/register-count.mjs +12 -59
  66. package/driver/register-fixture-marker.mjs +22 -0
  67. package/driver/register-plan.mjs +48 -0
  68. package/driver/register-records.mjs +84 -266
  69. package/driver/register-taint.mjs +2 -2
  70. package/driver/repair-composers.mjs +15 -8
  71. package/driver/result-noun-fields.mjs +6 -2
  72. package/driver/run-requirements.mjs +54 -4
  73. package/driver/runner.mjs +4 -13
  74. package/driver/skills/clearance-register/providers/clarivate.md +2 -2
  75. package/driver/skills/knockout-assess/SKILL.md +101 -100
  76. package/driver/skills/knockout-frame/SKILL.md +3 -1
  77. package/driver/skills/knockout-register-read/SKILL.md +77 -0
  78. package/driver/stages-knockout.mjs +159 -98
  79. package/driver/stages.mjs +4 -2
  80. package/driver/suite-census.json +389 -71
  81. package/driver/systemd/README.md +2 -2
  82. package/driver/verify-knockout.mjs +175 -39
  83. package/driver/verify.mjs +10 -9
  84. package/mcp-server/CHANGELOG.md +4 -0
  85. package/mcp-server/CONNECT.md +4 -0
  86. package/mcp-server/demo-mode.mjs +6 -0
  87. package/mcp-server/lib/demo-texts.mjs +38 -0
  88. package/mcp-server/lib/http-handler.mjs +7 -1
  89. package/mcp-server/lib/knockout.mjs +3 -2
  90. package/mcp-server/lib/options.mjs +3 -1
  91. package/mcp-server/lib/plan.mjs +6 -1
  92. package/mcp-server/mint-token.mjs +1 -1
  93. package/mcp-server/package.json +1 -1
  94. package/mcp-server/serve.mjs +11 -0
  95. package/mcp-server/server.mjs +13 -5
  96. package/package.json +1 -1
  97. package/portal-ui/dist/assets/{index-D2wrw9cH.css → index-AtB9ZpDH.css} +29 -0
  98. package/portal-ui/dist/assets/{index-DcLbvFmQ.js → index-C1oE78Wk.js} +161 -195
  99. package/portal-ui/dist/index.html +2 -2
  100. package/portal-ui/package.json +4 -4
  101. package/providers/README.md +4 -4
  102. package/providers/_shared/execute-plan.mjs +45 -1
  103. package/providers/_shared/term-shape.mjs +1 -1
  104. package/providers/clarivate/src/capabilities.js +7 -6
  105. package/providers/clarivate/src/core.js +11 -7
  106. package/providers/clarivate/src/wider-list.js +104 -0
  107. package/providers/oauth-mcp-bridge/CHANGELOG.md +4 -0
  108. package/providers/oauth-mcp-bridge/package.json +1 -1
  109. package/providers/signa/src/capabilities.js +0 -9
  110. package/scripts/e2e-first-time.mjs +8 -7
  111. package/scripts/freeze-example-run.mjs +2 -2
  112. package/scripts/settings-render-check.mjs +5 -3
  113. package/scripts/test-run.mjs +8 -2
  114. package/shared/client-door.mjs +11 -8
  115. package/shared/connect-clients.mjs +10 -4
  116. package/shared/demo-connection.mjs +43 -0
  117. package/shared/demo-start-args.mjs +7 -2
  118. package/shared/invocation.mjs +18 -3
  119. package/shared/permanent-install.mjs +14 -0
  120. package/shared/scope.mjs +8 -1
  121. package/shared/stdio-connect.mjs +43 -21
  122. package/shared/trigger-lane.mjs +7 -0
  123. package/shared/tty-style.mjs +21 -5
@@ -21,6 +21,17 @@ if (!floor.ok) {
21
21
  process.exit(1);
22
22
  }
23
23
 
24
+ // A DEMO'S CONNECTION STAYS WITH THAT DEMO (shared/demo-connection.mjs), and a demo that is gone refuses here, in one
25
+ // plain line, before the server could read anything else on this machine.
26
+ if (process.env.CLEAROTRON_DEMO === "1") {
27
+ const { bindDemoConnection } = await import("../shared/demo-connection.mjs");
28
+ const gone = bindDemoConnection();
29
+ if (gone) {
30
+ console.error(`clearotron: ${gone}`);
31
+ process.exit(1);
32
+ }
33
+ }
34
+
24
35
  // THE SERVER STARTS AS THE ENTRY IT WOULD HAVE BEEN. It starts its stdio transport, and reads the
25
36
  // install's settings, only when it is the process's entry file, so the entry is handed over first.
26
37
  process.argv[1] = fileURLToPath(new URL("./server.mjs", import.meta.url));
@@ -33,7 +33,8 @@ import { fileURLToPath } from "node:url";
33
33
 
34
34
  import { enumerateRuns, resolveRun, runAccountKey, runOrganisation, runProfileFacts, productIdentityFor, unreadableRunsReason } from "./lib/runs.mjs";
35
35
  import { ORDERABLE_PRODUCTS } from "../driver/search-policy.mjs";
36
- import { demoMode } from "./demo-mode.mjs";
36
+ import { demoServing } from "./demo-mode.mjs";
37
+ import { DEMO_SWAPS, demoText, demoGuidance } from "./lib/demo-texts.mjs"; // — a demo names no tool it withholds
37
38
  import { PRODUCTS } from "../driver/products.mjs";
38
39
 
39
40
  // The offering writes its own schema prose. A hand-typed "up to 20 names" beside a wall that refuses at
@@ -200,7 +201,7 @@ function runSummary(run) {
200
201
  // field is what made the list unanswerable in the first place.
201
202
  const facts = runProfileFacts(run);
202
203
  return {
203
- ...(demoMode.on ? { demo: DEMO_LABEL } : {}),
204
+ ...(demoServing() ? { demo: DEMO_LABEL } : {}),
204
205
  runId: run.runId, slug: run.slug, codename: run.codename, date: run.date, agent: run.agent,
205
206
  client: facts.known
206
207
  ? { key: facts.account, name: facts.clientName }
@@ -819,6 +820,12 @@ const CLIENT_TOOL_TEXT = {
819
820
  * principal get the client cut where one exists; ops and staff get the operator text unchanged.
820
821
  * Descriptions only — name, inputSchema and everything the gate reads pass through untouched.
821
822
  */
823
+ /** A tool's description as a demo's assistant reads it: the owner's demo words where a real install's send it to a withheld tool. */
824
+ export function inDemo(def, kind) {
825
+ const key = `${def.name}:${kind === "user" || kind === "account" ? "client" : "ops"}`;
826
+ return DEMO_SWAPS[key] ? { ...def, description: demoText(key, def.description) } : def;
827
+ }
828
+
822
829
  export function describeForAudience(def, kind) {
823
830
  if (kind !== "user" && kind !== "account") return def;
824
831
  const text = CLIENT_TOOL_TEXT[def.name];
@@ -841,8 +848,9 @@ export function withAnnotations(def) {
841
848
  }
842
849
 
843
850
  export function attachHandlers(server, { scope = { kind: "ops", runId: null }, local = true } = {}) {
844
- const allow = visibleTools({ kind: scope.kind, local });
845
- const toolDefs = TOOL_DEFS.filter((d) => allow(d.name)).map((d) => withAnnotations(describeForAudience(d, scope.kind)));
851
+ const demo = demoServing();
852
+ const allow = visibleTools({ kind: scope.kind, local, demo });
853
+ const toolDefs = TOOL_DEFS.filter((d) => allow(d.name)).map((d) => withAnnotations(demo ? inDemo(describeForAudience(d, scope.kind), scope.kind) : describeForAudience(d, scope.kind)));
846
854
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: toolDefs }));
847
855
 
848
856
  // Prompts are guidance, like the pack: offered to the two client audiences, empty for everyone else.
@@ -1119,7 +1127,7 @@ export function makeServer({ scope = null, local = null, readonly = false } = {}
1119
1127
  { name: NS, version: productIdentity().version ?? "unknown" }, // the package's own version, the one server_info reports
1120
1128
  // `prompts` is declared for every kind; promptsFor() returns [] for the audiences that get none, so
1121
1129
  // an ops client sees an empty list rather than a protocol error on a capability we did not announce.
1122
- { capabilities: { tools: {}, resources: {}, prompts: {} }, instructions: instructionsFor(eff) },
1130
+ { capabilities: { tools: {}, resources: {}, prompts: {} }, instructions: demoServing() ? demoGuidance(instructionsFor(eff)) : instructionsFor(eff) },
1123
1131
  );
1124
1132
  attachHandlers(server, { scope: eff, local: isLocal });
1125
1133
  return server;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "clearotron",
3
3
  "mcpName": "io.github.CordilleraSarl/clearotron",
4
4
  "type": "module",
5
- "version": "0.5.0",
5
+ "version": "0.5.1-beta.0",
6
6
  "license": "AGPL-3.0-only",
7
7
  "repository": {
8
8
  "type": "git",
@@ -2603,6 +2603,35 @@ details[open] > .fold-summary .fold-chev {
2603
2603
  flex-wrap: wrap;
2604
2604
  }
2605
2605
 
2606
+ /* THE BLEED FOLLOWS THE GUTTER. The footer's negative margin cancels `.screen`'s side padding, which is 30px wide and
2607
+ 18px below 900px (the `.screen, .topbar` rule in the max-width: 899px block). Left at 30px there, the footer ran
2608
+ 12px past both edges of a phone and pushed the page sideways. Measured 2026-11-06 at 390px. */
2609
+ @media (max-width: 899px) {
2610
+ .composer-footer {
2611
+ margin-left: -18px;
2612
+ margin-right: -18px;
2613
+ padding-left: 18px;
2614
+ padding-right: 18px;
2615
+ }
2616
+ }
2617
+
2618
+ /* The footer's actions: saving a template, and the review with its line beside it. They keep their width beside the
2619
+ figures on a desk, and below 900px they take a line of their own and wrap inside it. Held at full width there, the
2620
+ row and the line beside the button ran past the footer and made a filled form 583px wide on a 390px phone. */
2621
+ .composer-actions {
2622
+ display: flex;
2623
+ align-items: center;
2624
+ gap: 9px;
2625
+ flex: none;
2626
+ flex-wrap: wrap;
2627
+ }
2628
+ @media (max-width: 899px) {
2629
+ .composer-actions {
2630
+ flex: 1 1 100%;
2631
+ min-width: 0;
2632
+ }
2633
+ }
2634
+
2606
2635
  :root[data-theme='dark'] .composer-footer {
2607
2636
  box-shadow: 0 -10px 30px -14px rgba(0, 0, 0, 0.75);
2608
2637
  }