@nram-ai/setup-agents 0.0.1-pre.0

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 (84) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +109 -0
  3. package/dist/helpers/configure/amp.d.ts +9 -0
  4. package/dist/helpers/configure/amp.js +49 -0
  5. package/dist/helpers/configure/amp.js.map +1 -0
  6. package/dist/helpers/configure/antigravity.d.ts +12 -0
  7. package/dist/helpers/configure/antigravity.js +74 -0
  8. package/dist/helpers/configure/antigravity.js.map +1 -0
  9. package/dist/helpers/configure/claude_code.d.ts +9 -0
  10. package/dist/helpers/configure/claude_code.js +119 -0
  11. package/dist/helpers/configure/claude_code.js.map +1 -0
  12. package/dist/helpers/configure/codex.d.ts +19 -0
  13. package/dist/helpers/configure/codex.js +76 -0
  14. package/dist/helpers/configure/codex.js.map +1 -0
  15. package/dist/helpers/configure/copilot.d.ts +11 -0
  16. package/dist/helpers/configure/copilot.js +64 -0
  17. package/dist/helpers/configure/copilot.js.map +1 -0
  18. package/dist/helpers/configure/cursor.d.ts +26 -0
  19. package/dist/helpers/configure/cursor.js +90 -0
  20. package/dist/helpers/configure/cursor.js.map +1 -0
  21. package/dist/helpers/configure/droid.d.ts +18 -0
  22. package/dist/helpers/configure/droid.js +70 -0
  23. package/dist/helpers/configure/droid.js.map +1 -0
  24. package/dist/helpers/configure/grok.d.ts +25 -0
  25. package/dist/helpers/configure/grok.js +93 -0
  26. package/dist/helpers/configure/grok.js.map +1 -0
  27. package/dist/helpers/configure/hermes.d.ts +22 -0
  28. package/dist/helpers/configure/hermes.js +107 -0
  29. package/dist/helpers/configure/hermes.js.map +1 -0
  30. package/dist/helpers/configure/junie.d.ts +10 -0
  31. package/dist/helpers/configure/junie.js +52 -0
  32. package/dist/helpers/configure/junie.js.map +1 -0
  33. package/dist/helpers/configure/kilo.d.ts +19 -0
  34. package/dist/helpers/configure/kilo.js +110 -0
  35. package/dist/helpers/configure/kilo.js.map +1 -0
  36. package/dist/helpers/configure/kimi.d.ts +10 -0
  37. package/dist/helpers/configure/kimi.js +75 -0
  38. package/dist/helpers/configure/kimi.js.map +1 -0
  39. package/dist/helpers/configure/kiro.d.ts +25 -0
  40. package/dist/helpers/configure/kiro.js +77 -0
  41. package/dist/helpers/configure/kiro.js.map +1 -0
  42. package/dist/helpers/configure/openclaw.d.ts +10 -0
  43. package/dist/helpers/configure/openclaw.js +72 -0
  44. package/dist/helpers/configure/openclaw.js.map +1 -0
  45. package/dist/helpers/configure/opencode.d.ts +18 -0
  46. package/dist/helpers/configure/opencode.js +72 -0
  47. package/dist/helpers/configure/opencode.js.map +1 -0
  48. package/dist/helpers/configure/pi.d.ts +10 -0
  49. package/dist/helpers/configure/pi.js +60 -0
  50. package/dist/helpers/configure/pi.js.map +1 -0
  51. package/dist/helpers/configure/trae.d.ts +11 -0
  52. package/dist/helpers/configure/trae.js +63 -0
  53. package/dist/helpers/configure/trae.js.map +1 -0
  54. package/dist/helpers/configure/vibe.d.ts +24 -0
  55. package/dist/helpers/configure/vibe.js +106 -0
  56. package/dist/helpers/configure/vibe.js.map +1 -0
  57. package/dist/helpers/configure/vscode.d.ts +18 -0
  58. package/dist/helpers/configure/vscode.js +81 -0
  59. package/dist/helpers/configure/vscode.js.map +1 -0
  60. package/dist/helpers/harnesses.d.ts +8 -0
  61. package/dist/helpers/harnesses.js +161 -0
  62. package/dist/helpers/harnesses.js.map +1 -0
  63. package/dist/helpers/instructions.d.ts +63 -0
  64. package/dist/helpers/instructions.js +175 -0
  65. package/dist/helpers/instructions.js.map +1 -0
  66. package/dist/helpers/paths.d.ts +130 -0
  67. package/dist/helpers/paths.js +211 -0
  68. package/dist/helpers/paths.js.map +1 -0
  69. package/dist/helpers/upsert.d.ts +197 -0
  70. package/dist/helpers/upsert.js +428 -0
  71. package/dist/helpers/upsert.js.map +1 -0
  72. package/dist/helpers/url.d.ts +15 -0
  73. package/dist/helpers/url.js +51 -0
  74. package/dist/helpers/url.js.map +1 -0
  75. package/dist/index.d.ts +2 -0
  76. package/dist/index.js +105 -0
  77. package/dist/index.js.map +1 -0
  78. package/dist/setup.d.ts +17 -0
  79. package/dist/setup.js +296 -0
  80. package/dist/setup.js.map +1 -0
  81. package/dist/types.d.ts +67 -0
  82. package/dist/types.js +50 -0
  83. package/dist/types.js.map +1 -0
  84. package/package.json +76 -0
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ // Copyright (c) 2026, Brandon Lehmann <brandonlehmann@gmail.com>
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.configure_trae = void 0;
23
+ const path_1 = require("path");
24
+ const types_1 = require("../../types");
25
+ const paths_1 = require("../paths");
26
+ const upsert_1 = require("../upsert");
27
+ /**
28
+ * Configures Trae (ByteDance): writes the agent instructions as a project
29
+ * rules file. Trae's MCP config schema could not be verified against
30
+ * accessible documentation, so MCP registration is reported as a manual
31
+ * step through Trae's own UI rather than risking a guessed write; the
32
+ * user-level rules location is likewise undocumented
33
+ *
34
+ * @param options the collected setup options
35
+ */
36
+ const configure_trae = async (options) => {
37
+ const results = [];
38
+ if (options.mcp_url !== undefined) {
39
+ results.push({
40
+ action: 'MCP registration',
41
+ kind: 'manual',
42
+ detail: 'Trae\'s MCP config file schema is not verifiable against accessible docs; add the server ' +
43
+ `through Trae's UI (MCP, Add) with the URL ${options.mcp_url}`
44
+ });
45
+ }
46
+ if (options.instructions) {
47
+ if (options.scope !== types_1.Scope.PROJECT) {
48
+ results.push({
49
+ action: 'Agent instructions',
50
+ kind: 'skipped',
51
+ detail: 'Trae user-level rules are managed through the IDE UI (no documented file path); ' +
52
+ 'rerun at project scope to write .trae/rules/nram.md'
53
+ });
54
+ }
55
+ else {
56
+ const rule_path = (0, path_1.resolve)((0, paths_1.trae_dir)(options.scope), 'rules', 'nram.md');
57
+ results.push((0, upsert_1.upsert_own_file)(rule_path, options.instructions.condensed, 'Agent instructions'));
58
+ }
59
+ }
60
+ return results;
61
+ };
62
+ exports.configure_trae = configure_trae;
63
+ //# sourceMappingURL=trae.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trae.js","sourceRoot":"","sources":["../../../src/helpers/configure/trae.ts"],"names":[],"mappings":";AAAA,iEAAiE;AACjE,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAC3D,EAAE;AACF,iFAAiF;AACjF,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,YAAY;;;AAEZ,+BAA+B;AAC/B,uCAAgE;AAChE,oCAAoC;AACpC,sCAA4C;AAE5C;;;;;;;;GAQG;AACI,MAAM,cAAc,GAAG,KAAK,EAAE,OAAqB,EAA2B,EAAE;IACnF,MAAM,OAAO,GAAmB,EAAE,CAAC;IAEnC,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,CAAC,IAAI,CAAC;YACT,MAAM,EAAE,kBAAkB;YAC1B,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,2FAA2F;gBAC/F,6CAA6C,OAAO,CAAC,OAAO,EAAE;SACrE,CAAC,CAAC;IACP,CAAC;IAED,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACvB,IAAI,OAAO,CAAC,KAAK,KAAK,aAAK,CAAC,OAAO,EAAE,CAAC;YAClC,OAAO,CAAC,IAAI,CAAC;gBACT,MAAM,EAAE,oBAAoB;gBAC5B,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,kFAAkF;oBACtF,qDAAqD;aAC5D,CAAC,CAAC;QACP,CAAC;aAAM,CAAC;YACJ,MAAM,SAAS,GAAG,IAAA,cAAO,EAAC,IAAA,gBAAQ,EAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;YAEvE,OAAO,CAAC,IAAI,CAAC,IAAA,wBAAe,EAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC;QACnG,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AA5BW,QAAA,cAAc,kBA4BzB"}
@@ -0,0 +1,24 @@
1
+ import { ActionResult, SetupOptions } from '../../types';
2
+ /**
3
+ * Builds the marker-fenced `[[mcp_servers]]` TOML block. nram serves MCP over
4
+ * streamable HTTP, so the matching Vibe transport is declared explicitly. In
5
+ * API-key mode the key itself is never written to disk; Vibe's documented
6
+ * `api_key_env` substitution references the NRAM_API_KEY environment variable
7
+ *
8
+ * @param mcp_url the MCP endpoint URL
9
+ * @param api_key the API key, when API-key authentication was chosen
10
+ */
11
+ export declare const vibe_mcp_block: (mcp_url: string, api_key?: string) => string;
12
+ /**
13
+ * Configures Vibe (Mistral): upserts a marker-fenced `[[mcp_servers]]` block
14
+ * in config.toml and the agent instructions into the AGENTS.md Vibe reads
15
+ * (`~/.vibe/AGENTS.md` at user scope, the repository root at project scope).
16
+ *
17
+ * Vibe reads exactly ONE config.toml (`./.vibe/config.toml` when present,
18
+ * else `~/.vibe/config.toml` as a whole-file fallback, never a merge), so a
19
+ * project config.toml is only ever updated, not created: creating one would
20
+ * silently shadow everything in the user-level file
21
+ *
22
+ * @param options the collected setup options
23
+ */
24
+ export declare const configure_vibe: (options: SetupOptions) => Promise<ActionResult[]>;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ // Copyright (c) 2026, Brandon Lehmann <brandonlehmann@gmail.com>
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.configure_vibe = exports.vibe_mcp_block = void 0;
23
+ const fs_1 = require("fs");
24
+ const path_1 = require("path");
25
+ const smol_toml_1 = require("smol-toml");
26
+ const types_1 = require("../../types");
27
+ const paths_1 = require("../paths");
28
+ const upsert_1 = require("../upsert");
29
+ /**
30
+ * Returns whether the parsed config carries an `[[mcp_servers]]` entry named
31
+ * `nram` (Vibe keys its MCP servers as an array of tables, not a keyed table)
32
+ *
33
+ * @param parsed the parsed config.toml
34
+ */
35
+ const has_nram_entry = (parsed) => Array.isArray(parsed?.mcp_servers) &&
36
+ parsed.mcp_servers.some((server) => server?.name === 'nram');
37
+ /**
38
+ * Builds the marker-fenced `[[mcp_servers]]` TOML block. nram serves MCP over
39
+ * streamable HTTP, so the matching Vibe transport is declared explicitly. In
40
+ * API-key mode the key itself is never written to disk; Vibe's documented
41
+ * `api_key_env` substitution references the NRAM_API_KEY environment variable
42
+ *
43
+ * @param mcp_url the MCP endpoint URL
44
+ * @param api_key the API key, when API-key authentication was chosen
45
+ */
46
+ const vibe_mcp_block = (mcp_url, api_key) => {
47
+ const lines = [
48
+ '[[mcp_servers]]',
49
+ 'name = "nram"',
50
+ 'transport = "streamable-http"',
51
+ `url = "${mcp_url}"`
52
+ ];
53
+ if (api_key !== undefined) {
54
+ lines.push('api_key_env = "NRAM_API_KEY"', 'api_key_header = "Authorization"', 'api_key_format = "Bearer {token}"');
55
+ }
56
+ return lines.join('\n');
57
+ };
58
+ exports.vibe_mcp_block = vibe_mcp_block;
59
+ /**
60
+ * Configures Vibe (Mistral): upserts a marker-fenced `[[mcp_servers]]` block
61
+ * in config.toml and the agent instructions into the AGENTS.md Vibe reads
62
+ * (`~/.vibe/AGENTS.md` at user scope, the repository root at project scope).
63
+ *
64
+ * Vibe reads exactly ONE config.toml (`./.vibe/config.toml` when present,
65
+ * else `~/.vibe/config.toml` as a whole-file fallback, never a merge), so a
66
+ * project config.toml is only ever updated, not created: creating one would
67
+ * silently shadow everything in the user-level file
68
+ *
69
+ * @param options the collected setup options
70
+ */
71
+ const configure_vibe = async (options) => {
72
+ const results = [];
73
+ if (options.mcp_url !== undefined) {
74
+ const config_path = (0, path_1.resolve)((0, paths_1.vibe_dir)(options.scope), 'config.toml');
75
+ if (options.scope === types_1.Scope.PROJECT && !(0, fs_1.existsSync)(config_path)) {
76
+ results.push({
77
+ action: 'MCP registration',
78
+ kind: 'manual',
79
+ detail: `refusing to create ${config_path}: Vibe reads one config.toml, and a new project ` +
80
+ 'file would shadow the user-level one entirely; if you want a project config, create ' +
81
+ 'it yourself and re-run, or add this block to it:\n' +
82
+ (0, exports.vibe_mcp_block)(options.mcp_url, options.api_key)
83
+ });
84
+ }
85
+ else {
86
+ const mcp = (0, upsert_1.upsert_block_with_validation)(config_path, (0, exports.vibe_mcp_block)(options.mcp_url, options.api_key), smol_toml_1.parse, 'TOML', (parsed, text) => has_nram_entry(parsed) && !(0, upsert_1.has_marker_block)(text, 'hash')
87
+ ? {
88
+ action: 'MCP registration',
89
+ kind: 'skipped',
90
+ detail: `an [[mcp_servers]] entry named "nram" already exists in ${config_path} ` +
91
+ '(outside the nram setup markers)'
92
+ }
93
+ : undefined, has_nram_entry);
94
+ results.push(mcp);
95
+ if ((mcp.kind === 'written' || mcp.kind === 'updated') && options.api_key !== undefined) {
96
+ results.push((0, upsert_1.api_key_manual_result)());
97
+ }
98
+ }
99
+ }
100
+ if (options.instructions) {
101
+ results.push((0, upsert_1.agents_md_result)((0, paths_1.agents_md_path)(options.scope, (0, path_1.resolve)((0, paths_1.vibe_dir)(options.scope), 'AGENTS.md')), options.instructions.full));
102
+ }
103
+ return results;
104
+ };
105
+ exports.configure_vibe = configure_vibe;
106
+ //# sourceMappingURL=vibe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vibe.js","sourceRoot":"","sources":["../../../src/helpers/configure/vibe.ts"],"names":[],"mappings":";AAAA,iEAAiE;AACjE,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAC3D,E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C,OAAO,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,EAC5E,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AA/CW,QAAA,cAAc,kBA+CzB"}
@@ -0,0 +1,18 @@
1
+ import { ActionResult, SetupOptions } from '../../types';
2
+ /**
3
+ * Builds the instructions file VS Code loads for Copilot
4
+ * (`applyTo: '**'` front matter applies it to every request)
5
+ *
6
+ * @param instructions the agent instructions text
7
+ */
8
+ export declare const vscode_instruction_file: (instructions: string) => string;
9
+ /**
10
+ * Configures VS Code (Copilot agent mode): merges the nram MCP server into
11
+ * the project `.vscode/mcp.json` (the user-profile mcp.json filename is not
12
+ * documented, so user scope reports the Command Palette path instead) and
13
+ * writes the agent instructions as an `*.instructions.md` file in the
14
+ * profile prompts dir (user) or `.github/instructions` (project)
15
+ *
16
+ * @param options the collected setup options
17
+ */
18
+ export declare const configure_vscode: (options: SetupOptions) => Promise<ActionResult[]>;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ // Copyright (c) 2026, Brandon Lehmann <brandonlehmann@gmail.com>
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.configure_vscode = exports.vscode_instruction_file = void 0;
23
+ const path_1 = require("path");
24
+ const types_1 = require("../../types");
25
+ const paths_1 = require("../paths");
26
+ const upsert_1 = require("../upsert");
27
+ /**
28
+ * Builds the instructions file VS Code loads for Copilot
29
+ * (`applyTo: '**'` front matter applies it to every request)
30
+ *
31
+ * @param instructions the agent instructions text
32
+ */
33
+ const vscode_instruction_file = (instructions) => '---\n' +
34
+ 'applyTo: \'**\'\n' +
35
+ 'description: nram (Neural Ram) persistent memory protocol\n' +
36
+ '---\n\n' +
37
+ `${instructions.trimEnd()}\n`;
38
+ exports.vscode_instruction_file = vscode_instruction_file;
39
+ /**
40
+ * Configures VS Code (Copilot agent mode): merges the nram MCP server into
41
+ * the project `.vscode/mcp.json` (the user-profile mcp.json filename is not
42
+ * documented, so user scope reports the Command Palette path instead) and
43
+ * writes the agent instructions as an `*.instructions.md` file in the
44
+ * profile prompts dir (user) or `.github/instructions` (project)
45
+ *
46
+ * @param options the collected setup options
47
+ */
48
+ const configure_vscode = async (options) => {
49
+ const results = [];
50
+ if (options.mcp_url !== undefined) {
51
+ if (options.scope !== types_1.Scope.PROJECT) {
52
+ results.push({
53
+ action: 'MCP registration',
54
+ kind: 'manual',
55
+ detail: 'VS Code keeps user-level MCP servers in a profile file with no documented path; run ' +
56
+ 'the "MCP: Open User Configuration" command in VS Code and add under "servers": ' +
57
+ `"nram": { "type": "http", "url": "${options.mcp_url}" }`
58
+ });
59
+ }
60
+ else {
61
+ const config_path = (0, path_1.resolve)(process.cwd(), '.vscode', 'mcp.json');
62
+ const mcp = (0, upsert_1.mcp_json_result)(config_path, ['servers', 'nram'], {
63
+ type: 'http',
64
+ url: options.mcp_url
65
+ });
66
+ results.push(mcp);
67
+ if (mcp.kind !== 'manual' && options.api_key !== undefined) {
68
+ results.push((0, upsert_1.api_key_header_manual_result)(config_path));
69
+ }
70
+ }
71
+ }
72
+ if (options.instructions) {
73
+ const instructions_path = options.scope === types_1.Scope.USER
74
+ ? (0, path_1.resolve)((0, paths_1.vscode_user_dir)(), 'prompts', 'nram.instructions.md')
75
+ : (0, path_1.resolve)(process.cwd(), '.github', 'instructions', 'nram.instructions.md');
76
+ results.push((0, upsert_1.upsert_own_file)(instructions_path, (0, exports.vscode_instruction_file)(options.instructions.condensed), 'Agent instructions'));
77
+ }
78
+ return results;
79
+ };
80
+ exports.configure_vscode = configure_vscode;
81
+ //# sourceMappingURL=vscode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vscode.js","sourceRoot":"","sources":["../../../src/helpers/configure/vscode.ts"],"names":[],"mappings":";AAAA,iEAAiE;AACjE,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAC3D,EAAE;AACF,iFAAiF;AACjF,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,YAAY;;;AAEZ,+BAA+B;AAC/B,uCAAgE;AAChE,oCAA2C;AAC3C,sCAA2F;AAE3F;;;;;GAKG;AACI,MAAM,uBAAuB,GAAG,CAAC,YAAoB,EAAU,EAAE,CACpE,OAAO;IACP,mBAAmB;IACnB,6DAA6D;IAC7D,SAAS;IACT,GAAG,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC;AALrB,QAAA,uBAAuB,2BAKF;AAElC;;;;;;;;GAQG;AACI,MAAM,gBAAgB,GAAG,KAAK,EAAE,OAAqB,EAA2B,EAAE;IACrF,MAAM,OAAO,GAAmB,EA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EAAE,IAAA,+BAAuB,EAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,EACtF,oBAAoB,CAAC,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAvCW,QAAA,gBAAgB,oBAuC3B"}
@@ -0,0 +1,8 @@
1
+ import { Harness, HarnessDescriptor, Scope } from '../types';
2
+ export { Harness, Scope };
3
+ /**
4
+ * The harnesses this tool knows how to configure, ordered alphabetically by
5
+ * label, with per-scope detection: user scope checks the tool's home
6
+ * directory, project scope checks the tool's directory in the repository
7
+ */
8
+ export declare const HARNESSES: HarnessDescriptor[];
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ // Copyright (c) 2026, Brandon Lehmann <brandonlehmann@gmail.com>
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal
6
+ // in the Software without restriction, including without limitation the rights
7
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ // copies of the Software, and to permit persons to whom the Software is
9
+ // furnished to do so, subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in all
12
+ // copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ // SOFTWARE.
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.HARNESSES = exports.Scope = exports.Harness = void 0;
23
+ const fs_1 = require("fs");
24
+ const path_1 = require("path");
25
+ const types_1 = require("../types");
26
+ Object.defineProperty(exports, "Harness", { enumerable: true, get: function () { return types_1.Harness; } });
27
+ Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return types_1.Scope; } });
28
+ const paths_1 = require("./paths");
29
+ const amp_1 = require("./configure/amp");
30
+ const antigravity_1 = require("./configure/antigravity");
31
+ const claude_code_1 = require("./configure/claude_code");
32
+ const codex_1 = require("./configure/codex");
33
+ const copilot_1 = require("./configure/copilot");
34
+ const cursor_1 = require("./configure/cursor");
35
+ const droid_1 = require("./configure/droid");
36
+ const grok_1 = require("./configure/grok");
37
+ const hermes_1 = require("./configure/hermes");
38
+ const junie_1 = require("./configure/junie");
39
+ const kilo_1 = require("./configure/kilo");
40
+ const kimi_1 = require("./configure/kimi");
41
+ const kiro_1 = require("./configure/kiro");
42
+ const openclaw_1 = require("./configure/openclaw");
43
+ const opencode_1 = require("./configure/opencode");
44
+ const pi_1 = require("./configure/pi");
45
+ const trae_1 = require("./configure/trae");
46
+ const vibe_1 = require("./configure/vibe");
47
+ const vscode_1 = require("./configure/vscode");
48
+ /**
49
+ * The harnesses this tool knows how to configure, ordered alphabetically by
50
+ * label, with per-scope detection: user scope checks the tool's home
51
+ * directory, project scope checks the tool's directory in the repository
52
+ */
53
+ exports.HARNESSES = [{
54
+ harness: types_1.Harness.AMP,
55
+ label: 'Amp',
56
+ detected: scope => (0, fs_1.existsSync)((0, paths_1.amp_dir)(scope)),
57
+ configure: amp_1.configure_amp
58
+ }, {
59
+ harness: types_1.Harness.GOOGLE_ANTIGRAVITY,
60
+ label: 'Antigravity',
61
+ detected: scope => scope === types_1.Scope.USER
62
+ ? (0, fs_1.existsSync)((0, paths_1.antigravity_dir)())
63
+ : (0, fs_1.existsSync)((0, path_1.resolve)(process.cwd(), '.agent')),
64
+ configure: antigravity_1.configure_antigravity
65
+ }, {
66
+ harness: types_1.Harness.ANTHROPIC_CLAUDE_CODE,
67
+ label: 'Claude Code',
68
+ detected: scope => (0, fs_1.existsSync)((0, paths_1.claude_dir)(scope)),
69
+ configure: claude_code_1.configure_claude_code
70
+ }, {
71
+ harness: types_1.Harness.OPENAI_CODEX,
72
+ label: 'Codex',
73
+ detected: scope => (0, fs_1.existsSync)((0, paths_1.codex_dir)(scope)),
74
+ configure: codex_1.configure_codex
75
+ }, {
76
+ harness: types_1.Harness.CURSOR,
77
+ label: 'Cursor',
78
+ detected: scope => (0, fs_1.existsSync)((0, paths_1.cursor_dir)(scope)),
79
+ configure: cursor_1.configure_cursor
80
+ }, {
81
+ harness: types_1.Harness.FACTORY_DROID,
82
+ label: 'Droid',
83
+ detected: scope => (0, fs_1.existsSync)((0, paths_1.factory_dir)(scope)),
84
+ configure: droid_1.configure_droid
85
+ }, {
86
+ harness: types_1.Harness.GITHUB_COPILOT_CLI,
87
+ label: 'GitHub Copilot CLI',
88
+ detected: scope => scope === types_1.Scope.USER
89
+ ? (0, fs_1.existsSync)((0, paths_1.copilot_dir)())
90
+ : (0, fs_1.existsSync)((0, path_1.resolve)(process.cwd(), '.github', 'copilot-instructions.md')),
91
+ configure: copilot_1.configure_copilot
92
+ }, {
93
+ harness: types_1.Harness.XAI_GROK_BUILD,
94
+ label: 'Grok Build',
95
+ detected: scope => (0, fs_1.existsSync)((0, paths_1.grok_dir)(scope)),
96
+ configure: grok_1.configure_grok
97
+ }, {
98
+ harness: types_1.Harness.HERMES,
99
+ label: 'Hermes',
100
+ detected: scope => scope === types_1.Scope.USER && (0, fs_1.existsSync)((0, paths_1.hermes_dir)()),
101
+ configure: hermes_1.configure_hermes
102
+ }, {
103
+ harness: types_1.Harness.JETBRAINS_JUNIE,
104
+ label: 'Junie',
105
+ detected: scope => (0, fs_1.existsSync)((0, paths_1.junie_dir)(scope)),
106
+ configure: junie_1.configure_junie
107
+ }, {
108
+ harness: types_1.Harness.KILO_CODE,
109
+ label: 'Kilo Code',
110
+ detected: scope => scope === types_1.Scope.USER
111
+ ? (0, fs_1.existsSync)((0, paths_1.kilo_dir)(scope))
112
+ : (0, fs_1.existsSync)((0, paths_1.kilo_dir)(scope)) || (0, fs_1.existsSync)((0, path_1.resolve)(process.cwd(), 'kilo.jsonc')),
113
+ configure: kilo_1.configure_kilo
114
+ }, {
115
+ harness: types_1.Harness.KIMI_CODE,
116
+ label: 'Kimi Code',
117
+ detected: scope => scope === types_1.Scope.USER && (0, fs_1.existsSync)((0, paths_1.kimi_dir)()),
118
+ configure: kimi_1.configure_kimi
119
+ }, {
120
+ harness: types_1.Harness.KIRO,
121
+ label: 'Kiro',
122
+ detected: scope => (0, fs_1.existsSync)((0, paths_1.kiro_dir)(scope)),
123
+ configure: kiro_1.configure_kiro
124
+ }, {
125
+ harness: types_1.Harness.OPENCLAW,
126
+ label: 'OpenClaw',
127
+ detected: scope => scope === types_1.Scope.USER && (0, fs_1.existsSync)((0, paths_1.openclaw_dir)()),
128
+ configure: openclaw_1.configure_openclaw
129
+ }, {
130
+ harness: types_1.Harness.OPENCODE,
131
+ label: 'OpenCode',
132
+ detected: scope => scope === types_1.Scope.USER
133
+ ? (0, fs_1.existsSync)((0, paths_1.opencode_dir)(scope))
134
+ : (0, fs_1.existsSync)((0, path_1.resolve)(process.cwd(), 'opencode.json')) || (0, fs_1.existsSync)((0, path_1.resolve)(process.cwd(), '.opencode')),
135
+ configure: opencode_1.configure_opencode
136
+ }, {
137
+ harness: types_1.Harness.PI,
138
+ label: 'Pi',
139
+ detected: scope => scope === types_1.Scope.USER
140
+ ? (0, fs_1.existsSync)((0, path_1.resolve)((0, paths_1.pi_dir)(), '..'))
141
+ : (0, fs_1.existsSync)((0, path_1.resolve)(process.cwd(), '.pi')),
142
+ configure: pi_1.configure_pi
143
+ }, {
144
+ harness: types_1.Harness.TRAE,
145
+ label: 'Trae',
146
+ detected: scope => (0, fs_1.existsSync)((0, paths_1.trae_dir)(scope)),
147
+ configure: trae_1.configure_trae
148
+ }, {
149
+ harness: types_1.Harness.MISTRAL_VIBE,
150
+ label: 'Vibe',
151
+ detected: scope => (0, fs_1.existsSync)((0, paths_1.vibe_dir)(scope)),
152
+ configure: vibe_1.configure_vibe
153
+ }, {
154
+ harness: types_1.Harness.VSCODE,
155
+ label: 'VS Code',
156
+ detected: scope => scope === types_1.Scope.USER
157
+ ? (0, fs_1.existsSync)((0, paths_1.vscode_user_dir)())
158
+ : (0, fs_1.existsSync)((0, path_1.resolve)(process.cwd(), '.vscode')),
159
+ configure: vscode_1.configure_vscode
160
+ }];
161
+ //# sourceMappingURL=harnesses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harnesses.js","sourceRoot":"","sources":["../../src/helpers/harnesses.ts"],"names":[],"mappings":";AAAA,iEAAiE;AACjE,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,2DAA2D;AAC3D,EAAE;AACF,iFAAiF;AACjF,kDAAkD;AAClD,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,YAAY;;;AAEZ,2BAAgC;AAChC,+BAA+B;AAC/B,oCAA6D;AA0CpD,wFA1CA,eAAO,OA0CA;AAAE,sFA1CmB,aAAK,OA0CnB;AAzCvB,mCAoBiB;AACjB,yCAAgD;AAChD,yDAAgE;AAChE,yDAAgE;AAChE,6CAAoD;AACpD,iDAAwD;AACxD,+CAAsD;AACtD,6CAAoD;AACpD,2CAAkD;AAClD,+CAAsD;AACtD,6CAAoD;AACpD,2CAAkD;AAClD,2CAAkD;AAClD,2CAAkD;AAClD,mDAA0D;AAC1D,mDAA0D;AAC1D,uCAA8C;AAC9C,2CAAkD;AAClD,2CAAkD;AAClD,+CAAsD;AAItD;;;;GAIG;AACU,QAAA,SAAS,GAAwB,CAAC;QAC3C,OAAO,EAAE,eAAO,CAAC,GAAG;QACpB,KAAK,EAAE,KAAK;QACZ,QAAQ,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
4
+ * The GitHub raw URL serving the fallback copy of the given format; the base
5
+ * is env-overridable so tests can stay off the network
6
+ *
7
+ * @param format the instructions format
8
+ */
9
+ export declare const github_url: (format: Format) => string;
10
+ /**
11
+ * The machine-local cache file holding the last successfully fetched copy of
12
+ * the given format; the directory is env-overridable so tests can isolate it
13
+ *
14
+ * @param format the instructions format
15
+ */
16
+ export declare const cache_path: (format: Format) => string;
17
+ /**
18
+ * Reads the cached copy of the given format, returning undefined when there
19
+ * is none (or it cannot be read)
20
+ *
21
+ * @param format the instructions format
22
+ */
23
+ export declare const read_cache: (format: Format) => string | undefined;
24
+ /**
25
+ * Caches a successfully fetched copy of the given format, creating the cache
26
+ * directory as needed; failures are swallowed because the cache is an
27
+ * optimization, never a requirement
28
+ *
29
+ * @param format the instructions format
30
+ * @param text the instructions text
31
+ */
32
+ export declare const write_cache: (format: Format, text: string) => void;
33
+ /**
34
+ * Fetches the canonical instructions from an nram server's public
35
+ * `/instructions` endpoint, throwing on failure
36
+ *
37
+ * @param base_url the normalized nram base URL
38
+ * @param format the instructions format
39
+ * @param timeout_ms the request timeout in milliseconds
40
+ */
41
+ export declare const fetch_instructions: (base_url: string, format: Format, timeout_ms: number) => Promise<string>;
42
+ /**
43
+ * The last-resort text emitted when the canonical instructions could not be
44
+ * loaded from anywhere; it tells the agent to surface the failure to the user
45
+ * instead of silently proceeding without the memory protocol
46
+ *
47
+ * @param format the instructions format
48
+ */
49
+ export declare const builtin_notice: (format: Format) => string;
50
+ /**
51
+ * Resolves the instructions text through the fallback chain: the configured
52
+ * server (skipped when no base URL is known), then the machine-local cache,
53
+ * then the GitHub raw copy, then the built-in notice. Any successful network
54
+ * fetch refreshes the cache. Never throws
55
+ *
56
+ * @param base_url the normalized nram base URL, or undefined to skip the server
57
+ * @param format the instructions format
58
+ * @param timeout_ms the per-attempt network timeout in milliseconds
59
+ */
60
+ export declare const resolve_instructions: (base_url: string | undefined, format: Format, timeout_ms: number) => Promise<{
61
+ text: string;
62
+ source: InstructionsSource;
63
+ }>;