@iaforged/context-code 2.0.1 → 2.0.3

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 (145) 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/server/channelServer.js +1 -0
  103. package/dist/src/server/channelServer.test.js +1 -0
  104. package/dist/src/services/api/errors.js +1 -1
  105. package/dist/src/services/api/filesApi.js +1 -1
  106. package/dist/src/services/api/index.js +1 -1
  107. package/dist/src/services/tips/tipRegistry.js +1 -1
  108. package/dist/src/tasks/RemoteAgentTask/RemoteAgentTask.js +1 -1
  109. package/dist/src/tools/AgentTool/AgentTool.js +1 -1
  110. package/dist/src/tools/ConfigTool/supportedSettings.js +1 -1
  111. package/dist/src/tools/EnterWorktreeTool/EnterWorktreeTool.js +1 -1
  112. package/dist/src/tools/ExitWorktreeTool/ExitWorktreeTool.js +1 -1
  113. package/dist/src/tools/WebFetchTool/WebFetchTool.js +1 -1
  114. package/dist/src/utils/computerUse/cleanup.js +1 -1
  115. package/dist/src/utils/computerUse/wrapper.js +1 -1
  116. package/dist/src/utils/fileHistory.js +1 -1
  117. package/dist/src/utils/heartbeat.js +1 -0
  118. package/dist/src/utils/model/providers.js +1 -1
  119. package/dist/src/utils/permissions/filesystem.js +1 -1
  120. package/dist/src/utils/permissions/permissions.js +1 -1
  121. package/dist/src/utils/processUserInput/processSlashCommand.js +1 -1
  122. package/dist/src/utils/releaseNoteTranslations.js +1 -1
  123. package/dist/src/utils/shell/shellToolUtils.js +1 -1
  124. package/dist/src/utils/sideQuery.js +1 -1
  125. package/dist/src/utils/sshMcp/common.js +1 -0
  126. package/dist/src/utils/sshMcp/setup.js +1 -0
  127. package/dist/src/utils/sshMcp/sshMcpServer.js +1 -0
  128. package/dist/src/utils/sshMcp/sshMcpServer.test.js +1 -0
  129. package/dist/src/utils/teleport.js +1 -1
  130. package/dist/src/webapp/server.js +1 -1
  131. package/dist/sshMcpServer.js +1 -0
  132. package/dist/sshMcpServer.test.js +1 -0
  133. package/dist/webapp/chunk-AMCDNAIG.js +1 -0
  134. package/dist/webapp/{chunk-YUEYJPXQ.js → chunk-NFYBHCXF.js} +1 -1
  135. package/dist/webapp/{chunk-DFKSSBHI.js → chunk-OJZNEHPP.js} +1 -1
  136. package/dist/webapp/chunk-VAB2VXFI.js +1 -0
  137. package/dist/webapp/index.html +2 -2
  138. package/dist/webapp/main-MTQLKGXD.js +1 -0
  139. package/dist/webapp/ngsw.json +14 -14
  140. package/dist/webapp/styles-DIKEDJBH.css +1 -0
  141. package/package.json +2 -1
  142. package/dist/webapp/chunk-4SRNXNLW.js +0 -1
  143. package/dist/webapp/chunk-SIHYW6PA.js +0 -1
  144. package/dist/webapp/main-LBNRQBXX.js +0 -1
  145. package/dist/webapp/styles-FUPULZDX.css +0 -1
