@rubytech/create-maxy 1.0.735 → 1.0.737

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.
@@ -1,35 +1,65 @@
1
1
  import {
2
- GREETING_DIRECTIVE,
3
- HAIKU_MODEL,
4
2
  Hono,
5
3
  LOG_DIR,
6
4
  MAXY_DIR,
7
5
  TELEGRAM_ADMIN_WEBHOOK_SECRET_FILE,
8
6
  TELEGRAM_WEBHOOK_SECRET_FILE,
9
7
  USERS_FILE,
10
- __commonJS,
11
- __toESM,
12
- agentLogStream,
13
- backfillNullUserIdConversations,
14
- bindVisitorToGroup,
15
8
  buildX11Env,
16
9
  callOauthLlm,
17
10
  canAccessAdmin,
18
- checkGroupMembership,
19
11
  checkRateLimit,
20
12
  clearRateLimit,
21
- clearSessionHistory,
22
13
  clientIpMiddleware,
23
14
  compactSession,
24
- completeGrantSetup,
25
15
  computeConstraints,
26
16
  createRemoteSession,
27
- deleteConversation,
28
- embed,
29
17
  ensureAuth,
30
18
  ensureCdp,
31
19
  ensureLogDir,
32
20
  ensureVnc,
21
+ hashPassword,
22
+ invokeAgent,
23
+ isActionActive,
24
+ isPasswordValid,
25
+ isRemoteAuthConfigured,
26
+ keyFilePath,
27
+ launchAction,
28
+ load,
29
+ logPath,
30
+ recordFailedAttempt,
31
+ render,
32
+ renderLoginPage,
33
+ requireAdminSession,
34
+ resolveBrowserTransport,
35
+ resolveClientIp,
36
+ safeJson,
37
+ sanitizeClientCorrId,
38
+ serve,
39
+ setRemotePassword,
40
+ sleep,
41
+ streamLogPathFor,
42
+ validateKey,
43
+ validatePasswordStrength,
44
+ verifyPassword,
45
+ verifyRemotePassword,
46
+ vncLog,
47
+ waitForExit,
48
+ writeChromiumWrapper
49
+ } from "./chunk-ULVR2RRY.js";
50
+ import {
51
+ GREETING_DIRECTIVE,
52
+ HAIKU_MODEL,
53
+ __commonJS,
54
+ __toESM,
55
+ agentLogStream,
56
+ backfillNullUserIdConversations,
57
+ bindVisitorToGroup,
58
+ checkGroupMembership,
59
+ clearSessionHistory,
60
+ completeGrantSetup,
61
+ deleteConversation,
62
+ embed,
33
63
  fetchBranding,
34
64
  findGroupBySlug,
35
65
  findRecentConversation,
@@ -49,58 +79,30 @@ import {
49
79
  getUserNameForSession,
50
80
  getUserTimezone,
51
81
  getVisitorIdForSession,
52
- hashPassword,
53
82
  interruptClient,
54
- invokeAgent,
55
- isActionActive,
56
- isPasswordValid,
57
- isRemoteAuthConfigured,
58
- keyFilePath,
59
- launchAction,
60
83
  listAdminSessions,
61
84
  listAdminSessionsInProgress,
62
- load,
63
85
  loadOnboardingStep,
64
- logPath,
65
86
  preConversationLogStream,
66
87
  preflushStreamLogKey,
67
- recordFailedAttempt,
68
88
  registerGrantSession,
69
89
  registerResumedSession,
70
90
  registerSession,
71
91
  renameConversation,
72
- render,
73
- renderLoginPage,
74
- requireAdminSession,
75
92
  resolveAccount,
76
93
  resolveAgentConfig,
77
- resolveBrowserTransport,
78
- resolveClientIp,
79
94
  resolveDefaultAgentSlug,
80
95
  resolveUserAccounts,
81
- safeJson,
82
- sanitizeClientCorrId,
83
96
  seedSessionHistory,
84
- serve,
85
97
  setConversationIdForSession,
86
98
  setGroupContextForSession,
87
- setRemotePassword,
88
99
  sigtermFlushStreamLogs,
89
- sleep,
90
- streamLogPathFor,
91
100
  unregisterSession,
92
101
  validateAgentSlug,
93
- validateKey,
94
- validatePasswordStrength,
95
102
  validateSession,
96
103
  verifyAndGetConversationUpdatedAt,
97
- verifyConversationOwnership,
98
- verifyPassword,
99
- verifyRemotePassword,
100
- vncLog,
101
- waitForExit,
102
- writeChromiumWrapper
103
- } from "./chunk-HU5FSQYA.js";
104
+ verifyConversationOwnership
105
+ } from "./chunk-3KDVGWPQ.js";
104
106
 
105
107
  // ../lib/graph-trash/dist/index.js
