@trevonistrevon/pi-loop 0.2.4 → 0.2.5
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 +8 -9
- package/package.json +1 -1
- package/src/index.ts +8 -9
package/dist/index.js
CHANGED
|
@@ -30,10 +30,6 @@ function debug(...args) {
|
|
|
30
30
|
function textResult(msg) {
|
|
31
31
|
return { content: [{ type: "text", text: msg }], details: undefined };
|
|
32
32
|
}
|
|
33
|
-
const SYSTEM_REMINDER_TEMPLATE = `<system-reminder>
|
|
34
|
-
Loop "%prompt%" fired. Execute this instruction now.
|
|
35
|
-
Trigger: %trigger_info%. Loop: %loop_id%.
|
|
36
|
-
</system-reminder>`;
|
|
37
33
|
export default function (pi) {
|
|
38
34
|
const piLoopEnv = process.env.PI_LOOP;
|
|
39
35
|
const piLoopScope = process.env.PI_LOOP_SCOPE;
|
|
@@ -190,11 +186,14 @@ export default function (pi) {
|
|
|
190
186
|
: data.trigger?.type === "event"
|
|
191
187
|
? `event: ${data.trigger.source}`
|
|
192
188
|
: `hybrid`;
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
.
|
|
196
|
-
|
|
197
|
-
|
|
189
|
+
const prompt = data.prompt || "loop fired";
|
|
190
|
+
const message = [
|
|
191
|
+
`[pi-loop] Loop #${data.loopId || "?"} fired (${triggerInfo}).`,
|
|
192
|
+
prompt,
|
|
193
|
+
].join("\n");
|
|
194
|
+
// deliverAs: "followUp" queues the message when the agent is busy;
|
|
195
|
+
// it delivers after the current turn finishes.
|
|
196
|
+
pi.sendUserMessage(message, { deliverAs: "followUp" });
|
|
198
197
|
});
|
|
199
198
|
// ──────────────────────────────────────────────────
|
|
200
199
|
// Tool 1: LoopCreate
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -35,10 +35,6 @@ function textResult(msg: string) {
|
|
|
35
35
|
return { content: [{ type: "text" as const, text: msg }], details: undefined as any };
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
const SYSTEM_REMINDER_TEMPLATE = `<system-reminder>
|
|
39
|
-
Loop "%prompt%" fired. Execute this instruction now.
|
|
40
|
-
Trigger: %trigger_info%. Loop: %loop_id%.
|
|
41
|
-
</system-reminder>`;
|
|
42
38
|
|
|
43
39
|
export default function (pi: ExtensionAPI) {
|
|
44
40
|
const piLoopEnv = process.env.PI_LOOP;
|
|
@@ -204,12 +200,15 @@ export default function (pi: ExtensionAPI) {
|
|
|
204
200
|
? `event: ${data.trigger.source}`
|
|
205
201
|
: `hybrid`;
|
|
206
202
|
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
.
|
|
210
|
-
|
|
203
|
+
const prompt = data.prompt || "loop fired";
|
|
204
|
+
const message = [
|
|
205
|
+
`[pi-loop] Loop #${data.loopId || "?"} fired (${triggerInfo}).`,
|
|
206
|
+
prompt,
|
|
207
|
+
].join("\n");
|
|
211
208
|
|
|
212
|
-
|
|
209
|
+
// deliverAs: "followUp" queues the message when the agent is busy;
|
|
210
|
+
// it delivers after the current turn finishes.
|
|
211
|
+
pi.sendUserMessage(message, { deliverAs: "followUp" });
|
|
213
212
|
});
|
|
214
213
|
|
|
215
214
|
// ──────────────────────────────────────────────────
|