@sumicom/quicksave 0.8.15 → 0.8.17

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 (622) hide show
  1. package/dist/ai/cardBuilder.d.ts +1 -0
  2. package/dist/ai/cardBuilder.d.ts.map +1 -1
  3. package/dist/ai/cardBuilder.js +33 -2
  4. package/dist/ai/cardBuilder.js.map +1 -1
  5. package/dist/ai/claudeCliProvider.d.ts.map +1 -1
  6. package/dist/ai/claudeCliProvider.js +9 -2
  7. package/dist/ai/claudeCliProvider.js.map +1 -1
  8. package/dist/ai/claudeTerminal/hookBridge.d.ts +4 -3
  9. package/dist/ai/claudeTerminal/hookBridge.d.ts.map +1 -1
  10. package/dist/ai/claudeTerminal/hookBridge.js.map +1 -1
  11. package/dist/ai/claudeTerminal/provider.d.ts +14 -1
  12. package/dist/ai/claudeTerminal/provider.d.ts.map +1 -1
  13. package/dist/ai/claudeTerminal/provider.js +358 -65
  14. package/dist/ai/claudeTerminal/provider.js.map +1 -1
  15. package/dist/ai/codexAppServer/approvalMapping.d.ts.map +1 -1
  16. package/dist/ai/codexAppServer/approvalMapping.js +3 -1
  17. package/dist/ai/codexAppServer/approvalMapping.js.map +1 -1
  18. package/dist/ai/codexAppServer/cardAdapter.d.ts +29 -5
  19. package/dist/ai/codexAppServer/cardAdapter.d.ts.map +1 -1
  20. package/dist/ai/codexAppServer/cardAdapter.js +122 -30
  21. package/dist/ai/codexAppServer/cardAdapter.js.map +1 -1
  22. package/dist/ai/codexAppServer/overrideStore.d.ts +0 -2
  23. package/dist/ai/codexAppServer/overrideStore.d.ts.map +1 -1
  24. package/dist/ai/codexAppServer/overrideStore.js +0 -1
  25. package/dist/ai/codexAppServer/overrideStore.js.map +1 -1
  26. package/dist/ai/codexAppServer/permissionMapping.d.ts.map +1 -1
  27. package/dist/ai/codexAppServer/permissionMapping.js +0 -2
  28. package/dist/ai/codexAppServer/permissionMapping.js.map +1 -1
  29. package/dist/ai/codexAppServer/protocolLog.d.ts +2 -0
  30. package/dist/ai/codexAppServer/protocolLog.d.ts.map +1 -0
  31. package/dist/ai/codexAppServer/protocolLog.js +16 -0
  32. package/dist/ai/codexAppServer/protocolLog.js.map +1 -0
  33. package/dist/ai/codexAppServer/provider.d.ts +34 -2
  34. package/dist/ai/codexAppServer/provider.d.ts.map +1 -1
  35. package/dist/ai/codexAppServer/provider.js +639 -40
  36. package/dist/ai/codexAppServer/provider.js.map +1 -1
  37. package/dist/ai/codexAppServer/rpcClient.d.ts +2 -0
  38. package/dist/ai/codexAppServer/rpcClient.d.ts.map +1 -1
  39. package/dist/ai/codexAppServer/rpcClient.js +15 -1
  40. package/dist/ai/codexAppServer/rpcClient.js.map +1 -1
  41. package/dist/ai/codexAppServer/schema/generated/AgentMessageInputContent.d.ts +5 -0
  42. package/dist/ai/codexAppServer/schema/generated/AgentMessageInputContent.d.ts.map +1 -0
  43. package/dist/ai/codexAppServer/schema/generated/AgentMessageInputContent.js +3 -0
  44. package/dist/ai/codexAppServer/schema/generated/AgentMessageInputContent.js.map +1 -0
  45. package/dist/ai/codexAppServer/schema/generated/AuthMode.d.ts +1 -1
  46. package/dist/ai/codexAppServer/schema/generated/AuthMode.d.ts.map +1 -1
  47. package/dist/ai/codexAppServer/schema/generated/AutoCompactTokenLimitScope.d.ts +6 -0
  48. package/dist/ai/codexAppServer/schema/generated/AutoCompactTokenLimitScope.d.ts.map +1 -0
  49. package/dist/ai/codexAppServer/schema/generated/AutoCompactTokenLimitScope.js +3 -0
  50. package/dist/ai/codexAppServer/schema/generated/AutoCompactTokenLimitScope.js.map +1 -0
  51. package/dist/ai/codexAppServer/schema/generated/ClientRequest.d.ts +74 -16
  52. package/dist/ai/codexAppServer/schema/generated/ClientRequest.d.ts.map +1 -1
  53. package/dist/ai/codexAppServer/schema/generated/FunctionCallOutputContentItem.d.ts +3 -0
  54. package/dist/ai/codexAppServer/schema/generated/FunctionCallOutputContentItem.d.ts.map +1 -1
  55. package/dist/ai/codexAppServer/schema/generated/InitializeCapabilities.d.ts +4 -0
  56. package/dist/ai/codexAppServer/schema/generated/InitializeCapabilities.d.ts.map +1 -1
  57. package/dist/ai/codexAppServer/schema/generated/InternalSessionSource.d.ts +2 -0
  58. package/dist/ai/codexAppServer/schema/generated/InternalSessionSource.d.ts.map +1 -0
  59. package/dist/ai/codexAppServer/schema/generated/{v2/DeviceKeyCreateParams.js → InternalSessionSource.js} +1 -1
  60. package/dist/ai/codexAppServer/schema/generated/InternalSessionSource.js.map +1 -0
  61. package/dist/ai/codexAppServer/schema/generated/McpServerInfo.d.ts +13 -0
  62. package/dist/ai/codexAppServer/schema/generated/McpServerInfo.d.ts.map +1 -0
  63. package/dist/ai/codexAppServer/schema/generated/{v2/ReadOnlyAccess.js → McpServerInfo.js} +1 -1
  64. package/dist/ai/codexAppServer/schema/generated/McpServerInfo.js.map +1 -0
  65. package/dist/ai/codexAppServer/schema/generated/ReasoningEffort.d.ts +1 -1
  66. package/dist/ai/codexAppServer/schema/generated/ReasoningEffort.d.ts.map +1 -1
  67. package/dist/ai/codexAppServer/schema/generated/ResponseItem.d.ts +11 -5
  68. package/dist/ai/codexAppServer/schema/generated/ResponseItem.d.ts.map +1 -1
  69. package/dist/ai/codexAppServer/schema/generated/ServerNotification.d.ts +28 -0
  70. package/dist/ai/codexAppServer/schema/generated/ServerNotification.d.ts.map +1 -1
  71. package/dist/ai/codexAppServer/schema/generated/ServerRequest.d.ts +5 -0
  72. package/dist/ai/codexAppServer/schema/generated/ServerRequest.d.ts.map +1 -1
  73. package/dist/ai/codexAppServer/schema/generated/SessionSource.d.ts +3 -0
  74. package/dist/ai/codexAppServer/schema/generated/SessionSource.d.ts.map +1 -1
  75. package/dist/ai/codexAppServer/schema/generated/v2/AccountRateLimitsUpdatedNotification.d.ts +7 -0
  76. package/dist/ai/codexAppServer/schema/generated/v2/AccountRateLimitsUpdatedNotification.d.ts.map +1 -1
  77. package/dist/ai/codexAppServer/schema/generated/v2/AccountTokenUsageDailyBucket.d.ts +5 -0
  78. package/dist/ai/codexAppServer/schema/generated/v2/AccountTokenUsageDailyBucket.d.ts.map +1 -0
  79. package/dist/ai/codexAppServer/schema/generated/v2/AccountTokenUsageDailyBucket.js +3 -0
  80. package/dist/ai/codexAppServer/schema/generated/v2/AccountTokenUsageDailyBucket.js.map +1 -0
  81. package/dist/ai/codexAppServer/schema/generated/v2/AccountTokenUsageSummary.d.ts +8 -0
  82. package/dist/ai/codexAppServer/schema/generated/v2/AccountTokenUsageSummary.d.ts.map +1 -0
  83. package/dist/ai/codexAppServer/schema/generated/v2/AccountTokenUsageSummary.js +3 -0
  84. package/dist/ai/codexAppServer/schema/generated/v2/AccountTokenUsageSummary.js.map +1 -0
  85. package/dist/ai/codexAppServer/schema/generated/v2/ActivePermissionProfile.d.ts +13 -0
  86. package/dist/ai/codexAppServer/schema/generated/v2/ActivePermissionProfile.d.ts.map +1 -0
  87. package/dist/ai/codexAppServer/schema/generated/v2/ActivePermissionProfile.js +3 -0
  88. package/dist/ai/codexAppServer/schema/generated/v2/ActivePermissionProfile.js.map +1 -0
  89. package/dist/ai/codexAppServer/schema/generated/v2/AdditionalContextEntry.d.ts +6 -0
  90. package/dist/ai/codexAppServer/schema/generated/v2/AdditionalContextEntry.d.ts.map +1 -0
  91. package/dist/ai/codexAppServer/schema/generated/v2/AdditionalContextEntry.js +3 -0
  92. package/dist/ai/codexAppServer/schema/generated/v2/AdditionalContextEntry.js.map +1 -0
  93. package/dist/ai/codexAppServer/schema/generated/v2/AdditionalContextKind.d.ts +2 -0
  94. package/dist/ai/codexAppServer/schema/generated/v2/AdditionalContextKind.d.ts.map +1 -0
  95. package/dist/ai/codexAppServer/schema/generated/v2/AdditionalContextKind.js +3 -0
  96. package/dist/ai/codexAppServer/schema/generated/v2/AdditionalContextKind.js.map +1 -0
  97. package/dist/ai/codexAppServer/schema/generated/v2/AppTemplateSummary.d.ts +12 -0
  98. package/dist/ai/codexAppServer/schema/generated/v2/AppTemplateSummary.d.ts.map +1 -0
  99. package/dist/ai/codexAppServer/schema/generated/v2/{DeviceKeyAlgorithm.js → AppTemplateSummary.js} +1 -1
  100. package/dist/ai/codexAppServer/schema/generated/v2/AppTemplateSummary.js.map +1 -0
  101. package/dist/ai/codexAppServer/schema/generated/v2/AppTemplateUnavailableReason.d.ts +2 -0
  102. package/dist/ai/codexAppServer/schema/generated/v2/AppTemplateUnavailableReason.d.ts.map +1 -0
  103. package/dist/ai/codexAppServer/schema/generated/v2/AppTemplateUnavailableReason.js +3 -0
  104. package/dist/ai/codexAppServer/schema/generated/v2/AppTemplateUnavailableReason.js.map +1 -0
  105. package/dist/ai/codexAppServer/schema/generated/v2/AppsConfig.d.ts +2 -0
  106. package/dist/ai/codexAppServer/schema/generated/v2/AppsConfig.d.ts.map +1 -1
  107. package/dist/ai/codexAppServer/schema/generated/v2/AttestationGenerateParams.d.ts +2 -0
  108. package/dist/ai/codexAppServer/schema/generated/v2/AttestationGenerateParams.d.ts.map +1 -0
  109. package/dist/ai/codexAppServer/schema/generated/v2/AttestationGenerateParams.js +3 -0
  110. package/dist/ai/codexAppServer/schema/generated/v2/AttestationGenerateParams.js.map +1 -0
  111. package/dist/ai/codexAppServer/schema/generated/v2/AttestationGenerateResponse.d.ts +7 -0
  112. package/dist/ai/codexAppServer/schema/generated/v2/AttestationGenerateResponse.d.ts.map +1 -0
  113. package/dist/ai/codexAppServer/schema/generated/v2/AttestationGenerateResponse.js +3 -0
  114. package/dist/ai/codexAppServer/schema/generated/v2/AttestationGenerateResponse.js.map +1 -0
  115. package/dist/ai/codexAppServer/schema/generated/v2/CommandExecParams.d.ts +12 -35
  116. package/dist/ai/codexAppServer/schema/generated/v2/CommandExecParams.d.ts.map +1 -1
  117. package/dist/ai/codexAppServer/schema/generated/v2/CommandExecutionRequestApprovalParams.d.ts +11 -26
  118. package/dist/ai/codexAppServer/schema/generated/v2/CommandExecutionRequestApprovalParams.d.ts.map +1 -1
  119. package/dist/ai/codexAppServer/schema/generated/v2/CommandMigration.d.ts +4 -0
  120. package/dist/ai/codexAppServer/schema/generated/v2/CommandMigration.d.ts.map +1 -0
  121. package/dist/ai/codexAppServer/schema/generated/v2/CommandMigration.js +3 -0
  122. package/dist/ai/codexAppServer/schema/generated/v2/CommandMigration.js.map +1 -0
  123. package/dist/ai/codexAppServer/schema/generated/v2/ComputerUseRequirements.d.ts +4 -0
  124. package/dist/ai/codexAppServer/schema/generated/v2/ComputerUseRequirements.d.ts.map +1 -0
  125. package/dist/ai/codexAppServer/schema/generated/v2/ComputerUseRequirements.js +3 -0
  126. package/dist/ai/codexAppServer/schema/generated/v2/ComputerUseRequirements.js.map +1 -0
  127. package/dist/ai/codexAppServer/schema/generated/v2/Config.d.ts +8 -8
  128. package/dist/ai/codexAppServer/schema/generated/v2/Config.d.ts.map +1 -1
  129. package/dist/ai/codexAppServer/schema/generated/v2/ConfigLayerSource.d.ts +17 -0
  130. package/dist/ai/codexAppServer/schema/generated/v2/ConfigLayerSource.d.ts.map +1 -1
  131. package/dist/ai/codexAppServer/schema/generated/v2/ConfigReadParams.d.ts +1 -1
  132. package/dist/ai/codexAppServer/schema/generated/v2/ConfigReadParams.d.ts.map +1 -1
  133. package/dist/ai/codexAppServer/schema/generated/v2/ConfigRequirements.d.ts +10 -0
  134. package/dist/ai/codexAppServer/schema/generated/v2/ConfigRequirements.d.ts.map +1 -1
  135. package/dist/ai/codexAppServer/schema/generated/v2/ConfiguredHookHandler.d.ts +1 -0
  136. package/dist/ai/codexAppServer/schema/generated/v2/ConfiguredHookHandler.d.ts.map +1 -1
  137. package/dist/ai/codexAppServer/schema/generated/v2/ExperimentalFeatureListParams.d.ts +6 -0
  138. package/dist/ai/codexAppServer/schema/generated/v2/ExperimentalFeatureListParams.d.ts.map +1 -1
  139. package/dist/ai/codexAppServer/schema/generated/v2/ExternalAgentConfigMigrationItemType.d.ts +1 -1
  140. package/dist/ai/codexAppServer/schema/generated/v2/ExternalAgentConfigMigrationItemType.d.ts.map +1 -1
  141. package/dist/ai/codexAppServer/schema/generated/v2/FeedbackUploadParams.d.ts +1 -1
  142. package/dist/ai/codexAppServer/schema/generated/v2/FeedbackUploadParams.d.ts.map +1 -1
  143. package/dist/ai/codexAppServer/schema/generated/v2/FileChangeOutputDeltaNotification.d.ts +5 -0
  144. package/dist/ai/codexAppServer/schema/generated/v2/FileChangeOutputDeltaNotification.d.ts.map +1 -1
  145. package/dist/ai/codexAppServer/schema/generated/v2/FileChangeRequestApprovalParams.d.ts +4 -0
  146. package/dist/ai/codexAppServer/schema/generated/v2/FileChangeRequestApprovalParams.d.ts.map +1 -1
  147. package/dist/ai/codexAppServer/schema/generated/v2/FileSystemAccessMode.d.ts +1 -1
  148. package/dist/ai/codexAppServer/schema/generated/v2/FileSystemSpecialPath.d.ts +0 -2
  149. package/dist/ai/codexAppServer/schema/generated/v2/FileSystemSpecialPath.d.ts.map +1 -1
  150. package/dist/ai/codexAppServer/schema/generated/v2/ForcedChatgptWorkspaceIds.d.ts +5 -0
  151. package/dist/ai/codexAppServer/schema/generated/v2/ForcedChatgptWorkspaceIds.d.ts.map +1 -0
  152. package/dist/ai/codexAppServer/schema/generated/v2/ForcedChatgptWorkspaceIds.js +3 -0
  153. package/dist/ai/codexAppServer/schema/generated/v2/ForcedChatgptWorkspaceIds.js.map +1 -0
  154. package/dist/ai/codexAppServer/schema/generated/v2/GetAccountParams.d.ts +1 -1
  155. package/dist/ai/codexAppServer/schema/generated/v2/GetAccountParams.d.ts.map +1 -1
  156. package/dist/ai/codexAppServer/schema/generated/v2/GetAccountTokenUsageResponse.d.ts +7 -0
  157. package/dist/ai/codexAppServer/schema/generated/v2/GetAccountTokenUsageResponse.d.ts.map +1 -0
  158. package/dist/ai/codexAppServer/schema/generated/v2/GetAccountTokenUsageResponse.js +3 -0
  159. package/dist/ai/codexAppServer/schema/generated/v2/GetAccountTokenUsageResponse.js.map +1 -0
  160. package/dist/ai/codexAppServer/schema/generated/v2/HookErrorInfo.d.ts +5 -0
  161. package/dist/ai/codexAppServer/schema/generated/v2/HookErrorInfo.d.ts.map +1 -0
  162. package/dist/ai/codexAppServer/schema/generated/v2/HookErrorInfo.js +3 -0
  163. package/dist/ai/codexAppServer/schema/generated/v2/HookErrorInfo.js.map +1 -0
  164. package/dist/ai/codexAppServer/schema/generated/v2/HookEventName.d.ts +1 -1
  165. package/dist/ai/codexAppServer/schema/generated/v2/HookEventName.d.ts.map +1 -1
  166. package/dist/ai/codexAppServer/schema/generated/v2/HookMetadata.d.ts +23 -0
  167. package/dist/ai/codexAppServer/schema/generated/v2/HookMetadata.d.ts.map +1 -0
  168. package/dist/ai/codexAppServer/schema/generated/{GhostCommit.js → v2/HookMetadata.js} +1 -1
  169. package/dist/ai/codexAppServer/schema/generated/v2/HookMetadata.js.map +1 -0
  170. package/dist/ai/codexAppServer/schema/generated/v2/HookMigration.d.ts +4 -0
  171. package/dist/ai/codexAppServer/schema/generated/v2/HookMigration.d.ts.map +1 -0
  172. package/dist/ai/codexAppServer/schema/generated/v2/HookMigration.js +3 -0
  173. package/dist/ai/codexAppServer/schema/generated/v2/HookMigration.js.map +1 -0
  174. package/dist/ai/codexAppServer/schema/generated/v2/HookSource.d.ts +1 -1
  175. package/dist/ai/codexAppServer/schema/generated/v2/HookSource.d.ts.map +1 -1
  176. package/dist/ai/codexAppServer/schema/generated/v2/HookTrustStatus.d.ts +2 -0
  177. package/dist/ai/codexAppServer/schema/generated/v2/HookTrustStatus.d.ts.map +1 -0
  178. package/dist/ai/codexAppServer/schema/generated/v2/HookTrustStatus.js +3 -0
  179. package/dist/ai/codexAppServer/schema/generated/v2/HookTrustStatus.js.map +1 -0
  180. package/dist/ai/codexAppServer/schema/generated/v2/HooksListEntry.d.ts +9 -0
  181. package/dist/ai/codexAppServer/schema/generated/v2/HooksListEntry.d.ts.map +1 -0
  182. package/dist/ai/codexAppServer/schema/generated/v2/HooksListEntry.js +3 -0
  183. package/dist/ai/codexAppServer/schema/generated/v2/HooksListEntry.js.map +1 -0
  184. package/dist/ai/codexAppServer/schema/generated/v2/HooksListParams.d.ts +7 -0
  185. package/dist/ai/codexAppServer/schema/generated/v2/HooksListParams.d.ts.map +1 -0
  186. package/dist/ai/codexAppServer/schema/generated/v2/HooksListParams.js +3 -0
  187. package/dist/ai/codexAppServer/schema/generated/v2/HooksListParams.js.map +1 -0
  188. package/dist/ai/codexAppServer/schema/generated/v2/HooksListResponse.d.ts +5 -0
  189. package/dist/ai/codexAppServer/schema/generated/v2/HooksListResponse.d.ts.map +1 -0
  190. package/dist/ai/codexAppServer/schema/generated/v2/{PermissionProfile.js → HooksListResponse.js} +1 -1
  191. package/dist/ai/codexAppServer/schema/generated/v2/HooksListResponse.js.map +1 -0
  192. package/dist/ai/codexAppServer/schema/generated/v2/ItemCompletedNotification.d.ts +4 -0
  193. package/dist/ai/codexAppServer/schema/generated/v2/ItemCompletedNotification.d.ts.map +1 -1
  194. package/dist/ai/codexAppServer/schema/generated/v2/ItemGuardianApprovalReviewCompletedNotification.d.ts +8 -0
  195. package/dist/ai/codexAppServer/schema/generated/v2/ItemGuardianApprovalReviewCompletedNotification.d.ts.map +1 -1
  196. package/dist/ai/codexAppServer/schema/generated/v2/ItemGuardianApprovalReviewStartedNotification.d.ts +4 -0
  197. package/dist/ai/codexAppServer/schema/generated/v2/ItemGuardianApprovalReviewStartedNotification.d.ts.map +1 -1
  198. package/dist/ai/codexAppServer/schema/generated/v2/ItemStartedNotification.d.ts +4 -0
  199. package/dist/ai/codexAppServer/schema/generated/v2/ItemStartedNotification.d.ts.map +1 -1
  200. package/dist/ai/codexAppServer/schema/generated/v2/ListMcpServerStatusParams.d.ts +1 -0
  201. package/dist/ai/codexAppServer/schema/generated/v2/ListMcpServerStatusParams.d.ts.map +1 -1
  202. package/dist/ai/codexAppServer/schema/generated/v2/LoginAccountParams.d.ts +1 -0
  203. package/dist/ai/codexAppServer/schema/generated/v2/LoginAccountParams.d.ts.map +1 -1
  204. package/dist/ai/codexAppServer/schema/generated/v2/ManagedHooksRequirements.d.ts +4 -0
  205. package/dist/ai/codexAppServer/schema/generated/v2/ManagedHooksRequirements.d.ts.map +1 -1
  206. package/dist/ai/codexAppServer/schema/generated/v2/McpServerMigration.d.ts +4 -0
  207. package/dist/ai/codexAppServer/schema/generated/v2/McpServerMigration.d.ts.map +1 -0
  208. package/dist/ai/codexAppServer/schema/generated/v2/McpServerMigration.js +3 -0
  209. package/dist/ai/codexAppServer/schema/generated/v2/McpServerMigration.js.map +1 -0
  210. package/dist/ai/codexAppServer/schema/generated/v2/McpServerStatus.d.ts +2 -0
  211. package/dist/ai/codexAppServer/schema/generated/v2/McpServerStatus.d.ts.map +1 -1
  212. package/dist/ai/codexAppServer/schema/generated/v2/McpServerStatusUpdatedNotification.d.ts +1 -0
  213. package/dist/ai/codexAppServer/schema/generated/v2/McpServerStatusUpdatedNotification.d.ts.map +1 -1
  214. package/dist/ai/codexAppServer/schema/generated/v2/MigrationDetails.d.ts +10 -0
  215. package/dist/ai/codexAppServer/schema/generated/v2/MigrationDetails.d.ts.map +1 -1
  216. package/dist/ai/codexAppServer/schema/generated/v2/Model.d.ts +9 -0
  217. package/dist/ai/codexAppServer/schema/generated/v2/Model.d.ts.map +1 -1
  218. package/dist/ai/codexAppServer/schema/generated/v2/ModelProviderCapabilitiesReadParams.d.ts +2 -0
  219. package/dist/ai/codexAppServer/schema/generated/v2/ModelProviderCapabilitiesReadParams.d.ts.map +1 -0
  220. package/dist/ai/codexAppServer/schema/generated/v2/ModelProviderCapabilitiesReadParams.js +3 -0
  221. package/dist/ai/codexAppServer/schema/generated/v2/ModelProviderCapabilitiesReadParams.js.map +1 -0
  222. package/dist/ai/codexAppServer/schema/generated/v2/ModelProviderCapabilitiesReadResponse.d.ts +6 -0
  223. package/dist/ai/codexAppServer/schema/generated/v2/ModelProviderCapabilitiesReadResponse.d.ts.map +1 -0
  224. package/dist/ai/codexAppServer/schema/generated/v2/ModelProviderCapabilitiesReadResponse.js +3 -0
  225. package/dist/ai/codexAppServer/schema/generated/v2/ModelProviderCapabilitiesReadResponse.js.map +1 -0
  226. package/dist/ai/codexAppServer/schema/generated/v2/ModelServiceTier.d.ts +6 -0
  227. package/dist/ai/codexAppServer/schema/generated/v2/ModelServiceTier.d.ts.map +1 -0
  228. package/dist/ai/codexAppServer/schema/generated/v2/ModelServiceTier.js +3 -0
  229. package/dist/ai/codexAppServer/schema/generated/v2/ModelServiceTier.js.map +1 -0
  230. package/dist/ai/codexAppServer/schema/generated/v2/NetworkUnixSocketPermission.d.ts +1 -1
  231. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileListParams.d.ts +15 -0
  232. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileListParams.d.ts.map +1 -0
  233. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileListParams.js +3 -0
  234. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileListParams.js.map +1 -0
  235. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileListResponse.d.ts +10 -0
  236. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileListResponse.d.ts.map +1 -0
  237. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileListResponse.js +3 -0
  238. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileListResponse.js.map +1 -0
  239. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileSummary.d.ts +11 -0
  240. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileSummary.d.ts.map +1 -0
  241. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileSummary.js +3 -0
  242. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileSummary.js.map +1 -0
  243. package/dist/ai/codexAppServer/schema/generated/v2/PermissionsRequestApprovalParams.d.ts +5 -0
  244. package/dist/ai/codexAppServer/schema/generated/v2/PermissionsRequestApprovalParams.d.ts.map +1 -1
  245. package/dist/ai/codexAppServer/schema/generated/v2/PluginAvailability.d.ts +2 -0
  246. package/dist/ai/codexAppServer/schema/generated/v2/PluginAvailability.d.ts.map +1 -0
  247. package/dist/ai/codexAppServer/schema/generated/v2/PluginAvailability.js +3 -0
  248. package/dist/ai/codexAppServer/schema/generated/v2/PluginAvailability.js.map +1 -0
  249. package/dist/ai/codexAppServer/schema/generated/v2/PluginDetail.d.ts +4 -0
  250. package/dist/ai/codexAppServer/schema/generated/v2/PluginDetail.d.ts.map +1 -1
  251. package/dist/ai/codexAppServer/schema/generated/v2/PluginHookSummary.d.ts +6 -0
  252. package/dist/ai/codexAppServer/schema/generated/v2/PluginHookSummary.d.ts.map +1 -0
  253. package/dist/ai/codexAppServer/schema/generated/v2/PluginHookSummary.js +3 -0
  254. package/dist/ai/codexAppServer/schema/generated/v2/PluginHookSummary.js.map +1 -0
  255. package/dist/ai/codexAppServer/schema/generated/v2/PluginInstalledParams.d.ts +13 -0
  256. package/dist/ai/codexAppServer/schema/generated/v2/PluginInstalledParams.d.ts.map +1 -0
  257. package/dist/ai/codexAppServer/schema/generated/v2/PluginInstalledParams.js +3 -0
  258. package/dist/ai/codexAppServer/schema/generated/v2/PluginInstalledParams.js.map +1 -0
  259. package/dist/ai/codexAppServer/schema/generated/v2/PluginInstalledResponse.d.ts +7 -0
  260. package/dist/ai/codexAppServer/schema/generated/v2/PluginInstalledResponse.d.ts.map +1 -0
  261. package/dist/ai/codexAppServer/schema/generated/v2/PluginInstalledResponse.js +3 -0
  262. package/dist/ai/codexAppServer/schema/generated/v2/PluginInstalledResponse.js.map +1 -0
  263. package/dist/ai/codexAppServer/schema/generated/v2/PluginListMarketplaceKind.d.ts +2 -0
  264. package/dist/ai/codexAppServer/schema/generated/v2/PluginListMarketplaceKind.d.ts.map +1 -0
  265. package/dist/ai/codexAppServer/schema/generated/v2/PluginListMarketplaceKind.js +3 -0
  266. package/dist/ai/codexAppServer/schema/generated/v2/PluginListMarketplaceKind.js.map +1 -0
  267. package/dist/ai/codexAppServer/schema/generated/v2/PluginListParams.d.ts +6 -0
  268. package/dist/ai/codexAppServer/schema/generated/v2/PluginListParams.d.ts.map +1 -1
  269. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareCheckoutParams.d.ts +4 -0
  270. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareCheckoutParams.d.ts.map +1 -0
  271. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareCheckoutParams.js +3 -0
  272. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareCheckoutParams.js.map +1 -0
  273. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareCheckoutResponse.d.ts +11 -0
  274. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareCheckoutResponse.d.ts.map +1 -0
  275. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareCheckoutResponse.js +3 -0
  276. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareCheckoutResponse.js.map +1 -0
  277. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareContext.d.ts +15 -0
  278. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareContext.d.ts.map +1 -0
  279. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareContext.js +3 -0
  280. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareContext.js.map +1 -0
  281. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareDeleteParams.d.ts +4 -0
  282. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareDeleteParams.d.ts.map +1 -0
  283. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareDeleteParams.js +3 -0
  284. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareDeleteParams.js.map +1 -0
  285. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareDeleteResponse.d.ts +2 -0
  286. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareDeleteResponse.d.ts.map +1 -0
  287. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareDeleteResponse.js +3 -0
  288. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareDeleteResponse.js.map +1 -0
  289. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareDiscoverability.d.ts +2 -0
  290. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareDiscoverability.d.ts.map +1 -0
  291. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareDiscoverability.js +3 -0
  292. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareDiscoverability.js.map +1 -0
  293. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareListItem.d.ts +7 -0
  294. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareListItem.d.ts.map +1 -0
  295. package/dist/ai/codexAppServer/schema/generated/v2/{DeviceKeySignParams.js → PluginShareListItem.js} +1 -1
  296. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareListItem.js.map +1 -0
  297. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareListParams.d.ts +2 -0
  298. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareListParams.d.ts.map +1 -0
  299. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareListParams.js +3 -0
  300. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareListParams.js.map +1 -0
  301. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareListResponse.d.ts +5 -0
  302. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareListResponse.d.ts.map +1 -0
  303. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareListResponse.js +3 -0
  304. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareListResponse.js.map +1 -0
  305. package/dist/ai/codexAppServer/schema/generated/v2/PluginSharePrincipal.d.ts +9 -0
  306. package/dist/ai/codexAppServer/schema/generated/v2/PluginSharePrincipal.d.ts.map +1 -0
  307. package/dist/ai/codexAppServer/schema/generated/v2/PluginSharePrincipal.js +3 -0
  308. package/dist/ai/codexAppServer/schema/generated/v2/PluginSharePrincipal.js.map +1 -0
  309. package/dist/ai/codexAppServer/schema/generated/v2/PluginSharePrincipalRole.d.ts +2 -0
  310. package/dist/ai/codexAppServer/schema/generated/v2/PluginSharePrincipalRole.d.ts.map +1 -0
  311. package/dist/ai/codexAppServer/schema/generated/v2/PluginSharePrincipalRole.js +3 -0
  312. package/dist/ai/codexAppServer/schema/generated/v2/PluginSharePrincipalRole.js.map +1 -0
  313. package/dist/ai/codexAppServer/schema/generated/v2/PluginSharePrincipalType.d.ts +2 -0
  314. package/dist/ai/codexAppServer/schema/generated/v2/PluginSharePrincipalType.d.ts.map +1 -0
  315. package/dist/ai/codexAppServer/schema/generated/v2/PluginSharePrincipalType.js +3 -0
  316. package/dist/ai/codexAppServer/schema/generated/v2/PluginSharePrincipalType.js.map +1 -0
  317. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareSaveParams.d.ts +10 -0
  318. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareSaveParams.d.ts.map +1 -0
  319. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareSaveParams.js +3 -0
  320. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareSaveParams.js.map +1 -0
  321. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareSaveResponse.d.ts +5 -0
  322. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareSaveResponse.d.ts.map +1 -0
  323. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareSaveResponse.js +3 -0
  324. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareSaveResponse.js.map +1 -0
  325. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareTarget.d.ts +8 -0
  326. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareTarget.d.ts.map +1 -0
  327. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareTarget.js +3 -0
  328. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareTarget.js.map +1 -0
  329. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareTargetRole.d.ts +2 -0
  330. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareTargetRole.d.ts.map +1 -0
  331. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareTargetRole.js +3 -0
  332. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareTargetRole.js.map +1 -0
  333. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareUpdateDiscoverability.d.ts +2 -0
  334. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareUpdateDiscoverability.d.ts.map +1 -0
  335. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareUpdateDiscoverability.js +3 -0
  336. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareUpdateDiscoverability.js.map +1 -0
  337. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareUpdateTargetsParams.d.ts +8 -0
  338. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareUpdateTargetsParams.d.ts.map +1 -0
  339. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareUpdateTargetsParams.js +3 -0
  340. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareUpdateTargetsParams.js.map +1 -0
  341. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareUpdateTargetsResponse.d.ts +7 -0
  342. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareUpdateTargetsResponse.d.ts.map +1 -0
  343. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareUpdateTargetsResponse.js +3 -0
  344. package/dist/ai/codexAppServer/schema/generated/v2/PluginShareUpdateTargetsResponse.js.map +1 -0
  345. package/dist/ai/codexAppServer/schema/generated/v2/PluginSkillReadParams.d.ts +6 -0
  346. package/dist/ai/codexAppServer/schema/generated/v2/PluginSkillReadParams.d.ts.map +1 -0
  347. package/dist/ai/codexAppServer/schema/generated/v2/PluginSkillReadParams.js +3 -0
  348. package/dist/ai/codexAppServer/schema/generated/v2/PluginSkillReadParams.js.map +1 -0
  349. package/dist/ai/codexAppServer/schema/generated/v2/PluginSkillReadResponse.d.ts +4 -0
  350. package/dist/ai/codexAppServer/schema/generated/v2/PluginSkillReadResponse.d.ts.map +1 -0
  351. package/dist/ai/codexAppServer/schema/generated/v2/PluginSkillReadResponse.js +3 -0
  352. package/dist/ai/codexAppServer/schema/generated/v2/PluginSkillReadResponse.js.map +1 -0
  353. package/dist/ai/codexAppServer/schema/generated/v2/PluginSummary.d.ts +19 -0
  354. package/dist/ai/codexAppServer/schema/generated/v2/PluginSummary.d.ts.map +1 -1
  355. package/dist/ai/codexAppServer/schema/generated/v2/ProcessExitedNotification.d.ts +40 -0
  356. package/dist/ai/codexAppServer/schema/generated/v2/ProcessExitedNotification.d.ts.map +1 -0
  357. package/dist/ai/codexAppServer/schema/generated/v2/ProcessExitedNotification.js +3 -0
  358. package/dist/ai/codexAppServer/schema/generated/v2/ProcessExitedNotification.js.map +1 -0
  359. package/dist/ai/codexAppServer/schema/generated/v2/ProcessOutputDeltaNotification.d.ts +24 -0
  360. package/dist/ai/codexAppServer/schema/generated/v2/ProcessOutputDeltaNotification.d.ts.map +1 -0
  361. package/dist/ai/codexAppServer/schema/generated/v2/ProcessOutputDeltaNotification.js +3 -0
  362. package/dist/ai/codexAppServer/schema/generated/v2/ProcessOutputDeltaNotification.js.map +1 -0
  363. package/dist/ai/codexAppServer/schema/generated/v2/ProcessOutputStream.d.ts +5 -0
  364. package/dist/ai/codexAppServer/schema/generated/v2/ProcessOutputStream.d.ts.map +1 -0
  365. package/dist/ai/codexAppServer/schema/generated/v2/ProcessOutputStream.js +3 -0
  366. package/dist/ai/codexAppServer/schema/generated/v2/ProcessOutputStream.js.map +1 -0
  367. package/dist/ai/codexAppServer/schema/generated/v2/ProcessTerminalSize.d.ts +14 -0
  368. package/dist/ai/codexAppServer/schema/generated/v2/ProcessTerminalSize.d.ts.map +1 -0
  369. package/dist/ai/codexAppServer/schema/generated/v2/ProcessTerminalSize.js +3 -0
  370. package/dist/ai/codexAppServer/schema/generated/v2/ProcessTerminalSize.js.map +1 -0
  371. package/dist/ai/codexAppServer/schema/generated/v2/RateLimitSnapshot.d.ts +2 -0
  372. package/dist/ai/codexAppServer/schema/generated/v2/RateLimitSnapshot.d.ts.map +1 -1
  373. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlConnectionStatus.d.ts +2 -0
  374. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlConnectionStatus.d.ts.map +1 -0
  375. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlConnectionStatus.js +3 -0
  376. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlConnectionStatus.js.map +1 -0
  377. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlStatusChangedNotification.d.ts +11 -0
  378. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlStatusChangedNotification.d.ts.map +1 -0
  379. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlStatusChangedNotification.js +3 -0
  380. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlStatusChangedNotification.js.map +1 -0
  381. package/dist/ai/codexAppServer/schema/generated/v2/SandboxPolicy.d.ts +0 -3
  382. package/dist/ai/codexAppServer/schema/generated/v2/SandboxPolicy.d.ts.map +1 -1
  383. package/dist/ai/codexAppServer/schema/generated/v2/SessionMigration.d.ts +6 -0
  384. package/dist/ai/codexAppServer/schema/generated/v2/SessionMigration.d.ts.map +1 -0
  385. package/dist/ai/codexAppServer/schema/generated/v2/SessionMigration.js +3 -0
  386. package/dist/ai/codexAppServer/schema/generated/v2/SessionMigration.js.map +1 -0
  387. package/dist/ai/codexAppServer/schema/generated/v2/SkillsExtraRootsSetParams.d.ts +5 -0
  388. package/dist/ai/codexAppServer/schema/generated/v2/SkillsExtraRootsSetParams.d.ts.map +1 -0
  389. package/dist/ai/codexAppServer/schema/generated/v2/SkillsExtraRootsSetParams.js +3 -0
  390. package/dist/ai/codexAppServer/schema/generated/v2/SkillsExtraRootsSetParams.js.map +1 -0
  391. package/dist/ai/codexAppServer/schema/generated/v2/SkillsExtraRootsSetResponse.d.ts +2 -0
  392. package/dist/ai/codexAppServer/schema/generated/v2/SkillsExtraRootsSetResponse.d.ts.map +1 -0
  393. package/dist/ai/codexAppServer/schema/generated/v2/SkillsExtraRootsSetResponse.js +3 -0
  394. package/dist/ai/codexAppServer/schema/generated/v2/SkillsExtraRootsSetResponse.js.map +1 -0
  395. package/dist/ai/codexAppServer/schema/generated/v2/SkillsListParams.d.ts +0 -5
  396. package/dist/ai/codexAppServer/schema/generated/v2/SkillsListParams.d.ts.map +1 -1
  397. package/dist/ai/codexAppServer/schema/generated/v2/SpendControlLimitSnapshot.d.ts +7 -0
  398. package/dist/ai/codexAppServer/schema/generated/v2/SpendControlLimitSnapshot.d.ts.map +1 -0
  399. package/dist/ai/codexAppServer/schema/generated/v2/SpendControlLimitSnapshot.js +3 -0
  400. package/dist/ai/codexAppServer/schema/generated/v2/SpendControlLimitSnapshot.js.map +1 -0
  401. package/dist/ai/codexAppServer/schema/generated/v2/SubagentMigration.d.ts +4 -0
  402. package/dist/ai/codexAppServer/schema/generated/v2/SubagentMigration.d.ts.map +1 -0
  403. package/dist/ai/codexAppServer/schema/generated/v2/SubagentMigration.js +3 -0
  404. package/dist/ai/codexAppServer/schema/generated/v2/SubagentMigration.js.map +1 -0
  405. package/dist/ai/codexAppServer/schema/generated/v2/Thread.d.ts +13 -0
  406. package/dist/ai/codexAppServer/schema/generated/v2/Thread.d.ts.map +1 -1
  407. package/dist/ai/codexAppServer/schema/generated/v2/ThreadForkParams.d.ts +7 -21
  408. package/dist/ai/codexAppServer/schema/generated/v2/ThreadForkParams.d.ts.map +1 -1
  409. package/dist/ai/codexAppServer/schema/generated/v2/ThreadForkResponse.d.ts +6 -16
  410. package/dist/ai/codexAppServer/schema/generated/v2/ThreadForkResponse.d.ts.map +1 -1
  411. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoal.d.ts +12 -0
  412. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoal.d.ts.map +1 -0
  413. package/dist/ai/codexAppServer/schema/generated/{ServiceTier.js → v2/ThreadGoal.js} +1 -1
  414. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoal.js.map +1 -0
  415. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalClearParams.d.ts +4 -0
  416. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalClearParams.d.ts.map +1 -0
  417. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalClearParams.js +3 -0
  418. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalClearParams.js.map +1 -0
  419. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalClearResponse.d.ts +4 -0
  420. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalClearResponse.d.ts.map +1 -0
  421. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalClearResponse.js +3 -0
  422. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalClearResponse.js.map +1 -0
  423. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalClearedNotification.d.ts +4 -0
  424. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalClearedNotification.d.ts.map +1 -0
  425. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalClearedNotification.js +3 -0
  426. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalClearedNotification.js.map +1 -0
  427. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalGetParams.d.ts +4 -0
  428. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalGetParams.d.ts.map +1 -0
  429. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalGetParams.js +3 -0
  430. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalGetParams.js.map +1 -0
  431. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalGetResponse.d.ts +5 -0
  432. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalGetResponse.d.ts.map +1 -0
  433. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalGetResponse.js +3 -0
  434. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalGetResponse.js.map +1 -0
  435. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalSetParams.d.ts +8 -0
  436. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalSetParams.d.ts.map +1 -0
  437. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalSetParams.js +3 -0
  438. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalSetParams.js.map +1 -0
  439. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalSetResponse.d.ts +5 -0
  440. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalSetResponse.d.ts.map +1 -0
  441. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalSetResponse.js +3 -0
  442. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalSetResponse.js.map +1 -0
  443. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalStatus.d.ts +2 -0
  444. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalStatus.d.ts.map +1 -0
  445. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalStatus.js +3 -0
  446. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalStatus.js.map +1 -0
  447. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalUpdatedNotification.d.ts +7 -0
  448. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalUpdatedNotification.d.ts.map +1 -0
  449. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalUpdatedNotification.js +3 -0
  450. package/dist/ai/codexAppServer/schema/generated/v2/ThreadGoalUpdatedNotification.js.map +1 -0
  451. package/dist/ai/codexAppServer/schema/generated/v2/ThreadItem.d.ts +2 -0
  452. package/dist/ai/codexAppServer/schema/generated/v2/ThreadItem.d.ts.map +1 -1
  453. package/dist/ai/codexAppServer/schema/generated/v2/ThreadReadParams.d.ts +1 -1
  454. package/dist/ai/codexAppServer/schema/generated/v2/ThreadReadParams.d.ts.map +1 -1
  455. package/dist/ai/codexAppServer/schema/generated/v2/ThreadRealtimeStartedNotification.d.ts +1 -1
  456. package/dist/ai/codexAppServer/schema/generated/v2/ThreadRealtimeStartedNotification.d.ts.map +1 -1
  457. package/dist/ai/codexAppServer/schema/generated/v2/ThreadResumeInitialTurnsPageParams.d.ts +17 -0
  458. package/dist/ai/codexAppServer/schema/generated/v2/ThreadResumeInitialTurnsPageParams.d.ts.map +1 -0
  459. package/dist/ai/codexAppServer/schema/generated/v2/ThreadResumeInitialTurnsPageParams.js +3 -0
  460. package/dist/ai/codexAppServer/schema/generated/v2/ThreadResumeInitialTurnsPageParams.js.map +1 -0
  461. package/dist/ai/codexAppServer/schema/generated/v2/ThreadResumeParams.d.ts +10 -30
  462. package/dist/ai/codexAppServer/schema/generated/v2/ThreadResumeParams.d.ts.map +1 -1
  463. package/dist/ai/codexAppServer/schema/generated/v2/ThreadResumeResponse.d.ts +6 -16
  464. package/dist/ai/codexAppServer/schema/generated/v2/ThreadResumeResponse.d.ts.map +1 -1
  465. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSearchResult.d.ts +6 -0
  466. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSearchResult.d.ts.map +1 -0
  467. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSearchResult.js +3 -0
  468. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSearchResult.js.map +1 -0
  469. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSettings.d.ts +24 -0
  470. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSettings.d.ts.map +1 -0
  471. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSettings.js +3 -0
  472. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSettings.js.map +1 -0
  473. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSettingsUpdatedNotification.d.ts +6 -0
  474. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSettingsUpdatedNotification.d.ts.map +1 -0
  475. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSettingsUpdatedNotification.js +3 -0
  476. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSettingsUpdatedNotification.js.map +1 -0
  477. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSource.d.ts +2 -0
  478. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSource.d.ts.map +1 -0
  479. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSource.js +3 -0
  480. package/dist/ai/codexAppServer/schema/generated/v2/ThreadSource.js.map +1 -0
  481. package/dist/ai/codexAppServer/schema/generated/v2/ThreadStartParams.d.ts +5 -15
  482. package/dist/ai/codexAppServer/schema/generated/v2/ThreadStartParams.d.ts.map +1 -1
  483. package/dist/ai/codexAppServer/schema/generated/v2/ThreadStartResponse.d.ts +6 -16
  484. package/dist/ai/codexAppServer/schema/generated/v2/ThreadStartResponse.d.ts.map +1 -1
  485. package/dist/ai/codexAppServer/schema/generated/v2/ToolsV2.d.ts +0 -1
  486. package/dist/ai/codexAppServer/schema/generated/v2/ToolsV2.d.ts.map +1 -1
  487. package/dist/ai/codexAppServer/schema/generated/v2/Turn.d.ts +6 -3
  488. package/dist/ai/codexAppServer/schema/generated/v2/Turn.d.ts.map +1 -1
  489. package/dist/ai/codexAppServer/schema/generated/v2/TurnItemsView.d.ts +2 -0
  490. package/dist/ai/codexAppServer/schema/generated/v2/TurnItemsView.d.ts.map +1 -0
  491. package/dist/ai/codexAppServer/schema/generated/v2/TurnItemsView.js +3 -0
  492. package/dist/ai/codexAppServer/schema/generated/v2/TurnItemsView.js.map +1 -0
  493. package/dist/ai/codexAppServer/schema/generated/v2/TurnModerationMetadataNotification.d.ts +7 -0
  494. package/dist/ai/codexAppServer/schema/generated/v2/TurnModerationMetadataNotification.d.ts.map +1 -0
  495. package/dist/ai/codexAppServer/schema/generated/v2/TurnModerationMetadataNotification.js +3 -0
  496. package/dist/ai/codexAppServer/schema/generated/v2/TurnModerationMetadataNotification.js.map +1 -0
  497. package/dist/ai/codexAppServer/schema/generated/v2/TurnStartParams.d.ts +3 -16
  498. package/dist/ai/codexAppServer/schema/generated/v2/TurnStartParams.d.ts.map +1 -1
  499. package/dist/ai/codexAppServer/schema/generated/v2/TurnSteerParams.d.ts +1 -0
  500. package/dist/ai/codexAppServer/schema/generated/v2/TurnSteerParams.d.ts.map +1 -1
  501. package/dist/ai/codexAppServer/schema/generated/v2/TurnsPage.d.ts +7 -0
  502. package/dist/ai/codexAppServer/schema/generated/v2/TurnsPage.d.ts.map +1 -0
  503. package/dist/ai/codexAppServer/schema/generated/v2/{ProfileV2.js → TurnsPage.js} +1 -1
  504. package/dist/ai/codexAppServer/schema/generated/v2/TurnsPage.js.map +1 -0
  505. package/dist/ai/codexAppServer/schema/generated/v2/UserInput.d.ts +3 -0
  506. package/dist/ai/codexAppServer/schema/generated/v2/UserInput.d.ts.map +1 -1
  507. package/dist/ai/codexAppServer/schema/generated/v2/WindowsSandboxReadiness.d.ts +2 -0
  508. package/dist/ai/codexAppServer/schema/generated/v2/WindowsSandboxReadiness.d.ts.map +1 -0
  509. package/dist/ai/codexAppServer/schema/generated/v2/WindowsSandboxReadiness.js +3 -0
  510. package/dist/ai/codexAppServer/schema/generated/v2/WindowsSandboxReadiness.js.map +1 -0
  511. package/dist/ai/codexAppServer/schema/generated/v2/WindowsSandboxReadinessResponse.d.ts +5 -0
  512. package/dist/ai/codexAppServer/schema/generated/v2/WindowsSandboxReadinessResponse.d.ts.map +1 -0
  513. package/dist/ai/codexAppServer/schema/generated/v2/WindowsSandboxReadinessResponse.js +3 -0
  514. package/dist/ai/codexAppServer/schema/generated/v2/WindowsSandboxReadinessResponse.js.map +1 -0
  515. package/dist/ai/codexAppServer/schema/generated/v2/index.d.ts +84 -20
  516. package/dist/ai/codexAppServer/schema/generated/v2/index.d.ts.map +1 -1
  517. package/dist/ai/codexAppServer/serverRequestIds.d.ts +3 -0
  518. package/dist/ai/codexAppServer/serverRequestIds.d.ts.map +1 -0
  519. package/dist/ai/codexAppServer/serverRequestIds.js +6 -0
  520. package/dist/ai/codexAppServer/serverRequestIds.js.map +1 -0
  521. package/dist/ai/codexAppServer/version.d.ts +1 -1
  522. package/dist/ai/codexAppServer/version.js +1 -1
  523. package/dist/ai/codexQuota.js +1 -1
  524. package/dist/ai/codexQuota.js.map +1 -1
  525. package/dist/ai/provider.d.ts +26 -6
  526. package/dist/ai/provider.d.ts.map +1 -1
  527. package/dist/ai/provider.js.map +1 -1
  528. package/dist/ai/sessionManager.d.ts +1 -1
  529. package/dist/ai/sessionManager.d.ts.map +1 -1
  530. package/dist/ai/sessionManager.js +18 -11
  531. package/dist/ai/sessionManager.js.map +1 -1
  532. package/dist/handlers/messageHandler.js +2 -2
  533. package/dist/handlers/messageHandler.js.map +1 -1
  534. package/dist/index.js +2 -2
  535. package/dist/service/ipcClient.js +1 -1
  536. package/dist/service/run.js +1 -1
  537. package/dist/service/types.js +1 -1
  538. package/dist/terminal/terminalManager.d.ts +1 -0
  539. package/dist/terminal/terminalManager.d.ts.map +1 -1
  540. package/dist/terminal/terminalManager.js +4 -0
  541. package/dist/terminal/terminalManager.js.map +1 -1
  542. package/package.json +3 -3
  543. package/dist/ai/codexAppServer/schema/generated/GhostCommit.d.ts +0 -10
  544. package/dist/ai/codexAppServer/schema/generated/GhostCommit.d.ts.map +0 -1
  545. package/dist/ai/codexAppServer/schema/generated/GhostCommit.js.map +0 -1
  546. package/dist/ai/codexAppServer/schema/generated/ServiceTier.d.ts +0 -2
  547. package/dist/ai/codexAppServer/schema/generated/ServiceTier.d.ts.map +0 -1
  548. package/dist/ai/codexAppServer/schema/generated/ServiceTier.js.map +0 -1
  549. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyAlgorithm.d.ts +0 -5
  550. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyAlgorithm.d.ts.map +0 -1
  551. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyAlgorithm.js.map +0 -1
  552. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyCreateParams.d.ts +0 -13
  553. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyCreateParams.d.ts.map +0 -1
  554. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyCreateParams.js.map +0 -1
  555. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyCreateResponse.d.ts +0 -15
  556. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyCreateResponse.d.ts.map +0 -1
  557. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyCreateResponse.js +0 -3
  558. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyCreateResponse.js.map +0 -1
  559. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyProtectionClass.d.ts +0 -5
  560. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyProtectionClass.d.ts.map +0 -1
  561. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyProtectionClass.js +0 -3
  562. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyProtectionClass.js.map +0 -1
  563. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyProtectionPolicy.d.ts +0 -5
  564. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyProtectionPolicy.d.ts.map +0 -1
  565. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyProtectionPolicy.js +0 -3
  566. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyProtectionPolicy.js.map +0 -1
  567. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyPublicParams.d.ts +0 -7
  568. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyPublicParams.d.ts.map +0 -1
  569. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyPublicParams.js +0 -3
  570. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyPublicParams.js.map +0 -1
  571. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyPublicResponse.d.ts +0 -15
  572. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyPublicResponse.d.ts.map +0 -1
  573. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyPublicResponse.js +0 -3
  574. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeyPublicResponse.js.map +0 -1
  575. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeySignParams.d.ts +0 -9
  576. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeySignParams.d.ts.map +0 -1
  577. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeySignParams.js.map +0 -1
  578. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeySignPayload.d.ts +0 -63
  579. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeySignPayload.d.ts.map +0 -1
  580. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeySignPayload.js +0 -3
  581. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeySignPayload.js.map +0 -1
  582. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeySignResponse.d.ts +0 -17
  583. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeySignResponse.d.ts.map +0 -1
  584. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeySignResponse.js +0 -3
  585. package/dist/ai/codexAppServer/schema/generated/v2/DeviceKeySignResponse.js.map +0 -1
  586. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfile.d.ts +0 -13
  587. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfile.d.ts.map +0 -1
  588. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfile.js.map +0 -1
  589. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileFileSystemPermissions.d.ts +0 -9
  590. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileFileSystemPermissions.d.ts.map +0 -1
  591. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileFileSystemPermissions.js +0 -3
  592. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileFileSystemPermissions.js.map +0 -1
  593. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileNetworkPermissions.d.ts +0 -4
  594. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileNetworkPermissions.d.ts.map +0 -1
  595. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileNetworkPermissions.js +0 -3
  596. package/dist/ai/codexAppServer/schema/generated/v2/PermissionProfileNetworkPermissions.js.map +0 -1
  597. package/dist/ai/codexAppServer/schema/generated/v2/ProfileV2.d.ts +0 -31
  598. package/dist/ai/codexAppServer/schema/generated/v2/ProfileV2.d.ts.map +0 -1
  599. package/dist/ai/codexAppServer/schema/generated/v2/ProfileV2.js.map +0 -1
  600. package/dist/ai/codexAppServer/schema/generated/v2/ReadOnlyAccess.d.ts +0 -9
  601. package/dist/ai/codexAppServer/schema/generated/v2/ReadOnlyAccess.d.ts.map +0 -1
  602. package/dist/ai/codexAppServer/schema/generated/v2/ReadOnlyAccess.js.map +0 -1
  603. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlClientConnectionAudience.d.ts +0 -5
  604. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlClientConnectionAudience.d.ts.map +0 -1
  605. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlClientConnectionAudience.js +0 -3
  606. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlClientConnectionAudience.js.map +0 -1
  607. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlClientEnrollmentAudience.d.ts +0 -5
  608. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlClientEnrollmentAudience.d.ts.map +0 -1
  609. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlClientEnrollmentAudience.js +0 -3
  610. package/dist/ai/codexAppServer/schema/generated/v2/RemoteControlClientEnrollmentAudience.js.map +0 -1
  611. package/dist/ai/codexAppServer/schema/generated/v2/SkillsListExtraRootsForCwd.d.ts +0 -5
  612. package/dist/ai/codexAppServer/schema/generated/v2/SkillsListExtraRootsForCwd.d.ts.map +0 -1
  613. package/dist/ai/codexAppServer/schema/generated/v2/SkillsListExtraRootsForCwd.js +0 -3
  614. package/dist/ai/codexAppServer/schema/generated/v2/SkillsListExtraRootsForCwd.js.map +0 -1
  615. package/dist/ai/codexAppServer/schema/generated/v2/ThreadTurnsListParams.d.ts +0 -17
  616. package/dist/ai/codexAppServer/schema/generated/v2/ThreadTurnsListParams.d.ts.map +0 -1
  617. package/dist/ai/codexAppServer/schema/generated/v2/ThreadTurnsListParams.js +0 -3
  618. package/dist/ai/codexAppServer/schema/generated/v2/ThreadTurnsListParams.js.map +0 -1
  619. package/dist/ai/codexAppServer/schema/generated/v2/ThreadTurnsListResponse.d.ts +0 -17
  620. package/dist/ai/codexAppServer/schema/generated/v2/ThreadTurnsListResponse.d.ts.map +0 -1
  621. package/dist/ai/codexAppServer/schema/generated/v2/ThreadTurnsListResponse.js +0 -3
  622. package/dist/ai/codexAppServer/schema/generated/v2/ThreadTurnsListResponse.js.map +0 -1
