@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.
- package/LICENSE +19 -0
- package/README.md +109 -0
- package/dist/helpers/configure/amp.d.ts +9 -0
- package/dist/helpers/configure/amp.js +49 -0
- package/dist/helpers/configure/amp.js.map +1 -0
- package/dist/helpers/configure/antigravity.d.ts +12 -0
- package/dist/helpers/configure/antigravity.js +74 -0
- package/dist/helpers/configure/antigravity.js.map +1 -0
- package/dist/helpers/configure/claude_code.d.ts +9 -0
- package/dist/helpers/configure/claude_code.js +119 -0
- package/dist/helpers/configure/claude_code.js.map +1 -0
- package/dist/helpers/configure/codex.d.ts +19 -0
- package/dist/helpers/configure/codex.js +76 -0
- package/dist/helpers/configure/codex.js.map +1 -0
- package/dist/helpers/configure/copilot.d.ts +11 -0
- package/dist/helpers/configure/copilot.js +64 -0
- package/dist/helpers/configure/copilot.js.map +1 -0
- package/dist/helpers/configure/cursor.d.ts +26 -0
- package/dist/helpers/configure/cursor.js +90 -0
- package/dist/helpers/configure/cursor.js.map +1 -0
- package/dist/helpers/configure/droid.d.ts +18 -0
- package/dist/helpers/configure/droid.js +70 -0
- package/dist/helpers/configure/droid.js.map +1 -0
- package/dist/helpers/configure/grok.d.ts +25 -0
- package/dist/helpers/configure/grok.js +93 -0
- package/dist/helpers/configure/grok.js.map +1 -0
- package/dist/helpers/configure/hermes.d.ts +22 -0
- package/dist/helpers/configure/hermes.js +107 -0
- package/dist/helpers/configure/hermes.js.map +1 -0
- package/dist/helpers/configure/junie.d.ts +10 -0
- package/dist/helpers/configure/junie.js +52 -0
- package/dist/helpers/configure/junie.js.map +1 -0
- package/dist/helpers/configure/kilo.d.ts +19 -0
- package/dist/helpers/configure/kilo.js +110 -0
- package/dist/helpers/configure/kilo.js.map +1 -0
- package/dist/helpers/configure/kimi.d.ts +10 -0
- package/dist/helpers/configure/kimi.js +75 -0
- package/dist/helpers/configure/kimi.js.map +1 -0
- package/dist/helpers/configure/kiro.d.ts +25 -0
- package/dist/helpers/configure/kiro.js +77 -0
- package/dist/helpers/configure/kiro.js.map +1 -0
- package/dist/helpers/configure/openclaw.d.ts +10 -0
- package/dist/helpers/configure/openclaw.js +72 -0
- package/dist/helpers/configure/openclaw.js.map +1 -0
- package/dist/helpers/configure/opencode.d.ts +18 -0
- package/dist/helpers/configure/opencode.js +72 -0
- package/dist/helpers/configure/opencode.js.map +1 -0
- package/dist/helpers/configure/pi.d.ts +10 -0
- package/dist/helpers/configure/pi.js +60 -0
- package/dist/helpers/configure/pi.js.map +1 -0
- package/dist/helpers/configure/trae.d.ts +11 -0
- package/dist/helpers/configure/trae.js +63 -0
- package/dist/helpers/configure/trae.js.map +1 -0
- package/dist/helpers/configure/vibe.d.ts +24 -0
- package/dist/helpers/configure/vibe.js +106 -0
- package/dist/helpers/configure/vibe.js.map +1 -0
- package/dist/helpers/configure/vscode.d.ts +18 -0
- package/dist/helpers/configure/vscode.js +81 -0
- package/dist/helpers/configure/vscode.js.map +1 -0
- package/dist/helpers/harnesses.d.ts +8 -0
- package/dist/helpers/harnesses.js +161 -0
- package/dist/helpers/harnesses.js.map +1 -0
- package/dist/helpers/instructions.d.ts +63 -0
- package/dist/helpers/instructions.js +175 -0
- package/dist/helpers/instructions.js.map +1 -0
- package/dist/helpers/paths.d.ts +130 -0
- package/dist/helpers/paths.js +211 -0
- package/dist/helpers/paths.js.map +1 -0
- package/dist/helpers/upsert.d.ts +197 -0
- package/dist/helpers/upsert.js +428 -0
- package/dist/helpers/upsert.js.map +1 -0
- package/dist/helpers/url.d.ts +15 -0
- package/dist/helpers/url.js +51 -0
- package/dist/helpers/url.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -0
- package/dist/setup.d.ts +17 -0
- package/dist/setup.js +296 -0
- package/dist/setup.js.map +1 -0
- package/dist/types.d.ts +67 -0
- package/dist/types.js +50 -0
- package/dist/types.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,90 @@
|
|
|
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_cursor = exports.cursor_rule_file = exports.cursor_mcp_entry = 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 `mcpServers.nram` entry for Cursor's mcp.json. In API-key mode
|
|
29
|
+
* the key is referenced through Cursor's `${env:...}` interpolation, never
|
|
30
|
+
* written to disk
|
|
31
|
+
*
|
|
32
|
+
* @param mcp_url the MCP endpoint URL
|
|
33
|
+
* @param api_key the API key, when API-key authentication was chosen
|
|
34
|
+
*/
|
|
35
|
+
const cursor_mcp_entry = (mcp_url, api_key) => {
|
|
36
|
+
const entry = { url: mcp_url };
|
|
37
|
+
if (api_key !== undefined) {
|
|
38
|
+
entry.headers = { Authorization: 'Bearer ${env:NRAM_API_KEY}' };
|
|
39
|
+
}
|
|
40
|
+
return entry;
|
|
41
|
+
};
|
|
42
|
+
exports.cursor_mcp_entry = cursor_mcp_entry;
|
|
43
|
+
/**
|
|
44
|
+
* Builds the project rule file (`.cursor/rules/nram.mdc`) carrying the agent
|
|
45
|
+
* instructions; `alwaysApply: true` injects it into every Agent conversation
|
|
46
|
+
*
|
|
47
|
+
* @param instructions the agent instructions text
|
|
48
|
+
*/
|
|
49
|
+
const cursor_rule_file = (instructions) => '---\n' +
|
|
50
|
+
'description: nram (Neural Ram) persistent memory protocol\n' +
|
|
51
|
+
'alwaysApply: true\n' +
|
|
52
|
+
'---\n\n' +
|
|
53
|
+
`${instructions.trimEnd()}\n`;
|
|
54
|
+
exports.cursor_rule_file = cursor_rule_file;
|
|
55
|
+
/**
|
|
56
|
+
* Configures Cursor: merges the nram MCP server into mcp.json and, at project
|
|
57
|
+
* scope, writes the agent instructions as `.cursor/rules/nram.mdc`
|
|
58
|
+
* (`.cursorrules` is deprecated; user-level rules live only in the Cursor
|
|
59
|
+
* settings GUI, so the instruction half is reported and skipped at user scope)
|
|
60
|
+
*
|
|
61
|
+
* @param options the collected setup options
|
|
62
|
+
*/
|
|
63
|
+
const configure_cursor = async (options) => {
|
|
64
|
+
const results = [];
|
|
65
|
+
if (options.mcp_url !== undefined) {
|
|
66
|
+
const config_path = (0, path_1.resolve)((0, paths_1.cursor_dir)(options.scope), 'mcp.json');
|
|
67
|
+
const mcp = (0, upsert_1.mcp_json_result)(config_path, ['mcpServers', 'nram'], (0, exports.cursor_mcp_entry)(options.mcp_url, options.api_key));
|
|
68
|
+
results.push(mcp);
|
|
69
|
+
if (mcp.kind !== 'manual' && options.api_key !== undefined) {
|
|
70
|
+
results.push((0, upsert_1.api_key_manual_result)());
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (!options.instructions) {
|
|
74
|
+
return results;
|
|
75
|
+
}
|
|
76
|
+
if (options.scope !== types_1.Scope.PROJECT) {
|
|
77
|
+
results.push({
|
|
78
|
+
action: 'Agent instructions',
|
|
79
|
+
kind: 'skipped',
|
|
80
|
+
detail: 'Cursor has no file-based user-level rules (only Cursor Settings, Rules); ' +
|
|
81
|
+
'rerun at project scope to write .cursor/rules/nram.mdc instead'
|
|
82
|
+
});
|
|
83
|
+
return results;
|
|
84
|
+
}
|
|
85
|
+
const rule_path = (0, path_1.resolve)((0, paths_1.cursor_dir)(options.scope), 'rules', 'nram.mdc');
|
|
86
|
+
results.push((0, upsert_1.upsert_own_file)(rule_path, (0, exports.cursor_rule_file)(options.instructions.condensed), 'Agent instructions'));
|
|
87
|
+
return results;
|
|
88
|
+
};
|
|
89
|
+
exports.configure_cursor = configure_cursor;
|
|
90
|
+
//# sourceMappingURL=cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/helpers/configure/cursor.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,oCAAsC;AACtC,sCAAoF;AAEp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CAAC,YAAY,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,IAAI,OAAO,CAAC,KAAK,KAAK,aAAK,CAAC,OAAO,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC;YACT,MAAM,EAAE,oBAAoB;YAC5B,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,2EAA2E;gBAC/E,gEAAgE;SACvE,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,MAAM,SAAS,GAAG,IAAA,cAAO,EAAC,IAAA,kBAAU,EAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAE1E,OAAO,CAAC,IAAI,CAAC,IAAA,wBAAe,EAAC,SAAS,EAAE,IAAA,wBAAgB,EAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAEjH,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AApCW,QAAA,gBAAgB,oBAoC3B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActionResult, SetupOptions } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the array element for Factory's mcp.json. Droid expands `${VAR}`
|
|
4
|
+
* references at load time, so the key never reaches disk
|
|
5
|
+
*
|
|
6
|
+
* @param mcp_url the MCP endpoint URL
|
|
7
|
+
* @param api_key the API key, when API-key authentication was chosen
|
|
8
|
+
*/
|
|
9
|
+
export declare const droid_mcp_entry: (mcp_url: string, api_key?: string) => any;
|
|
10
|
+
/**
|
|
11
|
+
* Configures Droid (Factory): merges the nram MCP server into mcp.json
|
|
12
|
+
* (array-shaped `servers` list) and upserts the agent instructions into the
|
|
13
|
+
* AGENTS.md droid reads: `~/.factory/AGENTS.md` (documented personal
|
|
14
|
+
* override) at user scope, the repository root AGENTS.md at project scope
|
|
15
|
+
*
|
|
16
|
+
* @param options the collected setup options
|
|
17
|
+
*/
|
|
18
|
+
export declare const configure_droid: (options: SetupOptions) => Promise<ActionResult[]>;
|
|
@@ -0,0 +1,70 @@
|
|
|
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_droid = exports.droid_mcp_entry = void 0;
|
|
23
|
+
const path_1 = require("path");
|
|
24
|
+
const paths_1 = require("../paths");
|
|
25
|
+
const upsert_1 = require("../upsert");
|
|
26
|
+
/**
|
|
27
|
+
* Builds the array element for Factory's mcp.json. Droid expands `${VAR}`
|
|
28
|
+
* references at load time, so the key never reaches disk
|
|
29
|
+
*
|
|
30
|
+
* @param mcp_url the MCP endpoint URL
|
|
31
|
+
* @param api_key the API key, when API-key authentication was chosen
|
|
32
|
+
*/
|
|
33
|
+
const droid_mcp_entry = (mcp_url, api_key) => {
|
|
34
|
+
const entry = {
|
|
35
|
+
name: 'nram',
|
|
36
|
+
type: 'http',
|
|
37
|
+
url: mcp_url
|
|
38
|
+
};
|
|
39
|
+
if (api_key !== undefined) {
|
|
40
|
+
entry.headers = { Authorization: 'Bearer ${NRAM_API_KEY}' };
|
|
41
|
+
}
|
|
42
|
+
return entry;
|
|
43
|
+
};
|
|
44
|
+
exports.droid_mcp_entry = droid_mcp_entry;
|
|
45
|
+
/**
|
|
46
|
+
* Configures Droid (Factory): merges the nram MCP server into mcp.json
|
|
47
|
+
* (array-shaped `servers` list) and upserts the agent instructions into the
|
|
48
|
+
* AGENTS.md droid reads: `~/.factory/AGENTS.md` (documented personal
|
|
49
|
+
* override) at user scope, the repository root AGENTS.md at project scope
|
|
50
|
+
*
|
|
51
|
+
* @param options the collected setup options
|
|
52
|
+
*/
|
|
53
|
+
const configure_droid = async (options) => {
|
|
54
|
+
const results = [];
|
|
55
|
+
if (options.mcp_url !== undefined) {
|
|
56
|
+
const config_path = (0, path_1.resolve)((0, paths_1.factory_dir)(options.scope), 'mcp.json');
|
|
57
|
+
const entry = (0, exports.droid_mcp_entry)(options.mcp_url, options.api_key);
|
|
58
|
+
const mcp = (0, upsert_1.mcp_json_result)(config_path, ['servers'], entry, { array: true });
|
|
59
|
+
results.push(mcp);
|
|
60
|
+
if (mcp.kind !== 'manual' && options.api_key !== undefined) {
|
|
61
|
+
results.push((0, upsert_1.api_key_manual_result)());
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (options.instructions) {
|
|
65
|
+
results.push((0, upsert_1.agents_md_result)((0, paths_1.agents_md_path)(options.scope, (0, path_1.resolve)((0, paths_1.factory_dir)(options.scope), 'AGENTS.md')), options.instructions.full));
|
|
66
|
+
}
|
|
67
|
+
return results;
|
|
68
|
+
};
|
|
69
|
+
exports.configure_droid = configure_droid;
|
|
70
|
+
//# sourceMappingURL=droid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"droid.js","sourceRoot":"","sources":["../../../src/helpers/configure/droid.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;AAE/B,oCAAuD;AACvD,sCAAqF;AAErF;;;;;;GAMG;AACI,MAAM,eAAe,GAAG,CAAC,OAAe,EAAE,OAAgB,EAAO,EAAE;IACtE,MAAM,KAAK,GAAQ;QACf,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,OAAO;KACf,CAAC;IAEF,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACxB,KAAK,CAAC,OAAO,GAAG,EAAE,aAAa,EAAE,wBAAwB,EAAE,CAAC;IAChE,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAZW,QAAA,eAAe,mBAY1B;AAEF;;;;;;;GAOG;AACI,MAAM,eAAe,GAAG,KAAK,EAAE,OAAqB,EAA2B,EAAE;IACpF,MAAM,OAAO,GAAmB,EAAE,CAAC;IAEnC,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,WAAW,GAAG,IAAA,cAAO,EAAC,IAAA,mBAAW,EAAC,OAAO,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;QAEpE,MAAM,KAAK,GAAG,IAAA,uBAAe,EAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAEhE,MAAM,GAAG,GAAG,IAAA,wBAAe,EAAC,WAAW,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAE9E,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAElB,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACzD,OAAO,CAAC,IAAI,CAAC,IAAA,8BAAqB,GAAE,CAAC,CAAC;QAC1C,CAAC;IACL,CAAC;IAED,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;QACvB,OAAO,CAAC,IAAI,CAAC,IAAA,yBAAgB,EACzB,IAAA,sBAAc,EAAC,OAAO,CAAC,KAAK,EAAE,IAAA,cAAO,EAAC,IAAA,mBAAW,EAAC,OAAO,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,EAC/E,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAxBW,QAAA,eAAe,mBAwB1B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ActionResult, SetupOptions } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the marker-fenced `[mcp_servers.nram]` TOML block. Grok Build
|
|
4
|
+
* expands `${VAR}` in string fields at load time, so in API-key mode the
|
|
5
|
+
* Authorization header references the NRAM_API_KEY environment variable and
|
|
6
|
+
* the key itself is never written to disk
|
|
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 grok_mcp_block: (mcp_url: string, api_key?: string) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Configures Grok Build (xAI): upserts a marker-fenced `[mcp_servers.nram]`
|
|
14
|
+
* block in config.toml (project-scoped config files support `[mcp_servers]`
|
|
15
|
+
* only, which is exactly what is written) and injects the agent-instructions
|
|
16
|
+
* SessionStart hook as its own merged hooks file (Grok Build merges every
|
|
17
|
+
* `hooks/*.json`, in the same nested shape Claude Code uses).
|
|
18
|
+
*
|
|
19
|
+
* Native config.toml servers take documented precedence over Grok Build's
|
|
20
|
+
* Claude Code compatibility sources on a name conflict, so registering nram
|
|
21
|
+
* here stays correct on machines where Claude Code is configured too
|
|
22
|
+
*
|
|
23
|
+
* @param options the collected setup options
|
|
24
|
+
*/
|
|
25
|
+
export declare const configure_grok: (options: SetupOptions) => Promise<ActionResult[]>;
|
|
@@ -0,0 +1,93 @@
|
|
|
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_grok = exports.grok_mcp_block = void 0;
|
|
23
|
+
const path_1 = require("path");
|
|
24
|
+
const smol_toml_1 = require("smol-toml");
|
|
25
|
+
const types_1 = require("../../types");
|
|
26
|
+
const paths_1 = require("../paths");
|
|
27
|
+
const upsert_1 = require("../upsert");
|
|
28
|
+
/**
|
|
29
|
+
* Builds the marker-fenced `[mcp_servers.nram]` TOML block. Grok Build
|
|
30
|
+
* expands `${VAR}` in string fields at load time, so in API-key mode the
|
|
31
|
+
* Authorization header references the NRAM_API_KEY environment variable and
|
|
32
|
+
* the key itself is never written to disk
|
|
33
|
+
*
|
|
34
|
+
* @param mcp_url the MCP endpoint URL
|
|
35
|
+
* @param api_key the API key, when API-key authentication was chosen
|
|
36
|
+
*/
|
|
37
|
+
const grok_mcp_block = (mcp_url, api_key) => {
|
|
38
|
+
const lines = [
|
|
39
|
+
'[mcp_servers.nram]',
|
|
40
|
+
`url = "${mcp_url}"`
|
|
41
|
+
];
|
|
42
|
+
if (api_key !== undefined) {
|
|
43
|
+
lines.push('headers = { "Authorization" = "Bearer ${NRAM_API_KEY}" }');
|
|
44
|
+
}
|
|
45
|
+
return lines.join('\n');
|
|
46
|
+
};
|
|
47
|
+
exports.grok_mcp_block = grok_mcp_block;
|
|
48
|
+
/**
|
|
49
|
+
* Configures Grok Build (xAI): upserts a marker-fenced `[mcp_servers.nram]`
|
|
50
|
+
* block in config.toml (project-scoped config files support `[mcp_servers]`
|
|
51
|
+
* only, which is exactly what is written) and injects the agent-instructions
|
|
52
|
+
* SessionStart hook as its own merged hooks file (Grok Build merges every
|
|
53
|
+
* `hooks/*.json`, in the same nested shape Claude Code uses).
|
|
54
|
+
*
|
|
55
|
+
* Native config.toml servers take documented precedence over Grok Build's
|
|
56
|
+
* Claude Code compatibility sources on a name conflict, so registering nram
|
|
57
|
+
* here stays correct on machines where Claude Code is configured too
|
|
58
|
+
*
|
|
59
|
+
* @param options the collected setup options
|
|
60
|
+
*/
|
|
61
|
+
const configure_grok = async (options) => {
|
|
62
|
+
const results = [];
|
|
63
|
+
if (options.mcp_url !== undefined) {
|
|
64
|
+
const config_path = (0, path_1.resolve)((0, paths_1.grok_dir)(options.scope), 'config.toml');
|
|
65
|
+
const mcp = (0, upsert_1.upsert_block_with_validation)(config_path, (0, exports.grok_mcp_block)(options.mcp_url, options.api_key), smol_toml_1.parse, 'TOML', (parsed, text) => parsed?.mcp_servers?.nram !== undefined && !(0, upsert_1.has_marker_block)(text, 'hash')
|
|
66
|
+
? {
|
|
67
|
+
action: 'MCP registration',
|
|
68
|
+
kind: 'skipped',
|
|
69
|
+
detail: `[mcp_servers.nram] already exists in ${config_path} (outside the nram setup markers)`
|
|
70
|
+
}
|
|
71
|
+
: undefined, parsed => parsed?.mcp_servers?.nram !== undefined);
|
|
72
|
+
results.push(mcp);
|
|
73
|
+
if ((mcp.kind === 'written' || mcp.kind === 'updated') && options.api_key !== undefined) {
|
|
74
|
+
results.push((0, upsert_1.api_key_manual_result)());
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (options.instructions) {
|
|
78
|
+
const hook = (0, upsert_1.upsert_hooks_json)((0, path_1.resolve)((0, paths_1.grok_dir)(options.scope), 'hooks', 'nram.json'), options.base_url);
|
|
79
|
+
results.push(hook);
|
|
80
|
+
// user-scope hooks are always trusted; project hooks are not run
|
|
81
|
+
// until the user trusts them inside Grok Build
|
|
82
|
+
if (options.scope === types_1.Scope.PROJECT && (hook.kind === 'written' || hook.kind === 'updated')) {
|
|
83
|
+
results.push({
|
|
84
|
+
action: 'Hook trust',
|
|
85
|
+
kind: 'manual',
|
|
86
|
+
detail: 'project-scope hooks only run after you approve them: run /hooks-trust inside Grok Build'
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return results;
|
|
91
|
+
};
|
|
92
|
+
exports.configure_grok = configure_grok;
|
|
93
|
+
//# sourceMappingURL=grok.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grok.js","sourceRoot":"","sources":["../../../src/helpers/configure/grok.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,yCAAkC;AAClC,uCAAgE;AAChE,oCAAoC;AACpC,sCAKmB;AAEnB;;;;;;;;GAQG;AACI,MAAM,cAAc,GAAG,CAAC,OAAe,EAAE,OAAgB,EAAU,EAAE;IACxE,MAAM,KAAK,GAAG;QACV,oBAAoB;QACpB,UAAU,OAAO,GAAG;KACvB,CAAC;IAEF,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAC;AAXW,QAAA,cAAc,kBAWzB;AAEF;;;;;;;;;;;;GAYG;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,MAAM,WAAW,GAAG,IAAA,cAAO,EAAC,IAAA,gBAAQ,EAAC,OAAO,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC;QAEpE,MAAM,GAAG,G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AC,IAAI,CAAC;gBACT,MAAM,EAAE,YAAY;gBACpB,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,yFAAyF;aACpG,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AA7CW,QAAA,cAAc,kBA6CzB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ActionResult, SetupOptions } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the marker-fenced `mcp_servers` YAML block. Hermes resolves
|
|
4
|
+
* `${VAR}` placeholders from `~/.hermes/.env` at connection time, so the key
|
|
5
|
+
* never reaches disk
|
|
6
|
+
*
|
|
7
|
+
* @param mcp_url the MCP endpoint URL
|
|
8
|
+
* @param api_key the API key, when API-key authentication was chosen
|
|
9
|
+
*/
|
|
10
|
+
export declare const hermes_mcp_block: (mcp_url: string, api_key?: string) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Configures Hermes (Nous Research): upserts a marker-fenced `mcp_servers`
|
|
13
|
+
* block in `~/.hermes/config.yaml` (user scope only; Hermes has no project
|
|
14
|
+
* configuration; YAML cannot carry a duplicate top-level key, so an existing
|
|
15
|
+
* `mcp_servers` outside our markers means a manual step) and the agent
|
|
16
|
+
* instructions into the repository root AGENTS.md at project scope.
|
|
17
|
+
* Hermes's user-level SOUL.md is identity, not protocol, so user-scope
|
|
18
|
+
* instructions are reported and skipped
|
|
19
|
+
*
|
|
20
|
+
* @param options the collected setup options
|
|
21
|
+
*/
|
|
22
|
+
export declare const configure_hermes: (options: SetupOptions) => Promise<ActionResult[]>;
|
|
@@ -0,0 +1,107 @@
|
|
|
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_hermes = exports.hermes_mcp_block = void 0;
|
|
23
|
+
const path_1 = require("path");
|
|
24
|
+
const yaml_1 = require("yaml");
|
|
25
|
+
const types_1 = require("../../types");
|
|
26
|
+
const paths_1 = require("../paths");
|
|
27
|
+
const upsert_1 = require("../upsert");
|
|
28
|
+
/**
|
|
29
|
+
* Builds the marker-fenced `mcp_servers` YAML block. Hermes resolves
|
|
30
|
+
* `${VAR}` placeholders from `~/.hermes/.env` at connection time, so the key
|
|
31
|
+
* never reaches disk
|
|
32
|
+
*
|
|
33
|
+
* @param mcp_url the MCP endpoint URL
|
|
34
|
+
* @param api_key the API key, when API-key authentication was chosen
|
|
35
|
+
*/
|
|
36
|
+
const hermes_mcp_block = (mcp_url, api_key) => {
|
|
37
|
+
const lines = [
|
|
38
|
+
'mcp_servers:',
|
|
39
|
+
' nram:',
|
|
40
|
+
` url: "${mcp_url}"`
|
|
41
|
+
];
|
|
42
|
+
if (api_key !== undefined) {
|
|
43
|
+
lines.push(' headers:');
|
|
44
|
+
lines.push(' Authorization: "Bearer ${NRAM_API_KEY}"');
|
|
45
|
+
}
|
|
46
|
+
return lines.join('\n');
|
|
47
|
+
};
|
|
48
|
+
exports.hermes_mcp_block = hermes_mcp_block;
|
|
49
|
+
/**
|
|
50
|
+
* Configures Hermes (Nous Research): upserts a marker-fenced `mcp_servers`
|
|
51
|
+
* block in `~/.hermes/config.yaml` (user scope only; Hermes has no project
|
|
52
|
+
* configuration; YAML cannot carry a duplicate top-level key, so an existing
|
|
53
|
+
* `mcp_servers` outside our markers means a manual step) and the agent
|
|
54
|
+
* instructions into the repository root AGENTS.md at project scope.
|
|
55
|
+
* Hermes's user-level SOUL.md is identity, not protocol, so user-scope
|
|
56
|
+
* instructions are reported and skipped
|
|
57
|
+
*
|
|
58
|
+
* @param options the collected setup options
|
|
59
|
+
*/
|
|
60
|
+
const configure_hermes = async (options) => {
|
|
61
|
+
const results = [];
|
|
62
|
+
if (options.mcp_url !== undefined) {
|
|
63
|
+
if (options.scope !== types_1.Scope.USER) {
|
|
64
|
+
results.push({
|
|
65
|
+
action: 'MCP registration',
|
|
66
|
+
kind: 'skipped',
|
|
67
|
+
detail: 'Hermes keeps MCP servers in the user-level ~/.hermes/config.yaml only; rerun at user scope'
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const config_path = (0, path_1.resolve)((0, paths_1.hermes_dir)(), 'config.yaml');
|
|
72
|
+
const mcp = (0, upsert_1.upsert_block_with_validation)(config_path, (0, exports.hermes_mcp_block)(options.mcp_url, options.api_key), yaml_1.parse, 'YAML', (parsed, text) => parsed?.mcp_servers !== undefined && !(0, upsert_1.has_marker_block)(text, 'hash')
|
|
73
|
+
? {
|
|
74
|
+
action: 'MCP registration',
|
|
75
|
+
kind: 'manual',
|
|
76
|
+
detail: `${config_path} already has an mcp_servers key (YAML cannot carry the key ` +
|
|
77
|
+
'twice); add this under it yourself:\n nram:\n url: "<your nram MCP URL>"'
|
|
78
|
+
}
|
|
79
|
+
: undefined, parsed => parsed?.mcp_servers?.nram !== undefined);
|
|
80
|
+
results.push(mcp);
|
|
81
|
+
if ((mcp.kind === 'written' || mcp.kind === 'updated') && options.api_key !== undefined) {
|
|
82
|
+
results.push({
|
|
83
|
+
action: 'API key',
|
|
84
|
+
kind: 'manual',
|
|
85
|
+
detail: 'add NRAM_API_KEY=<your nram API key> to ~/.hermes/.env (Hermes resolves ${VAR} ' +
|
|
86
|
+
'placeholders from that file); the key is never written to config.yaml'
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (options.instructions) {
|
|
92
|
+
if (options.scope !== types_1.Scope.PROJECT) {
|
|
93
|
+
results.push({
|
|
94
|
+
action: 'Agent instructions',
|
|
95
|
+
kind: 'skipped',
|
|
96
|
+
detail: 'Hermes has no documented global AGENTS.md (SOUL.md is identity, not protocol); ' +
|
|
97
|
+
'rerun at project scope to write the repository AGENTS.md'
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
results.push((0, upsert_1.agents_md_result)((0, path_1.resolve)(process.cwd(), 'AGENTS.md'), options.instructions.full));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return results;
|
|
105
|
+
};
|
|
106
|
+
exports.configure_hermes = configure_hermes;
|
|
107
|
+
//# sourceMappingURL=hermes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermes.js","sourceRoot":"","sources":["../../../src/helpers/configure/hermes.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,iFAA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O,OAAO,CAAC;AACnB,CAAC,CAAC;AAxDW,QAAA,gBAAgB,oBAwD3B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionResult, SetupOptions } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Configures Junie (JetBrains): merges the nram MCP server into mcp/mcp.json
|
|
4
|
+
* at the requested scope and upserts the agent instructions into the
|
|
5
|
+
* AGENTS.md Junie reads: `~/.junie/AGENTS.md` at user scope, the repository
|
|
6
|
+
* root AGENTS.md at project scope
|
|
7
|
+
*
|
|
8
|
+
* @param options the collected setup options
|
|
9
|
+
*/
|
|
10
|
+
export declare const configure_junie: (options: SetupOptions) => Promise<ActionResult[]>;
|
|
@@ -0,0 +1,52 @@
|
|
|
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_junie = void 0;
|
|
23
|
+
const path_1 = require("path");
|
|
24
|
+
const paths_1 = require("../paths");
|
|
25
|
+
const upsert_1 = require("../upsert");
|
|
26
|
+
/**
|
|
27
|
+
* Configures Junie (JetBrains): merges the nram MCP server into mcp/mcp.json
|
|
28
|
+
* at the requested scope and upserts the agent instructions into the
|
|
29
|
+
* AGENTS.md Junie reads: `~/.junie/AGENTS.md` at user scope, the repository
|
|
30
|
+
* root AGENTS.md at project scope
|
|
31
|
+
*
|
|
32
|
+
* @param options the collected setup options
|
|
33
|
+
*/
|
|
34
|
+
const configure_junie = async (options) => {
|
|
35
|
+
const results = [];
|
|
36
|
+
if (options.mcp_url !== undefined) {
|
|
37
|
+
const config_path = (0, path_1.resolve)((0, paths_1.junie_dir)(options.scope), 'mcp', 'mcp.json');
|
|
38
|
+
const mcp = (0, upsert_1.mcp_json_result)(config_path, ['mcpServers', 'nram'], { url: options.mcp_url }, {
|
|
39
|
+
note: 'CLI format; JetBrains tracks an IDE/CLI mcp.json incompatibility, JUNIE-1331'
|
|
40
|
+
});
|
|
41
|
+
results.push(mcp);
|
|
42
|
+
if (mcp.kind !== 'manual' && options.api_key !== undefined) {
|
|
43
|
+
results.push((0, upsert_1.api_key_header_manual_result)(config_path));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (options.instructions) {
|
|
47
|
+
results.push((0, upsert_1.agents_md_result)((0, paths_1.agents_md_path)(options.scope, (0, path_1.resolve)((0, paths_1.junie_dir)(options.scope), 'AGENTS.md')), options.instructions.full));
|
|
48
|
+
}
|
|
49
|
+
return results;
|
|
50
|
+
};
|
|
51
|
+
exports.configure_junie = configure_junie;
|
|
52
|
+
//# sourceMapping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B,EACzB,IAAA,sBAAc,EAAC,OAAO,CAAC,KAAK,EAAE,IAAA,cAAO,EAAC,IAAA,iBAAS,EAAC,OAAO,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC,EAC7E,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAxBW,QAAA,eAAe,mBAwB1B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ActionResult, SetupOptions } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the `mcp.nram` entry for kilo.jsonc. Kilo substitutes
|
|
4
|
+
* `{env:VAR}` references, so the key never reaches disk
|
|
5
|
+
*
|
|
6
|
+
* @param mcp_url the MCP endpoint URL
|
|
7
|
+
* @param api_key the API key, when API-key authentication was chosen
|
|
8
|
+
*/
|
|
9
|
+
export declare const kilo_mcp_entry: (mcp_url: string, api_key?: string) => any;
|
|
10
|
+
/**
|
|
11
|
+
* Configures Kilo Code: merges the nram MCP server into kilo.jsonc at the
|
|
12
|
+
* requested scope. Instructions: project scope uses the repository root
|
|
13
|
+
* AGENTS.md (Kilo reads it natively); user scope writes a rule file under
|
|
14
|
+
* the global config dir and references it from the `instructions` array in
|
|
15
|
+
* kilo.jsonc, which is how Kilo documents global rules
|
|
16
|
+
*
|
|
17
|
+
* @param options the collected setup options
|
|
18
|
+
*/
|
|
19
|
+
export declare const configure_kilo: (options: SetupOptions) => Promise<ActionResult[]>;
|