@agentteams/cli 0.1.76 → 0.1.78

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 (101) hide show
  1. package/.eslintcache +1 -1
  2. package/dist/api/convention.d.ts +11 -0
  3. package/dist/api/convention.d.ts.map +1 -0
  4. package/dist/api/convention.js +26 -0
  5. package/dist/api/convention.js.map +1 -0
  6. package/dist/api/document.d.ts +1 -1
  7. package/dist/api/document.d.ts.map +1 -1
  8. package/dist/api/document.js.map +1 -1
  9. package/dist/commands/agentConfig.d.ts.map +1 -1
  10. package/dist/commands/agentConfig.js +2 -1
  11. package/dist/commands/agentConfig.js.map +1 -1
  12. package/dist/commands/convention.d.ts.map +1 -1
  13. package/dist/commands/convention.js +9 -10
  14. package/dist/commands/convention.js.map +1 -1
  15. package/dist/commands/dependency.d.ts.map +1 -1
  16. package/dist/commands/dependency.js +2 -1
  17. package/dist/commands/dependency.js.map +1 -1
  18. package/dist/commands/index.d.ts.map +1 -1
  19. package/dist/commands/index.js +1 -19
  20. package/dist/commands/index.js.map +1 -1
  21. package/dist/commands/init.d.ts.map +1 -1
  22. package/dist/commands/init.js +2 -1
  23. package/dist/commands/init.js.map +1 -1
  24. package/dist/commands/mcp.d.ts +13 -0
  25. package/dist/commands/mcp.d.ts.map +1 -0
  26. package/dist/commands/mcp.js +13 -0
  27. package/dist/commands/mcp.js.map +1 -0
  28. package/dist/commands/search.d.ts.map +1 -1
  29. package/dist/commands/search.js +8 -35
  30. package/dist/commands/search.js.map +1 -1
  31. package/dist/index.js +71 -0
  32. package/dist/index.js.map +1 -1
  33. package/dist/mcp/context.d.ts +15 -0
  34. package/dist/mcp/context.d.ts.map +1 -0
  35. package/dist/mcp/context.js +47 -0
  36. package/dist/mcp/context.js.map +1 -0
  37. package/dist/mcp/resources.d.ts +17 -0
  38. package/dist/mcp/resources.d.ts.map +1 -0
  39. package/dist/mcp/resources.js +50 -0
  40. package/dist/mcp/resources.js.map +1 -0
  41. package/dist/mcp/server.d.ts +20 -0
  42. package/dist/mcp/server.d.ts.map +1 -0
  43. package/dist/mcp/server.js +107 -0
  44. package/dist/mcp/server.js.map +1 -0
  45. package/dist/mcp/tools.d.ts +12 -0
  46. package/dist/mcp/tools.d.ts.map +1 -0
  47. package/dist/mcp/tools.js +54 -0
  48. package/dist/mcp/tools.js.map +1 -0
  49. package/dist/mcp-registration/atomicWrite.d.ts +26 -0
  50. package/dist/mcp-registration/atomicWrite.d.ts.map +1 -0
  51. package/dist/mcp-registration/atomicWrite.js +58 -0
  52. package/dist/mcp-registration/atomicWrite.js.map +1 -0
  53. package/dist/mcp-registration/clients.d.ts +5 -0
  54. package/dist/mcp-registration/clients.d.ts.map +1 -0
  55. package/dist/mcp-registration/clients.js +300 -0
  56. package/dist/mcp-registration/clients.js.map +1 -0
  57. package/dist/mcp-registration/detect.d.ts +23 -0
  58. package/dist/mcp-registration/detect.d.ts.map +1 -0
  59. package/dist/mcp-registration/detect.js +48 -0
  60. package/dist/mcp-registration/detect.js.map +1 -0
  61. package/dist/mcp-registration/index.d.ts +50 -0
  62. package/dist/mcp-registration/index.d.ts.map +1 -0
  63. package/dist/mcp-registration/index.js +205 -0
  64. package/dist/mcp-registration/index.js.map +1 -0
  65. package/dist/mcp-registration/install.d.ts +66 -0
  66. package/dist/mcp-registration/install.d.ts.map +1 -0
  67. package/dist/mcp-registration/install.js +244 -0
  68. package/dist/mcp-registration/install.js.map +1 -0
  69. package/dist/mcp-registration/jsonc.d.ts +44 -0
  70. package/dist/mcp-registration/jsonc.d.ts.map +1 -0
  71. package/dist/mcp-registration/jsonc.js +266 -0
  72. package/dist/mcp-registration/jsonc.js.map +1 -0
  73. package/dist/mcp-registration/render.d.ts +18 -0
  74. package/dist/mcp-registration/render.d.ts.map +1 -0
  75. package/dist/mcp-registration/render.js +91 -0
  76. package/dist/mcp-registration/render.js.map +1 -0
  77. package/dist/mcp-registration/serverSpec.d.ts +31 -0
  78. package/dist/mcp-registration/serverSpec.d.ts.map +1 -0
  79. package/dist/mcp-registration/serverSpec.js +29 -0
  80. package/dist/mcp-registration/serverSpec.js.map +1 -0
  81. package/dist/mcp-registration/types.d.ts +98 -0
  82. package/dist/mcp-registration/types.d.ts.map +1 -0
  83. package/dist/mcp-registration/types.js +12 -0
  84. package/dist/mcp-registration/types.js.map +1 -0
  85. package/dist/mcp-registration/vendorCommand.d.ts +18 -0
  86. package/dist/mcp-registration/vendorCommand.d.ts.map +1 -0
  87. package/dist/mcp-registration/vendorCommand.js +27 -0
  88. package/dist/mcp-registration/vendorCommand.js.map +1 -0
  89. package/dist/utils/apiContext.d.ts +22 -0
  90. package/dist/utils/apiContext.d.ts.map +1 -0
  91. package/dist/utils/apiContext.js +39 -0
  92. package/dist/utils/apiContext.js.map +1 -0
  93. package/dist/utils/entityId.d.ts +12 -0
  94. package/dist/utils/entityId.d.ts.map +1 -1
  95. package/dist/utils/entityId.js +2 -4
  96. package/dist/utils/entityId.js.map +1 -1
  97. package/dist/utils/searchParams.d.ts +22 -0
  98. package/dist/utils/searchParams.d.ts.map +1 -0
  99. package/dist/utils/searchParams.js +32 -0
  100. package/dist/utils/searchParams.js.map +1 -0
  101. package/package.json +9 -3
