@kaitranntt/ccs 7.68.1-dev.9 → 7.68.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/commands/create-command-env.d.ts +0 -1
- package/dist/auth/commands/create-command-env.d.ts.map +1 -1
- package/dist/ccs.js +2 -55
- package/dist/ccs.js.map +1 -1
- package/dist/channels/official-channels-runtime.d.ts +0 -1
- package/dist/channels/official-channels-runtime.d.ts.map +1 -1
- package/dist/channels/official-channels-store.d.ts +0 -1
- package/dist/channels/official-channels-store.d.ts.map +1 -1
- package/dist/cliproxy/base-config-loader.d.ts +0 -1
- package/dist/cliproxy/base-config-loader.d.ts.map +1 -1
- package/dist/cliproxy/config/env-builder.d.ts +0 -1
- package/dist/cliproxy/config/env-builder.d.ts.map +1 -1
- package/dist/cliproxy/config/extended-context-config.d.ts +0 -1
- package/dist/cliproxy/config/extended-context-config.d.ts.map +1 -1
- package/dist/cliproxy/config/thinking-config.d.ts +0 -1
- package/dist/cliproxy/config/thinking-config.d.ts.map +1 -1
- package/dist/cliproxy/executor/env-resolver.d.ts +0 -2
- package/dist/cliproxy/executor/env-resolver.d.ts.map +1 -1
- package/dist/cliproxy/executor/env-resolver.js +1 -2
- package/dist/cliproxy/executor/env-resolver.js.map +1 -1
- package/dist/cliproxy/executor/index.d.ts.map +1 -1
- package/dist/cliproxy/executor/index.js +1 -28
- package/dist/cliproxy/executor/index.js.map +1 -1
- package/dist/cliproxy/model-id-normalizer.d.ts +0 -1
- package/dist/cliproxy/model-id-normalizer.d.ts.map +1 -1
- package/dist/cliproxy/routing-strategy-http.d.ts +0 -1
- package/dist/cliproxy/routing-strategy-http.d.ts.map +1 -1
- package/dist/cliproxy/tool-sanitization-proxy.d.ts.map +1 -1
- package/dist/cliproxy/tool-sanitization-proxy.js +3 -0
- package/dist/cliproxy/tool-sanitization-proxy.js.map +1 -1
- package/dist/cliproxy/types.d.ts +0 -2
- package/dist/cliproxy/types.d.ts.map +1 -1
- package/dist/commands/cliproxy/catalog-subcommand.d.ts +0 -6
- package/dist/commands/cliproxy/catalog-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/catalog-subcommand.js +1 -39
- package/dist/commands/cliproxy/catalog-subcommand.js.map +1 -1
- package/dist/commands/cliproxy/help-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/help-subcommand.js +0 -1
- package/dist/commands/cliproxy/help-subcommand.js.map +1 -1
- package/dist/commands/cliproxy/index.d.ts.map +1 -1
- package/dist/commands/cliproxy/index.js +0 -6
- package/dist/commands/cliproxy/index.js.map +1 -1
- package/dist/commands/command-catalog.d.ts +1 -1
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/cursor-command-display.d.ts +0 -2
- package/dist/commands/cursor-command-display.d.ts.map +1 -1
- package/dist/commands/cursor-command-display.js +3 -24
- package/dist/commands/cursor-command-display.js.map +1 -1
- package/dist/commands/cursor-command.d.ts.map +1 -1
- package/dist/commands/cursor-command.js +1 -31
- package/dist/commands/cursor-command.js.map +1 -1
- package/dist/config/migration-manager.d.ts.map +1 -1
- package/dist/config/migration-manager.js +1 -2
- package/dist/config/migration-manager.js.map +1 -1
- package/dist/config/unified-config-loader.d.ts +3 -8
- package/dist/config/unified-config-loader.d.ts.map +1 -1
- package/dist/config/unified-config-loader.js +7 -20
- package/dist/config/unified-config-loader.js.map +1 -1
- package/dist/config/unified-config-types.d.ts +2 -15
- package/dist/config/unified-config-types.d.ts.map +1 -1
- package/dist/config/unified-config-types.js +3 -8
- package/dist/config/unified-config-types.js.map +1 -1
- package/dist/cursor/constants.d.ts +1 -1
- package/dist/cursor/constants.d.ts.map +1 -1
- package/dist/cursor/constants.js +0 -1
- package/dist/cursor/constants.js.map +1 -1
- package/dist/cursor/cursor-anthropic-response.d.ts +0 -1
- package/dist/cursor/cursor-anthropic-response.d.ts.map +1 -1
- package/dist/cursor/cursor-auth.d.ts +0 -1
- package/dist/cursor/cursor-auth.d.ts.map +1 -1
- package/dist/cursor/cursor-auth.js +32 -154
- package/dist/cursor/cursor-auth.js.map +1 -1
- package/dist/cursor/cursor-executor.d.ts +1 -2
- package/dist/cursor/cursor-executor.d.ts.map +1 -1
- package/dist/cursor/cursor-executor.js +160 -295
- package/dist/cursor/cursor-executor.js.map +1 -1
- package/dist/cursor/cursor-protobuf-decoder.d.ts.map +1 -1
- package/dist/cursor/cursor-protobuf-decoder.js +3 -1
- package/dist/cursor/cursor-protobuf-decoder.js.map +1 -1
- package/dist/cursor/cursor-protobuf-schema.d.ts +3 -12
- package/dist/cursor/cursor-protobuf-schema.d.ts.map +1 -1
- package/dist/cursor/cursor-protobuf-schema.js +5 -23
- package/dist/cursor/cursor-protobuf-schema.js.map +1 -1
- package/dist/cursor/cursor-protobuf.d.ts +1 -1
- package/dist/cursor/cursor-protobuf.d.ts.map +1 -1
- package/dist/cursor/cursor-protobuf.js +4 -2
- package/dist/cursor/cursor-protobuf.js.map +1 -1
- package/dist/cursor/cursor-stream-parser.d.ts +0 -10
- package/dist/cursor/cursor-stream-parser.d.ts.map +1 -1
- package/dist/cursor/cursor-stream-parser.js +10 -106
- package/dist/cursor/cursor-stream-parser.js.map +1 -1
- package/dist/cursor/index.d.ts +0 -1
- package/dist/cursor/index.d.ts.map +1 -1
- package/dist/cursor/index.js +1 -3
- package/dist/cursor/index.js.map +1 -1
- package/dist/cursor/types.d.ts +0 -6
- package/dist/cursor/types.d.ts.map +1 -1
- package/dist/docker/docker-executor.d.ts +0 -1
- package/dist/docker/docker-executor.d.ts.map +1 -1
- package/dist/management/instance-manager.d.ts.map +1 -1
- package/dist/management/instance-manager.js +2 -5
- package/dist/management/instance-manager.js.map +1 -1
- package/dist/targets/claude-adapter.d.ts +1 -6
- package/dist/targets/claude-adapter.d.ts.map +1 -1
- package/dist/targets/claude-adapter.js +2 -6
- package/dist/targets/claude-adapter.js.map +1 -1
- package/dist/targets/codex-adapter.d.ts +0 -1
- package/dist/targets/codex-adapter.d.ts.map +1 -1
- package/dist/targets/codex-adapter.js +8 -12
- package/dist/targets/codex-adapter.js.map +1 -1
- package/dist/targets/droid-adapter.d.ts +1 -3
- package/dist/targets/droid-adapter.d.ts.map +1 -1
- package/dist/targets/droid-adapter.js +2 -3
- package/dist/targets/droid-adapter.js.map +1 -1
- package/dist/targets/target-adapter.d.ts +0 -5
- package/dist/targets/target-adapter.d.ts.map +1 -1
- package/dist/types/cli.d.ts +0 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/ui/assets/{accounts-D9eEaNx9.js → accounts-DjL3iVZW.js} +1 -1
- package/dist/ui/assets/{alert-dialog-QyEXocpn.js → alert-dialog-Tc_D1a_B.js} +1 -1
- package/dist/ui/assets/{api-7vQe0xOg.js → api-CUtkvXmX.js} +1 -1
- package/dist/ui/assets/{auth-section-BszF77uT.js → auth-section-CuKWQHC7.js} +1 -1
- package/dist/ui/assets/{backups-section-D6RgaOx1.js → backups-section-BKW2pbb9.js} +1 -1
- package/dist/ui/assets/{channels-B1vgnNJX.js → channels-DvWJMdaq.js} +1 -1
- package/dist/ui/assets/{checkbox-Dzwkj_Pg.js → checkbox-B0hZxMK5.js} +1 -1
- package/dist/ui/assets/{claude-extension-CKO4bJ22.js → claude-extension-Dfqu-rev.js} +1 -1
- package/dist/ui/assets/{cliproxy-kHd-oC5W.js → cliproxy-C9RxW-I8.js} +1 -1
- package/dist/ui/assets/{cliproxy-ai-providers-CmbFYVoR.js → cliproxy-ai-providers-BXLuuxNf.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-M8ZfUq3C.js → cliproxy-control-panel-aQ7cCc2U.js} +1 -1
- package/dist/ui/assets/{codex-BJ0RdMuh.js → codex-aq4RI6_n.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-BlSaX2gK.js → confirm-dialog-CpDk6eu4.js} +1 -1
- package/dist/ui/assets/{copilot-NJKZQXQ_.js → copilot-CQRpGXvY.js} +1 -1
- package/dist/ui/assets/cursor-BpXPf6qi.js +1 -0
- package/dist/ui/assets/{droid-B9u9ZB-a.js → droid-Cgx-yLjy.js} +1 -1
- package/dist/ui/assets/{globalenv-section-DoX37DqB.js → globalenv-section-DsNqG1yB.js} +1 -1
- package/dist/ui/assets/{health-D_gdcxnc.js → health-BY-O-JcA.js} +1 -1
- package/dist/ui/assets/index-BmSzf0T9.js +72 -0
- package/dist/ui/assets/{index-DFEMq3KP.js → index-CLGiPB3A.js} +1 -1
- package/dist/ui/assets/{index-CTGpqIx6.js → index-Cet36v1V.js} +1 -1
- package/dist/ui/assets/index-DH6L6ybH.js +1 -0
- package/dist/ui/assets/{index-BNU4Hhe_.js → index-DsCjnpco.js} +1 -1
- package/dist/ui/assets/{index-DoVPk3vW.js → index-TQFuDZdB.js} +1 -1
- package/dist/ui/assets/index-teLjoh2T.css +1 -0
- package/dist/ui/assets/{logs-DtH4YMt4.js → logs-D5ro-pc7.js} +1 -1
- package/dist/ui/assets/{masked-input-C2H-Ax0Z.js → masked-input-h0XkMSwB.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-BOrsn86w.js → proxy-status-widget-yBdrFeb7.js} +1 -1
- package/dist/ui/assets/{raw-json-settings-editor-panel-WxTn7-hS.js → raw-json-settings-editor-panel-Cb7ZInQV.js} +1 -1
- package/dist/ui/assets/{searchable-select-1zOULoec.js → searchable-select-D4xr5xKS.js} +1 -1
- package/dist/ui/assets/{separator-BCfZ54mZ.js → separator-gw5BjIpP.js} +1 -1
- package/dist/ui/assets/{shared-DlTbnc9n.js → shared-C-VeA1Z9.js} +1 -1
- package/dist/ui/assets/{table-Bx2cnkWN.js → table-Bd4isC18.js} +1 -1
- package/dist/ui/assets/{updates-SiZKOnUD.js → updates-DiK8I67C.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/utils/claude-detector.d.ts +0 -1
- package/dist/utils/claude-detector.d.ts.map +1 -1
- package/dist/utils/claude-spawner.d.ts +0 -1
- package/dist/utils/claude-spawner.d.ts.map +1 -1
- package/dist/utils/hooks/image-analysis-runtime-status.js +5 -5
- package/dist/utils/hooks/image-analysis-runtime-status.js.map +1 -1
- package/dist/utils/image-analysis/claude-tool-args.d.ts +0 -3
- package/dist/utils/image-analysis/claude-tool-args.d.ts.map +1 -1
- package/dist/utils/image-analysis/claude-tool-args.js +47 -21
- package/dist/utils/image-analysis/claude-tool-args.js.map +1 -1
- package/dist/utils/package-manager-detector.d.ts +0 -1
- package/dist/utils/package-manager-detector.d.ts.map +1 -1
- package/dist/utils/shell-executor.d.ts +0 -1
- package/dist/utils/shell-executor.d.ts.map +1 -1
- package/dist/utils/websearch/claude-tool-args.d.ts +0 -7
- package/dist/utils/websearch/claude-tool-args.d.ts.map +1 -1
- package/dist/utils/websearch/claude-tool-args.js +50 -27
- package/dist/utils/websearch/claude-tool-args.js.map +1 -1
- package/dist/utils/websearch/hook-env.d.ts.map +1 -1
- package/dist/utils/websearch/hook-env.js +1 -19
- package/dist/utils/websearch/hook-env.js.map +1 -1
- package/dist/utils/websearch/status.d.ts +1 -1
- package/dist/utils/websearch/status.d.ts.map +1 -1
- package/dist/utils/websearch/status.js +12 -33
- package/dist/utils/websearch/status.js.map +1 -1
- package/dist/utils/websearch/trace.d.ts +0 -1
- package/dist/utils/websearch/trace.d.ts.map +1 -1
- package/dist/utils/websearch/trace.js +5 -20
- package/dist/utils/websearch/trace.js.map +1 -1
- package/dist/utils/websearch/types.d.ts +2 -12
- package/dist/utils/websearch/types.d.ts.map +1 -1
- package/dist/utils/websearch/types.js +0 -38
- package/dist/utils/websearch/types.js.map +1 -1
- package/dist/web-server/health/websearch-checks.js +1 -1
- package/dist/web-server/health/websearch-checks.js.map +1 -1
- package/dist/web-server/middleware/auth-middleware.d.ts +1 -0
- package/dist/web-server/middleware/auth-middleware.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-local-proxy.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-local-proxy.js +6 -26
- package/dist/web-server/routes/cliproxy-local-proxy.js.map +1 -1
- package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-stats-routes.js +1 -8
- package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
- package/dist/web-server/routes/cursor-routes.d.ts +0 -2
- package/dist/web-server/routes/cursor-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cursor-routes.js +2 -44
- package/dist/web-server/routes/cursor-routes.js.map +1 -1
- package/dist/web-server/routes/websearch-routes.d.ts.map +1 -1
- package/dist/web-server/routes/websearch-routes.js +0 -37
- package/dist/web-server/routes/websearch-routes.js.map +1 -1
- package/dist/web-server/services/cliproxy-dashboard-install-service.d.ts.map +1 -1
- package/dist/web-server/services/cliproxy-dashboard-install-service.js +0 -14
- package/dist/web-server/services/cliproxy-dashboard-install-service.js.map +1 -1
- package/dist/web-server/services/codex-dashboard-service.d.ts +0 -1
- package/dist/web-server/services/codex-dashboard-service.d.ts.map +1 -1
- package/dist/web-server/services/droid-dashboard-service.d.ts +0 -1
- package/dist/web-server/services/droid-dashboard-service.d.ts.map +1 -1
- package/lib/hooks/websearch-transformer.cjs +0 -136
- package/lib/mcp/ccs-websearch-server.cjs +1 -1
- package/package.json +1 -2
- package/dist/cursor/cursor-runtime-probe.d.ts +0 -12
- package/dist/cursor/cursor-runtime-probe.d.ts.map +0 -1
- package/dist/cursor/cursor-runtime-probe.js +0 -220
- package/dist/cursor/cursor-runtime-probe.js.map +0 -1
- package/dist/docker/supervisord-lifecycle.d.ts +0 -17
- package/dist/docker/supervisord-lifecycle.d.ts.map +0 -1
- package/dist/docker/supervisord-lifecycle.js +0 -58
- package/dist/docker/supervisord-lifecycle.js.map +0 -1
- package/dist/ui/assets/cursor-BrcDgu6X.js +0 -1
- package/dist/ui/assets/index-Cu6e0-ev.css +0 -1
- package/dist/ui/assets/index-DOn6k1jF.js +0 -72
- package/dist/ui/assets/index-h08p9xL5.js +0 -1
- package/dist/utils/browser/chrome-reuse.d.ts +0 -17
- package/dist/utils/browser/chrome-reuse.d.ts.map +0 -1
- package/dist/utils/browser/chrome-reuse.js +0 -205
- package/dist/utils/browser/chrome-reuse.js.map +0 -1
- package/dist/utils/browser/claude-tool-args.d.ts +0 -2
- package/dist/utils/browser/claude-tool-args.d.ts.map +0 -1
- package/dist/utils/browser/claude-tool-args.js +0 -18
- package/dist/utils/browser/claude-tool-args.js.map +0 -1
- package/dist/utils/browser/index.d.ts +0 -8
- package/dist/utils/browser/index.d.ts.map +0 -1
- package/dist/utils/browser/index.js +0 -24
- package/dist/utils/browser/index.js.map +0 -1
- package/dist/utils/browser/mcp-installer.d.ts +0 -14
- package/dist/utils/browser/mcp-installer.d.ts.map +0 -1
- package/dist/utils/browser/mcp-installer.js +0 -356
- package/dist/utils/browser/mcp-installer.js.map +0 -1
- package/dist/utils/browser-codex-overrides.d.ts +0 -3
- package/dist/utils/browser-codex-overrides.d.ts.map +0 -1
- package/dist/utils/browser-codex-overrides.js +0 -29
- package/dist/utils/browser-codex-overrides.js.map +0 -1
- package/dist/utils/claude-tool-args.d.ts +0 -7
- package/dist/utils/claude-tool-args.d.ts.map +0 -1
- package/dist/utils/claude-tool-args.js +0 -43
- package/dist/utils/claude-tool-args.js.map +0 -1
- package/dist/utils/prompt-injection-strategy.d.ts +0 -54
- package/dist/utils/prompt-injection-strategy.d.ts.map +0 -1
- package/dist/utils/prompt-injection-strategy.js +0 -128
- package/dist/utils/prompt-injection-strategy.js.map +0 -1
- package/lib/mcp/ccs-browser-server.cjs +0 -877
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as i}from"./react-vendor-CNOkPC89.js";import{bv as F,be as y,bg as w,n as L,B as $,L as M,aF as A,I as O,d as P}from"./index-DOn6k1jF.js";import{R as U,w as N,x as B,ab as V,at as K,as as _,aG as q}from"./icons-KVCk4_U8.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";const R={selected:[],unattended:!1};async function k(t,a){try{const c=await t.json();return typeof c.error=="string"&&c.error.trim().length>0?c.error:a}catch{return a}}function G(){const[t,a]=i.useState(R),[c,o]=i.useState(null),[v,g]=i.useState(!0),[j,x]=i.useState(!1),[C,u]=i.useState(null),[h,b]=i.useState(null),m=i.useCallback(r=>{b(r),window.setTimeout(()=>b(null),1500)},[]),f=i.useCallback(async()=>{try{g(!0),u(null);const r=await fetch("/api/channels");if(!r.ok)throw new Error(await k(r,"Failed to load Official Channels settings"));const n=await r.json();return a(n.config??R),o(n.status??null),!0}catch(r){return u(r instanceof Error?r.message:"Unknown error"),!1}finally{g(!1)}},[]),S=i.useCallback(async(r,n="Settings saved")=>{try{x(!0),u(null);const s=await fetch("/api/channels",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!s.ok)throw new Error(await k(s,"Failed to save Official Channels settings"));const d=await s.json();return a(l=>d.config??{...l,...r}),m(n),!0}catch(s){return u(s instanceof Error?s.message:"Unknown error"),!1}finally{x(!1)}},[m]),T=i.useCallback(async(r,n)=>{try{x(!0),u(null);const s=await fetch(`/api/channels/${r}/token`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:n})});if(!s.ok)throw new Error(await k(s,`Failed to save ${r} token`));return await f()?(m(`${r} token saved`),!0):!1}catch(s){return u(s instanceof Error?s.message:"Unknown error"),!1}finally{x(!1)}},[f,m]),E=i.useCallback(async r=>{try{x(!0),u(null);const n=await fetch(`/api/channels/${r}/token`,{method:"DELETE"});if(!n.ok)throw new Error(await k(n,`Failed to clear ${r} token`));return await f()?(m(`${r} token cleared`),!0):!1}catch(n){return u(n instanceof Error?n.message:"Unknown error"),!1}finally{x(!1)}},[f,m]);return{config:t,status:c,loading:v,saving:j,error:C,success:h,fetchConfig:f,updateConfig:S,saveToken:T,clearToken:E}}const J={telegram:"",discord:"",imessage:""};function Y(t){return t==="ready"?"border-green-200 bg-green-50 text-green-900 dark:border-green-900/60 dark:bg-green-950/40 dark:text-green-100":t==="limited"?"border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-900/60 dark:bg-amber-950/40 dark:text-amber-100":"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-900/60 dark:bg-blue-950/40 dark:text-blue-100"}function z(t){return t==="ready"?"default":t==="not_selected"?"secondary":t==="unavailable"?"destructive":"outline"}function H(t){return t==="ready"?"default":t==="partial"?"outline":t==="blocked"?"destructive":"secondary"}function Q(t,a){return t.length===0?"None selected":t.map(c=>a?.find(o=>o.id===c)?.displayName??c).join(", ")}function ne(){const{config:t,status:a,loading:c,saving:o,error:v,success:g,fetchConfig:j,updateConfig:x,saveToken:C,clearToken:u}=G(),{fetchRawConfig:h}=F(),[b,m]=i.useState(J),f=Q(t.selected,a?.channels);i.useEffect(()=>{j(),h()},[j,h]);const S=async()=>{await Promise.all([j(),h()])},T=async(s,d)=>{const l=d?[...new Set([...t.selected,s])]:t.selected.filter(D=>D!==s);await x({selected:l},d?`${s} selected for auto-enable`:`${s} removed from auto-enable`)&&await Promise.all([j(),h()])},E=(s,d)=>{m(l=>({...l,[s]:d}))},r=async s=>{await C(s,b[s])&&(m(l=>({...l,[s]:""})),await h())},n=async s=>{await u(s)&&(m(l=>({...l,[s]:""})),await h())};return c?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(U,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:"Loading"})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${v||g?"translate-y-0 opacity-100":"pointer-events-none -translate-y-2 opacity-0"}`,children:[v&&e.jsxs(y,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(w,{children:v})]}),g&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-green-200 bg-green-50 px-3 py-2 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(B,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:g})]})]}),e.jsx(L,{className:"flex-1",children:e.jsxs("div",{className:"space-y-6 p-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(V,{className:"h-5 w-5 text-primary"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"Official Channels"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Configure official Claude channels here, then run ",e.jsx("code",{children:"ccs"})," normally on a supported native Claude session."]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["CCS stores only channel selection in ",e.jsx("code",{children:"config.yaml"}),". Claude keeps the machine-level channel state under ",e.jsx("code",{children:"~/.claude/channels/"}),"."]})]})]}),a&&e.jsxs("div",{className:`rounded-xl border p-4 ${Y(a.summary.state)}`,children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{variant:a.summary.state==="ready"?"default":"outline",children:a.summary.title}),e.jsx("span",{className:"text-sm font-medium",children:f})]}),e.jsx("p",{className:"text-sm",children:a.summary.message}),e.jsx("p",{className:"text-sm opacity-90",children:a.summary.nextStep})]}),e.jsxs("div",{className:"min-w-[220px] rounded-lg border border-current/10 bg-background/60 p-3 text-sm text-foreground",children:[e.jsx("p",{className:"font-medium",children:"Machine checks"}),e.jsxs("div",{className:"mt-2 space-y-1 text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:"Bun"}),e.jsx("span",{children:a.bunInstalled?"Installed":"Missing"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:"Claude Code"}),e.jsx("span",{children:a.claudeVersion.current?`v${a.claudeVersion.current}`:"Unknown"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:"Claude auth"}),e.jsx("span",{children:a.auth.authMethod??"Unknown"})]})]})]})]}),a.summary.blockers.length>0&&e.jsx("div",{className:"mt-3 space-y-1 text-sm",children:a.summary.blockers.map(s=>e.jsx("p",{children:s},s))})]}),a&&e.jsxs("div",{className:"rounded-lg border bg-muted/20 p-4",children:[e.jsx("p",{className:"font-medium",children:"Fastest path"}),e.jsxs("div",{className:"mt-3 space-y-2 text-sm text-muted-foreground",children:[e.jsx("p",{children:"1. Turn on the channels you want below."}),e.jsx("p",{children:"2. Save Telegram or Discord bot tokens here if that channel needs one."}),e.jsxs("p",{children:["3. Run ",e.jsx("code",{children:"ccs"})," or a native Claude account profile. CCS adds"," ",e.jsx("code",{children:"--channels"})," for you on supported runs."]}),e.jsx("p",{children:a.supportMessage})]}),e.jsxs("details",{className:"mt-3 rounded-lg border bg-background p-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Advanced notes and scope"}),e.jsxs("div",{className:"mt-3 space-y-2 text-sm text-muted-foreground",children:[e.jsx("p",{children:a.accountStatusCaveat}),e.jsx("p",{children:a.stateScopeMessage})]})]})]}),a&&e.jsxs("div",{className:"rounded-lg border bg-background p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"font-medium",children:["If you run ",e.jsx("code",{children:"ccs"})," now"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.launchPreview.detail})]}),e.jsx($,{variant:H(a.launchPreview.state),children:a.launchPreview.title})]}),e.jsxs("div",{className:"mt-3 space-y-2",children:[e.jsxs("div",{className:"rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"You type:"})," ",a.launchPreview.command]}),e.jsxs("div",{className:"rounded-md bg-muted px-3 py-2 font-mono text-sm break-all",children:[e.jsx("span",{className:"text-muted-foreground",children:"CCS adds:"})," ",a.launchPreview.appendedArgs.length>0?a.launchPreview.appendedArgs.join(" "):"(nothing yet)"]})]}),a.launchPreview.skippedMessages.length>0&&e.jsx("div",{className:"mt-3 space-y-1 text-sm text-muted-foreground",children:a.launchPreview.skippedMessages.map(s=>e.jsx("p",{children:s},s))})]}),a?.claudeVersion.message&&a.claudeVersion.state!=="supported"&&e.jsxs(y,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(w,{children:a.claudeVersion.message})]}),a?.auth.message&&a.auth.state!=="eligible"&&e.jsxs(y,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(w,{children:a.auth.message})]}),a?.auth.orgRequirementMessage&&e.jsxs(y,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(w,{children:a.auth.orgRequirementMessage})]}),e.jsx("div",{className:"space-y-4",children:a?.channels.map(s=>{const d=t.selected.includes(s.id),l=b[s.id];return e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(M,{className:"text-base font-medium",children:s.displayName}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s.summary}),e.jsx("p",{className:"mt-2 font-mono text-xs text-muted-foreground",children:s.pluginSpec})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx($,{variant:z(s.setup.state),children:s.setup.label}),e.jsx(A,{checked:d,disabled:o||!!s.unavailableReason&&!d,onCheckedChange:p=>void T(s.id,p)})]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/30 p-4 text-sm text-muted-foreground space-y-2",children:[e.jsx("p",{children:s.setup.detail}),e.jsx("p",{children:s.setup.nextStep})]}),s.requiresToken&&e.jsxs("div",{className:"space-y-3 rounded-lg bg-muted/30 p-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:!s.tokenConfigured&&s.tokenSource==="process_env"?`The current CCS process already has ${s.envKey}. Save it here only if you want persistent Claude channel state.`:s.tokenConfigured&&s.processEnvAvailable?`${s.envKey} is saved in Claude channel state, and the current CCS process env also provides it.`:`Save ${s.envKey} in Claude's official channel env file. The dashboard never reads the token value back after save.`}),s.tokenConfigured&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Saving here writes the same ",e.jsx("code",{children:".env"})," file as"," ",e.jsxs("code",{children:["/",s.id,":configure"]}),", so you do not need to run the configure command again after a successful save."]}),e.jsx(O,{type:"password",value:l,onChange:p=>E(s.id,p.target.value),placeholder:s.tokenConfigured?`Configured. Enter a new ${s.envKey} to replace it.`:!s.tokenConfigured&&s.tokenSource==="process_env"?`Using current CCS process env. Enter a new ${s.envKey} to save it for Claude.`:`Paste ${s.envKey}`,disabled:o}),s.tokenPath&&s.tokenSource!=="process_env"&&e.jsx("div",{className:"text-xs text-muted-foreground break-all",children:s.tokenPath}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(P,{onClick:()=>void r(s.id),disabled:o||!l.trim(),children:[e.jsx(K,{className:"mr-2 h-4 w-4"}),"Save Token"]}),e.jsxs(P,{variant:"outline",onClick:()=>void n(s.id),disabled:o||!s.tokenConfigured,children:[e.jsx(_,{className:"mr-2 h-4 w-4"}),"Clear Saved Token"]})]})]}),e.jsxs("details",{className:"rounded-lg border bg-background p-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Claude-side setup commands"}),e.jsx("div",{className:"mt-3 space-y-2",children:(s.manualSetupCommands??[]).map(p=>e.jsx("div",{className:"rounded-md bg-muted px-3 py-2 font-mono text-sm break-all",children:p},p))})]})]},s.id)})}),e.jsx(y,{children:e.jsxs(w,{children:["CCS injects ",e.jsx("code",{children:"--channels"})," only for the current Claude session. Telegram, Discord, and iMessage stop receiving messages when that Claude session exits."]})}),e.jsx("div",{className:"rounded-lg border p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg bg-muted/30 p-4",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx(q,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600"}),e.jsxs("div",{children:[e.jsx(M,{className:"text-sm font-medium",children:"Skip permission prompts on launch"}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Optional advanced behavior. CCS adds ",e.jsx("code",{children:"--dangerously-skip-permissions"})," ","only when at least one selected channel is being auto-enabled and you did not already pass a permission flag yourself."]})]})]}),e.jsx(A,{checked:t.unattended,disabled:o,onCheckedChange:s=>void(async()=>{await x({unattended:s},s?"Unattended mode enabled":"Unattended mode disabled")&&await h()})()})]})}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(P,{variant:"outline",onClick:()=>void S(),disabled:o,children:[e.jsx(U,{className:`mr-2 h-4 w-4 ${o?"animate-spin":""}`}),"Refresh"]})})]})})]})}export{ne as default};
|
|
1
|
+
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as i}from"./react-vendor-CNOkPC89.js";import{bv as F,be as y,bg as w,n as L,B as $,L as M,aF as A,I as O,d as P}from"./index-BmSzf0T9.js";import{R as U,w as N,x as B,ab as V,at as K,as as _,aG as q}from"./icons-KVCk4_U8.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";const R={selected:[],unattended:!1};async function k(t,a){try{const c=await t.json();return typeof c.error=="string"&&c.error.trim().length>0?c.error:a}catch{return a}}function G(){const[t,a]=i.useState(R),[c,o]=i.useState(null),[v,g]=i.useState(!0),[j,x]=i.useState(!1),[C,u]=i.useState(null),[h,b]=i.useState(null),m=i.useCallback(r=>{b(r),window.setTimeout(()=>b(null),1500)},[]),f=i.useCallback(async()=>{try{g(!0),u(null);const r=await fetch("/api/channels");if(!r.ok)throw new Error(await k(r,"Failed to load Official Channels settings"));const n=await r.json();return a(n.config??R),o(n.status??null),!0}catch(r){return u(r instanceof Error?r.message:"Unknown error"),!1}finally{g(!1)}},[]),S=i.useCallback(async(r,n="Settings saved")=>{try{x(!0),u(null);const s=await fetch("/api/channels",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!s.ok)throw new Error(await k(s,"Failed to save Official Channels settings"));const d=await s.json();return a(l=>d.config??{...l,...r}),m(n),!0}catch(s){return u(s instanceof Error?s.message:"Unknown error"),!1}finally{x(!1)}},[m]),T=i.useCallback(async(r,n)=>{try{x(!0),u(null);const s=await fetch(`/api/channels/${r}/token`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:n})});if(!s.ok)throw new Error(await k(s,`Failed to save ${r} token`));return await f()?(m(`${r} token saved`),!0):!1}catch(s){return u(s instanceof Error?s.message:"Unknown error"),!1}finally{x(!1)}},[f,m]),E=i.useCallback(async r=>{try{x(!0),u(null);const n=await fetch(`/api/channels/${r}/token`,{method:"DELETE"});if(!n.ok)throw new Error(await k(n,`Failed to clear ${r} token`));return await f()?(m(`${r} token cleared`),!0):!1}catch(n){return u(n instanceof Error?n.message:"Unknown error"),!1}finally{x(!1)}},[f,m]);return{config:t,status:c,loading:v,saving:j,error:C,success:h,fetchConfig:f,updateConfig:S,saveToken:T,clearToken:E}}const J={telegram:"",discord:"",imessage:""};function Y(t){return t==="ready"?"border-green-200 bg-green-50 text-green-900 dark:border-green-900/60 dark:bg-green-950/40 dark:text-green-100":t==="limited"?"border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-900/60 dark:bg-amber-950/40 dark:text-amber-100":"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-900/60 dark:bg-blue-950/40 dark:text-blue-100"}function z(t){return t==="ready"?"default":t==="not_selected"?"secondary":t==="unavailable"?"destructive":"outline"}function H(t){return t==="ready"?"default":t==="partial"?"outline":t==="blocked"?"destructive":"secondary"}function Q(t,a){return t.length===0?"None selected":t.map(c=>a?.find(o=>o.id===c)?.displayName??c).join(", ")}function ne(){const{config:t,status:a,loading:c,saving:o,error:v,success:g,fetchConfig:j,updateConfig:x,saveToken:C,clearToken:u}=G(),{fetchRawConfig:h}=F(),[b,m]=i.useState(J),f=Q(t.selected,a?.channels);i.useEffect(()=>{j(),h()},[j,h]);const S=async()=>{await Promise.all([j(),h()])},T=async(s,d)=>{const l=d?[...new Set([...t.selected,s])]:t.selected.filter(D=>D!==s);await x({selected:l},d?`${s} selected for auto-enable`:`${s} removed from auto-enable`)&&await Promise.all([j(),h()])},E=(s,d)=>{m(l=>({...l,[s]:d}))},r=async s=>{await C(s,b[s])&&(m(l=>({...l,[s]:""})),await h())},n=async s=>{await u(s)&&(m(l=>({...l,[s]:""})),await h())};return c?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(U,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:"Loading"})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${v||g?"translate-y-0 opacity-100":"pointer-events-none -translate-y-2 opacity-0"}`,children:[v&&e.jsxs(y,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(w,{children:v})]}),g&&e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-green-200 bg-green-50 px-3 py-2 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(B,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:g})]})]}),e.jsx(L,{className:"flex-1",children:e.jsxs("div",{className:"space-y-6 p-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(V,{className:"h-5 w-5 text-primary"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"Official Channels"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Configure official Claude channels here, then run ",e.jsx("code",{children:"ccs"})," normally on a supported native Claude session."]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["CCS stores only channel selection in ",e.jsx("code",{children:"config.yaml"}),". Claude keeps the machine-level channel state under ",e.jsx("code",{children:"~/.claude/channels/"}),"."]})]})]}),a&&e.jsxs("div",{className:`rounded-xl border p-4 ${Y(a.summary.state)}`,children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{variant:a.summary.state==="ready"?"default":"outline",children:a.summary.title}),e.jsx("span",{className:"text-sm font-medium",children:f})]}),e.jsx("p",{className:"text-sm",children:a.summary.message}),e.jsx("p",{className:"text-sm opacity-90",children:a.summary.nextStep})]}),e.jsxs("div",{className:"min-w-[220px] rounded-lg border border-current/10 bg-background/60 p-3 text-sm text-foreground",children:[e.jsx("p",{className:"font-medium",children:"Machine checks"}),e.jsxs("div",{className:"mt-2 space-y-1 text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:"Bun"}),e.jsx("span",{children:a.bunInstalled?"Installed":"Missing"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:"Claude Code"}),e.jsx("span",{children:a.claudeVersion.current?`v${a.claudeVersion.current}`:"Unknown"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:"Claude auth"}),e.jsx("span",{children:a.auth.authMethod??"Unknown"})]})]})]})]}),a.summary.blockers.length>0&&e.jsx("div",{className:"mt-3 space-y-1 text-sm",children:a.summary.blockers.map(s=>e.jsx("p",{children:s},s))})]}),a&&e.jsxs("div",{className:"rounded-lg border bg-muted/20 p-4",children:[e.jsx("p",{className:"font-medium",children:"Fastest path"}),e.jsxs("div",{className:"mt-3 space-y-2 text-sm text-muted-foreground",children:[e.jsx("p",{children:"1. Turn on the channels you want below."}),e.jsx("p",{children:"2. Save Telegram or Discord bot tokens here if that channel needs one."}),e.jsxs("p",{children:["3. Run ",e.jsx("code",{children:"ccs"})," or a native Claude account profile. CCS adds"," ",e.jsx("code",{children:"--channels"})," for you on supported runs."]}),e.jsx("p",{children:a.supportMessage})]}),e.jsxs("details",{className:"mt-3 rounded-lg border bg-background p-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Advanced notes and scope"}),e.jsxs("div",{className:"mt-3 space-y-2 text-sm text-muted-foreground",children:[e.jsx("p",{children:a.accountStatusCaveat}),e.jsx("p",{children:a.stateScopeMessage})]})]})]}),a&&e.jsxs("div",{className:"rounded-lg border bg-background p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"font-medium",children:["If you run ",e.jsx("code",{children:"ccs"})," now"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:a.launchPreview.detail})]}),e.jsx($,{variant:H(a.launchPreview.state),children:a.launchPreview.title})]}),e.jsxs("div",{className:"mt-3 space-y-2",children:[e.jsxs("div",{className:"rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"You type:"})," ",a.launchPreview.command]}),e.jsxs("div",{className:"rounded-md bg-muted px-3 py-2 font-mono text-sm break-all",children:[e.jsx("span",{className:"text-muted-foreground",children:"CCS adds:"})," ",a.launchPreview.appendedArgs.length>0?a.launchPreview.appendedArgs.join(" "):"(nothing yet)"]})]}),a.launchPreview.skippedMessages.length>0&&e.jsx("div",{className:"mt-3 space-y-1 text-sm text-muted-foreground",children:a.launchPreview.skippedMessages.map(s=>e.jsx("p",{children:s},s))})]}),a?.claudeVersion.message&&a.claudeVersion.state!=="supported"&&e.jsxs(y,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(w,{children:a.claudeVersion.message})]}),a?.auth.message&&a.auth.state!=="eligible"&&e.jsxs(y,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(w,{children:a.auth.message})]}),a?.auth.orgRequirementMessage&&e.jsxs(y,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(w,{children:a.auth.orgRequirementMessage})]}),e.jsx("div",{className:"space-y-4",children:a?.channels.map(s=>{const d=t.selected.includes(s.id),l=b[s.id];return e.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(M,{className:"text-base font-medium",children:s.displayName}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s.summary}),e.jsx("p",{className:"mt-2 font-mono text-xs text-muted-foreground",children:s.pluginSpec})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx($,{variant:z(s.setup.state),children:s.setup.label}),e.jsx(A,{checked:d,disabled:o||!!s.unavailableReason&&!d,onCheckedChange:p=>void T(s.id,p)})]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/30 p-4 text-sm text-muted-foreground space-y-2",children:[e.jsx("p",{children:s.setup.detail}),e.jsx("p",{children:s.setup.nextStep})]}),s.requiresToken&&e.jsxs("div",{className:"space-y-3 rounded-lg bg-muted/30 p-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:!s.tokenConfigured&&s.tokenSource==="process_env"?`The current CCS process already has ${s.envKey}. Save it here only if you want persistent Claude channel state.`:s.tokenConfigured&&s.processEnvAvailable?`${s.envKey} is saved in Claude channel state, and the current CCS process env also provides it.`:`Save ${s.envKey} in Claude's official channel env file. The dashboard never reads the token value back after save.`}),s.tokenConfigured&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Saving here writes the same ",e.jsx("code",{children:".env"})," file as"," ",e.jsxs("code",{children:["/",s.id,":configure"]}),", so you do not need to run the configure command again after a successful save."]}),e.jsx(O,{type:"password",value:l,onChange:p=>E(s.id,p.target.value),placeholder:s.tokenConfigured?`Configured. Enter a new ${s.envKey} to replace it.`:!s.tokenConfigured&&s.tokenSource==="process_env"?`Using current CCS process env. Enter a new ${s.envKey} to save it for Claude.`:`Paste ${s.envKey}`,disabled:o}),s.tokenPath&&s.tokenSource!=="process_env"&&e.jsx("div",{className:"text-xs text-muted-foreground break-all",children:s.tokenPath}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(P,{onClick:()=>void r(s.id),disabled:o||!l.trim(),children:[e.jsx(K,{className:"mr-2 h-4 w-4"}),"Save Token"]}),e.jsxs(P,{variant:"outline",onClick:()=>void n(s.id),disabled:o||!s.tokenConfigured,children:[e.jsx(_,{className:"mr-2 h-4 w-4"}),"Clear Saved Token"]})]})]}),e.jsxs("details",{className:"rounded-lg border bg-background p-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Claude-side setup commands"}),e.jsx("div",{className:"mt-3 space-y-2",children:(s.manualSetupCommands??[]).map(p=>e.jsx("div",{className:"rounded-md bg-muted px-3 py-2 font-mono text-sm break-all",children:p},p))})]})]},s.id)})}),e.jsx(y,{children:e.jsxs(w,{children:["CCS injects ",e.jsx("code",{children:"--channels"})," only for the current Claude session. Telegram, Discord, and iMessage stop receiving messages when that Claude session exits."]})}),e.jsx("div",{className:"rounded-lg border p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg bg-muted/30 p-4",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx(q,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600"}),e.jsxs("div",{children:[e.jsx(M,{className:"text-sm font-medium",children:"Skip permission prompts on launch"}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Optional advanced behavior. CCS adds ",e.jsx("code",{children:"--dangerously-skip-permissions"})," ","only when at least one selected channel is being auto-enabled and you did not already pass a permission flag yourself."]})]})]}),e.jsx(A,{checked:t.unattended,disabled:o,onCheckedChange:s=>void(async()=>{await x({unattended:s},s?"Unattended mode enabled":"Unattended mode disabled")&&await h()})()})]})}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(P,{variant:"outline",onClick:()=>void S(),disabled:o,children:[e.jsx(U,{className:`mr-2 h-4 w-4 ${o?"animate-spin":""}`}),"Refresh"]})})]})})]})}export{ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,a1 as i,a2 as t}from"./radix-ui-Zb8sVEtn.js";import"./react-vendor-CNOkPC89.js";import{c as s}from"./index-
|
|
1
|
+
import{j as r,a1 as i,a2 as t}from"./radix-ui-Zb8sVEtn.js";import"./react-vendor-CNOkPC89.js";import{c as s}from"./index-BmSzf0T9.js";import{m as o}from"./icons-KVCk4_U8.js";function b({className:e,...a}){return r.jsx(i,{"data-slot":"checkbox",className:s("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...a,children:r.jsx(t,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:r.jsx(o,{className:"size-3.5"})})})}export{b as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as W}from"./react-vendor-CNOkPC89.js";import{bb as Ce,B as p,d as y,n as se,C as u,j as f,k as j,_ as v,b as h,I as H,r as te,s as ae,t as ne,v as ie,w as re,x as F,Q as we,R as Ee,U as le,V as de,c as xe}from"./index-DOn6k1jF.js";import{u as K,a as J,b as V}from"./tanstack-CrmUhA7Z.js";import{t as E}from"./notifications-B2HqRBj7.js";import{aa as Pe,a9 as ke,L as U,at as De,as as Be,R as Ie,T as oe,ah as Te,a7 as Re}from"./icons-KVCk4_U8.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";const L=["claude-extension-bindings"];async function P(s,a){const n=await fetch(Ce(s),{headers:{"Content-Type":"application/json"},...a});if(!n.ok){const l=await n.json().catch(()=>null);throw new Error(l?.error||`Request failed (${n.status})`)}return n.status===204?void 0:await n.json()}function qe(){return K({queryKey:["claude-extension-options"],queryFn:()=>P("/claude-extension/profiles")})}function Ae(s,a="vscode"){return K({queryKey:["claude-extension-setup",s,a],enabled:!!s,queryFn:()=>P(`/claude-extension/setup?profile=${encodeURIComponent(s||"")}&host=${encodeURIComponent(a)}`)})}function $e(){return K({queryKey:L,queryFn:()=>P("/claude-extension/bindings")})}function Le(s){return K({queryKey:["claude-extension-binding-status",s],enabled:!!s,queryFn:()=>P(`/claude-extension/bindings/${encodeURIComponent(s||"")}/verify`)})}function Oe(){const s=J();return V({mutationFn:a=>P("/claude-extension/bindings",{method:"POST",body:JSON.stringify(a)}),onSuccess:()=>{s.invalidateQueries({queryKey:L}),E.success("Binding created")},onError:a=>E.error(a.message)})}function Qe(){const s=J();return V({mutationFn:({id:a,binding:n})=>P(`/claude-extension/bindings/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:(a,n)=>{s.invalidateQueries({queryKey:L}),s.invalidateQueries({queryKey:["claude-extension-binding-status",n.id]}),E.success("Binding saved")},onError:a=>E.error(a.message)})}function Ue(){const s=J();return V({mutationFn:a=>P(`/claude-extension/bindings/${encodeURIComponent(a)}`,{method:"DELETE"}),onSuccess:()=>{s.invalidateQueries({queryKey:L}),E.success("Binding deleted")},onError:a=>E.error(a.message)})}function ge(s,a){const n=J();return V({mutationFn:({id:l,target:S})=>P(`/claude-extension/bindings/${encodeURIComponent(l)}/${s}`,{method:"POST",body:JSON.stringify({target:S})}),onSuccess:l=>{n.invalidateQueries({queryKey:L}),n.setQueryData(["claude-extension-binding-status",l.bindingId],l),E.success(a)},onError:l=>E.error(l.message)})}function Fe(){return ge("apply","Binding applied")}function Ke(){return ge("reset","Managed values removed")}const Je=[];function ce(s){return{name:"",profile:s,host:"vscode",ideSettingsPath:"",notes:""}}function q(s){return{name:s.name,profile:s.profile,host:s.host,ideSettingsPath:s.ideSettingsPath||"",notes:s.notes||""}}function Ve(s){return{name:s.name.trim(),profile:s.profile.trim(),host:s.host,ideSettingsPath:s.ideSettingsPath.trim()||void 0,notes:s.notes.trim()||void 0}}function me(s){return s?.state==="applied"}function Me({state:s}){const a=s==="applied"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":s==="drifted"?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300":s==="missing"?"border-destructive/30 bg-destructive/10 text-destructive":"border-border bg-muted text-muted-foreground";return e.jsx(p,{variant:"outline",className:a,children:s})}function _e(s){return s.replace(/[\\/]/g,"$&")}function o({label:s,value:a,mono:n=!1,copyValue:l}){const S=typeof l=="string"&&l.trim().length>0;return e.jsxs("div",{className:"grid gap-2 text-sm sm:grid-cols-[112px_minmax(0,1fr)] sm:items-start",children:[e.jsx("span",{className:"text-muted-foreground",children:s}),S?e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx("div",{className:"min-w-0 flex-1 rounded-md border bg-muted/25 px-3 py-2",children:e.jsx("span",{className:"block text-left font-mono text-xs leading-5 [overflow-wrap:anywhere]",children:_e(a)})}),e.jsx(F,{value:l,label:`Copy ${s.toLowerCase()}`,className:"shrink-0"})]}):e.jsx("span",{className:xe("text-left sm:text-right",n&&"font-mono text-xs leading-5 [overflow-wrap:anywhere]"),children:a})]})}function ue({title:s,description:a,value:n}){return e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsx(f,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(j,{className:"text-base",children:s}),e.jsx(v,{className:"mt-1",children:a})]}),e.jsx(F,{value:n,label:`Copy ${s}`})]})}),e.jsx(h,{children:e.jsx("pre",{className:"max-h-[360px] overflow-auto rounded-lg border bg-muted/30 p-4 text-xs leading-6",children:n})})]})}function he({title:s,description:a,status:n,applyLabel:l,resetLabel:S,onApply:x,onReset:C,disabled:D,busy:B}){return e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsx(f,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(j,{className:"text-base",children:s}),e.jsx(v,{className:"mt-1",children:a})]}),n?e.jsx(Me,{state:n.state}):null]})}),e.jsxs(h,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{label:"Path",value:n?.path||"Save a binding first",mono:!0,copyValue:n?.path}),e.jsx(o,{label:"File",value:n?n.exists?"Present":"Not created yet":"Unavailable"})]}),e.jsx("div",{className:"rounded-lg border bg-muted/25 p-3 text-sm text-muted-foreground",children:n?.message||"Verify the binding after saving to inspect the current file state."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{size:"sm",className:"flex-1",onClick:x,disabled:D||B,children:[B?e.jsx(U,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,l]}),e.jsx(y,{size:"sm",variant:"outline",className:"flex-1",onClick:C,disabled:D||B,children:S})]})]})]})}function ze({binding:s,isSelected:a,onSelect:n}){return e.jsx("button",{onClick:n,className:xe("w-full rounded-lg border px-3 py-3 text-left transition-colors",a?"border-primary/40 bg-primary/10":"border-border/60 bg-card hover:bg-muted/40"),children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium",children:s.name}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[s.profile," · ",s.host]})]}),e.jsx(p,{variant:"outline",className:"shrink-0",children:s.usesDefaultIdeSettingsPath?"Default path":"Custom path"})]})})}function as(){const s=qe(),a=$e(),n=Oe(),l=Qe(),S=Ue(),x=Fe(),C=Ke(),D=s.data?.profiles??[],B=s.data?.hosts??[],w=a.data?.bindings??Je,pe=D[0]?.name??"default",[fe,I]=W.useState(!1),[O,T]=W.useState(null),[G,k]=W.useState(()=>ce("default")),c=fe||w.length===0,b=!c&&w.length>0?w.find(t=>t.id===O)??(O?null:w[0]):null,g=b?.id??null,r=c||!b||O?G:q(b),Y=Ae(r.profile,r.host),A=Le(c?void 0:g||void 0),d=B.find(t=>t.id===r.host),M=D.find(t=>t.name===r.profile),_=s.error||a.error||Y.error||A.error,je=`${w.length} saved`,X=n.isPending||l.isPending,ve=x.isPending&&x.variables?.target==="shared"||C.isPending&&C.variables?.target==="shared",be=x.isPending&&x.variables?.target==="ide"||C.isPending&&C.variables?.target==="ide",Z=r.name.trim().length>0&&r.profile.trim().length>0,i=Y.data,m=A.data,ee=Math.max((i?.env.length??0)-6,0),Ne=i?.env.slice(0,6)??[];function z(){I(!0),T(null),k(ce(pe))}async function ye(){if(!Z)return;const t=Ve(r);if(!c&&g){const Q=await l.mutateAsync({id:g,binding:t});I(!1),T(Q.binding.id),k(q(Q.binding));return}const N=await n.mutateAsync(t);I(!1),T(N.binding.id),k(q(N.binding))}async function Se(){if(!g||!b||!window.confirm(`Delete binding "${b.name}"?`))return;await S.mutateAsync(g);const t=w.filter(N=>N.id!==g);t.length>0?(T(t[0].id),I(!1),k(q(t[0]))):z()}function $(t,N){if(!c&&b&&!O){T(b.id),k({...q(b),[t]:N}),I(!1);return}k(Q=>({...Q,[t]:N}))}function R(t,N){if(g){if(N==="apply"){x.mutate({id:g,target:t});return}C.mutate({id:g,target:t})}}return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"flex w-[348px] shrink-0 flex-col border-r bg-muted/30 xl:w-[372px]",children:[e.jsx("div",{className:"border-b bg-background p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"rounded-lg border bg-muted/40 p-2",children:e.jsx(Pe,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"font-semibold",children:"Claude Extension"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Saved IDE bindings for CCS profiles"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(p,{variant:"secondary",children:je}),d?e.jsx(p,{variant:"outline",children:d.label}):null]})]}),e.jsxs(y,{size:"sm",onClick:z,className:"gap-1.5",children:[e.jsx(ke,{className:"h-3.5 w-3.5"}),"New"]})]})}),e.jsx(se,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 p-5",children:[e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:c?"Create binding":"Binding editor"}),e.jsx(v,{children:"Save a profile + IDE path once, then apply or reset it from the dashboard."})]}),e.jsxs(h,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"Binding name"}),e.jsx(H,{value:r.name,onChange:t=>$("name",t.target.value),placeholder:"VS Code · work profile"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"CCS profile"}),e.jsxs(te,{value:r.profile,onValueChange:t=>$("profile",t),children:[e.jsx(ae,{children:e.jsx(ne,{placeholder:"Select a profile"})}),e.jsx(ie,{children:D.map(t=>e.jsxs(re,{value:t.name,children:[t.label," (",t.profileType,")"]},t.name))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:M?.description||"Choose which CCS profile the IDE should inherit."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"IDE host"}),e.jsxs(te,{value:r.host,onValueChange:t=>$("host",t),children:[e.jsx(ae,{children:e.jsx(ne,{placeholder:"Select a host"})}),e.jsx(ie,{children:B.map(t=>e.jsx(re,{value:t.id,children:t.label},t.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"IDE settings path"}),e.jsx(H,{value:r.ideSettingsPath,onChange:t=>$("ideSettingsPath",t.target.value),placeholder:d?.defaultSettingsPath||"Leave blank for the default user settings path"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Leave blank to use the default user settings path for"," ",d?.label||"this IDE","."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"Notes"}),e.jsx(H,{value:r.notes,onChange:t=>$("notes",t.target.value),placeholder:"Optional reminder for this machine or workspace"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{className:"flex-1 gap-1.5",onClick:()=>void ye(),disabled:!Z||X,children:[X?e.jsx(U,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(De,{className:"h-3.5 w-3.5"}),c?"Create":"Save"]}),e.jsx(y,{variant:"outline",onClick:z,children:"Reset form"})]}),c?null:e.jsxs(y,{variant:"outline",className:"w-full gap-1.5 text-destructive hover:text-destructive",onClick:()=>void Se(),disabled:S.isPending,children:[e.jsx(Be,{className:"h-3.5 w-3.5"}),"Delete binding"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"px-1 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Saved bindings"}),e.jsx("div",{className:"space-y-2",children:w.length>0?w.map(t=>e.jsx(ze,{binding:t,isSelected:t.id===g&&!c,onSelect:()=>{I(!1),T(t.id),k(q(t))}},t.id)):e.jsx(u,{className:"border-dashed border-border/60 bg-card/60",children:e.jsx(h,{className:"pt-6 text-sm text-muted-foreground",children:"No saved bindings yet. Create one to manage apply, reset, and drift checks from the dashboard."})})})]})]})})]}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(se,{className:"h-full",children:e.jsxs("div",{className:"w-full space-y-6 p-6 xl:p-7 2xl:p-8",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[M?e.jsx(p,{variant:"outline",children:M.label}):null,d?e.jsx(p,{variant:"outline",children:d.label}):null,c?e.jsx(p,{variant:"secondary",children:"Draft"}):null,m?.sharedSettings&&me(m.sharedSettings)&&me(m.ideSettings)?e.jsx(p,{className:"bg-emerald-600 hover:bg-emerald-600",children:"In sync"}):null]}),e.jsxs("div",{className:"max-w-5xl",children:[e.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:b?.name||"Claude extension binding"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Manage the shared Claude settings file and the IDE-local settings file as two scoped targets."})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{variant:"outline",onClick:()=>void A.refetch(),disabled:c||A.isFetching,children:[A.isFetching?e.jsx(U,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):e.jsx(Ie,{className:"mr-1.5 h-3.5 w-3.5"}),"Verify"]}),i?e.jsx(F,{value:i.sharedSettings.command,label:"Copy persist command"}):null]})]}),_?e.jsx(u,{className:"border-destructive/40 bg-destructive/5",children:e.jsxs(h,{className:"flex items-start gap-3 pt-6 text-sm text-destructive",children:[e.jsx(oe,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("div",{children:_.message})]})}):null,_?null:e.jsxs(we,{defaultValue:"overview",className:"flex flex-col gap-6",children:[e.jsxs(Ee,{className:"w-full justify-start",children:[e.jsx(le,{value:"overview",children:"Overview"}),e.jsx(le,{value:"advanced",children:"Advanced"})]}),e.jsxs(de,{value:"overview",className:"mt-0 space-y-6",children:[e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsx(he,{title:"Shared Claude settings",description:"Writes the managed env block inside ~/.claude/settings.json so CLI and IDE behavior stay aligned.",status:m?.sharedSettings,applyLabel:"Apply shared",resetLabel:"Reset shared",onApply:()=>R("shared","apply"),onReset:()=>R("shared","reset"),disabled:c,busy:ve}),e.jsx(he,{title:`${d?.label||"IDE"} settings.json`,description:"Writes only the Anthropic extension keys so unrelated editor preferences stay untouched.",status:m?.ideSettings,applyLabel:"Apply IDE",resetLabel:"Reset IDE",onApply:()=>R("ide","apply"),onReset:()=>R("ide","reset"),disabled:c,busy:be})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1.15fr)_minmax(320px,0.85fr)]",children:[e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:"Resolved binding"}),e.jsx(v,{children:"The binding uses the same profile resolution as `ccs persist` and `ccs env`."})]}),e.jsxs(h,{className:"space-y-3",children:[e.jsx(o,{label:"Profile",value:i?.profile.label||r.profile||"Not selected"}),e.jsx(o,{label:"Profile type",value:i?.profile.profileType||"Unknown"}),e.jsx(o,{label:"IDE host",value:d?.label||"Not selected"}),e.jsx(o,{label:"IDE path mode",value:r.ideSettingsPath.trim()?"Custom path":"Default user path"}),e.jsx(o,{label:"Effective IDE path",value:m?.ideSettings.path||r.ideSettingsPath.trim()||d?.defaultSettingsPath||"Unavailable",mono:!0,copyValue:m?.ideSettings.path||r.ideSettingsPath.trim()||d?.defaultSettingsPath}),e.jsx(o,{label:"Persist command",value:i?.sharedSettings.command||"Save a valid binding first",mono:!0}),r.notes.trim()?e.jsx(o,{label:"Notes",value:r.notes.trim()}):null]})]}),e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:"Managed payload"}),e.jsx(v,{children:"Keep the main view short. The full JSON stays in the Advanced tab."})]}),e.jsxs(h,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[Ne.map(t=>e.jsx(p,{variant:"secondary",className:"font-mono text-[10px]",children:t.name},t.name)),ee>0?e.jsxs(p,{variant:"outline",children:["+",ee," more"]}):null]}),e.jsx("div",{className:"rounded-lg border bg-muted/25 p-4 text-sm",children:i?.env.length?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"font-medium",children:["CCS will inject ",i.env.length," environment values."]}),e.jsx("div",{className:"text-muted-foreground",children:"The IDE-local target receives the extension schema. The shared target receives the same env block through Claude settings."})]}):e.jsx("div",{className:"text-muted-foreground",children:"This profile resolves to native Claude defaults, so apply/reset mainly clears existing CCS-managed overrides."})}),c?e.jsx("div",{className:"rounded-lg border border-dashed bg-muted/15 p-4 text-sm text-muted-foreground",children:"Save this draft to unlock apply, reset, and verify actions."}):e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{className:"flex-1",onClick:()=>R("all","apply"),disabled:x.isPending,children:[x.isPending&&x.variables?.target==="all"?e.jsx(U,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,"Apply both targets"]}),e.jsx(y,{variant:"outline",className:"flex-1",onClick:()=>R("all","reset"),disabled:C.isPending,children:"Reset both targets"})]})]})]})]}),i&&(i.warnings.length>0||i.notes.length>0)?e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:"Warnings"}),e.jsx(v,{children:"Operational details that can break the binding even when JSON is correct."})]}),e.jsx(h,{className:"space-y-3",children:i.warnings.length>0?i.warnings.map(t=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-amber-400/40 bg-amber-50/60 p-3 text-sm dark:bg-amber-950/10",children:[e.jsx(oe,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600"}),e.jsx("span",{children:t})]},t)):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-3 text-sm text-muted-foreground",children:"No runtime warnings for this binding."})})]}),e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:"Notes"}),e.jsx(v,{children:"Short context from CCS about account continuity and host-specific behavior."})]}),e.jsx(h,{className:"space-y-3",children:i.notes.length>0?i.notes.map(t=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/30 p-3 text-sm",children:[e.jsx(Te,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsx("span",{children:t})]},t)):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-3 text-sm text-muted-foreground",children:"No extra notes for this binding."})})]})]}):null]}),e.jsx(de,{value:"advanced",className:"mt-0 space-y-6",children:i?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsx(ue,{title:"Shared Claude settings JSON",description:"Managed env block for ~/.claude/settings.json.",value:i.sharedSettings.json}),e.jsx(ue,{title:`${d?.label||"IDE"} settings JSON`,description:`Anthropic extension snippet for ${d?.settingsTargetLabel||"settings.json"}.`,value:i.ideSettings.json})]}),e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsx(f,{children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(j,{className:"text-base",children:"Resolved environment payload"}),e.jsx(v,{children:"Exact environment values that the extension receives after CCS expands this profile."})]}),e.jsx(F,{value:JSON.stringify(i.env,null,2),label:"Copy environment payload"})]})}),e.jsx(h,{children:i.env.length>0?e.jsx("pre",{className:"max-h-[420px] overflow-auto rounded-lg border bg-muted/30 p-4 text-xs leading-6",children:JSON.stringify(i.env,null,2)}):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-4 text-sm text-muted-foreground",children:"No env payload. This binding resolves to native Claude defaults."})})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:"Shared target metadata"}),e.jsx(v,{children:"Useful when debugging drift or comparing with manual edits."})]}),e.jsxs(h,{className:"space-y-3",children:[e.jsx(o,{label:"Target path",value:m?.sharedSettings.path||i.sharedSettings.path,mono:!0,copyValue:m?.sharedSettings.path||i.sharedSettings.path}),e.jsx(o,{label:"Command",value:i.sharedSettings.command,mono:!0}),e.jsx(o,{label:"Current state",value:m?.sharedSettings.state||"Not verified"})]})]}),e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:"IDE target metadata"}),e.jsx(v,{children:"Current file path plus the extension setting key used for this host."})]}),e.jsxs(h,{className:"space-y-3",children:[e.jsx(o,{label:"Target path",value:m?.ideSettings.path||r.ideSettingsPath.trim()||d?.defaultSettingsPath||i.ideSettings.path,mono:!0,copyValue:m?.ideSettings.path||r.ideSettingsPath.trim()||d?.defaultSettingsPath||i.ideSettings.path}),e.jsx(o,{label:"Settings key",value:d?.settingsKey||"Unknown",mono:!0}),e.jsx(o,{label:"Current state",value:m?.ideSettings.state||"Not verified"})]})]})]})]}):e.jsx(u,{className:"border-border/60 bg-card/80",children:e.jsxs(h,{className:"flex min-h-[240px] items-center justify-center gap-3 text-sm text-muted-foreground",children:[e.jsx(Re,{className:"h-5 w-5"}),"Choose a profile and IDE host to preview the generated payload."]})})})]})]})})})]})}export{as as ClaudeExtensionPage};
|
|
1
|
+
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as W}from"./react-vendor-CNOkPC89.js";import{bb as Ce,B as p,d as y,n as se,C as u,j as f,k as j,_ as v,b as h,I as H,r as te,s as ae,t as ne,v as ie,w as re,x as F,Q as we,R as Ee,U as le,V as de,c as xe}from"./index-BmSzf0T9.js";import{u as K,a as J,b as V}from"./tanstack-CrmUhA7Z.js";import{t as E}from"./notifications-B2HqRBj7.js";import{aa as Pe,a9 as ke,L as U,at as De,as as Be,R as Ie,T as oe,ah as Te,a7 as Re}from"./icons-KVCk4_U8.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";const L=["claude-extension-bindings"];async function P(s,a){const n=await fetch(Ce(s),{headers:{"Content-Type":"application/json"},...a});if(!n.ok){const l=await n.json().catch(()=>null);throw new Error(l?.error||`Request failed (${n.status})`)}return n.status===204?void 0:await n.json()}function qe(){return K({queryKey:["claude-extension-options"],queryFn:()=>P("/claude-extension/profiles")})}function Ae(s,a="vscode"){return K({queryKey:["claude-extension-setup",s,a],enabled:!!s,queryFn:()=>P(`/claude-extension/setup?profile=${encodeURIComponent(s||"")}&host=${encodeURIComponent(a)}`)})}function $e(){return K({queryKey:L,queryFn:()=>P("/claude-extension/bindings")})}function Le(s){return K({queryKey:["claude-extension-binding-status",s],enabled:!!s,queryFn:()=>P(`/claude-extension/bindings/${encodeURIComponent(s||"")}/verify`)})}function Oe(){const s=J();return V({mutationFn:a=>P("/claude-extension/bindings",{method:"POST",body:JSON.stringify(a)}),onSuccess:()=>{s.invalidateQueries({queryKey:L}),E.success("Binding created")},onError:a=>E.error(a.message)})}function Qe(){const s=J();return V({mutationFn:({id:a,binding:n})=>P(`/claude-extension/bindings/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify(n)}),onSuccess:(a,n)=>{s.invalidateQueries({queryKey:L}),s.invalidateQueries({queryKey:["claude-extension-binding-status",n.id]}),E.success("Binding saved")},onError:a=>E.error(a.message)})}function Ue(){const s=J();return V({mutationFn:a=>P(`/claude-extension/bindings/${encodeURIComponent(a)}`,{method:"DELETE"}),onSuccess:()=>{s.invalidateQueries({queryKey:L}),E.success("Binding deleted")},onError:a=>E.error(a.message)})}function ge(s,a){const n=J();return V({mutationFn:({id:l,target:S})=>P(`/claude-extension/bindings/${encodeURIComponent(l)}/${s}`,{method:"POST",body:JSON.stringify({target:S})}),onSuccess:l=>{n.invalidateQueries({queryKey:L}),n.setQueryData(["claude-extension-binding-status",l.bindingId],l),E.success(a)},onError:l=>E.error(l.message)})}function Fe(){return ge("apply","Binding applied")}function Ke(){return ge("reset","Managed values removed")}const Je=[];function ce(s){return{name:"",profile:s,host:"vscode",ideSettingsPath:"",notes:""}}function q(s){return{name:s.name,profile:s.profile,host:s.host,ideSettingsPath:s.ideSettingsPath||"",notes:s.notes||""}}function Ve(s){return{name:s.name.trim(),profile:s.profile.trim(),host:s.host,ideSettingsPath:s.ideSettingsPath.trim()||void 0,notes:s.notes.trim()||void 0}}function me(s){return s?.state==="applied"}function Me({state:s}){const a=s==="applied"?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":s==="drifted"?"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300":s==="missing"?"border-destructive/30 bg-destructive/10 text-destructive":"border-border bg-muted text-muted-foreground";return e.jsx(p,{variant:"outline",className:a,children:s})}function _e(s){return s.replace(/[\\/]/g,"$&")}function o({label:s,value:a,mono:n=!1,copyValue:l}){const S=typeof l=="string"&&l.trim().length>0;return e.jsxs("div",{className:"grid gap-2 text-sm sm:grid-cols-[112px_minmax(0,1fr)] sm:items-start",children:[e.jsx("span",{className:"text-muted-foreground",children:s}),S?e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx("div",{className:"min-w-0 flex-1 rounded-md border bg-muted/25 px-3 py-2",children:e.jsx("span",{className:"block text-left font-mono text-xs leading-5 [overflow-wrap:anywhere]",children:_e(a)})}),e.jsx(F,{value:l,label:`Copy ${s.toLowerCase()}`,className:"shrink-0"})]}):e.jsx("span",{className:xe("text-left sm:text-right",n&&"font-mono text-xs leading-5 [overflow-wrap:anywhere]"),children:a})]})}function ue({title:s,description:a,value:n}){return e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsx(f,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(j,{className:"text-base",children:s}),e.jsx(v,{className:"mt-1",children:a})]}),e.jsx(F,{value:n,label:`Copy ${s}`})]})}),e.jsx(h,{children:e.jsx("pre",{className:"max-h-[360px] overflow-auto rounded-lg border bg-muted/30 p-4 text-xs leading-6",children:n})})]})}function he({title:s,description:a,status:n,applyLabel:l,resetLabel:S,onApply:x,onReset:C,disabled:D,busy:B}){return e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsx(f,{className:"pb-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(j,{className:"text-base",children:s}),e.jsx(v,{className:"mt-1",children:a})]}),n?e.jsx(Me,{state:n.state}):null]})}),e.jsxs(h,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{label:"Path",value:n?.path||"Save a binding first",mono:!0,copyValue:n?.path}),e.jsx(o,{label:"File",value:n?n.exists?"Present":"Not created yet":"Unavailable"})]}),e.jsx("div",{className:"rounded-lg border bg-muted/25 p-3 text-sm text-muted-foreground",children:n?.message||"Verify the binding after saving to inspect the current file state."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{size:"sm",className:"flex-1",onClick:x,disabled:D||B,children:[B?e.jsx(U,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,l]}),e.jsx(y,{size:"sm",variant:"outline",className:"flex-1",onClick:C,disabled:D||B,children:S})]})]})]})}function ze({binding:s,isSelected:a,onSelect:n}){return e.jsx("button",{onClick:n,className:xe("w-full rounded-lg border px-3 py-3 text-left transition-colors",a?"border-primary/40 bg-primary/10":"border-border/60 bg-card hover:bg-muted/40"),children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium",children:s.name}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[s.profile," · ",s.host]})]}),e.jsx(p,{variant:"outline",className:"shrink-0",children:s.usesDefaultIdeSettingsPath?"Default path":"Custom path"})]})})}function as(){const s=qe(),a=$e(),n=Oe(),l=Qe(),S=Ue(),x=Fe(),C=Ke(),D=s.data?.profiles??[],B=s.data?.hosts??[],w=a.data?.bindings??Je,pe=D[0]?.name??"default",[fe,I]=W.useState(!1),[O,T]=W.useState(null),[G,k]=W.useState(()=>ce("default")),c=fe||w.length===0,b=!c&&w.length>0?w.find(t=>t.id===O)??(O?null:w[0]):null,g=b?.id??null,r=c||!b||O?G:q(b),Y=Ae(r.profile,r.host),A=Le(c?void 0:g||void 0),d=B.find(t=>t.id===r.host),M=D.find(t=>t.name===r.profile),_=s.error||a.error||Y.error||A.error,je=`${w.length} saved`,X=n.isPending||l.isPending,ve=x.isPending&&x.variables?.target==="shared"||C.isPending&&C.variables?.target==="shared",be=x.isPending&&x.variables?.target==="ide"||C.isPending&&C.variables?.target==="ide",Z=r.name.trim().length>0&&r.profile.trim().length>0,i=Y.data,m=A.data,ee=Math.max((i?.env.length??0)-6,0),Ne=i?.env.slice(0,6)??[];function z(){I(!0),T(null),k(ce(pe))}async function ye(){if(!Z)return;const t=Ve(r);if(!c&&g){const Q=await l.mutateAsync({id:g,binding:t});I(!1),T(Q.binding.id),k(q(Q.binding));return}const N=await n.mutateAsync(t);I(!1),T(N.binding.id),k(q(N.binding))}async function Se(){if(!g||!b||!window.confirm(`Delete binding "${b.name}"?`))return;await S.mutateAsync(g);const t=w.filter(N=>N.id!==g);t.length>0?(T(t[0].id),I(!1),k(q(t[0]))):z()}function $(t,N){if(!c&&b&&!O){T(b.id),k({...q(b),[t]:N}),I(!1);return}k(Q=>({...Q,[t]:N}))}function R(t,N){if(g){if(N==="apply"){x.mutate({id:g,target:t});return}C.mutate({id:g,target:t})}}return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"flex w-[348px] shrink-0 flex-col border-r bg-muted/30 xl:w-[372px]",children:[e.jsx("div",{className:"border-b bg-background p-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"rounded-lg border bg-muted/40 p-2",children:e.jsx(Pe,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"font-semibold",children:"Claude Extension"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Saved IDE bindings for CCS profiles"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(p,{variant:"secondary",children:je}),d?e.jsx(p,{variant:"outline",children:d.label}):null]})]}),e.jsxs(y,{size:"sm",onClick:z,className:"gap-1.5",children:[e.jsx(ke,{className:"h-3.5 w-3.5"}),"New"]})]})}),e.jsx(se,{className:"flex-1",children:e.jsxs("div",{className:"space-y-4 p-5",children:[e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:c?"Create binding":"Binding editor"}),e.jsx(v,{children:"Save a profile + IDE path once, then apply or reset it from the dashboard."})]}),e.jsxs(h,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"Binding name"}),e.jsx(H,{value:r.name,onChange:t=>$("name",t.target.value),placeholder:"VS Code · work profile"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"CCS profile"}),e.jsxs(te,{value:r.profile,onValueChange:t=>$("profile",t),children:[e.jsx(ae,{children:e.jsx(ne,{placeholder:"Select a profile"})}),e.jsx(ie,{children:D.map(t=>e.jsxs(re,{value:t.name,children:[t.label," (",t.profileType,")"]},t.name))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:M?.description||"Choose which CCS profile the IDE should inherit."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"IDE host"}),e.jsxs(te,{value:r.host,onValueChange:t=>$("host",t),children:[e.jsx(ae,{children:e.jsx(ne,{placeholder:"Select a host"})}),e.jsx(ie,{children:B.map(t=>e.jsx(re,{value:t.id,children:t.label},t.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"IDE settings path"}),e.jsx(H,{value:r.ideSettingsPath,onChange:t=>$("ideSettingsPath",t.target.value),placeholder:d?.defaultSettingsPath||"Leave blank for the default user settings path"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Leave blank to use the default user settings path for"," ",d?.label||"this IDE","."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:"Notes"}),e.jsx(H,{value:r.notes,onChange:t=>$("notes",t.target.value),placeholder:"Optional reminder for this machine or workspace"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{className:"flex-1 gap-1.5",onClick:()=>void ye(),disabled:!Z||X,children:[X?e.jsx(U,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(De,{className:"h-3.5 w-3.5"}),c?"Create":"Save"]}),e.jsx(y,{variant:"outline",onClick:z,children:"Reset form"})]}),c?null:e.jsxs(y,{variant:"outline",className:"w-full gap-1.5 text-destructive hover:text-destructive",onClick:()=>void Se(),disabled:S.isPending,children:[e.jsx(Be,{className:"h-3.5 w-3.5"}),"Delete binding"]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"px-1 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Saved bindings"}),e.jsx("div",{className:"space-y-2",children:w.length>0?w.map(t=>e.jsx(ze,{binding:t,isSelected:t.id===g&&!c,onSelect:()=>{I(!1),T(t.id),k(q(t))}},t.id)):e.jsx(u,{className:"border-dashed border-border/60 bg-card/60",children:e.jsx(h,{className:"pt-6 text-sm text-muted-foreground",children:"No saved bindings yet. Create one to manage apply, reset, and drift checks from the dashboard."})})})]})]})})]}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(se,{className:"h-full",children:e.jsxs("div",{className:"w-full space-y-6 p-6 xl:p-7 2xl:p-8",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[M?e.jsx(p,{variant:"outline",children:M.label}):null,d?e.jsx(p,{variant:"outline",children:d.label}):null,c?e.jsx(p,{variant:"secondary",children:"Draft"}):null,m?.sharedSettings&&me(m.sharedSettings)&&me(m.ideSettings)?e.jsx(p,{className:"bg-emerald-600 hover:bg-emerald-600",children:"In sync"}):null]}),e.jsxs("div",{className:"max-w-5xl",children:[e.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:b?.name||"Claude extension binding"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Manage the shared Claude settings file and the IDE-local settings file as two scoped targets."})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{variant:"outline",onClick:()=>void A.refetch(),disabled:c||A.isFetching,children:[A.isFetching?e.jsx(U,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):e.jsx(Ie,{className:"mr-1.5 h-3.5 w-3.5"}),"Verify"]}),i?e.jsx(F,{value:i.sharedSettings.command,label:"Copy persist command"}):null]})]}),_?e.jsx(u,{className:"border-destructive/40 bg-destructive/5",children:e.jsxs(h,{className:"flex items-start gap-3 pt-6 text-sm text-destructive",children:[e.jsx(oe,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("div",{children:_.message})]})}):null,_?null:e.jsxs(we,{defaultValue:"overview",className:"flex flex-col gap-6",children:[e.jsxs(Ee,{className:"w-full justify-start",children:[e.jsx(le,{value:"overview",children:"Overview"}),e.jsx(le,{value:"advanced",children:"Advanced"})]}),e.jsxs(de,{value:"overview",className:"mt-0 space-y-6",children:[e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsx(he,{title:"Shared Claude settings",description:"Writes the managed env block inside ~/.claude/settings.json so CLI and IDE behavior stay aligned.",status:m?.sharedSettings,applyLabel:"Apply shared",resetLabel:"Reset shared",onApply:()=>R("shared","apply"),onReset:()=>R("shared","reset"),disabled:c,busy:ve}),e.jsx(he,{title:`${d?.label||"IDE"} settings.json`,description:"Writes only the Anthropic extension keys so unrelated editor preferences stay untouched.",status:m?.ideSettings,applyLabel:"Apply IDE",resetLabel:"Reset IDE",onApply:()=>R("ide","apply"),onReset:()=>R("ide","reset"),disabled:c,busy:be})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1.15fr)_minmax(320px,0.85fr)]",children:[e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:"Resolved binding"}),e.jsx(v,{children:"The binding uses the same profile resolution as `ccs persist` and `ccs env`."})]}),e.jsxs(h,{className:"space-y-3",children:[e.jsx(o,{label:"Profile",value:i?.profile.label||r.profile||"Not selected"}),e.jsx(o,{label:"Profile type",value:i?.profile.profileType||"Unknown"}),e.jsx(o,{label:"IDE host",value:d?.label||"Not selected"}),e.jsx(o,{label:"IDE path mode",value:r.ideSettingsPath.trim()?"Custom path":"Default user path"}),e.jsx(o,{label:"Effective IDE path",value:m?.ideSettings.path||r.ideSettingsPath.trim()||d?.defaultSettingsPath||"Unavailable",mono:!0,copyValue:m?.ideSettings.path||r.ideSettingsPath.trim()||d?.defaultSettingsPath}),e.jsx(o,{label:"Persist command",value:i?.sharedSettings.command||"Save a valid binding first",mono:!0}),r.notes.trim()?e.jsx(o,{label:"Notes",value:r.notes.trim()}):null]})]}),e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:"Managed payload"}),e.jsx(v,{children:"Keep the main view short. The full JSON stays in the Advanced tab."})]}),e.jsxs(h,{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[Ne.map(t=>e.jsx(p,{variant:"secondary",className:"font-mono text-[10px]",children:t.name},t.name)),ee>0?e.jsxs(p,{variant:"outline",children:["+",ee," more"]}):null]}),e.jsx("div",{className:"rounded-lg border bg-muted/25 p-4 text-sm",children:i?.env.length?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"font-medium",children:["CCS will inject ",i.env.length," environment values."]}),e.jsx("div",{className:"text-muted-foreground",children:"The IDE-local target receives the extension schema. The shared target receives the same env block through Claude settings."})]}):e.jsx("div",{className:"text-muted-foreground",children:"This profile resolves to native Claude defaults, so apply/reset mainly clears existing CCS-managed overrides."})}),c?e.jsx("div",{className:"rounded-lg border border-dashed bg-muted/15 p-4 text-sm text-muted-foreground",children:"Save this draft to unlock apply, reset, and verify actions."}):e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{className:"flex-1",onClick:()=>R("all","apply"),disabled:x.isPending,children:[x.isPending&&x.variables?.target==="all"?e.jsx(U,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,"Apply both targets"]}),e.jsx(y,{variant:"outline",className:"flex-1",onClick:()=>R("all","reset"),disabled:C.isPending,children:"Reset both targets"})]})]})]})]}),i&&(i.warnings.length>0||i.notes.length>0)?e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:"Warnings"}),e.jsx(v,{children:"Operational details that can break the binding even when JSON is correct."})]}),e.jsx(h,{className:"space-y-3",children:i.warnings.length>0?i.warnings.map(t=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-amber-400/40 bg-amber-50/60 p-3 text-sm dark:bg-amber-950/10",children:[e.jsx(oe,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600"}),e.jsx("span",{children:t})]},t)):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-3 text-sm text-muted-foreground",children:"No runtime warnings for this binding."})})]}),e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:"Notes"}),e.jsx(v,{children:"Short context from CCS about account continuity and host-specific behavior."})]}),e.jsx(h,{className:"space-y-3",children:i.notes.length>0?i.notes.map(t=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border bg-muted/30 p-3 text-sm",children:[e.jsx(Te,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsx("span",{children:t})]},t)):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-3 text-sm text-muted-foreground",children:"No extra notes for this binding."})})]})]}):null]}),e.jsx(de,{value:"advanced",className:"mt-0 space-y-6",children:i?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsx(ue,{title:"Shared Claude settings JSON",description:"Managed env block for ~/.claude/settings.json.",value:i.sharedSettings.json}),e.jsx(ue,{title:`${d?.label||"IDE"} settings JSON`,description:`Anthropic extension snippet for ${d?.settingsTargetLabel||"settings.json"}.`,value:i.ideSettings.json})]}),e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsx(f,{children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(j,{className:"text-base",children:"Resolved environment payload"}),e.jsx(v,{children:"Exact environment values that the extension receives after CCS expands this profile."})]}),e.jsx(F,{value:JSON.stringify(i.env,null,2),label:"Copy environment payload"})]})}),e.jsx(h,{children:i.env.length>0?e.jsx("pre",{className:"max-h-[420px] overflow-auto rounded-lg border bg-muted/30 p-4 text-xs leading-6",children:JSON.stringify(i.env,null,2)}):e.jsx("div",{className:"rounded-lg border bg-muted/20 p-4 text-sm text-muted-foreground",children:"No env payload. This binding resolves to native Claude defaults."})})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:"Shared target metadata"}),e.jsx(v,{children:"Useful when debugging drift or comparing with manual edits."})]}),e.jsxs(h,{className:"space-y-3",children:[e.jsx(o,{label:"Target path",value:m?.sharedSettings.path||i.sharedSettings.path,mono:!0,copyValue:m?.sharedSettings.path||i.sharedSettings.path}),e.jsx(o,{label:"Command",value:i.sharedSettings.command,mono:!0}),e.jsx(o,{label:"Current state",value:m?.sharedSettings.state||"Not verified"})]})]}),e.jsxs(u,{className:"border-border/60 bg-card/80",children:[e.jsxs(f,{children:[e.jsx(j,{className:"text-base",children:"IDE target metadata"}),e.jsx(v,{children:"Current file path plus the extension setting key used for this host."})]}),e.jsxs(h,{className:"space-y-3",children:[e.jsx(o,{label:"Target path",value:m?.ideSettings.path||r.ideSettingsPath.trim()||d?.defaultSettingsPath||i.ideSettings.path,mono:!0,copyValue:m?.ideSettings.path||r.ideSettingsPath.trim()||d?.defaultSettingsPath||i.ideSettings.path}),e.jsx(o,{label:"Settings key",value:d?.settingsKey||"Unknown",mono:!0}),e.jsx(o,{label:"Current state",value:m?.ideSettings.state||"Not verified"})]})]})]})]}):e.jsx(u,{className:"border-border/60 bg-card/80",children:e.jsxs(h,{className:"flex min-h-[240px] items-center justify-center gap-3 text-sm text-muted-foreground",children:[e.jsx(Re,{className:"h-5 w-5"}),"Choose a profile and IDE host to preview the generated payload."]})})})]})]})})})]})}export{as as ClaudeExtensionPage};
|