skill-creator 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/cli.js +119 -9
  2. package/dist/cli.js.map +2 -2
  3. package/dist/daemon.js +268 -21
  4. package/dist/daemon.js.map +4 -4
  5. package/dist/package.json +1 -1
  6. package/dist/webui/_app/immutable/assets/0.DLmCZ2fP.css +2 -0
  7. package/dist/webui/_app/immutable/assets/CreatorWorkspace.CvDsme_1.css +1 -0
  8. package/dist/webui/_app/immutable/chunks/{CdjBDc_u.js → B8aGNSaH.js} +1 -1
  9. package/dist/webui/_app/immutable/chunks/{CvO5eq4f.js → BDMeqoYB.js} +1 -1
  10. package/dist/webui/_app/immutable/chunks/{BgJCuTDs.js → BTMBuftG.js} +1 -1
  11. package/dist/webui/_app/immutable/chunks/Ba9GVGQ5.js +6 -0
  12. package/dist/webui/_app/immutable/chunks/{D6s79OPW.js → BchFBl6r.js} +1 -1
  13. package/dist/webui/_app/immutable/chunks/BhCD2hsN.js +8 -0
  14. package/dist/webui/_app/immutable/chunks/{hIGXQE4_.js → Bynub5xW.js} +1 -1
  15. package/dist/webui/_app/immutable/chunks/CYhuNS_d.js +11 -0
  16. package/dist/webui/_app/immutable/chunks/{Bd1_Ly7G.js → C_mgfJl-.js} +1 -1
  17. package/dist/webui/_app/immutable/chunks/{CIxXWvxF.js → ClW_LCBS.js} +1 -1
  18. package/dist/webui/_app/immutable/chunks/{Do_MDwCJ.js → Cy5ABld-.js} +1 -1
  19. package/dist/webui/_app/immutable/chunks/CzkhJhvt.js +1 -0
  20. package/dist/webui/_app/immutable/chunks/{BTuMeN4z.js → DBNjJ5Iw.js} +1 -1
  21. package/dist/webui/_app/immutable/chunks/DC5f4JBB.js +5 -0
  22. package/dist/webui/_app/immutable/chunks/DF_TIB7n.js +1 -0
  23. package/dist/webui/_app/immutable/chunks/DH8yd93-.js +1 -0
  24. package/dist/webui/_app/immutable/chunks/DSbDiml2.js +28 -0
  25. package/dist/webui/_app/immutable/chunks/{Du6-3Tbt.js → DTzqg7c9.js} +1 -1
  26. package/dist/webui/_app/immutable/chunks/{DGJ9QIPN.js → DVv6BdWV.js} +1 -1
  27. package/dist/webui/_app/immutable/chunks/{CBFLFfGb.js → DYbgoqwH.js} +1 -1
  28. package/dist/webui/_app/immutable/chunks/DdHvRi0A.js +1 -0
  29. package/dist/webui/_app/immutable/chunks/{B0stYqX9.js → DjZ7hdjX.js} +1 -1
  30. package/dist/webui/_app/immutable/chunks/DvWG9eQi.js +1 -0
  31. package/dist/webui/_app/immutable/chunks/DzfSSVEB.js +2 -0
  32. package/dist/webui/_app/immutable/chunks/GHFnehdP.js +5 -0
  33. package/dist/webui/_app/immutable/chunks/VnziGBZO.js +2 -0
  34. package/dist/webui/_app/immutable/chunks/a0LlqeqU.js +1 -0
  35. package/dist/webui/_app/immutable/chunks/eFUKcYMv.js +1 -0
  36. package/dist/webui/_app/immutable/chunks/{DlsPNMHX.js → pd7EK5wP.js} +2 -2
  37. package/dist/webui/_app/immutable/chunks/{Dcf0klrH.js → xAjQV7BZ.js} +2 -2
  38. package/dist/webui/_app/immutable/entry/{app.SX0t6ojk.js → app.DlQ53I3_.js} +2 -2
  39. package/dist/webui/_app/immutable/entry/start.CNmXm9ox.js +1 -0
  40. package/dist/webui/_app/immutable/nodes/0.BXeEkneG.js +229 -0
  41. package/dist/webui/_app/immutable/nodes/{1.BY0DmHLP.js → 1.DzYWdh98.js} +1 -1
  42. package/dist/webui/_app/immutable/nodes/{2._osi8D6m.js → 2.Dl1DQV0d.js} +1 -1
  43. package/dist/webui/_app/version.json +1 -1
  44. package/dist/webui/index.html +23 -21
  45. package/package.json +5 -5
  46. package/dist/webui/_app/immutable/assets/0.B4ZC2KQW.css +0 -2
  47. package/dist/webui/_app/immutable/chunks/B_gnhZ39.js +0 -1
  48. package/dist/webui/_app/immutable/chunks/BcvferwH.js +0 -8
  49. package/dist/webui/_app/immutable/chunks/CD-NpLjk.js +0 -6
  50. package/dist/webui/_app/immutable/chunks/COXgCOd9.js +0 -2
  51. package/dist/webui/_app/immutable/chunks/Ccj5eiVa.js +0 -1
  52. package/dist/webui/_app/immutable/chunks/Cp0lquqA.js +0 -1
  53. package/dist/webui/_app/immutable/chunks/Crg8KRap.js +0 -5
  54. package/dist/webui/_app/immutable/chunks/D7DTLcps.js +0 -1
  55. package/dist/webui/_app/immutable/chunks/oJ4aK8PG.js +0 -1
  56. package/dist/webui/_app/immutable/chunks/vry1W47_.js +0 -7
  57. package/dist/webui/_app/immutable/entry/start.gejSBBnR.js +0 -1
  58. package/dist/webui/_app/immutable/nodes/0.BTXc1wYu.js +0 -229
