@x-code-cli/core 0.2.10 → 0.3.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.
Files changed (258) hide show
  1. package/dist/agent/compression.d.ts +12 -2
  2. package/dist/agent/compression.d.ts.map +1 -1
  3. package/dist/agent/compression.js +51 -2
  4. package/dist/agent/compression.js.map +1 -1
  5. package/dist/agent/file-ingest.js +2 -2
  6. package/dist/agent/file-ingest.js.map +1 -1
  7. package/dist/agent/loop-state.d.ts +3 -2
  8. package/dist/agent/loop-state.d.ts.map +1 -1
  9. package/dist/agent/loop-state.js.map +1 -1
  10. package/dist/agent/loop.d.ts.map +1 -1
  11. package/dist/agent/loop.js +134 -5
  12. package/dist/agent/loop.js.map +1 -1
  13. package/dist/agent/memory-extractor.js +5 -5
  14. package/dist/agent/memory-extractor.js.map +1 -1
  15. package/dist/agent/plan-storage.js +1 -1
  16. package/dist/agent/plan-storage.js.map +1 -1
  17. package/dist/agent/sub-agents/index.d.ts +2 -1
  18. package/dist/agent/sub-agents/index.d.ts.map +1 -1
  19. package/dist/agent/sub-agents/index.js +1 -1
  20. package/dist/agent/sub-agents/index.js.map +1 -1
  21. package/dist/agent/sub-agents/loader.d.ts +13 -3
  22. package/dist/agent/sub-agents/loader.d.ts.map +1 -1
  23. package/dist/agent/sub-agents/loader.js +36 -9
  24. package/dist/agent/sub-agents/loader.js.map +1 -1
  25. package/dist/agent/sub-agents/registry.d.ts +18 -1
  26. package/dist/agent/sub-agents/registry.d.ts.map +1 -1
  27. package/dist/agent/sub-agents/registry.js +38 -5
  28. package/dist/agent/sub-agents/registry.js.map +1 -1
  29. package/dist/agent/sub-agents/runner.d.ts.map +1 -1
  30. package/dist/agent/sub-agents/runner.js +45 -1
  31. package/dist/agent/sub-agents/runner.js.map +1 -1
  32. package/dist/agent/sub-agents/types.d.ts +4 -1
  33. package/dist/agent/sub-agents/types.d.ts.map +1 -1
  34. package/dist/agent/system-prompt.d.ts +21 -0
  35. package/dist/agent/system-prompt.d.ts.map +1 -1
  36. package/dist/agent/system-prompt.js +68 -2
  37. package/dist/agent/system-prompt.js.map +1 -1
  38. package/dist/agent/tool-execution.d.ts.map +1 -1
  39. package/dist/agent/tool-execution.js +220 -1
  40. package/dist/agent/tool-execution.js.map +1 -1
  41. package/dist/commands/index.d.ts +6 -0
  42. package/dist/commands/index.d.ts.map +1 -0
  43. package/dist/commands/index.js +3 -0
  44. package/dist/commands/index.js.map +1 -0
  45. package/dist/commands/loader.d.ts +19 -0
  46. package/dist/commands/loader.d.ts.map +1 -0
  47. package/dist/commands/loader.js +109 -0
  48. package/dist/commands/loader.js.map +1 -0
  49. package/dist/commands/registry.d.ts +44 -0
  50. package/dist/commands/registry.d.ts.map +1 -0
  51. package/dist/commands/registry.js +102 -0
  52. package/dist/commands/registry.js.map +1 -0
  53. package/dist/commands/types.d.ts +23 -0
  54. package/dist/commands/types.d.ts.map +1 -0
  55. package/dist/commands/types.js +26 -0
  56. package/dist/commands/types.js.map +1 -0
  57. package/dist/config/index.d.ts +9 -0
  58. package/dist/config/index.d.ts.map +1 -1
  59. package/dist/config/index.js +12 -10
  60. package/dist/config/index.js.map +1 -1
  61. package/dist/hooks/bus.d.ts +54 -0
  62. package/dist/hooks/bus.d.ts.map +1 -0
  63. package/dist/hooks/bus.js +165 -0
  64. package/dist/hooks/bus.js.map +1 -0
  65. package/dist/hooks/config-schema.d.ts +854 -0
  66. package/dist/hooks/config-schema.d.ts.map +1 -0
  67. package/dist/hooks/config-schema.js +79 -0
  68. package/dist/hooks/config-schema.js.map +1 -0
  69. package/dist/hooks/executor.d.ts +16 -0
  70. package/dist/hooks/executor.d.ts.map +1 -0
  71. package/dist/hooks/executor.js +183 -0
  72. package/dist/hooks/executor.js.map +1 -0
  73. package/dist/hooks/index.d.ts +10 -0
  74. package/dist/hooks/index.d.ts.map +1 -0
  75. package/dist/hooks/index.js +6 -0
  76. package/dist/hooks/index.js.map +1 -0
  77. package/dist/hooks/registry.d.ts +23 -0
  78. package/dist/hooks/registry.d.ts.map +1 -0
  79. package/dist/hooks/registry.js +49 -0
  80. package/dist/hooks/registry.js.map +1 -0
  81. package/dist/hooks/types.d.ts +165 -0
  82. package/dist/hooks/types.d.ts.map +1 -0
  83. package/dist/hooks/types.js +25 -0
  84. package/dist/hooks/types.js.map +1 -0
  85. package/dist/hooks/variables.d.ts +22 -0
  86. package/dist/hooks/variables.d.ts.map +1 -0
  87. package/dist/hooks/variables.js +80 -0
  88. package/dist/hooks/variables.js.map +1 -0
  89. package/dist/index.d.ts +57 -2
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/index.js +38 -2
  92. package/dist/index.js.map +1 -1
  93. package/dist/knowledge/auto-memory.d.ts +1 -1
  94. package/dist/knowledge/auto-memory.d.ts.map +1 -1
  95. package/dist/knowledge/auto-memory.js +10 -10
  96. package/dist/knowledge/auto-memory.js.map +1 -1
  97. package/dist/knowledge/loader.js +12 -12
  98. package/dist/knowledge/loader.js.map +1 -1
  99. package/dist/mcp/arg-parser.d.ts +49 -0
  100. package/dist/mcp/arg-parser.d.ts.map +1 -0
  101. package/dist/mcp/arg-parser.js +357 -0
  102. package/dist/mcp/arg-parser.js.map +1 -0
  103. package/dist/mcp/client.d.ts +73 -0
  104. package/dist/mcp/client.d.ts.map +1 -0
  105. package/dist/mcp/client.js +376 -0
  106. package/dist/mcp/client.js.map +1 -0
  107. package/dist/mcp/config-schema.d.ts +64 -0
  108. package/dist/mcp/config-schema.d.ts.map +1 -0
  109. package/dist/mcp/config-schema.js +86 -0
  110. package/dist/mcp/config-schema.js.map +1 -0
  111. package/dist/mcp/config-writer.d.ts +41 -0
  112. package/dist/mcp/config-writer.d.ts.map +1 -0
  113. package/dist/mcp/config-writer.js +138 -0
  114. package/dist/mcp/config-writer.js.map +1 -0
  115. package/dist/mcp/env-safety.d.ts +12 -0
  116. package/dist/mcp/env-safety.d.ts.map +1 -0
  117. package/dist/mcp/env-safety.js +80 -0
  118. package/dist/mcp/env-safety.js.map +1 -0
  119. package/dist/mcp/expand-env.d.ts +14 -0
  120. package/dist/mcp/expand-env.d.ts.map +1 -0
  121. package/dist/mcp/expand-env.js +52 -0
  122. package/dist/mcp/expand-env.js.map +1 -0
  123. package/dist/mcp/loader.d.ts +81 -0
  124. package/dist/mcp/loader.d.ts.map +1 -0
  125. package/dist/mcp/loader.js +223 -0
  126. package/dist/mcp/loader.js.map +1 -0
  127. package/dist/mcp/name-mangling.d.ts +11 -0
  128. package/dist/mcp/name-mangling.d.ts.map +1 -0
  129. package/dist/mcp/name-mangling.js +82 -0
  130. package/dist/mcp/name-mangling.js.map +1 -0
  131. package/dist/mcp/oauth/callback-server.d.ts +25 -0
  132. package/dist/mcp/oauth/callback-server.d.ts.map +1 -0
  133. package/dist/mcp/oauth/callback-server.js +118 -0
  134. package/dist/mcp/oauth/callback-server.js.map +1 -0
  135. package/dist/mcp/oauth/provider.d.ts +80 -0
  136. package/dist/mcp/oauth/provider.d.ts.map +1 -0
  137. package/dist/mcp/oauth/provider.js +292 -0
  138. package/dist/mcp/oauth/provider.js.map +1 -0
  139. package/dist/mcp/oauth/token-storage.d.ts +42 -0
  140. package/dist/mcp/oauth/token-storage.d.ts.map +1 -0
  141. package/dist/mcp/oauth/token-storage.js +121 -0
  142. package/dist/mcp/oauth/token-storage.js.map +1 -0
  143. package/dist/mcp/permissions.d.ts +28 -0
  144. package/dist/mcp/permissions.d.ts.map +1 -0
  145. package/dist/mcp/permissions.js +105 -0
  146. package/dist/mcp/permissions.js.map +1 -0
  147. package/dist/mcp/registry.d.ts +150 -0
  148. package/dist/mcp/registry.d.ts.map +1 -0
  149. package/dist/mcp/registry.js +334 -0
  150. package/dist/mcp/registry.js.map +1 -0
  151. package/dist/mcp/resources.d.ts +7 -0
  152. package/dist/mcp/resources.d.ts.map +1 -0
  153. package/dist/mcp/resources.js +40 -0
  154. package/dist/mcp/resources.js.map +1 -0
  155. package/dist/mcp/tool-bridge.d.ts +16 -0
  156. package/dist/mcp/tool-bridge.d.ts.map +1 -0
  157. package/dist/mcp/tool-bridge.js +56 -0
  158. package/dist/mcp/tool-bridge.js.map +1 -0
  159. package/dist/mcp/trust.d.ts +31 -0
  160. package/dist/mcp/trust.d.ts.map +1 -0
  161. package/dist/mcp/trust.js +103 -0
  162. package/dist/mcp/trust.js.map +1 -0
  163. package/dist/mcp/types.d.ts +73 -0
  164. package/dist/mcp/types.d.ts.map +1 -0
  165. package/dist/mcp/types.js +13 -0
  166. package/dist/mcp/types.js.map +1 -0
  167. package/dist/permissions/index.d.ts +1 -1
  168. package/dist/permissions/index.d.ts.map +1 -1
  169. package/dist/permissions/index.js +10 -4
  170. package/dist/permissions/index.js.map +1 -1
  171. package/dist/permissions/session-store.d.ts +79 -17
  172. package/dist/permissions/session-store.d.ts.map +1 -1
  173. package/dist/permissions/session-store.js +298 -38
  174. package/dist/permissions/session-store.js.map +1 -1
  175. package/dist/plugins/consent.d.ts +87 -0
  176. package/dist/plugins/consent.d.ts.map +1 -0
  177. package/dist/plugins/consent.js +181 -0
  178. package/dist/plugins/consent.js.map +1 -0
  179. package/dist/plugins/enable-state.d.ts +34 -0
  180. package/dist/plugins/enable-state.d.ts.map +1 -0
  181. package/dist/plugins/enable-state.js +159 -0
  182. package/dist/plugins/enable-state.js.map +1 -0
  183. package/dist/plugins/installer.d.ts +64 -0
  184. package/dist/plugins/installer.d.ts.map +1 -0
  185. package/dist/plugins/installer.js +416 -0
  186. package/dist/plugins/installer.js.map +1 -0
  187. package/dist/plugins/integration.d.ts +91 -0
  188. package/dist/plugins/integration.d.ts.map +1 -0
  189. package/dist/plugins/integration.js +233 -0
  190. package/dist/plugins/integration.js.map +1 -0
  191. package/dist/plugins/loader.d.ts +69 -0
  192. package/dist/plugins/loader.d.ts.map +1 -0
  193. package/dist/plugins/loader.js +243 -0
  194. package/dist/plugins/loader.js.map +1 -0
  195. package/dist/plugins/manifest.d.ts +23 -0
  196. package/dist/plugins/manifest.d.ts.map +1 -0
  197. package/dist/plugins/manifest.js +143 -0
  198. package/dist/plugins/manifest.js.map +1 -0
  199. package/dist/plugins/marketplace.d.ts +103 -0
  200. package/dist/plugins/marketplace.d.ts.map +1 -0
  201. package/dist/plugins/marketplace.js +532 -0
  202. package/dist/plugins/marketplace.js.map +1 -0
  203. package/dist/plugins/paths.d.ts +44 -0
  204. package/dist/plugins/paths.d.ts.map +1 -0
  205. package/dist/plugins/paths.js +89 -0
  206. package/dist/plugins/paths.js.map +1 -0
  207. package/dist/plugins/refresh.d.ts +61 -0
  208. package/dist/plugins/refresh.d.ts.map +1 -0
  209. package/dist/plugins/refresh.js +98 -0
  210. package/dist/plugins/refresh.js.map +1 -0
  211. package/dist/plugins/registry.d.ts +40 -0
  212. package/dist/plugins/registry.d.ts.map +1 -0
  213. package/dist/plugins/registry.js +80 -0
  214. package/dist/plugins/registry.js.map +1 -0
  215. package/dist/plugins/types.d.ts +225 -0
  216. package/dist/plugins/types.d.ts.map +1 -0
  217. package/dist/plugins/types.js +16 -0
  218. package/dist/plugins/types.js.map +1 -0
  219. package/dist/plugins/user-config.d.ts +22 -0
  220. package/dist/plugins/user-config.d.ts.map +1 -0
  221. package/dist/plugins/user-config.js +96 -0
  222. package/dist/plugins/user-config.js.map +1 -0
  223. package/dist/skills/loader.d.ts +19 -0
  224. package/dist/skills/loader.d.ts.map +1 -0
  225. package/dist/skills/loader.js +197 -0
  226. package/dist/skills/loader.js.map +1 -0
  227. package/dist/skills/registry.d.ts +74 -0
  228. package/dist/skills/registry.d.ts.map +1 -0
  229. package/dist/skills/registry.js +136 -0
  230. package/dist/skills/registry.js.map +1 -0
  231. package/dist/skills/settings.d.ts +13 -0
  232. package/dist/skills/settings.d.ts.map +1 -0
  233. package/dist/skills/settings.js +100 -0
  234. package/dist/skills/settings.js.map +1 -0
  235. package/dist/tools/activate-skill.d.ts +5 -0
  236. package/dist/tools/activate-skill.d.ts.map +1 -0
  237. package/dist/tools/activate-skill.js +33 -0
  238. package/dist/tools/activate-skill.js.map +1 -0
  239. package/dist/tools/index.d.ts +1 -1
  240. package/dist/tools/shell-utils.d.ts.map +1 -1
  241. package/dist/tools/shell-utils.js +157 -6
  242. package/dist/tools/shell-utils.js.map +1 -1
  243. package/dist/tools/todo-write.d.ts +1 -1
  244. package/dist/tools/web-fetch.d.ts.map +1 -1
  245. package/dist/tools/web-fetch.js +2 -1
  246. package/dist/tools/web-fetch.js.map +1 -1
  247. package/dist/types/index.d.ts +46 -1
  248. package/dist/types/index.d.ts.map +1 -1
  249. package/dist/types/index.js.map +1 -1
  250. package/dist/utils.d.ts +23 -2
  251. package/dist/utils.d.ts.map +1 -1
  252. package/dist/utils.js +76 -20
  253. package/dist/utils.js.map +1 -1
  254. package/dist/version.d.ts +2 -0
  255. package/dist/version.d.ts.map +1 -0
  256. package/dist/version.js +47 -0
  257. package/dist/version.js.map +1 -0
  258. package/package.json +2 -1
