ryco-cli 0.1.7 → 0.1.8

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 (150) hide show
  1. package/dist/{AzureDevOpsSourceControlProvider-CF5LuCHp.mjs → AzureDevOpsSourceControlProvider-B5vb4DOU.mjs} +2 -2
  2. package/dist/{AzureDevOpsSourceControlProvider-5exivY-1.cjs → AzureDevOpsSourceControlProvider-CYZmJqSM.cjs} +2 -2
  3. package/dist/{BitbucketSourceControlProvider-CKH09tfT.mjs → BitbucketSourceControlProvider-CcAb4IgH.mjs} +2 -2
  4. package/dist/{BitbucketSourceControlProvider-1GWENqcl.cjs → BitbucketSourceControlProvider-D_7i4YQz.cjs} +2 -2
  5. package/dist/{ClaudeDriver-WwWFTu61.mjs → ClaudeDriver-CoPBpdrp.mjs} +22 -5
  6. package/dist/{ClaudeDriver-BXLdjrht.cjs → ClaudeDriver-ScqmbPKW.cjs} +22 -5
  7. package/dist/{CodexDriver-BboMT9uk.cjs → CodexDriver-CtCCc3CC.cjs} +34 -7
  8. package/dist/{CodexDriver-93-TmCrO.mjs → CodexDriver-DH7vqku4.mjs} +34 -7
  9. package/dist/{CodexTextGeneration-BU9Myn87.mjs → CodexTextGeneration-CJV1jPda.mjs} +2 -2
  10. package/dist/{CodexTextGeneration-0pRbJji3.cjs → CodexTextGeneration-Db2hn8Qz.cjs} +2 -2
  11. package/dist/{CopilotDriver-BASi8pJ0.mjs → CopilotDriver-CFCF68Te.mjs} +6 -5
  12. package/dist/{CopilotDriver-DCsv-17W.cjs → CopilotDriver-DLN2KEoc.cjs} +6 -5
  13. package/dist/{CursorDriver-BTSiM3A8.cjs → CursorDriver-BlvQbOEZ.cjs} +42 -3
  14. package/dist/{CursorDriver-D5LvIqUk.mjs → CursorDriver-Dej81rwD.mjs} +42 -3
  15. package/dist/{ForgejoSourceControlProvider-e-4hvvZ_.mjs → ForgejoSourceControlProvider-3cFD7SqY.mjs} +2 -2
  16. package/dist/{ForgejoSourceControlProvider-BTXRDCGB.cjs → ForgejoSourceControlProvider-DYFUGvBk.cjs} +2 -2
  17. package/dist/{GitHubSourceControlProvider-DWmwkA_y.cjs → GitHubSourceControlProvider-B1Tp0TbY.cjs} +27 -4
  18. package/dist/{GitHubSourceControlProvider-26IofDAO.mjs → GitHubSourceControlProvider-Kf4rrBTF.mjs} +27 -4
  19. package/dist/{GitLabSourceControlProvider-D-YHnxRe.cjs → GitLabSourceControlProvider-D3vvKrB4.cjs} +2 -2
  20. package/dist/{GitLabSourceControlProvider-DePct78W.mjs → GitLabSourceControlProvider-Ygppeftk.mjs} +2 -2
  21. package/dist/{NodeSqliteClient-B5aDHbNc.cjs → NodeSqliteClient-D1O-MR8w.cjs} +4 -1
  22. package/dist/{NodeSqliteClient-A1TEgwj_.mjs → NodeSqliteClient-DdTjpAko.mjs} +4 -1
  23. package/dist/{OpenCodeDriver-BhvLOmvn.mjs → OpenCodeDriver-BGa9Tkot.mjs} +3 -3
  24. package/dist/{OpenCodeDriver-CVeZ4n9-.cjs → OpenCodeDriver-mbR9mF54.cjs} +3 -3
  25. package/dist/{SourceControlProviderDiscoveryCatalog-DeFR5xH3.cjs → SourceControlProviderDiscoveryCatalog-CTb100Uk.cjs} +1 -1
  26. package/dist/{SourceControlProviderDiscoveryCatalog-mJV_Xitr.mjs → SourceControlProviderDiscoveryCatalog-Zk11tJoL.mjs} +1 -1
  27. package/dist/bin.cjs +259 -243
  28. package/dist/bin.mjs +259 -243
  29. package/dist/client/assets/{AnimatedHeight-BSU0lzYs.js → AnimatedHeight-CPQ2q38I.js} +1 -1
  30. package/dist/client/assets/AppearanceSettings-B0FYiIxL.js +1 -0
  31. package/dist/client/assets/{BranchToolbar.logic-CZIFSvhd.js → BranchToolbar.logic-C1yjFjxJ.js} +1 -1
  32. package/dist/client/assets/ChatRightPanel-CJDSKMU2.js +188 -0
  33. package/dist/client/assets/ChatThreadRouteView-BaKwKGbC.js +1 -0
  34. package/dist/client/assets/CommandPaletteDialog-BHG_MdZk.js +1 -0
  35. package/dist/client/assets/{CompositeRoot-B_KEfCUE.js → CompositeRoot-Bs0hfelE.js} +1 -1
  36. package/dist/client/assets/ConnectionsSettings-DvZNgO60.js +1 -0
  37. package/dist/client/assets/{DiagnosticsSettings-DtzPCb6N.js → DiagnosticsSettings-0v_hh1Qh.js} +1 -1
  38. package/dist/client/assets/{DialogHandle-DuHnmWoE.js → DialogHandle-CwEAVRF_.js} +1 -1
  39. package/dist/client/assets/{DialogRoot-BV25qAcA.js → DialogRoot-CYuaaDI3.js} +1 -1
  40. package/dist/client/assets/{DialogTitle-DQsi-RTa.js → DialogTitle-Cak6zT3u.js} +1 -1
  41. package/dist/client/assets/{DialogTrigger-D0fA01C6.js → DialogTrigger-BD0KYYT-.js} +1 -1
  42. package/dist/client/assets/{DialogViewport-CMV_BePU.js → DialogViewport-9sGf4JUp.js} +1 -1
  43. package/dist/client/assets/{DraftChatThreadRouteView-BoiKnrii.js → DraftChatThreadRouteView-nvKLHlii.js} +1 -1
  44. package/dist/client/assets/{JetBrainsIcons-BcPxJlMf.js → JetBrainsIcons-CflvH7gO.js} +1 -1
  45. package/dist/client/assets/KeybindingsSettings-DhLKhgYn.js +7 -0
  46. package/dist/client/assets/McpServersSettings-COs_dng1.js +6 -0
  47. package/dist/client/assets/{NoActiveThreadState-C2q_O1kP.js → NoActiveThreadState-cxMCW-cQ.js} +1 -1
  48. package/dist/client/assets/OpinionatedPluginsSettings-ag_OgOGj.js +1 -0
  49. package/dist/client/assets/{ProjectFavicon-D2imiJ8M.js → ProjectFavicon-D97Hy4xo.js} +1 -1
  50. package/dist/client/assets/{ProviderUpdateLaunchNotification.logic-CJgA--nK.js → ProviderUpdateLaunchNotification.logic-RMYvRSEk.js} +1 -1
  51. package/dist/client/assets/ProvidersSettingsPanel-DcdVMRVC.js +1 -0
  52. package/dist/client/assets/{RedactedSensitiveText-B2GFTyfq.js → RedactedSensitiveText-CQY4pFAq.js} +1 -1
  53. package/dist/client/assets/RootAppShell-BRjETnaT.js +12 -0
  54. package/dist/client/assets/SettingsDialog-DRi5jsmq.js +2 -0
  55. package/dist/client/assets/SourceControlSettings-CdUulS4O.js +1 -0
  56. package/dist/client/assets/StatisticsPanel-NLU3ecLt.js +64 -0
  57. package/dist/client/assets/{ThreadStatusIndicators-Cw_jLVQf.js → ThreadStatusIndicators-CebYbeXP.js} +1 -1
  58. package/dist/client/assets/{ThreadTerminalDrawer-D1WnSemH.js → ThreadTerminalDrawer-DlI0gGer.js} +2 -2
  59. package/dist/client/assets/{ThreadWorkspacePanel-L4qCPTOA.js → ThreadWorkspacePanel-CEIVrCZ0.js} +6 -6
  60. package/dist/client/assets/{alert-dialog-CNmKa0BK.js → alert-dialog-wh07u3JU.js} +1 -1
  61. package/dist/client/assets/{chart-column-BWSKYZ_a.js → chart-column-Cg34FxwD.js} +1 -1
  62. package/dist/client/assets/{chatThreadActions-TtDsiwDC.js → chatThreadActions-UitETN_n.js} +1 -1
  63. package/dist/client/assets/{chevron-up-zopJ_99l.js → chevron-up-C3DS3evc.js} +1 -1
  64. package/dist/client/assets/{clamp-Ds6WJu8j.js → clamp-DPbdAzEu.js} +1 -1
  65. package/dist/client/assets/{clipboard-copy-BoJGpdmJ.js → clipboard-copy-ClVNnHW5.js} +1 -1
  66. package/dist/client/assets/clock-Cr66Pt4W.js +1 -0
  67. package/dist/client/assets/{commandPaletteStore-KebG835b.js → commandPaletteStore-DzUBFRor.js} +1 -1
  68. package/dist/client/assets/composerDraftStore-BfLPHwHL.js +21 -0
  69. package/dist/client/assets/{desktopUpdateAtoms-BQ0GGEfM.js → desktopUpdateAtoms-BiqPT2_z.js} +1 -1
  70. package/dist/client/assets/{download-CUiRE0N9.js → download-DJ1juHK4.js} +1 -1
  71. package/dist/client/assets/{draft-input-CwpGDtoT.js → draft-input-B1txZFC7.js} +1 -1
  72. package/dist/client/assets/editorPreferences-Bbmh6Bm1.js +1 -0
  73. package/dist/client/assets/{empty-CBuXePtg.js → empty-CUEYr1p8.js} +1 -1
  74. package/dist/client/assets/{group-BpZvxjG5.js → group-BouZ2n9F.js} +1 -1
  75. package/dist/client/assets/{index-BKzXTNJ_.js → index-DiHgOLH_.js} +2 -2
  76. package/dist/client/assets/{input-CgDawd6k.js → input-Do_m9U-4.js} +1 -1
  77. package/dist/client/assets/kbd-DJilTfYF.js +1 -0
  78. package/dist/client/assets/{keybindings-CUTRYI_A.js → keybindings-CRkz0yvp.js} +1 -1
  79. package/dist/client/assets/{keyboard-DFFiI7JY.js → keyboard-D3WgbAUQ.js} +1 -1
  80. package/dist/client/assets/{keyedQuery-DiOCbGH0.js → keyedQuery-PQcOnB2O.js} +0 -0
  81. package/dist/client/assets/{main-BgFGju3e.js → main-C-491vdD.js} +3 -3
  82. package/dist/client/assets/main-fW5L_SdM.css +2 -0
  83. package/dist/client/assets/{palette-BXCL909c.js → palette-BRoYo327.js} +1 -1
  84. package/dist/client/assets/{play-DI2LZohg.js → play-BZbHk_vw.js} +1 -1
  85. package/dist/client/assets/plus-D0S72hZS.js +1 -0
  86. package/dist/client/assets/projectAtoms-KYCIIuVn.js +1 -0
  87. package/dist/client/assets/providerDriverMeta-BX4CLldz.js +1 -0
  88. package/dist/client/assets/providerIconUtils-DTRc3qno.js +47 -0
  89. package/dist/client/assets/{radio-group-_PPYg3YY.js → radio-group-De3hRQoY.js} +1 -1
  90. package/dist/client/assets/{refresh-cw-BsQTNBXl.js → refresh-cw-D_1NT-T2.js} +1 -1
  91. package/dist/client/assets/{resolveAriaLabelledBy-CRHo_s16.js → resolveAriaLabelledBy-RblUm3b1.js} +1 -1
  92. package/dist/client/assets/rightPanelRouteSearch-DLllyqRr.js +1 -0
  93. package/dist/client/assets/{scale-DDEJ-tvn.js → scale-s57Ro96s.js} +1 -1
  94. package/dist/client/assets/{scroll-area-HgsI-ErG.js → scroll-area-B0_k8-iT.js} +1 -1
  95. package/dist/client/assets/{separator-ClnL4mUB.js → separator-AyXRgdnJ.js} +1 -1
  96. package/dist/client/assets/{server-Bbs3L-6_.js → server-Z-m1OqE5.js} +1 -1
  97. package/dist/client/assets/{session-logic-CKQkgIwo.js → session-logic-B87Htlw4.js} +2 -2
  98. package/dist/client/assets/settingsDialogStore-CxUfUnd9.js +1 -0
  99. package/dist/client/assets/{settingsLayout-G5xVm-ZT.js → settingsLayout-BtKS3Z8f.js} +1 -1
  100. package/dist/client/assets/{sidebar-_u7SGgmC.js → sidebar-B0WxOej2.js} +1 -1
  101. package/dist/client/assets/{sidebarStatusText-BTYnwflG.js → sidebarStatusText-C_EsHj20.js} +1 -1
  102. package/dist/client/assets/{skeleton-CmUvhZGP.js → skeleton-COt2Az5i.js} +1 -1
  103. package/dist/client/assets/{storeSelectors-DhJRpdiw.js → storeSelectors-BuB4Kzj6.js} +1 -1
  104. package/dist/client/assets/{threadSelectionStore-ygmA4DNA.js → threadSelectionStore-BS6X6HHt.js} +1 -1
  105. package/dist/client/assets/toast-CaV8TQi_.js +1 -0
  106. package/dist/client/assets/{toggle-DGS7tKuj.js → toggle-DE4ApNIU.js} +1 -1
  107. package/dist/client/assets/{toggle-group-Dtv1ZUFW.js → toggle-group-BuzAkAEk.js} +1 -1
  108. package/dist/client/assets/{tokenModePresentation-Dor1DnBx.js → tokenModePresentation-BCL2aeat.js} +1 -1
  109. package/dist/client/assets/{trash-2-C2G3VGoV.js → trash-2-ZZ1feCT6.js} +1 -1
  110. package/dist/client/assets/{triangle-alert-Bpz3xGu5.js → triangle-alert-CL3zqnKL.js} +1 -1
  111. package/dist/client/assets/{undo-2-C3rtxuqZ.js → undo-2-Cu9H3R3q.js} +1 -1
  112. package/dist/client/assets/{useHandleNewThread-ypSbzG0P.js → useHandleNewThread-Gke-ZFBr.js} +1 -1
  113. package/dist/client/assets/useLabelableId-DfuxWqrk.js +1 -0
  114. package/dist/client/assets/{useNavigate-_4hWGSey.js → useNavigate-DQEHh6ky.js} +1 -1
  115. package/dist/client/assets/{vscode-icons-DdSTtxYd.js → vscode-icons-DGDiHkqG.js} +1 -1
  116. package/dist/client/assets/{wrench-C4jdis40.js → wrench-C_OATMLq.js} +1 -1
  117. package/dist/client/assets/x-BG9zZGeD.js +1 -0
  118. package/dist/client/index.html +1 -1
  119. package/dist/{collectUint8StreamText-uNXVRHOf.cjs → collectUint8StreamText-B-GW3u_2.cjs} +83 -10
  120. package/dist/{collectUint8StreamText-Lv4GGI79.mjs → collectUint8StreamText-COE2_gie.mjs} +83 -10
  121. package/dist/{makeManagedServerProvider-CkPEptun.mjs → makeManagedServerProvider-D1_iEWGi.mjs} +1 -1
  122. package/dist/{makeManagedServerProvider-3SD-Q5xh.cjs → makeManagedServerProvider-DTsQ87HL.cjs} +1 -1
  123. package/package.json +4 -2
  124. package/dist/client/assets/AppearanceSettings-D7q0ujGK.js +0 -1
  125. package/dist/client/assets/ChatRightPanel-CWHOIuiQ.js +0 -188
  126. package/dist/client/assets/ChatThreadRouteView-bA7xWXzc.js +0 -1
  127. package/dist/client/assets/CommandPaletteDialog-DNYaVOZO.js +0 -1
  128. package/dist/client/assets/ConnectionsSettings-CLZPbx_K.js +0 -1
  129. package/dist/client/assets/KeybindingsSettings-LuI98pdF.js +0 -7
  130. package/dist/client/assets/McpServersSettings-BFMuWYVV.js +0 -6
  131. package/dist/client/assets/OpinionatedPluginsSettings-Bqwct37O.js +0 -1
  132. package/dist/client/assets/ProvidersSettingsPanel-B97vbeu6.js +0 -1
  133. package/dist/client/assets/RootAppShell-C1xTR98P.js +0 -12
  134. package/dist/client/assets/SettingsDialog-Q0Q8O5oH.js +0 -2
  135. package/dist/client/assets/SourceControlSettings-KAvoPTNi.js +0 -1
  136. package/dist/client/assets/StatisticsPanel-BzsQ444K.js +0 -64
  137. package/dist/client/assets/clock-CzUHThzk.js +0 -1
  138. package/dist/client/assets/composerDraftStore-DpPEQ6BN.js +0 -21
  139. package/dist/client/assets/editorPreferences-jN7DKbyt.js +0 -1
  140. package/dist/client/assets/kbd-QYSL97CK.js +0 -1
  141. package/dist/client/assets/main-D0UFdwts.css +0 -2
  142. package/dist/client/assets/plus-DzgIfHUF.js +0 -1
  143. package/dist/client/assets/projectAtoms-DXXpuERK.js +0 -1
  144. package/dist/client/assets/providerDriverMeta-CRNNp0q3.js +0 -1
  145. package/dist/client/assets/providerIconUtils-D-DFhem2.js +0 -47
  146. package/dist/client/assets/rightPanelRouteSearch-CfmZ7osj.js +0 -1
  147. package/dist/client/assets/settingsDialogStore-SG-W1q0A.js +0 -1
  148. package/dist/client/assets/toast-DmA_ziPT.js +0 -1
  149. package/dist/client/assets/useLabelableId-Bc7KEnHU.js +0 -1
  150. package/dist/client/assets/x-CG2WU63t.js +0 -1