@@ -0,0 +1,107 @@
1
+ import { createRequire } from 'node:module';
2
+ import { McpServer, ResourceTemplate } from '@modelcontextprotocol/server';
3
+ import { serveStdio } from '@modelcontextprotocol/server/stdio';
4
+ import { handleError } from '../utils/errors.js';
5
+ import { resolveMcpToolContext } from './context.js';
6
+ import { getResourceSpecs } from './resources.js';
7
+ import { createCliContextToolsClient, getToolSpecs } from './tools.js';
8
+ const require = createRequire(import.meta.url);
9
+ const pkg = require('../../package.json');
10
+ export const MCP_SERVER_NAME = '@agentteams/cli';
11
+ /**
12
+ * Build one MCP server instance. `serveStdio` calls this per connection (and
13
+ * per discarded `server/discover` probe), so it must stay side-effect free
14
+ * apart from stderr diagnostics.
15
+ *
16
+ * This module is the only place allowed to import the MCP SDK or assemble MCP
17
+ * response envelopes: domain handlers stay SDK-agnostic so upgrading the
18
+ * pinned beta only touches this adapter.
19
+ */
20
+ export function createMcpServer(context, version = pkg.version) {
21
+ // Read-only surface: tools plus single-entity resource templates. Prompts
22
+ // and Extensions stay out of scope for Phase 1.
23
+ const server = new McpServer({ name: MCP_SERVER_NAME, version }, { capabilities: { tools: {}, resources: {} } });
24
+ registerTools(server, context);
25
+ registerResources(server, context);
26
+ return server;
27
+ }
28
+ /** The single `registerTool` loop — tool envelopes are assembled only here. */
29
+ function registerTools(server, context) {
30
+ const client = createCliContextToolsClient(context);
31
+ for (const spec of getToolSpecs()) {
32
+ server.registerTool(spec.name, {
33
+ title: spec.title,
34
+ description: spec.description,
35
+ inputSchema: spec.inputSchema,
36
+ }, async (args) => {
37
+ try {
38
+ // The SDK has already validated `args` against `spec.inputSchema`
39
+ // before this callback runs, so the record cast is safe.
40
+ const result = await spec.handler(args, client);
41
+ return { content: [{ type: 'text', text: JSON.stringify(result) }] };
42
+ }
43
+ catch (error) {
44
+ // API failures are reported as a tool error so the connection survives.
45
+ return {
46
+ content: [{ type: 'text', text: handleError(error, { apiUrl: context.apiUrl }) }],
47
+ isError: true,
48
+ };
49
+ }
50
+ });
51
+ }
52
+ }
53
+ /**
54
+ * The single `registerResource` loop — resource envelopes and JSON-RPC error
55
+ * mapping live only here. Every template hides enumeration (`list: undefined`):
56
+ * entity listing is the search/list tools' job, and a full dump would be
57
+ * unbounded.
58
+ */
59
+ function registerResources(server, context) {
60
+ for (const spec of getResourceSpecs()) {
61
+ server.registerResource(spec.name, new ResourceTemplate(spec.uriTemplate, { list: undefined }), {
62
+ title: spec.title,
63
+ description: spec.description,
64
+ mimeType: 'application/json',
65
+ }, async (uri, variables) => {
66
+ try {
67
+ const result = await spec.handler(normalizeVariables(variables), context);
68
+ return {
69
+ contents: [{ uri: uri.href, mimeType: 'application/json', text: JSON.stringify(result) }],
70
+ };
71
+ }
72
+ catch (error) {
73
+ // Unlike tools (isError envelope), resource failures surface as
74
+ // JSON-RPC errors: rethrow with the translated message and let the
75
+ // SDK build the error frame — the connection itself survives.
76
+ throw new Error(handleError(error, { apiUrl: context.apiUrl }));
77
+ }
78
+ });
79
+ }
80
+ }
81
+ /** The SDK hands template variables as `string | string[]`; specs expect plain strings. */
82
+ function normalizeVariables(variables) {
83
+ const normalized = {};
84
+ for (const [key, value] of Object.entries(variables)) {
85
+ normalized[key] = Array.isArray(value) ? (value[0] ?? '') : value;
86
+ }
87
+ return normalized;
88
+ }
89
+ /**
90
+ * Start the stdio MCP server. stdout is reserved for JSON-RPC frames, so every
91
+ * diagnostic goes to stderr.
92
+ */
93
+ export function startMcpServer(options = {}) {
94
+ const context = resolveMcpToolContext(options);
95
+ writeDiagnostic(`serving stdio (cli ${pkg.version}) apiUrl=${context.apiUrl} projectId=${context.projectId}`);
96
+ return serveStdio((ctx) => {
97
+ // The era tells us whether the client negotiated the modern
98
+ // (`server/discover`) or legacy (`initialize`) revision — the key
99
+ // observation this spike has to record.
100
+ writeDiagnostic(`connection era=${ctx.era}`);
101
+ return createMcpServer(context);
102
+ });
103
+ }
104
+ function writeDiagnostic(message) {
105
+ process.stderr.write(`[agentteams mcp] ${message}\n`);
106
+ }
107
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,UAAU,EAA0B,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAuB,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,2BAA2B,EAAE,YAAY,EAAE,MAAM,YAAY,CA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E,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAClE,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,2FAA2F;AAC3F,SAAS,kBAAkB,CAAC,SAA4C;IACtE,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACrD,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACpE,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,UAAmC,EAAE;IAClE,MAAM,OAAO,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAE/C,eAAe,CAAC,sBAAsB,GAAG,CAAC,OAAO,YAAY,OAAO,CAAC,MAAM,cAAc,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAE9G,OAAO,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE;QACxB,4DAA4D;QAC5D,kEAAkE;QAClE,wCAAwC;QACxC,eAAe,CAAC,kBAAkB,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7C,OAAO,eAAe,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,eAAe,CAAC,OAAe;IACtC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,OAAO,IAAI,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { SEARCH_TOOL_NAME, type ContextToolsClient, type ContextToolSpec } from '@agentteams/context-tools';
2
+ import type { McpToolContext } from './context.js';
3
+ export { SEARCH_TOOL_NAME };
4
+ export type McpToolSpec = ContextToolSpec;
5
+ /**
6
+ * Bind the transport-independent context-tool contract to the CLI's existing
7
+ * authenticated HTTP functions. MCP envelopes remain in server.ts.
8
+ */
9
+ export declare function createCliContextToolsClient(context: McpToolContext): ContextToolsClient;
10
+ /** Every tool the MCP server exposes, in registration order. */
11
+ export declare function getToolSpecs(): McpToolSpec[];
12
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAEhB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACrB,MAAM,2BAA2B,CAAC;AAUnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC;AAe1C;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,cAAc,GAAG,kBAAkB,CA0BvF;AAED,gEAAgE;AAChE,wBAAgB,YAAY,IAAI,WAAW,EAAE,CAE5C"}
@@ -0,0 +1,54 @@
1
+ import { getContextToolSpecs, SEARCH_TOOL_NAME, } from '@agentteams/context-tools';
2
+ import { getCoAction, listCoActions } from '../api/coaction.js';
3
+ import { getCodeReview, getCodeReviewFinding, listCodeReviews } from '../api/codeReview.js';
4
+ import { getComment, listComments, listFindingComments, listTaskComments } from '../api/comment.js';
5
+ import { getConvention, listConventions } from '../api/convention.js';
6
+ import { getDocument, listDocuments } from '../api/document.js';
7
+ import { getPlanRunbook, listPlans } from '../api/plan.js';
8
+ import { getPostMortem, listPostMortems } from '../api/postmortem.js';
9
+ import { getReport, listReports } from '../api/report.js';
10
+ import { searchEntities } from '../api/search.js';
11
+ export { SEARCH_TOOL_NAME };
12
+ function scalarListParams(params) {
13
+ return params;
14
+ }
15
+ function documentListParams(params) {
16
+ return {
17
+ ...params,
18
+ ...(Array.isArray(params.tags) ? { tags: params.tags.join(',') } : {}),
19
+ };
20
+ }
21
+ /**
22
+ * Bind the transport-independent context-tool contract to the CLI's existing
23
+ * authenticated HTTP functions. MCP envelopes remain in server.ts.
24
+ */
25
+ export function createCliContextToolsClient(context) {
26
+ const { apiUrl, projectId, headers } = context;
27
+ return {
28
+ search: (params) => searchEntities(apiUrl, projectId, headers, params),
29
+ listPlans: (params) => listPlans(apiUrl, projectId, headers, scalarListParams(params)),
30
+ getPlan: (id) => getPlanRunbook(apiUrl, projectId, headers, id),
31
+ listCompletionReports: (params) => listReports(apiUrl, projectId, headers, scalarListParams(params)),
32
+ getCompletionReport: (id) => getReport(apiUrl, projectId, headers, id),
33
+ listCoActions: (params) => listCoActions(apiUrl, projectId, headers, scalarListParams(params)),
34
+ getCoAction: (id) => getCoAction(apiUrl, projectId, headers, id),
35
+ listPostMortems: (params) => listPostMortems(apiUrl, projectId, headers, scalarListParams(params)),
36
+ getPostMortem: (id) => getPostMortem(apiUrl, projectId, headers, id),
37
+ listDocuments: (params) => listDocuments(apiUrl, projectId, headers, documentListParams(params)),
38
+ getDocument: (id) => getDocument(apiUrl, projectId, headers, id),
39
+ listConventions: (params) => listConventions(apiUrl, projectId, headers, scalarListParams(params)),
40
+ getConvention: (id) => getConvention(apiUrl, projectId, headers, id),
41
+ listCodeReviews: (params) => listCodeReviews(apiUrl, projectId, headers, scalarListParams(params)),
42
+ getCodeReview: (id) => getCodeReview(apiUrl, projectId, headers, id),
43
+ listComments: (planId, params) => listComments(apiUrl, projectId, headers, planId, scalarListParams(params)),
44
+ listFindingComments: (findingId, params) => listFindingComments(apiUrl, projectId, headers, findingId, scalarListParams(params)),
45
+ listTaskComments: (taskId, params) => listTaskComments(apiUrl, projectId, headers, taskId, scalarListParams(params)),
46
+ getComment: (id) => getComment(apiUrl, projectId, headers, id),
47
+ getCodeReviewFinding: (id, codeReviewId) => getCodeReviewFinding(apiUrl, projectId, headers, id, codeReviewId),
48
+ };
49
+ }
50
+ /** Every tool the MCP server exposes, in registration order. */
51
+ export function getToolSpecs() {
52
+ return getContextToolSpecs();
53
+ }
54
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,GAIjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAK5B,SAAS,gBAAgB,CAAC,MAAyB;IACjD,OAAO,MAA0B,CAAC;AACpC,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAyB;IACnD,OAAO;QACL,GAAG,MAAM;QACT,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1B,CAA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E,SAAS,EAAE,OAAO,EAAE,EAAE,CAAC;QAC9D,oBAAoB,EAAE,CAAC,EAAE,EAAE,YAAY,EAAE,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY,CAAC;KAC/G,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,YAAY;IAC1B,OAAO,mBAAmB,EAAE,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Config files written here belong to the user, not to AgentTeams: they hold
3
+ * other MCP servers, editor preferences and (for user scope) API keys. Every
4
+ * write therefore goes backup → temp file in the same directory → rename, so a
5
+ * crash or a full disk can never leave a truncated config behind.
6
+ */
7
+ /** Suffix is deterministic so `install` twice does not accumulate backup files. */
8
+ export declare const BACKUP_SUFFIX = ".agentteams-backup";
9
+ /** User-scope files can carry a literal API key, so they must not be world-readable. */
10
+ export declare const USER_SCOPE_FILE_MODE = 384;
11
+ export declare const PROJECT_SCOPE_FILE_MODE = 420;
12
+ export interface AtomicWriteResult {
13
+ path: string;
14
+ /** Absolute path of the backup, or null when the file did not exist yet. */
15
+ backupPath: string | null;
16
+ created: boolean;
17
+ mode: number;
18
+ }
19
+ /**
20
+ * Replace `path` with `content` atomically.
21
+ *
22
+ * @param targetMode - when present, force the replacement to this mode while
23
+ * preserving the original mode on the backup.
24
+ */
25
+ export declare function writeConfigFileAtomically(path: string, content: string, defaultMode: number, targetMode?: number): AtomicWriteResult;
26
+ //# sourceMappingURL=atomicWrite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atomicWrite.d.ts","sourceRoot":"","sources":["../../src/mcp-registration/atomicWrite.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH,mFAAmF;AACnF,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAElD,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,MAAQ,CAAC;AAC1C,eAAO,MAAM,uBAAuB,MAAQ,CAAC;AAE7C,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAUD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,iBAAiB,CA+BnB"}
@@ -0,0 +1,58 @@
1
+ import { chmodSync, copyFileSync, mkdirSync, renameSync, statSync, unlinkSync, writeFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ /**
4
+ * Config files written here belong to the user, not to AgentTeams: they hold
5
+ * other MCP servers, editor preferences and (for user scope) API keys. Every
6
+ * write therefore goes backup → temp file in the same directory → rename, so a
7
+ * crash or a full disk can never leave a truncated config behind.
8
+ */
9
+ /** Suffix is deterministic so `install` twice does not accumulate backup files. */
10
+ export const BACKUP_SUFFIX = '.agentteams-backup';
11
+ /** User-scope files can carry a literal API key, so they must not be world-readable. */
12
+ export const USER_SCOPE_FILE_MODE = 0o600;
13
+ export const PROJECT_SCOPE_FILE_MODE = 0o644;
14
+ function existingMode(path) {
15
+ try {
16
+ return statSync(path).mode & 0o777;
17
+ }
18
+ catch {
19
+ return null;
20
+ }
21
+ }
22
+ /**
23
+ * Replace `path` with `content` atomically.
24
+ *
25
+ * @param targetMode - when present, force the replacement to this mode while
26
+ * preserving the original mode on the backup.
27
+ */
28
+ export function writeConfigFileAtomically(path, content, defaultMode, targetMode) {
29
+ const directory = dirname(path);
30
+ mkdirSync(directory, { recursive: true });
31
+ const previousMode = existingMode(path);
32
+ const created = previousMode === null;
33
+ const mode = targetMode ?? previousMode ?? defaultMode;
34
+ let backupPath = null;
35
+ if (!created) {
36
+ backupPath = `${path}${BACKUP_SUFFIX}`;
37
+ copyFileSync(path, backupPath);
38
+ chmodSync(backupPath, previousMode ?? defaultMode);
39
+ }
40
+ // Same directory as the target: `rename` is only atomic within a filesystem.
41
+ const temporaryPath = join(directory, `.${Date.now().toString(36)}-${process.pid}.agentteams-tmp`);
42
+ try {
43
+ writeFileSync(temporaryPath, content, { encoding: 'utf-8', mode });
44
+ chmodSync(temporaryPath, mode);
45
+ renameSync(temporaryPath, path);
46
+ }
47
+ catch (error) {
48
+ try {
49
+ unlinkSync(temporaryPath);
50
+ }
51
+ catch {
52
+ // The temp file may never have been created; the original is untouched either way.
53
+ }
54
+ throw error;
55
+ }
56
+ return { path, backupPath, created, mode };
57
+ }
58
+ //# sourceMappingURL=atomicWrite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atomicWrite.js","sourceRoot":"","sources":["../../src/mcp-registration/atomicWrite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC9G,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;GAKG;AAEH,mFAAmF;AACnF,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAElD,wFAAwF;AACxF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAC1C,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAU7C,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CACvC,IAAY,EACZ,OAAe,EACf,WAAmB,EACnB,UAAmB;IAEnB,MAAM,SAAS,GAAG,OAAO,CA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S: McpClientDefinition[];
3
+ export declare function findClient(clientId: string): McpClientDefinition | undefined;
4
+ export declare function listClientIds(): McpClientId[];
5
+ //# sourceMappingURL=clients.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../src/mcp-registration/clients.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAiC,MAAM,YAAY,CAAC;AA+ClG,eAAO,MAAM,WAAW,EAAE,mBAAmB,EA+P5C,CAAC;AAEF,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAE5E;AAED,wBAAgB,aAAa,IAAI,WAAW,EAAE,CAE7C"}
@@ -0,0 +1,300 @@
1
+ import { join } from 'node:path';
2
+ /**
3
+ * Registry of the eight AgentTeams runner engines that can host an MCP client.
4
+ *
5
+ * Every entry below was verified on 2026-07-25 against the vendor's public docs
6
+ * *and* against a local install (`<tool> mcp add --help`, plus a two-run
7
+ * idempotency check where the tool ships a registration command). The
8
+ * `verifiedAt` / `docsUrl` fields exist so a future contract drift is traceable
9
+ * to the day the claim was made.
10
+ *
11
+ * Deliberate exclusions: Orca is a worktree runner environment, not an MCP
12
+ * client (register the agents it launches instead), and `GEMINI` is a
13
+ * deprecated runner type.
14
+ *
15
+ * `runnerType` mirrors `packages/core-constants`'s `RUNNER_TYPES`. The public
16
+ * CLI is published from a `cli/`-only subtree split, so that private package
17
+ * cannot be a runtime dependency; a monorepo-only drift test asserts the two
18
+ * key sets stay identical instead.
19
+ */
20
+ function xdgConfigHome(context) {
21
+ const override = context.env.XDG_CONFIG_HOME;
22
+ return override && override.length > 0 ? override : join(context.homeDir, '.config');
23
+ }
24
+ function kimiHome(context) {
25
+ const override = context.env.KIMI_CODE_HOME;
26
+ return override && override.length > 0 ? override : join(context.homeDir, '.kimi-code');
27
+ }
28
+ function codexHome(context) {
29
+ const override = context.env.CODEX_HOME;
30
+ return override && override.length > 0 ? override : join(context.homeDir, '.codex');
31
+ }
32
+ function copilotHome(context) {
33
+ const override = context.env.COPILOT_HOME;
34
+ return override && override.length > 0 ? override : join(context.homeDir, '.copilot');
35
+ }
36
+ function envFlags(spec, flag) {
37
+ return Object.entries(spec.env).flatMap(([key, value]) => [flag, `${key}=${value}`]);
38
+ }
39
+ const ALREADY_REGISTERED = [/already exists/i];
40
+ export const MCP_CLIENTS = [
41
+ {
42
+ id: 'claude-code',
43
+ runnerType: 'CLAUDE_CODE',
44
+ label: 'Claude Code',
45
+ executables: ['claude'],
46
+ secretReference: 'dollarBraces',
47
+ configSignals: (context) => [join(context.homeDir, '.claude.json'), join(context.homeDir, '.claude')],
48
+ docsUrl: 'https://code.claude.com/docs/en/mcp',
49
+ verifiedAt: '2026-07-25',
50
+ scopes: {
51
+ user: {
52
+ configPath: (context) => join(context.homeDir, '.claude.json'),
53
+ format: 'json',
54
+ containerKey: 'mcpServers',
55
+ entryShape: 'stdio',
56
+ strategy: 'jsonMerge',
57
+ },
58
+ project: {
59
+ configPath: (context) => join(context.cwd, '.mcp.json'),
60
+ format: 'json',
61
+ containerKey: 'mcpServers',
62
+ entryShape: 'stdio',
63
+ strategy: 'vendorCommand',
64
+ vendor: {
65
+ buildArgs: (spec, name) => [
66
+ 'mcp',
67
+ 'add',
68
+ name,
69
+ '--scope',
70
+ 'project',
71
+ ...envFlags(spec, '-e'),
72
+ '--',
73
+ spec.command,
74
+ ...spec.args,
75
+ ],
76
+ rerunBehavior: 'refuse',
77
+ alreadyRegisteredPatterns: ALREADY_REGISTERED,
78
+ },
79
+ },
80
+ },
81
+ },
82
+ {
83
+ id: 'codex',
84
+ runnerType: 'CODEX',
85
+ label: 'Codex',
86
+ executables: ['codex'],
87
+ secretReference: 'codexEnvVars',
88
+ configSignals: (context) => [join(codexHome(context), 'config.toml'), codexHome(context)],
89
+ docsUrl: 'https://developers.openai.com/codex/mcp',
90
+ verifiedAt: '2026-07-25',
91
+ scopes: {
92
+ user: {
93
+ configPath: (context) => join(codexHome(context), 'config.toml'),
94
+ format: 'toml',
95
+ strategy: 'configOnly',
96
+ configOnlyReason: 'Codex inherits secrets through `env_vars`, but `codex mcp add --env` accepts values only through argv. The CLI therefore prints a safe TOML snippet instead of exposing the API key in the process list.',
97
+ },
98
+ project: {
99
+ configPath: (context) => join(context.cwd, '.codex', 'config.toml'),
100
+ format: 'toml',
101
+ strategy: 'configOnly',
102
+ configOnlyReason: 'Codex project config is TOML and `codex mcp add` only targets the user config. The CLI has no comment-preserving TOML editor, so rewriting the file would drop your comments and key order.',
103
+ },
104
+ },
105
+ },
106
+ {
107
+ id: 'copilot-cli',
108
+ runnerType: 'COPILOT_CLI',
109
+ label: 'GitHub Copilot CLI',
110
+ executables: ['copilot'],
111
+ secretReference: 'dollarBraces',
112
+ configSignals: (context) => [join(copilotHome(context), 'mcp-config.json'), copilotHome(context)],
113
+ docsUrl: 'https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers',
114
+ verifiedAt: '2026-07-25',
115
+ scopes: {
116
+ user: {
117
+ configPath: (context) => join(copilotHome(context), 'mcp-config.json'),
118
+ format: 'json',
119
+ containerKey: 'mcpServers',
120
+ entryShape: 'stdio',
121
+ strategy: 'jsonMerge',
122
+ },
123
+ project: {
124
+ configPath: (context) => join(context.cwd, '.mcp.json'),
125
+ format: 'json',
126
+ containerKey: 'mcpServers',
127
+ entryShape: 'stdio',
128
+ strategy: 'jsonMerge',
129
+ },
130
+ },
131
+ },
132
+ {
133
+ id: 'opencode',
134
+ runnerType: 'OPENCODE',
135
+ label: 'OpenCode',
136
+ executables: ['opencode'],
137
+ secretReference: 'opencodeEnv',
138
+ configSignals: (context) => [
139
+ join(xdgConfigHome(context), 'opencode', 'opencode.jsonc'),
140
+ join(xdgConfigHome(context), 'opencode', 'opencode.json'),
141
+ join(xdgConfigHome(context), 'opencode'),
142
+ ],
143
+ docsUrl: 'https://opencode.ai/docs/mcp-servers',
144
+ verifiedAt: '2026-07-25',
145
+ scopes: {
146
+ user: {
147
+ configPath: (context) => join(xdgConfigHome(context), 'opencode', 'opencode.jsonc'),
148
+ format: 'jsonc',
149
+ containerKey: 'mcp',
150
+ entryShape: 'opencode',
151
+ strategy: 'jsonMerge',
152
+ },
153
+ project: {
154
+ configPath: (context) => join(context.cwd, 'opencode.json'),
155
+ format: 'json',
156
+ containerKey: 'mcp',
157
+ entryShape: 'opencode',
158
+ strategy: 'jsonMerge',
159
+ },
160
+ },
161
+ },
162
+ {
163
+ id: 'amp',
164
+ runnerType: 'AMP',
165
+ label: 'Amp',
166
+ executables: ['amp'],
167
+ secretReference: 'dollarBraces',
168
+ configSignals: (context) => [
169
+ join(xdgConfigHome(context), 'amp', 'settings.json'),
170
+ join(xdgConfigHome(context), 'amp'),
171
+ ],
172
+ docsUrl: 'https://ampcode.com/manual',
173
+ verifiedAt: '2026-07-25',
174
+ scopes: {
175
+ user: {
176
+ configPath: (context) => join(xdgConfigHome(context), 'amp', 'settings.json'),
177
+ format: 'json',
178
+ containerKey: 'amp.mcpServers',
179
+ entryShape: 'plain',
180
+ strategy: 'jsonMerge',
181
+ },
182
+ project: {
183
+ configPath: (context) => join(context.cwd, '.amp', 'settings.json'),
184
+ format: 'json',
185
+ containerKey: 'amp.mcpServers',
186
+ entryShape: 'plain',
187
+ strategy: 'vendorCommand',
188
+ vendor: {
189
+ buildArgs: (spec, name) => [
190
+ 'mcp',
191
+ 'add',
192
+ name,
193
+ '--workspace',
194
+ ...envFlags(spec, '--env'),
195
+ '--',
196
+ spec.command,
197
+ ...spec.args,
198
+ ],
199
+ rerunBehavior: 'refuse',
200
+ alreadyRegisteredPatterns: ALREADY_REGISTERED,
201
+ },
202
+ },
203
+ },
204
+ },
205
+ {
206
+ id: 'cursor-cli',
207
+ runnerType: 'CURSOR_CLI',
208
+ label: 'Cursor CLI',
209
+ executables: ['cursor-agent'],
210
+ secretReference: 'dollarBraces',
211
+ configSignals: (context) => [join(context.homeDir, '.cursor', 'mcp.json'), join(context.homeDir, '.cursor')],
212
+ docsUrl: 'https://docs.cursor.com/context/model-context-protocol',
213
+ verifiedAt: '2026-07-25',
214
+ scopes: {
215
+ // Verified 2026.07.16: `cursor-agent mcp` exposes only login/list/enable/
216
+ // disable — there is no `add`, so the config file is the only contract.
217
+ user: {
218
+ configPath: (context) => join(context.homeDir, '.cursor', 'mcp.json'),
219
+ format: 'json',
220
+ containerKey: 'mcpServers',
221
+ entryShape: 'plain',
222
+ strategy: 'jsonMerge',
223
+ },
224
+ project: {
225
+ configPath: (context) => join(context.cwd, '.cursor', 'mcp.json'),
226
+ format: 'json',
227
+ containerKey: 'mcpServers',
228
+ entryShape: 'plain',
229
+ strategy: 'jsonMerge',
230
+ },
231
+ },
232
+ },
233
+ {
234
+ id: 'kimi-cli',
235
+ runnerType: 'KIMI_CLI',
236
+ label: 'Kimi CLI',
237
+ executables: ['kimi'],
238
+ secretReference: 'dollarBraces',
239
+ extraBinDirs: (context) => [join(kimiHome(context), 'bin')],
240
+ configSignals: (context) => [join(kimiHome(context), 'mcp.json'), kimiHome(context)],
241
+ docsUrl: 'https://www.kimi.com/code/docs/en/kimi-code-cli/customization/mcp.html',
242
+ verifiedAt: '2026-07-25',
243
+ scopes: {
244
+ // Verified 0.29.0: kimi-code exposes no `mcp` subcommand at all; it loads
245
+ // `<KIMI_CODE_HOME>/mcp.json` and `<cwd>/.kimi-code/mcp.json` directly.
246
+ user: {
247
+ configPath: (context) => join(kimiHome(context), 'mcp.json'),
248
+ format: 'json',
249
+ containerKey: 'mcpServers',
250
+ entryShape: 'plain',
251
+ strategy: 'jsonMerge',
252
+ },
253
+ project: {
254
+ configPath: (context) => join(context.cwd, '.kimi-code', 'mcp.json'),
255
+ format: 'json',
256
+ containerKey: 'mcpServers',
257
+ entryShape: 'plain',
258
+ strategy: 'jsonMerge',
259
+ },
260
+ },
261
+ },
262
+ {
263
+ id: 'antigravity',
264
+ runnerType: 'ANTIGRAVITY',
265
+ label: 'Antigravity',
266
+ executables: ['agy', 'antigravity'],
267
+ secretReference: 'dollarBraces',
268
+ configSignals: (context) => [
269
+ join(context.homeDir, '.gemini', 'config', 'mcp_config.json'),
270
+ join(context.homeDir, '.gemini', 'antigravity'),
271
+ ],
272
+ docsUrl: 'https://antigravity.google/docs/mcp',
273
+ verifiedAt: '2026-07-25',
274
+ scopes: {
275
+ // Verified 1.1.2: the `agy` CLI has no `mcp` subcommand; `mcp_config.json`
276
+ // with an `mcpServers` map is the documented contract.
277
+ user: {
278
+ configPath: (context) => join(context.homeDir, '.gemini', 'config', 'mcp_config.json'),
279
+ format: 'json',
280
+ containerKey: 'mcpServers',
281
+ entryShape: 'plain',
282
+ strategy: 'jsonMerge',
283
+ },
284
+ project: {
285
+ configPath: (context) => join(context.cwd, '.agents', 'mcp_config.json'),
286
+ format: 'json',
287
+ containerKey: 'mcpServers',
288
+ entryShape: 'plain',
289
+ strategy: 'jsonMerge',
290
+ },
291
+ },
292
+ },
293
+ ];
294
+ export function findClient(clientId) {
295
+ return MCP_CLIENTS.find((client) => client.id === clientId);
296
+ }
297
+ export function listClientIds() {
298
+ return MCP_CLIENTS.map((client) => client.id);
299
+ }
300
+ //# sourceMappingURL=clients.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clients.js","sourceRoot":"","sources":["../../src/mcp-registration/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;;;;;;;;;;;;;;;;GAiBG;AAEH,SAAS,aAAa,CAAC,OAAuB;IAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IAC7C,OAAO,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACvF,CAAC;AAED,SAAS,QAAQ,CAAC,OAAuB;IACvC,MAAM,QAAQ,GAAG,OAAO,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EAAE,iBAAiB,CAAC;gBACxE,MAAM,EAAE,MAAM;gBACd,YAAY,EAAE,YAAY;gBAC1B,UAAU,EAAE,OAAO;gBACnB,QAAQ,EAAE,WAAW;aACtB;SACF;KACF;CACF,CAAC;AAEF,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAChD,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { DetectionSignal, McpPathContext } from './types.js';
2
+ /**
3
+ * CLI-local client detection.
4
+ *
5
+ * The daemon has its own executable resolver, but the public CLI is published
6
+ * from a `cli/`-only subtree split and cannot import `daemon/src/executable.ts`.
7
+ * The lookup is kept injectable so tests drive it with a fake PATH and a
8
+ * temporary HOME rather than the developer's real machine.
9
+ */
10
+ export interface DetectionDependencies {
11
+ context: McpPathContext;
12
+ fileExists?: (path: string) => boolean;
13
+ /** Windows resolves executables through PATHEXT; the default mirrors that. */
14
+ executableSuffixes?: string[];
15
+ }
16
+ /**
17
+ * Config traces and an executable are independent signals: a client counts as a
18
+ * candidate when either one is present. Reporting *which* signal fired is what
19
+ * lets a user tell "installed but never configured" apart from "config left
20
+ * behind by an uninstall".
21
+ */
22
+ export declare function detectClients(dependencies: DetectionDependencies): DetectionSignal[];
23
+ //# sourceMappingURL=detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/mcp-registration/detect.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAuB,cAAc,EAAE,MAAM,YAAY,CAAC;AAEvF;;;;;;;GAOG;AAEH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,8EAA8E;IAC9E,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AA2BD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,qBAAqB,GAAG,eAAe,EAAE,CAsBpF"}