@@ -5,11 +5,13 @@ import { buildSandboxMcpServerConfig, SANDBOX_MCP_NAME } from '../sandboxMcp.js'
5
5
  import { normalizePermissionLevelForAgent } from '../provider.js';
6
6
  import { makeQueuedUserPrompt, queueStateFor } from '../queuedUserPrompts.js';
7
7
  import { getEventStore } from '../../storage/eventStore.js';
8
- import { consumeAppServerStream } from './cardAdapter.js';
8
+ import { createCodexTurnStreamConsumer, } from './cardAdapter.js';
9
9
  import { codexApprovalResponse, codexApprovalToPermissionPrompt, } from './approvalMapping.js';
10
10
  import { detectCodexVersion, spawnAppServer } from './processManager.js';
11
11
  import { RuntimeOverrideStore } from './overrideStore.js';
12
12
  import { TokenAccounting } from './tokenAccounting.js';
13
+ import { codexProtocolPreview } from './protocolLog.js';
14
+ import { codexServerRequestInputId } from './serverRequestIds.js';
13
15
  const __ownDir = dirname(fileURLToPath(import.meta.url));
14
16
  const __aiDir = dirname(__ownDir);
15
17
  /**
@@ -71,10 +73,13 @@ export class CodexAppServerProvider {
71
73
  onExitedFire: callbacks.onSessionExited,
72
74
  });
73
75
  callbacks.onModelDetected(response.model);
76
+ void session.refreshGoalConfig().catch((err) => {
77
+ console.warn(`[codex-app] failed to refresh goal session=${response.thread.id.slice(0, 8)}: ${err instanceof Error ? err.message : String(err)}`);
78
+ });
74
79
  // First-turn overrides from opts (effort etc.) get queued so drain()
75
80
  // attaches them to the next turn/start.
76
81
  overrideStore.enqueue(perTurnOverridesFromOpts(opts, response));
77
- void session.runTurn(opts.prompt, opts.attachments);
82
+ scheduleInitialTurn(session, opts.prompt, opts.attachments);
78
83
  return { sessionId: response.thread.id, session };
79
84
  }
80
85
  async resumeSession(opts, cardBuilder, callbacks) {
@@ -102,11 +107,24 @@ export class CodexAppServerProvider {
102
107
  onExitedFire: callbacks.onSessionExited,
103
108
  });
104
109
  callbacks.onModelDetected(response.model);
110
+ void session.refreshGoalConfig().catch((err) => {
111
+ console.warn(`[codex-app] failed to refresh goal session=${response.thread.id.slice(0, 8)}: ${err instanceof Error ? err.message : String(err)}`);
112
+ });
105
113
  overrideStore.enqueue(perTurnOverridesFromOpts(opts, response));
106
- void session.runTurn(opts.prompt, opts.attachments);
114
+ scheduleInitialTurn(session, opts.prompt, opts.attachments);
107
115
  return { sessionId: response.thread.id, session };
108
116
  }
109
117
  }
118
+ function scheduleInitialTurn(session, prompt, attachments) {
119
+ // Give SessionManager and messageHandler one macrotask to register the
120
+ // session and persist the mcpCorrId-backed registry entry before the model
121
+ // can call Quicksave's MCP tools. Without this, the first
122
+ // UpdateSessionStatus call in a fresh Codex turn can see `source: "unknown"`.
123
+ setTimeout(() => {
124
+ if (session.alive)
125
+ void session.runTurn(prompt, attachments);
126
+ }, 0);
127
+ }
110
128
  export class CodexAppServerSession {
111
129
  handle;
112
130
  tokens;
@@ -117,7 +135,13 @@ export class CodexAppServerSession {
117
135
  currentTurnId = null;
118
136
  pendingTurns = [];
119
137
  running = false;
138
+ startingRunTurn = false;
139
+ prestartedRunTurnId = null;
120
140
  exited = false;
141
+ turnConsumers = new Map();
142
+ settledTurnIds = new Set();
143
+ unsubscribeSessionNotifications = null;
144
+ unsubscribeTransportClose = null;
121
145
  constructor(args) {
122
146
  this.handle = args.handle;
123
147
  this.tokens = args.tokens;
@@ -130,6 +154,12 @@ export class CodexAppServerSession {
130
154
  this.handle.rpc.setServerRequestHandler(async (req) => {
131
155
  return this.handleServerRequest(req);
132
156
  });
157
+ this.unsubscribeSessionNotifications = this.handle.rpc.onNotification((notification) => {
158
+ this.handleSessionNotification(notification);
159
+ });
160
+ this.unsubscribeTransportClose = this.handle.rpc.onClose(() => {
161
+ this.handleTransportClosed();
162
+ });
133
163
  // If the child exits unexpectedly, mark us dead and notify SessionManager.
134
164
  this.handle.child.once('exit', () => {
135
165
  if (this.exited)
@@ -142,9 +172,9 @@ export class CodexAppServerSession {
142
172
  return !this.exited;
143
173
  }
144
174
  sendUserMessage(prompt, attachments) {
145
- if (this.currentTurnId) {
146
- this.pendingTurns.push(makeQueuedUserPrompt(prompt, attachments));
147
- this.callbacks.onQueueStateChange?.(this.threadId);
175
+ const activeTurnId = this.currentTurnId;
176
+ if (activeTurnId) {
177
+ void this.steerOrQueue(prompt, attachments, activeTurnId);
148
178
  return;
149
179
  }
150
180
  void this.runTurn(prompt, attachments);
@@ -152,12 +182,7 @@ export class CodexAppServerSession {
152
182
  interruptThenSendUserMessage(prompt, attachments) {
153
183
  if (this.currentTurnId)
154
184
  this.interrupt();
155
- if (this.running) {
156
- this.pendingTurns.push(makeQueuedUserPrompt(prompt, attachments));
157
- this.callbacks.onQueueStateChange?.(this.threadId);
158
- return;
159
- }
160
- void this.runTurn(prompt, attachments);
185
+ this.enqueueOrRunTurn(prompt, attachments);
161
186
  }
162
187
  getQueueState() {
163
188
  return queueStateFor(this.pendingTurns, this.currentTurnId !== null);
@@ -168,11 +193,45 @@ export class CodexAppServerSession {
168
193
  hasPendingOverride() {
169
194
  return this.overrideStore.hasPending();
170
195
  }
196
+ async sendControlRequest(subtype, params) {
197
+ switch (subtype) {
198
+ case 'goal.get':
199
+ case 'thread/goal/get':
200
+ return this.refreshGoalConfigAndReturn();
201
+ case 'goal.set':
202
+ case 'goal.update':
203
+ case 'thread/goal/set': {
204
+ const response = await this.handle.rpc.request('thread/goal/set', this.goalSetParams(params));
205
+ this.emitGoalConfig(response.goal);
206
+ return response;
207
+ }
208
+ case 'goal.pause': {
209
+ const response = await this.handle.rpc.request('thread/goal/set', { threadId: this.threadId, status: 'paused' });
210
+ this.emitGoalConfig(response.goal);
211
+ return response;
212
+ }
213
+ case 'goal.resume': {
214
+ const response = await this.handle.rpc.request('thread/goal/set', { threadId: this.threadId, status: 'active' });
215
+ this.emitGoalConfig(response.goal);
216
+ return response;
217
+ }
218
+ case 'goal.clear':
219
+ case 'thread/goal/clear': {
220
+ const response = await this.handle.rpc.request('thread/goal/clear', { threadId: this.threadId });
221
+ this.emitGoalClearedConfig();
222
+ return response;
223
+ }
224
+ default:
225
+ throw new Error(`Unsupported Codex control request subtype: ${subtype}`);
226
+ }
227
+ }
228
+ async refreshGoalConfig() {
229
+ await this.refreshGoalConfigAndReturn();
230
+ }
171
231
  async listSlashCommands(opts) {
172
232
  const response = await this.handle.rpc.request('skills/list', {
173
233
  cwds: opts?.cwd ? [opts.cwd] : [],
174
234
  forceReload: opts?.forceReload === true,
175
- perCwdExtraUserRoots: null,
176
235
  });
177
236
  return codexSkillsToSlashCommands(response, opts?.cwd);
178
237
  }
@@ -190,6 +249,11 @@ export class CodexAppServerSession {
190
249
  return;
191
250
  this.exited = true;
192
251
  this.pendingTurns = [];
252
+ this.unsubscribeSessionNotifications?.();
253
+ this.unsubscribeSessionNotifications = null;
254
+ this.unsubscribeTransportClose?.();
255
+ this.unsubscribeTransportClose = null;
256
+ this.closeTurnConsumersAsInterrupted();
193
257
  try {
194
258
  await this.cardBuilder.persistCards();
195
259
  }
@@ -209,8 +273,8 @@ export class CodexAppServerSession {
209
273
  // best-effort
210
274
  }
211
275
  }
212
- /** Run a single turn end-to-end: cb.startNewTurn → cb.userMessage
213
- * turn/start → consume notifications emit stream-end. */
276
+ /** Run a single explicit turn end-to-end: cb.startNewTurn → cb.userMessage
277
+ * turn/start → wait for the session-routed turn consumer to settle. */
214
278
  async runTurn(prompt, attachments) {
215
279
  if (this.exited)
216
280
  return;
@@ -259,6 +323,22 @@ export class CodexAppServerSession {
259
323
  this.callbacks.onQueueStateChange?.(this.threadId);
260
324
  return true;
261
325
  }
326
+ async steerOrQueue(prompt, attachments, expectedTurnId) {
327
+ const steered = await this.steerCurrentTurn(prompt, attachments, expectedTurnId);
328
+ if (steered)
329
+ return;
330
+ this.enqueueOrRunTurn(prompt, attachments);
331
+ }
332
+ enqueueOrRunTurn(prompt, attachments) {
333
+ if (this.exited)
334
+ return;
335
+ if (this.running || this.currentTurnId) {
336
+ this.pendingTurns.push(makeQueuedUserPrompt(prompt, attachments));
337
+ this.callbacks.onQueueStateChange?.(this.threadId);
338
+ return;
339
+ }
340
+ void this.runTurn(prompt, attachments);
341
+ }
262
342
  async steerCurrentTurn(prompt, attachments, expectedTurnId, opts) {
263
343
  try {
264
344
  if (attachments && attachments.length > 0) {
@@ -314,17 +394,24 @@ export class CodexAppServerSession {
314
394
  input: attachmentsToCodexUserInput(prompt, attachments),
315
395
  ...drained,
316
396
  };
317
- const response = await this.handle.rpc.request('turn/start', params);
397
+ this.startingRunTurn = true;
398
+ this.prestartedRunTurnId = null;
399
+ let response;
400
+ try {
401
+ response = await this.handle.rpc.request('turn/start', params);
402
+ }
403
+ finally {
404
+ this.startingRunTurn = false;
405
+ }
318
406
  this.overrideStore.commit();
319
407
  turnId = response.turn.id;
320
408
  this.currentTurnId = turnId;
321
409
  cb.setCurrentTurnId(turnId);
322
- const result = await consumeAppServerStream(this.handle.rpc, cb, {
323
- sessionId: this.threadId,
324
- threadId: this.threadId,
325
- turnId,
326
- tokens: this.tokens,
327
- }, this.callbacks);
410
+ const prestartedTurnId = this.prestartedRunTurnId;
411
+ if (prestartedTurnId && prestartedTurnId !== turnId) {
412
+ console.warn(`[codex-app] turn/start response mismatch session=${this.threadId.slice(0, 8)} response=${turnId.slice(0, 8)} notification=${prestartedTurnId.slice(0, 8)}`);
413
+ }
414
+ const result = await this.beginTurnConsumer(turnId, { managedByRunTurn: true }).result;
328
415
  void result; // settled; stream-end already emitted by adapter
329
416
  }
330
417
  catch (err) {
@@ -338,19 +425,191 @@ export class CodexAppServerSession {
338
425
  });
339
426
  }
340
427
  finally {
428
+ this.startingRunTurn = false;
429
+ const lifecycleTurnId = turnId ?? this.prestartedRunTurnId;
430
+ this.prestartedRunTurnId = null;
431
+ await this.finishTurnLifecycle(lifecycleTurnId);
432
+ }
433
+ }
434
+ async refreshGoalConfigAndReturn() {
435
+ const response = await this.handle.rpc.request('thread/goal/get', { threadId: this.threadId });
436
+ if (response.goal) {
437
+ this.emitGoalConfig(response.goal);
438
+ }
439
+ else {
440
+ this.emitGoalClearedConfig();
441
+ }
442
+ return response;
443
+ }
444
+ goalSetParams(params) {
445
+ const out = { threadId: this.threadId };
446
+ const input = params ?? {};
447
+ if ('objective' in input) {
448
+ out.objective = normalizeGoalObjective(input.objective);
449
+ }
450
+ if ('status' in input) {
451
+ out.status = normalizeGoalStatusOrNull(input.status);
452
+ }
453
+ if ('tokenBudget' in input) {
454
+ out.tokenBudget = normalizeGoalTokenBudget(input.tokenBudget);
455
+ }
456
+ return out;
457
+ }
458
+ beginTurnConsumer(turnId, opts) {
459
+ const existing = this.turnConsumers.get(turnId);
460
+ if (existing)
461
+ return existing;
462
+ this.settledTurnIds.delete(turnId);
463
+ const consumer = createCodexTurnStreamConsumer(this.cardBuilder, {
464
+ sessionId: this.threadId,
465
+ threadId: this.threadId,
466
+ turnId,
467
+ tokens: this.tokens,
468
+ }, this.callbacks);
469
+ this.turnConsumers.set(turnId, consumer);
470
+ void consumer.result.then(() => {
471
+ void this.handleTurnConsumerSettled(turnId, consumer, opts.managedByRunTurn).catch((err) => {
472
+ console.warn(`[codex-app] failed to settle turn consumer session=${this.threadId.slice(0, 8)} turn=${turnId.slice(0, 8)} error=${err instanceof Error ? err.message : String(err)}`);
473
+ });
474
+ });
475
+ return consumer;
476
+ }
477
+ async handleTurnConsumerSettled(turnId, consumer, managedByRunTurn) {
478
+ if (this.turnConsumers.get(turnId) === consumer) {
479
+ this.turnConsumers.delete(turnId);
480
+ }
481
+ this.rememberSettledTurn(turnId);
482
+ consumer.dispose();
483
+ if (managedByRunTurn)
484
+ return;
485
+ await this.finishTurnLifecycle(turnId);
486
+ this.drainPendingTurnsAfterObservedTurn();
487
+ }
488
+ async finishTurnLifecycle(turnId) {
489
+ const builderTurnId = this.cardBuilder.getCurrentTurnId();
490
+ const shouldClearCards = !turnId || !builderTurnId || builderTurnId === turnId;
491
+ if (!turnId || this.currentTurnId === turnId) {
341
492
  this.currentTurnId = null;
342
- try {
343
- await cb.persistCards();
344
- }
345
- catch {
346
- // best-effort
493
+ }
494
+ try {
495
+ await this.cardBuilder.persistCards();
496
+ }
497
+ catch {
498
+ // best-effort
499
+ }
500
+ if (shouldClearCards) {
501
+ this.cardBuilder.clearCards();
502
+ }
503
+ this.callbacks.onTurnSettled?.(this.threadId);
504
+ }
505
+ drainPendingTurnsAfterObservedTurn() {
506
+ if (this.exited || this.running || this.currentTurnId || this.pendingTurns.length === 0) {
507
+ return;
508
+ }
509
+ const next = this.pendingTurns.shift();
510
+ this.callbacks.onQueueStateChange?.(this.threadId);
511
+ void this.runTurn(next.prompt, next.attachments);
512
+ }
513
+ closeTurnConsumersAsInterrupted() {
514
+ for (const consumer of this.turnConsumers.values()) {
515
+ consumer.closeAsInterrupted();
516
+ }
517
+ }
518
+ handleTransportClosed() {
519
+ this.closeTurnConsumersAsInterrupted();
520
+ }
521
+ rememberSettledTurn(turnId) {
522
+ this.settledTurnIds.add(turnId);
523
+ if (this.settledTurnIds.size <= 100)
524
+ return;
525
+ const oldest = this.settledTurnIds.values().next().value;
526
+ if (oldest)
527
+ this.settledTurnIds.delete(oldest);
528
+ }
529
+ handleSessionNotification(notification) {
530
+ try {
531
+ this.observeTokenUsageNotification(notification);
532
+ const turnId = this.ensureTurnConsumerForNotification(notification);
533
+ this.dispatchTurnNotification(notification, turnId);
534
+ switch (notification.method) {
535
+ case 'thread/goal/updated': {
536
+ const params = notification.params;
537
+ if (params.threadId !== this.threadId)
538
+ return;
539
+ this.emitGoalConfig(params.goal);
540
+ return;
541
+ }
542
+ case 'thread/goal/cleared': {
543
+ const params = notification.params;
544
+ if (params.threadId !== this.threadId)
545
+ return;
546
+ this.emitGoalClearedConfig();
547
+ return;
548
+ }
549
+ default:
550
+ return;
347
551
  }
348
- cb.clearCards();
349
- this.callbacks.onTurnSettled?.(this.threadId);
350
552
  }
553
+ catch (err) {
554
+ console.warn(`[codex-app] failed to handle session notification method=${notification.method} session=${this.threadId.slice(0, 8)} params=${codexProtocolPreview(notification.params)} error=${err instanceof Error ? err.message : String(err)}`);
555
+ }
556
+ }
557
+ observeTokenUsageNotification(notification) {
558
+ if (notification.method !== 'thread/tokenUsage/updated')
559
+ return;
560
+ if (!notificationBelongsToThread(notification.params, this.threadId))
561
+ return;
562
+ this.tokens.observe(notification.params);
563
+ }
564
+ ensureTurnConsumerForNotification(notification) {
565
+ if (!notificationBelongsToThread(notification.params, this.threadId))
566
+ return null;
567
+ const turnId = notificationTurnId(notification);
568
+ if (!turnId)
569
+ return null;
570
+ if (this.settledTurnIds.has(turnId))
571
+ return turnId;
572
+ const existing = this.turnConsumers.get(turnId);
573
+ if (existing)
574
+ return turnId;
575
+ if (!shouldCreateTurnConsumerForNotification(notification.method))
576
+ return turnId;
577
+ const managedByRunTurn = this.startingRunTurn || this.currentTurnId === turnId;
578
+ if (this.startingRunTurn) {
579
+ this.prestartedRunTurnId = turnId;
580
+ }
581
+ if (managedByRunTurn) {
582
+ this.currentTurnId = turnId;
583
+ this.cardBuilder.setCurrentTurnId(turnId);
584
+ }
585
+ else {
586
+ this.cardBuilder.startNewTurn(turnId);
587
+ this.currentTurnId = turnId;
588
+ this.callbacks.onQueueStateChange?.(this.threadId);
589
+ }
590
+ this.beginTurnConsumer(turnId, { managedByRunTurn });
591
+ return turnId;
592
+ }
593
+ dispatchTurnNotification(notification, turnId) {
594
+ if (!notificationBelongsToThread(notification.params, this.threadId))
595
+ return;
596
+ if (turnId) {
597
+ this.turnConsumers.get(turnId)?.dispatch(notification);
598
+ return;
599
+ }
600
+ for (const consumer of this.turnConsumers.values()) {
601
+ consumer.dispatch(notification);
602
+ }
603
+ }
604
+ emitGoalConfig(goal) {
605
+ this.callbacks.onSessionConfigPatch?.(this.threadId, codexGoalToConfigPatch(goal));
606
+ }
607
+ emitGoalClearedConfig() {
608
+ this.callbacks.onSessionConfigPatch?.(this.threadId, clearedGoalConfigPatch());
351
609
  }
352
610
  async handleServerRequest(req) {
353
611
  const requestIdStr = String(req.id);
612
+ const pendingRequestId = codexServerRequestInputId(this.threadId, requestIdStr);
354
613
  switch (req.method) {
355
614
  case 'item/commandExecution/requestApproval':
356
615
  case 'item/fileChange/requestApproval':
@@ -359,16 +618,364 @@ export class CodexAppServerSession {
359
618
  case 'applyPatchApproval': {
360
619
  const method = req.method;
361
620
  const prompt = codexApprovalToPermissionPrompt(method, requestIdStr, req.params);
362
- const decision = await this.callbacks.handlePermissionRequest(this.threadId, prompt);
621
+ const decision = await this.callbacks.handlePermissionRequest(this.threadId, {
622
+ ...prompt,
623
+ requestId: pendingRequestId,
624
+ });
363
625
  return codexApprovalResponse(method, req.params, decision);
364
626
  }
627
+ case 'item/tool/requestUserInput':
628
+ return this.handleToolRequestUserInput(req.params, pendingRequestId);
629
+ case 'mcpServer/elicitation/request':
630
+ return this.handleMcpServerElicitation(req.params, pendingRequestId);
631
+ case 'item/tool/call':
632
+ return unsupportedDynamicToolCallResponse(req.params);
633
+ case 'account/chatgptAuthTokens/refresh':
634
+ return unsupportedChatgptAuthTokensRefresh(req.params);
635
+ case 'attestation/generate':
636
+ return unsupportedAttestationGenerate(req.params);
365
637
  default:
366
638
  // Unknown server request — refuse.
639
+ console.warn(`[codex-app] unsupported server request method=${req.method} id=${requestIdStr} params=${codexProtocolPreview(req.params)}`);
367
640
  throw new Error(`unsupported server request method: ${req.method}`);
368
641
  }
369
642
  }
643
+ async handleToolRequestUserInput(params, requestId) {
644
+ const questions = params.questions ?? [];
645
+ const decision = await this.callbacks.handlePermissionRequest(this.threadId, {
646
+ requestId,
647
+ inputType: 'question',
648
+ toolName: 'AskUserQuestion',
649
+ toolInput: {
650
+ questions: questions.map(codexToolQuestionToPromptQuestion),
651
+ },
652
+ toolUseId: params.itemId,
653
+ title: questions[0]?.question ?? 'Codex needs input',
654
+ message: questions.length > 1 ? 'Codex needs answers before it can continue.' : undefined,
655
+ skipAutoApprove: true,
656
+ });
657
+ if (decision.action === 'deny')
658
+ return { answers: {} };
659
+ return codexToolAnswersFromResponse(questions, decision.response ?? '');
660
+ }
661
+ async handleMcpServerElicitation(params, requestId) {
662
+ const toolUseId = `mcp-elicitation:${requestId}`;
663
+ if (params.mode === 'url') {
664
+ const decision = await this.callbacks.handlePermissionRequest(this.threadId, {
665
+ requestId,
666
+ inputType: 'permission',
667
+ toolName: 'McpElicitation',
668
+ toolInput: {
669
+ serverName: params.serverName,
670
+ mode: params.mode,
671
+ url: params.url,
672
+ elicitationId: params.elicitationId,
673
+ },
674
+ toolUseId,
675
+ title: `Open MCP prompt from ${params.serverName}?`,
676
+ message: `${params.message}\n\n${params.url}`,
677
+ skipAutoApprove: true,
678
+ });
679
+ return {
680
+ action: decision.action === 'deny' ? 'decline' : 'accept',
681
+ content: null,
682
+ _meta: params._meta ?? null,
683
+ };
684
+ }
685
+ const fields = mcpElicitationFields(params.requestedSchema);
686
+ const decision = await this.callbacks.handlePermissionRequest(this.threadId, {
687
+ requestId,
688
+ inputType: 'question',
689
+ toolName: 'AskUserQuestion',
690
+ toolInput: {
691
+ serverName: params.serverName,
692
+ mode: params.mode,
693
+ message: params.message,
694
+ questions: fields.map((field) => field.question),
695
+ },
696
+ toolUseId,
697
+ title: params.message || `MCP prompt from ${params.serverName}`,
698
+ message: `MCP server: ${params.serverName}`,
699
+ skipAutoApprove: true,
700
+ });
701
+ if (decision.action === 'deny') {
702
+ return { action: 'decline', content: null, _meta: params._meta ?? null };
703
+ }
704
+ return {
705
+ action: 'accept',
706
+ content: mcpElicitationContentFromResponse(fields, decision.response ?? ''),
707
+ _meta: params._meta ?? null,
708
+ };
709
+ }
370
710
  }
371
711
  // ── helpers ──
712
+ function notificationBelongsToThread(params, threadId) {
713
+ if (typeof params !== 'object' || params === null)
714
+ return true;
715
+ const candidate = params.threadId;
716
+ return typeof candidate !== 'string' || candidate === threadId;
717
+ }
718
+ function notificationTurnId(notification) {
719
+ switch (notification.method) {
720
+ case 'turn/started': {
721
+ const params = notification.params;
722
+ return params.turn?.id ?? null;
723
+ }
724
+ case 'turn/completed': {
725
+ const params = notification.params;
726
+ return params.turn?.id ?? null;
727
+ }
728
+ default: {
729
+ if (typeof notification.params !== 'object' || notification.params === null)
730
+ return null;
731
+ const candidate = notification.params.turnId;
732
+ return typeof candidate === 'string' && candidate.length > 0 ? candidate : null;
733
+ }
734
+ }
735
+ }
736
+ function shouldCreateTurnConsumerForNotification(method) {
737
+ switch (method) {
738
+ case 'turn/started':
739
+ case 'turn/completed':
740
+ case 'turn/plan/updated':
741
+ case 'item/started':
742
+ case 'item/autoApprovalReview/started':
743
+ case 'item/autoApprovalReview/completed':
744
+ case 'item/completed':
745
+ case 'item/agentMessage/delta':
746
+ case 'item/plan/delta':
747
+ case 'item/commandExecution/outputDelta':
748
+ case 'item/fileChange/outputDelta':
749
+ case 'item/fileChange/patchUpdated':
750
+ case 'item/mcpToolCall/progress':
751
+ case 'item/reasoning/summaryTextDelta':
752
+ case 'item/reasoning/summaryPartAdded':
753
+ case 'item/reasoning/textDelta':
754
+ case 'model/rerouted':
755
+ case 'model/verification':
756
+ case 'error':
757
+ return true;
758
+ default:
759
+ return false;
760
+ }
761
+ }
762
+ function codexToolQuestionToPromptQuestion(question) {
763
+ return {
764
+ id: question.id,
765
+ question: question.question,
766
+ header: question.header || undefined,
767
+ options: question.options?.map((option) => ({
768
+ label: option.label,
769
+ description: option.description || undefined,
770
+ })),
771
+ isSecret: question.isSecret || undefined,
772
+ };
773
+ }
774
+ function codexToolAnswersFromResponse(questions, responseText) {
775
+ const parts = questions.length > 1 ? responseText.split('\n') : [responseText];
776
+ const answers = {};
777
+ for (let i = 0; i < questions.length; i++) {
778
+ const question = questions[i];
779
+ if (!question?.id)
780
+ continue;
781
+ const answer = (parts[i] ?? '').trim();
782
+ answers[question.id] = { answers: answer ? [answer] : [] };
783
+ }
784
+ return { answers };
785
+ }
786
+ function mcpElicitationFields(schema) {
787
+ return Object.entries(schema.properties ?? {}).map(([key, prop]) => {
788
+ const primitive = prop;
789
+ const options = mcpOptionsForSchema(primitive);
790
+ const multiSelect = primitiveType(primitive) === 'array';
791
+ return {
792
+ key,
793
+ schema: primitive,
794
+ options,
795
+ multiSelect,
796
+ question: {
797
+ id: key,
798
+ question: primitiveTitle(primitive) ?? key,
799
+ header: key,
800
+ options: options?.map((option) => ({
801
+ label: option.label,
802
+ description: typeof option.value === 'string' && option.value !== option.label
803
+ ? option.value
804
+ : undefined,
805
+ })),
806
+ multiSelect,
807
+ },
808
+ };
809
+ });
810
+ }
811
+ function mcpElicitationContentFromResponse(fields, responseText) {
812
+ const parts = fields.length > 1 ? responseText.split('\n') : [responseText];
813
+ const content = {};
814
+ for (let i = 0; i < fields.length; i++) {
815
+ const field = fields[i];
816
+ const raw = (parts[i] ?? '').trim();
817
+ content[field.key] = parseMcpElicitationValue(field, raw);
818
+ }
819
+ return content;
820
+ }
821
+ function parseMcpElicitationValue(field, raw) {
822
+ if (field.multiSelect) {
823
+ const answers = raw ? raw.split(',').map((part) => part.trim()).filter(Boolean) : [];
824
+ return answers.map((answer) => mcpOptionValue(field.options, answer));
825
+ }
826
+ const mapped = mcpOptionValue(field.options, raw);
827
+ const type = primitiveType(field.schema);
828
+ if (type === 'boolean') {
829
+ if (/^(true|yes|y|1)$/i.test(String(mapped)))
830
+ return true;
831
+ if (/^(false|no|n|0)$/i.test(String(mapped)))
832
+ return false;
833
+ return Boolean(raw);
834
+ }
835
+ if (type === 'number' || type === 'integer') {
836
+ const n = Number(mapped);
837
+ return Number.isFinite(n) ? n : raw;
838
+ }
839
+ return mapped;
840
+ }
841
+ function mcpOptionValue(options, answer) {
842
+ const match = options?.find((option) => option.label === answer || option.value === answer);
843
+ return match ? match.value : answer;
844
+ }
845
+ function mcpOptionsForSchema(schema) {
846
+ const record = schema;
847
+ if (Array.isArray(record.oneOf)) {
848
+ return record.oneOf.map((option) => constOption(option)).filter((option) => !!option);
849
+ }
850
+ if (Array.isArray(record.enum)) {
851
+ const names = Array.isArray(record.enumNames) ? record.enumNames : [];
852
+ return record.enum.map((value, index) => ({
853
+ label: typeof names[index] === 'string' ? names[index] : String(value),
854
+ value: jsonPrimitive(value),
855
+ }));
856
+ }
857
+ const items = record.items;
858
+ if (items && Array.isArray(items.anyOf)) {
859
+ return items.anyOf.map((option) => constOption(option)).filter((option) => !!option);
860
+ }
861
+ if (items && Array.isArray(items.enum)) {
862
+ return items.enum.map((value) => ({ label: String(value), value: jsonPrimitive(value) }));
863
+ }
864
+ if (record.type === 'boolean') {
865
+ return [
866
+ { label: 'Yes', value: true },
867
+ { label: 'No', value: false },
868
+ ];
869
+ }
870
+ return null;
871
+ }
872
+ function constOption(value) {
873
+ if (typeof value !== 'object' || value === null)
874
+ return null;
875
+ const option = value;
876
+ if (option.const === undefined)
877
+ return null;
878
+ return {
879
+ label: typeof option.title === 'string' ? option.title : String(option.const),
880
+ value: jsonPrimitive(option.const),
881
+ };
882
+ }
883
+ function jsonPrimitive(value) {
884
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || value === null) {
885
+ return value;
886
+ }
887
+ return String(value);
888
+ }
889
+ function primitiveType(schema) {
890
+ return schema.type;
891
+ }
892
+ function primitiveTitle(schema) {
893
+ const title = schema.title;
894
+ return typeof title === 'string' && title.trim() ? title : undefined;
895
+ }
896
+ function unsupportedDynamicToolCallResponse(params) {
897
+ const toolName = params.namespace ? `${params.namespace}:${params.tool}` : params.tool;
898
+ return {
899
+ success: false,
900
+ contentItems: [{
901
+ type: 'inputText',
902
+ text: `Dynamic tool calls are not supported by Quicksave: ${toolName}`,
903
+ }],
904
+ };
905
+ }
906
+ function unsupportedChatgptAuthTokensRefresh(params) {
907
+ throw new Error(`chatgptAuthTokens refresh is not supported by Quicksave (reason=${params.reason}). ` +
908
+ 'Use Codex managed ChatGPT login or API key auth.');
909
+ }
910
+ function unsupportedAttestationGenerate(params) {
911
+ console.warn(`[codex-app] unsupported server request method=attestation/generate params=${codexProtocolPreview(params)}`);
912
+ throw new Error('attestation/generate is not supported by Quicksave');
913
+ }
914
+ function normalizeGoalObjective(value) {
915
+ if (value === null)
916
+ return null;
917
+ if (typeof value !== 'string') {
918
+ throw new Error('goal objective must be a string');
919
+ }
920
+ const objective = value.trim();
921
+ if (!objective) {
922
+ throw new Error('goal objective must not be empty');
923
+ }
924
+ if (objective.length > 4000) {
925
+ throw new Error('goal objective must be 4000 characters or fewer');
926
+ }
927
+ return objective;
928
+ }
929
+ function normalizeGoalStatusOrNull(value) {
930
+ if (value === null)
931
+ return null;
932
+ if (typeof value === 'string' && isThreadGoalStatus(value))
933
+ return value;
934
+ throw new Error(`goal status must be one of: ${THREAD_GOAL_STATUSES.join(', ')}`);
935
+ }
936
+ function normalizeGoalTokenBudget(value) {
937
+ if (value === null)
938
+ return null;
939
+ if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {
940
+ throw new Error('goal tokenBudget must be a non-negative number');
941
+ }
942
+ return value;
943
+ }
944
+ const THREAD_GOAL_STATUSES = [
945
+ 'active',
946
+ 'paused',
947
+ 'blocked',
948
+ 'usageLimited',
949
+ 'budgetLimited',
950
+ 'complete',
951
+ ];
952
+ function isThreadGoalStatus(value) {
953
+ return THREAD_GOAL_STATUSES.includes(value);
954
+ }
955
+ function codexGoalToConfigPatch(goal) {
956
+ return {
957
+ codexGoalPresent: true,
958
+ codexGoalObjective: goal.objective,
959
+ codexGoalStatus: goal.status,
960
+ codexGoalTokenBudget: goal.tokenBudget,
961
+ codexGoalTokensUsed: goal.tokensUsed,
962
+ codexGoalTimeUsedSeconds: goal.timeUsedSeconds,
963
+ codexGoalCreatedAt: goal.createdAt,
964
+ codexGoalUpdatedAt: goal.updatedAt,
965
+ };
966
+ }
967
+ function clearedGoalConfigPatch() {
968
+ return {
969
+ codexGoalPresent: false,
970
+ codexGoalObjective: null,
971
+ codexGoalStatus: null,
972
+ codexGoalTokenBudget: null,
973
+ codexGoalTokensUsed: null,
974
+ codexGoalTimeUsedSeconds: null,
975
+ codexGoalCreatedAt: null,
976
+ codexGoalUpdatedAt: null,
977
+ };
978
+ }
372
979
  function spawnCodexAppServer(opts) {
373
980
  return spawnAppServer({
374
981
  clientInfo: {
@@ -376,7 +983,7 @@ function spawnCodexAppServer(opts) {
376
983
  title: 'Quicksave Agent',
377
984
  version: '0.0.0',
378
985
  },
379
- capabilities: { experimentalApi: true, optOutNotificationMethods: null },
986
+ capabilities: { experimentalApi: true, requestAttestation: false, optOutNotificationMethods: null },
380
987
  }, {
381
988
  extraArgs: buildCodexSandboxMcpConfigArgs({
382
989
  cwd: opts.cwd,
@@ -430,7 +1037,6 @@ function seedOverrideStoreFromResponse(store, resp) {
430
1037
  effort: resp.reasoningEffort ?? null,
431
1038
  approvalPolicy: resp.approvalPolicy,
432
1039
  sandboxPolicy: resp.sandbox,
433
- permissionProfile: resp.permissionProfile,
434
1040
  approvalsReviewer: resp.approvalsReviewer,
435
1041
  });
436
1042
  }
@@ -485,7 +1091,6 @@ export function buildThreadStartParams(opts) {
485
1091
  approvalPolicy: perm.approvalPolicy,
486
1092
  approvalsReviewer: perm.approvalsReviewer,
487
1093
  sandbox: perm.sandbox,
488
- permissionProfile: null,
489
1094
  config: null,
490
1095
  serviceName: null,
491
1096
  baseInstructions: null,
@@ -493,8 +1098,7 @@ export function buildThreadStartParams(opts) {
493
1098
  personality: null,
494
1099
  ephemeral: null,
495
1100
  sessionStartSource: null,
496
- experimentalRawEvents: false,
497
- persistExtendedHistory: true,
1101
+ threadSource: null,
498
1102
  };
499
1103
  }
500
1104
  export function buildThreadResumeParams(opts) {
@@ -502,8 +1106,6 @@ export function buildThreadResumeParams(opts) {
502
1106
  const perm = mapCodexPresetToInitialThreadOpts(preset, opts.sandboxed);
503
1107
  return {
504
1108
  threadId: opts.sessionId,
505
- history: null,
506
- path: null,
507
1109
  model: opts.model ?? null,
508
1110
  modelProvider: null,
509
1111
  serviceTier: null,
@@ -511,13 +1113,10 @@ export function buildThreadResumeParams(opts) {
511
1113
  approvalPolicy: perm.approvalPolicy,
512
1114
  approvalsReviewer: perm.approvalsReviewer,
513
1115
  sandbox: perm.sandbox,
514
- permissionProfile: null,
515
1116
  config: null,
516
1117
  baseInstructions: null,
517
1118
  developerInstructions: opts.systemPrompt ?? null,
518
1119
  personality: null,
519
- excludeTurns: true,
520
- persistExtendedHistory: true,
521
1120
  };
522
1121
  }
523
1122
  function perTurnOverridesFromOpts(opts, resolved) {