dorkos 0.37.0 → 0.38.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.
@@ -1 +1 @@
1
- import{r as b,j as e,T as f,C as v,P as N,a as E,c as g,B as k,S,u as w,b as y,d as C,e as T,f as R,g as z,t as m}from"./index-Bpr8KFot.js";import{E as M,h as _,i as B,k as H}from"./index-Bpr8KFot.js";const P=new Set(["disabled","discovered","incompatible","invalid"]);function I({extension:o,onToggle:u,isToggling:c}){const{manifest:s,status:t,scope:h,error:n}=o,[r,a]=b.useState(!1),x=!P.has(t),d=t==="incompatible",l=t==="invalid",i=t==="compile_error"||t==="activate_error",j=!d&&!l;return e.jsx("div",{"data-slot":"extension-card","data-testid":`extension-card-${o.id}`,className:g("bg-card rounded-xl border p-4",i&&"border-amber-500/50",(d||l)&&"opacity-70"),children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i&&e.jsx(f,{className:"size-4 shrink-0 text-amber-500","aria-hidden":"true"}),(d||l)&&!i&&e.jsx(v,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),!i&&!d&&!l&&e.jsx(N,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"font-medium",children:s.name}),e.jsxs("span",{className:"text-muted-foreground text-sm",children:["v",s.version]})]}),s.description&&e.jsx("p",{className:"text-muted-foreground text-sm",children:s.description}),d&&s.minHostVersion&&e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Requires DorkOS >= ",s.minHostVersion]}),i&&n&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:[t==="compile_error"?"Compilation error: ":"Activation failed: ",n.message]}),n.details&&e.jsxs("button",{type:"button",onClick:()=>a(p=>!p),className:"text-muted-foreground hover:text-foreground flex items-center gap-1 text-xs transition-colors","aria-expanded":r,children:[e.jsx(E,{className:g("size-3 transition-transform",r&&"rotate-180")}),r?"Hide details":"Show details"]}),r&&n.details&&e.jsx("pre",{className:"bg-muted mt-1 max-h-32 overflow-auto rounded-md p-2 text-xs",children:n.details})]}),e.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-2 text-xs",children:[e.jsx(k,{variant:"outline",className:"text-xs",children:h}),s.author&&e.jsx("span",{children:s.author})]})]}),e.jsx("div",{className:"pt-0.5",children:e.jsx(S,{checked:x,onCheckedChange:p=>u(o.id,p),disabled:!j||c,"aria-label":`${x?"Disable":"Enable"} ${s.name}`})})]})})}function A(){const{data:o=[],isLoading:u}=w(),c=y(),s=C(),t=T(),h=new Set([...c.variables?[c.variables]:[],...s.variables?[s.variables]:[]]);async function n(a,x){(x?c:s).mutate(a,{onSuccess:()=>{m.info("Extension changed — reload the page to apply",{action:{label:"Reload now",onClick:()=>location.reload()}})},onError:l=>{const i=x?"enable":"disable";m.error(`Failed to ${i} extension: ${l.message}`)}})}function r(){t.mutate(void 0,{onSuccess:a=>{m.success(`Reloaded ${a.length} extension(s)`)},onError:()=>{m.error("Failed to reload extensions")}})}return u?e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm",children:"Loading extensions…"}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Extensions add new UI and capabilities to DorkOS. Place them in"," ",e.jsx("code",{className:"bg-muted rounded px-1",children:"~/.dork/extensions/"})," or"," ",e.jsx("code",{className:"bg-muted rounded px-1",children:".dork/extensions/"})," in your project."]}),o.length===0?e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm","data-testid":"no-extensions",children:e.jsx("p",{children:"No extensions installed."})}):e.jsx("div",{className:"space-y-3",children:o.map(a=>e.jsx(I,{extension:a,onToggle:n,isToggling:h.has(a.id)},a.id))}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(R,{variant:"outline",size:"sm",onClick:r,disabled:t.isPending,"data-testid":"reload-extensions-button",children:[e.jsx(z,{className:g("mr-2 size-4",t.isPending&&"animate-spin")}),"Reload Extensions"]})})]})}export{M as ExtensionLoader,_ as ExtensionProvider,A as ExtensionsSettingsTab,B as createExtensionAPI,H as useExtensions};
1
+ import{r as b,j as e,T as f,C as v,P as N,a as E,c as g,B as k,S,u as w,b as y,d as C,e as T,f as R,g as z,t as m}from"./index-CwvMtDAg.js";import{E as M,h as _,i as B,k as H}from"./index-CwvMtDAg.js";const P=new Set(["disabled","discovered","incompatible","invalid"]);function I({extension:o,onToggle:u,isToggling:c}){const{manifest:s,status:t,scope:h,error:n}=o,[r,a]=b.useState(!1),x=!P.has(t),d=t==="incompatible",l=t==="invalid",i=t==="compile_error"||t==="activate_error",j=!d&&!l;return e.jsx("div",{"data-slot":"extension-card","data-testid":`extension-card-${o.id}`,className:g("bg-card rounded-xl border p-4",i&&"border-amber-500/50",(d||l)&&"opacity-70"),children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i&&e.jsx(f,{className:"size-4 shrink-0 text-amber-500","aria-hidden":"true"}),(d||l)&&!i&&e.jsx(v,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),!i&&!d&&!l&&e.jsx(N,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"font-medium",children:s.name}),e.jsxs("span",{className:"text-muted-foreground text-sm",children:["v",s.version]})]}),s.description&&e.jsx("p",{className:"text-muted-foreground text-sm",children:s.description}),d&&s.minHostVersion&&e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Requires DorkOS >= ",s.minHostVersion]}),i&&n&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:[t==="compile_error"?"Compilation error: ":"Activation failed: ",n.message]}),n.details&&e.jsxs("button",{type:"button",onClick:()=>a(p=>!p),className:"text-muted-foreground hover:text-foreground flex items-center gap-1 text-xs transition-colors","aria-expanded":r,children:[e.jsx(E,{className:g("size-3 transition-transform",r&&"rotate-180")}),r?"Hide details":"Show details"]}),r&&n.details&&e.jsx("pre",{className:"bg-muted mt-1 max-h-32 overflow-auto rounded-md p-2 text-xs",children:n.details})]}),e.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-2 text-xs",children:[e.jsx(k,{variant:"outline",className:"text-xs",children:h}),s.author&&e.jsx("span",{children:s.author})]})]}),e.jsx("div",{className:"pt-0.5",children:e.jsx(S,{checked:x,onCheckedChange:p=>u(o.id,p),disabled:!j||c,"aria-label":`${x?"Disable":"Enable"} ${s.name}`})})]})})}function A(){const{data:o=[],isLoading:u}=w(),c=y(),s=C(),t=T(),h=new Set([...c.variables?[c.variables]:[],...s.variables?[s.variables]:[]]);async function n(a,x){(x?c:s).mutate(a,{onSuccess:()=>{m.info("Extension changed — reload the page to apply",{action:{label:"Reload now",onClick:()=>location.reload()}})},onError:l=>{const i=x?"enable":"disable";m.error(`Failed to ${i} extension: ${l.message}`)}})}function r(){t.mutate(void 0,{onSuccess:a=>{m.success(`Reloaded ${a.length} extension(s)`)},onError:()=>{m.error("Failed to reload extensions")}})}return u?e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm",children:"Loading extensions…"}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Extensions add new UI and capabilities to DorkOS. Place them in"," ",e.jsx("code",{className:"bg-muted rounded px-1",children:"~/.dork/extensions/"})," or"," ",e.jsx("code",{className:"bg-muted rounded px-1",children:".dork/extensions/"})," in your project."]}),o.length===0?e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm","data-testid":"no-extensions",children:e.jsx("p",{children:"No extensions installed."})}):e.jsx("div",{className:"space-y-3",children:o.map(a=>e.jsx(I,{extension:a,onToggle:n,isToggling:h.has(a.id)},a.id))}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(R,{variant:"outline",size:"sm",onClick:r,disabled:t.isPending,"data-testid":"reload-extensions-button",children:[e.jsx(z,{className:g("mr-2 size-4",t.isPending&&"animate-spin")}),"Reload Extensions"]})})]})}export{M as ExtensionLoader,_ as ExtensionProvider,A as ExtensionsSettingsTab,B as createExtensionAPI,H as useExtensions};
@@ -1,4 +1,4 @@
1
- var xt=Object.defineProperty;var wt=(e,n,i)=>n in e?xt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var N=(e,n,i)=>wt(e,typeof n!="symbol"?n+"":n,i);import{l as bt,j as v,r as ee}from"./index-Bpr8KFot.js";var on={exports:{}};/*!
1
+ var xt=Object.defineProperty;var wt=(e,n,i)=>n in e?xt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var N=(e,n,i)=>wt(e,typeof n!="symbol"?n+"":n,i);import{l as bt,j as v,r as ee}from"./index-BIiA1ABD.js";var on={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
@@ -15,8 +15,8 @@
15
15
  if (dark) document.documentElement.classList.add('dark');
16
16
  })();
17
17
  </script>
18
- <script type="module" crossorigin src="/assets/index-B5TKcNau.js"></script>
19
- <link rel="stylesheet" crossorigin href="/assets/index-BdwdqwzU.css">
18
+ <script type="module" crossorigin src="/assets/index-BIiA1ABD.js"></script>
19
+ <link rel="stylesheet" crossorigin href="/assets/index-Bz6iMwsx.css">
20
20
  </head>
21
21
  <body>
22
22
  <div id="root"></div>
@@ -84119,7 +84119,7 @@ var SERVER_VERSION = resolveVersion();
84119
84119
  var IS_DEV_BUILD = checkDevBuild(SERVER_VERSION);
84120
84120
  function resolveVersion() {
84121
84121
  if (env.DORKOS_VERSION_OVERRIDE) return env.DORKOS_VERSION_OVERRIDE;
84122
- if (true) return "0.37.0";
84122
+ if (true) return "0.38.0";
84123
84123
  const pkgPath = path4.join(path4.dirname(fileURLToPath2(import.meta.url)), "../../package.json");
84124
84124
  return JSON.parse(readFileSync(pkgPath, "utf-8")).version;
84125
84125
  }
@@ -95890,16 +95890,38 @@ async function createAgentWorkspace(input, meshCore2) {
95890
95890
  throw err;
95891
95891
  }
95892
95892
  if (!opts.skipTemplateDownload) {
95893
+ let dirExists = false;
95893
95894
  try {
95894
95895
  await fs12.stat(resolvedPath);
95895
- throw new AgentCreationError("Directory already exists", "COLLISION", 409);
95896
+ dirExists = true;
95896
95897
  } catch (err) {
95897
- if (err instanceof AgentCreationError) throw err;
95898
95898
  if (err.code !== "ENOENT") throw err;
95899
95899
  }
95900
- const parentDir = path25.dirname(resolvedPath);
95901
- await fs12.mkdir(parentDir, { recursive: true });
95902
- await fs12.mkdir(resolvedPath);
95900
+ if (dirExists) {
95901
+ const dorkPath = path25.join(resolvedPath, ".dork");
95902
+ try {
95903
+ await fs12.stat(dorkPath);
95904
+ throw new AgentCreationError(
95905
+ "Directory already contains a DorkOS project \u2014 use Import instead",
95906
+ "COLLISION",
95907
+ 409
95908
+ );
95909
+ } catch (err) {
95910
+ if (err instanceof AgentCreationError) throw err;
95911
+ if (err.code !== "ENOENT") throw err;
95912
+ }
95913
+ if (opts.template) {
95914
+ throw new AgentCreationError(
95915
+ "Cannot apply template to an existing directory \u2014 use Start Blank or choose a new directory",
95916
+ "COLLISION",
95917
+ 409
95918
+ );
95919
+ }
95920
+ } else {
95921
+ const parentDir = path25.dirname(resolvedPath);
95922
+ await fs12.mkdir(parentDir, { recursive: true });
95923
+ await fs12.mkdir(resolvedPath);
95924
+ }
95903
95925
  }
95904
95926
  let meta;
95905
95927
  if (opts.template && !opts.skipTemplateDownload) {
@@ -136735,6 +136757,7 @@ function createAgentsRouter(meshCore2) {
136735
136757
  }
136736
136758
  return res.status(201).json({
136737
136759
  ...result2.manifest,
136760
+ _path: result2.path,
136738
136761
  ...result2.meta ? { _meta: result2.meta } : {}
136739
136762
  });
136740
136763
  } catch (err) {