Lines 1-22javascript
2import{a as wn,b as gl,c as Tn,d as _r,e as Mt,f as yl,h as xl}from"./chunk-V3LN4R4P.js";import{a as Tp}from"./chunk-XW3DXEJJ.js";import{a as hl,b as xp,c as go}from"./chunk-FJL5WURJ.js";import{a as je,b as qn,c as bl}from"./chunk-5Z3DMHRQ.js";import{a as wp}from"./chunk-5NFOBNG6.js";import{a as pp,b as fp,c as bn,f as mp,g as hp,h as gp,i as yp,k as kn}from"./chunk-EEH2ZJA5.js";import{a as bp,b as kp,c as Xs,f as Js}from"./chunk-O3L436MU.js";import{a as Ks}from"./chunk-XAWVLVWL.js";import{a as xx,b as dp,c as bx,d as p}from"./chunk-LPD7BHH5.js";var Lf=xx((DE,$f)=>{"use strict";p();var ql,{def ...
3`)?u.replace(/(\r?\n)/g,s+"$1"+o):u)+s};return Pf(i,b0(e)).p={t,o:n,p:e.p},i.open=o,i.close=s,i},If=new function e(t=globalThis){let n=typeof t=="number"?t:(E=>{let I=E.process??{},F=I.argv??[],M=
4`)}p();import{createInterface as _p}from"readline";import we from"chalk";function vp(e){return!!(e.some(t=>t.apiKey)||process.env.DEEPSEEK_API_KEY)}var kl=10;async function Rp(){console.log(we.yellow(`
5 \u26A0 \u672A\u68C0\u6D4B\u5230 API Key \u914D\u7F6E`)),console.log(we.dim(" \u4F60\u53EF\u4EE5\u901A\u8FC7\u4EE5\u4E0B\u4EFB\u4E00\u65B9\u5F0F\u914D\u7F6E\uFF1A")),console.log(we.dim(" \xB7 \u73AF\u5883\u53D8\u91CF: export DEEPSEEK_API_KEY=sk-xxx")),console.log(we.dim(" \xB7 \u914D\u7F6E\u6587\u4EF6: ~/.dskcode/settings.json")),console.log(we.dim(` \xB7 \u4E0B\u9762\u76F4\u63A5\u8F93\u5165\uFF0C\u81EA\u52A8\u4FDD\u5B58\u5230\u5168\u5C40\u914D\u7F6E
6`));let e=_p({input:process.stdin,output:process.stdout});return new Promise(t=>{let n=!1,r=()=>{n||(n=!0,process.stdin.removeListener("keypress",o),e.close())},o=(s,i)=>{i.ctrl&&i.name==="c"&&(r(),t(null))};process.stdin.on("keypress",o),e.question(` ${we.cyan("\u{1F511}")} ${we.bold("\u8BF7\u8F93\u5165\u4F60\u7684 DeepSeek API Key:")} `,s=>{r();let i=s.trim();if(!i){console.log(we.red(" \u2716 API Key \u4E0D\u80FD\u4E3A\u7A7A")),t(null);return}if(i.length<kl){console.log(we.red(" \u2716 API Key \u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u957F\u5EA6\u81F3\u5C11 10 \u4F4D")),t(null);return}t(i)}) ...
7 \u26A0 \u672A\u68C0\u6D4B\u5230\u706B\u5C71 ASR \u51ED\u636E`)),console.log(we.dim(" \u4F60\u53EF\u4EE5\u901A\u8FC7\u4EE5\u4E0B\u4EFB\u4E00\u65B9\u5F0F\u914D\u7F6E\uFF1A")),console.log(we.dim(" \xB7 \u73AF\u5883\u53D8\u91CF: export VOLC_ASR_APP_ID=... VOLC_ASR_ACCESS_KEY=...")),console.log(we.dim(" \xB7 \u914D\u7F6E\u6587\u4EF6: ~/.dskcode/settings.json \u7684 voice \u6BB5")),console.log(we.dim(` \xB7 \u4E0B\u9762\u76F4\u63A5\u8F93\u5165\uFF0C\u81EA\u52A8\u4FDD\u5B58\u5230\u5168\u5C40\u914D\u7F6E
8`)),console.log(we.dim(` \u51ED\u636E\u83B7\u53D6\u8DEF\u5F84\uFF1A\u706B\u5C71\u63A7\u5236\u53F0 \u2192 \u8BED\u97F3\u6280\u672F \u2192 \u6211\u7684\u5E94\u7528
9`));let e=_p({input:process.stdin,output:process.stdout});return new Promise(t=>{let n=!1,r=()=>{n||(n=!0,process.stdin.removeListener("keypress",o),e.close())},o=(s,i)=>{i.ctrl&&i.name==="c"&&(r(),t(null))};process.stdin.
10`));return}if(await Px())return;let n=await Rx();if(n.length===0)return;console.log(ot.cyan(`
11 \u2726 \u68C0\u6D4B\u5230\u4F60\u5728 Claude Code \u4E2D\u5B89\u88C5\u4E86 ${String(n.length)} \u4E2A skill\uFF1A`));let r=n.slice(0,5).map(s=>ot.dim(` \xB7 ${s}`)).join(`
12`);if(console.log(r),n.length>5&&console.log(ot.dim(` \xB7 ...\u7B49 ${String(n.length)} \u4E2A`)),console.log(ot.dim(` \u6E90\u76EE\u5F55: ${wl()}`)),console.log(ot.dim(` \u76EE\u6807\u76EE\u5F55: ${Ar()}
13`)),!await Ax(` ${ot.cyan("\u{1F4E6}")} \u662F\u5426\u5C06\u8FD9\u4E9B skill \u5BFC\u5165\u5230 dskcode\uFF1F${ot.dim("[y/N] ")} `)){console.log(ot.dim(` \u5DF2\u8DF3\u8FC7 skill \u5BFC\u5165
14`));return}try{let{imported:s,skipped:i}=await Ex(n);s.length>0&&console.log(ot.green(` \u2714 \u5DF2\u5BFC\u5165 ${String(s.length)} \u4E2A skill \u5230 ~/.dskcode/skills`)),i.length>0&&console.log(ot.yellow(` \u26A0 ${String(i.length)} \u4E2A skill \u5DF2\u5B58\u5728\uFF0C\u5DF2\u8DF3\u8FC7\uFF1A${i.join(", ")}`)),console.log("")}catch(s){console.log(ot.red(` \u2716 \u5BFC\u5165 skill \u5931\u8D25: ${s instanceof Error?s.message:String(s)}`)),console.log(ot.dim(` \u4F60\u53EF\u4EE5\u7A0D\u540E\u624B\u52A8\u590D\u5236 ~/.claude/skills \u5230 ~/.dskcode/skills
15`))}}async function $x(){let e=Ar();if(!zt(e))return[];let t;try{t=await Rr(e)}catch{return[]}let n=[];for(let r of t){let o=st(e,r);vr(o).isDirectory()&&await Er(o)&&n.push(r)}return n}async function Lx(e){let t=Tl(e);if(!zt(t))return[];let n;try{n=await Rr(t)}catch{return[]}let r=[];for(let o of n){let s=st(t,o);vr(s).isDirectory()&&await Er(s)&&r.push(o)}return r}async function Ep(e){try{let n=(await vx(st(e,"SKILL.md"),"utf-8")).match(/^---\n([\s\S]*?)\n---/);if(!n)return null;let r=n[1],o=r.match(/^name:\s*(.+)$/m),s=r.match(/^description:\s*(.+)$/m);return{name:o?.[1]?.trim()??"",descrip ...
16`)}function Rl(e,t=80){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return e.length>t?e.slice(0,t-1)+
17`)){if(r.length===0){n.push("");continue}let o=Zx(r,t);for(let s of o)n.push(s)}return n.length===0?[""]:n}function Zx(e,t){if(ko(e)<=t)return[e];let n=[],r="",o=0,s=-1,i=0;for(let{ch:a,width:l}of Xx(e)){if(a===" "||a===" "){s=r.length,i=o+l,r+=a,o+=l;continue}if(o+l>t)if(s>0){let c=r.slice(0,s).replace(/[ \t]+$/,"");n.push(c),r=r.slice(s).replace(/^[ \t]+/,"")+a,o=ko(r),s=-1,i=0}else n.push(r),r=a,o=l;else r+=a,o+=l}return r.length>0&&n.push(r),n}function Yx(e,t,n){return e.map((r,o)=>{let s=t[o]??3;return Jx(r,s).map(a=>Qx(a,s,n[o]??"left"))})}function Qx(e,t,n="left"){let r=ko(e),o=t-r;if(o ...
18`).filter(C=>C.trim().length>0);if(s.length<2)return{lines:s,colWidths:[],totalWidth:0};let i=-1;for(let C=0;C<s.length;C++){let N=(s[C
19`),n=[],r="";function o(){r&&(n.push({text:r,type:"plain"}),r="")}for(let s=0;s<t.length;s++){let i=t[s]??"";if(Pl(i)&&s+1<t.length&&nb(t[s+1]??"")&&s+2<t.length&&Pl(t[s+2]??"")){o();let a=[],l=s;for(;l<t.length&&Pl(t[l]??"");)a.push(t[l]),l++;n.push({text:a.join(`
20`),type:"table"}),s=l-1}else r?r+=`
21`+i:r=i}return o(),n}function ob(e){let t=[],n=0;for(;n<e.length;){let r=e.indexOf("**",n);if(r===-1){t.push({text:e.slice(n),type:"plain"});break}r>n&&t.push({text:e.slice(n,r),type:"plain"});let o=e.indexOf("**",r+2);if(o===-1){t.push({text:e.slice(r),type:"plain"});break}t.push({text:e.slice(r+2,o),type:"bold"}),n=o+2}return t}function sb(e){let t=[],n=0;for(;n<e.length;){let r=e.indexOf("`",n);if(r===-1){t.push({text:e.slice(n),type:"plain"});break}r>n&&t.push({text:e.slice(n,r),type:"plain"});let o=1;for(;r+o<e.length&&e[r+o]==="`";)o++;if(o===1){let s=e.indexOf("`",r+1);if(s===-1){t.push ...
22`),n=t[0]??"",r=n.trim().length>0&&!n.startsWith("+")&&!n.startsWith("-")&&!n.startsWith("@@")&&!n.startsWith(" "),o=r?n:void 0,s=r?t.slice(1):t;return s.length===0?r?ve(Ys,{marginLeft:2,children:$l(Ge,{color:"#888888",children:["\u250C ",o]})}):null:$l(Ys,{flexDirection:"column",marginLeft:2,marginTop:1,children:[o&&$l(Ge,{color:"#888888",children:["\u250C ",o]}),s.map((i,a)=>i.startsWith("+")?ve(Ge,{color:ab,children:i},a):i.startsWith("-")?ve(Ge,{color:lb,children:i},a):i.startsWith("@@")?ve(Ge,{color:cb,children:i},a):ve(Ge,{children:i},a))]})}function db({text:e}){let t=Fp(),n=Gp(e,{termW ...
Long lines were clipped for display.