pi-blackhole 0.4.5 → 0.4.7
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/dist/index.js +31 -8
- package/dist/index.js.map +1 -1
- package/package.json +11 -12
- package/src/om/compaction-trigger.ts +4 -0
- package/src/tools/recall.ts +39 -9
package/dist/index.js
CHANGED
|
@@ -12218,6 +12218,9 @@ async function handleTurnEnd(ctx, runtime, inlineCompact) {
|
|
|
12218
12218
|
}
|
|
12219
12219
|
} finally {
|
|
12220
12220
|
runtime.compactInFlight = false;
|
|
12221
|
+
if (hasUI && ctx.signal?.aborted !== true) {
|
|
12222
|
+
ui?.setWorkingVisible?.(true);
|
|
12223
|
+
}
|
|
12221
12224
|
}
|
|
12222
12225
|
return;
|
|
12223
12226
|
}
|
|
@@ -12878,17 +12881,37 @@ function registerRecallTool(pi) {
|
|
|
12878
12881
|
)
|
|
12879
12882
|
}),
|
|
12880
12883
|
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
12884
|
+
const sessionFile = ctx.sessionManager.getSessionFile();
|
|
12885
|
+
if (!sessionFile) {
|
|
12886
|
+
return {
|
|
12887
|
+
content: [
|
|
12888
|
+
{ type: "text", text: "No session file available." }
|
|
12889
|
+
],
|
|
12890
|
+
details: void 0
|
|
12891
|
+
};
|
|
12892
|
+
}
|
|
12893
|
+
const scope = normalizeRecallScope(params.scope);
|
|
12894
|
+
const lineageEntryIds = scope === "lineage" ? getActiveLineageEntryIds(ctx.sessionManager) : void 0;
|
|
12881
12895
|
const q = params.query?.trim();
|
|
12882
12896
|
if (q && parseDrillDown(q)) {
|
|
12883
12897
|
const parsed = parseDrillDown(q);
|
|
12884
|
-
|
|
12885
|
-
|
|
12886
|
-
|
|
12887
|
-
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12898
|
+
if (lineageEntryIds) {
|
|
12899
|
+
const { rendered } = loadAllMessages(
|
|
12900
|
+
sessionFile,
|
|
12901
|
+
false,
|
|
12902
|
+
lineageEntryIds
|
|
12903
|
+
);
|
|
12904
|
+
if (!rendered.some((m) => m.index === parsed.index)) {
|
|
12905
|
+
return {
|
|
12906
|
+
content: [
|
|
12907
|
+
{
|
|
12908
|
+
type: "text",
|
|
12909
|
+
text: `Cannot expand indices outside active lineage: ${parsed.index}. Use scope:'all' to reach other branches.`
|
|
12910
|
+
}
|
|
12911
|
+
],
|
|
12912
|
+
details: void 0
|
|
12913
|
+
};
|
|
12914
|
+
}
|
|
12892
12915
|
}
|
|
12893
12916
|
const text = expandEntryFile(
|
|
12894
12917
|
sessionFile,
|