aicodeman 1.44.0 → 1.45.0

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.
Files changed (211) hide show
  1. package/README.md +6 -2
  2. package/dist/case-rename.d.ts +65 -0
  3. package/dist/case-rename.d.ts.map +1 -0
  4. package/dist/case-rename.js +198 -0
  5. package/dist/case-rename.js.map +1 -0
  6. package/dist/cli-agent.d.ts +60 -1
  7. package/dist/cli-agent.d.ts.map +1 -1
  8. package/dist/cli-agent.js +225 -13
  9. package/dist/cli-agent.js.map +1 -1
  10. package/dist/config/auth-config.d.ts +16 -1
  11. package/dist/config/auth-config.d.ts.map +1 -1
  12. package/dist/config/auth-config.js +16 -1
  13. package/dist/config/auth-config.js.map +1 -1
  14. package/dist/host-sensors.d.ts +115 -0
  15. package/dist/host-sensors.d.ts.map +1 -0
  16. package/dist/host-sensors.js +457 -0
  17. package/dist/host-sensors.js.map +1 -0
  18. package/dist/remote-hosts.d.ts +7 -0
  19. package/dist/remote-hosts.d.ts.map +1 -1
  20. package/dist/remote-hosts.js +17 -3
  21. package/dist/remote-hosts.js.map +1 -1
  22. package/dist/remote-pane-history.d.ts.map +1 -1
  23. package/dist/remote-pane-history.js +2 -2
  24. package/dist/remote-pane-history.js.map +1 -1
  25. package/dist/session.d.ts.map +1 -1
  26. package/dist/session.js +13 -0
  27. package/dist/session.js.map +1 -1
  28. package/dist/tmux-manager.d.ts +7 -3
  29. package/dist/tmux-manager.d.ts.map +1 -1
  30. package/dist/tmux-manager.js +47 -15
  31. package/dist/tmux-manager.js.map +1 -1
  32. package/dist/tmux-prefix-table.d.ts +37 -5
  33. package/dist/tmux-prefix-table.d.ts.map +1 -1
  34. package/dist/tmux-prefix-table.js +40 -5
  35. package/dist/tmux-prefix-table.js.map +1 -1
  36. package/dist/tui/tui-app.d.ts +8 -1
  37. package/dist/tui/tui-app.d.ts.map +1 -1
  38. package/dist/tui/tui-app.js +49 -12
  39. package/dist/tui/tui-app.js.map +1 -1
  40. package/dist/tui/tui-client.d.ts +90 -3
  41. package/dist/tui/tui-client.d.ts.map +1 -1
  42. package/dist/tui/tui-client.js +195 -26
  43. package/dist/tui/tui-client.js.map +1 -1
  44. package/dist/web/agent-inbox-persistence.d.ts +52 -0
  45. package/dist/web/agent-inbox-persistence.d.ts.map +1 -0
  46. package/dist/web/agent-inbox-persistence.js +139 -0
  47. package/dist/web/agent-inbox-persistence.js.map +1 -0
  48. package/dist/web/agent-inbox.d.ts +140 -0
  49. package/dist/web/agent-inbox.d.ts.map +1 -0
  50. package/dist/web/agent-inbox.js +258 -0
  51. package/dist/web/agent-inbox.js.map +1 -0
  52. package/dist/web/middleware/auth.d.ts +2 -0
  53. package/dist/web/middleware/auth.d.ts.map +1 -1
  54. package/dist/web/middleware/auth.js +145 -52
  55. package/dist/web/middleware/auth.js.map +1 -1
  56. package/dist/web/public/admin-ui.js.gz +0 -0
  57. package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
  58. package/dist/web/public/app.42d0abae.js +43 -0
  59. package/dist/web/public/app.42d0abae.js.br +0 -0
  60. package/dist/web/public/app.42d0abae.js.gz +0 -0
  61. package/dist/web/public/approvals-ui.js.gz +0 -0
  62. package/dist/web/public/{constants.4866ecc3.js → constants.0b3cdde9.js} +11 -0
  63. package/dist/web/public/constants.0b3cdde9.js.br +0 -0
  64. package/dist/web/public/constants.0b3cdde9.js.gz +0 -0
  65. package/dist/web/public/cron-ui.js.gz +0 -0
  66. package/dist/web/public/entrance-animations.js.gz +0 -0
  67. package/dist/web/public/git-status-ui.js.gz +0 -0
  68. package/dist/web/public/header-divider.eb2d2463.js +1 -0
  69. package/dist/web/public/header-divider.eb2d2463.js.br +0 -0
  70. package/dist/web/public/header-divider.eb2d2463.js.gz +0 -0
  71. package/dist/web/public/home-sessions.js.gz +0 -0
  72. package/dist/web/public/host-wake-ui.js.gz +0 -0
  73. package/dist/web/public/i18n.1e68220d.js +2 -0
  74. package/dist/web/public/i18n.1e68220d.js.br +0 -0
  75. package/dist/web/public/i18n.1e68220d.js.gz +0 -0
  76. package/dist/web/public/image-input.941386e7.js.gz +0 -0
  77. package/dist/web/public/index.html +74 -11
  78. package/dist/web/public/index.html.br +0 -0
  79. package/dist/web/public/index.html.gz +0 -0
  80. package/dist/web/public/input-cjk.8bc46081.js.gz +0 -0
  81. package/dist/web/public/keyboard-accessory.4e8b20ac.js.gz +0 -0
  82. package/dist/web/public/{mobile-handlers.44adaa07.js → mobile-handlers.1c0cbcd8.js} +4 -2
  83. package/dist/web/public/mobile-handlers.1c0cbcd8.js.br +0 -0
  84. package/dist/web/public/mobile-handlers.1c0cbcd8.js.gz +0 -0
  85. package/dist/web/public/mobile-ime-preview.2dbaf262.js.gz +0 -0
  86. package/dist/web/public/mobile-overview.js.gz +0 -0
  87. package/dist/web/public/mobile.12fb18de.css.gz +0 -0
  88. package/dist/web/public/notification-manager.feb82c04.js.gz +0 -0
  89. package/dist/web/public/orchestrator-panel.js.gz +0 -0
  90. package/dist/web/public/{panels-ui.cbb24ba1.js → panels-ui.78c3defb.js} +76 -70
  91. package/dist/web/public/panels-ui.78c3defb.js.br +0 -0
  92. package/dist/web/public/panels-ui.78c3defb.js.gz +0 -0
  93. package/dist/web/public/ralph-panel.b350e2ef.js.gz +0 -0
  94. package/dist/web/public/ralph-wizard.b6c0dd19.js.gz +0 -0
  95. package/dist/web/public/readmymind-ui.js.gz +0 -0
  96. package/dist/web/public/reboot-restore-ui.js.gz +0 -0
  97. package/dist/web/public/respawn-ui.d7adcf6a.js.gz +0 -0
  98. package/dist/web/public/sanitize-html.e7147e76.js.gz +0 -0
  99. package/dist/web/public/session-lineage.js.gz +0 -0
  100. package/dist/web/public/{session-ui.9c1f009b.js → session-ui.ea6b1994.js} +28 -26
  101. package/dist/web/public/session-ui.ea6b1994.js.br +0 -0
  102. package/dist/web/public/session-ui.ea6b1994.js.gz +0 -0
  103. package/dist/web/public/{settings-ui.fea9ddae.js → settings-ui.085dd202.js} +3 -3
  104. package/dist/web/public/settings-ui.085dd202.js.br +0 -0
  105. package/dist/web/public/settings-ui.085dd202.js.gz +0 -0
  106. package/dist/web/public/spreadsheet-preview-worker.js.gz +0 -0
  107. package/dist/web/public/spreadsheet-preview.75c751de.js.gz +0 -0
  108. package/dist/web/public/spreadsheet-xlsx-core.js.gz +0 -0
  109. package/dist/web/public/styles.3b59b41d.css +1 -0
  110. package/dist/web/public/styles.3b59b41d.css.br +0 -0
  111. package/dist/web/public/styles.3b59b41d.css.gz +0 -0
  112. package/dist/web/public/subagent-windows.07277a58.js.gz +0 -0
  113. package/dist/web/public/sw.js +2 -2
  114. package/dist/web/public/sw.js.br +0 -0
  115. package/dist/web/public/sw.js.gz +0 -0
  116. package/dist/web/public/tab-layout-browser.2d6189f7.js.gz +0 -0
  117. package/dist/web/public/tab-rail-resize.7157e0bd.js.gz +0 -0
  118. package/dist/web/public/terminal-keycode229-recovery.af09f99a.js.gz +0 -0
  119. package/dist/web/public/terminal-split.js.gz +0 -0
  120. package/dist/web/public/terminal-tile.js +8 -1
  121. package/dist/web/public/terminal-tile.js.br +0 -0
  122. package/dist/web/public/terminal-tile.js.gz +0 -0
  123. package/dist/web/public/terminal-ui.fb2a27f5.js +2 -0
  124. package/dist/web/public/terminal-ui.fb2a27f5.js.br +0 -0
  125. package/dist/web/public/terminal-ui.fb2a27f5.js.gz +0 -0
  126. package/dist/web/public/tile-grid.js.gz +0 -0
  127. package/dist/web/public/ultracode-panel.js.gz +0 -0
  128. package/dist/web/public/ultracode-windows.js.gz +0 -0
  129. package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
  130. package/dist/web/public/vendor/exceljs.min.js.gz +0 -0
  131. package/dist/web/public/vendor/fflate.min.js.gz +0 -0
  132. package/dist/web/public/vendor/marked.min.js.gz +0 -0
  133. package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
  134. package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
  135. package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
  136. package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
  137. package/dist/web/public/vendor/xterm-predictive-echo.ae5e3d5d.js.gz +0 -0
  138. package/dist/web/public/vendor/xterm-zerolag-input.0b69623c.js.gz +0 -0
  139. package/dist/web/public/vendor/xterm.css.gz +0 -0
  140. package/dist/web/public/vendor/xterm.min.js.gz +0 -0
  141. package/dist/web/public/voice-input.2342c37b.js.gz +0 -0
  142. package/dist/web/public/voice-pcm-worklet.js.gz +0 -0
  143. package/dist/web/public/webview-tabs.js.gz +0 -0
  144. package/dist/web/public/whats-new.json +9 -9
  145. package/dist/web/route-helpers.d.ts +57 -6
  146. package/dist/web/route-helpers.d.ts.map +1 -1
  147. package/dist/web/route-helpers.js +72 -4
  148. package/dist/web/route-helpers.js.map +1 -1
  149. package/dist/web/routes/case-routes.d.ts.map +1 -1
  150. package/dist/web/routes/case-routes.js +183 -2
  151. package/dist/web/routes/case-routes.js.map +1 -1
  152. package/dist/web/routes/inbox-routes.d.ts +43 -0
  153. package/dist/web/routes/inbox-routes.d.ts.map +1 -0
  154. package/dist/web/routes/inbox-routes.js +148 -0
  155. package/dist/web/routes/inbox-routes.js.map +1 -0
  156. package/dist/web/routes/index.d.ts +1 -0
  157. package/dist/web/routes/index.d.ts.map +1 -1
  158. package/dist/web/routes/index.js +1 -0
  159. package/dist/web/routes/index.js.map +1 -1
  160. package/dist/web/routes/session-routes.d.ts.map +1 -1
  161. package/dist/web/routes/session-routes.js +25 -47
  162. package/dist/web/routes/session-routes.js.map +1 -1
  163. package/dist/web/routes/system-routes.d.ts.map +1 -1
  164. package/dist/web/routes/system-routes.js +23 -2
  165. package/dist/web/routes/system-routes.js.map +1 -1
  166. package/dist/web/schemas.d.ts +26 -0
  167. package/dist/web/schemas.d.ts.map +1 -1
  168. package/dist/web/schemas.js +48 -0
  169. package/dist/web/schemas.js.map +1 -1
  170. package/dist/web/sensitive-path.d.ts.map +1 -1
  171. package/dist/web/sensitive-path.js +2 -0
  172. package/dist/web/sensitive-path.js.map +1 -1
  173. package/dist/web/server.d.ts +2 -0
  174. package/dist/web/server.d.ts.map +1 -1
  175. package/dist/web/server.js +61 -3
  176. package/dist/web/server.js.map +1 -1
  177. package/dist/web/session-wait-registry.d.ts +48 -4
  178. package/dist/web/session-wait-registry.d.ts.map +1 -1
  179. package/dist/web/session-wait-registry.js +144 -6
  180. package/dist/web/session-wait-registry.js.map +1 -1
  181. package/dist/web/sse-events.d.ts +4 -1
  182. package/dist/web/sse-events.d.ts.map +1 -1
  183. package/dist/web/sse-events.js +4 -1
  184. package/dist/web/sse-events.js.map +1 -1
  185. package/package.json +1 -1
  186. package/skills/codeman/SKILL.md +7 -4
  187. package/skills/codeman/preamble.sh +3 -3
  188. package/skills/codeman/reference/endpoints.md +24 -3
  189. package/skills/codeman/reference/verbs.md +47 -0
  190. package/dist/web/public/app.9314ee60.js +0 -43
  191. package/dist/web/public/app.9314ee60.js.br +0 -0
  192. package/dist/web/public/app.9314ee60.js.gz +0 -0
  193. package/dist/web/public/constants.4866ecc3.js.br +0 -0
  194. package/dist/web/public/constants.4866ecc3.js.gz +0 -0
  195. package/dist/web/public/i18n.22ca902b.js +0 -2
  196. package/dist/web/public/i18n.22ca902b.js.br +0 -0
  197. package/dist/web/public/i18n.22ca902b.js.gz +0 -0
  198. package/dist/web/public/mobile-handlers.44adaa07.js.br +0 -0
  199. package/dist/web/public/mobile-handlers.44adaa07.js.gz +0 -0
  200. package/dist/web/public/panels-ui.cbb24ba1.js.br +0 -0
  201. package/dist/web/public/panels-ui.cbb24ba1.js.gz +0 -0
  202. package/dist/web/public/session-ui.9c1f009b.js.br +0 -0
  203. package/dist/web/public/session-ui.9c1f009b.js.gz +0 -0
  204. package/dist/web/public/settings-ui.fea9ddae.js.br +0 -0
  205. package/dist/web/public/settings-ui.fea9ddae.js.gz +0 -0
  206. package/dist/web/public/styles.e096fcd6.css +0 -1
  207. package/dist/web/public/styles.e096fcd6.css.br +0 -0
  208. package/dist/web/public/styles.e096fcd6.css.gz +0 -0
  209. package/dist/web/public/terminal-ui.68dbd352.js +0 -2
  210. package/dist/web/public/terminal-ui.68dbd352.js.br +0 -0
  211. package/dist/web/public/terminal-ui.68dbd352.js.gz +0 -0
