@threadbase-sh/streamer 1.63.0 → 1.64.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 (296) hide show
  1. package/dist/agent/agent-client.d.ts +14 -0
  2. package/dist/agent/agent-client.d.ts.map +1 -0
  3. package/dist/agent/agent-config.d.ts +24 -0
  4. package/dist/agent/agent-config.d.ts.map +1 -0
  5. package/dist/agent/conversation-writer.d.ts +13 -0
  6. package/dist/agent/conversation-writer.d.ts.map +1 -0
  7. package/dist/agent/dedupe.d.ts +6 -0
  8. package/dist/agent/dedupe.d.ts.map +1 -0
  9. package/dist/agent/errors.d.ts +23 -0
  10. package/dist/agent/errors.d.ts.map +1 -0
  11. package/dist/agent/handle-send-agent-input.d.ts +21 -0
  12. package/dist/agent/handle-send-agent-input.d.ts.map +1 -0
  13. package/dist/agent/handle-start-agent-session.d.ts +21 -0
  14. package/dist/agent/handle-start-agent-session.d.ts.map +1 -0
  15. package/dist/agent/history-mapper.d.ts +4 -0
  16. package/dist/agent/history-mapper.d.ts.map +1 -0
  17. package/dist/agent/payload-guard.d.ts +29 -0
  18. package/dist/agent/payload-guard.d.ts.map +1 -0
  19. package/dist/api/app.d.ts +28 -0
  20. package/dist/api/app.d.ts.map +1 -0
  21. package/dist/api/handlers/conversations.handlers.d.ts +69 -0
  22. package/dist/api/handlers/conversations.handlers.d.ts.map +1 -0
  23. package/dist/api/handlers/http-helpers.d.ts +50 -0
  24. package/dist/api/handlers/http-helpers.d.ts.map +1 -0
  25. package/dist/api/handlers/sessions.handlers.d.ts +230 -0
  26. package/dist/api/handlers/sessions.handlers.d.ts.map +1 -0
  27. package/dist/api/middleware/auth.middleware.d.ts +5 -0
  28. package/dist/api/middleware/auth.middleware.d.ts.map +1 -0
  29. package/dist/api/middleware/cors.middleware.d.ts +5 -0
  30. package/dist/api/middleware/cors.middleware.d.ts.map +1 -0
  31. package/dist/api/middleware/error.middleware.d.ts +4 -0
  32. package/dist/api/middleware/error.middleware.d.ts.map +1 -0
  33. package/dist/api/routes/backup.routes.d.ts +5 -0
  34. package/dist/api/routes/backup.routes.d.ts.map +1 -0
  35. package/dist/api/routes/browse.routes.d.ts +5 -0
  36. package/dist/api/routes/browse.routes.d.ts.map +1 -0
  37. package/dist/api/routes/cacheAlert.routes.d.ts +5 -0
  38. package/dist/api/routes/cacheAlert.routes.d.ts.map +1 -0
  39. package/dist/api/routes/config.routes.d.ts +5 -0
  40. package/dist/api/routes/config.routes.d.ts.map +1 -0
  41. package/dist/api/routes/conversations.routes.d.ts +5 -0
  42. package/dist/api/routes/conversations.routes.d.ts.map +1 -0
  43. package/dist/api/routes/devices.routes.d.ts +17 -0
  44. package/dist/api/routes/devices.routes.d.ts.map +1 -0
  45. package/dist/api/routes/diagnostics.routes.d.ts +5 -0
  46. package/dist/api/routes/diagnostics.routes.d.ts.map +1 -0
  47. package/dist/api/routes/health.routes.d.ts +5 -0
  48. package/dist/api/routes/health.routes.d.ts.map +1 -0
  49. package/dist/api/routes/logs.routes.d.ts +3 -0
  50. package/dist/api/routes/logs.routes.d.ts.map +1 -0
  51. package/dist/api/routes/misc.routes.d.ts +77 -0
  52. package/dist/api/routes/misc.routes.d.ts.map +1 -0
  53. package/dist/api/routes/pair.routes.d.ts +5 -0
  54. package/dist/api/routes/pair.routes.d.ts.map +1 -0
  55. package/dist/api/routes/progress.routes.d.ts +39 -0
  56. package/dist/api/routes/progress.routes.d.ts.map +1 -0
  57. package/dist/api/routes/projects.routes.d.ts +5 -0
  58. package/dist/api/routes/projects.routes.d.ts.map +1 -0
  59. package/dist/api/routes/providers.routes.d.ts +19 -0
  60. package/dist/api/routes/providers.routes.d.ts.map +1 -0
  61. package/dist/api/routes/scanner.routes.d.ts +5 -0
  62. package/dist/api/routes/scanner.routes.d.ts.map +1 -0
  63. package/dist/api/routes/sessions.routes.d.ts +6 -0
  64. package/dist/api/routes/sessions.routes.d.ts.map +1 -0
  65. package/dist/api/routes/ws.routes.d.ts +7 -0
  66. package/dist/api/routes/ws.routes.d.ts.map +1 -0
  67. package/dist/api/types/api-deps.d.ts +114 -0
  68. package/dist/api/types/api-deps.d.ts.map +1 -0
  69. package/dist/auth.d.ts +81 -0
  70. package/dist/auth.d.ts.map +1 -0
  71. package/dist/browse.d.ts +17 -0
  72. package/dist/browse.d.ts.map +1 -0
  73. package/dist/claude-flags.d.ts +76 -0
  74. package/dist/claude-flags.d.ts.map +1 -0
  75. package/dist/cli.cjs +20 -5
  76. package/dist/cli.cjs.map +1 -1
  77. package/dist/codex-pty-runner.d.ts +90 -0
  78. package/dist/codex-pty-runner.d.ts.map +1 -0
  79. package/dist/config/update-config.d.ts +13 -0
  80. package/dist/config/update-config.d.ts.map +1 -0
  81. package/dist/conversation-cache.d.ts +336 -0
  82. package/dist/conversation-cache.d.ts.map +1 -0
  83. package/dist/db/config.d.ts +11 -0
  84. package/dist/db/config.d.ts.map +1 -0
  85. package/dist/db/index.d.ts +5 -0
  86. package/dist/db/index.d.ts.map +1 -0
  87. package/dist/db/migrations.d.ts +3 -0
  88. package/dist/db/migrations.d.ts.map +1 -0
  89. package/dist/db/pool.d.ts +5 -0
  90. package/dist/db/pool.d.ts.map +1 -0
  91. package/dist/db/query-timing.d.ts +52 -0
  92. package/dist/db/query-timing.d.ts.map +1 -0
  93. package/dist/db/repositories/cacheMetadata.repository.d.ts +12 -0
  94. package/dist/db/repositories/cacheMetadata.repository.d.ts.map +1 -0
  95. package/dist/db/repositories/conversations.repository.d.ts +27 -0
  96. package/dist/db/repositories/conversations.repository.d.ts.map +1 -0
  97. package/dist/db/repositories/devices.repository.d.ts +137 -0
  98. package/dist/db/repositories/devices.repository.d.ts.map +1 -0
  99. package/dist/db/repositories/managed-sessions.repository.d.ts +127 -0
  100. package/dist/db/repositories/managed-sessions.repository.d.ts.map +1 -0
  101. package/dist/db/repositories/projects.repository.d.ts +28 -0
  102. package/dist/db/repositories/projects.repository.d.ts.map +1 -0
  103. package/dist/db/repositories/push.repository.d.ts +186 -0
  104. package/dist/db/repositories/push.repository.d.ts.map +1 -0
  105. package/dist/db/repositories/sessions.repository.d.ts +16 -0
  106. package/dist/db/repositories/sessions.repository.d.ts.map +1 -0
  107. package/dist/db/runtime-store.d.ts +80 -0
  108. package/dist/db/runtime-store.d.ts.map +1 -0
  109. package/dist/db/sqlite-migrate.d.ts +13 -0
  110. package/dist/db/sqlite-migrate.d.ts.map +1 -0
  111. package/dist/db/upload-records.d.ts +11 -0
  112. package/dist/db/upload-records.d.ts.map +1 -0
  113. package/dist/e2ee/noise.d.ts +261 -0
  114. package/dist/e2ee/noise.d.ts.map +1 -0
  115. package/dist/e2ee/pair-payload.d.ts +60 -0
  116. package/dist/e2ee/pair-payload.d.ts.map +1 -0
  117. package/dist/e2ee/pair-request.d.ts +24 -0
  118. package/dist/e2ee/pair-request.d.ts.map +1 -0
  119. package/dist/external-tails.d.ts +91 -0
  120. package/dist/external-tails.d.ts.map +1 -0
  121. package/dist/feature-flags.d.ts +212 -0
  122. package/dist/feature-flags.d.ts.map +1 -0
  123. package/dist/handlers/handleListProjects.d.ts +3 -0
  124. package/dist/handlers/handleListProjects.d.ts.map +1 -0
  125. package/dist/index.d.ts +18 -2571
  126. package/dist/index.d.ts.map +1 -0
  127. package/dist/lifecycle/constants.d.ts +21 -0
  128. package/dist/lifecycle/constants.d.ts.map +1 -0
  129. package/dist/lifecycle/process-liveness.d.ts +7 -0
  130. package/dist/lifecycle/process-liveness.d.ts.map +1 -0
  131. package/dist/live-session-manager.d.ts +59 -0
  132. package/dist/live-session-manager.d.ts.map +1 -0
  133. package/dist/logger.d.ts +14 -0
  134. package/dist/logger.d.ts.map +1 -0
  135. package/dist/pair-store.d.ts +60 -0
  136. package/dist/pair-store.d.ts.map +1 -0
  137. package/dist/platform.d.ts +25 -0
  138. package/dist/platform.d.ts.map +1 -0
  139. package/dist/process-discovery.d.ts +35 -0
  140. package/dist/process-discovery.d.ts.map +1 -0
  141. package/dist/providers.d.ts +7 -0
  142. package/dist/providers.d.ts.map +1 -0
  143. package/dist/pty-host/protocol.d.ts +270 -0
  144. package/dist/pty-host/protocol.d.ts.map +1 -0
  145. package/dist/pty-host/remote-session-runner.d.ts +133 -0
  146. package/dist/pty-host/remote-session-runner.d.ts.map +1 -0
  147. package/dist/pty-host/socket.d.ts +54 -0
  148. package/dist/pty-host/socket.d.ts.map +1 -0
  149. package/dist/pty-host/spawn-host.d.ts +30 -0
  150. package/dist/pty-host/spawn-host.d.ts.map +1 -0
  151. package/dist/pty-manager.d.ts +65 -0
  152. package/dist/pty-manager.d.ts.map +1 -0
  153. package/dist/pty-shared.d.ts +27 -0
  154. package/dist/pty-shared.d.ts.map +1 -0
  155. package/dist/scanner-manager.d.ts +126 -0
  156. package/dist/scanner-manager.d.ts.map +1 -0
  157. package/dist/schemas/cacheAlert.schema.d.ts +14 -0
  158. package/dist/schemas/cacheAlert.schema.d.ts.map +1 -0
  159. package/dist/schemas/claudeFlags.schema.d.ts +7 -0
  160. package/dist/schemas/claudeFlags.schema.d.ts.map +1 -0
  161. package/dist/schemas/project.schema.d.ts +18 -0
  162. package/dist/schemas/project.schema.d.ts.map +1 -0
  163. package/dist/schemas/updateConfig.schema.d.ts +19 -0
  164. package/dist/schemas/updateConfig.schema.d.ts.map +1 -0
  165. package/dist/seal.d.ts +14 -0
  166. package/dist/seal.d.ts.map +1 -0
  167. package/dist/server-identity.d.ts +43 -0
  168. package/dist/server-identity.d.ts.map +1 -0
  169. package/dist/server-wiring.d.ts +184 -0
  170. package/dist/server-wiring.d.ts.map +1 -0
  171. package/dist/server.d.ts +390 -0
  172. package/dist/server.d.ts.map +1 -0
  173. package/dist/services/backup/backup.d.ts +103 -0
  174. package/dist/services/backup/backup.d.ts.map +1 -0
  175. package/dist/services/cache/cacheMetadata.d.ts +8 -0
  176. package/dist/services/cache/cacheMetadata.d.ts.map +1 -0
  177. package/dist/services/cache-integrity/alertStore.d.ts +24 -0
  178. package/dist/services/cache-integrity/alertStore.d.ts.map +1 -0
  179. package/dist/services/cache-integrity/backup.d.ts +8 -0
  180. package/dist/services/cache-integrity/backup.d.ts.map +1 -0
  181. package/dist/services/cache-integrity/cacheIntegrityMonitor.d.ts +71 -0
  182. package/dist/services/cache-integrity/cacheIntegrityMonitor.d.ts.map +1 -0
  183. package/dist/services/conversations/conversationWatcher.d.ts +99 -0
  184. package/dist/services/conversations/conversationWatcher.d.ts.map +1 -0
  185. package/dist/services/conversations/findSearchTarget.d.ts +30 -0
  186. package/dist/services/conversations/findSearchTarget.d.ts.map +1 -0
  187. package/dist/services/conversations/isAgentConversation.d.ts +8 -0
  188. package/dist/services/conversations/isAgentConversation.d.ts.map +1 -0
  189. package/dist/services/conversations/pruneAgentConversations.d.ts +8 -0
  190. package/dist/services/conversations/pruneAgentConversations.d.ts.map +1 -0
  191. package/dist/services/conversations/refreshConversationCache.d.ts +27 -0
  192. package/dist/services/conversations/refreshConversationCache.d.ts.map +1 -0
  193. package/dist/services/conversations/shouldRefreshProjectsFromHdd.d.ts +33 -0
  194. package/dist/services/conversations/shouldRefreshProjectsFromHdd.d.ts.map +1 -0
  195. package/dist/services/diagnostics/diagnostics.d.ts +66 -0
  196. package/dist/services/diagnostics/diagnostics.d.ts.map +1 -0
  197. package/dist/services/projectChats/deriveProjectChatTitle.d.ts +15 -0
  198. package/dist/services/projectChats/deriveProjectChatTitle.d.ts.map +1 -0
  199. package/dist/services/projects/ensureProjectsForConversations.d.ts +15 -0
  200. package/dist/services/projects/ensureProjectsForConversations.d.ts.map +1 -0
  201. package/dist/services/providers/capabilities.d.ts +105 -0
  202. package/dist/services/providers/capabilities.d.ts.map +1 -0
  203. package/dist/services/providers/providerHealth.d.ts +72 -0
  204. package/dist/services/providers/providerHealth.d.ts.map +1 -0
  205. package/dist/services/push/apnsClient.d.ts +105 -0
  206. package/dist/services/push/apnsClient.d.ts.map +1 -0
  207. package/dist/services/push/expoPushSender.d.ts +37 -0
  208. package/dist/services/push/expoPushSender.d.ts.map +1 -0
  209. package/dist/services/push/liveActivityContentState.d.ts +60 -0
  210. package/dist/services/push/liveActivityContentState.d.ts.map +1 -0
  211. package/dist/services/push/liveActivityNotifier.d.ts +49 -0
  212. package/dist/services/push/liveActivityNotifier.d.ts.map +1 -0
  213. package/dist/services/push/liveActivityRenewal.d.ts +63 -0
  214. package/dist/services/push/liveActivityRenewal.d.ts.map +1 -0
  215. package/dist/services/push/liveActivitySender.d.ts +88 -0
  216. package/dist/services/push/liveActivitySender.d.ts.map +1 -0
  217. package/dist/services/push/waitingInputNotifier.d.ts +41 -0
  218. package/dist/services/push/waitingInputNotifier.d.ts.map +1 -0
  219. package/dist/services/questions/answersToKeystrokes.d.ts +8 -0
  220. package/dist/services/questions/answersToKeystrokes.d.ts.map +1 -0
  221. package/dist/services/questions/codexGateAnswers.d.ts +14 -0
  222. package/dist/services/questions/codexGateAnswers.d.ts.map +1 -0
  223. package/dist/services/questions/codexScreen.d.ts +74 -0
  224. package/dist/services/questions/codexScreen.d.ts.map +1 -0
  225. package/dist/services/questions/detectAskUserQuestion.d.ts +6 -0
  226. package/dist/services/questions/detectAskUserQuestion.d.ts.map +1 -0
  227. package/dist/services/questions/detectPermissionGate.d.ts +62 -0
  228. package/dist/services/questions/detectPermissionGate.d.ts.map +1 -0
  229. package/dist/services/questions/detectQuestionFromScreen.d.ts +30 -0
  230. package/dist/services/questions/detectQuestionFromScreen.d.ts.map +1 -0
  231. package/dist/services/questions/detectShellPrompt.d.ts +18 -0
  232. package/dist/services/questions/detectShellPrompt.d.ts.map +1 -0
  233. package/dist/services/questions/parseAgentPhase.d.ts +12 -0
  234. package/dist/services/questions/parseAgentPhase.d.ts.map +1 -0
  235. package/dist/services/questions/parseStatusLine.d.ts +19 -0
  236. package/dist/services/questions/parseStatusLine.d.ts.map +1 -0
  237. package/dist/services/questions/questionBroadcast.d.ts +18 -0
  238. package/dist/services/questions/questionBroadcast.d.ts.map +1 -0
  239. package/dist/services/questions/resolveAnswer.d.ts +16 -0
  240. package/dist/services/questions/resolveAnswer.d.ts.map +1 -0
  241. package/dist/services/search/searchQuery.d.ts +78 -0
  242. package/dist/services/search/searchQuery.d.ts.map +1 -0
  243. package/dist/services/security/capabilities.d.ts +50 -0
  244. package/dist/services/security/capabilities.d.ts.map +1 -0
  245. package/dist/services/sessions/autoResumeOnBoot.d.ts +28 -0
  246. package/dist/services/sessions/autoResumeOnBoot.d.ts.map +1 -0
  247. package/dist/services/sessions/codexRolloutOwner.d.ts +55 -0
  248. package/dist/services/sessions/codexRolloutOwner.d.ts.map +1 -0
  249. package/dist/services/sessions/conversationBusy.d.ts +32 -0
  250. package/dist/services/sessions/conversationBusy.d.ts.map +1 -0
  251. package/dist/services/sessions/idempotency.d.ts +67 -0
  252. package/dist/services/sessions/idempotency.d.ts.map +1 -0
  253. package/dist/services/sessions/reconcileSessions.d.ts +63 -0
  254. package/dist/services/sessions/reconcileSessions.d.ts.map +1 -0
  255. package/dist/services/sessions/rehydrateSessions.d.ts +68 -0
  256. package/dist/services/sessions/rehydrateSessions.d.ts.map +1 -0
  257. package/dist/services/sessions/resumeIdentity.d.ts +16 -0
  258. package/dist/services/sessions/resumeIdentity.d.ts.map +1 -0
  259. package/dist/session-registry-boot.d.ts +142 -0
  260. package/dist/session-registry-boot.d.ts.map +1 -0
  261. package/dist/session-store.d.ts +32 -0
  262. package/dist/session-store.d.ts.map +1 -0
  263. package/dist/session-watchers.d.ts +60 -0
  264. package/dist/session-watchers.d.ts.map +1 -0
  265. package/dist/types.d.ts +616 -0
  266. package/dist/types.d.ts.map +1 -0
  267. package/dist/uploads.d.ts +16 -0
  268. package/dist/uploads.d.ts.map +1 -0
  269. package/dist/utils/bootToken.d.ts +3 -0
  270. package/dist/utils/bootToken.d.ts.map +1 -0
  271. package/dist/utils/canonicalizeFilePath.d.ts +75 -0
  272. package/dist/utils/canonicalizeFilePath.d.ts.map +1 -0
  273. package/dist/utils/canonicalizeProjectPath.d.ts +13 -0
  274. package/dist/utils/canonicalizeProjectPath.d.ts.map +1 -0
  275. package/dist/utils/codexConversationLine.d.ts +38 -0
  276. package/dist/utils/codexConversationLine.d.ts.map +1 -0
  277. package/dist/utils/conversationEtag.d.ts +19 -0
  278. package/dist/utils/conversationEtag.d.ts.map +1 -0
  279. package/dist/utils/dates.d.ts +12 -0
  280. package/dist/utils/dates.d.ts.map +1 -0
  281. package/dist/utils/debounce.d.ts +15 -0
  282. package/dist/utils/debounce.d.ts.map +1 -0
  283. package/dist/utils/deriveSessionName.d.ts +10 -0
  284. package/dist/utils/deriveSessionName.d.ts.map +1 -0
  285. package/dist/utils/fileIdentity.d.ts +36 -0
  286. package/dist/utils/fileIdentity.d.ts.map +1 -0
  287. package/dist/utils/isScannedSnapshotStale.d.ts +16 -0
  288. package/dist/utils/isScannedSnapshotStale.d.ts.map +1 -0
  289. package/dist/utils/scanProgressThrottle.d.ts +12 -0
  290. package/dist/utils/scanProgressThrottle.d.ts.map +1 -0
  291. package/dist/version.d.ts +3 -0
  292. package/dist/version.d.ts.map +1 -0
  293. package/dist/ws-hub.d.ts +15 -0
  294. package/dist/ws-hub.d.ts.map +1 -0
  295. package/package.json +3 -4
  296. package/dist/index.d.cts +0 -2571