@@ -1 +0,0 @@
1
- import{$ as e,At as t,B as n,Ct as r,D as i,F as a,N as o,R as s,St as c,X as l,bt as u,ct as d,ft as f,gt as p,it as m,l as h,lt as g,mt as _,nt as v,ot as y,rt as b,st as ee,wt as x,xt as S,z as te}from"./CmCJ0SKP.js";import{t as C}from"./B0stYqX9.js";import"./xihTtKlq.js";import{t as w}from"./CvO5eq4f.js";import"./oJ4aK8PG.js";import{D as T,S as E,T as D,w as O}from"./DlsPNMHX.js";function k(e){return e.activities.find(e=>e.entry)??e.activities[0]}var A=class{entries=new Map;register(e){this.entries.set(e.id,e)}get(e){return this.entries.get(e)}list(){return[...this.entries.values()]}findByPath(e){for(let t of this.entries.values()){let n=t.absolutePattern.replace(/:[^/]+/g,`[^/]+`);try{if(RegExp(`^${n.replace(/\//g,`\\/`)}\\/?$`).test(e))return t}catch{}}}},j=class{apps=new Map;register(e){this.apps.set(e.id,e)}get(e){return this.apps.get(e)}list(){return[...this.apps.values()]}},M=new A,N=new j;function P(e){let t={id:e.id,pattern:e.pattern,params:e.params,search:e.search,component:e.component,children:e.children};return I(t,t.pattern||`/`),t}function F(e,t){L(e,t)}function I(e,t){if(M.register({id:e.id,route:e,absolutePattern:t}),e.children)for(let n of e.children)I(n,R(t,n.pattern))}function L(e,t){let n=R(e,t.pattern);if(M.register({id:t.id,route:t,absolutePattern:n}),t.children)for(let e of t.children)L(n,e)}function R(e,t){let n=e.replace(/\/+$/,``),r=t.replace(/^\/+|\/+$/g,``);return r===``?n||`/`:`${n}/${r}`}function ne(e){return F(e.pattern,e.root),{pattern:e.pattern,root:e.root,entry:e.entry}}function re(e){return{id:e.id,pattern:``,search:e.search,component:e.component}}function ie(e){return N.register(e),{manifest:e}}function ae(e){let t=Object.entries(e).filter(([,e])=>e!=null);if(t.length===0)return``;let n=new URLSearchParams;for(let[e,r]of t)n.set(e,typeof r==`string`?r:String(r));let r=n.toString();return r?`?${r}`:``}function z(e){let t=e.startsWith(`?`)?e.slice(1):e;if(!t)return{};let n={},r=new URLSearchParams(t);for(let[e,t]of r)n[e]=t;return n}function B(e,t,n,r){let i=G(e,H(V(t,r)),r);if(i.length===0)return{kind:`no-match`,reason:`no-route`};let a=K(i),o=i[i.length-1].route,s=o.params;if(s){let e=s.safeParse(a);if(!e.success)return{kind:`parse-error`,reason:`params`,chain:i,errors:e.error}}let c=o.search;if(c){let e=z(n),t=c.safeParse(e);if(!t.success)return{kind:`parse-error`,reason:`search`,chain:i,errors:t.error}}return{kind:`matched`,chain:i}}function V(e,t){let n=t.replace(/\/+$/,``);return e===n?``:e.startsWith(n+`/`)?e.slice(n.length):e}function H(e){let t=e.replace(/^\/+|\/+$/g,``);return t===``?[]:t.split(`/`).map(e=>{try{return decodeURIComponent(e)}catch{return e}})}function U(e){let t=e.replace(/^\/+|\/+$/g,``);return t===``?[]:t.split(`/`).map(e=>e.startsWith(`:`)?{kind:`param`,value:e.slice(1)}:{kind:`static`,value:e})}function W(e,t){let n=e.replace(/\/+$/,``),r=t.replace(/^\/+|\/+$/g,``);return r===``?n:`${n}/${r}`}function G(e,t,n){let r=W(n,e.pattern),i=U(e.pattern);if(t.length<i.length)return[];let a={};for(let e=0;e<i.length;e++){let n=i[e],r=t[e];if(!r)return[];if(n.kind===`static`){if(n.value!==r)return[]}else a[n.value]=r}let o={absolutePattern:r,route:e,rawParams:a},s=t.slice(i.length);if(s.length===0)return[o];if(e.children&&e.children.length>0)for(let t of e.children){let e=G(t,s,r);if(e.length>0)return[o,...e]}return[]}function K(e){let t={};for(let n of e)Object.assign(t,n.rawParams);return t}var q=/:([A-Za-z_][A-Za-z0-9_]*)/g;function J(e,t){return e.replace(q,(e,n)=>{let r=t[n];return r===void 0?`:${n}`:encodeURIComponent(r)})}var Y=`/workspaces`;function oe(e,t){let n=se(e),r=n?N.get(n):void 0;if(!r)return{kind:`redirect`,path:Y};let i=k(r);if(!i)return{kind:`redirect`,path:Y};for(let n of r.activities){let r=B(n.root,e,t,n.pattern);if(r.kind===`matched`)return{kind:`ok`};if(r.kind===`parse-error`)return r.reason===`params`?{kind:`redirect`,path:i.pattern}:{kind:`redirect`,path:e}}return{kind:`redirect`,path:i.pattern}}function se(e){let t=e.replace(/^\/+/,``);return t?t.split(`/`)[0]??null:null}var X=null;function ce(e){X=e}function le(e,t,n){let r=M.get(e);return r?de(r.absolutePattern,t,n):`/`}function ue(e,t,n,r){let i=le(e,t,n);X?.navigate(i,r)}function de(e,t,n){return`${J(e,t??{})}${n?ae(n):``}`}var fe=Symbol(`skill-creator:portal-target`),pe=Symbol(`skill-creator:app-context`);function me(e){x(fe,e)}function he(e){x(pe,e)}var Z=Symbol(`skill-creator:router`);function ge(e){x(Z,{get:e})}function _e(){if(!S(Z))return;let e=u(Z).get;return()=>e().params}function ve(){if(!S(Z))return;let e=u(Z).get;return()=>e().search}function Q(e){let t=e.replace(/^\/+|\/+$/g,``);if(!t)return null;let n=t.split(`/`),r=n[0];return r?{app:r,instanceKey:n[1]??`home`}:null}var ye={navigate(e,t=`PUSH`){t===`REPLACE`?C(e,{replaceState:!0,keepFocus:!0,noScroll:!0}):C(e)},replace(e){this.navigate(e,`REPLACE`)}};T({version:D(1),theme:E([`light`,`dark`,`system`]).default(`system`),sidebarCollapsed:O().default(!1)});var be=n(`<div class="app-shell-error svelte-1oszhz"> </div>`),$=n(`<div class="app-shell-loading svelte-1oszhz" aria-label="Loading"></div>`),xe=n(`<div class="app-shell-empty svelte-1oszhz">No route matched</div>`),Se=n(`<div class="app-shell svelte-1oszhz"><!> <div class="app-portal-root svelte-1oszhz"></div></div>`);function Ce(n,u){r(u,!0);let m=_(null),x=p(()=>B(u.activity.root,w.url.pathname,w.url.search,u.activity.pattern)),S=p(()=>l(x).kind===`matched`?l(x).chain:[]),C=p(()=>A(l(S))),T=p(()=>j(l(x),l(S)));me(()=>l(m)),he({get manifest(){return{id:u.app.id,name:u.app.name,icon:u.app.icon}},get pathname(){return w.url.pathname}}),ge(()=>({match:l(x),params:l(C),search:l(T),chain:l(S)}));let E=_(null),D=_(null),O=null,k=0;b(()=>{let t=(l(S).length>0?l(S)[l(S).length-1]:void 0)?.route,n=e(()=>O);if(!t){O=null,k+=1,f(E,null),f(D,null);return}if(n===t)return;O=t,f(E,null),f(D,null);let r=++k;t.component().then(e=>{r===k&&f(E,e.default,!0)}).catch(e=>{r===k&&f(D,e instanceof Error?e.message:String(e),!0)})});function A(e){if(e.length===0)return;let t={};for(let n of e)Object.assign(t,n.rawParams);return t}function j(e,t){if(e.kind===`no-match`||t.length===0)return;let n=t[t.length-1]?.route.search;if(!n)return;let r=n.safeParse(z(w.url.search));return r.success?r.data:void 0}var M=Se(),N=y(M),P=e=>{var t=be(),n=d(t);v(()=>a(n,`Failed to load: ${l(D)??``}`)),s(e,t)},F=e=>{let t=p(()=>l(E));var n=te(),r=ee(n);i(r,()=>l(t),(e,t)=>{t(e,{})}),s(e,n)},I=e=>{var t=$();s(e,t)},L=e=>{var t=xe();s(e,t)};o(N,e=>{l(D)?e(P):l(E)?e(F,1):l(S).length>0?e(I,2):e(L,-1)});var R=g(N,2);h(R,e=>f(m,e),()=>l(m)),t(M),s(n,M),c()}var we=n(`<div class="tab-empty svelte-t4mhty">Select an app from the sidebar.</div>`),Te=n(`<div class="tab-outlet-root svelte-t4mhty"><!></div>`);function Ee(e,n){r(n,!0);let i=p(()=>w.url.pathname),a=p(()=>Q(l(i))?.app??null),u=p(()=>l(a)?N.get(l(a)):null);m(()=>{let e=oe(l(i),w.url.search);e.kind===`redirect`&&(e.path!==l(i)||w.url.search)&&ye.replace(e.path)});let d=p(()=>{if(!l(u))return null;for(let e of l(u).activities)if(B(e.root,l(i),w.url.search,e.pattern).kind===`matched`)return e;return l(u).activities.find(e=>e.entry)??l(u).activities[0]??null});var f=Te(),h=y(f),g=e=>{Ce(e,{get app(){return l(u)},get activity(){return l(d)}})},_=e=>{var t=we();s(e,t)};o(h,e=>{l(u)&&l(d)?e(g):e(_,-1)}),t(f),s(e,f),c()}export{ue as a,ne as c,N as d,ve as i,re as l,Q as n,ce as o,_e as r,ie as s,Ee as t,P as u};
@@ -1 +0,0 @@
1
- import"./B0stYqX9.js";
@@ -1,7 +0,0 @@
1
- import{A as e,At as t,B as n,Ct as r,D as i,F as a,G as o,Mt as s,N as c,R as l,St as u,U as d,W as f,X as p,_t as m,bt as h,ct as g,d as _,ft as v,gt as y,j as b,k as x,kt as S,lt as C,mt as w,nt as T,o as E,ot as D,rt as O,s as k,st as A,ut as j,wt as M,x as N,xt as P,z as F}from"./CmCJ0SKP.js";import{t as I}from"./B0stYqX9.js";import"./xihTtKlq.js";import{t as L}from"./CvO5eq4f.js";import"./oJ4aK8PG.js";import{t as R}from"./BkEnd9_Z.js";import{i as z,r as B}from"./D7DTLcps.js";import{_ as ee,a as te,b as V,l as ne,s as H,t as re,x as ie}from"./DlsPNMHX.js";import{g as ae,h as oe,m as se}from"./CdjBDc_u.js";import{n as U}from"./1aUphu7Y.js";import{n as W,t as G}from"./DnPeA-9c.js";import{t as ce}from"./DOjT7y5f.js";import{h as K}from"./Ccj5eiVa.js";import{n as q,t as le}from"./ChvFFUWR.js";import{t as J}from"./C67g-p2T.js";import{t as ue}from"./BYNWtKcf.js";import{n as de,t as fe}from"./DovL68qD.js";import{n as pe,t as me}from"./hIGXQE4_.js";import{t as he}from"./s48N5eaK.js";import{t as Y}from"./CeR4do8T.js";var ge=new Set([`$$slots`,`$$events`,`$$legacy`]);function _e(e,t){let n=E(t,ge),r=[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`}],[`path`,{d:`m9 11 3 3L22 4`}]];R(e,k({name:`circle-check-big`},()=>n,{get iconNode(){return r}}))}var ve=new Set([`$$slots`,`$$events`,`$$legacy`]);function ye(e,t){let n=E(t,ve),r=[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`}],[`path`,{d:`M6.453 15h11.094`}],[`path`,{d:`M8.5 2h7`}]];R(e,k({name:`flask-conical`},()=>n,{get iconNode(){return r}}))}var be=n(`<button><!> </button>`),xe=n(`<div class="flex shrink-0 items-center gap-1 border-b border-border px-2"></div>`);function Se(n,s){r(s,!0);let c=[{id:`file`,label:`File`,icon:q},{id:`log`,label:`History`,icon:de},{id:`preview`,label:`Preview`,icon:fe},{id:`validate`,label:`Validate`,icon:_e},{id:`test`,label:`Test`,icon:ye}],d=z(),f=y(()=>d?.()?.subview??`file`);function m(e){let t=new URLSearchParams(L.url.search);t.set(`subview`,e),I(`${L.url.pathname}?${t.toString()}`)}var h=xe();e(h,21,()=>c,e=>e.id,(e,n)=>{var r=be(),s=D(r);i(s,()=>p(n).icon,(e,t)=>{t(e,{class:`h-3.5 w-3.5`})});var c=C(s);t(r),T(()=>{N(r,1,`flex items-center gap-1.5 px-3 py-2 text-xs font-medium transition-colors ${p(f)===p(n).id?`border-b-2 border-primary text-primary`:`text-muted-foreground hover:text-foreground`}`),a(c,` ${p(n).label??``}`)}),o(`click`,r,()=>m(p(n).id)),l(e,r)}),t(h),l(n,h),u()}f([`click`]);function Ce(e,t=``){return{mode:`new`,target:e,skillId:null,name:``,description:``,body:``,revision:null,extraFrontmatter:{},directoryName:t}}var we={workspaceId:ie.parse(`~`),providerId:V.parse(`user`)};function Te(){return{mode:`new`,target:we,skillId:null,name:``,description:``,body:``,revision:null,extraFrontmatter:{},directoryName:``}}function Ee(e,t){return{mode:`edit`,target:e,skillId:t,name:``,description:``,body:``,revision:null,extraFrontmatter:{},directoryName:``}}function De(e){return{...e.extraFrontmatter,name:e.name,description:e.description}}var Oe=Symbol(`skill-creator:creator-editor`);function ke(e){let t=j(e),n={get draft(){return t},hydrateFromDocument(e){t.skillId=e.skillId,t.name=String(e.frontmatter.name??``),t.description=String(e.frontmatter.description??``),t.body=e.body,t.revision=e.revision,t.directoryName=e.directoryName;let{name:n,description:r,...i}=e.frontmatter;t.extraFrontmatter=i},advanceRevision(e){t.revision=e}};return M(Oe,n),n}function X(){if(!P(Oe))throw Error(`[creator-editor] useCreatorEditor 必须在 <CreatorWorkspace> 内调用`);return h(Oe)}function Z(e,t,n){return e?`${t}:${e.workspaceId}/${e.providerId}${n===null?``:`/${n}`}`:null}var Ae=new Map,Q=new Set;function je(e){return{...e,target:{...e.target},extraFrontmatter:{...e.extraFrontmatter}}}function Me(e,t){Ae.set(e,je(t))}function Ne(e){let t=Ae.get(e);return t===void 0?null:je(t)}function Pe(e){Ae.delete(e)}function Fe(e){Q.add(e)}function Ie(e){return Q.has(e)}function Le(e){Q.delete(e)}var Re=new Set([`$$slots`,`$$events`,`$$legacy`]);function ze(e,t){let n=E(t,Re),r=[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`}]];R(e,k({name:`save`},()=>n,{get iconNode(){return r}}))}var Be=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ve(e,t){let n=E(t,Be),r=[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`}],[`path`,{d:`M21 3v5h-5`}]];R(e,k({name:`rotate-cw`},()=>n,{get iconNode(){return r}}))}var He=n(`<!> Reload`,1),Ue=n(`<!> <span class="hidden sm:inline">Delete</span>`,1),We=n(`<!> `,1),Ge=n(`<div class="flex flex-1 items-center justify-center gap-2 text-xs text-muted-foreground"><!> Loading…</div>`),Ke=n(`<div class="flex flex-1 flex-col items-center justify-center gap-2 px-8 text-center"><p class="text-xs text-destructive"> </p> <!></div>`),qe=n(`<span class="text-[11px] text-destructive">Use lowercase letters, numbers, and hyphens.</span>`),Je=n(`<label class="block space-y-1"><span class="text-[11px] font-medium text-muted-foreground">Directory name</span> <!> <!></label>`),Ye=n(`<div class="min-h-0 flex-1 space-y-3 overflow-y-auto p-4"><!> <label class="block space-y-1"><span class="text-[11px] font-medium text-muted-foreground">Name</span> <!></label> <label class="block space-y-1"><span class="text-[11px] font-medium text-muted-foreground">Description</span> <textarea rows="2" class="w-full resize-y rounded-md border border-input bg-input/20 px-2 py-1 text-xs leading-5 outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30" placeholder="What this skill does"></textarea></label> <label class="block flex min-h-0 flex-1 flex-col space-y-1"><span class="text-[11px] font-medium text-muted-foreground">Body (Markdown)</span> <textarea rows="16" class="w-full flex-1 resize-y rounded-md border border-input bg-input/20 px-2 py-1.5 font-mono text-xs leading-5 outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30" placeholder="## When to Use
2
-
3
- Describe when this skill should be invoked."></textarea></label></div>`),Xe=n(`<div class="flex h-full flex-col"><div class="flex shrink-0 items-center justify-between border-b border-border px-4 py-2"><span class="text-xs font-medium"> </span> <div class="flex items-center gap-1.5"><!> <!> <!></div></div> <!></div> <!>`,1);function Ze(e,n){r(n,!0);let i=X(),o=i.draft,s=re(te),f=w(!1),h=w(null),b=w(!1);O(()=>{if(o.mode!==`edit`||o.skillId===null)return;let e=Z(o.target,`edit`,o.skillId);e!==null&&Ie(e)||x(o.target,o.skillId)});async function x(e,t){let n=s.issue();v(f,!0),v(h,null);try{let r=await se(e,t);if(!n.isCurrent())return;i.hydrateFromDocument(r);let a=Z(e,`edit`,t);a!==null&&Fe(a)}catch(e){if(!n.isCurrent())return;v(h,e instanceof Error?e.message:String(e),!0)}finally{n.isLatest()&&v(f,!1)}}function E(){if(o.mode===`edit`&&o.skillId){let e=Z(o.target,`edit`,o.skillId);e!==null&&Le(e),x(o.target,o.skillId)}}let k=y(()=>o.mode!==`new`||ne.safeParse(o.directoryName).success),j=y(()=>!p(b)&&o.name.trim().length>0&&o.description.trim().length>0&&(o.mode===`edit`||p(k))&&o.revision!==null==(o.mode===`edit`));async function M(){if(o.mode===`edit`){if(o.skillId===null||o.revision===null)return;v(b,!0);try{let e=await ae({mode:`update`,workspaceId:o.target.workspaceId,providerId:o.target.providerId,skillId:o.skillId,expectedRevision:o.revision,frontmatter:De(o),body:o.body});i.advanceRevision(e.document.revision),U(`Saved.`)}catch(e){N(e)}finally{v(b,!1)}return}let e=ne.safeParse(o.directoryName);if(!e.success){U(`Directory name must be lowercase letters, numbers, and hyphens.`);return}v(b,!0);try{let t=await ae({mode:`create`,workspaceId:o.target.workspaceId,providerId:o.target.providerId,directoryName:e.data,frontmatter:De(o),body:o.body});i.hydrateFromDocument(t.document);let n=Z(o.target,`edit`,t.document.skillId);n!==null&&Fe(n),U(`Skill created.`)}catch(e){N(e)}finally{v(b,!1)}}function N(e){if(e instanceof ee&&e.code===`CONFLICT`){U(`This skill changed elsewhere. Reload to view the latest.`,{label:`Reload`,run:E});return}U(e instanceof Error?e.message:String(e))}let P=w(!1),F=w(!1),L=y(()=>o.mode===`edit`&&o.skillId!==null&&o.revision!==null);async function R(){if(!p(L)||p(F))return;let e=o.skillId,t=o.revision;if(e!==null&&t!==null){v(F,!0);try{await oe({target:o.target,skillId:e,expectedRevision:t}),v(P,!1),U(`Skill deleted.`);let n=Z(o.target,`edit`,e);n!==null&&(Pe(n),Le(n)),await I(`/creator`)}catch(e){e instanceof ee&&e.code===`CONFLICT`?(v(P,!1),U(`This skill changed elsewhere. Reload before deleting.`,{label:`Reload`,run:E})):U(e instanceof Error?e.message:String(e))}finally{v(F,!1)}}}var z=Xe(),B=A(z),V=D(B),H=D(V),ie=g(H,!0),K=C(H,2),q=D(K),le=e=>{W(e,{variant:`outline`,size:`sm`,class:`h-7 gap-1.5`,onclick:E,get disabled(){return p(f)},children:(e,t)=>{var n=He();Ve(A(n),{class:`h-3.5 w-3.5`}),S(),l(e,n)},$$slots:{default:!0}})};c(q,e=>{o.mode===`edit`&&o.skillId&&e(le)});var J=C(q,2),ue=e=>{{let t=y(()=>!p(L)||p(F));W(e,{variant:`ghost`,size:`sm`,class:`h-7 gap-1.5 px-2 text-destructive hover:text-destructive`,title:`Delete this skill`,get disabled(){return p(t)},onclick:()=>v(P,!0),children:(e,t)=>{var n=Ue(),r=A(n);me(r,{class:`h-3.5 w-3.5`}),S(2),l(e,n)},$$slots:{default:!0}})}};c(J,e=>{o.mode===`edit`&&e(ue)});var de=C(J,2);{let e=y(()=>!p(j));W(de,{size:`sm`,class:`h-7 gap-1.5`,onclick:M,get disabled(){return p(e)},children:(e,t)=>{var n=We(),r=A(n),i=e=>{G(e,{class:`h-3.5 w-3.5 animate-spin`})},s=e=>{ze(e,{class:`h-3.5 w-3.5`})};c(r,e=>{p(b)?e(i):e(s,-1)});var u=C(r);T(()=>a(u,` ${o.mode===`new`?`Create`:`Save`}`)),l(e,n)},$$slots:{default:!0}})}t(K),t(V);var fe=C(V,2),he=e=>{var n=Ge(),r=D(n);G(r,{class:`h-4 w-4 animate-spin`}),S(),t(n),l(e,n)},Y=e=>{var n=Ke(),r=D(n),i=g(r,!0),s=C(r,2),u=e=>{W(e,{variant:`outline`,size:`sm`,onclick:E,children:(e,t)=>{S();var n=d(`Retry`);l(e,n)},$$slots:{default:!0}})};c(s,e=>{o.mode===`edit`&&o.skillId&&e(u)}),t(n),T(()=>a(i,p(h))),l(e,n)},ge=e=>{var n=Ye(),r=D(n),i=e=>{var n=Je(),r=C(D(n),2);ce(r,{class:`h-8 font-mono text-xs`,placeholder:`my-skill`,get value(){return o.directoryName},set value(e){o.directoryName=e}});var i=C(r,2),a=e=>{var t=qe();l(e,t)};c(i,e=>{p(k)||e(a)}),t(n),l(e,n)};c(r,e=>{o.mode===`new`&&e(i)});var a=C(r,2),s=C(D(a),2);ce(s,{class:`h-8 text-sm`,placeholder:`Skill name`,get value(){return o.name},set value(e){o.name=e}}),t(a);var u=C(a,2),d=C(D(u),2);m(d),t(u);var f=C(u,2),h=C(D(f),2);m(h),t(f),t(n),_(d,()=>o.description,e=>o.description=e),_(h,()=>o.body,e=>o.body=e),l(e,n)};c(fe,e=>{p(f)?e(he):p(h)?e(Y,1):e(ge,-1)}),t(B);var _e=C(B,2);{let e=y(()=>`Delete this skill from ${o.target.providerId}? Its SKILL.md directory is removed from disk.`);pe(_e,{title:`Delete skill`,get description(){return p(e)},confirmLabel:`Delete`,get busy(){return p(F)},onConfirm:()=>void R(),get open(){return p(P)},set open(e){v(P,e,!0)}})}T(()=>a(ie,o.mode===`new`?`New SKILL.md`:`SKILL.md`)),l(e,z),u()}var Qe=n(`<!> Refresh`,1),$e=n(`<div class="flex flex-1 items-center justify-center px-8 text-center text-xs text-muted-foreground">Save the skill first to see its change history.</div>`),et=n(`<div class="flex flex-1 items-center justify-center gap-2 text-xs text-muted-foreground"><!> Loading history…</div>`),tt=n(`<div class="flex flex-1 flex-col items-center justify-center gap-2 px-8 text-center"><p class="text-xs text-destructive"> </p> <!></div>`),nt=n(`<div class="flex flex-1 items-center justify-center px-8 text-center text-xs text-muted-foreground">No revisions recorded yet.</div>`),rt=n(`<span class="rounded-sm bg-emerald-500/10 px-1.5 py-0.5 text-[10px] font-medium text-emerald-700 dark:text-emerald-300">latest</span>`),it=n(`<span class="text-[10px] text-muted-foreground/70">snapshot pruned</span>`),at=n(`<div><p class="mb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground">Diff vs previous</p> <pre class="overflow-x-auto rounded-md border border-border bg-muted/30 p-2 font-mono text-[10px] leading-4"> </pre></div>`),ot=n(`<div><p class="mb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground">Full snapshot</p> <pre class="max-h-72 overflow-auto rounded-md border border-border bg-muted/30 p-2 font-mono text-[10px] leading-4"> </pre></div>`),st=n(`<p class="text-[10px] text-muted-foreground/70">Initial revision — no diff and no persisted snapshot.</p>`),ct=n(`<div class="mt-2 space-y-2 pl-5"><!> <!> <!></div>`),lt=n(`<li class="px-4 py-3"><button type="button" class="flex w-full items-start gap-2 text-left"><!> <div class="min-w-0 flex-1"><div class="flex items-center gap-2"><span class="text-xs font-medium"> </span> <!> <!></div> <p class="mt-0.5 truncate font-mono text-[10px] text-muted-foreground"> </p></div></button> <!></li>`),ut=n(`<ol class="min-h-0 flex-1 divide-y divide-border overflow-y-auto"></ol>`),dt=n(`<div class="flex h-full flex-col"><div class="flex shrink-0 items-center justify-between border-b border-border px-4 py-2"><span class="text-xs font-medium">Change history</span> <!></div> <!></div>`);function ft(n,i){r(i,!0);let s=X().draft,f=re(te),m=w(!1),h=w(null),_=w(j([])),b=j({});O(()=>{s.mode===`edit`&&s.skillId!==null&&x(s.skillId)});async function x(e){let t=f.issue();v(m,!0),v(h,null);try{let n=await H().creator.revisions({workspaceId:s.target.workspaceId,providerId:s.target.providerId,skillId:e});if(!t.isCurrent())return;v(_,[...n.revisions].sort((e,t)=>t.timestamp-e.timestamp),!0)}catch(e){if(!t.isCurrent())return;v(h,e instanceof Error?e.message:String(e),!0)}finally{t.isLatest()&&v(m,!1)}}function E(e){b[e]=!b[e]}function k(){s.mode===`edit`&&s.skillId&&x(s.skillId)}function M(e){try{return new Date(e).toLocaleString()}catch{return String(e)}}var N=dt(),P=D(N),F=C(D(P),2),I=e=>{W(e,{variant:`outline`,size:`sm`,class:`h-7 gap-1.5`,onclick:k,get disabled(){return p(m)},children:(e,t)=>{var n=Qe();Ve(A(n),{class:`h-3.5 w-3.5`}),S(),l(e,n)},$$slots:{default:!0}})};c(F,e=>{s.mode===`edit`&&s.skillId&&e(I)}),t(P);var L=C(P,2),R=e=>{var t=$e();l(e,t)},z=e=>{var n=et(),r=D(n);G(r,{class:`h-4 w-4 animate-spin`}),S(),t(n),l(e,n)},B=e=>{var n=tt(),r=D(n),i=g(r,!0),o=C(r,2),u=e=>{W(e,{variant:`outline`,size:`sm`,onclick:k,children:(e,t)=>{S();var n=d(`Retry`);l(e,n)},$$slots:{default:!0}})};c(o,e=>{s.skillId&&e(u)}),t(n),T(()=>a(i,p(h))),l(e,n)},ee=e=>{var t=nt();l(e,t)},V=n=>{var r=ut();e(r,23,()=>p(_),e=>e.revision,(e,n,r)=>{var i=lt(),s=D(i),u=D(s);{let e=y(()=>b[p(n).revision]?`rotate-90`:``);J(u,{get class(){return`mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform ${p(e)??``}`}})}var d=C(u,2),f=D(d),m=D(f),h=g(m,!0),_=C(m,2),v=e=>{var t=rt();l(e,t)};c(_,e=>{p(r)===0&&e(v)});var x=C(_,2),S=e=>{var t=it();l(e,t)};c(x,e=>{p(n).content===null&&e(S)}),t(f);var w=C(f,2),O=g(w);t(d),t(s);var k=C(s,2),A=e=>{var r=ct(),i=D(r),o=e=>{var r=at(),i=C(D(r),2),o=g(i,!0);t(r),T(()=>a(o,p(n).diff)),l(e,r)};c(i,e=>{p(n).diff&&e(o)});var s=C(i,2),u=e=>{var r=ot(),i=C(D(r),2),o=g(i,!0);t(r),T(()=>a(o,p(n).content)),l(e,r)};c(s,e=>{p(n).content!==null&&e(u)});var d=C(s,2),f=e=>{var t=st();l(e,t)};c(d,e=>{p(n).diff===null&&p(n).content===null&&e(f)}),t(r),l(e,r)};c(k,e=>{b[p(n).revision]&&e(A)}),t(i),T((e,t)=>{a(h,e),a(O,`${t??``}…`)},[()=>M(p(n).timestamp),()=>p(n).revision.slice(0,16)]),o(`click`,s,()=>E(p(n).revision)),l(e,i)}),t(r),l(n,r)};c(L,e=>{s.mode===`new`?e(R):p(m)?e(z,1):p(h)?e(B,2):p(_).length===0?e(ee,3):e(V,-1)}),t(N),l(n,N),u()}f([`click`]);var pt=n(`<p class="text-[11px] text-muted-foreground/70">Only name and description — no additional metadata.</p>`),mt=n(`<div><dt class="bg-muted/40 px-2 py-1 text-[11px] font-medium text-muted-foreground"> </dt> <dd class="break-words px-2 py-1 text-[11px]"> </dd></div>`),ht=n(`<dl class="overflow-x-auto rounded-md border border-border"></dl>`),gt=n(`<p class="text-xs text-muted-foreground/70">Nothing to preview yet.</p>`),_t=n(`<div class="prose prose-sm max-w-none overflow-x-auto"></div>`),vt=n(`<div class="flex h-full flex-col overflow-y-auto p-4"><section class="mb-4"><h1 class="text-base font-semibold"> </h1> <p class="mt-0.5 text-xs leading-5 text-muted-foreground"> </p></section> <section class="mb-4"><h2 class="mb-2 text-[11px] font-medium text-muted-foreground">Frontmatter</h2> <!></section> <section class="min-h-0 flex-1"><h2 class="mb-2 text-[11px] font-medium text-muted-foreground">Body</h2> <!></section></div>`);function yt(n,i){r(i,!0);let o=X().draft,d=y(()=>De(o)),f=y(()=>he(o.body)),m=y(()=>Object.entries(p(d)).filter(([e])=>e!==`name`&&e!==`description`));var h=vt(),_=D(h),v=D(_),b=g(v,!0),S=C(v,2),w=g(S,!0);t(_);var E=C(_,2),O=C(D(E),2),k=e=>{var t=pt();l(e,t)},A=n=>{var r=ht();e(r,23,()=>p(m),([e,t])=>e,(e,n,r)=>{var i=y(()=>s(p(n),2));let o=()=>p(i)[0],c=()=>p(i)[1];var u=mt(),d=D(u),f=g(d,!0),m=C(d,2),h=g(m,!0);t(u),T(e=>{N(u,1,`grid grid-cols-[120px_minmax(0,1fr)] ${p(r)>0?`border-t border-border`:``}`),a(f,o()),a(h,e)},[()=>c()===null?`null`:String(c())]),l(e,u)}),t(r),l(n,r)};c(O,e=>{p(m).length===0?e(k):e(A,-1)}),t(E);var j=C(E,2),M=C(D(j),2),P=e=>{var t=gt();l(e,t)},F=y(()=>o.body.trim().length===0),I=e=>{var n=_t();x(n,()=>p(f),!0),t(n),l(e,n)};c(M,e=>{p(F)?e(P):e(I,-1)}),t(j),t(h),T(()=>{a(b,o.name||`Untitled skill`),a(w,o.description||`No description yet.`)}),l(n,h),u()}var bt=n(`<!> Re-validate`,1),xt=n(`<div class="flex flex-1 items-center justify-center px-8 text-center text-xs text-muted-foreground">Save the skill first to validate it.</div>`),St=n(`<div class="flex flex-1 items-center justify-center gap-2 text-xs text-muted-foreground"><!> Validating…</div>`),Ct=n(`<div class="flex flex-1 flex-col items-center justify-center gap-2 px-8 text-center"><p class="text-xs text-destructive"> </p> <!></div>`),wt=n(`<div class="flex items-center gap-2 text-xs text-emerald-700 dark:text-emerald-300"><!> Skill passes all checks.</div>`),Tt=n(`<li class="flex gap-2 rounded-md bg-destructive/10 px-2 py-1.5 text-xs text-destructive"><!> <span class="break-words"> </span></li>`),Et=n(`<section><h3 class="mb-1.5 text-[11px] font-medium uppercase tracking-wide text-destructive"> </h3> <ul class="space-y-1"></ul></section>`),Dt=n(`<li class="flex gap-2 rounded-md bg-amber-500/10 px-2 py-1.5 text-xs text-amber-700 dark:text-amber-300"><!> <span class="break-words"> </span></li>`),Ot=n(`<section><h3 class="mb-1.5 text-[11px] font-medium uppercase tracking-wide text-amber-700 dark:text-amber-300"> </h3> <ul class="space-y-1"></ul></section>`),kt=n(`<!> <!>`,1),At=n(`<div class="min-h-0 flex-1 space-y-3 overflow-y-auto p-4"><!></div>`),jt=n(`<div class="flex h-full flex-col"><div class="flex shrink-0 items-center justify-between border-b border-border px-4 py-2"><span class="text-xs font-medium">Validation</span> <!></div> <!></div>`);function Mt(n,i){r(i,!0);let o=X().draft,s=re(te),f=w(!1),m=w(null),h=w(null);O(()=>{o.mode===`edit`&&o.skillId!==null&&_(o.skillId)});async function _(e){let t=s.issue();v(f,!0),v(m,null);try{let n=await H().skills.validate({workspaceId:o.target.workspaceId,providerId:o.target.providerId,skillId:e});if(!t.isCurrent())return;v(h,n,!0)}catch(e){if(!t.isCurrent())return;v(m,e instanceof Error?e.message:String(e),!0),v(h,null)}finally{t.isLatest()&&v(f,!1)}}function y(){o.mode===`edit`&&o.skillId&&_(o.skillId)}var x=jt(),E=D(x),k=C(D(E),2),j=e=>{W(e,{variant:`outline`,size:`sm`,class:`h-7 gap-1.5`,onclick:y,get disabled(){return p(f)},children:(e,t)=>{var n=bt(),r=A(n),i=e=>{G(e,{class:`h-3.5 w-3.5 animate-spin`})},a=e=>{Y(e,{class:`h-3.5 w-3.5`})};c(r,e=>{p(f)?e(i):e(a,-1)}),S(),l(e,n)},$$slots:{default:!0}})};c(k,e=>{o.mode===`edit`&&o.skillId&&e(j)}),t(E);var M=C(E,2),N=e=>{var t=xt();l(e,t)},P=e=>{var n=St(),r=D(n);G(r,{class:`h-4 w-4 animate-spin`}),S(),t(n),l(e,n)},F=e=>{var n=Ct(),r=D(n),i=g(r,!0),s=C(r,2),u=e=>{W(e,{variant:`outline`,size:`sm`,onclick:y,children:(e,t)=>{S();var n=d(`Retry`);l(e,n)},$$slots:{default:!0}})};c(s,e=>{o.skillId&&e(u)}),t(n),T(()=>a(i,p(m))),l(e,n)},I=n=>{var r=At(),i=D(r),o=e=>{var n=wt(),r=D(n);le(r,{class:`h-4 w-4`}),S(),t(n),l(e,n)},s=n=>{var r=kt(),i=A(r),o=n=>{var r=Et(),i=D(r),o=g(i),s=C(i,2);e(s,21,()=>p(h).errors,b,(e,n)=>{var r=Tt(),i=D(r);Y(i,{class:`mt-0.5 h-3.5 w-3.5 shrink-0`});var o=C(i,2),s=g(o,!0);t(r),T(()=>a(s,p(n))),l(e,r)}),t(s),t(r),T(()=>a(o,`Errors (${p(h).errors.length??``})`)),l(n,r)};c(i,e=>{p(h).errors.length>0&&e(o)});var s=C(i,2),u=n=>{var r=Ot(),i=D(r),o=g(i),s=C(i,2);e(s,21,()=>p(h).warnings,b,(e,n)=>{var r=Dt(),i=D(r);Y(i,{class:`mt-0.5 h-3.5 w-3.5 shrink-0`});var o=C(i,2),s=g(o,!0);t(r),T(()=>a(s,p(n))),l(e,r)}),t(s),t(r),T(()=>a(o,`Warnings (${p(h).warnings.length??``})`)),l(n,r)};c(s,e=>{p(h).warnings.length>0&&e(u)}),l(n,r)};c(i,e=>{p(h).success&&p(h).errors.length===0&&p(h).warnings.length===0?e(o):e(s,-1)}),t(r),l(n,r)};c(M,e=>{o.mode===`new`?e(N):p(f)&&p(h)===null?e(P,1):p(m)?e(F,2):p(h)&&e(I,3)}),t(x),l(n,x),u()}var $={id:`probe-recall-v1`,version:1,render(e){return`请阅读引用的技能文档($${e} 芯片)。然后:
4
- 1. 复述该技能的触发条件与适用场景;
5
- 2. 列出它声明提供的工具与参考文件;
6
- 3. 给出一个你会使用它的典型任务示例。`}},Nt=n(`<!> Run in Agent panel`,1),Pt=n(`<div class="flex h-full flex-col gap-3 p-4"><div class="flex items-center gap-2 text-sm font-medium"><!> Test run <span class="text-xs font-normal text-muted-foreground"> </span></div> <p class="text-xs text-muted-foreground">在 Agent 面板打开一个携带 <code class="rounded bg-muted px-1"> </code> 技能引用的试跑会话——发送后由 daemon 展开技能文档,你可以编辑最终指令。</p> <textarea class="min-h-0 flex-1 resize-none rounded-md border border-border bg-background p-3 font-mono text-xs leading-relaxed focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring" aria-label="Test run prompt" spellcheck="false"></textarea> <div class="flex shrink-0 items-center justify-end gap-2"><!> <!></div></div>`),Ft=n(`<!> Go save`,1),It=n(`<div class="flex h-full items-center justify-center p-6 text-center text-xs text-muted-foreground"><div class="space-y-2"><p class="font-medium text-foreground">Test run</p> <p>Save the skill first to test it — the run needs a stable skill identity.</p> <!></div></div>`);function Lt(e,n){r(n,!0);let i=X().draft,s=w(!1),f=w(``);O(()=>{let e=i.name;p(s)||v(f,$.render(e.length>0?e:`skill`),!0)});let h=y(()=>i.mode===`edit`&&i.skillId!==null&&i.revision!==null);function b(){p(h)&&i.skillId!==null&&i.revision!==null&&K({text:p(f).trim().length>0?p(f):$.render(i.name),skill:{workspaceId:i.target.workspaceId,providerId:i.target.providerId,skillId:i.skillId},skillName:i.name.length>0?i.name:i.skillId,revision:i.revision,templateId:$.id,templateVersion:$.version})}function x(){let e=new URLSearchParams(L.url.searchParams);e.set(`subview`,`file`),I(`${L.url.pathname}?${e.toString()}`)}var E=F(),k=A(E),j=e=>{var n=Pt(),r=D(n),c=D(r);ye(c,{class:`size-4 text-muted-foreground`});var u=C(c,2),h=g(u);t(r);var y=C(r,2),x=C(D(y)),w=g(x);S(),t(y);var E=C(y,2);m(E);var O=C(E,2),k=D(O);W(k,{size:`sm`,variant:`secondary`,onclick:()=>v(s,!1),children:(e,t)=>{S();var n=d(`Reset probe`);l(e,n)},$$slots:{default:!0}});var j=C(k,2);W(j,{size:`sm`,onclick:b,children:(e,t)=>{var n=Nt();ye(A(n),{class:`size-4`}),S(),l(e,n)},$$slots:{default:!0}}),t(O),t(n),T(e=>{a(h,`probe ${$.id??``} v${$.version??``} · revision
7
- ${e??``}…`),a(w,`$${i.name??``}`)},[()=>i.revision?.slice(0,14)]),o(`input`,E,()=>v(s,!0)),_(E,()=>p(f),e=>v(f,e)),l(e,n)},M=e=>{var n=It(),r=D(n),i=C(D(r),4);W(i,{size:`sm`,variant:`secondary`,onclick:x,children:(e,t)=>{var n=Ft();ze(A(n),{class:`size-4`}),S(),l(e,n)},$$slots:{default:!0}}),t(r),t(n),l(e,n)};c(k,e=>{p(h)?e(j):e(M,-1)}),l(e,E),u()}f([`input`]);var Rt=n(`<div class="flex flex-1 items-center justify-center p-4 text-center text-xs text-muted-foreground">Invalid workspace target.</div>`),zt=n(`<!> <div class="min-h-0 flex-1 overflow-hidden"><!></div>`,1),Bt=n(`<div class="flex h-full flex-col overflow-hidden"><header class="flex shrink-0 items-center gap-2 border-b border-border px-4 py-2"><span class="text-sm font-medium"> </span> <span class="text-xs text-muted-foreground"> </span></header> <div class="flex min-h-0 flex-1 flex-col"><!></div></div>`);function Vt(e,n){r(n,!0);let i=B(),o=y(()=>i?.()),s=y(()=>p(o)?.mode),d=y(()=>p(o)?.wsId),f=y(()=>p(o)?.providerId),m=y(()=>p(o)?.skillId),h=z(),_=y(()=>h?.()??{}),v=y(()=>p(_).subview??`file`),b=y(()=>!p(d)||!p(f)?null:{workspaceId:p(d),providerId:p(f)}),x=y(()=>{if(!p(b))return Te();if(p(s)===`edit`&&p(m))return Ee(p(b),p(m));let e=p(_).template?ue.find(e=>e.id===p(_).template):void 0,t=Ce(p(b),e?e.name:``);return e&&(t.name=e.name,t.description=e.description,t.body=e.body),t}),S=ke(Te()),w=y(()=>Z(p(b),p(s)===`edit`?`edit`:`new`,p(m)??null));O(()=>{let e=p(w),t=p(x),n=e===null?null:Ne(e),r=n??t;S.draft.mode=r.mode,S.draft.target=r.target,S.draft.skillId=r.skillId,S.draft.name=r.name,S.draft.description=r.description,S.draft.body=r.body,S.draft.revision=r.revision,S.draft.extraFrontmatter=r.extraFrontmatter,S.draft.directoryName=r.directoryName,n!==null&&e!==null&&Fe(e)}),O(()=>()=>{let e=S.draft;if(e.target.workspaceId===`~`)return;let t=Z(e.target,e.mode,e.skillId);t!==null&&Me(t,e)});var E=Bt(),k=D(E),j=D(k),M=g(j,!0),N=C(j,2),P=g(N);t(k);var F=C(k,2),I=D(F),L=e=>{var t=Rt();l(e,t)},R=e=>{var n=zt(),r=A(n);Se(r,{});var i=C(r,2),a=D(i),o=e=>{Ze(e,{})},s=e=>{ft(e,{})},u=e=>{yt(e,{})},d=e=>{Mt(e,{})},f=e=>{Lt(e,{})},m=e=>{Ze(e,{})};c(a,e=>{p(v)===`file`?e(o):p(v)===`log`?e(s,1):p(v)===`preview`?e(u,2):p(v)===`validate`?e(d,3):p(v)===`test`?e(f,4):e(m,-1)}),t(i),l(e,n)};c(I,e=>{p(b)?e(R,-1):e(L)}),t(F),t(E),T(e=>{a(M,e),a(P,`${p(d)??``} / ${p(f)??``}`)},[()=>p(s)===`new`?`New skill`:p(m)?`Edit: ${p(m).slice(0,12)}…`:`Editor`]),l(e,E),u()}export{Vt as default};
@@ -1 +0,0 @@
1
- import{o as e,r as t}from"../chunks/B0stYqX9.js";export{e as load_css,t as start};