@selfagency/beans-mcp 0.1.1 → 0.1.2
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/beans-mcp-server.cjs → beans-mcp-server.cjs} +8 -4
- package/{dist/index.cjs → index.cjs} +8 -4
- package/{dist/index.d.ts → index.d.ts} +2 -1
- package/{dist/index.js → index.js} +8 -4
- package/package.json +27 -64
- package/.beans.yml +0 -6
- package/.claude/settings.local.json +0 -18
- package/.editorconfig +0 -13
- package/.github/workflows/release.yml +0 -235
- package/.github/workflows/test.yml +0 -80
- package/.husky/pre-commit +0 -1
- package/.nvmrc +0 -1
- package/.oxfmtrc.json +0 -11
- package/.oxlintrc.json +0 -37
- package/.vscode/settings.json +0 -3
- package/CHANGELOG.md +0 -140
- package/CONTRIBUTING.md +0 -139
- package/dist/README.md +0 -307
- package/dist/beans-mcp-server.cjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/package.json +0 -43
- package/pnpm-workspace.yaml +0 -2
- package/scripts/release.js +0 -433
- package/scripts/write-dist-package.js +0 -53
- package/src/cli.ts +0 -14
- package/src/index.ts +0 -21
- package/src/internal/graphql.ts +0 -33
- package/src/internal/queryHelpers.ts +0 -157
- package/src/server/BeansMcpServer.ts +0 -600
- package/src/server/backend.ts +0 -358
- package/src/test/BeansMcpServer.test.ts +0 -514
- package/src/test/handlers.unit.test.ts +0 -184
- package/src/test/parseCliArgs.test.ts +0 -69
- package/src/test/protocol.e2e.test.ts +0 -884
- package/src/test/queryHelpers.test.ts +0 -524
- package/src/test/startBeansMcpServer.test.ts +0 -146
- package/src/test/tools-integration.test.ts +0 -912
- package/src/test/utils.test.ts +0 -80
- package/src/types.ts +0 -46
- package/src/utils.ts +0 -20
- package/tsconfig.json +0 -24
- package/tsup.config.ts +0 -42
- package/vitest.config.ts +0 -18
package/src/test/utils.test.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { isPathWithinRoot, makeTextAndStructured } from "../utils";
|
|
3
|
-
|
|
4
|
-
describe("isPathWithinRoot", () => {
|
|
5
|
-
it("should return true for paths within root", () => {
|
|
6
|
-
const root = "/workspace/.beans";
|
|
7
|
-
const target = "/workspace/.beans/file.md";
|
|
8
|
-
expect(isPathWithinRoot(root, target)).toBe(true);
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it("should return false for paths outside root", () => {
|
|
12
|
-
const root = "/workspace/.beans";
|
|
13
|
-
const target = "/workspace/outside.md";
|
|
14
|
-
expect(isPathWithinRoot(root, target)).toBe(false);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it("should return false for paths with parent traversal", () => {
|
|
18
|
-
const root = "/workspace/.beans";
|
|
19
|
-
const target = "/workspace/.beans/../../etc/passwd";
|
|
20
|
-
expect(isPathWithinRoot(root, target)).toBe(false);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it("should handle relative path normalization", () => {
|
|
24
|
-
const root = "/workspace/.beans/";
|
|
25
|
-
const target = "/workspace/.beans/subdir/file.md";
|
|
26
|
-
expect(isPathWithinRoot(root, target)).toBe(true);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("should return false when root and target are the same", () => {
|
|
30
|
-
const root = "/workspace/.beans";
|
|
31
|
-
const target = "/workspace/.beans";
|
|
32
|
-
expect(isPathWithinRoot(root, target)).toBe(false);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it("should handle paths with trailing slashes", () => {
|
|
36
|
-
const root = "/workspace/.beans/";
|
|
37
|
-
const target = "/workspace/.beans/file.md";
|
|
38
|
-
expect(isPathWithinRoot(root, target)).toBe(true);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe("makeTextAndStructured", () => {
|
|
43
|
-
it("should create text and structured content from object", () => {
|
|
44
|
-
const input = { name: "test", value: 42 };
|
|
45
|
-
const result = makeTextAndStructured(input);
|
|
46
|
-
|
|
47
|
-
expect(result.content).toHaveLength(1);
|
|
48
|
-
expect(result.content[0].type).toBe("text");
|
|
49
|
-
expect(result.structuredContent).toEqual(input);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it("should serialize content as JSON", () => {
|
|
53
|
-
const input = { key: "value", nested: { deep: true } };
|
|
54
|
-
const result = makeTextAndStructured(input);
|
|
55
|
-
|
|
56
|
-
const parsed = JSON.parse(result.content[0].text);
|
|
57
|
-
expect(parsed).toEqual(input);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it("should format JSON with proper indentation", () => {
|
|
61
|
-
const input = { a: 1 };
|
|
62
|
-
const result = makeTextAndStructured(input);
|
|
63
|
-
|
|
64
|
-
expect(result.content[0].text).toContain("\n");
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it("should handle arrays in structured content", () => {
|
|
68
|
-
const input = { items: [1, 2, 3] };
|
|
69
|
-
const result = makeTextAndStructured(input);
|
|
70
|
-
|
|
71
|
-
expect(result.structuredContent.items).toEqual([1, 2, 3]);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it("should handle null and undefined values", () => {
|
|
75
|
-
const input = { nullValue: null, undefinedValue: undefined };
|
|
76
|
-
const result = makeTextAndStructured(input);
|
|
77
|
-
|
|
78
|
-
expect(result.structuredContent.nullValue).toBeNull();
|
|
79
|
-
});
|
|
80
|
-
});
|
package/src/types.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public types for beans-mcp-server
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export type SortMode =
|
|
6
|
-
| "status-priority-type-title"
|
|
7
|
-
| "updated"
|
|
8
|
-
| "created"
|
|
9
|
-
| "id";
|
|
10
|
-
|
|
11
|
-
export type BeanRecord = {
|
|
12
|
-
id: string;
|
|
13
|
-
slug: string;
|
|
14
|
-
path: string;
|
|
15
|
-
title: string;
|
|
16
|
-
body: string;
|
|
17
|
-
status: string;
|
|
18
|
-
type: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
priority?: string;
|
|
21
|
-
tags?: string[];
|
|
22
|
-
parentId?: string;
|
|
23
|
-
blockingIds?: string[];
|
|
24
|
-
blockedByIds?: string[];
|
|
25
|
-
createdAt?: string;
|
|
26
|
-
updatedAt?: string;
|
|
27
|
-
etag?: string;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* GraphQL error shape as returned by the Beans CLI GraphQL endpoint.
|
|
32
|
-
*/
|
|
33
|
-
export type GraphQLError = {
|
|
34
|
-
message: string;
|
|
35
|
-
locations?: Array<{ line: number; column: number }>;
|
|
36
|
-
path?: Array<string | number>;
|
|
37
|
-
extensions?: Record<string, unknown>;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const DEFAULT_MCP_PORT = 39173;
|
|
41
|
-
|
|
42
|
-
export const MAX_ID_LENGTH = 128;
|
|
43
|
-
export const MAX_TITLE_LENGTH = 1024;
|
|
44
|
-
export const MAX_METADATA_LENGTH = 128;
|
|
45
|
-
export const MAX_DESCRIPTION_LENGTH = 65536; // 64KB
|
|
46
|
-
export const MAX_PATH_LENGTH = 1024;
|
package/src/utils.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { isAbsolute, relative, resolve } from 'node:path';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Check whether `target` is contained within `root` after resolving both paths.
|
|
5
|
-
* Guards against the Windows cross-drive bypass where `path.relative(root, target)`
|
|
6
|
-
* returns an absolute path (e.g. `D:\evil`) that does not start with `..`.
|
|
7
|
-
*/
|
|
8
|
-
export function isPathWithinRoot(root: string, target: string): boolean {
|
|
9
|
-
const resolvedRoot = resolve(root);
|
|
10
|
-
const resolvedTarget = resolve(target);
|
|
11
|
-
const rel = relative(resolvedRoot, resolvedTarget);
|
|
12
|
-
return !!rel && !rel.startsWith('..') && !isAbsolute(rel);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function makeTextAndStructured<T extends Record<string, unknown>>(value: T) {
|
|
16
|
-
return {
|
|
17
|
-
content: [{ type: 'text' as const, text: JSON.stringify(value, null, 2) }],
|
|
18
|
-
structuredContent: value,
|
|
19
|
-
};
|
|
20
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"lib": ["ES2022"],
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"outDir": "./dist",
|
|
9
|
-
"rootDir": "./src",
|
|
10
|
-
"moduleResolution": "bundler",
|
|
11
|
-
"resolveJsonModule": true,
|
|
12
|
-
"strict": true,
|
|
13
|
-
"esModuleInterop": true,
|
|
14
|
-
"skipLibCheck": true,
|
|
15
|
-
"forceConsistentCasingInFileNames": true,
|
|
16
|
-
"noUnusedLocals": true,
|
|
17
|
-
"noUnusedParameters": true,
|
|
18
|
-
"noImplicitReturns": true,
|
|
19
|
-
"noFallthroughCasesInSwitch": true,
|
|
20
|
-
"allowSyntheticDefaultImports": true
|
|
21
|
-
},
|
|
22
|
-
"include": ["src/**/*.ts"],
|
|
23
|
-
"exclude": ["src/**/*.test.ts", "dist", "node_modules"]
|
|
24
|
-
}
|
package/tsup.config.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup';
|
|
2
|
-
|
|
3
|
-
export default defineConfig([
|
|
4
|
-
{
|
|
5
|
-
// ESM library entry point
|
|
6
|
-
entry: { index: 'src/index.ts' },
|
|
7
|
-
format: ['esm'],
|
|
8
|
-
outDir: 'dist',
|
|
9
|
-
target: 'node18',
|
|
10
|
-
splitting: false,
|
|
11
|
-
dts: true,
|
|
12
|
-
sourcemap: process.env.NODE_ENV !== 'production',
|
|
13
|
-
clean: true,
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
// CJS library entry point
|
|
17
|
-
entry: { index: 'src/index.ts' },
|
|
18
|
-
format: ['cjs'],
|
|
19
|
-
outDir: 'dist',
|
|
20
|
-
outExtension: () => ({ js: '.cjs' }),
|
|
21
|
-
target: 'node18',
|
|
22
|
-
splitting: false,
|
|
23
|
-
cjsInterop: true,
|
|
24
|
-
dts: false,
|
|
25
|
-
sourcemap: process.env.NODE_ENV !== 'production',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
// CLI binary entry point
|
|
29
|
-
entry: { 'beans-mcp-server': 'src/cli.ts' },
|
|
30
|
-
format: ['cjs'],
|
|
31
|
-
outDir: 'dist',
|
|
32
|
-
outExtension: () => ({ js: '.cjs' }),
|
|
33
|
-
target: 'node18',
|
|
34
|
-
splitting: false,
|
|
35
|
-
cjsInterop: true,
|
|
36
|
-
dts: false,
|
|
37
|
-
sourcemap: process.env.NODE_ENV !== 'production',
|
|
38
|
-
banner: {
|
|
39
|
-
js: '#!/usr/bin/env node',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
]);
|
package/vitest.config.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vitest/config";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
test: {
|
|
5
|
-
globals: false,
|
|
6
|
-
environment: "node",
|
|
7
|
-
coverage: {
|
|
8
|
-
provider: "v8",
|
|
9
|
-
reporter: ["text", "json", "html"],
|
|
10
|
-
exclude: [
|
|
11
|
-
"node_modules/",
|
|
12
|
-
"dist/",
|
|
13
|
-
"src/**/*.test.ts",
|
|
14
|
-
"src/server/backend.ts",
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
});
|