onto-mcp 0.4.3 → 0.4.5

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 CHANGED
@@ -132,25 +132,25 @@ Available MCP tools:
132
132
 
133
133
  | Tool | Purpose |
134
134
  |---|---|
135
- | `onto.review` | Run the full review path and return artifact refs plus summary |
136
- | `onto.prepare_review` | Prepare a review session and prompt packets |
137
- | `onto.review_continue` | Continue a prepared or halted review from the ledger frontier |
138
- | `onto.review_status` | Read structured status and artifact refs |
139
- | `onto.review_result` | Read `review-record.yaml` and final output |
140
- | `onto.list_lenses` | List canonical lens sets |
141
- | `onto.list_domains` | List available domain ids |
142
- | `onto.list_source_profiles` | List reconstruct source profiles |
143
- | `onto.observe_source` | Materialize reconstruct material profile, inventory, source observations, and initial record |
144
- | `onto.validate_reconstruct_directive` | Validate LLM-authored reconstruct artifacts |
145
- | `onto.reconstruct` | Run the material-aware direct-call reconstruct path with runtime validation gates |
146
- | `onto.reconstruct_status` | Read reconstruct session status, progress, counts, and artifact refs |
147
- | `onto.reconstruct_result` | Read `reconstruct-record.yaml`, run manifest, progress projection, and final output |
135
+ | `onto_review` | Run the full review path and return artifact refs plus summary |
136
+ | `onto_prepare_review` | Prepare a review session and prompt packets |
137
+ | `onto_review_continue` | Continue a prepared or halted review from the ledger frontier |
138
+ | `onto_review_status` | Read structured status and artifact refs |
139
+ | `onto_review_result` | Read `review-record.yaml` and final output |
140
+ | `onto_list_lenses` | List canonical lens sets |
141
+ | `onto_list_domains` | List available domain ids |
142
+ | `onto_list_source_profiles` | List reconstruct source profiles |
143
+ | `onto_observe_source` | Materialize reconstruct material profile, inventory, source observations, and initial record |
144
+ | `onto_validate_reconstruct_directive` | Validate LLM-authored reconstruct artifacts |
145
+ | `onto_reconstruct` | Run the material-aware direct-call reconstruct path with runtime validation gates |
146
+ | `onto_reconstruct_status` | Read reconstruct session status, progress, counts, and artifact refs |
147
+ | `onto_reconstruct_result` | Read `reconstruct-record.yaml`, run manifest, progress projection, and final output |
148
148
 
149
149
  MCP results include `llmPresentation` prompts. The runtime supplies bounded
150
150
  facts; the host LLM should use those prompts to explain the opening brief and
151
151
  final result to the user without inventing settings or findings.
152
152
 
153
- When `onto.review`, `onto.review_continue`, or `onto.reconstruct` starts, the
153
+ When `onto_review`, `onto_review_continue`, or `onto_reconstruct` starts, the
154
154
  runtime writes a session-local `runtime-events.ndjson` stream and tries to open
155
155
  `scripts/onto-runtime-watch.sh` in a supported terminal split/tab. Current
156
156
  automatic attach targets are `tmux`, Codex Desktop with a configured launcher
@@ -168,7 +168,7 @@ Minimal reconstruct MCP call shape:
168
168
 
