@selfagency/beans-mcp 0.5.0 → 0.6.0
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 +180 -30
- package/beans-mcp-server.cjs +560 -93
- package/index.cjs +562 -93
- package/index.d.ts +55 -2
- package/index.js +562 -94
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Public types for beans-mcp-server
|
|
5
5
|
*/
|
|
6
|
-
type SortMode =
|
|
6
|
+
type SortMode = 'status-priority-type-title' | 'updated' | 'created' | 'id';
|
|
7
7
|
type BeanRecord = {
|
|
8
8
|
id: string;
|
|
9
9
|
slug: string;
|
|
@@ -38,6 +38,7 @@ declare const DEFAULT_MCP_PORT = 39173;
|
|
|
38
38
|
declare const MAX_ID_LENGTH = 128;
|
|
39
39
|
declare const MAX_TITLE_LENGTH = 1024;
|
|
40
40
|
declare const MAX_METADATA_LENGTH = 128;
|
|
41
|
+
declare const MAX_PATH_LENGTH = 1024;
|
|
41
42
|
|
|
42
43
|
declare function sortBeansInternal(beans: BeanRecord[], mode: SortMode): BeanRecord[];
|
|
43
44
|
|
|
@@ -47,6 +48,11 @@ declare function sortBeansInternal(beans: BeanRecord[], mode: SortMode): BeanRec
|
|
|
47
48
|
*/
|
|
48
49
|
interface BackendInterface {
|
|
49
50
|
init(prefix?: string): Promise<Record<string, unknown>>;
|
|
51
|
+
archive?(): Promise<Record<string, unknown>>;
|
|
52
|
+
queryGraphql?(query: string, variables?: Record<string, unknown>): Promise<{
|
|
53
|
+
data: unknown;
|
|
54
|
+
errors?: GraphQLError[];
|
|
55
|
+
}>;
|
|
50
56
|
list(options?: {
|
|
51
57
|
status?: string[];
|
|
52
58
|
type?: string[];
|
|
@@ -134,6 +140,23 @@ interface BackendInterface {
|
|
|
134
140
|
path: string;
|
|
135
141
|
bytes: number;
|
|
136
142
|
}>;
|
|
143
|
+
updateBeanFrontmatter(relativePath: string, updates: {
|
|
144
|
+
title?: string;
|
|
145
|
+
status?: string;
|
|
146
|
+
type?: string;
|
|
147
|
+
priority?: string;
|
|
148
|
+
parent_id?: string | null;
|
|
149
|
+
tags?: string[] | null;
|
|
150
|
+
blocking_ids?: string[] | null;
|
|
151
|
+
blocked_by_ids?: string[] | null;
|
|
152
|
+
pr?: string | null;
|
|
153
|
+
branch?: string | null;
|
|
154
|
+
}): Promise<{
|
|
155
|
+
path: string;
|
|
156
|
+
bytes: number;
|
|
157
|
+
updatedFields: string[];
|
|
158
|
+
frontmatter: Record<string, string | string[]>;
|
|
159
|
+
}>;
|
|
137
160
|
createBeanFile(relativePath: string, content: string, options?: {
|
|
138
161
|
overwrite?: boolean;
|
|
139
162
|
}): Promise<{
|
|
@@ -175,6 +198,11 @@ declare class BeansCliBackend implements BackendInterface {
|
|
|
175
198
|
*/
|
|
176
199
|
private executeGraphQL;
|
|
177
200
|
init(prefix?: string): Promise<Record<string, unknown>>;
|
|
201
|
+
archive(): Promise<Record<string, unknown>>;
|
|
202
|
+
queryGraphql(query: string, variables?: Record<string, unknown>): Promise<{
|
|
203
|
+
data: unknown;
|
|
204
|
+
errors?: GraphQLError[];
|
|
205
|
+
}>;
|
|
178
206
|
list(options?: {
|
|
179
207
|
status?: string[];
|
|
180
208
|
type?: string[];
|
|
@@ -263,6 +291,14 @@ declare class BeansCliBackend implements BackendInterface {
|
|
|
263
291
|
private isYamlBlockScalarIndicator;
|
|
264
292
|
/** Escape a plain string for use inside a YAML double-quoted scalar. */
|
|
265
293
|
private escapeForYamlDoubleQuoted;
|
|
294
|
+
private shouldQuoteFrontmatterValue;
|
|
295
|
+
private parseFrontmatterLine;
|
|
296
|
+
private buildFrontmatterIndex;
|
|
297
|
+
private serializeFrontmatterValue;
|
|
298
|
+
private deserializeFrontmatterValue;
|
|
299
|
+
private splitFrontmatterDocument;
|
|
300
|
+
private parseFrontmatterFields;
|
|
301
|
+
private writeFileAtomically;
|
|
266
302
|
/**
|
|
267
303
|
* Normalise a raw YAML title value to a double-quoted scalar.
|
|
268
304
|
* Handles: empty, already double-quoted, single-quoted (unescaping `''`),
|
|
@@ -283,6 +319,23 @@ declare class BeansCliBackend implements BackendInterface {
|
|
|
283
319
|
path: string;
|
|
284
320
|
bytes: number;
|
|
285
321
|
}>;
|
|
322
|
+
updateBeanFrontmatter(relativePath: string, updates: {
|
|
323
|
+
title?: string;
|
|
324
|
+
status?: string;
|
|
325
|
+
type?: string;
|
|
326
|
+
priority?: string;
|
|
327
|
+
parent_id?: string | null;
|
|
328
|
+
tags?: string[] | null;
|
|
329
|
+
blocking_ids?: string[] | null;
|
|
330
|
+
blocked_by_ids?: string[] | null;
|
|
331
|
+
pr?: string | null;
|
|
332
|
+
branch?: string | null;
|
|
333
|
+
}): Promise<{
|
|
334
|
+
path: string;
|
|
335
|
+
bytes: number;
|
|
336
|
+
updatedFields: string[];
|
|
337
|
+
frontmatter: Record<string, string | string[]>;
|
|
338
|
+
}>;
|
|
286
339
|
createBeanFile(relativePath: string, content: string, options?: {
|
|
287
340
|
overwrite?: boolean;
|
|
288
341
|
}): Promise<{
|
|
@@ -334,4 +387,4 @@ declare function makeTextAndStructured<T extends Record<string, unknown>>(value:
|
|
|
334
387
|
}[];
|
|
335
388
|
};
|
|
336
389
|
|
|
337
|
-
export { type BackendInterface, type BeanRecord, BeansCliBackend, DEFAULT_MCP_PORT, type GraphQLError, MAX_ID_LENGTH, MAX_METADATA_LENGTH, MAX_TITLE_LENGTH, type SortMode, createBeansMcpServer, isPathWithinRoot, makeTextAndStructured, parseCliArgs, sortBeansInternal as sortBeans, startBeansMcpServer };
|
|
390
|
+
export { type BackendInterface, type BeanRecord, BeansCliBackend, DEFAULT_MCP_PORT, type GraphQLError, MAX_ID_LENGTH, MAX_METADATA_LENGTH, MAX_PATH_LENGTH, MAX_TITLE_LENGTH, type SortMode, createBeansMcpServer, isPathWithinRoot, makeTextAndStructured, parseCliArgs, sortBeansInternal as sortBeans, startBeansMcpServer };
|