@sudosandwich/limps 0.2.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/LICENSE +21 -0
- package/README.md +190 -0
- package/dist/agent-parser.d.ts +146 -0
- package/dist/agent-parser.d.ts.map +1 -0
- package/dist/agent-parser.js +448 -0
- package/dist/agent-parser.js.map +1 -0
- package/dist/config.d.ts +54 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +146 -0
- package/dist/config.js.map +1 -0
- package/dist/coordination.d.ts +102 -0
- package/dist/coordination.d.ts.map +1 -0
- package/dist/coordination.js +157 -0
- package/dist/coordination.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +256 -0
- package/dist/index.js.map +1 -0
- package/dist/indexer.d.ts +83 -0
- package/dist/indexer.d.ts.map +1 -0
- package/dist/indexer.js +467 -0
- package/dist/indexer.js.map +1 -0
- package/dist/resources/agents-status.d.ts +32 -0
- package/dist/resources/agents-status.d.ts.map +1 -0
- package/dist/resources/agents-status.js +73 -0
- package/dist/resources/agents-status.js.map +1 -0
- package/dist/resources/decisions-log.d.ts +21 -0
- package/dist/resources/decisions-log.d.ts.map +1 -0
- package/dist/resources/decisions-log.js +146 -0
- package/dist/resources/decisions-log.js.map +1 -0
- package/dist/resources/index.d.ts +10 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +74 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/plans-full.d.ts +11 -0
- package/dist/resources/plans-full.d.ts.map +1 -0
- package/dist/resources/plans-full.js +71 -0
- package/dist/resources/plans-full.js.map +1 -0
- package/dist/resources/plans-index.d.ts +30 -0
- package/dist/resources/plans-index.d.ts.map +1 -0
- package/dist/resources/plans-index.js +177 -0
- package/dist/resources/plans-index.js.map +1 -0
- package/dist/resources/plans-summary.d.ts +33 -0
- package/dist/resources/plans-summary.d.ts.map +1 -0
- package/dist/resources/plans-summary.js +238 -0
- package/dist/resources/plans-summary.js.map +1 -0
- package/dist/rlm/extractors.d.ts +39 -0
- package/dist/rlm/extractors.d.ts.map +1 -0
- package/dist/rlm/extractors.js +291 -0
- package/dist/rlm/extractors.js.map +1 -0
- package/dist/rlm/helpers-inject.d.ts +13 -0
- package/dist/rlm/helpers-inject.d.ts.map +1 -0
- package/dist/rlm/helpers-inject.js +586 -0
- package/dist/rlm/helpers-inject.js.map +1 -0
- package/dist/rlm/helpers.d.ts +124 -0
- package/dist/rlm/helpers.d.ts.map +1 -0
- package/dist/rlm/helpers.js +381 -0
- package/dist/rlm/helpers.js.map +1 -0
- package/dist/rlm/index.d.ts +12 -0
- package/dist/rlm/index.d.ts.map +1 -0
- package/dist/rlm/index.js +19 -0
- package/dist/rlm/index.js.map +1 -0
- package/dist/rlm/parallel.d.ts +45 -0
- package/dist/rlm/parallel.d.ts.map +1 -0
- package/dist/rlm/parallel.js +76 -0
- package/dist/rlm/parallel.js.map +1 -0
- package/dist/rlm/recursion.d.ts +96 -0
- package/dist/rlm/recursion.d.ts.map +1 -0
- package/dist/rlm/recursion.js +113 -0
- package/dist/rlm/recursion.js.map +1 -0
- package/dist/rlm/sampling.d.ts +100 -0
- package/dist/rlm/sampling.d.ts.map +1 -0
- package/dist/rlm/sampling.js +96 -0
- package/dist/rlm/sampling.js.map +1 -0
- package/dist/rlm/sandbox.d.ts +73 -0
- package/dist/rlm/sandbox.d.ts.map +1 -0
- package/dist/rlm/sandbox.js +160 -0
- package/dist/rlm/sandbox.js.map +1 -0
- package/dist/rlm/security.d.ts +28 -0
- package/dist/rlm/security.d.ts.map +1 -0
- package/dist/rlm/security.js +154 -0
- package/dist/rlm/security.js.map +1 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +107 -0
- package/dist/server.js.map +1 -0
- package/dist/task-parser.d.ts +47 -0
- package/dist/task-parser.d.ts.map +1 -0
- package/dist/task-parser.js +112 -0
- package/dist/task-parser.js.map +1 -0
- package/dist/test-setup.d.ts +6 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +37 -0
- package/dist/test-setup.js.map +1 -0
- package/dist/tools/claim-task.d.ts +28 -0
- package/dist/tools/claim-task.d.ts.map +1 -0
- package/dist/tools/claim-task.js +288 -0
- package/dist/tools/claim-task.js.map +1 -0
- package/dist/tools/create-doc.d.ts +47 -0
- package/dist/tools/create-doc.d.ts.map +1 -0
- package/dist/tools/create-doc.js +137 -0
- package/dist/tools/create-doc.js.map +1 -0
- package/dist/tools/create-plan.d.ts +25 -0
- package/dist/tools/create-plan.d.ts.map +1 -0
- package/dist/tools/create-plan.js +179 -0
- package/dist/tools/create-plan.js.map +1 -0
- package/dist/tools/delete-doc.d.ts +51 -0
- package/dist/tools/delete-doc.d.ts.map +1 -0
- package/dist/tools/delete-doc.js +194 -0
- package/dist/tools/delete-doc.js.map +1 -0
- package/dist/tools/get-next-task.d.ts +49 -0
- package/dist/tools/get-next-task.d.ts.map +1 -0
- package/dist/tools/get-next-task.js +204 -0
- package/dist/tools/get-next-task.js.map +1 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +122 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/list-docs.d.ts +53 -0
- package/dist/tools/list-docs.d.ts.map +1 -0
- package/dist/tools/list-docs.js +236 -0
- package/dist/tools/list-docs.js.map +1 -0
- package/dist/tools/open-document-in-cursor.d.ts +62 -0
- package/dist/tools/open-document-in-cursor.d.ts.map +1 -0
- package/dist/tools/open-document-in-cursor.js +211 -0
- package/dist/tools/open-document-in-cursor.js.map +1 -0
- package/dist/tools/read-doc.d.ts +44 -0
- package/dist/tools/read-doc.d.ts.map +1 -0
- package/dist/tools/read-doc.js +174 -0
- package/dist/tools/read-doc.js.map +1 -0
- package/dist/tools/release-task.d.ts +28 -0
- package/dist/tools/release-task.d.ts.map +1 -0
- package/dist/tools/release-task.js +154 -0
- package/dist/tools/release-task.js.map +1 -0
- package/dist/tools/rlm-multi-query.d.ts +110 -0
- package/dist/tools/rlm-multi-query.d.ts.map +1 -0
- package/dist/tools/rlm-multi-query.js +348 -0
- package/dist/tools/rlm-multi-query.js.map +1 -0
- package/dist/tools/rlm-query.d.ts +56 -0
- package/dist/tools/rlm-query.d.ts.map +1 -0
- package/dist/tools/rlm-query.js +228 -0
- package/dist/tools/rlm-query.js.map +1 -0
- package/dist/tools/search-docs.d.ts +34 -0
- package/dist/tools/search-docs.d.ts.map +1 -0
- package/dist/tools/search-docs.js +292 -0
- package/dist/tools/search-docs.js.map +1 -0
- package/dist/tools/update-doc.d.ts +149 -0
- package/dist/tools/update-doc.d.ts.map +1 -0
- package/dist/tools/update-doc.js +195 -0
- package/dist/tools/update-doc.js.map +1 -0
- package/dist/tools/update-task-status.d.ts +31 -0
- package/dist/tools/update-task-status.d.ts.map +1 -0
- package/dist/tools/update-task-status.js +303 -0
- package/dist/tools/update-task-status.js.map +1 -0
- package/dist/types.d.ts +50 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/backup.d.ts +76 -0
- package/dist/utils/backup.d.ts.map +1 -0
- package/dist/utils/backup.js +172 -0
- package/dist/utils/backup.js.map +1 -0
- package/dist/utils/errors.d.ts +93 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +125 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/os-paths.d.ts +45 -0
- package/dist/utils/os-paths.d.ts.map +1 -0
- package/dist/utils/os-paths.js +81 -0
- package/dist/utils/os-paths.js.map +1 -0
- package/dist/utils/paths.d.ts +71 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +165 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/watcher.d.ts +19 -0
- package/dist/watcher.d.ts.map +1 -0
- package/dist/watcher.js +109 -0
- package/dist/watcher.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-task-status.js","sourceRoot":"","sources":["../../src/tools/update-task-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEjD,OAAO,EACL,gBAAgB,EAChB,iBAAiB,GAGlB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGxF;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACjD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,iBAAiB,GAA6B;IAClD,GAAG,EAAE,CAAC,KAAK,CAAC;IACZ,GAAG,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;IACxB,IAAI,EAAE,EAAE,EAAE,iBAAiB;IAC3B,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,mBAAmB;CAC7C,CAAC;AAEF;;GAEG;AACH,SAAS,iBAAiB,CAAC,IAAY,EAAE,EAAU;IACjD,MAAM,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;I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AM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;IACH,CAAC;IAED,oBAAoB;IACpB,MAAM,aAAa,CAAC,OAAO,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IAE9C,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ,MAAM,sBAAsB,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,aAAa,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;aAC9H;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Database as DatabaseType } from 'better-sqlite3';
|
|
2
|
+
import type { CoordinationState } from './coordination.js';
|
|
3
|
+
import type { ServerConfig } from './config.js';
|
|
4
|
+
/**
|
|
5
|
+
* Context passed to tool handlers.
|
|
6
|
+
*/
|
|
7
|
+
export interface ToolContext {
|
|
8
|
+
db: DatabaseType;
|
|
9
|
+
coordination: CoordinationState;
|
|
10
|
+
config: ServerConfig;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Context passed to resource handlers.
|
|
14
|
+
*/
|
|
15
|
+
export interface ResourceContext {
|
|
16
|
+
db: DatabaseType;
|
|
17
|
+
coordination: CoordinationState;
|
|
18
|
+
config: ServerConfig;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Result returned by tool handlers.
|
|
22
|
+
* Matches MCP SDK tool result format.
|
|
23
|
+
* Index signature required for MCP SDK compatibility.
|
|
24
|
+
*/
|
|
25
|
+
export interface ToolResult {
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
content: {
|
|
28
|
+
type: 'text';
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
isError?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Result returned by resource handlers.
|
|
35
|
+
* Matches MCP SDK resource result format.
|
|
36
|
+
*/
|
|
37
|
+
export interface ResourceResult {
|
|
38
|
+
contents: ({
|
|
39
|
+
uri: string;
|
|
40
|
+
mimeType?: string;
|
|
41
|
+
text: string;
|
|
42
|
+
blob?: never;
|
|
43
|
+
} | {
|
|
44
|
+
uri: string;
|
|
45
|
+
mimeType?: string;
|
|
46
|
+
blob: string;
|
|
47
|
+
text?: never;
|
|
48
|
+
})[];
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,YAAY,CAAC;IACjB,YAAY,EAAE,iBAAiB,CAAC;IAChC,MAAM,EAAE,YAAY,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,YAAY,CAAC;IACjB,YAAY,EAAE,iBAAiB,CAAC;IAChC,MAAM,EAAE,YAAY,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACJ,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,CACN;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,KAAK,CAAC;KACd,GACD;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,KAAK,CAAC;KACd,CACJ,EAAE,CAAC;CACL"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backup utilities for MCP document CRUD operations.
|
|
3
|
+
* Creates timestamped backups before destructive operations and handles pruning.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Backup directory name (relative to repo root).
|
|
7
|
+
*/
|
|
8
|
+
export declare const BACKUP_DIR = ".backups";
|
|
9
|
+
/**
|
|
10
|
+
* Result of a backup operation.
|
|
11
|
+
*/
|
|
12
|
+
export interface BackupResult {
|
|
13
|
+
/** Original file path */
|
|
14
|
+
path: string;
|
|
15
|
+
/** Path to the backup file */
|
|
16
|
+
backupPath: string;
|
|
17
|
+
/** ISO timestamp of the backup */
|
|
18
|
+
timestamp: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Options for backup operations.
|
|
22
|
+
*/
|
|
23
|
+
export interface BackupOptions {
|
|
24
|
+
/** Number of days to retain backups (default: 7) */
|
|
25
|
+
retentionDays?: number;
|
|
26
|
+
/** Minimum backups to keep regardless of age (default: 3) */
|
|
27
|
+
minBackups?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Format a date for use in backup/trash filenames.
|
|
31
|
+
* Uses ISO format with colons replaced by dashes for Windows compatibility.
|
|
32
|
+
*
|
|
33
|
+
* @param date - Date to format
|
|
34
|
+
* @returns Formatted timestamp string (e.g., "2026-01-20T12-30-45")
|
|
35
|
+
* @example
|
|
36
|
+
* formatTimestamp(new Date('2026-01-20T12:30:45Z'));
|
|
37
|
+
* // Returns: "2026-01-20T12-30-45"
|
|
38
|
+
*/
|
|
39
|
+
export declare function formatTimestamp(date: Date): string;
|
|
40
|
+
/**
|
|
41
|
+
* Get the backup path for a file.
|
|
42
|
+
*
|
|
43
|
+
* @param filePath - Absolute path to the original file
|
|
44
|
+
* @param repoRoot - Absolute path to repository root
|
|
45
|
+
* @param timestamp - Optional timestamp (defaults to now)
|
|
46
|
+
* @returns Absolute path for the backup file
|
|
47
|
+
*/
|
|
48
|
+
export declare function getBackupPath(filePath: string, repoRoot: string, timestamp?: Date): string;
|
|
49
|
+
/**
|
|
50
|
+
* Create a backup of a file.
|
|
51
|
+
*
|
|
52
|
+
* @param filePath - Absolute path to the file to backup
|
|
53
|
+
* @param repoRoot - Absolute path to repository root
|
|
54
|
+
* @returns Backup result with paths and timestamp
|
|
55
|
+
* @throws DocumentError if file doesn't exist
|
|
56
|
+
*/
|
|
57
|
+
export declare function createBackup(filePath: string, repoRoot: string): Promise<BackupResult>;
|
|
58
|
+
/**
|
|
59
|
+
* List all backups for a file, sorted by timestamp (newest first).
|
|
60
|
+
*
|
|
61
|
+
* @param filePath - Absolute path to the original file
|
|
62
|
+
* @param repoRoot - Absolute path to repository root
|
|
63
|
+
* @returns Array of backup results
|
|
64
|
+
*/
|
|
65
|
+
export declare function listBackups(filePath: string, repoRoot: string): Promise<BackupResult[]>;
|
|
66
|
+
/**
|
|
67
|
+
* Prune old backups for a file.
|
|
68
|
+
* Keeps backups newer than retention period OR minimum count, whichever keeps more.
|
|
69
|
+
*
|
|
70
|
+
* @param filePath - Absolute path to the original file
|
|
71
|
+
* @param repoRoot - Absolute path to repository root
|
|
72
|
+
* @param options - Pruning options
|
|
73
|
+
* @returns Number of backups pruned
|
|
74
|
+
*/
|
|
75
|
+
export declare function pruneBackups(filePath: string, repoRoot: string, options?: BackupOptions): Promise<number>;
|
|
76
|
+
//# sourceMappingURL=backup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backup.d.ts","sourceRoot":"","sources":["../../src/utils/backup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;GAEG;AACH,eAAO,MAAM,UAAU,aAAa,CAAC;AAYrC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAMlD;AAoBD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,IAAiB,GAC3B,MAAM,CASR;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAqB5F;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAkC7F;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAsCjB"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backup utilities for MCP document CRUD operations.
|
|
3
|
+
* Creates timestamped backups before destructive operations and handles pruning.
|
|
4
|
+
*/
|
|
5
|
+
import { copyFile, mkdir, readdir, unlink } from 'fs/promises';
|
|
6
|
+
import { existsSync } from 'fs';
|
|
7
|
+
import { join, dirname, basename, relative } from 'path';
|
|
8
|
+
import { notFound } from './errors.js';
|
|
9
|
+
/**
|
|
10
|
+
* Backup directory name (relative to repo root).
|
|
11
|
+
*/
|
|
12
|
+
export const BACKUP_DIR = '.backups';
|
|
13
|
+
/**
|
|
14
|
+
* Default backup retention: 7 days.
|
|
15
|
+
*/
|
|
16
|
+
const DEFAULT_RETENTION_DAYS = 7;
|
|
17
|
+
/**
|
|
18
|
+
* Minimum backups to keep regardless of age.
|
|
19
|
+
*/
|
|
20
|
+
const DEFAULT_MIN_BACKUPS = 3;
|
|
21
|
+
/**
|
|
22
|
+
* Format a date for use in backup/trash filenames.
|
|
23
|
+
* Uses ISO format with colons replaced by dashes for Windows compatibility.
|
|
24
|
+
*
|
|
25
|
+
* @param date - Date to format
|
|
26
|
+
* @returns Formatted timestamp string (e.g., "2026-01-20T12-30-45")
|
|
27
|
+
* @example
|
|
28
|
+
* formatTimestamp(new Date('2026-01-20T12:30:45Z'));
|
|
29
|
+
* // Returns: "2026-01-20T12-30-45"
|
|
30
|
+
*/
|
|
31
|
+
export function formatTimestamp(date) {
|
|
32
|
+
// Format: 2026-01-20T12-30-45
|
|
33
|
+
return date
|
|
34
|
+
.toISOString()
|
|
35
|
+
.replace(/:/g, '-')
|
|
36
|
+
.replace(/\.\d{3}Z$/, '');
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Parse a timestamp from a backup filename.
|
|
40
|
+
*/
|
|
41
|
+
function parseTimestamp(filename) {
|
|
42
|
+
// Match: filename.YYYY-MM-DDTHH-MM-SS.bak
|
|
43
|
+
const match = filename.match(/\.(\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2})\.bak$/);
|
|
44
|
+
if (!match)
|
|
45
|
+
return null;
|
|
46
|
+
// Convert back to ISO format
|
|
47
|
+
const isoString = match[1].replace(/-/g, (char, index) => {
|
|
48
|
+
// Keep dashes for date part (indices 4, 7), replace with colons for time (indices 13, 16)
|
|
49
|
+
return index > 9 ? ':' : char;
|
|
50
|
+
}) + 'Z';
|
|
51
|
+
return new Date(isoString);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get the backup path for a file.
|
|
55
|
+
*
|
|
56
|
+
* @param filePath - Absolute path to the original file
|
|
57
|
+
* @param repoRoot - Absolute path to repository root
|
|
58
|
+
* @param timestamp - Optional timestamp (defaults to now)
|
|
59
|
+
* @returns Absolute path for the backup file
|
|
60
|
+
*/
|
|
61
|
+
export function getBackupPath(filePath, repoRoot, timestamp = new Date()) {
|
|
62
|
+
// Get relative path from repo root
|
|
63
|
+
const relativePath = relative(repoRoot, filePath);
|
|
64
|
+
// Build backup path: .backups/{relative-path}.{timestamp}.bak
|
|
65
|
+
const backupFilename = `${basename(relativePath)}.${formatTimestamp(timestamp)}.bak`;
|
|
66
|
+
const backupDir = join(repoRoot, BACKUP_DIR, dirname(relativePath));
|
|
67
|
+
return join(backupDir, backupFilename);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Create a backup of a file.
|
|
71
|
+
*
|
|
72
|
+
* @param filePath - Absolute path to the file to backup
|
|
73
|
+
* @param repoRoot - Absolute path to repository root
|
|
74
|
+
* @returns Backup result with paths and timestamp
|
|
75
|
+
* @throws DocumentError if file doesn't exist
|
|
76
|
+
*/
|
|
77
|
+
export async function createBackup(filePath, repoRoot) {
|
|
78
|
+
// Verify file exists
|
|
79
|
+
if (!existsSync(filePath)) {
|
|
80
|
+
throw notFound(relative(repoRoot, filePath));
|
|
81
|
+
}
|
|
82
|
+
const timestamp = new Date();
|
|
83
|
+
const backupPath = getBackupPath(filePath, repoRoot, timestamp);
|
|
84
|
+
// Ensure backup directory exists
|
|
85
|
+
const backupDir = dirname(backupPath);
|
|
86
|
+
await mkdir(backupDir, { recursive: true });
|
|
87
|
+
// Copy file to backup location
|
|
88
|
+
await copyFile(filePath, backupPath);
|
|
89
|
+
return {
|
|
90
|
+
path: filePath,
|
|
91
|
+
backupPath,
|
|
92
|
+
timestamp: formatTimestamp(timestamp),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* List all backups for a file, sorted by timestamp (newest first).
|
|
97
|
+
*
|
|
98
|
+
* @param filePath - Absolute path to the original file
|
|
99
|
+
* @param repoRoot - Absolute path to repository root
|
|
100
|
+
* @returns Array of backup results
|
|
101
|
+
*/
|
|
102
|
+
export async function listBackups(filePath, repoRoot) {
|
|
103
|
+
const relativePath = relative(repoRoot, filePath);
|
|
104
|
+
const backupDir = join(repoRoot, BACKUP_DIR, dirname(relativePath));
|
|
105
|
+
// If backup directory doesn't exist, no backups
|
|
106
|
+
if (!existsSync(backupDir)) {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
const filename = basename(relativePath);
|
|
110
|
+
const backupPrefix = `${filename}.`;
|
|
111
|
+
const backupSuffix = '.bak';
|
|
112
|
+
// Find all backups for this file
|
|
113
|
+
const entries = await readdir(backupDir);
|
|
114
|
+
const backups = [];
|
|
115
|
+
for (const entry of entries) {
|
|
116
|
+
if (entry.startsWith(backupPrefix) && entry.endsWith(backupSuffix)) {
|
|
117
|
+
const timestamp = parseTimestamp(entry);
|
|
118
|
+
if (timestamp) {
|
|
119
|
+
backups.push({
|
|
120
|
+
path: filePath,
|
|
121
|
+
backupPath: join(backupDir, entry),
|
|
122
|
+
timestamp: formatTimestamp(timestamp),
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// Sort by timestamp, newest first
|
|
128
|
+
backups.sort((a, b) => b.timestamp.localeCompare(a.timestamp));
|
|
129
|
+
return backups;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Prune old backups for a file.
|
|
133
|
+
* Keeps backups newer than retention period OR minimum count, whichever keeps more.
|
|
134
|
+
*
|
|
135
|
+
* @param filePath - Absolute path to the original file
|
|
136
|
+
* @param repoRoot - Absolute path to repository root
|
|
137
|
+
* @param options - Pruning options
|
|
138
|
+
* @returns Number of backups pruned
|
|
139
|
+
*/
|
|
140
|
+
export async function pruneBackups(filePath, repoRoot, options = {}) {
|
|
141
|
+
const retentionDays = options.retentionDays ?? DEFAULT_RETENTION_DAYS;
|
|
142
|
+
const minBackups = options.minBackups ?? DEFAULT_MIN_BACKUPS;
|
|
143
|
+
const backups = await listBackups(filePath, repoRoot);
|
|
144
|
+
if (backups.length <= minBackups) {
|
|
145
|
+
return 0;
|
|
146
|
+
}
|
|
147
|
+
const cutoffDate = new Date();
|
|
148
|
+
cutoffDate.setDate(cutoffDate.getDate() - retentionDays);
|
|
149
|
+
const cutoffTimestamp = formatTimestamp(cutoffDate);
|
|
150
|
+
let prunedCount = 0;
|
|
151
|
+
// Process backups from oldest to newest (reverse of the sorted list)
|
|
152
|
+
// But keep at least minBackups
|
|
153
|
+
for (let i = backups.length - 1; i >= 0; i--) {
|
|
154
|
+
// Always keep minimum backups
|
|
155
|
+
if (backups.length - prunedCount <= minBackups) {
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
const backup = backups[i];
|
|
159
|
+
// Only prune if older than retention period
|
|
160
|
+
if (backup.timestamp < cutoffTimestamp) {
|
|
161
|
+
try {
|
|
162
|
+
await unlink(backup.backupPath);
|
|
163
|
+
prunedCount++;
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
// Ignore errors (file may already be deleted)
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return prunedCount;
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=backup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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error types with codes, suggestions, and JSON serialization.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Error codes for document operations.
|
|
7
|
+
*/
|
|
8
|
+
export type ErrorCode = 'NOT_FOUND' | 'ALREADY_EXISTS' | 'PERMISSION_DENIED' | 'VALIDATION_ERROR' | 'RESTRICTED_PATH' | 'INTERNAL_ERROR';
|
|
9
|
+
/**
|
|
10
|
+
* MCP-compatible error shape for JSON responses.
|
|
11
|
+
*/
|
|
12
|
+
export interface MCPError {
|
|
13
|
+
code: ErrorCode;
|
|
14
|
+
message: string;
|
|
15
|
+
path?: string;
|
|
16
|
+
suggestion?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Custom error class for document operations.
|
|
20
|
+
* Extends Error with code, path, suggestion, and JSON serialization.
|
|
21
|
+
*/
|
|
22
|
+
export declare class DocumentError extends Error {
|
|
23
|
+
readonly code: ErrorCode;
|
|
24
|
+
readonly path?: string;
|
|
25
|
+
readonly suggestion?: string;
|
|
26
|
+
constructor(code: ErrorCode, message: string, path?: string, suggestion?: string);
|
|
27
|
+
/**
|
|
28
|
+
* Convert to MCP-compatible JSON shape.
|
|
29
|
+
*/
|
|
30
|
+
toJSON(): MCPError;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Factory: File not found error.
|
|
34
|
+
*
|
|
35
|
+
* @param path - Path to the file that was not found
|
|
36
|
+
* @returns DocumentError with NOT_FOUND code
|
|
37
|
+
* @example
|
|
38
|
+
* throw notFound('research/missing.md');
|
|
39
|
+
* // DocumentError: File not found: research/missing.md
|
|
40
|
+
*/
|
|
41
|
+
export declare function notFound(path: string): DocumentError;
|
|
42
|
+
/**
|
|
43
|
+
* Factory: File already exists error.
|
|
44
|
+
*
|
|
45
|
+
* @param path - Path to the file that already exists
|
|
46
|
+
* @returns DocumentError with ALREADY_EXISTS code
|
|
47
|
+
* @example
|
|
48
|
+
* throw alreadyExists('addendums/001-existing.md');
|
|
49
|
+
* // DocumentError: File already exists: addendums/001-existing.md
|
|
50
|
+
*/
|
|
51
|
+
export declare function alreadyExists(path: string): DocumentError;
|
|
52
|
+
/**
|
|
53
|
+
* Factory: Permission denied error.
|
|
54
|
+
*
|
|
55
|
+
* @param path - Path to the file
|
|
56
|
+
* @param reason - Reason for the permission denial
|
|
57
|
+
* @returns DocumentError with PERMISSION_DENIED code
|
|
58
|
+
* @example
|
|
59
|
+
* throw permissionDenied('config.json', 'File is read-only');
|
|
60
|
+
* // DocumentError: Permission denied for config.json: File is read-only
|
|
61
|
+
*/
|
|
62
|
+
export declare function permissionDenied(path: string, reason: string): DocumentError;
|
|
63
|
+
/**
|
|
64
|
+
* Factory: Restricted path error.
|
|
65
|
+
*
|
|
66
|
+
* @param path - Path that is restricted
|
|
67
|
+
* @returns DocumentError with RESTRICTED_PATH code
|
|
68
|
+
* @example
|
|
69
|
+
* throw restrictedPath('.git/config');
|
|
70
|
+
* // DocumentError: Cannot access restricted path: .git/config
|
|
71
|
+
*/
|
|
72
|
+
export declare function restrictedPath(path: string): DocumentError;
|
|
73
|
+
/**
|
|
74
|
+
* Factory: Validation error.
|
|
75
|
+
*
|
|
76
|
+
* @param field - Name of the field that failed validation
|
|
77
|
+
* @param message - Description of the validation failure
|
|
78
|
+
* @returns DocumentError with VALIDATION_ERROR code
|
|
79
|
+
* @example
|
|
80
|
+
* throw validationError('path', 'must be relative to repo root');
|
|
81
|
+
* // DocumentError: Validation failed for 'path': must be relative to repo root
|
|
82
|
+
*/
|
|
83
|
+
export declare function validationError(field: string, message: string): DocumentError;
|
|
84
|
+
/**
|
|
85
|
+
* Error thrown when recursion depth limit is exceeded.
|
|
86
|
+
* Used by RLM sub-call processing.
|
|
87
|
+
*/
|
|
88
|
+
export declare class DepthLimitError extends Error {
|
|
89
|
+
readonly maxDepth: number;
|
|
90
|
+
readonly currentDepth: number;
|
|
91
|
+
constructor(maxDepth: number, currentDepth: number);
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=errors.d.ts.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;GAGG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;gBAElB,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;CAcnD"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error handling utilities for MCP document CRUD operations.
|
|
3
|
+
* Provides consistent error types with codes, suggestions, and JSON serialization.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Custom error class for document operations.
|
|
7
|
+
* Extends Error with code, path, suggestion, and JSON serialization.
|
|
8
|
+
*/
|
|
9
|
+
export class DocumentError extends Error {
|
|
10
|
+
code;
|
|
11
|
+
path;
|
|
12
|
+
suggestion;
|
|
13
|
+
constructor(code, message, path, suggestion) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = 'DocumentError';
|
|
16
|
+
this.code = code;
|
|
17
|
+
this.path = path;
|
|
18
|
+
this.suggestion = suggestion;
|
|
19
|
+
// Ensure proper prototype chain for instanceof checks
|
|
20
|
+
Object.setPrototypeOf(this, DocumentError.prototype);
|
|
21
|
+
// Capture stack trace (V8 engines)
|
|
22
|
+
if (Error.captureStackTrace) {
|
|
23
|
+
Error.captureStackTrace(this, DocumentError);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Convert to MCP-compatible JSON shape.
|
|
28
|
+
*/
|
|
29
|
+
toJSON() {
|
|
30
|
+
const result = {
|
|
31
|
+
code: this.code,
|
|
32
|
+
message: this.message,
|
|
33
|
+
};
|
|
34
|
+
if (this.path !== undefined) {
|
|
35
|
+
result.path = this.path;
|
|
36
|
+
}
|
|
37
|
+
if (this.suggestion !== undefined) {
|
|
38
|
+
result.suggestion = this.suggestion;
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Factory: File not found error.
|
|
45
|
+
*
|
|
46
|
+
* @param path - Path to the file that was not found
|
|
47
|
+
* @returns DocumentError with NOT_FOUND code
|
|
48
|
+
* @example
|
|
49
|
+
* throw notFound('research/missing.md');
|
|
50
|
+
* // DocumentError: File not found: research/missing.md
|
|
51
|
+
*/
|
|
52
|
+
export function notFound(path) {
|
|
53
|
+
return new DocumentError('NOT_FOUND', `File not found: ${path}`, path, 'Use create_doc to create a new file, or check that the path is correct.');
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Factory: File already exists error.
|
|
57
|
+
*
|
|
58
|
+
* @param path - Path to the file that already exists
|
|
59
|
+
* @returns DocumentError with ALREADY_EXISTS code
|
|
60
|
+
* @example
|
|
61
|
+
* throw alreadyExists('addendums/001-existing.md');
|
|
62
|
+
* // DocumentError: File already exists: addendums/001-existing.md
|
|
63
|
+
*/
|
|
64
|
+
export function alreadyExists(path) {
|
|
65
|
+
return new DocumentError('ALREADY_EXISTS', `File already exists: ${path}`, path, 'Use update_doc to modify existing files.');
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Factory: Permission denied error.
|
|
69
|
+
*
|
|
70
|
+
* @param path - Path to the file
|
|
71
|
+
* @param reason - Reason for the permission denial
|
|
72
|
+
* @returns DocumentError with PERMISSION_DENIED code
|
|
73
|
+
* @example
|
|
74
|
+
* throw permissionDenied('config.json', 'File is read-only');
|
|
75
|
+
* // DocumentError: Permission denied for config.json: File is read-only
|
|
76
|
+
*/
|
|
77
|
+
export function permissionDenied(path, reason) {
|
|
78
|
+
return new DocumentError('PERMISSION_DENIED', `Permission denied for ${path}: ${reason}`, path, 'Check file permissions or ensure the file is not locked.');
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Factory: Restricted path error.
|
|
82
|
+
*
|
|
83
|
+
* @param path - Path that is restricted
|
|
84
|
+
* @returns DocumentError with RESTRICTED_PATH code
|
|
85
|
+
* @example
|
|
86
|
+
* throw restrictedPath('.git/config');
|
|
87
|
+
* // DocumentError: Cannot access restricted path: .git/config
|
|
88
|
+
*/
|
|
89
|
+
export function restrictedPath(path) {
|
|
90
|
+
return new DocumentError('RESTRICTED_PATH', `Cannot access restricted path: ${path}`, path, 'Writable directories: addendums/, examples/, research/, and root *.md files.');
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Factory: Validation error.
|
|
94
|
+
*
|
|
95
|
+
* @param field - Name of the field that failed validation
|
|
96
|
+
* @param message - Description of the validation failure
|
|
97
|
+
* @returns DocumentError with VALIDATION_ERROR code
|
|
98
|
+
* @example
|
|
99
|
+
* throw validationError('path', 'must be relative to repo root');
|
|
100
|
+
* // DocumentError: Validation failed for 'path': must be relative to repo root
|
|
101
|
+
*/
|
|
102
|
+
export function validationError(field, message) {
|
|
103
|
+
return new DocumentError('VALIDATION_ERROR', `Validation failed for '${field}': ${message}`);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Error thrown when recursion depth limit is exceeded.
|
|
107
|
+
* Used by RLM sub-call processing.
|
|
108
|
+
*/
|
|
109
|
+
export class DepthLimitError extends Error {
|
|
110
|
+
maxDepth;
|
|
111
|
+
currentDepth;
|
|
112
|
+
constructor(maxDepth, currentDepth) {
|
|
113
|
+
super(`Max recursion depth exceeded: ${currentDepth} > ${maxDepth}`);
|
|
114
|
+
this.name = 'DepthLimitError';
|
|
115
|
+
this.maxDepth = maxDepth;
|
|
116
|
+
this.currentDepth = currentDepth;
|
|
117
|
+
// Ensure proper prototype chain for instanceof checks
|
|
118
|
+
Object.setPrototypeOf(this, DepthLimitError.prototype);
|
|
119
|
+
// Capture stack trace (V8 engines)
|
|
120
|
+
if (Error.captureStackTrace) {
|
|
121
|
+
Error.captureStackTrace(this, DepthLimitError);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"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CAAC,CAAC;QACjD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,0BAA0B;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OS-specific path resolution utilities for global npm installation.
|
|
3
|
+
* Provides default configuration and data paths based on the operating system.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Get the OS-specific base directory for application data.
|
|
7
|
+
*
|
|
8
|
+
* @param appName - Application/project name (defaults to mcp-planning-server)
|
|
9
|
+
* @returns Absolute path to the base directory
|
|
10
|
+
*/
|
|
11
|
+
export declare function getOSBasePath(appName?: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Get the OS-specific default configuration file path.
|
|
14
|
+
*
|
|
15
|
+
* - macOS: ~/Library/Application Support/{appName}/config.json
|
|
16
|
+
* - Windows: %APPDATA%\{appName}\config.json
|
|
17
|
+
* - Linux/others: ~/.config/{appName}/config.json (XDG_CONFIG_HOME)
|
|
18
|
+
*
|
|
19
|
+
* @param appName - Application/project name (defaults to mcp-planning-server)
|
|
20
|
+
* @returns Absolute path to the default config file location
|
|
21
|
+
*/
|
|
22
|
+
export declare function getOSConfigPath(appName?: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Get the OS-specific default data directory path.
|
|
25
|
+
*
|
|
26
|
+
* - macOS: ~/Library/Application Support/{appName}/data
|
|
27
|
+
* - Windows: %APPDATA%\{appName}\data
|
|
28
|
+
* - Linux/others: ~/.local/share/{appName}/data (XDG_DATA_HOME)
|
|
29
|
+
*
|
|
30
|
+
* @param appName - Application/project name (defaults to mcp-planning-server)
|
|
31
|
+
* @returns Absolute path to the default data directory
|
|
32
|
+
*/
|
|
33
|
+
export declare function getOSDataPath(appName?: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Get the OS-specific default coordination file path.
|
|
36
|
+
*
|
|
37
|
+
* - macOS: ~/Library/Application Support/{appName}/coordination.json
|
|
38
|
+
* - Windows: %APPDATA%\{appName}\coordination.json
|
|
39
|
+
* - Linux/others: ~/.local/share/{appName}/coordination.json (XDG_DATA_HOME)
|
|
40
|
+
*
|
|
41
|
+
* @param appName - Application/project name (defaults to mcp-planning-server)
|
|
42
|
+
* @returns Absolute path to the default coordination file
|
|
43
|
+
*/
|
|
44
|
+
export declare function getOSCoordinationPath(appName?: string): string;
|
|
45
|
+
//# sourceMappingURL=os-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"os-paths.d.ts","sourceRoot":"","sources":["../../src/utils/os-paths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,MAAyB,GAAG,MAAM,CAWxE;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,MAAyB,GAAG,MAAM,CAE1E;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,MAAyB,GAAG,MAAM,CAYxE;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,MAAyB,GAAG,MAAM,CAehF"}
|