keywordgraph-mcp-server 1.7.3 → 1.8.4

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 (113) hide show
  1. package/README.md +81 -3
  2. package/dist/api/client.d.ts +3 -1
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/client.js +2 -1
  5. package/dist/api/client.js.map +1 -1
  6. package/dist/api/config-store.d.ts +11 -0
  7. package/dist/api/config-store.d.ts.map +1 -1
  8. package/dist/api/config-store.js +7 -0
  9. package/dist/api/config-store.js.map +1 -1
  10. package/dist/config/brand.d.ts.map +1 -1
  11. package/dist/config/brand.js +11 -0
  12. package/dist/config/brand.js.map +1 -1
  13. package/dist/http-server.js +3 -1
  14. package/dist/http-server.js.map +1 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +110 -11
  17. package/dist/index.js.map +1 -1
  18. package/dist/instructions.d.ts.map +1 -1
  19. package/dist/instructions.js +9 -2
  20. package/dist/instructions.js.map +1 -1
  21. package/dist/prompts/index.d.ts.map +1 -1
  22. package/dist/prompts/index.js +32 -0
  23. package/dist/prompts/index.js.map +1 -1
  24. package/dist/resources/about.d.ts.map +1 -1
  25. package/dist/resources/about.js +9 -1
  26. package/dist/resources/about.js.map +1 -1
  27. package/dist/schemas/index.d.ts +353 -63
  28. package/dist/schemas/index.d.ts.map +1 -1
  29. package/dist/schemas/index.js +407 -31
  30. package/dist/schemas/index.js.map +1 -1
  31. package/dist/tools/addProjectLearnings.d.ts +30 -0
  32. package/dist/tools/addProjectLearnings.d.ts.map +1 -0
  33. package/dist/tools/addProjectLearnings.js +197 -0
  34. package/dist/tools/addProjectLearnings.js.map +1 -0
  35. package/dist/tools/analyzeLlmResults.d.ts +1 -1
  36. package/dist/tools/analyzeLlmResults.d.ts.map +1 -1
  37. package/dist/tools/analyzeLlmResults.js +5 -2
  38. package/dist/tools/analyzeLlmResults.js.map +1 -1
  39. package/dist/tools/deleteGraph.d.ts +43 -0
  40. package/dist/tools/deleteGraph.d.ts.map +1 -0
  41. package/dist/tools/deleteGraph.js +145 -0
  42. package/dist/tools/deleteGraph.js.map +1 -0
  43. package/dist/tools/deleteStatements.d.ts +106 -0
  44. package/dist/tools/deleteStatements.d.ts.map +1 -0
  45. package/dist/tools/deleteStatements.js +288 -0
  46. package/dist/tools/deleteStatements.js.map +1 -0
  47. package/dist/tools/developConceptualBridges.d.ts +1 -1
  48. package/dist/tools/developLatentTopics.d.ts +1 -1
  49. package/dist/tools/developTextTool.d.ts +1 -1
  50. package/dist/tools/enableProjectLearnings.d.ts +27 -0
  51. package/dist/tools/enableProjectLearnings.d.ts.map +1 -0
  52. package/dist/tools/enableProjectLearnings.js +68 -0
  53. package/dist/tools/enableProjectLearnings.js.map +1 -0
  54. package/dist/tools/generateOntologyGraph.d.ts +10 -3
  55. package/dist/tools/generateOntologyGraph.d.ts.map +1 -1
  56. package/dist/tools/generateOntologyGraph.js +142 -34
  57. package/dist/tools/generateOntologyGraph.js.map +1 -1
  58. package/dist/tools/generateResearchIdeas.d.ts +1 -1
  59. package/dist/tools/generateResearchQuestions.d.ts +1 -1
  60. package/dist/tools/generateResponses.d.ts +1 -1
  61. package/dist/tools/getProjectLearnings.d.ts +30 -0
  62. package/dist/tools/getProjectLearnings.d.ts.map +1 -0
  63. package/dist/tools/getProjectLearnings.js +151 -0
  64. package/dist/tools/getProjectLearnings.js.map +1 -0
  65. package/dist/tools/index.d.ts +8 -0
  66. package/dist/tools/index.d.ts.map +1 -1
  67. package/dist/tools/index.js +8 -0
  68. package/dist/tools/index.js.map +1 -1
  69. package/dist/tools/optimizeKnowledgeBase.d.ts +40 -0
  70. package/dist/tools/optimizeKnowledgeBase.d.ts.map +1 -0
  71. package/dist/tools/optimizeKnowledgeBase.js +230 -0
  72. package/dist/tools/optimizeKnowledgeBase.js.map +1 -0
  73. package/dist/tools/optimizeReasoning.d.ts +1 -1
  74. package/dist/tools/optimizeTextStructure.d.ts +1 -1
  75. package/dist/tools/submitWorkflowFeedback.d.ts +35 -0
  76. package/dist/tools/submitWorkflowFeedback.d.ts.map +1 -0
  77. package/dist/tools/submitWorkflowFeedback.js +62 -0
  78. package/dist/tools/submitWorkflowFeedback.js.map +1 -0
  79. package/dist/tools/updateStatements.d.ts +134 -0
  80. package/dist/tools/updateStatements.d.ts.map +1 -0
  81. package/dist/tools/updateStatements.js +378 -0
  82. package/dist/tools/updateStatements.js.map +1 -0
  83. package/dist/types/index.d.ts +30 -0
  84. package/dist/types/index.d.ts.map +1 -1
  85. package/dist/utils/callTracking.d.ts +29 -0
  86. package/dist/utils/callTracking.d.ts.map +1 -0
  87. package/dist/utils/callTracking.js +88 -0
  88. package/dist/utils/callTracking.js.map +1 -0
  89. package/dist/utils/feedback.d.ts +63 -0
  90. package/dist/utils/feedback.d.ts.map +1 -0
  91. package/dist/utils/feedback.js +115 -0
  92. package/dist/utils/feedback.js.map +1 -0
  93. package/dist/utils/graphInput.d.ts +1 -0
  94. package/dist/utils/graphInput.d.ts.map +1 -1
  95. package/dist/utils/graphInput.js +1 -1
  96. package/dist/utils/graphInput.js.map +1 -1
  97. package/dist/utils/graphLookup.d.ts +29 -0
  98. package/dist/utils/graphLookup.d.ts.map +1 -0
  99. package/dist/utils/graphLookup.js +57 -0
  100. package/dist/utils/graphLookup.js.map +1 -0
  101. package/dist/utils/knowledgeBase.d.ts +21 -0
  102. package/dist/utils/knowledgeBase.d.ts.map +1 -0
  103. package/dist/utils/knowledgeBase.js +110 -0
  104. package/dist/utils/knowledgeBase.js.map +1 -0
  105. package/dist/utils/learnings.d.ts +119 -0
  106. package/dist/utils/learnings.d.ts.map +1 -0
  107. package/dist/utils/learnings.js +337 -0
  108. package/dist/utils/learnings.js.map +1 -0
  109. package/llms-full.infranodus.txt +39 -1
  110. package/llms-full.txt +39 -1
  111. package/llms.infranodus.txt +2 -0
  112. package/llms.txt +2 -0
  113. package/package.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","source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;;;;;;;;;;;;;;EAqGjC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DpC,CAAC;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOjC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;EAsC3B,CAAC;AAaH,eAAO,MAAM,4BAA4B;;;;;;EAEvC,CAAC;AAIH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAgCnC,CAAC;AAEJ,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAgCpC,CAAC;AAMH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgEvC,CAAC;AAMH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DtC,CAAC;AASH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuDjC,CAAC;AAMH,eAAO,MAAM,iBAAiB;;;;;;;;;EAa5B,CAAC;AAMH,wDAAwD;AACxD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAkCpC,CAAC;AAMH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwGjC,CAAC"}
