@agentteams/cli 0.1.76 → 0.1.77
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/.eslintcache +1 -1
- package/dist/api/convention.d.ts +11 -0
- package/dist/api/convention.d.ts.map +1 -0
- package/dist/api/convention.js +26 -0
- package/dist/api/convention.js.map +1 -0
- package/dist/commands/convention.d.ts.map +1 -1
- package/dist/commands/convention.js +6 -8
- package/dist/commands/convention.js.map +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +1 -19
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/mcp.d.ts +13 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +13 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +8 -35
- package/dist/commands/search.js.map +1 -1
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/context.d.ts +15 -0
- package/dist/mcp/context.d.ts.map +1 -0
- package/dist/mcp/context.js +47 -0
- package/dist/mcp/context.js.map +1 -0
- package/dist/mcp/resources.d.ts +17 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +50 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/server.d.ts +20 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +106 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +20 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +172 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp-registration/atomicWrite.d.ts +26 -0
- package/dist/mcp-registration/atomicWrite.d.ts.map +1 -0
- package/dist/mcp-registration/atomicWrite.js +58 -0
- package/dist/mcp-registration/atomicWrite.js.map +1 -0
- package/dist/mcp-registration/clients.d.ts +5 -0
- package/dist/mcp-registration/clients.d.ts.map +1 -0
- package/dist/mcp-registration/clients.js +300 -0
- package/dist/mcp-registration/clients.js.map +1 -0
- package/dist/mcp-registration/detect.d.ts +23 -0
- package/dist/mcp-registration/detect.d.ts.map +1 -0
- package/dist/mcp-registration/detect.js +48 -0
- package/dist/mcp-registration/detect.js.map +1 -0
- package/dist/mcp-registration/index.d.ts +50 -0
- package/dist/mcp-registration/index.d.ts.map +1 -0
- package/dist/mcp-registration/index.js +205 -0
- package/dist/mcp-registration/index.js.map +1 -0
- package/dist/mcp-registration/install.d.ts +66 -0
- package/dist/mcp-registration/install.d.ts.map +1 -0
- package/dist/mcp-registration/install.js +244 -0
- package/dist/mcp-registration/install.js.map +1 -0
- package/dist/mcp-registration/jsonc.d.ts +44 -0
- package/dist/mcp-registration/jsonc.d.ts.map +1 -0
- package/dist/mcp-registration/jsonc.js +266 -0
- package/dist/mcp-registration/jsonc.js.map +1 -0
- package/dist/mcp-registration/render.d.ts +18 -0
- package/dist/mcp-registration/render.d.ts.map +1 -0
- package/dist/mcp-registration/render.js +91 -0
- package/dist/mcp-registration/render.js.map +1 -0
- package/dist/mcp-registration/serverSpec.d.ts +31 -0
- package/dist/mcp-registration/serverSpec.d.ts.map +1 -0
- package/dist/mcp-registration/serverSpec.js +29 -0
- package/dist/mcp-registration/serverSpec.js.map +1 -0
- package/dist/mcp-registration/types.d.ts +98 -0
- package/dist/mcp-registration/types.d.ts.map +1 -0
- package/dist/mcp-registration/types.js +12 -0
- package/dist/mcp-registration/types.js.map +1 -0
- package/dist/mcp-registration/vendorCommand.d.ts +18 -0
- package/dist/mcp-registration/vendorCommand.d.ts.map +1 -0
- package/dist/mcp-registration/vendorCommand.js +27 -0
- package/dist/mcp-registration/vendorCommand.js.map +1 -0
- package/dist/utils/apiContext.d.ts +13 -0
- package/dist/utils/apiContext.d.ts.map +1 -0
- package/dist/utils/apiContext.js +26 -0
- package/dist/utils/apiContext.js.map +1 -0
- package/dist/utils/searchParams.d.ts +21 -0
- package/dist/utils/searchParams.d.ts.map +1 -0
- package/dist/utils/searchParams.js +47 -0
- package/dist/utils/searchParams.js.map +1 -0
- package/package.json +5 -3
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getCoAction } from '../api/coaction.js';
|
|
3
|
+
import { getConvention, listConventions } from '../api/convention.js';
|
|
4
|
+
import { getDocument } from '../api/document.js';
|
|
5
|
+
import { getPlanRunbook } from '../api/plan.js';
|
|
6
|
+
import { getPostMortem } from '../api/postmortem.js';
|
|
7
|
+
import { getReport } from '../api/report.js';
|
|
8
|
+
import { searchEntities } from '../api/search.js';
|
|
9
|
+
import { stripEntityIdPrefix } from '../utils/entityId.js';
|
|
10
|
+
import { buildSearchParams, VALID_TYPES } from '../utils/searchParams.js';
|
|
11
|
+
export const SEARCH_TOOL_NAME = 'agentteams_search';
|
|
12
|
+
const SEARCH_TOOL_DESCRIPTION = [
|
|
13
|
+
'Search AgentTeams entities (plans, co-actions, completion reports, post-mortems, conventions, comments, code reviews, documents) in this project.',
|
|
14
|
+
'Scope: results are limited to the projectId configured for this CLI — the tool cannot search other projects.',
|
|
15
|
+
'Truncation: when the token budget trims the response, meta.truncatedByTokenBudget is true; per-item contentTokenCount tells you what fetching the full entity would cost.',
|
|
16
|
+
'Limitation: under agent API-key authentication the external issue/PR types (GITHUB_ISSUE, GITHUB_PR, GITLAB_ISSUE, GITLAB_MERGE_REQUEST, BITBUCKET_ISSUE, BITBUCKET_PR, LINEAR_ISSUE) always come back empty.',
|
|
17
|
+
].join(' ');
|
|
18
|
+
const searchToolSpec = {
|
|
19
|
+
name: SEARCH_TOOL_NAME,
|
|
20
|
+
title: 'Search AgentTeams',
|
|
21
|
+
description: SEARCH_TOOL_DESCRIPTION,
|
|
22
|
+
// 1:1 with the backend's searchQuerySchema. Defaults for limit/maxTokens
|
|
23
|
+
// stay unset so the backend remains the single source of truth.
|
|
24
|
+
inputSchema: z.object({
|
|
25
|
+
query: z.string().min(1).describe('Search query'),
|
|
26
|
+
types: z.array(z.enum(VALID_TYPES)).optional().describe('Entity types to filter by'),
|
|
27
|
+
limit: z.number().int().min(1).max(100).optional().describe('Max results (backend default: 20)'),
|
|
28
|
+
maxTokens: z.number().int().min(1).optional().describe('Token budget for the response'),
|
|
29
|
+
}),
|
|
30
|
+
// The full payload is passed through verbatim: summarizing away `meta` or
|
|
31
|
+
// `partialFailures` would let an agent read a truncated or partially failed
|
|
32
|
+
// search as "no results".
|
|
33
|
+
handler: async (args, context) => {
|
|
34
|
+
return searchEntities(context.apiUrl, context.projectId, context.headers, buildSearchParams({
|
|
35
|
+
query: args.query,
|
|
36
|
+
types: args.types,
|
|
37
|
+
limit: args.limit,
|
|
38
|
+
maxTokens: args.maxTokens,
|
|
39
|
+
}));
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Detail-tool factory: `{ id }` in, upstream envelope out — verbatim. The id
|
|
44
|
+
* accepts both bare uuids and `agentteams_<type>_`-prefixed ids as they appear
|
|
45
|
+
* in search results and web-UI entity references.
|
|
46
|
+
*/
|
|
47
|
+
function createEntityGetToolSpec(options) {
|
|
48
|
+
return {
|
|
49
|
+
name: options.name,
|
|
50
|
+
title: options.title,
|
|
51
|
+
description: options.description,
|
|
52
|
+
inputSchema: z.object({
|
|
53
|
+
id: z.string().min(1).describe(options.idDescription),
|
|
54
|
+
}),
|
|
55
|
+
handler: async (args, context) => {
|
|
56
|
+
const id = stripEntityIdPrefix(args.id);
|
|
57
|
+
return options.fetch(context.apiUrl, context.projectId, context.headers, id);
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const planGetToolSpec = createEntityGetToolSpec({
|
|
62
|
+
name: 'agentteams_plan_get',
|
|
63
|
+
title: 'Get AgentTeams Plan',
|
|
64
|
+
description: [
|
|
65
|
+
'Fetch one plan from this project as its full execution runbook: metadata, the complete contentMarkdown body, structured V2 tasks (including dependsOnTaskIds) and progress.',
|
|
66
|
+
'The upstream payload is returned verbatim — nothing is summarized or omitted.',
|
|
67
|
+
'Responses can be large, so check contentTokenCount on the agentteams_search result before fetching the full plan.',
|
|
68
|
+
].join(' '),
|
|
69
|
+
idDescription: 'Plan id (bare uuid or agentteams_pln_-prefixed)',
|
|
70
|
+
fetch: getPlanRunbook,
|
|
71
|
+
});
|
|
72
|
+
const reportGetToolSpec = createEntityGetToolSpec({
|
|
73
|
+
name: 'agentteams_report_get',
|
|
74
|
+
title: 'Get AgentTeams Completion Report',
|
|
75
|
+
description: [
|
|
76
|
+
'Fetch one completion report from this project, including its full content and metrics.',
|
|
77
|
+
'The upstream payload is returned verbatim — nothing is summarized or omitted.',
|
|
78
|
+
'Responses can be large, so check contentTokenCount on the agentteams_search result before fetching the full report.',
|
|
79
|
+
].join(' '),
|
|
80
|
+
idDescription: 'Completion report id (bare uuid or agentteams_rpt_-prefixed)',
|
|
81
|
+
fetch: getReport,
|
|
82
|
+
});
|
|
83
|
+
const coactionGetToolSpec = createEntityGetToolSpec({
|
|
84
|
+
name: 'agentteams_coaction_get',
|
|
85
|
+
title: 'Get AgentTeams Co-Action',
|
|
86
|
+
description: [
|
|
87
|
+
'Fetch one co-action (handoff record) from this project, including its full content.',
|
|
88
|
+
'The upstream payload is returned verbatim — nothing is summarized or omitted.',
|
|
89
|
+
'Responses can be large, so check contentTokenCount on the agentteams_search result before fetching the full co-action.',
|
|
90
|
+
].join(' '),
|
|
91
|
+
idDescription: 'Co-action id (bare uuid or agentteams_act_-prefixed)',
|
|
92
|
+
fetch: getCoAction,
|
|
93
|
+
});
|
|
94
|
+
const postmortemGetToolSpec = createEntityGetToolSpec({
|
|
95
|
+
name: 'agentteams_postmortem_get',
|
|
96
|
+
title: 'Get AgentTeams Post-Mortem',
|
|
97
|
+
description: [
|
|
98
|
+
'Fetch one post-mortem from this project, including its full content.',
|
|
99
|
+
'The upstream payload is returned verbatim — nothing is summarized or omitted.',
|
|
100
|
+
'Responses can be large, so check contentTokenCount on the agentteams_search result before fetching the full post-mortem.',
|
|
101
|
+
].join(' '),
|
|
102
|
+
idDescription: 'Post-mortem id (bare uuid or agentteams_pmt_-prefixed)',
|
|
103
|
+
fetch: getPostMortem,
|
|
104
|
+
});
|
|
105
|
+
const documentGetToolSpec = createEntityGetToolSpec({
|
|
106
|
+
name: 'agentteams_document_get',
|
|
107
|
+
title: 'Get AgentTeams Document',
|
|
108
|
+
description: [
|
|
109
|
+
'Fetch one document from this project, including its full body.',
|
|
110
|
+
'The upstream payload is returned verbatim — nothing is summarized or omitted.',
|
|
111
|
+
'Responses can be large, so check contentTokenCount on the agentteams_search result before fetching the full document.',
|
|
112
|
+
].join(' '),
|
|
113
|
+
idDescription: 'Document id (bare uuid or agentteams_doc_-prefixed)',
|
|
114
|
+
fetch: getDocument,
|
|
115
|
+
});
|
|
116
|
+
const conventionListToolSpec = {
|
|
117
|
+
name: 'agentteams_convention_list',
|
|
118
|
+
title: 'List AgentTeams Conventions',
|
|
119
|
+
description: [
|
|
120
|
+
'List the conventions (coding rules, guides, skills) of this project with optional filters and pagination.',
|
|
121
|
+
'Use agentteams_search to discover relevant conventions; use this tool when you need exact filters or a paginated inventory.',
|
|
122
|
+
'The paginated data/meta envelope is returned verbatim; list items carry metadata only — fetch the full text with agentteams_convention_get.',
|
|
123
|
+
].join(' '),
|
|
124
|
+
// 1:1 with the backend's conventionQuerySchema (+ paginationQuerySchema);
|
|
125
|
+
// defaults stay unset so the backend remains the single source of truth.
|
|
126
|
+
inputSchema: z.object({
|
|
127
|
+
category: z.string().optional().describe('Filter by category (e.g. rules, skills, guides, references)'),
|
|
128
|
+
scope: z.enum(['PROJECT', 'PERSONAL']).optional().describe('Filter by convention scope'),
|
|
129
|
+
archived: z
|
|
130
|
+
.enum(['ACTIVE', 'ARCHIVED', 'ALL'])
|
|
131
|
+
.optional()
|
|
132
|
+
.describe('Filter by archive state (backend default: ACTIVE)'),
|
|
133
|
+
search: z.string().optional().describe('Keyword filter on title/content'),
|
|
134
|
+
createdByMemberId: z.string().optional().describe('Filter by creator member id'),
|
|
135
|
+
page: z.number().int().min(0).optional().describe('Page number (backend default: 1)'),
|
|
136
|
+
pageSize: z.number().int().min(0).max(100).optional().describe('Page size (backend default: 20)'),
|
|
137
|
+
}),
|
|
138
|
+
handler: async (args, context) => {
|
|
139
|
+
const params = {};
|
|
140
|
+
for (const key of ['category', 'scope', 'archived', 'search', 'createdByMemberId', 'page', 'pageSize']) {
|
|
141
|
+
const value = args[key];
|
|
142
|
+
if (typeof value === 'string' || typeof value === 'number')
|
|
143
|
+
params[key] = value;
|
|
144
|
+
}
|
|
145
|
+
return listConventions(context.apiUrl, context.projectId, context.headers, params);
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
const conventionGetToolSpec = createEntityGetToolSpec({
|
|
149
|
+
name: 'agentteams_convention_get',
|
|
150
|
+
title: 'Get AgentTeams Convention',
|
|
151
|
+
description: [
|
|
152
|
+
'Fetch one convention from this project, including its full contentMarkdown.',
|
|
153
|
+
'Pass a convention id from agentteams_search, or use agentteams_convention_list first when you need exact filters.',
|
|
154
|
+
'The upstream payload is returned verbatim — nothing is summarized or omitted.',
|
|
155
|
+
].join(' '),
|
|
156
|
+
idDescription: 'Convention id (bare uuid or agentteams_cnv_-prefixed)',
|
|
157
|
+
fetch: getConvention,
|
|
158
|
+
});
|
|
159
|
+
/** Every tool the MCP server exposes, in registration order. */
|
|
160
|
+
export function getToolSpecs() {
|
|
161
|
+
return [
|
|
162
|
+
searchToolSpec,
|
|
163
|
+
planGetToolSpec,
|
|
164
|
+
reportGetToolSpec,
|
|
165
|
+
coactionGetToolSpec,
|
|
166
|
+
postmortemGetToolSpec,
|
|
167
|
+
documentGetToolSpec,
|
|
168
|
+
conventionListToolSpec,
|
|
169
|
+
conventionGetToolSpec,
|
|
170
|
+
];
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/mcp/tools.ts"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QAAQ,CAAC,iCAAiC,CAAC;KAClG,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAoC,EAAE,CAAC;QACnD,KAAK,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,EAAE,UAAU,CAAU,EAAE,CAAC;YAChH,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YACxB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAClF,CAAC;QACD,OAAO,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrF,CAAC;CACF,CAAC;AAEF,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;IACpD,IAAI,EAAE,2BAA2B;IACjC,KAAK,EAAE,2BAA2B;IAClC,WAAW,EAAE;QACX,6EAA6E;QAC7E,mHAAmH;QACnH,+EAA+E;KAChF,CAAC,IAAI,CAAC,GAAG,CAAC;IACX,aAAa,EAAE,uDAAuD;IACtE,KAAK,EAAE,aAAa;CACrB,CAAC,CAAC;AAEH,gEAAgE;AAChE,MAAM,UAAU,YAAY;IAC1B,OAAO;QACL,cAAc;QACd,eAAe;QACf,iBAAiB;QACjB,mBAAmB;QACnB,qBAAqB;QACrB,mBAAmB;QACnB,sBAAsB;QACtB,qBAAqB;KACtB,CAAC;AACJ,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,CAA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ACd,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { McpClientDefinition, McpClientId } from './types.js';
|
|
2
|
+
export declare const MCP_CLIENTS: 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,CAAC,GAAG,CAAC,cAAc,CAAC;IAC5C,OAAO,QAAQ,IAAI,QAAQ,C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AAY;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"}
|