@@ -1 +1 @@
1
- import{feature as e}from"../recovery/bunBundleShim.js";import{jsx as t}from"react/jsx-runtime";import o from"chalk";import{useMemo as s,useRef as i}from"react";import{useVoiceState as n}from"../context/voice.js";import{useClipboardImageHint as r}from"../hooks/useClipboardImageHint.js";import{useSettings as l}from"../hooks/useSettings.js";import{useTextInput as m}from"../hooks/useTextInput.js";import{Box as a,color as u,useAnimationFrame as h,useTerminalFocus as p,useTheme as c}from"../ink.js";import{isEnvTruthy as f}from"../utils/envUtils.js";import{BaseTextInput as g}from"./BaseTextInput.js";import{hueToRgb as C}from"./Spinner/utils.js";const x=" ▁▂▃▄▅▆▇█";export default function TextInput(d){const[E]=c(),I=p(),b=s(()=>f(process.env.CONTEXT_CODE_ACCESSIBILITY)||f(process.env.CLAUDE_CODE_ACCESSIBILITY),[]),v=l().prefersReducedMotion??!1,O="recording"===(e("VOICE_MODE")?n(e=>e.voiceState):"idle"),T=e("VOICE_MODE")?n(e=>e.voiceAudioLevels):[],D=i(new Array(1).fill(0)),M=O&&!v,[j,S]=e("VOICE_MODE")?h(M?50:null):[()=>{},0];r(I,!!d.onImagePaste);let y;if(I&&!b)if(O&&!v){const e=D.current,t=T.length>0?T[T.length-1]??0:0,s=Math.min(1.8*t,1);e[0]=.7*(e[0]??0)+s*(1-.7);const i=e[0]??0,n=Math.max(1,Math.min(Math.round(8*i),8)),r=t<.15,l=S/1e3*90%360,{r:m,g:a,b:u}=r?{r:128,g:128,b:128}:C(l);y=()=>o.rgb(m,a,u)(x[n])}else y=o.inverse;else y=e=>e;const P=m({value:d.value,onChange:d.onChange,onSubmit:d.onSubmit,onExit:d.onExit,onExitMessage:d.onExitMessage,onHistoryReset:d.onHistoryReset,onHistoryUp:d.onHistoryUp,onHistoryDown:d.onHistoryDown,onClearInput:d.onClearInput,focus:d.focus,mask:d.mask,multiline:d.multiline,cursorChar:d.showCursor?" ":"",highlightPastedText:d.highlightPastedText,invert:y,themeText:u("text",E),columns:d.columns,maxVisibleLines:d.maxVisibleLines,onImagePaste:d.onImagePaste,disableCursorMovementForUpDownKeys:d.disableCursorMovementForUpDownKeys,disableEscapeDoublePress:d.disableEscapeDoublePress,externalOffset:d.cursorOffset,onOffsetChange:d.onChangeCursorOffset,inputFilter:d.inputFilter,inlineGhostText:d.inlineGhostText,dim:o.dim});return t(a,{ref:j,children:t(g,{inputState:P,terminalFocus:I,highlights:d.highlights,invert:y,hidePlaceholderText:O,...d})})}
1
+ import{feature as e}from"../recovery/bunBundleShim.js";import{jsx as o,jsxs as r}from"react/jsx-runtime";import t from"chalk";import{useMemo as i,useRef as n,useState as s,useEffect as l}from"react";import{useVoiceState as a}from"../context/voice.js";import{useClipboardImageHint as c}from"../hooks/useClipboardImageHint.js";import{useSettings as u}from"../hooks/useSettings.js";import{useTextInput as d}from"../hooks/useTextInput.js";import{Box as m,color as p,useAnimationFrame as h,useTerminalFocus as f,useTheme as g,Text as v}from"../ink.js";import{isEnvTruthy as C}from"../utils/envUtils.js";import{BaseTextInput as x}from"./BaseTextInput.js";import{hueToRgb as b}from"./Spinner/utils.js";import{isWebappRunning as E,broadcastInteractiveInput as I,getWebappUrl as y}from"../webapp/server.js";const S=" ▁▂▃▄▅▆▇█";export default function TextInput(T){const[k,D]=s(!1),[j,M]=s(!1),[O,P]=s(null);l(()=>{if(E()&&!T.multiline){D(!0);const e=Math.random().toString(36).substring(2,9),{title:o,description:r,placeholder:t}=function(e){const o=(e.placeholder||e.value||"").toLowerCase();return e.mask||o.includes("api")||o.includes("key")||o.includes("token")||o.includes("password")||o.includes("contraseña")?{title:"Introducir Clave de API / Token Confidencial",description:"Por seguridad, introduce tu API Key o Token de acceso en este campo seguro y enmascarado.",placeholder:"sk-..."}:o.includes("host")||o.includes("url")||o.includes("puerto")||o.includes("port")?{title:"Configurar Dirección / Servidor",description:"Introduce la dirección URL, host o puerto del servicio que deseas configurar.",placeholder:"http://localhost:..."}:{title:"Entrada de Texto Requerida",description:"Por favor, introduce el valor solicitado para continuar con la operación en curso.",placeholder:"Escribe aquí..."}}(T),i=T.value?String(T.value):void 0;I(e,o,r,T.placeholder||t,T.mask,i).then(e=>{M(!0),T.onSubmit?.(e)}).catch(e=>{P(e.message||String(e)),T.onExit?.()})}},[T.multiline,T.value]);const[w]=g(),A=f();if(k&&!j)return r(m,{flexDirection:"column",padding:1,borderStyle:"round",borderColor:"cyan",children:[o(v,{color:"cyan",bold:!0,children:"✨ Interacción de Entrada Transferida a la WebApp"}),o(v,{color:"white",children:"Por favor, escribe el valor requerido en tu navegador:"}),o(v,{bold:!0,color:"cyan",children:y()}),O?r(v,{color:"red",children:["Error: ",O]}):o(v,{dimColor:!0,children:"Esperando respuesta del usuario..."})]});const L=i(()=>C(process.env.CONTEXT_CODE_ACCESSIBILITY)||C(process.env.CLAUDE_CODE_ACCESSIBILITY),[]),H=u().prefersReducedMotion??!1,U="recording"===(e("VOICE_MODE")?a(e=>e.voiceState):"idle"),_=e("VOICE_MODE")?a(e=>e.voiceAudioLevels):[],F=n(new Array(1).fill(0)),R=U&&!H,[V,q]=e("VOICE_MODE")?h(R?50:null):[()=>{},0];c(A,!!T.onImagePaste);let B;if(A&&!L)if(U&&!H){const e=F.current,o=_.length>0?_[_.length-1]??0:0,r=Math.min(1.8*o,1);e[0]=.7*(e[0]??0)+r*(1-.7);const i=e[0]??0,n=Math.max(1,Math.min(Math.round(8*i),8)),s=o<.15,l=q/1e3*90%360,{r:a,g:c,b:u}=s?{r:128,g:128,b:128}:b(l);B=()=>t.rgb(a,c,u)(S[n])}else B=t.inverse;else B=e=>e;const K=d({value:T.value,onChange:T.onChange,onSubmit:T.onSubmit,onExit:T.onExit,onExitMessage:T.onExitMessage,onHistoryReset:T.onHistoryReset,onHistoryUp:T.onHistoryUp,onHistoryDown:T.onHistoryDown,onClearInput:T.onClearInput,focus:T.focus,mask:T.mask,multiline:T.multiline,cursorChar:T.showCursor?" ":"",highlightPastedText:T.highlightPastedText,invert:B,themeText:p("text",w),columns:T.columns,maxVisibleLines:T.maxVisibleLines,onImagePaste:T.onImagePaste,disableCursorMovementForUpDownKeys:T.disableCursorMovementForUpDownKeys,disableEscapeDoublePress:T.disableEscapeDoublePress,externalOffset:T.cursorOffset,onOffsetChange:T.onChangeCursorOffset,inputFilter:T.inputFilter,inlineGhostText:T.inlineGhostText,dim:t.dim});return o(m,{ref:V,children:o(x,{inputState:K,terminalFocus:A,highlights:T.highlights,invert:B,hidePlaceholderText:U,...T})})}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{Box as r}from"../../../../ink.js";import{ConfigurableShortcutHint as n}from"../../../ConfigurableShortcutHint.js";import{Select as a}from"../../../CustomSelect/select.js";import{Byline as i}from"../../../design-system/Byline.js";import{KeyboardShortcutHint as c}from"../../../design-system/KeyboardShortcutHint.js";import{useWizard as m}from"../../../wizard/index.js";import{WizardDialogLayout as s}from"../../../wizard/WizardDialogLayout.js";export function MethodStep(){const l=t(11),{goNext:d,goBack:u,updateWizardData:f,goToStep:p}=m();let g;l[0]===Symbol.for("react.memo_cache_sentinel")?(g=[{label:"Generar con Claude (recomendado)",value:"generate"},{label:"Configuracion manual",value:"manual"}],l[0]=g):g=l[0];const h=g;let j,b,x,y;return l[1]===Symbol.for("react.memo_cache_sentinel")?(j=o(i,{children:[e(c,{shortcut:"↑↓",action:"navegar"}),e(c,{shortcut:"Enter",action:"seleccionar"}),e(n,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"volver"})]}),l[1]=j):j=l[1],l[2]!==d||l[3]!==p||l[4]!==f?(b=e=>{const o=e;f({method:o,wasGenerated:"generate"===o}),"generate"===o?d():p(3)},l[2]=d,l[3]=p,l[4]=f,l[5]=b):b=l[5],l[6]!==u?(x=()=>u(),l[6]=u,l[7]=x):x=l[7],l[8]!==b||l[9]!==x?(y=e(s,{subtitle:"Metodo de creacion",footerText:j,children:e(r,{children:e(a,{options:h,onChange:b,onCancel:x},"method-select")})}),l[8]=b,l[9]=x,l[10]=y):y=l[10],y}
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{Box as r}from"../../../../ink.js";import{ConfigurableShortcutHint as n}from"../../../ConfigurableShortcutHint.js";import{Select as a}from"../../../CustomSelect/select.js";import{Byline as i}from"../../../design-system/Byline.js";import{KeyboardShortcutHint as c}from"../../../design-system/KeyboardShortcutHint.js";import{useWizard as m}from"../../../wizard/index.js";import{WizardDialogLayout as s}from"../../../wizard/WizardDialogLayout.js";export function MethodStep(){const l=t(11),{goNext:d,goBack:f,updateWizardData:u,goToStep:p}=m();let g;l[0]===Symbol.for("react.memo_cache_sentinel")?(g=[{label:"Generar con Context (recomendado)",value:"generate"},{label:"Configuracion manual",value:"manual"}],l[0]=g):g=l[0];const h=g;let j,x,b,y;return l[1]===Symbol.for("react.memo_cache_sentinel")?(j=o(i,{children:[e(c,{shortcut:"↑↓",action:"navegar"}),e(c,{shortcut:"Enter",action:"seleccionar"}),e(n,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"volver"})]}),l[1]=j):j=l[1],l[2]!==d||l[3]!==p||l[4]!==u?(x=e=>{const o=e;u({method:o,wasGenerated:"generate"===o}),"generate"===o?d():p(3)},l[2]=d,l[3]=p,l[4]=u,l[5]=x):x=l[5],l[6]!==f?(b=()=>f(),l[6]=f,l[7]=b):b=l[7],l[8]!==x||l[9]!==b?(y=e(s,{subtitle:"Metodo de creacion",footerText:j,children:e(r,{children:e(a,{options:h,onChange:x,onCancel:b},"method-select")})}),l[8]=x,l[9]=b,l[10]=y):y=l[10],y}
@@ -1 +1 @@
1
- import{jsx as t,jsxs as o}from"react/jsx-runtime";import{c as r}from"react/compiler-runtime";import e from"../../ink/components/Text.js";export function KeyboardShortcutHint(n){const i=r(9),{shortcut:c,action:s,parens:m,bold:l}=n,a=void 0!==m&&m,d=void 0!==l&&l;let p;i[0]!==d||i[1]!==c?(p=d?t(e,{bold:!0,children:c}):c,i[0]=d,i[1]=c,i[2]=p):p=i[2];const u=p;if(a){let t;return i[3]!==s||i[4]!==u?(t=o(e,{children:["(",u," to ",s,")"]}),i[3]=s,i[4]=u,i[5]=t):t=i[5],t}let f;return i[6]!==s||i[7]!==u?(f=o(e,{children:[u," to ",s]}),i[6]=s,i[7]=u,i[8]=f):f=i[8],f}
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{c as a}from"react/compiler-runtime";import n from"../../ink/components/Text.js";const c={expand:"expandir",cancel:"cancelar",cancelar:"cancelar",toggle:"alternar",navigate:"navegar",navegar:"navegar",seleccionar:"seleccionar",select:"seleccionar",confirm:"confirmar",confirmar:"confirmar",manage:"gestionar","run in background":"ejecutar en segundo plano",copy:"copiar",unset:"quitar",switch:"cambiar",return:"volver",tabs:"pestañas","select message":"seleccionar mensaje","open in editor":"abrir en el editor","disable external includes":"desactivar inclusiones externas",reintentar:"reintentar",cerrar:"cerrar"};export function KeyboardShortcutHint(t){const o=a(9),{shortcut:i,action:s,parens:l,bold:m}=t,d=void 0!==l&&l,p=void 0!==m&&m,u=c[s.toLowerCase()]||s;let g;o[0]!==p||o[1]!==i?(g=p?e(n,{bold:!0,children:i}):i,o[0]=p,o[1]=i,o[2]=g):g=o[2];const f=g;if(d){let e;return o[3]!==u||o[4]!==f?(e=r(n,{children:["(",f," para ",u,")"]}),o[3]=u,o[4]=f,o[5]=e):e=o[5],e}let v;return o[6]!==u||o[7]!==f?(v=r(n,{children:[f," para ",u]}),o[6]=u,o[7]=f,o[8]=v):v=o[8],v}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as i}from"react/jsx-runtime";import{c as l}from"react/compiler-runtime";import{resolve as n}from"path";import{useTerminalSize as t}from"../../hooks/useTerminalSize.js";import{Box as r,Text as o}from"../../ink.js";import{getCwd as c}from"../../utils/cwd.js";import{readFileSafe as d}from"../../utils/file.js";import{Divider as m}from"../design-system/Divider.js";import{StructuredDiff as f}from"../StructuredDiff.js";export function DiffDetailView(a){const s=l(53),{filePath:h,hunks:u,isLargeFile:p,isBinary:_,isTruncated:b,isUntracked:x}=a,{columns:y}=t();let C;e:{if(!h){let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={firstLine:null,fileContent:void 0},s[0]=e):e=s[0],C=e;break e}let e,i;if(s[1]!==h){const l=n(c(),h);e=d(l),i=e?.split("\n")[0]??null,s[1]=h,s[2]=e,s[3]=i}else e=s[2],i=s[3];const l=e??void 0;let t;s[4]!==i||s[5]!==l?(t={firstLine:i,fileContent:l},s[4]=i,s[5]=l,s[6]=t):t=s[6],C=t}const{firstLine:D,fileContent:S}=C;if(x){let l,n,t,c,d,f,a;return s[7]!==h?(l=e(o,{bold:!0,children:h}),s[7]=h,s[8]=l):l=s[8],s[9]===Symbol.for("react.memo_cache_sentinel")?(n=e(o,{dimColor:!0,children:" (untracked)"}),s[9]=n):n=s[9],s[10]!==l?(t=i(r,{children:[l,n]}),s[10]=l,s[11]=t):t=s[11],s[12]===Symbol.for("react.memo_cache_sentinel")?(c=e(m,{padding:4}),s[12]=c):c=s[12],s[13]===Symbol.for("react.memo_cache_sentinel")?(d=e(o,{dimColor:!0,italic:!0,children:"New file not yet staged."}),s[13]=d):d=s[13],s[14]!==h?(f=i(r,{flexDirection:"column",children:[d,i(o,{dimColor:!0,italic:!0,children:["Run `git add ",h,"` to see line counts."]})]}),s[14]=h,s[15]=f):f=s[15],s[16]!==t||s[17]!==f?(a=i(r,{flexDirection:"column",width:"100%",children:[t,c,f]}),s[16]=t,s[17]=f,s[18]=a):a=s[18],a}if(_){let l,n,t,c;return s[19]!==h?(l=e(r,{children:e(o,{bold:!0,children:h})}),s[19]=h,s[20]=l):l=s[20],s[21]===Symbol.for("react.memo_cache_sentinel")?(n=e(m,{padding:4}),s[21]=n):n=s[21],s[22]===Symbol.for("react.memo_cache_sentinel")?(t=e(r,{flexDirection:"column",children:e(o,{dimColor:!0,italic:!0,children:"Binary file - cannot display diff"})}),s[22]=t):t=s[22],s[23]!==l?(c=i(r,{flexDirection:"column",width:"100%",children:[l,n,t]}),s[23]=l,s[24]=c):c=s[24],c}if(p){let l,n,t,c;return s[25]!==h?(l=e(r,{children:e(o,{bold:!0,children:h})}),s[25]=h,s[26]=l):l=s[26],s[27]===Symbol.for("react.memo_cache_sentinel")?(n=e(m,{padding:4}),s[27]=n):n=s[27],s[28]===Symbol.for("react.memo_cache_sentinel")?(t=e(r,{flexDirection:"column",children:e(o,{dimColor:!0,italic:!0,children:"Large file - diff exceeds 1 MB limit"})}),s[28]=t):t=s[28],s[29]!==l?(c=i(r,{flexDirection:"column",width:"100%",children:[l,n,t]}),s[29]=l,s[30]=c):c=s[30],c}let g,j,w,k,L,v,B,N;return s[31]!==h?(g=e(o,{bold:!0,children:h}),s[31]=h,s[32]=g):g=s[32],s[33]!==b?(j=b&&e(o,{dimColor:!0,children:" (truncated)"}),s[33]=b,s[34]=j):j=s[34],s[35]!==g||s[36]!==j?(w=i(r,{children:[g,j]}),s[35]=g,s[36]=j,s[37]=w):w=s[37],s[38]===Symbol.for("react.memo_cache_sentinel")?(k=e(m,{padding:4}),s[38]=k):k=s[38],s[39]!==y||s[40]!==S||s[41]!==h||s[42]!==D||s[43]!==u?(L=0===u.length?e(o,{dimColor:!0,children:"No diff content"}):u.map((i,l)=>e(f,{patch:i,filePath:h,firstLine:D,fileContent:S,dim:!1,width:y-2-2},l)),s[39]=y,s[40]=S,s[41]=h,s[42]=D,s[43]=u,s[44]=L):L=s[44],s[45]!==L?(v=e(r,{flexDirection:"column",children:L}),s[45]=L,s[46]=v):v=s[46],s[47]!==b?(B=b&&e(o,{dimColor:!0,italic:!0,children:"… diff truncated (exceeded 400 line limit)"}),s[47]=b,s[48]=B):B=s[48],s[49]!==w||s[50]!==v||s[51]!==B?(N=i(r,{flexDirection:"column",width:"100%",children:[w,k,v,B]}),s[49]=w,s[50]=v,s[51]=B,s[52]=N):N=s[52],N}
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{c as n}from"react/compiler-runtime";import{resolve as l}from"path";import{useTerminalSize as r}from"../../hooks/useTerminalSize.js";import{Box as t,Text as o}from"../../ink.js";import{getCwd as c}from"../../utils/cwd.js";import{readFileSafe as d}from"../../utils/file.js";import{Divider as m}from"../design-system/Divider.js";import{StructuredDiff as a}from"../StructuredDiff.js";export function DiffDetailView(f){const s=n(53),{filePath:h,hunks:u,isLargeFile:p,isBinary:_,isTruncated:b,isUntracked:x}=f,{columns:y}=r();let C;e:{if(!h){let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={firstLine:null,fileContent:void 0},s[0]=e):e=s[0],C=e;break e}let e,i;if(s[1]!==h){const n=l(c(),h);e=d(n),i=e?.split("\n")[0]??null,s[1]=h,s[2]=e,s[3]=i}else e=s[2],i=s[3];const n=e??void 0;let r;s[4]!==i||s[5]!==n?(r={firstLine:i,fileContent:n},s[4]=i,s[5]=n,s[6]=r):r=s[6],C=r}const{firstLine:D,fileContent:g}=C;if(x){let n,l,r,c,d,a,f;return s[7]!==h?(n=e(o,{bold:!0,children:h}),s[7]=h,s[8]=n):n=s[8],s[9]===Symbol.for("react.memo_cache_sentinel")?(l=e(o,{dimColor:!0,children:" (untracked)"}),s[9]=l):l=s[9],s[10]!==n?(r=i(t,{children:[n,l]}),s[10]=n,s[11]=r):r=s[11],s[12]===Symbol.for("react.memo_cache_sentinel")?(c=e(m,{padding:4}),s[12]=c):c=s[12],s[13]===Symbol.for("react.memo_cache_sentinel")?(d=e(o,{dimColor:!0,italic:!0,children:"Archivo nuevo, aún no añadido al staging."}),s[13]=d):d=s[13],s[14]!==h?(a=i(t,{flexDirection:"column",children:[d,i(o,{dimColor:!0,italic:!0,children:["Run `git add ",h,"` to see line counts."]})]}),s[14]=h,s[15]=a):a=s[15],s[16]!==r||s[17]!==a?(f=i(t,{flexDirection:"column",width:"100%",children:[r,c,a]}),s[16]=r,s[17]=a,s[18]=f):f=s[18],f}if(_){let n,l,r,c;return s[19]!==h?(n=e(t,{children:e(o,{bold:!0,children:h})}),s[19]=h,s[20]=n):n=s[20],s[21]===Symbol.for("react.memo_cache_sentinel")?(l=e(m,{padding:4}),s[21]=l):l=s[21],s[22]===Symbol.for("react.memo_cache_sentinel")?(r=e(t,{flexDirection:"column",children:e(o,{dimColor:!0,italic:!0,children:"Binary file - cannot display diff"})}),s[22]=r):r=s[22],s[23]!==n?(c=i(t,{flexDirection:"column",width:"100%",children:[n,l,r]}),s[23]=n,s[24]=c):c=s[24],c}if(p){let n,l,r,c;return s[25]!==h?(n=e(t,{children:e(o,{bold:!0,children:h})}),s[25]=h,s[26]=n):n=s[26],s[27]===Symbol.for("react.memo_cache_sentinel")?(l=e(m,{padding:4}),s[27]=l):l=s[27],s[28]===Symbol.for("react.memo_cache_sentinel")?(r=e(t,{flexDirection:"column",children:e(o,{dimColor:!0,italic:!0,children:"Large file - diff exceeds 1 MB limit"})}),s[28]=r):r=s[28],s[29]!==n?(c=i(t,{flexDirection:"column",width:"100%",children:[n,l,r]}),s[29]=n,s[30]=c):c=s[30],c}let S,j,w,k,L,v,B,P;return s[31]!==h?(S=e(o,{bold:!0,children:h}),s[31]=h,s[32]=S):S=s[32],s[33]!==b?(j=b&&e(o,{dimColor:!0,children:" (truncated)"}),s[33]=b,s[34]=j):j=s[34],s[35]!==S||s[36]!==j?(w=i(t,{children:[S,j]}),s[35]=S,s[36]=j,s[37]=w):w=s[37],s[38]===Symbol.for("react.memo_cache_sentinel")?(k=e(m,{padding:4}),s[38]=k):k=s[38],s[39]!==y||s[40]!==g||s[41]!==h||s[42]!==D||s[43]!==u?(L=0===u.length?e(o,{dimColor:!0,children:"No diff content"}):u.map((i,n)=>e(a,{patch:i,filePath:h,firstLine:D,fileContent:g,dim:!1,width:y-2-2},n)),s[39]=y,s[40]=g,s[41]=h,s[42]=D,s[43]=u,s[44]=L):L=s[44],s[45]!==L?(v=e(t,{flexDirection:"column",children:L}),s[45]=L,s[46]=v):v=s[46],s[47]!==b?(B=b&&e(o,{dimColor:!0,italic:!0,children:"… diff truncated (exceeded 400 line limit)"}),s[47]=b,s[48]=B):B=s[48],s[49]!==w||s[50]!==v||s[51]!==B?(P=i(t,{flexDirection:"column",width:"100%",children:[w,k,v,B]}),s[49]=w,s[50]=v,s[51]=B,s[52]=P):P=s[52],P}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{c as n}from"react/compiler-runtime";import r,{useEffect as c,useState as i}from"react";import{logEvent as a}from"../../services/analytics/index.js";import{Box as l,Link as s,Text as d,useInput as m}from"../../ink.js";import{calculateShouldShowGrove as _,getGroveNoticeConfig as u,getGroveSettings as p,markGroveNoticeViewed as h,updateGroveSettings as f}from"../../services/api/grove.js";import{Select as y}from"../CustomSelect/index.js";import{Byline as g}from"../design-system/Byline.js";import{Dialog as b}from"../design-system/Dialog.js";import{KeyboardShortcutHint as v}from"../design-system/KeyboardShortcutHint.js";function GracePeriodContentBody(){const r=n(9);let c,i,a,m,_,u,p,h,f;return r[0]===Symbol.for("react.memo_cache_sentinel")?(c=o(d,{children:["An update to our Consumer Terms and Privacy Policy will take effect on"," ",e(d,{bold:!0,children:"October 8, 2025"}),". You can accept the updated terms today."]}),r[0]=c):c=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(i=e(d,{children:"What's changing?"}),r[1]=i):i=r[1],r[2]===Symbol.for("react.memo_cache_sentinel")?(a=e(d,{children:"· "}),m=e(d,{bold:!0,children:"You can help improve Claude "}),r[2]=a,r[3]=m):(a=r[2],m=r[3]),r[4]===Symbol.for("react.memo_cache_sentinel")?(_=e(l,{paddingLeft:1,children:o(d,{children:[a,m,o(d,{children:["— Allow the use of your chats and coding sessions to train and improve Anthropic AI models. Change anytime in your Privacy Settings (",e(s,{url:"https://claude.ai/settings/data-privacy-controls"}),")."]})]})}),r[4]=_):_=r[4],r[5]===Symbol.for("react.memo_cache_sentinel")?(u=o(l,{flexDirection:"column",children:[i,_,e(l,{paddingLeft:1,children:o(d,{children:[e(d,{children:"· "}),e(d,{bold:!0,children:"Updates to data retention "}),e(d,{children:"— To help us improve our AI models and safety protections, we're extending data retention to 5 years."})]})})]}),r[5]=u):u=r[5],r[6]===Symbol.for("react.memo_cache_sentinel")?(p=e(s,{url:"https://www.anthropic.com/news/updates-to-our-consumer-terms"}),r[6]=p):p=r[6],r[7]===Symbol.for("react.memo_cache_sentinel")?(h=e(s,{url:"https://anthropic.com/legal/terms"}),r[7]=h):h=r[7],r[8]===Symbol.for("react.memo_cache_sentinel")?(f=o(t,{children:[c,u,o(d,{children:["Learn more (",p,") or read the updated Consumer Terms (",h,") and Privacy Policy (",e(s,{url:"https://anthropic.com/legal/privacy"}),")"]})]}),r[8]=f):f=r[8],f}function PostGracePeriodContentBody(){const r=n(7);let c,i,a,m,_,u,p;return r[0]===Symbol.for("react.memo_cache_sentinel")?(c=e(d,{children:"We've updated our Consumer Terms and Privacy Policy."}),r[0]=c):c=r[0],r[1]===Symbol.for("react.memo_cache_sentinel")?(i=e(d,{children:"What's changing?"}),r[1]=i):i=r[1],r[2]===Symbol.for("react.memo_cache_sentinel")?(a=o(l,{flexDirection:"column",children:[e(d,{bold:!0,children:"Help improve Claude"}),e(d,{children:"Allow the use of your chats and coding sessions to train and improve Anthropic AI models. You can change this anytime in Privacy Settings"}),e(s,{url:"https://claude.ai/settings/data-privacy-controls"})]}),r[2]=a):a=r[2],r[3]===Symbol.for("react.memo_cache_sentinel")?(m=o(l,{flexDirection:"column",gap:1,children:[i,a,o(l,{flexDirection:"column",children:[e(d,{bold:!0,children:"How this affects data retention"}),e(d,{children:"Turning ON the improve Claude setting extends data retention from 30 days to 5 years. Turning it OFF keeps the default 30-day data retention. Delete data anytime."})]})]}),r[3]=m):m=r[3],r[4]===Symbol.for("react.memo_cache_sentinel")?(_=e(s,{url:"https://www.anthropic.com/news/updates-to-our-consumer-terms"}),r[4]=_):_=r[4],r[5]===Symbol.for("react.memo_cache_sentinel")?(u=e(s,{url:"https://anthropic.com/legal/terms"}),r[5]=u):u=r[5],r[6]===Symbol.for("react.memo_cache_sentinel")?(p=o(t,{children:[c,m,o(d,{children:["Learn more (",_,") or read the updated Consumer Terms (",u,") and Privacy Policy (",e(s,{url:"https://anthropic.com/legal/privacy"}),")"]})]}),r[6]=p):p=r[6],p}export function GroveDialog(t){const r=n(34),{showIfAlreadyViewed:s,location:m,onDone:g}=t,[v,S]=i(null),[w,x]=i(null);let P,C,D;if(r[0]!==m||r[1]!==g||r[2]!==s?(P=()=>{!async function(){const[e,o]=await Promise.all([p(),u()]),t=o.success?o.data:null;x(t);const n=_(e,o,s);S(n),n?(h(),a("tengu_grove_policy_viewed",{location:m,dismissable:t?.notice_is_grace_period})):g("skip_rendering")}()},C=[s,m,g],r[0]=m,r[1]=g,r[2]=s,r[3]=P,r[4]=C):(P=r[3],C=r[4]),c(P,C),null===v)return null;if(!v)return null;r[5]!==w?.notice_is_grace_period||r[6]!==g?(D=async function(e){e:switch(e){case"accept_opt_in":await f(!0),a("tengu_grove_policy_submitted",{state:!0,dismissable:w?.notice_is_grace_period});break e;case"accept_opt_out":await f(!1),a("tengu_grove_policy_submitted",{state:!1,dismissable:w?.notice_is_grace_period});break e;case"defer":a("tengu_grove_policy_dismissed",{state:!0});break e;case"escape":a("tengu_grove_policy_escaped",{})}g(e)},r[5]=w?.notice_is_grace_period,r[6]=g,r[7]=D):D=r[7];const k=D;let A;r[8]!==w?.domain_excluded?(A=w?.domain_excluded?[{label:"Accept terms · Help improve Claude: OFF (for emails with your domain)",value:"accept_opt_out"}]:[{label:"Accept terms · Help improve Claude: ON",value:"accept_opt_in"},{label:"Accept terms · Help improve Claude: OFF",value:"accept_opt_out"}],r[8]=w?.domain_excluded,r[9]=A):A=r[9];const j=A;let T;r[10]!==w?.notice_is_grace_period||r[11]!==k?(T=function(){k(w?.notice_is_grace_period?"defer":"escape")},r[10]=w?.notice_is_grace_period,r[11]=k,r[12]=T):T=r[12];const E=T;let B,G,F,H,N,O,I,L,W;return r[13]!==w?.notice_is_grace_period?(B=e(l,{flexDirection:"column",gap:1,flexGrow:1,children:e(w?.notice_is_grace_period?GracePeriodContentBody:PostGracePeriodContentBody,{})}),r[13]=w?.notice_is_grace_period,r[14]=B):B=r[14],r[15]===Symbol.for("react.memo_cache_sentinel")?(G=e(l,{flexShrink:0,children:e(d,{color:"professionalBlue",children:" _____________\n | \\ \\\n | NEW TERMS \\__\\\n | |\n | ---------- |\n | ---------- |\n | ---------- |\n | ---------- |\n | ---------- |\n | |\n |______________|"})}),r[15]=G):G=r[15],r[16]!==B?(F=o(l,{flexDirection:"row",children:[B,G]}),r[16]=B,r[17]=F):F=r[17],r[18]===Symbol.for("react.memo_cache_sentinel")?(H=o(l,{flexDirection:"column",children:[e(d,{bold:!0,children:"Please select how you'd like to continue"}),e(d,{children:"Your choice takes effect immediately upon confirmation."})]}),r[18]=H):H=r[18],r[19]!==w?.notice_is_grace_period?(N=w?.notice_is_grace_period?[{label:"Not now",value:"defer"}]:[],r[19]=w?.notice_is_grace_period,r[20]=N):N=r[20],r[21]!==j||r[22]!==N?(O=[...j,...N],r[21]=j,r[22]=N,r[23]=O):O=r[23],r[24]!==k?(I=e=>k(e),r[24]=k,r[25]=I):I=r[25],r[26]!==E||r[27]!==O||r[28]!==I?(L=o(l,{flexDirection:"column",gap:1,children:[H,e(y,{options:O,onChange:I,onCancel:E})]}),r[26]=E,r[27]=O,r[28]=I,r[29]=L):L=r[29],r[30]!==E||r[31]!==L||r[32]!==F?(W=o(b,{title:"Updates to Consumer Terms and Policies",color:"professionalBlue",onCancel:E,inputGuide:_temp,children:[F,L]}),r[30]=E,r[31]=L,r[32]=F,r[33]=W):W=r[33],W}function _temp(t){return t.pending?o(d,{children:["Presiona ",t.keyName," de nuevo para salir"]}):o(g,{children:[e(v,{shortcut:"Enter",action:"confirmar"}),e(v,{shortcut:"Esc",action:"cancelar"})]})}export function PrivacySettingsDialog(t){const c=n(17),{settings:a,domainExcluded:_,onDone:u}=t,[p,h]=i(a.grove_enabled);let y,S,w;c[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],c[0]=y):y=c[0],r.useEffect(_temp2,y),c[1]!==_||c[2]!==p?(S=async(e,o)=>{if(!_&&(o.tab||o.return||" "===e)){const e=!p;h(e),await f(e)}},c[1]=_,c[2]=p,c[3]=S):S=c[3],m(S),c[4]===Symbol.for("react.memo_cache_sentinel")?(w=e(d,{color:"error",children:"false"}),c[4]=w):w=c[4];let x,P,C,D,k,A=w;if(_){let o;c[5]===Symbol.for("react.memo_cache_sentinel")?(o=e(d,{color:"error",children:"false (for emails with your domain)"}),c[5]=o):o=c[5],A=o}else if(p){let o;c[6]===Symbol.for("react.memo_cache_sentinel")?(o=e(d,{color:"success",children:"true"}),c[6]=o):o=c[6],A=o}return c[7]!==_?(x=t=>t.pending?o(d,{children:["Presiona ",t.keyName," de nuevo para salir"]}):_?e(v,{shortcut:"Esc",action:"cancelar"}):o(g,{children:[e(v,{shortcut:"Enter/Tab/Space",action:"toggle"}),e(v,{shortcut:"Esc",action:"cancelar"})]}),c[7]=_,c[8]=x):x=c[8],c[9]===Symbol.for("react.memo_cache_sentinel")?(P=o(d,{children:["Review and manage your privacy settings at"," ",e(s,{url:"https://claude.ai/settings/data-privacy-controls"})]}),c[9]=P):P=c[9],c[10]===Symbol.for("react.memo_cache_sentinel")?(C=e(l,{width:44,children:e(d,{bold:!0,children:"Help improve Claude"})}),c[10]=C):C=c[10],c[11]!==A?(D=o(l,{children:[C,e(l,{children:A})]}),c[11]=A,c[12]=D):D=c[12],c[13]!==u||c[14]!==x||c[15]!==D?(k=o(b,{title:"Data Privacy",color:"professionalBlue",onCancel:u,inputGuide:x,children:[P,D]}),c[13]=u,c[14]=x,c[15]=D,c[16]=k):k=c[16],k}function _temp2(){a("tengu_grove_privacy_settings_viewed",{})}
1
+ import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{c as n}from"react/compiler-runtime";import c,{useEffect as t,useState as i}from"react";import{logEvent as a}from"../../services/analytics/index.js";import{Box as l,Link as s,Text as d,useInput as m}from"../../ink.js";import{calculateShouldShowGrove as _,getGroveNoticeConfig as u,getGroveSettings as h,markGroveNoticeViewed as p,updateGroveSettings as f}from"../../services/api/grove.js";import{Select as y}from"../CustomSelect/index.js";import{Byline as g}from"../design-system/Byline.js";import{Dialog as b}from"../design-system/Dialog.js";import{KeyboardShortcutHint as v}from"../design-system/KeyboardShortcutHint.js";function GracePeriodContentBody(){const c=n(9);let t,i,a,m,_,u,h,p,f;return c[0]===Symbol.for("react.memo_cache_sentinel")?(t=o(d,{children:["Una actualización a nuestros Términos del Consumidor y Política de Privacidad entrará en vigor el"," ",e(d,{bold:!0,children:"8 de octubre de 2025"}),". Puedes aceptar los términos actualizados hoy."]}),c[0]=t):t=c[0],c[1]===Symbol.for("react.memo_cache_sentinel")?(i=e(d,{children:"¿Qué está cambiando?"}),c[1]=i):i=c[1],c[2]===Symbol.for("react.memo_cache_sentinel")?(a=e(d,{children:"· "}),m=e(d,{bold:!0,children:"Puedes ayudar a mejorar Context "}),c[2]=a,c[3]=m):(a=c[2],m=c[3]),c[4]===Symbol.for("react.memo_cache_sentinel")?(_=e(l,{paddingLeft:1,children:o(d,{children:[a,m,o(d,{children:["— Permite el uso de tus chats y sesiones de código para entrenar y mejorar los modelos de IA de Anthropic. Cambia esto en cualquier momento en tu Configuración de Privacidad (",e(s,{url:"https://claude.ai/settings/data-privacy-controls"}),")."]})]})}),c[4]=_):_=c[4],c[5]===Symbol.for("react.memo_cache_sentinel")?(u=o(l,{flexDirection:"column",children:[i,_,e(l,{paddingLeft:1,children:o(d,{children:[e(d,{children:"· "}),e(d,{bold:!0,children:"Actualizaciones a la retención de datos "}),e(d,{children:"— Para ayudarnos a mejorar nuestros modelos de IA y protecciones de seguridad, extenderemos la retención de datos a 5 años."})]})})]}),c[5]=u):u=c[5],c[6]===Symbol.for("react.memo_cache_sentinel")?(h=e(s,{url:"https://www.anthropic.com/news/updates-to-our-consumer-terms"}),c[6]=h):h=c[6],c[7]===Symbol.for("react.memo_cache_sentinel")?(p=e(s,{url:"https://anthropic.com/legal/terms"}),c[7]=p):p=c[7],c[8]===Symbol.for("react.memo_cache_sentinel")?(f=o(r,{children:[t,u,o(d,{children:["Más información (",h,") o lee los Términos del Consumidor actualizados (",p,") y la Política de Privacidad (",e(s,{url:"https://anthropic.com/legal/privacy"}),")"]})]}),c[8]=f):f=c[8],f}function PostGracePeriodContentBody(){const c=n(7);let t,i,a,m,_,u,h;return c[0]===Symbol.for("react.memo_cache_sentinel")?(t=e(d,{children:"Hemos actualizado nuestros Términos del Consumidor y Política de Privacidad."}),c[0]=t):t=c[0],c[1]===Symbol.for("react.memo_cache_sentinel")?(i=e(d,{children:"¿Qué está cambiando?"}),c[1]=i):i=c[1],c[2]===Symbol.for("react.memo_cache_sentinel")?(a=o(l,{flexDirection:"column",children:[e(d,{bold:!0,children:"Ayudar a mejorar Context"}),e(d,{children:"Permite el uso de tus chats y sesiones de código para entrenar y mejorar los modelos de IA de Anthropic. Puedes cambiar esto en cualquier momento en Configuración de Privacidad"}),e(s,{url:"https://claude.ai/settings/data-privacy-controls"})]}),c[2]=a):a=c[2],c[3]===Symbol.for("react.memo_cache_sentinel")?(m=o(l,{flexDirection:"column",gap:1,children:[i,a,o(l,{flexDirection:"column",children:[e(d,{bold:!0,children:"Cómo afecta esto la retención de datos"}),e(d,{children:"Activar el ajuste de mejorar Context extiende la retención de datos de 30 días a 5 años. Desactivarlo mantiene la retención predeterminada de 30 días. Puedes borrar datos en cualquier momento."})]})]}),c[3]=m):m=c[3],c[4]===Symbol.for("react.memo_cache_sentinel")?(_=e(s,{url:"https://www.anthropic.com/news/updates-to-our-consumer-terms"}),c[4]=_):_=c[4],c[5]===Symbol.for("react.memo_cache_sentinel")?(u=e(s,{url:"https://anthropic.com/legal/terms"}),c[5]=u):u=c[5],c[6]===Symbol.for("react.memo_cache_sentinel")?(h=o(r,{children:[t,m,o(d,{children:["Learn more (",_,") or read the updated Consumer Terms (",u,") and Privacy Policy (",e(s,{url:"https://anthropic.com/legal/privacy"}),")"]})]}),c[6]=h):h=c[6],h}export function GroveDialog(r){const c=n(34),{showIfAlreadyViewed:s,location:m,onDone:g}=r,[v,S]=i(null),[x,P]=i(null);let C,w,j;if(c[0]!==m||c[1]!==g||c[2]!==s?(C=()=>{!async function(){const[e,o]=await Promise.all([h(),u()]),r=o.success?o.data:null;P(r);const n=_(e,o,s);S(n),n?(p(),a("tengu_grove_policy_viewed",{location:m,dismissable:r?.notice_is_grace_period})):g("skip_rendering")}()},w=[s,m,g],c[0]=m,c[1]=g,c[2]=s,c[3]=C,c[4]=w):(C=c[3],w=c[4]),t(C,w),null===v)return null;if(!v)return null;c[5]!==x?.notice_is_grace_period||c[6]!==g?(j=async function(e){e:switch(e){case"accept_opt_in":await f(!0),a("tengu_grove_policy_submitted",{state:!0,dismissable:x?.notice_is_grace_period});break e;case"accept_opt_out":await f(!1),a("tengu_grove_policy_submitted",{state:!1,dismissable:x?.notice_is_grace_period});break e;case"defer":a("tengu_grove_policy_dismissed",{state:!0});break e;case"escape":a("tengu_grove_policy_escaped",{})}g(e)},c[5]=x?.notice_is_grace_period,c[6]=g,c[7]=j):j=c[7];const A=j;let D;c[8]!==x?.domain_excluded?(D=x?.domain_excluded?[{label:"Aceptar términos · Ayudar a mejorar Context: NO (para correos con tu dominio)",value:"accept_opt_out"}]:[{label:"Aceptar términos · Ayudar a mejorar Context: ",value:"accept_opt_in"},{label:"Aceptar términos · Ayudar a mejorar Context: NO",value:"accept_opt_out"}],c[8]=x?.domain_excluded,c[9]=D):D=c[9];const E=D;let k;c[10]!==x?.notice_is_grace_period||c[11]!==A?(k=function(){A(x?.notice_is_grace_period?"defer":"escape")},c[10]=x?.notice_is_grace_period,c[11]=A,c[12]=k):k=c[12];const B=k;let G,T,z,N,q,I,H,L,M;return c[13]!==x?.notice_is_grace_period?(G=e(l,{flexDirection:"column",gap:1,flexGrow:1,children:e(x?.notice_is_grace_period?GracePeriodContentBody:PostGracePeriodContentBody,{})}),c[13]=x?.notice_is_grace_period,c[14]=G):G=c[14],c[15]===Symbol.for("react.memo_cache_sentinel")?(T=e(l,{flexShrink:0,children:e(d,{color:"professionalBlue",children:" _____________\n | \\ \\\n | NEW TERMS \\__\\\n | |\n | ---------- |\n | ---------- |\n | ---------- |\n | ---------- |\n | ---------- |\n | |\n |______________|"})}),c[15]=T):T=c[15],c[16]!==G?(z=o(l,{flexDirection:"row",children:[G,T]}),c[16]=G,c[17]=z):z=c[17],c[18]===Symbol.for("react.memo_cache_sentinel")?(N=o(l,{flexDirection:"column",children:[e(d,{bold:!0,children:"Selecciona cómo quieres continuar"}),e(d,{children:"Tu elección tendrá efecto inmediato al confirmar."})]}),c[18]=N):N=c[18],c[19]!==x?.notice_is_grace_period?(q=x?.notice_is_grace_period?[{label:"Ahora no",value:"defer"}]:[],c[19]=x?.notice_is_grace_period,c[20]=q):q=c[20],c[21]!==E||c[22]!==q?(I=[...E,...q],c[21]=E,c[22]=q,c[23]=I):I=c[23],c[24]!==A?(H=e=>A(e),c[24]=A,c[25]=H):H=c[25],c[26]!==B||c[27]!==I||c[28]!==H?(L=o(l,{flexDirection:"column",gap:1,children:[N,e(y,{options:I,onChange:H,onCancel:B})]}),c[26]=B,c[27]=I,c[28]=H,c[29]=L):L=c[29],c[30]!==B||c[31]!==L||c[32]!==z?(M=o(b,{title:"Updates to Consumer Terms and Policies",color:"professionalBlue",onCancel:B,inputGuide:_temp,children:[z,L]}),c[30]=B,c[31]=L,c[32]=z,c[33]=M):M=c[33],M}function _temp(r){return r.pending?o(d,{children:["Presiona ",r.keyName," de nuevo para salir"]}):o(g,{children:[e(v,{shortcut:"Enter",action:"confirmar"}),e(v,{shortcut:"Esc",action:"cancelar"})]})}export function PrivacySettingsDialog(r){const t=n(17),{settings:a,domainExcluded:_,onDone:u}=r,[h,p]=i(a.grove_enabled);let y,S,x;t[0]===Symbol.for("react.memo_cache_sentinel")?(y=[],t[0]=y):y=t[0],c.useEffect(_temp2,y),t[1]!==_||t[2]!==h?(S=async(e,o)=>{if(!_&&(o.tab||o.return||" "===e)){const e=!h;p(e),await f(e)}},t[1]=_,t[2]=h,t[3]=S):S=t[3],m(S),t[4]===Symbol.for("react.memo_cache_sentinel")?(x=e(d,{color:"error",children:"false"}),t[4]=x):x=t[4];let P,C,w,j,A,D=x;if(_){let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=e(d,{color:"error",children:"false (for emails with your domain)"}),t[5]=o):o=t[5],D=o}else if(h){let o;t[6]===Symbol.for("react.memo_cache_sentinel")?(o=e(d,{color:"success",children:"true"}),t[6]=o):o=t[6],D=o}return t[7]!==_?(P=r=>r.pending?o(d,{children:["Presiona ",r.keyName," de nuevo para salir"]}):_?e(v,{shortcut:"Esc",action:"cancelar"}):o(g,{children:[e(v,{shortcut:"Enter/Tab/Space",action:"toggle"}),e(v,{shortcut:"Esc",action:"cancelar"})]}),t[7]=_,t[8]=P):P=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(C=o(d,{children:["Revisa y gestiona tu configuración de privacidad en"," ",e(s,{url:"https://claude.ai/settings/data-privacy-controls"})]}),t[9]=C):C=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(w=e(l,{width:44,children:e(d,{bold:!0,children:"Help improve Claude"})}),t[10]=w):w=t[10],t[11]!==D?(j=o(l,{children:[w,e(l,{children:D})]}),t[11]=D,t[12]=j):j=t[12],t[13]!==u||t[14]!==P||t[15]!==j?(A=o(b,{title:"Data Privacy",color:"professionalBlue",onCancel:u,inputGuide:P,children:[C,j]}),t[13]=u,t[14]=P,t[15]=j,t[16]=A):A=t[16],A}function _temp2(){a("tengu_grove_privacy_settings_viewed",{})}
@@ -1 +1 @@
1
- import{jsxs as o,jsx as e}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import n from"figures";import{Box as i,Link as r,Text as s}from"../../ink.js";import{plural as c}from"../../utils/stringUtils.js";import{Select as l}from"../CustomSelect/select.js";import{Dialog as m}from"../design-system/Dialog.js";export function SelectEventMode(d){const a=t(23),{hookEventMetadata:u,hooksByEvent:h,totalHooksCount:f,restrictedByPolicy:g,onSelectEvent:p,onCancel:k}=d;let j;a[0]!==f?(j=c(f,"hook"),a[0]=f,a[1]=j):j=a[1];const y=`${f} ${j} configured`;let x,C,b,v,D,E,S,H;return a[2]!==g?(x=g&&o(i,{flexDirection:"column",children:[o(s,{color:"suggestion",children:[n.info," Hooks Restricted by Policy"]}),e(s,{dimColor:!0,children:"Only hooks from managed settings can run. User-defined hooks from ~/.context/settings.json, .context/settings.json, and .context/settings.local.json are blocked."})]}),a[2]=g,a[3]=x):x=a[3],a[4]===Symbol.for("react.memo_cache_sentinel")?(C=e(i,{flexDirection:"column",children:o(s,{dimColor:!0,children:[n.info," This menu is read-only. To add or modify hooks, edit settings.json directly or ask Claude."," ",e(r,{url:"https://code.claude.com/docs/en/hooks",children:"Learn more"})]})}),a[4]=C):C=a[4],a[5]!==p?(b=o=>{p(o)},a[5]=p,a[6]=b):b=a[6],a[7]!==u?(v=Object.entries(u),a[7]=u,a[8]=v):v=a[8],a[9]!==h||a[10]!==v?(D=v.map(e=>{const[t,n]=e,i=h[t]||0;return{label:i>0?o(s,{children:[t," ",o(s,{color:"suggestion",children:["(",i,")"]})]}):t,value:t,description:n.summary}}),a[9]=h,a[10]=v,a[11]=D):D=a[11],a[12]!==k||a[13]!==b||a[14]!==D?(E=e(i,{flexDirection:"column",children:e(l,{onChange:b,onCancel:k,options:D})}),a[12]=k,a[13]=b,a[14]=D,a[15]=E):E=a[15],a[16]!==x||a[17]!==E?(S=o(i,{flexDirection:"column",gap:1,children:[x,C,E]}),a[16]=x,a[17]=E,a[18]=S):S=a[18],a[19]!==k||a[20]!==y||a[21]!==S?(H=e(m,{title:"Hooks",subtitle:y,onCancel:k,children:S}),a[19]=k,a[20]=y,a[21]=S,a[22]=H):H=a[22],H}
1
+ import{jsxs as o,jsx as e}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import n from"figures";import{Box as s,Link as i,Text as r}from"../../ink.js";import{plural as c}from"../../utils/stringUtils.js";import{Select as l}from"../CustomSelect/select.js";import{Dialog as a}from"../design-system/Dialog.js";export function SelectEventMode(d){const m=t(23),{hookEventMetadata:u,hooksByEvent:f,totalHooksCount:h,restrictedByPolicy:g,onSelectEvent:p,onCancel:j}=d;let x;m[0]!==h?(x=c(h,"hook"),m[0]=h,m[1]=x):x=m[1];const k=`${h} ${x} configured`;let C,y,b,v,D,E,S,H;return m[2]!==g?(C=g&&o(s,{flexDirection:"column",children:[o(r,{color:"suggestion",children:[n.info," Hooks restringidos por política"]}),e(r,{dimColor:!0,children:"Solo pueden ejecutarse hooks desde configuraciones gestionadas. Los hooks definidos por usuario en ~/.context/settings.json, .context/settings.json y .context/settings.local.json están bloqueados."})]}),m[2]=g,m[3]=C):C=m[3],m[4]===Symbol.for("react.memo_cache_sentinel")?(y=e(s,{flexDirection:"column",children:o(r,{dimColor:!0,children:[n.info," Este menú es de solo lectura. Para agregar o modificar hooks, edita settings.json directamente o pídeselo a Context."," ",e(i,{url:"https://code.claude.com/docs/en/hooks",children:"Más info"})]})}),m[4]=y):y=m[4],m[5]!==p?(b=o=>{p(o)},m[5]=p,m[6]=b):b=m[6],m[7]!==u?(v=Object.entries(u),m[7]=u,m[8]=v):v=m[8],m[9]!==f||m[10]!==v?(D=v.map(e=>{const[t,n]=e,s=f[t]||0;return{label:s>0?o(r,{children:[t," ",o(r,{color:"suggestion",children:["(",s,")"]})]}):t,value:t,description:n.summary}}),m[9]=f,m[10]=v,m[11]=D):D=m[11],m[12]!==j||m[13]!==b||m[14]!==D?(E=e(s,{flexDirection:"column",children:e(l,{onChange:b,onCancel:j,options:D})}),m[12]=j,m[13]=b,m[14]=D,m[15]=E):E=m[15],m[16]!==C||m[17]!==E?(S=o(s,{flexDirection:"column",gap:1,children:[C,y,E]}),m[16]=C,m[17]=E,m[18]=S):S=m[18],m[19]!==j||m[20]!==k||m[21]!==S?(H=e(a,{title:"Hooks",subtitle:k,onCancel:j,children:S}),m[19]=j,m[20]=k,m[21]=S,m[22]=H):H=m[22],H}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{Box as i,Text as n}from"../../ink.js";import{getHookDisplayText as r,hookSourceHeaderDisplayString as c}from"../../utils/hooks/hooksSettings.js";import{Select as s}from"../CustomSelect/select.js";import{Dialog as l}from"../design-system/Dialog.js";export function SelectHookMode(r){const c=o(19),{selectedEvent:a,selectedMatcher:m,hooksForSelectedMatcher:d,hookEventMetadata:p,onSelect:u,onCancel:h}=r,f=void 0!==p.matcherMetadata?`${a} - Matcher: ${m||"(all)"}`:a;if(0===d.length){let o,r;return c[0]===Symbol.for("react.memo_cache_sentinel")?(o=t(i,{flexDirection:"column",gap:1,children:[e(n,{dimColor:!0,children:"No hooks configured for this event."}),e(n,{dimColor:!0,children:"To add hooks, edit settings.json directly or ask Claude."})]}),c[0]=o):o=c[0],c[1]!==p.description||c[2]!==h||c[3]!==f?(r=e(l,{title:f,subtitle:p.description,onCancel:h,inputGuide:_temp,children:o}),c[1]=p.description,c[2]=h,c[3]=f,c[4]=r):r=c[4],r}const g=p.description;let k,C,j,v;return c[5]!==d?(k=d.map(_temp2),c[5]=d,c[6]=k):k=c[6],c[7]!==d||c[8]!==u?(C=e=>{const t=parseInt(e,10),o=d[t];o&&u(o)},c[7]=d,c[8]=u,c[9]=C):C=c[9],c[10]!==h||c[11]!==k||c[12]!==C?(j=e(i,{flexDirection:"column",children:e(s,{options:k,onChange:C,onCancel:h})}),c[10]=h,c[11]=k,c[12]=C,c[13]=j):j=c[13],c[14]!==p.description||c[15]!==h||c[16]!==j||c[17]!==f?(v=e(l,{title:f,subtitle:g,onCancel:h,children:j}),c[14]=p.description,c[15]=h,c[16]=j,c[17]=f,c[18]=v):v=c[18],v}function _temp2(e,t){return{label:`[${e.config.type}] ${r(e.config)}`,value:t.toString(),description:"pluginHook"===e.source&&e.pluginName?`${c(e.source)} (${e.pluginName})`:c(e.source)}}function _temp(){return e(n,{children:"Esc para volver"})}
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{Box as n,Text as i}from"../../ink.js";import{getHookDisplayText as r,hookSourceHeaderDisplayString as c}from"../../utils/hooks/hooksSettings.js";import{Select as s}from"../CustomSelect/select.js";import{Dialog as l}from"../design-system/Dialog.js";export function SelectHookMode(r){const c=o(19),{selectedEvent:a,selectedMatcher:m,hooksForSelectedMatcher:p,hookEventMetadata:d,onSelect:u,onCancel:h}=r,f=void 0!==d.matcherMetadata?`${a} - Matcher: ${m||"(all)"}`:a;if(0===p.length){let o,r;return c[0]===Symbol.for("react.memo_cache_sentinel")?(o=t(n,{flexDirection:"column",gap:1,children:[e(i,{dimColor:!0,children:"No hay hooks configurados para este evento."}),e(i,{dimColor:!0,children:"Para agregar hooks, edita settings.json directamente o pídeselo a Context."})]}),c[0]=o):o=c[0],c[1]!==d.description||c[2]!==h||c[3]!==f?(r=e(l,{title:f,subtitle:d.description,onCancel:h,inputGuide:_temp,children:o}),c[1]=d.description,c[2]=h,c[3]=f,c[4]=r):r=c[4],r}const g=d.description;let k,C,j,v;return c[5]!==p?(k=p.map(_temp2),c[5]=p,c[6]=k):k=c[6],c[7]!==p||c[8]!==u?(C=e=>{const t=parseInt(e,10),o=p[t];o&&u(o)},c[7]=p,c[8]=u,c[9]=C):C=c[9],c[10]!==h||c[11]!==k||c[12]!==C?(j=e(n,{flexDirection:"column",children:e(s,{options:k,onChange:C,onCancel:h})}),c[10]=h,c[11]=k,c[12]=C,c[13]=j):j=c[13],c[14]!==d.description||c[15]!==h||c[16]!==j||c[17]!==f?(v=e(l,{title:f,subtitle:g,onCancel:h,children:j}),c[14]=d.description,c[15]=h,c[16]=j,c[17]=f,c[18]=v):v=c[18],v}function _temp2(e,t){return{label:`[${e.config.type}] ${r(e.config)}`,value:t.toString(),description:"pluginHook"===e.source&&e.pluginName?`${c(e.source)} (${e.pluginName})`:c(e.source)}}function _temp(){return e(i,{children:"Esc para volver"})}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{Box as n,Text as r}from"../../ink.js";import{hookSourceInlineDisplayString as i}from"../../utils/hooks/hooksSettings.js";import{plural as s}from"../../utils/stringUtils.js";import{Select as c}from"../CustomSelect/select.js";import{Dialog as l}from"../design-system/Dialog.js";export function SelectMatcherMode(i){const s=o(25),{selectedEvent:m,matchersForSelectedEvent:a,hooksByEventAndMatcher:u,eventDescription:h,onSelect:p,onCancel:d}=i;let f;if(s[0]!==u||s[1]!==a||s[2]!==m){let e;s[4]!==u||s[5]!==m?(e=e=>{const t=u[m]?.[e]||[];return{matcher:e,sources:Array.from(new Set(t.map(_temp))),hookCount:t.length}},s[4]=u,s[5]=m,s[6]=e):e=s[6],f=a.map(e),s[0]=u,s[1]=a,s[2]=m,s[3]=f}else f=s[3];const C=f;if(0===a.length){const o=`${m} - Matchers`;let i,c;return s[7]===Symbol.for("react.memo_cache_sentinel")?(i=t(n,{flexDirection:"column",gap:1,children:[e(r,{dimColor:!0,children:"No hooks configured for this event."}),e(r,{dimColor:!0,children:"To add hooks, edit settings.json directly or ask Claude."})]}),s[7]=i):i=s[7],s[8]!==h||s[9]!==d||s[10]!==o?(c=e(l,{title:o,subtitle:h,onCancel:d,inputGuide:_temp2,children:i}),s[8]=h,s[9]=d,s[10]=o,s[11]=c):c=s[11],c}const k=`${m} - Matchers`;let g,j,v,_;return s[12]!==C?(g=C.map(_temp3),s[12]=C,s[13]=g):g=s[13],s[14]!==p?(j=e=>{p(e)},s[14]=p,s[15]=j):j=s[15],s[16]!==d||s[17]!==g||s[18]!==j?(v=e(n,{flexDirection:"column",children:e(c,{options:g,onChange:j,onCancel:d})}),s[16]=d,s[17]=g,s[18]=j,s[19]=v):v=s[19],s[20]!==h||s[21]!==d||s[22]!==k||s[23]!==v?(_=e(l,{title:k,subtitle:h,onCancel:d,children:v}),s[20]=h,s[21]=d,s[22]=k,s[23]=v,s[24]=_):_=s[24],_}function _temp3(e){return{label:`[${e.sources.map(i).join(", ")}] ${e.matcher||"(all)"}`,value:e.matcher,description:`${e.hookCount} ${s(e.hookCount,"hook")}`}}function _temp2(){return e(r,{children:"Esc para volver"})}function _temp(e){return e.source}
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{Box as n,Text as r}from"../../ink.js";import{hookSourceInlineDisplayString as s}from"../../utils/hooks/hooksSettings.js";import{plural as i}from"../../utils/stringUtils.js";import{Select as c}from"../CustomSelect/select.js";import{Dialog as l}from"../design-system/Dialog.js";export function SelectMatcherMode(s){const i=o(25),{selectedEvent:a,matchersForSelectedEvent:m,hooksByEventAndMatcher:h,eventDescription:u,onSelect:p,onCancel:d}=s;let f;if(i[0]!==h||i[1]!==m||i[2]!==a){let e;i[4]!==h||i[5]!==a?(e=e=>{const t=h[a]?.[e]||[];return{matcher:e,sources:Array.from(new Set(t.map(_temp))),hookCount:t.length}},i[4]=h,i[5]=a,i[6]=e):e=i[6],f=m.map(e),i[0]=h,i[1]=m,i[2]=a,i[3]=f}else f=i[3];const g=f;if(0===m.length){const o=`${a} - Matchers`;let s,c;return i[7]===Symbol.for("react.memo_cache_sentinel")?(s=t(n,{flexDirection:"column",gap:1,children:[e(r,{dimColor:!0,children:"No hay hooks configurados para este evento."}),e(r,{dimColor:!0,children:"Para agregar hooks, edita settings.json directamente o pídeselo a Context."})]}),i[7]=s):s=i[7],i[8]!==u||i[9]!==d||i[10]!==o?(c=e(l,{title:o,subtitle:u,onCancel:d,inputGuide:_temp2,children:s}),i[8]=u,i[9]=d,i[10]=o,i[11]=c):c=i[11],c}const C=`${a} - Matchers`;let j,k,v,_;return i[12]!==g?(j=g.map(_temp3),i[12]=g,i[13]=j):j=i[13],i[14]!==p?(k=e=>{p(e)},i[14]=p,i[15]=k):k=i[15],i[16]!==d||i[17]!==j||i[18]!==k?(v=e(n,{flexDirection:"column",children:e(c,{options:j,onChange:k,onCancel:d})}),i[16]=d,i[17]=j,i[18]=k,i[19]=v):v=i[19],i[20]!==u||i[21]!==d||i[22]!==C||i[23]!==v?(_=e(l,{title:C,subtitle:u,onCancel:d,children:v}),i[20]=u,i[21]=d,i[22]=C,i[23]=v,i[24]=_):_=i[24],_}function _temp3(e){return{label:`[${e.sources.map(s).join(", ")}] ${e.matcher||"(all)"}`,value:e.matcher,description:`${e.hookCount} ${i(e.hookCount,"hook")}`}}function _temp2(){return e(r,{children:"Esc para volver"})}function _temp(e){return e.source}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{c as n}from"react/compiler-runtime";import{Box as r,Text as i}from"../../ink.js";import{hookSourceDescriptionDisplayString as t}from"../../utils/hooks/hooksSettings.js";import{Dialog as c}from"../design-system/Dialog.js";export function ViewHookMode(l){const s=n(40),{selectedHook:a,eventSupportsMatcher:m,onCancel:d}=l;let h,u,p,g,f,y,C,k,v,j,x,b,M,S,D,N;return s[0]!==a.event?(h=o(i,{children:["Event: ",e(i,{bold:!0,children:a.event})]}),s[0]=a.event,s[1]=h):h=s[1],s[2]!==m||s[3]!==a.matcher?(u=m&&o(i,{children:["Matcher: ",e(i,{bold:!0,children:a.matcher||"(all)"})]}),s[2]=m,s[3]=a.matcher,s[4]=u):u=s[4],s[5]!==a.config.type?(p=o(i,{children:["Type: ",e(i,{bold:!0,children:a.config.type})]}),s[5]=a.config.type,s[6]=p):p=s[6],s[7]!==a.source?(g=t(a.source),s[7]=a.source,s[8]=g):g=s[8],s[9]!==g?(f=o(i,{children:["Source:"," ",e(i,{dimColor:!0,children:g})]}),s[9]=g,s[10]=f):f=s[10],s[11]!==a.pluginName?(y=a.pluginName&&o(i,{children:["Plugin: ",e(i,{dimColor:!0,children:a.pluginName})]}),s[11]=a.pluginName,s[12]=y):y=s[12],s[13]!==h||s[14]!==u||s[15]!==p||s[16]!==f||s[17]!==y?(C=o(r,{flexDirection:"column",children:[h,u,p,f,y]}),s[13]=h,s[14]=u,s[15]=p,s[16]=f,s[17]=y,s[18]=C):C=s[18],s[19]!==a.config?(k=function(e){switch(e.type){case"command":return"Command";case"prompt":case"agent":return"Prompt";case"http":return"URL"}}(a.config),s[19]=a.config,s[20]=k):k=s[20],s[21]!==k?(v=o(i,{dimColor:!0,children:[k,":"]}),s[21]=k,s[22]=v):v=s[22],s[23]!==a.config?(j=function(e){switch(e.type){case"command":return e.command;case"prompt":case"agent":return e.prompt;case"http":return e.url}}(a.config),s[23]=a.config,s[24]=j):j=s[24],s[25]!==j?(x=e(r,{borderStyle:"round",borderDimColor:!0,paddingLeft:1,paddingRight:1,children:e(i,{children:j})}),s[25]=j,s[26]=x):x=s[26],s[27]!==x||s[28]!==v?(b=o(r,{flexDirection:"column",children:[v,x]}),s[27]=x,s[28]=v,s[29]=b):b=s[29],s[30]!==a.config?(M="statusMessage"in a.config&&a.config.statusMessage&&o(i,{children:["Status message:"," ",e(i,{dimColor:!0,children:a.config.statusMessage})]}),s[30]=a.config,s[31]=M):M=s[31],s[32]===Symbol.for("react.memo_cache_sentinel")?(S=e(i,{dimColor:!0,children:"To modify or remove this hook, edit settings.json directly or ask Claude to help."}),s[32]=S):S=s[32],s[33]!==b||s[34]!==M||s[35]!==C?(D=o(r,{flexDirection:"column",gap:1,children:[C,b,M,S]}),s[33]=b,s[34]=M,s[35]=C,s[36]=D):D=s[36],s[37]!==d||s[38]!==D?(N=e(c,{title:"Hook details",onCancel:d,inputGuide:_temp,children:D}),s[37]=d,s[38]=D,s[39]=N):N=s[39],N}function _temp(){return e(i,{children:"Esc para volver"})}
1
+ import{jsx as e,jsxs as n}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{Box as r,Text as i}from"../../ink.js";import{hookSourceDescriptionDisplayString as t}from"../../utils/hooks/hooksSettings.js";import{Dialog as c}from"../design-system/Dialog.js";export function ViewHookMode(l){const s=o(40),{selectedHook:a,eventSupportsMatcher:m,onCancel:d}=l;let p,u,h,g,f,C,y,x,j,k,v,b,M,S,D,N;return s[0]!==a.event?(p=n(i,{children:["Event: ",e(i,{bold:!0,children:a.event})]}),s[0]=a.event,s[1]=p):p=s[1],s[2]!==m||s[3]!==a.matcher?(u=m&&n(i,{children:["Matcher: ",e(i,{bold:!0,children:a.matcher||"(all)"})]}),s[2]=m,s[3]=a.matcher,s[4]=u):u=s[4],s[5]!==a.config.type?(h=n(i,{children:["Type: ",e(i,{bold:!0,children:a.config.type})]}),s[5]=a.config.type,s[6]=h):h=s[6],s[7]!==a.source?(g=t(a.source),s[7]=a.source,s[8]=g):g=s[8],s[9]!==g?(f=n(i,{children:["Source:"," ",e(i,{dimColor:!0,children:g})]}),s[9]=g,s[10]=f):f=s[10],s[11]!==a.pluginName?(C=a.pluginName&&n(i,{children:["Plugin: ",e(i,{dimColor:!0,children:a.pluginName})]}),s[11]=a.pluginName,s[12]=C):C=s[12],s[13]!==p||s[14]!==u||s[15]!==h||s[16]!==f||s[17]!==C?(y=n(r,{flexDirection:"column",children:[p,u,h,f,C]}),s[13]=p,s[14]=u,s[15]=h,s[16]=f,s[17]=C,s[18]=y):y=s[18],s[19]!==a.config?(x=function(e){switch(e.type){case"command":return"Command";case"prompt":case"agent":return"Prompt";case"http":return"URL"}}(a.config),s[19]=a.config,s[20]=x):x=s[20],s[21]!==x?(j=n(i,{dimColor:!0,children:[x,":"]}),s[21]=x,s[22]=j):j=s[22],s[23]!==a.config?(k=function(e){switch(e.type){case"command":return e.command;case"prompt":case"agent":return e.prompt;case"http":return e.url}}(a.config),s[23]=a.config,s[24]=k):k=s[24],s[25]!==k?(v=e(r,{borderStyle:"round",borderDimColor:!0,paddingLeft:1,paddingRight:1,children:e(i,{children:k})}),s[25]=k,s[26]=v):v=s[26],s[27]!==v||s[28]!==j?(b=n(r,{flexDirection:"column",children:[j,v]}),s[27]=v,s[28]=j,s[29]=b):b=s[29],s[30]!==a.config?(M="statusMessage"in a.config&&a.config.statusMessage&&n(i,{children:["Status message:"," ",e(i,{dimColor:!0,children:a.config.statusMessage})]}),s[30]=a.config,s[31]=M):M=s[31],s[32]===Symbol.for("react.memo_cache_sentinel")?(S=e(i,{dimColor:!0,children:"Para modificar o eliminar este hook, edita settings.json directamente o pídeselo a Context."}),s[32]=S):S=s[32],s[33]!==b||s[34]!==M||s[35]!==y?(D=n(r,{flexDirection:"column",gap:1,children:[y,b,M,S]}),s[33]=b,s[34]=M,s[35]=y,s[36]=D):D=s[36],s[37]!==d||s[38]!==D?(N=e(c,{title:"Hook details",onCancel:d,inputGuide:_temp,children:D}),s[37]=d,s[38]=D,s[39]=N):N=s[39],N}function _temp(){return e(i,{children:"Esc para volver"})}
@@ -1 +1 @@
1
- import{jsxs as n,jsx as e}from"react/jsx-runtime";import r from"figures";import{useCallback as i,useEffect as t,useRef as o,useState as c}from"react";import{Box as l,color as a,Link as s,Text as d,useTheme as u}from"../../ink.js";import{useKeybinding as h}from"../../keybindings/useKeybinding.js";import{AuthenticationCancelledError as m,performMCPOAuthFlow as f}from"../../services/mcp/auth.js";import{capitalize as p}from"../../utils/stringUtils.js";import{ConfigurableShortcutHint as g}from"../ConfigurableShortcutHint.js";import{Select as b}from"../CustomSelect/index.js";import{Byline as y}from"../design-system/Byline.js";import{Dialog as C}from"../design-system/Dialog.js";import{KeyboardShortcutHint as v}from"../design-system/KeyboardShortcutHint.js";import{Spinner as w}from"../Spinner.js";export function MCPAgentServerMenu({agentServer:j,onCancel:A,onComplete:x}){const[k]=u(),[S,E]=c(!1),[U,D]=c(null),[R,T]=c(null),L=o(null);t(()=>()=>L.current?.abort(),[]);const M=i(()=>{S&&(L.current?.abort(),L.current=null,E(!1),T(null))},[S]);h("confirm:no",M,{context:"Confirmation",isActive:S});const P=i(async()=>{if(!j.needsAuth||!j.url)return;E(!0),D(null);const n=new AbortController;L.current=n;try{const e={type:j.transport,url:j.url};await f(j.name,e,T,n.signal),x?.(`Authentication successful for ${j.name}. The server will connect when the agent runs.`)}catch(n){n instanceof Error&&!(n instanceof m)&&D(n.message)}finally{E(!1),L.current=null}},[j,x]),B=p(String(j.name));if(S)return n(l,{flexDirection:"column",gap:1,padding:1,children:[n(d,{color:"claude",children:["Authenticating with ",j.name,"…"]}),n(l,{children:[e(w,{}),e(d,{children:" A browser window will open for authentication"})]}),R&&n(l,{flexDirection:"column",children:[e(d,{dimColor:!0,children:"If your browser doesn't open automatically, copy this URL manually:"}),e(s,{url:R})]}),e(l,{marginLeft:3,children:n(d,{dimColor:!0,children:["Return here after authenticating in your browser."," ",e(g,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"volver"})]})})]});const H=[];return j.needsAuth&&H.push({label:j.isAuthenticated?"Re-authenticate":"Authenticate",value:"auth"}),H.push({label:"Back",value:"back"}),n(C,{title:`${B} MCP Server`,subtitle:"agent-only",onCancel:A,inputGuide:r=>r.pending?n(d,{children:["Presiona ",r.keyName," de nuevo para salir"]}):n(y,{children:[e(v,{shortcut:"↑↓",action:"navegar"}),e(v,{shortcut:"Enter",action:"confirmar"}),e(g,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"volver"})]}),children:[n(l,{flexDirection:"column",gap:0,children:[n(l,{children:[e(d,{bold:!0,children:"Type: "}),e(d,{dimColor:!0,children:j.transport})]}),j.url&&n(l,{children:[e(d,{bold:!0,children:"URL: "}),e(d,{dimColor:!0,children:j.url})]}),j.command&&n(l,{children:[e(d,{bold:!0,children:"Command: "}),e(d,{dimColor:!0,children:j.command})]}),n(l,{children:[e(d,{bold:!0,children:"Used by: "}),e(d,{dimColor:!0,children:j.sourceAgents.join(", ")})]}),n(l,{marginTop:1,children:[e(d,{bold:!0,children:"Status: "}),n(d,{children:[a("inactive",k)(r.radioOff)," not connected (agent-only)"]})]}),j.needsAuth&&n(l,{children:[e(d,{bold:!0,children:"Auth: "}),j.isAuthenticated?n(d,{children:[a("success",k)(r.tick)," authenticated"]}):n(d,{children:[a("warning",k)(r.triangleUpOutline)," may need authentication"]})]})]}),e(l,{children:e(d,{dimColor:!0,children:"This server connects only when running the agent."})}),U&&e(l,{children:n(d,{color:"error",children:["Error: ",U]})}),e(l,{children:e(b,{options:H,onChange:async n=>{switch(n){case"auth":await P();break;case"back":A()}},onCancel:A})})]})}
1
+ import{jsxs as n,jsx as e}from"react/jsx-runtime";import r from"figures";import{useCallback as t,useEffect as i,useRef as o,useState as c}from"react";import{Box as l,color as a,Link as s,Text as d,useTheme as u}from"../../ink.js";import{useKeybinding as m}from"../../keybindings/useKeybinding.js";import{AuthenticationCancelledError as h,performMCPOAuthFlow as f}from"../../services/mcp/auth.js";import{capitalize as p}from"../../utils/stringUtils.js";import{ConfigurableShortcutHint as g}from"../ConfigurableShortcutHint.js";import{Select as b}from"../CustomSelect/index.js";import{Byline as y}from"../design-system/Byline.js";import{Dialog as C}from"../design-system/Dialog.js";import{KeyboardShortcutHint as v}from"../design-system/KeyboardShortcutHint.js";import{Spinner as j}from"../Spinner.js";export function MCPAgentServerMenu({agentServer:A,onCancel:w,onComplete:x}){const[k]=u(),[S,E]=c(!1),[U,D]=c(null),[R,L]=c(null),M=o(null);i(()=>()=>M.current?.abort(),[]);const P=t(()=>{S&&(M.current?.abort(),M.current=null,E(!1),L(null))},[S]);m("confirm:no",P,{context:"Confirmation",isActive:S});const T=t(async()=>{if(!A.needsAuth||!A.url)return;E(!0),D(null);const n=new AbortController;M.current=n;try{const e={type:A.transport,url:A.url};await f(A.name,e,L,n.signal),x?.(`Authentication successful for ${A.name}. The server will connect when the agent runs.`)}catch(n){n instanceof Error&&!(n instanceof h)&&D(n.message)}finally{E(!1),M.current=null}},[A,x]),B=p(String(A.name));if(S)return n(l,{flexDirection:"column",gap:1,padding:1,children:[n(d,{color:"claude",children:["Autenticando con ",A.name,"…"]}),n(l,{children:[e(j,{}),e(d,{children:" A browser window will open for authentication"})]}),R&&n(l,{flexDirection:"column",children:[e(d,{dimColor:!0,children:"If your browser doesn't open automatically, copy this URL manually:"}),e(s,{url:R})]}),e(l,{marginLeft:3,children:n(d,{dimColor:!0,children:["Return here after authenticating in your browser."," ",e(g,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"volver"})]})})]});const H=[];return A.needsAuth&&H.push({label:A.isAuthenticated?"Re-authenticate":"Authenticate",value:"auth"}),H.push({label:"Back",value:"back"}),n(C,{title:`${B} MCP Server`,subtitle:"agent-only",onCancel:w,inputGuide:r=>r.pending?n(d,{children:["Presiona ",r.keyName," de nuevo para salir"]}):n(y,{children:[e(v,{shortcut:"↑↓",action:"navegar"}),e(v,{shortcut:"Enter",action:"confirmar"}),e(g,{action:"confirm:no",context:"Confirmation",fallback:"Esc",description:"volver"})]}),children:[n(l,{flexDirection:"column",gap:0,children:[n(l,{children:[e(d,{bold:!0,children:"Type: "}),e(d,{dimColor:!0,children:A.transport})]}),A.url&&n(l,{children:[e(d,{bold:!0,children:"URL: "}),e(d,{dimColor:!0,children:A.url})]}),A.command&&n(l,{children:[e(d,{bold:!0,children:"Command: "}),e(d,{dimColor:!0,children:A.command})]}),n(l,{children:[e(d,{bold:!0,children:"Used by: "}),e(d,{dimColor:!0,children:A.sourceAgents.join(", ")})]}),n(l,{marginTop:1,children:[e(d,{bold:!0,children:"Status: "}),n(d,{children:[a("inactive",k)(r.radioOff)," not connected (agent-only)"]})]}),A.needsAuth&&n(l,{children:[e(d,{bold:!0,children:"Auth: "}),A.isAuthenticated?n(d,{children:[a("success",k)(r.tick)," authenticated"]}):n(d,{children:[a("warning",k)(r.triangleUpOutline)," may need authentication"]})]})]}),e(l,{children:e(d,{dimColor:!0,children:"Este servidor solo se conecta al ejecutar el agente."})}),U&&e(l,{children:n(d,{color:"error",children:["Error: ",U]})}),e(l,{children:e(b,{options:H,onChange:async n=>{switch(n){case"auth":await T();break;case"back":w()}},onCancel:w})})]})}
@@ -1 +1 @@
1
- export function handleReconnectResult(e,n){switch(e.client.type){case"connected":return{message:`Reconnected to ${n}.`,success:!0};case"needs-auth":return{message:`${n} requires authentication. Use the 'Authenticate' option.`,success:!1};case"failed":return{message:`Failed to reconnect to ${n}.`,success:!1};default:return{message:`Unknown result when reconnecting to ${n}.`,success:!1}}}export function handleReconnectError(e,n){return`Error reconnecting to ${n}: ${e instanceof Error?e.message:String(e)}`}
1
+ export function handleReconnectResult(e,c){switch(e.client.type){case"connected":return{message:`Reconectado con ${c}.`,success:!0};case"needs-auth":return{message:`${c} requiere autenticación. Usa la opción 'Autenticar'.`,success:!1};case"failed":return{message:`Error al reconectar con ${c}.`,success:!1};default:return{message:`Resultado desconocido al reconectar con ${c}.`,success:!1}}}export function handleReconnectError(e,c){return`Error reconnecting to ${c}: ${e instanceof Error?e.message:String(e)}`}
@@ -1 +1 @@
1
- import{feature as e}from"../../recovery/bunBundleShim.js";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{createRequire as r}from"module";const n=r(import.meta.url);import{c as m}from"react/compiler-runtime";import s from"chalk";import{mkdir as i}from"fs/promises";import{join as l}from"path";import{use as a,useEffect as c,useState as p}from"react";import{getOriginalCwd as u}from"../../bootstrap/state.js";import{useExitOnCtrlCDWithKeybindings as f}from"../../hooks/useExitOnCtrlCDWithKeybindings.js";import{Box as d,Text as h}from"../../ink.js";import{useKeybinding as y}from"../../keybindings/useKeybinding.js";import{getAutoMemPath as _,isAutoMemoryEnabled as g}from"../../memdir/paths.js";import{logEvent as j}from"../../services/analytics/index.js";import{isAutoDreamEnabled as v}from"../../services/autoDream/config.js";import{readLastConsolidatedAt as b}from"../../services/autoDream/consolidationLock.js";import{useAppState as x}from"../../state/AppState.js";import{getAgentMemoryDir as A}from"../../tools/AgentTool/agentMemory.js";import{openPath as C}from"../../utils/browser.js";import{getMemoryFiles as M}from"../../utils/claudemd.js";import{getClaudeConfigHomeDir as S}from"../../utils/envUtils.js";import{getDisplayPath as D}from"../../utils/file.js";import{formatRelativeTimeAgo as $}from"../../utils/format.js";import{projectIsInGitRepo as E}from"../../utils/memory/versions.js";import{updateSettingsForSource as U}from"../../utils/settings/settings.js";import{Select as T}from"../CustomSelect/index.js";import{ListItem as k}from"../design-system/ListItem.js";const L=e("TEAMMEM")?n("../../memdir/teamMemPaths.js"):null;let F;const P="__open_folder__";export function MemoryFileSelector(r){const n=m(58),{onSelect:w,onCancel:N}=r,O=a(M()),B=l(S(),"CLAUDE.md"),I=l(u(),"CLAUDE.md"),K=O.some(e=>e.path===B),W=O.some(e=>e.path===I),V=[...O.filter(_temp).map(_temp2),...K?[]:[{path:B,type:"User",content:"",exists:!1}],...W?[]:[{path:I,type:"Project",content:"",exists:!1}]],q=new Map,z=V.map(e=>{const t=D(e.path),o=e.exists?"":" (new)",r=e.parent?(q.get(e.parent)??0)+1:0;q.set(e.path,r);const n=r>0?" ".repeat(r-1):"";let m,s;m="User"!==e.type||e.isNested||e.path!==B?"Project"!==e.type||e.isNested||e.path!==I?r>0?`${n}L ${t}${o}`:`${t}`:"Project memory":"User memory";const i=E(u());return s="User"!==e.type||e.isNested?"Project"!==e.type||e.isNested||e.path!==I?e.parent?"@-imported":e.isNested?"dynamically loaded":"":(i?"Checked in at":"Saved in")+" ./CLAUDE.md":"Saved in ~/.context/CLAUDE.md",{label:m,value:e.path,description:s}}),G=[],H=x(_temp3);if(g()){let t;if(n[0]===Symbol.for("react.memo_cache_sentinel")?(t={label:"Open auto-memory folder",value:`${P}${_()}`,description:""},n[0]=t):t=n[0],G.push(t),e("TEAMMEM")&&L.isTeamMemoryEnabled()){let e;n[1]===Symbol.for("react.memo_cache_sentinel")?(e={label:"Open team memory folder",value:`${P}${L.getTeamMemPath()}`,description:""},n[1]=e):e=n[1],G.push(e)}for(const e of H.activeAgents)if(e.memory){const t=A(e.agentType,e.memory);G.push({label:`Open ${s.bold(e.agentType)} agent memory`,value:`${P}${t}`,description:`${e.memory} scope`})}}let J;z.push(...G),n[2]!==z?(J=F&&z.some(_temp4)?F:z[0]?.value||"",n[2]=z,n[3]=J):J=n[3];const Q=J,[R,X]=p(g),[Y,Z]=p(v),[ee]=p(g),te=x(_temp6),[oe,re]=p(null);let ne,me,se;n[4]!==ee?(ne=()=>{ee&&b().then(re)},n[4]=ee,n[5]=ne):ne=n[5],n[6]!==te||n[7]!==ee?(me=[ee,te],n[6]=te,n[7]=ee,n[8]=me):me=n[8],c(ne,me),n[9]!==te||n[10]!==oe?(se=te?"running":null===oe?"":0===oe?"never":`last ran ${$(new Date(oe))}`,n[9]=te,n[10]=oe,n[11]=se):se=n[11];const ie=se,[le,ae]=p(null),ce=null!==le,pe=ee?1:0;let ue;n[12]!==R?(ue=function(){const e=!R;U("userSettings",{autoMemoryEnabled:e}),X(e),j("tengu_auto_memory_toggled",{enabled:e})},n[12]=R,n[13]=ue):ue=n[13];const fe=ue;let de;n[14]!==Y?(de=function(){const e=!Y;U("userSettings",{autoDreamEnabled:e}),Z(e),j("tengu_auto_dream_toggled",{enabled:e})},n[14]=Y,n[15]=de):de=n[15];const he=de;let ye,_e,ge,je,ve,be,xe;f(),n[16]===Symbol.for("react.memo_cache_sentinel")?(ye={context:"Confirmation"},n[16]=ye):ye=n[16],y("confirm:no",N,ye),n[17]!==le||n[18]!==he||n[19]!==fe?(_e=()=>{0===le?fe():1===le&&he()},n[17]=le,n[18]=he,n[19]=fe,n[20]=_e):_e=n[20],n[21]!==ce?(ge={context:"Confirmation",isActive:ce},n[21]=ce,n[22]=ge):ge=n[22],y("confirm:yes",_e,ge),n[23]!==pe?(je=()=>{ae(e=>null!==e&&e<pe?e+1:null)},n[23]=pe,n[24]=je):je=n[24],n[25]!==ce?(ve={context:"Select",isActive:ce},n[25]=ce,n[26]=ve):ve=n[26],y("select:next",je,ve),n[27]===Symbol.for("react.memo_cache_sentinel")?(be=()=>{ae(_temp7)},n[27]=be):be=n[27],n[28]!==ce?(xe={context:"Select",isActive:ce},n[28]=ce,n[29]=xe):xe=n[29],y("select:previous",be,xe);const Ae=0===le,Ce=R?"on":"off";let Me,Se,De,$e,Ee,Ue,Te,ke;return n[30]!==Ce?(Me=t(h,{children:["Auto-memory: ",Ce]}),n[30]=Ce,n[31]=Me):Me=n[31],n[32]!==Ae||n[33]!==Me?(Se=o(k,{isFocused:Ae,children:Me}),n[32]=Ae,n[33]=Me,n[34]=Se):Se=n[34],n[35]!==Y||n[36]!==ie||n[37]!==le||n[38]!==te||n[39]!==ee?(De=ee&&o(k,{isFocused:1===le,styled:!1,children:t(h,{color:1===le?"suggestion":void 0,children:["Auto-dream: ",Y?"on":"off",ie&&t(h,{dimColor:!0,children:[" · ",ie]}),!te&&Y&&o(h,{dimColor:!0,children:" · /dream to run"})]})}),n[35]=Y,n[36]=ie,n[37]=le,n[38]=te,n[39]=ee,n[40]=De):De=n[40],n[41]!==Se||n[42]!==De?($e=t(d,{flexDirection:"column",marginBottom:1,children:[Se,De]}),n[41]=Se,n[42]=De,n[43]=$e):$e=n[43],n[44]!==w?(Ee=e=>{if(e.startsWith(P)){const t=e.slice(15);return void i(t,{recursive:!0}).catch(_temp8).then(()=>C(t))}F=e,w(e)},n[44]=w,n[45]=Ee):Ee=n[45],n[46]!==pe?(Ue=()=>ae(pe),n[46]=pe,n[47]=Ue):Ue=n[47],n[48]!==Q||n[49]!==z||n[50]!==N||n[51]!==Ee||n[52]!==Ue||n[53]!==ce?(Te=o(T,{defaultFocusValue:Q,options:z,isDisabled:ce,onChange:Ee,onCancel:N,onUpFromFirstItem:Ue}),n[48]=Q,n[49]=z,n[50]=N,n[51]=Ee,n[52]=Ue,n[53]=ce,n[54]=Te):Te=n[54],n[55]!==$e||n[56]!==Te?(ke=t(d,{flexDirection:"column",width:"100%",children:[$e,Te]}),n[55]=$e,n[56]=Te,n[57]=ke):ke=n[57],ke}function _temp8(){}function _temp7(e){return null!==e&&e>0?e-1:e}function _temp6(e){return Object.values(e.tasks).some(_temp5)}function _temp5(e){return"dream"===e.type&&"running"===e.status}function _temp4(e){return e.value===F}function _temp3(e){return e.agentDefinitions}function _temp2(e){return{...e,exists:!0}}function _temp(e){return"AutoMem"!==e.type&&"TeamMem"!==e.type}
1
+ import{feature as e}from"../../recovery/bunBundleShim.js";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{createRequire as r}from"module";const n=r(import.meta.url);import{c as i}from"react/compiler-runtime";import m from"chalk";import{mkdir as s}from"fs/promises";import{join as a}from"path";import{use as l,useEffect as c,useState as p}from"react";import{getOriginalCwd as u}from"../../bootstrap/state.js";import{useExitOnCtrlCDWithKeybindings as d}from"../../hooks/useExitOnCtrlCDWithKeybindings.js";import{Box as f,Text as h}from"../../ink.js";import{useKeybinding as y}from"../../keybindings/useKeybinding.js";import{getAutoMemPath as _,isAutoMemoryEnabled as g}from"../../memdir/paths.js";import{logEvent as j}from"../../services/analytics/index.js";import{isAutoDreamEnabled as b}from"../../services/autoDream/config.js";import{readLastConsolidatedAt as v}from"../../services/autoDream/consolidationLock.js";import{useAppState as x}from"../../state/AppState.js";import{getAgentMemoryDir as A}from"../../tools/AgentTool/agentMemory.js";import{openPath as C}from"../../utils/browser.js";import{getMemoryFiles as M}from"../../utils/claudemd.js";import{getClaudeConfigHomeDir as S}from"../../utils/envUtils.js";import{getDisplayPath as D}from"../../utils/file.js";import{formatRelativeTimeAgo as $}from"../../utils/format.js";import{projectIsInGitRepo as E}from"../../utils/memory/versions.js";import{updateSettingsForSource as U}from"../../utils/settings/settings.js";import{Select as T}from"../CustomSelect/index.js";import{ListItem as k}from"../design-system/ListItem.js";const L=e("TEAMMEM")?n("../../memdir/teamMemPaths.js"):null;let F;const P="__open_folder__";export function MemoryFileSelector(r){const n=i(58),{onSelect:w,onCancel:N}=r,O=l(M()),B=a(S(),"CLAUDE.md"),I=a(u(),"CLAUDE.md"),K=O.some(e=>e.path===B),W=O.some(e=>e.path===I),q=[...O.filter(_temp).map(_temp2),...K?[]:[{path:B,type:"User",content:"",exists:!1}],...W?[]:[{path:I,type:"Project",content:"",exists:!1}]],V=new Map,z=q.map(e=>{const t=D(e.path),o=e.exists?"":" (new)",r=e.parent?(V.get(e.parent)??0)+1:0;V.set(e.path,r);const n=r>0?" ".repeat(r-1):"";let i,m;i="User"!==e.type||e.isNested||e.path!==B?"Project"!==e.type||e.isNested||e.path!==I?r>0?`${n}L ${t}${o}`:`${t}`:"Project memory":"User memory";const s=E(u());return m="User"!==e.type||e.isNested?"Project"!==e.type||e.isNested||e.path!==I?e.parent?"@-imported":e.isNested?"dynamically loaded":"":(s?"Checked in at":"Saved in")+" ./CLAUDE.md":"Saved in ~/.context/CLAUDE.md",{label:i,value:e.path,description:m}}),G=[],H=x(_temp3);if(g()){let t;if(n[0]===Symbol.for("react.memo_cache_sentinel")?(t={label:"Abrir carpeta de auto-memoria",value:`${P}${_()}`,description:""},n[0]=t):t=n[0],G.push(t),e("TEAMMEM")&&L.isTeamMemoryEnabled()){let e;n[1]===Symbol.for("react.memo_cache_sentinel")?(e={label:"Abrir carpeta de memoria del equipo",value:`${P}${L.getTeamMemPath()}`,description:""},n[1]=e):e=n[1],G.push(e)}for(const e of H.activeAgents)if(e.memory){const t=A(e.agentType,e.memory);G.push({label:`Open ${m.bold(e.agentType)} agent memory`,value:`${P}${t}`,description:`${e.memory} scope`})}}let J;z.push(...G),n[2]!==z?(J=F&&z.some(_temp4)?F:z[0]?.value||"",n[2]=z,n[3]=J):J=n[3];const Q=J,[R,X]=p(g),[Y,Z]=p(b),[ee]=p(g),te=x(_temp6),[oe,re]=p(null);let ne,ie,me;n[4]!==ee?(ne=()=>{ee&&v().then(re)},n[4]=ee,n[5]=ne):ne=n[5],n[6]!==te||n[7]!==ee?(ie=[ee,te],n[6]=te,n[7]=ee,n[8]=ie):ie=n[8],c(ne,ie),n[9]!==te||n[10]!==oe?(me=te?"running":null===oe?"":0===oe?"never":`last ran ${$(new Date(oe))}`,n[9]=te,n[10]=oe,n[11]=me):me=n[11];const se=me,[ae,le]=p(null),ce=null!==ae,pe=ee?1:0;let ue;n[12]!==R?(ue=function(){const e=!R;U("userSettings",{autoMemoryEnabled:e}),X(e),j("tengu_auto_memory_toggled",{enabled:e})},n[12]=R,n[13]=ue):ue=n[13];const de=ue;let fe;n[14]!==Y?(fe=function(){const e=!Y;U("userSettings",{autoDreamEnabled:e}),Z(e),j("tengu_auto_dream_toggled",{enabled:e})},n[14]=Y,n[15]=fe):fe=n[15];const he=fe;let ye,_e,ge,je,be,ve,xe;d(),n[16]===Symbol.for("react.memo_cache_sentinel")?(ye={context:"Confirmation"},n[16]=ye):ye=n[16],y("confirm:no",N,ye),n[17]!==ae||n[18]!==he||n[19]!==de?(_e=()=>{0===ae?de():1===ae&&he()},n[17]=ae,n[18]=he,n[19]=de,n[20]=_e):_e=n[20],n[21]!==ce?(ge={context:"Confirmation",isActive:ce},n[21]=ce,n[22]=ge):ge=n[22],y("confirm:yes",_e,ge),n[23]!==pe?(je=()=>{le(e=>null!==e&&e<pe?e+1:null)},n[23]=pe,n[24]=je):je=n[24],n[25]!==ce?(be={context:"Select",isActive:ce},n[25]=ce,n[26]=be):be=n[26],y("select:next",je,be),n[27]===Symbol.for("react.memo_cache_sentinel")?(ve=()=>{le(_temp7)},n[27]=ve):ve=n[27],n[28]!==ce?(xe={context:"Select",isActive:ce},n[28]=ce,n[29]=xe):xe=n[29],y("select:previous",ve,xe);const Ae=0===ae,Ce=R?"on":"off";let Me,Se,De,$e,Ee,Ue,Te,ke;return n[30]!==Ce?(Me=t(h,{children:["Auto-memory: ",Ce]}),n[30]=Ce,n[31]=Me):Me=n[31],n[32]!==Ae||n[33]!==Me?(Se=o(k,{isFocused:Ae,children:Me}),n[32]=Ae,n[33]=Me,n[34]=Se):Se=n[34],n[35]!==Y||n[36]!==se||n[37]!==ae||n[38]!==te||n[39]!==ee?(De=ee&&o(k,{isFocused:1===ae,styled:!1,children:t(h,{color:1===ae?"suggestion":void 0,children:["Auto-dream: ",Y?"on":"off",se&&t(h,{dimColor:!0,children:[" · ",se]}),!te&&Y&&o(h,{dimColor:!0,children:" · /dream to run"})]})}),n[35]=Y,n[36]=se,n[37]=ae,n[38]=te,n[39]=ee,n[40]=De):De=n[40],n[41]!==Se||n[42]!==De?($e=t(f,{flexDirection:"column",marginBottom:1,children:[Se,De]}),n[41]=Se,n[42]=De,n[43]=$e):$e=n[43],n[44]!==w?(Ee=e=>{if(e.startsWith(P)){const t=e.slice(15);return void s(t,{recursive:!0}).catch(_temp8).then(()=>C(t))}F=e,w(e)},n[44]=w,n[45]=Ee):Ee=n[45],n[46]!==pe?(Ue=()=>le(pe),n[46]=pe,n[47]=Ue):Ue=n[47],n[48]!==Q||n[49]!==z||n[50]!==N||n[51]!==Ee||n[52]!==Ue||n[53]!==ce?(Te=o(T,{defaultFocusValue:Q,options:z,isDisabled:ce,onChange:Ee,onCancel:N,onUpFromFirstItem:Ue}),n[48]=Q,n[49]=z,n[50]=N,n[51]=Ee,n[52]=Ue,n[53]=ce,n[54]=Te):Te=n[54],n[55]!==$e||n[56]!==Te?(ke=t(f,{flexDirection:"column",width:"100%",children:[$e,Te]}),n[55]=$e,n[56]=Te,n[57]=ke):ke=n[57],ke}function _temp8(){}function _temp7(e){return null!==e&&e>0?e-1:e}function _temp6(e){return Object.values(e.tasks).some(_temp5)}function _temp5(e){return"dream"===e.type&&"running"===e.status}function _temp4(e){return e.value===F}function _temp3(e){return e.agentDefinitions}function _temp2(e){return{...e,exists:!0}}function _temp(e){return"AutoMem"!==e.type&&"TeamMem"!==e.type}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{useContext as n}from"react";import{ERROR_MESSAGE_USER_ABORT as i}from"../../services/compact/compact.js";import{isRateLimitErrorMessage as c}from"../../services/rateLimitMessages.js";import{BLACK_CIRCLE as l}from"../../constants/figures.js";import{Box as s,NoSelect as m,Text as a}from"../../ink.js";import{API_ERROR_MESSAGE_PREFIX as h,API_TIMEOUT_ERROR_MESSAGE as d,CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE as f,CUSTOM_OFF_SWITCH_MESSAGE as u,INVALID_API_KEY_ERROR_MESSAGE as p,INVALID_API_KEY_ERROR_MESSAGE_EXTERNAL as g,ORG_DISABLED_ERROR_MESSAGE_ENV_KEY as _,ORG_DISABLED_ERROR_MESSAGE_ENV_KEY_WITH_OAUTH as y,PROMPT_TOO_LONG_ERROR_MESSAGE as j,startsWithApiErrorPrefix as x,TOKEN_REVOKED_ERROR_MESSAGE as S}from"../../services/api/errors.js";import{isEmptyMessageText as b,NO_RESPONSE_REQUESTED as M}from"../../utils/messages.js";import{getUpgradeMessage as w}from"../../utils/model/contextWindowUpgradeCheck.js";import{getDefaultSonnetModel as I,renderModelName as O}from"../../utils/model/model.js";import{isMacOsKeychainLocked as T}from"../../utils/secureStorage/macOsKeychainStorage.js";import{CtrlOToExpand as v}from"../CtrlOToExpand.js";import{InterruptedByUser as A}from"../InterruptedByUser.js";import{Markdown as k}from"../Markdown.js";import{MessageResponse as C}from"../MessageResponse.js";import{MessageActionsSelectedContext as D}from"../messageActions.js";import{RateLimitMessage as E}from"./RateLimitMessage.js";function InvalidApiKeyMessage(){const o=t(2);let n;o[0]===Symbol.for("react.memo_cache_sentinel")?(n=T(),o[0]=n):n=o[0];const i=n;let c;return o[1]===Symbol.for("react.memo_cache_sentinel")?(c=e(C,{children:r(s,{flexDirection:"column",children:[e(a,{color:"error",children:p}),i&&e(a,{dimColor:!0,children:"· Run in another terminal: security unlock-keychain"})]})}),o[1]=c):c=o[1],c}export function AssistantTextMessage(T){const L=t(34),{param:R,addMargin:U,shouldShowDot:P,verbose:K,onOpenRateLimitOptions:W}=T,{text:B}=R,$=n(D);if(b(B))return null;if(c(B)){let r;return L[0]!==W||L[1]!==B?(r=e(E,{text:B,onOpenRateLimitOptions:W}),L[0]=W,L[1]=B,L[2]=r):r=L[2],r}switch(B){case M:return null;case j:{let o;L[3]===Symbol.for("react.memo_cache_sentinel")?(o=w("warning"),L[3]=o):o=L[3];const t=o;let n;return L[4]===Symbol.for("react.memo_cache_sentinel")?(n=e(C,{height:1,children:r(a,{color:"error",children:["Context limit reached · /compact or /clear to continue",t?` · ${t}`:""]})}),L[4]=n):n=L[4],n}case f:{let r;return L[5]===Symbol.for("react.memo_cache_sentinel")?(r=e(C,{height:1,children:e(a,{color:"error",children:"Credit balance too low · Add funds: https://platform.claude.com/settings/billing"})}),L[5]=r):r=L[5],r}case p:{let r;return L[6]===Symbol.for("react.memo_cache_sentinel")?(r=e(InvalidApiKeyMessage,{}),L[6]=r):r=L[6],r}case g:{let r;return L[7]===Symbol.for("react.memo_cache_sentinel")?(r=e(C,{height:1,children:e(a,{color:"error",children:g})}),L[7]=r):r=L[7],r}case _:case y:{let r;return L[8]!==B?(r=e(C,{children:e(a,{color:"error",children:B})}),L[8]=B,L[9]=r):r=L[9],r}case S:{let r;return L[10]===Symbol.for("react.memo_cache_sentinel")?(r=e(C,{height:1,children:e(a,{color:"error",children:S})}),L[10]=r):r=L[10],r}case d:{let t;return L[11]===Symbol.for("react.memo_cache_sentinel")?(t=e(C,{height:1,children:r(a,{color:"error",children:[d,process.env.API_TIMEOUT_MS&&r(o,{children:[" ","(API_TIMEOUT_MS=",process.env.API_TIMEOUT_MS,"ms, try increasing it)"]})]})}),L[11]=t):t=L[11],t}case u:{let o,t;return L[12]===Symbol.for("react.memo_cache_sentinel")?(o=e(a,{color:"error",children:"We are experiencing high demand for Opus 4."}),L[12]=o):o=L[12],L[13]===Symbol.for("react.memo_cache_sentinel")?(t=e(C,{children:r(s,{flexDirection:"column",gap:1,children:[o,r(a,{children:["To continue immediately, use /model to switch to"," ",O(I())," and continue coding."]})]})}),L[13]=t):t=L[13],t}case i:{let r;return L[14]===Symbol.for("react.memo_cache_sentinel")?(r=e(C,{height:1,children:e(A,{})}),L[14]=r):r=L[14],r}default:{if(x(B)){const o=!K&&B.length>1e3,t=B===h?`${h}: Please wait a moment and try again.`:o?B.slice(0,1e3)+"…":B;let n,i,c;return L[15]!==t?(n=e(a,{color:"error",children:t}),L[15]=t,L[16]=n):n=L[16],L[17]!==o?(i=o&&e(v,{}),L[17]=o,L[18]=i):i=L[18],L[19]!==n||L[20]!==i?(c=e(C,{children:r(s,{flexDirection:"column",children:[n,i]})}),L[19]=n,L[20]=i,L[21]=c):c=L[21],c}const o=U?1:0,t=$?"messageActionsBackground":void 0;let n,i,c,d;return L[22]!==$||L[23]!==P?(n=P&&e(m,{fromLeftEdge:!0,minWidth:2,children:e(a,{color:$?"suggestion":"text",children:l})}),L[22]=$,L[23]=P,L[24]=n):n=L[24],L[25]!==B?(i=e(s,{flexDirection:"column",children:e(k,{children:B})}),L[25]=B,L[26]=i):i=L[26],L[27]!==n||L[28]!==i?(c=r(s,{flexDirection:"row",children:[n,i]}),L[27]=n,L[28]=i,L[29]=c):c=L[29],L[30]!==o||L[31]!==t||L[32]!==c?(d=e(s,{alignItems:"flex-start",flexDirection:"row",justifyContent:"space-between",marginTop:o,width:"100%",backgroundColor:t,children:c}),L[30]=o,L[31]=t,L[32]=c,L[33]=d):d=L[33],d}}}
1
+ import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{useContext as n}from"react";import{ERROR_MESSAGE_USER_ABORT as i}from"../../services/compact/compact.js";import{isRateLimitErrorMessage as c}from"../../services/rateLimitMessages.js";import{BLACK_CIRCLE as l}from"../../constants/figures.js";import{Box as s,NoSelect as m,Text as a}from"../../ink.js";import{API_ERROR_MESSAGE_PREFIX as h,API_TIMEOUT_ERROR_MESSAGE as d,CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE as f,CUSTOM_OFF_SWITCH_MESSAGE as u,INVALID_API_KEY_ERROR_MESSAGE as p,INVALID_API_KEY_ERROR_MESSAGE_EXTERNAL as g,ORG_DISABLED_ERROR_MESSAGE_ENV_KEY as _,ORG_DISABLED_ERROR_MESSAGE_ENV_KEY_WITH_OAUTH as y,PROMPT_TOO_LONG_ERROR_MESSAGE as j,startsWithApiErrorPrefix as x,TOKEN_REVOKED_ERROR_MESSAGE as S}from"../../services/api/errors.js";import{isEmptyMessageText as b,NO_RESPONSE_REQUESTED as M}from"../../utils/messages.js";import{getUpgradeMessage as w}from"../../utils/model/contextWindowUpgradeCheck.js";import{getDefaultSonnetModel as I,renderModelName as O}from"../../utils/model/model.js";import{isMacOsKeychainLocked as T}from"../../utils/secureStorage/macOsKeychainStorage.js";import{CtrlOToExpand as v}from"../CtrlOToExpand.js";import{InterruptedByUser as A}from"../InterruptedByUser.js";import{Markdown as k}from"../Markdown.js";import{MessageResponse as C}from"../MessageResponse.js";import{MessageActionsSelectedContext as D}from"../messageActions.js";import{RateLimitMessage as E}from"./RateLimitMessage.js";function InvalidApiKeyMessage(){const o=t(2);let n;o[0]===Symbol.for("react.memo_cache_sentinel")?(n=T(),o[0]=n):n=o[0];const i=n;let c;return o[1]===Symbol.for("react.memo_cache_sentinel")?(c=e(C,{children:r(s,{flexDirection:"column",children:[e(a,{color:"error",children:p}),i&&e(a,{dimColor:!0,children:"· Run in another terminal: security unlock-keychain"})]})}),o[1]=c):c=o[1],c}export function AssistantTextMessage(T){const L=t(34),{param:R,addMargin:U,shouldShowDot:P,verbose:K,onOpenRateLimitOptions:B}=T,{text:W}=R,$=n(D);if(b(W))return null;if(c(W)){let r;return L[0]!==B||L[1]!==W?(r=e(E,{text:W,onOpenRateLimitOptions:B}),L[0]=B,L[1]=W,L[2]=r):r=L[2],r}switch(W){case M:return null;case j:{let o;L[3]===Symbol.for("react.memo_cache_sentinel")?(o=w("warning"),L[3]=o):o=L[3];const t=o;let n;return L[4]===Symbol.for("react.memo_cache_sentinel")?(n=e(C,{height:1,children:r(a,{color:"error",children:["Context limit reached · /compact or /clear to continue",t?` · ${t}`:""]})}),L[4]=n):n=L[4],n}case f:{let r;return L[5]===Symbol.for("react.memo_cache_sentinel")?(r=e(C,{height:1,children:e(a,{color:"error",children:"Credit balance too low · Add funds: https://platform.claude.com/settings/billing"})}),L[5]=r):r=L[5],r}case p:{let r;return L[6]===Symbol.for("react.memo_cache_sentinel")?(r=e(InvalidApiKeyMessage,{}),L[6]=r):r=L[6],r}case g:{let r;return L[7]===Symbol.for("react.memo_cache_sentinel")?(r=e(C,{height:1,children:e(a,{color:"error",children:g})}),L[7]=r):r=L[7],r}case _:case y:{let r;return L[8]!==W?(r=e(C,{children:e(a,{color:"error",children:W})}),L[8]=W,L[9]=r):r=L[9],r}case S:{let r;return L[10]===Symbol.for("react.memo_cache_sentinel")?(r=e(C,{height:1,children:e(a,{color:"error",children:S})}),L[10]=r):r=L[10],r}case d:{let t;return L[11]===Symbol.for("react.memo_cache_sentinel")?(t=e(C,{height:1,children:r(a,{color:"error",children:[d,process.env.API_TIMEOUT_MS&&r(o,{children:[" ","(API_TIMEOUT_MS=",process.env.API_TIMEOUT_MS,"ms, try increasing it)"]})]})}),L[11]=t):t=L[11],t}case u:{let o,t;return L[12]===Symbol.for("react.memo_cache_sentinel")?(o=e(a,{color:"error",children:"Estamos experimentando alta demanda para Opus 4."}),L[12]=o):o=L[12],L[13]===Symbol.for("react.memo_cache_sentinel")?(t=e(C,{children:r(s,{flexDirection:"column",gap:1,children:[o,r(a,{children:["To continue immediately, use /model to switch to"," ",O(I())," and continue coding."]})]})}),L[13]=t):t=L[13],t}case i:{let r;return L[14]===Symbol.for("react.memo_cache_sentinel")?(r=e(C,{height:1,children:e(A,{})}),L[14]=r):r=L[14],r}default:{if(x(W)){const o=!K&&W.length>1e3,t=W===h?`${h}: Please wait a moment and try again.`:o?W.slice(0,1e3)+"…":W;let n,i,c;return L[15]!==t?(n=e(a,{color:"error",children:t}),L[15]=t,L[16]=n):n=L[16],L[17]!==o?(i=o&&e(v,{}),L[17]=o,L[18]=i):i=L[18],L[19]!==n||L[20]!==i?(c=e(C,{children:r(s,{flexDirection:"column",children:[n,i]})}),L[19]=n,L[20]=i,L[21]=c):c=L[21],c}const o=U?1:0,t=$?"messageActionsBackground":void 0;let n,i,c,d;return L[22]!==$||L[23]!==P?(n=P&&e(m,{fromLeftEdge:!0,minWidth:2,children:e(a,{color:$?"suggestion":"text",children:l})}),L[22]=$,L[23]=P,L[24]=n):n=L[24],L[25]!==W?(i=e(s,{flexDirection:"column",children:e(k,{children:W})}),L[25]=W,L[26]=i):i=L[26],L[27]!==n||L[28]!==i?(c=r(s,{flexDirection:"row",children:[n,i]}),L[27]=n,L[28]=i,L[29]=c):c=L[29],L[30]!==o||L[31]!==t||L[32]!==c?(d=e(s,{alignItems:"flex-start",flexDirection:"row",justifyContent:"space-between",marginTop:o,width:"100%",backgroundColor:t,children:c}),L[30]=o,L[31]=t,L[32]=c,L[33]=d):d=L[33],d}}}
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{Markdown as n}from"../Markdown.js";import{Box as t,Text as l}from"../../ink.js";import{jsonParse as a}from"../../utils/slowOperations.js";import{isIdleNotification as i,isPlanApprovalRequest as d,isPlanApprovalResponse as s}from"../../utils/teammateMailbox.js";import{getShutdownMessageSummary as c}from"./ShutdownMessage.js";import{getTaskAssignmentSummary as m}from"./TaskAssignmentMessage.js";export function PlanApprovalRequestDisplay(a){const i=o(10),{request:d}=a;let s,c,m,p;return i[0]!==d.from?(s=r(t,{marginBottom:1,children:e(l,{color:"planMode",bold:!0,children:["Plan Approval Request from ",d.from]})}),i[0]=d.from,i[1]=s):s=i[1],i[2]!==d.planContent?(c=r(t,{borderStyle:"dashed",borderColor:"subtle",borderLeft:!1,borderRight:!1,flexDirection:"column",paddingX:1,marginBottom:1,children:r(n,{children:d.planContent})}),i[2]=d.planContent,i[3]=c):c=i[3],i[4]!==d.planFilePath?(m=e(l,{dimColor:!0,children:["Plan file: ",d.planFilePath]}),i[4]=d.planFilePath,i[5]=m):m=i[5],i[6]!==s||i[7]!==c||i[8]!==m?(p=r(t,{flexDirection:"column",marginY:1,children:e(t,{borderStyle:"round",borderColor:"planMode",flexDirection:"column",paddingX:1,children:[s,c,m]})}),i[6]=s,i[7]=c,i[8]=m,i[9]=p):p=i[9],p}export function PlanApprovalResponseDisplay(n){const a=o(13),{response:i,senderName:d}=n;if(i.approved){let o,n,i;return a[0]!==d?(o=r(t,{children:e(l,{color:"success",bold:!0,children:["✓ Plan Approved by ",d]})}),a[0]=d,a[1]=o):o=a[1],a[2]===Symbol.for("react.memo_cache_sentinel")?(n=r(t,{marginTop:1,children:r(l,{children:"You can now proceed with implementation. Your plan mode restrictions have been lifted."})}),a[2]=n):n=a[2],a[3]!==o?(i=r(t,{flexDirection:"column",marginY:1,children:e(t,{borderStyle:"round",borderColor:"success",flexDirection:"column",paddingX:1,paddingY:1,children:[o,n]})}),a[3]=o,a[4]=i):i=a[4],i}let s,c,m,p;return a[5]!==d?(s=r(t,{children:e(l,{color:"error",bold:!0,children:["✗ Plan Rejected by ",d]})}),a[5]=d,a[6]=s):s=a[6],a[7]!==i.feedback?(c=i.feedback&&r(t,{marginTop:1,borderStyle:"dashed",borderColor:"subtle",borderLeft:!1,borderRight:!1,paddingX:1,children:e(l,{children:["Feedback: ",i.feedback]})}),a[7]=i.feedback,a[8]=c):c=a[8],a[9]===Symbol.for("react.memo_cache_sentinel")?(m=r(t,{marginTop:1,children:r(l,{dimColor:!0,children:"Please revise your plan based on the feedback and call ExitPlanMode again."})}),a[9]=m):m=a[9],a[10]!==s||a[11]!==c?(p=r(t,{flexDirection:"column",marginY:1,children:e(t,{borderStyle:"round",borderColor:"error",flexDirection:"column",paddingX:1,paddingY:1,children:[s,c,m]})}),a[10]=s,a[11]=c,a[12]=p):p=a[12],p}export function tryRenderPlanApprovalMessage(e,o){const n=d(e);if(n)return r(PlanApprovalRequestDisplay,{request:n});const t=s(e);return t?r(PlanApprovalResponseDisplay,{response:t,senderName:o}):null}export function formatTeammateMessageContent(e){const r=function(e){const r=d(e);if(r)return`[Plan Approval Request from ${r.from}]`;const o=s(e);return o?o.approved?"[Plan Approved] You can now proceed with implementation":`[Plan Rejected] ${o.feedback||"Please revise your plan"}`:null}(e);if(r)return r;const o=c(e);if(o)return o;const n=i(e);if(n)return function(e){const r=["Agent idle"];if(e.completedTaskId){const o=e.completedStatus||"completed";r.push(`Task ${e.completedTaskId} ${o}`)}return e.summary&&r.push(`Last DM: ${e.summary}`),r.join(" · ")}(n);const t=m(e);if(t)return t;try{const r=a(e);if("teammate_terminated"===r?.type&&r.message)return r.message}catch{}return e}
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{Markdown as n}from"../Markdown.js";import{Box as t,Text as l}from"../../ink.js";import{jsonParse as a}from"../../utils/slowOperations.js";import{isIdleNotification as i,isPlanApprovalRequest as d,isPlanApprovalResponse as s}from"../../utils/teammateMailbox.js";import{getShutdownMessageSummary as c}from"./ShutdownMessage.js";import{getTaskAssignmentSummary as m}from"./TaskAssignmentMessage.js";export function PlanApprovalRequestDisplay(a){const i=o(10),{request:d}=a;let s,c,m,p;return i[0]!==d.from?(s=r(t,{marginBottom:1,children:e(l,{color:"planMode",bold:!0,children:["Plan Approval Request from ",d.from]})}),i[0]=d.from,i[1]=s):s=i[1],i[2]!==d.planContent?(c=r(t,{borderStyle:"dashed",borderColor:"subtle",borderLeft:!1,borderRight:!1,flexDirection:"column",paddingX:1,marginBottom:1,children:r(n,{children:d.planContent})}),i[2]=d.planContent,i[3]=c):c=i[3],i[4]!==d.planFilePath?(m=e(l,{dimColor:!0,children:["Plan file: ",d.planFilePath]}),i[4]=d.planFilePath,i[5]=m):m=i[5],i[6]!==s||i[7]!==c||i[8]!==m?(p=r(t,{flexDirection:"column",marginY:1,children:e(t,{borderStyle:"round",borderColor:"planMode",flexDirection:"column",paddingX:1,children:[s,c,m]})}),i[6]=s,i[7]=c,i[8]=m,i[9]=p):p=i[9],p}export function PlanApprovalResponseDisplay(n){const a=o(13),{response:i,senderName:d}=n;if(i.approved){let o,n,i;return a[0]!==d?(o=r(t,{children:e(l,{color:"success",bold:!0,children:["✓ Plan Approved by ",d]})}),a[0]=d,a[1]=o):o=a[1],a[2]===Symbol.for("react.memo_cache_sentinel")?(n=r(t,{marginTop:1,children:r(l,{children:"Ahora puedes proceder con la implementación. Las restricciones del modo plan han sido removidas."})}),a[2]=n):n=a[2],a[3]!==o?(i=r(t,{flexDirection:"column",marginY:1,children:e(t,{borderStyle:"round",borderColor:"success",flexDirection:"column",paddingX:1,paddingY:1,children:[o,n]})}),a[3]=o,a[4]=i):i=a[4],i}let s,c,m,p;return a[5]!==d?(s=r(t,{children:e(l,{color:"error",bold:!0,children:["✗ Plan Rejected by ",d]})}),a[5]=d,a[6]=s):s=a[6],a[7]!==i.feedback?(c=i.feedback&&r(t,{marginTop:1,borderStyle:"dashed",borderColor:"subtle",borderLeft:!1,borderRight:!1,paddingX:1,children:e(l,{children:["Feedback: ",i.feedback]})}),a[7]=i.feedback,a[8]=c):c=a[8],a[9]===Symbol.for("react.memo_cache_sentinel")?(m=r(t,{marginTop:1,children:r(l,{dimColor:!0,children:"Please revise your plan based on the feedback and call ExitPlanMode again."})}),a[9]=m):m=a[9],a[10]!==s||a[11]!==c?(p=r(t,{flexDirection:"column",marginY:1,children:e(t,{borderStyle:"round",borderColor:"error",flexDirection:"column",paddingX:1,paddingY:1,children:[s,c,m]})}),a[10]=s,a[11]=c,a[12]=p):p=a[12],p}export function tryRenderPlanApprovalMessage(e,o){const n=d(e);if(n)return r(PlanApprovalRequestDisplay,{request:n});const t=s(e);return t?r(PlanApprovalResponseDisplay,{response:t,senderName:o}):null}export function formatTeammateMessageContent(e){const r=function(e){const r=d(e);if(r)return`[Plan Approval Request from ${r.from}]`;const o=s(e);return o?o.approved?"[Plan Approved] You can now proceed with implementation":`[Plan Rejected] ${o.feedback||"Please revise your plan"}`:null}(e);if(r)return r;const o=c(e);if(o)return o;const n=i(e);if(n)return function(e){const r=["Agent idle"];if(e.completedTaskId){const o=e.completedStatus||"completed";r.push(`Task ${e.completedTaskId} ${o}`)}return e.summary&&r.push(`Last DM: ${e.summary}`),r.join(" · ")}(n);const t=m(e);if(t)return t;try{const r=a(e);if("teammate_terminated"===r?.type&&r.message)return r.message}catch{}return e}
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{Box as n,Text as t}from"../../ink.js";import{isShutdownApproved as i,isShutdownRejected as d,isShutdownRequest as s}from"../../utils/teammateMailbox.js";export function ShutdownRequestDisplay(i){const d=o(7),{request:s}=i;let l,u,a;return d[0]!==s.from?(l=r(n,{marginBottom:1,children:e(t,{color:"warning",bold:!0,children:["Shutdown request from ",s.from]})}),d[0]=s.from,d[1]=l):l=d[1],d[2]!==s.reason?(u=s.reason&&r(n,{children:e(t,{children:["Reason: ",s.reason]})}),d[2]=s.reason,d[3]=u):u=d[3],d[4]!==l||d[5]!==u?(a=r(n,{flexDirection:"column",marginY:1,children:e(n,{borderStyle:"round",borderColor:"warning",flexDirection:"column",paddingX:1,paddingY:1,children:[l,u]})}),d[4]=l,d[5]=u,d[6]=a):a=d[6],a}export function ShutdownRejectedDisplay(i){const d=o(8),{response:s}=i;let l,u,a,c;return d[0]!==s.from?(l=e(t,{color:"subtle",bold:!0,children:["Shutdown rejected by ",s.from]}),d[0]=s.from,d[1]=l):l=d[1],d[2]!==s.reason?(u=r(n,{marginTop:1,borderStyle:"dashed",borderColor:"subtle",borderLeft:!1,borderRight:!1,paddingX:1,children:e(t,{children:["Reason: ",s.reason]})}),d[2]=s.reason,d[3]=u):u=d[3],d[4]===Symbol.for("react.memo_cache_sentinel")?(a=r(n,{marginTop:1,children:r(t,{dimColor:!0,children:"Teammate is continuing to work. You may request shutdown again later."})}),d[4]=a):a=d[4],d[5]!==l||d[6]!==u?(c=r(n,{flexDirection:"column",marginY:1,children:e(n,{borderStyle:"round",borderColor:"subtle",flexDirection:"column",paddingX:1,paddingY:1,children:[l,u,a]})}),d[5]=l,d[6]=u,d[7]=c):c=d[7],c}export function tryRenderShutdownMessage(e){const o=s(e);if(o)return r(ShutdownRequestDisplay,{request:o});if(i(e))return null;const n=d(e);return n?r(ShutdownRejectedDisplay,{response:n}):null}export function getShutdownMessageSummary(e){const r=s(e);if(r)return`[Shutdown Request from ${r.from}]${r.reason?` ${r.reason}`:""}`;const o=i(e);if(o)return`[Shutdown Approved] ${o.from} is now exiting`;const n=d(e);return n?`[Shutdown Rejected] ${n.from}: ${n.reason}`:null}
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{Box as n,Text as t}from"../../ink.js";import{isShutdownApproved as i,isShutdownRejected as d,isShutdownRequest as s}from"../../utils/teammateMailbox.js";export function ShutdownRequestDisplay(i){const d=o(7),{request:s}=i;let l,a,c;return d[0]!==s.from?(l=r(n,{marginBottom:1,children:e(t,{color:"warning",bold:!0,children:["Shutdown request from ",s.from]})}),d[0]=s.from,d[1]=l):l=d[1],d[2]!==s.reason?(a=s.reason&&r(n,{children:e(t,{children:["Reason: ",s.reason]})}),d[2]=s.reason,d[3]=a):a=d[3],d[4]!==l||d[5]!==a?(c=r(n,{flexDirection:"column",marginY:1,children:e(n,{borderStyle:"round",borderColor:"warning",flexDirection:"column",paddingX:1,paddingY:1,children:[l,a]})}),d[4]=l,d[5]=a,d[6]=c):c=d[6],c}export function ShutdownRejectedDisplay(i){const d=o(8),{response:s}=i;let l,a,c,u;return d[0]!==s.from?(l=e(t,{color:"subtle",bold:!0,children:["Shutdown rejected by ",s.from]}),d[0]=s.from,d[1]=l):l=d[1],d[2]!==s.reason?(a=r(n,{marginTop:1,borderStyle:"dashed",borderColor:"subtle",borderLeft:!1,borderRight:!1,paddingX:1,children:e(t,{children:["Reason: ",s.reason]})}),d[2]=s.reason,d[3]=a):a=d[3],d[4]===Symbol.for("react.memo_cache_sentinel")?(c=r(n,{marginTop:1,children:r(t,{dimColor:!0,children:"El compañero sigue trabajando. Puedes solicitar el apagado más tarde."})}),d[4]=c):c=d[4],d[5]!==l||d[6]!==a?(u=r(n,{flexDirection:"column",marginY:1,children:e(n,{borderStyle:"round",borderColor:"subtle",flexDirection:"column",paddingX:1,paddingY:1,children:[l,a,c]})}),d[5]=l,d[6]=a,d[7]=u):u=d[7],u}export function tryRenderShutdownMessage(e){const o=s(e);if(o)return r(ShutdownRequestDisplay,{request:o});if(i(e))return null;const n=d(e);return n?r(ShutdownRejectedDisplay,{response:n}):null}export function getShutdownMessageSummary(e){const r=s(e);if(r)return`[Shutdown Request from ${r.from}]${r.reason?` ${r.reason}`:""}`;const o=i(e);if(o)return`[Shutdown Approved] ${o.from} is now exiting`;const n=d(e);return n?`[Shutdown Rejected] ${n.from}: ${n.reason}`:null}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{useState as o}from"react";import{Box as s,Text as n}from"../../ink.js";import{formatAPIError as i}from"../../services/api/errorUtils.js";import{useInterval as m}from"usehooks-ts";import{CtrlOToExpand as c}from"../CtrlOToExpand.js";import{MessageResponse as l}from"../MessageResponse.js";export function SystemAPIErrorMessage(a){const p=t(33),{message:f,verbose:u}=a,{retryAttempt:M,error:_,retryInMs:d,maxRetries:h}=f,x=M<4,[I,j]=o(0),T=I>=d;let g,y;if(p[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>j(_temp),p[0]=g):g=p[0],m(g,x||T?null:1e3),x)return null;p[1]!==I||p[2]!==d?(y=Math.round((d-I)/1e3),p[1]=I,p[2]=d,p[3]=y):y=p[3];const A=Math.max(0,y);let E,S,v,O,P,U,R,b,k;if(p[4]!==_||p[5]!==u){const e=i(_);R=!u&&e.length>1e3,v=l,S=s,U="column",E=n,O="error",P=R?e.slice(0,1e3)+"…":e,p[4]=_,p[5]=u,p[6]=E,p[7]=S,p[8]=v,p[9]=O,p[10]=P,p[11]=U,p[12]=R}else E=p[6],S=p[7],v=p[8],O=p[9],P=p[10],U=p[11],R=p[12];p[13]!==E||p[14]!==O||p[15]!==P?(b=e(E,{color:O,children:P}),p[13]=E,p[14]=O,p[15]=P,p[16]=b):b=p[16],p[17]!==R?(k=R&&e(c,{}),p[17]=R,p[18]=k):k=p[18];const C=1===A?"second":"seconds";let D,$,q;return p[19]!==h||p[20]!==M||p[21]!==A||p[22]!==C?(D=r(n,{dimColor:!0,children:["Retrying in ",A," ",C,"… (attempt"," ",M,"/",h,")",process.env.API_TIMEOUT_MS?` · API_TIMEOUT_MS=${process.env.API_TIMEOUT_MS}ms, try increasing it`:""]}),p[19]=h,p[20]=M,p[21]=A,p[22]=C,p[23]=D):D=p[23],p[24]!==S||p[25]!==D||p[26]!==U||p[27]!==b||p[28]!==k?($=r(S,{flexDirection:U,children:[b,k,D]}),p[24]=S,p[25]=D,p[26]=U,p[27]=b,p[28]=k,p[29]=$):$=p[29],p[30]!==v||p[31]!==$?(q=e(v,{children:$}),p[30]=v,p[31]=$,p[32]=q):q=p[32],q}function _temp(e){return e+1e3}
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{c as o}from"react/compiler-runtime";import{useState as t}from"react";import{Box as s,Text as n}from"../../ink.js";import{formatAPIError as m}from"../../services/api/errorUtils.js";import{useInterval as i}from"usehooks-ts";import{CtrlOToExpand as c}from"../CtrlOToExpand.js";import{MessageResponse as l}from"../MessageResponse.js";export function SystemAPIErrorMessage(a){const p=o(33),{message:u,verbose:f}=a,{retryAttempt:M,error:d,retryInMs:_,maxRetries:h}=u,x=M<4,[I,j]=t(0),T=I>=_;let g,A;if(p[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>j(_temp),p[0]=g):g=p[0],i(g,x||T?null:1e3),x)return null;p[1]!==I||p[2]!==_?(A=Math.round((_-I)/1e3),p[1]=I,p[2]=_,p[3]=A):A=p[3];const E=Math.max(0,A);let S,v,y,O,P,U,b,R,k;if(p[4]!==d||p[5]!==f){const e=m(d);b=!f&&e.length>1e3,y=l,v=s,U="column",S=n,O="error",P=b?e.slice(0,1e3)+"…":e,p[4]=d,p[5]=f,p[6]=S,p[7]=v,p[8]=y,p[9]=O,p[10]=P,p[11]=U,p[12]=b}else S=p[6],v=p[7],y=p[8],O=p[9],P=p[10],U=p[11],b=p[12];p[13]!==S||p[14]!==O||p[15]!==P?(R=e(S,{color:O,children:P}),p[13]=S,p[14]=O,p[15]=P,p[16]=R):R=p[16],p[17]!==b?(k=b&&e(c,{}),p[17]=b,p[18]=k):k=p[18];const C=1===E?"segundo":"segundos";let D,$,q;return p[19]!==h||p[20]!==M||p[21]!==E||p[22]!==C?(D=r(n,{dimColor:!0,children:["Reintentando en ",E," ",C,"… (intento"," ",M,"/",h,")",process.env.API_TIMEOUT_MS?` · API_TIMEOUT_MS=${process.env.API_TIMEOUT_MS}ms, prueba aumentarlo`:""]}),p[19]=h,p[20]=M,p[21]=E,p[22]=C,p[23]=D):D=p[23],p[24]!==v||p[25]!==D||p[26]!==U||p[27]!==R||p[28]!==k?($=r(v,{flexDirection:U,children:[R,k,D]}),p[24]=v,p[25]=D,p[26]=U,p[27]=R,p[28]=k,p[29]=$):$=p[29],p[30]!==y||p[31]!==$?(q=e(y,{children:$}),p[30]=y,p[31]=$,p[32]=q):q=p[32],q}function _temp(e){return e+1e3}
@@ -1 +1 @@
1
- import{jsx as r,jsxs as o}from"react/jsx-runtime";import{c as e}from"react/compiler-runtime";import{Box as n,Text as t}from"../../ink.js";import{Markdown as i}from"../Markdown.js";export function UserPlanMessage(l){const m=e(6),{addMargin:a,planContent:c}=l,d=a?1:0;let s,p,f;return m[0]===Symbol.for("react.memo_cache_sentinel")?(s=r(n,{marginBottom:1,children:r(t,{bold:!0,color:"planMode",children:"Plan to implement"})}),m[0]=s):s=m[0],m[1]!==c?(p=r(i,{children:c}),m[1]=c,m[2]=p):p=m[2],m[3]!==d||m[4]!==p?(f=o(n,{flexDirection:"column",borderStyle:"round",borderColor:"planMode",marginTop:d,paddingX:1,children:[s,p]}),m[3]=d,m[4]=p,m[5]=f):f=m[5],f}
1
+ import{jsx as r,jsxs as o}from"react/jsx-runtime";import{c as e}from"react/compiler-runtime";import{Box as n,Text as t}from"../../ink.js";import{Markdown as a}from"../Markdown.js";export function UserPlanMessage(i){const l=e(6),{addMargin:m,planContent:c}=i,d=m?1:0;let s,p,f;return l[0]===Symbol.for("react.memo_cache_sentinel")?(s=r(n,{marginBottom:1,children:r(t,{bold:!0,color:"planMode",children:"Plan a implementar"})}),l[0]=s):s=l[0],l[1]!==c?(p=r(a,{children:c}),l[1]=c,l[2]=p):p=l[2],l[3]!==d||l[4]!==p?(f=o(n,{flexDirection:"column",borderStyle:"round",borderColor:"planMode",marginTop:d,paddingX:1,children:[s,p]}),l[3]=d,l[4]=p,l[5]=f):f=l[5],f}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import o from"figures";import{useCallback as i,useMemo as r,useRef as l,useState as s}from"react";import{useTerminalSize as c}from"../../../hooks/useTerminalSize.js";import{Box as a,Text as u}from"../../../ink.js";import{useKeybinding as d,useKeybindings as p}from"../../../keybindings/useKeybinding.js";import{useAppState as m}from"../../../state/AppState.js";import{getExternalEditor as f}from"../../../utils/editor.js";import{toIDEDisplayName as h}from"../../../utils/ide.js";import{editPromptInEditor as g}from"../../../utils/promptEditor.js";import{Divider as x}from"../../design-system/Divider.js";import v from"../../TextInput.js";import{PermissionRequestTitle as w}from"../PermissionRequestTitle.js";import{PreviewBox as y}from"./PreviewBox.js";import{QuestionNavigationBar as D}from"./QuestionNavigationBar.js";export function PreviewQuestionView({question:b,questions:k,currentQuestionIndex:T,answers:j,questionStates:C,hideSubmitTab:I=!1,minContentHeight:q,minContentWidth:S,onUpdateQuestionState:V,onAnswer:P,onTextInputFocus:A,onCancel:E,onTabPrev:Q,onTabNext:F,onRespondToClaude:N,onFinishPlanInterview:W}){const B="plan"===m(e=>e.toolPermissionContext.mode),[H,K]=s(!1),[O,R]=s(0),[U,z]=s(!1),[G,L]=s(0),M=f(),J=M?h(M):null,X=b.question,Y=C[X],Z=b.options,[$,_]=s(0),ee=l(X);if(ee.current!==X){ee.current=X;const e=Y?.selectedValue,t=e?Z.findIndex(t=>t.label===e):-1;_(t>=0?t:0)}const te=Z[$],ne=Y?.selectedValue,oe=Y?.textInputValue||"",ie=i(e=>{const t=Z[e];t&&(_(e),V(X,{selectedValue:t.label},!1),P(X,t.label))},[Z,X,V,P]),re=i(e=>{if(U)return;let t;t="number"==typeof e?e:"up"===e?$>0?$-1:$:$<Z.length-1?$+1:$,t>=0&&t<Z.length&&_(t)},[$,Z.length,U]);d("chat:externalEditor",async()=>{const e=Y?.textInputValue||"",t=await g(e);null!==t.content&&t.content!==e&&V(X,{textInputValue:t.content},!1)},{context:"Chat",isActive:U&&!!M}),p({"tabs:previous":()=>Q?.(),"tabs:next":()=>F?.()},{context:"Tabs",isActive:!U&&!H});const le=i(()=>{z(!1),A(!1),ne&&P(X,ne)},[ne,X,P,A]),se=i(()=>{K(!0)},[]),ce=i(()=>{K(!1)},[]),ae=i(e=>{if(H)return"up"===e.key||e.ctrl&&"p"===e.key?(e.preventDefault(),void(0===O?ce():R(0))):"down"===e.key||e.ctrl&&"n"===e.key?(e.preventDefault(),void(B&&0===O&&R(1))):"return"===e.key?(e.preventDefault(),void(0===O?N():W())):void("escape"===e.key&&(e.preventDefault(),E()));if(U)"escape"===e.key&&(e.preventDefault(),le());else if("up"===e.key||e.ctrl&&"p"===e.key)e.preventDefault(),$>0&&re("up");else if("down"===e.key||e.ctrl&&"n"===e.key)e.preventDefault(),$===Z.length-1?se():re("down");else if("return"===e.key)e.preventDefault(),ie($);else if("n"!==e.key||e.ctrl||e.meta){if("escape"===e.key)e.preventDefault(),E();else if(1===e.key.length&&e.key>="1"&&e.key<="9"){e.preventDefault();const t=parseInt(e.key,10)-1;t<Z.length&&re(t)}}else e.preventDefault(),z(!0),A(!0)},[H,O,B,U,$,Z.length,ce,se,re,ie,le,N,W,E,A]),ue=te?.preview||null,{columns:de}=c(),pe=de-30-4,me=r(()=>q?Math.max(1,q-11):void 0,[q]);return t(a,{flexDirection:"column",marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:ae,children:[e(x,{color:"inactive"}),t(a,{flexDirection:"column",paddingTop:0,children:[e(D,{questions:k,currentQuestionIndex:T,answers:j,hideSubmitTab:I}),e(w,{title:b.question,color:"text"}),t(a,{flexDirection:"column",minHeight:q,children:[t(a,{marginTop:1,flexDirection:"row",gap:4,children:[e(a,{flexDirection:"column",width:30,children:Z.map((n,i)=>{const r=$===i,l=ne===n.label;return t(a,{flexDirection:"row",children:[e(u,r?{color:"suggestion",children:o.pointer}:{children:" "}),t(u,{dimColor:!0,children:[" ",i+1,"."]}),t(u,{color:l?"success":r?"suggestion":void 0,bold:r,children:[" ",n.label]}),l&&t(u,{color:"success",children:[" ",o.tick]})]},n.label)})}),t(a,{flexDirection:"column",flexGrow:1,children:[e(y,{content:ue||"No preview available",maxLines:me,minWidth:S,maxWidth:pe}),t(a,{marginTop:1,flexDirection:"row",gap:1,children:[e(u,{color:"suggestion",children:"Notes:"}),U?e(v,{value:oe,placeholder:"Add notes on this design…",onChange:e=>{V(X,{textInputValue:e},!1)},onSubmit:le,onExit:le,focus:!0,showCursor:!0,columns:60,cursorOffset:G,onChangeCursorOffset:L}):e(u,{dimColor:!0,italic:!0,children:oe||"press n to add notes"})]})]})]}),t(a,{flexDirection:"column",marginTop:1,children:[e(x,{color:"inactive"}),t(a,{flexDirection:"row",gap:1,children:[e(u,H&&0===O?{color:"suggestion",children:o.pointer}:{children:" "}),e(u,{color:H&&0===O?"suggestion":void 0,children:"Chat about this"})]}),B&&t(a,{flexDirection:"row",gap:1,children:[e(u,H&&1===O?{color:"suggestion",children:o.pointer}:{children:" "}),e(u,{color:H&&1===O?"suggestion":void 0,children:"Skip interview and plan immediately"})]})]}),e(a,{marginTop:1,children:t(u,{color:"inactive",dimColor:!0,children:["Enter to select · ",o.arrowUp,"/",o.arrowDown," to navigate · n to add notes",k.length>1&&e(n,{children:" · Tab to switch questions"}),U&&J&&t(n,{children:[" · ctrl+g to edit in ",J]})," ","· Esc para cancelar"]})})]})]})]})}
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import i from"figures";import{useCallback as o,useMemo as r,useRef as l,useState as a}from"react";import{useTerminalSize as s}from"../../../hooks/useTerminalSize.js";import{Box as c,Text as u}from"../../../ink.js";import{useKeybinding as p,useKeybindings as d}from"../../../keybindings/useKeybinding.js";import{useAppState as m}from"../../../state/AppState.js";import{getExternalEditor as f}from"../../../utils/editor.js";import{toIDEDisplayName as h}from"../../../utils/ide.js";import{editPromptInEditor as g}from"../../../utils/promptEditor.js";import{Divider as x}from"../../design-system/Divider.js";import v from"../../TextInput.js";import{PermissionRequestTitle as b}from"../PermissionRequestTitle.js";import{PreviewBox as y}from"./PreviewBox.js";import{QuestionNavigationBar as D}from"./QuestionNavigationBar.js";export function PreviewQuestionView({question:w,questions:k,currentQuestionIndex:T,answers:j,questionStates:C,hideSubmitTab:I=!1,minContentHeight:V,minContentWidth:q,onUpdateQuestionState:S,onAnswer:P,onTextInputFocus:A,onCancel:E,onTabPrev:Q,onTabNext:F,onRespondToClaude:N,onFinishPlanInterview:O}){const W="plan"===m(e=>e.toolPermissionContext.mode),[B,H]=a(!1),[K,R]=a(0),[U,z]=a(!1),[G,L]=a(0),M=f(),J=M?h(M):null,X=w.question,Y=C[X],Z=w.options,[$,_]=a(0),ee=l(X);if(ee.current!==X){ee.current=X;const e=Y?.selectedValue,t=e?Z.findIndex(t=>t.label===e):-1;_(t>=0?t:0)}const te=Z[$],ne=Y?.selectedValue,ie=Y?.textInputValue||"",oe=o(e=>{const t=Z[e];t&&(_(e),S(X,{selectedValue:t.label},!1),P(X,t.label))},[Z,X,S,P]),re=o(e=>{if(U)return;let t;t="number"==typeof e?e:"up"===e?$>0?$-1:$:$<Z.length-1?$+1:$,t>=0&&t<Z.length&&_(t)},[$,Z.length,U]);p("chat:externalEditor",async()=>{const e=Y?.textInputValue||"",t=await g(e);null!==t.content&&t.content!==e&&S(X,{textInputValue:t.content},!1)},{context:"Chat",isActive:U&&!!M}),d({"tabs:previous":()=>Q?.(),"tabs:next":()=>F?.()},{context:"Tabs",isActive:!U&&!B});const le=o(()=>{z(!1),A(!1),ne&&P(X,ne)},[ne,X,P,A]),ae=o(()=>{H(!0)},[]),se=o(()=>{H(!1)},[]),ce=o(e=>{if(B)return"up"===e.key||e.ctrl&&"p"===e.key?(e.preventDefault(),void(0===K?se():R(0))):"down"===e.key||e.ctrl&&"n"===e.key?(e.preventDefault(),void(W&&0===K&&R(1))):"return"===e.key?(e.preventDefault(),void(0===K?N():O())):void("escape"===e.key&&(e.preventDefault(),E()));if(U)"escape"===e.key&&(e.preventDefault(),le());else if("up"===e.key||e.ctrl&&"p"===e.key)e.preventDefault(),$>0&&re("up");else if("down"===e.key||e.ctrl&&"n"===e.key)e.preventDefault(),$===Z.length-1?ae():re("down");else if("return"===e.key)e.preventDefault(),oe($);else if("n"!==e.key||e.ctrl||e.meta){if("escape"===e.key)e.preventDefault(),E();else if(1===e.key.length&&e.key>="1"&&e.key<="9"){e.preventDefault();const t=parseInt(e.key,10)-1;t<Z.length&&re(t)}}else e.preventDefault(),z(!0),A(!0)},[B,K,W,U,$,Z.length,se,ae,re,oe,le,N,O,E,A]),ue=te?.preview||null,{columns:pe}=s(),de=pe-30-4,me=r(()=>V?Math.max(1,V-11):void 0,[V]);return t(c,{flexDirection:"column",marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:ce,children:[e(x,{color:"inactive"}),t(c,{flexDirection:"column",paddingTop:0,children:[e(D,{questions:k,currentQuestionIndex:T,answers:j,hideSubmitTab:I}),e(b,{title:w.question,color:"text"}),t(c,{flexDirection:"column",minHeight:V,children:[t(c,{marginTop:1,flexDirection:"row",gap:4,children:[e(c,{flexDirection:"column",width:30,children:Z.map((n,o)=>{const r=$===o,l=ne===n.label;return t(c,{flexDirection:"row",children:[e(u,r?{color:"suggestion",children:i.pointer}:{children:" "}),t(u,{dimColor:!0,children:[" ",o+1,"."]}),t(u,{color:l?"success":r?"suggestion":void 0,bold:r,children:[" ",n.label]}),l&&t(u,{color:"success",children:[" ",i.tick]})]},n.label)})}),t(c,{flexDirection:"column",flexGrow:1,children:[e(y,{content:ue||"No hay vista previa disponible",maxLines:me,minWidth:q,maxWidth:de}),t(c,{marginTop:1,flexDirection:"row",gap:1,children:[e(u,{color:"suggestion",children:"Notas:"}),U?e(v,{value:ie,placeholder:"Añadir notas sobre este diseño…",onChange:e=>{S(X,{textInputValue:e},!1)},onSubmit:le,onExit:le,focus:!0,showCursor:!0,columns:60,cursorOffset:G,onChangeCursorOffset:L}):e(u,{dimColor:!0,italic:!0,children:ie||"presiona n para añadir notas"})]})]})]}),t(c,{flexDirection:"column",marginTop:1,children:[e(x,{color:"inactive"}),t(c,{flexDirection:"row",gap:1,children:[e(u,B&&0===K?{color:"suggestion",children:i.pointer}:{children:" "}),e(u,{color:B&&0===K?"suggestion":void 0,children:"Chatear sobre esto"})]}),W&&t(c,{flexDirection:"row",gap:1,children:[e(u,B&&1===K?{color:"suggestion",children:i.pointer}:{children:" "}),e(u,{color:B&&1===K?"suggestion":void 0,children:"Omitir entrevista y planificar inmediatamente"})]})]}),e(c,{marginTop:1,children:t(u,{color:"inactive",dimColor:!0,children:["Enter para seleccionar · ",i.arrowUp,"/",i.arrowDown," para navegar · n para añadir notas",k.length>1&&e(n,{children:" · Tab para cambiar de pregunta"}),U&&J&&t(n,{children:[" · ctrl+g para editar en ",J]})," ","· Esc para cancelar"]})})]})]})]})}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as n}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{getSentinelCategory as r}from"@ant/computer-use-mcp/sentinelApps";import{DEFAULT_GRANT_FLAGS as l}from"@ant/computer-use-mcp/types";import i from"figures";import{useState as s}from"react";import{Box as o,Text as c}from"../../../ink.js";import{execFileNoThrow as a}from"../../../utils/execFileNoThrow.js";import{plural as d}from"../../../utils/stringUtils.js";import{Select as p}from"../../CustomSelect/select.js";import{Dialog as m}from"../../design-system/Dialog.js";const u={granted:[],denied:[],flags:l};export function ComputerUseApproval(n){const r=t(3),{request:l,onDone:i}=n;let s;return r[0]!==i||r[1]!==l?(s=l.tccState?e(ComputerUseTccPanel,{tccState:l.tccState,onDone:()=>i(u)}):e(ComputerUseAppListPanel,{request:l,onDone:i}),r[0]=i,r[1]=l,r[2]=s):s=r[2],s}function ComputerUseTccPanel(r){const l=t(26),{tccState:s,onDone:d}=r;let u;if(l[0]!==s.accessibility||l[1]!==s.screenRecording){if(u=[],!s.accessibility){let e;l[3]===Symbol.for("react.memo_cache_sentinel")?(e={label:"Open System Settings → Accessibility",value:"open_accessibility"},l[3]=e):e=l[3],u.push(e)}if(!s.screenRecording){let e;l[4]===Symbol.for("react.memo_cache_sentinel")?(e={label:"Open System Settings → Screen Recording",value:"open_screen_recording"},l[4]=e):e=l[4],u.push(e)}let e;l[5]===Symbol.for("react.memo_cache_sentinel")?(e={label:"Try again",value:"retry"},l[5]=e):e=l[5],u.push(e),l[0]=s.accessibility,l[1]=s.screenRecording,l[2]=u}else u=l[2];const f=u;let h;l[6]!==d?(h=function(e){switch(e){case"open_accessibility":return void a("open",["x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"],{useCwd:!1});case"open_screen_recording":return void a("open",["x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture"],{useCwd:!1});case"retry":return void d()}},l[6]=d,l[7]=h):h=l[7];const g=h,y=s.accessibility?`${i.tick} granted`:`${i.cross} not granted`;let b;l[8]!==y?(b=n(c,{children:["Accessibility:"," ",y]}),l[8]=y,l[9]=b):b=l[9];const _=s.screenRecording?`${i.tick} granted`:`${i.cross} not granted`;let C,v,S,w,x,D;return l[10]!==_?(C=n(c,{children:["Screen Recording:"," ",_]}),l[10]=_,l[11]=C):C=l[11],l[12]!==b||l[13]!==C?(v=n(o,{flexDirection:"column",children:[b,C]}),l[12]=b,l[13]=C,l[14]=v):v=l[14],l[15]===Symbol.for("react.memo_cache_sentinel")?(S=e(c,{dimColor:!0,children:'Grant the missing permissions in System Settings, then select "Try again". macOS may require you to restart Context Code after granting Screen Recording.'}),l[15]=S):S=l[15],l[16]!==g||l[17]!==d||l[18]!==f?(w=e(p,{options:f,onChange:g,onCancel:d}),l[16]=g,l[17]=d,l[18]=f,l[19]=w):w=l[19],l[20]!==v||l[21]!==w?(x=n(o,{flexDirection:"column",paddingX:1,paddingY:1,gap:1,children:[v,S,w]}),l[20]=v,l[21]=w,l[22]=x):x=l[22],l[23]!==d||l[24]!==x?(D=e(m,{title:"Computer Use needs macOS permissions",onCancel:d,children:x}),l[23]=d,l[24]=x,l[25]=D):D=l[25],D}const f={shell:"equivalent to shell access",filesystem:"can read/write any file",system_settings:"can change system settings"};function ComputerUseAppListPanel(a){const h=t(48),{request:g,onDone:y}=a;let b;h[0]!==g.apps?(b=()=>new Set(g.apps.flatMap(_temp)),h[0]=g.apps,h[1]=b):b=h[1];const[_]=s(b);let C;h[2]===Symbol.for("react.memo_cache_sentinel")?(C=["clipboardRead","clipboardWrite","systemKeyCombos"],h[2]=C):C=h[2];const v=C;let S;h[3]!==g.requestedFlags?(S=v.filter(e=>g.requestedFlags[e]),h[3]=g.requestedFlags,h[4]=S):S=h[4];const w=S,x=_.size;let D;h[5]!==_.size?(D=d(_.size,"app"),h[5]=_.size,h[6]=D):D=h[6];const q=`Allow for this session (${x} ${D})`;let I,A,j;h[7]!==q?(I={label:q,value:"allow_all"},h[7]=q,h[8]=I):I=h[8],h[9]===Symbol.for("react.memo_cache_sentinel")?(A={label:n(c,{children:["Deny, and tell Claude what to do differently ",e(c,{bold:!0,children:"(esc)"})]}),value:"deny"},h[9]=A):A=h[9],h[10]!==I?(j=[I,A],h[10]=I,h[11]=j):j=h[11];const N=j;let R;h[12]!==_||h[13]!==y||h[14]!==g.apps||h[15]!==w?(R=function(e){if(!e)return void y(u);const n=Date.now(),t=g.apps.flatMap(e=>e.resolved&&_.has(e.resolved.bundleId)?[{bundleId:e.resolved.bundleId,displayName:e.resolved.displayName,grantedAt:n}]:[]),r=g.apps.filter(e=>!e.resolved||!_.has(e.resolved.bundleId)).map(_temp2),i={...l,...Object.fromEntries(w.map(_temp3))};y({granted:t,denied:r,flags:i})},h[12]=_,h[13]=y,h[14]=g.apps,h[15]=w,h[16]=R):R=h[16];const U=R;let H,P,$,k,F,O,T,z,G,L,M;if(h[17]!==U?(H=()=>U(!1),h[17]=U,h[18]=H):H=h[18],h[19]!==g.reason?(P=g.reason?e(c,{dimColor:!0,children:g.reason}):null,h[19]=g.reason,h[20]=P):P=h[20],h[21]!==_||h[22]!==g.apps){let t;h[24]!==_?(t=t=>{const l=t.resolved;if(!l)return n(c,{dimColor:!0,children:[" ",i.circle," ",t.requestedName," ",e(c,{dimColor:!0,children:"(not installed)"})]},t.requestedName);if(t.alreadyGranted)return n(c,{dimColor:!0,children:[" ",i.tick," ",l.displayName," ",e(c,{dimColor:!0,children:"(already granted)"})]},l.bundleId);const s=r(l.bundleId),a=_.has(l.bundleId);return n(o,{flexDirection:"column",children:[n(c,{children:[" ",a?i.circleFilled:i.circle," ",l.displayName]}),s?n(c,{bold:!0,children:[" ",i.warning," ",f[s]]}):null]},l.bundleId)},h[24]=_,h[25]=t):t=h[25],$=g.apps.map(t),h[21]=_,h[22]=g.apps,h[23]=$}else $=h[23];return h[26]!==$?(k=e(o,{flexDirection:"column",children:$}),h[26]=$,h[27]=k):k=h[27],h[28]!==w?(F=w.length>0?n(o,{flexDirection:"column",children:[e(c,{dimColor:!0,children:"Also requested:"}),w.map(_temp4)]}):null,h[28]=w,h[29]=F):F=h[29],h[30]!==g.willHide?(O=g.willHide&&g.willHide.length>0?n(c,{dimColor:!0,children:[g.willHide.length," other"," ",d(g.willHide.length,"app")," will be hidden while Claude works."]}):null,h[30]=g.willHide,h[31]=O):O=h[31],h[32]!==U?(T=e=>U("allow_all"===e),z=()=>U(!1),h[32]=U,h[33]=T,h[34]=z):(T=h[33],z=h[34]),h[35]!==N||h[36]!==T||h[37]!==z?(G=e(p,{options:N,onChange:T,onCancel:z}),h[35]=N,h[36]=T,h[37]=z,h[38]=G):G=h[38],h[39]!==P||h[40]!==k||h[41]!==F||h[42]!==O||h[43]!==G?(L=n(o,{flexDirection:"column",paddingX:1,paddingY:1,gap:1,children:[P,k,F,O,G]}),h[39]=P,h[40]=k,h[41]=F,h[42]=O,h[43]=G,h[44]=L):L=h[44],h[45]!==H||h[46]!==L?(M=e(m,{title:"Computer Use wants to control these apps",onCancel:H,children:L}),h[45]=H,h[46]=L,h[47]=M):M=h[47],M}function _temp4(e){return n(c,{dimColor:!0,children:[" ","· ",e]},e)}function _temp3(e){return[e,!0]}function _temp2(e){return{bundleId:e.resolved?.bundleId??e.requestedName,reason:e.resolved?"user_denied":"not_installed"}}function _temp(e){return e.resolved&&!e.alreadyGranted?[e.resolved.bundleId]:[]}
1
+ import{jsx as e,jsxs as n}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{getSentinelCategory as l}from"@ant/computer-use-mcp/sentinelApps";import{DEFAULT_GRANT_FLAGS as r}from"@ant/computer-use-mcp/types";import i from"figures";import{useState as o}from"react";import{Box as s,Text as c}from"../../../ink.js";import{execFileNoThrow as a}from"../../../utils/execFileNoThrow.js";import{plural as d}from"../../../utils/stringUtils.js";import{Select as p}from"../../CustomSelect/select.js";import{Dialog as m}from"../../design-system/Dialog.js";const u={granted:[],denied:[],flags:r};export function ComputerUseApproval(n){const l=t(3),{request:r,onDone:i}=n;let o;return l[0]!==i||l[1]!==r?(o=r.tccState?e(ComputerUseTccPanel,{tccState:r.tccState,onDone:()=>i(u)}):e(ComputerUseAppListPanel,{request:r,onDone:i}),l[0]=i,l[1]=r,l[2]=o):o=l[2],o}function ComputerUseTccPanel(l){const r=t(26),{tccState:o,onDone:d}=l;let u;if(r[0]!==o.accessibility||r[1]!==o.screenRecording){if(u=[],!o.accessibility){let e;r[3]===Symbol.for("react.memo_cache_sentinel")?(e={label:"Open System Settings → Accessibility",value:"open_accessibility"},r[3]=e):e=r[3],u.push(e)}if(!o.screenRecording){let e;r[4]===Symbol.for("react.memo_cache_sentinel")?(e={label:"Open System Settings → Screen Recording",value:"open_screen_recording"},r[4]=e):e=r[4],u.push(e)}let e;r[5]===Symbol.for("react.memo_cache_sentinel")?(e={label:"Reintentar",value:"retry"},r[5]=e):e=r[5],u.push(e),r[0]=o.accessibility,r[1]=o.screenRecording,r[2]=u}else u=r[2];const f=u;let h;r[6]!==d?(h=function(e){switch(e){case"open_accessibility":return void a("open",["x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"],{useCwd:!1});case"open_screen_recording":return void a("open",["x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture"],{useCwd:!1});case"retry":return void d()}},r[6]=d,r[7]=h):h=r[7];const g=h,y=o.accessibility?`${i.tick} granted`:`${i.cross} not granted`;let b;r[8]!==y?(b=n(c,{children:["Accessibility:"," ",y]}),r[8]=y,r[9]=b):b=r[9];const _=o.screenRecording?`${i.tick} granted`:`${i.cross} not granted`;let C,v,w,S,x,D;return r[10]!==_?(C=n(c,{children:["Screen Recording:"," ",_]}),r[10]=_,r[11]=C):C=r[11],r[12]!==b||r[13]!==C?(v=n(s,{flexDirection:"column",children:[b,C]}),r[12]=b,r[13]=C,r[14]=v):v=r[14],r[15]===Symbol.for("react.memo_cache_sentinel")?(w=e(c,{dimColor:!0,children:'Otorga los permisos faltantes en Configuración del Sistema y luego selecciona "Reintentar". macOS puede requerir que reinicies Context Code tras otorgar la Grabación de Pantalla.'}),r[15]=w):w=r[15],r[16]!==g||r[17]!==d||r[18]!==f?(S=e(p,{options:f,onChange:g,onCancel:d}),r[16]=g,r[17]=d,r[18]=f,r[19]=S):S=r[19],r[20]!==v||r[21]!==S?(x=n(s,{flexDirection:"column",paddingX:1,paddingY:1,gap:1,children:[v,w,S]}),r[20]=v,r[21]=S,r[22]=x):x=r[22],r[23]!==d||r[24]!==x?(D=e(m,{title:"Computer Use needs macOS permissions",onCancel:d,children:x}),r[23]=d,r[24]=x,r[25]=D):D=r[25],D}const f={shell:"equivalent to shell access",filesystem:"can read/write any file",system_settings:"can change system settings"};function ComputerUseAppListPanel(a){const h=t(48),{request:g,onDone:y}=a;let b;h[0]!==g.apps?(b=()=>new Set(g.apps.flatMap(_temp)),h[0]=g.apps,h[1]=b):b=h[1];const[_]=o(b);let C;h[2]===Symbol.for("react.memo_cache_sentinel")?(C=["clipboardRead","clipboardWrite","systemKeyCombos"],h[2]=C):C=h[2];const v=C;let w;h[3]!==g.requestedFlags?(w=v.filter(e=>g.requestedFlags[e]),h[3]=g.requestedFlags,h[4]=w):w=h[4];const S=w,x=_.size;let D;h[5]!==_.size?(D=d(_.size,"app"),h[5]=_.size,h[6]=D):D=h[6];const q=`Allow for this session (${x} ${D})`;let I,A,j;h[7]!==q?(I={label:q,value:"allow_all"},h[7]=q,h[8]=I):I=h[8],h[9]===Symbol.for("react.memo_cache_sentinel")?(A={label:n(c,{children:["Deny, and tell Claude what to do differently ",e(c,{bold:!0,children:"(esc)"})]}),value:"deny"},h[9]=A):A=h[9],h[10]!==I?(j=[I,A],h[10]=I,h[11]=j):j=h[11];const R=j;let N;h[12]!==_||h[13]!==y||h[14]!==g.apps||h[15]!==S?(N=function(e){if(!e)return void y(u);const n=Date.now(),t=g.apps.flatMap(e=>e.resolved&&_.has(e.resolved.bundleId)?[{bundleId:e.resolved.bundleId,displayName:e.resolved.displayName,grantedAt:n}]:[]),l=g.apps.filter(e=>!e.resolved||!_.has(e.resolved.bundleId)).map(_temp2),i={...r,...Object.fromEntries(S.map(_temp3))};y({granted:t,denied:l,flags:i})},h[12]=_,h[13]=y,h[14]=g.apps,h[15]=S,h[16]=N):N=h[16];const U=N;let P,H,O,$,k,F,z,G,T,L,M;if(h[17]!==U?(P=()=>U(!1),h[17]=U,h[18]=P):P=h[18],h[19]!==g.reason?(H=g.reason?e(c,{dimColor:!0,children:g.reason}):null,h[19]=g.reason,h[20]=H):H=h[20],h[21]!==_||h[22]!==g.apps){let t;h[24]!==_?(t=t=>{const r=t.resolved;if(!r)return n(c,{dimColor:!0,children:[" ",i.circle," ",t.requestedName," ",e(c,{dimColor:!0,children:"(not installed)"})]},t.requestedName);if(t.alreadyGranted)return n(c,{dimColor:!0,children:[" ",i.tick," ",r.displayName," ",e(c,{dimColor:!0,children:"(already granted)"})]},r.bundleId);const o=l(r.bundleId),a=_.has(r.bundleId);return n(s,{flexDirection:"column",children:[n(c,{children:[" ",a?i.circleFilled:i.circle," ",r.displayName]}),o?n(c,{bold:!0,children:[" ",i.warning," ",f[o]]}):null]},r.bundleId)},h[24]=_,h[25]=t):t=h[25],O=g.apps.map(t),h[21]=_,h[22]=g.apps,h[23]=O}else O=h[23];return h[26]!==O?($=e(s,{flexDirection:"column",children:O}),h[26]=O,h[27]=$):$=h[27],h[28]!==S?(k=S.length>0?n(s,{flexDirection:"column",children:[e(c,{dimColor:!0,children:"Also requested:"}),S.map(_temp4)]}):null,h[28]=S,h[29]=k):k=h[29],h[30]!==g.willHide?(F=g.willHide&&g.willHide.length>0?n(c,{dimColor:!0,children:[g.willHide.length," other"," ",d(g.willHide.length,"app")," will be hidden while Claude works."]}):null,h[30]=g.willHide,h[31]=F):F=h[31],h[32]!==U?(z=e=>U("allow_all"===e),G=()=>U(!1),h[32]=U,h[33]=z,h[34]=G):(z=h[33],G=h[34]),h[35]!==R||h[36]!==z||h[37]!==G?(T=e(p,{options:R,onChange:z,onCancel:G}),h[35]=R,h[36]=z,h[37]=G,h[38]=T):T=h[38],h[39]!==H||h[40]!==$||h[41]!==k||h[42]!==F||h[43]!==T?(L=n(s,{flexDirection:"column",paddingX:1,paddingY:1,gap:1,children:[H,$,k,F,T]}),h[39]=H,h[40]=$,h[41]=k,h[42]=F,h[43]=T,h[44]=L):L=h[44],h[45]!==P||h[46]!==L?(M=e(m,{title:"Computer Use wants to control these apps",onCancel:P,children:L}),h[45]=P,h[46]=L,h[47]=M):M=h[47],M}function _temp4(e){return n(c,{dimColor:!0,children:[" ","· ",e]},e)}function _temp3(e){return[e,!0]}function _temp2(e){return{bundleId:e.resolved?.bundleId??e.requestedName,reason:e.resolved?"user_denied":"not_installed"}}function _temp(e){return e.resolved&&!e.alreadyGranted?[e.resolved.bundleId]:[]}
@@ -1 +1 @@
1
- import{jsx as o,jsxs as e}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{basename as i,relative as n}from"path";import{FileEditToolDiff as r}from"../../FileEditToolDiff.js";import{getCwd as l}from"../../../utils/cwd.js";import{Text as s}from"../../../ink.js";import{FileEditTool as a}from"../../../tools/FileEditTool/FileEditTool.js";import{FilePermissionDialog as m}from"../FilePermissionDialog/FilePermissionDialog.js";import{createSingleEditDiffConfig as p}from"../FilePermissionDialog/ideDiffConfig.js";const f={getConfig:o=>p(o.file_path,o.old_string,o.new_string,o.replace_all),applyChanges:(o,e)=>{const t=e[0];return t?{...o,old_string:t.old_string,new_string:t.new_string,replace_all:t.replace_all}:o}};export function FileEditPermissionRequest(a){const p=t(51),c=_temp;let d,g,_,u,j,C,w,D,h,U,x,F,k,E,R,B,P,T,y,b;if(p[0]!==a.onDone||p[1]!==a.onReject||p[2]!==a.toolUseConfirm||p[3]!==a.toolUseContext||p[4]!==a.workerBadge){const o=c(a.toolUseConfirm.input);({file_path:u,old_string:C,new_string:j,replace_all:w}=o),_=m,k=a.toolUseConfirm,E=a.toolUseContext,R=a.onDone,B=a.onReject,P=a.workerBadge,T="Edit file",U=n(l(),u),g=s,x="Do you want to make this edit to",F=" ",d=s,D=!0,h=i(u),p[0]=a.onDone,p[1]=a.onReject,p[2]=a.toolUseConfirm,p[3]=a.toolUseContext,p[4]=a.workerBadge,p[5]=d,p[6]=g,p[7]=_,p[8]=u,p[9]=j,p[10]=C,p[11]=w,p[12]=D,p[13]=h,p[14]=U,p[15]=x,p[16]=F,p[17]=k,p[18]=E,p[19]=R,p[20]=B,p[21]=P,p[22]=T}else d=p[5],g=p[6],_=p[7],u=p[8],j=p[9],C=p[10],w=p[11],D=p[12],h=p[13],U=p[14],x=p[15],F=p[16],k=p[17],E=p[18],R=p[19],B=p[20],P=p[21],T=p[22];p[23]!==d||p[24]!==D||p[25]!==h?(y=o(d,{bold:D,children:h}),p[23]=d,p[24]=D,p[25]=h,p[26]=y):y=p[26],p[27]!==g||p[28]!==y||p[29]!==x||p[30]!==F?(b=e(g,{children:[x,F,y,"?"]}),p[27]=g,p[28]=y,p[29]=x,p[30]=F,p[31]=b):b=p[31];const q=w||!1;let S,I,v;return p[32]!==j||p[33]!==C||p[34]!==q?(S=[{old_string:C,new_string:j,replace_all:q}],p[32]=j,p[33]=C,p[34]=q,p[35]=S):S=p[35],p[36]!==u||p[37]!==S?(I=o(r,{file_path:u,edits:S}),p[36]=u,p[37]=S,p[38]=I):I=p[38],p[39]!==_||p[40]!==u||p[41]!==U||p[42]!==b||p[43]!==I||p[44]!==k||p[45]!==E||p[46]!==R||p[47]!==B||p[48]!==P||p[49]!==T?(v=o(_,{toolUseConfirm:k,toolUseContext:E,onDone:R,onReject:B,workerBadge:P,title:T,subtitle:U,question:b,content:I,path:u,completionType:"str_replace_single",parseInput:c,ideDiffSupport:f}),p[39]=_,p[40]=u,p[41]=U,p[42]=b,p[43]=I,p[44]=k,p[45]=E,p[46]=R,p[47]=B,p[48]=P,p[49]=T,p[50]=v):v=p[50],v}function _temp(o){return a.inputSchema.parse(o)}
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{c as t}from"react/compiler-runtime";import{basename as i,relative as r}from"path";import{FileEditToolDiff as n}from"../../FileEditToolDiff.js";import{getCwd as l}from"../../../utils/cwd.js";import{Text as s}from"../../../ink.js";import{FileEditTool as a}from"../../../tools/FileEditTool/FileEditTool.js";import{FilePermissionDialog as p}from"../FilePermissionDialog/FilePermissionDialog.js";import{createSingleEditDiffConfig as m}from"../FilePermissionDialog/ideDiffConfig.js";const c={getConfig:e=>m(e.file_path,e.old_string,e.new_string,e.replace_all),applyChanges:(e,o)=>{const t=o[0];return t?{...e,old_string:t.old_string,new_string:t.new_string,replace_all:t.replace_all}:e}};export function FileEditPermissionRequest(a){const m=t(51),f=_temp;let d,g,_,u,j,C,D,h,w,U,x,F,k,E,R,B,P,T,b,q;if(m[0]!==a.onDone||m[1]!==a.onReject||m[2]!==a.toolUseConfirm||m[3]!==a.toolUseContext||m[4]!==a.workerBadge){const e=f(a.toolUseConfirm.input);({file_path:u,old_string:C,new_string:j,replace_all:D}=e),_=p,k=a.toolUseConfirm,E=a.toolUseContext,R=a.onDone,B=a.onReject,P=a.workerBadge,T="Editar archivo",U=r(l(),u),g=s,x="¿Deseas realizar esta edición en",F=" ",d=s,h=!0,w=i(u),m[0]=a.onDone,m[1]=a.onReject,m[2]=a.toolUseConfirm,m[3]=a.toolUseContext,m[4]=a.workerBadge,m[5]=d,m[6]=g,m[7]=_,m[8]=u,m[9]=j,m[10]=C,m[11]=D,m[12]=h,m[13]=w,m[14]=U,m[15]=x,m[16]=F,m[17]=k,m[18]=E,m[19]=R,m[20]=B,m[21]=P,m[22]=T}else d=m[5],g=m[6],_=m[7],u=m[8],j=m[9],C=m[10],D=m[11],h=m[12],w=m[13],U=m[14],x=m[15],F=m[16],k=m[17],E=m[18],R=m[19],B=m[20],P=m[21],T=m[22];m[23]!==d||m[24]!==h||m[25]!==w?(b=e(d,{bold:h,children:w}),m[23]=d,m[24]=h,m[25]=w,m[26]=b):b=m[26],m[27]!==g||m[28]!==b||m[29]!==x||m[30]!==F?(q=o(g,{children:[x,F,b,"?"]}),m[27]=g,m[28]=b,m[29]=x,m[30]=F,m[31]=q):q=m[31];const y=D||!1;let S,v,z;return m[32]!==j||m[33]!==C||m[34]!==y?(S=[{old_string:C,new_string:j,replace_all:y}],m[32]=j,m[33]=C,m[34]=y,m[35]=S):S=m[35],m[36]!==u||m[37]!==S?(v=e(n,{file_path:u,edits:S}),m[36]=u,m[37]=S,m[38]=v):v=m[38],m[39]!==_||m[40]!==u||m[41]!==U||m[42]!==q||m[43]!==v||m[44]!==k||m[45]!==E||m[46]!==R||m[47]!==B||m[48]!==P||m[49]!==T?(z=e(_,{toolUseConfirm:k,toolUseContext:E,onDone:R,onReject:B,workerBadge:P,title:T,subtitle:U,question:q,content:v,path:u,completionType:"str_replace_single",parseInput:f,ideDiffSupport:c}),m[39]=_,m[40]=u,m[41]=U,m[42]=q,m[43]=v,m[44]=k,m[45]=E,m[46]=R,m[47]=B,m[48]=P,m[49]=T,m[50]=z):z=m[50],z}function _temp(e){return a.inputSchema.parse(e)}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{relative as n}from"path";import{useMemo as i}from"react";import{useDiffInIDE as r}from"../../../hooks/useDiffInIDE.js";import{Box as s,Text as l}from"../../../ink.js";import{getLanguageName as a}from"../../../utils/cliHighlight.js";import{getCwd as p}from"../../../utils/cwd.js";import{getFsImplementation as d,safeResolvePath as c}from"../../../utils/fsOperations.js";import{expandPath as m}from"../../../utils/path.js";import{Select as u}from"../../CustomSelect/index.js";import{ShowInIDEPrompt as g}from"../../ShowInIDEPrompt.js";import{usePermissionRequestLogging as f}from"../hooks.js";import{PermissionDialog as h}from"../PermissionDialog.js";import{useFilePermissionDialog as j}from"./useFilePermissionDialog.js";export function FilePermissionDialog({toolUseConfirm:y,toolUseContext:I,onDone:C,onReject:D,title:k,subtitle:w,question:T="Do you want to proceed?",content:P,completionType:F="tool_use_single",path:M,parseInput:_,operationType:x="write",ideDiffSupport:b,workerBadge:v,languageName:E}){const O=i(()=>E??(M?a(M):"none"),[E,M]),S=i(()=>({completion_type:F,language_name:O}),[F,O]);f(y,S);const U=i(()=>{if(!M||"read"===x)return null;const e=m(M),o=d(),{resolvedPath:t,isSymlink:n}=c(o,e);return n?t:null},[M,x]),N=j({filePath:M||"",completionType:F,languageName:O,toolUseConfirm:y,onDone:C,onReject:D,parseInput:_,operationType:x}),{options:X,acceptFeedback:B,rejectFeedback:R,setFocusedOption:$,handleInputModeToggle:q,focusedOption:H,yesInputMode:W,noInputMode:z}=N,A=_(y.input),G=i(()=>b?b.getConfig(_(y.input)):null,[b,y.input]),J=G?{onChange:(e,o)=>{const t=b.applyChanges(A,o.edits);N.onChange(e,t)},toolUseContext:I,filePath:G.filePath,edits:(G.edits||[]).map(e=>({old_string:e.old_string,new_string:e.new_string,replace_all:e.replace_all||!1})),editMode:G.editMode||"single"}:{onChange:()=>{},toolUseContext:I,filePath:"",edits:[],editMode:"single"},{closeTabInIDE:K,showingDiffInIDE:L,ideName:Q}=r(J),onChange=(e,o)=>{K?.(),N.onChange(e,A,o?.trim())};if(L&&G&&M)return e(g,{onChange:(e,o,t)=>onChange(e,t),options:X,filePath:M,input:A,ideName:Q,symlinkTarget:U,rejectFeedback:R,acceptFeedback:B,setFocusedOption:$,onInputModeToggle:q,focusedOption:H,yesInputMode:W,noInputMode:z});const V=null!=U&&n(p(),U).startsWith(".."),Y=U?e(s,{paddingX:1,marginBottom:1,children:e(l,{color:"warning",children:V?`This will modify ${U} (outside working directory) via a symlink`:`Symlink target: ${U}`})}):null;return o(t,{children:[o(h,{title:k,subtitle:w,innerPaddingX:0,workerBadge:v,children:[Y,P,o(s,{flexDirection:"column",paddingX:1,children:["string"==typeof T?e(l,{children:T}):T,e(u,{options:X,inlineDescriptions:!0,onChange:e=>{const o=X.find(o=>o.value===e);if(o){if("reject"===o.option.type){const e=R.trim();return void onChange(o.option,e||void 0)}if("accept-once"===o.option.type){const e=B.trim();return void onChange(o.option,e||void 0)}onChange(o.option)}},onCancel:()=>onChange({type:"reject"}),onFocus:e=>$(e),onInputModeToggle:q})]})]}),e(s,{paddingX:1,marginTop:1,children:o(l,{dimColor:!0,children:["Esc para cancelar",("yes"===H&&!W||"no"===H&&!z)&&" · Tab to amend"]})})]})}
1
+ import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{relative as n}from"path";import{useMemo as i}from"react";import{useDiffInIDE as r}from"../../../hooks/useDiffInIDE.js";import{Box as s,Text as a}from"../../../ink.js";import{getLanguageName as l}from"../../../utils/cliHighlight.js";import{getCwd as p}from"../../../utils/cwd.js";import{getFsImplementation as c,safeResolvePath as d}from"../../../utils/fsOperations.js";import{expandPath as m}from"../../../utils/path.js";import{Select as u}from"../../CustomSelect/index.js";import{ShowInIDEPrompt as g}from"../../ShowInIDEPrompt.js";import{usePermissionRequestLogging as f}from"../hooks.js";import{PermissionDialog as h}from"../PermissionDialog.js";import{useFilePermissionDialog as j}from"./useFilePermissionDialog.js";export function FilePermissionDialog({toolUseConfirm:I,toolUseContext:C,onDone:D,onReject:y,title:b,subtitle:k,question:P="¿Deseas continuar?",content:T,completionType:F="tool_use_single",path:M,parseInput:_,operationType:w="write",ideDiffSupport:x,workerBadge:v,languageName:E}){const O=i(()=>E??(M?l(M):"none"),[E,M]),U=i(()=>({completion_type:F,language_name:O}),[F,O]);f(I,U);const N=i(()=>{if(!M||"read"===w)return null;const e=m(M),o=c(),{resolvedPath:t,isSymlink:n}=d(o,e);return n?t:null},[M,w]),S=j({filePath:M||"",completionType:F,languageName:O,toolUseConfirm:I,onDone:D,onReject:y,parseInput:_,operationType:w}),{options:X,acceptFeedback:B,rejectFeedback:R,setFocusedOption:$,handleInputModeToggle:q,focusedOption:H,yesInputMode:W,noInputMode:z}=S,A=_(I.input),G=i(()=>x?x.getConfig(_(I.input)):null,[x,I.input]),J=G?{onChange:(e,o)=>{const t=x.applyChanges(A,o.edits);S.onChange(e,t)},toolUseContext:C,filePath:G.filePath,edits:(G.edits||[]).map(e=>({old_string:e.old_string,new_string:e.new_string,replace_all:e.replace_all||!1})),editMode:G.editMode||"single"}:{onChange:()=>{},toolUseContext:C,filePath:"",edits:[],editMode:"single"},{closeTabInIDE:K,showingDiffInIDE:L,ideName:Q}=r(J),onChange=(e,o)=>{K?.(),S.onChange(e,A,o?.trim())};if(L&&G&&M)return e(g,{onChange:(e,o,t)=>onChange(e,t),options:X,filePath:M,input:A,ideName:Q,symlinkTarget:N,rejectFeedback:R,acceptFeedback:B,setFocusedOption:$,onInputModeToggle:q,focusedOption:H,yesInputMode:W,noInputMode:z});const V=null!=N&&n(p(),N).startsWith(".."),Y=N?e(s,{paddingX:1,marginBottom:1,children:e(a,{color:"warning",children:V?`Esto modificará ${N} (fuera del directorio de trabajo) a través de un enlace simbólico`:`Destino del enlace simbólico: ${N}`})}):null;return o(t,{children:[o(h,{title:b,subtitle:k,innerPaddingX:0,workerBadge:v,children:[Y,T,o(s,{flexDirection:"column",paddingX:1,children:["string"==typeof P?e(a,{children:P}):P,e(u,{options:X,inlineDescriptions:!0,onChange:e=>{const o=X.find(o=>o.value===e);if(o){if("reject"===o.option.type){const e=R.trim();return void onChange(o.option,e||void 0)}if("accept-once"===o.option.type){const e=B.trim();return void onChange(o.option,e||void 0)}onChange(o.option)}},onCancel:()=>onChange({type:"reject"}),onFocus:e=>$(e),onInputModeToggle:q})]})]}),e(s,{paddingX:1,marginTop:1,children:o(a,{dimColor:!0,children:["Esc para cancelar",("yes"===H&&!W||"no"===H&&!z)&&" · Tab para modificar"]})})]})}
@@ -1 +1 @@
1
- import{jsxs as e}from"react/jsx-runtime";import{homedir as t}from"os";import{basename as o,join as s,sep as l}from"path";import{getOriginalCwd as i}from"../../../bootstrap/state.js";import{Text as n}from"../../../ink.js";import{getShortcutDisplay as a}from"../../../keybindings/shortcutFormat.js";import{expandPath as r,getDirectoryForPath as d}from"../../../utils/path.js";import{normalizeCaseForComparison as p,pathInAllowedWorkingPath as c}from"../../../utils/permissions/filesystem.js";export function isInClaudeFolder(e){const t=r(e),o=r(`${i()}/.claude`),s=p(t),n=p(o);return s.startsWith(n+l.toLowerCase())||s.startsWith(n+"/")}export function isInGlobalClaudeFolder(e){const o=r(e),i=s(t(),".claude"),n=p(o),a=p(i);return n.startsWith(a+l.toLowerCase())||n.startsWith(a+"/")}export function getFilePermissionOptions({filePath:t,toolPermissionContext:s,operationType:l="write",onRejectFeedbackChange:i,onAcceptFeedbackChange:r,yesInputMode:p=!1,noInputMode:u=!1}){const h=[],m=a("chat:cycleMode","Chat","shift+tab");p&&r?h.push({type:"input",label:"Yes",value:"yes",placeholder:"and tell Claude what to do next",onChange:r,allowEmptySubmitToCancel:!0,option:{type:"accept-once"}}):h.push({label:"Yes",value:"yes",option:{type:"accept-once"}});const f=c(t,s),y=isInClaudeFolder(t),b=isInGlobalClaudeFolder(t);if((y||b)&&"read"!==l)h.push({label:"Yes, and allow Claude to edit its own settings for this session",value:"yes-claude-folder",option:{type:"accept-session",scope:b?"global-claude-folder":"claude-folder"}});else{let s;if(f)s="read"===l?"Yes, during this session":e(n,{children:["Yes, allow all edits during this session"," ",e(n,{bold:!0,children:["(",m,")"]})]});else{const i=d(t),a=o(i)||"this directory";s=e(n,"read"===l?{children:["Yes, allow reading from ",e(n,{bold:!0,children:[a,"/"]})," during this session"]}:{children:["Yes, allow all edits in ",e(n,{bold:!0,children:[a,"/"]})," during this session ",e(n,{bold:!0,children:["(",m,")"]})]})}h.push({label:s,value:"yes-session",option:{type:"accept-session"}})}return u&&i?h.push({type:"input",label:"No",value:"no",placeholder:"and tell Claude what to do differently",onChange:i,allowEmptySubmitToCancel:!0,option:{type:"reject"}}):h.push({label:"No",value:"no",option:{type:"reject"}}),h}
1
+ import{jsxs as e}from"react/jsx-runtime";import{homedir as t}from"os";import{basename as o,join as s,sep as i}from"path";import{getOriginalCwd as a}from"../../../bootstrap/state.js";import{Text as n}from"../../../ink.js";import{getShortcutDisplay as r}from"../../../keybindings/shortcutFormat.js";import{expandPath as l,getDirectoryForPath as p}from"../../../utils/path.js";import{normalizeCaseForComparison as c,pathInAllowedWorkingPath as d}from"../../../utils/permissions/filesystem.js";export function isInClaudeFolder(e){const t=l(e),o=l(`${a()}/.claude`),s=c(t),n=c(o);return s.startsWith(n+i.toLowerCase())||s.startsWith(n+"/")}export function isInGlobalClaudeFolder(e){const o=l(e),a=s(t(),".claude"),n=c(o),r=c(a);return n.startsWith(r+i.toLowerCase())||n.startsWith(r+"/")}export function getFilePermissionOptions({filePath:t,toolPermissionContext:s,operationType:i="write",onRejectFeedbackChange:a,onAcceptFeedbackChange:l,yesInputMode:c=!1,noInputMode:u=!1}){const h=[],m=r("chat:cycleMode","Chat","shift+tab");c&&l?h.push({type:"input",label:"",value:"yes",placeholder:"y dile a Context qué hacer a continuación",onChange:l,allowEmptySubmitToCancel:!0,option:{type:"accept-once"}}):h.push({label:"",value:"yes",option:{type:"accept-once"}});const f=d(t,s),y=isInClaudeFolder(t),b=isInGlobalClaudeFolder(t);if((y||b)&&"read"!==i)h.push({label:"Sí, y permitir a Context editar su propia configuración en esta sesión",value:"yes-claude-folder",option:{type:"accept-session",scope:b?"global-claude-folder":"claude-folder"}});else{let s;if(f)s="read"===i?"Sí, durante esta sesión":e(n,{children:["Sí, permitir todas las ediciones durante esta sesión"," ",e(n,{bold:!0,children:["(",m,")"]})]});else{const a=p(t),r=o(a)||"este directorio";s=e(n,"read"===i?{children:["Sí, permitir lectura desde ",e(n,{bold:!0,children:[r,"/"]})," durante esta sesión"]}:{children:["Sí, permitir todas las ediciones en ",e(n,{bold:!0,children:[r,"/"]})," durante esta sesión ",e(n,{bold:!0,children:["(",m,")"]})]})}h.push({label:s,value:"yes-session",option:{type:"accept-session"}})}return u&&a?h.push({type:"input",label:"No",value:"no",placeholder:"y dile a Context qué hacer de forma diferente",onChange:a,allowEmptySubmitToCancel:!0,option:{type:"reject"}}):h.push({label:"No",value:"no",option:{type:"reject"}}),h}