@iaforged/context-code 2.0.1 → 2.0.2

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 (141) hide show
  1. package/dist/src/bridge/bridgeMain.js +1 -1
  2. package/dist/src/bridge/types.js +1 -1
  3. package/dist/src/cli/handlers/auth.js +1 -1
  4. package/dist/src/cli/handlers/mcp.js +1 -1
  5. package/dist/src/cli/print.js +1 -1
  6. package/dist/src/commands/copy/copy.js +1 -1
  7. package/dist/src/commands/heartbeat/heartbeat.js +1 -0
  8. package/dist/src/commands/heartbeat/index.js +1 -0
  9. package/dist/src/commands/insights.js +1 -1
  10. package/dist/src/commands/install-github-app/ExistingWorkflowStep.js +1 -1
  11. package/dist/src/commands/install-github-app/InstallAppStep.js +1 -1
  12. package/dist/src/commands/install-github-app/OAuthFlowStep.js +1 -1
  13. package/dist/src/commands/install-github-app/SuccessStep.js +1 -1
  14. package/dist/src/commands/install-github-app/setupGitHubActions.js +1 -1
  15. package/dist/src/commands/login-openai/index.js +1 -1
  16. package/dist/src/commands/mobile/mobile.js +1 -1
  17. package/dist/src/commands/remote-setup/remote-setup.js +1 -1
  18. package/dist/src/commands/swarm-auto/swarmAuto.js +1 -1
  19. package/dist/src/commands/timeline/timeline.js +1 -1
  20. package/dist/src/commands/webapp/webapp.js +1 -1
  21. package/dist/src/commands.js +1 -1
  22. package/dist/src/components/ApproveApiKey.js +1 -1
  23. package/dist/src/components/ChannelDowngradeDialog.js +1 -1
  24. package/dist/src/components/ClaudeCodeHint/PluginHintMenu.js +1 -1
  25. package/dist/src/components/ConsoleOAuthFlow.js +1 -1
  26. package/dist/src/components/CostThresholdDialog.js +1 -1
  27. package/dist/src/components/CtrlOToExpand.js +1 -1
  28. package/dist/src/components/CustomSelect/select.js +1 -1
  29. package/dist/src/components/DesktopHandoff.js +1 -1
  30. package/dist/src/components/DesktopUpsell/DesktopUpsellStartup.js +1 -1
  31. package/dist/src/components/ExportDialog.js +1 -1
  32. package/dist/src/components/Feedback.js +1 -1
  33. package/dist/src/components/FeedbackSurvey/FeedbackSurvey.js +1 -1
  34. package/dist/src/components/FeedbackSurvey/FeedbackSurveyView.js +1 -1
  35. package/dist/src/components/IdeAutoConnectDialog.js +1 -1
  36. package/dist/src/components/IdeOnboardingDialog.js +1 -1
  37. package/dist/src/components/IdleReturnDialog.js +1 -1
  38. package/dist/src/components/InterruptedByUser.js +1 -1
  39. package/dist/src/components/InvalidConfigDialog.js +1 -1
  40. package/dist/src/components/InvalidSettingsDialog.js +1 -1
  41. package/dist/src/components/LanguagePicker.js +1 -1
  42. package/dist/src/components/LogSelector.js +1 -1
  43. package/dist/src/components/LogoV2/ChannelsNotice.js +1 -1
  44. package/dist/src/components/LogoV2/LogoV2.js +1 -1
  45. package/dist/src/components/LogoV2/feedConfigs.js +1 -1
  46. package/dist/src/components/LspRecommendation/LspRecommendationMenu.js +1 -1
  47. package/dist/src/components/MCPServerApprovalDialog.js +1 -1
  48. package/dist/src/components/MCPServerDesktopImportDialog.js +1 -1
  49. package/dist/src/components/ManagedSettingsSecurityDialog/ManagedSettingsSecurityDialog.js +1 -1
  50. package/dist/src/components/MessageSelector.js +1 -1
  51. package/dist/src/components/OutputStylePicker.js +1 -1
  52. package/dist/src/components/PromptInput/PromptInput.js +1 -1
  53. package/dist/src/components/RemoteCallout.js +1 -1
  54. package/dist/src/components/ResumeTask.js +1 -1
  55. package/dist/src/components/Settings/Config.js +1 -1
  56. package/dist/src/components/ShowInIDEPrompt.js +1 -1
  57. package/dist/src/components/Stats.js +1 -1
  58. package/dist/src/components/TagTabs.js +1 -1
  59. package/dist/src/components/TeleportError.js +1 -1
  60. package/dist/src/components/TeleportResumeWrapper.js +1 -1
  61. package/dist/src/components/TextInput.js +1 -1
  62. package/dist/src/components/agents/new-agent-creation/wizard-steps/MethodStep.js +1 -1
  63. package/dist/src/components/design-system/KeyboardShortcutHint.js +1 -1
  64. package/dist/src/components/diff/DiffDetailView.js +1 -1
  65. package/dist/src/components/grove/Grove.js +1 -1
  66. package/dist/src/components/hooks/SelectEventMode.js +1 -1
  67. package/dist/src/components/hooks/SelectHookMode.js +1 -1
  68. package/dist/src/components/hooks/SelectMatcherMode.js +1 -1
  69. package/dist/src/components/hooks/ViewHookMode.js +1 -1
  70. package/dist/src/components/mcp/MCPAgentServerMenu.js +1 -1
  71. package/dist/src/components/mcp/utils/reconnectHelpers.js +1 -1
  72. package/dist/src/components/memory/MemoryFileSelector.js +1 -1
  73. package/dist/src/components/messages/AssistantTextMessage.js +1 -1
  74. package/dist/src/components/messages/PlanApprovalMessage.js +1 -1
  75. package/dist/src/components/messages/ShutdownMessage.js +1 -1
  76. package/dist/src/components/messages/SystemAPIErrorMessage.js +1 -1
  77. package/dist/src/components/messages/UserPlanMessage.js +1 -1
  78. package/dist/src/components/permissions/AskUserQuestionPermissionRequest/PreviewQuestionView.js +1 -1
  79. package/dist/src/components/permissions/ComputerUseApproval/ComputerUseApproval.js +1 -1
  80. package/dist/src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +1 -1
  81. package/dist/src/components/permissions/FilePermissionDialog/FilePermissionDialog.js +1 -1
  82. package/dist/src/components/permissions/FilePermissionDialog/permissionOptions.js +1 -1
  83. package/dist/src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +1 -1
  84. package/dist/src/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +1 -1
  85. package/dist/src/components/permissions/PermissionRequest.js +1 -1
  86. package/dist/src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.js +1 -1
  87. package/dist/src/components/permissions/SkillPermissionRequest/SkillPermissionRequest.js +1 -1
  88. package/dist/src/components/permissions/WebFetchPermissionRequest/WebFetchPermissionRequest.js +1 -1
  89. package/dist/src/components/permissions/rules/AddPermissionRules.js +1 -1
  90. package/dist/src/components/permissions/rules/AddWorkspaceDirectory.js +1 -1
  91. package/dist/src/components/permissions/rules/PermissionRuleList.js +1 -1
  92. package/dist/src/components/permissions/rules/RemoveWorkspaceDirectory.js +1 -1
  93. package/dist/src/components/sandbox/SandboxConfigTab.js +1 -1
  94. package/dist/src/components/sandbox/SandboxOverridesTab.js +1 -1
  95. package/dist/src/components/tasks/RemoteSessionDetailDialog.js +1 -1
  96. package/dist/src/constants/outputStyles.js +1 -1
  97. package/dist/src/entrypoints/cli.js +1 -1
  98. package/dist/src/hooks/notifs/useCanSwitchToExistingSubscription.js +1 -1
  99. package/dist/src/main.js +1 -1
  100. package/dist/src/projectOnboardingState.js +1 -1
  101. package/dist/src/screens/REPL.js +1 -1
  102. package/dist/src/services/api/errors.js +1 -1
  103. package/dist/src/services/api/filesApi.js +1 -1
  104. package/dist/src/services/tips/tipRegistry.js +1 -1
  105. package/dist/src/tasks/RemoteAgentTask/RemoteAgentTask.js +1 -1
  106. package/dist/src/tools/AgentTool/AgentTool.js +1 -1
  107. package/dist/src/tools/ConfigTool/supportedSettings.js +1 -1
  108. package/dist/src/tools/EnterWorktreeTool/EnterWorktreeTool.js +1 -1
  109. package/dist/src/tools/ExitWorktreeTool/ExitWorktreeTool.js +1 -1
  110. package/dist/src/tools/WebFetchTool/WebFetchTool.js +1 -1
  111. package/dist/src/utils/computerUse/cleanup.js +1 -1
  112. package/dist/src/utils/computerUse/wrapper.js +1 -1
  113. package/dist/src/utils/fileHistory.js +1 -1
  114. package/dist/src/utils/heartbeat.js +1 -0
  115. package/dist/src/utils/model/providers.js +1 -1
  116. package/dist/src/utils/permissions/filesystem.js +1 -1
  117. package/dist/src/utils/permissions/permissions.js +1 -1
  118. package/dist/src/utils/processUserInput/processSlashCommand.js +1 -1
  119. package/dist/src/utils/releaseNoteTranslations.js +1 -1
  120. package/dist/src/utils/shell/shellToolUtils.js +1 -1
  121. package/dist/src/utils/sshMcp/common.js +1 -0
  122. package/dist/src/utils/sshMcp/setup.js +1 -0
  123. package/dist/src/utils/sshMcp/sshMcpServer.js +1 -0
  124. package/dist/src/utils/sshMcp/sshMcpServer.test.js +1 -0
  125. package/dist/src/utils/teleport.js +1 -1
  126. package/dist/src/webapp/server.js +1 -1
  127. package/dist/sshMcpServer.js +1 -0
  128. package/dist/sshMcpServer.test.js +1 -0
  129. package/dist/webapp/chunk-AMCDNAIG.js +1 -0
  130. package/dist/webapp/{chunk-YUEYJPXQ.js → chunk-NFYBHCXF.js} +1 -1
  131. package/dist/webapp/{chunk-DFKSSBHI.js → chunk-OJZNEHPP.js} +1 -1
  132. package/dist/webapp/chunk-VAB2VXFI.js +1 -0
  133. package/dist/webapp/index.html +2 -2
  134. package/dist/webapp/main-MTQLKGXD.js +1 -0
  135. package/dist/webapp/ngsw.json +14 -14
  136. package/dist/webapp/styles-DIKEDJBH.css +1 -0
  137. package/package.json +2 -1
  138. package/dist/webapp/chunk-4SRNXNLW.js +0 -1
  139. package/dist/webapp/chunk-SIHYW6PA.js +0 -1
  140. package/dist/webapp/main-LBNRQBXX.js +0 -1
  141. package/dist/webapp/styles-FUPULZDX.css +0 -1
