nolo-cli 0.31.0-alpha.2 → 0.31.0-alpha.4
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.
|
@@ -4478,9 +4478,7 @@ var estimateTokens = (text) => {
|
|
|
4478
4478
|
return Math.ceil(cjk * 1.5 + ascii / 4);
|
|
4479
4479
|
};
|
|
4480
4480
|
var OVERLAY_HEADER_LINES = [
|
|
4481
|
-
"--- Memory
|
|
4482
|
-
"\u4EE5\u4E0B\u662F\u5F53\u524D\u8BF7\u6C42\u53EF\u7528\u7684\u8BB0\u5FC6\u4E8B\u5B9E\uFF1B\u76F8\u5173\u65F6\u76F4\u63A5\u57FA\u4E8E\u8FD9\u4E9B\u8BB0\u5FC6\u56DE\u7B54\u3002",
|
|
4483
|
-
"\u7528\u6237\u5F53\u524D\u8F93\u5165\u4F18\u5148\u4E8E\u8BB0\u5FC6\uFF1B\u8BB0\u5FC6\u53EA\u8F85\u52A9\u7406\u89E3\uFF0C\u4E0D\u8981\u6C42\u8FCE\u5408\u3002",
|
|
4481
|
+
"--- Memory (\u76F8\u5173\u65F6\u53C2\u8003\uFF0C\u7528\u6237\u8F93\u5165\u4F18\u5148) ---",
|
|
4484
4482
|
""
|
|
4485
4483
|
];
|
|
4486
4484
|
var OVERLAY_HEADER_TOKENS = estimateTokens(OVERLAY_HEADER_LINES.join("\n"));
|
|
@@ -4505,15 +4503,15 @@ var normalizeDisplayContent = (item) => {
|
|
|
4505
4503
|
const normalized = item.content.trim().replace(EXPLICIT_REMEMBER_PREFIX_REGEX, "").replace(/[。!?!?]+$/u, "").trim();
|
|
4506
4504
|
if (item.kind === "semantic") {
|
|
4507
4505
|
if (item.tags?.includes("understanding-memory") && item.facet) {
|
|
4508
|
-
return formatFacetContent(item.facet, normalized, "
|
|
4506
|
+
return formatFacetContent(item.facet, normalized, "");
|
|
4509
4507
|
}
|
|
4510
|
-
return
|
|
4508
|
+
return normalized;
|
|
4511
4509
|
}
|
|
4512
4510
|
if (item.kind === "episodic" && (item.patternKey === "explicit-remember" || item.patternKey === "agent-remember")) {
|
|
4513
|
-
return
|
|
4511
|
+
return normalized;
|
|
4514
4512
|
}
|
|
4515
4513
|
if (item.kind === "episodic" && item.tags?.includes("understanding-memory") && item.facet) {
|
|
4516
|
-
return formatFacetContent(item.facet, normalized, "\
|
|
4514
|
+
return formatFacetContent(item.facet, normalized, "\u4E0A\u6B21: ");
|
|
4517
4515
|
}
|
|
4518
4516
|
return normalized;
|
|
4519
4517
|
};
|
|
@@ -4663,7 +4661,7 @@ var rankMemoryCandidates = (items, query, context) => {
|
|
|
4663
4661
|
|
|
4664
4662
|
// packages/ai/memory/runtime.ts
|
|
4665
4663
|
var COLD_STORAGE_CONFIDENCE = 0.3;
|
|
4666
|
-
var MEMORY_OVERLAY_TOKEN_BUDGET =
|
|
4664
|
+
var MEMORY_OVERLAY_TOKEN_BUDGET = 1200;
|
|
4667
4665
|
var normalizeSelectedContent = (text) => text.trim().replace(EXPLICIT_REMEMBER_PREFIX_REGEX, "").replace(/[。!?!?]+$/u, "").trim();
|
|
4668
4666
|
var STACK_TERMS = [
|
|
4669
4667
|
"typescript",
|
|
@@ -4748,7 +4746,7 @@ var selectRuntimeMemoryItems = (items, context, userInput = "") => {
|
|
|
4748
4746
|
const selected = [];
|
|
4749
4747
|
const selectedIds = /* @__PURE__ */ new Set();
|
|
4750
4748
|
const add = (item) => {
|
|
4751
|
-
if (!item || selectedIds.has(item.id) || selected.length >=
|
|
4749
|
+
if (!item || selectedIds.has(item.id) || selected.length >= 10) return;
|
|
4752
4750
|
selected.push(item);
|
|
4753
4751
|
selectedIds.add(item.id);
|
|
4754
4752
|
};
|
|
@@ -5430,6 +5428,7 @@ export {
|
|
|
5430
5428
|
prependSubjectDialogMarker,
|
|
5431
5429
|
normalizeCliImageInput,
|
|
5432
5430
|
inspectLocalRunWorkspace,
|
|
5431
|
+
resolveCliMemory,
|
|
5433
5432
|
QUOTA_ERROR_PATTERNS,
|
|
5434
5433
|
isQuotaExhaustedError,
|
|
5435
5434
|
runAgentRunCommand,
|
package/index.js
CHANGED
|
@@ -126,7 +126,7 @@ function createDaemonShortcutCommand(path, description, command2) {
|
|
|
126
126
|
// packages/cli/agentInternalCommandEntries.ts
|
|
127
127
|
function getAgentInternalCommandEntries() {
|
|
128
128
|
const createAgentRunCommand = (path, description) => createContextCommand(path, description, async (args2, ctx) => {
|
|
129
|
-
const { runAgentRunCommand } = await import("./agentRunCommand-
|
|
129
|
+
const { runAgentRunCommand } = await import("./agentRunCommand-CUDPUVWQ.js");
|
|
130
130
|
return runAgentRunCommand(args2, {
|
|
131
131
|
env: ctx.env,
|
|
132
132
|
scriptDir: ctx.scriptDir,
|
|
@@ -796,7 +796,7 @@ async function runScript(script, forwardedArgs, env) {
|
|
|
796
796
|
return proc.exited;
|
|
797
797
|
}
|
|
798
798
|
async function launchTuiWorkspace(args2) {
|
|
799
|
-
const { startTuiWorkspace } = await import("./readlineWorkspace-
|
|
799
|
+
const { startTuiWorkspace } = await import("./readlineWorkspace-YHZS56AL.js");
|
|
800
800
|
const { createTuiSummaryLlmCaller } = await import("./tuiSummaryLlmCaller-SRZ4QQUP.js");
|
|
801
801
|
return startTuiWorkspace({
|
|
802
802
|
...args2,
|
package/package.json
CHANGED
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
replaceCollapsedPastesWithReferences,
|
|
40
40
|
resolveAgentContextWindow,
|
|
41
41
|
resolveCliColorEnabled,
|
|
42
|
+
resolveCliMemory,
|
|
42
43
|
resolveSkillReference,
|
|
43
44
|
resolveTuiBrightness,
|
|
44
45
|
runAgentTurn,
|
|
@@ -57,7 +58,7 @@ import {
|
|
|
57
58
|
visibleWidth,
|
|
58
59
|
wrapTextToLines,
|
|
59
60
|
wrapTranscriptLine
|
|
60
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-SIDO3UCU.js";
|
|
61
62
|
import "./chunk-AOS5IN2I.js";
|
|
62
63
|
import "./chunk-6HYVJV7B.js";
|
|
63
64
|
import {
|
|
@@ -128,6 +129,8 @@ import {
|
|
|
128
129
|
import "./chunk-N7J63Q6C.js";
|
|
129
130
|
import {
|
|
130
131
|
buildAgentsMdLayer,
|
|
132
|
+
buildMemoryOverlayLayer,
|
|
133
|
+
buildMemoryUseGuidanceLayer,
|
|
131
134
|
partitionScopedBlocks,
|
|
132
135
|
renderTurnContextBlocksWithScope
|
|
133
136
|
} from "./chunk-DPR66GY6.js";
|
|
@@ -5822,12 +5825,23 @@ async function runAgentChat(scriptDir, state, message, env, output, agentRunner
|
|
|
5822
5825
|
// on-demand. Mirrors agentRunCommand.ts and desktopAgentRuntimeTurnService.
|
|
5823
5826
|
buildSkillDiscoveryContextLayer(state.cwd)
|
|
5824
5827
|
];
|
|
5828
|
+
const memoryPromptBlock = await resolveCliMemory({
|
|
5829
|
+
serverUrl: state.serverUrl,
|
|
5830
|
+
authToken: resolvePlatformAuthToken(env),
|
|
5831
|
+
agentKey: effectiveAgentKey,
|
|
5832
|
+
userInput: effectiveMessage,
|
|
5833
|
+
env
|
|
5834
|
+
}).catch(() => null);
|
|
5835
|
+
const memoryOverlayLayer = buildMemoryOverlayLayer({ promptBlock: memoryPromptBlock });
|
|
5836
|
+
const memoryUseGuidanceLayer = buildMemoryUseGuidanceLayer({ promptBlock: memoryPromptBlock });
|
|
5825
5837
|
const contextBlockScopes = partitionScopedBlocks([
|
|
5826
5838
|
...renderTurnContextBlocksWithScope(layers),
|
|
5839
|
+
...renderTurnContextBlocksWithScope([memoryUseGuidanceLayer]),
|
|
5827
5840
|
// Attached skill bodies are already self-contained sections built by
|
|
5828
5841
|
// buildSkillContextBlocks; they stay turn-scope because the user can
|
|
5829
5842
|
// attach/detach skills between turns.
|
|
5830
|
-
...(skillContextBlocks ?? []).map((content) => content.trim()).filter((content) => content.length > 0).map((content) => ({ content, cacheScope: "turn" }))
|
|
5843
|
+
...(skillContextBlocks ?? []).map((content) => content.trim()).filter((content) => content.length > 0).map((content) => ({ content, cacheScope: "turn" })),
|
|
5844
|
+
...renderTurnContextBlocksWithScope([memoryOverlayLayer])
|
|
5831
5845
|
]);
|
|
5832
5846
|
const result = await agentRunner({
|
|
5833
5847
|
agentName: effectiveAgentName,
|