@beehexa/hexasync-template-assets 2610.3.1 → 2610.4.3
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcpClients.d.ts +53 -6
- package/dist/mcpClients.d.ts.map +1 -1
- package/dist/mcpClients.js +109 -8
- package/dist/mcpClients.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ export { assertInstalled, updateAssets, type ConfirmOverwrite, type OverwriteDif
|
|
|
7
7
|
export type { FileReader } from './ports.js';
|
|
8
8
|
export { COLLECTIONS, FILENAME_CONVENTION, MAX_COLLECTIONS_PER_FILE, declaredCollections, lintDocument, summariseLint, type Collection, type LintDiagnostic, type LintSummary, type Severity, } from './lint.js';
|
|
9
9
|
export { checkEnvironment, formatEnvReport, type EnvItem, type EnvObservation, type EnvOutcome, type EnvReport, } from './env.js';
|
|
10
|
-
export { MCP_CLIENTS,
|
|
10
|
+
export { MCP_CLIENTS, serverEntry, removeNativeClientEntry, VSCODE_NATIVE_CLIENT, LEGACY_SERVER_NAMES, type McpLaunch, SERVER_NAME, clientSnippet, mergeClientConfig, type McpClient, type MergeOutcome, } from './mcpClients.js';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,MAAM,EACN,KAAK,SAAS,EACd,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,OAAO,EACP,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,QAAQ,GACd,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,SAAS,GACf,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,MAAM,EACN,KAAK,SAAS,EACd,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC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CHANGED
|
@@ -5,5 +5,5 @@ export { classifyTarget, summariseClassification, } from './classify.js';
|
|
|
5
5
|
export { assertInstalled, updateAssets, } from './update.js';
|
|
6
6
|
export { COLLECTIONS, FILENAME_CONVENTION, MAX_COLLECTIONS_PER_FILE, declaredCollections, lintDocument, summariseLint, } from './lint.js';
|
|
7
7
|
export { checkEnvironment, formatEnvReport, } from './env.js';
|
|
8
|
-
export { MCP_CLIENTS,
|
|
8
|
+
export { MCP_CLIENTS, serverEntry, removeNativeClientEntry, VSCODE_NATIVE_CLIENT, LEGACY_SERVER_NAMES, SERVER_NAME, clientSnippet, mergeClientConfig, } from './mcpClients.js';
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,MAAM,EAEN,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,GAMd,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,OAAO,EACP,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,cAAc,EACd,uBAAuB,GAKxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,YAAY,GAMb,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,YAAY,EACZ,aAAa,GAKd,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,gBAAgB,EAChB,eAAe,GAKhB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,MAAM,EAEN,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,GAMd,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,OAAO,EACP,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,cAAc,EACd,uBAAuB,GAKxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,YAAY,GAMb,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,YAAY,EACZ,aAAa,GAKd,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,gBAAgB,EAChB,eAAe,GAKhB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,WAAW,EACX,WAAW,EACX,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EAEnB,WAAW,EACX,aAAa,EACb,iBAAiB,GAGlB,MAAM,iBAAiB,CAAC"}
|
package/dist/mcpClients.d.ts
CHANGED
|
@@ -30,12 +30,59 @@ export interface McpClient {
|
|
|
30
30
|
* AC-3 prints a snippet instead. That is a deliberate refusal, not a gap.
|
|
31
31
|
*/
|
|
32
32
|
export declare const MCP_CLIENTS: readonly McpClient[];
|
|
33
|
+
/**
|
|
34
|
+
* How a client should LAUNCH the server.
|
|
35
|
+
*
|
|
36
|
+
* ⛔ This was `{ command: 'hexasync', args: ['mcp'] } as const` — a fixed entry naming a global CLI. Three things
|
|
37
|
+
* were wrong with it and the third is fatal: it required a separate install, it required that install to be on
|
|
38
|
+
* `PATH`, and the CLI it names is being retired. A client configured from it would keep the entry long after the
|
|
39
|
+
* command stopped existing, and MCP would fail with `ENOENT` rather than with anything a user could act on.
|
|
40
|
+
*
|
|
41
|
+
* So the entry is now COMPUTED from where the server actually is. The extension bundles it (`dist/mcp/server.js`)
|
|
42
|
+
* and knows both its own path and the Node running it; nothing here has to guess, and nothing has to be installed.
|
|
43
|
+
*/
|
|
44
|
+
export interface McpLaunch {
|
|
45
|
+
readonly command: string;
|
|
46
|
+
readonly args: readonly string[];
|
|
47
|
+
}
|
|
33
48
|
/** The entry every client gets — the same server, however each one spells the surrounding structure. */
|
|
34
|
-
export declare
|
|
35
|
-
|
|
36
|
-
|
|
49
|
+
export declare function serverEntry(launch: McpLaunch): {
|
|
50
|
+
command: string;
|
|
51
|
+
args: string[];
|
|
37
52
|
};
|
|
38
|
-
|
|
53
|
+
/**
|
|
54
|
+
* The key our entry occupies in a client's server map — CAP-8's `hexasync-template-ide`.
|
|
55
|
+
*
|
|
56
|
+
* ⛔ It was `'hexasync'`, which names the vendor rather than the product, and HexaSync ships sibling MCP servers.
|
|
57
|
+
* Two of them configured in one client would have collided on a single key, silently overwriting each other.
|
|
58
|
+
*/
|
|
59
|
+
export declare const SERVER_NAME = "hexasync-template-ide";
|
|
60
|
+
/**
|
|
61
|
+
* Every key this feature has ever written, newest first.
|
|
62
|
+
*
|
|
63
|
+
* Cleanup has to know the OLD name too: a workspace configured before the rename holds `hexasync`, and a cleanup
|
|
64
|
+
* that only looked for the current name would leave exactly the duplicate it exists to remove.
|
|
65
|
+
*/
|
|
66
|
+
export declare const LEGACY_SERVER_NAMES: readonly string[];
|
|
67
|
+
/**
|
|
68
|
+
* The VS Code client, kept ONLY so its previously-written entry can be removed.
|
|
69
|
+
*
|
|
70
|
+
* ⚠️ Deliberately not a member of `MCP_CLIENTS` — see the note there. Nothing writes this; `removeNativeClientEntry`
|
|
71
|
+
* reads it to find the file to clean.
|
|
72
|
+
*/
|
|
73
|
+
export declare const VSCODE_NATIVE_CLIENT: McpClient;
|
|
74
|
+
/**
|
|
75
|
+
* Strip our server entry from a config file the editor now provides natively.
|
|
76
|
+
*
|
|
77
|
+
* ⛔ Removes ONE key and preserves everything else, for the same reason `mergeClientConfig` never overwrites: the
|
|
78
|
+
* file is the user's and may hold servers this feature knows nothing about. An unparseable file is left completely
|
|
79
|
+
* alone — it still contains their work, and destroying it to tidy up our own mess would be the worse trade.
|
|
80
|
+
*
|
|
81
|
+
* Returns `text: undefined` when there was nothing of ours to remove, so a caller writes no file and churns no mtime.
|
|
82
|
+
* When our entry was the only one, the result is an empty server map rather than a deleted file: removing a file a
|
|
83
|
+
* user may have committed is not this command's business.
|
|
84
|
+
*/
|
|
85
|
+
export declare function removeNativeClientEntry(existing: string | undefined): MergeOutcome;
|
|
39
86
|
export interface MergeOutcome {
|
|
40
87
|
/** The text to write, or `undefined` when nothing needs writing (AC-4). */
|
|
41
88
|
readonly text?: string;
|
|
@@ -54,12 +101,12 @@ export interface MergeOutcome {
|
|
|
54
101
|
* ⚠️ Unparseable input is REFUSED rather than replaced. A file with a syntax error still contains the user's work, and
|
|
55
102
|
* overwriting it to make the install succeed would trade their configuration for our convenience.
|
|
56
103
|
*/
|
|
57
|
-
export declare function mergeClientConfig(client: McpClient, existing: string | undefined): MergeOutcome;
|
|
104
|
+
export declare function mergeClientConfig(client: McpClient, existing: string | undefined, launch: McpLaunch): MergeOutcome;
|
|
58
105
|
/**
|
|
59
106
|
* The snippet for a client we will not write to (AC-3).
|
|
60
107
|
*
|
|
61
108
|
* Named by client and ready to paste, because "configure it yourself" without the exact shape is how a user ends up
|
|
62
109
|
* with a subtly wrong key name.
|
|
63
110
|
*/
|
|
64
|
-
export declare function clientSnippet(client: McpClient): string;
|
|
111
|
+
export declare function clientSnippet(client: McpClient, launch: McpLaunch): string;
|
|
65
112
|
//# sourceMappingURL=mcpClients.d.ts.map
|
package/dist/mcpClients.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpClients.d.ts","sourceRoot":"","sources":["../src/mcpClients.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,yCAAyC;AACzC,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4GAA4G;IAC5G,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,4EAA4E;IAC5E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,
|
|
1
|
+
{"version":3,"file":"mcpClients.d.ts","sourceRoot":"","sources":["../src/mcpClients.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,yCAAyC;AACzC,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4GAA4G;IAC5G,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,4EAA4E;IAC5E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EA0C3C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,wGAAwG;AACxG,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAElF;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,0BAA0B,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAA0C,CAAC;AAE5F;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAKlC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CA0ClF;AAED,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,SAAS,GAChB,YAAY,CA8Cd;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,CAS1E"}
|
package/dist/mcpClients.js
CHANGED
|
@@ -21,7 +21,28 @@
|
|
|
21
21
|
* AC-3 prints a snippet instead. That is a deliberate refusal, not a gap.
|
|
22
22
|
*/
|
|
23
23
|
export const MCP_CLIENTS = [
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* ⛔ **VS Code is NOT in this list, and removing it was the fix for a real mess.**
|
|
26
|
+
*
|
|
27
|
+
* It used to be — `{ id: 'vscode', file: '.vscode/mcp.json', key: 'servers' }` — written on every run of
|
|
28
|
+
* *Install IntelliSense*. Since the extension began contributing an MCP server definition provider, that entry is
|
|
29
|
+
* a DUPLICATE of a server the editor already has, and the duplicate is strictly worse than the original in three
|
|
30
|
+
* ways that were all reported at once:
|
|
31
|
+
*
|
|
32
|
+
* 1. the MCP servers list showed two rows for one server, the second one disabled, and running the command again
|
|
33
|
+
* produced another;
|
|
34
|
+
* 2. the written entry hard-codes the extension's VERSIONED install path
|
|
35
|
+
* (`…/beehexa-corp.hexasync-templates-2609.28.2/dist/mcp/server.js`), so it breaks on the next update and
|
|
36
|
+
* keeps pointing at a directory that no longer exists;
|
|
37
|
+
* 3. a server from a config file has no contributing extension for the editor to attribute, so it renders with
|
|
38
|
+
* the generic MCP glyph instead of this extension's icon — the "rubbish icon" half of the same report.
|
|
39
|
+
*
|
|
40
|
+
* The provider has none of those problems: the editor resolves the path at launch, attributes it to this
|
|
41
|
+
* extension, and offers it with no file at all. `removeNativeClientEntry` below deletes what was already written.
|
|
42
|
+
*
|
|
43
|
+
* ⚠️ The other clients stay. They are separate applications with no equivalent of the provider API, so a
|
|
44
|
+
* config file is the only way to reach them.
|
|
45
|
+
*/
|
|
25
46
|
{
|
|
26
47
|
id: 'cursor',
|
|
27
48
|
label: 'Cursor',
|
|
@@ -43,8 +64,87 @@ export const MCP_CLIENTS = [
|
|
|
43
64
|
{ id: 'claude-desktop', label: 'Claude Desktop', key: 'mcpServers' },
|
|
44
65
|
];
|
|
45
66
|
/** The entry every client gets — the same server, however each one spells the surrounding structure. */
|
|
46
|
-
export
|
|
47
|
-
|
|
67
|
+
export function serverEntry(launch) {
|
|
68
|
+
return { command: launch.command, args: [...launch.args] };
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The key our entry occupies in a client's server map — CAP-8's `hexasync-template-ide`.
|
|
72
|
+
*
|
|
73
|
+
* ⛔ It was `'hexasync'`, which names the vendor rather than the product, and HexaSync ships sibling MCP servers.
|
|
74
|
+
* Two of them configured in one client would have collided on a single key, silently overwriting each other.
|
|
75
|
+
*/
|
|
76
|
+
export const SERVER_NAME = 'hexasync-template-ide';
|
|
77
|
+
/**
|
|
78
|
+
* Every key this feature has ever written, newest first.
|
|
79
|
+
*
|
|
80
|
+
* Cleanup has to know the OLD name too: a workspace configured before the rename holds `hexasync`, and a cleanup
|
|
81
|
+
* that only looked for the current name would leave exactly the duplicate it exists to remove.
|
|
82
|
+
*/
|
|
83
|
+
export const LEGACY_SERVER_NAMES = ['hexasync-template-ide', 'hexasync'];
|
|
84
|
+
/**
|
|
85
|
+
* The VS Code client, kept ONLY so its previously-written entry can be removed.
|
|
86
|
+
*
|
|
87
|
+
* ⚠️ Deliberately not a member of `MCP_CLIENTS` — see the note there. Nothing writes this; `removeNativeClientEntry`
|
|
88
|
+
* reads it to find the file to clean.
|
|
89
|
+
*/
|
|
90
|
+
export const VSCODE_NATIVE_CLIENT = {
|
|
91
|
+
id: 'vscode',
|
|
92
|
+
label: 'VS Code',
|
|
93
|
+
file: '.vscode/mcp.json',
|
|
94
|
+
key: 'servers',
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Strip our server entry from a config file the editor now provides natively.
|
|
98
|
+
*
|
|
99
|
+
* ⛔ Removes ONE key and preserves everything else, for the same reason `mergeClientConfig` never overwrites: the
|
|
100
|
+
* file is the user's and may hold servers this feature knows nothing about. An unparseable file is left completely
|
|
101
|
+
* alone — it still contains their work, and destroying it to tidy up our own mess would be the worse trade.
|
|
102
|
+
*
|
|
103
|
+
* Returns `text: undefined` when there was nothing of ours to remove, so a caller writes no file and churns no mtime.
|
|
104
|
+
* When our entry was the only one, the result is an empty server map rather than a deleted file: removing a file a
|
|
105
|
+
* user may have committed is not this command's business.
|
|
106
|
+
*/
|
|
107
|
+
export function removeNativeClientEntry(existing) {
|
|
108
|
+
if (existing === undefined || existing.trim() === '') {
|
|
109
|
+
return { reason: 'VS Code: nothing to clean up.', unchanged: true };
|
|
110
|
+
}
|
|
111
|
+
let document;
|
|
112
|
+
try {
|
|
113
|
+
const parsed = JSON.parse(existing);
|
|
114
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
115
|
+
return {
|
|
116
|
+
reason: 'VS Code: its configuration is not a JSON object, so it was left alone.',
|
|
117
|
+
unchanged: true,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
document = parsed;
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
return {
|
|
124
|
+
reason: 'VS Code: its configuration could not be parsed, so it was left alone.',
|
|
125
|
+
unchanged: true,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
const servers = document[VSCODE_NATIVE_CLIENT.key];
|
|
129
|
+
if (!servers || typeof servers !== 'object' || Array.isArray(servers)) {
|
|
130
|
+
return { reason: 'VS Code: nothing to clean up.', unchanged: true };
|
|
131
|
+
}
|
|
132
|
+
const remaining = { ...servers };
|
|
133
|
+
const removed = LEGACY_SERVER_NAMES.filter((name) => Object.hasOwn(remaining, name));
|
|
134
|
+
if (removed.length === 0) {
|
|
135
|
+
return { reason: 'VS Code: nothing to clean up.', unchanged: true };
|
|
136
|
+
}
|
|
137
|
+
for (const name of removed)
|
|
138
|
+
delete remaining[name];
|
|
139
|
+
const merged = { ...document, [VSCODE_NATIVE_CLIENT.key]: remaining };
|
|
140
|
+
const others = Object.keys(remaining).length;
|
|
141
|
+
return {
|
|
142
|
+
text: `${JSON.stringify(merged, null, 2)}\n`,
|
|
143
|
+
reason: `VS Code: removed the stale \`${removed.join('`, `')}\` entry — the extension now provides this server ` +
|
|
144
|
+
`itself, with no configuration${others > 0 ? `, keeping ${others} other server(s)` : ''}.`,
|
|
145
|
+
unchanged: false,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
48
148
|
/**
|
|
49
149
|
* Merge our entry into a client's configuration.
|
|
50
150
|
*
|
|
@@ -55,7 +155,8 @@ export const SERVER_NAME = 'hexasync';
|
|
|
55
155
|
* ⚠️ Unparseable input is REFUSED rather than replaced. A file with a syntax error still contains the user's work, and
|
|
56
156
|
* overwriting it to make the install succeed would trade their configuration for our convenience.
|
|
57
157
|
*/
|
|
58
|
-
export function mergeClientConfig(client, existing) {
|
|
158
|
+
export function mergeClientConfig(client, existing, launch) {
|
|
159
|
+
const entry = serverEntry(launch);
|
|
59
160
|
let document = {};
|
|
60
161
|
if (existing !== undefined && existing.trim() !== '') {
|
|
61
162
|
try {
|
|
@@ -78,13 +179,13 @@ export function mergeClientConfig(client, existing) {
|
|
|
78
179
|
}
|
|
79
180
|
const servers = document[client.key] ?? {};
|
|
80
181
|
const current = servers[SERVER_NAME];
|
|
81
|
-
if (JSON.stringify(current) === JSON.stringify(
|
|
182
|
+
if (JSON.stringify(current) === JSON.stringify(entry)) {
|
|
82
183
|
// AC-4 — already correct, so nothing is written. Rewriting an identical file churns a diff and a mtime for nothing.
|
|
83
184
|
return { reason: `${client.label}: already configured.`, unchanged: true };
|
|
84
185
|
}
|
|
85
186
|
const merged = {
|
|
86
187
|
...document,
|
|
87
|
-
[client.key]: { ...servers, [SERVER_NAME]:
|
|
188
|
+
[client.key]: { ...servers, [SERVER_NAME]: entry },
|
|
88
189
|
};
|
|
89
190
|
const others = Object.keys(servers).filter((name) => name !== SERVER_NAME);
|
|
90
191
|
return {
|
|
@@ -101,14 +202,14 @@ export function mergeClientConfig(client, existing) {
|
|
|
101
202
|
* Named by client and ready to paste, because "configure it yourself" without the exact shape is how a user ends up
|
|
102
203
|
* with a subtly wrong key name.
|
|
103
204
|
*/
|
|
104
|
-
export function clientSnippet(client) {
|
|
205
|
+
export function clientSnippet(client, launch) {
|
|
105
206
|
/**
|
|
106
207
|
* ⚠️ A `parent` field once let a client nest the server map under an outer object. No client declared it, no test
|
|
107
208
|
* exercised it, and a mutation throwing inside both branches ran 18 tests green — so it was capability nobody could
|
|
108
209
|
* see was broken. Removed rather than kept "just in case": all four supported clients key the map at the root, and
|
|
109
210
|
* a nesting client can have it back in a few lines, with a row that proves it.
|
|
110
211
|
*/
|
|
111
|
-
const body = { [client.key]: { [SERVER_NAME]:
|
|
212
|
+
const body = { [client.key]: { [SERVER_NAME]: serverEntry(launch) } };
|
|
112
213
|
return `${client.label} (user-scoped — paste this into its config):\n${JSON.stringify(body, null, 2)}`;
|
|
113
214
|
}
|
|
114
215
|
//# sourceMappingURL=mcpClients.js.map
|
package/dist/mcpClients.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpClients.js","sourceRoot":"","sources":["../src/mcpClients.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAyB;IAC/C
|
|
1
|
+
{"version":3,"file":"mcpClients.js","sourceRoot":"","sources":["../src/mcpClients.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAyB;IAC/C;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH;QACE,EAAE,EAAE,QAAQ;QACZ,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,kBAAkB;QACxB,GAAG,EAAE,YAAY;KAClB;IACD;QACE,EAAE,EAAE,aAAa;QACjB,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,YAAY;KAClB;IACD;QACE,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,oBAAoB;QAC1B,GAAG,EAAE,YAAY;KAClB;IACD,EAAE,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,YAAY,EAAE;CACrE,CAAC;AAkBF,wGAAwG;AACxG,MAAM,UAAU,WAAW,CAAC,MAAiB;IAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;AAC7D,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAsB,CAAC,uBAAuB,EAAE,UAAU,CAAC,CAAC;AAE5F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAc;IAC7C,EAAE,EAAE,QAAQ;IACZ,KAAK,EAAE,SAAS;IAChB,IA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ACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,MAAiB,EAAE,MAAiB;IAChE;;;;;OAKG;IACH,MAAM,IAAI,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,GAAG,MAAM,CAAC,KAAK,iDAAiD,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;AACzG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beehexa/hexasync-template-assets",
|
|
3
|
-
"version": "2610.3
|
|
3
|
+
"version": "2610.4.3",
|
|
4
4
|
"description": "Canonical intellisense asset installation. Pure core: ports in, no IO.",
|
|
5
5
|
"license": "SEE LICENSE IN ../../LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@beehexa/hexasync-template-model": "2610.3
|
|
23
|
+
"@beehexa/hexasync-template-model": "2610.4.3"
|
|
24
24
|
},
|
|
25
25
|
"publishConfig": {
|
|
26
26
|
"access": "public"
|