@rubytech/create-maxy 1.0.734 → 1.0.735

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": "@rubytech/create-maxy",
3
- "version": "1.0.734",
3
+ "version": "1.0.735",
4
4
  "description": "Install Maxy — AI for Productive People",
5
5
  "bin": {
6
6
  "create-maxy": "./dist/index.js"
@@ -8262,10 +8262,37 @@ app11.post("/", requireAdminSession, async (c) => {
8262
8262
  const teeStreamLogKey = sseConvId ?? preflushStreamLogKey(session_key);
8263
8263
  const teeStreamLogPath = resolve12(account.accountDir, "logs", `claude-agent-stream-${teeStreamLogKey}.log`);
8264
8264
  try {
8265
- appendFileSync4(teeStreamLogPath, `[${(/* @__PURE__ */ new Date()).toISOString()}] [chat-route-version=task606-tee] sessionKey=${session_key.slice(0, 12)}\u2026
8265
+ appendFileSync4(teeStreamLogPath, `[${(/* @__PURE__ */ new Date()).toISOString()}] [chat-route-version=task606-incoming-close] sessionKey=${session_key.slice(0, 12)}\u2026
8266
8266
  `);
8267
8267
  } catch {
8268
8268
  }
8269
+ const incoming = c.env?.incoming;
8270
+ if (incoming && typeof incoming.on === "function") {
8271
+ incoming.on("close", () => {
8272
+ const tsClose = (/* @__PURE__ */ new Date()).toISOString();
8273
+ try {
8274
+ appendFileSync4(teeStreamLogPath, `[${tsClose}] [incoming-close] sessionKey=${session_key.slice(0, 12)}\u2026 complete=${incoming.complete}
8275
+ `);
8276
+ } catch {
8277
+ }
8278
+ if (incoming.complete === false) {
8279
+ console.error(`[${tsClose}] [incoming-close] DISCONNECT sessionKey=${session_key.slice(0, 12)}\u2026`);
8280
+ interruptClient(session_key).catch((err) => {
8281
+ try {
8282
+ appendFileSync4(teeStreamLogPath, `[${(/* @__PURE__ */ new Date()).toISOString()}] [incoming-close] interrupt-failed: ${err instanceof Error ? err.message : String(err)}
8283
+ `);
8284
+ } catch {
8285
+ }
8286
+ });
8287
+ }
8288
+ });
8289
+ } else {
8290
+ try {
8291
+ appendFileSync4(teeStreamLogPath, `[${(/* @__PURE__ */ new Date()).toISOString()}] [incoming-close] UNAVAILABLE \u2014 c.env.incoming is not an EventEmitter
8292
+ `);
8293
+ } catch {
8294
+ }
8295
+ }
8269
8296
  const sseLog = {
8270
8297
  write(line) {
8271
8298
  try {