package/dist/bin.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { $ as ProviderRespondToUserInputInput, $n as AuthRevokeClientSessionInput, $t as ThreadDeletedPayload$1, A as McpServerName, At as OrchestrationSession, B as DEFAULT_SERVER_SETTINGS, Bn as ProviderInstanceId, Bt as ProjectMetaUpdatedPayload$1, C as McpInventoryResourceTemplate, Cn as WorkItemProviderError, Ct as OrchestrationGetTurnDiffError, D as McpProviderSupport, Dn as SourceControlRepositoryError, Dt as OrchestrationProposedPlanId, E as McpOauthLoginResult, En as SourceControlProviderError, Et as OrchestrationMessageRole, F as ServerProviderUpdateError, Ft as OrchestrationWorktreeShell, G as KeybindingsConfig, Gn as TerminalHistoryError, H as ServerSettings, Hn as isProviderDriverKind, Ht as ProjectScript, I as ClaudeSettings, In as DEFAULT_GIT_TEXT_GENERATION_MODEL_BY_PROVIDER, J as ResolvedKeybindingRule, Jn as EDITORS, Jt as RuntimeMode, K as KeybindingsConfigError, Kn as TerminalNotRunningError, Kt as ProviderInteractionMode, L as CodexSettings, Ln as DEFAULT_MODEL, Lt as ProjectAvatarSetPayload$1, M as McpWorkspaceId, Mt as OrchestrationShellSnapshot, N as OpinionatedPluginError, Nt as OrchestrationThread, O as McpServer, Ot as OrchestrationReadModel, P as ServerProvider, Pn as VcsUnsupportedOperationError, Pt as OrchestrationThreadActivityTone, Q as ProviderRespondToRequestInput, Qn as AuthCreatePairingCredentialInput, Qt as ThreadCreatedPayload$1, R as CopilotSettings, Rn as MODEL_SLUG_ALIASES_BY_PROVIDER, Rt as ProjectCreatedPayload$1, S as McpInventoryResource, Sn as WORK_ITEM_DETAIL_COMMENT_BODY_MAX_BYTES, Sr as TurnId, St as OrchestrationGetSnapshotError, T as McpListServersResult, Tt as OrchestrationMessage, U as ServerSettingsError, Ut as ProjectionPendingApprovalDecision, V as OpenCodeSettings, Vn as defaultInstanceIdForDriver, Vt as ProjectMetadataDir, W as KeybindingRule, Wn as TerminalCwdError, Wt as ProjectionPendingApprovalStatus, X as isToolLifecycleItemType, Xn as AuthBootstrapInput, Xt as ThreadArchivedPayload$1, Y as THREAD_JUMP_KEYBINDING_COMMANDS, Yn as OpenError, Yt as ThreadActivityAppendedPayload$1, Z as ProviderInterruptTurnInput, Zn as AuthClientMetadataDeviceType, Zt as ThreadAttachedToWorktreePayload$1, _ as AtlassianConnectionStatus, _n as WorktreeSourceControlStateUpdatedPayload$1, _t as OrchestrationDispatchCommandError, a as WS_METHODS, an as ThreadRuntimeModeSetPayload$1, ar as AuthSessionId, at as ClientOrchestrationCommand, b as GitManagerError, bn as WorktreeId, br as ThreadId, bt as OrchestrationEventType, cn as ThreadTokenModeSetPayload$1, cr as EnvironmentId, ct as DEFAULT_PROVIDER_INTERACTION_MODE, d as ProjectSearchEntriesError, dn as WorktreeArchivedPayload$1, dr as MessageId, dt as OrchestrationActorKind, en as ThreadInteractionModeSetPayload$1, er as AuthRevokePairingLinkInput, et as ProviderSendTurnInput, f as ProjectStageFileReferenceError, fn as WorktreeCreatedPayload$1, fr as NonNegativeInt, ft as OrchestrationAggregateKind, g as AtlassianConnectionKind, gn as WorktreeRestoredPayload$1, gt as OrchestrationCommandReceiptStatus, h as AtlassianConnectionError, hn as WorktreeMetaUpdatedPayload$1, ht as OrchestrationCheckpointSummary, i as fromLenientJson, in as ThreadRevertedPayload$1, ir as AtlassianResourceId, it as ChatAttachment, j as McpSettingsError, jn as VcsProcessExitError, jt as OrchestrationSessionStatus, k as McpServerConfig, kn as VcsDriverKind, kt as OrchestrationReplayEventsError, l as ProjectListEntriesError, ln as ThreadTurnDiffCompletedPayload$1, lr as EventId, lt as ModelSelection, m as AtlassianCapability, mn as WorktreeManualPositionSetPayload$1, mr as ProjectId, mt as OrchestrationCheckpointStatus, n as decodeJsonResult, nn as ThreadMetaUpdatedPayload$1, nr as ApprovalRequestId, nt as ProviderStopSessionInput, o as WsRpcGroup, on as ThreadSessionSetPayload$1, or as CheckpointRef, ot as DEFAULT_AGENT_TOKEN_MODE, p as ProjectWriteFileError, pn as WorktreeDeletedPayload$1, pr as PositiveInt, pt as OrchestrationCheckpointFile, q as MODEL_PICKER_JUMP_KEYBINDING_COMMANDS, qn as TerminalSessionLookupError, qt as ProviderSessionRuntimeStatus, r as formatSchemaError, rn as ThreadProposedPlanUpsertedPayload$1, rr as AtlassianConnectionId, rt as AgentTokenMode, s as FilesystemBrowseError, sn as ThreadStatusBucketOverriddenPayload$1, sr as CommandId, t as collectUint8StreamText, tn as ThreadMessageSentPayload, tr as AuthRpcError, tt as ProviderSessionStartInput, u as ProjectReadFileError, un as ThreadUnarchivedPayload$1, ur as IsoDateTime, ut as ORCHESTRATION_WS_METHODS, v as AtlassianProduct, vn as StatusBucket, vt as OrchestrationEvent, w as McpInventoryTool, wn as WorkItemProviderKind, wt as OrchestrationGetTurnDiffResult, x as TextGenerationError, xn as WORK_ITEM_DETAIL_BODY_MAX_BYTES, xr as TrimmedNonEmptyString, xt as OrchestrationGetFullThreadDiffError, y as GitCommandError, yn as Worktree, yt as OrchestrationEventMetadata, z as CursorSettings, zn as ProviderDriverKind, zt as ProjectDeletedPayload$1 } from "./collectUint8StreamText-Lv4GGI79.mjs";
3
+ import { $ as ProviderRespondToUserInputInput, $n as AuthRevokeClientSessionInput, $t as ThreadDeletedPayload$1, A as McpServerName, At as OrchestrationSession, B as DEFAULT_SERVER_SETTINGS, Bn as ProviderInstanceId, Bt as ProjectMetaUpdatedPayload$1, C as McpInventoryResourceTemplate, Cn as WorkItemProviderError, Ct as OrchestrationGetTurnDiffError, D as McpProviderSupport, Dn as SourceControlRepositoryError, Dt as OrchestrationProposedPlanId, E as McpOauthLoginResult, En as SourceControlProviderError, Et as OrchestrationMessageRole, F as ServerProviderUpdateError, Ft as OrchestrationWorktreeShell, G as KeybindingsConfig, Gn as TerminalHistoryError, H as ServerSettings, Hn as isProviderDriverKind, Ht as ProjectScript, I as ClaudeSettings, In as DEFAULT_GIT_TEXT_GENERATION_MODEL_BY_PROVIDER, J as ResolvedKeybindingRule, Jn as EDITORS, Jt as RuntimeMode, K as KeybindingsConfigError, Kn as TerminalNotRunningError, Kt as ProviderInteractionMode, L as CodexSettings, Ln as DEFAULT_MODEL, Lt as ProjectAvatarSetPayload$1, M as McpWorkspaceId, Mt as OrchestrationShellSnapshot, N as OpinionatedPluginError, Nt as OrchestrationThread, O as McpServer, Ot as OrchestrationReadModel, P as ServerProvider, Pn as VcsUnsupportedOperationError, Pt as OrchestrationThreadActivityTone, Q as ProviderRespondToRequestInput, Qn as AuthCreatePairingCredentialInput, Qt as ThreadCreatedPayload$1, R as CopilotSettings, Rn as MODEL_SLUG_ALIASES_BY_PROVIDER, Rt as ProjectCreatedPayload$1, S as McpInventoryResource, Sn as WORK_ITEM_DETAIL_COMMENT_BODY_MAX_BYTES, Sr as TurnId, St as OrchestrationGetSnapshotError, T as McpListServersResult, Tt as OrchestrationMessage, U as ServerSettingsError, Ut as ProjectionPendingApprovalDecision, V as OpenCodeSettings, Vn as defaultInstanceIdForDriver, Vt as ProjectMetadataDir, W as KeybindingRule, Wn as TerminalCwdError, Wt as ProjectionPendingApprovalStatus, X as isToolLifecycleItemType, Xn as AuthBootstrapInput, Xt as ThreadArchivedPayload$1, Y as THREAD_JUMP_KEYBINDING_COMMANDS, Yn as OpenError, Yt as ThreadActivityAppendedPayload$1, Z as ProviderInterruptTurnInput, Zn as AuthClientMetadataDeviceType, Zt as ThreadAttachedToWorktreePayload$1, _ as AtlassianConnectionStatus, _n as WorktreeSourceControlStateUpdatedPayload$1, _t as OrchestrationDispatchCommandError, a as WS_METHODS, an as ThreadRuntimeModeSetPayload$1, ar as AuthSessionId, at as ClientOrchestrationCommand, b as GitManagerError, bn as WorktreeId, br as ThreadId, bt as OrchestrationEventType, cn as ThreadTokenModeSetPayload$1, cr as EnvironmentId, ct as DEFAULT_PROVIDER_INTERACTION_MODE, d as ProjectSearchEntriesError, dn as WorktreeArchivedPayload$1, dr as MessageId, dt as OrchestrationActorKind, en as ThreadInteractionModeSetPayload$1, er as AuthRevokePairingLinkInput, et as ProviderSendTurnInput, f as ProjectStageFileReferenceError, fn as WorktreeCreatedPayload$1, fr as NonNegativeInt, ft as OrchestrationAggregateKind, g as AtlassianConnectionKind, gn as WorktreeRestoredPayload$1, gt as OrchestrationCommandReceiptStatus, h as AtlassianConnectionError, hn as WorktreeMetaUpdatedPayload$1, ht as OrchestrationCheckpointSummary, i as fromLenientJson, in as ThreadRevertedPayload$1, ir as AtlassianResourceId, it as ChatAttachment, j as McpSettingsError, jn as VcsProcessExitError, jt as OrchestrationSessionStatus, k as McpServerConfig, kn as VcsDriverKind, kt as OrchestrationReplayEventsError, l as ProjectListEntriesError, ln as ThreadTurnDiffCompletedPayload$1, lr as EventId, lt as ModelSelection, m as AtlassianCapability, mn as WorktreeManualPositionSetPayload$1, mr as ProjectId, mt as OrchestrationCheckpointStatus, n as decodeJsonResult, nn as ThreadMetaUpdatedPayload$1, nr as ApprovalRequestId, nt as ProviderStopSessionInput, o as WsRpcGroup, on as ThreadSessionSetPayload$1, or as CheckpointRef, ot as DEFAULT_AGENT_TOKEN_MODE, p as ProjectWriteFileError, pn as WorktreeDeletedPayload$1, pr as PositiveInt, pt as OrchestrationCheckpointFile, q as MODEL_PICKER_JUMP_KEYBINDING_COMMANDS, qn as TerminalSessionLookupError, qt as ProviderSessionRuntimeStatus, r as formatSchemaError, rn as ThreadProposedPlanUpsertedPayload$1, rr as AtlassianConnectionId, rt as AgentTokenMode, s as FilesystemBrowseError, sn as ThreadStatusBucketOverriddenPayload$1, sr as CommandId, t as collectUint8StreamText, tn as ThreadMessageSentPayload, tr as AuthRpcError, tt as ProviderSessionStartInput, u as ProjectReadFileError, un as ThreadUnarchivedPayload$1, ur as IsoDateTime, ut as ORCHESTRATION_WS_METHODS, v as AtlassianProduct, vn as StatusBucket, vt as OrchestrationEvent, w as McpInventoryTool, wn as WorkItemProviderKind, wt as OrchestrationGetTurnDiffResult, x as TextGenerationError, xn as WORK_ITEM_DETAIL_BODY_MAX_BYTES, xr as TrimmedNonEmptyString, xt as OrchestrationGetFullThreadDiffError, y as GitCommandError, yn as Worktree, yt as OrchestrationEventMetadata, z as CursorSettings, zn as ProviderDriverKind, zt as ProjectDeletedPayload$1 } from "./collectUint8StreamText-COE2_gie.mjs";
4
4
  import { A as terminalRestartsTotal, B as mergeGitStatusParts, C as runtimeQueueDequeuesTotal, D as startupCommandGateQueueDepth, E as startupCommandGateEnqueuesTotal, F as WORKTREE_BRANCH_PREFIX, G as compactTraceAttributes, H as resolveAutoFeatureBranchName, I as buildTemporaryWorktreeBranchName, J as RuntimeMode$1, K as outcomeFromExit, L as dedupeRemoteBranchesWithLocalMatches, M as withMetrics, N as LocalDiagnosticsMetrics, O as startupCommandGateQueueHighWater, P as LocalDiagnosticsMetricsLive, Q as resolveStaticDir, R as detectSourceControlProviderFromGitRemoteUrl, S as runtimeQueueDepth, T as runtimeQueueHighWater, U as sanitizeBranchFragment, V as normalizeGitRemoteUrl, W as sanitizeFeatureBranchName, X as deriveServerPaths, Y as ServerConfig, Z as ensureServerDirectories, _ as providerTurnDuration, a as orchestrationCommandAckDuration, b as rpcRequestDuration, c as orchestrationEventsProcessedTotal, d as providerRuntimeEventsTotal, f as providerSessionsTotal, g as providerStartupQueueWaitDuration, h as providerStartupQueueHighWater, i as metricAttributes, j as terminalSessionsTotal, k as startupCommandGateQueueWaitDuration, l as providerEventLogRecordsDroppedTotal, m as providerStartupQueueDepth, n as gitCommandsTotal, o as orchestrationCommandDuration, p as providerStartupAdmissionTotal, q as DEFAULT_PORT, r as increment, s as orchestrationCommandsTotal, t as gitCommandDuration, u as providerMetricAttributes, v as providerTurnMetricAttributes, w as runtimeQueueEnqueuesTotal, x as rpcRequestsTotal, y as providerTurnsTotal, z as isTemporaryWorktreeBranch } from "./Metrics-6Xj17Se3.mjs";
