import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,T as n,b as r,p as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{Cc as c,Sc as l,dc as u,yc as d}from"./paths-Ci1iwL5Y.js";import{n as f,r as p}from"./analytics-DqMQntaB.js";import{n as m,t as h}from"./ThemePicker-DKmIL5Ku.js";function g(e){return e}function _(e){let t=e.trim().toLowerCase();return t===``||t===`reset`?{sub:`full`}:x.has(t)?{sub:t}:{sub:`full`,unknownArg:t}}function v({onDone:e}){let[,t]=n();return(0,b.jsx)(i,{color:`permission`,children:(0,b.jsx)(h,{onThemeSelect:n=>{t(n),p(`tengu_onboarding_step`,{stepId:g(`theme`)}),e(`Theme set to ${n}.`)},onCancel:()=>e(`Theme picker dismissed.`),skipExitHandling:!0})})}function y({theme:e,hasCompletedOnboarding:t,lastOnboardingVersion:n}){return(0,b.jsxs)(o,{flexDirection:`column`,paddingLeft:1,children:[(0,b.jsx)(r,{bold:!0,children:`Onboarding status`}),(0,b.jsxs)(r,{children:[`- Theme: `,(0,b.jsx)(r,{bold:!0,children:e})]}),(0,b.jsxs)(r,{children:[`- Onboarding completed:`,` `,(0,b.jsx)(r,{bold:!0,color:t?`success`:`warning`,children:t?`yes`:`no`})]}),(0,b.jsxs)(r,{children:[`- Last onboarding version: `,(0,b.jsx)(r,{bold:!0,children:n})]}),(0,b.jsx)(r,{dimColor:!0,children:`Run /onboarding (no args) to re-run the full flow, or /onboarding theme | trust | model | mcp for a specific step.`})]})}var b,x,S;e((()=>{t(),a(),f(),m(),d(),b=s(),x=new Set([`full`,`theme`,`trust`,`model`,`mcp`,`status`]),S=async(e,t,n)=>{let{sub:r,unknownArg:i}=_(n);if(p(`tengu_onboarding_step`,{stepId:g(`slash_${r}`)}),i!==void 0)return e(`Unknown /onboarding subcommand: \`${i}\`.\nValid: full | theme | trust | model | mcp | status`,{display:`system`}),null;if(r===`theme`)return(0,b.jsx)(v,{onDone:t=>e(t)});if(r===`trust`)return l(e=>({...e,hasTrustDialogAccepted:!1})),e("Workspace trust cleared for the current project. The trust dialog will appear on the next `claude` launch.",{display:`system`}),null;if(r===`model`)return e("Run `/model` to pick the AI model. Onboarding does not own the model picker; this entry exists for discoverability only.",{display:`system`}),null;if(r===`mcp`)return e("MCP server setup:\n  - `/mcp` — list configured MCP servers\n  - `claude mcp add <name> <command>` — add a server (in your shell)\n  - `claude mcp remove <name>` — remove a server\nServers also load from `.mcp.json` in the workspace and from `~/.claude.json` globally.",{display:`system`}),null;if(r===`status`){let e=u();return(0,b.jsx)(y,{theme:e.theme??`(unset)`,hasCompletedOnboarding:e.hasCompletedOnboarding===!0,lastOnboardingVersion:e.lastOnboardingVersion??`(unset)`})}return c(e=>({...e,hasCompletedOnboarding:!1})),e(`Onboarding flag cleared. The full first-run setup (theme, OAuth/API key, security notes, terminal-setup) will run on the next \`claude\` launch.

For individual steps in this session, use:
  /onboarding theme   — re-pick theme inline
  /onboarding trust   — re-confirm workspace trust on next launch
  /onboarding model   — open /model picker
  /onboarding mcp     — show MCP setup hints
  /onboarding status  — show current onboarding state`,{display:`system`}),null}}))();export{S as callOnboarding};