byterover-cli 3.5.0 → 3.5.1

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.
@@ -39,6 +39,9 @@ export class ByteRoverMcpServer {
39
39
  this.server = new McpServer({
40
40
  name: 'byterover',
41
41
  version: config.version,
42
+ }, {
43
+ instructions: 'ByteRover MCP — curate and query project context trees. ' +
44
+ 'See the `cwd` parameter description on each tool for how to provide the project path correctly.',
42
45
  });
43
46
  this.connectOptions = {
44
47
  clientType: 'mcp',
@@ -2,19 +2,15 @@ import { waitForConnectedClient } from '@campfirein/brv-transport-client';
2
2
  import { randomUUID } from 'node:crypto';
3
3
  import { z } from 'zod';
4
4
  import { TransportTaskEventNames } from '../../../core/domain/transport/schemas.js';
5
- import { associateProjectWithRetry, resolveMcpTaskContext, } from './mcp-project-context.js';
5
+ import { associateProjectWithRetry, resolveMcpTaskContext } from './mcp-project-context.js';
6
6
  import { resolveClientCwd } from './resolve-client-cwd.js';
7
+ import { cwdField } from './shared-schema.js';
7
8
  export const BrvCurateInputSchema = z.object({
8
9
  context: z
9
10
  .string()
10
11
  .optional()
11
12
  .describe('Knowledge to store: patterns, decisions, errors, or insights about the codebase. Required unless files or folder are provided.'),
12
- cwd: z
13
- .string()
14
- .optional()
15
- .describe('Working directory of the project (absolute path). ' +
16
- 'Required when the MCP server runs in global mode (e.g., Windsurf). ' +
17
- 'Optional in project mode — defaults to the project directory.'),
13
+ cwd: cwdField,
18
14
  files: z
19
15
  .array(z.string())
20
16
  .max(5)
@@ -2,16 +2,12 @@ import { waitForConnectedClient } from '@campfirein/brv-transport-client';
2
2
  import { randomUUID } from 'node:crypto';
3
3
  import { z } from 'zod';
4
4
  import { TransportTaskEventNames } from '../../../core/domain/transport/schemas.js';
5
- import { associateProjectWithRetry, resolveMcpTaskContext, } from './mcp-project-context.js';
5
+ import { associateProjectWithRetry, resolveMcpTaskContext } from './mcp-project-context.js';
6
6
  import { resolveClientCwd } from './resolve-client-cwd.js';
7
+ import { cwdField } from './shared-schema.js';
7
8
  import { waitForTaskResult } from './task-result-waiter.js';
8
9
  export const BrvQueryInputSchema = z.object({
9
- cwd: z
10
- .string()
11
- .optional()
12
- .describe('Working directory of the project (absolute path). ' +
13
- 'Required when the MCP server runs in global mode (e.g., Windsurf). ' +
14
- 'Optional in project mode — defaults to the project directory.'),
10
+ cwd: cwdField,
15
11
  query: z.string().describe('Natural language question about the codebase or project'),
16
12
  });
17
13
  /**
@@ -1,4 +1,5 @@
1
1
  export { registerBrvCurateTool } from './brv-curate-tool.js';
2
2
  export { registerBrvQueryTool } from './brv-query-tool.js';
3
3
  export { resolveClientCwd } from './resolve-client-cwd.js';
4
+ export { CWD_DESCRIPTION, cwdField } from './shared-schema.js';
4
5
  export { waitForTaskResult } from './task-result-waiter.js';
@@ -1,4 +1,5 @@
1
1
  export { registerBrvCurateTool } from './brv-curate-tool.js';
2
2
  export { registerBrvQueryTool } from './brv-query-tool.js';
3
3
  export { resolveClientCwd } from './resolve-client-cwd.js';
4
+ export { CWD_DESCRIPTION, cwdField } from './shared-schema.js';
4
5
  export { waitForTaskResult } from './task-result-waiter.js';
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ export declare const CWD_DESCRIPTION: string;
3
+ export declare const cwdField: z.ZodOptional<z.ZodString>;
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export const CWD_DESCRIPTION = 'Absolute path to the project root — selects which ByteRover context tree to use ' +
3
+ String.raw `(e.g., "/Users/me/code/myapp", "C:\\code\\myapp").` +
4
+ '\n\n' +
5
+ 'When to provide:\n' +
6
+ '- If your runtime does NOT expose any workspace/project context to you ' +
7
+ '(e.g., Claude Desktop, hosted MCP, global Windsurf): you MUST provide cwd. ' +
8
+ 'Use the path the user mentions, or ASK the user for the absolute path if unknown.\n' +
9
+ '- If your runtime DOES expose an open workspace/project root to you ' +
10
+ '(e.g., Cursor, Cline, Zed, Claude Code): you can OMIT this field — ' +
11
+ 'the MCP server was launched from that same project and already knows the cwd. ' +
12
+ 'Providing it is harmless but unnecessary.\n' +
13
+ '\n' +
14
+ 'If you omit cwd and the tool returns an error about the project not being resolved or cwd being required, retry with cwd explicitly set to the project root path.\n' +
15
+ '\n' +
16
+ 'Never guess, never invent paths, never use relative paths.';
17
+ export const cwdField = z.string().optional().describe(CWD_DESCRIPTION);
@@ -1676,84 +1676,6 @@
1676
1676
  "reject.js"
1677
1677
  ]
1678
1678
  },
1679
- "space:list": {
1680
- "aliases": [],
1681
- "args": {},
1682
- "description": "List all teams and spaces (deprecated)",
1683
- "examples": [
1684
- "<%= config.bin %> space list"
1685
- ],
1686
- "flags": {
1687
- "format": {
1688
- "char": "f",
1689
- "description": "Output format",
1690
- "name": "format",
1691
- "default": "text",
1692
- "hasDynamicHelp": false,
1693
- "multiple": false,
1694
- "options": [
1695
- "text",
1696
- "json"
1697
- ],
1698
- "type": "option"
1699
- }
1700
- },
1701
- "hasDynamicHelp": false,
1702
- "hiddenAliases": [],
1703
- "id": "space:list",
1704
- "pluginAlias": "byterover-cli",
1705
- "pluginName": "byterover-cli",
1706
- "pluginType": "core",
1707
- "strict": true,
1708
- "enableJsonFlag": false,
1709
- "isESM": true,
1710
- "relativePath": [
1711
- "dist",
1712
- "oclif",
1713
- "commands",
1714
- "space",
1715
- "list.js"
1716
- ]
1717
- },
1718
- "space:switch": {
1719
- "aliases": [],
1720
- "args": {},
1721
- "description": "Switch to a different space (deprecated)",
1722
- "examples": [
1723
- "<%= config.bin %> space switch"
1724
- ],
1725
- "flags": {
1726
- "format": {
1727
- "char": "f",
1728
- "description": "Output format",
1729
- "name": "format",
1730
- "default": "text",
1731
- "hasDynamicHelp": false,
1732
- "multiple": false,
1733
- "options": [
1734
- "text",
1735
- "json"
1736
- ],
1737
- "type": "option"
1738
- }
1739
- },
1740
- "hasDynamicHelp": false,
1741
- "hiddenAliases": [],
1742
- "id": "space:switch",
1743
- "pluginAlias": "byterover-cli",
1744
- "pluginName": "byterover-cli",
1745
- "pluginType": "core",
1746
- "strict": true,
1747
- "enableJsonFlag": false,
1748
- "isESM": true,
1749
- "relativePath": [
1750
- "dist",
1751
- "oclif",
1752
- "commands",
1753
- "space",
1754
- "switch.js"
1755
- ]
1756
- },
1757
1679
  "source:add": {
1758
1680
  "aliases": [],
1759
1681
  "args": {
@@ -1877,57 +1799,31 @@
1877
1799
  "remove.js"
1878
1800
  ]
1879
1801
  },
1880
- "worktree:add": {
1802
+ "space:list": {
1881
1803
  "aliases": [],
1882
- "args": {
1883
- "path": {
1884
- "description": "Path to the directory to register as a worktree (relative or absolute)",
1885
- "name": "path",
1886
- "required": false
1887
- }
1888
- },
1889
- "description": "Register a directory as a worktree of this project",
1804
+ "args": {},
1805
+ "description": "List all teams and spaces (deprecated)",
1890
1806
  "examples": [
1891
- "<%= config.bin %> <%= command.id %> packages/api",
1892
- "<%= config.bin %> <%= command.id %> ../other-checkout",
1893
- "<%= config.bin %> <%= command.id %> (auto-detect parent from subdirectory)"
1807
+ "<%= config.bin %> space list"
1894
1808
  ],
1895
1809
  "flags": {
1896
- "force": {
1897
- "description": "Replace existing .brv/ directory in target with a worktree pointer",
1898
- "name": "force",
1899
- "allowNo": false,
1900
- "type": "boolean"
1810
+ "format": {
1811
+ "char": "f",
1812
+ "description": "Output format",
1813
+ "name": "format",
1814
+ "default": "text",
1815
+ "hasDynamicHelp": false,
1816
+ "multiple": false,
1817
+ "options": [
1818
+ "text",
1819
+ "json"
1820
+ ],
1821
+ "type": "option"
1901
1822
  }
1902
1823
  },
1903
1824
  "hasDynamicHelp": false,
1904
1825
  "hiddenAliases": [],
1905
- "id": "worktree:add",
1906
- "pluginAlias": "byterover-cli",
1907
- "pluginName": "byterover-cli",
1908
- "pluginType": "core",
1909
- "strict": true,
1910
- "enableJsonFlag": false,
1911
- "isESM": true,
1912
- "relativePath": [
1913
- "dist",
1914
- "oclif",
1915
- "commands",
1916
- "worktree",
1917
- "add.js"
1918
- ]
1919
- },
1920
- "worktree": {
1921
- "aliases": [],
1922
- "args": {},
1923
- "description": "Manage worktree links for subdirectories and sibling checkouts",
1924
- "examples": [
1925
- "<%= config.bin %> <%= command.id %> --help"
1926
- ],
1927
- "flags": {},
1928
- "hasDynamicHelp": false,
1929
- "hiddenAliases": [],
1930
- "id": "worktree",
1826
+ "id": "space:list",
1931
1827
  "pluginAlias": "byterover-cli",
1932
1828
  "pluginName": "byterover-cli",
1933
1829
  "pluginType": "core",
@@ -1938,53 +1834,35 @@
1938
1834
  "dist",
1939
1835
  "oclif",
1940
1836
  "commands",
1941
- "worktree",
1942
- "index.js"
1837
+ "space",
1838
+ "list.js"
1943
1839
  ]
1944
1840
  },
1945
- "worktree:list": {
1841
+ "space:switch": {
1946
1842
  "aliases": [],
1947
1843
  "args": {},
1948
- "description": "Show the current worktree link and list all registered worktrees",
1844
+ "description": "Switch to a different space (deprecated)",
1949
1845
  "examples": [
1950
- "<%= config.bin %> <%= command.id %>"
1846
+ "<%= config.bin %> space switch"
1951
1847
  ],
1952
- "flags": {},
1953
- "hasDynamicHelp": false,
1954
- "hiddenAliases": [],
1955
- "id": "worktree:list",
1956
- "pluginAlias": "byterover-cli",
1957
- "pluginName": "byterover-cli",
1958
- "pluginType": "core",
1959
- "strict": true,
1960
- "enableJsonFlag": false,
1961
- "isESM": true,
1962
- "relativePath": [
1963
- "dist",
1964
- "oclif",
1965
- "commands",
1966
- "worktree",
1967
- "list.js"
1968
- ]
1969
- },
1970
- "worktree:remove": {
1971
- "aliases": [],
1972
- "args": {
1973
- "path": {
1974
- "description": "Path to the worktree to remove (defaults to cwd)",
1975
- "name": "path",
1976
- "required": false
1848
+ "flags": {
1849
+ "format": {
1850
+ "char": "f",
1851
+ "description": "Output format",
1852
+ "name": "format",
1853
+ "default": "text",
1854
+ "hasDynamicHelp": false,
1855
+ "multiple": false,
1856
+ "options": [
1857
+ "text",
1858
+ "json"
1859
+ ],
1860
+ "type": "option"
1977
1861
  }
1978
1862
  },
1979
- "description": "Remove a worktree registration and its .brv pointer",
1980
- "examples": [
1981
- "<%= config.bin %> <%= command.id %> (remove cwd as worktree)",
1982
- "<%= config.bin %> <%= command.id %> packages/api (remove from parent)"
1983
- ],
1984
- "flags": {},
1985
1863
  "hasDynamicHelp": false,
1986
1864
  "hiddenAliases": [],
1987
- "id": "worktree:remove",
1865
+ "id": "space:switch",
1988
1866
  "pluginAlias": "byterover-cli",
1989
1867
  "pluginName": "byterover-cli",
1990
1868
  "pluginType": "core",
@@ -1995,8 +1873,8 @@
1995
1873
  "dist",
1996
1874
  "oclif",
1997
1875
  "commands",
1998
- "worktree",
1999
- "remove.js"
1876
+ "space",
1877
+ "switch.js"
2000
1878
  ]
2001
1879
  },
2002
1880
  "swarm:curate": {
@@ -2179,6 +2057,128 @@
2179
2057
  "status.js"
2180
2058
  ]
2181
2059
  },
2060
+ "worktree:add": {
2061
+ "aliases": [],
2062
+ "args": {
2063
+ "path": {
2064
+ "description": "Path to the directory to register as a worktree (relative or absolute)",
2065
+ "name": "path",
2066
+ "required": false
2067
+ }
2068
+ },
2069
+ "description": "Register a directory as a worktree of this project",
2070
+ "examples": [
2071
+ "<%= config.bin %> <%= command.id %> packages/api",
2072
+ "<%= config.bin %> <%= command.id %> ../other-checkout",
2073
+ "<%= config.bin %> <%= command.id %> (auto-detect parent from subdirectory)"
2074
+ ],
2075
+ "flags": {
2076
+ "force": {
2077
+ "description": "Replace existing .brv/ directory in target with a worktree pointer",
2078
+ "name": "force",
2079
+ "allowNo": false,
2080
+ "type": "boolean"
2081
+ }
2082
+ },
2083
+ "hasDynamicHelp": false,
2084
+ "hiddenAliases": [],
2085
+ "id": "worktree:add",
2086
+ "pluginAlias": "byterover-cli",
2087
+ "pluginName": "byterover-cli",
2088
+ "pluginType": "core",
2089
+ "strict": true,
2090
+ "enableJsonFlag": false,
2091
+ "isESM": true,
2092
+ "relativePath": [
2093
+ "dist",
2094
+ "oclif",
2095
+ "commands",
2096
+ "worktree",
2097
+ "add.js"
2098
+ ]
2099
+ },
2100
+ "worktree": {
2101
+ "aliases": [],
2102
+ "args": {},
2103
+ "description": "Manage worktree links for subdirectories and sibling checkouts",
2104
+ "examples": [
2105
+ "<%= config.bin %> <%= command.id %> --help"
2106
+ ],
2107
+ "flags": {},
2108
+ "hasDynamicHelp": false,
2109
+ "hiddenAliases": [],
2110
+ "id": "worktree",
2111
+ "pluginAlias": "byterover-cli",
2112
+ "pluginName": "byterover-cli",
2113
+ "pluginType": "core",
2114
+ "strict": true,
2115
+ "enableJsonFlag": false,
2116
+ "isESM": true,
2117
+ "relativePath": [
2118
+ "dist",
2119
+ "oclif",
2120
+ "commands",
2121
+ "worktree",
2122
+ "index.js"
2123
+ ]
2124
+ },
2125
+ "worktree:list": {
2126
+ "aliases": [],
2127
+ "args": {},
2128
+ "description": "Show the current worktree link and list all registered worktrees",
2129
+ "examples": [
2130
+ "<%= config.bin %> <%= command.id %>"
2131
+ ],
2132
+ "flags": {},
2133
+ "hasDynamicHelp": false,
2134
+ "hiddenAliases": [],
2135
+ "id": "worktree:list",
2136
+ "pluginAlias": "byterover-cli",
2137
+ "pluginName": "byterover-cli",
2138
+ "pluginType": "core",
2139
+ "strict": true,
2140
+ "enableJsonFlag": false,
2141
+ "isESM": true,
2142
+ "relativePath": [
2143
+ "dist",
2144
+ "oclif",
2145
+ "commands",
2146
+ "worktree",
2147
+ "list.js"
2148
+ ]
2149
+ },
2150
+ "worktree:remove": {
2151
+ "aliases": [],
2152
+ "args": {
2153
+ "path": {
2154
+ "description": "Path to the worktree to remove (defaults to cwd)",
2155
+ "name": "path",
2156
+ "required": false
2157
+ }
2158
+ },
2159
+ "description": "Remove a worktree registration and its .brv pointer",
2160
+ "examples": [
2161
+ "<%= config.bin %> <%= command.id %> (remove cwd as worktree)",
2162
+ "<%= config.bin %> <%= command.id %> packages/api (remove from parent)"
2163
+ ],
2164
+ "flags": {},
2165
+ "hasDynamicHelp": false,
2166
+ "hiddenAliases": [],
2167
+ "id": "worktree:remove",
2168
+ "pluginAlias": "byterover-cli",
2169
+ "pluginName": "byterover-cli",
2170
+ "pluginType": "core",
2171
+ "strict": true,
2172
+ "enableJsonFlag": false,
2173
+ "isESM": true,
2174
+ "relativePath": [
2175
+ "dist",
2176
+ "oclif",
2177
+ "commands",
2178
+ "worktree",
2179
+ "remove.js"
2180
+ ]
2181
+ },
2182
2182
  "vc:add": {
2183
2183
  "aliases": [],
2184
2184
  "args": {},
@@ -3080,5 +3080,5 @@
3080
3080
  ]
3081
3081
  }
3082
3082
  },
3083
- "version": "3.5.0"
3083
+ "version": "3.5.1"
3084
3084
  }
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "coding-assistant",
13
13
  "knowledge-management"
14
14
  ],
15
- "version": "3.5.0",
15
+ "version": "3.5.1",
16
16
  "author": "ByteRover",
17
17
  "bin": {
18
18
  "brv": "./bin/run.js"