@matthewfl/pi-contemplator 0.1.17 → 0.1.18
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matthewfl/pi-contemplator",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "A Pi extension that keeps long-running agentic sessions on track with background memory, contemplation, and structural review.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,12 +20,11 @@ export function createCompactContextTool(runtime: Runtime) {
|
|
|
20
20
|
promptGuidelines: [
|
|
21
21
|
"Use compact_context sparingly when either substantial additional work remains and there is not enough context left to complete it, or accumulated past context has become noisy, stale, or distracting enough that you are struggling to focus on the current task or reason about it reliably.",
|
|
22
22
|
"Do not use compact_context routinely, for short tasks, or merely because the conversation is long; use it for genuine context-capacity pressure or context degradation that is interfering with the work.",
|
|
23
|
-
"Call compact_context by itself
|
|
23
|
+
"Call compact_context by itself and provide short_continuation_prompt with concrete instructions for the next agent step. The tool ends the current turn automatically; pi-contemplator will compact the context and resume with those instructions, so do not add a separate response after the tool call.",
|
|
24
24
|
],
|
|
25
25
|
parameters: Type.Object({
|
|
26
26
|
short_continuation_prompt: Type.String({
|
|
27
27
|
minLength: 1,
|
|
28
|
-
maxLength: 1_000,
|
|
29
28
|
pattern: "\\S",
|
|
30
29
|
description: "Short, concrete instructions to your post-compaction self describing the next action and any critical immediate constraint. Do not summarize the whole conversation.",
|
|
31
30
|
}),
|
|
@@ -33,14 +32,14 @@ export function createCompactContextTool(runtime: Runtime) {
|
|
|
33
32
|
async execute(_toolCallId, params) {
|
|
34
33
|
if (runtime.compactInFlight) {
|
|
35
34
|
return {
|
|
36
|
-
content: [{ type: "text" as const, text: "Context compaction is already in progress.
|
|
35
|
+
content: [{ type: "text" as const, text: "Context compaction is already in progress. This turn is ending automatically; wait for automatic resume." }],
|
|
37
36
|
details: { status: "in_progress" } as CompactContextDetails,
|
|
38
37
|
terminate: true,
|
|
39
38
|
};
|
|
40
39
|
}
|
|
41
40
|
if (runtime.compactRequested) {
|
|
42
41
|
return {
|
|
43
|
-
content: [{ type: "text" as const, text: "Context compaction is already scheduled.
|
|
42
|
+
content: [{ type: "text" as const, text: "Context compaction is already scheduled. This turn is ending automatically; wait for automatic resume." }],
|
|
44
43
|
details: { status: "already_pending" } as CompactContextDetails,
|
|
45
44
|
terminate: true,
|
|
46
45
|
};
|
|
@@ -49,7 +48,7 @@ export function createCompactContextTool(runtime: Runtime) {
|
|
|
49
48
|
runtime.compactRequested = true;
|
|
50
49
|
runtime.compactContinuationPrompt = params.short_continuation_prompt.trim();
|
|
51
50
|
return {
|
|
52
|
-
content: [{ type: "text" as const, text: "Context compaction scheduled.
|
|
51
|
+
content: [{ type: "text" as const, text: "Context compaction scheduled. This turn is ending automatically, and the task will resume after compaction." }],
|
|
53
52
|
details: { status: "scheduled" } as CompactContextDetails,
|
|
54
53
|
terminate: true,
|
|
55
54
|
};
|