@@ -3,6 +3,7 @@
3
3
  * Covers session CRUD, input/output, terminal buffer, quick-start, quick-run,
4
4
  * auto-clear, auto-compact, image watcher, flicker filter, and logout.
5
5
  */
6
+ import { claudeProjectDirName } from '../../case-rename.js';
6
7
  import { join, dirname, extname, basename, resolve as resolvePath } from 'node:path';
7
8
  import { homedir } from 'node:os';
8
9
  import { existsSync, statSync, mkdirSync, writeFileSync } from 'node:fs';
@@ -27,8 +28,9 @@ import { TabLayoutValidationError } from '../../tab-layout.js';
27
28
  import { sessionWaits, resolveWaitSignals, sessionHookOptions, signalForStatus, WaitCapacityError, } from '../session-wait-registry.js';
28
29
  import { RemoteWakeRegistry, REMOTE_WAKE_REQUEST_READY_TIMEOUT_MS, createDefaultRemoteWakeDeps, isProbeable, } from '../../remote-wake.js';
29
30
  import { clampWaitMs, MAX_BUFFER_SCAN_BYTES } from '../../config/agent-wait.js';
30
- import { autoConfigureRalph, canAccessOwned, CASES_DIR, findPersistedSessionOrFail, findSessionOrFail, getAuthUser, isAdmin, isPlainPromptInput, isWorkingDirAllowed, ownerFor, parseBody, persistAndBroadcastSession, readJsonConfig, resolveAgentCaseOrigin, resolveCasesDir, resolveParentSessionId, sessionCapacityMessage, SETTINGS_PATH, validatePathWithinBase, } from '../route-helpers.js';
31
+ import { autoConfigureRalph, canAccessOwned, CASES_DIR, findPersistedSessionOrFail, findSessionOrFail, getAuthUser, isAdmin, isPlainPromptInput, isWorkingDirAllowed, ownerFor, parseBody, persistAndBroadcastSession, readJsonConfig, resolveAgentCaseOrigin, resolveCasesDir, resolveParentSessionId, sessionCapacityMessage, SETTINGS_PATH, validatePathWithinBase, waitCapacityResponse, abortOnClientHangUp, } from '../route-helpers.js';
31
32
  import { buildAgentCaseMarker, writeAgentCaseMarker } from '../../agent-case-marker.js';
