@sudosandwich/limps 0.2.0 → 0.3.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 +281 -33
- package/dist/cli/config-cmd.d.ts +68 -0
- package/dist/cli/config-cmd.d.ts.map +1 -0
- package/dist/cli/config-cmd.js +206 -0
- package/dist/cli/config-cmd.js.map +1 -0
- package/dist/cli/index.d.ts +11 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +12 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init-project.d.ts +12 -0
- package/dist/cli/init-project.d.ts.map +1 -0
- package/dist/cli/init-project.js +104 -0
- package/dist/cli/init-project.js.map +1 -0
- package/dist/cli/list-agents.d.ts +66 -0
- package/dist/cli/list-agents.d.ts.map +1 -0
- package/dist/cli/list-agents.js +147 -0
- package/dist/cli/list-agents.js.map +1 -0
- package/dist/cli/list-plans.d.ts +63 -0
- package/dist/cli/list-plans.d.ts.map +1 -0
- package/dist/cli/list-plans.js +218 -0
- package/dist/cli/list-plans.js.map +1 -0
- package/dist/cli/next-task.d.ts +83 -0
- package/dist/cli/next-task.d.ts.map +1 -0
- package/dist/cli/next-task.js +201 -0
- package/dist/cli/next-task.js.map +1 -0
- package/dist/cli/registry.d.ts +94 -0
- package/dist/cli/registry.d.ts.map +1 -0
- package/dist/cli/registry.js +150 -0
- package/dist/cli/registry.js.map +1 -0
- package/dist/cli/status.d.ts +35 -0
- package/dist/cli/status.d.ts.map +1 -0
- package/dist/cli/status.js +110 -0
- package/dist/cli/status.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +10 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/config/add.d.ts +9 -0
- package/dist/commands/config/add.d.ts.map +1 -0
- package/dist/commands/config/add.js +20 -0
- package/dist/commands/config/add.js.map +1 -0
- package/dist/commands/config/discover.d.ts +3 -0
- package/dist/commands/config/discover.d.ts.map +1 -0
- package/dist/commands/config/discover.js +9 -0
- package/dist/commands/config/discover.js.map +1 -0
- package/dist/commands/config/index.d.ts +3 -0
- package/dist/commands/config/index.d.ts.map +1 -0
- package/dist/commands/config/index.js +7 -0
- package/dist/commands/config/index.js.map +1 -0
- package/dist/commands/config/list.d.ts +3 -0
- package/dist/commands/config/list.d.ts.map +1 -0
- package/dist/commands/config/list.js +9 -0
- package/dist/commands/config/list.js.map +1 -0
- package/dist/commands/config/path.d.ts +3 -0
- package/dist/commands/config/path.d.ts.map +1 -0
- package/dist/commands/config/path.js +10 -0
- package/dist/commands/config/path.js.map +1 -0
- package/dist/commands/config/remove.d.ts +9 -0
- package/dist/commands/config/remove.d.ts.map +1 -0
- package/dist/commands/config/remove.js +17 -0
- package/dist/commands/config/remove.js.map +1 -0
- package/dist/commands/config/set.d.ts +9 -0
- package/dist/commands/config/set.d.ts.map +1 -0
- package/dist/commands/config/set.js +17 -0
- package/dist/commands/config/set.js.map +1 -0
- package/dist/commands/config/show.d.ts +3 -0
- package/dist/commands/config/show.d.ts.map +1 -0
- package/dist/commands/config/show.js +15 -0
- package/dist/commands/config/show.js.map +1 -0
- package/dist/commands/config/use.d.ts +9 -0
- package/dist/commands/config/use.d.ts.map +1 -0
- package/dist/commands/config/use.js +17 -0
- package/dist/commands/config/use.js.map +1 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +7 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +13 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +20 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list-agents.d.ts +13 -0
- package/dist/commands/list-agents.d.ts.map +1 -0
- package/dist/commands/list-agents.js +31 -0
- package/dist/commands/list-agents.js.map +1 -0
- package/dist/commands/list-plans.d.ts +11 -0
- package/dist/commands/list-plans.d.ts.map +1 -0
- package/dist/commands/list-plans.js +21 -0
- package/dist/commands/list-plans.js.map +1 -0
- package/dist/commands/next-task.d.ts +13 -0
- package/dist/commands/next-task.d.ts.map +1 -0
- package/dist/commands/next-task.js +46 -0
- package/dist/commands/next-task.js.map +1 -0
- package/dist/commands/serve.d.ts +11 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +31 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/status.d.ts +13 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +28 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/components/AgentsList.d.ts +19 -0
- package/dist/components/AgentsList.d.ts.map +1 -0
- package/dist/components/AgentsList.js +29 -0
- package/dist/components/AgentsList.js.map +1 -0
- package/dist/components/Error.d.ts +6 -0
- package/dist/components/Error.d.ts.map +1 -0
- package/dist/components/Error.js +6 -0
- package/dist/components/Error.js.map +1 -0
- package/dist/components/NextTask.d.ts +12 -0
- package/dist/components/NextTask.d.ts.map +1 -0
- package/dist/components/NextTask.js +11 -0
- package/dist/components/NextTask.js.map +1 -0
- package/dist/components/PlanStatus.d.ts +11 -0
- package/dist/components/PlanStatus.d.ts.map +1 -0
- package/dist/components/PlanStatus.js +18 -0
- package/dist/components/PlanStatus.js.map +1 -0
- package/dist/components/PlansList.d.ts +12 -0
- package/dist/components/PlansList.d.ts.map +1 -0
- package/dist/components/PlansList.js +23 -0
- package/dist/components/PlansList.js.map +1 -0
- package/dist/components/Success.d.ts +6 -0
- package/dist/components/Success.d.ts.map +1 -0
- package/dist/components/Success.js +6 -0
- package/dist/components/Success.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -246
- package/dist/index.js.map +1 -1
- package/dist/server-main.d.ts +11 -0
- package/dist/server-main.d.ts.map +1 -0
- package/dist/server-main.js +81 -0
- package/dist/server-main.js.map +1 -0
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/theme/colors.d.ts +64 -0
- package/dist/theme/colors.d.ts.map +1 -0
- package/dist/theme/colors.js +85 -0
- package/dist/theme/colors.js.map +1 -0
- package/dist/theme/index.d.ts +6 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +6 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/tools/claim-task.d.ts +7 -10
- package/dist/tools/claim-task.d.ts.map +1 -1
- package/dist/tools/create-doc.d.ts +7 -10
- package/dist/tools/create-doc.d.ts.map +1 -1
- package/dist/tools/create-plan.d.ts +1 -7
- package/dist/tools/create-plan.d.ts.map +1 -1
- package/dist/tools/delete-doc.d.ts +1 -9
- package/dist/tools/delete-doc.d.ts.map +1 -1
- package/dist/tools/get-next-task.d.ts +19 -9
- package/dist/tools/get-next-task.d.ts.map +1 -1
- package/dist/tools/get-next-task.js +64 -1
- package/dist/tools/get-next-task.js.map +1 -1
- package/dist/tools/get-plan-status.d.ts +24 -0
- package/dist/tools/get-plan-status.d.ts.map +1 -0
- package/dist/tools/get-plan-status.js +48 -0
- package/dist/tools/get-plan-status.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +66 -18
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/list-agents.d.ts +24 -0
- package/dist/tools/list-agents.d.ts.map +1 -0
- package/dist/tools/list-agents.js +60 -0
- package/dist/tools/list-agents.js.map +1 -0
- package/dist/tools/list-docs.d.ts +1 -11
- package/dist/tools/list-docs.d.ts.map +1 -1
- package/dist/tools/list-plans.d.ts +23 -0
- package/dist/tools/list-plans.d.ts.map +1 -0
- package/dist/tools/list-plans.js +44 -0
- package/dist/tools/list-plans.js.map +1 -0
- package/dist/tools/open-document-in-cursor.d.ts +1 -9
- package/dist/tools/open-document-in-cursor.d.ts.map +1 -1
- package/dist/tools/process-doc.d.ts +43 -0
- package/dist/tools/process-doc.d.ts.map +1 -0
- package/dist/tools/{rlm-query.js → process-doc.js} +7 -8
- package/dist/tools/process-doc.js.map +1 -0
- package/dist/tools/process-docs.d.ts +54 -0
- package/dist/tools/process-docs.d.ts.map +1 -0
- package/dist/tools/{rlm-multi-query.js → process-docs.js} +10 -10
- package/dist/tools/process-docs.js.map +1 -0
- package/dist/tools/release-task.d.ts +5 -10
- package/dist/tools/release-task.d.ts.map +1 -1
- package/dist/tools/search-docs.d.ts +1 -7
- package/dist/tools/search-docs.d.ts.map +1 -1
- package/dist/tools/update-doc.d.ts +6 -90
- package/dist/tools/update-doc.d.ts.map +1 -1
- package/dist/tools/update-task-status.d.ts +7 -12
- package/dist/tools/update-task-status.d.ts.map +1 -1
- package/dist/utils/config-resolver.d.ts +19 -0
- package/dist/utils/config-resolver.d.ts.map +1 -0
- package/dist/utils/config-resolver.js +65 -0
- package/dist/utils/config-resolver.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/markdown.d.ts +15 -0
- package/dist/utils/markdown.d.ts.map +1 -0
- package/dist/utils/markdown.js +20 -0
- package/dist/utils/markdown.js.map +1 -0
- package/dist/utils/os-paths.d.ts +4 -4
- package/dist/utils/os-paths.js +5 -5
- package/dist/utils/os-paths.js.map +1 -1
- package/package.json +22 -11
- package/dist/tools/read-doc.d.ts +0 -44
- package/dist/tools/read-doc.d.ts.map +0 -1
- package/dist/tools/read-doc.js +0 -174
- package/dist/tools/read-doc.js.map +0 -1
- package/dist/tools/rlm-multi-query.d.ts +0 -110
- package/dist/tools/rlm-multi-query.d.ts.map +0 -1
- package/dist/tools/rlm-multi-query.js.map +0 -1
- package/dist/tools/rlm-query.d.ts +0 -56
- package/dist/tools/rlm-query.d.ts.map +0 -1
- package/dist/tools/rlm-query.js.map +0 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration path resolution utility.
|
|
3
|
+
* Shared between CLI commands and server startup.
|
|
4
|
+
*/
|
|
5
|
+
import { resolve, dirname } from 'path';
|
|
6
|
+
import { existsSync } from 'fs';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
import { getCurrentProjectPath, getProjectPath } from '../cli/registry.js';
|
|
9
|
+
import { getOSConfigPath } from './os-paths.js';
|
|
10
|
+
/**
|
|
11
|
+
* Resolve configuration file path with priority:
|
|
12
|
+
* 1. CLI argument --config
|
|
13
|
+
* 2. Environment variable MCP_PLANNING_CONFIG
|
|
14
|
+
* 3. Environment variable LIMPS_PROJECT (project name → registry lookup)
|
|
15
|
+
* 4. Registry current project
|
|
16
|
+
* 5. OS-specific default path
|
|
17
|
+
*
|
|
18
|
+
* Falls back to repo-local config.json if no config exists at determined path.
|
|
19
|
+
*
|
|
20
|
+
* @param cliConfigPath - Config path from CLI argument (if provided)
|
|
21
|
+
* @returns Resolved absolute path to config file
|
|
22
|
+
*/
|
|
23
|
+
export function resolveConfigPath(cliConfigPath) {
|
|
24
|
+
// Priority 1: CLI argument
|
|
25
|
+
if (cliConfigPath) {
|
|
26
|
+
return resolve(cliConfigPath);
|
|
27
|
+
}
|
|
28
|
+
// Priority 2: Environment variable MCP_PLANNING_CONFIG
|
|
29
|
+
const envConfigPath = process.env.MCP_PLANNING_CONFIG;
|
|
30
|
+
if (envConfigPath) {
|
|
31
|
+
return resolve(envConfigPath);
|
|
32
|
+
}
|
|
33
|
+
// Priority 3: LIMPS_PROJECT env → registry lookup
|
|
34
|
+
const envProject = process.env.LIMPS_PROJECT;
|
|
35
|
+
if (envProject) {
|
|
36
|
+
const projectPath = getProjectPath(envProject);
|
|
37
|
+
if (projectPath && existsSync(projectPath)) {
|
|
38
|
+
return projectPath;
|
|
39
|
+
}
|
|
40
|
+
// Warn but don't fail - fall through to next priority
|
|
41
|
+
console.error(`Warning: LIMPS_PROJECT="${envProject}" not found in registry`);
|
|
42
|
+
}
|
|
43
|
+
// Priority 4: Registry current project
|
|
44
|
+
const currentPath = getCurrentProjectPath();
|
|
45
|
+
if (currentPath && existsSync(currentPath)) {
|
|
46
|
+
return currentPath;
|
|
47
|
+
}
|
|
48
|
+
// Priority 5: OS-specific default
|
|
49
|
+
const osConfigPath = getOSConfigPath();
|
|
50
|
+
if (existsSync(osConfigPath)) {
|
|
51
|
+
return osConfigPath;
|
|
52
|
+
}
|
|
53
|
+
// Fallback: repo-local config.json (for development/backwards compatibility)
|
|
54
|
+
const currentFile = fileURLToPath(import.meta.url);
|
|
55
|
+
const currentDir = dirname(currentFile);
|
|
56
|
+
const srcDir = dirname(currentDir);
|
|
57
|
+
const repoRoot = dirname(srcDir);
|
|
58
|
+
const repoConfigPath = resolve(repoRoot, 'config.json');
|
|
59
|
+
// If neither OS config nor repo config exists, use OS path (will be created)
|
|
60
|
+
if (existsSync(repoConfigPath)) {
|
|
61
|
+
return repoConfigPath;
|
|
62
|
+
}
|
|
63
|
+
return osConfigPath;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=config-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-resolver.js","sourceRoot":"","sources":["../../src/utils/config-resolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,aAAsB;IACtD,2BAA2B;IAC3B,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC,CAAC;IAED,uDAAuD;IACvD,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IACtD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,OAAO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","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"}
|
|
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;AAC9B,cAAc,eAAe,CAAC"}
|
package/dist/utils/index.js
CHANGED
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +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"}
|
|
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;AAC9B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for markdown text processing.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Strip all markdown syntax from text, converting it to plain text.
|
|
6
|
+
* Uses the remove-markdown library for reliable markdown removal.
|
|
7
|
+
*
|
|
8
|
+
* This is for CLI display - LLM processing happens elsewhere
|
|
9
|
+
* and should receive full markdown.
|
|
10
|
+
*
|
|
11
|
+
* @param text - Markdown text to strip
|
|
12
|
+
* @returns Plain text without markdown syntax
|
|
13
|
+
*/
|
|
14
|
+
export declare function stripMarkdown(text: string): string;
|
|
15
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/utils/markdown.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGlD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for markdown text processing.
|
|
3
|
+
*/
|
|
4
|
+
import removeMarkdown from 'remove-markdown';
|
|
5
|
+
/**
|
|
6
|
+
* Strip all markdown syntax from text, converting it to plain text.
|
|
7
|
+
* Uses the remove-markdown library for reliable markdown removal.
|
|
8
|
+
*
|
|
9
|
+
* This is for CLI display - LLM processing happens elsewhere
|
|
10
|
+
* and should receive full markdown.
|
|
11
|
+
*
|
|
12
|
+
* @param text - Markdown text to strip
|
|
13
|
+
* @returns Plain text without markdown syntax
|
|
14
|
+
*/
|
|
15
|
+
export function stripMarkdown(text) {
|
|
16
|
+
if (!text)
|
|
17
|
+
return '';
|
|
18
|
+
return removeMarkdown(text).trim();
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/utils/markdown.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AACrC,CAAC"}
|
package/dist/utils/os-paths.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Get the OS-specific base directory for application data.
|
|
7
7
|
*
|
|
8
|
-
* @param appName - Application/project name (defaults to
|
|
8
|
+
* @param appName - Application/project name (defaults to limps)
|
|
9
9
|
* @returns Absolute path to the base directory
|
|
10
10
|
*/
|
|
11
11
|
export declare function getOSBasePath(appName?: string): string;
|
|
@@ -16,7 +16,7 @@ export declare function getOSBasePath(appName?: string): string;
|
|
|
16
16
|
* - Windows: %APPDATA%\{appName}\config.json
|
|
17
17
|
* - Linux/others: ~/.config/{appName}/config.json (XDG_CONFIG_HOME)
|
|
18
18
|
*
|
|
19
|
-
* @param appName - Application/project name (defaults to
|
|
19
|
+
* @param appName - Application/project name (defaults to limps)
|
|
20
20
|
* @returns Absolute path to the default config file location
|
|
21
21
|
*/
|
|
22
22
|
export declare function getOSConfigPath(appName?: string): string;
|
|
@@ -27,7 +27,7 @@ export declare function getOSConfigPath(appName?: string): string;
|
|
|
27
27
|
* - Windows: %APPDATA%\{appName}\data
|
|
28
28
|
* - Linux/others: ~/.local/share/{appName}/data (XDG_DATA_HOME)
|
|
29
29
|
*
|
|
30
|
-
* @param appName - Application/project name (defaults to
|
|
30
|
+
* @param appName - Application/project name (defaults to limps)
|
|
31
31
|
* @returns Absolute path to the default data directory
|
|
32
32
|
*/
|
|
33
33
|
export declare function getOSDataPath(appName?: string): string;
|
|
@@ -38,7 +38,7 @@ export declare function getOSDataPath(appName?: string): string;
|
|
|
38
38
|
* - Windows: %APPDATA%\{appName}\coordination.json
|
|
39
39
|
* - Linux/others: ~/.local/share/{appName}/coordination.json (XDG_DATA_HOME)
|
|
40
40
|
*
|
|
41
|
-
* @param appName - Application/project name (defaults to
|
|
41
|
+
* @param appName - Application/project name (defaults to limps)
|
|
42
42
|
* @returns Absolute path to the default coordination file
|
|
43
43
|
*/
|
|
44
44
|
export declare function getOSCoordinationPath(appName?: string): string;
|
package/dist/utils/os-paths.js
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { homedir } from 'os';
|
|
6
6
|
import { join } from 'path';
|
|
7
|
-
const DEFAULT_APP_NAME = '
|
|
7
|
+
const DEFAULT_APP_NAME = 'limps';
|
|
8
8
|
/**
|
|
9
9
|
* Get the OS-specific base directory for application data.
|
|
10
10
|
*
|
|
11
|
-
* @param appName - Application/project name (defaults to
|
|
11
|
+
* @param appName - Application/project name (defaults to limps)
|
|
12
12
|
* @returns Absolute path to the base directory
|
|
13
13
|
*/
|
|
14
14
|
export function getOSBasePath(appName = DEFAULT_APP_NAME) {
|
|
@@ -29,7 +29,7 @@ export function getOSBasePath(appName = DEFAULT_APP_NAME) {
|
|
|
29
29
|
* - Windows: %APPDATA%\{appName}\config.json
|
|
30
30
|
* - Linux/others: ~/.config/{appName}/config.json (XDG_CONFIG_HOME)
|
|
31
31
|
*
|
|
32
|
-
* @param appName - Application/project name (defaults to
|
|
32
|
+
* @param appName - Application/project name (defaults to limps)
|
|
33
33
|
* @returns Absolute path to the default config file location
|
|
34
34
|
*/
|
|
35
35
|
export function getOSConfigPath(appName = DEFAULT_APP_NAME) {
|
|
@@ -42,7 +42,7 @@ export function getOSConfigPath(appName = DEFAULT_APP_NAME) {
|
|
|
42
42
|
* - Windows: %APPDATA%\{appName}\data
|
|
43
43
|
* - Linux/others: ~/.local/share/{appName}/data (XDG_DATA_HOME)
|
|
44
44
|
*
|
|
45
|
-
* @param appName - Application/project name (defaults to
|
|
45
|
+
* @param appName - Application/project name (defaults to limps)
|
|
46
46
|
* @returns Absolute path to the default data directory
|
|
47
47
|
*/
|
|
48
48
|
export function getOSDataPath(appName = DEFAULT_APP_NAME) {
|
|
@@ -64,7 +64,7 @@ export function getOSDataPath(appName = DEFAULT_APP_NAME) {
|
|
|
64
64
|
* - Windows: %APPDATA%\{appName}\coordination.json
|
|
65
65
|
* - Linux/others: ~/.local/share/{appName}/coordination.json (XDG_DATA_HOME)
|
|
66
66
|
*
|
|
67
|
-
* @param appName - Application/project name (defaults to
|
|
67
|
+
* @param appName - Application/project name (defaults to limps)
|
|
68
68
|
* @returns Absolute path to the default coordination file
|
|
69
69
|
*/
|
|
70
70
|
export function getOSCoordinationPath(appName = DEFAULT_APP_NAME) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"os-paths.js","sourceRoot":"","sources":["../../src/utils/os-paths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"os-paths.js","sourceRoot":"","sources":["../../src/utils/os-paths.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkB,gBAAgB;IAC9D,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,QAAQ,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,qBAAqB,EAAE,OAAO,CAAC,CAAC;QAC/D,KAAK,OAAO;YACV,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;QAChF;YACE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,UAAkB,gBAAgB;IAChE,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,aA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Server - AI agent plan management and coordination",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"limps": "dist/
|
|
8
|
+
"limps": "dist/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "vitest run",
|
|
@@ -13,10 +13,13 @@
|
|
|
13
13
|
"test:coverage": "vitest run --coverage",
|
|
14
14
|
"build": "tsc",
|
|
15
15
|
"dev": "tsc --watch",
|
|
16
|
-
"
|
|
16
|
+
"type-check": "tsc --noEmit",
|
|
17
|
+
"lint": "eslint src/ tests/ --max-warnings 0",
|
|
17
18
|
"lint:fix": "eslint src/ tests/ --fix",
|
|
18
|
-
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
19
|
-
"format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
19
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\" \"tests/**/*.{ts,tsx}\"",
|
|
20
|
+
"format:check": "prettier --check \"src/**/*.{ts,tsx}\" \"tests/**/*.{ts,tsx}\"",
|
|
21
|
+
"validate": "npm run format:check && npm run lint && npm run type-check && npm run build && npm test",
|
|
22
|
+
"ci": "npm run validate",
|
|
20
23
|
"prepare": "husky"
|
|
21
24
|
},
|
|
22
25
|
"keywords": [
|
|
@@ -39,7 +42,7 @@
|
|
|
39
42
|
"license": "MIT",
|
|
40
43
|
"repository": {
|
|
41
44
|
"type": "git",
|
|
42
|
-
"url": "git+https://github.com/paulbreuler/
|
|
45
|
+
"url": "git+https://github.com/paulbreuler/limps.git"
|
|
43
46
|
},
|
|
44
47
|
"files": [
|
|
45
48
|
"dist",
|
|
@@ -50,21 +53,27 @@
|
|
|
50
53
|
"@modelcontextprotocol/sdk": "^1.22.0",
|
|
51
54
|
"better-sqlite3": "^11.7.0",
|
|
52
55
|
"chokidar": "^4.0.3",
|
|
56
|
+
"ink": "^6.6.0",
|
|
53
57
|
"micromatch": "^4.0.8",
|
|
54
58
|
"open": "^10.2.0",
|
|
59
|
+
"pastel": "^4.0.0",
|
|
55
60
|
"quickjs-emscripten": "^0.31.0",
|
|
61
|
+
"react": "^19.2.3",
|
|
62
|
+
"remove-markdown": "^0.6.3",
|
|
56
63
|
"which": "^4.0.0",
|
|
57
64
|
"yaml": "^2.7.0",
|
|
58
|
-
"zod": "^3.
|
|
65
|
+
"zod": "^4.3.6"
|
|
59
66
|
},
|
|
60
67
|
"lint-staged": {
|
|
61
|
-
"src/**/*.ts": [
|
|
68
|
+
"src/**/*.{ts,tsx}": [
|
|
62
69
|
"prettier --write",
|
|
63
|
-
"eslint --fix"
|
|
70
|
+
"eslint --fix",
|
|
71
|
+
"eslint"
|
|
64
72
|
],
|
|
65
|
-
"tests/**/*.ts": [
|
|
73
|
+
"tests/**/*.{ts,tsx}": [
|
|
66
74
|
"prettier --write",
|
|
67
|
-
"eslint --fix"
|
|
75
|
+
"eslint --fix",
|
|
76
|
+
"eslint"
|
|
68
77
|
]
|
|
69
78
|
},
|
|
70
79
|
"devDependencies": {
|
|
@@ -72,10 +81,12 @@
|
|
|
72
81
|
"@types/better-sqlite3": "^7.6.12",
|
|
73
82
|
"@types/micromatch": "^4.0.10",
|
|
74
83
|
"@types/node": "^25.0.9",
|
|
84
|
+
"@types/react": "^19.2.9",
|
|
75
85
|
"@types/which": "^3.0.4",
|
|
76
86
|
"@vitest/coverage-v8": "^4.0.17",
|
|
77
87
|
"eslint": "^9.39.2",
|
|
78
88
|
"husky": "^9.1.7",
|
|
89
|
+
"ink-testing-library": "^4.0.0",
|
|
79
90
|
"lint-staged": "^16.2.7",
|
|
80
91
|
"prettier": "^3.8.0",
|
|
81
92
|
"typescript": "^5.9.3",
|
package/dist/tools/read-doc.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* read_doc tool: Read full content of any document in the repository.
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import type { ToolContext, ToolResult } from '../types.js';
|
|
6
|
-
/**
|
|
7
|
-
* Input schema for read_doc tool.
|
|
8
|
-
*/
|
|
9
|
-
export declare const ReadDocInputSchema: z.ZodObject<{
|
|
10
|
-
path: z.ZodString;
|
|
11
|
-
lines: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
path: string;
|
|
14
|
-
lines?: [number, number] | undefined;
|
|
15
|
-
}, {
|
|
16
|
-
path: string;
|
|
17
|
-
lines?: [number, number] | undefined;
|
|
18
|
-
}>;
|
|
19
|
-
export type ReadDocInput = z.infer<typeof ReadDocInputSchema>;
|
|
20
|
-
/**
|
|
21
|
-
* Output interface for read_doc tool.
|
|
22
|
-
*/
|
|
23
|
-
export interface ReadDocOutput {
|
|
24
|
-
path: string;
|
|
25
|
-
content: string;
|
|
26
|
-
metadata: {
|
|
27
|
-
size: number;
|
|
28
|
-
lines: number;
|
|
29
|
-
modified: string;
|
|
30
|
-
type: 'md' | 'jsx' | 'tsx' | 'ts' | 'json' | 'yaml' | 'other';
|
|
31
|
-
partial?: boolean;
|
|
32
|
-
range?: [number, number];
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Handle read_doc tool request.
|
|
37
|
-
* Reads full file content with optional line range.
|
|
38
|
-
*
|
|
39
|
-
* @param input - Tool input
|
|
40
|
-
* @param context - Tool context
|
|
41
|
-
* @returns Tool result
|
|
42
|
-
*/
|
|
43
|
-
export declare function handleReadDoc(input: ReadDocInput, context: ToolContext): Promise<ToolResult>;
|
|
44
|
-
//# sourceMappingURL=read-doc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read-doc.d.ts","sourceRoot":"","sources":["../../src/tools/read-doc.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI3D;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;EAM7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;QAC9D,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC1B,CAAC;CACH;AAeD;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAuJrB"}
|
package/dist/tools/read-doc.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* read_doc tool: Read full content of any document in the repository.
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { readFile, stat } from 'fs/promises';
|
|
6
|
-
import { existsSync } from 'fs';
|
|
7
|
-
import { dirname } from 'path';
|
|
8
|
-
import { validatePath } from '../utils/paths.js';
|
|
9
|
-
import { notFound } from '../utils/errors.js';
|
|
10
|
-
/**
|
|
11
|
-
* Input schema for read_doc tool.
|
|
12
|
-
*/
|
|
13
|
-
export const ReadDocInputSchema = z.object({
|
|
14
|
-
path: z.string().min(1).describe('Path relative to repo root'),
|
|
15
|
-
lines: z
|
|
16
|
-
.tuple([z.number().int().positive(), z.number().int().positive()])
|
|
17
|
-
.optional()
|
|
18
|
-
.describe('Optional line range [start, end], 1-indexed'),
|
|
19
|
-
});
|
|
20
|
-
/**
|
|
21
|
-
* Get repository root from config.
|
|
22
|
-
* Uses the first docsPath entry as the repo root, or derives from plansPath.
|
|
23
|
-
*/
|
|
24
|
-
function getRepoRoot(config) {
|
|
25
|
-
// Prefer docsPaths[0] if it exists (it's the repo root)
|
|
26
|
-
if (config.docsPaths && config.docsPaths.length > 0) {
|
|
27
|
-
return config.docsPaths[0];
|
|
28
|
-
}
|
|
29
|
-
// Fallback: use plansPath parent directory
|
|
30
|
-
return dirname(config.plansPath);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Handle read_doc tool request.
|
|
34
|
-
* Reads full file content with optional line range.
|
|
35
|
-
*
|
|
36
|
-
* @param input - Tool input
|
|
37
|
-
* @param context - Tool context
|
|
38
|
-
* @returns Tool result
|
|
39
|
-
*/
|
|
40
|
-
export async function handleReadDoc(input, context) {
|
|
41
|
-
const { path, lines } = input;
|
|
42
|
-
const { config } = context;
|
|
43
|
-
try {
|
|
44
|
-
// Get repo root
|
|
45
|
-
const repoRoot = getRepoRoot(config);
|
|
46
|
-
// Validate path first
|
|
47
|
-
const validated = validatePath(path, repoRoot);
|
|
48
|
-
// Check if file exists
|
|
49
|
-
if (!existsSync(validated.absolute)) {
|
|
50
|
-
throw notFound(path);
|
|
51
|
-
}
|
|
52
|
-
// Read file stats
|
|
53
|
-
const stats = await stat(validated.absolute);
|
|
54
|
-
// Read file content
|
|
55
|
-
const content = await readFile(validated.absolute, 'utf-8');
|
|
56
|
-
// Count lines (empty file has 0 lines, not 1)
|
|
57
|
-
const lineCount = content === '' ? 0 : content.split('\n').length;
|
|
58
|
-
// Handle line range if specified
|
|
59
|
-
let finalContent = content;
|
|
60
|
-
let partial = false;
|
|
61
|
-
let range;
|
|
62
|
-
if (lines) {
|
|
63
|
-
const [start, end] = lines;
|
|
64
|
-
// Validate range
|
|
65
|
-
if (start > end) {
|
|
66
|
-
return {
|
|
67
|
-
content: [
|
|
68
|
-
{
|
|
69
|
-
type: 'text',
|
|
70
|
-
text: `Invalid line range: start (${start}) must be <= end (${end})`,
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
isError: true,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
if (start < 1 || end < 1) {
|
|
77
|
-
return {
|
|
78
|
-
content: [
|
|
79
|
-
{
|
|
80
|
-
type: 'text',
|
|
81
|
-
text: `Invalid line range: line numbers must be >= 1`,
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
isError: true,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
// Convert 1-indexed to 0-indexed
|
|
88
|
-
const startIdx = start - 1;
|
|
89
|
-
const endIdx = end; // end is inclusive, so we use it directly for slice
|
|
90
|
-
// Split into lines
|
|
91
|
-
const contentLines = content.split('\n');
|
|
92
|
-
// Validate range against file
|
|
93
|
-
if (startIdx > contentLines.length) {
|
|
94
|
-
return {
|
|
95
|
-
content: [
|
|
96
|
-
{
|
|
97
|
-
type: 'text',
|
|
98
|
-
text: `Line range [${start}, ${end}] exceeds file length (${lineCount} lines)`,
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
isError: true,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
// Extract range (endIdx is exclusive in slice, so we add 1)
|
|
105
|
-
const endSlice = Math.min(endIdx, contentLines.length);
|
|
106
|
-
const selectedLines = contentLines.slice(startIdx, endSlice);
|
|
107
|
-
// Rejoin lines
|
|
108
|
-
finalContent = selectedLines.join('\n');
|
|
109
|
-
partial = true;
|
|
110
|
-
range = [start, Math.min(end, lineCount)];
|
|
111
|
-
}
|
|
112
|
-
// Format output
|
|
113
|
-
const output = {
|
|
114
|
-
path: validated.relative,
|
|
115
|
-
content: finalContent,
|
|
116
|
-
metadata: {
|
|
117
|
-
size: stats.size,
|
|
118
|
-
lines: lineCount,
|
|
119
|
-
modified: stats.mtime.toISOString(),
|
|
120
|
-
type: validated.type,
|
|
121
|
-
...(partial && { partial: true, range }),
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
return {
|
|
125
|
-
content: [
|
|
126
|
-
{
|
|
127
|
-
type: 'text',
|
|
128
|
-
text: JSON.stringify(output, null, 2),
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
catch (error) {
|
|
134
|
-
// Handle DocumentError
|
|
135
|
-
if (error instanceof Error && 'code' in error) {
|
|
136
|
-
const docError = error;
|
|
137
|
-
return {
|
|
138
|
-
content: [
|
|
139
|
-
{
|
|
140
|
-
type: 'text',
|
|
141
|
-
text: `Error: ${docError.message}${docError.path ? ` (path: ${docError.path})` : ''}`,
|
|
142
|
-
},
|
|
143
|
-
],
|
|
144
|
-
isError: true,
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
// Handle file system errors
|
|
148
|
-
if (error instanceof Error) {
|
|
149
|
-
// Check for ENOENT (file not found)
|
|
150
|
-
if ('code' in error && error.code === 'ENOENT') {
|
|
151
|
-
throw notFound(path);
|
|
152
|
-
}
|
|
153
|
-
return {
|
|
154
|
-
content: [
|
|
155
|
-
{
|
|
156
|
-
type: 'text',
|
|
157
|
-
text: `Error reading file: ${error.message}`,
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
isError: true,
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
return {
|
|
164
|
-
content: [
|
|
165
|
-
{
|
|
166
|
-
type: 'text',
|
|
167
|
-
text: `Unknown error: ${String(error)}`,
|
|
168
|
-
},
|
|
169
|
-
],
|
|
170
|
-
isError: true,
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
//# sourceMappingURL=read-doc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read-doc.js","sourceRoot":"","sources":["../../src/tools/read-doc.ts"],"names":[],"mappings":"AAAA;;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AAC"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* rlm_multi_query tool: Execute JavaScript code on multiple documents.
|
|
3
|
-
* Feature #4: RLM Multi-Query Tool
|
|
4
|
-
*
|
|
5
|
-
* Enables cross-document analysis with glob patterns or explicit paths.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
import type { ToolContext, ToolResult } from '../types.js';
|
|
9
|
-
/**
|
|
10
|
-
* Base input schema for rlm_multi_query tool (for registration).
|
|
11
|
-
*/
|
|
12
|
-
export declare const RlmMultiQueryInputBaseSchema: z.ZodObject<{
|
|
13
|
-
paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
14
|
-
pattern: z.ZodOptional<z.ZodString>;
|
|
15
|
-
code: z.ZodString;
|
|
16
|
-
sub_query: z.ZodOptional<z.ZodString>;
|
|
17
|
-
timeout: z.ZodDefault<z.ZodNumber>;
|
|
18
|
-
max_docs: z.ZodDefault<z.ZodNumber>;
|
|
19
|
-
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
code: string;
|
|
21
|
-
timeout: number;
|
|
22
|
-
max_docs: number;
|
|
23
|
-
pattern?: string | undefined;
|
|
24
|
-
sub_query?: string | undefined;
|
|
25
|
-
paths?: string[] | undefined;
|
|
26
|
-
}, {
|
|
27
|
-
code: string;
|
|
28
|
-
pattern?: string | undefined;
|
|
29
|
-
timeout?: number | undefined;
|
|
30
|
-
sub_query?: string | undefined;
|
|
31
|
-
paths?: string[] | undefined;
|
|
32
|
-
max_docs?: number | undefined;
|
|
33
|
-
}>;
|
|
34
|
-
/**
|
|
35
|
-
* Input schema for rlm_multi_query tool (with validation).
|
|
36
|
-
*/
|
|
37
|
-
export declare const RlmMultiQueryInputSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
38
|
-
paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
39
|
-
pattern: z.ZodOptional<z.ZodString>;
|
|
40
|
-
code: z.ZodString;
|
|
41
|
-
sub_query: z.ZodOptional<z.ZodString>;
|
|
42
|
-
timeout: z.ZodDefault<z.ZodNumber>;
|
|
43
|
-
max_docs: z.ZodDefault<z.ZodNumber>;
|
|
44
|
-
}, "strip", z.ZodTypeAny, {
|
|
45
|
-
code: string;
|
|
46
|
-
timeout: number;
|
|
47
|
-
max_docs: number;
|
|
48
|
-
pattern?: string | undefined;
|
|
49
|
-
sub_query?: string | undefined;
|
|
50
|
-
paths?: string[] | undefined;
|
|
51
|
-
}, {
|
|
52
|
-
code: string;
|
|
53
|
-
pattern?: string | undefined;
|
|
54
|
-
timeout?: number | undefined;
|
|
55
|
-
sub_query?: string | undefined;
|
|
56
|
-
paths?: string[] | undefined;
|
|
57
|
-
max_docs?: number | undefined;
|
|
58
|
-
}>, {
|
|
59
|
-
code: string;
|
|
60
|
-
timeout: number;
|
|
61
|
-
max_docs: number;
|
|
62
|
-
pattern?: string | undefined;
|
|
63
|
-
sub_query?: string | undefined;
|
|
64
|
-
paths?: string[] | undefined;
|
|
65
|
-
}, {
|
|
66
|
-
code: string;
|
|
67
|
-
pattern?: string | undefined;
|
|
68
|
-
timeout?: number | undefined;
|
|
69
|
-
sub_query?: string | undefined;
|
|
70
|
-
paths?: string[] | undefined;
|
|
71
|
-
max_docs?: number | undefined;
|
|
72
|
-
}>, {
|
|
73
|
-
code: string;
|
|
74
|
-
timeout: number;
|
|
75
|
-
max_docs: number;
|
|
76
|
-
pattern?: string | undefined;
|
|
77
|
-
sub_query?: string | undefined;
|
|
78
|
-
paths?: string[] | undefined;
|
|
79
|
-
}, {
|
|
80
|
-
code: string;
|
|
81
|
-
pattern?: string | undefined;
|
|
82
|
-
timeout?: number | undefined;
|
|
83
|
-
sub_query?: string | undefined;
|
|
84
|
-
paths?: string[] | undefined;
|
|
85
|
-
max_docs?: number | undefined;
|
|
86
|
-
}>;
|
|
87
|
-
export type RlmMultiQueryInput = z.infer<typeof RlmMultiQueryInputSchema>;
|
|
88
|
-
/**
|
|
89
|
-
* Output interface for rlm_multi_query tool.
|
|
90
|
-
*/
|
|
91
|
-
export interface RlmMultiQueryOutput {
|
|
92
|
-
result: unknown;
|
|
93
|
-
docs_loaded: number;
|
|
94
|
-
execution_time_ms: number;
|
|
95
|
-
sub_results?: unknown[];
|
|
96
|
-
metadata: {
|
|
97
|
-
paths: string[];
|
|
98
|
-
total_size: number;
|
|
99
|
-
result_size: number;
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Handle rlm_multi_query tool request.
|
|
104
|
-
*
|
|
105
|
-
* @param input - Tool input
|
|
106
|
-
* @param context - Tool context
|
|
107
|
-
* @returns Tool result
|
|
108
|
-
*/
|
|
109
|
-
export declare function handleRlmMultiQuery(input: RlmMultiQueryInput, context: ToolContext): Promise<ToolResult>;
|
|
110
|
-
//# sourceMappingURL=rlm-multi-query.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rlm-multi-query.d.ts","sourceRoot":"","sources":["../../src/tools/rlm-multi-query.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAQ3D;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;EAOvC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;IACxB,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AA0GD;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,kBAAkB,EACzB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAmPrB"}
|