5
- import { a as makeForgejoDiscovery, c as sourceBranch, d as firstNonEmptyLine, f as probeSourceControlProvider, h as layer$19, i as makeBitbucketDiscovery, m as VcsProcess, n as githubDiscovery, o as SourceControlProvider, p as refineUnknownRemoteProvider, r as gitlabDiscovery, s as parseSourceControlOwnerRef, t as azureDevOpsDiscovery, u as detailFromCause } from "./SourceControlProviderDiscoveryCatalog-mJV_Xitr.mjs";
5
+ import { a as makeForgejoDiscovery, c as sourceBranch, d as firstNonEmptyLine, f as probeSourceControlProvider, h as layer$19, i as makeBitbucketDiscovery, m as VcsProcess, n as githubDiscovery, o as SourceControlProvider, p as refineUnknownRemoteProvider, r as gitlabDiscovery, s as parseSourceControlOwnerRef, t as azureDevOpsDiscovery, u as detailFromCause } from "./SourceControlProviderDiscoveryCatalog-Zk11tJoL.mjs";
6
6
  import { n as detectSourceControlProviderFromRemoteUrl, r as getChangeRequestTerminologyForKind } from "./sourceControl-iWG-m4wE.mjs";
7
7
  import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
8
8
  import * as NodeServices from "@effect/platform-node/NodeServices";
@@ -4596,7 +4596,7 @@ Layer$1.effectDiscard(runMigrations());
4596
4596
  //#region src/persistence/Layers/Sqlite.ts
4597
4597
  const defaultSqliteClientLoaders = {
4598
4598
  bun: () => import("@effect/sql-sqlite-bun/SqliteClient"),
4599
- node: () => import("./NodeSqliteClient-A1TEgwj_.mjs")
4599
+ node: () => import("./NodeSqliteClient-DdTjpAko.mjs")
4600
4600
  };