33
+ import { agentInbox } from '../agent-inbox.js';
32
34
  import { canUsernameRunPrivilegedCommands, resolveClaudeModeForUsername } from '../../user-store.js';
33
35
  import { clampEnvOverridesForOwner } from '../../session-env-clamp.js';
34
36
  import { enabledClis, getCli } from '../../config/cli-registry/registry.js';
@@ -548,22 +550,6 @@ function parseWaitQuery(schema, query, label) {
548
550
  body: createErrorResponse(ApiErrorCode.INVALID_INPUT, message),
549
551
  });
550
552
  }
551
- /**
552
- * Map a waiter-cap rejection to the code that tells the caller the truth.
553
- *
554
- * The two caps mean different things and warrant different recovery: `session` is
555
- * genuinely about THIS session, while `owner` and `total` are process-wide budgets
556
- * that say nothing about it. Reporting a global cap as `SESSION_BUSY` (409,
557
- * documented as "Session is busy") sent an agent off to a different session to hit
558
- * the identical error. `RATE_LIMITED` is the code whose whole meaning is "come back
559
- * later", and clients and proxies already treat 429 that way.
560
- */
561
- function waitCapacityResponse(err) {
562
- const code = err.scope === 'session' ? ApiErrorCode.SESSION_BUSY : ApiErrorCode.RATE_LIMITED;
563
- // The registry's message already names the scope and the limit; passing it through
564
- // verbatim keeps the wording in one place.
565
- return createErrorResponse(code, err.message);
566
- }
567
553
  /**
568
554
  * The signal a session is ALREADY emitting, corrected for liveness.
569
555
  *
@@ -730,34 +716,6 @@ export function _resetPaneLivenessState() {
730
716
  export function _paneDeathWatcherCount() {
731
717
  return paneDeathWatchers.size;
732
718
  }
733
- /**
734
- * An `AbortController` that fires when the CLIENT goes away, and only then.
735
- *
736
- * Freeing an abandoned waiter matters because the documented pattern is a loop of
737
- * short waits: `curl --max-time 30 ".../wait?timeout=600000"` abandons a live waiter
738
- * every iteration until the cap is hit and an innocent session reports busy. Same for
739
- * any proxy that cuts the connection.
740
- *
741
- * ⚠️ **It must listen on the RESPONSE, not the request.** `req.raw` emits `'close'`
742
- * as soon as the request body has finished streaming, which on a POST is BEFORE the
743
- * handler ever blocks — measured at +1ms with `aborted: false`, indistinguishable
744
- * from a real hang-up at +0ms. Wiring the abort there cancels every send-and-wait
745
- * instantly and silently kills the feature (it survives on GET only because a GET has
746
- * no body to finish). `reply.raw` emits `'close'` both when the response completes
747
- * and when the socket dies, and `writableFinished` is what tells those apart: true
748
- * only if the response actually went out. The guard is load-bearing, not defensive.
749
- *
750
- * `app.inject()` never emits `'close'` at all, so this is only observable over real
751
- * HTTP — which is why the regression test for it binds a port.
752
- */
753
- function abortOnClientHangUp(reply) {
754
- const controller = new AbortController();
755
- reply.raw.on('close', () => {
756
- if (!reply.raw.writableFinished)
757
- controller.abort();
758
- });
759
- return controller;
760
- }
761
719
  /**
762
720
  * Inject the agent skill into a case on create, surfacing only the REFUSALS.
763
721
  *
@@ -1403,6 +1361,9 @@ options = {}) {
1403
1361
  // below re-looks-up the record by id, so the returned SessionState is unused here.
1404
1362
  findPersistedSessionOrFail(ctx.store, id, req);
1405
1363
  ctx.store.demoteOrRemoveSession(id);
1364
+ // A detached session kept its agent inbox (server.ts _doCleanupSession drops it
1365
+ // only on killMux); retiring the row is the delete, so the mail goes now.
1366
+ agentInbox.drop(id);
1406
1367
  // Mirrors the broadcast at the tail of the live-session cleanup path
1407
1368
  // (_doCleanupSession in server.ts) — without it, other open tabs keep
1408
1369
  // showing the retired row until their next unrelated fetch.
@@ -4453,6 +4414,7 @@ options = {}) {
4453
4414
  if (!stat?.isDirectory())
4454
4415
  return out;
4455
4416
  const workingDir = await decodeProjectKey(projDir);
4417
+ const staleCwd = new Map();
4456
4418
  const entries = await fs.readdir(projPath).catch(() => []);
4457
4419
  for (const entry of entries) {
4458
4420
  if (!entry.endsWith('.jsonl'))
@@ -4554,13 +4516,29 @@ options = {}) {
4554
4516
  worktreeName: headGit.worktreeName ?? tailGit.worktreeName,
4555
4517
  worktreeRepo: headGit.worktreeRepo ?? tailGit.worktreeRepo,
4556
4518
  };
4519
+ // A case rename moves the project directory but leaves the old path in each transcript's
4520
+ // cwd. When that cwd is gone and the decoded key is a real folder that encodes back to this
4521
+ // very key (not the $HOME collapse of #265), the key is the truer answer.
4522
+ let cwd = git.cwd;
4523
+ if (cwd !== undefined && cwd !== workingDir) {
4524
+ let stale = staleCwd.get(cwd);
4525
+ if (stale === undefined) {
4526
+ stale =
4527
+ claudeProjectDirName(workingDir) === projDir &&
4528
+ (await fs.stat(cwd).then(() => false, () => true)) &&
4529
+ (await fs.stat(workingDir).then((s) => s.isDirectory(), () => false));
4530
+ staleCwd.set(cwd, stale);
4531
+ }
4532
+ if (stale)
4533
+ cwd = undefined;
4534
+ }
4557
4535
  out.push({
4558
4536
  sessionId,
4559
4537
  // The transcript's literal cwd beats decodeProjectKey's stat-walked guess,
4560
4538
  // which silently collapses to $HOME once the directory is gone (#265).
4561
4539
  // Absent cwd falls back to the old behaviour rather than inventing a path.
4562
- workingDir: git.cwd ?? workingDir,
4563
- workingDirExact: git.cwd !== undefined,
4540
+ workingDir: cwd ?? workingDir,
4541
+ workingDirExact: cwd !== undefined,
4564
4542
  projectKey: projDir,
4565
4543
  sizeBytes: fileStat.size,
4566
4544
  lastModified: fileStat.mtime.toISOString(),