mindgraph-mcp 0.13.1 → 0.13.3

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 (3) hide show
  1. package/dist/cli.js +43 -27
  2. package/dist/index.js +43 -27
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -312,19 +312,12 @@ async function handlePlan(client2, args) {
312
312
  return ok(await client2.execution({ action: "complete", task_uid, agent_id }));
313
313
  case "fail_execution":
314
314
  return ok(await client2.execution({ action: "fail", task_uid, agent_id }));
315
- // Governance
316
- case "create_policy":
317
- return ok(
318
- await client2.governance({ action: "create_policy", label, summary, props, agent_id })
319
- );
320
- case "request_approval":
321
- return ok(
322
- await client2.governance({ action: "request_approval", label, summary, props, agent_id })
323
- );
324
- case "resolve_approval":
325
- return ok(
326
- await client2.governance({ action: "resolve_approval", task_uid, props, agent_id })
327
- );
315
+ // Governance — read-only from MCP by design (C33). The write actions were
316
+ // removed rather than repaired: `resolve_approval` here also sent
317
+ // `task_uid` where the server requires `approval_uid`, and never sent
318
+ // `approved` at all, so the server's `unwrap_or(false)` would have silently
319
+ // DENIED every approval an agent tried to resolve. Wiring that correctly
320
+ // would have meant building a working self-approval path — the hole itself.
328
321
  case "get_pending":
329
322
  return ok(await client2.governance({ action: "get_pending", agent_id }));
330
323
  // Procedures (merged from mindgraph_action)
@@ -592,6 +585,15 @@ async function handleIngest(client2, args) {
592
585
  agent_id
593
586
  } = args;
594
587
  const src = source_uri ?? source;
588
+ const targetsOntology = Array.isArray(layers) && layers.includes("ontology");
589
+ const cognitiveLayers = targetsOntology ? layers.filter((layer) => layer !== "ontology") : layers;
590
+ if (targetsOntology && !ontology_schema_id) {
591
+ return err(
592
+ "layers included 'ontology' but no ontology_schema_id was supplied. Typed Layer-7 extraction is driven by ontology_schema_id, not by the layers list \u2014 pass the schema id, or drop 'ontology' from layers."
593
+ );
594
+ }
595
+ const forwardedLayers = Array.isArray(cognitiveLayers) && cognitiveLayers.length === 0 ? void 0 : cognitiveLayers;
596
+ const ontologyOnly = targetsOntology && forwardedLayers === void 0;
595
597
  switch (action) {
596
598
  case "chunk":
597
599
  if (!content) return err("content is required for chunk ingestion");
@@ -601,7 +603,9 @@ async function handleIngest(client2, args) {
601
603
  label: title,
602
604
  document_uid,
603
605
  chunk_index,
604
- layers,
606
+ // `/ingest/chunk` runs its ontology pass inline from
607
+ // ontology_schema_id alone and has no ontology_only switch.
608
+ layers: forwardedLayers,
605
609
  agent_id,
606
610
  ontology_schema_id
607
611
  })
@@ -615,8 +619,9 @@ async function handleIngest(client2, args) {
615
619
  source_uri: src,
616
620
  content_type,
617
621
  document_type,
618
- layers,
622
+ layers: forwardedLayers,
619
623
  ontology_schema_id,
624
+ ...ontologyOnly ? { ontology_only: true } : {},
620
625
  participants,
621
626
  occurred_at,
622
627
  context,
@@ -631,8 +636,9 @@ async function handleIngest(client2, args) {
631
636
  await client2.ingestSession({
632
637
  content,
633
638
  title,
634
- layers,
639
+ layers: forwardedLayers,
635
640
  ontology_schema_id,
641
+ ...ontologyOnly ? { ontology_only: true } : {},
636
642
  participants,
637
643
  occurred_at,
638
644
  context,
@@ -1033,7 +1039,7 @@ var init_tools = __esm({
1033
1039
  },
1034
1040
  {
1035
1041
  name: "mindgraph_plan",
1036
- description: "Agent-level task management, governance, and procedural knowledge. Use 'create_plan'/'create_task'/'add_step' for task breakdowns, 'update_status' for progress, 'get_plan' to review. Use 'create_flow'/'add_procedure_step'/'add_affordance'/'add_control' for workflows and procedures. Use 'assess_risk'/'get_assessments' for risk analysis. Use 'create_policy'/'request_approval'/'resolve_approval'/'get_pending' for governance. Prefer mindgraph_commit for user goals/projects; use this for agent-managed execution.",
1042
+ description: "Agent-level task management, governance, and procedural knowledge. Use 'create_plan'/'create_task'/'add_step' for task breakdowns, 'update_status' for progress, 'get_plan' to review. Use 'create_flow'/'add_procedure_step'/'add_affordance'/'add_control' for workflows and procedures. Use 'assess_risk'/'get_assessments' for risk analysis. Use 'get_pending' to read the governance approval queue \u2014 approvals are granted by a person in the MindGraph dashboard, never from here, so wait for one rather than trying to clear it. Prefer mindgraph_commit for user goals/projects; use this for agent-managed execution.",
1037
1043
  inputSchema: {
1038
1044
  type: "object",
1039
1045
  properties: {
@@ -1048,9 +1054,13 @@ var init_tools = __esm({
1048
1054
  "start_execution",
1049
1055
  "complete_execution",
1050
1056
  "fail_execution",
1051
- "create_policy",
1052
- "request_approval",
1053
- "resolve_approval",
1057
+ // C33: governance WRITES are deliberately not exposed here.
1058
+ // `create_policy` let a model author the rules it is judged by;
1059
+ // `request_approval` + `resolve_approval` let it raise and then
1060
+ // clear its own gate, which defeats the human-in-the-loop control
1061
+ // entirely. Authoring and resolving happen in the dashboard, by a
1062
+ // person. `get_pending` stays — reading the queue is safe and is
1063
+ // what an agent needs in order to wait correctly.
1054
1064
  "get_pending",
1055
1065
  "create_flow",
1056
1066
  "add_procedure_step",
@@ -1075,7 +1085,7 @@ var init_tools = __esm({
1075
1085
  },
1076
1086
  task_uid: {
1077
1087
  type: "string",
1078
- description: "Task/step UID (for update_status, execution actions, resolve_approval)"
1088
+ description: "Task/step UID (for update_status, execution actions)"
1079
1089
  },
1080
1090
  target_uid: {
1081
1091
  type: "string",
@@ -1266,11 +1276,11 @@ var init_tools = __esm({
1266
1276
  "ontology"
1267
1277
  ]
1268
1278
  },
1269
- description: "Cognitive layers to extract (defaults vary by action)"
1279
+ description: "Cognitive layers to extract (defaults vary by action). 'ontology' is a targeting flag rather than a cognitive layer: include it only alongside ontology_schema_id, and list it alone to extract domain objects without any cognitive extraction."
1270
1280
  },
1271
1281
  ontology_schema_id: {
1272
1282
  type: "string",
1273
- description: "When set, run typed Layer-7 (domain-object) extraction against this schema in addition to the cognitive layers."
1283
+ description: "When set, run typed Layer-7 (domain-object) extraction against this schema in addition to the cognitive layers. This field alone drives domain-object extraction \u2014 listing 'ontology' in layers without it extracts nothing."
1274
1284
  },
1275
1285
  participants: {
1276
1286
  type: "array",
@@ -1302,12 +1312,18 @@ var init_tools = __esm({
1302
1312
  description: "chunk action: 0-based index of this chunk within its document."
1303
1313
  },
1304
1314
  chunk_size: {
1305
- type: "number",
1306
- description: "Characters per chunk for document ingestion (default: 4000)"
1315
+ type: "integer",
1316
+ minimum: 50,
1317
+ maximum: 32e3,
1318
+ default: 2e3,
1319
+ description: "Maximum tokens per chunk for document or session ingestion (default: 2000)"
1307
1320
  },
1308
1321
  chunk_overlap: {
1309
1322
  type: "number",
1310
- description: "Overlap between chunks (default: 200)"
1323
+ minimum: 0,
1324
+ maximum: 0.9,
1325
+ default: 0.1,
1326
+ description: "Fractional overlap between adjacent chunks for document or session ingestion (default: 0.1; maximum: 0.9)"
1311
1327
  },
1312
1328
  job_id: {
1313
1329
  type: "string",
@@ -1811,7 +1827,7 @@ Capture knowledge when the user shares something worth remembering:
1811
1827
  server = new import_server.Server(
1812
1828
  {
1813
1829
  name: "mindgraph",
1814
- version: "0.13.1"
1830
+ version: "0.13.3"
1815
1831
  },
1816
1832
  {
1817
1833
  capabilities: {
package/dist/index.js CHANGED
@@ -248,7 +248,7 @@ var TOOLS = [
248
248
  },
249
249
  {
250
250
  name: "mindgraph_plan",
251
- description: "Agent-level task management, governance, and procedural knowledge. Use 'create_plan'/'create_task'/'add_step' for task breakdowns, 'update_status' for progress, 'get_plan' to review. Use 'create_flow'/'add_procedure_step'/'add_affordance'/'add_control' for workflows and procedures. Use 'assess_risk'/'get_assessments' for risk analysis. Use 'create_policy'/'request_approval'/'resolve_approval'/'get_pending' for governance. Prefer mindgraph_commit for user goals/projects; use this for agent-managed execution.",
251
+ description: "Agent-level task management, governance, and procedural knowledge. Use 'create_plan'/'create_task'/'add_step' for task breakdowns, 'update_status' for progress, 'get_plan' to review. Use 'create_flow'/'add_procedure_step'/'add_affordance'/'add_control' for workflows and procedures. Use 'assess_risk'/'get_assessments' for risk analysis. Use 'get_pending' to read the governance approval queue \u2014 approvals are granted by a person in the MindGraph dashboard, never from here, so wait for one rather than trying to clear it. Prefer mindgraph_commit for user goals/projects; use this for agent-managed execution.",
252
252
  inputSchema: {
253
253
  type: "object",
254
254
  properties: {
@@ -263,9 +263,13 @@ var TOOLS = [
263
263
  "start_execution",
264
264
  "complete_execution",
265
265
  "fail_execution",
266
- "create_policy",
267
- "request_approval",
268
- "resolve_approval",
266
+ // C33: governance WRITES are deliberately not exposed here.
267
+ // `create_policy` let a model author the rules it is judged by;
268
+ // `request_approval` + `resolve_approval` let it raise and then
269
+ // clear its own gate, which defeats the human-in-the-loop control
270
+ // entirely. Authoring and resolving happen in the dashboard, by a
271
+ // person. `get_pending` stays — reading the queue is safe and is
272
+ // what an agent needs in order to wait correctly.
269
273
  "get_pending",
270
274
  "create_flow",
271
275
  "add_procedure_step",
@@ -290,7 +294,7 @@ var TOOLS = [
290
294
  },
291
295
  task_uid: {
292
296
  type: "string",
293
- description: "Task/step UID (for update_status, execution actions, resolve_approval)"
297
+ description: "Task/step UID (for update_status, execution actions)"
294
298
  },
295
299
  target_uid: {
296
300
  type: "string",
@@ -481,11 +485,11 @@ var TOOLS = [
481
485
  "ontology"
482
486
  ]
483
487
  },
484
- description: "Cognitive layers to extract (defaults vary by action)"
488
+ description: "Cognitive layers to extract (defaults vary by action). 'ontology' is a targeting flag rather than a cognitive layer: include it only alongside ontology_schema_id, and list it alone to extract domain objects without any cognitive extraction."
485
489
  },
486
490
  ontology_schema_id: {
487
491
  type: "string",
488
- description: "When set, run typed Layer-7 (domain-object) extraction against this schema in addition to the cognitive layers."
492
+ description: "When set, run typed Layer-7 (domain-object) extraction against this schema in addition to the cognitive layers. This field alone drives domain-object extraction \u2014 listing 'ontology' in layers without it extracts nothing."
489
493
  },
490
494
  participants: {
491
495
  type: "array",
@@ -517,12 +521,18 @@ var TOOLS = [
517
521
  description: "chunk action: 0-based index of this chunk within its document."
518
522
  },
519
523
  chunk_size: {
520
- type: "number",
521
- description: "Characters per chunk for document ingestion (default: 4000)"
524
+ type: "integer",
525
+ minimum: 50,
526
+ maximum: 32e3,
527
+ default: 2e3,
528
+ description: "Maximum tokens per chunk for document or session ingestion (default: 2000)"
522
529
  },
523
530
  chunk_overlap: {
524
531
  type: "number",
525
- description: "Overlap between chunks (default: 200)"
532
+ minimum: 0,
533
+ maximum: 0.9,
534
+ default: 0.1,
535
+ description: "Fractional overlap between adjacent chunks for document or session ingestion (default: 0.1; maximum: 0.9)"
526
536
  },
527
537
  job_id: {
528
538
  type: "string",
@@ -965,19 +975,12 @@ async function handlePlan(client2, args) {
965
975
  return ok(await client2.execution({ action: "complete", task_uid, agent_id }));
966
976
  case "fail_execution":
967
977
  return ok(await client2.execution({ action: "fail", task_uid, agent_id }));
968
- // Governance
969
- case "create_policy":
970
- return ok(
971
- await client2.governance({ action: "create_policy", label, summary, props, agent_id })
972
- );
973
- case "request_approval":
974
- return ok(
975
- await client2.governance({ action: "request_approval", label, summary, props, agent_id })
976
- );
977
- case "resolve_approval":
978
- return ok(
979
- await client2.governance({ action: "resolve_approval", task_uid, props, agent_id })
980
- );
978
+ // Governance — read-only from MCP by design (C33). The write actions were
979
+ // removed rather than repaired: `resolve_approval` here also sent
980
+ // `task_uid` where the server requires `approval_uid`, and never sent
981
+ // `approved` at all, so the server's `unwrap_or(false)` would have silently
982
+ // DENIED every approval an agent tried to resolve. Wiring that correctly
983
+ // would have meant building a working self-approval path — the hole itself.
981
984
  case "get_pending":
982
985
  return ok(await client2.governance({ action: "get_pending", agent_id }));
983
986
  // Procedures (merged from mindgraph_action)
@@ -1245,6 +1248,15 @@ async function handleIngest(client2, args) {
1245
1248
  agent_id
1246
1249
  } = args;
1247
1250
  const src = source_uri ?? source;
1251
+ const targetsOntology = Array.isArray(layers) && layers.includes("ontology");
1252
+ const cognitiveLayers = targetsOntology ? layers.filter((layer) => layer !== "ontology") : layers;
1253
+ if (targetsOntology && !ontology_schema_id) {
1254
+ return err(
1255
+ "layers included 'ontology' but no ontology_schema_id was supplied. Typed Layer-7 extraction is driven by ontology_schema_id, not by the layers list \u2014 pass the schema id, or drop 'ontology' from layers."
1256
+ );
1257
+ }
1258
+ const forwardedLayers = Array.isArray(cognitiveLayers) && cognitiveLayers.length === 0 ? void 0 : cognitiveLayers;
1259
+ const ontologyOnly = targetsOntology && forwardedLayers === void 0;
1248
1260
  switch (action) {
1249
1261
  case "chunk":
1250
1262
  if (!content) return err("content is required for chunk ingestion");
@@ -1254,7 +1266,9 @@ async function handleIngest(client2, args) {
1254
1266
  label: title,
1255
1267
  document_uid,
1256
1268
  chunk_index,
1257
- layers,
1269
+ // `/ingest/chunk` runs its ontology pass inline from
1270
+ // ontology_schema_id alone and has no ontology_only switch.
1271
+ layers: forwardedLayers,
1258
1272
  agent_id,
1259
1273
  ontology_schema_id
1260
1274
  })
@@ -1268,8 +1282,9 @@ async function handleIngest(client2, args) {
1268
1282
  source_uri: src,
1269
1283
  content_type,
1270
1284
  document_type,
1271
- layers,
1285
+ layers: forwardedLayers,
1272
1286
  ontology_schema_id,
1287
+ ...ontologyOnly ? { ontology_only: true } : {},
1273
1288
  participants,
1274
1289
  occurred_at,
1275
1290
  context,
@@ -1284,8 +1299,9 @@ async function handleIngest(client2, args) {
1284
1299
  await client2.ingestSession({
1285
1300
  content,
1286
1301
  title,
1287
- layers,
1302
+ layers: forwardedLayers,
1288
1303
  ontology_schema_id,
1304
+ ...ontologyOnly ? { ontology_only: true } : {},
1289
1305
  participants,
1290
1306
  occurred_at,
1291
1307
  context,
@@ -1754,7 +1770,7 @@ Capture knowledge when the user shares something worth remembering:
1754
1770
  var server = new import_server.Server(
1755
1771
  {
1756
1772
  name: "mindgraph",
1757
- version: "0.13.1"
1773
+ version: "0.13.3"
1758
1774
  },
1759
1775
  {
1760
1776
  capabilities: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindgraph-mcp",
3
- "version": "0.13.1",
3
+ "version": "0.13.3",
4
4
  "description": "MCP server for MindGraph — connect Claude Desktop, Claude Code, and any MCP client to your knowledge graph",
5
5
  "repository": {
6
6
  "type": "git",