@sjawhar/pi-envoy 16.46.0 → 16.46.1
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/envoy.js +32 -13
- package/package.json +1 -1
package/dist/envoy.js
CHANGED
|
@@ -42706,7 +42706,7 @@ var import_nats2 = __toESM(require_mod4(), 1);
|
|
|
42706
42706
|
|
|
42707
42707
|
// package.json
|
|
42708
42708
|
var name = "@sjawhar/pi-envoy";
|
|
42709
|
-
var version2 = "16.46.
|
|
42709
|
+
var version2 = "16.46.1";
|
|
42710
42710
|
var package_default = {
|
|
42711
42711
|
name,
|
|
42712
42712
|
version: version2,
|
|
@@ -49428,6 +49428,32 @@ ${REPLAYED_BTW_NOTE}`, frame.envelope, "inert");
|
|
|
49428
49428
|
return result;
|
|
49429
49429
|
};
|
|
49430
49430
|
const registerSession = () => trackRegistration(sessionID, sendRegistration(registrationState.refreshRegistration));
|
|
49431
|
+
let writtenTitle;
|
|
49432
|
+
const writeDispatchTitle = (context) => {
|
|
49433
|
+
const id = process.env.DISPATCH_SESSION_ID;
|
|
49434
|
+
if (id === undefined || id === "")
|
|
49435
|
+
return;
|
|
49436
|
+
const title = context.sessionManager.getSessionName?.() ?? "";
|
|
49437
|
+
if (title === "")
|
|
49438
|
+
return;
|
|
49439
|
+
if (writtenTitle?.sessionID === id && writtenTitle.title === title)
|
|
49440
|
+
return;
|
|
49441
|
+
writeSessionTitle(sessionDirectory(process.env, id), title);
|
|
49442
|
+
writtenTitle = { sessionID: id, title };
|
|
49443
|
+
};
|
|
49444
|
+
const dispatchTitleWriter = () => {
|
|
49445
|
+
let notified = false;
|
|
49446
|
+
return (context) => {
|
|
49447
|
+
try {
|
|
49448
|
+
writeDispatchTitle(context);
|
|
49449
|
+
} catch (error) {
|
|
49450
|
+
if (notified)
|
|
49451
|
+
return;
|
|
49452
|
+
notified = true;
|
|
49453
|
+
logger3.warn(`envoy: could not write the session title for the dispatch command (${messageFor(error)}); the dispatch command's writes carry no session title`);
|
|
49454
|
+
}
|
|
49455
|
+
};
|
|
49456
|
+
};
|
|
49431
49457
|
const ensureHeartbeat = (context) => {
|
|
49432
49458
|
if (heartbeatRegistered)
|
|
49433
49459
|
return;
|
|
@@ -49436,6 +49462,7 @@ ${REPLAYED_BTW_NOTE}`, frame.envelope, "inert");
|
|
|
49436
49462
|
let registrationFailed = false;
|
|
49437
49463
|
let healing = false;
|
|
49438
49464
|
let retryArmed = false;
|
|
49465
|
+
const writeHeartbeatTitle = dispatchTitleWriter();
|
|
49439
49466
|
const noteStall = (detail) => {
|
|
49440
49467
|
if (stallNotified)
|
|
49441
49468
|
return;
|
|
@@ -49451,6 +49478,7 @@ ${REPLAYED_BTW_NOTE}`, frame.envelope, "inert");
|
|
|
49451
49478
|
return;
|
|
49452
49479
|
if (context.sessionManager.getSessionId() === "")
|
|
49453
49480
|
return;
|
|
49481
|
+
writeHeartbeatTitle(context);
|
|
49454
49482
|
unwritten.handBackWithdrawn();
|
|
49455
49483
|
triggerReplay();
|
|
49456
49484
|
if (healing) {
|
|
@@ -50137,20 +50165,11 @@ ${REPLAYED_BTW_NOTE}`, frame.envelope, "inert");
|
|
|
50137
50165
|
return;
|
|
50138
50166
|
pi.sendMessage({ customType: ASK_REMINDER_MESSAGE, content: UNASKED_WAIT_REMINDER, display: false }, { deliverAs: "steer", triggerTurn: true });
|
|
50139
50167
|
}
|
|
50140
|
-
|
|
50141
|
-
pi.on("tool_call", async (
|
|
50142
|
-
if (event.toolName !== "bash" && event.toolName !== "eval")
|
|
50143
|
-
return;
|
|
50168
|
+
const writeToolCallTitle = dispatchTitleWriter();
|
|
50169
|
+
pi.on("tool_call", async (_event, context) => {
|
|
50144
50170
|
if (context.agent?.kind !== "main")
|
|
50145
50171
|
return;
|
|
50146
|
-
|
|
50147
|
-
if (id === undefined || id === "")
|
|
50148
|
-
return;
|
|
50149
|
-
const title = context.sessionManager.getSessionName?.() ?? "";
|
|
50150
|
-
if (writtenTitle?.sessionID === id && writtenTitle.title === title)
|
|
50151
|
-
return;
|
|
50152
|
-
writeSessionTitle(sessionDirectory(process.env, id), title);
|
|
50153
|
-
writtenTitle = { sessionID: id, title };
|
|
50172
|
+
writeToolCallTitle(context);
|
|
50154
50173
|
return;
|
|
50155
50174
|
});
|
|
50156
50175
|
if (askgateFile !== null) {
|