keywordgraph-mcp-server 1.7.0 → 1.7.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.
- package/README.md +27 -20
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +8 -2
- package/dist/api/client.js.map +1 -1
- package/dist/api/config-store.d.ts +2 -0
- package/dist/api/config-store.d.ts.map +1 -1
- package/dist/api/config-store.js +7 -0
- package/dist/api/config-store.js.map +1 -1
- package/dist/auth/oauth-provider.d.ts +3 -2
- package/dist/auth/oauth-provider.d.ts.map +1 -1
- package/dist/auth/oauth-provider.js +83 -28
- package/dist/auth/oauth-provider.js.map +1 -1
- package/dist/http-server.js +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/instructions.js +2 -2
- package/dist/resources/about.d.ts.map +1 -1
- package/dist/resources/about.js +15 -14
- package/dist/resources/about.js.map +1 -1
- package/dist/schemas/index.d.ts +452 -15
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +190 -32
- package/dist/schemas/index.js.map +1 -1
- package/dist/tools/addMemory.d.ts +4 -2
- package/dist/tools/addMemory.d.ts.map +1 -1
- package/dist/tools/addMemory.js +15 -1
- package/dist/tools/addMemory.js.map +1 -1
- package/dist/tools/analyzeExistingGraph.d.ts +1 -0
- package/dist/tools/analyzeExistingGraph.d.ts.map +1 -1
- package/dist/tools/analyzeExistingGraph.js +13 -4
- package/dist/tools/analyzeExistingGraph.js.map +1 -1
- package/dist/tools/analyzeText.d.ts +5 -0
- package/dist/tools/analyzeText.d.ts.map +1 -1
- package/dist/tools/analyzeText.js +18 -21
- package/dist/tools/analyzeText.js.map +1 -1
- package/dist/tools/createKnowledgeGraph.d.ts +6 -0
- package/dist/tools/createKnowledgeGraph.d.ts.map +1 -1
- package/dist/tools/createKnowledgeGraph.js +25 -22
- package/dist/tools/createKnowledgeGraph.js.map +1 -1
- package/dist/tools/developConceptualBridges.d.ts +3 -0
- package/dist/tools/developConceptualBridges.d.ts.map +1 -1
- package/dist/tools/developConceptualBridges.js +5 -17
- package/dist/tools/developConceptualBridges.js.map +1 -1
- package/dist/tools/developLatentTopics.d.ts +3 -0
- package/dist/tools/developLatentTopics.d.ts.map +1 -1
- package/dist/tools/developLatentTopics.js +5 -17
- package/dist/tools/developLatentTopics.js.map +1 -1
- package/dist/tools/developTextTool.d.ts +3 -0
- package/dist/tools/developTextTool.d.ts.map +1 -1
- package/dist/tools/developTextTool.js +9 -19
- package/dist/tools/developTextTool.js.map +1 -1
- package/dist/tools/generateContentGaps.d.ts +3 -0
- package/dist/tools/generateContentGaps.d.ts.map +1 -1
- package/dist/tools/generateContentGaps.js +5 -17
- package/dist/tools/generateContentGaps.js.map +1 -1
- package/dist/tools/generateContextualHint.d.ts +3 -0
- package/dist/tools/generateContextualHint.d.ts.map +1 -1
- package/dist/tools/generateContextualHint.js +5 -17
- package/dist/tools/generateContextualHint.js.map +1 -1
- package/dist/tools/generateDifferenceGraphFromTexts.d.ts +15 -3
- package/dist/tools/generateDifferenceGraphFromTexts.d.ts.map +1 -1
- package/dist/tools/generateDifferenceGraphFromTexts.js +9 -30
- package/dist/tools/generateDifferenceGraphFromTexts.js.map +1 -1
- package/dist/tools/generateKnowledgeGraph.d.ts +6 -0
- package/dist/tools/generateKnowledgeGraph.d.ts.map +1 -1
- package/dist/tools/generateKnowledgeGraph.js +19 -22
- package/dist/tools/generateKnowledgeGraph.js.map +1 -1
- package/dist/tools/generateMergedGraphFromTexts.d.ts +15 -3
- package/dist/tools/generateMergedGraphFromTexts.d.ts.map +1 -1
- package/dist/tools/generateMergedGraphFromTexts.js +9 -30
- package/dist/tools/generateMergedGraphFromTexts.js.map +1 -1
- package/dist/tools/generateOntologyGraph.d.ts +2 -0
- package/dist/tools/generateOntologyGraph.d.ts.map +1 -1
- package/dist/tools/generateOntologyGraph.js +9 -2
- package/dist/tools/generateOntologyGraph.js.map +1 -1
- package/dist/tools/generateOverlapGraphFromTexts.d.ts +15 -3
- package/dist/tools/generateOverlapGraphFromTexts.d.ts.map +1 -1
- package/dist/tools/generateOverlapGraphFromTexts.js +9 -30
- package/dist/tools/generateOverlapGraphFromTexts.js.map +1 -1
- package/dist/tools/generateResearchIdeas.d.ts +3 -0
- package/dist/tools/generateResearchIdeas.d.ts.map +1 -1
- package/dist/tools/generateResearchIdeas.js +5 -17
- package/dist/tools/generateResearchIdeas.js.map +1 -1
- package/dist/tools/generateResearchQuestions.d.ts +3 -0
- package/dist/tools/generateResearchQuestions.d.ts.map +1 -1
- package/dist/tools/generateResearchQuestions.js +5 -17
- package/dist/tools/generateResearchQuestions.js.map +1 -1
- package/dist/tools/generateResponses.d.ts +3 -0
- package/dist/tools/generateResponses.d.ts.map +1 -1
- package/dist/tools/generateResponses.js +5 -17
- package/dist/tools/generateResponses.js.map +1 -1
- package/dist/tools/generateSEOGraphTool.d.ts +2 -0
- package/dist/tools/generateSEOGraphTool.d.ts.map +1 -1
- package/dist/tools/generateSEOGraphTool.js +47 -9
- package/dist/tools/generateSEOGraphTool.js.map +1 -1
- package/dist/tools/generateTopicalClusters.d.ts +3 -0
- package/dist/tools/generateTopicalClusters.d.ts.map +1 -1
- package/dist/tools/generateTopicalClusters.js +5 -17
- package/dist/tools/generateTopicalClusters.js.map +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/optimizeReasoning.d.ts +34 -0
- package/dist/tools/optimizeReasoning.d.ts.map +1 -0
- package/dist/tools/optimizeReasoning.js +84 -0
- package/dist/tools/optimizeReasoning.js.map +1 -0
- package/dist/tools/optimizeTextStructure.d.ts +3 -0
- package/dist/tools/optimizeTextStructure.d.ts.map +1 -1
- package/dist/tools/optimizeTextStructure.js +7 -19
- package/dist/tools/optimizeTextStructure.js.map +1 -1
- package/dist/utils/graphInput.d.ts +72 -0
- package/dist/utils/graphInput.d.ts.map +1 -0
- package/dist/utils/graphInput.js +167 -0
- package/dist/utils/graphInput.js.map +1 -0
- package/dist/utils/wikilinksMode.d.ts +65 -0
- package/dist/utils/wikilinksMode.d.ts.map +1 -0
- package/dist/utils/wikilinksMode.js +188 -0
- package/dist/utils/wikilinksMode.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"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"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,15 +1,41 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { brand } from "../config/brand.js";
|
|
3
|
+
import { WikilinksModeEnum, wikilinksModeDescription, } from "../utils/wikilinksMode.js";
|
|
4
|
+
/**
|
|
5
|
+
* Optional alternative to `text` / `url`, shared by every tool that builds a
|
|
6
|
+
* graph from content: discrete statements with optional per-statement
|
|
7
|
+
* metadata. Reused across schemas — zod field instances are immutable.
|
|
8
|
+
*/
|
|
9
|
+
const statementsField = z
|
|
10
|
+
.array(z.string().min(1))
|
|
11
|
+
.min(1)
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Alternative to `text`: already-separated statements, each one unit of analysis (the role a line plays in `text`). Use only for short discrete items — notes, records, memory entries, survey answers, relations — especially when they carry `categories` or `timestamps`. For prose or long content use text/url instead, which is split on new lines anyway.");
|
|
14
|
+
const categoriesField = z
|
|
15
|
+
.array(z.array(z.string()))
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Per-statement metadata labels, one entry per statement (empty array for none, length must match `statements`). Each label becomes a [[label]] node linked to that statement's concepts only, so author / source / tag / section can be filtered and grouped in the graph. Requires `statements`; omit when there is no metadata.");
|
|
18
|
+
/** Saved graphs freeze their processing settings at creation (lib/context.js
|
|
19
|
+
* applies contextSettings only when the context does not already exist), so
|
|
20
|
+
* categories on a later upload to the same graph produce no label nodes. */
|
|
21
|
+
const SAVED_GRAPH_CATEGORIES_NOTE = "Per-statement metadata labels, one entry per statement (empty array for none, length must match `statements`). Each label becomes a [[label]] node linked to that statement's concepts only, so author / source / tag / section can be filtered and grouped in the graph. Takes effect only when the graph is FIRST created — uploads to an existing graphName keep its original settings and the labels are ignored. Requires `statements`; omit when there is no metadata.";
|
|
22
|
+
const timestampsField = z
|
|
23
|
+
.array(z.string())
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Per-statement date, one entry per statement (empty string = upload time, length must match `statements`). ISO 8601 only — '2026-08-02' or '2026-08-02T14:30:00Z'; other formats are refused because day-first and month-first dates are indistinguishable below the 13th. Stored to minute precision in the server timezone; drives time filters and dynamic graph views. Requires `statements`; omit when the statements are undated.");
|
|
3
26
|
export const GenerateGraphSchema = z.object({
|
|
4
27
|
text: z
|
|
5
28
|
.string()
|
|
6
29
|
.optional()
|
|
7
|
-
.describe("Text that you'd like to analyze. Use new lines to separate separate statements or paragrams in each text (but not the sentences). Use [[wikilinks]] to mark entities (if required for social / knowledge graphs, ontology, or entity detection). Provide
|
|
30
|
+
.describe("Text that you'd like to analyze. Use new lines to separate separate statements or paragrams in each text (but not the sentences). Use [[wikilinks]] to mark entities (if required for social / knowledge graphs, ontology, or entity detection). Provide one of: this, url, or statements."),
|
|
8
31
|
url: z
|
|
9
32
|
.string()
|
|
10
33
|
.url()
|
|
11
34
|
.optional()
|
|
12
35
|
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide either this or text, not both."),
|
|
36
|
+
statements: statementsField,
|
|
37
|
+
categories: categoriesField,
|
|
38
|
+
timestamps: timestampsField,
|
|
13
39
|
includeStatements: z
|
|
14
40
|
.boolean()
|
|
15
41
|
.default(false)
|
|
@@ -22,10 +48,22 @@ export const GenerateGraphSchema = z.object({
|
|
|
22
48
|
.boolean()
|
|
23
49
|
.default(false)
|
|
24
50
|
.describe("Include nodes and edges in response (true only if explicitly needed, not recommended for longer texts)"),
|
|
51
|
+
fullGraph: z
|
|
52
|
+
.boolean()
|
|
53
|
+
.default(false)
|
|
54
|
+
.describe("Return the complete non-compacted graph: all node attributes (degree, betweenness centrality, community), all edge attributes including context_matrix (which statements produced each edge, with weights), the nodes-to-statements map, and full statement metadata. Overrides includeGraph / addNodesAndEdges / compaction. Token-heavy — use only when the raw graph data is explicitly needed (e.g. export, rendering, or programmatic processing)."),
|
|
55
|
+
maxNodes: z
|
|
56
|
+
.number()
|
|
57
|
+
.int()
|
|
58
|
+
.positive()
|
|
59
|
+
.max(1000)
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("Maximum number of concepts (nodes) in the generated graph. Default 150 — the most relevant nodes are kept and the rest dropped. Increase (e.g. 500) for large texts when a more complete graph is explicitly needed; response size grows accordingly. Omit to use the default."),
|
|
25
62
|
modifyAnalyzedText: z
|
|
26
63
|
.enum(["none", "detectEntities", "extractEntitiesOnly"])
|
|
27
64
|
.default("none")
|
|
28
65
|
.describe("Text processing setting to use: none (for text, gap, and topical analysis), detectEntities (mix entities and words), extractEntitiesOnly (detect entities only - use for ontology and knowledge graph generation and entity extraction)"),
|
|
66
|
+
wikilinksMode: WikilinksModeEnum.default("default").describe(wikilinksModeDescription),
|
|
29
67
|
});
|
|
30
68
|
export const CreateGraphSchema = z.object({
|
|
31
69
|
graphName: z
|
|
@@ -35,12 +73,15 @@ export const CreateGraphSchema = z.object({
|
|
|
35
73
|
text: z
|
|
36
74
|
.string()
|
|
37
75
|
.optional()
|
|
38
|
-
.describe("Text that you'd like to analyze. Use new lines to separate separate statements or paragrams in each text (but not the sentences). Provide
|
|
76
|
+
.describe("Text that you'd like to analyze. Use new lines to separate separate statements or paragrams in each text (but not the sentences). Provide one of: this, url, or statements."),
|
|
39
77
|
url: z
|
|
40
78
|
.string()
|
|
41
79
|
.url()
|
|
42
80
|
.optional()
|
|
43
81
|
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide either this or text, not both."),
|
|
82
|
+
statements: statementsField,
|
|
83
|
+
categories: categoriesField.describe(`${SAVED_GRAPH_CATEGORIES_NOTE}`),
|
|
84
|
+
timestamps: timestampsField,
|
|
44
85
|
includeStatements: z
|
|
45
86
|
.boolean()
|
|
46
87
|
.default(false)
|
|
@@ -53,10 +94,23 @@ export const CreateGraphSchema = z.object({
|
|
|
53
94
|
.boolean()
|
|
54
95
|
.default(false)
|
|
55
96
|
.describe("Include nodes and edges in response (add only if explicitly needed, not recommended for longer texts)"),
|
|
97
|
+
fullGraph: z
|
|
98
|
+
.boolean()
|
|
99
|
+
.default(false)
|
|
100
|
+
.describe("Return the complete non-compacted graph: all node attributes (degree, betweenness centrality, community), all edge attributes including context_matrix (which statements produced each edge, with weights), the nodes-to-statements map, and full statement metadata. Overrides includeGraph / addNodesAndEdges / compaction. Token-heavy — use only when the raw graph data is explicitly needed (e.g. export, rendering, or programmatic processing)."),
|
|
101
|
+
maxNodes: z
|
|
102
|
+
.number()
|
|
103
|
+
.int()
|
|
104
|
+
.positive()
|
|
105
|
+
.max(1000)
|
|
106
|
+
.optional()
|
|
107
|
+
.describe("Maximum number of concepts (nodes) in the generated graph. Default 150 — the most relevant nodes are kept and the rest dropped. Increase (e.g. 500) for large texts when a more complete graph is explicitly needed; response size grows accordingly. Omit to use the default."),
|
|
56
108
|
modifyAnalyzedText: z
|
|
57
109
|
.enum(["none", "detectEntities", "extractEntitiesOnly"])
|
|
58
110
|
.default("none")
|
|
59
111
|
.describe("Entity detection: none (normal), detectEntities (mix entities and words), extractEntitiesOnly (detect entities only - use for ontology and knowledge graph creation and entity extraction)"),
|
|
112
|
+
wikilinksMode: WikilinksModeEnum.default("default").describe(wikilinksModeDescription +
|
|
113
|
+
" For saved graphs this applies only when the graph is FIRST created; uploads to an existing graphName keep its original setting."),
|
|
60
114
|
});
|
|
61
115
|
export const AddMemorySchema = z.object({
|
|
62
116
|
graphName: z
|
|
@@ -66,8 +120,11 @@ export const AddMemorySchema = z.object({
|
|
|
66
120
|
.describe(`Name of the graph to add the memory to in ${brand.name} - lowercase, dashes for spaces, no special characters. Auto-generate from the context of the conversation (if previously available) or use the nanme of the LLM client or project, or use the name the user explicitly provided or requested.`),
|
|
67
121
|
text: z
|
|
68
122
|
.string()
|
|
69
|
-
.
|
|
70
|
-
.describe("Text that you'd like to analyze. Use new lines to separate separate statements, relations, and paragraphs in each text (but not the sentences). Detect the entities in every statement and use [[wikilinks]] syntax to mark them, unless the user explicitly requests automatic entity detection. Every statement should have at least two entities marked."),
|
|
123
|
+
.optional()
|
|
124
|
+
.describe("Text that you'd like to analyze. Use new lines to separate separate statements, relations, and paragraphs in each text (but not the sentences). Detect the entities in every statement and use [[wikilinks]] syntax to mark them, unless the user explicitly requests automatic entity detection. Every statement should have at least two entities marked. Provide either this or statements."),
|
|
125
|
+
statements: statementsField,
|
|
126
|
+
categories: categoriesField.describe(SAVED_GRAPH_CATEGORIES_NOTE),
|
|
127
|
+
timestamps: timestampsField,
|
|
71
128
|
includeStatements: z
|
|
72
129
|
.boolean()
|
|
73
130
|
.default(false)
|
|
@@ -89,12 +146,15 @@ export const AnalyzeTextSchemaBase = z.object({
|
|
|
89
146
|
text: z
|
|
90
147
|
.string()
|
|
91
148
|
.optional()
|
|
92
|
-
.describe("Text that you'd like to analyze. Use new lines to separate separate statements or paragrams in each text (but not the sentences). Provide
|
|
149
|
+
.describe("Text that you'd like to analyze. Use new lines to separate separate statements or paragrams in each text (but not the sentences). Provide one of: this, url, or statements."),
|
|
93
150
|
url: z
|
|
94
151
|
.string()
|
|
95
152
|
.url()
|
|
96
153
|
.optional()
|
|
97
154
|
.describe("URL to fetch content from (e.g. webpage or YouTube video transcript). Provide either this or text."),
|
|
155
|
+
statements: statementsField,
|
|
156
|
+
categories: categoriesField,
|
|
157
|
+
timestamps: timestampsField,
|
|
98
158
|
includeStatements: z
|
|
99
159
|
.boolean()
|
|
100
160
|
.default(false)
|
|
@@ -107,6 +167,10 @@ export const AnalyzeTextSchemaBase = z.object({
|
|
|
107
167
|
.boolean()
|
|
108
168
|
.default(false)
|
|
109
169
|
.describe("Include nodes and edges in response (add only if explicitly needed, not recommended for longer texts)"),
|
|
170
|
+
fullGraph: z
|
|
171
|
+
.boolean()
|
|
172
|
+
.default(false)
|
|
173
|
+
.describe("Return the complete non-compacted graph: all node attributes (degree, betweenness centrality, community), all edge attributes including context_matrix (which statements produced each edge, with weights), the nodes-to-statements map, and full statement metadata. Overrides includeGraph / addNodesAndEdges / compaction. Token-heavy — use only when the raw graph data is explicitly needed (e.g. export, rendering, or programmatic processing)."),
|
|
110
174
|
includeGraphSummary: z
|
|
111
175
|
.boolean()
|
|
112
176
|
.default(false)
|
|
@@ -115,9 +179,11 @@ export const AnalyzeTextSchemaBase = z.object({
|
|
|
115
179
|
.enum(["none", "detectEntities", "extractEntitiesOnly"])
|
|
116
180
|
.default("none")
|
|
117
181
|
.describe("Entity detection: none (normal), detectEntities (mix entities and words), extractEntitiesOnly (detect entities only - use for ontology and knowledge graph creation and entity extraction)"),
|
|
182
|
+
wikilinksMode: WikilinksModeEnum.default("default").describe(wikilinksModeDescription),
|
|
118
183
|
});
|
|
119
184
|
export const AnalyzeTextSchema = AnalyzeTextSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
120
|
-
(data.url !== undefined && data.url.length > 0)
|
|
185
|
+
(data.url !== undefined && data.url.length > 0) ||
|
|
186
|
+
(data.statements !== undefined && data.statements.length > 0), { message: "Provide text, url, or statements for analysis." });
|
|
121
187
|
export const AnalyzeExistingGraphSchemaBase = z.object({
|
|
122
188
|
graphName: z
|
|
123
189
|
.string()
|
|
@@ -139,6 +205,10 @@ export const AnalyzeExistingGraphSchemaBase = z.object({
|
|
|
139
205
|
.boolean()
|
|
140
206
|
.default(false)
|
|
141
207
|
.describe("Include nodes and edges in response (add only if explicitly needed, not recommended for longer texts)"),
|
|
208
|
+
fullGraph: z
|
|
209
|
+
.boolean()
|
|
210
|
+
.default(false)
|
|
211
|
+
.describe("Return the complete non-compacted graph: all node attributes (degree, betweenness centrality, community), all edge attributes including context_matrix (which statements produced each edge, with weights), the nodes-to-statements map, and full statement metadata. Overrides includeGraph / addNodesAndEdges / compaction. Token-heavy — use only when the raw graph data is explicitly needed (e.g. export, rendering, or programmatic processing)."),
|
|
142
212
|
includeGraphSummary: z
|
|
143
213
|
.boolean()
|
|
144
214
|
.default(false)
|
|
@@ -188,7 +258,10 @@ export const GenerateContentGapsSchemaBase = z.object({
|
|
|
188
258
|
.string()
|
|
189
259
|
.url()
|
|
190
260
|
.optional()
|
|
191
|
-
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, or graphName."),
|
|
261
|
+
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, statements, or graphName."),
|
|
262
|
+
statements: statementsField,
|
|
263
|
+
categories: categoriesField,
|
|
264
|
+
timestamps: timestampsField,
|
|
192
265
|
graphName: z
|
|
193
266
|
.string()
|
|
194
267
|
.min(1, "Graph name must be non-empty when provided")
|
|
@@ -207,7 +280,10 @@ export const generateContextualHintSchemaBase = z.object({
|
|
|
207
280
|
.string()
|
|
208
281
|
.url()
|
|
209
282
|
.optional()
|
|
210
|
-
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, or graphName."),
|
|
283
|
+
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, statements, or graphName."),
|
|
284
|
+
statements: statementsField,
|
|
285
|
+
categories: categoriesField,
|
|
286
|
+
timestamps: timestampsField,
|
|
211
287
|
graphName: z
|
|
212
288
|
.string()
|
|
213
289
|
.min(1, "Graph name must be non-empty when provided")
|
|
@@ -220,7 +296,8 @@ export const generateContextualHintSchemaBase = z.object({
|
|
|
220
296
|
});
|
|
221
297
|
export const generateContextualHintSchema = generateContextualHintSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
222
298
|
(data.url !== undefined && data.url.length > 0) ||
|
|
223
|
-
(data.graphName !== undefined && data.graphName.trim().length > 0)
|
|
299
|
+
(data.graphName !== undefined && data.graphName.trim().length > 0) ||
|
|
300
|
+
(data.statements !== undefined && data.statements.length > 0), { message: "Provide text, url, statements, or graphName for analysis." });
|
|
224
301
|
export const GenerateOntologyGraphSchema = z.object({
|
|
225
302
|
prompt: z
|
|
226
303
|
.string()
|
|
@@ -254,6 +331,17 @@ export const GenerateOntologyGraphSchema = z.object({
|
|
|
254
331
|
.boolean()
|
|
255
332
|
.default(false)
|
|
256
333
|
.describe("Include the compact graph structure — nodes (entities), edges (relations between them), and clusters — in the response. False by default to keep the response small; the ontology statements and analytics usually carry what's needed. Set to true when you also want to inspect the node/edge structure or render it."),
|
|
334
|
+
fullGraph: z
|
|
335
|
+
.boolean()
|
|
336
|
+
.default(false)
|
|
337
|
+
.describe("Return the complete non-compacted graph: all node attributes (degree, betweenness centrality, community), all edge attributes including context_matrix (which statements produced each edge, with weights), and the nodes-to-statements map. Implies includeGraph and overrides compaction. Token-heavy — use only when the raw graph data is explicitly needed (e.g. export, rendering, or programmatic processing)."),
|
|
338
|
+
maxNodes: z
|
|
339
|
+
.number()
|
|
340
|
+
.int()
|
|
341
|
+
.positive()
|
|
342
|
+
.max(1000)
|
|
343
|
+
.optional()
|
|
344
|
+
.describe("Maximum number of concepts (nodes) in the generated graph. Default 150 — the most relevant nodes are kept and the rest dropped. Increase (e.g. 500) for large ontologies when a more complete graph is explicitly needed; response size grows accordingly. Omit to use the default."),
|
|
257
345
|
includeAnalytics: z
|
|
258
346
|
.boolean()
|
|
259
347
|
.default(true)
|
|
@@ -318,7 +406,10 @@ export const GenerateTopicalClustersSchemaBase = z.object({
|
|
|
318
406
|
.string()
|
|
319
407
|
.url()
|
|
320
408
|
.optional()
|
|
321
|
-
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, or graphName."),
|
|
409
|
+
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, statements, or graphName."),
|
|
410
|
+
statements: statementsField,
|
|
411
|
+
categories: categoriesField,
|
|
412
|
+
timestamps: timestampsField,
|
|
322
413
|
graphName: z
|
|
323
414
|
.string()
|
|
324
415
|
.min(1, "Graph name must be non-empty when provided")
|
|
@@ -336,7 +427,8 @@ export const GenerateTopicalClustersSchemaBase = z.object({
|
|
|
336
427
|
});
|
|
337
428
|
export const GenerateTopicalClustersSchema = GenerateTopicalClustersSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
338
429
|
(data.url !== undefined && data.url.length > 0) ||
|
|
339
|
-
(data.graphName !== undefined && data.graphName.trim().length > 0)
|
|
430
|
+
(data.graphName !== undefined && data.graphName.trim().length > 0) ||
|
|
431
|
+
(data.statements !== undefined && data.statements.length > 0), { message: "Provide text, url, statements, or graphName for analysis." });
|
|
340
432
|
export const GenerateResearchQuestionsSchemaBase = z.object({
|
|
341
433
|
text: z
|
|
342
434
|
.string()
|
|
@@ -346,7 +438,10 @@ export const GenerateResearchQuestionsSchemaBase = z.object({
|
|
|
346
438
|
.string()
|
|
347
439
|
.url()
|
|
348
440
|
.optional()
|
|
349
|
-
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, or graphName."),
|
|
441
|
+
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, statements, or graphName."),
|
|
442
|
+
statements: statementsField,
|
|
443
|
+
categories: categoriesField,
|
|
444
|
+
timestamps: timestampsField,
|
|
350
445
|
graphName: z
|
|
351
446
|
.string()
|
|
352
447
|
.min(1, "Graph name must be non-empty when provided")
|
|
@@ -382,12 +477,13 @@ export const GenerateResearchQuestionsSchemaBase = z.object({
|
|
|
382
477
|
"gpt-5.4",
|
|
383
478
|
"gpt-5.4-mini",
|
|
384
479
|
])
|
|
385
|
-
.default("gpt-
|
|
480
|
+
.default("gpt-5.4")
|
|
386
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"),
|
|
387
482
|
});
|
|
388
483
|
export const GenerateResearchQuestionsSchema = GenerateResearchQuestionsSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
389
484
|
(data.url !== undefined && data.url.length > 0) ||
|
|
390
|
-
(data.graphName !== undefined && data.graphName.trim().length > 0)
|
|
485
|
+
(data.graphName !== undefined && data.graphName.trim().length > 0) ||
|
|
486
|
+
(data.statements !== undefined && data.statements.length > 0), { message: "Provide text, url, statements, or graphName for analysis." });
|
|
391
487
|
export const GenerateResearchIdeasSchemaBase = z.object({
|
|
392
488
|
text: z
|
|
393
489
|
.string()
|
|
@@ -397,7 +493,10 @@ export const GenerateResearchIdeasSchemaBase = z.object({
|
|
|
397
493
|
.string()
|
|
398
494
|
.url()
|
|
399
495
|
.optional()
|
|
400
|
-
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, or graphName."),
|
|
496
|
+
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, statements, or graphName."),
|
|
497
|
+
statements: statementsField,
|
|
498
|
+
categories: categoriesField,
|
|
499
|
+
timestamps: timestampsField,
|
|
401
500
|
graphName: z
|
|
402
501
|
.string()
|
|
403
502
|
.min(1, "Graph name must be non-empty when provided")
|
|
@@ -441,12 +540,13 @@ export const GenerateResearchIdeasSchemaBase = z.object({
|
|
|
441
540
|
"gpt-5.4",
|
|
442
541
|
"gpt-5.4-mini",
|
|
443
542
|
])
|
|
444
|
-
.default("gpt-
|
|
543
|
+
.default("gpt-5.4")
|
|
445
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"),
|
|
446
545
|
});
|
|
447
546
|
export const GenerateResearchIdeasSchema = GenerateResearchIdeasSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
448
547
|
(data.url !== undefined && data.url.length > 0) ||
|
|
449
|
-
(data.graphName !== undefined && data.graphName.trim().length > 0)
|
|
548
|
+
(data.graphName !== undefined && data.graphName.trim().length > 0) ||
|
|
549
|
+
(data.statements !== undefined && data.statements.length > 0), { message: "Provide text, url, statements, or graphName for analysis." });
|
|
450
550
|
export const OptimizeTextStructureSchemaBase = z.object({
|
|
451
551
|
text: z
|
|
452
552
|
.string()
|
|
@@ -456,7 +556,10 @@ export const OptimizeTextStructureSchemaBase = z.object({
|
|
|
456
556
|
.string()
|
|
457
557
|
.url()
|
|
458
558
|
.optional()
|
|
459
|
-
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, or graphName."),
|
|
559
|
+
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, statements, or graphName."),
|
|
560
|
+
statements: statementsField,
|
|
561
|
+
categories: categoriesField,
|
|
562
|
+
timestamps: timestampsField,
|
|
460
563
|
graphName: z
|
|
461
564
|
.string()
|
|
462
565
|
.min(1, "Graph name must be non-empty when provided")
|
|
@@ -480,12 +583,39 @@ export const OptimizeTextStructureSchemaBase = z.object({
|
|
|
480
583
|
"gpt-5.4",
|
|
481
584
|
"gpt-5.4-mini",
|
|
482
585
|
])
|
|
483
|
-
.default("gpt-
|
|
586
|
+
.default("gpt-5.4")
|
|
484
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"),
|
|
485
588
|
});
|
|
486
589
|
export const OptimizeTextStructureSchema = OptimizeTextStructureSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
487
590
|
(data.url !== undefined && data.url.length > 0) ||
|
|
488
|
-
(data.graphName !== undefined && data.graphName.trim().length > 0)
|
|
591
|
+
(data.graphName !== undefined && data.graphName.trim().length > 0) ||
|
|
592
|
+
(data.statements !== undefined && data.statements.length > 0), { message: "Provide text, url, statements, or graphName for analysis." });
|
|
593
|
+
export const OptimizeReasoningSchemaBase = z.object({
|
|
594
|
+
text: z
|
|
595
|
+
.string()
|
|
596
|
+
.optional()
|
|
597
|
+
.describe("The current reasoning trace or chat conversation to analyze structurally. Paste the model's own chain-of-thought / reasoning output, the running dialogue with the user, or both concatenated. Use new lines to separate distinct reasoning steps, turns, or paragraphs (but not individual sentences). Provide either this or statements."),
|
|
598
|
+
statements: statementsField,
|
|
599
|
+
categories: categoriesField,
|
|
600
|
+
timestamps: timestampsField,
|
|
601
|
+
modelToUse: z
|
|
602
|
+
.enum([
|
|
603
|
+
"claude-opus-4.6",
|
|
604
|
+
"claude-sonnet-4.6",
|
|
605
|
+
"gemini-2.5-pro",
|
|
606
|
+
"gemini-2.5-flash",
|
|
607
|
+
"gemini-2.5-flash-lite",
|
|
608
|
+
"grok-4.1-fast-non-reasoning",
|
|
609
|
+
"grok-4.1-fast-reasoning",
|
|
610
|
+
"gpt-4o",
|
|
611
|
+
"gpt-4o-mini",
|
|
612
|
+
"gpt-5.4",
|
|
613
|
+
"gpt-5.4-mini",
|
|
614
|
+
])
|
|
615
|
+
.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"),
|
|
617
|
+
});
|
|
618
|
+
export const OptimizeReasoningSchema = OptimizeReasoningSchemaBase;
|
|
489
619
|
export const DevelopLatentConceptsSchemaBase = z.object({
|
|
490
620
|
text: z
|
|
491
621
|
.string()
|
|
@@ -495,7 +625,10 @@ export const DevelopLatentConceptsSchemaBase = z.object({
|
|
|
495
625
|
.string()
|
|
496
626
|
.url()
|
|
497
627
|
.optional()
|
|
498
|
-
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, or graphName."),
|
|
628
|
+
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, statements, or graphName."),
|
|
629
|
+
statements: statementsField,
|
|
630
|
+
categories: categoriesField,
|
|
631
|
+
timestamps: timestampsField,
|
|
499
632
|
graphName: z
|
|
500
633
|
.string()
|
|
501
634
|
.min(1, "Graph name must be non-empty when provided")
|
|
@@ -519,12 +652,13 @@ export const DevelopLatentConceptsSchemaBase = z.object({
|
|
|
519
652
|
"gpt-5.4",
|
|
520
653
|
"gpt-5.4-mini",
|
|
521
654
|
])
|
|
522
|
-
.default("gpt-
|
|
655
|
+
.default("gpt-5.4")
|
|
523
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"),
|
|
524
657
|
});
|
|
525
658
|
export const DevelopLatentConceptsSchema = DevelopLatentConceptsSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
526
659
|
(data.url !== undefined && data.url.length > 0) ||
|
|
527
|
-
(data.graphName !== undefined && data.graphName.trim().length > 0)
|
|
660
|
+
(data.graphName !== undefined && data.graphName.trim().length > 0) ||
|
|
661
|
+
(data.statements !== undefined && data.statements.length > 0), { message: "Provide text, url, statements, or graphName for analysis." });
|
|
528
662
|
export const RetrieveContextForPromptFromGraphSchema = z.object({
|
|
529
663
|
graphName: z
|
|
530
664
|
.string()
|
|
@@ -573,7 +707,10 @@ export const GenerateResponsesFromGraphSchemaBase = z.object({
|
|
|
573
707
|
.string()
|
|
574
708
|
.url()
|
|
575
709
|
.optional()
|
|
576
|
-
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, or graphName."),
|
|
710
|
+
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, statements, or graphName."),
|
|
711
|
+
statements: statementsField,
|
|
712
|
+
categories: categoriesField,
|
|
713
|
+
timestamps: timestampsField,
|
|
577
714
|
prompt: z
|
|
578
715
|
.string()
|
|
579
716
|
.min(1, "Prompt is required")
|
|
@@ -592,12 +729,13 @@ export const GenerateResponsesFromGraphSchemaBase = z.object({
|
|
|
592
729
|
"gpt-5.4",
|
|
593
730
|
"gpt-5.4-mini",
|
|
594
731
|
])
|
|
595
|
-
.default("gpt-
|
|
732
|
+
.default("gpt-5.4")
|
|
596
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"),
|
|
597
734
|
});
|
|
598
735
|
export const GenerateResponsesFromGraphSchema = GenerateResponsesFromGraphSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
599
736
|
(data.url !== undefined && data.url.length > 0) ||
|
|
600
|
-
(data.graphName !== undefined && data.graphName.trim().length > 0)
|
|
737
|
+
(data.graphName !== undefined && data.graphName.trim().length > 0) ||
|
|
738
|
+
(data.statements !== undefined && data.statements.length > 0), { message: "Provide text, url, statements, or graphName for analysis." });
|
|
601
739
|
// This is used for adding options later to each tool
|
|
602
740
|
export const GenerateGeneralGraphSchema = z.object({
|
|
603
741
|
text: z
|
|
@@ -638,7 +776,7 @@ export const GenerateGeneralGraphSchema = z.object({
|
|
|
638
776
|
.default("none")
|
|
639
777
|
.describe("Entity detection: none (normal), detectEntities (mix entities and words), extractEntitiesOnly (detect entities only - use for ontology and knowledge graph creation and entity extraction)"),
|
|
640
778
|
});
|
|
641
|
-
/** Shared context item: one of { text }, { url }, or { graphName }. Used by overlap and difference tools. */
|
|
779
|
+
/** Shared context item: one of { text }, { statements }, { url }, or { graphName }. Used by overlap and difference tools. */
|
|
642
780
|
const contextItemTextUrlOrGraphSchema = z.union([
|
|
643
781
|
z
|
|
644
782
|
.object({
|
|
@@ -647,7 +785,19 @@ const contextItemTextUrlOrGraphSchema = z.union([
|
|
|
647
785
|
.min(1, "Text is required for analysis")
|
|
648
786
|
.describe("Text content - use new lines to separate statements (but not sentences)."),
|
|
649
787
|
})
|
|
788
|
+
.strict()
|
|
650
789
|
.describe("Context from plain text."),
|
|
790
|
+
z
|
|
791
|
+
.object({
|
|
792
|
+
statements: z
|
|
793
|
+
.array(z.string().min(1))
|
|
794
|
+
.min(1)
|
|
795
|
+
.describe("Short discrete statements, one unit of analysis each."),
|
|
796
|
+
categories: categoriesField,
|
|
797
|
+
timestamps: timestampsField,
|
|
798
|
+
})
|
|
799
|
+
.strict()
|
|
800
|
+
.describe("Context from short discrete statements. Categories and timestamps apply only when every context uses statements; otherwise the statements are joined into text."),
|
|
651
801
|
z
|
|
652
802
|
.object({
|
|
653
803
|
url: z
|
|
@@ -656,6 +806,7 @@ const contextItemTextUrlOrGraphSchema = z.union([
|
|
|
656
806
|
.url("Must be a valid URL")
|
|
657
807
|
.describe("URL to fetch content from (or YouTube transcript)."),
|
|
658
808
|
})
|
|
809
|
+
.strict()
|
|
659
810
|
.describe("Context from a URL."),
|
|
660
811
|
z
|
|
661
812
|
.object({
|
|
@@ -664,13 +815,14 @@ const contextItemTextUrlOrGraphSchema = z.union([
|
|
|
664
815
|
.min(1, "Graph name is required when provided")
|
|
665
816
|
.describe(`Name of an existing ${brand.name} graph; its statements are retrieved and used as text.`),
|
|
666
817
|
})
|
|
818
|
+
.strict()
|
|
667
819
|
.describe(`Context from an existing ${brand.name} graph by name.`),
|
|
668
820
|
]);
|
|
669
821
|
const GenerateOverlapGraphFromTextsSchemaBase = z.object({
|
|
670
822
|
contexts: z
|
|
671
823
|
.array(contextItemTextUrlOrGraphSchema)
|
|
672
824
|
.min(2, "At least two contexts are required for overlap")
|
|
673
|
-
.describe("Array of sources to analyze and find content overlaps for. Each item is an object with exactly one of: { text: string }, { url: string }, or { graphName: string }. Example: [{ text: '...' }, { url: 'https://...' }, { graphName: 'my-graph' }]."),
|
|
825
|
+
.describe("Array of sources to analyze and find content overlaps for. Each item is an object with exactly one of: { text: string }, { statements: string[] } (optionally with categories / timestamps), { url: string }, or { graphName: string }. Example: [{ text: '...' }, { url: 'https://...' }, { graphName: 'my-graph' }]."),
|
|
674
826
|
modifyAnalyzedText: z
|
|
675
827
|
.enum(["none", "detectEntities", "extractEntitiesOnly"])
|
|
676
828
|
.default("none")
|
|
@@ -694,7 +846,7 @@ const GenerateDifferenceGraphFromTextsSchemaBase = z.object({
|
|
|
694
846
|
contexts: z
|
|
695
847
|
.array(contextItemTextUrlOrGraphSchema)
|
|
696
848
|
.min(2, "At least two contexts (target + one reference) are required")
|
|
697
|
-
.describe("Array where the FIRST item is the target to analyze for missing parts; REMAINING items are reference sources. Each item is an object with exactly one of: { text: string }, { url: string }, or { graphName: string }. Example: [{ text: '...' }, { url: 'https://...' }, { graphName: 'my-graph' }]."),
|
|
849
|
+
.describe("Array where the FIRST item is the target to analyze for missing parts; REMAINING items are reference sources. Each item is an object with exactly one of: { text: string }, { statements: string[] } (optionally with categories / timestamps), { url: string }, or { graphName: string }. Example: [{ text: '...' }, { url: 'https://...' }, { graphName: 'my-graph' }]."),
|
|
698
850
|
modifyAnalyzedText: z
|
|
699
851
|
.enum(["none", "detectEntities", "extractEntitiesOnly"])
|
|
700
852
|
.default("none")
|
|
@@ -1042,6 +1194,8 @@ export const GenerateSEOGraphSchema = z.object({
|
|
|
1042
1194
|
.url()
|
|
1043
1195
|
.optional()
|
|
1044
1196
|
.describe("URL to fetch content from for SEO analysis. Provide either this or text, not both."),
|
|
1197
|
+
statements: statementsField,
|
|
1198
|
+
categories: categoriesField,
|
|
1045
1199
|
contentToExtract: z
|
|
1046
1200
|
.enum(["all", "header tags", "link tags"])
|
|
1047
1201
|
.default("all")
|
|
@@ -1124,7 +1278,10 @@ export const DevelopTextToolSchemaBase = z.object({
|
|
|
1124
1278
|
.string()
|
|
1125
1279
|
.url()
|
|
1126
1280
|
.optional()
|
|
1127
|
-
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, or graphName."),
|
|
1281
|
+
.describe("URL to fetch content from or YouTube video URL to fetch transcript. Provide one of: text, url, statements, or graphName."),
|
|
1282
|
+
statements: statementsField,
|
|
1283
|
+
categories: categoriesField,
|
|
1284
|
+
timestamps: timestampsField,
|
|
1128
1285
|
graphName: z
|
|
1129
1286
|
.string()
|
|
1130
1287
|
.min(1, "Graph name must be non-empty when provided")
|
|
@@ -1156,12 +1313,13 @@ export const DevelopTextToolSchemaBase = z.object({
|
|
|
1156
1313
|
"gpt-5.4",
|
|
1157
1314
|
"gpt-5.4-mini",
|
|
1158
1315
|
])
|
|
1159
|
-
.default("gpt-
|
|
1316
|
+
.default("gpt-5.4")
|
|
1160
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"),
|
|
1161
1318
|
});
|
|
1162
1319
|
export const DevelopTextToolSchema = DevelopTextToolSchemaBase.refine((data) => (data.text !== undefined && data.text.trim().length > 0) ||
|
|
1163
1320
|
(data.url !== undefined && data.url.length > 0) ||
|
|
1164
|
-
(data.graphName !== undefined && data.graphName.trim().length > 0)
|
|
1321
|
+
(data.graphName !== undefined && data.graphName.trim().length > 0) ||
|
|
1322
|
+
(data.statements !== undefined && data.statements.length > 0), { message: "Provide text, url, statements, or graphName for analysis." });
|
|
1165
1323
|
export const ListGraphsSchema = z.object({
|
|
1166
1324
|
nameContains: z
|
|
1167
1325
|
.string()
|