@@ -301,16 +301,36 @@ export const generateContextualHintSchema = generateContextualHintSchemaBase.ref
301
301
  export const GenerateOntologyGraphSchema = z.object({
302
302
  prompt: z
303
303
  .string()
304
- .min(1, "Provide a topic, prompt, or text to generate an ontology for")
305
- .describe("The topic, prompt, or text to generate a reasoning ontology graph for. For example: 'build an ontology on AI attention mechanisms' or 'the main principles of Ray Dalio applied to investment'. The AI generates entities and the relations between them."),
304
+ .optional()
305
+ .describe("A topic or short prompt to generate a reasoning ontology for, e.g. 'build an ontology on AI attention mechanisms' or 'the main principles of Ray Dalio applied to investment'. Sent to the AI as-is in one call. Provide exactly one of: prompt, text, sourceGraphName."),
306
+ text: z
307
+ .string()
308
+ .optional()
309
+ .describe("A long text, document, or structure map of a project (file tree, imports, exports, docstring headlines) to EXTRACT an ontology from. Chunked server-side (see chunkSize); every chunk's ontology is appended to the same graph. Provide exactly one of: prompt, text, sourceGraphName."),
310
+ sourceGraphName: z
311
+ .string()
312
+ .optional()
313
+ .describe(`Name of an existing ${brand.name} graph whose statements are the source: they are read back, chunked, and an ontology is generated from each chunk into the graph named by graphName. Use it to condense a fully ingested repo, vault, or corpus graph (e.g. repo-<project>-docs or repo-<project>-structure) into an ontology, or — with ontologyMode 'procedural' — into a digest of how the project works. Provide exactly one of: prompt, text, sourceGraphName.`),
314
+ ontologyMode: z
315
+ .enum(["general", "codebase", "procedural"])
316
+ .default("general")
317
+ .describe("'general' (default): entities and relations of any domain. 'codebase': the source is a software project's structure map or code documentation — entities are modules/files, functions, classes, data stores, external services, configuration, and the domain concepts they implement; relations favour dependsOn / partOf / exposes / calls / stores / implements. 'procedural': instead of an ontology, write a DIGEST of how the project works — one prose statement per line with [[wikilinks]] on the modules, concepts, and files involved, each ending with its type in [brackets] — [principles], [rules], [procedures], [handoffs], [main_ideas], [gaps] — which is saved as the statement's category; save it as repo-<project>-digest or vault-<project>-digest and feed it to optimize_knowledge_base. Use it when the content already lives in a graph (docs, structure, notes) and nobody can or should re-read the files. Applies to text and sourceGraphName inputs."),
318
+ chunkSize: z
319
+ .number()
320
+ .int()
321
+ .min(2000)
322
+ .max(40000)
323
+ .default(12000)
324
+ .describe("Characters per chunk for text / sourceGraphName inputs (split on line boundaries). Smaller chunks give more detailed, more expensive ontologies. Default 12000."),
306
325
  graphName: z
307
326
  .string()
308
327
  .optional()
309
328
  .describe(`Name of the ${brand.name} graph to save the ontology to. Only used when saveGraph is true. If omitted, a name is auto-generated from the prompt. Note: saving to a name that already exists appends the new statements to that graph rather than replacing it.`),
310
329
  modelToUse: z
311
330
  .enum([
312
- "claude-opus-4.6",
313
- "claude-sonnet-4.6",
331
+ "claude-opus-5",
332
+ "claude-sonnet-5",
333
+ "claude-fable-5",
314
334
  "gemini-2.5-pro",
315
335
  "gemini-2.5-flash",
316
336
  "gemini-2.5-flash-lite",
@@ -320,9 +340,11 @@ export const GenerateOntologyGraphSchema = z.object({
320
340
  "gpt-4o-mini",
321
341
  "gpt-5.4",
322
342
  "gpt-5.4-mini",
343
+ "gpt-5.6-terra",
344
+ "gpt-5.6-sol",
323
345
  ])
324
- .default("claude-opus-4.6")
325
- .describe("AI model used to generate the ontology. More capable models (claude-opus-4.6, gpt-5.4) produce richer, more accurate ontologies; the -mini and -lite variants are faster and cheaper. Default: claude-opus-4.6."),
346
+ .default("claude-opus-5")
347
+ .describe("AI model used to generate the ontology. More capable models (claude-opus-5, claude-fable-5, gpt-5.6-terra) produce richer, more accurate ontologies; the -mini and -lite variants are faster and cheaper. Default: claude-opus-5."),
326
348
  saveGraph: z
327
349
  .boolean()
328
350
  .default(true)
@@ -362,8 +384,9 @@ export const AnalyzeLlmResultsSchema = z.object({
362
384
  .describe(`Name of the ${brand.name} graph to save the LLM overview to. Only used when saveGraph is true. If omitted, a name is auto-generated from the prompt. Note: saving to a name that already exists appends the new statements to that graph rather than replacing it.`),
363
385
  modelToUse: z
364
386
  .enum([
365
- "claude-opus-4.6",
366
- "claude-sonnet-4.6",
387
+ "claude-opus-5",
388
+ "claude-sonnet-5",
389
+ "claude-fable-5",
367
390
  "gemini-2.5-pro",
368
391
  "gemini-2.5-flash",
369
392
  "gemini-2.5-flash-lite",
@@ -373,9 +396,11 @@ export const AnalyzeLlmResultsSchema = z.object({
373
396
  "gpt-4o-mini",
374
397
  "gpt-5.4",
375
398
  "gpt-5.4-mini",
399
+ "gpt-5.6-terra",
400
+ "gpt-5.6-sol",
376
401
  ])
377
- .default("claude-opus-4.6")
378
- .describe("AI model whose view of the topic is being analyzed. Pick the model the user is curious about — different models surface different framings. Default: claude-opus-4.6."),
402
+ .default("claude-opus-5")
403
+ .describe("AI model whose view of the topic is being analyzed. Pick the model the user is curious about — different models surface different framings. Default: claude-opus-5."),
379
404
  modifyAnalyzedText: z
380
405
  .enum(["none", "detectEntities", "extractEntitiesOnly"])
381
406
  .default("none")
@@ -465,8 +490,9 @@ export const GenerateResearchQuestionsSchemaBase = z.object({
465
490
  .describe("Include graph summary string in the response to provide additional information about the text knowledge graph structure"),
466
491
  modelToUse: z
467
492
  .enum([
468
- "claude-opus-4.6",
469
- "claude-sonnet-4.6",
493
+ "claude-opus-5",
494
+ "claude-sonnet-5",
495
+ "claude-fable-5",
470
496
  "gemini-2.5-pro",
471
497
  "gemini-2.5-flash",
472
498
  "gemini-2.5-flash-lite",
@@ -476,9 +502,11 @@ export const GenerateResearchQuestionsSchemaBase = z.object({
476
502
  "gpt-4o-mini",
477
503
  "gpt-5.4",
478
504
  "gpt-5.4-mini",
505
+ "gpt-5.6-terra",
506
+ "gpt-5.6-sol",
479
507
  ])
480
508
  .default("gpt-5.4")
481
- .describe("AI model to use for generating research questions: claude-opus-4.6, claude-sonnet-4.6, gemini-2.5-flash, gemini-2.5-flash-lite, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini"),
509
+ .describe("AI model to use for generating research questions: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
482
510
  });
483
511
  export const GenerateResearchQuestionsSchema = GenerateResearchQuestionsSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
484
512
  (data.url !== undefined && data.url.length > 0) ||
@@ -528,8 +556,9 @@ export const GenerateResearchIdeasSchemaBase = z.object({
528
556
  .describe("Include graph summary string in the response to provide additional information about the text knowledge graph structure"),
529
557
  modelToUse: z
530
558
  .enum([
531
- "claude-opus-4.6",
532
- "claude-sonnet-4.6",
559
+ "claude-opus-5",
560
+ "claude-sonnet-5",
561
+ "claude-fable-5",
533
562
  "gemini-2.5-pro",
534
563
  "gemini-2.5-flash",
535
564
  "gemini-2.5-flash-lite",
@@ -539,9 +568,11 @@ export const GenerateResearchIdeasSchemaBase = z.object({
539
568
  "gpt-4o-mini",
540
569
  "gpt-5.4",
541
570
  "gpt-5.4-mini",
571
+ "gpt-5.6-terra",
572
+ "gpt-5.6-sol",
542
573
  ])
543
574
  .default("gpt-5.4")
544
- .describe("AI model to use for generating research questions: claude-opus-4.6, claude-sonnet-4.6, gemini-2.5-flash, gemini-2.5-flash-lite, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini"),
575
+ .describe("AI model to use for generating research questions: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
545
576
  });
546
577
  export const GenerateResearchIdeasSchema = GenerateResearchIdeasSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
547
578
  (data.url !== undefined && data.url.length > 0) ||
@@ -571,8 +602,9 @@ export const OptimizeTextStructureSchemaBase = z.object({
571
602
  .describe("Type of response to generate: 'response' — generates a response based on the gaps identified; 'idea' — generate a business idea that bridges the gap; 'question' — generate questions that focus on this context; 'transcend' — generate responses that go beyond the text and relate to a broader discourse."),
572
603
  modelToUse: z
573
604
  .enum([
574
- "claude-opus-4.6",
575
- "claude-sonnet-4.6",
605
+ "claude-opus-5",
606
+ "claude-sonnet-5",
607
+ "claude-fable-5",
576
608
  "gemini-2.5-pro",
577
609
  "gemini-2.5-flash",
578
610
  "gemini-2.5-flash-lite",
@@ -582,9 +614,11 @@ export const OptimizeTextStructureSchemaBase = z.object({
582
614
  "gpt-4o-mini",
583
615
  "gpt-5.4",
584
616
  "gpt-5.4-mini",
617
+ "gpt-5.6-terra",
618
+ "gpt-5.6-sol",
585
619
  ])
586
620
  .default("gpt-5.4")
587
- .describe("AI model to use for generating optimization suggestions: claude-opus-4.6, claude-sonnet-4.6, gemini-2.5-flash, gemini-2.5-flash-lite, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini"),
621
+ .describe("AI model to use for generating optimization suggestions: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
588
622
  });
589
623
  export const OptimizeTextStructureSchema = OptimizeTextStructureSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
590
624
  (data.url !== undefined && data.url.length > 0) ||
@@ -600,8 +634,9 @@ export const OptimizeReasoningSchemaBase = z.object({
600
634
  timestamps: timestampsField,
601
635
  modelToUse: z
602
636
  .enum([
603
- "claude-opus-4.6",
604
- "claude-sonnet-4.6",
637
+ "claude-opus-5",
638
+ "claude-sonnet-5",
639
+ "claude-fable-5",
605
640
  "gemini-2.5-pro",
606
641
  "gemini-2.5-flash",
607
642
  "gemini-2.5-flash-lite",
@@ -611,9 +646,11 @@ export const OptimizeReasoningSchemaBase = z.object({
611
646
  "gpt-4o-mini",
612
647
  "gpt-5.4",
613
648
  "gpt-5.4-mini",
649
+ "gpt-5.6-terra",
650
+ "gpt-5.6-sol",
614
651
  ])
615
652
  .default("gpt-5.4")
616
- .describe("AI model to use for generating the reasoning-optimization suggestions: claude-opus-4.6, claude-sonnet-4.6, gemini-2.5-flash, gemini-2.5-flash-lite, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini"),
653
+ .describe("AI model to use for generating the reasoning-optimization suggestions: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
617
654
  });
618
655
  export const OptimizeReasoningSchema = OptimizeReasoningSchemaBase;
619
656
  export const DevelopLatentConceptsSchemaBase = z.object({
@@ -640,8 +677,9 @@ export const DevelopLatentConceptsSchemaBase = z.object({
640
677
  .describe("Request mode: 'question' — generate questions that focus on this context; 'transcend' — generate responses that transcend and go beyond the content of the text and relate to a broader discourse."),
641
678
  modelToUse: z
642
679
  .enum([
643
- "claude-opus-4.6",
644
- "claude-sonnet-4.6",
680
+ "claude-opus-5",
681
+ "claude-sonnet-5",
682
+ "claude-fable-5",
645
683
  "gemini-2.5-pro",
646
684
  "gemini-2.5-flash",
647
685
  "gemini-2.5-flash-lite",
@@ -651,9 +689,11 @@ export const DevelopLatentConceptsSchemaBase = z.object({
651
689
  "gpt-4o-mini",
652
690
  "gpt-5.4",
653
691
  "gpt-5.4-mini",
692
+ "gpt-5.6-terra",
693
+ "gpt-5.6-sol",
654
694
  ])
655
695
  .default("gpt-5.4")
656
- .describe("AI model to use for generating research questions: claude-opus-4.6, claude-sonnet-4.6, gemini-2.5-flash, gemini-2.5-flash-lite, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini"),
696
+ .describe("AI model to use for generating research questions: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
657
697
  });
658
698
  export const DevelopLatentConceptsSchema = DevelopLatentConceptsSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
659
699
  (data.url !== undefined && data.url.length > 0) ||
@@ -717,8 +757,9 @@ export const GenerateResponsesFromGraphSchemaBase = z.object({
717
757
  .describe("Prompt to generate responses to from the graph"),
718
758
  modelToUse: z
719
759
  .enum([
720
- "claude-opus-4.6",
721
- "claude-sonnet-4.6",
760
+ "claude-opus-5",
761
+ "claude-sonnet-5",
762
+ "claude-fable-5",
722
763
  "gemini-2.5-pro",
723
764
  "gemini-2.5-flash",
724
765
  "gemini-2.5-flash-lite",
@@ -728,9 +769,11 @@ export const GenerateResponsesFromGraphSchemaBase = z.object({
728
769
  "gpt-4o-mini",
729
770
  "gpt-5.4",
730
771
  "gpt-5.4-mini",
772
+ "gpt-5.6-terra",
773
+ "gpt-5.6-sol",
731
774
  ])
732
775
  .default("gpt-5.4")
733
- .describe("AI model to use for generating research questions: claude-opus-4.6, claude-sonnet-4.6, gemini-2.5-flash, gemini-2.5-flash-lite, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini"),
776
+ .describe("AI model to use for generating research questions: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
734
777
  });
735
778
  export const GenerateResponsesFromGraphSchema = GenerateResponsesFromGraphSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
736
779
  (data.url !== undefined && data.url.length > 0) ||
@@ -1301,8 +1344,9 @@ export const DevelopTextToolSchemaBase = z.object({
1301
1344
  .describe("Shall we transcend and go beyond this text to relate to a broader discourse? If false, the focus is on this text only."),
1302
1345
  modelToUse: z
1303
1346
  .enum([
1304
- "claude-opus-4.6",
1305
- "claude-sonnet-4.6",
1347
+ "claude-opus-5",
1348
+ "claude-sonnet-5",
1349
+ "claude-fable-5",
1306
1350
  "gemini-2.5-pro",
1307
1351
  "gemini-2.5-flash",
1308
1352
  "gemini-2.5-flash-lite",
@@ -1312,9 +1356,11 @@ export const DevelopTextToolSchemaBase = z.object({
1312
1356
  "gpt-4o-mini",
1313
1357
  "gpt-5.4",
1314
1358
  "gpt-5.4-mini",
1359
+ "gpt-5.6-terra",
1360
+ "gpt-5.6-sol",
1315
1361
  ])
1316
1362
  .default("gpt-5.4")
1317
- .describe("AI model to use for generating insights: claude-opus-4.6, claude-sonnet-4.6, gemini-2.5-flash, gemini-2.5-flash-lite, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini"),
1363
+ .describe("AI model to use for generating insights: claude-opus-5, claude-sonnet-5, claude-fable-5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, grok-4.1-fast-non-reasoning, grok-4.1-fast-reasoning, gpt-4o, gpt-4o-mini, gpt-5.4, gpt-5.4-mini, gpt-5.6-terra, gpt-5.6-sol"),
1318
1364
  });
1319
1365
  export const DevelopTextToolSchema = DevelopTextToolSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
1320
1366
  (data.url !== undefined && data.url.length > 0) ||
@@ -1347,4 +1393,334 @@ export const ListGraphsSchema = z.object({
1347
1393
  .describe("Filter by language code (e.g., 'EN', 'AUTO', 'DE', 'FR', 'ES', etc.)"),
1348
1394
  favorite: z.boolean().optional().describe("Filter by favorite status"),
1349
1395
  });
1396
+ // ---------------------------------------------------------------------------
1397
+ // Project learnings (see docs/drafts/project-learnings-graph.md)
1398
+ // ---------------------------------------------------------------------------
1399
+ const projectField = z
1400
+ .string()
1401
+ .min(1, "Project name is required")
1402
+ .describe("Name of the project the learnings belong to — the repo or folder name, git remote basename, or whatever the user calls it. Use the same name every time for the same project (call get_project_learnings without a project to list the names already in use). Becomes the graph name learn-<slug>.");
1403
+ export const EnableProjectLearningsSchema = z.object({
1404
+ project: projectField,
1405
+ });
1406
+ // Length parity between `types` and `statements` is checked in the handler
1407
+ // (a .refine() would hide `.shape`, which tool registration needs).
1408
+ export const AddProjectLearningsSchema = z.object({
1409
+ project: projectField,
1410
+ statements: z
1411
+ .array(z.string().min(1))
1412
+ .min(1)
1413
+ .max(10)
1414
+ .describe("One learning per statement, at most 2 sentences each, with at least two [[wikilinked]] entities (file paths, modules, concepts, tools). Only project knowledge that is not derivable from the code in a few reads, would have saved time up front, survived verification, and ideally connects things that are not obviously connected. Include a self-assessment of how the work went: what approach worked well in this project and should be repeated, and what should be done differently next time (type 'approach'). Never anything about the user; never secrets, hostnames, env values, or verbatim error output."),
1415
+ types: z
1416
+ .array(z.enum([
1417
+ "location",
1418
+ "trap",
1419
+ "convention",
1420
+ "decision",
1421
+ "workflow",
1422
+ "question",
1423
+ "approach",
1424
+ ]))
1425
+ .min(1)
1426
+ .max(10)
1427
+ .describe("One type per statement, parallel to `statements`: location (where X lives), trap (what went wrong first), convention (how things are done here), decision (what was chosen and why), workflow (how to run/test/build/deploy), question (open, unresolved), approach (self-assessment: what worked well and should be repeated, or what should be done differently next time in this project)."),
1428
+ confirm: z
1429
+ .boolean()
1430
+ .default(false)
1431
+ .describe("false (default) = dry run: returns what would be written (new vs reinforced duplicates) and writes nothing — show it to the user and ask whether to save. true = write. Pass true directly only when the user has said they don't want to be asked each time."),
1432
+ });
1433
+ export const GetProjectLearningsSchema = z.object({
1434
+ project: z
1435
+ .string()
1436
+ .optional()
1437
+ .describe("Project name (same as used when enabling). Omit to list the projects that have learnings enabled in this account."),
1438
+ prompt: z
1439
+ .string()
1440
+ .optional()
1441
+ .describe("The task or question at hand. Retrieves the most relevant learnings for it (GraphRAG) plus a structural overview of what is known. Use at the start of a substantive task."),
1442
+ entity: z
1443
+ .string()
1444
+ .optional()
1445
+ .describe("A file path, module, or concept. Returns every learning that mentions it. Use before working on an unfamiliar area."),
1446
+ type: z
1447
+ .enum(["location", "trap", "convention", "decision", "workflow", "question", "approach"])
1448
+ .optional()
1449
+ .describe("Only return learnings of this type (e.g. 'trap' for the fragile areas of the project, 'approach' for what worked well or should be done differently). Applies to the overview and prompt modes."),
1450
+ limit: z
1451
+ .number()
1452
+ .int()
1453
+ .min(1)
1454
+ .max(50)
1455
+ .default(15)
1456
+ .describe("Maximum number of learnings to return."),
1457
+ });
1458
+ // ---------------------------------------------------------------------------
1459
+ // Workflow feedback (see docs/drafts/workflow-feedback-tool.md)
1460
+ // ---------------------------------------------------------------------------
1461
+ export const SubmitWorkflowFeedbackSchema = z.object({
1462
+ workflow: z
1463
+ .string()
1464
+ .min(1)
1465
+ .describe("One sentence: what the user was trying to accomplish."),
1466
+ toolsUsed: z
1467
+ .array(z.string().min(1))
1468
+ .min(1)
1469
+ .describe(`Names of the ${brand.name} tools called in this workflow, in order.`),
1470
+ consumption: z
1471
+ .enum(["none", "some", "most"])
1472
+ .describe("How much of the tool output you carried into your reply to the user."),
1473
+ usedExample: z
1474
+ .string()
1475
+ .optional()
1476
+ .describe("Quote ONE specific item from the output that you used (a gap, a question, a cluster name, a bridge). Required when consumption is not 'none'. Never invent one."),
1477
+ novelty: z
1478
+ .enum(["nothing_new", "some_new", "mostly_new"])
1479
+ .describe("Did the output contain things you would NOT have produced from the source text on your own?"),
1480
+ taskFit: z
1481
+ .enum(["right_tool", "needed_another", "wrong_tool"])
1482
+ .describe("Was this the right tool for the request, or did you have to call another tool / do the work yourself to compensate?"),
1483
+ callsNeeded: z
1484
+ .number()
1485
+ .int()
1486
+ .min(1)
1487
+ .describe("How many InfraNodus calls it took to get a usable result (including retries with changed parameters)."),
1488
+ defects: z
1489
+ .array(z.enum([
1490
+ "too_generic",
1491
+ "off_topic",
1492
+ "wrong_language",
1493
+ "truncated",
1494
+ "duplicates",
1495
+ "too_long_to_read",
1496
+ "error",
1497
+ "empty",
1498
+ ]))
1499
+ .default([])
1500
+ .describe("Concrete problems observed in the output. Empty array if none."),
1501
+ userNext: z
1502
+ .enum(["built_on_it", "asked_followup", "ignored", "redirected", "unknown"])
1503
+ .default("unknown")
1504
+ .describe("Only if you can observe it: what the user did after your reply. Leave 'unknown' when reporting before the user has responded."),
1505
+ reason: z
1506
+ .string()
1507
+ .min(1)
1508
+ .describe("One line justifying the observations above."),
1509
+ });
1510
+ // ---------------------------------------------------------------------------
1511
+ // optimize_knowledge_base — structural feedback on a code base / vault / rule set
1512
+ // ---------------------------------------------------------------------------
1513
+ export const OptimizeKnowledgeBaseSchema = z.object({
1514
+ graphName: z
1515
+ .string()
1516
+ .optional()
1517
+ .describe(`Name of the saved ${brand.name} graph that represents the project: e.g. repo-<project>-digest or vault-<project>-digest (the LLM-written digest of how it works), repo-<project>-structure (the deterministic map of files, imports, exports), repo-<project>-docs, vault-<project>-links, or learn-<project>. Provide this or statements/text.`),
1518
+ statements: statementsField,
1519
+ categories: categoriesField,
1520
+ text: z
1521
+ .string()
1522
+ .optional()
1523
+ .describe("Alternative to graphName: a digest of the project as text that YOU write after reading its files — one statement per line describing how it works (principles, rules, procedures, hand-offs, main ideas, gaps), in your own words, with [[wikilinks]] on the modules, concepts, tools, and files each statement is about, grouped under `## [[Topic]]` heading lines; no tags; 100–300 lines. Analyzed without saving unless saveAs is given."),
1524
+ saveAs: z
1525
+ .string()
1526
+ .optional()
1527
+ .describe("With statements/text: save the submitted digest as this graph first (e.g. repo-<project>-digest, vault-<project>-digest), then analyse the saved graph. `## [[Topic]]` heading lines become the parent of the statements under them. Makes compareWith available in the same call and keeps the digest for later questions. Use a name no other producer writes to: a graph created here is in parent mode, and appending generate_ontology_graph 'procedural' output (whose [type] tags are categories) to it would turn those tags into central nodes. Ignored when graphName is given."),
1528
+ focus: z
1529
+ .enum(["general", "codebase", "vault", "procedural"])
1530
+ .default("general")
1531
+ .describe("How to read the structure: 'codebase' (modules, features, integrations), 'vault' (notes, themes, bridge notes), 'procedural' (rules, frameworks, hand-offs between them), or 'general'. Changes the interpretation of the diagnosis, not the analysis."),
1532
+ compareWith: z
1533
+ .array(z.string().min(1))
1534
+ .max(2)
1535
+ .optional()
1536
+ .describe("Up to two other saved graphs of the same project to compare against (e.g. repo-<project>-structure when the primary is the digest, or docs when the primary is code). Each comparison reports what the other layer covers that the primary lacks, and the reverse — rules without code, code without documentation, features described but not built. Requires the primary to be a saved graph: graphName, or statements/text with saveAs."),
1537
+ includeLatent: z
1538
+ .boolean()
1539
+ .default(true)
1540
+ .describe("Also run the latent-topics pass (one extra AI call) to list under-developed areas with ideas on how to develop them. Default true."),
1541
+ modelToUse: z
1542
+ .enum([
1543
+ "claude-opus-5",
1544
+ "claude-sonnet-5",
1545
+ "claude-fable-5",
1546
+ "gemini-2.5-pro",
1547
+ "gemini-2.5-flash",
1548
+ "gemini-2.5-flash-lite",
1549
+ "grok-4.1-fast-non-reasoning",
1550
+ "grok-4.1-fast-reasoning",
1551
+ "gpt-4o",
1552
+ "gpt-4o-mini",
1553
+ "gpt-5.4",
1554
+ "gpt-5.4-mini",
1555
+ "gpt-5.6-terra",
1556
+ "gpt-5.6-sol",
1557
+ ])
1558
+ .default("gpt-5.4")
1559
+ .describe("AI model for the development suggestions and latent-topic ideas."),
1560
+ });
1561
+ // ---------------------------------------------------------------------------
1562
+ // delete_statements (see docs/drafts/delete-statements-tool.md)
1563
+ // ---------------------------------------------------------------------------
1564
+ // "Exactly one selector" is checked in the handler (a .refine() would hide
1565
+ // `.shape`, which tool registration needs). There is deliberately no
1566
+ // `userName`: the tool only ever addresses graphs in the caller's own account.
1567
+ export const DeleteStatementsSchema = z.object({
1568
+ graphName: z
1569
+ .string()
1570
+ .min(1, "graphName is required")
1571
+ .describe(`Name of the graph in your own ${brand.name} account to delete from. It must already exist (use list_graphs to check the exact name); other users' graphs cannot be targeted and this tool never creates a graph.`),
1572
+ categories: z
1573
+ .array(z.string().min(1))
1574
+ .optional()
1575
+ .describe("Delete every statement that carries any of these category labels (exact match). Categories are the source labels statements were uploaded with — a file path, a page name, the [[label]] parent from a '## [[Topic]]' heading — so this is how you remove everything that came from one source before re-uploading its new version with create_knowledge_graph to the same graphName."),
1576
+ statements: z
1577
+ .array(z.string().min(1))
1578
+ .optional()
1579
+ .describe("Delete statements whose text equals one of these exactly (whitespace-normalised)."),
1580
+ query: z
1581
+ .string()
1582
+ .optional()
1583
+ .describe("Delete statements containing this text (case-insensitive substring), or matching a regular expression written as /pattern/flags."),
1584
+ before: z
1585
+ .string()
1586
+ .optional()
1587
+ .describe("Delete statements dated before this ISO 8601 date or datetime (e.g. 2026-08-01 or 2026-08-01T12:00:00Z). Combine with after for a window; the two together count as one selector."),
1588
+ after: z
1589
+ .string()
1590
+ .optional()
1591
+ .describe("Delete statements dated after this ISO 8601 date or datetime. Combine with before for a window."),
1592
+ deleteAll: z
1593
+ .boolean()
1594
+ .optional()
1595
+ .describe("Delete every statement but keep the graph: its name, URL, and settings (e.g. wikilinksMode) stay valid, so it can be rebuilt in place with create_knowledge_graph."),
1596
+ statementIds: z
1597
+ .array(z.number().int())
1598
+ .optional()
1599
+ .describe("Advanced: delete by statement id (ids come from an earlier dry run of this tool or from retrieve_from_knowledge_base). Ids that do not belong to this graph are ignored and reported as ignoredIds."),
1600
+ confirm: z
1601
+ .boolean()
1602
+ .default(false)
1603
+ .describe("Without this (the default) the call is a DRY RUN that only reports what would be deleted. Set true, with the same filter, only after the user has agreed to delete what the dry run showed. The deletion is irreversible."),
1604
+ });
1605
+ // ---------------------------------------------------------------------------
1606
+ // delete_graph
1607
+ // ---------------------------------------------------------------------------
1608
+ export const DeleteGraphSchema = z.object({
1609
+ graphName: z
1610
+ .string()
1611
+ .min(1, "graphName is required")
1612
+ .describe(`Exact name of the graph in your own ${brand.name} account to delete (use list_graphs to check it). Other users' graphs cannot be targeted.`),
1613
+ confirm: z
1614
+ .boolean()
1615
+ .default(false)
1616
+ .describe("Without this (the default) the call is a DRY RUN that only confirms the graph exists and reports what would be removed. Set true, with the same graphName, only after the user has agreed to delete that graph. The deletion is irreversible."),
1617
+ });
1618
+ // ---------------------------------------------------------------------------
1619
+ // update_statements (see docs/drafts/update-statements-tool.md)
1620
+ // ---------------------------------------------------------------------------
1621
+ /** One targeted edit for update_statements (Mode A). */
1622
+ export const UpdateStatementEditSchema = z.object({
1623
+ match: z
1624
+ .string()
1625
+ .min(1)
1626
+ .optional()
1627
+ .describe("The exact current text of the statement to edit (whitespace-normalised), e.g. as returned by analyze_existing_graph_by_name with includeStatements, retrieve_from_knowledge_base, or an earlier dry run. Give exactly one of match or statementId."),
1628
+ statementId: z
1629
+ .number()
1630
+ .int()
1631
+ .optional()
1632
+ .describe("Advanced: the id of the statement to edit (ids come from a dry run of this tool, of delete_statements, or from retrieve_from_knowledge_base). Give exactly one of match or statementId."),
1633
+ content: z
1634
+ .string()
1635
+ .min(1)
1636
+ .optional()
1637
+ .describe("The new text of the statement (at most 1000 characters). [[wikilinks]] are honoured as in create_knowledge_graph. Omit to keep the current text."),
1638
+ categories: z
1639
+ .array(z.string().min(1))
1640
+ .optional()
1641
+ .describe("The new full list of category labels for this statement (replaces the current list). Omit to keep the current categories."),
1642
+ timestamp: z
1643
+ .string()
1644
+ .optional()
1645
+ .describe("The new ISO 8601 date or datetime for this statement (e.g. 2026-08-01 or 2026-08-01T12:00:00Z). Omit to keep the current one."),
1646
+ });
1647
+ // Cross-field rules (Mode A xor Mode B, exactly one selector, at least one
1648
+ // operation, one of match/statementId per edit) are checked in the handler
1649
+ // (a .refine() would hide `.shape`, which tool registration needs). No
1650
+ // `userName`: the tool only ever addresses graphs in the caller's own account.
1651
+ export const UpdateStatementsSchema = z.object({
1652
+ graphName: z
1653
+ .string()
1654
+ .min(1, "graphName is required")
1655
+ .describe(`Name of the graph in your own ${brand.name} account to edit. It must already exist (use list_graphs to check the exact name); other users' graphs cannot be targeted and this tool never creates a graph.`),
1656
+ edits: z
1657
+ .array(UpdateStatementEditSchema)
1658
+ .optional()
1659
+ .describe("Mode A — rewrite specific statements. Each item names one statement (exactly one of match — its exact current text — or statementId) and at least one field to change (content, categories, timestamp). Cannot be combined with the Mode B fields below. Items that match no statement are reported as unmatched, not errors."),
1660
+ categories: z
1661
+ .array(z.string().min(1))
1662
+ .optional()
1663
+ .describe("Mode B selector: every statement carrying any of these category labels (exact match) — everything uploaded under one source (a file path, a page name, the [[label]] parent of a '## [[Topic]]' heading)."),
1664
+ statements: z
1665
+ .array(z.string().min(1))
1666
+ .optional()
1667
+ .describe("Mode B selector: statements whose text equals one of these exactly (whitespace-normalised)."),
1668
+ query: z
1669
+ .string()
1670
+ .optional()
1671
+ .describe("Mode B selector: statements containing this text (case-insensitive substring), or matching a regular expression written as /pattern/flags."),
1672
+ before: z
1673
+ .string()
1674
+ .optional()
1675
+ .describe("Mode B selector: statements dated before this ISO 8601 date or datetime (e.g. 2026-08-01 or 2026-08-01T12:00:00Z). Combine with after for a window; the two together count as one selector."),
1676
+ after: z
1677
+ .string()
1678
+ .optional()
1679
+ .describe("Mode B selector: statements dated after this ISO 8601 date or datetime. Combine with before for a window."),
1680
+ all: z
1681
+ .boolean()
1682
+ .optional()
1683
+ .describe("Mode B selector: every statement in the graph (e.g. to rename a [[concept]] or a source path everywhere with replace)."),
1684
+ statementIds: z
1685
+ .array(z.number().int())
1686
+ .optional()
1687
+ .describe("Mode B selector (advanced): statements by id (ids come from an earlier dry run of this tool or of delete_statements, or from retrieve_from_knowledge_base). Ids that do not belong to this graph are reported as unmatched."),
1688
+ set: z
1689
+ .object({
1690
+ addCategories: z
1691
+ .array(z.string().min(1))
1692
+ .optional()
1693
+ .describe("Category labels to add to every selected statement (existing ones are kept)."),
1694
+ removeCategories: z
1695
+ .array(z.string().min(1))
1696
+ .optional()
1697
+ .describe("Category labels to remove from every selected statement."),
1698
+ categories: z
1699
+ .array(z.string().min(1))
1700
+ .optional()
1701
+ .describe("The new full list of category labels for every selected statement (replaces the current list). Cannot be combined with addCategories or removeCategories."),
1702
+ timestamp: z
1703
+ .string()
1704
+ .optional()
1705
+ .describe("The new ISO 8601 date or datetime for every selected statement."),
1706
+ })
1707
+ .optional()
1708
+ .describe("Mode B operation: change the metadata of every selected statement — addCategories, removeCategories, categories (full replacement; exclusive with add/remove), timestamp. At least one of set or replace is required in Mode B."),
1709
+ replace: z
1710
+ .object({
1711
+ pattern: z
1712
+ .string()
1713
+ .min(1)
1714
+ .describe("What to find in the text of every selected statement: a plain substring (every occurrence, case-sensitive) or a regular expression written as /pattern/flags (e.g. /\\[\\[Old Name\\]\\]/g)."),
1715
+ with: z
1716
+ .string()
1717
+ .describe("The replacement text ($1-style backreferences work with a regex pattern). An empty string removes the match. The resulting statement must stay at most 1000 characters."),
1718
+ })
1719
+ .optional()
1720
+ .describe("Mode B operation: find-and-replace in the text of every selected statement, e.g. to rename a [[concept]] or a source path across the graph. At least one of set or replace is required in Mode B."),
1721
+ confirm: z
1722
+ .boolean()
1723
+ .default(false)
1724
+ .describe("Without this (the default) the call is a DRY RUN that only reports what would change (before → after for each statement). Set true, with the same arguments, only after the user has agreed to the changes the dry run showed. The edit is irreversible: the previous text survives only in the dry-run output."),
1725
+ });
1350
1726
  //# sourceMappingURL=index.js.map