4601
4601
  const makeRuntimeSqliteLayer = Effect.fn("makeRuntimeSqliteLayer")(function* (config) {
4602
4602
  const loader = defaultSqliteClientLoaders[process.versions.bun !== void 0 ? "bun" : "node"];
@@ -9687,6 +9687,7 @@ function workflowRunsEndpoint(input) {
9687
9687
  const params = new URLSearchParams();
9688
9688
  params.set("per_page", String(workflowRunLimit(input.limit)));
9689
9689
  if (input.headSha?.trim()) params.set("head_sha", input.headSha.trim());
9690
+ else if (input.branch?.trim()) params.set("branch", input.branch.trim());
9690
9691
  return `repos/{owner}/{repo}/actions/runs?${params.toString()}`;
9691
9692
  }
9692
9693
  function isWorkflowRerunStateError(error) {
@@ -10951,26 +10952,26 @@ const make$11 = Effect.fn("makeSourceControlProviderRegistry")(function* () {
10951
10952
  const azureDevOpsCli = yield* AzureDevOpsCli;
10952
10953
  const fileSystem = yield* FileSystem.FileSystem;
10953
10954
  const github = yield* makeLazyProvider("github", Effect.tryPromise({
10954
- try: () => import("./GitHubSourceControlProvider-26IofDAO.mjs"),
10955
+ try: () => import("./GitHubSourceControlProvider-Kf4rrBTF.mjs"),
10955
10956
  catch: (cause) => providerLoadError("github", cause)
10956
10957
  }).pipe(Effect.flatMap((module) => module.make()), Effect.provideService(GitHubCli, githubCli), Effect.provideService(FileSystem.FileSystem, fileSystem)));
10957
10958
  const gitlab = yield* makeLazyProvider("gitlab", Effect.tryPromise({
10958
- try: () => import("./GitLabSourceControlProvider-DePct78W.mjs"),
10959
+ try: () => import("./GitLabSourceControlProvider-Ygppeftk.mjs"),
10959
10960
  catch: (cause) => providerLoadError("gitlab", cause)
10960
10961
  }).pipe(Effect.flatMap((module) => module.make()), Effect.provideService(GitLabCli, gitlabCli)));
10961
10962
  const bitbucket = yield* makeLazyProvider("bitbucket", Effect.tryPromise({
10962
- try: () => import("./BitbucketSourceControlProvider-CKH09tfT.mjs"),
10963
+ try: () => import("./BitbucketSourceControlProvider-CcAb4IgH.mjs"),
10963
10964
  catch: (cause) => providerLoadError("bitbucket", cause)
10964
10965
  }).pipe(Effect.flatMap((module) => module.make()), Effect.provideService(BitbucketApi, bitbucketApi)), {
10965
10966
  searchRepositories: true,
10966
10967
  cloneAuthentication: true
10967
10968
  });
10968
10969
  const forgejo = yield* makeLazyProvider("forgejo", Effect.tryPromise({
10969
- try: () => import("./ForgejoSourceControlProvider-e-4hvvZ_.mjs"),
10970
+ try: () => import("./ForgejoSourceControlProvider-3cFD7SqY.mjs"),
10970
10971
  catch: (cause) => providerLoadError("forgejo", cause)
10971
10972
  }).pipe(Effect.flatMap((module) => module.make()), Effect.provideService(ForgejoApi, forgejoApi)));
10972
10973
  const azureDevOps = yield* makeLazyProvider("azure-devops", Effect.tryPromise({
10973
- try: () => import("./AzureDevOpsSourceControlProvider-CF5LuCHp.mjs"),
10974
+ try: () => import("./AzureDevOpsSourceControlProvider-B5vb4DOU.mjs"),
10974
10975
  catch: (cause) => providerLoadError("azure-devops", cause)
10975
10976
  }).pipe(Effect.flatMap((module) => module.make()), Effect.provideService(AzureDevOpsCli, azureDevOpsCli)));
10976
10977
  const bitbucketDiscovery = makeBitbucketDiscovery(bitbucketApi);
@@ -11163,6 +11164,11 @@ const DEFAULT_KEYBINDINGS = [
11163
11164
  key: "mod+o",
11164
11165
  command: "editor.openFavorite"
11165
11166
  },
11167
+ {
11168
+ key: "mod+f",
11169
+ command: "thread.find",
11170
+ when: "!terminalFocus"
11171
+ },
11166
11172
  {
11167
11173
  key: "mod+shift+[",
11168
11174
  command: "thread.previous"
@@ -11984,14 +11990,7 @@ const ClientRequest__PluginsMigration = Schema$1.Struct({
11984
11990
  marketplaceName: Schema$1.String,
11985
11991
  pluginNames: Schema$1.Array(Schema$1.String)
11986
11992
  });
11987
- const ClientRequest__ReasoningEffort = Schema$1.Literals([
11988
- "none",
11989
- "minimal",
11990
- "low",
11991
- "medium",
11992
- "high",
11993
- "xhigh"
11994
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
11993
+ const ClientRequest__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
11995
11994
  const ClientRequest__ReasoningItemContent = Schema$1.Union([Schema$1.Struct({
11996
11995
  text: Schema$1.String,
11997
11996
  type: Schema$1.Literal("reasoning_text").annotate({ title: "ReasoningTextReasoningItemContentType" })
@@ -12567,14 +12566,7 @@ const ServerNotification__RateLimitWindow = Schema$1.Struct({
12567
12566
  windowDurationMins: Schema$1.optionalKey(Schema$1.Union([Schema$1.Number.annotate({ format: "int64" }).check(Schema$1.isInt()), Schema$1.Null]))
12568
12567
  });
12569
12568
  const ServerNotification__RealtimeConversationVersion = Schema$1.Literals(["v1", "v2"]);
12570
- const ServerNotification__ReasoningEffort = Schema$1.Literals([
12571
- "none",
12572
- "minimal",
12573
- "low",
12574
- "medium",
12575
- "high",
12576
- "xhigh"
12577
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
12569
+ const ServerNotification__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
12578
12570
  const ServerNotification__ReasoningSummaryPartAddedNotification = Schema$1.Struct({
12579
12571
  itemId: Schema$1.String,
12580
12572
  summaryIndex: Schema$1.Number.annotate({ format: "int64" }).check(Schema$1.isInt()),
@@ -12953,14 +12945,7 @@ const V2ConfigReadResponse__AskForApproval = Schema$1.Union([Schema$1.Literals([
12953
12945
  skill_approval: Schema$1.optionalKey(Schema$1.Boolean.annotate({ default: false }))
12954
12946
  }) }).annotate({ title: "GranularAskForApproval" })], { mode: "oneOf" });
12955
12947
  const V2ConfigReadResponse__ForcedLoginMethod = Schema$1.Literals(["chatgpt", "api"]);
12956
- const V2ConfigReadResponse__ReasoningEffort = Schema$1.Literals([
12957
- "none",
12958
- "minimal",
12959
- "low",
12960
- "medium",
12961
- "high",
12962
- "xhigh"
12963
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
12948
+ const V2ConfigReadResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
12964
12949
  const V2ConfigReadResponse__ReasoningSummary = Schema$1.Union([Schema$1.Literals([
12965
12950
  "auto",
12966
12951
  "concise",
@@ -13278,14 +13263,7 @@ const V2ItemCompletedNotification__PatchChangeKind = Schema$1.Union([
13278
13263
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
13279
13264
  }).annotate({ title: "UpdatePatchChangeKind" })
13280
13265
  ], { mode: "oneOf" });
13281
- const V2ItemCompletedNotification__ReasoningEffort = Schema$1.Literals([
13282
- "none",
13283
- "minimal",
13284
- "low",
13285
- "medium",
13286
- "high",
13287
- "xhigh"
13288
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
13266
+ const V2ItemCompletedNotification__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
13289
13267
  const V2ItemCompletedNotification__TextElement = Schema$1.Struct({
13290
13268
  byteRange: Schema$1.Struct({
13291
13269
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -13473,14 +13451,7 @@ const V2ItemStartedNotification__PatchChangeKind = Schema$1.Union([
13473
13451
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
13474
13452
  }).annotate({ title: "UpdatePatchChangeKind" })
13475
13453
  ], { mode: "oneOf" });
13476
- const V2ItemStartedNotification__ReasoningEffort = Schema$1.Literals([
13477
- "none",
13478
- "minimal",
13479
- "low",
13480
- "medium",
13481
- "high",
13482
- "xhigh"
13483
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
13454
+ const V2ItemStartedNotification__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
13484
13455
  const V2ItemStartedNotification__TextElement = Schema$1.Struct({
13485
13456
  byteRange: Schema$1.Struct({
13486
13457
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -13568,14 +13539,7 @@ const V2ModelListResponse__ModelUpgradeInfo = Schema$1.Struct({
13568
13539
  modelLink: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null])),
13569
13540
  upgradeCopy: Schema$1.optionalKey(Schema$1.Union([Schema$1.String, Schema$1.Null]))
13570
13541
  });
13571
- const V2ModelListResponse__ReasoningEffort = Schema$1.Literals([
13572
- "none",
13573
- "minimal",
13574
- "low",
13575
- "medium",
13576
- "high",
13577
- "xhigh"
13578
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
13542
+ const V2ModelListResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
13579
13543
  const V2ModelReroutedNotification__ModelRerouteReason = Schema$1.Literal("highRiskCyberActivity");
13580
13544
  const V2PluginInstallParams__AbsolutePathBuf = Schema$1.String.annotate({ description: "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute." });
13581
13545
  const V2PluginInstallResponse__AppSummary = Schema$1.Struct({
@@ -13758,14 +13722,7 @@ const V2ReviewStartResponse__PatchChangeKind = Schema$1.Union([
13758
13722
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
13759
13723
  }).annotate({ title: "UpdatePatchChangeKind" })
13760
13724
  ], { mode: "oneOf" });
13761
- const V2ReviewStartResponse__ReasoningEffort = Schema$1.Literals([
13762
- "none",
13763
- "minimal",
13764
- "low",
13765
- "medium",
13766
- "high",
13767
- "xhigh"
13768
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
13725
+ const V2ReviewStartResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
13769
13726
  const V2ReviewStartResponse__TextElement = Schema$1.Struct({
13770
13727
  byteRange: Schema$1.Struct({
13771
13728
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -13929,14 +13886,7 @@ const V2ThreadForkResponse__PatchChangeKind = Schema$1.Union([
13929
13886
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
13930
13887
  }).annotate({ title: "UpdatePatchChangeKind" })
13931
13888
  ], { mode: "oneOf" });
13932
- const V2ThreadForkResponse__ReasoningEffort = Schema$1.Literals([
13933
- "none",
13934
- "minimal",
13935
- "low",
13936
- "medium",
13937
- "high",
13938
- "xhigh"
13939
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
13889
+ const V2ThreadForkResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
13940
13890
  const V2ThreadForkResponse__ServiceTier = Schema$1.Literals([
13941
13891
  "fast",
13942
13892
  "flex",
@@ -14059,14 +14009,7 @@ const V2ThreadListResponse__PatchChangeKind = Schema$1.Union([
14059
14009
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
14060
14010
  }).annotate({ title: "UpdatePatchChangeKind" })
14061
14011
  ], { mode: "oneOf" });
14062
- const V2ThreadListResponse__ReasoningEffort = Schema$1.Literals([
14063
- "none",
14064
- "minimal",
14065
- "low",
14066
- "medium",
14067
- "high",
14068
- "xhigh"
14069
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
14012
+ const V2ThreadListResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
14070
14013
  const V2ThreadListResponse__TextElement = Schema$1.Struct({
14071
14014
  byteRange: Schema$1.Struct({
14072
14015
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -14175,14 +14118,7 @@ const V2ThreadMetadataUpdateResponse__PatchChangeKind = Schema$1.Union([
14175
14118
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
14176
14119
  }).annotate({ title: "UpdatePatchChangeKind" })
14177
14120
  ], { mode: "oneOf" });
14178
- const V2ThreadMetadataUpdateResponse__ReasoningEffort = Schema$1.Literals([
14179
- "none",
14180
- "minimal",
14181
- "low",
14182
- "medium",
14183
- "high",
14184
- "xhigh"
14185
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
14121
+ const V2ThreadMetadataUpdateResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
14186
14122
  const V2ThreadMetadataUpdateResponse__TextElement = Schema$1.Struct({
14187
14123
  byteRange: Schema$1.Struct({
14188
14124
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -14286,14 +14222,7 @@ const V2ThreadReadResponse__PatchChangeKind = Schema$1.Union([
14286
14222
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
14287
14223
  }).annotate({ title: "UpdatePatchChangeKind" })
14288
14224
  ], { mode: "oneOf" });
14289
- const V2ThreadReadResponse__ReasoningEffort = Schema$1.Literals([
14290
- "none",
14291
- "minimal",
14292
- "low",
14293
- "medium",
14294
- "high",
14295
- "xhigh"
14296
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
14225
+ const V2ThreadReadResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
14297
14226
  const V2ThreadReadResponse__TextElement = Schema$1.Struct({
14298
14227
  byteRange: Schema$1.Struct({
14299
14228
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -14499,14 +14428,7 @@ const V2ThreadResumeResponse__PatchChangeKind = Schema$1.Union([
14499
14428
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
14500
14429
  }).annotate({ title: "UpdatePatchChangeKind" })
14501
14430
  ], { mode: "oneOf" });
14502
- const V2ThreadResumeResponse__ReasoningEffort = Schema$1.Literals([
14503
- "none",
14504
- "minimal",
14505
- "low",
14506
- "medium",
14507
- "high",
14508
- "xhigh"
14509
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
14431
+ const V2ThreadResumeResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
14510
14432
  const V2ThreadResumeResponse__ServiceTier = Schema$1.Literals([
14511
14433
  "fast",
14512
14434
  "flex",
@@ -14615,14 +14537,7 @@ const V2ThreadRollbackResponse__PatchChangeKind = Schema$1.Union([
14615
14537
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
14616
14538
  }).annotate({ title: "UpdatePatchChangeKind" })
14617
14539
  ], { mode: "oneOf" });
14618
- const V2ThreadRollbackResponse__ReasoningEffort = Schema$1.Literals([
14619
- "none",
14620
- "minimal",
14621
- "low",
14622
- "medium",
14623
- "high",
14624
- "xhigh"
14625
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
14540
+ const V2ThreadRollbackResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
14626
14541
  const V2ThreadRollbackResponse__TextElement = Schema$1.Struct({
14627
14542
  byteRange: Schema$1.Struct({
14628
14543
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -14726,14 +14641,7 @@ const V2ThreadStartedNotification__PatchChangeKind = Schema$1.Union([
14726
14641
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
14727
14642
  }).annotate({ title: "UpdatePatchChangeKind" })
14728
14643
  ], { mode: "oneOf" });
14729
- const V2ThreadStartedNotification__ReasoningEffort = Schema$1.Literals([
14730
- "none",
14731
- "minimal",
14732
- "low",
14733
- "medium",
14734
- "high",
14735
- "xhigh"
14736
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
14644
+ const V2ThreadStartedNotification__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
14737
14645
  const V2ThreadStartedNotification__TextElement = Schema$1.Struct({
14738
14646
  byteRange: Schema$1.Struct({
14739
14647
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -14878,14 +14786,7 @@ const V2ThreadStartResponse__PatchChangeKind = Schema$1.Union([
14878
14786
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
14879
14787
  }).annotate({ title: "UpdatePatchChangeKind" })
14880
14788
  ], { mode: "oneOf" });
14881
- const V2ThreadStartResponse__ReasoningEffort = Schema$1.Literals([
14882
- "none",
14883
- "minimal",
14884
- "low",
14885
- "medium",
14886
- "high",
14887
- "xhigh"
14888
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
14789
+ const V2ThreadStartResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
14889
14790
  const V2ThreadStartResponse__ServiceTier = Schema$1.Literals([
14890
14791
  "fast",
14891
14792
  "flex",
@@ -14997,14 +14898,7 @@ const V2ThreadTurnsListResponse__PatchChangeKind = Schema$1.Union([
14997
14898
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
14998
14899
  }).annotate({ title: "UpdatePatchChangeKind" })
14999
14900
  ], { mode: "oneOf" });
15000
- const V2ThreadTurnsListResponse__ReasoningEffort = Schema$1.Literals([
15001
- "none",
15002
- "minimal",
15003
- "low",
15004
- "medium",
15005
- "high",
15006
- "xhigh"
15007
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
14901
+ const V2ThreadTurnsListResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
15008
14902
  const V2ThreadTurnsListResponse__TextElement = Schema$1.Struct({
15009
14903
  byteRange: Schema$1.Struct({
15010
14904
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -15106,14 +15000,7 @@ const V2ThreadUnarchiveResponse__PatchChangeKind = Schema$1.Union([
15106
15000
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
15107
15001
  }).annotate({ title: "UpdatePatchChangeKind" })
15108
15002
  ], { mode: "oneOf" });
15109
- const V2ThreadUnarchiveResponse__ReasoningEffort = Schema$1.Literals([
15110
- "none",
15111
- "minimal",
15112
- "low",
15113
- "medium",
15114
- "high",
15115
- "xhigh"
15116
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
15003
+ const V2ThreadUnarchiveResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
15117
15004
  const V2ThreadUnarchiveResponse__TextElement = Schema$1.Struct({
15118
15005
  byteRange: Schema$1.Struct({
15119
15006
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -15216,14 +15103,7 @@ const V2TurnCompletedNotification__PatchChangeKind = Schema$1.Union([
15216
15103
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
15217
15104
  }).annotate({ title: "UpdatePatchChangeKind" })
15218
15105
  ], { mode: "oneOf" });
15219
- const V2TurnCompletedNotification__ReasoningEffort = Schema$1.Literals([
15220
- "none",
15221
- "minimal",
15222
- "low",
15223
- "medium",
15224
- "high",
15225
- "xhigh"
15226
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
15106
+ const V2TurnCompletedNotification__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
15227
15107
  const V2TurnCompletedNotification__TextElement = Schema$1.Struct({
15228
15108
  byteRange: Schema$1.Struct({
15229
15109
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -15324,14 +15204,7 @@ const V2TurnStartedNotification__PatchChangeKind = Schema$1.Union([
15324
15204
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
15325
15205
  }).annotate({ title: "UpdatePatchChangeKind" })
15326
15206
  ], { mode: "oneOf" });
15327
- const V2TurnStartedNotification__ReasoningEffort = Schema$1.Literals([
15328
- "none",
15329
- "minimal",
15330
- "low",
15331
- "medium",
15332
- "high",
15333
- "xhigh"
15334
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
15207
+ const V2TurnStartedNotification__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
15335
15208
  const V2TurnStartedNotification__TextElement = Schema$1.Struct({
15336
15209
  byteRange: Schema$1.Struct({
15337
15210
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -15382,14 +15255,7 @@ const V2TurnStartParams__Personality = Schema$1.Literals([
15382
15255
  "friendly",
15383
15256
  "pragmatic"
15384
15257
  ]);
15385
- const V2TurnStartParams__ReasoningEffort = Schema$1.Literals([
15386
- "none",
15387
- "minimal",
15388
- "low",
15389
- "medium",
15390
- "high",
15391
- "xhigh"
15392
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
15258
+ const V2TurnStartParams__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
15393
15259
  const V2TurnStartParams__ReasoningSummary = Schema$1.Union([Schema$1.Literals([
15394
15260
  "auto",
15395
15261
  "concise",
@@ -15472,14 +15338,7 @@ const V2TurnStartResponse__PatchChangeKind = Schema$1.Union([
15472
15338
  type: Schema$1.Literal("update").annotate({ title: "UpdatePatchChangeKindType" })
15473
15339
  }).annotate({ title: "UpdatePatchChangeKind" })
15474
15340
  ], { mode: "oneOf" });
15475
- const V2TurnStartResponse__ReasoningEffort = Schema$1.Literals([
15476
- "none",
15477
- "minimal",
15478
- "low",
15479
- "medium",
15480
- "high",
15481
- "xhigh"
15482
- ]).annotate({ description: "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning" });
15341
+ const V2TurnStartResponse__ReasoningEffort = Schema$1.String.check(Schema$1.isNonEmpty()).annotate({ description: "A non-empty reasoning effort value advertised by the model." });
15483
15342
  const V2TurnStartResponse__TextElement = Schema$1.Struct({
15484
15343
  byteRange: Schema$1.Struct({
15485
15344
  end: Schema$1.Number.annotate({ format: "uint" }).check(Schema$1.isInt()).check(Schema$1.isGreaterThanOrEqualTo(0)),
@@ -26798,7 +26657,7 @@ const BUILT_IN_DRIVERS = [
26798
26657
  configSchema: CodexSettings,
26799
26658
  defaultConfig: () => Schema.decodeSync(CodexSettings)({}),
26800
26659
  create: (input) => Effect.tryPromise({
26801
- try: () => import("./CodexDriver-93-TmCrO.mjs"),
26660
+ try: () => import("./CodexDriver-DH7vqku4.mjs"),
26802
26661
  catch: (cause) => driverImportError(codexDriverKind, input, cause)
26803
26662
  }).pipe(Effect.flatMap(({ CodexDriver }) => CodexDriver.create(input)))
26804
26663
  },
@@ -26811,7 +26670,7 @@ const BUILT_IN_DRIVERS = [
26811
26670
  configSchema: ClaudeSettings,
26812
26671
  defaultConfig: () => Schema.decodeSync(ClaudeSettings)({}),
26813
26672
  create: (input) => Effect.tryPromise({
26814
- try: () => import("./ClaudeDriver-WwWFTu61.mjs"),
26673
+ try: () => import("./ClaudeDriver-CoPBpdrp.mjs"),
26815
26674
  catch: (cause) => driverImportError(claudeDriverKind, input, cause)
26816
26675
  }).pipe(Effect.flatMap(({ ClaudeDriver }) => ClaudeDriver.create(input)))
26817
26676
  },
@@ -26824,7 +26683,7 @@ const BUILT_IN_DRIVERS = [
26824
26683
  configSchema: CopilotSettings,
26825
26684
  defaultConfig: () => Schema.decodeSync(CopilotSettings)({}),
26826
26685
  create: (input) => Effect.tryPromise({
26827
- try: () => import("./CopilotDriver-BASi8pJ0.mjs"),
26686
+ try: () => import("./CopilotDriver-CFCF68Te.mjs"),
26828
26687
  catch: (cause) => driverImportError(copilotDriverKind, input, cause)
26829
26688
  }).pipe(Effect.flatMap(({ CopilotDriver }) => CopilotDriver.create(input)))
26830
26689
  },
@@ -26837,7 +26696,7 @@ const BUILT_IN_DRIVERS = [
26837
26696
  configSchema: CursorSettings,
26838
26697
  defaultConfig: () => Schema.decodeSync(CursorSettings)({}),
26839
26698
  create: (input) => Effect.tryPromise({
26840
- try: () => import("./CursorDriver-D5LvIqUk.mjs"),
26699
+ try: () => import("./CursorDriver-Dej81rwD.mjs"),
26841
26700
  catch: (cause) => driverImportError(cursorDriverKind, input, cause)
26842
26701
  }).pipe(Effect.flatMap(({ CursorDriver }) => CursorDriver.create(input)))
26843
26702
  },
@@ -26850,7 +26709,7 @@ const BUILT_IN_DRIVERS = [
26850
26709
  configSchema: OpenCodeSettings,
26851
26710
  defaultConfig: () => Schema.decodeSync(OpenCodeSettings)({}),
26852
26711
  create: (input) => Effect.tryPromise({
26853
- try: () => import("./OpenCodeDriver-BhvLOmvn.mjs"),
26712
+ try: () => import("./OpenCodeDriver-BGa9Tkot.mjs"),
26854
26713
  catch: (cause) => driverImportError(openCodeDriverKind, input, cause)
26855
26714
  }).pipe(Effect.flatMap(({ OpenCodeDriver }) => OpenCodeDriver.create(input)))
26856
26715
  }
@@ -26950,6 +26809,7 @@ function buildServerProvider(input) {
26950
26809
  displayName: input.presentation.displayName,
26951
26810
  ...input.presentation.badgeLabel ? { badgeLabel: input.presentation.badgeLabel } : {},
26952
26811
  ...typeof input.presentation.showInteractionModeToggle === "boolean" ? { showInteractionModeToggle: input.presentation.showInteractionModeToggle } : {},
26812
+ ...typeof input.presentation.supportsAskMode === "boolean" ? { supportsAskMode: input.presentation.supportsAskMode } : {},
26953
26813
  enabled: input.enabled,
26954
26814
  installed: input.probe.installed,
26955
26815
  version: input.probe.version,
@@ -27563,13 +27423,14 @@ const scopedSafeTeardown = (label) => (effect) => Effect.gen(function* () {
27563
27423
  });
27564
27424
  //#endregion
27565
27425
  //#region package.json
27566
- var version = "0.1.7";
27426
+ var version = "0.1.8";
27567
27427
  //#endregion
27568
27428
  //#region src/provider/Layers/CodexProvider.ts
27569
27429
  const PROVIDER_PROBE_TIMEOUT_MS = 8e3;
27570
27430
  const CODEX_PRESENTATION = {
27571
27431
  displayName: "Codex",
27572
- showInteractionModeToggle: true
27432
+ showInteractionModeToggle: true,
27433
+ supportsAskMode: true
27573
27434
  };
27574
27435
  const REASONING_EFFORT_LABELS = {
27575
27436
  none: "None",
@@ -27577,8 +27438,15 @@ const REASONING_EFFORT_LABELS = {
27577
27438
  low: "Low",
27578
27439
  medium: "Medium",
27579
27440
  high: "High",
27580
- xhigh: "Extra High"
27441
+ xhigh: "Extra High",
27442
+ max: "Max",
27443
+ ultra: "Ultra"
27581
27444
  };
27445
+ function formatReasoningEffortLabel(reasoningEffort) {
27446
+ const known = REASONING_EFFORT_LABELS[reasoningEffort];
27447
+ if (known) return known;
27448
+ return reasoningEffort.replace(/[_-]+/g, " ").replace(/\b\w/g, (char) => char.toUpperCase());
27449
+ }
27582
27450
  function codexAccountAuthLabel(account) {
27583
27451
  if (!account) return void 0;
27584
27452
  if (account.type === "apiKey") return "OpenAI API Key";
@@ -27607,11 +27475,11 @@ function codexAccountEmail(account) {
27607
27475
  function mapCodexModelCapabilities(model) {
27608
27476
  const reasoningOptions = model.supportedReasoningEfforts.map(({ reasoningEffort }) => reasoningEffort === model.defaultReasoningEffort ? {
27609
27477
  id: reasoningEffort,
27610
- label: REASONING_EFFORT_LABELS[reasoningEffort],
27478
+ label: formatReasoningEffortLabel(reasoningEffort),
27611
27479
  isDefault: true
27612
27480
  } : {
27613
27481
  id: reasoningEffort,
27614
- label: REASONING_EFFORT_LABELS[reasoningEffort]
27482
+ label: formatReasoningEffortLabel(reasoningEffort)
27615
27483
  });
27616
27484
  const defaultReasoning = reasoningOptions.find((option) => option.isDefault)?.id;
27617
27485
  const supportsFastMode = (model.additionalSpeedTiers ?? []).includes("fast");
@@ -28609,11 +28477,12 @@ var ProjectionSnapshotQuery = class extends Context.Service()("ryco/orchestratio
28609
28477
  * on demand. No dedicated statistics tables exist; everything is derived from
28610
28478
  * data already persisted by the projection pipeline.
28611
28479
  *
28612
- * Token figures use a per-turn delta attribution: for each `(thread, turn)` we
28613
- * read the final `context-window.updated` activity and sum its `last*` deltas,
28614
- * bucketed by day/project/model. When deltas are absent (older data / providers
28615
- * that only report cumulative totals) we fall back to attributing a thread's
28616
- * cumulative total to its primary model and last-activity day.
28480
+ * Token figures prefer per-turn attribution: for each `(thread, turn)` with
28481
+ * exact `last*` breakdowns we read the final `context-window.updated` activity
28482
+ * and bucket its provider-reported turn total by day/project/provider/model.
28483
+ * Threads without exact deltas (older data / providers that only report
28484
+ * cumulative context usage) fall back to attributing the latest cumulative
28485
+ * total to the thread's primary model and last-activity day.
28617
28486
  *
28618
28487
  * @module StatisticsQuery
28619
28488
  */
@@ -28628,6 +28497,7 @@ const ThreadRow = Schema.Struct({
28628
28497
  threadId: Schema.String,
28629
28498
  projectId: ProjectId,
28630
28499
  model: Schema.NullOr(Schema.String),
28500
+ providerInstanceId: Schema.NullOr(Schema.String),
28631
28501
  createdAt: Schema.String,
28632
28502
  providerName: Schema.NullOr(Schema.String)
28633
28503
  });
@@ -28666,6 +28536,33 @@ function num(value) {
28666
28536
  function dayOf(iso) {
28667
28537
  return iso.length >= 10 ? iso.slice(0, 10) : null;
28668
28538
  }
28539
+ function bestPerTurnTotalTokenCount(payload) {
28540
+ const reportedTotal = num(payload?.lastUsedTokens);
28541
+ if (reportedTotal > 0) return reportedTotal;
28542
+ return num(payload?.lastInputTokens) + num(payload?.lastOutputTokens);
28543
+ }
28544
+ function bestCumulativeTotalTokenCount(payload) {
28545
+ const reportedTotal = num(payload?.usedTokens);
28546
+ if (reportedTotal > 0) return reportedTotal;
28547
+ return num(payload?.inputTokens) + num(payload?.outputTokens);
28548
+ }
28549
+ function hasExactPerTurnBreakdown(payload) {
28550
+ return num(payload?.lastInputTokens) + num(payload?.lastOutputTokens) + num(payload?.lastCachedInputTokens) + num(payload?.lastReasoningOutputTokens) > 0;
28551
+ }
28552
+ function addPerTurnUsage(bucket, payload) {
28553
+ bucket.inputTokens += num(payload?.lastInputTokens);
28554
+ bucket.outputTokens += num(payload?.lastOutputTokens);
28555
+ bucket.cachedInputTokens += num(payload?.lastCachedInputTokens);
28556
+ bucket.reasoningTokens += num(payload?.lastReasoningOutputTokens);
28557
+ bucket.totalTokens += bestPerTurnTotalTokenCount(payload);
28558
+ }
28559
+ function addCumulativeUsage(bucket, payload) {
28560
+ bucket.inputTokens += num(payload?.inputTokens);
28561
+ bucket.outputTokens += num(payload?.outputTokens);
28562
+ bucket.cachedInputTokens += num(payload?.cachedInputTokens);
28563
+ bucket.reasoningTokens += num(payload?.reasoningOutputTokens);
28564
+ bucket.totalTokens += bestCumulativeTotalTokenCount(payload);
28565
+ }
28669
28566
  const makeStatisticsQuery = Effect.gen(function* () {
28670
28567
  const sql = yield* SqlClient.SqlClient;
28671
28568
  const listThreadRows = SqlSchema.findAll({
@@ -28676,9 +28573,14 @@ const makeStatisticsQuery = Effect.gen(function* () {
28676
28573
  t.thread_id AS "threadId",
28677
28574
  t.project_id AS "projectId",
28678
28575
  json_extract(t.model_selection_json, '$.model') AS "model",
28576
+ COALESCE(
28577
+ json_extract(t.model_selection_json, '$.instanceId'),
28578
+ json_extract(t.model_selection_json, '$.provider')
28579
+ ) AS "providerInstanceId",
28679
28580
  t.created_at AS "createdAt",
28680
28581
  COALESCE(
28681
28582
  s.provider_name,
28583
+ json_extract(t.model_selection_json, '$.instanceId'),
28682
28584
  json_extract(t.model_selection_json, '$.provider')
28683
28585
  ) AS "providerName"
28684
28586
  FROM projection_threads t
@@ -28758,9 +28660,9 @@ const makeStatisticsQuery = Effect.gen(function* () {
28758
28660
  listWorktreeRows(void 0).pipe(Effect.mapError(toPersistenceSqlOrDecodeError$7("StatisticsQuery.getStatistics:listWorktrees:query", "StatisticsQuery.getStatistics:listWorktrees:decodeRows")))
28759
28661
  ], { concurrency: "unbounded" });
28760
28662
  const threadMeta = /* @__PURE__ */ new Map();
28761
- const modelProvider = /* @__PURE__ */ new Map();
28663
+ const modelRefs = /* @__PURE__ */ new Map();
28762
28664
  for (const row of threadRows) {
28763
- const provider = row.providerName?.trim() || void 0;
28665
+ const provider = row.providerName?.trim() || row.providerInstanceId?.trim() || void 0;
28764
28666
  const model = (row.model ?? "").trim() || "unknown";
28765
28667
  threadMeta.set(row.threadId, {
28766
28668
  projectId: row.projectId,
@@ -28768,22 +28670,27 @@ const makeStatisticsQuery = Effect.gen(function* () {
28768
28670
  provider,
28769
28671
  createdAt: row.createdAt
28770
28672
  });
28771
- if (!modelProvider.has(model) || modelProvider.get(model) === void 0 && provider) modelProvider.set(model, provider);
28673
+ const modelKey = `${provider ?? ""}\u0000${model}`;
28674
+ modelRefs.set(modelKey, provider ? {
28675
+ model,
28676
+ provider
28677
+ } : { model });
28772
28678
  }
28773
28679
  const buckets = /* @__PURE__ */ new Map();
28774
- const getBucket = (date, projectId, model) => {
28775
- const key = `${date}${projectId}${model}`;
28680
+ const getBucket = (date, projectId, model, provider) => {
28681
+ const key = `${date}\u0000${projectId}\u0000${provider ?? ""}\u0000${model}`;
28776
28682
  let bucket = buckets.get(key);
28777
28683
  if (!bucket) {
28778
28684
  bucket = {
28779
28685
  date,
28780
28686
  projectId,
28781
28687
  model,
28782
- provider: modelProvider.get(model),
28688
+ provider,
28783
28689
  inputTokens: 0,
28784
28690
  outputTokens: 0,
28785
28691
  cachedInputTokens: 0,
28786
28692
  reasoningTokens: 0,
28693
+ totalTokens: 0,
28787
28694
  turns: 0,
28788
28695
  activeMs: 0,
28789
28696
  toolUses: 0,
@@ -28803,50 +28710,50 @@ const makeStatisticsQuery = Effect.gen(function* () {
28803
28710
  if (iso && (earliest === void 0 || iso < earliest)) earliest = iso;
28804
28711
  };
28805
28712
  const lastPerTurn = /* @__PURE__ */ new Map();
28806
- const lastPerThread = /* @__PURE__ */ new Map();
28807
28713
  const isLater = (a, b) => {
28808
28714
  if (a.createdAt !== b.createdAt) return a.createdAt > b.createdAt;
28809
28715
  return (a.sequence ?? -1) >= (b.sequence ?? -1);
28810
28716
  };
28811
28717
  for (const row of tokenRows) {
28812
28718
  considerIso(row.createdAt);
28813
- lastPerTurn.set(`${row.threadId}${row.turnId ?? ""}`, row);
28814
- const prevThread = lastPerThread.get(row.threadId);
28815
- if (!prevThread || isLater(row, prevThread)) lastPerThread.set(row.threadId, row);
28719
+ const turnKey = `${row.threadId}\u0000${row.turnId ?? ""}`;
28720
+ const prevTurn = lastPerTurn.get(turnKey);
28721
+ if (!prevTurn || isLater(row, prevTurn)) lastPerTurn.set(turnKey, row);
28816
28722
  }
28817
- let perTurnDeltaSum = 0;
28818
- for (const row of lastPerTurn.values()) {
28819
- const payload = safeParse(row.payloadJson);
28820
- perTurnDeltaSum += num(payload?.lastInputTokens) + num(payload?.lastOutputTokens) + num(payload?.lastCachedInputTokens) + num(payload?.lastReasoningOutputTokens);
28723
+ const firstExactPerThread = /* @__PURE__ */ new Map();
28724
+ for (const row of lastPerTurn.values()) if (hasExactPerTurnBreakdown(safeParse(row.payloadJson))) {
28725
+ const prev = firstExactPerThread.get(row.threadId);
28726
+ if (!prev || isLater(prev, row)) firstExactPerThread.set(row.threadId, row);
28821
28727
  }
28822
- let cumulativeSum = 0;
28823
- for (const row of lastPerThread.values()) {
28728
+ const cumulativeFallbackByThread = /* @__PURE__ */ new Map();
28729
+ for (const row of lastPerTurn.values()) {
28730
+ if (hasExactPerTurnBreakdown(safeParse(row.payloadJson))) continue;
28731
+ const firstExact = firstExactPerThread.get(row.threadId);
28732
+ if (firstExact && !isLater(firstExact, row)) continue;
28733
+ const prev = cumulativeFallbackByThread.get(row.threadId);
28734
+ if (!prev || isLater(row, prev)) cumulativeFallbackByThread.set(row.threadId, row);
28735
+ }
28736
+ let usedExactPerTurn = false;
28737
+ let usedCumulativeFallback = false;
28738
+ for (const row of lastPerTurn.values()) {
28824
28739
  const payload = safeParse(row.payloadJson);
28825
- cumulativeSum += num(payload?.inputTokens) + num(payload?.outputTokens);
28826
- }
28827
- const attribution = perTurnDeltaSum === 0 && cumulativeSum > 0 ? "thread-cumulative" : "per-turn-delta";
28828
- if (attribution === "per-turn-delta") for (const row of lastPerTurn.values()) {
28740
+ if (!hasExactPerTurnBreakdown(payload)) continue;
28829
28741
  const meta = threadMeta.get(row.threadId);
28830
28742
  const date = dayOf(row.createdAt);
28831
28743
  if (!meta || !date) continue;
28832
- const payload = safeParse(row.payloadJson);
28833
- const bucket = getBucket(date, meta.projectId, meta.model);
28834
- bucket.inputTokens += num(payload?.lastInputTokens);
28835
- bucket.outputTokens += num(payload?.lastOutputTokens);
28836
- bucket.cachedInputTokens += num(payload?.lastCachedInputTokens);
28837
- bucket.reasoningTokens += num(payload?.lastReasoningOutputTokens);
28744
+ addPerTurnUsage(getBucket(date, meta.projectId, meta.model, meta.provider), payload);
28745
+ usedExactPerTurn = true;
28838
28746
  }
28839
- else for (const row of lastPerThread.values()) {
28747
+ for (const row of cumulativeFallbackByThread.values()) {
28840
28748
  const meta = threadMeta.get(row.threadId);
28841
28749
  const date = dayOf(row.createdAt);
28842
28750
  if (!meta || !date) continue;
28843
28751
  const payload = safeParse(row.payloadJson);
28844
- const bucket = getBucket(date, meta.projectId, meta.model);
28845
- bucket.inputTokens += num(payload?.inputTokens);
28846
- bucket.outputTokens += num(payload?.outputTokens);
28847
- bucket.cachedInputTokens += num(payload?.cachedInputTokens);
28848
- bucket.reasoningTokens += num(payload?.reasoningOutputTokens);
28752
+ if (bestCumulativeTotalTokenCount(payload) <= 0) continue;
28753
+ addCumulativeUsage(getBucket(date, meta.projectId, meta.model, meta.provider), payload);
28754
+ usedCumulativeFallback = true;
28849
28755
  }
28756
+ const attribution = usedExactPerTurn && usedCumulativeFallback ? "mixed" : usedCumulativeFallback ? "thread-cumulative" : "per-turn-delta";
28850
28757
  for (const row of turnRows) {
28851
28758
  const meta = threadMeta.get(row.threadId);
28852
28759
  if (!meta) continue;
@@ -28855,7 +28762,7 @@ const makeStatisticsQuery = Effect.gen(function* () {
28855
28762
  const anchor = row.completedAt ?? row.startedAt;
28856
28763
  const date = anchor ? dayOf(anchor) : null;
28857
28764
  if (!date) continue;
28858
- const bucket = getBucket(date, meta.projectId, meta.model);
28765
+ const bucket = getBucket(date, meta.projectId, meta.model, meta.provider);
28859
28766
  if (row.completedAt) {
28860
28767
  bucket.turns += 1;
28861
28768
  if (row.startedAt) {
@@ -28875,14 +28782,14 @@ const makeStatisticsQuery = Effect.gen(function* () {
28875
28782
  for (const row of toolRows) {
28876
28783
  const meta = threadMeta.get(row.threadId);
28877
28784
  if (!meta) continue;
28878
- const bucket = getBucket(row.date, meta.projectId, meta.model);
28785
+ const bucket = getBucket(row.date, meta.projectId, meta.model, meta.provider);
28879
28786
  bucket.toolUses += num(row.count);
28880
28787
  }
28881
28788
  for (const meta of threadMeta.values()) {
28882
28789
  considerIso(meta.createdAt);
28883
28790
  const date = dayOf(meta.createdAt);
28884
28791
  if (!date) continue;
28885
- getBucket(date, meta.projectId, meta.model).threadsCreated += 1;
28792
+ getBucket(date, meta.projectId, meta.model, meta.provider).threadsCreated += 1;
28886
28793
  }
28887
28794
  let wtCreated = 0;
28888
28795
  let wtArchived = 0;
@@ -28929,8 +28836,9 @@ const makeStatisticsQuery = Effect.gen(function* () {
28929
28836
  totals.deletions += bucket.deletions;
28930
28837
  totals.commits += bucket.commits;
28931
28838
  totals.pushes += bucket.pushes;
28839
+ totals.totalTokens += bucket.totalTokens;
28932
28840
  }
28933
- totals.totalTokens = totals.inputTokens + totals.outputTokens;
28841
+ dailyBuckets.sort((a, b) => a.date === b.date ? a.projectId === b.projectId ? (a.provider ?? "").localeCompare(b.provider ?? "") || a.model.localeCompare(b.model) : a.projectId.localeCompare(b.projectId) : a.date.localeCompare(b.date));
28934
28842
  const projectTitle = /* @__PURE__ */ new Map();
28935
28843
  for (const row of projectRows) projectTitle.set(row.projectId, row.title);
28936
28844
  const projectIdsInData = /* @__PURE__ */ new Set();
@@ -28941,10 +28849,8 @@ const makeStatisticsQuery = Effect.gen(function* () {
28941
28849
  id,
28942
28850
  title: projectTitle.get(id)?.trim() || id
28943
28851
  }));
28944
- const models = [...modelProvider].map(([model, provider]) => provider ? {
28945
- model,
28946
- provider
28947
- } : { model });
28852
+ projects.sort((a, b) => a.title.localeCompare(b.title) || a.id.localeCompare(b.id));
28853
+ const models = [...modelRefs.values()].toSorted((a, b) => (a.provider ?? "").localeCompare(b.provider ?? "") || a.model.localeCompare(b.model));
28948
28854
  return {
28949
28855
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
28950
28856
  ...earliest ? { earliestActivityAt: earliest } : {},
@@ -33373,6 +33279,13 @@ const makeWorktreeOperations = (deps) => {
33373
33279
  onNone: () => failGitWorkflow(operation, `Worktree ${worktreeId} not found.`),
33374
33280
  onSome: Effect.succeed
33375
33281
  })));
33282
+ const isProjectRootPath = (candidate, projectRoot) => {
33283
+ const normalize = (value) => {
33284
+ const resolved = path.resolve(value).replace(/[\\/]+$/g, "");
33285
+ return process.platform === "win32" || process.platform === "darwin" ? resolved.toLowerCase() : resolved;
33286
+ };
33287
+ return normalize(candidate) === normalize(projectRoot);
33288
+ };
33376
33289
  const dispatchWorktreeCommand = (command, operation) => dispatchNormalizedCommand(command).pipe(Effect.mapError((cause) => toGitManagerError(operation, "Failed to dispatch orchestration command.", cause)), Effect.asVoid);
33377
33290
  const launchSetupScriptForWorktreeInBackground = (input) => Effect.gen(function* () {
33378
33291
  const requestedAt = (/* @__PURE__ */ new Date()).toISOString();
@@ -33596,20 +33509,27 @@ const makeWorktreeOperations = (deps) => {
33596
33509
  break;
33597
33510
  }
33598
33511
  }
33599
- const worktreePath = preparedWorktreePath ?? (yield* gitWorkflow.createWorktree({
33600
- cwd: project.workspaceRoot,
33601
- refName,
33602
- ...newRefName !== void 0 ? { newRefName } : {},
33603
- path: resolveWorktreeCheckoutPath({
33512
+ let worktreePath;
33513
+ if (preparedWorktreePath !== null) {
33514
+ if (isProjectRootPath(preparedWorktreePath, project.workspaceRoot)) return yield* failGitWorkflow(operation, "Cannot create a worktree at the project root.");
33515
+ worktreePath = preparedWorktreePath;
33516
+ } else {
33517
+ const targetPath = resolveWorktreeCheckoutPath({
33604
33518
  location: input.worktreeLocation,
33605
33519
  appWorktreesRoot: config.worktreesDir,
33606
33520
  projectId: input.projectId,
33607
33521
  workspaceRoot: project.workspaceRoot,
33608
33522
  projectMetadataDir: project.projectMetadataDir,
33609
33523
  branchName: branch
33610
- })
33611
- })).worktree.path;
33612
- if (preparedWorktreePath === null) {
33524
+ });
33525
+ if (isProjectRootPath(targetPath, project.workspaceRoot)) return yield* failGitWorkflow(operation, "Cannot create a worktree at the project root.");
33526
+ worktreePath = (yield* gitWorkflow.createWorktree({
33527
+ cwd: project.workspaceRoot,
33528
+ refName,
33529
+ ...newRefName !== void 0 ? { newRefName } : {},
33530
+ path: targetPath
33531
+ })).worktree.path;
33532
+ if (isProjectRootPath(worktreePath, project.workspaceRoot)) return yield* failGitWorkflow(operation, "Refusing to register a worktree that resolved to the project root.");
33613
33533
  ownedWorktreePath = worktreePath;
33614
33534
  if (newRefName !== void 0) ownedBranchName = newRefName;
33615
33535
  }
@@ -33750,6 +33670,7 @@ const makeWorktreeOperations = (deps) => {
33750
33670
  const worktree = yield* loadWorktreeForGitWorkflow(operation, input.worktreeId);
33751
33671
  if (worktree.origin === "main") return yield* failGitWorkflow(operation, "Cannot delete the main worktree.");
33752
33672
  const project = yield* loadProjectForGitWorkflow(operation, worktree.projectId);
33673
+ if (worktree.worktreePath !== null && isProjectRootPath(worktree.worktreePath, project.workspaceRoot)) return yield* failGitWorkflow(operation, "Cannot delete a worktree that points at the project root.");
33753
33674
  if (input.force) {
33754
33675
  if (worktree.worktreePath !== null) {
33755
33676
  if (existsSync(worktree.worktreePath)) return yield* failGitWorkflow(operation, "Cannot force delete: the worktree path still exists on disk. Use a regular delete instead.");
@@ -34523,6 +34444,16 @@ const makeOrchestrationHandlers = (ctx) => {
34523
34444
  message: "Failed to load full thread diff",
34524
34445
  cause
34525
34446
  }))), { "rpc.aggregate": "orchestration" }),
34447
+ [ORCHESTRATION_WS_METHODS.searchThreadMessages]: (input) => observeRpcEffect(ORCHESTRATION_WS_METHODS.searchThreadMessages, projectionSnapshotQuery.searchThreadMessages({
34448
+ ...input,
34449
+ limit: clamp(input.limit, {
34450
+ maximum: 50,
34451
+ minimum: 1
34452
+ })
34453
+ }).pipe(Effect.mapError((cause) => new OrchestrationGetSnapshotError({
34454
+ message: "Failed to search thread messages",
34455
+ cause
34456
+ }))), { "rpc.aggregate": "orchestration" }),
34526
34457
  [ORCHESTRATION_WS_METHODS.replayEvents]: (input) => observeRpcEffect(ORCHESTRATION_WS_METHODS.replayEvents, Stream.runCollect(orchestrationEngine.readEvents(clamp(input.fromSequenceExclusive, {
34527
34458
  maximum: Number.MAX_SAFE_INTEGER,
34528
34459
  minimum: 0
@@ -34582,7 +34513,22 @@ const makeOrchestrationHandlers = (ctx) => {
34582
34513
  threadId: input.threadId,
34583
34514
  position: input.position,
34584
34515
  changedAt: (/* @__PURE__ */ new Date()).toISOString()
34585
- }, "threads.setManualPosition").pipe(Effect.as({}))), { "rpc.aggregate": "orchestration" })
34516
+ }, "threads.setManualPosition").pipe(Effect.as({}))), { "rpc.aggregate": "orchestration" }),
34517
+ [WS_METHODS.searchThreadMessages]: (input) => observeRpcEffect(WS_METHODS.searchThreadMessages, ownerEffect(WS_METHODS.searchThreadMessages, Effect.gen(function* () {
34518
+ const query = input.query.trim();
34519
+ if (query.length === 0) return { results: [] };
34520
+ return { results: yield* projectionSnapshotQuery.searchThreadMessages({
34521
+ query,
34522
+ ...input.projectId ? { projectId: input.projectId } : {},
34523
+ limit: clamp(input.limit ?? 20, {
34524
+ maximum: 50,
34525
+ minimum: 1
34526
+ })
34527
+ }) };
34528
+ }).pipe(Effect.mapError(() => new AuthRpcError({
34529
+ message: "Failed to search thread messages.",
34530
+ status: 403
34531
+ })))), { "rpc.aggregate": "orchestration" })
34586
34532
  });
34587
34533
  };
34588
34534
  //#endregion
@@ -34864,7 +34810,7 @@ const makeSourceControlHandlers = (ctx) => {
34864
34810
  })), { "rpc.aggregate": "source-control" }),
34865
34811
  [WS_METHODS.sourceControlListIssueLabels]: ({ cwd }) => observeRpcEffect(WS_METHODS.sourceControlListIssueLabels, ownerEffect(WS_METHODS.sourceControlListIssueLabels, sourceControlRegistry.resolve({ cwd }).pipe(Effect.flatMap((provider) => provider.listLabels({ cwd })))), { "rpc.aggregate": "source-control" }),
34866
34812
  [WS_METHODS.sourceControlListIssueAssignees]: ({ cwd }) => observeRpcEffect(WS_METHODS.sourceControlListIssueAssignees, ownerEffect(WS_METHODS.sourceControlListIssueAssignees, sourceControlRegistry.resolve({ cwd }).pipe(Effect.flatMap((provider) => provider.listAssignees({ cwd })))), { "rpc.aggregate": "source-control" }),
34867
- [WS_METHODS.sourceControlListWorkflowRuns]: ({ cwd, pullRequestNumber, commitSha, limit }) => observeRpcEffect(WS_METHODS.sourceControlListWorkflowRuns, ownerEffect(WS_METHODS.sourceControlListWorkflowRuns, callSourceControlWorkflowMethod({
34813
+ [WS_METHODS.sourceControlListWorkflowRuns]: ({ cwd, pullRequestNumber, commitSha, branch, limit }) => observeRpcEffect(WS_METHODS.sourceControlListWorkflowRuns, ownerEffect(WS_METHODS.sourceControlListWorkflowRuns, callSourceControlWorkflowMethod({
34868
34814
  cwd,
34869
34815
  operation: "listWorkflowRuns",
34870
34816
  invoke: (provider) => {
@@ -34873,6 +34819,7 @@ const makeSourceControlHandlers = (ctx) => {
34873
34819
  cwd,
34874
34820
  ...pullRequestNumber !== void 0 ? { pullRequestNumber } : {},
34875
34821
  ...commitSha !== void 0 ? { commitSha } : {},
34822
+ ...branch !== void 0 ? { branch } : {},
34876
34823
  ...limit !== void 0 ? { limit } : {}
34877
34824
  });
34878
34825
  }
@@ -35639,7 +35586,7 @@ const TelemetryEnvConfig = Config.all({
35639
35586
  maxBufferedEvents: Config.number("RYCO_TELEMETRY_MAX_BUFFERED_EVENTS").pipe(Config.withDefault(1e3))
35640
35587
  });
35641
35588
  const makeAnalyticsService = Effect.gen(function* () {
35642
- const telemetryConfig = yield* TelemetryEnvConfig.asEffect();
35589
+ const telemetryConfig = yield* TelemetryEnvConfig;
35643
35590
  const httpClient = yield* HttpClient.HttpClient;
35644
35591
  const serverConfig = yield* ServerConfig;
35645
35592
  const identifier = yield* getTelemetryIdentifier;
@@ -50576,8 +50523,20 @@ const WorkspaceRootLookupInput = Schema.Struct({ workspaceRoot: Schema.String })
50576
50523
  const ProjectIdLookupInput = Schema.Struct({ projectId: ProjectId });
50577
50524
  const ThreadIdLookupInput = Schema.Struct({ threadId: ThreadId });
50578
50525
  const WorktreeIdLookupInput = Schema.Struct({ worktreeId: WorktreeId });
50526
+ const ThreadMessageSearchQueryInput = Schema.Struct({
50527
+ likePattern: Schema.String,
50528
+ projectId: Schema.NullOr(ProjectId),
50529
+ limit: NonNegativeInt
50530
+ });
50579
50531
  const ProjectionProjectLookupRowSchema = ProjectionProjectDbRowSchema;
50580
50532
  const ProjectionThreadIdLookupRowSchema = Schema.Struct({ threadId: ThreadId });
50533
+ const ProjectionThreadMessageSearchRowSchema = Schema.Struct({
50534
+ threadId: ThreadId,
50535
+ messageId: MessageId,
50536
+ text: Schema.String,
50537
+ createdAt: IsoDateTime,
50538
+ updatedAt: IsoDateTime
50539
+ });
50581
50540
  const ProjectionThreadCheckpointContextThreadRowSchema = Schema.Struct({
50582
50541
  threadId: ThreadId,
50583
50542
  projectId: ProjectId,
@@ -50609,6 +50568,20 @@ function computeSnapshotSequence(stateRows) {
50609
50568
  }
50610
50569
  return Number.isFinite(minSequence) ? minSequence : 0;
50611
50570
  }
50571
+ function escapeSqlLikePattern(value) {
50572
+ return value.replace(/[\\%_]/g, (match) => `\\${match}`);
50573
+ }
50574
+ function buildMessageSearchSnippet(input) {
50575
+ const maxLength = input.maxLength ?? 180;
50576
+ const normalizedQuery = input.query.trim().toLowerCase();
50577
+ const normalizedText = input.text.toLowerCase();
50578
+ const matchIndex = normalizedQuery.length > 0 ? normalizedText.indexOf(normalizedQuery) : -1;
50579
+ const contextLength = Math.floor(maxLength / 2);
50580
+ const start = matchIndex <= contextLength ? 0 : Math.max(0, matchIndex - Math.floor(contextLength / 2));
50581
+ const end = Math.min(input.text.length, start + maxLength);
50582
+ const snippet = input.text.slice(start, end).replace(/\s+/g, " ").trim();
50583
+ return `${start > 0 ? "..." : ""}${snippet}${end < input.text.length ? "..." : ""}`;
50584
+ }
50612
50585
  function mapLatestTurn(row) {
50613
50586
  return {
50614
50587
  turnId: row.turnId,
@@ -51078,6 +51051,30 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
51078
51051
  FROM projection_thread_messages
51079
51052
  WHERE thread_id = ${threadId}
51080
51053
  ORDER BY created_at ASC, message_id ASC
51054
+ `
51055
+ });
51056
+ const searchThreadMessageRows = SqlSchema.findAll({
51057
+ Request: ThreadMessageSearchQueryInput,
51058
+ Result: ProjectionThreadMessageSearchRowSchema,
51059
+ execute: ({ likePattern, projectId, limit }) => sql`
51060
+ SELECT
51061
+ messages.thread_id AS "threadId",
51062
+ messages.message_id AS "messageId",
51063
+ messages.text,
51064
+ messages.created_at AS "createdAt",
51065
+ messages.updated_at AS "updatedAt"
51066
+ FROM projection_thread_messages AS messages
51067
+ INNER JOIN projection_threads AS threads
51068
+ ON threads.thread_id = messages.thread_id
51069
+ INNER JOIN projection_projects AS projects
51070
+ ON projects.project_id = threads.project_id
51071
+ WHERE threads.deleted_at IS NULL
51072
+ AND projects.deleted_at IS NULL
51073
+ AND messages.role IN ('user', 'assistant')
51074
+ AND (${projectId} IS NULL OR threads.project_id = ${projectId})
51075
+ AND lower(messages.text) LIKE ${likePattern} ESCAPE '\\'
51076
+ ORDER BY messages.created_at DESC, messages.message_id DESC
51077
+ LIMIT ${limit}
51081
51078
  `
51082
51079
  });
51083
51080
  const listThreadProposedPlanRowsByThread = SqlSchema.findAll({
@@ -51666,6 +51663,24 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
51666
51663
  };
51667
51664
  return Option.some(yield* decodeThread(thread).pipe(Effect.mapError(toPersistenceDecodeError("ProjectionSnapshotQuery.getThreadDetailById:decodeThread"))));
51668
51665
  });
51666
+ const searchThreadMessages = (input) => {
51667
+ const query = input.query.trim();
51668
+ if (query.length === 0) return Effect.succeed([]);
51669
+ const limit = Math.min(Math.max(1, input.limit), 50);
51670
+ return searchThreadMessageRows({
51671
+ likePattern: `%${escapeSqlLikePattern(query.toLowerCase())}%`,
51672
+ projectId: input.projectId ?? null,
51673
+ limit
51674
+ }).pipe(Effect.mapError(toPersistenceSqlOrDecodeError("ProjectionSnapshotQuery.searchThreadMessages:query", "ProjectionSnapshotQuery.searchThreadMessages:decodeRows")), Effect.map((rows) => rows.map((row) => ({
51675
+ threadId: row.threadId,
51676
+ messageId: row.messageId,
51677
+ snippet: buildMessageSearchSnippet({
51678
+ text: row.text,
51679
+ query
51680
+ }),
51681
+ timestamp: row.createdAt
51682
+ }))));
51683
+ };
51669
51684
  return {
51670
51685
  getCommandReadModel,
51671
51686
  getSnapshot,
@@ -51678,7 +51693,8 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
51678
51693
  getThreadCheckpointContext,
51679
51694
  getThreadShellById,
51680
51695
  getWorktreeShellById,
51681
- getThreadDetailById
51696
+ getThreadDetailById,
51697
+ searchThreadMessages
51682
51698
  };
51683
51699
  });
51684
51700
  const OrchestrationProjectionSnapshotQueryLive = Layer.effect(ProjectionSnapshotQuery, makeProjectionSnapshotQuery);