106
108
  var require_dist = __commonJS({
@@ -8109,6 +8111,16 @@ function chatReject(status, error, sk) {
8109
8111
  });
8110
8112
  }
8111
8113
  var app11 = new Hono();
8114
+ app11.post("/cancel", requireAdminSession, async (c) => {
8115
+ const session_key = c.var.sessionKey;
8116
+ try {
8117
+ const { interruptClient: interruptClient2 } = await import("./client-pool-I5TCP7WI.js");
8118
+ await interruptClient2(session_key);
8119
+ return c.json({ ok: true });
8120
+ } catch (err) {
8121
+ return c.json({ ok: false, error: err instanceof Error ? err.message : String(err) }, 500);
8122
+ }
8123
+ });
8112
8124
  app11.post("/", requireAdminSession, async (c) => {
8113
8125
  const session_key = c.var.sessionKey;
8114
8126
  const contentType = c.req.header("content-type") ?? "";
@@ -8259,10 +8271,13 @@ app11.post("/", requireAdminSession, async (c) => {
8259
8271
  const sseConvId = getConversationIdForSession(session_key);
8260
8272
  const sseLogStream = sseConvId ? agentLogStream("sse-events", account.accountDir, sseConvId) : preConversationLogStream("sse-events", account.accountDir);
8261
8273
  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`);
8274
+ function resolveTeeStreamLogPath() {
8275
+ const liveConvId = getConversationIdForSession(session_key);
8276
+ const key = liveConvId ?? preflushStreamLogKey(session_key);
8277
+ return resolve12(account.accountDir, "logs", `claude-agent-stream-${key}.log`);
8278
+ }
8264
8279
  try {
8265
- appendFileSync4(teeStreamLogPath, `[${(/* @__PURE__ */ new Date()).toISOString()}] [chat-route-version=task606-incoming-close] sessionKey=${session_key.slice(0, 12)}\u2026
8280
+ appendFileSync4(resolveTeeStreamLogPath(), `[${(/* @__PURE__ */ new Date()).toISOString()}] [chat-route-version=task606-tee-path-resolve] sessionKey=${session_key.slice(0, 12)}\u2026
8266
8281
  `);
8267
8282
  } catch {
8268
8283
  }
@@ -8271,7 +8286,7 @@ app11.post("/", requireAdminSession, async (c) => {
8271
8286
  incoming.on("close", () => {
8272
8287
  const tsClose = (/* @__PURE__ */ new Date()).toISOString();
8273
8288
  try {
8274
- appendFileSync4(teeStreamLogPath, `[${tsClose}] [incoming-close] sessionKey=${session_key.slice(0, 12)}\u2026 complete=${incoming.complete}
8289
+ appendFileSync4(resolveTeeStreamLogPath(), `[${tsClose}] [incoming-close] sessionKey=${session_key.slice(0, 12)}\u2026 complete=${incoming.complete}
8275
8290
  `);
8276
8291
  } catch {
8277
8292
  }
@@ -8279,7 +8294,7 @@ app11.post("/", requireAdminSession, async (c) => {
8279
8294
  console.error(`[${tsClose}] [incoming-close] DISCONNECT sessionKey=${session_key.slice(0, 12)}\u2026`);
8280
8295
  interruptClient(session_key).catch((err) => {
8281
8296
  try {
8282
- appendFileSync4(teeStreamLogPath, `[${(/* @__PURE__ */ new Date()).toISOString()}] [incoming-close] interrupt-failed: ${err instanceof Error ? err.message : String(err)}
8297
+ appendFileSync4(resolveTeeStreamLogPath(), `[${(/* @__PURE__ */ new Date()).toISOString()}] [incoming-close] interrupt-failed: ${err instanceof Error ? err.message : String(err)}
8283
8298
  `);
8284
8299
  } catch {
8285
8300
  }
@@ -8288,7 +8303,7 @@ app11.post("/", requireAdminSession, async (c) => {
8288
8303
  });
8289
8304
  } else {
8290
8305
  try {
8291
- appendFileSync4(teeStreamLogPath, `[${(/* @__PURE__ */ new Date()).toISOString()}] [incoming-close] UNAVAILABLE \u2014 c.env.incoming is not an EventEmitter
8306
+ appendFileSync4(resolveTeeStreamLogPath(), `[${(/* @__PURE__ */ new Date()).toISOString()}] [incoming-close] UNAVAILABLE \u2014 c.env.incoming is not an EventEmitter
8292
8307
  `);
8293
8308
  } catch {
8294
8309
  }
@@ -8300,7 +8315,7 @@ app11.post("/", requireAdminSession, async (c) => {
8300
8315
  } catch {
8301
8316
  }
8302
8317
  try {
8303
- appendFileSync4(teeStreamLogPath, line);
8318
+ appendFileSync4(resolveTeeStreamLogPath(), line);
8304
8319
  } catch {
8305
8320
  }
8306
8321
  return true;