@@ -1 +1 @@
1
- import{jsx as o,jsxs as e}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{Text as n}from"../ink.js";import{getGlobalConfig as l,saveGlobalConfig as c}from"../utils/config.js";import{isSupportedTerminal as i}from"../utils/ide.js";import{Select as s}from"./CustomSelect/index.js";import{Dialog as a}from"./design-system/Dialog.js";export function IdeAutoConnectDialog(l){const i=t(9),{onComplete:r}=l;let u;i[0]!==r?(u=async o=>{const e="yes"===o;c(o=>({...o,autoConnectIde:e,hasIdeAutoConnectDialogBeenShown:!0})),r()},i[0]=r,i[1]=u):u=i[1];const m=u;let d;i[2]===Symbol.for("react.memo_cache_sentinel")?(d=[{label:"Yes",value:"yes"},{label:"No",value:"no"}],i[2]=d):d=i[2];const f=d;let h,p,C;return i[3]!==m?(h=o(s,{options:f,onChange:m,defaultValue:"yes"}),i[3]=m,i[4]=h):h=i[4],i[5]===Symbol.for("react.memo_cache_sentinel")?(p=o(n,{dimColor:!0,children:"You can also configure this in /config or with the --ide flag"}),i[5]=p):p=i[5],i[6]!==r||i[7]!==h?(C=e(a,{title:"Do you wish to enable auto-connect to IDE?",color:"ide",onCancel:r,children:[h,p]}),i[6]=r,i[7]=h,i[8]=C):C=i[8],C}export function shouldShowAutoConnectDialog(){const o=l();return!i()&&!0!==o.autoConnectIde&&!0!==o.hasIdeAutoConnectDialogBeenShown}export function IdeDisableAutoConnectDialog(e){const n=t(10),{onComplete:l}=e;let i;n[0]!==l?(i=o=>{const e="yes"===o;e&&c(_temp),l(e)},n[0]=l,n[1]=i):i=n[1];const r=i;let u;n[2]!==l?(u=()=>{l(!1)},n[2]=l,n[3]=u):u=n[3];const m=u;let d;n[4]===Symbol.for("react.memo_cache_sentinel")?(d=[{label:"No",value:"no"},{label:"Yes",value:"yes"}],n[4]=d):d=n[4];const f=d;let h,p;return n[5]!==r?(h=o(s,{options:f,onChange:r,defaultValue:"no"}),n[5]=r,n[6]=h):h=n[6],n[7]!==m||n[8]!==h?(p=o(a,{title:"Do you wish to disable auto-connect to IDE?",subtitle:"You can also configure this in /config",onCancel:m,color:"ide",children:h}),n[7]=m,n[8]=h,n[9]=p):p=n[9],p}function _temp(o){return{...o,autoConnectIde:!1}}export function shouldShowDisableAutoConnectDialog(){const o=l();return!i()&&!0===o.autoConnectIde}
1
+ import{jsx as o,jsxs as e}from"react/jsx-runtime";import{c as n}from"react/compiler-runtime";import{Text as t}from"../ink.js";import{getGlobalConfig as l,saveGlobalConfig as c}from"../utils/config.js";import{isSupportedTerminal as i}from"../utils/ide.js";import{Select as s}from"./CustomSelect/index.js";import{Dialog as a}from"./design-system/Dialog.js";export function IdeAutoConnectDialog(l){const i=n(9),{onComplete:r}=l;let u;i[0]!==r?(u=async o=>{const e="yes"===o;c(o=>({...o,autoConnectIde:e,hasIdeAutoConnectDialogBeenShown:!0})),r()},i[0]=r,i[1]=u):u=i[1];const m=u;let d;i[2]===Symbol.for("react.memo_cache_sentinel")?(d=[{label:"Yes",value:"yes"},{label:"No",value:"no"}],i[2]=d):d=i[2];const f=d;let p,h,C;return i[3]!==m?(p=o(s,{options:f,onChange:m,defaultValue:"yes"}),i[3]=m,i[4]=p):p=i[4],i[5]===Symbol.for("react.memo_cache_sentinel")?(h=o(t,{dimColor:!0,children:"También puedes configurar esto en /config o con la opción --ide"}),i[5]=h):h=i[5],i[6]!==r||i[7]!==p?(C=e(a,{title:"¿Quieres habilitar la auto-conexión con el IDE?",color:"ide",onCancel:r,children:[p,h]}),i[6]=r,i[7]=p,i[8]=C):C=i[8],C}export function shouldShowAutoConnectDialog(){const o=l();return!i()&&!0!==o.autoConnectIde&&!0!==o.hasIdeAutoConnectDialogBeenShown}export function IdeDisableAutoConnectDialog(e){const t=n(10),{onComplete:l}=e;let i;t[0]!==l?(i=o=>{const e="yes"===o;e&&c(_temp),l(e)},t[0]=l,t[1]=i):i=t[1];const r=i;let u;t[2]!==l?(u=()=>{l(!1)},t[2]=l,t[3]=u):u=t[3];const m=u;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=[{label:"No",value:"no"},{label:"Yes",value:"yes"}],t[4]=d):d=t[4];const f=d;let p,h;return t[5]!==r?(p=o(s,{options:f,onChange:r,defaultValue:"no"}),t[5]=r,t[6]=p):p=t[6],t[7]!==m||t[8]!==p?(h=o(a,{title:"Do you wish to disable auto-connect to IDE?",subtitle:"You can also configure this in /config",onCancel:m,color:"ide",children:p}),t[7]=m,t[8]=p,t[9]=h):h=t[9],h}function _temp(o){return{...o,autoConnectIde:!1}}export function shouldShowDisableAutoConnectDialog(){const o=l();return!i()&&!0===o.autoConnectIde}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as n,Fragment as o}from"react/jsx-runtime";import{c as i}from"react/compiler-runtime";import{envDynamic as r}from"../utils/envDynamic.js";import{Box as t,Text as c}from"../ink.js";import{useKeybindings as l}from"../keybindings/useKeybinding.js";import{getGlobalConfig as s,saveGlobalConfig as m}from"../utils/config.js";import{env as d}from"../utils/env.js";import{getTerminalIdeType as a,isJetBrainsIde as h,toIDEDisplayName as f}from"../utils/ide.js";import{Dialog as u}from"./design-system/Dialog.js";export function IdeOnboardingDialog(s){const g=i(23),{onDone:p,installationStatus:y}=s;let b,_,S;!function(){if(hasIdeOnboardingDialogBeenShown())return;const e=r.terminal||"unknown";m(n=>({...n,hasIdeOnboardingBeenShown:{...n.hasIdeOnboardingBeenShown,[e]:!0}}))}(),g[0]!==p?(b={"confirm:yes":p,"confirm:no":p},g[0]=p,g[1]=b):b=g[1],g[2]===Symbol.for("react.memo_cache_sentinel")?(_={context:"Confirmation"},g[2]=_):_=g[2],l(b,_),g[3]!==y?.ideType?(S=y?.ideType??a(),g[3]=y?.ideType,g[4]=S):S=g[4];const C=S,x=h(C);let j;g[5]!==C?(j=f(C),g[5]=C,g[6]=j):j=g[6];const w=j,D=y?.installedVersion,I=x?"plugin":"extension",O="darwin"===d.platform?"Cmd+Option+K":"Ctrl+Alt+K";let v,k;g[7]===Symbol.for("react.memo_cache_sentinel")?(v=e(c,{color:"claude",children:"✻ "}),g[7]=v):v=g[7],g[8]!==w?(k=n(o,{children:[v,n(c,{children:["Welcome to Context Code for ",w]})]}),g[8]=w,g[9]=k):k=g[9];const B=D?`installed ${I} v${D}`:void 0;let E,K,T,W,A,R,$,F,G;return g[10]===Symbol.for("react.memo_cache_sentinel")?(E=e(c,{color:"suggestion",children:"⧉ open files"}),g[10]=E):E=g[10],g[11]===Symbol.for("react.memo_cache_sentinel")?(K=n(c,{children:["• Claude has context of ",E," ","and ",e(c,{color:"suggestion",children:"⧉ selected lines"})]}),g[11]=K):K=g[11],g[12]===Symbol.for("react.memo_cache_sentinel")?(T=e(c,{color:"diffAddedWord",children:"+11"}),g[12]=T):T=g[12],g[13]===Symbol.for("react.memo_cache_sentinel")?(W=n(c,{children:["• Review Context Code's changes"," ",T," ",e(c,{color:"diffRemovedWord",children:"-22"})," in the comfort of your IDE"]}),g[13]=W):W=g[13],g[14]===Symbol.for("react.memo_cache_sentinel")?(A=n(c,{children:["• Cmd+Esc",e(c,{dimColor:!0,children:" for Quick Launch"})]}),g[14]=A):A=g[14],g[15]===Symbol.for("react.memo_cache_sentinel")?(R=n(t,{flexDirection:"column",gap:1,children:[K,W,A,n(c,{children:["• ",O,e(c,{dimColor:!0,children:" to reference files or lines in your input"})]})]}),g[15]=R):R=g[15],g[16]!==p||g[17]!==k||g[18]!==B?($=e(u,{title:k,subtitle:B,color:"ide",onCancel:p,hideInputGuide:!0,children:R}),g[16]=p,g[17]=k,g[18]=B,g[19]=$):$=g[19],g[20]===Symbol.for("react.memo_cache_sentinel")?(F=e(t,{paddingX:1,children:e(c,{dimColor:!0,italic:!0,children:"Press Enter to continue"})}),g[20]=F):F=g[20],g[21]!==$?(G=n(o,{children:[$,F]}),g[21]=$,g[22]=G):G=g[22],G}export function hasIdeOnboardingDialogBeenShown(){const e=s(),n=r.terminal||"unknown";return!0===e.hasIdeOnboardingBeenShown?.[n]}
1
+ import{jsx as e,jsxs as n,Fragment as o}from"react/jsx-runtime";import{c as i}from"react/compiler-runtime";import{envDynamic as r}from"../utils/envDynamic.js";import{Box as t,Text as c}from"../ink.js";import{useKeybindings as l}from"../keybindings/useKeybinding.js";import{getGlobalConfig as s,saveGlobalConfig as d}from"../utils/config.js";import{env as m}from"../utils/env.js";import{getTerminalIdeType as a,isJetBrainsIde as h,toIDEDisplayName as f}from"../utils/ide.js";import{Dialog as u}from"./design-system/Dialog.js";export function IdeOnboardingDialog(s){const p=i(23),{onDone:g,installationStatus:y}=s;let b,_,S;!function(){if(hasIdeOnboardingDialogBeenShown())return;const e=r.terminal||"unknown";d(n=>({...n,hasIdeOnboardingBeenShown:{...n.hasIdeOnboardingBeenShown,[e]:!0}}))}(),p[0]!==g?(b={"confirm:yes":g,"confirm:no":g},p[0]=g,p[1]=b):b=p[1],p[2]===Symbol.for("react.memo_cache_sentinel")?(_={context:"Confirmation"},p[2]=_):_=p[2],l(b,_),p[3]!==y?.ideType?(S=y?.ideType??a(),p[3]=y?.ideType,p[4]=S):S=p[4];const C=S,x=h(C);let j;p[5]!==C?(j=f(C),p[5]=C,p[6]=j):j=p[6];const w=j,D=y?.installedVersion,I=x?"plugin":"extension",v="darwin"===m.platform?"Cmd+Option+K":"Ctrl+Alt+K";let O,B;p[7]===Symbol.for("react.memo_cache_sentinel")?(O=e(c,{color:"claude",children:"✻ "}),p[7]=O):O=p[7],p[8]!==w?(B=n(o,{children:[O,n(c,{children:["Bienvenido a Context Code para ",w]})]}),p[8]=w,p[9]=B):B=p[9];const k=D?`installed ${I} v${D}`:void 0;let E,K,T,A,R,W,$,F,G;return p[10]===Symbol.for("react.memo_cache_sentinel")?(E=e(c,{color:"suggestion",children:"⧉ open files"}),p[10]=E):E=p[10],p[11]===Symbol.for("react.memo_cache_sentinel")?(K=n(c,{children:["• Claude has context of ",E," ","and ",e(c,{color:"suggestion",children:"⧉ selected lines"})]}),p[11]=K):K=p[11],p[12]===Symbol.for("react.memo_cache_sentinel")?(T=e(c,{color:"diffAddedWord",children:"+11"}),p[12]=T):T=p[12],p[13]===Symbol.for("react.memo_cache_sentinel")?(A=n(c,{children:["• Review Context Code's changes"," ",T," ",e(c,{color:"diffRemovedWord",children:"-22"})," in the comfort of your IDE"]}),p[13]=A):A=p[13],p[14]===Symbol.for("react.memo_cache_sentinel")?(R=n(c,{children:["• Cmd+Esc",e(c,{dimColor:!0,children:" for Quick Launch"})]}),p[14]=R):R=p[14],p[15]===Symbol.for("react.memo_cache_sentinel")?(W=n(t,{flexDirection:"column",gap:1,children:[K,A,R,n(c,{children:["• ",v,e(c,{dimColor:!0,children:" to reference files or lines in your input"})]})]}),p[15]=W):W=p[15],p[16]!==g||p[17]!==B||p[18]!==k?($=e(u,{title:B,subtitle:k,color:"ide",onCancel:g,hideInputGuide:!0,children:W}),p[16]=g,p[17]=B,p[18]=k,p[19]=$):$=p[19],p[20]===Symbol.for("react.memo_cache_sentinel")?(F=e(t,{paddingX:1,children:e(c,{dimColor:!0,italic:!0,children:"Press Enter to continue"})}),p[20]=F):F=p[20],p[21]!==$?(G=n(o,{children:[$,F]}),p[21]=$,p[22]=G):G=p[22],G}export function hasIdeOnboardingDialogBeenShown(){const e=s(),n=r.terminal||"unknown";return!0===e.hasIdeOnboardingBeenShown?.[n]}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as n}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{Box as t,Text as r}from"../ink.js";import{formatTokens as a}from"../utils/format.js";import{Select as i}from"./CustomSelect/index.js";import{Dialog as s}from"./design-system/Dialog.js";export function IdleReturnDialog(l){const m=o(16),{idleMinutes:c,totalInputTokens:f,onDone:u}=l;let h;m[0]!==c?(h=function(e){if(e<1)return"< 1m";if(e<60)return`${Math.floor(e)}m`;const n=Math.floor(e/60),o=Math.floor(e%60);if(0===o)return`${n}h`;return`${n}h ${o}m`}(c),m[0]=c,m[1]=h):h=m[1];const d=h;let p;m[2]!==f?(p=a(f),m[2]=f,m[3]=p):p=m[3];const b=`You've been away ${d} and this conversation is ${p} tokens.`;let v,g,_,j,x,y,S;return m[4]!==u?(v=()=>u("dismiss"),m[4]=u,m[5]=v):v=m[5],m[6]===Symbol.for("react.memo_cache_sentinel")?(g=e(t,{flexDirection:"column",children:e(r,{children:"If this is a new task, clearing context will save usage and be faster."})}),m[6]=g):g=m[6],m[7]===Symbol.for("react.memo_cache_sentinel")?(_={value:"continue",label:"Continue this conversation"},m[7]=_):_=m[7],m[8]===Symbol.for("react.memo_cache_sentinel")?(j={value:"clear",label:"Send message as a new conversation"},m[8]=j):j=m[8],m[9]===Symbol.for("react.memo_cache_sentinel")?(x=[_,j,{value:"never",label:"Don't ask me again"}],m[9]=x):x=m[9],m[10]!==u?(y=e(i,{options:x,onChange:e=>u(e)}),m[10]=u,m[11]=y):y=m[11],m[12]!==b||m[13]!==v||m[14]!==y?(S=n(s,{title:b,onCancel:v,children:[g,y]}),m[12]=b,m[13]=v,m[14]=y,m[15]=S):S=m[15],S}
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{c as n}from"react/compiler-runtime";import{Box as t,Text as r}from"../ink.js";import{formatTokens as a}from"../utils/format.js";import{Select as i}from"./CustomSelect/index.js";import{Dialog as s}from"./design-system/Dialog.js";export function IdleReturnDialog(l){const m=n(16),{idleMinutes:c,totalInputTokens:u,onDone:f}=l;let h;m[0]!==c?(h=function(e){if(e<1)return"< 1m";if(e<60)return`${Math.floor(e)}m`;const o=Math.floor(e/60),n=Math.floor(e%60);if(0===n)return`${o}h`;return`${o}h ${n}m`}(c),m[0]=c,m[1]=h):h=m[1];const p=h;let v;m[2]!==u?(v=a(u),m[2]=u,m[3]=v):v=m[3];const d=`You've been away ${p} and this conversation is ${v} tokens.`;let b,j,_,x,y,S,$;return m[4]!==f?(b=()=>f("dismiss"),m[4]=f,m[5]=b):b=m[5],m[6]===Symbol.for("react.memo_cache_sentinel")?(j=e(t,{flexDirection:"column",children:e(r,{children:"Si esta es una tarea nueva, limpiar el contexto ahorra uso y es más rápido."})}),m[6]=j):j=m[6],m[7]===Symbol.for("react.memo_cache_sentinel")?(_={value:"continue",label:"Continuar esta conversación"},m[7]=_):_=m[7],m[8]===Symbol.for("react.memo_cache_sentinel")?(x={value:"clear",label:"Enviar mensaje como conversación nueva"},m[8]=x):x=m[8],m[9]===Symbol.for("react.memo_cache_sentinel")?(y=[_,x,{value:"never",label:"No preguntar de nuevo"}],m[9]=y):y=m[9],m[10]!==f?(S=e(i,{options:y,onChange:e=>f(e)}),m[10]=f,m[11]=S):S=m[11],m[12]!==d||m[13]!==b||m[14]!==S?($=o(s,{title:d,onCancel:b,children:[j,S]}),m[12]=d,m[13]=b,m[14]=S,m[15]=$):$=m[15],$}
@@ -1 +1 @@
1
- import{jsx as r,Fragment as e,jsxs as t}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{Text as n}from"../ink.js";export function InterruptedByUser(){const i=o(1);let m;return i[0]===Symbol.for("react.memo_cache_sentinel")?(m=t(e,{children:[r(n,{dimColor:!0,children:"Interrupted "}),r(n,{dimColor:!0,children:"· What should Claude do instead?"})]}),i[0]=m):m=i[0],m}
1
+ import{jsx as r,Fragment as e,jsxs as o}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{Text as m}from"../ink.js";export function InterruptedByUser(){const n=t(1);let i;return n[0]===Symbol.for("react.memo_cache_sentinel")?(i=o(e,{children:[r(m,{dimColor:!0,children:"Interrumpido "}),r(m,{dimColor:!0,children:"· ¿Qué debería hacer en su lugar?"})]}),n[0]=i):i=n[0],i}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as i}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{Box as n,render as t,Text as r}from"../ink.js";import{KeybindingSetup as l}from"../keybindings/KeybindingProviderSetup.js";import{AppStateProvider as a}from"../state/AppState.js";import{getBaseRenderOptions as s}from"../utils/renderOptions.js";import{jsonStringify as c,writeFileSync_DEPRECATED as m}from"../utils/slowOperations.js";import{Select as f}from"./CustomSelect/index.js";import{Dialog as d}from"./design-system/Dialog.js";function InvalidConfigDialog(t){const l=o(19),{filePath:a,errorDescription:s,onExit:c,onReset:m}=t;let u;l[0]!==c||l[1]!==m?(u=e=>{"exit"===e?c():m()},l[0]=c,l[1]=m,l[2]=u):u=l[2];const p=u;let h,g,x,j,C,b,y;return l[3]!==a?(h=i(r,{children:["The configuration file at ",e(r,{bold:!0,children:a})," contains invalid JSON."]}),l[3]=a,l[4]=h):h=l[4],l[5]!==s?(g=e(r,{children:s}),l[5]=s,l[6]=g):g=l[6],l[7]!==h||l[8]!==g?(x=i(n,{flexDirection:"column",gap:1,children:[h,g]}),l[7]=h,l[8]=g,l[9]=x):x=l[9],l[10]===Symbol.for("react.memo_cache_sentinel")?(j=e(r,{bold:!0,children:"Choose an option:"}),l[10]=j):j=l[10],l[11]===Symbol.for("react.memo_cache_sentinel")?(C=[{label:"Exit and fix manually",value:"exit"},{label:"Reset with default configuration",value:"reset"}],l[11]=C):C=l[11],l[12]!==p||l[13]!==c?(b=i(n,{flexDirection:"column",children:[j,e(f,{options:C,onChange:p,onCancel:c})]}),l[12]=p,l[13]=c,l[14]=b):b=l[14],l[15]!==c||l[16]!==x||l[17]!==b?(y=i(d,{title:"Configuration Error",color:"error",onCancel:c,children:[x,b]}),l[15]=c,l[16]=x,l[17]=b,l[18]=y):y=l[18],y}export async function showInvalidConfigDialog({error:i}){const o={...s(!1),theme:"dark"};await new Promise(async n=>{const{unmount:r}=await t(e(a,{children:e(l,{children:e(InvalidConfigDialog,{filePath:i.filePath,errorDescription:i.message,onExit:()=>{r(),n(),process.exit(1)},onReset:()=>{m(i.filePath,c(i.defaultConfig,null,2),{flush:!1,encoding:"utf8"}),r(),n(),process.exit(0)}})})}),o)})}
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{c as i}from"react/compiler-runtime";import{Box as n,render as r,Text as t}from"../ink.js";import{KeybindingSetup as l}from"../keybindings/KeybindingProviderSetup.js";import{AppStateProvider as c}from"../state/AppState.js";import{getBaseRenderOptions as a}from"../utils/renderOptions.js";import{jsonStringify as s,writeFileSync_DEPRECATED as m}from"../utils/slowOperations.js";import{Select as f}from"./CustomSelect/index.js";import{Dialog as d}from"./design-system/Dialog.js";function InvalidConfigDialog(r){const l=i(19),{filePath:c,errorDescription:a,onExit:s,onReset:m}=r;let p;l[0]!==s||l[1]!==m?(p=e=>{"exit"===e?s():m()},l[0]=s,l[1]=m,l[2]=p):p=l[2];const u=p;let g,h,x,j,b,C,v;return l[3]!==c?(g=o(t,{children:["El archivo de configuración en ",e(t,{bold:!0,children:c})," contiene JSON inválido."]}),l[3]=c,l[4]=g):g=l[4],l[5]!==a?(h=e(t,{children:a}),l[5]=a,l[6]=h):h=l[6],l[7]!==g||l[8]!==h?(x=o(n,{flexDirection:"column",gap:1,children:[g,h]}),l[7]=g,l[8]=h,l[9]=x):x=l[9],l[10]===Symbol.for("react.memo_cache_sentinel")?(j=e(t,{bold:!0,children:"Elige una opción:"}),l[10]=j):j=l[10],l[11]===Symbol.for("react.memo_cache_sentinel")?(b=[{label:"Salir y corregir manualmente",value:"exit"},{label:"Restablecer con configuración por defecto",value:"reset"}],l[11]=b):b=l[11],l[12]!==u||l[13]!==s?(C=o(n,{flexDirection:"column",children:[j,e(f,{options:b,onChange:u,onCancel:s})]}),l[12]=u,l[13]=s,l[14]=C):C=l[14],l[15]!==s||l[16]!==x||l[17]!==C?(v=o(d,{title:"Configuration Error",color:"error",onCancel:s,children:[x,C]}),l[15]=s,l[16]=x,l[17]=C,l[18]=v):v=l[18],v}export async function showInvalidConfigDialog({error:o}){const i={...a(!1),theme:"dark"};await new Promise(async n=>{const{unmount:t}=await r(e(c,{children:e(l,{children:e(InvalidConfigDialog,{filePath:o.filePath,errorDescription:o.message,onExit:()=>{t(),n(),process.exit(1)},onReset:()=>{m(o.filePath,s(o.defaultConfig,null,2),{flush:!1,encoding:"utf8"}),t(),n(),process.exit(0)}})})}),i)})}
@@ -1 +1 @@
1
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{c as i}from"react/compiler-runtime";import{Text as o}from"../ink.js";import{Select as r}from"./CustomSelect/index.js";import{Dialog as n}from"./design-system/Dialog.js";import{ValidationErrorsList as s}from"./ValidationErrorsList.js";export function InvalidSettingsDialog(l){const a=i(13),{settingsErrors:m,onContinue:c,onExit:u}=l;let f;a[0]!==c||a[1]!==u?(f=function(t){"exit"===t?u():c()},a[0]=c,a[1]=u,a[2]=f):f=a[2];const p=f;let d,g,x,h,j;return a[3]!==m?(d=t(s,{errors:m}),a[3]=m,a[4]=d):d=a[4],a[5]===Symbol.for("react.memo_cache_sentinel")?(g=t(o,{dimColor:!0,children:"Files with errors are skipped entirely, not just the invalid settings."}),a[5]=g):g=a[5],a[6]===Symbol.for("react.memo_cache_sentinel")?(x=[{label:"Exit and fix manually",value:"exit"},{label:"Continue without these settings",value:"continue"}],a[6]=x):x=a[6],a[7]!==p?(h=t(r,{options:x,onChange:p}),a[7]=p,a[8]=h):h=a[8],a[9]!==u||a[10]!==d||a[11]!==h?(j=e(n,{title:"Settings Error",onCancel:u,color:"warning",children:[d,g,h]}),a[9]=u,a[10]=d,a[11]=h,a[12]=j):j=a[12],j}
1
+ import{jsx as o,jsxs as r}from"react/jsx-runtime";import{c as e}from"react/compiler-runtime";import{Text as n}from"../ink.js";import{Select as i}from"./CustomSelect/index.js";import{Dialog as t}from"./design-system/Dialog.js";import{ValidationErrorsList as s}from"./ValidationErrorsList.js";export function InvalidSettingsDialog(a){const l=e(13),{settingsErrors:c,onContinue:m,onExit:u}=a;let f;l[0]!==m||l[1]!==u?(f=function(o){"exit"===o?u():m()},l[0]=m,l[1]=u,l[2]=f):f=l[2];const g=f;let p,d,x,j,h;return l[3]!==c?(p=o(s,{errors:c}),l[3]=c,l[4]=p):p=l[4],l[5]===Symbol.for("react.memo_cache_sentinel")?(d=o(n,{dimColor:!0,children:"Los archivos con errores se omiten por completo, no solo las configuraciones inválidas."}),l[5]=d):d=l[5],l[6]===Symbol.for("react.memo_cache_sentinel")?(x=[{label:"Salir y corregir manualmente",value:"exit"},{label:"Continuar sin estas configuraciones",value:"continue"}],l[6]=x):x=l[6],l[7]!==g?(j=o(i,{options:x,onChange:g}),l[7]=g,l[8]=j):j=l[8],l[9]!==u||l[10]!==p||l[11]!==j?(h=r(t,{title:"Settings Error",onCancel:u,color:"warning",children:[p,d,j]}),l[9]=u,l[10]=p,l[11]=j,l[12]=h):h=l[12],h}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{c as r}from"react/compiler-runtime";import n from"figures";import{useState as t}from"react";import{Box as i,Text as c}from"../ink.js";import{useKeybinding as m}from"../keybindings/useKeybinding.js";import s from"./TextInput.js";export function LanguagePicker(l){const a=r(13),{initialLanguage:f,onComplete:p,onCancel:u}=l,[g,h]=t(f),[d,x]=t((f??"").length);let y,_;a[0]===Symbol.for("react.memo_cache_sentinel")?(y={context:"Settings"},a[0]=y):y=a[0],m("confirm:no",u,y),a[1]!==g||a[2]!==p?(_=function(){const e=g?.trim();p(e||void 0)},a[1]=g,a[2]=p,a[3]=_):_=a[3];const b=_;let C,j;a[4]===Symbol.for("react.memo_cache_sentinel")?(C=e(c,{children:"Enter your preferred response and voice language:"}),a[4]=C):C=a[4],a[5]===Symbol.for("react.memo_cache_sentinel")?(j=e(c,{children:n.pointer}),a[5]=j):j=a[5];const S=g??"";let v,k,E;return a[6]!==d||a[7]!==b||a[8]!==S?(v=o(i,{flexDirection:"row",gap:1,children:[j,e(s,{value:S,onChange:h,onSubmit:b,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, 日本語, Español${n.ellipsis}`,columns:60,cursorOffset:d,onChangeCursorOffset:x})]}),a[6]=d,a[7]=b,a[8]=S,a[9]=v):v=a[9],a[10]===Symbol.for("react.memo_cache_sentinel")?(k=e(c,{dimColor:!0,children:"Leave empty for default (English)"}),a[10]=k):k=a[10],a[11]!==v?(E=o(i,{flexDirection:"column",gap:1,children:[C,v,k]}),a[11]=v,a[12]=E):E=a[12],E}
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{c as r}from"react/compiler-runtime";import n from"figures";import{useState as t}from"react";import{Box as i,Text as a}from"../ink.js";import{useKeybinding as c}from"../keybindings/useKeybinding.js";import s from"./TextInput.js";export function LanguagePicker(m){const l=r(13),{initialLanguage:f,onComplete:p,onCancel:u}=m,[g,d]=t(f),[h,x]=t((f??"").length);let _,b;l[0]===Symbol.for("react.memo_cache_sentinel")?(_={context:"Settings"},l[0]=_):_=l[0],c("confirm:no",u,_),l[1]!==g||l[2]!==p?(b=function(){const e=g?.trim();p(e||void 0)},l[1]=g,l[2]=p,l[3]=b):b=l[3];const j=b;let y,C;l[4]===Symbol.for("react.memo_cache_sentinel")?(y=e(a,{children:"Ingresa tu idioma preferido para respuestas y voz:"}),l[4]=y):y=l[4],l[5]===Symbol.for("react.memo_cache_sentinel")?(C=e(a,{children:n.pointer}),l[5]=C):C=l[5];const S=g??"";let v,k,D;return l[6]!==h||l[7]!==j||l[8]!==S?(v=o(i,{flexDirection:"row",gap:1,children:[C,e(s,{value:S,onChange:d,onSubmit:j,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, 日本語, Español${n.ellipsis}`,columns:60,cursorOffset:h,onChangeCursorOffset:x})]}),l[6]=h,l[7]=j,l[8]=S,l[9]=v):v=l[9],l[10]===Symbol.for("react.memo_cache_sentinel")?(k=e(a,{dimColor:!0,children:"Déjalo vacío para usar el predeterminado (Inglés)"}),l[10]=k):k=l[10],l[11]!==v?(D=o(i,{flexDirection:"column",gap:1,children:[y,v,k]}),l[11]=v,l[12]=D):D=l[12],D}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{c as n}from"react/compiler-runtime";import s from"chalk";import r from"figures";import o from"react";import{getOriginalCwd as i,getSessionId as l}from"../bootstrap/state.js";import{useExitOnCtrlCDWithKeybindings as a}from"../hooks/useExitOnCtrlCDWithKeybindings.js";import{useSearchInput as c}from"../hooks/useSearchInput.js";import{useTerminalSize as u}from"../hooks/useTerminalSize.js";import{applyColor as m}from"../ink/colorize.js";import{Box as d,Text as h,useInput as f,useTerminalFocus as g,useTheme as p}from"../ink.js";import{useKeybinding as _}from"../keybindings/useKeybinding.js";import{logEvent as b}from"../services/analytics/index.js";import{formatLogMetadata as S,truncateToWidth as x}from"../utils/format.js";import{getWorktreePaths as y}from"../utils/getWorktreePaths.js";import{getBranch as C}from"../utils/git.js";import{getLogDisplayTitle as w}from"../utils/log.js";import{getFirstMeaningfulUserMessageTextContent as j,getSessionIdFromLog as v,isCustomTitleEnabled as k,saveCustomTitle as L}from"../utils/sessionStorage.js";import{getTheme as T}from"../utils/theme.js";import{ConfigurableShortcutHint as $}from"./ConfigurableShortcutHint.js";import{Select as E}from"./CustomSelect/select.js";import{Byline as A}from"./design-system/Byline.js";import{Divider as P}from"./design-system/Divider.js";import{KeyboardShortcutHint as I}from"./design-system/KeyboardShortcutHint.js";import{SearchBox as F}from"./SearchBox.js";import{SessionPreview as B}from"./SessionPreview.js";import{Spinner as D}from"./Spinner.js";import{TagTabs as M}from"./TagTabs.js";import N from"./TextInput.js";import{TreeSelect as O}from"./ui/TreeSelect.js";function normalizeAndTruncateToWidth(e,t){const n=e.replace(/\s+/g," ").trim();return x(n,t)}function formatSnippet({before:e,match:t,after:n},r){return s.dim(e)+r(t)+s.dim(n)}function extractSnippet(e,t,n){const s=e.toLowerCase().indexOf(t.toLowerCase());if(-1===s)return null;const r=s+t.length,o=Math.max(0,s-n),i=Math.min(e.length,r+n),l=e.slice(o,s),a=e.slice(s,r),c=e.slice(r,i);return{before:(o>0?"…":"")+l.replace(/\s+/g," ").trimStart(),match:a.trim(),after:c.replace(/\s+/g," ").trimEnd()+(i<e.length?"…":"")}}function buildLogLabel(e,t,n){const{isGroupHeader:s=!1,isChild:r=!1,forkCount:o=0}=n||{},i=s&&o>0?2:r?4:0,l=s&&o>0?` (+${o} other ${1===o?"session":"sessions"})`:"",a=e.isSidechain?" (sidechain)":"",c=t-i-a.length-l.length;return`${normalizeAndTruncateToWidth(w(e),c)}${a}${l}`}function buildLogMetadata(e,t){const{isChild:n=!1,showProjectPath:s=!1}=t||{};return(n?" ":"")+S(e)+(s&&e.projectPath?` · ${e.projectPath}`:"")}export function LogSelector(s){const r=n(247),{logs:l,maxHeight:x,forceWidth:j,onCancel:W,onSelect:R,onLogsChanged:q,onLoadMore:z,initialSearchQuery:H,showAllProjects:K,onToggleAllProjects:Q,onAgenticSearch:U}=s,V=void 0===x?1/0:x,G=void 0!==K&&K,J=u(),X=void 0===j?J.columns:j,Y=a(W),Z=g();let ee;r[0]===Symbol.for("react.memo_cache_sentinel")?(ee=k(),r[0]=ee):ee=r[0];const te=ee,[ne]=p();let se;r[1]!==ne?(se=T(ne),r[1]=ne,r[2]=se):se=r[2];const re=se;let oe;r[3]!==re.warning?(oe=e=>m(e,re.warning),r[3]=re.warning,r[4]=oe):oe=r[4];const ie=oe,[le,ae]=o.useState(null),[ce,ue]=o.useState(!1),[me,de]=o.useState(!1),[he,fe]=o.useState(!1);let ge;r[5]===Symbol.for("react.memo_cache_sentinel")?(ge=i(),r[5]=ge):ge=r[5];const pe=ge,[_e,be]=o.useState(""),[Se,xe]=o.useState(0);let ye;r[6]===Symbol.for("react.memo_cache_sentinel")?(ye=new Set,r[6]=ye):ye=r[6];const[Ce,we]=o.useState(ye),[je,ve]=o.useState(null),[ke,Le]=o.useState(1),[Te,$e]=o.useState("list"),[Ee,Ae]=o.useState(null),Pe=o.useRef(null),[Ie,Fe]=o.useState(0);let Be;r[7]===Symbol.for("react.memo_cache_sentinel")?(Be={status:"idle"},r[7]=Be):Be=r[7];const[De,Me]=o.useState(Be),[Ne,Oe]=o.useState(!1),We=o.useRef(null),Re="search"===Te&&"searching"!==De.status;let qe,ze,He;r[8]===Symbol.for("react.memo_cache_sentinel")?(qe=()=>{$e("list"),b("tengu_session_search_toggled",{enabled:!1})},ze=()=>{$e("list"),b("tengu_session_search_toggled",{enabled:!1})},He=["n"],r[8]=qe,r[9]=ze,r[10]=He):(qe=r[8],ze=r[9],He=r[10]);const Ke=H||"";let Qe;r[11]!==Ke||r[12]!==Re?(Qe={isActive:Re,onExit:qe,onExitUp:ze,passthroughCtrlKeys:He,initialQuery:Ke},r[11]=Ke,r[12]=Re,r[13]=Qe):Qe=r[13];const{query:Ue,setQuery:Ve,cursorOffset:Ge}=c(Qe),Je=o.useDeferredValue(Ue),[Xe,Ye]=o.useState("");let Ze,et;r[14]!==Je?(Ze=()=>{if(!Je)return void Ye("");const e=setTimeout(Ye,300,Je);return()=>clearTimeout(e)},et=[Je],r[14]=Je,r[15]=Ze,r[16]=et):(Ze=r[15],et=r[16]),o.useEffect(Ze,et);const[tt,nt]=o.useState(null),[st,rt]=o.useState(!1);let ot,it;r[17]===Symbol.for("react.memo_cache_sentinel")?(ot=()=>{C().then(e=>ae(e)),y(pe).then(e=>{fe(e.length>1)})},it=[pe],r[17]=ot,r[18]=it):(ot=r[17],it=r[18]),o.useEffect(ot,it);new Map(l.map(_temp));let lt,at;lt=null,r[19]!==l?(at=function(e){const t=new Set;for(const n of e)n.tag&&t.add(n.tag);return Array.from(t).sort((e,t)=>e.localeCompare(t))}(l),r[19]=l,r[20]=at):at=r[20];const ct=at,ut=ct.length>0;let mt;r[21]!==ut||r[22]!==ct?(mt=ut?["All",...ct]:[],r[21]=ut,r[22]=ct,r[23]=mt):mt=r[23];const dt=mt,ht=dt.length>0&&Ie<dt.length?Ie:0,ft=dt[ht],gt="All"===ft?void 0:ft,pt=ut?1:0;let _t=l;if(te){let e;r[24]!==l?(e=l.filter(_temp2),r[24]=l,r[25]=e):e=r[25],_t=e}if(void 0!==gt){let e;if(r[26]!==_t||r[27]!==gt){let t;r[29]!==gt?(t=e=>e.tag===gt,r[29]=gt,r[30]=t):t=r[30],e=_t.filter(t),r[26]=_t,r[27]=gt,r[28]=e}else e=r[28];_t=e}if(ce&&le){let e;if(r[31]!==le||r[32]!==_t){let t;r[34]!==le?(t=e=>e.gitBranch===le,r[34]=le,r[35]=t):t=r[35],e=_t.filter(t),r[31]=le,r[32]=_t,r[33]=e}else e=r[33];_t=e}if(he&&!me){let e;if(r[36]!==_t){let t;r[38]===Symbol.for("react.memo_cache_sentinel")?(t=e=>e.projectPath===pe,r[38]=t):t=r[38],e=_t.filter(t),r[36]=_t,r[37]=e}else e=r[37];_t=e}const bt=_t;let St;e:{if(!Ue){St=bt;break e}let e;if(r[39]!==bt||r[40]!==Ue){const t=Ue.toLowerCase();e=bt.filter(e=>{const n=w(e).toLowerCase(),s=(e.gitBranch||"").toLowerCase(),r=(e.tag||"").toLowerCase(),o=e.prNumber?`pr #${e.prNumber} ${e.prRepository||""}`.toLowerCase():"";return n.includes(t)||s.includes(t)||r.includes(t)||o.includes(t)}),r[39]=bt,r[40]=Ue,r[41]=e}else e=r[41];St=e}const xt=St;let yt,Ct,wt,jt,vt,kt,Lt;if(r[42]!==Xe||r[43]!==Je?(yt=()=>{0},Ct=[Je,Xe,!1],r[42]=Xe,r[43]=Je,r[44]=yt,r[45]=Ct):(yt=r[44],Ct=r[45]),o.useEffect(yt,Ct),r[46]!==Xe?(wt=()=>(nt(null),void rt(!1)),jt=[Xe,null,!1],r[46]=Xe,r[47]=wt,r[48]=jt):(wt=r[47],jt=r[48]),o.useEffect(wt,jt),r[49]!==Xe||r[50]!==tt||r[51]!==xt){if(kt=new Map,vt=xt,tt&&Xe&&tt.query===Xe){for(const e of tt.results)if(e.searchableText){const t=extractSnippet(e.searchableText,Xe,50);t&&kt.set(e.log,t)}let e;r[54]!==vt?(e=new Set(vt.map(_temp6)),r[54]=vt,r[55]=e):e=r[55];const t=e;let n;if(r[56]!==tt.results||r[57]!==vt||r[58]!==t){let e;r[60]!==t?(e=e=>!t.has(e.messages[0]?.uuid),r[60]=t,r[61]=e):e=r[61];const s=tt.results.map(_temp7).filter(e);n=[...vt,...s],r[56]=tt.results,r[57]=vt,r[58]=t,r[59]=n}else n=r[59];vt=n}r[49]=Xe,r[50]=tt,r[51]=xt,r[52]=vt,r[53]=kt}else vt=r[52],kt=r[53];r[62]!==vt||r[63]!==kt?(Lt={filteredLogs:vt,snippets:kt},r[62]=vt,r[63]=kt,r[64]=Lt):Lt=r[64];const{filteredLogs:Tt,snippets:$t}=Lt;let Et;Et="results"===De.status&&De.results.length>0?De.results:Tt;const At=Et,Pt=Math.max(30,X-4);let It;e:{if(!te){let e;r[65]===Symbol.for("react.memo_cache_sentinel")?(e=[],r[65]=e):e=r[65],It=e;break e}let e;if(r[66]!==At||r[67]!==ie||r[68]!==Pt||r[69]!==G||r[70]!==$t){const t=function(e){const t=new Map;for(const n of e){const e=v(n);if(e){const s=t.get(e);s?s.push(n):t.set(e,[n])}}return t.forEach(e=>e.sort((e,t)=>new Date(t.modified).getTime()-new Date(e.modified).getTime())),t}(At);e=Array.from(t.entries()).map(e=>{const[t,n]=e,s=n[0],r=At.indexOf(s),o=$t.get(s),i=o?formatSnippet(o,ie):null;if(1===n.length){const e=buildLogMetadata(s,{showProjectPath:G});return{id:`log:${t}:0`,value:{log:s,indexInFiltered:r},label:buildLogLabel(s,Pt),description:i?`${e}\n ${i}`:e,dimDescription:!0}}const l=n.length-1,a=n.slice(1).map((e,n)=>{const s=At.indexOf(e),r=$t.get(e),o=r?formatSnippet(r,ie):null,i=buildLogMetadata(e,{isChild:!0,showProjectPath:G});return{id:`log:${t}:${n+1}`,value:{log:e,indexInFiltered:s},label:buildLogLabel(e,Pt,{isChild:!0}),description:o?`${i}\n ${o}`:i,dimDescription:!0}}),c=buildLogMetadata(s,{showProjectPath:G});return{id:`group:${t}`,value:{log:s,indexInFiltered:r},label:buildLogLabel(s,Pt,{isGroupHeader:!0,forkCount:l}),description:i?`${c}\n ${i}`:c,dimDescription:!0,children:a}}),r[66]=At,r[67]=ie,r[68]=Pt,r[69]=G,r[70]=$t,r[71]=e}else e=r[71];It=e}const Ft=It;let Bt;e:{if(te){let e;r[72]===Symbol.for("react.memo_cache_sentinel")?(e=[],r[72]=e):e=r[72],Bt=e;break e}let e;if(r[73]!==At||r[74]!==ie||r[75]!==Pt||r[76]!==G||r[77]!==$t){let t;r[79]!==ie||r[80]!==Pt||r[81]!==G||r[82]!==$t?(t=(e,t)=>{const n=normalizeAndTruncateToWidth(w(e)+(e.isSidechain?" (sidechain)":""),Pt),s=S(e),r=G&&e.projectPath?` · ${e.projectPath}`:"",o=$t.get(e),i=o?formatSnippet(o,ie):null;return{label:n,description:i?`${s}${r}\n ${i}`:s+r,dimDescription:!0,value:t.toString()}},r[79]=ie,r[80]=Pt,r[81]=G,r[82]=$t,r[83]=t):t=r[83],e=At.map(t),r[73]=At,r[74]=ie,r[75]=Pt,r[76]=G,r[77]=$t,r[78]=e}else e=r[78];Bt=e}const Dt=Bt,Mt=je?.value.log??null;let Nt;r[84]!==At||r[85]!==Ce||r[86]!==Mt?(Nt=()=>{if(!te||!Mt)return"";const e=v(Mt);if(!e)return"";const t=At.filter(t=>v(t)===e);if(!(t.length>1))return"";const n=Ce.has(e);return t.indexOf(Mt)>0||n?"← to collapse":"→ to expand"},r[84]=At,r[85]=Ce,r[86]=Mt,r[87]=Nt):Nt=r[87];const Ot=Nt;let Wt;r[88]!==Mt||r[89]!==q||r[90]!==_e?(Wt=async()=>{const e=Mt?v(Mt):void 0;if(!Mt||!e)return $e("list"),void be("");_e.trim()&&(await L(e,_e.trim(),Mt.fullPath),te&&q&&q()),$e("list"),be("")},r[88]=Mt,r[89]=q,r[90]=_e,r[91]=Wt):Wt=r[91];const Rt=Wt;let qt;r[92]===Symbol.for("react.memo_cache_sentinel")?(qt=()=>{$e("list"),b("tengu_session_search_toggled",{enabled:!1})},r[92]=qt):qt=r[92];const zt=qt;let Ht;r[93]===Symbol.for("react.memo_cache_sentinel")?(Ht=()=>{$e("search"),b("tengu_session_search_toggled",{enabled:!0})},r[93]=Ht):Ht=r[93];const Kt=Ht;let Qt;r[94]!==l||r[95]!==U||r[96]!==Ue?(Qt=async()=>{Ue.trim()},r[94]=l,r[95]=U,r[96]=Ue,r[97]=Qt):Qt=r[97];const Ut=Qt;let Vt,Gt,Jt,Xt;r[98]!==De.query||r[99]!==De.status||r[100]!==Ue?(Vt=()=>{"idle"!==De.status&&"searching"!==De.status&&("results"===De.status&&De.query!==Ue||"error"===De.status)&&Me({status:"idle"})},r[98]=De.query,r[99]=De.status,r[100]=Ue,r[101]=Vt):Vt=r[101],r[102]!==De||r[103]!==Ue?(Gt=[Ue,De],r[102]=De,r[103]=Ue,r[104]=Gt):Gt=r[104],o.useEffect(Vt,Gt),r[105]===Symbol.for("react.memo_cache_sentinel")?(Jt=()=>()=>{We.current?.abort()},Xt=[],r[105]=Jt,r[106]=Xt):(Jt=r[105],Xt=r[106]),o.useEffect(Jt,Xt);const Yt=o.useRef(De.status);let Zt,en,tn;r[107]!==De.status||r[108]!==At[0]||r[109]!==At.length||r[110]!==Ft?(Zt=()=>{const e=Yt.current;if(Yt.current=De.status,"searching"===e&&"results"===De.status)if(te&&Ft.length>0)ve(Ft[0]);else if(!te&&At.length>0){const e=At[0];ve({id:"0",value:{log:e,indexInFiltered:0},label:""})}},r[107]=De.status,r[108]=At[0],r[109]=At.length,r[110]=Ft,r[111]=Zt):Zt=r[111],r[112]!==De.status||r[113]!==At||r[114]!==Ft?(en=[De.status,te,Ft,At],r[112]=De.status,r[113]=At,r[114]=Ft,r[115]=en):en=r[115],o.useEffect(Zt,en),r[116]!==At?(tn=e=>{const t=parseInt(e,10),n=At[t];n&&Pe.current!==t.toString()&&(Pe.current=t.toString(),ve({id:t.toString(),value:{log:n,indexInFiltered:t},label:""}),Le(t+1))},r[116]=At,r[117]=tn):tn=r[117];const nn=tn;let sn;r[118]!==At?(sn=e=>{ve(e);const t=At.findIndex(t=>v(t)===v(e.value.log));t>=0&&Le(t+1)},r[118]=At,r[119]=sn):sn=r[119];const rn=sn;let on;r[120]===Symbol.for("react.memo_cache_sentinel")?(on=()=>{We.current?.abort(),Me({status:"idle"}),b("tengu_agentic_search_cancelled",{})},r[120]=on):on=r[120];const ln="preview"!==Te&&"searching"===De.status;let an,cn;r[121]!==ln?(an={context:"Confirmation",isActive:ln},r[121]=ln,r[122]=an):an=r[122],_("confirm:no",on,an),r[123]===Symbol.for("react.memo_cache_sentinel")?(cn=()=>{$e("list"),be("")},r[123]=cn):cn=r[123];const un="rename"===Te&&"searching"!==De.status;let mn,dn;r[124]!==un?(mn={context:"Settings",isActive:un},r[124]=un,r[125]=mn):mn=r[125],_("confirm:no",cn,mn),r[126]!==W||r[127]!==Ve?(dn=()=>{Ve(""),Oe(!1),W?.()},r[126]=W,r[127]=Ve,r[128]=dn):dn=r[128];const hn="preview"!==Te&&"rename"!==Te&&"search"!==Te&&Ne&&"searching"!==De.status;let fn,gn,pn,_n;r[129]!==hn?(fn={context:"Confirmation",isActive:hn},r[129]=hn,r[130]=fn):fn=r[130],_("confirm:no",dn,fn),r[131]!==De.status||r[132]!==ce||r[133]!==Mt||r[134]!==Ut||r[135]!==he||r[136]!==ut||r[137]!==Ne||r[138]!==U||r[139]!==Q||r[140]!==Ue||r[141]!==Ve||r[142]!==G||r[143]!==me||r[144]!==dt||r[145]!==ct||r[146]!==Te?(gn=(e,t)=>{if("preview"!==Te&&"searching"!==De.status)if("rename"===Te);else if("search"===Te)"n"===e.toLowerCase()&&t.ctrl?zt():(t.return||t.downArrow)&&Ue.trim();else{if(Ne){if(t.return)return Ut(),void Oe(!1);if(t.downArrow)return void Oe(!1);if(t.upArrow)return $e("search"),void Oe(!1)}if(ut&&t.tab){const e=t.shift?-1:1;return void Fe(t=>{const n=((t<dt.length?t:0)+dt.length+e)%dt.length,s=dt[n];return b("tengu_session_tag_filter_changed",{is_all:"All"===s,tag_count:ct.length}),n})}const n=!t.ctrl&&!t.meta,s=e.toLowerCase();if("a"===s&&t.ctrl&&Q)Q(),b("tengu_session_all_projects_toggled",{enabled:!G});else if("b"===s&&t.ctrl){const e=!ce;ue(e),b("tengu_session_branch_filter_toggled",{enabled:e})}else if("w"===s&&t.ctrl&&he){const e=!me;de(e),b("tengu_session_worktree_filter_toggled",{enabled:e})}else"/"===s&&n?($e("search"),b("tengu_session_search_toggled",{enabled:!0})):"r"===s&&t.ctrl&&Mt?($e("rename"),be(""),b("tengu_session_rename_started",{})):"v"===s&&t.ctrl&&Mt?(Ae(Mt),$e("preview"),b("tengu_session_preview_opened",{messageCount:Mt.messageCount})):Mt&&n&&e.length>0&&!/^\s+$/.test(e)&&($e("search"),Ve(e),b("tengu_session_search_toggled",{enabled:!0}))}},r[131]=De.status,r[132]=ce,r[133]=Mt,r[134]=Ut,r[135]=he,r[136]=ut,r[137]=Ne,r[138]=U,r[139]=Q,r[140]=Ue,r[141]=Ve,r[142]=G,r[143]=me,r[144]=dt,r[145]=ct,r[146]=Te,r[147]=gn):gn=r[147],r[148]===Symbol.for("react.memo_cache_sentinel")?(pn={isActive:!0},r[148]=pn):pn=r[148],f(gn,pn),r[149]!==ce||r[150]!==le||r[151]!==he||r[152]!==me?(_n=[],ce&&le&&_n.push(le),he&&!me&&_n.push("current worktree"),r[149]=ce,r[150]=le,r[151]=he,r[152]=me,r[153]=_n):_n=r[153];const bn=8+(_n.length>0&&"search"!==Te?1:0)+pt,Sn=Math.max(1,Math.floor((V-bn-2)/3));let xn,yn;if(r[154]!==At.length||r[155]!==ke||r[156]!==z||r[157]!==Sn?(xn=()=>{if(!z)return;ke+2*Sn>=At.length&&z(3*Sn)},yn=[ke,Sn,At.length,z],r[154]=At.length,r[155]=ke,r[156]=z,r[157]=Sn,r[158]=xn,r[159]=yn):(xn=r[158],yn=r[159]),o.useEffect(xn,yn),0===l.length)return null;if("preview"===Te&&Ee&&te){let t,n;return r[160]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{$e("list"),Ae(null)},r[160]=t):t=r[160],r[161]!==R||r[162]!==Ee?(n=e(B,{log:Ee,onExit:t,onSelect:R}),r[161]=R,r[162]=Ee,r[163]=n):n=r[163],n}const Cn=V-1;let wn,jn,vn;r[164]===Symbol.for("react.memo_cache_sentinel")?(wn=e(d,{flexShrink:0,children:e(P,{color:"suggestion"})}),r[164]=wn):wn=r[164],r[165]===Symbol.for("react.memo_cache_sentinel")?(jn=e(d,{flexShrink:0,children:e(h,{children:" "})}),r[165]=jn):jn=r[165],r[166]!==X||r[167]!==At.length||r[168]!==ht||r[169]!==ke||r[170]!==ut||r[171]!==G||r[172]!==dt||r[173]!==Te||r[174]!==Sn?(vn=ut?e(M,{tabs:dt,selectedIndex:ht,availableWidth:X,showAllProjects:G}):e(d,{flexShrink:0,children:t(h,{bold:!0,color:"suggestion",children:["Resume Session","list"===Te&&At.length>Sn&&t(h,{dimColor:!0,children:[" ","(",ke," of ",At.length,")"]})]})}),r[166]=X,r[167]=At.length,r[168]=ht,r[169]=ke,r[170]=ut,r[171]=G,r[172]=dt,r[173]=Te,r[174]=Sn,r[175]=vn):vn=r[175];const kn="search"===Te;let Ln,Tn,$n,En,An,Pn,In,Fn,Bn,Dn,Mn;return r[176]!==Z||r[177]!==Ge||r[178]!==Ue||r[179]!==kn?(Ln=e(F,{query:Ue,isFocused:kn,isTerminalFocused:Z,cursorOffset:Ge}),r[176]=Z,r[177]=Ge,r[178]=Ue,r[179]=kn,r[180]=Ln):Ln=r[180],r[181]!==_n||r[182]!==Te?(Tn=_n.length>0&&"search"!==Te&&e(d,{flexShrink:0,paddingLeft:2,children:e(h,{dimColor:!0,children:e(A,{children:_n})})}),r[181]=_n,r[182]=Te,r[183]=Tn):Tn=r[183],r[184]===Symbol.for("react.memo_cache_sentinel")?($n=e(d,{flexShrink:0,children:e(h,{children:" "})}),r[184]=$n):$n=r[184],r[185]!==De.status?(En="searching"===De.status&&t(d,{paddingLeft:1,flexShrink:0,children:[e(D,{}),e(h,{children:" Searching…"})]}),r[185]=De.status,r[186]=En):En=r[186],r[187]!==De.results||r[188]!==De.status?(An="results"===De.status&&De.results.length>0&&e(d,{paddingLeft:1,marginBottom:1,flexShrink:0,children:e(h,{dimColor:!0,italic:!0,children:"Claude found these results:"})}),r[187]=De.results,r[188]=De.status,r[189]=An):An=r[189],r[190]!==De.results||r[191]!==De.status||r[192]!==Tt?(Pn="results"===De.status&&0===De.results.length&&0===Tt.length&&e(d,{paddingLeft:1,marginBottom:1,flexShrink:0,children:e(h,{dimColor:!0,italic:!0,children:"No matching sessions found."})}),r[190]=De.results,r[191]=De.status,r[192]=Tt,r[193]=Pn):Pn=r[193],r[194]!==De.status||r[195]!==Tt?(In="error"===De.status&&0===Tt.length&&e(d,{paddingLeft:1,marginBottom:1,flexShrink:0,children:e(h,{dimColor:!0,italic:!0,children:"No matching sessions found."})}),r[194]=De.status,r[195]=Tt,r[196]=In):In=r[196],r[197]!==De.status||r[198]!==Ne||r[199]!==U||r[200]!==Ue?(Fn=Boolean(Ue.trim())&&U&&!1,r[197]=De.status,r[198]=Ne,r[199]=U,r[200]=Ue,r[201]=Fn):Fn=r[201],r[202]!==De.status||r[203]!==ce||r[204]!==X||r[205]!==At||r[206]!==Ce||r[207]!==Dt||r[208]!==Mt||r[209]!==je?.id||r[210]!==nn||r[211]!==Rt||r[212]!==rn||r[213]!==Ne||r[214]!==W||r[215]!==R||r[216]!==Se||r[217]!==_e||r[218]!==Ft||r[219]!==Te||r[220]!==Sn?(Bn="searching"===De.status?null:"rename"===Te&&Mt?t(d,{paddingLeft:2,flexDirection:"column",children:[e(h,{bold:!0,children:"Rename session:"}),e(d,{paddingTop:1,children:e(N,{value:_e,onChange:be,onSubmit:Rt,placeholder:w(Mt,"Enter new session name"),columns:X,cursorOffset:Se,onChangeCursorOffset:xe,showCursor:!0})})]}):te?e(O,{nodes:Ft,onSelect:e=>{R(e.value.log)},onFocus:rn,onCancel:W,focusNodeId:je?.id,visibleOptionCount:Sn,layout:"expanded",isDisabled:"search"===Te||Ne,hideIndexes:!1,isNodeExpanded:e=>{if("search"===Te||ce)return!0;const t="string"==typeof e&&e.startsWith("group:")?e.substring(6):null;return!!t&&Ce.has(t)},onExpand:e=>{const t="string"==typeof e&&e.startsWith("group:")?e.substring(6):null;t&&(we(e=>new Set(e).add(t)),b("tengu_session_group_expanded",{}))},onCollapse:e=>{const t="string"==typeof e&&e.startsWith("group:")?e.substring(6):null;t&&we(e=>{const n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:Kt}):e(E,{options:Dt,onChange:e=>{const t=parseInt(e,10),n=At[t];n&&R(n)},visibleOptionCount:Sn,onCancel:W,onFocus:nn,defaultFocusValue:je?.id.toString(),layout:"expanded",isDisabled:"search"===Te||Ne,onUpFromFirstItem:Kt}),r[202]=De.status,r[203]=ce,r[204]=X,r[205]=At,r[206]=Ce,r[207]=Dt,r[208]=Mt,r[209]=je?.id,r[210]=nn,r[211]=Rt,r[212]=rn,r[213]=Ne,r[214]=W,r[215]=R,r[216]=Se,r[217]=_e,r[218]=Ft,r[219]=Te,r[220]=Sn,r[221]=Bn):Bn=r[221],r[222]!==De.status||r[223]!==le||r[224]!==Y.keyName||r[225]!==Y.pending||r[226]!==Ot||r[227]!==he||r[228]!==Ne||r[229]!==st||r[230]!==Q||r[231]!==G||r[232]!==me||r[233]!==Te?(Dn=e(d,{paddingLeft:2,children:Y.pending?t(h,{dimColor:!0,children:["Press ",Y.keyName," again to exit"]}):"rename"===Te?e(h,{dimColor:!0,children:t(A,{children:[e(I,{shortcut:"Enter",action:"save"}),e($,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})]})}):"searching"===De.status?e(h,{dimColor:!0,children:t(A,{children:[e(h,{children:"Searching with Claude…"}),e($,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})]})}):e(h,Ne?{dimColor:!0,children:t(A,{children:[e(I,{shortcut:"Enter",action:"search"}),e(I,{shortcut:"↓",action:"skip"}),e($,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})]})}:"search"===Te?{dimColor:!0,children:t(A,{children:[e(h,{children:"Type to Search"}),e(I,{shortcut:"Enter",action:"select"}),e($,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"clear"})]})}:{dimColor:!0,children:t(A,{children:[Q&&e(I,{shortcut:"Ctrl+A",action:"show "+(G?"current dir":"all projects")}),le&&e(I,{shortcut:"Ctrl+B",action:"toggle branch"}),he&&e(I,{shortcut:"Ctrl+W",action:"show "+(me?"current worktree":"all worktrees")}),e(I,{shortcut:"Ctrl+V",action:"preview"}),e(I,{shortcut:"Ctrl+R",action:"rename"}),e(h,{children:"Type to search"}),e($,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}),Ot()&&e(h,{children:Ot()})]})})}),r[222]=De.status,r[223]=le,r[224]=Y.keyName,r[225]=Y.pending,r[226]=Ot,r[227]=he,r[228]=Ne,r[229]=st,r[230]=Q,r[231]=G,r[232]=me,r[233]=Te,r[234]=Dn):Dn=r[234],r[235]!==Cn||r[236]!==vn||r[237]!==Ln||r[238]!==Tn||r[239]!==En||r[240]!==An||r[241]!==Pn||r[242]!==In||r[243]!==Fn||r[244]!==Bn||r[245]!==Dn?(Mn=t(d,{flexDirection:"column",height:Cn,children:[wn,jn,vn,Ln,Tn,$n,En,An,Pn,In,Fn,Bn,Dn]}),r[235]=Cn,r[236]=vn,r[237]=Ln,r[238]=Tn,r[239]=En,r[240]=An,r[241]=Pn,r[242]=In,r[243]=Fn,r[244]=Bn,r[245]=Dn,r[246]=Mn):Mn=r[246],Mn}function _temp7(e){return e.log}function _temp6(e){return e.messages[0]?.uuid}function _temp2(e){const t=l(),n=v(e);if(t&&n===t)return!0;if(e.customTitle)return!0;return!!j(e.messages)||!(!e.firstPrompt&&!e.customTitle)}function _temp(e){return[e,buildSearchableText(e)]}function extractSearchableText(e){if("user"!==e.type&&"assistant"!==e.type)return"";const t="message"in e?e.message?.content:void 0;return t?"string"==typeof t?t:Array.isArray(t)?t.map(e=>"string"==typeof e?e:"text"in e&&"string"==typeof e.text?e.text:"").filter(Boolean).join(" "):"":""}function buildSearchableText(e){const t=(e.messages.length<=2e3?e.messages:[...e.messages.slice(0,1e3),...e.messages.slice(-1e3)]).map(extractSearchableText).filter(Boolean).join(" "),n=`${[e.customTitle,e.summary,e.firstPrompt,e.gitBranch,e.tag,e.prNumber?`PR #${e.prNumber}`:void 0,e.prRepository].filter(Boolean).join(" ")} ${t}`.trim();return n.length>5e4?n.slice(0,5e4):n}
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{c as n}from"react/compiler-runtime";import s from"chalk";import r from"figures";import o from"react";import{getOriginalCwd as i,getSessionId as l}from"../bootstrap/state.js";import{useExitOnCtrlCDWithKeybindings as a}from"../hooks/useExitOnCtrlCDWithKeybindings.js";import{useSearchInput as c}from"../hooks/useSearchInput.js";import{useTerminalSize as u}from"../hooks/useTerminalSize.js";import{applyColor as m}from"../ink/colorize.js";import{Box as d,Text as h,useInput as f,useTerminalFocus as g,useTheme as p}from"../ink.js";import{useKeybinding as _}from"../keybindings/useKeybinding.js";import{logEvent as b}from"../services/analytics/index.js";import{formatLogMetadata as S,truncateToWidth as x}from"../utils/format.js";import{getWorktreePaths as y}from"../utils/getWorktreePaths.js";import{getBranch as C}from"../utils/git.js";import{getLogDisplayTitle as w}from"../utils/log.js";import{getFirstMeaningfulUserMessageTextContent as j,getSessionIdFromLog as v,isCustomTitleEnabled as k,saveCustomTitle as L}from"../utils/sessionStorage.js";import{getTheme as T}from"../utils/theme.js";import{ConfigurableShortcutHint as $}from"./ConfigurableShortcutHint.js";import{Select as E}from"./CustomSelect/select.js";import{Byline as A}from"./design-system/Byline.js";import{Divider as P}from"./design-system/Divider.js";import{KeyboardShortcutHint as I}from"./design-system/KeyboardShortcutHint.js";import{SearchBox as F}from"./SearchBox.js";import{SessionPreview as B}from"./SessionPreview.js";import{Spinner as D}from"./Spinner.js";import{TagTabs as M}from"./TagTabs.js";import N from"./TextInput.js";import{TreeSelect as O}from"./ui/TreeSelect.js";function normalizeAndTruncateToWidth(e,t){const n=e.replace(/\s+/g," ").trim();return x(n,t)}function formatSnippet({before:e,match:t,after:n},r){return s.dim(e)+r(t)+s.dim(n)}function extractSnippet(e,t,n){const s=e.toLowerCase().indexOf(t.toLowerCase());if(-1===s)return null;const r=s+t.length,o=Math.max(0,s-n),i=Math.min(e.length,r+n),l=e.slice(o,s),a=e.slice(s,r),c=e.slice(r,i);return{before:(o>0?"…":"")+l.replace(/\s+/g," ").trimStart(),match:a.trim(),after:c.replace(/\s+/g," ").trimEnd()+(i<e.length?"…":"")}}function buildLogLabel(e,t,n){const{isGroupHeader:s=!1,isChild:r=!1,forkCount:o=0}=n||{},i=s&&o>0?2:r?4:0,l=s&&o>0?` (+${o} other ${1===o?"session":"sessions"})`:"",a=e.isSidechain?" (sidechain)":"",c=t-i-a.length-l.length;return`${normalizeAndTruncateToWidth(w(e),c)}${a}${l}`}function buildLogMetadata(e,t){const{isChild:n=!1,showProjectPath:s=!1}=t||{};return(n?" ":"")+S(e)+(s&&e.projectPath?` · ${e.projectPath}`:"")}export function LogSelector(s){const r=n(247),{logs:l,maxHeight:x,forceWidth:j,onCancel:W,onSelect:R,onLogsChanged:q,onLoadMore:z,initialSearchQuery:H,showAllProjects:K,onToggleAllProjects:Q,onAgenticSearch:U}=s,V=void 0===x?1/0:x,G=void 0!==K&&K,J=u(),X=void 0===j?J.columns:j,Y=a(W),Z=g();let ee;r[0]===Symbol.for("react.memo_cache_sentinel")?(ee=k(),r[0]=ee):ee=r[0];const te=ee,[ne]=p();let se;r[1]!==ne?(se=T(ne),r[1]=ne,r[2]=se):se=r[2];const re=se;let oe;r[3]!==re.warning?(oe=e=>m(e,re.warning),r[3]=re.warning,r[4]=oe):oe=r[4];const ie=oe,[le,ae]=o.useState(null),[ce,ue]=o.useState(!1),[me,de]=o.useState(!1),[he,fe]=o.useState(!1);let ge;r[5]===Symbol.for("react.memo_cache_sentinel")?(ge=i(),r[5]=ge):ge=r[5];const pe=ge,[_e,be]=o.useState(""),[Se,xe]=o.useState(0);let ye;r[6]===Symbol.for("react.memo_cache_sentinel")?(ye=new Set,r[6]=ye):ye=r[6];const[Ce,we]=o.useState(ye),[je,ve]=o.useState(null),[ke,Le]=o.useState(1),[Te,$e]=o.useState("list"),[Ee,Ae]=o.useState(null),Pe=o.useRef(null),[Ie,Fe]=o.useState(0);let Be;r[7]===Symbol.for("react.memo_cache_sentinel")?(Be={status:"idle"},r[7]=Be):Be=r[7];const[De,Me]=o.useState(Be),[Ne,Oe]=o.useState(!1),We=o.useRef(null),Re="search"===Te&&"searching"!==De.status;let qe,ze,He;r[8]===Symbol.for("react.memo_cache_sentinel")?(qe=()=>{$e("list"),b("tengu_session_search_toggled",{enabled:!1})},ze=()=>{$e("list"),b("tengu_session_search_toggled",{enabled:!1})},He=["n"],r[8]=qe,r[9]=ze,r[10]=He):(qe=r[8],ze=r[9],He=r[10]);const Ke=H||"";let Qe;r[11]!==Ke||r[12]!==Re?(Qe={isActive:Re,onExit:qe,onExitUp:ze,passthroughCtrlKeys:He,initialQuery:Ke},r[11]=Ke,r[12]=Re,r[13]=Qe):Qe=r[13];const{query:Ue,setQuery:Ve,cursorOffset:Ge}=c(Qe),Je=o.useDeferredValue(Ue),[Xe,Ye]=o.useState("");let Ze,et;r[14]!==Je?(Ze=()=>{if(!Je)return void Ye("");const e=setTimeout(Ye,300,Je);return()=>clearTimeout(e)},et=[Je],r[14]=Je,r[15]=Ze,r[16]=et):(Ze=r[15],et=r[16]),o.useEffect(Ze,et);const[tt,nt]=o.useState(null),[st,rt]=o.useState(!1);let ot,it;r[17]===Symbol.for("react.memo_cache_sentinel")?(ot=()=>{C().then(e=>ae(e)),y(pe).then(e=>{fe(e.length>1)})},it=[pe],r[17]=ot,r[18]=it):(ot=r[17],it=r[18]),o.useEffect(ot,it);new Map(l.map(_temp));let lt,at;lt=null,r[19]!==l?(at=function(e){const t=new Set;for(const n of e)n.tag&&t.add(n.tag);return Array.from(t).sort((e,t)=>e.localeCompare(t))}(l),r[19]=l,r[20]=at):at=r[20];const ct=at,ut=ct.length>0;let mt;r[21]!==ut||r[22]!==ct?(mt=ut?["All",...ct]:[],r[21]=ut,r[22]=ct,r[23]=mt):mt=r[23];const dt=mt,ht=dt.length>0&&Ie<dt.length?Ie:0,ft=dt[ht],gt="All"===ft?void 0:ft,pt=ut?1:0;let _t=l;if(te){let e;r[24]!==l?(e=l.filter(_temp2),r[24]=l,r[25]=e):e=r[25],_t=e}if(void 0!==gt){let e;if(r[26]!==_t||r[27]!==gt){let t;r[29]!==gt?(t=e=>e.tag===gt,r[29]=gt,r[30]=t):t=r[30],e=_t.filter(t),r[26]=_t,r[27]=gt,r[28]=e}else e=r[28];_t=e}if(ce&&le){let e;if(r[31]!==le||r[32]!==_t){let t;r[34]!==le?(t=e=>e.gitBranch===le,r[34]=le,r[35]=t):t=r[35],e=_t.filter(t),r[31]=le,r[32]=_t,r[33]=e}else e=r[33];_t=e}if(he&&!me){let e;if(r[36]!==_t){let t;r[38]===Symbol.for("react.memo_cache_sentinel")?(t=e=>e.projectPath===pe,r[38]=t):t=r[38],e=_t.filter(t),r[36]=_t,r[37]=e}else e=r[37];_t=e}const bt=_t;let St;e:{if(!Ue){St=bt;break e}let e;if(r[39]!==bt||r[40]!==Ue){const t=Ue.toLowerCase();e=bt.filter(e=>{const n=w(e).toLowerCase(),s=(e.gitBranch||"").toLowerCase(),r=(e.tag||"").toLowerCase(),o=e.prNumber?`pr #${e.prNumber} ${e.prRepository||""}`.toLowerCase():"";return n.includes(t)||s.includes(t)||r.includes(t)||o.includes(t)}),r[39]=bt,r[40]=Ue,r[41]=e}else e=r[41];St=e}const xt=St;let yt,Ct,wt,jt,vt,kt,Lt;if(r[42]!==Xe||r[43]!==Je?(yt=()=>{0},Ct=[Je,Xe,!1],r[42]=Xe,r[43]=Je,r[44]=yt,r[45]=Ct):(yt=r[44],Ct=r[45]),o.useEffect(yt,Ct),r[46]!==Xe?(wt=()=>(nt(null),void rt(!1)),jt=[Xe,null,!1],r[46]=Xe,r[47]=wt,r[48]=jt):(wt=r[47],jt=r[48]),o.useEffect(wt,jt),r[49]!==Xe||r[50]!==tt||r[51]!==xt){if(kt=new Map,vt=xt,tt&&Xe&&tt.query===Xe){for(const e of tt.results)if(e.searchableText){const t=extractSnippet(e.searchableText,Xe,50);t&&kt.set(e.log,t)}let e;r[54]!==vt?(e=new Set(vt.map(_temp6)),r[54]=vt,r[55]=e):e=r[55];const t=e;let n;if(r[56]!==tt.results||r[57]!==vt||r[58]!==t){let e;r[60]!==t?(e=e=>!t.has(e.messages[0]?.uuid),r[60]=t,r[61]=e):e=r[61];const s=tt.results.map(_temp7).filter(e);n=[...vt,...s],r[56]=tt.results,r[57]=vt,r[58]=t,r[59]=n}else n=r[59];vt=n}r[49]=Xe,r[50]=tt,r[51]=xt,r[52]=vt,r[53]=kt}else vt=r[52],kt=r[53];r[62]!==vt||r[63]!==kt?(Lt={filteredLogs:vt,snippets:kt},r[62]=vt,r[63]=kt,r[64]=Lt):Lt=r[64];const{filteredLogs:Tt,snippets:$t}=Lt;let Et;Et="results"===De.status&&De.results.length>0?De.results:Tt;const At=Et,Pt=Math.max(30,X-4);let It;e:{if(!te){let e;r[65]===Symbol.for("react.memo_cache_sentinel")?(e=[],r[65]=e):e=r[65],It=e;break e}let e;if(r[66]!==At||r[67]!==ie||r[68]!==Pt||r[69]!==G||r[70]!==$t){const t=function(e){const t=new Map;for(const n of e){const e=v(n);if(e){const s=t.get(e);s?s.push(n):t.set(e,[n])}}return t.forEach(e=>e.sort((e,t)=>new Date(t.modified).getTime()-new Date(e.modified).getTime())),t}(At);e=Array.from(t.entries()).map(e=>{const[t,n]=e,s=n[0],r=At.indexOf(s),o=$t.get(s),i=o?formatSnippet(o,ie):null;if(1===n.length){const e=buildLogMetadata(s,{showProjectPath:G});return{id:`log:${t}:0`,value:{log:s,indexInFiltered:r},label:buildLogLabel(s,Pt),description:i?`${e}\n ${i}`:e,dimDescription:!0}}const l=n.length-1,a=n.slice(1).map((e,n)=>{const s=At.indexOf(e),r=$t.get(e),o=r?formatSnippet(r,ie):null,i=buildLogMetadata(e,{isChild:!0,showProjectPath:G});return{id:`log:${t}:${n+1}`,value:{log:e,indexInFiltered:s},label:buildLogLabel(e,Pt,{isChild:!0}),description:o?`${i}\n ${o}`:i,dimDescription:!0}}),c=buildLogMetadata(s,{showProjectPath:G});return{id:`group:${t}`,value:{log:s,indexInFiltered:r},label:buildLogLabel(s,Pt,{isGroupHeader:!0,forkCount:l}),description:i?`${c}\n ${i}`:c,dimDescription:!0,children:a}}),r[66]=At,r[67]=ie,r[68]=Pt,r[69]=G,r[70]=$t,r[71]=e}else e=r[71];It=e}const Ft=It;let Bt;e:{if(te){let e;r[72]===Symbol.for("react.memo_cache_sentinel")?(e=[],r[72]=e):e=r[72],Bt=e;break e}let e;if(r[73]!==At||r[74]!==ie||r[75]!==Pt||r[76]!==G||r[77]!==$t){let t;r[79]!==ie||r[80]!==Pt||r[81]!==G||r[82]!==$t?(t=(e,t)=>{const n=normalizeAndTruncateToWidth(w(e)+(e.isSidechain?" (sidechain)":""),Pt),s=S(e),r=G&&e.projectPath?` · ${e.projectPath}`:"",o=$t.get(e),i=o?formatSnippet(o,ie):null;return{label:n,description:i?`${s}${r}\n ${i}`:s+r,dimDescription:!0,value:t.toString()}},r[79]=ie,r[80]=Pt,r[81]=G,r[82]=$t,r[83]=t):t=r[83],e=At.map(t),r[73]=At,r[74]=ie,r[75]=Pt,r[76]=G,r[77]=$t,r[78]=e}else e=r[78];Bt=e}const Dt=Bt,Mt=je?.value.log??null;let Nt;r[84]!==At||r[85]!==Ce||r[86]!==Mt?(Nt=()=>{if(!te||!Mt)return"";const e=v(Mt);if(!e)return"";const t=At.filter(t=>v(t)===e);if(!(t.length>1))return"";const n=Ce.has(e);return t.indexOf(Mt)>0||n?"← para contraer":"→ para expandir"},r[84]=At,r[85]=Ce,r[86]=Mt,r[87]=Nt):Nt=r[87];const Ot=Nt;let Wt;r[88]!==Mt||r[89]!==q||r[90]!==_e?(Wt=async()=>{const e=Mt?v(Mt):void 0;if(!Mt||!e)return $e("list"),void be("");_e.trim()&&(await L(e,_e.trim(),Mt.fullPath),te&&q&&q()),$e("list"),be("")},r[88]=Mt,r[89]=q,r[90]=_e,r[91]=Wt):Wt=r[91];const Rt=Wt;let qt;r[92]===Symbol.for("react.memo_cache_sentinel")?(qt=()=>{$e("list"),b("tengu_session_search_toggled",{enabled:!1})},r[92]=qt):qt=r[92];const zt=qt;let Ht;r[93]===Symbol.for("react.memo_cache_sentinel")?(Ht=()=>{$e("search"),b("tengu_session_search_toggled",{enabled:!0})},r[93]=Ht):Ht=r[93];const Kt=Ht;let Qt;r[94]!==l||r[95]!==U||r[96]!==Ue?(Qt=async()=>{Ue.trim()},r[94]=l,r[95]=U,r[96]=Ue,r[97]=Qt):Qt=r[97];const Ut=Qt;let Vt,Gt,Jt,Xt;r[98]!==De.query||r[99]!==De.status||r[100]!==Ue?(Vt=()=>{"idle"!==De.status&&"searching"!==De.status&&("results"===De.status&&De.query!==Ue||"error"===De.status)&&Me({status:"idle"})},r[98]=De.query,r[99]=De.status,r[100]=Ue,r[101]=Vt):Vt=r[101],r[102]!==De||r[103]!==Ue?(Gt=[Ue,De],r[102]=De,r[103]=Ue,r[104]=Gt):Gt=r[104],o.useEffect(Vt,Gt),r[105]===Symbol.for("react.memo_cache_sentinel")?(Jt=()=>()=>{We.current?.abort()},Xt=[],r[105]=Jt,r[106]=Xt):(Jt=r[105],Xt=r[106]),o.useEffect(Jt,Xt);const Yt=o.useRef(De.status);let Zt,en,tn;r[107]!==De.status||r[108]!==At[0]||r[109]!==At.length||r[110]!==Ft?(Zt=()=>{const e=Yt.current;if(Yt.current=De.status,"searching"===e&&"results"===De.status)if(te&&Ft.length>0)ve(Ft[0]);else if(!te&&At.length>0){const e=At[0];ve({id:"0",value:{log:e,indexInFiltered:0},label:""})}},r[107]=De.status,r[108]=At[0],r[109]=At.length,r[110]=Ft,r[111]=Zt):Zt=r[111],r[112]!==De.status||r[113]!==At||r[114]!==Ft?(en=[De.status,te,Ft,At],r[112]=De.status,r[113]=At,r[114]=Ft,r[115]=en):en=r[115],o.useEffect(Zt,en),r[116]!==At?(tn=e=>{const t=parseInt(e,10),n=At[t];n&&Pe.current!==t.toString()&&(Pe.current=t.toString(),ve({id:t.toString(),value:{log:n,indexInFiltered:t},label:""}),Le(t+1))},r[116]=At,r[117]=tn):tn=r[117];const nn=tn;let sn;r[118]!==At?(sn=e=>{ve(e);const t=At.findIndex(t=>v(t)===v(e.value.log));t>=0&&Le(t+1)},r[118]=At,r[119]=sn):sn=r[119];const rn=sn;let on;r[120]===Symbol.for("react.memo_cache_sentinel")?(on=()=>{We.current?.abort(),Me({status:"idle"}),b("tengu_agentic_search_cancelled",{})},r[120]=on):on=r[120];const ln="preview"!==Te&&"searching"===De.status;let an,cn;r[121]!==ln?(an={context:"Confirmation",isActive:ln},r[121]=ln,r[122]=an):an=r[122],_("confirm:no",on,an),r[123]===Symbol.for("react.memo_cache_sentinel")?(cn=()=>{$e("list"),be("")},r[123]=cn):cn=r[123];const un="rename"===Te&&"searching"!==De.status;let mn,dn;r[124]!==un?(mn={context:"Settings",isActive:un},r[124]=un,r[125]=mn):mn=r[125],_("confirm:no",cn,mn),r[126]!==W||r[127]!==Ve?(dn=()=>{Ve(""),Oe(!1),W?.()},r[126]=W,r[127]=Ve,r[128]=dn):dn=r[128];const hn="preview"!==Te&&"rename"!==Te&&"search"!==Te&&Ne&&"searching"!==De.status;let fn,gn,pn,_n;r[129]!==hn?(fn={context:"Confirmation",isActive:hn},r[129]=hn,r[130]=fn):fn=r[130],_("confirm:no",dn,fn),r[131]!==De.status||r[132]!==ce||r[133]!==Mt||r[134]!==Ut||r[135]!==he||r[136]!==ut||r[137]!==Ne||r[138]!==U||r[139]!==Q||r[140]!==Ue||r[141]!==Ve||r[142]!==G||r[143]!==me||r[144]!==dt||r[145]!==ct||r[146]!==Te?(gn=(e,t)=>{if("preview"!==Te&&"searching"!==De.status)if("rename"===Te);else if("search"===Te)"n"===e.toLowerCase()&&t.ctrl?zt():(t.return||t.downArrow)&&Ue.trim();else{if(Ne){if(t.return)return Ut(),void Oe(!1);if(t.downArrow)return void Oe(!1);if(t.upArrow)return $e("search"),void Oe(!1)}if(ut&&t.tab){const e=t.shift?-1:1;return void Fe(t=>{const n=((t<dt.length?t:0)+dt.length+e)%dt.length,s=dt[n];return b("tengu_session_tag_filter_changed",{is_all:"All"===s,tag_count:ct.length}),n})}const n=!t.ctrl&&!t.meta,s=e.toLowerCase();if("a"===s&&t.ctrl&&Q)Q(),b("tengu_session_all_projects_toggled",{enabled:!G});else if("b"===s&&t.ctrl){const e=!ce;ue(e),b("tengu_session_branch_filter_toggled",{enabled:e})}else if("w"===s&&t.ctrl&&he){const e=!me;de(e),b("tengu_session_worktree_filter_toggled",{enabled:e})}else"/"===s&&n?($e("search"),b("tengu_session_search_toggled",{enabled:!0})):"r"===s&&t.ctrl&&Mt?($e("rename"),be(""),b("tengu_session_rename_started",{})):"v"===s&&t.ctrl&&Mt?(Ae(Mt),$e("preview"),b("tengu_session_preview_opened",{messageCount:Mt.messageCount})):Mt&&n&&e.length>0&&!/^\s+$/.test(e)&&($e("search"),Ve(e),b("tengu_session_search_toggled",{enabled:!0}))}},r[131]=De.status,r[132]=ce,r[133]=Mt,r[134]=Ut,r[135]=he,r[136]=ut,r[137]=Ne,r[138]=U,r[139]=Q,r[140]=Ue,r[141]=Ve,r[142]=G,r[143]=me,r[144]=dt,r[145]=ct,r[146]=Te,r[147]=gn):gn=r[147],r[148]===Symbol.for("react.memo_cache_sentinel")?(pn={isActive:!0},r[148]=pn):pn=r[148],f(gn,pn),r[149]!==ce||r[150]!==le||r[151]!==he||r[152]!==me?(_n=[],ce&&le&&_n.push(le),he&&!me&&_n.push("current worktree"),r[149]=ce,r[150]=le,r[151]=he,r[152]=me,r[153]=_n):_n=r[153];const bn=8+(_n.length>0&&"search"!==Te?1:0)+pt,Sn=Math.max(1,Math.floor((V-bn-2)/3));let xn,yn;if(r[154]!==At.length||r[155]!==ke||r[156]!==z||r[157]!==Sn?(xn=()=>{if(!z)return;ke+2*Sn>=At.length&&z(3*Sn)},yn=[ke,Sn,At.length,z],r[154]=At.length,r[155]=ke,r[156]=z,r[157]=Sn,r[158]=xn,r[159]=yn):(xn=r[158],yn=r[159]),o.useEffect(xn,yn),0===l.length)return null;if("preview"===Te&&Ee&&te){let t,n;return r[160]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{$e("list"),Ae(null)},r[160]=t):t=r[160],r[161]!==R||r[162]!==Ee?(n=e(B,{log:Ee,onExit:t,onSelect:R}),r[161]=R,r[162]=Ee,r[163]=n):n=r[163],n}const Cn=V-1;let wn,jn,vn;r[164]===Symbol.for("react.memo_cache_sentinel")?(wn=e(d,{flexShrink:0,children:e(P,{color:"suggestion"})}),r[164]=wn):wn=r[164],r[165]===Symbol.for("react.memo_cache_sentinel")?(jn=e(d,{flexShrink:0,children:e(h,{children:" "})}),r[165]=jn):jn=r[165],r[166]!==X||r[167]!==At.length||r[168]!==ht||r[169]!==ke||r[170]!==ut||r[171]!==G||r[172]!==dt||r[173]!==Te||r[174]!==Sn?(vn=ut?e(M,{tabs:dt,selectedIndex:ht,availableWidth:X,showAllProjects:G}):e(d,{flexShrink:0,children:t(h,{bold:!0,color:"suggestion",children:["Resume Session","list"===Te&&At.length>Sn&&t(h,{dimColor:!0,children:[" ","(",ke," of ",At.length,")"]})]})}),r[166]=X,r[167]=At.length,r[168]=ht,r[169]=ke,r[170]=ut,r[171]=G,r[172]=dt,r[173]=Te,r[174]=Sn,r[175]=vn):vn=r[175];const kn="search"===Te;let Ln,Tn,$n,En,An,Pn,In,Fn,Bn,Dn,Mn;return r[176]!==Z||r[177]!==Ge||r[178]!==Ue||r[179]!==kn?(Ln=e(F,{query:Ue,isFocused:kn,isTerminalFocused:Z,cursorOffset:Ge}),r[176]=Z,r[177]=Ge,r[178]=Ue,r[179]=kn,r[180]=Ln):Ln=r[180],r[181]!==_n||r[182]!==Te?(Tn=_n.length>0&&"search"!==Te&&e(d,{flexShrink:0,paddingLeft:2,children:e(h,{dimColor:!0,children:e(A,{children:_n})})}),r[181]=_n,r[182]=Te,r[183]=Tn):Tn=r[183],r[184]===Symbol.for("react.memo_cache_sentinel")?($n=e(d,{flexShrink:0,children:e(h,{children:" "})}),r[184]=$n):$n=r[184],r[185]!==De.status?(En="searching"===De.status&&t(d,{paddingLeft:1,flexShrink:0,children:[e(D,{}),e(h,{children:" Searching…"})]}),r[185]=De.status,r[186]=En):En=r[186],r[187]!==De.results||r[188]!==De.status?(An="results"===De.status&&De.results.length>0&&e(d,{paddingLeft:1,marginBottom:1,flexShrink:0,children:e(h,{dimColor:!0,italic:!0,children:"Context encontró estos resultados:"})}),r[187]=De.results,r[188]=De.status,r[189]=An):An=r[189],r[190]!==De.results||r[191]!==De.status||r[192]!==Tt?(Pn="results"===De.status&&0===De.results.length&&0===Tt.length&&e(d,{paddingLeft:1,marginBottom:1,flexShrink:0,children:e(h,{dimColor:!0,italic:!0,children:"No se encontraron sesiones coincidentes."})}),r[190]=De.results,r[191]=De.status,r[192]=Tt,r[193]=Pn):Pn=r[193],r[194]!==De.status||r[195]!==Tt?(In="error"===De.status&&0===Tt.length&&e(d,{paddingLeft:1,marginBottom:1,flexShrink:0,children:e(h,{dimColor:!0,italic:!0,children:"No se encontraron sesiones coincidentes."})}),r[194]=De.status,r[195]=Tt,r[196]=In):In=r[196],r[197]!==De.status||r[198]!==Ne||r[199]!==U||r[200]!==Ue?(Fn=Boolean(Ue.trim())&&U&&!1,r[197]=De.status,r[198]=Ne,r[199]=U,r[200]=Ue,r[201]=Fn):Fn=r[201],r[202]!==De.status||r[203]!==ce||r[204]!==X||r[205]!==At||r[206]!==Ce||r[207]!==Dt||r[208]!==Mt||r[209]!==je?.id||r[210]!==nn||r[211]!==Rt||r[212]!==rn||r[213]!==Ne||r[214]!==W||r[215]!==R||r[216]!==Se||r[217]!==_e||r[218]!==Ft||r[219]!==Te||r[220]!==Sn?(Bn="searching"===De.status?null:"rename"===Te&&Mt?t(d,{paddingLeft:2,flexDirection:"column",children:[e(h,{bold:!0,children:"Rename session:"}),e(d,{paddingTop:1,children:e(N,{value:_e,onChange:be,onSubmit:Rt,placeholder:w(Mt,"Enter new session name"),columns:X,cursorOffset:Se,onChangeCursorOffset:xe,showCursor:!0})})]}):te?e(O,{nodes:Ft,onSelect:e=>{R(e.value.log)},onFocus:rn,onCancel:W,focusNodeId:je?.id,visibleOptionCount:Sn,layout:"expanded",isDisabled:"search"===Te||Ne,hideIndexes:!1,isNodeExpanded:e=>{if("search"===Te||ce)return!0;const t="string"==typeof e&&e.startsWith("group:")?e.substring(6):null;return!!t&&Ce.has(t)},onExpand:e=>{const t="string"==typeof e&&e.startsWith("group:")?e.substring(6):null;t&&(we(e=>new Set(e).add(t)),b("tengu_session_group_expanded",{}))},onCollapse:e=>{const t="string"==typeof e&&e.startsWith("group:")?e.substring(6):null;t&&we(e=>{const n=new Set(e);return n.delete(t),n})},onUpFromFirstItem:Kt}):e(E,{options:Dt,onChange:e=>{const t=parseInt(e,10),n=At[t];n&&R(n)},visibleOptionCount:Sn,onCancel:W,onFocus:nn,defaultFocusValue:je?.id.toString(),layout:"expanded",isDisabled:"search"===Te||Ne,onUpFromFirstItem:Kt}),r[202]=De.status,r[203]=ce,r[204]=X,r[205]=At,r[206]=Ce,r[207]=Dt,r[208]=Mt,r[209]=je?.id,r[210]=nn,r[211]=Rt,r[212]=rn,r[213]=Ne,r[214]=W,r[215]=R,r[216]=Se,r[217]=_e,r[218]=Ft,r[219]=Te,r[220]=Sn,r[221]=Bn):Bn=r[221],r[222]!==De.status||r[223]!==le||r[224]!==Y.keyName||r[225]!==Y.pending||r[226]!==Ot||r[227]!==he||r[228]!==Ne||r[229]!==st||r[230]!==Q||r[231]!==G||r[232]!==me||r[233]!==Te?(Dn=e(d,{paddingLeft:2,children:Y.pending?t(h,{dimColor:!0,children:["Press ",Y.keyName," again to exit"]}):"rename"===Te?e(h,{dimColor:!0,children:t(A,{children:[e(I,{shortcut:"Enter",action:"save"}),e($,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})]})}):"searching"===De.status?e(h,{dimColor:!0,children:t(A,{children:[e(h,{children:"Searching with Claude…"}),e($,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})]})}):e(h,Ne?{dimColor:!0,children:t(A,{children:[e(I,{shortcut:"Enter",action:"search"}),e(I,{shortcut:"↓",action:"skip"}),e($,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"})]})}:"search"===Te?{dimColor:!0,children:t(A,{children:[e(h,{children:"Type to Search"}),e(I,{shortcut:"Enter",action:"select"}),e($,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"clear"})]})}:{dimColor:!0,children:t(A,{children:[Q&&e(I,{shortcut:"Ctrl+A",action:"show "+(G?"current dir":"all projects")}),le&&e(I,{shortcut:"Ctrl+B",action:"toggle branch"}),he&&e(I,{shortcut:"Ctrl+W",action:"show "+(me?"current worktree":"all worktrees")}),e(I,{shortcut:"Ctrl+V",action:"preview"}),e(I,{shortcut:"Ctrl+R",action:"rename"}),e(h,{children:"Type to search"}),e($,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancel"}),Ot()&&e(h,{children:Ot()})]})})}),r[222]=De.status,r[223]=le,r[224]=Y.keyName,r[225]=Y.pending,r[226]=Ot,r[227]=he,r[228]=Ne,r[229]=st,r[230]=Q,r[231]=G,r[232]=me,r[233]=Te,r[234]=Dn):Dn=r[234],r[235]!==Cn||r[236]!==vn||r[237]!==Ln||r[238]!==Tn||r[239]!==En||r[240]!==An||r[241]!==Pn||r[242]!==In||r[243]!==Fn||r[244]!==Bn||r[245]!==Dn?(Mn=t(d,{flexDirection:"column",height:Cn,children:[wn,jn,vn,Ln,Tn,$n,En,An,Pn,In,Fn,Bn,Dn]}),r[235]=Cn,r[236]=vn,r[237]=Ln,r[238]=Tn,r[239]=En,r[240]=An,r[241]=Pn,r[242]=In,r[243]=Fn,r[244]=Bn,r[245]=Dn,r[246]=Mn):Mn=r[246],Mn}function _temp7(e){return e.log}function _temp6(e){return e.messages[0]?.uuid}function _temp2(e){const t=l(),n=v(e);if(t&&n===t)return!0;if(e.customTitle)return!0;return!!j(e.messages)||!(!e.firstPrompt&&!e.customTitle)}function _temp(e){return[e,buildSearchableText(e)]}function extractSearchableText(e){if("user"!==e.type&&"assistant"!==e.type)return"";const t="message"in e?e.message?.content:void 0;return t?"string"==typeof t?t:Array.isArray(t)?t.map(e=>"string"==typeof e?e:"text"in e&&"string"==typeof e.text?e.text:"").filter(Boolean).join(" "):"":""}function buildSearchableText(e){const t=(e.messages.length<=2e3?e.messages:[...e.messages.slice(0,1e3),...e.messages.slice(-1e3)]).map(extractSearchableText).filter(Boolean).join(" "),n=`${[e.customTitle,e.summary,e.firstPrompt,e.gitBranch,e.tag,e.prNumber?`PR #${e.prNumber}`:void 0,e.prRepository].filter(Boolean).join(" ")} ${t}`.trim();return n.length>5e4?n.slice(0,5e4):n}
@@ -1 +1 @@
1
- import{jsxs as e,jsx as n}from"react/jsx-runtime";import{createRequire as r}from"module";r(import.meta.url);import{c as t}from"react/compiler-runtime";import{useState as o}from"react";import{getAllowedChannels as i,getHasDevChannels as l}from"../../bootstrap/state.js";import{Box as s,Text as a}from"../../ink.js";import{isChannelsEnabled as c}from"../../services/mcp/channelAllowlist.js";import{getEffectiveChannelAllowlist as m}from"../../services/mcp/channelNotification.js";import{getMcpConfigsByScope as d}from"../../services/mcp/config.js";import{getClaudeAIOAuthTokens as h,getSubscriptionType as p}from"../../utils/auth.js";import{loadInstalledPluginsV2 as u}from"../../utils/plugins/installedPluginsManager.js";import{getSettingsForSource as f}from"../../utils/settings/settings.js";export function ChannelsNotice(){const r=t(32),[i]=o(_temp),{channels:c,disabled:m,noAuth:d,policyBlocked:h,list:p,unmatched:u}=i;if(0===c.length)return null;const f=c.some(_temp2),y=l()&&f?"Channels":l()?"--dangerously-load-development-channels":"--channels";if(m){let t,o,i;return r[0]!==y||r[1]!==p?(t=e(a,{color:"error",children:[y," ignored (",p,")"]}),r[0]=y,r[1]=p,r[2]=t):t=r[2],r[3]===Symbol.for("react.memo_cache_sentinel")?(o=n(a,{dimColor:!0,children:"Channels are not currently available"}),r[3]=o):o=r[3],r[4]!==t?(i=e(s,{paddingLeft:2,flexDirection:"column",children:[t,o]}),r[4]=t,r[5]=i):i=r[5],i}if(d){let t,o,i;return r[6]!==y||r[7]!==p?(t=e(a,{color:"error",children:[y," ignored (",p,")"]}),r[6]=y,r[7]=p,r[8]=t):t=r[8],r[9]===Symbol.for("react.memo_cache_sentinel")?(o=n(a,{dimColor:!0,children:"Channels require claude.ai authentication · run /login, then restart"}),r[9]=o):o=r[9],r[10]!==t?(i=e(s,{paddingLeft:2,flexDirection:"column",children:[t,o]}),r[10]=t,r[11]=i):i=r[11],i}if(h){let t,o,i,l,c;return r[12]!==y||r[13]!==p?(t=e(a,{color:"error",children:[y," blocked by org policy (",p,")"]}),r[12]=y,r[13]=p,r[14]=t):t=r[14],r[15]===Symbol.for("react.memo_cache_sentinel")?(o=n(a,{dimColor:!0,children:"Inbound messages will be silently dropped"}),i=n(a,{dimColor:!0,children:"Have an administrator set channelsEnabled: true in managed settings to enable"}),r[15]=o,r[16]=i):(o=r[15],i=r[16]),r[17]!==u?(l=u.map(_temp3),r[17]=u,r[18]=l):l=r[18],r[19]!==t||r[20]!==l?(c=e(s,{paddingLeft:2,flexDirection:"column",children:[t,o,i,l]}),r[19]=t,r[20]=l,r[21]=c):c=r[21],c}let g,b,w,v;return r[22]!==p?(g=e(a,{color:"error",children:["Listening for channel messages from: ",p]}),r[22]=p,r[23]=g):g=r[23],r[24]!==y?(b=e(a,{dimColor:!0,children:["Experimental · inbound messages will be pushed into this session, this carries prompt injection risks. Restart Context Code without ",y," to disable."]}),r[24]=y,r[25]=b):b=r[25],r[26]!==u?(w=u.map(_temp4),r[26]=u,r[27]=w):w=r[27],r[28]!==g||r[29]!==b||r[30]!==w?(v=e(s,{paddingLeft:2,flexDirection:"column",children:[g,b,w]}),r[28]=g,r[29]=b,r[30]=w,r[31]=v):v=r[31],v}function _temp4(n){return e(a,{color:"warning",children:[formatEntry(n.entry)," · ",n.why]},`${formatEntry(n.entry)}:${n.why}`)}function _temp3(n){return e(a,{color:"warning",children:[formatEntry(n.entry)," · ",n.why]},`${formatEntry(n.entry)}:${n.why}`)}function _temp2(e){return!e.dev}function _temp(){const e=i();if(0===e.length)return{channels:e,disabled:!1,noAuth:!1,policyBlocked:!1,list:"",unmatched:[]};const n=e.map(formatEntry).join(", "),r=p(),t="team"===r||"enterprise"===r,o=f("policySettings"),l=m(r,o?.allowedChannelPlugins);return{channels:e,disabled:!c(),noAuth:!h()?.accessToken,policyBlocked:t&&!0!==o?.channelsEnabled,list:n,unmatched:findUnmatched(e,l)}}function formatEntry(e){return"plugin"===e.kind?`plugin:${e.name}@${e.marketplace}`:`server:${e.name}`}function findUnmatched(e,n){const r=["enterprise","user","project","local"],t=new Set;for(const e of r)for(const n of Object.keys(d(e).servers))t.add(n);const o=new Set(Object.keys(u().plugins)),{entries:i,source:l}=n,s=[];for(const n of e)"server"!==n.kind?(o.has(`${n.name}@${n.marketplace}`)||s.push({entry:n,why:"plugin not installed"}),n.dev||i.some(e=>e.plugin===n.name&&e.marketplace===n.marketplace)||s.push({entry:n,why:"org"===l?"not on your org's approved channels list":"not on the approved channels allowlist"})):(t.has(n.name)||s.push({entry:n,why:"no MCP server configured with that name"}),n.dev||s.push({entry:n,why:"server: entries need --dangerously-load-development-channels"}));return s}
1
+ import{jsxs as e,jsx as n}from"react/jsx-runtime";import{createRequire as r}from"module";r(import.meta.url);import{c as t}from"react/compiler-runtime";import{useState as o}from"react";import{getAllowedChannels as i,getHasDevChannels as l}from"../../bootstrap/state.js";import{Box as a,Text as s}from"../../ink.js";import{isChannelsEnabled as c}from"../../services/mcp/channelAllowlist.js";import{getEffectiveChannelAllowlist as m}from"../../services/mcp/channelNotification.js";import{getMcpConfigsByScope as d}from"../../services/mcp/config.js";import{getClaudeAIOAuthTokens as p,getSubscriptionType as u}from"../../utils/auth.js";import{loadInstalledPluginsV2 as h}from"../../utils/plugins/installedPluginsManager.js";import{getSettingsForSource as f}from"../../utils/settings/settings.js";export function ChannelsNotice(){const r=t(32),[i]=o(_temp),{channels:c,disabled:m,noAuth:d,policyBlocked:p,list:u,unmatched:h}=i;if(0===c.length)return null;const f=c.some(_temp2),y=l()&&f?"Channels":l()?"--dangerously-load-development-channels":"--channels";if(m){let t,o,i;return r[0]!==y||r[1]!==u?(t=e(s,{color:"error",children:[y," ignorado (",u,")"]}),r[0]=y,r[1]=u,r[2]=t):t=r[2],r[3]===Symbol.for("react.memo_cache_sentinel")?(o=n(s,{dimColor:!0,children:"Los canales no están disponibles actualmente"}),r[3]=o):o=r[3],r[4]!==t?(i=e(a,{paddingLeft:2,flexDirection:"column",children:[t,o]}),r[4]=t,r[5]=i):i=r[5],i}if(d){let t,o,i;return r[6]!==y||r[7]!==u?(t=e(s,{color:"error",children:[y," ignorado (",u,")"]}),r[6]=y,r[7]=u,r[8]=t):t=r[8],r[9]===Symbol.for("react.memo_cache_sentinel")?(o=n(s,{dimColor:!0,children:"Los canales requieren autenticación con Context · ejecuta /login y luego reinicia"}),r[9]=o):o=r[9],r[10]!==t?(i=e(a,{paddingLeft:2,flexDirection:"column",children:[t,o]}),r[10]=t,r[11]=i):i=r[11],i}if(p){let t,o,i,l,c;return r[12]!==y||r[13]!==u?(t=e(s,{color:"error",children:[y," bloqueado por política de la organización (",u,")"]}),r[12]=y,r[13]=u,r[14]=t):t=r[14],r[15]===Symbol.for("react.memo_cache_sentinel")?(o=n(s,{dimColor:!0,children:"Los mensajes entrantes serán descartados silenciosamente"}),i=n(s,{dimColor:!0,children:"Pide a un administrador que configure channelsEnabled: true en los ajustes gestionados para habilitarlo"}),r[15]=o,r[16]=i):(o=r[15],i=r[16]),r[17]!==h?(l=h.map(_temp3),r[17]=h,r[18]=l):l=r[18],r[19]!==t||r[20]!==l?(c=e(a,{paddingLeft:2,flexDirection:"column",children:[t,o,i,l]}),r[19]=t,r[20]=l,r[21]=c):c=r[21],c}let g,j,v,w;return r[22]!==u?(g=e(s,{color:"error",children:["Escuchando mensajes de canal desde: ",u]}),r[22]=u,r[23]=g):g=r[23],r[24]!==y?(j=e(s,{dimColor:!0,children:["Experimental · los mensajes entrantes se inyectarán en esta sesión, lo que conlleva riesgos de inyección de prompt. Reinicia Context Code sin ",y," para desactivarlo."]}),r[24]=y,r[25]=j):j=r[25],r[26]!==h?(v=h.map(_temp4),r[26]=h,r[27]=v):v=r[27],r[28]!==g||r[29]!==j||r[30]!==v?(w=e(a,{paddingLeft:2,flexDirection:"column",children:[g,j,v]}),r[28]=g,r[29]=j,r[30]=v,r[31]=w):w=r[31],w}function _temp4(n){return e(s,{color:"warning",children:[formatEntry(n.entry)," · ",n.why]},`${formatEntry(n.entry)}:${n.why}`)}function _temp3(n){return e(s,{color:"warning",children:[formatEntry(n.entry)," · ",n.why]},`${formatEntry(n.entry)}:${n.why}`)}function _temp2(e){return!e.dev}function _temp(){const e=i();if(0===e.length)return{channels:e,disabled:!1,noAuth:!1,policyBlocked:!1,list:"",unmatched:[]};const n=e.map(formatEntry).join(", "),r=u(),t="team"===r||"enterprise"===r,o=f("policySettings"),l=m(r,o?.allowedChannelPlugins);return{channels:e,disabled:!c(),noAuth:!p()?.accessToken,policyBlocked:t&&!0!==o?.channelsEnabled,list:n,unmatched:findUnmatched(e,l)}}function formatEntry(e){return"plugin"===e.kind?`plugin:${e.name}@${e.marketplace}`:`server:${e.name}`}function findUnmatched(e,n){const r=["enterprise","user","project","local"],t=new Set;for(const e of r)for(const n of Object.keys(d(e).servers))t.add(n);const o=new Set(Object.keys(h().plugins)),{entries:i,source:l}=n,a=[];for(const n of e)"server"!==n.kind?(o.has(`${n.name}@${n.marketplace}`)||a.push({entry:n,why:"plugin not installed"}),n.dev||i.some(e=>e.plugin===n.name&&e.marketplace===n.marketplace)||a.push({entry:n,why:"org"===l?"not on your org's approved channels list":"not on the approved channels allowlist"})):(t.has(n.name)||a.push({entry:n,why:"no MCP server configured with that name"}),n.dev||a.push({entry:n,why:"server: entries need --dangerously-load-development-channels"}));return a}
@@ -1 +1 @@
1
- import{MACRO as e,feature as o}from"../../recovery/bunBundleShim.js";import{jsx as r,jsxs as n,Fragment as t}from"react/jsx-runtime";import{createRequire as i}from"module";const s=i(import.meta.url);import{c}from"react/compiler-runtime";import{Box as l,Text as m,color as a}from"../../ink.js";import{useTerminalSize as d}from"../../hooks/useTerminalSize.js";import{stringWidth as _}from"../../ink/stringWidth.js";import{getLayoutMode as p,calculateLayoutDimensions as C,calculateOptimalLeftWidth as E,formatWelcomeMessage as f,truncatePath as h,getRecentActivitySync as u,getRecentReleaseNotesSync as O,getLogoDisplayData as T}from"../../utils/logoV2Utils.js";import{truncate as D}from"../../utils/format.js";import{getDisplayPath as X}from"../../utils/file.js";import{Clawd as S}from"./Clawd.js";import{FeedColumn as g}from"./FeedColumn.js";import{createRecentActivityFeed as N,createWhatsNewFeed as U,createProjectOnboardingFeed as L,createGuestPassesFeed as b}from"./feedConfigs.js";import{getGlobalConfig as I,saveGlobalConfig as v}from"../../utils/config.js";import{resolveThemeSetting as M}from"../../utils/systemTheme.js";import{getInitialSettings as j}from"../../utils/settings/settings.js";import{isDebugMode as F,isDebugToStdErr as x,getDebugLogPath as R}from"../../utils/debug.js";import{useEffect as A,useState as y}from"react";import{getSteps as P,shouldShowProjectOnboarding as $,incrementProjectOnboardingSeenCount as w}from"../../projectOnboardingState.js";import{CondensedLogo as z}from"./CondensedLogo.js";import{OffscreenFreeze as V}from"../OffscreenFreeze.js";import{checkForReleaseNotesSync as G}from"../../utils/releaseNotes.js";import{getDumpPromptsPath as k}from"../../services/api/dumpPrompts.js";import{isEnvTruthy as W}from"../../utils/envUtils.js";import{getStartupPerfLogPath as Y,isDetailedProfilingEnabled as H}from"../../utils/startupProfiler.js";import{EmergencyTip as K}from"./EmergencyTip.js";import{VoiceModeNotice as B}from"./VoiceModeNotice.js";import{Opus1mMergeNotice as q}from"./Opus1mMergeNotice.js";const J=o("KAIROS")||o("KAIROS_CHANNELS")?s("./ChannelsNotice.js"):null;import{SandboxManager as Q}from"../../utils/sandbox/sandbox-adapter.js";import{useShowGuestPassesUpsell as Z,incrementGuestPassesSeenCount as ee}from"./GuestPassesUpsell.js";import{useShowOverageCreditUpsell as oe,incrementOverageCreditUpsellSeenCount as re,createOverageCreditFeed as ne}from"./OverageCreditUpsell.js";import{useAppState as te}from"../../state/AppState.js";import{getEffortSuffix as ie}from"../../utils/effort.js";import{useMainLoopModel as se}from"../../hooks/useMainLoopModel.js";import{renderModelSetting as ce}from"../../utils/model/model.js";export function LogoV2(){const o=c(94),i=u(),s=I().oauthAccount?.displayName??"",{columns:X}=d();let k;o[0]===Symbol.for("react.memo_cache_sentinel")?(k=$(),o[0]=k):k=o[0];const Y=k;let H;o[1]===Symbol.for("react.memo_cache_sentinel")?(H=Q.isSandboxingEnabled(),o[1]=H):H=o[1];const le=H,me=Z(),ae=oe(),de=te(_temp),_e=te(_temp2),pe=I();let Ce;try{Ce=O(3)}catch{Ce=[]}const[Ee]=y(()=>{const e=j().companyAnnouncements;if(e&&0!==e.length)return 1===pe.numStartups?e[0]:e[Math.floor(Math.random()*e.length)]}),{hasReleaseNotes:fe}=G(pe.lastReleaseNotesSeen);let he,ue,Oe;o[2]===Symbol.for("react.memo_cache_sentinel")?(he=()=>{I().lastReleaseNotesSeen!==e.VERSION&&(v(_temp3),Y&&w())},o[2]=he):he=o[2],o[3]!==pe?(ue=[pe,Y],o[3]=pe,o[4]=ue):ue=o[4],A(he,ue),o[5]===Symbol.for("react.memo_cache_sentinel")?(Oe=!(fe||Y||W(process.env.CONTEXT_CODE_FORCE_FULL_LOGO)||W(process.env.CLAUDE_CODE_FORCE_FULL_LOGO)),o[5]=Oe):Oe=o[5];const Te=Oe;let De,Xe,Se,ge;o[6]!==me?(De=()=>{!me||Y||Te||ee()},Xe=[me,Y,Te],o[6]=me,o[7]=De,o[8]=Xe):(De=o[7],Xe=o[8]),A(De,Xe),o[9]!==me||o[10]!==ae?(Se=()=>{!ae||Y||me||Te||re()},ge=[ae,Y,me,Te],o[9]=me,o[10]=ae,o[11]=Se,o[12]=ge):(Se=o[11],ge=o[12]),A(Se,ge);const Ne=se(),Ue=ce(Ne),{version:Le,cwd:be,billingType:Ie,agentName:ve}=T(),Me=de??ve,je=Ue+ie(Ne,_e);let Fe;o[13]!==je?(Fe=D(je,30),o[13]=je,o[14]=Fe):Fe=o[14];const xe=Fe;if(!(fe||Y||W(process.env.CONTEXT_CODE_FORCE_FULL_LOGO)||W(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))){let e,i,s,c,a,d,_,p,C,E,f,h,u;return o[15]===Symbol.for("react.memo_cache_sentinel")?(e=r(z,{}),i=r(B,{}),s=r(q,{}),c=J&&r(J.ChannelsNotice,{}),a=F()&&n(l,{paddingLeft:2,flexDirection:"column",children:[r(m,{color:"warning",children:"Debug mode enabled"}),n(m,{dimColor:!0,children:["Logging to: ",x()?"stderr":R()]})]}),d=r(K,{}),_=(process.env.CONTEXT_CODE_TMUX_SESSION??process.env.CLAUDE_CODE_TMUX_SESSION)&&n(l,{paddingLeft:2,flexDirection:"column",children:[n(m,{dimColor:!0,children:["tmux session: ",process.env.CONTEXT_CODE_TMUX_SESSION??process.env.CLAUDE_CODE_TMUX_SESSION]}),r(m,{dimColor:!0,children:process.env.CONTEXT_CODE_TMUX_PREFIX_CONFLICTS??process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),o[15]=e,o[16]=i,o[17]=s,o[18]=c,o[19]=a,o[20]=d,o[21]=_):(e=o[15],i=o[16],s=o[17],c=o[18],a=o[19],d=o[20],_=o[21]),o[22]!==Ee||o[23]!==pe?(p=Ee&&n(l,{paddingLeft:2,flexDirection:"column",children:[!process.env.IS_DEMO&&pe.oauthAccount?.organizationName&&n(m,{dimColor:!0,children:["Message from ",pe.oauthAccount.organizationName,":"]}),r(m,{children:Ee})]}),o[22]=Ee,o[23]=pe,o[24]=p):p=o[24],o[25]===Symbol.for("react.memo_cache_sentinel")?(C=!1,E=!1,f=!1,h=!1,o[25]=C,o[26]=E,o[27]=f,o[28]=h):(C=o[25],E=o[26],f=o[27],h=o[28]),o[29]!==p?(u=n(t,{children:[e,i,s,c,a,d,_,p,C,E,f,h]}),o[29]=p,o[30]=u):u=o[30],u}const Re=p(X),Ae=M(I().theme),ye=` ${a("claude",Ae)("CTX")} ${a("inactive",Ae)(`v${Le}`)} `,Pe=a("claude",Ae)(" CTX ");if("compact"===Re){let e=f(s);if(_(e)>X-4){let r;o[31]===Symbol.for("react.memo_cache_sentinel")?(r=f(null),o[31]=r):r=o[31],e=r}const i=h(be,Math.max(X-4,10));let c,a,d,p,C,E,u,O,T;return o[32]!==Pe?(c={content:Pe,position:"top",align:"start",offset:1},o[32]=Pe,o[33]=c):c=o[33],o[34]===Symbol.for("react.memo_cache_sentinel")?(a=r(l,{marginY:1,children:r(S,{})}),o[34]=a):a=o[34],o[35]!==xe?(d=r(m,{dimColor:!0,children:xe}),o[35]=xe,o[36]=d):d=o[36],o[37]===Symbol.for("react.memo_cache_sentinel")?(p=r(B,{}),C=r(q,{}),E=J&&r(J.ChannelsNotice,{}),o[37]=p,o[38]=C,o[39]=E):(p=o[37],C=o[38],E=o[39]),o[40]!==le?(u=le&&r(l,{marginTop:1,flexDirection:"column",children:r(m,{color:"warning",children:"Your bash commands will be sandboxed. Disable with /sandbox."})}),o[40]=le,o[41]=u):u=o[41],o[42]===Symbol.for("react.memo_cache_sentinel")?(O=!1,T=!1,o[42]=O,o[43]=T):(O=o[42],T=o[43]),n(t,{children:[r(V,{children:n(l,{flexDirection:"column",borderStyle:"round",borderColor:"claude",borderText:c,paddingX:2,paddingY:1,alignItems:"center",width:X,children:[r(m,{color:"claude",children:"CTX"}),r(m,{bold:!0,children:e}),a,r(m,{dimColor:!0,children:xe}),r(m,{dimColor:!0,children:Ie}),Me?n(m,{dimColor:!0,children:["@",Me]}):null,r(m,{dimColor:!0,children:i})]})}),p,C,E,u,O,T]})}const $e=f(s),we=!process.env.IS_DEMO&&pe.oauthAccount?.organizationName?`${xe} · ${Ie} · ${pe.oauthAccount.organizationName}`:`${xe} · ${Ie}`,ze=Me?49-_(Me)-3:50,Ve=h(be,Math.max(ze,10)),Ge=Me?`@${Me} · ${Ve}`:Ve,ke=E($e,Ge,we),{leftWidth:We,rightWidth:Ye}=C(X,Re,ke),He=V,Ke=l;let Be;o[44]!==ye?(Be={content:ye,position:"top",align:"start",offset:3},o[44]=ye,o[45]=Be):Be=o[45];const qe=l,Je="column";let Qe,Ze,eo,oo,ro,no,to;o[46]!==$e?(Qe=r(l,{marginTop:1,children:r(m,{bold:!0,children:$e})}),o[46]=$e,o[47]=Qe):Qe=o[47],o[48]===Symbol.for("react.memo_cache_sentinel")?(Ze=r(S,{}),o[48]=Ze):Ze=o[48],o[49]!==we?(eo=r(m,{dimColor:!0,children:we}),o[49]=we,o[50]=eo):eo=o[50],o[51]!==Ge?(oo=r(m,{dimColor:!0,children:Ge}),o[51]=Ge,o[52]=oo):oo=o[52],o[53]!==eo||o[54]!==oo?(ro=n(l,{flexDirection:"column",alignItems:"center",children:[r(m,{color:"claude",children:"CTX"}),eo,oo]}),o[53]=eo,o[54]=oo,o[55]=ro):ro=o[55],o[56]!==We||o[57]!==Qe||o[58]!==ro?(no=n(l,{flexDirection:"column",width:We,justifyContent:"space-between",alignItems:"center",minHeight:11,children:[Qe,Ze,ro]}),o[56]=We,o[57]=Qe,o[58]=ro,o[59]=no):no=o[59],o[60]!==Re?(to=null,o[60]=Re,o[61]=to):to=o[61];const io=r(g,{feeds:Y?[L(P()),N(i)]:me?[N(i),b()]:ae?[N(i),ne()]:[N(i),U(Ce)],maxWidth:Math.max(We,Ye)});let so,co,lo,mo,ao,_o,po,Co,Eo,fo,ho,uo,Oo,To,Do,Xo;return o[62]!==qe||o[63]!==Je||o[64]!==no||o[65]!==to||o[66]!==io?(so=n(qe,{flexDirection:Je,paddingX:2,gap:2,children:[no,to,io]}),o[62]=qe,o[63]=Je,o[64]=no,o[65]=to,o[66]=io,o[67]=so):so=o[67],o[68]!==Ke||o[69]!==Be||o[70]!==so?(co=r(Ke,{flexDirection:"column",borderStyle:"round",borderColor:"claude",borderText:Be,children:so}),o[68]=Ke,o[69]=Be,o[70]=so,o[71]=co):co=o[71],o[72]!==He||o[73]!==co?(lo=r(He,{children:co}),o[72]=He,o[73]=co,o[74]=lo):lo=o[74],o[75]===Symbol.for("react.memo_cache_sentinel")?(mo=r(B,{}),ao=r(q,{}),_o=J&&r(J.ChannelsNotice,{}),po=F()&&n(l,{paddingLeft:2,flexDirection:"column",children:[r(m,{color:"warning",children:"Debug mode enabled"}),n(m,{dimColor:!0,children:["Logging to: ",x()?"stderr":R()]})]}),Co=r(K,{}),Eo=(process.env.CONTEXT_CODE_TMUX_SESSION??process.env.CLAUDE_CODE_TMUX_SESSION)&&n(l,{paddingLeft:2,flexDirection:"column",children:[n(m,{dimColor:!0,children:["tmux session: ",process.env.CONTEXT_CODE_TMUX_SESSION??process.env.CLAUDE_CODE_TMUX_SESSION]}),r(m,{dimColor:!0,children:process.env.CONTEXT_CODE_TMUX_PREFIX_CONFLICTS??process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),o[75]=mo,o[76]=ao,o[77]=_o,o[78]=po,o[79]=Co,o[80]=Eo):(mo=o[75],ao=o[76],_o=o[77],po=o[78],Co=o[79],Eo=o[80]),o[81]!==Ee||o[82]!==pe?(fo=Ee&&n(l,{paddingLeft:2,flexDirection:"column",children:[!process.env.IS_DEMO&&pe.oauthAccount?.organizationName&&n(m,{dimColor:!0,children:["Message from ",pe.oauthAccount.organizationName,":"]}),r(m,{children:Ee})]}),o[81]=Ee,o[82]=pe,o[83]=fo):fo=o[83],o[84]!==le?(ho=le&&r(l,{paddingLeft:2,flexDirection:"column",children:r(m,{color:"warning",children:"Your bash commands will be sandboxed. Disable with /sandbox."})}),o[84]=le,o[85]=ho):ho=o[85],o[86]===Symbol.for("react.memo_cache_sentinel")?(uo=!1,Oo=!1,To=!1,Do=!1,o[86]=uo,o[87]=Oo,o[88]=To,o[89]=Do):(uo=o[86],Oo=o[87],To=o[88],Do=o[89]),o[90]!==lo||o[91]!==fo||o[92]!==ho?(Xo=n(t,{children:[lo,mo,ao,_o,po,Co,Eo,fo,ho,uo,Oo,To,Do]}),o[90]=lo,o[91]=fo,o[92]=ho,o[93]=Xo):Xo=o[93],Xo}function _temp3(o){return o.lastReleaseNotesSeen===e.VERSION?o:{...o,lastReleaseNotesSeen:e.VERSION}}function _temp2(e){return e.effortValue}function _temp(e){return e.agent}
1
+ import{MACRO as e,feature as o}from"../../recovery/bunBundleShim.js";import{jsx as r,jsxs as n,Fragment as t}from"react/jsx-runtime";import{createRequire as s}from"module";const i=s(import.meta.url);import{c}from"react/compiler-runtime";import{Box as l,Text as m,color as a}from"../../ink.js";import{useTerminalSize as d}from"../../hooks/useTerminalSize.js";import{stringWidth as _}from"../../ink/stringWidth.js";import{getLayoutMode as p,calculateLayoutDimensions as C,calculateOptimalLeftWidth as E,formatWelcomeMessage as f,truncatePath as h,getRecentActivitySync as u,getRecentReleaseNotesSync as O,getLogoDisplayData as T}from"../../utils/logoV2Utils.js";import{truncate as D}from"../../utils/format.js";import{getDisplayPath as X}from"../../utils/file.js";import{Clawd as S}from"./Clawd.js";import{FeedColumn as g}from"./FeedColumn.js";import{createRecentActivityFeed as N,createWhatsNewFeed as U,createProjectOnboardingFeed as L,createGuestPassesFeed as v}from"./feedConfigs.js";import{getGlobalConfig as I,saveGlobalConfig as M}from"../../utils/config.js";import{resolveThemeSetting as b}from"../../utils/systemTheme.js";import{getInitialSettings as j}from"../../utils/settings/settings.js";import{isDebugMode as F,isDebugToStdErr as x,getDebugLogPath as R}from"../../utils/debug.js";import{useEffect as A,useState as y}from"react";import{getSteps as P,shouldShowProjectOnboarding as $,incrementProjectOnboardingSeenCount as w}from"../../projectOnboardingState.js";import{CondensedLogo as z}from"./CondensedLogo.js";import{OffscreenFreeze as V}from"../OffscreenFreeze.js";import{checkForReleaseNotesSync as G}from"../../utils/releaseNotes.js";import{getDumpPromptsPath as k}from"../../services/api/dumpPrompts.js";import{isEnvTruthy as W}from"../../utils/envUtils.js";import{getStartupPerfLogPath as H,isDetailedProfilingEnabled as K}from"../../utils/startupProfiler.js";import{EmergencyTip as Y}from"./EmergencyTip.js";import{VoiceModeNotice as B}from"./VoiceModeNotice.js";import{Opus1mMergeNotice as q}from"./Opus1mMergeNotice.js";const J=o("KAIROS")||o("KAIROS_CHANNELS")?i("./ChannelsNotice.js"):null;import{SandboxManager as Q}from"../../utils/sandbox/sandbox-adapter.js";import{useShowGuestPassesUpsell as Z,incrementGuestPassesSeenCount as ee}from"./GuestPassesUpsell.js";import{useShowOverageCreditUpsell as oe,incrementOverageCreditUpsellSeenCount as re,createOverageCreditFeed as ne}from"./OverageCreditUpsell.js";import{useAppState as te}from"../../state/AppState.js";import{getEffortSuffix as se}from"../../utils/effort.js";import{useMainLoopModel as ie}from"../../hooks/useMainLoopModel.js";import{renderModelSetting as ce}from"../../utils/model/model.js";export function LogoV2(){const o=c(94),s=u(),i=I().oauthAccount?.displayName??"",{columns:X}=d();let k;o[0]===Symbol.for("react.memo_cache_sentinel")?(k=$(),o[0]=k):k=o[0];const H=k;let K;o[1]===Symbol.for("react.memo_cache_sentinel")?(K=Q.isSandboxingEnabled(),o[1]=K):K=o[1];const le=K,me=Z(),ae=oe(),de=te(_temp),_e=te(_temp2),pe=I();let Ce;try{Ce=O(3)}catch{Ce=[]}const[Ee]=y(()=>{const e=j().companyAnnouncements;if(e&&0!==e.length)return 1===pe.numStartups?e[0]:e[Math.floor(Math.random()*e.length)]}),{hasReleaseNotes:fe}=G(pe.lastReleaseNotesSeen);let he,ue,Oe;o[2]===Symbol.for("react.memo_cache_sentinel")?(he=()=>{I().lastReleaseNotesSeen!==e.VERSION&&(M(_temp3),H&&w())},o[2]=he):he=o[2],o[3]!==pe?(ue=[pe,H],o[3]=pe,o[4]=ue):ue=o[4],A(he,ue),o[5]===Symbol.for("react.memo_cache_sentinel")?(Oe=!(fe||H||W(process.env.CONTEXT_CODE_FORCE_FULL_LOGO)||W(process.env.CLAUDE_CODE_FORCE_FULL_LOGO)),o[5]=Oe):Oe=o[5];const Te=Oe;let De,Xe,Se,ge;o[6]!==me?(De=()=>{!me||H||Te||ee()},Xe=[me,H,Te],o[6]=me,o[7]=De,o[8]=Xe):(De=o[7],Xe=o[8]),A(De,Xe),o[9]!==me||o[10]!==ae?(Se=()=>{!ae||H||me||Te||re()},ge=[ae,H,me,Te],o[9]=me,o[10]=ae,o[11]=Se,o[12]=ge):(Se=o[11],ge=o[12]),A(Se,ge);const Ne=ie(),Ue=ce(Ne),{version:Le,cwd:ve,billingType:Ie,agentName:Me}=T(),be=de??Me,je=Ue+se(Ne,_e);let Fe;o[13]!==je?(Fe=D(je,30),o[13]=je,o[14]=Fe):Fe=o[14];const xe=Fe;if(!(fe||H||W(process.env.CONTEXT_CODE_FORCE_FULL_LOGO)||W(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))){let e,s,i,c,a,d,_,p,C,E,f,h,u;return o[15]===Symbol.for("react.memo_cache_sentinel")?(e=r(z,{}),s=r(B,{}),i=r(q,{}),c=J&&r(J.ChannelsNotice,{}),a=F()&&n(l,{paddingLeft:2,flexDirection:"column",children:[r(m,{color:"warning",children:"Debug mode enabled"}),n(m,{dimColor:!0,children:["Logging to: ",x()?"stderr":R()]})]}),d=r(Y,{}),_=(process.env.CONTEXT_CODE_TMUX_SESSION??process.env.CLAUDE_CODE_TMUX_SESSION)&&n(l,{paddingLeft:2,flexDirection:"column",children:[n(m,{dimColor:!0,children:["tmux session: ",process.env.CONTEXT_CODE_TMUX_SESSION??process.env.CLAUDE_CODE_TMUX_SESSION]}),r(m,{dimColor:!0,children:process.env.CONTEXT_CODE_TMUX_PREFIX_CONFLICTS??process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),o[15]=e,o[16]=s,o[17]=i,o[18]=c,o[19]=a,o[20]=d,o[21]=_):(e=o[15],s=o[16],i=o[17],c=o[18],a=o[19],d=o[20],_=o[21]),o[22]!==Ee||o[23]!==pe?(p=Ee&&n(l,{paddingLeft:2,flexDirection:"column",children:[!process.env.IS_DEMO&&pe.oauthAccount?.organizationName&&n(m,{dimColor:!0,children:["Message from ",pe.oauthAccount.organizationName,":"]}),r(m,{children:Ee})]}),o[22]=Ee,o[23]=pe,o[24]=p):p=o[24],o[25]===Symbol.for("react.memo_cache_sentinel")?(C=!1,E=!1,f=!1,h=!1,o[25]=C,o[26]=E,o[27]=f,o[28]=h):(C=o[25],E=o[26],f=o[27],h=o[28]),o[29]!==p?(u=n(t,{children:[e,s,i,c,a,d,_,p,C,E,f,h]}),o[29]=p,o[30]=u):u=o[30],u}const Re=p(X),Ae=b(I().theme),ye=` ${a("claude",Ae)("CTX")} ${a("inactive",Ae)(`v${Le}`)} `,Pe=a("claude",Ae)(" CTX ");if("compact"===Re){let e=f(i);if(_(e)>X-4){let r;o[31]===Symbol.for("react.memo_cache_sentinel")?(r=f(null),o[31]=r):r=o[31],e=r}const s=h(ve,Math.max(X-4,10));let c,a,d,p,C,E,u,O,T;return o[32]!==Pe?(c={content:Pe,position:"top",align:"start",offset:1},o[32]=Pe,o[33]=c):c=o[33],o[34]===Symbol.for("react.memo_cache_sentinel")?(a=r(l,{marginY:1,children:r(S,{})}),o[34]=a):a=o[34],o[35]!==xe?(d=r(m,{dimColor:!0,children:xe}),o[35]=xe,o[36]=d):d=o[36],o[37]===Symbol.for("react.memo_cache_sentinel")?(p=r(B,{}),C=r(q,{}),E=J&&r(J.ChannelsNotice,{}),o[37]=p,o[38]=C,o[39]=E):(p=o[37],C=o[38],E=o[39]),o[40]!==le?(u=le&&r(l,{marginTop:1,flexDirection:"column",children:r(m,{color:"warning",children:"Tus comandos bash se ejecutarán en sandbox. Desactiva con /sandbox."})}),o[40]=le,o[41]=u):u=o[41],o[42]===Symbol.for("react.memo_cache_sentinel")?(O=!1,T=!1,o[42]=O,o[43]=T):(O=o[42],T=o[43]),n(t,{children:[r(V,{children:n(l,{flexDirection:"column",borderStyle:"round",borderColor:"claude",borderText:c,paddingX:2,paddingY:1,alignItems:"center",width:X,children:[r(m,{color:"claude",children:"CTX"}),r(m,{bold:!0,children:e}),a,r(m,{dimColor:!0,children:xe}),r(m,{dimColor:!0,children:Ie}),be?n(m,{dimColor:!0,children:["@",be]}):null,r(m,{dimColor:!0,children:s})]})}),p,C,E,u,O,T]})}const $e=f(i),we=!process.env.IS_DEMO&&pe.oauthAccount?.organizationName?`${xe} · ${Ie} · ${pe.oauthAccount.organizationName}`:`${xe} · ${Ie}`,ze=be?49-_(be)-3:50,Ve=h(ve,Math.max(ze,10)),Ge=be?`@${be} · ${Ve}`:Ve,ke=E($e,Ge,we),{leftWidth:We,rightWidth:He}=C(X,Re,ke),Ke=V,Ye=l;let Be;o[44]!==ye?(Be={content:ye,position:"top",align:"start",offset:3},o[44]=ye,o[45]=Be):Be=o[45];const qe=l,Je="column";let Qe,Ze,eo,oo,ro,no,to;o[46]!==$e?(Qe=r(l,{marginTop:1,children:r(m,{bold:!0,children:$e})}),o[46]=$e,o[47]=Qe):Qe=o[47],o[48]===Symbol.for("react.memo_cache_sentinel")?(Ze=r(S,{}),o[48]=Ze):Ze=o[48],o[49]!==we?(eo=r(m,{dimColor:!0,children:we}),o[49]=we,o[50]=eo):eo=o[50],o[51]!==Ge?(oo=r(m,{dimColor:!0,children:Ge}),o[51]=Ge,o[52]=oo):oo=o[52],o[53]!==eo||o[54]!==oo?(ro=n(l,{flexDirection:"column",alignItems:"center",children:[r(m,{color:"claude",children:"CTX"}),eo,oo]}),o[53]=eo,o[54]=oo,o[55]=ro):ro=o[55],o[56]!==We||o[57]!==Qe||o[58]!==ro?(no=n(l,{flexDirection:"column",width:We,justifyContent:"space-between",alignItems:"center",minHeight:11,children:[Qe,Ze,ro]}),o[56]=We,o[57]=Qe,o[58]=ro,o[59]=no):no=o[59],o[60]!==Re?(to=null,o[60]=Re,o[61]=to):to=o[61];const so=r(g,{feeds:H?[L(P()),N(s)]:me?[N(s),v()]:ae?[N(s),ne()]:[N(s),U(Ce)],maxWidth:Math.max(We,He)});let io,co,lo,mo,ao,_o,po,Co,Eo,fo,ho,uo,Oo,To,Do,Xo;return o[62]!==qe||o[63]!==Je||o[64]!==no||o[65]!==to||o[66]!==so?(io=n(qe,{flexDirection:Je,paddingX:2,gap:2,children:[no,to,so]}),o[62]=qe,o[63]=Je,o[64]=no,o[65]=to,o[66]=so,o[67]=io):io=o[67],o[68]!==Ye||o[69]!==Be||o[70]!==io?(co=r(Ye,{flexDirection:"column",borderStyle:"round",borderColor:"claude",borderText:Be,children:io}),o[68]=Ye,o[69]=Be,o[70]=io,o[71]=co):co=o[71],o[72]!==Ke||o[73]!==co?(lo=r(Ke,{children:co}),o[72]=Ke,o[73]=co,o[74]=lo):lo=o[74],o[75]===Symbol.for("react.memo_cache_sentinel")?(mo=r(B,{}),ao=r(q,{}),_o=J&&r(J.ChannelsNotice,{}),po=F()&&n(l,{paddingLeft:2,flexDirection:"column",children:[r(m,{color:"warning",children:"Debug mode enabled"}),n(m,{dimColor:!0,children:["Logging to: ",x()?"stderr":R()]})]}),Co=r(Y,{}),Eo=(process.env.CONTEXT_CODE_TMUX_SESSION??process.env.CLAUDE_CODE_TMUX_SESSION)&&n(l,{paddingLeft:2,flexDirection:"column",children:[n(m,{dimColor:!0,children:["tmux session: ",process.env.CONTEXT_CODE_TMUX_SESSION??process.env.CLAUDE_CODE_TMUX_SESSION]}),r(m,{dimColor:!0,children:process.env.CONTEXT_CODE_TMUX_PREFIX_CONFLICTS??process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CONTEXT_CODE_TMUX_PREFIX??process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),o[75]=mo,o[76]=ao,o[77]=_o,o[78]=po,o[79]=Co,o[80]=Eo):(mo=o[75],ao=o[76],_o=o[77],po=o[78],Co=o[79],Eo=o[80]),o[81]!==Ee||o[82]!==pe?(fo=Ee&&n(l,{paddingLeft:2,flexDirection:"column",children:[!process.env.IS_DEMO&&pe.oauthAccount?.organizationName&&n(m,{dimColor:!0,children:["Message from ",pe.oauthAccount.organizationName,":"]}),r(m,{children:Ee})]}),o[81]=Ee,o[82]=pe,o[83]=fo):fo=o[83],o[84]!==le?(ho=le&&r(l,{paddingLeft:2,flexDirection:"column",children:r(m,{color:"warning",children:"Tus comandos bash se ejecutarán en sandbox. Desactiva con /sandbox."})}),o[84]=le,o[85]=ho):ho=o[85],o[86]===Symbol.for("react.memo_cache_sentinel")?(uo=!1,Oo=!1,To=!1,Do=!1,o[86]=uo,o[87]=Oo,o[88]=To,o[89]=Do):(uo=o[86],Oo=o[87],To=o[88],Do=o[89]),o[90]!==lo||o[91]!==fo||o[92]!==ho?(Xo=n(t,{children:[lo,mo,ao,_o,po,Co,Eo,fo,ho,uo,Oo,To,Do]}),o[90]=lo,o[91]=fo,o[92]=ho,o[93]=Xo):Xo=o[93],Xo}function _temp3(o){return o.lastReleaseNotesSeen===e.VERSION?o:{...o,lastReleaseNotesSeen:e.VERSION}}function _temp2(e){return e.effortValue}function _temp(e){return e.agent}
@@ -1 +1 @@
1
- import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import o from"figures";import{homedir as i}from"os";import{Box as s,Text as a}from"../../ink.js";import{formatCreditAmount as n,getCachedReferrerReward as m}from"../../services/api/referral.js";import{getCwd as c}from"../../utils/cwd.js";import{formatRelativeTimeAgo as d}from"../../utils/format.js";import{translateReleaseNoteToSpanish as p}from"../../utils/releaseNoteTranslations.js";export function createRecentActivityFeed(e){const t=e.map(e=>{const t=d(e.modified);return{text:(e.summary&&"No prompt"!==e.summary?e.summary:e.firstPrompt)||"",timestamp:t}});return{title:"Actividad reciente",lines:t,footer:t.length>0?"/resume para ver más":void 0,emptyMessage:"Sin actividad reciente"}}export function createWhatsNewFeed(e){const t=e.map(e=>({text:p(e)}));return{title:"Novedades",lines:t,footer:t.length>0?"/release-notes para ver más":void 0,emptyMessage:"Consulta el changelog de Context Code para ver actualizaciones"}}export function createProjectOnboardingFeed(e){const t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${o.tick} `:""}${e}`})),r=c()===i()?"Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.":void 0;return r&&t.push({text:r}),{title:"Consejos para empezar",lines:t}}export function createGuestPassesFeed(){const o=m(),i=o?`Comparte Context Code y gana ${n(o)} de uso extra`:"Comparte Context Code con amigos";return{title:"3 pases de invitado",lines:[],customContent:{content:r(t,{children:[e(s,{marginY:1,children:e(a,{color:"claude",children:"[✻] [✻] [✻]"})}),e(a,{dimColor:!0,children:i})]}),width:48},footer:"/passes"}}
1
+ import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import o from"figures";import{homedir as i}from"os";import{Box as s,Text as a}from"../../ink.js";import{formatCreditAmount as n,getCachedReferrerReward as m}from"../../services/api/referral.js";import{getCwd as c}from"../../utils/cwd.js";import{formatRelativeTimeAgo as p}from"../../utils/format.js";import{translateReleaseNoteToSpanish as l}from"../../utils/releaseNoteTranslations.js";export function createRecentActivityFeed(e){const t=e.map(e=>{const t=p(e.modified);return{text:(e.summary&&"No prompt"!==e.summary?e.summary:e.firstPrompt)||"",timestamp:t}});return{title:"Actividad reciente",lines:t,footer:t.length>0?"/resume para ver más":void 0,emptyMessage:"Sin actividad reciente"}}export function createWhatsNewFeed(e){const t=e.map(e=>({text:l(e)}));return{title:"Novedades",lines:t,footer:t.length>0?"/release-notes para ver más":void 0,emptyMessage:"Consulta el changelog de Context Code para ver actualizaciones"}}export function createProjectOnboardingFeed(e){const t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${o.tick} `:""}${e}`})),r=c()===i()?"Nota: lanzaste Context en tu directorio home. Para una mejor experiencia, lánzalo en un directorio de proyecto.":void 0;return r&&t.push({text:r}),{title:"Consejos para empezar",lines:t}}export function createGuestPassesFeed(){const o=m(),i=o?`Comparte Context Code y gana ${n(o)} de uso extra`:"Comparte Context Code con amigos";return{title:"3 pases de invitado",lines:[],customContent:{content:r(t,{children:[e(s,{marginY:1,children:e(a,{color:"claude",children:"[✻] [✻] [✻]"})}),e(a,{dimColor:!0,children:i})]}),width:48},footer:"/passes"}}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as i from"react";import{Box as o,Text as l}from"../../ink.js";import{Select as r}from"../CustomSelect/select.js";import{PermissionDialog as c}from"../permissions/PermissionDialog.js";export function LspRecommendationMenu({pluginName:s,pluginDescription:t,fileExtension:d,onResponse:a}){const m=i.useRef(a);m.current=a,i.useEffect(()=>{const e=setTimeout(e=>e.current("no"),3e4,m);return()=>clearTimeout(e)},[]);const u=[{label:n(l,{children:["Yes, install ",e(l,{bold:!0,children:s})]}),value:"yes"},{label:"No, not now",value:"no"},{label:n(l,{children:["Never for ",e(l,{bold:!0,children:s})]}),value:"never"},{label:"Disable all LSP recommendations",value:"disable"}];return e(c,{title:"LSP Plugin Recommendation",children:n(o,{flexDirection:"column",paddingX:2,paddingY:1,children:[e(o,{marginBottom:1,children:e(l,{dimColor:!0,children:"LSP provides code intelligence like go-to-definition and error checking"})}),n(o,{children:[e(l,{dimColor:!0,children:"Plugin:"}),n(l,{children:[" ",s]})]}),t&&e(o,{children:e(l,{dimColor:!0,children:t})}),n(o,{children:[e(l,{dimColor:!0,children:"Triggered by:"}),n(l,{children:[" ",d," files"]})]}),e(o,{marginTop:1,children:e(l,{children:"Would you like to install this LSP plugin?"})}),e(o,{children:e(r,{options:u,onChange:function(e){switch(e){case"yes":a("yes");break;case"no":a("no");break;case"never":a("never");break;case"disable":a("disable")}},onCancel:()=>a("no")})})]})})}
1
+ import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as i from"react";import{Box as r,Text as o}from"../../ink.js";import{Select as l}from"../CustomSelect/select.js";import{PermissionDialog as s}from"../permissions/PermissionDialog.js";export function LspRecommendationMenu({pluginName:c,pluginDescription:t,fileExtension:a,onResponse:d}){const m=i.useRef(d);m.current=d,i.useEffect(()=>{const e=setTimeout(e=>e.current("no"),3e4,m);return()=>clearTimeout(e)},[]);const u=[{label:n(o,{children:["Yes, install ",e(o,{bold:!0,children:c})]}),value:"yes"},{label:"No, not now",value:"no"},{label:n(o,{children:["Never for ",e(o,{bold:!0,children:c})]}),value:"never"},{label:"Desactivar todas las recomendaciones LSP",value:"disable"}];return e(s,{title:"LSP Plugin Recommendation",children:n(r,{flexDirection:"column",paddingX:2,paddingY:1,children:[e(r,{marginBottom:1,children:e(o,{dimColor:!0,children:"LSP provides code intelligence like go-to-definition and error checking"})}),n(r,{children:[e(o,{dimColor:!0,children:"Plugin:"}),n(o,{children:[" ",c]})]}),t&&e(r,{children:e(o,{dimColor:!0,children:t})}),n(r,{children:[e(o,{dimColor:!0,children:"Triggered by:"}),n(o,{children:[" ",a," files"]})]}),e(r,{marginTop:1,children:e(o,{children:"¿Quieres instalar este plugin LSP?"})}),e(r,{children:e(l,{options:u,onChange:function(e){switch(e){case"yes":d("yes");break;case"no":d("no");break;case"never":d("never");break;case"disable":d("disable")}},onCancel:()=>d("no")})})]})})}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as s}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{logEvent as r}from"../services/analytics/index.js";import{getSettings_DEPRECATED as n,updateSettingsForSource as t}from"../utils/settings/settings.js";import{Select as l}from"./CustomSelect/index.js";import{Dialog as i}from"./design-system/Dialog.js";import{MCPServerDialogCopy as c}from"./MCPServerDialogCopy.js";export function MCPServerApprovalDialog(a){const m=o(13),{serverName:p,onDone:u}=a;let v;m[0]!==u||m[1]!==p?(v=function(e){r("tengu_mcp_dialog_choice",{choice:e});e:switch(e){case"yes":case"yes_all":{const s=(n()||{}).enabledMcpjsonServers||[];s.includes(p)||t("localSettings",{enabledMcpjsonServers:[...s,p]}),"yes_all"===e&&t("localSettings",{enableAllProjectMcpServers:!0}),u();break e}case"no":{const e=(n()||{}).disabledMcpjsonServers||[];e.includes(p)||t("localSettings",{disabledMcpjsonServers:[...e,p]}),u()}}},m[0]=u,m[1]=p,m[2]=v):v=m[2];const d=v,j=`New MCP server found in .mcp.json: ${p}`;let g,f,S,h,C;return m[3]!==d?(g=()=>d("no"),m[3]=d,m[4]=g):g=m[4],m[5]===Symbol.for("react.memo_cache_sentinel")?(f=e(c,{}),m[5]=f):f=m[5],m[6]===Symbol.for("react.memo_cache_sentinel")?(S=[{label:"Use this and all future MCP servers in this project",value:"yes_all"},{label:"Use this MCP server",value:"yes"},{label:"Continue without using this MCP server",value:"no"}],m[6]=S):S=m[6],m[7]!==d?(h=e(l,{options:S,onChange:e=>d(e),onCancel:()=>d("no")}),m[7]=d,m[8]=h):h=m[8],m[9]!==j||m[10]!==g||m[11]!==h?(C=s(i,{title:j,color:"warning",onCancel:g,children:[f,h]}),m[9]=j,m[10]=g,m[11]=h,m[12]=C):C=m[12],C}
1
+ import{jsx as e,jsxs as s}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{logEvent as r}from"../services/analytics/index.js";import{getSettings_DEPRECATED as n,updateSettingsForSource as t}from"../utils/settings/settings.js";import{Select as l}from"./CustomSelect/index.js";import{Dialog as a}from"./design-system/Dialog.js";import{MCPServerDialogCopy as i}from"./MCPServerDialogCopy.js";export function MCPServerApprovalDialog(c){const m=o(13),{serverName:p,onDone:d}=c;let u;m[0]!==d||m[1]!==p?(u=function(e){r("tengu_mcp_dialog_choice",{choice:e});e:switch(e){case"yes":case"yes_all":{const s=(n()||{}).enabledMcpjsonServers||[];s.includes(p)||t("localSettings",{enabledMcpjsonServers:[...s,p]}),"yes_all"===e&&t("localSettings",{enableAllProjectMcpServers:!0}),d();break e}case"no":{const e=(n()||{}).disabledMcpjsonServers||[];e.includes(p)||t("localSettings",{disabledMcpjsonServers:[...e,p]}),d()}}},m[0]=d,m[1]=p,m[2]=u):u=m[2];const v=u,j=`New MCP server found in .mcp.json: ${p}`;let f,g,S,y,C;return m[3]!==v?(f=()=>v("no"),m[3]=v,m[4]=f):f=m[4],m[5]===Symbol.for("react.memo_cache_sentinel")?(g=e(i,{}),m[5]=g):g=m[5],m[6]===Symbol.for("react.memo_cache_sentinel")?(S=[{label:"Usar este y todos los futuros servidores MCP en este proyecto",value:"yes_all"},{label:"Usar este servidor MCP",value:"yes"},{label:"Continuar sin usar este servidor MCP",value:"no"}],m[6]=S):S=m[6],m[7]!==v?(y=e(l,{options:S,onChange:e=>v(e),onCancel:()=>v("no")}),m[7]=v,m[8]=y):y=m[8],m[9]!==j||m[10]!==f||m[11]!==y?(C=s(a,{title:j,color:"warning",onCancel:f,children:[g,y]}),m[9]=j,m[10]=f,m[11]=y,m[12]=C):C=m[12],C}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{c as r}from"react/compiler-runtime";import{useEffect as s,useState as i}from"react";import{gracefulShutdown as n}from"../utils/gracefulShutdown.js";import{writeToStdout as c}from"../utils/process.js";import{Box as l,color as m,Text as a,useTheme as f}from"../ink.js";import{addMcpConfig as u,getAllMcpConfigs as d}from"../services/mcp/config.js";import{plural as p}from"../utils/stringUtils.js";import{ConfigurableShortcutHint as h}from"./ConfigurableShortcutHint.js";import{SelectMulti as g}from"./CustomSelect/SelectMulti.js";import{Byline as y}from"./design-system/Byline.js";import{Dialog as S}from"./design-system/Dialog.js";import{KeyboardShortcutHint as j}from"./design-system/KeyboardShortcutHint.js";export function MCPServerDesktopImportDialog(v){const b=r(36),{servers:C,scope:$,onDone:_}=v;let x;b[0]!==C?(x=Object.keys(C),b[0]=C,b[1]=x):x=b[1];const w=x;let k;b[2]===Symbol.for("react.memo_cache_sentinel")?(k={},b[2]=k):k=b[2];const[D,I]=i(k);let M,P,E;b[3]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{d().then(e=>{const{servers:t}=e;return I(t)})},P=[],b[3]=M,b[4]=P):(M=b[3],P=b[4]),s(M,P),b[5]!==D||b[6]!==w?(E=w.filter(e=>void 0!==D[e]),b[5]=D,b[6]=w,b[7]=E):E=b[7];const F=E,onSubmit=async function(e){let t=0;for(const o of e){const e=C[o];if(e){let r=o;if(void 0!==D[r]){let e=1;for(;void 0!==D[`${o}_${e}`];)e++;r=`${o}_${e}`}await u(r,e,$),t++}}B(t)},[H]=f();let N;b[8]!==_||b[9]!==$||b[10]!==H?(N=e=>{c(e>0?`\n${m("success",H)(`Successfully imported ${e} MCP ${p(e,"server")} to ${$} config.`)}\n`:"\nNo servers were imported."),_(),n()},b[8]=_,b[9]=$,b[10]=H,b[11]=N):N=b[11];const B=N;let G;b[12]!==B?(G=()=>{B(0)},b[12]=B,b[13]=G):G=b[13];const K=G,O=w.length;let U;b[14]!==w.length?(U=p(w.length,"server"),b[14]=w.length,b[15]=U):U=b[15];const V=`Found ${O} MCP ${U} in Claude Desktop.`;let X,q,z,A,J,L,Q,R;return b[16]!==F.length?(X=F.length>0&&e(a,{color:"warning",children:"Note: Some servers already exist with the same name. If selected, they will be imported with a numbered suffix."}),b[16]=F.length,b[17]=X):X=b[17],b[18]===Symbol.for("react.memo_cache_sentinel")?(q=e(a,{children:"Please select the servers you want to import:"}),b[18]=q):q=b[18],b[19]!==F||b[20]!==w?(z=w.map(e=>({label:`${e}${F.includes(e)?" (already exists)":""}`,value:e})),A=w.filter(e=>!F.includes(e)),b[19]=F,b[20]=w,b[21]=z,b[22]=A):(z=b[21],A=b[22]),b[23]!==K||b[24]!==onSubmit||b[25]!==z||b[26]!==A?(J=e(g,{options:z,defaultValue:A,onSubmit,onCancel:K,hideIndexes:!0}),b[23]=K,b[24]=onSubmit,b[25]=z,b[26]=A,b[27]=J):J=b[27],b[28]!==K||b[29]!==V||b[30]!==X||b[31]!==J?(L=t(S,{title:"Import MCP Servers from Claude Desktop",subtitle:V,color:"success",onCancel:K,hideInputGuide:!0,children:[X,q,J]}),b[28]=K,b[29]=V,b[30]=X,b[31]=J,b[32]=L):L=b[32],b[33]===Symbol.for("react.memo_cache_sentinel")?(Q=e(l,{paddingX:1,children:e(a,{dimColor:!0,italic:!0,children:t(y,{children:[e(j,{shortcut:"Space",action:"seleccionar"}),e(j,{shortcut:"Enter",action:"confirmar"}),e(h,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancelar"})]})})}),b[33]=Q):Q=b[33],b[34]!==L?(R=t(o,{children:[L,Q]}),b[34]=L,b[35]=R):R=b[35],R}
1
+ import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{c as r}from"react/compiler-runtime";import{useEffect as n,useState as s}from"react";import{gracefulShutdown as i}from"../utils/gracefulShutdown.js";import{writeToStdout as c}from"../utils/process.js";import{Box as l,color as m,Text as a,useTheme as f}from"../ink.js";import{addMcpConfig as u,getAllMcpConfigs as d}from"../services/mcp/config.js";import{plural as p}from"../utils/stringUtils.js";import{ConfigurableShortcutHint as h}from"./ConfigurableShortcutHint.js";import{SelectMulti as g}from"./CustomSelect/SelectMulti.js";import{Byline as S}from"./design-system/Byline.js";import{Dialog as j}from"./design-system/Dialog.js";import{KeyboardShortcutHint as v}from"./design-system/KeyboardShortcutHint.js";export function MCPServerDesktopImportDialog(y){const b=r(36),{servers:C,scope:$,onDone:x}=y;let _;b[0]!==C?(_=Object.keys(C),b[0]=C,b[1]=_):_=b[1];const k=_;let D;b[2]===Symbol.for("react.memo_cache_sentinel")?(D={},b[2]=D):D=b[2];const[M,w]=s(D);let I,P,q;b[3]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{d().then(e=>{const{servers:o}=e;return w(o)})},P=[],b[3]=I,b[4]=P):(I=b[3],P=b[4]),n(I,P),b[5]!==M||b[6]!==k?(q=k.filter(e=>void 0!==M[e]),b[5]=M,b[6]=k,b[7]=q):q=b[7];const E=q,onSubmit=async function(e){let o=0;for(const t of e){const e=C[t];if(e){let r=t;if(void 0!==M[r]){let e=1;for(;void 0!==M[`${t}_${e}`];)e++;r=`${t}_${e}`}await u(r,e,$),o++}}B(o)},[H]=f();let N;b[8]!==x||b[9]!==$||b[10]!==H?(N=e=>{c(e>0?`\n${m("success",H)(`Successfully imported ${e} MCP ${p(e,"server")} to ${$} config.`)}\n`:"\nNo servers were imported."),x(),i()},b[8]=x,b[9]=$,b[10]=H,b[11]=N):N=b[11];const B=N;let F;b[12]!==B?(F=()=>{B(0)},b[12]=B,b[13]=F):F=b[13];const G=F,K=k.length;let O;b[14]!==k.length?(O=p(k.length,"server"),b[14]=k.length,b[15]=O):O=b[15];const U=`Se encontraron ${K} ${O} MCP en Context Desktop.`;let V,X,z,A,J,L,Q,R;return b[16]!==E.length?(V=E.length>0&&e(a,{color:"warning",children:"Nota: algunos servidores ya existen con el mismo nombre. Si los seleccionas, se importarán con un sufijo numerado."}),b[16]=E.length,b[17]=V):V=b[17],b[18]===Symbol.for("react.memo_cache_sentinel")?(X=e(a,{children:"Selecciona los servidores que quieres importar:"}),b[18]=X):X=b[18],b[19]!==E||b[20]!==k?(z=k.map(e=>({label:`${e}${E.includes(e)?" (ya existe)":""}`,value:e})),A=k.filter(e=>!E.includes(e)),b[19]=E,b[20]=k,b[21]=z,b[22]=A):(z=b[21],A=b[22]),b[23]!==G||b[24]!==onSubmit||b[25]!==z||b[26]!==A?(J=e(g,{options:z,defaultValue:A,onSubmit,onCancel:G,hideIndexes:!0}),b[23]=G,b[24]=onSubmit,b[25]=z,b[26]=A,b[27]=J):J=b[27],b[28]!==G||b[29]!==U||b[30]!==V||b[31]!==J?(L=o(j,{title:"Importar servidores MCP desde Context Desktop",subtitle:U,color:"success",onCancel:G,hideInputGuide:!0,children:[V,X,J]}),b[28]=G,b[29]=U,b[30]=V,b[31]=J,b[32]=L):L=b[32],b[33]===Symbol.for("react.memo_cache_sentinel")?(Q=e(l,{paddingX:1,children:e(a,{dimColor:!0,italic:!0,children:o(S,{children:[e(v,{shortcut:"Space",action:"seleccionar"}),e(v,{shortcut:"Enter",action:"confirmar"}),e(h,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"cancelar"})]})})}),b[33]=Q):Q=b[33],b[34]!==L?(R=o(t,{children:[L,Q]}),b[34]=L,b[35]=R):R=b[35],R}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as n,Fragment as o}from"react/jsx-runtime";import{c as i}from"react/compiler-runtime";import{useExitOnCtrlCDWithKeybindings as t}from"../../hooks/useExitOnCtrlCDWithKeybindings.js";import{Box as r,Text as a}from"../../ink.js";import{useKeybinding as c}from"../../keybindings/useKeybinding.js";import{Select as s}from"../CustomSelect/index.js";import{PermissionDialog as l}from"../permissions/PermissionDialog.js";import{extractDangerousSettings as m,formatDangerousSettingsList as d}from"./utils.js";export function ManagedSettingsSecurityDialog(p){const g=i(26),{settings:u,onAccept:f,onReject:h}=p,y=m(u),x=d(y),b=t();let C,_;g[0]===Symbol.for("react.memo_cache_sentinel")?(C={context:"Confirmation"},g[0]=C):C=g[0],c("confirm:no",h,C),g[1]!==f||g[2]!==h?(_=function(e){"exit"!==e?f():h()},g[1]=f,g[2]=h,g[3]=_):_=g[3];const j=_,S=l,k=r;let v;g[4]===Symbol.for("react.memo_cache_sentinel")?(v=e(a,{children:"Your organization has configured managed settings that could allow execution of arbitrary code or interception of your prompts and responses."}),g[4]=v):v=g[4];const D=r;let N;g[5]===Symbol.for("react.memo_cache_sentinel")?(N=e(a,{dimColor:!0,children:"Settings requiring approval:"}),g[5]=N):N=g[5];const w=x.map(_temp);let E,q,z,I,K,M,O;return g[6]!==D||g[7]!==N||g[8]!==w?(E=n(D,{flexDirection:"column",children:[N,w]}),g[6]=D,g[7]=N,g[8]=w,g[9]=E):E=g[9],g[10]===Symbol.for("react.memo_cache_sentinel")?(q=e(a,{children:"Only accept if you trust your organization's IT administration and expect these settings to be configured."}),g[10]=q):q=g[10],g[11]===Symbol.for("react.memo_cache_sentinel")?(z=[{label:"Yes, I trust these settings",value:"accept"},{label:"No, exit Context Code",value:"exit"}],g[11]=z):z=g[11],g[12]!==j?(I=e(s,{options:z,onChange:e=>j(e),onCancel:()=>j("exit")}),g[12]=j,g[13]=I):I=g[13],g[14]!==b.keyName||g[15]!==b.pending?(K=e(a,{dimColor:!0,children:b.pending?n(o,{children:["Presiona ",b.keyName," de nuevo para salir"]}):e(o,{children:"Enter para confirmar · Esc para salir"})}),g[14]=b.keyName,g[15]=b.pending,g[16]=K):K=g[16],g[17]!==k||g[18]!==E||g[19]!==I||g[20]!==K||g[21]!==v?(M=n(k,{flexDirection:"column",gap:1,paddingTop:1,children:[v,E,q,I,K]}),g[17]=k,g[18]=E,g[19]=I,g[20]=K,g[21]=v,g[22]=M):M=g[22],g[23]!==S||g[24]!==M?(O=e(S,{color:"warning",titleColor:"warning",title:"Managed settings require approval",children:M}),g[23]=S,g[24]=M,g[25]=O):O=g[25],O}function _temp(o,i){return e(r,{paddingLeft:2,children:n(a,{children:[e(a,{dimColor:!0,children:"· "}),e(a,{children:o})]})},i)}
1
+ import{jsx as e,jsxs as n,Fragment as i}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{useExitOnCtrlCDWithKeybindings as r}from"../../hooks/useExitOnCtrlCDWithKeybindings.js";import{Box as t,Text as a}from"../../ink.js";import{useKeybinding as s}from"../../keybindings/useKeybinding.js";import{Select as c}from"../CustomSelect/index.js";import{PermissionDialog as l}from"../permissions/PermissionDialog.js";import{extractDangerousSettings as m,formatDangerousSettingsList as d}from"./utils.js";export function ManagedSettingsSecurityDialog(p){const u=o(26),{settings:g,onAccept:f,onReject:h}=p,j=m(g),x=d(j),y=r();let b,C;u[0]===Symbol.for("react.memo_cache_sentinel")?(b={context:"Confirmation"},u[0]=b):b=u[0],s("confirm:no",h,b),u[1]!==f||u[2]!==h?(C=function(e){"exit"!==e?f():h()},u[1]=f,u[2]=h,u[3]=C):C=u[3];const _=C,S=l,k=t;let q;u[4]===Symbol.for("react.memo_cache_sentinel")?(q=e(a,{children:"Tu organización ha configurado ajustes gestionados que podrían permitir la ejecución de código arbitrario o la interceptación de tus prompts y respuestas."}),u[4]=q):q=u[4];const D=t;let v;u[5]===Symbol.for("react.memo_cache_sentinel")?(v=e(a,{dimColor:!0,children:"Ajustes que requieren aprobación:"}),u[5]=v):v=u[5];const N=x.map(_temp);let A,E,T,w,z,I,K;return u[6]!==D||u[7]!==v||u[8]!==N?(A=n(D,{flexDirection:"column",children:[v,N]}),u[6]=D,u[7]=v,u[8]=N,u[9]=A):A=u[9],u[10]===Symbol.for("react.memo_cache_sentinel")?(E=e(a,{children:"Acepta solo si confías en la administración de TI de tu organización y esperas que estos ajustes estén configurados."}),u[10]=E):E=u[10],u[11]===Symbol.for("react.memo_cache_sentinel")?(T=[{label:"Yes, I trust these settings",value:"accept"},{label:"No, exit Context Code",value:"exit"}],u[11]=T):T=u[11],u[12]!==_?(w=e(c,{options:T,onChange:e=>_(e),onCancel:()=>_("exit")}),u[12]=_,u[13]=w):w=u[13],u[14]!==y.keyName||u[15]!==y.pending?(z=e(a,{dimColor:!0,children:y.pending?n(i,{children:["Presiona ",y.keyName," de nuevo para salir"]}):e(i,{children:"Enter para confirmar · Esc para salir"})}),u[14]=y.keyName,u[15]=y.pending,u[16]=z):z=u[16],u[17]!==k||u[18]!==A||u[19]!==w||u[20]!==z||u[21]!==q?(I=n(k,{flexDirection:"column",gap:1,paddingTop:1,children:[q,A,E,w,z]}),u[17]=k,u[18]=A,u[19]=w,u[20]=z,u[21]=q,u[22]=I):I=u[22],u[23]!==S||u[24]!==I?(K=e(S,{color:"warning",titleColor:"warning",title:"Managed settings require approval",children:I}),u[23]=S,u[24]=I,u[25]=K):K=u[25],K}function _temp(i,o){return e(t,{paddingLeft:2,children:n(a,{children:[e(a,{dimColor:!0,children:"· "}),e(a,{children:i})]})},o)}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{randomUUID as n}from"crypto";import r from"figures";import{useCallback as s,useEffect as l,useMemo as a,useState as c}from"react";import{logEvent as d}from"../services/analytics/index.js";import{useAppState as h}from"../state/AppState.js";import{fileHistoryCanRestore as f,fileHistoryEnabled as m,fileHistoryGetDiffStats as u}from"../utils/fileHistory.js";import{logError as g}from"../utils/log.js";import{useExitOnCtrlCDWithKeybindings as p}from"../hooks/useExitOnCtrlCDWithKeybindings.js";import{Box as y,Text as C}from"../ink.js";import{useKeybinding as b,useKeybindings as v}from"../keybindings/useKeybinding.js";import{stripDisplayTags as x}from"../utils/displayTags.js";import{createUserMessage as w,extractTag as S,isEmptyMessageText as _,isSyntheticMessage as R,isToolUseResultMessage as D}from"../utils/messages.js";import{Select as O}from"./CustomSelect/select.js";import{Spinner as M}from"./Spinner.js";function isTextBlock(e){return"text"===e.type}import*as j from"path";import{useTerminalSize as $}from"../hooks/useTerminalSize.js";import{BASH_STDERR_TAG as k,BASH_STDOUT_TAG as z,COMMAND_MESSAGE_TAG as T,LOCAL_COMMAND_STDERR_TAG as F,LOCAL_COMMAND_STDOUT_TAG as A,TASK_NOTIFICATION_TAG as P,TEAMMATE_MESSAGE_TAG as W,TICK_TAG as B}from"../constants/xml.js";import{count as U}from"../utils/array.js";import{formatRelativeTimeAgo as E,truncate as N}from"../utils/format.js";import{Divider as V}from"./design-system/Divider.js";function isSummarizeOption(e){return"summarize"===e||"summarize_up_to"===e}export function MessageSelector({messages:o,onPreRestore:x,onRestoreMessage:S,onRestoreCode:_,onSummarize:R,onClose:$,preselectedMessage:k}){const z=h(e=>e.fileHistory),[T,F]=c(void 0),A=m(),P=a(n,[]),W=a(()=>[...o.filter(selectableUserMessagesFilter),{...w({content:""}),uuid:P}],[o,P]),[B,N]=c(W.length-1),L=Math.max(0,Math.min(B-Math.floor(3.5),W.length-7)),I=W.length>1,[H,K]=c(k),[q,X]=c(void 0);l(()=>{if(!k||!A)return;let e=!1;return u(z,k.uuid).then(t=>{e||X(t)}),()=>{e=!0}},[k,A,z]);const[G,J]=c(!1),[Q,Y]=c(null),[Z,ee]=c("both"),[te,ie]=c(""),[oe,ne]=c("");async function handleSelect(e){const t=o.indexOf(e),i=o.length-1-t;if(d("tengu_message_selector_selected",{index_from_end:i,message_type:e.type,is_current_prompt:!1}),!o.includes(e))return void $();if(!A)return void await async function(e){x(),J(!0);try{await S(e),J(!1),$()}catch(e){g(e),J(!1),F(`Failed to restore the conversation:\n${e}`)}}(e);const n=await u(z,e.uuid);K(e),X(n)}l(()=>{d("tengu_message_selector_opened",{})},[]);const re=p(),se=s(()=>{!H||k?(d("tengu_message_selector_cancelled",{}),$()):K(void 0)},[$,H,k]),le=s(()=>N(e=>Math.max(0,e-1)),[]),ae=s(()=>N(e=>Math.min(W.length-1,e+1)),[W.length]),ce=s(()=>N(0),[]),de=s(()=>N(W.length-1),[W.length]),he=s(()=>{const e=W[B];e&&handleSelect(e)},[W,B,handleSelect]);b("confirm:no",se,{context:"Confirmation",isActive:!H}),v({"messageSelector:up":le,"messageSelector:down":ae,"messageSelector:top":ce,"messageSelector:bottom":de,"messageSelector:select":he},{context:"MessageSelector",isActive:!G&&!T&&!H&&I});const[fe,me]=c({});l(()=>{!async function(){A&&Promise.all(W.map(async(e,t)=>{if(e.uuid!==P){const i=f(z,e.uuid),n=W.at(t+1),r=i?function(e,t,i){const o=e.findIndex(e=>e.uuid===t);if(-1===o)return;let n=i?e.findIndex(e=>e.uuid===i):e.length;-1===n&&(n=e.length);const r=[];let s=0,l=0;for(let t=o+1;t<n;t++){const i=e[t];if(!i||!D(i))continue;const o=i.toolUseResult;if(o&&o.filePath&&o.structuredPatch){r.includes(o.filePath)||r.push(o.filePath);try{if("type"in o&&"create"===o.type)s+=o.content.split(/\r?\n/).length;else for(const e of o.structuredPatch){const t=U(e.lines,e=>e.startsWith("+")),i=U(e.lines,e=>e.startsWith("-"));s+=t,l+=i}}catch{continue}}}return{filesChanged:r,insertions:s,deletions:l}}(o,e.uuid,n?.uuid!==P?n?.uuid:void 0):void 0;me(void 0!==r?e=>({...e,[t]:r}):e=>({...e,[t]:void 0}))}}))}()},[W,o,P,z,A]);const ue=A&&q?.filesChanged&&q.filesChanged.length>0,ge=!T&&!H&&!k&&I;return t(y,{flexDirection:"column",width:"100%",children:[e(V,{color:"suggestion"}),t(y,{flexDirection:"column",marginX:1,gap:1,children:[e(C,{bold:!0,color:"suggestion",children:"Rewind"}),T&&e(i,{children:t(C,{color:"error",children:["Error: ",T]})}),!I&&e(i,{children:e(C,{children:"Nothing to rewind to yet."})}),!T&&H&&I&&t(i,{children:[t(C,{children:["Confirm you want to restore"," ",!q&&"the conversation ","to the point before you sent this message:"]}),t(y,{flexDirection:"column",paddingLeft:1,borderStyle:"single",borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[e(UserMessageOption,{userMessage:H,color:"text",isCurrent:!1}),t(C,{dimColor:!0,children:["(",E(new Date(H.timestamp)),")"]})]}),e(RestoreOptionDescription,{selectedRestoreOption:Z,canRestoreCode:!!ue,diffStatsForRestore:q}),G&&isSummarizeOption(Q)?t(y,{flexDirection:"row",gap:1,children:[e(M,{}),e(C,{children:"Summarizing…"})]}):e(O,{isDisabled:G,options:function(e){const t=e?[{value:"both",label:"Restore code and conversation"},{value:"conversation",label:"Restore conversation"},{value:"code",label:"Restore code"}]:[{value:"conversation",label:"Restore conversation"}],i={type:"input",placeholder:"add context (optional)",initialValue:"",allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:": "};return t.push({value:"summarize",label:"Summarize from here",...i,onChange:ie}),t.push({value:"nevermind",label:"Never mind"}),t}(!!ue),defaultFocusValue:ue?"both":"conversation",onFocus:e=>ee(e),onChange:e=>async function(e){if(d("tengu_message_selector_restore_option_selected",{option:e}),!H)return void F("Message not found.");if("nevermind"===e)return void(k?$():K(void 0));if(isSummarizeOption(e)){x(),J(!0),Y(e),F(void 0);try{const t="summarize_up_to"===e?"up_to":"from",i=("up_to"===t?oe:te).trim()||void 0;await R(H,i,t),J(!1),Y(null),K(void 0),$()}catch(e){g(e),J(!1),Y(null),K(void 0),F(`Failed to summarize:\n${e}`)}return}x(),J(!0),F(void 0);let t=null,i=null;if("code"===e||"both"===e)try{await _(H)}catch(e){t=e,g(t)}if("conversation"===e||"both"===e)try{await S(H)}catch(e){i=e,g(i)}J(!1),K(void 0),i&&t?F(`Failed to restore the conversation and code:\n${i}\n${t}`):i?F(`Failed to restore the conversation:\n${i}`):t?F(`Failed to restore the code:\n${t}`):$()}(e),onCancel:()=>k?$():K(void 0)}),ue&&e(y,{marginBottom:1,children:t(C,{dimColor:!0,children:[r.warning," Rewinding does not affect files edited manually or via bash."]})})]}),ge&&t(i,{children:[e(C,A?{children:"Restore the code and/or conversation to the point before…"}:{children:"Restore and fork the conversation to the point before…"}),e(y,{width:"100%",flexDirection:"column",children:W.slice(L,L+7).map((o,n)=>{const s=L+n,l=s===B,a=o.uuid===P,c=s in fe,d=fe[s],h=d?.filesChanged&&d.filesChanged.length;return t(y,{height:A?3:2,overflow:"hidden",width:"100%",flexDirection:"row",children:[e(y,{width:2,minWidth:2,children:l?t(C,{color:"permission",bold:!0,children:[r.pointer," "]}):e(C,{children:" "})}),t(y,{flexDirection:"column",children:[e(y,{flexShrink:1,height:1,overflow:"hidden",children:e(UserMessageOption,{userMessage:o,color:l?"suggestion":void 0,isCurrent:a,paddingRight:10})}),A&&c&&e(y,{height:1,flexDirection:"row",children:d?e(i,{children:e(C,{dimColor:!l,color:"inactive",children:h?t(i,{children:[1===h&&d.filesChanged[0]?`${j.basename(d.filesChanged[0])} `:`${h} files changed `,e(DiffStatsText,{diffStats:d})]}):e(i,{children:"No code changes"})})}):t(C,{dimColor:!0,color:"warning",children:[r.warning," No code restore"]})})]})]},o.uuid)})})]}),!H&&e(C,{dimColor:!0,italic:!0,children:re.pending?t(i,{children:["Presiona ",re.keyName," de nuevo para salir"]}):t(i,{children:[!T&&I&&"Enter para continuar · ","Esc para salir"]})})]})]})}function RestoreOptionDescription(i){const n=o(11),{selectedRestoreOption:r,canRestoreCode:s,diffStatsForRestore:l}=i,a=s&&("both"===r||"code"===r);let c,d,h,f;return n[0]!==r?(c=function(e){switch(e){case"summarize":return"Messages after this point will be summarized.";case"summarize_up_to":return"Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.";case"both":case"conversation":return"The conversation will be forked.";case"code":case"nevermind":return"The conversation will be unchanged."}}(r),n[0]=r,n[1]=c):c=n[1],n[2]!==c?(d=e(C,{dimColor:!0,children:c}),n[2]=c,n[3]=d):d=n[3],n[4]!==l||n[5]!==r||n[6]!==a?(h=!isSummarizeOption(r)&&(a?e(RestoreCodeConfirmation,{diffStatsForRestore:l}):e(C,{dimColor:!0,children:"The code will be unchanged."})),n[4]=l,n[5]=r,n[6]=a,n[7]=h):h=n[7],n[8]!==d||n[9]!==h?(f=t(y,{flexDirection:"column",children:[d,h]}),n[8]=d,n[9]=h,n[10]=f):f=n[10],f}function RestoreCodeConfirmation(n){const r=o(14),{diffStatsForRestore:s}=n;if(void 0===s)return;if(!s.filesChanged||!s.filesChanged[0]){let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(C,{dimColor:!0,children:"The code has not changed (nothing will be restored)."}),r[0]=t):t=r[0],t}const l=s.filesChanged.length;let a,c,d;if(1===l){let e;r[1]!==s.filesChanged[0]?(e=j.basename(s.filesChanged[0]||""),r[1]=s.filesChanged[0],r[2]=e):e=r[2],a=e}else if(2===l){let e;r[3]!==s.filesChanged[0]?(e=j.basename(s.filesChanged[0]||""),r[3]=s.filesChanged[0],r[4]=e):e=r[4];const t=e;let i;r[5]!==s.filesChanged[1]?(i=j.basename(s.filesChanged[1]||""),r[5]=s.filesChanged[1],r[6]=i):i=r[6];a=`${t} and ${i}`}else{let e;r[7]!==s.filesChanged[0]?(e=j.basename(s.filesChanged[0]||""),r[7]=s.filesChanged[0],r[8]=e):e=r[8];a=`${e} and ${s.filesChanged.length-1} other files`}return r[9]!==s?(c=e(DiffStatsText,{diffStats:s}),r[9]=s,r[10]=c):c=r[10],r[11]!==a||r[12]!==c?(d=e(i,{children:t(C,{dimColor:!0,children:["The code will be restored"," ",c," in ",a,"."]})}),r[11]=a,r[12]=c,r[13]=d):d=r[13],d}function DiffStatsText(e){const n=o(7),{diffStats:r}=e;if(!r||!r.filesChanged)return;let s,l,a;return n[0]!==r.insertions?(s=t(C,{color:"diffAddedWord",children:["+",r.insertions," "]}),n[0]=r.insertions,n[1]=s):s=n[1],n[2]!==r.deletions?(l=t(C,{color:"diffRemovedWord",children:["-",r.deletions]}),n[2]=r.deletions,n[3]=l):l=n[3],n[4]!==s||n[5]!==l?(a=t(i,{children:[s,l]}),n[4]=s,n[5]=l,n[6]=a):a=n[6],a}function UserMessageOption(i){const n=o(31),{userMessage:r,color:s,dimColor:l,isCurrent:a,paddingRight:c}=i,{columns:d}=$();if(a){let t;return n[0]!==s||n[1]!==l?(t=e(y,{width:"100%",children:e(C,{italic:!0,color:s,dimColor:l,children:"(current)"})}),n[0]=s,n[1]=l,n[2]=t):t=n[2],t}const h=r.message.content,f="string"==typeof h?null:h[h.length-1];let m,u,g,p,b,v,w,R,D,O;if(n[3]!==s||n[4]!==d||n[5]!==h||n[6]!==l||n[7]!==f||n[8]!==c){R=Symbol.for("react.early_return_sentinel");e:{const i="string"==typeof h?h.trim():f&&isTextBlock(f)?f.text.trim():"(no prompt)",o=x(i);if(_(o)){let t;n[17]!==s||n[18]!==l?(t=e(y,{flexDirection:"row",width:"100%",children:e(C,{italic:!0,color:s,dimColor:l,children:"((empty message))"})}),n[17]=s,n[18]=l,n[19]=t):t=n[19],R=t;break e}if(o.includes("<bash-input>")){const i=S(o,"bash-input");if(i){let o;n[20]===Symbol.for("react.memo_cache_sentinel")?(o=e(C,{color:"bashBorder",children:"!"}),n[20]=o):o=n[20],R=t(y,{flexDirection:"row",width:"100%",children:[o,t(C,{color:s,dimColor:l,children:[" ",i]})]});break e}}if(o.includes(`<${T}>`)){const i=S(o,T),n=S(o,"command-args"),r="true"===S(o,"skill-format");if(i){if(r){R=e(y,{flexDirection:"row",width:"100%",children:t(C,{color:s,dimColor:l,children:["Skill(",i,")"]})});break e}R=e(y,{flexDirection:"row",width:"100%",children:t(C,{color:s,dimColor:l,children:["/",i," ",n]})});break e}}u=y,v="row",w="100%",m=C,g=s,p=l,b=c?N(o,d-c,!0):o.slice(0,500).split("\n").slice(0,4).join("\n")}n[3]=s,n[4]=d,n[5]=h,n[6]=l,n[7]=f,n[8]=c,n[9]=m,n[10]=u,n[11]=g,n[12]=p,n[13]=b,n[14]=v,n[15]=w,n[16]=R}else m=n[9],u=n[10],g=n[11],p=n[12],b=n[13],v=n[14],w=n[15],R=n[16];return R!==Symbol.for("react.early_return_sentinel")?R:(n[21]!==m||n[22]!==g||n[23]!==p||n[24]!==b?(D=e(m,{color:g,dimColor:p,children:b}),n[21]=m,n[22]=g,n[23]=p,n[24]=b,n[25]=D):D=n[25],n[26]!==u||n[27]!==v||n[28]!==w||n[29]!==D?(O=e(u,{flexDirection:v,width:w,children:D}),n[26]=u,n[27]=v,n[28]=w,n[29]=D,n[30]=O):O=n[30],O)}export function selectableUserMessagesFilter(e){if("user"!==e.type)return!1;if(Array.isArray(e.message.content)&&"tool_result"===e.message.content[0]?.type)return!1;if(R(e))return!1;if(e.isMeta)return!1;if(e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;const t=e.message.content,i="string"==typeof t?null:t[t.length-1],o="string"==typeof t?t.trim():i&&isTextBlock(i)?i.text.trim():"";return-1===o.indexOf(`<${A}>`)&&-1===o.indexOf(`<${F}>`)&&-1===o.indexOf(`<${z}>`)&&-1===o.indexOf(`<${k}>`)&&-1===o.indexOf(`<${P}>`)&&-1===o.indexOf(`<${B}>`)&&-1===o.indexOf(`<${W}`)}export function messagesAfterAreOnlySynthetic(e,t){for(let i=t+1;i<e.length;i++){const t=e[i];if(t&&(!R(t)&&!(D(t)||"progress"===t.type||"system"===t.type||"attachment"===t.type||"user"===t.type&&t.isMeta))){if("assistant"===t.type){const e=t.message.content;if(Array.isArray(e)){if(e.some(e=>"text"===e.type&&e.text.trim()||"tool_use"===e.type))return!1}continue}if("user"===t.type)return!1}}return!0}
1
+ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{c as n}from"react/compiler-runtime";import{randomUUID as r}from"crypto";import o from"figures";import{useCallback as s,useEffect as l,useMemo as a,useState as c}from"react";import{logEvent as d}from"../services/analytics/index.js";import{useAppState as u}from"../state/AppState.js";import{fileHistoryCanRestore as f,fileHistoryEnabled as m,fileHistoryGetDiffStats as h}from"../utils/fileHistory.js";import{logError as g}from"../utils/log.js";import{useExitOnCtrlCDWithKeybindings as p}from"../hooks/useExitOnCtrlCDWithKeybindings.js";import{Box as y,Text as C}from"../ink.js";import{useKeybinding as b,useKeybindings as v}from"../keybindings/useKeybinding.js";import{stripDisplayTags as x}from"../utils/displayTags.js";import{createUserMessage as w,extractTag as S,isEmptyMessageText as _,isSyntheticMessage as R,isToolUseResultMessage as D}from"../utils/messages.js";import{Select as O}from"./CustomSelect/select.js";import{Spinner as j}from"./Spinner.js";function isTextBlock(e){return"text"===e.type}import*as M from"path";import{useTerminalSize as $}from"../hooks/useTerminalSize.js";import{BASH_STDERR_TAG as k,BASH_STDOUT_TAG as z,COMMAND_MESSAGE_TAG as F,LOCAL_COMMAND_STDERR_TAG as T,LOCAL_COMMAND_STDOUT_TAG as A,TASK_NOTIFICATION_TAG as P,TEAMMATE_MESSAGE_TAG as E,TICK_TAG as W}from"../constants/xml.js";import{count as B}from"../utils/array.js";import{formatRelativeTimeAgo as U,truncate as q}from"../utils/format.js";import{Divider as V}from"./design-system/Divider.js";function isSummarizeOption(e){return"summarize"===e||"summarize_up_to"===e}export function MessageSelector({messages:n,onPreRestore:x,onRestoreMessage:S,onRestoreCode:_,onSummarize:R,onClose:$,preselectedMessage:k}){const z=u(e=>e.fileHistory),[F,T]=c(void 0),A=m(),P=a(r,[]),E=a(()=>[...n.filter(selectableUserMessagesFilter),{...w({content:""}),uuid:P}],[n,P]),[W,q]=c(E.length-1),L=Math.max(0,Math.min(W-Math.floor(3.5),E.length-7)),I=E.length>1,[N,H]=c(k),[K,X]=c(void 0);l(()=>{if(!k||!A)return;let e=!1;return h(z,k.uuid).then(t=>{e||X(t)}),()=>{e=!0}},[k,A,z]);const[G,J]=c(!1),[Q,Y]=c(null),[Z,ee]=c("both"),[te,ie]=c(""),[ne,re]=c("");async function handleSelect(e){const t=n.indexOf(e),i=n.length-1-t;if(d("tengu_message_selector_selected",{index_from_end:i,message_type:e.type,is_current_prompt:!1}),!n.includes(e))return void $();if(!A)return void await async function(e){x(),J(!0);try{await S(e),J(!1),$()}catch(e){g(e),J(!1),T(`Failed to restore the conversation:\n${e}`)}}(e);const r=await h(z,e.uuid);H(e),X(r)}l(()=>{d("tengu_message_selector_opened",{})},[]);const oe=p(),se=s(()=>{!N||k?(d("tengu_message_selector_cancelled",{}),$()):H(void 0)},[$,N,k]),le=s(()=>q(e=>Math.max(0,e-1)),[]),ae=s(()=>q(e=>Math.min(E.length-1,e+1)),[E.length]),ce=s(()=>q(0),[]),de=s(()=>q(E.length-1),[E.length]),ue=s(()=>{const e=E[W];e&&handleSelect(e)},[E,W,handleSelect]);b("confirm:no",se,{context:"Confirmation",isActive:!N}),v({"messageSelector:up":le,"messageSelector:down":ae,"messageSelector:top":ce,"messageSelector:bottom":de,"messageSelector:select":ue},{context:"MessageSelector",isActive:!G&&!F&&!N&&I});const[fe,me]=c({});l(()=>{!async function(){A&&Promise.all(E.map(async(e,t)=>{if(e.uuid!==P){const i=f(z,e.uuid),r=E.at(t+1),o=i?function(e,t,i){const n=e.findIndex(e=>e.uuid===t);if(-1===n)return;let r=i?e.findIndex(e=>e.uuid===i):e.length;-1===r&&(r=e.length);const o=[];let s=0,l=0;for(let t=n+1;t<r;t++){const i=e[t];if(!i||!D(i))continue;const n=i.toolUseResult;if(n&&n.filePath&&n.structuredPatch){o.includes(n.filePath)||o.push(n.filePath);try{if("type"in n&&"create"===n.type)s+=n.content.split(/\r?\n/).length;else for(const e of n.structuredPatch){const t=B(e.lines,e=>e.startsWith("+")),i=B(e.lines,e=>e.startsWith("-"));s+=t,l+=i}}catch{continue}}}return{filesChanged:o,insertions:s,deletions:l}}(n,e.uuid,r?.uuid!==P?r?.uuid:void 0):void 0;me(void 0!==o?e=>({...e,[t]:o}):e=>({...e,[t]:void 0}))}}))}()},[E,n,P,z,A]);const he=A&&K?.filesChanged&&K.filesChanged.length>0,ge=!F&&!N&&!k&&I;return t(y,{flexDirection:"column",width:"100%",children:[e(V,{color:"suggestion"}),t(y,{flexDirection:"column",marginX:1,gap:1,children:[e(C,{bold:!0,color:"suggestion",children:"Rewind"}),F&&e(i,{children:t(C,{color:"error",children:["Error: ",F]})}),!I&&e(i,{children:e(C,{children:"Aún no hay nada a lo que rebobinar."})}),!F&&N&&I&&t(i,{children:[t(C,{children:["Confirma que quieres restaurar"," ",!K&&"la conversación ","al punto anterior a enviar este mensaje:"]}),t(y,{flexDirection:"column",paddingLeft:1,borderStyle:"single",borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[e(UserMessageOption,{userMessage:N,color:"text",isCurrent:!1}),t(C,{dimColor:!0,children:["(",U(new Date(N.timestamp)),")"]})]}),e(RestoreOptionDescription,{selectedRestoreOption:Z,canRestoreCode:!!he,diffStatsForRestore:K}),G&&isSummarizeOption(Q)?t(y,{flexDirection:"row",gap:1,children:[e(j,{}),e(C,{children:"Summarizing…"})]}):e(O,{isDisabled:G,options:function(e){const t=e?[{value:"both",label:"Restaurar código y conversación"},{value:"conversation",label:"Restaurar conversación"},{value:"code",label:"Restaurar código"}]:[{value:"conversation",label:"Restaurar conversación"}],i={type:"input",placeholder:"añadir contexto (opcional)",initialValue:"",allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:": "};return t.push({value:"summarize",label:"Resumir desde aquí",...i,onChange:ie}),t.push({value:"nevermind",label:"Cancelar"}),t}(!!he),defaultFocusValue:he?"both":"conversation",onFocus:e=>ee(e),onChange:e=>async function(e){if(d("tengu_message_selector_restore_option_selected",{option:e}),!N)return void T("Message not found.");if("nevermind"===e)return void(k?$():H(void 0));if(isSummarizeOption(e)){x(),J(!0),Y(e),T(void 0);try{const t="summarize_up_to"===e?"up_to":"from",i=("up_to"===t?ne:te).trim()||void 0;await R(N,i,t),J(!1),Y(null),H(void 0),$()}catch(e){g(e),J(!1),Y(null),H(void 0),T(`Failed to summarize:\n${e}`)}return}x(),J(!0),T(void 0);let t=null,i=null;if("code"===e||"both"===e)try{await _(N)}catch(e){t=e,g(t)}if("conversation"===e||"both"===e)try{await S(N)}catch(e){i=e,g(i)}J(!1),H(void 0),i&&t?T(`Failed to restore the conversation and code:\n${i}\n${t}`):i?T(`Failed to restore the conversation:\n${i}`):t?T(`Failed to restore the code:\n${t}`):$()}(e),onCancel:()=>k?$():H(void 0)}),he&&e(y,{marginBottom:1,children:t(C,{dimColor:!0,children:[o.warning," Rewinding does not affect files edited manually or via bash."]})})]}),ge&&t(i,{children:[e(C,A?{children:"Restore the code and/or conversation to the point before…"}:{children:"Restore and fork the conversation to the point before…"}),e(y,{width:"100%",flexDirection:"column",children:E.slice(L,L+7).map((n,r)=>{const s=L+r,l=s===W,a=n.uuid===P,c=s in fe,d=fe[s],u=d?.filesChanged&&d.filesChanged.length;return t(y,{height:A?3:2,overflow:"hidden",width:"100%",flexDirection:"row",children:[e(y,{width:2,minWidth:2,children:l?t(C,{color:"permission",bold:!0,children:[o.pointer," "]}):e(C,{children:" "})}),t(y,{flexDirection:"column",children:[e(y,{flexShrink:1,height:1,overflow:"hidden",children:e(UserMessageOption,{userMessage:n,color:l?"suggestion":void 0,isCurrent:a,paddingRight:10})}),A&&c&&e(y,{height:1,flexDirection:"row",children:d?e(i,{children:e(C,{dimColor:!l,color:"inactive",children:u?t(i,{children:[1===u&&d.filesChanged[0]?`${M.basename(d.filesChanged[0])} `:`${u} files changed `,e(DiffStatsText,{diffStats:d})]}):e(i,{children:"No code changes"})})}):t(C,{dimColor:!0,color:"warning",children:[o.warning," No code restore"]})})]})]},n.uuid)})})]}),!N&&e(C,{dimColor:!0,italic:!0,children:oe.pending?t(i,{children:["Presiona ",oe.keyName," de nuevo para salir"]}):t(i,{children:[!F&&I&&"Enter para continuar · ","Esc para salir"]})})]})]})}function RestoreOptionDescription(i){const r=n(11),{selectedRestoreOption:o,canRestoreCode:s,diffStatsForRestore:l}=i,a=s&&("both"===o||"code"===o);let c,d,u,f;return r[0]!==o?(c=function(e){switch(e){case"summarize":return"Messages after this point will be summarized.";case"summarize_up_to":return"Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.";case"both":case"conversation":return"The conversation will be forked.";case"code":case"nevermind":return"The conversation will be unchanged."}}(o),r[0]=o,r[1]=c):c=r[1],r[2]!==c?(d=e(C,{dimColor:!0,children:c}),r[2]=c,r[3]=d):d=r[3],r[4]!==l||r[5]!==o||r[6]!==a?(u=!isSummarizeOption(o)&&(a?e(RestoreCodeConfirmation,{diffStatsForRestore:l}):e(C,{dimColor:!0,children:"El código no se modificará."})),r[4]=l,r[5]=o,r[6]=a,r[7]=u):u=r[7],r[8]!==d||r[9]!==u?(f=t(y,{flexDirection:"column",children:[d,u]}),r[8]=d,r[9]=u,r[10]=f):f=r[10],f}function RestoreCodeConfirmation(r){const o=n(14),{diffStatsForRestore:s}=r;if(void 0===s)return;if(!s.filesChanged||!s.filesChanged[0]){let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(C,{dimColor:!0,children:"El código no ha cambiado (no se restaurará nada)."}),o[0]=t):t=o[0],t}const l=s.filesChanged.length;let a,c,d;if(1===l){let e;o[1]!==s.filesChanged[0]?(e=M.basename(s.filesChanged[0]||""),o[1]=s.filesChanged[0],o[2]=e):e=o[2],a=e}else if(2===l){let e;o[3]!==s.filesChanged[0]?(e=M.basename(s.filesChanged[0]||""),o[3]=s.filesChanged[0],o[4]=e):e=o[4];const t=e;let i;o[5]!==s.filesChanged[1]?(i=M.basename(s.filesChanged[1]||""),o[5]=s.filesChanged[1],o[6]=i):i=o[6];a=`${t} and ${i}`}else{let e;o[7]!==s.filesChanged[0]?(e=M.basename(s.filesChanged[0]||""),o[7]=s.filesChanged[0],o[8]=e):e=o[8];a=`${e} and ${s.filesChanged.length-1} other files`}return o[9]!==s?(c=e(DiffStatsText,{diffStats:s}),o[9]=s,o[10]=c):c=o[10],o[11]!==a||o[12]!==c?(d=e(i,{children:t(C,{dimColor:!0,children:["El código se restaurará"," ",c," en ",a,"."]})}),o[11]=a,o[12]=c,o[13]=d):d=o[13],d}function DiffStatsText(e){const r=n(7),{diffStats:o}=e;if(!o||!o.filesChanged)return;let s,l,a;return r[0]!==o.insertions?(s=t(C,{color:"diffAddedWord",children:["+",o.insertions," "]}),r[0]=o.insertions,r[1]=s):s=r[1],r[2]!==o.deletions?(l=t(C,{color:"diffRemovedWord",children:["-",o.deletions]}),r[2]=o.deletions,r[3]=l):l=r[3],r[4]!==s||r[5]!==l?(a=t(i,{children:[s,l]}),r[4]=s,r[5]=l,r[6]=a):a=r[6],a}function UserMessageOption(i){const r=n(31),{userMessage:o,color:s,dimColor:l,isCurrent:a,paddingRight:c}=i,{columns:d}=$();if(a){let t;return r[0]!==s||r[1]!==l?(t=e(y,{width:"100%",children:e(C,{italic:!0,color:s,dimColor:l,children:"(current)"})}),r[0]=s,r[1]=l,r[2]=t):t=r[2],t}const u=o.message.content,f="string"==typeof u?null:u[u.length-1];let m,h,g,p,b,v,w,R,D,O;if(r[3]!==s||r[4]!==d||r[5]!==u||r[6]!==l||r[7]!==f||r[8]!==c){R=Symbol.for("react.early_return_sentinel");e:{const i="string"==typeof u?u.trim():f&&isTextBlock(f)?f.text.trim():"(no prompt)",n=x(i);if(_(n)){let t;r[17]!==s||r[18]!==l?(t=e(y,{flexDirection:"row",width:"100%",children:e(C,{italic:!0,color:s,dimColor:l,children:"((empty message))"})}),r[17]=s,r[18]=l,r[19]=t):t=r[19],R=t;break e}if(n.includes("<bash-input>")){const i=S(n,"bash-input");if(i){let n;r[20]===Symbol.for("react.memo_cache_sentinel")?(n=e(C,{color:"bashBorder",children:"!"}),r[20]=n):n=r[20],R=t(y,{flexDirection:"row",width:"100%",children:[n,t(C,{color:s,dimColor:l,children:[" ",i]})]});break e}}if(n.includes(`<${F}>`)){const i=S(n,F),r=S(n,"command-args"),o="true"===S(n,"skill-format");if(i){if(o){R=e(y,{flexDirection:"row",width:"100%",children:t(C,{color:s,dimColor:l,children:["Skill(",i,")"]})});break e}R=e(y,{flexDirection:"row",width:"100%",children:t(C,{color:s,dimColor:l,children:["/",i," ",r]})});break e}}h=y,v="row",w="100%",m=C,g=s,p=l,b=c?q(n,d-c,!0):n.slice(0,500).split("\n").slice(0,4).join("\n")}r[3]=s,r[4]=d,r[5]=u,r[6]=l,r[7]=f,r[8]=c,r[9]=m,r[10]=h,r[11]=g,r[12]=p,r[13]=b,r[14]=v,r[15]=w,r[16]=R}else m=r[9],h=r[10],g=r[11],p=r[12],b=r[13],v=r[14],w=r[15],R=r[16];return R!==Symbol.for("react.early_return_sentinel")?R:(r[21]!==m||r[22]!==g||r[23]!==p||r[24]!==b?(D=e(m,{color:g,dimColor:p,children:b}),r[21]=m,r[22]=g,r[23]=p,r[24]=b,r[25]=D):D=r[25],r[26]!==h||r[27]!==v||r[28]!==w||r[29]!==D?(O=e(h,{flexDirection:v,width:w,children:D}),r[26]=h,r[27]=v,r[28]=w,r[29]=D,r[30]=O):O=r[30],O)}export function selectableUserMessagesFilter(e){if("user"!==e.type)return!1;if(Array.isArray(e.message.content)&&"tool_result"===e.message.content[0]?.type)return!1;if(R(e))return!1;if(e.isMeta)return!1;if(e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;const t=e.message.content,i="string"==typeof t?null:t[t.length-1],n="string"==typeof t?t.trim():i&&isTextBlock(i)?i.text.trim():"";return-1===n.indexOf(`<${A}>`)&&-1===n.indexOf(`<${T}>`)&&-1===n.indexOf(`<${z}>`)&&-1===n.indexOf(`<${k}>`)&&-1===n.indexOf(`<${P}>`)&&-1===n.indexOf(`<${W}>`)&&-1===n.indexOf(`<${E}`)}export function messagesAfterAreOnlySynthetic(e,t){for(let i=t+1;i<e.length;i++){const t=e[i];if(t&&(!R(t)&&!(D(t)||"progress"===t.type||"system"===t.type||"attachment"===t.type||"user"===t.type&&t.isMeta))){if("assistant"===t.type){const e=t.message.content;if(Array.isArray(e)){if(e.some(e=>"text"===e.type&&e.text.trim()||"tool_use"===e.type))return!1}continue}if("user"===t.type)return!1}}return!0}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{useEffect as n,useState as i}from"react";import{getAllOutputStyles as s,OUTPUT_STYLE_CONFIG as r}from"../constants/outputStyles.js";import{Box as c,Text as m}from"../ink.js";import{getCwd as l}from"../utils/cwd.js";import{Select as a}from"./CustomSelect/select.js";import{Dialog as p}from"./design-system/Dialog.js";function mapConfigsToOptions(e){return Object.entries(e).map(([e,o])=>({label:o?.name??"Default",value:e,description:o?.description??"Claude completes coding tasks efficiently and provides concise responses"}))}export function OutputStylePicker(u){const d=t(16),{initialStyle:f,onComplete:h,onCancel:C,isStandaloneCommand:g}=u;let y;d[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],d[0]=y):y=d[0];const[j,S]=i(y),[b,x]=i(!0);let O,_,T;d[1]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{s(l()).then(e=>{const o=mapConfigsToOptions(e);S(o),x(!1)}).catch(()=>{const e=mapConfigsToOptions(r);S(e),x(!1)})},_=[],d[1]=O,d[2]=_):(O=d[1],_=d[2]),n(O,_),d[3]!==h?(T=e=>{h(e)},d[3]=h,d[4]=T):T=d[4];const k=T,v=!g,w=!g;let D,P,B;return d[5]===Symbol.for("react.memo_cache_sentinel")?(D=e(c,{marginTop:1,children:e(m,{dimColor:!0,children:"This changes how Context Code communicates with you"})}),d[5]=D):D=d[5],d[6]!==k||d[7]!==f||d[8]!==b||d[9]!==j?(P=o(c,{flexDirection:"column",gap:1,children:[D,b?e(m,{dimColor:!0,children:"Loading output styles…"}):e(a,{options:j,onChange:k,visibleOptionCount:10,defaultValue:f})]}),d[6]=k,d[7]=f,d[8]=b,d[9]=j,d[10]=P):P=d[10],d[11]!==C||d[12]!==v||d[13]!==w||d[14]!==P?(B=e(p,{title:"Preferred output style",onCancel:C,hideInputGuide:v,hideBorder:w,children:P}),d[11]=C,d[12]=v,d[13]=w,d[14]=P,d[15]=B):B=d[15],B}
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{useEffect as n,useState as i}from"react";import{getAllOutputStyles as r,OUTPUT_STYLE_CONFIG as s}from"../constants/outputStyles.js";import{Box as c,Text as m}from"../ink.js";import{getCwd as a}from"../utils/cwd.js";import{Select as l}from"./CustomSelect/select.js";import{Dialog as p}from"./design-system/Dialog.js";function mapConfigsToOptions(e){return Object.entries(e).map(([e,o])=>({label:o?.name??"Predeterminado",value:e,description:o?.description??"Context completa tareas de código eficientemente y proporciona respuestas concisas"}))}export function OutputStylePicker(u){const d=t(16),{initialStyle:f,onComplete:h,onCancel:C,isStandaloneCommand:g}=u;let y;d[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],d[0]=y):y=d[0];const[j,S]=i(y),[x,b]=i(!0);let O,_,T;d[1]===Symbol.for("react.memo_cache_sentinel")?(O=()=>{r(a()).then(e=>{const o=mapConfigsToOptions(e);S(o),b(!1)}).catch(()=>{const e=mapConfigsToOptions(s);S(e),b(!1)})},_=[],d[1]=O,d[2]=_):(O=d[1],_=d[2]),n(O,_),d[3]!==h?(T=e=>{h(e)},d[3]=h,d[4]=T):T=d[4];const w=T,P=!g,k=!g;let v,D,B;return d[5]===Symbol.for("react.memo_cache_sentinel")?(v=e(c,{marginTop:1,children:e(m,{dimColor:!0,children:"This changes how Context Code communicates with you"})}),d[5]=v):v=d[5],d[6]!==w||d[7]!==f||d[8]!==x||d[9]!==j?(D=o(c,{flexDirection:"column",gap:1,children:[v,x?e(m,{dimColor:!0,children:"Loading output styles…"}):e(l,{options:j,onChange:w,visibleOptionCount:10,defaultValue:f})]}),d[6]=w,d[7]=f,d[8]=x,d[9]=j,d[10]=D):D=d[10],d[11]!==C||d[12]!==P||d[13]!==k||d[14]!==D?(B=e(p,{title:"Preferred output style",onCancel:C,hideInputGuide:P,hideBorder:k,children:D}),d[11]=C,d[12]=P,d[13]=k,d[14]=D,d[15]=B):B=d[15],B}