@hellcoder/companion 0.96.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 (242) hide show
  1. package/bin/cli.ts +168 -0
  2. package/bin/ctl.ts +528 -0
  3. package/bin/generate-token.ts +28 -0
  4. package/dist/apple-touch-icon.png +0 -0
  5. package/dist/assets/AgentsPage-DCFhrJ28.js +13 -0
  6. package/dist/assets/CronManager-EGwLJONv.js +1 -0
  7. package/dist/assets/IntegrationsPage-CTMRnbQS.js +1 -0
  8. package/dist/assets/LinearOAuthSettingsPage-CgQFMIgr.js +1 -0
  9. package/dist/assets/LinearSettingsPage-C9nok1qi.js +1 -0
  10. package/dist/assets/Playground-BV3k0RbV.js +109 -0
  11. package/dist/assets/PromptsPage-CFojqNKP.js +4 -0
  12. package/dist/assets/RunsPage-DUJ1QUSa.js +1 -0
  13. package/dist/assets/SandboxManager-CrVQ-VU_.js +8 -0
  14. package/dist/assets/SettingsPage-D1fPCL19.js +1 -0
  15. package/dist/assets/TailscalePage-D06cyvyC.js +1 -0
  16. package/dist/assets/index-BhUa1e6X.css +1 -0
  17. package/dist/assets/index-DkqeP-R9.js +134 -0
  18. package/dist/assets/sw-register-BibwRdvC.js +1 -0
  19. package/dist/assets/workbox-window.prod.es5-BIl4cyR9.js +2 -0
  20. package/dist/favicon.svg +8 -0
  21. package/dist/fonts/MesloLGSNerdFontMono-Bold.woff2 +0 -0
  22. package/dist/fonts/MesloLGSNerdFontMono-Regular.woff2 +0 -0
  23. package/dist/icon-192.png +0 -0
  24. package/dist/icon-512.png +0 -0
  25. package/dist/index.html +20 -0
  26. package/dist/logo-codex.svg +14 -0
  27. package/dist/logo-docker.svg +4 -0
  28. package/dist/logo.svg +14 -0
  29. package/dist/manifest.json +24 -0
  30. package/dist/sw.js +2 -0
  31. package/package.json +104 -0
  32. package/server/agent-cron-migrator.test.ts +610 -0
  33. package/server/agent-cron-migrator.ts +85 -0
  34. package/server/agent-executor.test.ts +1108 -0
  35. package/server/agent-executor.ts +346 -0
  36. package/server/agent-store.test.ts +588 -0
  37. package/server/agent-store.ts +185 -0
  38. package/server/agent-types.ts +138 -0
  39. package/server/ai-validation-settings.test.ts +128 -0
  40. package/server/ai-validation-settings.ts +35 -0
  41. package/server/ai-validator.test.ts +387 -0
  42. package/server/ai-validator.ts +271 -0
  43. package/server/auth-manager.test.ts +83 -0
  44. package/server/auth-manager.ts +150 -0
  45. package/server/auto-namer.test.ts +252 -0
  46. package/server/auto-namer.ts +78 -0
  47. package/server/backend-adapter.test.ts +38 -0
  48. package/server/backend-adapter.ts +54 -0
  49. package/server/cache-headers.test.ts +98 -0
  50. package/server/cache-headers.ts +61 -0
  51. package/server/claude-adapter.test.ts +1363 -0
  52. package/server/claude-adapter.ts +889 -0
  53. package/server/claude-container-auth.test.ts +44 -0
  54. package/server/claude-container-auth.ts +30 -0
  55. package/server/claude-protocol-contract.test.ts +71 -0
  56. package/server/claude-protocol-drift.test.ts +78 -0
  57. package/server/claude-session-discovery.test.ts +132 -0
  58. package/server/claude-session-discovery.ts +157 -0
  59. package/server/claude-session-history.test.ts +158 -0
  60. package/server/claude-session-history.ts +410 -0
  61. package/server/cli-launcher.test.ts +1343 -0
  62. package/server/cli-launcher.ts +1298 -0
  63. package/server/cli.test.ts +16 -0
  64. package/server/codex-adapter.test.ts +5545 -0
  65. package/server/codex-adapter.ts +3062 -0
  66. package/server/codex-container-auth.test.ts +50 -0
  67. package/server/codex-container-auth.ts +24 -0
  68. package/server/codex-home.test.ts +61 -0
  69. package/server/codex-home.ts +26 -0
  70. package/server/codex-protocol-contract.test.ts +96 -0
  71. package/server/codex-protocol-drift.test.ts +123 -0
  72. package/server/codex-ws-proxy.cjs +226 -0
  73. package/server/commands-discovery.test.ts +179 -0
  74. package/server/commands-discovery.ts +81 -0
  75. package/server/constants.ts +7 -0
  76. package/server/container-manager.test.ts +1211 -0
  77. package/server/container-manager.ts +1053 -0
  78. package/server/cron-scheduler.test.ts +957 -0
  79. package/server/cron-scheduler.ts +243 -0
  80. package/server/cron-store.test.ts +422 -0
  81. package/server/cron-store.ts +148 -0
  82. package/server/cron-types.ts +63 -0
  83. package/server/env-manager.test.ts +268 -0
  84. package/server/env-manager.ts +161 -0
  85. package/server/event-bus-types.ts +64 -0
  86. package/server/event-bus.test.ts +244 -0
  87. package/server/event-bus.ts +124 -0
  88. package/server/execution-store.test.ts +307 -0
  89. package/server/execution-store.ts +170 -0
  90. package/server/fs-utils.ts +15 -0
  91. package/server/git-utils.test.ts +938 -0
  92. package/server/git-utils.ts +421 -0
  93. package/server/github-pr.test.ts +498 -0
  94. package/server/github-pr.ts +379 -0
  95. package/server/image-pull-manager.test.ts +303 -0
  96. package/server/image-pull-manager.ts +279 -0
  97. package/server/index.ts +396 -0
  98. package/server/linear-agent-bridge.test.ts +1157 -0
  99. package/server/linear-agent-bridge.ts +629 -0
  100. package/server/linear-agent.test.ts +473 -0
  101. package/server/linear-agent.ts +479 -0
  102. package/server/linear-cache.test.ts +136 -0
  103. package/server/linear-cache.ts +113 -0
  104. package/server/linear-connections.test.ts +350 -0
  105. package/server/linear-connections.ts +231 -0
  106. package/server/linear-credential-migration.test.ts +337 -0
  107. package/server/linear-credential-migration.ts +63 -0
  108. package/server/linear-oauth-connections-migration.test.ts +268 -0
  109. package/server/linear-oauth-connections.test.ts +365 -0
  110. package/server/linear-oauth-connections.ts +294 -0
  111. package/server/linear-project-manager.test.ts +162 -0
  112. package/server/linear-project-manager.ts +111 -0
  113. package/server/linear-prompt-builder.test.ts +74 -0
  114. package/server/linear-prompt-builder.ts +61 -0
  115. package/server/linear-staging.test.ts +276 -0
  116. package/server/linear-staging.ts +142 -0
  117. package/server/logger.test.ts +393 -0
  118. package/server/logger.ts +259 -0
  119. package/server/metrics-collector.test.ts +413 -0
  120. package/server/metrics-collector.ts +350 -0
  121. package/server/metrics-types.ts +108 -0
  122. package/server/middleware/managed-auth.test.ts +264 -0
  123. package/server/middleware/managed-auth.ts +195 -0
  124. package/server/novnc-proxy.test.ts +333 -0
  125. package/server/novnc-proxy.ts +99 -0
  126. package/server/path-resolver.test.ts +552 -0
  127. package/server/path-resolver.ts +186 -0
  128. package/server/paths.test.ts +31 -0
  129. package/server/paths.ts +11 -0
  130. package/server/pr-poller.test.ts +191 -0
  131. package/server/pr-poller.ts +162 -0
  132. package/server/prompt-manager.test.ts +211 -0
  133. package/server/prompt-manager.ts +211 -0
  134. package/server/protocol/claude-upstream/README.md +19 -0
  135. package/server/protocol/claude-upstream/sdk.d.ts.txt +1943 -0
  136. package/server/protocol/codex-upstream/ClientNotification.ts.txt +5 -0
  137. package/server/protocol/codex-upstream/ClientRequest.ts.txt +60 -0
  138. package/server/protocol/codex-upstream/README.md +18 -0
  139. package/server/protocol/codex-upstream/ServerNotification.ts.txt +41 -0
  140. package/server/protocol/codex-upstream/ServerRequest.ts.txt +16 -0
  141. package/server/protocol/codex-upstream/v2/DynamicToolCallParams.ts.txt +6 -0
  142. package/server/protocol/codex-upstream/v2/DynamicToolCallResponse.ts.txt +6 -0
  143. package/server/protocol-monitor.ts +50 -0
  144. package/server/recorder.test.ts +454 -0
  145. package/server/recorder.ts +374 -0
  146. package/server/recording-hub/compat-validator.test.ts +150 -0
  147. package/server/recording-hub/compat-validator.ts +284 -0
  148. package/server/recording-hub/diagnostics.test.ts +140 -0
  149. package/server/recording-hub/diagnostics.ts +299 -0
  150. package/server/recording-hub/hub-config.test.ts +44 -0
  151. package/server/recording-hub/hub-config.ts +19 -0
  152. package/server/recording-hub/hub-routes.test.ts +417 -0
  153. package/server/recording-hub/hub-routes.ts +236 -0
  154. package/server/recording-hub/hub-store.test.ts +262 -0
  155. package/server/recording-hub/hub-store.ts +265 -0
  156. package/server/recording-hub/replay-adapter.test.ts +294 -0
  157. package/server/recording-hub/replay-adapter.ts +207 -0
  158. package/server/relay-client.test.ts +337 -0
  159. package/server/relay-client.ts +320 -0
  160. package/server/replay.test.ts +200 -0
  161. package/server/replay.ts +78 -0
  162. package/server/routes/agent-routes.test.ts +1400 -0
  163. package/server/routes/agent-routes.ts +409 -0
  164. package/server/routes/cron-routes.test.ts +881 -0
  165. package/server/routes/cron-routes.ts +103 -0
  166. package/server/routes/env-routes.test.ts +383 -0
  167. package/server/routes/env-routes.ts +95 -0
  168. package/server/routes/fs-routes.test.ts +1198 -0
  169. package/server/routes/fs-routes.ts +605 -0
  170. package/server/routes/git-routes.test.ts +813 -0
  171. package/server/routes/git-routes.ts +97 -0
  172. package/server/routes/linear-agent-routes.test.ts +721 -0
  173. package/server/routes/linear-agent-routes.ts +304 -0
  174. package/server/routes/linear-connection-routes.test.ts +927 -0
  175. package/server/routes/linear-connection-routes.ts +244 -0
  176. package/server/routes/linear-oauth-connection-routes.test.ts +406 -0
  177. package/server/routes/linear-oauth-connection-routes.ts +129 -0
  178. package/server/routes/linear-routes.test.ts +1510 -0
  179. package/server/routes/linear-routes.ts +953 -0
  180. package/server/routes/metrics-routes.test.ts +103 -0
  181. package/server/routes/metrics-routes.ts +13 -0
  182. package/server/routes/prompt-routes.ts +67 -0
  183. package/server/routes/sandbox-routes.test.ts +513 -0
  184. package/server/routes/sandbox-routes.ts +127 -0
  185. package/server/routes/settings-routes.ts +270 -0
  186. package/server/routes/skills-routes.test.ts +690 -0
  187. package/server/routes/skills-routes.ts +100 -0
  188. package/server/routes/system-routes.test.ts +637 -0
  189. package/server/routes/system-routes.ts +228 -0
  190. package/server/routes/tailscale-routes.test.ts +176 -0
  191. package/server/routes/tailscale-routes.ts +22 -0
  192. package/server/routes.test.ts +4655 -0
  193. package/server/routes.ts +1277 -0
  194. package/server/sandbox-manager.test.ts +378 -0
  195. package/server/sandbox-manager.ts +168 -0
  196. package/server/service.test.ts +1419 -0
  197. package/server/service.ts +718 -0
  198. package/server/session-creation-service.test.ts +661 -0
  199. package/server/session-creation-service.ts +473 -0
  200. package/server/session-git-info.ts +104 -0
  201. package/server/session-linear-issues.test.ts +118 -0
  202. package/server/session-linear-issues.ts +88 -0
  203. package/server/session-names.test.ts +94 -0
  204. package/server/session-names.ts +67 -0
  205. package/server/session-orchestrator.test.ts +1784 -0
  206. package/server/session-orchestrator.ts +973 -0
  207. package/server/session-state-machine.test.ts +606 -0
  208. package/server/session-state-machine.ts +207 -0
  209. package/server/session-store.test.ts +290 -0
  210. package/server/session-store.ts +146 -0
  211. package/server/session-types.ts +509 -0
  212. package/server/settings-manager.test.ts +275 -0
  213. package/server/settings-manager.ts +173 -0
  214. package/server/tailscale-manager.test.ts +553 -0
  215. package/server/tailscale-manager.ts +451 -0
  216. package/server/terminal-manager.ts +240 -0
  217. package/server/update-checker.test.ts +306 -0
  218. package/server/update-checker.ts +197 -0
  219. package/server/usage-limits.test.ts +536 -0
  220. package/server/usage-limits.ts +225 -0
  221. package/server/worktree-tracker.test.ts +243 -0
  222. package/server/worktree-tracker.ts +84 -0
  223. package/server/ws-auth.test.ts +59 -0
  224. package/server/ws-auth.ts +41 -0
  225. package/server/ws-bridge-browser-ingest.test.ts +272 -0
  226. package/server/ws-bridge-browser-ingest.ts +72 -0
  227. package/server/ws-bridge-browser.ts +112 -0
  228. package/server/ws-bridge-cli-ingest.test.ts +302 -0
  229. package/server/ws-bridge-cli-ingest.ts +81 -0
  230. package/server/ws-bridge-codex.test.ts +1837 -0
  231. package/server/ws-bridge-codex.ts +266 -0
  232. package/server/ws-bridge-controls.test.ts +124 -0
  233. package/server/ws-bridge-controls.ts +20 -0
  234. package/server/ws-bridge-persist.test.ts +296 -0
  235. package/server/ws-bridge-persist.ts +66 -0
  236. package/server/ws-bridge-publish.test.ts +234 -0
  237. package/server/ws-bridge-publish.ts +79 -0
  238. package/server/ws-bridge-replay.test.ts +44 -0
  239. package/server/ws-bridge-replay.ts +61 -0
  240. package/server/ws-bridge-types.ts +106 -0
  241. package/server/ws-bridge.test.ts +4777 -0
  242. package/server/ws-bridge.ts +1279 -0
