@rubytech/create-maxy 1.0.729 → 1.0.731

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.729",
3
+ "version": "1.0.731",
4
4
  "description": "Install Maxy — AI for Productive People",
5
5
  "bin": {
6
6
  "create-maxy": "./dist/index.js"
@@ -8260,6 +8260,24 @@ app11.post("/", requireAdminSession, async (c) => {
8260
8260
  const sk = sseConvId?.slice(0, 8) ?? session_key.slice(0, 8);
8261
8261
  let tailer = null;
8262
8262
  const readable = new ReadableStream({
8263
+ // Task 606 — fires when the consumer (Hono's response writer / Node
8264
+ // adapter) cancels the stream because the client disconnected. This is
8265
+ // the only signal that arrives WHILE start()'s for-await is blocked
8266
+ // awaiting the SDK's next message — c.req.raw.signal didn't propagate
8267
+ // under @hono/node-server, and controller.enqueue throwing only
8268
+ // surfaces on the next yielded event (which never comes if the model
8269
+ // is mid-response when Cancel is pressed). cancel() is the load-bearing
8270
+ // hook for operator abort.
8271
+ cancel(reason) {
8272
+ const ts = (/* @__PURE__ */ new Date()).toISOString().slice(11, 23);
8273
+ const reasonStr = typeof reason === "string" ? reason : reason instanceof Error ? reason.message : "consumer-cancelled";
8274
+ sseLog.write(`[${ts}] [${sk}] admin: CANCEL [stream-cancel] reason=${reasonStr}
8275
+ `);
8276
+ interruptClient(session_key).catch((err) => {
8277
+ sseLog.write(`[${ts}] [${sk}] admin: ABORT [interrupt-failed] ${err instanceof Error ? err.message : String(err)}
8278
+ `);
8279
+ });
8280
+ },
8263
8281
  async start(controller) {
8264
8282
  let controllerOpen = true;
8265
8283
  const sseEntry = { controller, conversationId: sseConvId ?? null, sessionKey: session_key };
@@ -8327,6 +8345,10 @@ app11.post("/", requireAdminSession, async (c) => {
8327
8345
  if (controllerClosed) {
8328
8346
  sseLog.write(`[${ts}] [${sk}] admin: DISCONNECT [client_disconnect] ${rawMessage}
8329
8347
  `);
8348
+ interruptClient(session_key).catch((interruptErr) => {
8349
+ sseLog.write(`[${ts}] [${sk}] admin: ABORT [interrupt-failed] ${interruptErr instanceof Error ? interruptErr.message : String(interruptErr)}
8350
+ `);
8351
+ });
8330
8352
  } else {
8331
8353
  const category = classifyAgentError(err);
8332
8354
  const errEvent = JSON.stringify({ type: "text", content: friendlyAgentError(err) });