@bendyline/gezel-mcp 1.2.2 → 1.2.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/dist/server.js +102 -9
- package/package.json +3 -3
package/dist/server.js
CHANGED
|
@@ -9,9 +9,13 @@ import {
|
|
|
9
9
|
CreateTaskInputSchema,
|
|
10
10
|
EmptyInputSchema,
|
|
11
11
|
EnsureGezelInputSchema,
|
|
12
|
+
FindFilesRequestSchema,
|
|
12
13
|
GEZEL_TOOL_DESCRIPTIONS as GEZEL_TOOL_DESCRIPTIONS2,
|
|
13
14
|
GetScriptRunInputSchema,
|
|
14
15
|
GetTaskInputSchema,
|
|
16
|
+
KnowledgeIdSchema,
|
|
17
|
+
KnowledgeNearbyRequestSchema,
|
|
18
|
+
KnowledgeRadiusSchema,
|
|
15
19
|
ListArtifactsInputSchema,
|
|
16
20
|
ListDirectoryInputSchema,
|
|
17
21
|
ListDocumentsInputSchema,
|
|
@@ -449,6 +453,7 @@ function closestFileNames(target, names, limit = 3) {
|
|
|
449
453
|
|
|
450
454
|
// src/tool-contracts.ts
|
|
451
455
|
import { toolErrorText } from "@bendyline/gezel";
|
|
456
|
+
import { KnowledgeLocationSchema } from "@bendyline/gezel";
|
|
452
457
|
import { z as z2 } from "zod";
|
|
453
458
|
|
|
454
459
|
// src/tool-inventory.ts
|
|
@@ -651,6 +656,23 @@ var TOOL_OUTPUT_SCHEMAS = {
|
|
|
651
656
|
list_tables: ListToolOutputSchema,
|
|
652
657
|
describe_table: TableDescribeToolOutputSchema,
|
|
653
658
|
query_table: TableQueryToolOutputSchema,
|
|
659
|
+
knowledge_nearby: z2.object({
|
|
660
|
+
documents: z2.array(
|
|
661
|
+
z2.object({
|
|
662
|
+
documentId: z2.string(),
|
|
663
|
+
title: z2.string(),
|
|
664
|
+
summary: z2.string().nullable(),
|
|
665
|
+
distanceMeters: z2.number().nonnegative(),
|
|
666
|
+
matchedLocation: KnowledgeLocationSchema,
|
|
667
|
+
uri: z2.string(),
|
|
668
|
+
publisherId: z2.string(),
|
|
669
|
+
catalogId: z2.string(),
|
|
670
|
+
catalogVersion: z2.string()
|
|
671
|
+
})
|
|
672
|
+
),
|
|
673
|
+
total: z2.number().int().nonnegative(),
|
|
674
|
+
nextCursor: z2.string().optional()
|
|
675
|
+
}),
|
|
654
676
|
search: SearchToolOutputSchema,
|
|
655
677
|
search_memory: SearchToolOutputSchema,
|
|
656
678
|
save_memory: MemorySaveToolOutputSchema,
|
|
@@ -738,6 +760,7 @@ var READ_ONLY_TOOLS = /* @__PURE__ */ new Set([
|
|
|
738
760
|
"describe_table",
|
|
739
761
|
"query_table",
|
|
740
762
|
"search",
|
|
763
|
+
"knowledge_nearby",
|
|
741
764
|
"search_memory",
|
|
742
765
|
"list_memories",
|
|
743
766
|
"list_dir",
|
|
@@ -6783,6 +6806,24 @@ server.tool(
|
|
|
6783
6806
|
ReadDocumentInputSchema.shape,
|
|
6784
6807
|
async ({ path }) => {
|
|
6785
6808
|
const knowledgeUri = parseKnowledgeUri(path);
|
|
6809
|
+
if (knowledgeUri?.fragment && "chunk" in knowledgeUri.fragment) {
|
|
6810
|
+
const passage = await api.readKnowledgePassage(
|
|
6811
|
+
knowledgeUri.catalogId,
|
|
6812
|
+
knowledgeUri.documentId,
|
|
6813
|
+
knowledgeUri.fragment.chunk
|
|
6814
|
+
);
|
|
6815
|
+
const articleUri = path.split("#")[0];
|
|
6816
|
+
const provenance = [
|
|
6817
|
+
`Source: ${passage.title} \u2014 ${path}`,
|
|
6818
|
+
...passage.headingPath.length ? [`Section: ${passage.headingPath.join(" \u203A ")}`] : [],
|
|
6819
|
+
`Lines ${passage.lineStart}-${passage.lineEnd} of the article (whole article: read_document ${articleUri})`,
|
|
6820
|
+
...passage.sourceUrl ? [`Origin: ${passage.sourceUrl}`] : [],
|
|
6821
|
+
...passage.sourceUpdatedAt ? [`Snapshot: ${passage.sourceUpdatedAt}`] : []
|
|
6822
|
+
].join("\n");
|
|
6823
|
+
return { content: [{ type: "text", text: `${provenance}
|
|
6824
|
+
|
|
6825
|
+
${passage.text}` }] };
|
|
6826
|
+
}
|
|
6786
6827
|
if (knowledgeUri) {
|
|
6787
6828
|
const doc = await api.readKnowledgeDocument(knowledgeUri.catalogId, knowledgeUri.documentId);
|
|
6788
6829
|
let body = doc.markdown;
|
|
@@ -8800,6 +8841,7 @@ server.tool(
|
|
|
8800
8841
|
AskUserQuestionInputSchema.shape,
|
|
8801
8842
|
async ({
|
|
8802
8843
|
question,
|
|
8844
|
+
permissionRequest,
|
|
8803
8845
|
prompt,
|
|
8804
8846
|
description,
|
|
8805
8847
|
choices,
|
|
@@ -8836,6 +8878,7 @@ server.tool(
|
|
|
8836
8878
|
gezelId,
|
|
8837
8879
|
sessionId,
|
|
8838
8880
|
prompt: body,
|
|
8881
|
+
...permissionRequest ? { permissionRequest } : {},
|
|
8839
8882
|
...choices ? { choices } : {},
|
|
8840
8883
|
...allowWriteIn !== void 0 ? { allowWriteIn } : {},
|
|
8841
8884
|
...multiSelect !== void 0 ? { multiSelect } : {},
|
|
@@ -9789,7 +9832,7 @@ server.tool(
|
|
|
9789
9832
|
async function resolveAssigneeArg(raw) {
|
|
9790
9833
|
const normalized = normalizeAssigneeArg(raw);
|
|
9791
9834
|
if (!normalized) return void 0;
|
|
9792
|
-
if (normalized.kind === "user") return
|
|
9835
|
+
if (normalized.kind === "user") return normalized;
|
|
9793
9836
|
return { kind: "gezel", gezelId: await resolveGezelId(normalized.ref) };
|
|
9794
9837
|
}
|
|
9795
9838
|
function inferDraftDeliverable(task) {
|
|
@@ -9868,6 +9911,7 @@ function blueprintToStep(s) {
|
|
|
9868
9911
|
const d = coerceBlueprintDeliverable(s.deliverable);
|
|
9869
9912
|
return {
|
|
9870
9913
|
name: s.name,
|
|
9914
|
+
...s.assignee ? { assignee: s.assignee } : {},
|
|
9871
9915
|
...s.description ? { description: s.description } : {},
|
|
9872
9916
|
...s.prompt ? { prompt: s.prompt } : {},
|
|
9873
9917
|
...s.suggestedGezelId ? { suggestedGezelId: s.suggestedGezelId } : {},
|
|
@@ -10474,6 +10518,7 @@ server.tool(
|
|
|
10474
10518
|
name: z5.string().min(1),
|
|
10475
10519
|
description: z5.string().optional(),
|
|
10476
10520
|
prompt: z5.string().optional(),
|
|
10521
|
+
assignee: StepBlueprintSchema.shape.assignee,
|
|
10477
10522
|
suggestedGezelId: z5.string().optional(),
|
|
10478
10523
|
suggestedRole: z5.string().optional().describe('Role hint, e.g. "developer", "reviewer".'),
|
|
10479
10524
|
deliverable: deliverableArg,
|
|
@@ -10486,6 +10531,7 @@ server.tool(
|
|
|
10486
10531
|
name,
|
|
10487
10532
|
description,
|
|
10488
10533
|
prompt,
|
|
10534
|
+
assignee,
|
|
10489
10535
|
suggestedGezelId,
|
|
10490
10536
|
suggestedRole,
|
|
10491
10537
|
deliverable,
|
|
@@ -10505,6 +10551,7 @@ server.tool(
|
|
|
10505
10551
|
name,
|
|
10506
10552
|
...description ? { description } : {},
|
|
10507
10553
|
...prompt ? { prompt } : {},
|
|
10554
|
+
...assignee ? { assignee } : {},
|
|
10508
10555
|
...suggestedGezelId ? { suggestedGezelId } : {},
|
|
10509
10556
|
...suggestedRole ? { suggestedRole } : {},
|
|
10510
10557
|
...d ? { deliverable: d } : {},
|
|
@@ -11420,12 +11467,7 @@ server.tool(
|
|
|
11420
11467
|
server.tool(
|
|
11421
11468
|
"find_files",
|
|
11422
11469
|
"Find files in the project workspace by glob (e.g. `**/*.spec.ts`). Complement to `grep_files`, which searches contents. Skips `node_modules` and `.git`.",
|
|
11423
|
-
|
|
11424
|
-
glob: z5.string().min(1),
|
|
11425
|
-
path: z5.string().optional(),
|
|
11426
|
-
caseInsensitive: z5.boolean().optional(),
|
|
11427
|
-
maxResults: z5.number().int().positive().optional()
|
|
11428
|
-
},
|
|
11470
|
+
FindFilesRequestSchema.shape,
|
|
11429
11471
|
async (args) => {
|
|
11430
11472
|
try {
|
|
11431
11473
|
const res = await api.toolFindFiles(projectId, args);
|
|
@@ -11731,10 +11773,56 @@ server.tool(
|
|
|
11731
11773
|
}
|
|
11732
11774
|
}
|
|
11733
11775
|
);
|
|
11776
|
+
server.tool(
|
|
11777
|
+
"knowledge_nearby",
|
|
11778
|
+
GEZEL_TOOL_DESCRIPTIONS2.knowledge_nearby,
|
|
11779
|
+
KnowledgeNearbyRequestSchema.shape,
|
|
11780
|
+
async (body) => {
|
|
11781
|
+
try {
|
|
11782
|
+
const found = await api.toolKnowledgeNearby(projectId, body);
|
|
11783
|
+
const result = {
|
|
11784
|
+
...found,
|
|
11785
|
+
documents: found.documents.map((document) => ({
|
|
11786
|
+
documentId: document.id,
|
|
11787
|
+
title: document.title,
|
|
11788
|
+
summary: document.summary,
|
|
11789
|
+
distanceMeters: document.distanceMeters,
|
|
11790
|
+
matchedLocation: {
|
|
11791
|
+
id: document.matchedLocation.id,
|
|
11792
|
+
latitude: document.matchedLocation.latitude,
|
|
11793
|
+
longitude: document.matchedLocation.longitude,
|
|
11794
|
+
role: document.matchedLocation.role
|
|
11795
|
+
},
|
|
11796
|
+
uri: document.uri,
|
|
11797
|
+
publisherId: document.publisherId,
|
|
11798
|
+
catalogId: document.catalogId,
|
|
11799
|
+
catalogVersion: document.catalogVersion
|
|
11800
|
+
}))
|
|
11801
|
+
};
|
|
11802
|
+
return {
|
|
11803
|
+
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
11804
|
+
structuredContent: result
|
|
11805
|
+
};
|
|
11806
|
+
} catch (error) {
|
|
11807
|
+
return {
|
|
11808
|
+
content: [
|
|
11809
|
+
{ type: "text", text: `knowledge_nearby failed: ${unwrapApiError(error)}` }
|
|
11810
|
+
],
|
|
11811
|
+
isError: true
|
|
11812
|
+
};
|
|
11813
|
+
}
|
|
11814
|
+
}
|
|
11815
|
+
);
|
|
11734
11816
|
server.tool(
|
|
11735
11817
|
"search",
|
|
11736
11818
|
GEZEL_TOOL_DESCRIPTIONS2.search,
|
|
11737
11819
|
SearchInputSchema.extend({
|
|
11820
|
+
spatial: KnowledgeRadiusSchema.optional().describe(
|
|
11821
|
+
"Restrict knowledge to subject locations within this radius, in meters."
|
|
11822
|
+
),
|
|
11823
|
+
catalogs: z5.array(KnowledgeIdSchema).optional().describe(
|
|
11824
|
+
'Search only these knowledge catalogs. Implies sources: ["knowledge"] unless sources is given.'
|
|
11825
|
+
),
|
|
11738
11826
|
sources: z5.array(
|
|
11739
11827
|
z5.enum(["workspace", "artifacts", "project-memory", "gezel-memory", "shared", "knowledge"])
|
|
11740
11828
|
).optional().describe("Optional corpus filter. Omit to search all knowledge available to this project."),
|
|
@@ -11746,13 +11834,18 @@ server.tool(
|
|
|
11746
11834
|
'Only results under this path prefix (e.g. "src/engine/" or "../<project-id>/docs/"). Narrowing only.'
|
|
11747
11835
|
)
|
|
11748
11836
|
}).shape,
|
|
11749
|
-
async ({ query, sources, maxResults, cursor, pathPrefix }) => {
|
|
11837
|
+
async ({ query, sources, maxResults, cursor, pathPrefix, spatial, catalogs }) => {
|
|
11750
11838
|
try {
|
|
11751
11839
|
const res = await api.toolSearch(projectId, {
|
|
11752
11840
|
query,
|
|
11753
11841
|
gezelId,
|
|
11754
11842
|
includeShared: true,
|
|
11755
|
-
|
|
11843
|
+
// Naming catalogs is asking for reference material: without this the
|
|
11844
|
+
// workspace and shared library kept answering, and their rank-derived
|
|
11845
|
+
// "strong" hits crowded the named catalog off the page.
|
|
11846
|
+
...sources ? { sources } : spatial || catalogs ? { sources: ["knowledge"] } : {},
|
|
11847
|
+
...spatial ? { spatial } : {},
|
|
11848
|
+
...catalogs ? { catalogs } : {},
|
|
11756
11849
|
...maxResults ? { maxResults } : {},
|
|
11757
11850
|
...cursor ? { offset: cursor } : {},
|
|
11758
11851
|
...pathPrefix ? { pathPrefix } : {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/gezel-mcp",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Gezel MCP server — gives agents access to memory, workspace, artifacts, and tools.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"!dist/**/*.map"
|
|
56
56
|
],
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@bendyline/gezel": "1.2.
|
|
59
|
-
"@bendyline/gezel-client": "1.2.
|
|
58
|
+
"@bendyline/gezel": "1.2.3",
|
|
59
|
+
"@bendyline/gezel-client": "1.2.3",
|
|
60
60
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
61
61
|
"typescript": "^6.0.3",
|
|
62
62
|
"zod": "^4.4.3"
|