169
169
  ```json
170
170
  {
171
- "name": "onto.reconstruct",
171
+ "name": "onto_reconstruct",
172
172
  "arguments": {
173
173
  "projectRoot": "/path/to/project",
174
174
  "targetRefs": ["src/example.ts"],
package/dist/cli.js CHANGED
@@ -41,18 +41,18 @@ function printHelp() {
41
41
  " register Register the onto MCP server into supported hosts",
42
42
  "",
43
43
  "Available MCP tools:",
44
- " onto.review",
45
- " onto.prepare_review",
46
- " onto.review_status",
47
- " onto.review_result",
48
- " onto.list_lenses",
49
- " onto.list_domains",
50
- " onto.list_source_profiles",
51
- " onto.observe_source",
52
- " onto.validate_reconstruct_directive",
53
- " onto.reconstruct",
54
- " onto.reconstruct_status",
55
- " onto.reconstruct_result",
44
+ " onto_review",
45
+ " onto_prepare_review",
46
+ " onto_review_status",
47
+ " onto_review_result",
48
+ " onto_list_lenses",
49
+ " onto_list_domains",
50
+ " onto_list_source_profiles",
51
+ " onto_observe_source",
52
+ " onto_validate_reconstruct_directive",
53
+ " onto_reconstruct",
54
+ " onto_reconstruct_status",
55
+ " onto_reconstruct_result",
56
56
  "",
57
57
  "Options:",
58
58
  " --version, -v Show version",
@@ -110,8 +110,46 @@ function parseDomainConstraints(sectionText, lensId) {
110
110
  };
111
111
  });
112
112
  }
113
- function parseStringList(sectionText, label) {
114
- return parseYamlList(sectionText, label).map((item, index) => requireNonEmptyString(item, `${label}[${index}]`));
113
+ /**
114
+ * Parse a lens section that is a list of free-text strings (e.g. Domain Context
115
+ * Assumptions).
116
+ *
117
+ * The lens-output contract asks for a YAML list, but lens output is LLM-authored
118
+ * prose and models routinely emit natural markdown bullets such as
119
+ * `- "PATH resolution" means ...`, which are valid markdown yet invalid YAML (a
120
+ * quoted scalar followed by more text -> "Unexpected scalar at node end"). That
121
+ * brittleness failed real ReviewRecord assembly. Accept a valid YAML string list
122
+ * first (preserves `[]`, `- none`, and clean YAML lists), then fall back to
123
+ * parsing markdown bullet lines as literal strings. Structured object sections
124
+ * (e.g. Domain Constraints Used) stay strict via parseYamlList/parseDomainConstraints.
125
+ *
126
+ * Exported for unit testing.
127
+ */
128
+ export function parseStringList(sectionText, label) {
129
+ const source = extractYamlFence(sectionText);
130
+ if (source.length === 0)
131
+ return [];
132
+ let yamlParsed;
133
+ let yamlParseOk = true;
134
+ try {
135
+ yamlParsed = YAML.parse(source);
136
+ }
137
+ catch {
138
+ yamlParseOk = false;
139
+ }
140
+ if (yamlParseOk &&
141
+ Array.isArray(yamlParsed) &&
142
+ yamlParsed.every((item) => typeof item === "string" && item.trim().length > 0)) {
143
+ return yamlParsed.map((item) => item.trim());
144
+ }
145
+ // Fallback: treat markdown bullet lines as literal strings.
146
+ const bullets = source
147
+ .split(/\r?\n/u)
148
+ .map((line) => /^\s*[-*]\s+(.*\S)\s*$/u.exec(line)?.[1]?.trim())
149
+ .filter((item) => Boolean(item && item.length > 0));
150
+ if (bullets.length > 0)
151
+ return bullets;
152
+ throw new Error(`Expected a YAML list of strings or a markdown bullet list in ${label}.`);
115
153
  }
116
154
  async function deriveLensProvenance(lensResultPathsById, participatingLensIds) {
117
155
  const perLensProvenance = {};
@@ -90,7 +90,7 @@ const REVIEW_INPUT_SCHEMA = {
90
90
  },
91
91
  returnRunningAfterMs: {
92
92
  type: "number",
93
- description: "Optional synchronous wait budget in milliseconds. When exceeded after session planning, onto.review returns a running handle and background execution continues.",
93
+ description: "Optional synchronous wait budget in milliseconds. When exceeded after session planning, onto_review returns a running handle and background execution continues.",
94
94
  },
95
95
  },
96
96
  };
@@ -383,72 +383,72 @@ const VALIDATE_RECONSTRUCT_DIRECTIVE_INPUT_SCHEMA = {
383
383
  };
384
384
  const TOOL_DEFINITIONS = [
385
385
  {
386
- name: "onto.review",
386
+ name: "onto_review",
387
387
  description: "Run an onto review: isolated parallel lens review followed by controlled synthesize/deliberation and ReviewRecord assembly.",
388
388
  inputSchema: REVIEW_INPUT_SCHEMA,
389
389
  },
390
390
  {
391
- name: "onto.prepare_review",
391
+ name: "onto_prepare_review",
392
392
  description: "Prepare an onto review session and prompt packets without executing lens units.",
393
393
  inputSchema: REVIEW_INPUT_SCHEMA,
394
394
  },
395
395
  {
396
- name: "onto.review_continue",
396
+ name: "onto_review_continue",
397
397
  description: "Continue a review session when runControl.continuationAvailable is true by reusing trusted PipelineExecutionLedger units and rerunning only the continuation frontier and downstream units.",
398
398
  inputSchema: REVIEW_CONTINUE_INPUT_SCHEMA,
399
399
  },
400
400
  {
401
- name: "onto.review_cancel",
401
+ name: "onto_review_cancel",
402
402
  description: "Request cancellation for a running review session. The runner writes a halted cancellation result at the next runtime cancellation checkpoint.",
403
403
  inputSchema: REVIEW_CANCEL_INPUT_SCHEMA,
404
404
  },
405
405
  {
406
- name: "onto.review_status",
406
+ name: "onto_review_status",
407
407
  description: "Read structured status and artifact refs for a review session, or recover the latest matching session.",
408
408
  inputSchema: REVIEW_STATUS_INPUT_SCHEMA,
409
409
  },
410
410
  {
411
- name: "onto.review_result",
411
+ name: "onto_review_result",
412
412
  description: "Read the ReviewRecord and rendered final output for a completed review session with compact/standard/full projections.",
413
413
  inputSchema: REVIEW_RESULT_INPUT_SCHEMA,
414
414
  },
415
415
  {
416
- name: "onto.list_lenses",
416
+ name: "onto_list_lenses",
417
417
  description: "List canonical full and core-axis review lens ids.",
418
418
  inputSchema: { type: "object", additionalProperties: false, properties: {} },
419
419
  },
420
420
  {
421
- name: "onto.list_domains",
421
+ name: "onto_list_domains",
422
422
  description: "List available domain ids from project, user, and installation domain seats.",
423
423
  inputSchema: LIST_DOMAINS_INPUT_SCHEMA,
424
424
  },
425
425
  {
426
- name: "onto.list_source_profiles",
426
+ name: "onto_list_source_profiles",
427
427
  description: "List reconstruct source profiles by target_material_kind and support status.",
428
428
  inputSchema: LIST_SOURCE_PROFILES_INPUT_SCHEMA,
429
429
  },
430
430
  {
431
- name: "onto.observe_source",
431
+ name: "onto_observe_source",
432
432
  description: "Prepare reconstruct material profiling, inventory, structural source observations, and reconstruct-record refs without generating ontology meaning.",
433
433
  inputSchema: OBSERVE_SOURCE_INPUT_SCHEMA,
434
434
  },
435
435
  {
436
- name: "onto.validate_reconstruct_directive",
436
+ name: "onto_validate_reconstruct_directive",
437
437
  description: "Validate LLM-authored reconstruct artifacts against runtime observations, registry enums, and evidence refs without repairing or rewriting them.",
438
438
  inputSchema: VALIDATE_RECONSTRUCT_DIRECTIVE_INPUT_SCHEMA,
439
439
  },
440
440
  {
441
- name: "onto.reconstruct",
441
+ name: "onto_reconstruct",
442
442
  description: "Run the material-aware reconstruct path with live semantic authoring, runtime validation gates, final-output.md, and reconstruct-record.yaml refs.",
443
443
  inputSchema: RECONSTRUCT_INPUT_SCHEMA,
444
444
  },
445
445
  {
446
- name: "onto.reconstruct_status",
446
+ name: "onto_reconstruct_status",
447
447
  description: "Read structured status, stage progress, liveness, count summary, and artifact refs for a reconstruct session.",
448
448
  inputSchema: RECONSTRUCT_SESSION_INPUT_SCHEMA,
449
449
  },
450
450
  {
451
- name: "onto.reconstruct_result",
451
+ name: "onto_reconstruct_result",
452
452
  description: "Read the reconstruct record, run manifest, stage progress, final output, and artifact refs for a reconstruct session.",
453
453
  inputSchema: RECONSTRUCT_SESSION_INPUT_SCHEMA,
454
454
  },
@@ -836,7 +836,7 @@ async function resolveAllowedReconstructSessionRoot(args) {
836
836
  async function callTool(name, args, options = {}) {
837
837
  try {
838
838
  switch (name) {
839
- case "onto.review": {
839
+ case "onto_review": {
840
840
  const parsed = OntoReviewToolInputSchema.parse(args);
841
841
  if (parsed.prepareOnly) {
842
842
  const prepared = await reviewApi.prepareReview(toReviewRequest(parsed));
@@ -855,12 +855,12 @@ async function callTool(name, args, options = {}) {
855
855
  });
856
856
  return formatToolResult(result);
857
857
  }
858
- case "onto.prepare_review": {
858
+ case "onto_prepare_review": {
859
859
  const parsed = OntoPrepareReviewToolInputSchema.parse(args);
860
860
  const result = await reviewApi.prepareReview(toReviewRequest(parsed));
861
861
  return formatToolResult(result);
862
862
  }
863
- case "onto.review_continue": {
863
+ case "onto_review_continue": {
864
864
  const parsed = OntoReviewContinueToolInputSchema.parse(args);
865
865
  const projectRoot = resolveProjectRoot(parsed.projectRoot);
866
866
  const sessionRoot = await resolveAllowedSessionRoot({
@@ -882,7 +882,7 @@ async function callTool(name, args, options = {}) {
882
882
  });
883
883
  return formatToolResult(result);
884
884
  }
885
- case "onto.review_cancel": {
885
+ case "onto_review_cancel": {
886
886
  const parsed = OntoReviewCancelToolInputSchema.parse(args);
887
887
  const projectRoot = resolveProjectRoot(parsed.projectRoot);
888
888
  const sessionRoot = await resolveAllowedSessionRoot({
@@ -895,7 +895,7 @@ async function callTool(name, args, options = {}) {
895
895
  ...(parsed.reason !== undefined ? { reason: parsed.reason } : {}),
896
896
  }));
897
897
  }
898
- case "onto.review_status": {
898
+ case "onto_review_status": {
899
899
  const parsed = OntoReviewStatusInputSchema.parse(args);
900
900
  const projectRoot = resolveProjectRoot(parsed.projectRoot);
901
901
  if (parsed.sessionRoot) {
@@ -935,28 +935,28 @@ async function callTool(name, args, options = {}) {
935
935
  latestSessionMatches,
936
936
  });
937
937
  }
938
- case "onto.review_result": {
938
+ case "onto_review_result": {
939
939
  const parsed = OntoReviewResultInputSchema.parse(args);
940
940
  const sessionRoot = await resolveAllowedSessionRoot(parsed);
941
941
  return formatToolResult(await reviewApi.getReviewResult(sessionRoot, {
942
942
  projectionLevel: parsed.projectionLevel ?? "standard",
943
943
  }));
944
944
  }
945
- case "onto.list_lenses":
945
+ case "onto_list_lenses":
946
946
  return formatToolResult(await reviewApi.listLenses());
947
- case "onto.list_domains": {
947
+ case "onto_list_domains": {
948
948
  const parsed = OntoListDomainsToolInputSchema.parse(args ?? {});
949
949
  const domains = await reviewApi.listDomains(parsed.projectRoot);
950
950
  // Wrap the array so structuredContent is a JSON object (MCP requirement).
951
951
  return formatToolResult({ domains });
952
952
  }
953
- case "onto.list_source_profiles": {
953
+ case "onto_list_source_profiles": {
954
954
  const parsed = OntoListSourceProfilesToolInputSchema.parse(args ?? {});
955
955
  const sourceProfiles = await reconstructApi.listSourceProfiles(parsed.projectRoot);
956
956
  // Wrap the array so structuredContent is a JSON object (MCP requirement).
957
957
  return formatToolResult({ sourceProfiles });
958
958
  }
959
- case "onto.observe_source": {
959
+ case "onto_observe_source": {
960
960
  const parsed = OntoObserveSourceToolInputSchema.parse(args);
961
961
  const projectRoot = resolveProjectRoot(parsed.projectRoot);
962
962
  const sessionRoot = resolveReconstructSessionRoot({
@@ -988,7 +988,7 @@ async function callTool(name, args, options = {}) {
988
988
  ...(filesystemAllowedRoots ? { filesystemAllowedRoots } : {}),
989
989
  }));
990
990
  }
991
- case "onto.validate_reconstruct_directive": {
991
+ case "onto_validate_reconstruct_directive": {
992
992
  const parsed = OntoValidateReconstructDirectiveToolInputSchema.parse(args);
993
993
  const projectRoot = resolveProjectRoot(parsed.projectRoot);
994
994
  const sourceObservationsPath = resolveInsideProject({
@@ -1066,7 +1066,7 @@ async function callTool(name, args, options = {}) {
1066
1066
  }
1067
1067
  throw new Error("Unsupported reconstruct directive kind.");
1068
1068
  }
1069
- case "onto.reconstruct": {
1069
+ case "onto_reconstruct": {
1070
1070
  const parsed = OntoReconstructToolInputSchema.parse(args);
1071
1071
  const projectRoot = resolveProjectRoot(parsed.projectRoot);
1072
1072
  const sessionRoot = resolveReconstructSessionRoot({
@@ -1103,7 +1103,7 @@ async function callTool(name, args, options = {}) {
1103
1103
  ...(filesystemAllowedRoots ? { filesystemAllowedRoots } : {}),
1104
1104
  }));
1105
1105
  }
1106
- case "onto.reconstruct_status": {
1106
+ case "onto_reconstruct_status": {
1107
1107
  const parsed = OntoReconstructSessionInputSchema.parse(args);
1108
1108
  const projectRoot = resolveProjectRoot(parsed.projectRoot);
1109
1109
  const sessionRoot = await resolveAllowedReconstructSessionRoot({
@@ -1112,7 +1112,7 @@ async function callTool(name, args, options = {}) {
1112
1112
  });
1113
1113
  return formatToolResult(await reconstructApi.getRunStatus(sessionRoot));
1114
1114
  }
1115
- case "onto.reconstruct_result": {
1115
+ case "onto_reconstruct_result": {
1116
1116
  const parsed = OntoReconstructSessionInputSchema.parse(args);
1117
1117
  const projectRoot = resolveProjectRoot(parsed.projectRoot);
1118
1118
  const sessionRoot = await resolveAllowedReconstructSessionRoot({
@@ -116,18 +116,18 @@ export const OntoValidateReconstructDirectiveToolInputSchema = z.discriminatedUn
116
116
  OntoValidateOntologySeedToolInputSchema,
117
117
  ]);
118
118
  export const OntoToolNames = [
119
- "onto.review",
120
- "onto.prepare_review",
121
- "onto.review_continue",
122
- "onto.review_cancel",
123
- "onto.review_status",
124
- "onto.review_result",
125
- "onto.list_lenses",
126
- "onto.list_domains",
127
- "onto.list_source_profiles",
128
- "onto.observe_source",
129
- "onto.validate_reconstruct_directive",
130
- "onto.reconstruct",
131
- "onto.reconstruct_status",
132
- "onto.reconstruct_result",
119
+ "onto_review",
120
+ "onto_prepare_review",
121
+ "onto_review_continue",
122
+ "onto_review_cancel",
123
+ "onto_review_status",
124
+ "onto_review_result",
125
+ "onto_list_lenses",
126
+ "onto_list_domains",
127
+ "onto_list_source_profiles",
128
+ "onto_observe_source",
129
+ "onto_validate_reconstruct_directive",
130
+ "onto_reconstruct",
131
+ "onto_reconstruct_status",
132
+ "onto_reconstruct_result",
133
133
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onto-mcp",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "MCP-native ontology review runtime with context-isolated lenses and controlled deliberation",
5
5
  "homepage": "https://github.com/kangminlee-maker/onto-mcp#readme",
6
6
  "bugs": {