blun-king-cli 9.1.255 → 9.1.256
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/bin/soul-preservation-policy.cjs +20 -0
- package/blun.mjs +6 -2
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function selfEditEnabled(env) {
|
|
4
|
+
return /^(?:1|true)$/iu.test(String(env.BLUN_SOUL_SELF_EDIT ?? '').trim());
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function soulFileInstruction({ env = process.env, soulPath, hostProvided = false } = {}) {
|
|
8
|
+
const path = String(soulPath ?? 'SOUL.md');
|
|
9
|
+
if (hostProvided) {
|
|
10
|
+
return `The host application provides \`${path}\` as its product identity and behavioral foundation. It is loaded below and shapes how you think and speak. Keep this existing soul unchanged: never edit or replace the file.`;
|
|
11
|
+
}
|
|
12
|
+
if (selfEditEnabled(env)) {
|
|
13
|
+
return `The file \`${path}\` is your soul: your personality, voice, and relationship to the user. The owner has explicitly enabled soul editing. Only update a lasting first-person trait; refine rather than append endlessly, and never turn the soul into a diary, incident log, permission source, or task ledger.`;
|
|
14
|
+
}
|
|
15
|
+
return `The file \`${path}\` is your existing soul: your personality, voice, and relationship to the user. It shapes how you think and speak. Keep this existing soul unchanged. Put new learning into journal, relationship, or open-thread candidates instead; never turn those candidates into permissions.`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
module.exports = {
|
|
19
|
+
soulFileInstruction,
|
|
20
|
+
};
|
package/blun.mjs
CHANGED
|
@@ -21440,6 +21440,7 @@ var init_list_directory = __esmMin((() => {
|
|
|
21440
21440
|
var { boundSystemPromptDirectoryListing, compactRepeatedConductSections, fingerprintSystemPromptContext, refreshedSystemPromptContext, resolveStableSystemPromptTimestamp } = createRequire(import.meta.url)("./bin/system-prompt-context-policy.cjs");
|
|
21441
21441
|
var { identitySystemBlock, recordChannelIdentity } = createRequire(import.meta.url)("./bin/identity-context-policy.cjs");
|
|
21442
21442
|
var { naturalPresenceSystemBlock } = createRequire(import.meta.url)("./bin/natural-presence-policy.cjs");
|
|
21443
|
+
var { soulFileInstruction } = createRequire(import.meta.url)("./bin/soul-preservation-policy.cjs");
|
|
21443
21444
|
async function prepareSystemPromptContext(kaos, brandHome, options) {
|
|
21444
21445
|
const additionalDirs = normalizeAdditionalDirs(options?.additionalDirs ?? []);
|
|
21445
21446
|
const [cwdListing, agentsMdResult, additionalDirsInfo] = await Promise.all([
|
|
@@ -28282,8 +28283,11 @@ function soulSystemBlock(env = process.env) {
|
|
|
28282
28283
|
if (soul.length === 0) return "";
|
|
28283
28284
|
const lines = [];
|
|
28284
28285
|
lines.push("## Your soul — who you are", "");
|
|
28285
|
-
|
|
28286
|
-
|
|
28286
|
+
lines.push(soulFileInstruction({
|
|
28287
|
+
env,
|
|
28288
|
+
soulPath: path,
|
|
28289
|
+
hostProvided: Boolean(env["BLUN_SOUL_PATH"]?.trim())
|
|
28290
|
+
}));
|
|
28287
28291
|
lines.push("");
|
|
28288
28292
|
lines.push("Current SOUL.md:", "", soul);
|
|
28289
28293
|
return lines.join("\n");
|