@rubytech/create-maxy 1.0.732 → 1.0.734
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 +28 -10
package/package.json
CHANGED
package/payload/server/server.js
CHANGED
|
@@ -8257,8 +8257,34 @@ 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
|
+
try {
|
|
8265
|
+
appendFileSync4(teeStreamLogPath, `[${(/* @__PURE__ */ new Date()).toISOString()}] [chat-route-version=task606-tee] sessionKey=${session_key.slice(0, 12)}\u2026
|
|
8266
|
+
`);
|
|
8267
|
+
} catch {
|
|
8268
|
+
}
|
|
8269
|
+
const sseLog = {
|
|
8270
|
+
write(line) {
|
|
8271
|
+
try {
|
|
8272
|
+
sseLogStream.write(line);
|
|
8273
|
+
} catch {
|
|
8274
|
+
}
|
|
8275
|
+
try {
|
|
8276
|
+
appendFileSync4(teeStreamLogPath, line);
|
|
8277
|
+
} catch {
|
|
8278
|
+
}
|
|
8279
|
+
return true;
|
|
8280
|
+
},
|
|
8281
|
+
end() {
|
|
8282
|
+
try {
|
|
8283
|
+
sseLogStream.end();
|
|
8284
|
+
} catch {
|
|
8285
|
+
}
|
|
8286
|
+
}
|
|
8287
|
+
};
|
|
8262
8288
|
let tailer = null;
|
|
8263
8289
|
const readable = new ReadableStream({
|
|
8264
8290
|
// Task 606 — fires when the consumer (Hono's response writer / Node
|
|
@@ -8277,17 +8303,9 @@ app11.post("/", requireAdminSession, async (c) => {
|
|
|
8277
8303
|
cancel(reason) {
|
|
8278
8304
|
const ts = (/* @__PURE__ */ new Date()).toISOString().slice(11, 23);
|
|
8279
8305
|
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
8306
|
sseLog.write(`[${ts}] [${sk}] admin: CANCEL [stream-cancel] reason=${reasonStr}
|
|
8290
8307
|
`);
|
|
8308
|
+
console.error(`[${(/* @__PURE__ */ new Date()).toISOString()}] [stream-cancel-callback] sessionKey=${session_key.slice(0, 12)}\u2026 reason=${JSON.stringify(reasonStr)}`);
|
|
8291
8309
|
interruptClient(session_key).catch((err) => {
|
|
8292
8310
|
sseLog.write(`[${ts}] [${sk}] admin: ABORT [interrupt-failed] ${err instanceof Error ? err.message : String(err)}
|
|
8293
8311
|
`);
|