@@ -0,0 +1,5 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+
5
+ export type ClientNotification = { "method": "initialized" };
@@ -0,0 +1,60 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { AddConversationListenerParams } from "./AddConversationListenerParams";
5
+ import type { ArchiveConversationParams } from "./ArchiveConversationParams";
6
+ import type { CancelLoginChatGptParams } from "./CancelLoginChatGptParams";
7
+ import type { ExecOneOffCommandParams } from "./ExecOneOffCommandParams";
8
+ import type { ForkConversationParams } from "./ForkConversationParams";
9
+ import type { FuzzyFileSearchParams } from "./FuzzyFileSearchParams";
10
+ import type { GetAuthStatusParams } from "./GetAuthStatusParams";
11
+ import type { GetConversationSummaryParams } from "./GetConversationSummaryParams";
12
+ import type { GitDiffToRemoteParams } from "./GitDiffToRemoteParams";
13
+ import type { InitializeParams } from "./InitializeParams";
14
+ import type { InterruptConversationParams } from "./InterruptConversationParams";
15
+ import type { ListConversationsParams } from "./ListConversationsParams";
16
+ import type { LoginApiKeyParams } from "./LoginApiKeyParams";
17
+ import type { NewConversationParams } from "./NewConversationParams";
18
+ import type { RemoveConversationListenerParams } from "./RemoveConversationListenerParams";
19
+ import type { RequestId } from "./RequestId";
20
+ import type { ResumeConversationParams } from "./ResumeConversationParams";
21
+ import type { SendUserMessageParams } from "./SendUserMessageParams";
22
+ import type { SendUserTurnParams } from "./SendUserTurnParams";
23
+ import type { SetDefaultModelParams } from "./SetDefaultModelParams";
24
+ import type { AppsListParams } from "./v2/AppsListParams";
25
+ import type { CancelLoginAccountParams } from "./v2/CancelLoginAccountParams";
26
+ import type { CommandExecParams } from "./v2/CommandExecParams";
27
+ import type { ConfigBatchWriteParams } from "./v2/ConfigBatchWriteParams";
28
+ import type { ConfigReadParams } from "./v2/ConfigReadParams";
29
+ import type { ConfigValueWriteParams } from "./v2/ConfigValueWriteParams";
30
+ import type { ExperimentalFeatureListParams } from "./v2/ExperimentalFeatureListParams";
31
+ import type { FeedbackUploadParams } from "./v2/FeedbackUploadParams";
32
+ import type { GetAccountParams } from "./v2/GetAccountParams";
33
+ import type { ListMcpServerStatusParams } from "./v2/ListMcpServerStatusParams";
34
+ import type { LoginAccountParams } from "./v2/LoginAccountParams";
35
+ import type { McpServerOauthLoginParams } from "./v2/McpServerOauthLoginParams";
36
+ import type { ModelListParams } from "./v2/ModelListParams";
37
+ import type { ReviewStartParams } from "./v2/ReviewStartParams";
38
+ import type { SkillsConfigWriteParams } from "./v2/SkillsConfigWriteParams";
39
+ import type { SkillsListParams } from "./v2/SkillsListParams";
40
+ import type { SkillsRemoteReadParams } from "./v2/SkillsRemoteReadParams";
41
+ import type { SkillsRemoteWriteParams } from "./v2/SkillsRemoteWriteParams";
42
+ import type { ThreadArchiveParams } from "./v2/ThreadArchiveParams";
43
+ import type { ThreadCompactStartParams } from "./v2/ThreadCompactStartParams";
44
+ import type { ThreadForkParams } from "./v2/ThreadForkParams";
45
+ import type { ThreadListParams } from "./v2/ThreadListParams";
46
+ import type { ThreadLoadedListParams } from "./v2/ThreadLoadedListParams";
47
+ import type { ThreadReadParams } from "./v2/ThreadReadParams";
48
+ import type { ThreadResumeParams } from "./v2/ThreadResumeParams";
49
+ import type { ThreadRollbackParams } from "./v2/ThreadRollbackParams";
50
+ import type { ThreadSetNameParams } from "./v2/ThreadSetNameParams";
51
+ import type { ThreadStartParams } from "./v2/ThreadStartParams";
52
+ import type { ThreadUnarchiveParams } from "./v2/ThreadUnarchiveParams";
53
+ import type { TurnInterruptParams } from "./v2/TurnInterruptParams";
54
+ import type { TurnStartParams } from "./v2/TurnStartParams";
55
+ import type { TurnSteerParams } from "./v2/TurnSteerParams";
56
+
57
+ /**
58
+ * Request from the client to the server.
59
+ */
60
+ export type ClientRequest ={ "method": "initialize", id: RequestId, params: InitializeParams, } | { "method": "thread/start", id: RequestId, params: ThreadStartParams, } | { "method": "thread/resume", id: RequestId, params: ThreadResumeParams, } | { "method": "thread/fork", id: RequestId, params: ThreadForkParams, } | { "method": "thread/archive", id: RequestId, params: ThreadArchiveParams, } | { "method": "thread/name/set", id: RequestId, params: ThreadSetNameParams, } | { "method": "thread/unarchive", id: RequestId, params: ThreadUnarchiveParams, } | { "method": "thread/compact/start", id: RequestId, params: ThreadCompactStartParams, } | { "method": "thread/rollback", id: RequestId, params: ThreadRollbackParams, } | { "method": "thread/list", id: RequestId, params: ThreadListParams, } | { "method": "thread/loaded/list", id: RequestId, params: ThreadLoadedListParams, } | { "method": "thread/read", id: RequestId, params: ThreadReadParams, } | { "method": "skills/list", id: RequestId, params: SkillsListParams, } | { "method": "skills/remote/read", id: RequestId, params: SkillsRemoteReadParams, } | { "method": "skills/remote/write", id: RequestId, params: SkillsRemoteWriteParams, } | { "method": "app/list", id: RequestId, params: AppsListParams, } | { "method": "skills/config/write", id: RequestId, params: SkillsConfigWriteParams, } | { "method": "turn/start", id: RequestId, params: TurnStartParams, } | { "method": "turn/steer", id: RequestId, params: TurnSteerParams, } | { "method": "turn/interrupt", id: RequestId, params: TurnInterruptParams, } | { "method": "review/start", id: RequestId, params: ReviewStartParams, } | { "method": "model/list", id: RequestId, params: ModelListParams, } | { "method": "experimentalFeature/list", id: RequestId, params: ExperimentalFeatureListParams, } | { "method": "mcpServer/oauth/login", id: RequestId, params: McpServerOauthLoginParams, } | { "method": "config/mcpServer/reload", id: RequestId, params: undefined, } | { "method": "mcpServerStatus/list", id: RequestId, params: ListMcpServerStatusParams, } | { "method": "account/login/start", id: RequestId, params: LoginAccountParams, } | { "method": "account/login/cancel", id: RequestId, params: CancelLoginAccountParams, } | { "method": "account/logout", id: RequestId, params: undefined, } | { "method": "account/rateLimits/read", id: RequestId, params: undefined, } | { "method": "feedback/upload", id: RequestId, params: FeedbackUploadParams, } | { "method": "command/exec", id: RequestId, params: CommandExecParams, } | { "method": "config/read", id: RequestId, params: ConfigReadParams, } | { "method": "config/value/write", id: RequestId, params: ConfigValueWriteParams, } | { "method": "config/batchWrite", id: RequestId, params: ConfigBatchWriteParams, } | { "method": "configRequirements/read", id: RequestId, params: undefined, } | { "method": "account/read", id: RequestId, params: GetAccountParams, } | { "method": "newConversation", id: RequestId, params: NewConversationParams, } | { "method": "getConversationSummary", id: RequestId, params: GetConversationSummaryParams, } | { "method": "listConversations", id: RequestId, params: ListConversationsParams, } | { "method": "resumeConversation", id: RequestId, params: ResumeConversationParams, } | { "method": "forkConversation", id: RequestId, params: ForkConversationParams, } | { "method": "archiveConversation", id: RequestId, params: ArchiveConversationParams, } | { "method": "sendUserMessage", id: RequestId, params: SendUserMessageParams, } | { "method": "sendUserTurn", id: RequestId, params: SendUserTurnParams, } | { "method": "interruptConversation", id: RequestId, params: InterruptConversationParams, } | { "method": "addConversationListener", id: RequestId, params: AddConversationListenerParams, } | { "method": "removeConversationListener", id: RequestId, params: RemoveConversationListenerParams, } | { "method": "gitDiffToRemote", id: RequestId, params: GitDiffToRemoteParams, } | { "method": "loginApiKey", id: RequestId, params: LoginApiKeyParams, } | { "method": "loginChatGpt", id: RequestId, params: undefined, } | { "method": "cancelLoginChatGpt", id: RequestId, params: CancelLoginChatGptParams, } | { "method": "logoutChatGpt", id: RequestId, params: undefined, } | { "method": "getAuthStatus", id: RequestId, params: GetAuthStatusParams, } | { "method": "getUserSavedConfig", id: RequestId, params: undefined, } | { "method": "setDefaultModel", id: RequestId, params: SetDefaultModelParams, } | { "method": "getUserAgent", id: RequestId, params: undefined, } | { "method": "userInfo", id: RequestId, params: undefined, } | { "method": "fuzzyFileSearch", id: RequestId, params: FuzzyFileSearchParams, } | { "method": "execOneOffCommand", id: RequestId, params: ExecOneOffCommandParams, };
@@ -0,0 +1,18 @@
1
+ Codex protocol snapshot used by offline compatibility tests.
2
+
3
+ Source repository: `https://github.com/openai/codex`
4
+ Source commit: `e5e40e2d4b2b815b1d3af9b866aff97002356c8d`
5
+
6
+ Copied files (stored as `.txt` snapshots to avoid TypeScript import resolution in this repo):
7
+ - `codex-rs/app-server-protocol/schema/typescript/ClientRequest.ts` -> `ClientRequest.ts.txt`
8
+ - `codex-rs/app-server-protocol/schema/typescript/ServerRequest.ts` -> `ServerRequest.ts.txt`
9
+ - `codex-rs/app-server-protocol/schema/typescript/ServerNotification.ts` -> `ServerNotification.ts.txt`
10
+ - `codex-rs/app-server-protocol/schema/typescript/ClientNotification.ts` -> `ClientNotification.ts.txt`
11
+ - `codex-rs/app-server-protocol/schema/typescript/v2/DynamicToolCallParams.ts` -> `v2/DynamicToolCallParams.ts.txt`
12
+ - `codex-rs/app-server-protocol/schema/typescript/v2/DynamicToolCallResponse.ts` -> `v2/DynamicToolCallResponse.ts.txt`
13
+
14
+ Refresh these files with:
15
+
16
+ ```bash
17
+ ./scripts/sync-codex-protocol.sh
18
+ ```
@@ -0,0 +1,41 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { AuthStatusChangeNotification } from "./AuthStatusChangeNotification";
5
+ import type { FuzzyFileSearchSessionUpdatedNotification } from "./FuzzyFileSearchSessionUpdatedNotification";
6
+ import type { LoginChatGptCompleteNotification } from "./LoginChatGptCompleteNotification";
7
+ import type { SessionConfiguredNotification } from "./SessionConfiguredNotification";
8
+ import type { AccountLoginCompletedNotification } from "./v2/AccountLoginCompletedNotification";
9
+ import type { AccountRateLimitsUpdatedNotification } from "./v2/AccountRateLimitsUpdatedNotification";
10
+ import type { AccountUpdatedNotification } from "./v2/AccountUpdatedNotification";
11
+ import type { AgentMessageDeltaNotification } from "./v2/AgentMessageDeltaNotification";
12
+ import type { AppListUpdatedNotification } from "./v2/AppListUpdatedNotification";
13
+ import type { CommandExecutionOutputDeltaNotification } from "./v2/CommandExecutionOutputDeltaNotification";
14
+ import type { ConfigWarningNotification } from "./v2/ConfigWarningNotification";
15
+ import type { ContextCompactedNotification } from "./v2/ContextCompactedNotification";
16
+ import type { DeprecationNoticeNotification } from "./v2/DeprecationNoticeNotification";
17
+ import type { ErrorNotification } from "./v2/ErrorNotification";
18
+ import type { FileChangeOutputDeltaNotification } from "./v2/FileChangeOutputDeltaNotification";
19
+ import type { ItemCompletedNotification } from "./v2/ItemCompletedNotification";
20
+ import type { ItemStartedNotification } from "./v2/ItemStartedNotification";
21
+ import type { McpServerOauthLoginCompletedNotification } from "./v2/McpServerOauthLoginCompletedNotification";
22
+ import type { McpToolCallProgressNotification } from "./v2/McpToolCallProgressNotification";
23
+ import type { PlanDeltaNotification } from "./v2/PlanDeltaNotification";
24
+ import type { RawResponseItemCompletedNotification } from "./v2/RawResponseItemCompletedNotification";
25
+ import type { ReasoningSummaryPartAddedNotification } from "./v2/ReasoningSummaryPartAddedNotification";
26
+ import type { ReasoningSummaryTextDeltaNotification } from "./v2/ReasoningSummaryTextDeltaNotification";
27
+ import type { ReasoningTextDeltaNotification } from "./v2/ReasoningTextDeltaNotification";
28
+ import type { TerminalInteractionNotification } from "./v2/TerminalInteractionNotification";
29
+ import type { ThreadNameUpdatedNotification } from "./v2/ThreadNameUpdatedNotification";
30
+ import type { ThreadStartedNotification } from "./v2/ThreadStartedNotification";
31
+ import type { ThreadTokenUsageUpdatedNotification } from "./v2/ThreadTokenUsageUpdatedNotification";
32
+ import type { TurnCompletedNotification } from "./v2/TurnCompletedNotification";
33
+ import type { TurnDiffUpdatedNotification } from "./v2/TurnDiffUpdatedNotification";
34
+ import type { TurnPlanUpdatedNotification } from "./v2/TurnPlanUpdatedNotification";
35
+ import type { TurnStartedNotification } from "./v2/TurnStartedNotification";
36
+ import type { WindowsWorldWritableWarningNotification } from "./v2/WindowsWorldWritableWarningNotification";
37
+
38
+ /**
39
+ * Notification sent from the server to the client.
40
+ */
41
+ export type ServerNotification = { "method": "error", "params": ErrorNotification } | { "method": "thread/started", "params": ThreadStartedNotification } | { "method": "thread/name/updated", "params": ThreadNameUpdatedNotification } | { "method": "thread/tokenUsage/updated", "params": ThreadTokenUsageUpdatedNotification } | { "method": "turn/started", "params": TurnStartedNotification } | { "method": "turn/completed", "params": TurnCompletedNotification } | { "method": "turn/diff/updated", "params": TurnDiffUpdatedNotification } | { "method": "turn/plan/updated", "params": TurnPlanUpdatedNotification } | { "method": "item/started", "params": ItemStartedNotification } | { "method": "item/completed", "params": ItemCompletedNotification } | { "method": "rawResponseItem/completed", "params": RawResponseItemCompletedNotification } | { "method": "item/agentMessage/delta", "params": AgentMessageDeltaNotification } | { "method": "item/plan/delta", "params": PlanDeltaNotification } | { "method": "item/commandExecution/outputDelta", "params": CommandExecutionOutputDeltaNotification } | { "method": "item/commandExecution/terminalInteraction", "params": TerminalInteractionNotification } | { "method": "item/fileChange/outputDelta", "params": FileChangeOutputDeltaNotification } | { "method": "item/mcpToolCall/progress", "params": McpToolCallProgressNotification } | { "method": "mcpServer/oauthLogin/completed", "params": McpServerOauthLoginCompletedNotification } | { "method": "account/updated", "params": AccountUpdatedNotification } | { "method": "account/rateLimits/updated", "params": AccountRateLimitsUpdatedNotification } | { "method": "app/list/updated", "params": AppListUpdatedNotification } | { "method": "item/reasoning/summaryTextDelta", "params": ReasoningSummaryTextDeltaNotification } | { "method": "item/reasoning/summaryPartAdded", "params": ReasoningSummaryPartAddedNotification } | { "method": "item/reasoning/textDelta", "params": ReasoningTextDeltaNotification } | { "method": "thread/compacted", "params": ContextCompactedNotification } | { "method": "deprecationNotice", "params": DeprecationNoticeNotification } | { "method": "configWarning", "params": ConfigWarningNotification } | { "method": "fuzzyFileSearch/sessionUpdated", "params": FuzzyFileSearchSessionUpdatedNotification } | { "method": "windows/worldWritableWarning", "params": WindowsWorldWritableWarningNotification } | { "method": "account/login/completed", "params": AccountLoginCompletedNotification } | { "method": "authStatusChange", "params": AuthStatusChangeNotification } | { "method": "loginChatGptComplete", "params": LoginChatGptCompleteNotification } | { "method": "sessionConfigured", "params": SessionConfiguredNotification };
@@ -0,0 +1,16 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { ApplyPatchApprovalParams } from "./ApplyPatchApprovalParams";
5
+ import type { ExecCommandApprovalParams } from "./ExecCommandApprovalParams";
6
+ import type { RequestId } from "./RequestId";
7
+ import type { ChatgptAuthTokensRefreshParams } from "./v2/ChatgptAuthTokensRefreshParams";
8
+ import type { CommandExecutionRequestApprovalParams } from "./v2/CommandExecutionRequestApprovalParams";
9
+ import type { DynamicToolCallParams } from "./v2/DynamicToolCallParams";
10
+ import type { FileChangeRequestApprovalParams } from "./v2/FileChangeRequestApprovalParams";
11
+ import type { ToolRequestUserInputParams } from "./v2/ToolRequestUserInputParams";
12
+
13
+ /**
14
+ * Request initiated from the server and sent to the client.
15
+ */
16
+ export type ServerRequest = { "method": "item/commandExecution/requestApproval", id: RequestId, params: CommandExecutionRequestApprovalParams, } | { "method": "item/fileChange/requestApproval", id: RequestId, params: FileChangeRequestApprovalParams, } | { "method": "item/tool/requestUserInput", id: RequestId, params: ToolRequestUserInputParams, } | { "method": "item/tool/call", id: RequestId, params: DynamicToolCallParams, } | { "method": "account/chatgptAuthTokens/refresh", id: RequestId, params: ChatgptAuthTokensRefreshParams, } | { "method": "applyPatchApproval", id: RequestId, params: ApplyPatchApprovalParams, } | { "method": "execCommandApproval", id: RequestId, params: ExecCommandApprovalParams, };
@@ -0,0 +1,6 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { JsonValue } from "../serde_json/JsonValue";
5
+
6
+ export type DynamicToolCallParams = { threadId: string, turnId: string, callId: string, tool: string, arguments: JsonValue, };
@@ -0,0 +1,6 @@
1
+ // GENERATED CODE! DO NOT MODIFY BY HAND!
2
+
3
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
4
+ import type { DynamicToolCallOutputContentItem } from "./DynamicToolCallOutputContentItem";
5
+
6
+ export type DynamicToolCallResponse = { contentItems: Array<DynamicToolCallOutputContentItem>, success: boolean, };
@@ -0,0 +1,50 @@
1
+ import { log } from "./logger.js";
2
+
3
+ type BackendName = "claude" | "codex";
4
+ type Direction = "incoming" | "outgoing";
5
+ type MessageKind = "message" | "notification" | "request" | "parse_error";
6
+
7
+ interface ProtocolDriftOptions {
8
+ backend: BackendName;
9
+ sessionId: string;
10
+ direction: Direction;
11
+ messageKind: MessageKind;
12
+ messageName: string;
13
+ keys?: string[];
14
+ rawPreview?: string;
15
+ blockedForSafety?: boolean;
16
+ }
17
+
18
+ function truncate(value: string, max = 240): string {
19
+ return value.length > max ? `${value.slice(0, max)}...` : value;
20
+ }
21
+
22
+ export function reportProtocolDrift(
23
+ seen: Set<string>,
24
+ options: ProtocolDriftOptions,
25
+ emitError?: (message: string) => void,
26
+ ): void {
27
+ const dedupeKey = [
28
+ options.backend,
29
+ options.direction,
30
+ options.messageKind,
31
+ options.messageName,
32
+ ].join(":");
33
+ if (seen.has(dedupeKey)) return;
34
+ seen.add(dedupeKey);
35
+
36
+ log.warn("protocol-monitor", "Backend protocol drift detected", {
37
+ backend: options.backend,
38
+ sessionId: options.sessionId,
39
+ direction: options.direction,
40
+ messageKind: options.messageKind,
41
+ messageName: options.messageName,
42
+ keys: options.keys,
43
+ rawPreview: options.rawPreview ? truncate(options.rawPreview) : undefined,
44
+ blockedForSafety: options.blockedForSafety,
45
+ });
46
+
47
+ emitError?.(
48
+ `${options.backend === "codex" ? "Codex" : "Claude"} protocol drift: unsupported ${options.direction} ${options.messageKind} "${options.messageName}". Companion may need an update.`,
49
+ );
50
+ }