@@ -0,0 +1,31 @@
1
+ export declare function isProjectTrusted(projectPath: string): Promise<boolean>;
2
+ export declare function trustProject(projectPath: string): Promise<void>;
3
+ export type TrustChoice = 'trust' | 'skip' | 'exit';
4
+ /** Ask the user whether to trust the project's MCP config.
5
+ *
6
+ * Caller passes a generic askUser callback (the same one the agent loop
7
+ * uses for askUser tool calls) so trust prompts render in the same dialog
8
+ * style as the rest of the UI. We show the actual command strings so the
9
+ * user can audit what would run.
10
+ *
11
+ * Returns:
12
+ * 'trust' — user accepted; caller should persist via trustProject(...)
13
+ * 'skip' — load only user-level mcpServers
14
+ * 'exit' — caller should terminate the CLI */
15
+ export declare function promptForTrust(projectPath: string, serverSummaries: Array<{
16
+ name: string;
17
+ preview: string;
18
+ }>, askUser: (question: string, options: Array<{
19
+ label: string;
20
+ description: string;
21
+ }>) => Promise<string>): Promise<TrustChoice>;
22
+ /** Build the one-line preview shown for each server in the trust dialog.
23
+ * Stdio servers expose their full command + args; HTTP servers show the
24
+ * URL. We intentionally don't truncate — the user needs to see the whole
25
+ * thing to make an informed call. */
26
+ export declare function buildServerPreview(config: {
27
+ command?: string;
28
+ args?: string[];
29
+ url?: string;
30
+ }): string;
31
+ //# sourceMappingURL=trust.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trust.d.ts","sourceRoot":"","sources":["../../src/mcp/trust.ts"],"names":[],"mappings":"AA8DA,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAI5E;AAED,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMrE;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAEnD;;;;;;;;;;kDAUkD;AAClD,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,EACzD,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,GACrG,OAAO,CAAC,WAAW,CAAC,CAiBtB;AAED;;;sCAGsC;AACtC,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAOtG"}
@@ -0,0 +1,103 @@
1
+ // @x-code-cli/core — MCP project-level trust gate
2
+ //
3
+ // A `.x-code/config.json` checked into a git repo can declare MCP servers
4
+ // with arbitrary `command` strings — i.e. cloning a hostile repo and
5
+ // launching the CLI would silently spawn whatever that command says.
6
+ // Before honouring any project-level mcpServers block, we therefore
7
+ // require an explicit consent step keyed to the absolute project path.
8
+ //
9
+ // Persistence file: ~/.x-code/trusted-projects.json (mode 0600).
10
+ // Format: { trusted: [{ path: <absolute>, trustedAt: <ISO> }, ...] }
11
+ //
12
+ // User config (~/.x-code/config.json) is NOT subject to this gate —
13
+ // the user wrote it themselves; trust is implicit.
14
+ import fs from 'node:fs/promises';
15
+ import path from 'node:path';
16
+ import { userXcodeDir } from '../utils.js';
17
+ function trustedFile() {
18
+ return path.join(userXcodeDir(), 'trusted-projects.json');
19
+ }
20
+ /** Normalise a path for stable comparison across platforms.
21
+ * Absolute + resolved + lowercased on Windows (case-insensitive FS),
22
+ * preserved case on macOS/Linux. */
23
+ function normalize(p) {
24
+ const resolved = path.resolve(p);
25
+ return process.platform === 'win32' ? resolved.toLowerCase() : resolved;
26
+ }
27
+ async function readStore() {
28
+ try {
29
+ const raw = await fs.readFile(trustedFile(), 'utf-8');
30
+ const parsed = JSON.parse(raw);
31
+ if (parsed && typeof parsed === 'object' && Array.isArray(parsed.trusted)) {
32
+ return parsed;
33
+ }
34
+ }
35
+ catch {
36
+ // missing file or malformed — start fresh
37
+ }
38
+ return { trusted: [] };
39
+ }
40
+ async function writeStore(store) {
41
+ await fs.mkdir(userXcodeDir(), { recursive: true });
42
+ // Atomic write: tmp + rename. Avoids a half-written file if the process
43
+ // is killed mid-write (the trust file is small but the principle holds —
44
+ // we never want a corrupted JSON to lock the user out of MCP).
45
+ const tmp = trustedFile() + '.tmp';
46
+ await fs.writeFile(tmp, JSON.stringify(store, null, 2) + '\n', { encoding: 'utf-8', mode: 0o600 });
47
+ await fs.rename(tmp, trustedFile());
48
+ }
49
+ export async function isProjectTrusted(projectPath) {
50
+ const normalized = normalize(projectPath);
51
+ const store = await readStore();
52
+ return store.trusted.some((e) => normalize(e.path) === normalized);
53
+ }
54
+ export async function trustProject(projectPath) {
55
+ const normalized = normalize(projectPath);
56
+ const store = await readStore();
57
+ if (store.trusted.some((e) => normalize(e.path) === normalized))
58
+ return;
59
+ store.trusted.push({ path: path.resolve(projectPath), trustedAt: new Date().toISOString() });
60
+ await writeStore(store);
61
+ }
62
+ /** Ask the user whether to trust the project's MCP config.
63
+ *
64
+ * Caller passes a generic askUser callback (the same one the agent loop
65
+ * uses for askUser tool calls) so trust prompts render in the same dialog
66
+ * style as the rest of the UI. We show the actual command strings so the
67
+ * user can audit what would run.
68
+ *
69
+ * Returns:
70
+ * 'trust' — user accepted; caller should persist via trustProject(...)
71
+ * 'skip' — load only user-level mcpServers
72
+ * 'exit' — caller should terminate the CLI */
73
+ export async function promptForTrust(projectPath, serverSummaries, askUser) {
74
+ const lines = serverSummaries.map((s) => ` • ${s.name}: ${s.preview}`).join('\n');
75
+ const question = `This project wants to load ${serverSummaries.length} MCP server(s):\n` +
76
+ lines +
77
+ `\n\nThese commands will run on your machine. Trust only if you trust this project.`;
78
+ const answer = await askUser(question, [
79
+ { label: 'Trust this project', description: 'Remember this choice. The project MCP servers will load.' },
80
+ { label: 'Skip project MCP', description: 'Use only user-level mcpServers for this session. No write to disk.' },
81
+ { label: 'Exit X-Code', description: 'Close the CLI without loading any MCP servers.' },
82
+ ]);
83
+ const lower = answer.toLowerCase();
84
+ if (lower.startsWith('trust'))
85
+ return 'trust';
86
+ if (lower.startsWith('exit'))
87
+ return 'exit';
88
+ return 'skip';
89
+ }
90
+ /** Build the one-line preview shown for each server in the trust dialog.
91
+ * Stdio servers expose their full command + args; HTTP servers show the
92
+ * URL. We intentionally don't truncate — the user needs to see the whole
93
+ * thing to make an informed call. */
94
+ export function buildServerPreview(config) {
95
+ if (config.url)
96
+ return config.url;
97
+ if (config.command) {
98
+ const parts = [config.command, ...(config.args ?? [])];
99
+ return parts.join(' ');
100
+ }
101
+ return '(invalid config)';
102
+ }
103
+ //# sourceMappingURL=trust.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trust.js","sourceRoot":"","sources":["../../src/mcp/trust.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,0EAA0E;AAC1E,qEAAqE;AACrE,qEAAqE;AACrE,oEAAoE;AACp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
+ command: string;
4
+ args?: string[];
5
+ env?: Record<string, string>;
6
+ cwd?: string;
7
+ /** First-connect timeout in ms. Default 30_000. */
8
+ timeout?: number;
9
+ /** Default true. Setting to false skips the server entirely. */
10
+ enabled?: boolean;
11
+ }
12
+ /** Streamable HTTP MCP server (remote). */
13
+ export interface McpHttpServerConfig {
14
+ url: string;
15
+ /** Static headers attached to every request (e.g. `X-Custom: foo`).
16
+ * OAuth `Authorization: Bearer ...` is added automatically — do NOT put
17
+ * the access token here, store it via the OAuth flow instead. */
18
+ headers?: Record<string, string>;
19
+ timeout?: number;
20
+ enabled?: boolean;
21
+ }
22
+ export type McpServerConfig = McpStdioServerConfig | McpHttpServerConfig;
23
+ /** Discriminator: tells stdio vs http servers apart at runtime. */
24
+ export declare function isStdioConfig(c: McpServerConfig): c is McpStdioServerConfig;
25
+ export declare function isHttpConfig(c: McpServerConfig): c is McpHttpServerConfig;
26
+ /** Per-server runtime status. UI reads this via /mcp list. */
27
+ export type McpServerStatus = {
28
+ kind: 'disabled';
29
+ } | {
30
+ kind: 'connecting';
31
+ } | {
32
+ kind: 'connected';
33
+ toolCount: number;
34
+ resourceCount: number;
35
+ } | {
36
+ kind: 'needs_auth';
37
+ authUrl?: string;
38
+ } | {
39
+ kind: 'failed';
40
+ error: string;
41
+ };
42
+ /** One MCP tool, after name-mangling.
43
+ *
44
+ * callableName is the model-facing name (<server>__<tool>);
45
+ * rawName is what we pass back to client.callTool — MCP servers don't
46
+ * know about our prefix scheme. */
47
+ export interface McpToolEntry {
48
+ callableName: string;
49
+ rawName: string;
50
+ serverName: string;
51
+ description: string;
52
+ /** JSON Schema as received from the server. We pass it directly to the
53
+ * AI SDK via `jsonSchema(...)` — no zod conversion. */
54
+ inputSchema: Record<string, unknown>;
55
+ }
56
+ /** One MCP resource (data the server lets us pull). */
57
+ export interface McpResourceEntry {
58
+ uri: string;
59
+ name: string;
60
+ description?: string;
61
+ mimeType?: string;
62
+ serverName: string;
63
+ }
64
+ /** Result of calling an MCP tool — flattened from MCP's content-blocks
65
+ * into something we can shove into a tool_result message. The raw blocks
66
+ * are kept on the side in case a future UI wants images/audio. */
67
+ export interface McpCallResult {
68
+ /** Text representation suitable for tool_result. */
69
+ text: string;
70
+ /** True iff the server marked the call as an error (MCP `isError` flag). */
71
+ isError: boolean;
72
+ }
73
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/mcp/types.ts"],"names":[],"mappings":"AAMA,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,2CAA2C;AAC3C,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAA;IACX;;sEAEkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAAG,mBAAmB,CAAA;AAExE,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC,IAAI,oBAAoB,CAE3E;AACD,wBAAgB,YAAY,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC,IAAI,mBAAmB,CAEzE;AAED,8DAA8D;AAC9D,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAErC;;;;oCAIoC;AACpC,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB;4DACwD;IACxD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACrC;AAED,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;mEAEmE;AACnE,MAAM,WAAW,aAAa;IAC5B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAA;IACZ,4EAA4E;IAC5E,OAAO,EAAE,OAAO,CAAA;CACjB"}
@@ -0,0 +1,13 @@
1
+ // @x-code-cli/core — MCP public types
2
+ //
3
+ // Shared shapes used across the mcp/ subsystem. Kept dependency-free so the
4
+ // loader/registry/UI layers can import without circular hops back into the
5
+ // agent loop or CLI.
6
+ /** Discriminator: tells stdio vs http servers apart at runtime. */
7
+ export function isStdioConfig(c) {
8
+ return 'command' in c;
9
+ }
10
+ export function isHttpConfig(c) {
11
+ return 'url' in c;
12
+ }
13
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/mcp/types.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,qBAAqB;AA2BrB,mEAAmE;AACnE,MAAM,UAAU,aAAa,CAAC,CAAkB;IAC9C,OAAO,SAAS,IAAI,CAAC,CAAA;AACvB,CAAC;AACD,MAAM,UAAU,YAAY,CAAC,CAAkB;IAC7C,OAAO,KAAK,IAAI,CAAC,CAAA;AACnB,CAAC"}
@@ -33,6 +33,6 @@ export declare function checkPermission(toolCall: {
33
33
  input: PermissionInput;
34
34
  }) => Promise<'yes' | 'always' | 'no'>, permissionMode?: PermissionMode, cwd?: string): Promise<boolean>;
