@beehexa/hexasync-template-assets 2608.8.3 → 2608.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/env.d.ts ADDED
@@ -0,0 +1,57 @@
1
+ /**
2
+ * The environment check — does the tooling agree with its own knowledge? (Story 6.8)
3
+ *
4
+ * ### Why every item carries a REASON, never a bare boolean (AC-1)
5
+ *
6
+ * A check that answers `false` has told you nothing you can act on. This feature has spent a session on exactly that
7
+ * failure in other clothes: four recorded constants that reproduced under no query, a guard that answered "fine" about a
8
+ * step that throws, an index section that said a project has no collections. So an item reports `pass`, `fail` or `n/a`
9
+ * **with a sentence**, and `n/a` is a first-class outcome rather than a disguised pass — "I could not evaluate this" and
10
+ * "this is fine" are different answers, and conflating them is how a stale belief survives a green check.
11
+ *
12
+ * ### Pure, so the CLI is a printer
13
+ *
14
+ * Nothing here reads a disk or a network. The caller supplies what it observed; this decides what it means. That keeps
15
+ * the decision in one place for every consumer — the CLI, the extension, an agent — which is the same reason the engine
16
+ * facade exists.
17
+ */
18
+ /** What a single check concluded. `n/a` is not a pass: it is an admission. */
19
+ export type EnvOutcome = 'pass' | 'fail' | 'n/a';
20
+ export interface EnvItem {
21
+ /** Stable id, so an agent can gate on one item rather than parse prose. */
22
+ readonly id: string;
23
+ readonly title: string;
24
+ readonly outcome: EnvOutcome;
25
+ /** Why — always present, for every outcome. A pass that cannot say why it passed is not evidence. */
26
+ readonly reason: string;
27
+ }
28
+ export interface EnvReport {
29
+ readonly items: readonly EnvItem[];
30
+ /** True when any item failed. The caller turns this into an exit code (AC-3). */
31
+ readonly failed: boolean;
32
+ /** How many could not be evaluated — surfaced so a mostly-`n/a` report cannot read as a healthy one (AC-4). */
33
+ readonly notApplicable: number;
34
+ }
35
+ /** What the caller observed. Every field is optional: absent means "could not look", which is `n/a`, not `fail`. */
36
+ export interface EnvObservation {
37
+ /** The bundle version the installed tooling ships. */
38
+ readonly toolingBundle?: string;
39
+ /** The bundle stamp written inside the installed knowledge surface. */
40
+ readonly surfaceBundle?: string;
41
+ /** Whether a project was found to check at all. */
42
+ readonly projectFound?: boolean;
43
+ /** Whether the knowledge surface exists at the canonical path. */
44
+ readonly surfaceInstalled?: boolean;
45
+ /** The installed manifest's recorded bundle, when a manifest was read. */
46
+ readonly manifestBundle?: string;
47
+ }
48
+ /**
49
+ * Decide what the observation means.
50
+ *
51
+ * ⚠️ The order is the reading order, and it matters: a reader who stops after the first failure should have seen the most
52
+ * fundamental thing first.
53
+ */
54
+ export declare function checkEnvironment(observed: EnvObservation): EnvReport;
55
+ /** The report as lines, for a terminal. One item per line, the reason always shown. */
56
+ export declare function formatEnvReport(report: EnvReport): string[];
57
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAEjD,MAAM,WAAW,OAAO;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,qGAAqG;IACrG,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,+GAA+G;IAC/G,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,oHAAoH;AACpH,MAAM,WAAW,cAAc;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,uEAAuE;IACvE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,mDAAmD;IACnD,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,kEAAkE;IAClE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAcD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,cAAc,GAAG,SAAS,CA6HpE;AAED,uFAAuF;AACvF,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,EAAE,CAa3D"}
package/dist/env.js ADDED
@@ -0,0 +1,97 @@
1
+ /**
2
+ * The environment check — does the tooling agree with its own knowledge? (Story 6.8)
3
+ *
4
+ * ### Why every item carries a REASON, never a bare boolean (AC-1)
5
+ *
6
+ * A check that answers `false` has told you nothing you can act on. This feature has spent a session on exactly that
7
+ * failure in other clothes: four recorded constants that reproduced under no query, a guard that answered "fine" about a
8
+ * step that throws, an index section that said a project has no collections. So an item reports `pass`, `fail` or `n/a`
9
+ * **with a sentence**, and `n/a` is a first-class outcome rather than a disguised pass — "I could not evaluate this" and
10
+ * "this is fine" are different answers, and conflating them is how a stale belief survives a green check.
11
+ *
12
+ * ### Pure, so the CLI is a printer
13
+ *
14
+ * Nothing here reads a disk or a network. The caller supplies what it observed; this decides what it means. That keeps
15
+ * the decision in one place for every consumer — the CLI, the extension, an agent — which is the same reason the engine
16
+ * facade exists.
17
+ */
18
+ const item = (id, title, outcome, reason) => ({
19
+ id,
20
+ title,
21
+ outcome,
22
+ reason,
23
+ });
24
+ /**
25
+ * Decide what the observation means.
26
+ *
27
+ * ⚠️ The order is the reading order, and it matters: a reader who stops after the first failure should have seen the most
28
+ * fundamental thing first.
29
+ */
30
+ export function checkEnvironment(observed) {
31
+ const items = [];
32
+ items.push(observed.projectFound === undefined
33
+ ? item('project', 'A HexaSync project is open', 'n/a', 'Nothing said whether a project was found.')
34
+ : observed.projectFound
35
+ ? item('project', 'A HexaSync project is open', 'pass', 'Found a project to check against.')
36
+ : item('project', 'A HexaSync project is open', 'n/a', 'No project here, so the project-specific items below could not be evaluated. The check still ran.'));
37
+ items.push(observed.surfaceInstalled === undefined
38
+ ? item('surface', 'The knowledge surface is installed', 'n/a', 'Could not look for the surface.')
39
+ : observed.surfaceInstalled
40
+ ? item('surface', 'The knowledge surface is installed', 'pass', 'Found it at the canonical path.')
41
+ : item('surface', 'The knowledge surface is installed', 'fail', 'Not installed. Run `Install IntelliSense` (or `hexasync intellisense install`) — until then an agent ' +
42
+ 'reading this repository has no vocabulary and will guess.'));
43
+ /**
44
+ * The stamp comparison — AC-2, and the reason this command exists.
45
+ *
46
+ * ⛔ Both versions are NAMED in the reason. "Stale" alone leaves a reader to go and find both numbers, which is the
47
+ * work they ran this to avoid.
48
+ */
49
+ if (observed.toolingBundle === undefined ||
50
+ observed.surfaceBundle === undefined) {
51
+ items.push(item('surface-current', 'The knowledge matches the install', 'n/a', observed.surfaceBundle === undefined
52
+ ? 'No surface stamp to compare — it is missing or unreadable.'
53
+ : 'Could not determine the version of the installed tooling.'));
54
+ }
55
+ else if (observed.toolingBundle === observed.surfaceBundle) {
56
+ items.push(item('surface-current', 'The knowledge matches the install', 'pass', `Both the surface and the install manifest say bundle ${observed.toolingBundle}. ⚠️ Whether the EDITOR has ` +
57
+ `since moved on cannot be checked from here — only the extension knows its own bundle version.`));
58
+ }
59
+ else {
60
+ items.push(item('surface-current', 'The knowledge matches the install', 'fail', `STALE: the knowledge surface says bundle ${observed.surfaceBundle}, the install recorded bundle ` +
61
+ `${observed.toolingBundle}. Part of the install is older than the rest, so anything an agent read from the ` +
62
+ `surface may be out of date — re-install to refresh it.`));
63
+ }
64
+ /**
65
+ * ⛔ There is no separate "manifest agrees" item, and there was.
66
+ *
67
+ * The caller derived `toolingBundle` FROM `manifestBundle`, so `manifestBundle === toolingBundle` held by
68
+ * construction: a green tick that could not fail, on an install that might be inconsistent. Its spec exercised the
69
+ * failing branch with hand-made unequal inputs — a shape production could not produce. That is the
70
+ * "a mutation test proves a test CAN fail, not that the shipped wiring is what's under test" trap exactly.
71
+ *
72
+ * The comparison that means something is surface-vs-manifest, and it is the item above. A second item comparing the
73
+ * manifest to itself added a reassurance rather than a check.
74
+ */
75
+ items.push(observed.manifestBundle === undefined
76
+ ? item('manifest', 'An install manifest was found', 'n/a', 'No manifest was read, so nothing recorded what was installed.')
77
+ : item('manifest', 'An install manifest was found', 'pass', `It records bundle ${observed.manifestBundle}, which is what the check above compares the surface against.`));
78
+ return {
79
+ items,
80
+ failed: items.some((entry) => entry.outcome === 'fail'),
81
+ notApplicable: items.filter((entry) => entry.outcome === 'n/a').length,
82
+ };
83
+ }
84
+ /** The report as lines, for a terminal. One item per line, the reason always shown. */
85
+ export function formatEnvReport(report) {
86
+ const mark = { pass: '✓', fail: '✗', 'n/a': '–' };
87
+ return [
88
+ ...report.items.map((entry) => `${mark[entry.outcome]} ${entry.title}\n ${entry.reason}`),
89
+ '',
90
+ report.failed
91
+ ? `${report.items.filter((e) => e.outcome === 'fail').length} check(s) failed.`
92
+ : report.notApplicable > 0
93
+ ? `Nothing failed, but ${report.notApplicable} check(s) could not be evaluated — see the reasons above.`
94
+ : 'Everything checks out.',
95
+ ];
96
+ }
97
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAoCH,MAAM,IAAI,GAAG,CACX,EAAU,EACV,KAAa,EACb,OAAmB,EACnB,MAAc,EACL,EAAE,CAAC,CAAC;IACb,EAAE;IACF,KAAK;IACL,OAAO;IACP,MAAM;CACP,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAwB;IACvD,MAAM,KAAK,GAAc,EAAE,CAAC;IAE5B,KAAK,CAAC,IAAI,CACR,Q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AC,OAAO,KAAK,MAAM,CAAC,CAAC,MAAM,mBAAmB;YAC/E,CAAC,CAAC,MAAM,CAAC,aAAa,GAAG,CAAC;gBACxB,CAAC,CAAC,uBAAuB,MAAM,CAAC,aAAa,2DAA2D;gBACxG,CAAC,CAAC,wBAAwB;KAC/B,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,4 +6,6 @@ export { classifyTarget, summariseClassification, type ClassifiedFile, type Clas
6
6
  export { assertInstalled, updateAssets, type ConfirmOverwrite, type OverwriteDiff, type UpdateOptions, type UpdateOutcome, type UpdateResult, } from './update.js';
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
+ export { checkEnvironment, formatEnvReport, type EnvItem, type EnvObservation, type EnvOutcome, type EnvReport, } from './env.js';
10
+ export { MCP_CLIENTS, SERVER_ENTRY, SERVER_NAME, clientSnippet, mergeClientConfig, type McpClient, type MergeOutcome, } from './mcpClients.js';
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -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"}
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,YAAY,EACZ,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,YAAY,GAClB,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -4,4 +4,6 @@ export { basenameUri, dirnameUri, isInsideUri, joinUri, normalizeUri, relativeUr
4
4
  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
+ export { checkEnvironment, formatEnvReport, } from './env.js';
8
+ export { MCP_CLIENTS, SERVER_ENTRY, SERVER_NAME, clientSnippet, mergeClientConfig, } from './mcpClients.js';
7
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"}
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,YAAY,EACZ,WAAW,EACX,aAAa,EACb,iBAAiB,GAGlB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Writing an MCP server entry into each client's own configuration (Story 7.5).
3
+ *
4
+ * ### Why this is data, not four code paths
5
+ *
6
+ * Every client stores the same three facts — a name, a command, its arguments — under a different key, in a different
7
+ * file, with a different nesting. Four bespoke writers would be four places to update when a fifth client appears, and
8
+ * four chances for one of them to overwrite something. So a client is a **row**, and one merge serves all of them.
9
+ *
10
+ * ### Pure, so the decision is testable without a filesystem
11
+ *
12
+ * `mergeClientConfig` takes the existing file's text and returns the text to write. The caller does the reading and
13
+ * writing. That is what makes AC-2 (*"those survive — the file is extended, never overwritten"*) and AC-4 (*"nothing
14
+ * changes"*) assertable on strings rather than on a temp directory.
15
+ */
16
+ /** How one client stores MCP servers. */
17
+ export interface McpClient {
18
+ readonly id: string;
19
+ readonly label: string;
20
+ /** Project-scoped path, relative to the workspace root. `undefined` when the client is user-scoped only. */
21
+ readonly file?: string;
22
+ /** The property that holds the server map — clients disagree about this. */
23
+ readonly key: string;
24
+ }
25
+ /**
26
+ * The clients this writes for.
27
+ *
28
+ * ⚠️ `claude-desktop` has **no project-scoped file** — its configuration is user-scoped and lives outside any
29
+ * workspace. Writing there would edit a file the user did not put under version control and did not ask us to touch, so
30
+ * AC-3 prints a snippet instead. That is a deliberate refusal, not a gap.
31
+ */
32
+ export declare const MCP_CLIENTS: readonly McpClient[];
33
+ /** The entry every client gets — the same server, however each one spells the surrounding structure. */
34
+ export declare const SERVER_ENTRY: {
35
+ readonly command: "hexasync";
36
+ readonly args: readonly ["mcp"];
37
+ };
38
+ export declare const SERVER_NAME = "hexasync";
39
+ export interface MergeOutcome {
40
+ /** The text to write, or `undefined` when nothing needs writing (AC-4). */
41
+ readonly text?: string;
42
+ /** Why, in one line — for a report a human reads. */
43
+ readonly reason: string;
44
+ /** True when the file already said the right thing. */
45
+ readonly unchanged: boolean;
46
+ }
47
+ /**
48
+ * Merge our entry into a client's configuration.
49
+ *
50
+ * ⛔ **Never overwrites.** The existing document is parsed, one key is added under the server map, and everything else
51
+ * is preserved — including servers this feature knows nothing about. A configuration file is the user's, and the most
52
+ * damaging thing an installer can do is silently drop someone else's entry.
53
+ *
54
+ * ⚠️ Unparseable input is REFUSED rather than replaced. A file with a syntax error still contains the user's work, and
55
+ * overwriting it to make the install succeed would trade their configuration for our convenience.
56
+ */
57
+ export declare function mergeClientConfig(client: McpClient, existing: string | undefined): MergeOutcome;
58
+ /**
59
+ * The snippet for a client we will not write to (AC-3).
60
+ *
61
+ * Named by client and ready to paste, because "configure it yourself" without the exact shape is how a user ends up
62
+ * with a subtly wrong key name.
63
+ */
64
+ export declare function clientSnippet(client: McpClient): string;
65
+ //# sourceMappingURL=mcpClients.d.ts.map
@@ -0,0 +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,EAqB3C,CAAC;AAEF,wGAAwG;AACxG,eAAO,MAAM,YAAY;;;CAAkD,CAAC;AAE5E,eAAO,MAAM,WAAW,aAAa,CAAC;AAEtC,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,GAC3B,YAAY,CA6Cd;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CASvD"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Writing an MCP server entry into each client's own configuration (Story 7.5).
3
+ *
4
+ * ### Why this is data, not four code paths
5
+ *
6
+ * Every client stores the same three facts — a name, a command, its arguments — under a different key, in a different
7
+ * file, with a different nesting. Four bespoke writers would be four places to update when a fifth client appears, and
8
+ * four chances for one of them to overwrite something. So a client is a **row**, and one merge serves all of them.
9
+ *
10
+ * ### Pure, so the decision is testable without a filesystem
11
+ *
12
+ * `mergeClientConfig` takes the existing file's text and returns the text to write. The caller does the reading and
13
+ * writing. That is what makes AC-2 (*"those survive — the file is extended, never overwritten"*) and AC-4 (*"nothing
14
+ * changes"*) assertable on strings rather than on a temp directory.
15
+ */
16
+ /**
17
+ * The clients this writes for.
18
+ *
19
+ * ⚠️ `claude-desktop` has **no project-scoped file** — its configuration is user-scoped and lives outside any
20
+ * workspace. Writing there would edit a file the user did not put under version control and did not ask us to touch, so
21
+ * AC-3 prints a snippet instead. That is a deliberate refusal, not a gap.
22
+ */
23
+ export const MCP_CLIENTS = [
24
+ { id: 'vscode', label: 'VS Code', file: '.vscode/mcp.json', key: 'servers' },
25
+ {
26
+ id: 'cursor',
27
+ label: 'Cursor',
28
+ file: '.cursor/mcp.json',
29
+ key: 'mcpServers',
30
+ },
31
+ {
32
+ id: 'claude-code',
33
+ label: 'Claude Code',
34
+ file: '.mcp.json',
35
+ key: 'mcpServers',
36
+ },
37
+ {
38
+ id: 'windsurf',
39
+ label: 'Windsurf',
40
+ file: '.windsurf/mcp.json',
41
+ key: 'mcpServers',
42
+ },
43
+ { id: 'claude-desktop', label: 'Claude Desktop', key: 'mcpServers' },
44
+ ];
45
+ /** The entry every client gets — the same server, however each one spells the surrounding structure. */
46
+ export const SERVER_ENTRY = { command: 'hexasync', args: ['mcp'] };
47
+ export const SERVER_NAME = 'hexasync';
48
+ /**
49
+ * Merge our entry into a client's configuration.
50
+ *
51
+ * ⛔ **Never overwrites.** The existing document is parsed, one key is added under the server map, and everything else
52
+ * is preserved — including servers this feature knows nothing about. A configuration file is the user's, and the most
53
+ * damaging thing an installer can do is silently drop someone else's entry.
54
+ *
55
+ * ⚠️ Unparseable input is REFUSED rather than replaced. A file with a syntax error still contains the user's work, and
56
+ * overwriting it to make the install succeed would trade their configuration for our convenience.
57
+ */
58
+ export function mergeClientConfig(client, existing) {
59
+ let document = {};
60
+ if (existing !== undefined && existing.trim() !== '') {
61
+ try {
62
+ const parsed = JSON.parse(existing);
63
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
64
+ return {
65
+ reason: `${client.label}: its configuration is not a JSON object, so it was left alone.`,
66
+ unchanged: true,
67
+ };
68
+ }
69
+ document = parsed;
70
+ }
71
+ catch {
72
+ return {
73
+ reason: `${client.label}: its configuration does not parse as JSON, so it was left alone — it still holds your ` +
74
+ `work, and overwriting it would trade that for a successful install.`,
75
+ unchanged: true,
76
+ };
77
+ }
78
+ }
79
+ const servers = document[client.key] ?? {};
80
+ const current = servers[SERVER_NAME];
81
+ if (JSON.stringify(current) === JSON.stringify(SERVER_ENTRY)) {
82
+ // AC-4 — already correct, so nothing is written. Rewriting an identical file churns a diff and a mtime for nothing.
83
+ return { reason: `${client.label}: already configured.`, unchanged: true };
84
+ }
85
+ const merged = {
86
+ ...document,
87
+ [client.key]: { ...servers, [SERVER_NAME]: SERVER_ENTRY },
88
+ };
89
+ const others = Object.keys(servers).filter((name) => name !== SERVER_NAME);
90
+ return {
91
+ text: `${JSON.stringify(merged, null, 2)}\n`,
92
+ reason: others.length > 0
93
+ ? `${client.label}: added \`${SERVER_NAME}\`, keeping ${others.length} other server(s).`
94
+ : `${client.label}: added \`${SERVER_NAME}\`.`,
95
+ unchanged: false,
96
+ };
97
+ }
98
+ /**
99
+ * The snippet for a client we will not write to (AC-3).
100
+ *
101
+ * Named by client and ready to paste, because "configure it yourself" without the exact shape is how a user ends up
102
+ * with a subtly wrong key name.
103
+ */
104
+ export function clientSnippet(client) {
105
+ /**
106
+ * ⚠️ A `parent` field once let a client nest the server map under an outer object. No client declared it, no test
107
+ * exercised it, and a mutation throwing inside both branches ran 18 tests green — so it was capability nobody could
108
+ * see was broken. Removed rather than kept "just in case": all four supported clients key the map at the root, and
109
+ * a nesting client can have it back in a few lines, with a row that proves it.
110
+ */
111
+ const body = { [client.key]: { [SERVER_NAME]: SERVER_ENTRY } };
112
+ return `${client.label} (user-scoped — paste this into its config):\n${JSON.stringify(body, null, 2)}`;
113
+ }
114
+ //# sourceMappingURL=mcpClients.js.map
@@ -0,0 +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,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG,EAAE,SAAS,EAAE;IAC5E;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,E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
+ "version": "2608.15.1",
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": "2608.8.3"
23
+ "@beehexa/hexasync-template-model": "2608.15.1"
24
24
  },
25
25
  "hexasync": {
26
26
  "layer": "core"