blun-king-cli 9.1.224 → 9.1.225
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/system-prompt-context-policy.cjs +11 -0
- package/blun.mjs +5 -1
- package/package.json +1 -1
|
@@ -103,6 +103,16 @@ function refreshedSystemPromptContext(previousFingerprint, context) {
|
|
|
103
103
|
return { fingerprint, reminder };
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
function resolveStableSystemPromptTimestamp(value, fallback = new Date()) {
|
|
107
|
+
const candidate = value instanceof Date ? value : new Date(value);
|
|
108
|
+
if (Number.isFinite(candidate.getTime())) return new Date(candidate.getTime());
|
|
109
|
+
|
|
110
|
+
const fallbackDate = fallback instanceof Date ? fallback : new Date(fallback);
|
|
111
|
+
return Number.isFinite(fallbackDate.getTime())
|
|
112
|
+
? new Date(fallbackDate.getTime())
|
|
113
|
+
: new Date();
|
|
114
|
+
}
|
|
115
|
+
|
|
106
116
|
module.exports = {
|
|
107
117
|
SYSTEM_PROMPT_DIRECTORY_MAX_CHARS,
|
|
108
118
|
SYSTEM_PROMPT_DIRECTORY_TRUNCATED_MARKER,
|
|
@@ -110,4 +120,5 @@ module.exports = {
|
|
|
110
120
|
compactRepeatedConductSections,
|
|
111
121
|
fingerprintSystemPromptContext,
|
|
112
122
|
refreshedSystemPromptContext,
|
|
123
|
+
resolveStableSystemPromptTimestamp,
|
|
113
124
|
};
|
package/blun.mjs
CHANGED
|
@@ -21437,7 +21437,7 @@ var init_list_directory = __esmMin((() => {
|
|
|
21437
21437
|
}));
|
|
21438
21438
|
//#endregion
|
|
21439
21439
|
//#region ../../packages/agent-core/src/profile/context.ts
|
|
21440
|
-
var { boundSystemPromptDirectoryListing, compactRepeatedConductSections, fingerprintSystemPromptContext, refreshedSystemPromptContext } = createRequire(import.meta.url)("./bin/system-prompt-context-policy.cjs");
|
|
21440
|
+
var { boundSystemPromptDirectoryListing, compactRepeatedConductSections, fingerprintSystemPromptContext, refreshedSystemPromptContext, resolveStableSystemPromptTimestamp } = createRequire(import.meta.url)("./bin/system-prompt-context-policy.cjs");
|
|
21441
21441
|
async function prepareSystemPromptContext(kaos, brandHome, options) {
|
|
21442
21442
|
const additionalDirs = normalizeAdditionalDirs(options?.additionalDirs ?? []);
|
|
21443
21443
|
const [cwdListing, agentsMdResult, additionalDirsInfo] = await Promise.all([
|
|
@@ -264973,6 +264973,9 @@ var init_agent = __esmMin((() => {
|
|
|
264973
264973
|
setRuntimeSystemPromptAppend(value) {
|
|
264974
264974
|
this.runtimeSystemPromptAppend = normalizeRuntimeSystemPromptAppend(value);
|
|
264975
264975
|
}
|
|
264976
|
+
setSystemPromptTimestamp(value) {
|
|
264977
|
+
this.systemPromptTimestamp = resolveStableSystemPromptTimestamp(value, this.systemPromptTimestamp);
|
|
264978
|
+
}
|
|
264976
264979
|
setActiveResponderModel(modelAlias) {
|
|
264977
264980
|
if (this._activeResponderModel === modelAlias) return;
|
|
264978
264981
|
this._activeResponderModel = modelAlias;
|
|
@@ -297363,6 +297366,7 @@ var init_session$1 = __esmMin((() => {
|
|
|
297363
297366
|
additionalDirs: parentAgent?.getAdditionalDirs() ?? this.additionalDirs,
|
|
297364
297367
|
systemPromptContextProvider: () => prepareSystemPromptContext(this.systemContextKaos(agent.kaos.getcwd()), this.options.blunHomeDir, { additionalDirs: agent.getAdditionalDirs() })
|
|
297365
297368
|
});
|
|
297369
|
+
agent.setSystemPromptTimestamp(this.metadata.createdAt);
|
|
297366
297370
|
agent.setRuntimeSystemPromptAppend(this.accountMemoryContext);
|
|
297367
297371
|
return agent;
|
|
297368
297372
|
}
|