@@ -0,0 +1,184 @@
1
+ import type { EventEmitter } from "events";
2
+ import type { IncomingMessage, ServerResponse } from "http";
3
+ import type { WebSocket } from "ws";
4
+ import type { AgentClient } from "./agent/agent-client";
5
+ import type { AgentConfig } from "./agent/agent-config";
6
+ import type { ConversationWriter } from "./agent/conversation-writer";
7
+ import type { ConversationHandlers } from "./api/handlers/conversations.handlers";
8
+ import type { SessionHandlers } from "./api/handlers/sessions.handlers";
9
+ import type { ApiDeps } from "./api/types/api-deps";
10
+ import { ConversationCache } from "./conversation-cache";
11
+ import type { CacheMetadataRepository } from "./db/repositories/cacheMetadata.repository";
12
+ import type { ConversationsRepository } from "./db/repositories/conversations.repository";
13
+ import type { DevicesRepository } from "./db/repositories/devices.repository";
14
+ import type { ManagedSessionsRepository } from "./db/repositories/managed-sessions.repository";
15
+ import type { ProjectsRepository } from "./db/repositories/projects.repository";
16
+ import type { PushRepository } from "./db/repositories/push.repository";
17
+ import type { SessionsRepository } from "./db/repositories/sessions.repository";
18
+ import type { RuntimeStore } from "./db/runtime-store";
19
+ import type { ExternalTailManager } from "./external-tails";
20
+ import type { LiveSessionManager } from "./live-session-manager";
21
+ import { type Logger } from "./logger";
22
+ import type { ScannerManager } from "./scanner-manager";
23
+ import type { CacheIntegrityMonitor } from "./services/cache-integrity/cacheIntegrityMonitor";
24
+ import type { ConversationWatcher, ConversationWatcherEvents } from "./services/conversations/conversationWatcher";
25
+ import type { LiveActivityNotifier } from "./services/push/liveActivityNotifier";
26
+ import type { WaitingInputNotifier } from "./services/push/waitingInputNotifier";
27
+ import type { ReconcileVerdict } from "./services/sessions/reconcileSessions";
28
+ import type { SessionStore } from "./session-store";
29
+ import type { AskQuestion, PermissionOption, PTYManagerOptions, ServerWarmupState, SessionResponse } from "./types";
30
+ import type { WSHub } from "./ws-hub";
31
+ /** The permission gate currently open for a session (scraped via OSC 777). */
32
+ export type PendingPermission = {
33
+ prompt?: string;
34
+ detail?: string;
35
+ options: PermissionOption[];
36
+ cursor?: number;
37
+ };
38
+ /** The AskUserQuestion card currently broadcast for a session. */
39
+ export type PendingQuestion = {
40
+ toolUseId: string;
41
+ questions: AskQuestion[];
42
+ origin: "pty" | "jsonl";
43
+ };
44
+ /**
45
+ * Everything the ConversationWatcher callbacks read from the server. Thunks
46
+ * rather than values for anything constructed after the watcher itself
47
+ * (`externalTailManager`, and `fileWatcher` — which IS the watcher these
48
+ * callbacks are handed to) or swapped on the instance by tests (`log`,
49
+ * `broadcastConversationLines`); the same reason ScannerManagerDeps passes
50
+ * `cache: () => ConversationCache | null`.
51
+ *
52
+ * The Maps are the server's own, held by reference: they stay StreamerServer
53
+ * state and are read directly elsewhere in server.ts.
54
+ */
55
+ export type ConversationWatcherWiringDeps = {
56
+ sessionFileMap: Map<string, string>;
57
+ pendingLineSeqs: Map<string, (number | null)[]>;
58
+ scannerManager: ScannerManager;
59
+ cache: () => ConversationCache | null;
60
+ log: () => Logger;
61
+ fileWatcher: () => ConversationWatcher;
62
+ externalTailManager: () => ExternalTailManager;
63
+ trackCacheWrite: (task: Promise<unknown>) => void;
64
+ processJsonlQuestions: (sessionId: string, lines: string[]) => void;
65
+ broadcastConversationLines: (sessionId: string, lines: string[], seqs?: (number | null)[] | null) => void;
66
+ };
67
+ /**
68
+ * The JSONL tail/offset-index/directory callbacks StreamerServer hands to its
69
+ * ConversationWatcher.
70
+ *
71
+ * Extracted from the constructor so watcher work stops editing the server file
72
+ * (see docs/plans/2026-07-12-server-ts-split.md, PR 7). State stays on the
73
+ * server: these callbacks only reach it through `deps`.
74
+ */
75
+ export declare function createConversationWatcherEvents(deps: ConversationWatcherWiringDeps): ConversationWatcherEvents;
76
+ /**
77
+ * Everything the LiveSessionManager callbacks read from the server. Same thunk
78
+ * discipline: `sessionHandlers` is constructed after the runner, the repos and
79
+ * notifiers are bound during listen(), and `log` is swapped by tests.
80
+ */
81
+ export type LiveSessionWiringDeps = {
82
+ sessionStore: SessionStore;
83
+ wsHub: WSHub;
84
+ fileWatcher: ConversationWatcher;
85
+ scannerManager: ScannerManager;
86
+ sessionStatusBus: EventEmitter;
87
+ sessionFileMap: Map<string, string>;
88
+ sessionSubscribers: Map<string, Set<WebSocket>>;
89
+ lastAgentChunkAt: Map<string, number>;
90
+ terminalSeq: Map<string, number>;
91
+ pendingQuestions: Map<string, PendingQuestion>;
92
+ pendingQuestionKey: Map<string, string>;
93
+ pendingPermission: Map<string, PendingPermission>;
94
+ pendingPermissionKey: Map<string, string>;
95
+ contendedSessions: Set<string>;
96
+ log: () => Logger;
97
+ sessionHandlers: () => SessionHandlers;
98
+ managedSessionsRepo: () => ManagedSessionsRepository | null;
99
+ liveActivityNotifier: () => LiveActivityNotifier | null;
100
+ waitingInputNotifier: () => WaitingInputNotifier | null;
101
+ ptyAttachedIds: () => Set<string>;
102
+ cancelPendingQuestion: (sessionId: string) => void;
103
+ rememberSelfPtyEnded: (conversationId: string) => void;
104
+ };
105
+ /**
106
+ * The options StreamerServer hands to its LiveSessionManager: terminal/user
107
+ * output fan-out, gate and question plumbing, and the status funnel that
108
+ * mirrors every transition into SessionStore, the durable registry, the
109
+ * scanner index and the push notifiers.
110
+ *
111
+ * Extracted from the constructor for the same reason as the watcher events
112
+ * above; the server keeps every Map and Set these callbacks mutate.
113
+ */
114
+ export declare function createLiveSessionOptions(deps: LiveSessionWiringDeps): PTYManagerOptions;
115
+ /**
116
+ * Everything the ApiDeps assembly reads from the server.
117
+ *
118
+ * Values where the original literal captured a value (`publicUrl`,
119
+ * `browseRoot`, and the collaborators built earlier in the constructor);
120
+ * thunks and arrows everywhere the original used them, which is load-bearing:
121
+ * the stores open during listen(), `apiKey` changes under rotateApiKey(), and
122
+ * tests swap `log`/`startGraceTimer`/`broadcastConversationLines` on the
123
+ * server instance after construction.
124
+ */
125
+ export type ApiDepsWiring = {
126
+ apiKey: () => string;
127
+ localNoAuth: boolean;
128
+ logMenubarRequests: boolean;
129
+ publicUrl: string | null;
130
+ browseRoot: string | null;
131
+ browserCors: string | undefined;
132
+ ptyGracePeriodMs: number;
133
+ rotateApiKey: ApiDeps["rotateApiKey"];
134
+ claudeFlagsConfig: ApiDeps["claudeFlagsConfig"];
135
+ featureFlagsConfig: ApiDeps["featureFlagsConfig"];
136
+ setClaudeFlagsConfig: ApiDeps["setClaudeFlagsConfig"];
137
+ ptyManager: LiveSessionManager;
138
+ sessionStore: SessionStore;
139
+ wsHub: WSHub;
140
+ sessionHandlers: SessionHandlers;
141
+ conversationHandlers: ConversationHandlers;
142
+ cache: () => ConversationCache | null;
143
+ cacheMonitor: () => CacheIntegrityMonitor | null;
144
+ pushRepo: () => PushRepository | null;
145
+ liveActivityPushEnabled: () => boolean;
146
+ devicesRepo: () => DevicesRepository | null;
147
+ projectsRepo: () => ProjectsRepository | null;
148
+ conversationsRepo: () => ConversationsRepository | null;
149
+ sessionsRepo: () => SessionsRepository | null;
150
+ cacheMetadataRepo: () => CacheMetadataRepository | null;
151
+ runtimeStore: () => RuntimeStore | null;
152
+ managedSessionsRepo: () => ManagedSessionsRepository | null;
153
+ sessionVerdicts: () => Map<string, ReconcileVerdict>;
154
+ log: () => Logger;
155
+ ptyAttachedIds: () => Set<string>;
156
+ withReconciledLifecycle: (sessions: readonly SessionResponse[]) => readonly SessionResponse[];
157
+ currentWarmupState: () => ServerWarmupState | null;
158
+ addSessionSubscriber: (sessionId: string, ws: WebSocket) => void;
159
+ startGraceTimer: (sessionId: string, delayMs: number) => void;
160
+ handleSessionsCount: (res: ServerResponse) => void;
161
+ applyLiveSessionSetting: (sessionId: string, req: IncomingMessage, res: ServerResponse, setting: "model" | "effort") => Promise<void>;
162
+ handlePairStart: (res: ServerResponse) => void;
163
+ handlePairExchange: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
164
+ handleBrowse: (url: URL, res: ServerResponse) => Promise<void>;
165
+ handleMkdir: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
166
+ clientIdToWs: Map<string, WebSocket>;
167
+ wsToClientId: Map<WebSocket, string>;
168
+ sessionSubscribers: Map<string, Set<WebSocket>>;
169
+ terminalSeq: Map<string, number>;
170
+ pendingPermission: Map<string, PendingPermission>;
171
+ pendingQuestions: Map<string, PendingQuestion>;
172
+ agentClient: AgentClient | null;
173
+ conversationWriter: ConversationWriter | null;
174
+ agentConfig: AgentConfig;
175
+ };
176
+ /**
177
+ * Assemble the dependency bag the Hono app and the WS routes are built from,
178
+ * including the three WebSocket lifecycle handlers.
179
+ *
180
+ * Extracted from the constructor for the same reason as the two factories
181
+ * above; every key, its order and its target are unchanged.
182
+ */
183
+ export declare function createApiDeps(deps: ApiDepsWiring): ApiDeps;
184
+ //# sourceMappingURL=server-wiring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-wiring.d.ts","sourceRoot":"","sources":["../src/server-wiring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY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E,OAAO,GAAG,QAAQ,KACxB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,eAAe,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,CAAC;IAC/C,kBAAkB,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjF,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,WAAW,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACrC,YAAY,EAAE,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACrC,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;IAChD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAClD,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC/C,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,kBAAkB,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC9C,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAkN1D"}
@@ -0,0 +1,390 @@
1
+ import type { CodexOwnerSource } from "./services/sessions/codexRolloutOwner";
2
+ import { type BusySignal } from "./services/sessions/conversationBusy";
3
+ import type { ManagedSession, ServerConfig, SessionResponse } from "./types";
4
+ export declare const GRACE_MAX_DEFERS = 4;
5
+ export declare const IDLE_REAP_AFTER_MS: number;
6
+ export declare const IDLE_REAP_SWEEP_MS: number;
7
+ export { ADOPT_KILL_TIMEOUT_MS, RESUME_DISCOVERY_TIMEOUT_MS, waitForProcessExit, } from "./api/handlers/sessions.handlers";
8
+ export { EXTERNAL_ACTIVE_WRITING_MS, EXTERNAL_TAIL_IDLE_MS, EXTERNAL_TAIL_MAX, EXTERNAL_TAIL_RECENCY_MS, } from "./external-tails";
9
+ export declare function parseIncludeAgentsEnv(raw: string | undefined): boolean;
10
+ /**
11
+ * Why a resume did not happen, in the vocabulary of the thing that failed
12
+ * rather than of HTTP (plan Phase 7c).
13
+ *
14
+ * `resumeSession` has two callers with nothing in common at the response layer:
15
+ * one writes a status code, the other writes a log line. Neither can be the
16
+ * owner of these distinctions, so they live here.
17
+ */
18
+ export type ResumeFailure = {
19
+ ok: false;
20
+ reason: "history_file_missing";
21
+ } | {
22
+ ok: false;
23
+ reason: "no_project_path";
24
+ } | {
25
+ ok: false;
26
+ reason: "conversation_busy";
27
+ /** Which signals fired — carried verbatim so the 409 body is unchanged. */
28
+ detectedBy: BusySignal[];
29
+ lastActivityMs: number | null;
30
+ likelyOwner: "external" | "unknown";
31
+ }
32
+ /**
33
+ * Codex's own single-writer lock said no — either an open handle on the exact
34
+ * rollout (pre-flight) or the `-32600` error Codex printed after spawn.
35
+ *
36
+ * Separate from `conversation_busy` because the two are not the same claim:
37
+ * that one is a heuristic a caller may override with `force`, this one is the
38
+ * provider refusing, which no flag of ours can bypass.
39
+ */
40
+ | {
41
+ ok: false;
42
+ reason: "codex_session_active";
43
+ detectedBy: BusySignal[];
44
+ lastActivityMs: number | null;
45
+ ownerPid?: number;
46
+ ownerSource?: CodexOwnerSource;
47
+ }
48
+ /** Codex exited or errored during startup for some other reason. */
49
+ | {
50
+ ok: false;
51
+ reason: "codex_start_failed";
52
+ failureReason: string;
53
+ };
54
+ export type ResumeOutcome = ResumeFailure | {
55
+ ok: true;
56
+ /** The session was already live here — nothing was spawned. */
57
+ alreadyRunning: true;
58
+ session: null;
59
+ response: SessionResponse;
60
+ } | {
61
+ ok: true;
62
+ alreadyRunning: false;
63
+ session: ManagedSession;
64
+ /** Null only if the store lost the session between spawn and read. */
65
+ response: SessionResponse | null;
66
+ };
67
+ export declare class StreamerServer {
68
+ private httpServer;
69
+ private ptyManager;
70
+ private sessionStore;
71
+ private wsHub;
72
+ private fileWatcher;
73
+ private sessionFileMap;
74
+ private externalTails;
75
+ private externalTailManager;
76
+ private pendingLineSeqs;
77
+ private pendingQuestions;
78
+ private contendedSessions;
79
+ private selfPtyEndedAt;
80
+ private pendingQuestionKey;
81
+ private pendingPermission;
82
+ private pendingPermissionKey;
83
+ private scannerManager;
84
+ private sessionWatchers;
85
+ private registryBoot;
86
+ private conversationHandlers;
87
+ private sessionHandlers;
88
+ private binding;
89
+ private activeWarmups;
90
+ private nextWarmupId;
91
+ private inFlightCacheWrites;
92
+ private apiKey;
93
+ private apiKeySource;
94
+ private localNoAuth;
95
+ private logMenubarRequests;
96
+ private verbose;
97
+ private scanProfiles;
98
+ private dbPool;
99
+ private dbInstanceId;
100
+ private disableDb;
101
+ private host;
102
+ private skipStartupWarmup;
103
+ private autoResumeOnBoot;
104
+ private browseRoot;
105
+ private publicUrl;
106
+ private browserCors;
107
+ private pairTokens;
108
+ private exchangeAttempts;
109
+ private sessionStartAttempts;
110
+ private sessionInputAttempts;
111
+ private ptyGracePeriodMs;
112
+ private defaultSystemPrompt;
113
+ private featureFlags;
114
+ private featureFlagSources;
115
+ private codexSystemPromptEnabled;
116
+ private defaultPermissionMode;
117
+ private defaultModel;
118
+ private defaultEffort;
119
+ private claudeFlags;
120
+ private claudeExtraArgs;
121
+ private claudeFlagsPersistable;
122
+ private ptyGraceTimers;
123
+ private ptyGraceDeferCounts;
124
+ private sessionSubscribers;
125
+ private lastAgentChunkAt;
126
+ private terminalSeq;
127
+ private idempotency;
128
+ private sessionVerdicts;
129
+ private idleReaperTimer;
130
+ private clientIdToWs;
131
+ private wsToClientId;
132
+ private cache;
133
+ private cacheMonitor;
134
+ private projectsRepo;
135
+ private conversationsRepo;
136
+ private sessionsRepo;
137
+ private managedSessionsRepo;
138
+ private runtimeStore;
139
+ private readonly streamerInstanceId;
140
+ private cacheMetadataRepo;
141
+ private pushRepo;
142
+ private devicesRepo;
143
+ private apnsClient;
144
+ private liveActivityNotifier;
145
+ private liveActivityRenewal;
146
+ private waitingInputNotifier;
147
+ private discoveryCache;
148
+ private discoveryInFlight;
149
+ private cacheDir;
150
+ private runtimeDbPath;
151
+ private tailSize;
152
+ private directoryDebounceMs;
153
+ private codexRoots;
154
+ private includeAgents;
155
+ private agentEntrypoints;
156
+ private honoApp;
157
+ private log;
158
+ private agentConfig;
159
+ private agentClient;
160
+ private sessionStatusBus;
161
+ constructor(config: ServerConfig & {
162
+ apiKey: string;
163
+ });
164
+ private ptyAttachedIds;
165
+ private rememberSelfPtyEnded;
166
+ /**
167
+ * Send a session_list to only the client that triggered this HTTP request
168
+ * (identified by X-Client-Id header → registered WS socket). Falls back to
169
+ * a full broadcast if no match exists (old clients, or no WS registered yet).
170
+ */
171
+ private broadcastOrUnicastSessionList;
172
+ private sessionListPayload;
173
+ /**
174
+ * Overlay boot-reconciliation verdicts onto session responses.
175
+ *
176
+ * A session left by a previous run is not in the in-memory store, so
177
+ * SessionStore cannot classify it — it only ever sees what this run spawned.
178
+ * Discovery may still surface the process, in which case the reconciler knows
179
+ * strictly more about it than discovery does: it can tell `detached` (alive
180
+ * and confirmed ours) from `orphaned` (alive but identity unconfirmed), which
181
+ * a pid enumeration alone cannot.
182
+ *
183
+ * Only applied when the session is NOT live here: a session this run owns has
184
+ * an authoritative lifecycle already, and a stale verdict must never override
185
+ * it.
186
+ */
187
+ private withReconciledLifecycle;
188
+ private addSessionSubscriber;
189
+ /**
190
+ * Bring up Live Activity push, if credentials are present (Feature 12).
191
+ *
192
+ * APNS_KEY absent is the ordinary case on a dev machine and in CI, so this
193
+ * logs once at info and leaves the feature off rather than failing: the server
194
+ * must not refuse to boot over a missing optional push credential.
195
+ *
196
+ * The key is read from the environment as PEM contents and never from a path
197
+ * on disk; neither it nor any device token is ever logged.
198
+ */
199
+ private initLiveActivityPush;
200
+ /**
201
+ * Bring up "your turn" notifications over Expo's relay (#528).
202
+ *
203
+ * Unconditional, unlike Live Activity push: Expo holds the app's APNs and FCM
204
+ * credentials, so a self-hosted streamer needs no credential of its own. The
205
+ * access token is optional and only relevant if the Expo project has enhanced
206
+ * security enabled — requiring one would lock out every self-hoster, since
207
+ * they do not own the project. It is never logged.
208
+ */
209
+ private initWaitingInputPush;
210
+ /** Whether any live socket is subscribed to this session — "someone is looking". */
211
+ private hasSessionSubscriber;
212
+ /**
213
+ * Release PTYs whose agent has been silent past IDLE_REAP_AFTER_MS.
214
+ *
215
+ * This is the bound that lets handleWsClose stop arming kill timers. The
216
+ * distinction that matters: the old timer measured how long nobody was
217
+ * *watching*, which is uncorrelated with whether work is in flight. This
218
+ * measures how long the *agent* has produced nothing, and only ever considers
219
+ * sessions that are already settled — a `running` PTY is skipped regardless of
220
+ * age, so a long silent turn is never interrupted.
221
+ *
222
+ * Exposed (not private) so tests can drive one sweep deterministically instead
223
+ * of waiting on the interval.
224
+ */
225
+ reapIdleSessions(now?: number): string[];
226
+ private startGraceTimer;
227
+ get port(): number;
228
+ private currentWarmupState;
229
+ private beginWarmup;
230
+ private finishWarmup;
231
+ private withWarmup;
232
+ private rejectIfWarmingUp;
233
+ /**
234
+ * Say which provider CLIs this machine can actually launch.
235
+ *
236
+ * The operator cannot discover this case unaided: under launchd/Task
237
+ * Scheduler the service inherits a stripped PATH, so a CLI that works
238
+ * perfectly in their terminal is invisible to the service, and every session
239
+ * start dies milliseconds in. `/api/diagnostics` answers it too, but only for
240
+ * someone who already suspects it.
241
+ *
242
+ * Availability only, never a version — `--version` costs a process spawn per
243
+ * provider (85ms for claude here) and belongs on the first request that wants
244
+ * it, not on boot.
245
+ *
246
+ * Called AFTER the port is bound, which is not cosmetic. This is the first
247
+ * caller of the exe resolvers in the process, so the memo is cold by
248
+ * definition and each provider pays one synchronous `which` / `where.exe`
249
+ * (platform.ts) with a 3s timeout. On POSIX that is 3ms found, 7ms missing.
250
+ * Windows is the risk — `where.exe` is slower, `execFileSync` blocks the
251
+ * event loop, and Task Scheduler's stripped PATH is exactly where a miss
252
+ * pays the full timeout — so the worst case is ~6s of two blocking lookups.
253
+ * After `listen()` that delays the first requests on a box that cannot start
254
+ * a session anyway; before it, it would have delayed binding the port.
255
+ */
256
+ private logProviderAvailability;
257
+ listen(port: number, opts?: {
258
+ awaitReady?: boolean;
259
+ }): Promise<void>;
260
+ private bindWithRetry;
261
+ private bindWithRetryLoop;
262
+ private trackCacheWrite;
263
+ close(): Promise<void>;
264
+ private handleRequest;
265
+ private handlePairStart;
266
+ private handlePairExchange;
267
+ private rotateApiKey;
268
+ /**
269
+ * The registry ships with the values so a client renders the list from one
270
+ * round-trip, same as getClaudeFlagsConfig().
271
+ *
272
+ * Deliberately no `persisted` field: unlike claude-flags there is no PUT, and
273
+ * the absence of that field is the signal that this endpoint is read-only.
274
+ */
275
+ private getFeatureFlagsConfig;
276
+ private getClaudeFlagsConfig;
277
+ /**
278
+ * Replace the per-server flag set. Applies to the NEXT spawn — a live PTY
279
+ * keeps the argv it was started with.
280
+ *
281
+ * Mirrors rotateApiKey(): when the values were pinned by a CLI flag we still
282
+ * apply them in memory but skip the server.yaml write, because the flag would
283
+ * win again on restart and silently revert them.
284
+ *
285
+ * Logged with old→new at info level on purpose: this can disable the
286
+ * permission prompts entirely, so it needs a forensic trail.
287
+ */
288
+ private setClaudeFlagsConfig;
289
+ /**
290
+ * The three spawn options that a configured claude-flag can override, with
291
+ * the boot-time CLI/yaml default as the fallback. Spread into every
292
+ * start/resume/adopt call so all three paths agree.
293
+ *
294
+ * These ids are excluded from buildFlagArgs (SPAWN_POSITIONAL_FLAG_IDS)
295
+ * precisely because they arrive here instead — the PTY spawn paths pass them
296
+ * as explicit positionals, so emitting them from the allowlist too would
297
+ * duplicate the flag.
298
+ *
299
+ * Narrowed with the type guards rather than cast: ClaudeFlagValues is a loose
300
+ * Record by design, and while validateFlagValues already guarantees the shape
301
+ * on the way in, TypeScript cannot see that through the record.
302
+ */
303
+ private spawnFlagOverrides;
304
+ private checkRateLimit;
305
+ private checkExchangeRateLimit;
306
+ private checkSessionStartRateLimit;
307
+ private checkSessionInputRateLimit;
308
+ private handleSessionsCount;
309
+ /**
310
+ * Live Codex sessions keep `SessionResponse.conversationId === managed.id`
311
+ * (stable deep-link / PTY key) and store the rollout UUID separately as
312
+ * `boundConversationId`. REST history is indexed under the rollout UUID, so
313
+ * resolve the placeholder → bound id before looking up the scanner.
314
+ */
315
+ private resolveConversationLookupId;
316
+ /** File path for a live managed session (placeholder id or bound Codex id). */
317
+ private findLiveSessionFilePath;
318
+ /** True when a conversation UUID is the bound rollout of a live PTY session. */
319
+ private isBoundConversationLive;
320
+ /**
321
+ * Broadcast conversation JSONL lines to WS clients. Codex rollout lines are
322
+ * normalized to the Claude `type:user|assistant` shape mobile understands;
323
+ * Claude lines pass through unchanged so seq alignment stays intact.
324
+ */
325
+ private broadcastConversationLines;
326
+ /**
327
+ * Resolve a client-supplied session/conversation id into everything needed to
328
+ * launch against it: the id the PROVIDER filed the history under, that
329
+ * history's path, the project cwd, and which CLI owns it.
330
+ *
331
+ * Shared by resume and fork so the two can never disagree about identity —
332
+ * which for Codex is the whole difficulty: the id a client navigated to may
333
+ * be a local placeholder, and only the registry knows the rollout id behind
334
+ * it.
335
+ */
336
+ private resolveConversationTarget;
337
+ /**
338
+ * Block until a freshly spawned session reaches `waiting_input` (ready) or
339
+ * `idle` (failed), or until `timeoutMs` elapses with the process still alive.
340
+ *
341
+ * "timeout" is not an error: it is the pre-existing asynchronous contract —
342
+ * the session keeps booting and the caller answers with a pending shape.
343
+ */
344
+ private waitForStartupOutcome;
345
+ /**
346
+ * Drop every trace of a managed session: in-memory store, durable registry
347
+ * row, and the collision-probe markers that would otherwise outlive it.
348
+ *
349
+ * Used when a start never became usable (`abandonFailedStart`) and when stop
350
+ * is asked to discard an empty session that has no cached conversation. The
351
+ * registry delete is load-bearing — `rehydrateSessions` will bring the row
352
+ * back on the next boot if it remains.
353
+ *
354
+ * Callers that kill the PTY (`putOnHold`) must do that *first*: onStatusChange
355
+ * on idle writes `selfPtyEndedAt` and a registry status, and those have to
356
+ * be cleared here afterwards.
357
+ */
358
+ private forgetSession;
359
+ /**
360
+ * Drop every trace of a session that never became usable.
361
+ *
362
+ * The runner has already torn itself down (failStartup / handleExit); what
363
+ * remains is server-side bookkeeping that would otherwise leave a dead
364
+ * session in the list, a registry row claiming a spawn, and a `selfPtyEndedAt`
365
+ * marker that would suppress the mtime collision signal on the NEXT resume —
366
+ * i.e. it would help hide the very owner we just collided with.
367
+ */
368
+ private abandonFailedStart;
369
+ private enrichResumedSessionAsync;
370
+ private processJsonlQuestions;
371
+ private cancelPendingQuestion;
372
+ private handleBrowse;
373
+ private handleMkdir;
374
+ /**
375
+ * Retarget a LIVE session's model or effort by typing the corresponding
376
+ * Claude Code slash command into its PTY.
377
+ *
378
+ * There is no CLI or IPC channel for this — `--model`/`--effort` are spawn
379
+ * arguments — so the interactive `/model <x>` / `/effort <y>` commands are the
380
+ * only way to change a session already running. Both accept an argument and
381
+ * apply it without opening the picker (verified against Claude Code v2.1.220).
382
+ *
383
+ * Answers 202, not 200: the value is applied by the TUI on its next render, so
384
+ * there is nothing truthful to echo back synchronously. Clients confirm with
385
+ * `GET /api/sessions/:id`, which scrapes the applied value off the live status
386
+ * line.
387
+ */
388
+ private applyLiveSessionSetting;
389
+ }
390
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAqIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,KAAK,UAAU,EAA6B,MAAM,sCAAsC,CAAC;AAOlG,OAAO,K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