immune-brain 3.6.1 → 3.6.2
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/package.json
CHANGED
|
@@ -42,7 +42,7 @@ function probeHost(env = process.env, platform = process.platform, hostVersion)
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// plugins/immune-brain/runtime/plugin_version.ts
|
|
45
|
-
var PLUGIN_VERSION = "3.6.
|
|
45
|
+
var PLUGIN_VERSION = "3.6.2";
|
|
46
46
|
|
|
47
47
|
// plugins/immune-brain/runtime/claude/interaction.ts
|
|
48
48
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -1001,13 +1001,20 @@ function roleSpec(role) {
|
|
|
1001
1001
|
throw new Error(`unknown internal role: ${String(role)}`);
|
|
1002
1002
|
return spec;
|
|
1003
1003
|
}
|
|
1004
|
+
function rolePromptSearchDirs(moduleDir) {
|
|
1005
|
+
return [
|
|
1006
|
+
join3(moduleDir, "..", "dist", "role-prompts"),
|
|
1007
|
+
join3(moduleDir, "..", "role-prompts")
|
|
1008
|
+
];
|
|
1009
|
+
}
|
|
1004
1010
|
function loadRolePrompt(role) {
|
|
1005
1011
|
const spec = roleSpec(role);
|
|
1006
|
-
const
|
|
1007
|
-
|
|
1008
|
-
|
|
1012
|
+
for (const dir of rolePromptSearchDirs(RUNTIME_DIR)) {
|
|
1013
|
+
const path = join3(dir, spec.file);
|
|
1014
|
+
if (existsSync(path))
|
|
1015
|
+
return readFileSync(path, "utf8");
|
|
1009
1016
|
}
|
|
1010
|
-
|
|
1017
|
+
throw new Error(`internal role prompt is not packaged: ${role}`);
|
|
1011
1018
|
}
|
|
1012
1019
|
function buildRoleDelegationPacket(input) {
|
|
1013
1020
|
const spec = roleSpec(input.role);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by scripts/plugin_versioning.ts from the root package.json.
|
|
2
|
-
export const PLUGIN_VERSION = "3.6.
|
|
2
|
+
export const PLUGIN_VERSION = "3.6.2" as const;
|
|
@@ -108,17 +108,33 @@ function roleSpec(role: InternalRole): RolePromptSpec {
|
|
|
108
108
|
return spec;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Directories that can hold the packaged role prompts, most specific first.
|
|
113
|
+
*
|
|
114
|
+
* From source this module sits in `runtime/`, a sibling of `dist/`. The Claude
|
|
115
|
+
* Code Host instead ships a bundle at `dist/claude/mcp-server.mjs`, where the
|
|
116
|
+
* same relative walk lands on a `dist/dist/` that never exists while the prompts
|
|
117
|
+
* sit one level up. Every test runs from source, so the shipped Host could not
|
|
118
|
+
* load a single internal role prompt and no test noticed.
|
|
119
|
+
*/
|
|
120
|
+
export function rolePromptSearchDirs(moduleDir: string): string[] {
|
|
121
|
+
return [
|
|
122
|
+
join(moduleDir, "..", "dist", "role-prompts"),
|
|
123
|
+
join(moduleDir, "..", "role-prompts"),
|
|
124
|
+
];
|
|
125
|
+
}
|
|
126
|
+
|
|
111
127
|
/**
|
|
112
128
|
* Read the packaged prompt so the runtime follows the bytes shipped to a
|
|
113
129
|
* consumer. The canonical source is synced into this dist-local directory.
|
|
114
130
|
*/
|
|
115
131
|
export function loadRolePrompt(role: InternalRole): string {
|
|
116
132
|
const spec = roleSpec(role);
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
133
|
+
for (const dir of rolePromptSearchDirs(RUNTIME_DIR)) {
|
|
134
|
+
const path = join(dir, spec.file);
|
|
135
|
+
if (existsSync(path)) return readFileSync(path, "utf8");
|
|
120
136
|
}
|
|
121
|
-
|
|
137
|
+
throw new Error(`internal role prompt is not packaged: ${role}`);
|
|
122
138
|
}
|
|
123
139
|
|
|
124
140
|
export function buildRoleDelegationPacket(input: {
|