@rubytech/create-maxy 1.0.732 → 1.0.733
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 +1 -1
- package/payload/server/server.js +23 -10
package/package.json
CHANGED
package/payload/server/server.js
CHANGED
|
@@ -8257,8 +8257,29 @@ app11.post("/", requireAdminSession, async (c) => {
|
|
|
8257
8257
|
}
|
|
8258
8258
|
const encoder = new TextEncoder();
|
|
8259
8259
|
const sseConvId = getConversationIdForSession(session_key);
|
|
8260
|
-
const
|
|
8260
|
+
const sseLogStream = sseConvId ? agentLogStream("sse-events", account.accountDir, sseConvId) : preConversationLogStream("sse-events", account.accountDir);
|
|
8261
8261
|
const sk = sseConvId?.slice(0, 8) ?? session_key.slice(0, 8);
|
|
8262
|
+
const teeStreamLogKey = sseConvId ?? preflushStreamLogKey(session_key);
|
|
8263
|
+
const teeStreamLogPath = resolve12(account.accountDir, "logs", `claude-agent-stream-${teeStreamLogKey}.log`);
|
|
8264
|
+
const sseLog = {
|
|
8265
|
+
write(line) {
|
|
8266
|
+
try {
|
|
8267
|
+
sseLogStream.write(line);
|
|
8268
|
+
} catch {
|
|
8269
|
+
}
|
|
8270
|
+
try {
|
|
8271
|
+
appendFileSync4(teeStreamLogPath, line);
|
|
8272
|
+
} catch {
|
|
8273
|
+
}
|
|
8274
|
+
return true;
|
|
8275
|
+
},
|
|
8276
|
+
end() {
|
|
8277
|
+
try {
|
|
8278
|
+
sseLogStream.end();
|
|
8279
|
+
} catch {
|
|
8280
|
+
}
|
|
8281
|
+
}
|
|
8282
|
+
};
|
|
8262
8283
|
let tailer = null;
|
|
8263
8284
|
const readable = new ReadableStream({
|
|
8264
8285
|
// Task 606 — fires when the consumer (Hono's response writer / Node
|
|
@@ -8277,17 +8298,9 @@ app11.post("/", requireAdminSession, async (c) => {
|
|
|
8277
8298
|
cancel(reason) {
|
|
8278
8299
|
const ts = (/* @__PURE__ */ new Date()).toISOString().slice(11, 23);
|
|
8279
8300
|
const reasonStr = typeof reason === "string" ? reason : reason instanceof Error ? reason.message : "consumer-cancelled";
|
|
8280
|
-
const cancelLine = `[${(/* @__PURE__ */ new Date()).toISOString()}] [stream-cancel-callback] sessionKey=${session_key.slice(0, 12)}\u2026 reason=${JSON.stringify(reasonStr)}
|
|
8281
|
-
`;
|
|
8282
|
-
try {
|
|
8283
|
-
const cancelLogKey = sseConvId ?? preflushStreamLogKey(session_key);
|
|
8284
|
-
const path2 = resolve12(account.accountDir, "logs", `claude-agent-stream-${cancelLogKey}.log`);
|
|
8285
|
-
appendFileSync4(path2, cancelLine);
|
|
8286
|
-
} catch {
|
|
8287
|
-
}
|
|
8288
|
-
console.error(cancelLine.trimEnd());
|
|
8289
8301
|
sseLog.write(`[${ts}] [${sk}] admin: CANCEL [stream-cancel] reason=${reasonStr}
|
|
8290
8302
|
`);
|
|
8303
|
+
console.error(`[${(/* @__PURE__ */ new Date()).toISOString()}] [stream-cancel-callback] sessionKey=${session_key.slice(0, 12)}\u2026 reason=${JSON.stringify(reasonStr)}`);
|
|
8291
8304
|
interruptClient(session_key).catch((err) => {
|
|
8292
8305
|
sseLog.write(`[${ts}] [${sk}] admin: ABORT [interrupt-failed] ${err instanceof Error ? err.message : String(err)}
|
|
8293
8306
|
`);
|