import{n as A,u as m,j as e,B as _,k as h,l as v,I as o,S as H,f as y,g as R,h as S,i as p,L as U}from"./index-O0BQoyzo.js";import{r as g}from"./react-Cb2sDjhD.js";import{u as k,a as L}from"./use-settings-DMdaoWsB.js";import{L as I}from"./loader-circle-9VUMGitw.js";import{R as B}from"./refresh-ccw-D2CWiyU_.js";import{X as P}from"./x-DG-JKVw_.js";import{S as O}from"./save-DB0BDYTs.js";import{N as V}from"./network-BXhEjGhE.js";import{S as D}from"./shield-alert-CKFVsGgI.js";import{B as w}from"./bell-Cg2Bvv06.js";import{H as K}from"./heart-pulse-DmGhKR2W.js";import"./useQuery-PdiC7-sY.js";/**
 * @license lucide-react v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const G=A("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
 * @license lucide-react v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const X=A("FileStack",[["path",{d:"M21 7h-3a2 2 0 0 1-2-2V2",key:"9rb54x"}],["path",{d:"M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z",key:"1059l0"}],["path",{d:"M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15",key:"16874u"}],["path",{d:"M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11",key:"k2ox98"}]]);/**
 * @license lucide-react v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Y=A("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
 * @license lucide-react v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z=A("Waves",[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]]);function F(a){return{role:a.IMHUB_NATIVE_AGENT_ROLE??"",mode:a.IMHUB_NATIVE_AGENT_MODE||"read-only",autoAllow:a.IMHUB_NATIVE_AGENT_AUTOALLOW??"",denyList:a.IMHUB_NATIVE_AGENT_DENYLIST??"",evalEnabled:x(a.IMHUB_NOTIFICATION_EVALUATOR),evalSources:a.IMHUB_NOTIFICATION_EVALUATOR_SOURCES??"",hbEnabled:x(a.IMHUB_HEARTBEAT_ENABLED),hbTickMs:a.IMHUB_HEARTBEAT_TICK_INTERVAL_MS??"",hbDefaultMin:a.IMHUB_HEARTBEAT_DEFAULT_INTERVAL_MIN??"",toolResultCap:a.IMHUB_NATIVE_TOOL_RESULT_MAX_CHARS??"",toolTimeoutMs:a.IMHUB_NATIVE_TOOL_TIMEOUT_MS??"",blankRetryMax:a.IMHUB_NATIVE_BLANK_RETRY_MAX??"",lengthRecoveryMax:a.IMHUB_NATIVE_LENGTH_RECOVERY_MAX??"",a2aMaxDepth:a.IMHUB_A2A_MAX_DEPTH??"",a2aTimeoutMs:a.IMHUB_A2A_TIMEOUT_DEFAULT_MS??"",callAgentInProcess:!N(a.IMHUB_NATIVE_CALL_AGENT_IN_PROCESS),callAgentMaxPerTurn:a.IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN??"",semanticStuckLoop:!N(a.IMHUB_NATIVE_SEMANTIC_STUCK_LOOP),criticEnabled:x(a.IMHUB_NATIVE_CRITIC),criticRole:a.IMHUB_NATIVE_CRITIC_ROLE??"",planModeDefault:x(a.IMHUB_NATIVE_PLAN_MODE),planIntentAuto:x(a.IMHUB_PLAN_INTENT_AUTO),planIntentPhrases:a.IMHUB_PLAN_INTENT_PHRASES??"",compactTriggerChars:a.IMHUB_NATIVE_COMPACT_TRIGGER_CHARS??"",compactKeepTurns:a.IMHUB_NATIVE_COMPACT_KEEP_TURNS??"",compactKeepFirst:a.IMHUB_NATIVE_COMPACT_KEEP_FIRST??"",compactSummaryChars:a.IMHUB_NATIVE_COMPACT_SUMMARY_CHARS??"",streamPartial:!N(a.IMHUB_NATIVE_STREAM_PARTIAL),maxIter:a.IMHUB_NATIVE_AGENT_MAX_ITER??""}}function N(a){if(!a)return!1;const l=a.toLowerCase().trim();return l==="off"||l==="false"||l==="0"||l==="no"}function x(a){if(!a)return!1;const l=a.toLowerCase();return l==="1"||l==="true"||l==="yes"||l==="on"}function W(){const{t:a}=m(["settings","common"]),l=a("nativeAgent.subtitle"),t=a("nativeAgent.llmLink"),s=l.indexOf(t);return s===-1?e.jsx("p",{className:"text-sm text-text-dim",children:l}):e.jsxs("p",{className:"text-sm text-text-dim",children:[l.slice(0,s),e.jsx("a",{className:"underline",href:t,children:t}),l.slice(s+t.length)]})}function pe(){const{t:a}=m(["settings","common"]),l=k({reveal:!1}),t=L(),s=l.data?.env??{},c=g.useMemo(()=>F(s),[s]),[n,b]=g.useState(c),[T,M]=g.useState("");g.useEffect(()=>{const r=JSON.stringify(c);r!==T&&(b(c),M(r))},[c,T]);const E=JSON.stringify(n)!==JSON.stringify(c);function d(r,u){b(C=>({...C,[r]:u}))}async function j(){const r={};if(n.role!==c.role&&(r.IMHUB_NATIVE_AGENT_ROLE=n.role.trim()||null),n.mode!==c.mode&&(r.IMHUB_NATIVE_AGENT_MODE=n.mode),n.autoAllow!==c.autoAllow&&(r.IMHUB_NATIVE_AGENT_AUTOALLOW=n.autoAllow.trim()||null),n.denyList!==c.denyList&&(r.IMHUB_NATIVE_AGENT_DENYLIST=n.denyList.trim()||null),n.evalEnabled!==c.evalEnabled&&(r.IMHUB_NOTIFICATION_EVALUATOR=n.evalEnabled?"on":null),n.evalSources!==c.evalSources&&(r.IMHUB_NOTIFICATION_EVALUATOR_SOURCES=n.evalSources.trim()||null),n.hbEnabled!==c.hbEnabled&&(r.IMHUB_HEARTBEAT_ENABLED=n.hbEnabled?"on":null),n.hbTickMs!==c.hbTickMs&&(r.IMHUB_HEARTBEAT_TICK_INTERVAL_MS=n.hbTickMs.trim()||null),n.hbDefaultMin!==c.hbDefaultMin&&(r.IMHUB_HEARTBEAT_DEFAULT_INTERVAL_MIN=n.hbDefaultMin.trim()||null),n.toolResultCap!==c.toolResultCap&&(r.IMHUB_NATIVE_TOOL_RESULT_MAX_CHARS=n.toolResultCap.trim()||null),n.toolTimeoutMs!==c.toolTimeoutMs&&(r.IMHUB_NATIVE_TOOL_TIMEOUT_MS=n.toolTimeoutMs.trim()||null),n.blankRetryMax!==c.blankRetryMax&&(r.IMHUB_NATIVE_BLANK_RETRY_MAX=n.blankRetryMax.trim()||null),n.lengthRecoveryMax!==c.lengthRecoveryMax&&(r.IMHUB_NATIVE_LENGTH_RECOVERY_MAX=n.lengthRecoveryMax.trim()||null),n.a2aMaxDepth!==c.a2aMaxDepth&&(r.IMHUB_A2A_MAX_DEPTH=n.a2aMaxDepth.trim()||null),n.a2aTimeoutMs!==c.a2aTimeoutMs&&(r.IMHUB_A2A_TIMEOUT_DEFAULT_MS=n.a2aTimeoutMs.trim()||null),n.callAgentInProcess!==c.callAgentInProcess&&(r.IMHUB_NATIVE_CALL_AGENT_IN_PROCESS=n.callAgentInProcess?null:"off"),n.callAgentMaxPerTurn!==c.callAgentMaxPerTurn&&(r.IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN=n.callAgentMaxPerTurn.trim()||null),n.semanticStuckLoop!==c.semanticStuckLoop&&(r.IMHUB_NATIVE_SEMANTIC_STUCK_LOOP=n.semanticStuckLoop?null:"off"),n.criticEnabled!==c.criticEnabled&&(r.IMHUB_NATIVE_CRITIC=n.criticEnabled?"on":null),n.criticRole!==c.criticRole&&(r.IMHUB_NATIVE_CRITIC_ROLE=n.criticRole.trim()||null),n.planModeDefault!==c.planModeDefault&&(r.IMHUB_NATIVE_PLAN_MODE=n.planModeDefault?"1":null),n.planIntentAuto!==c.planIntentAuto&&(r.IMHUB_PLAN_INTENT_AUTO=n.planIntentAuto?"on":null),n.planIntentPhrases!==c.planIntentPhrases&&(r.IMHUB_PLAN_INTENT_PHRASES=n.planIntentPhrases.trim()||null),n.compactTriggerChars!==c.compactTriggerChars&&(r.IMHUB_NATIVE_COMPACT_TRIGGER_CHARS=n.compactTriggerChars.trim()||null),n.compactKeepTurns!==c.compactKeepTurns&&(r.IMHUB_NATIVE_COMPACT_KEEP_TURNS=n.compactKeepTurns.trim()||null),n.compactKeepFirst!==c.compactKeepFirst&&(r.IMHUB_NATIVE_COMPACT_KEEP_FIRST=n.compactKeepFirst.trim()||null),n.compactSummaryChars!==c.compactSummaryChars&&(r.IMHUB_NATIVE_COMPACT_SUMMARY_CHARS=n.compactSummaryChars.trim()||null),n.streamPartial!==c.streamPartial&&(r.IMHUB_NATIVE_STREAM_PARTIAL=n.streamPartial?null:"off"),n.maxIter!==c.maxIter&&(r.IMHUB_NATIVE_AGENT_MAX_ITER=n.maxIter.trim()||null),Object.keys(r).length!==0)try{await t.mutateAsync({updates:r}),v.success(a("nativeAgent.savedToast"))}catch(u){v.error(u?.message??String(u))}}function f(){b(c)}return e.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-6",children:[e.jsxs("header",{className:"flex items-center gap-3",children:[e.jsx("h1",{className:"text-xl font-semibold",children:a("nativeAgent.title")}),e.jsxs(_,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>void l.refetch(),disabled:l.isFetching,"aria-label":a("actions.refresh",{ns:"common"}),children:[l.isFetching?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(B,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:a("nativeAgent.refresh")})]})]}),e.jsx(W,{}),l.isLoading?e.jsx("div",{className:"h-64 rounded-md bg-surface-2 animate-pulse"}):e.jsxs(e.Fragment,{children:[e.jsx(J,{draft:n,setField:d}),e.jsx(Z,{draft:n,setField:d}),e.jsx($,{draft:n,setField:d}),e.jsx(ee,{draft:n,setField:d}),e.jsx(te,{draft:n,setField:d}),e.jsx(ae,{draft:n,setField:d}),e.jsx(q,{draft:n,setField:d}),e.jsx(Q,{draft:n,setField:d})]}),E&&e.jsxs("div",{className:"sticky bottom-2 flex items-center gap-2 rounded-md border border-border bg-surface px-4 py-3 shadow",children:[e.jsx(h,{variant:"info",children:a("nativeAgent.unsaved")}),e.jsxs(_,{variant:"ghost",size:"sm",className:"ml-auto",onClick:f,disabled:t.isPending,children:[e.jsx(P,{className:"h-4 w-4"})," ",a("nativeAgent.discard")]}),e.jsxs(_,{size:"sm",onClick:()=>void j(),disabled:t.isPending,children:[t.isPending?e.jsx(I,{className:"h-4 w-4 animate-spin"}):e.jsx(O,{className:"h-4 w-4"}),a("nativeAgent.save")]})]})]})}function J({draft:a,setField:l}){const{t}=m(["settings","common"]);return e.jsxs("section",{className:"rounded-md border border-border bg-surface",children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-border px-4 py-3",children:[e.jsx(G,{className:"h-4 w-4 text-text-dim"}),e.jsx("h2",{className:"text-sm font-semibold",children:t("nativeAgent.agentCard")})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-4 sm:grid-cols-2",children:[e.jsx(i,{label:t("nativeAgent.roleOverride"),hint:t("nativeAgent.roleHint"),children:e.jsx(o,{value:a.role,onChange:s=>l("role",s.target.value),placeholder:"native-chat",className:"font-mono text-xs"})}),e.jsx(i,{label:t("nativeAgent.approvalMode"),hint:t("nativeAgent.approvalHint"),children:e.jsxs(H,{value:a.mode,onValueChange:s=>l("mode",s),children:[e.jsx(y,{children:e.jsx(R,{})}),e.jsxs(S,{children:[e.jsx(p,{value:"read-only",children:t("nativeAgent.modeReadOnly")}),e.jsx(p,{value:"allow-list",children:t("nativeAgent.modeAllowList")}),e.jsx(p,{value:"allow-all",children:t("nativeAgent.modeAllowAll")}),e.jsx(p,{value:"deny-all",children:t("nativeAgent.modeDenyAll")})]})]})}),e.jsx(i,{label:t("nativeAgent.autoAllow"),hint:t("nativeAgent.autoAllowHint"),children:e.jsx(o,{value:a.autoAllow,onChange:s=>l("autoAllow",s.target.value),placeholder:"native_,mcp_filesystem_",className:"font-mono text-xs"})}),e.jsx(i,{label:t("nativeAgent.denyList"),hint:t("nativeAgent.denyListHint"),children:e.jsx(o,{value:a.denyList,onChange:s=>l("denyList",s.target.value),placeholder:"mcp_shell_,mcp_dangerous_",className:"font-mono text-xs"})})]})]})}function q({draft:a,setField:l}){const{t}=m(["settings","common"]);return e.jsxs("section",{className:"rounded-md border border-border bg-surface",children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-border px-4 py-3",children:[e.jsx(w,{className:"h-4 w-4 text-text-dim"}),e.jsx("h2",{className:"text-sm font-semibold",children:t("nativeAgent.evaluatorCard")}),a.evalEnabled?e.jsx(h,{variant:"success",children:t("nativeAgent.on")}):e.jsx(h,{variant:"outline",children:t("nativeAgent.off")})]}),e.jsx("p",{className:"px-4 pt-2 text-xs text-text-dim",children:t("nativeAgent.evalDesc")}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-4 sm:grid-cols-2",children:[e.jsx(i,{label:t("nativeAgent.enableGate"),children:e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx("input",{type:"checkbox",checked:a.evalEnabled,onChange:s=>l("evalEnabled",s.target.checked),className:"h-4 w-4 accent-accent cursor-pointer"}),e.jsx("span",{children:t("nativeAgent.filterViaLlm")})]})}),e.jsx(i,{label:t("nativeAgent.evalSources"),hint:t("nativeAgent.evalSourcesHint"),children:e.jsx(o,{value:a.evalSources,onChange:s=>l("evalSources",s.target.value),placeholder:"push,heartbeat",className:"font-mono text-xs",disabled:!a.evalEnabled})})]})]})}function Q({draft:a,setField:l}){const{t}=m(["settings","common"]);return e.jsxs("section",{className:"rounded-md border border-border bg-surface",children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-border px-4 py-3",children:[e.jsx(K,{className:"h-4 w-4 text-text-dim"}),e.jsx("h2",{className:"text-sm font-semibold",children:t("nativeAgent.heartbeatCard")}),a.hbEnabled?e.jsx(h,{variant:"success",children:t("nativeAgent.on")}):e.jsx(h,{variant:"outline",children:t("nativeAgent.off")})]}),e.jsx("p",{className:"px-4 pt-2 text-xs text-text-dim",children:t("nativeAgent.hbDesc")}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-4 sm:grid-cols-3",children:[e.jsx(i,{label:t("nativeAgent.enableScheduler"),children:e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx("input",{type:"checkbox",checked:a.hbEnabled,onChange:s=>l("hbEnabled",s.target.checked),className:"h-4 w-4 accent-accent cursor-pointer"}),e.jsx("span",{children:t("nativeAgent.startScanLoop")})]})}),e.jsx(i,{label:t("nativeAgent.tickInterval"),hint:t("nativeAgent.tickHint"),children:e.jsx(o,{type:"number",value:a.hbTickMs,onChange:s=>l("hbTickMs",s.target.value),placeholder:"60000",className:"font-mono text-xs",disabled:!a.hbEnabled})}),e.jsx(i,{label:t("nativeAgent.defaultInterval"),hint:t("nativeAgent.defaultIntervalHint"),children:e.jsx(o,{type:"number",value:a.hbDefaultMin,onChange:s=>l("hbDefaultMin",s.target.value),placeholder:"15",className:"font-mono text-xs",disabled:!a.hbEnabled})})]})]})}function Z({draft:a,setField:l}){const{t}=m(["settings","common"]);return e.jsxs("section",{className:"rounded-md border border-border bg-surface",children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-border px-4 py-3",children:[e.jsx(Y,{className:"h-4 w-4 text-text-dim"}),e.jsx("h2",{className:"text-sm font-semibold",children:t("nativeAgent.runtimeCard")})]}),e.jsx("p",{className:"px-4 pt-2 text-xs text-text-dim",children:t("nativeAgent.runtimeDesc")}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-4 sm:grid-cols-2",children:[e.jsx(i,{label:t("nativeAgent.toolResultCap"),hint:t("nativeAgent.toolResultCapHint"),children:e.jsx(o,{type:"number",value:a.toolResultCap,onChange:s=>l("toolResultCap",s.target.value),placeholder:"64000",className:"font-mono text-xs"})}),e.jsx(i,{label:t("nativeAgent.toolTimeoutMs"),hint:t("nativeAgent.toolTimeoutHint"),children:e.jsx(o,{type:"number",value:a.toolTimeoutMs,onChange:s=>l("toolTimeoutMs",s.target.value),placeholder:"60000",className:"font-mono text-xs"})}),e.jsx(i,{label:t("nativeAgent.blankRetryMax"),hint:t("nativeAgent.blankRetryHint"),children:e.jsx(o,{type:"number",value:a.blankRetryMax,onChange:s=>l("blankRetryMax",s.target.value),placeholder:"1",className:"font-mono text-xs"})}),e.jsx(i,{label:t("nativeAgent.lengthRecoveryMax"),hint:t("nativeAgent.lengthRecoveryHint"),children:e.jsx(o,{type:"number",value:a.lengthRecoveryMax,onChange:s=>l("lengthRecoveryMax",s.target.value),placeholder:"1",className:"font-mono text-xs"})})]})]})}function $({draft:a,setField:l}){const{t}=m(["settings","common"]);return e.jsxs("section",{className:"rounded-md border border-border bg-surface",children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-border px-4 py-3",children:[e.jsx(V,{className:"h-4 w-4 text-text-dim"}),e.jsx("h2",{className:"text-sm font-semibold",children:t("nativeAgent.a2aCard")})]}),e.jsx("p",{className:"px-4 pt-2 text-xs text-text-dim",children:t("nativeAgent.a2aDesc")}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-4 sm:grid-cols-2",children:[e.jsx(i,{label:t("nativeAgent.a2aMaxDepth"),hint:t("nativeAgent.a2aMaxDepthHint"),children:e.jsx(o,{type:"number",value:a.a2aMaxDepth,onChange:s=>l("a2aMaxDepth",s.target.value),placeholder:"1",className:"font-mono text-xs"})}),e.jsx(i,{label:t("nativeAgent.a2aTimeoutMs"),hint:t("nativeAgent.a2aTimeoutMsHint"),children:e.jsx(o,{type:"number",value:a.a2aTimeoutMs,onChange:s=>l("a2aTimeoutMs",s.target.value),placeholder:"1800000",className:"font-mono text-xs"})}),e.jsx(i,{label:t("nativeAgent.callAgentInProcess"),hint:t("nativeAgent.callAgentInProcessHint"),children:e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx("input",{type:"checkbox",checked:a.callAgentInProcess,onChange:s=>l("callAgentInProcess",s.target.checked),className:"h-4 w-4 accent-accent cursor-pointer"}),e.jsx("span",{children:a.callAgentInProcess?t("nativeAgent.on"):t("nativeAgent.off")})]})}),e.jsx(i,{label:t("nativeAgent.callAgentMaxPerTurn"),hint:t("nativeAgent.callAgentMaxPerTurnHint"),children:e.jsx(o,{type:"number",value:a.callAgentMaxPerTurn,onChange:s=>l("callAgentMaxPerTurn",s.target.value),placeholder:"2",className:"font-mono text-xs"})})]})]})}function ee({draft:a,setField:l}){const{t}=m(["settings","common"]);return e.jsxs("section",{className:"rounded-md border border-border bg-surface",children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-border px-4 py-3",children:[e.jsx(D,{className:"h-4 w-4 text-text-dim"}),e.jsx("h2",{className:"text-sm font-semibold",children:t("nativeAgent.criticCard")})]}),e.jsx("p",{className:"px-4 pt-2 text-xs text-text-dim",children:t("nativeAgent.criticDesc")}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-4 sm:grid-cols-2",children:[e.jsx(i,{label:t("nativeAgent.semanticStuckLoop"),hint:t("nativeAgent.semanticStuckLoopHint"),children:e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx("input",{type:"checkbox",checked:a.semanticStuckLoop,onChange:s=>l("semanticStuckLoop",s.target.checked),className:"h-4 w-4 accent-accent cursor-pointer"}),e.jsx("span",{children:a.semanticStuckLoop?t("nativeAgent.on"):t("nativeAgent.off")})]})}),e.jsx(i,{label:t("nativeAgent.criticEnabled"),hint:t("nativeAgent.criticEnabledHint"),children:e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx("input",{type:"checkbox",checked:a.criticEnabled,onChange:s=>l("criticEnabled",s.target.checked),className:"h-4 w-4 accent-accent cursor-pointer"}),e.jsx("span",{children:a.criticEnabled?t("nativeAgent.on"):t("nativeAgent.off")})]})}),e.jsx(i,{label:t("nativeAgent.criticRole"),hint:t("nativeAgent.criticRoleHint"),children:e.jsx(o,{value:a.criticRole,onChange:s=>l("criticRole",s.target.value),placeholder:"(use main backend)",className:"font-mono text-xs",disabled:!a.criticEnabled})}),e.jsx(i,{label:t("nativeAgent.planModeDefault"),hint:t("nativeAgent.planModeDefaultHint"),children:e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx("input",{type:"checkbox",checked:a.planModeDefault,onChange:s=>l("planModeDefault",s.target.checked),className:"h-4 w-4 accent-accent cursor-pointer"}),e.jsx("span",{children:a.planModeDefault?t("nativeAgent.on"):t("nativeAgent.off")})]})}),e.jsx(i,{label:t("nativeAgent.planIntentAuto"),hint:t("nativeAgent.planIntentAutoHint"),children:e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx("input",{type:"checkbox",checked:a.planIntentAuto,onChange:s=>l("planIntentAuto",s.target.checked),className:"h-4 w-4 accent-accent cursor-pointer"}),e.jsx("span",{children:a.planIntentAuto?t("nativeAgent.on"):t("nativeAgent.off")})]})}),e.jsx(i,{label:t("nativeAgent.planIntentPhrases"),hint:t("nativeAgent.planIntentPhrasesHint"),children:e.jsx(o,{value:a.planIntentPhrases,onChange:s=>l("planIntentPhrases",s.target.value),placeholder:"先想想,plan only,don't act yet",className:"font-mono text-xs",disabled:!a.planIntentAuto})})]})]})}function te({draft:a,setField:l}){const{t}=m(["settings","common"]);return e.jsxs("section",{className:"rounded-md border border-border bg-surface",children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-border px-4 py-3",children:[e.jsx(X,{className:"h-4 w-4 text-text-dim"}),e.jsx("h2",{className:"text-sm font-semibold",children:t("nativeAgent.compactCard")})]}),e.jsx("p",{className:"px-4 pt-2 text-xs text-text-dim",children:t("nativeAgent.compactDesc")}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-4 sm:grid-cols-2",children:[e.jsx(i,{label:t("nativeAgent.compactTriggerChars"),hint:t("nativeAgent.compactTriggerCharsHint"),children:e.jsx(o,{type:"number",value:a.compactTriggerChars,onChange:s=>l("compactTriggerChars",s.target.value),placeholder:"60000",className:"font-mono text-xs"})}),e.jsx(i,{label:t("nativeAgent.compactKeepTurns"),hint:t("nativeAgent.compactKeepTurnsHint"),children:e.jsx(o,{type:"number",value:a.compactKeepTurns,onChange:s=>l("compactKeepTurns",s.target.value),placeholder:"6",className:"font-mono text-xs"})}),e.jsx(i,{label:t("nativeAgent.compactKeepFirst"),hint:t("nativeAgent.compactKeepFirstHint"),children:e.jsx(o,{type:"number",value:a.compactKeepFirst,onChange:s=>l("compactKeepFirst",s.target.value),placeholder:"1",className:"font-mono text-xs"})}),e.jsx(i,{label:t("nativeAgent.compactSummaryChars"),hint:t("nativeAgent.compactSummaryCharsHint"),children:e.jsx(o,{type:"number",value:a.compactSummaryChars,onChange:s=>l("compactSummaryChars",s.target.value),placeholder:"1500",className:"font-mono text-xs"})})]})]})}function ae({draft:a,setField:l}){const{t}=m(["settings","common"]);return e.jsxs("section",{className:"rounded-md border border-border bg-surface",children:[e.jsxs("header",{className:"flex items-center gap-2 border-b border-border px-4 py-3",children:[e.jsx(z,{className:"h-4 w-4 text-text-dim"}),e.jsx("h2",{className:"text-sm font-semibold",children:t("nativeAgent.streamCard")})]}),e.jsx("p",{className:"px-4 pt-2 text-xs text-text-dim",children:t("nativeAgent.streamDesc")}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-4 sm:grid-cols-2",children:[e.jsx(i,{label:t("nativeAgent.streamPartial"),hint:t("nativeAgent.streamPartialHint"),children:e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx("input",{type:"checkbox",checked:a.streamPartial,onChange:s=>l("streamPartial",s.target.checked),className:"h-4 w-4 accent-accent cursor-pointer"}),e.jsx("span",{children:a.streamPartial?t("nativeAgent.on"):t("nativeAgent.off")})]})}),e.jsx(i,{label:t("nativeAgent.maxIter"),hint:t("nativeAgent.maxIterHint"),children:e.jsx(o,{type:"number",value:a.maxIter,onChange:s=>l("maxIter",s.target.value),placeholder:"50",className:"font-mono text-xs"})})]})]})}function i({label:a,hint:l,children:t}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(U,{className:"text-xs font-medium",children:a}),t,l&&e.jsx("p",{className:"text-[11px] text-text-dim",children:l})]})}export{pe as default};
//# sourceMappingURL=native-agent-QvIa6LjE.js.map