35
35
  export { addSessionAllowRule, clearSessionRules, buildAllowRule } from './session-store.js';
36
- export { extractCommandPrefix, suggestRuleLabel } from './session-store.js';
36
+ export { extractCommandPrefix, extractCompoundPrefixes, extractCompoundRules, suggestRuleLabel, } from './session-store.js';
37
37
  export { loadPersistedRules, persistRule } from './session-store.js';
38
38
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/permissions/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAGxE,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAmD9C,2CAA2C;AAC3C,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,eAAe,CAI5F;AAmBD;;uDAEuD;AACvD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAKjF;AAMD;;;;;;;;;;;;;;;;uBAgBuB;AACvB,wBAAsB,eAAe,CACnC,QAAQ,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,eAAe,CAAA;CAAE,EAC1E,SAAS,EAAE,OA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AAK,EAAE,eAAe,CAAA;CACvB,KAAK,OAAO,CAAC,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC,EACtC,cAAc,GAAE,cAA0B,EAC1C,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CA8BlB;AAED,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAC3F,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA"}
@@ -121,15 +121,21 @@ export async function checkPermission(toolCall, trustMode, onAskPermission, perm
121
121
  if (decision === 'always') {
122
122
  const result = buildAllowRule(toolCall.toolName, toolCall.input);
123
123
  if (result) {
124
- addSessionAllowRule(result.rule);
125
- if (result.persist && cwd)
126
- persistRule(cwd, result.rule);
124
+ // buildAllowRule may return >1 rule for compound shells like
125
+ // `git commit && git push` — the user-visible label
126
+ // ("git commit:*, git push:*") shows both, and we save both
127
+ // here so the next compound invocation auto-approves.
128
+ for (const rule of result.rules) {
129
+ addSessionAllowRule(rule);
130
+ if (result.persist && cwd)
131
+ persistRule(cwd, rule);
132
+ }
127
133
  }
128
134
  return true;
129
135
  }
130
136
  return decision === 'yes';
131
137
  }
132
138
  export { addSessionAllowRule, clearSessionRules, buildAllowRule } from './session-store.js';
133
- export { extractCommandPrefix, suggestRuleLabel } from './session-store.js';
139
+ export { extractCommandPrefix, extractCompoundPrefixes, extractCompoundRules, suggestRuleLabel, } from './session-store.js';
134
140
  export { loadPersistedRules, persistRule } from './session-store.js';
135
141
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/permissions/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAA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AAC;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,QAAQ,KAAK,KAAK,CAAA;AAC3B,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAC3F,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA"}
@@ -24,45 +24,107 @@ export interface AllowRule {
24
24
  * 'powershell -ExecutionPolicy Bypass -c "git status"' → 'git'
25
25
  * 'pwsh -Command "& { Get-Process }"' → 'Get-Process'
26
26
  * 'powershell -Command Get-Date' → 'Get-Date'
27
+ * 'Get-ChildItem -Recurse -Filter *.ts' → 'Get-ChildItem'
28
+ * 'Invoke-WebRequest -Uri http://api' → 'Invoke-WebRequest'
29
+ * 'cd /tmp && npm test' → 'npm test'
30
+ * 'cd D:\\foo && npx tsc --noEmit | head -40' → 'npx tsc'
31
+ * 'Set-Location D:\\foo; Get-ChildItem -Recurse | Sort-Object Name'
32
+ * → 'Get-ChildItem'
33
+ * 'npm install && curl bad.com' → null
34
+ * (two distinct
35
+ * non-readonly
36
+ * segments — no
37
+ * shared prefix,
38
+ * fall back to
39
+ * exact)
40
+ * 'git commit -m a && git push' → null (segments
41
+ * disagree on
42
+ * prefix)
27
43
  * 'ls -la' → null
28
44
  * '' → null
29
45
  */
30
46
  export declare function extractCommandPrefix(command: string): string | null;
47
+ /**
48
+ * Like {@link extractCommandPrefix} but for compound commands returns the
49
+ * full set of distinct prefixes — one per non-read-only, non-cd segment.
50
+ *
51
+ * Returns `null` if any non-read-only segment has no derivable prefix
52
+ * (the caller has a richer fallback via {@link extractCompoundRules} now)
53
+ * or if every segment was filtered out as read-only / cd-like (mostly
54
+ * defensive — those auto-allow upstream).
55
+ *
56
+ * Kept exported for compatibility with consumers that only need the
57
+ * prefix list — current internal callers use the richer
58
+ * {@link extractCompoundRules}.
59
+ */
60
+ export declare function extractCompoundPrefixes(command: string): string[] | null;
61
+ /**
62
+ * Per-segment rule extraction for compound commands. Returns one rule
63
+ * per non-read-only, non-cd segment:
64
+ * - prefix rule when the segment has a derivable prefix (e.g.
65
+ * `git commit -m foo` → `{ type: 'prefix', pattern: 'git commit' }`)
66
+ * - segment-level exact rule otherwise (e.g. `curl evil.com` →
67
+ * `{ type: 'exact', pattern: 'curl evil.com' }`)
68
+ *
69
+ * The mix is the point: `git commit && curl evil.com` was previously
70
+ * collapsing to a single full-command exact-match because `curl evil.com`
71
+ * has no prefix, throwing away the perfectly-derivable `git commit:*`.
72
+ * The label now reads `git commit:*, curl evil.com` and one click saves
73
+ * both rules. The matcher accepts an exact rule either against the full
74
+ * command (legacy) or against any non-readonly segment, so future
75
+ * `cd /tmp && git commit -m b && curl evil.com` auto-approves cleanly.
76
+ *
77
+ * Returns `null` if no segment yielded a rule (all-readonly compounds —
78
+ * auto-allowed upstream, never reaches us in practice) or if we hit a
79
+ * non-whitelisted env-var prefix that disqualifies the segment (same
80
+ * security gate as the single-cmd path).
81
+ */
82
+ export declare function extractCompoundRules(command: string): AllowRule[] | null;
31
83
  /**
32
84
  * Generate the display label for the "don't ask again" option.
33
85
  * Returns `null` only for tools where a "don't ask again" affordance
34
86
  * makes no sense (enterPlanMode toggles a mode, not a recurring action).
35
87
  *
36
- * Shell with derivable prefix: `git commit:*`
37
- * Shell without derivable prefix: `this exact command` (exact-match rule —
38
- * covers Windows-style commands like `findstr /n …`, `cmd /c …`,
88
+ * Shell, single derivable prefix: `git commit:*`
89
+ * Shell, multiple derivable prefixes (compound where segments disagree
90
+ * e.g. `git commit && git push`): `git commit:*, git push:*`
91
+ * — the click saves BOTH rules so subsequent compound invocations
92
+ * stop prompting.
93
+ * Shell, no derivable prefix: `this exact command` (exact-match
94
+ * rule — covers Windows-style commands like `findstr /n …`, `cmd /c …`,
39
95
  * `dir /b`, where the second token is a `/flag` or path that fails
40
96
  * the prefix regex; without this fallback the user gets only Yes/No
41
97
  * forever for repeated identical commands).
42
98
  * Write tools (writeFile / edit): `all edits this session` (session-only)
99
+ * MCP tools (isMcp=true): `this MCP tool` (persisted to disk via
100
+ * McpPermissionStore — the label matches that posture, unlike write
101
+ * tools which fall back to session-only).
43
102
  */
44
- export declare function suggestRuleLabel(toolName: string, input: Record<string, unknown>): string | null;
103
+ export declare function suggestRuleLabel(toolName: string, input: Record<string, unknown>, isMcp?: boolean): string | null;
45
104
  /**
46
- * Build the AllowRule for a "don't ask again" approval.
105
+ * Build the AllowRule(s) for a "don't ask again" approval.
47
106
  *
48
- * - Shell with derivable prefix (e.g. `git commit`) → prefix rule, persisted
49
- * - Shell without derivable prefix → exact-match rule,
50
- * persisted (mirrors Claude Code's `suggestionForExactCommand`
51
- * fallback in `bashPermissions.ts`). Less reusable than a prefix rule
52
- * (any arg change breaks the match) but at least suppresses repeated
53
- * identical invocations better than "Yes/No forever". The matcher
54
- * compares against `stripEnvVars(cmd)` so leading `NODE_ENV=…` etc.
55
- * don't defeat the rule.
56
- * - writeFile / edit → tool-wide allow,
57
- * session-only (matches Claude Code).
107
+ * - Shell with derivable prefix(es) → one prefix rule per distinct
108
+ * non-read-only segment. `git commit && git push` saves BOTH
109
+ * `git commit:*` and `git push:*` on a single click (matching the
110
+ * compound label shown to the user). Persisted to disk.
111
+ * - Shell without derivable prefix → single exact-match rule, persisted
112
+ * (mirrors Claude Code's `suggestionForExactCommand` fallback in
113
+ * `bashPermissions.ts`). Less reusable than a prefix rule (any arg
114
+ * change breaks the match) but at least suppresses repeated identical
115
+ * invocations better than "Yes/No forever". The matcher compares
116
+ * against `stripEnvVars(cmd)` so leading `NODE_ENV=…` etc. don't defeat
117
+ * the rule.
118
+ * - writeFile / edit → single tool-wide allow, session-only (matches
119
+ * Claude Code).
58
120
  *
59
- * `persist` indicates whether the rule should be saved to disk. Write
121
+ * `persist` indicates whether the rules should be saved to disk. Write
60
122
  * tools return persist=false; everything else returns persist=true.
61
123
  * Returns `null` only for the very few cases where no rule shape applies
62
124
  * (currently nothing — kept in the signature so callers stay defensive).
63
125
  */
64
126
  export declare function buildAllowRule(toolName: string, input: Record<string, unknown>): {
65
- rule: AllowRule;
127
+ rules: AllowRule[];
66
128
  persist: boolean;
67
129
  } | null;
68
130
  export declare function addSessionAllowRule(rule: AllowRule): void;
@@ -1 +1 @@
1
- {"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../../src/permissions/session-store.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;CAClC;AA4ID;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA+CnE;AAyED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAShG;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAgB9C;AA8ED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAEzD;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAE3F;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAID;;;;GAI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