llmd 0.4.5 → 0.4.6

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 (2) hide show
  1. package/dist/llmd +6 -6
  2. package/package.json +1 -1
package/dist/llmd CHANGED
@@ -692,10 +692,10 @@ ${s.notes}
692
692
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
693
693
  .main { padding: 20px; }
694
694
  }
695
- `},__=(e)=>{let n=[],t=new Map;for(let a of e){let i=a.path.split("/"),s=n,r="";for(let c=0;c<i.length-1;c++){let o=i[c];if(!o)continue;r=r.length>0?`${r}/${o}`:o;let u=t.get(r);if(u)s=u.children;else{let m={type:"directory",name:o,path:r,depth:c,children:[]};t.set(r,m),s.push(m),s=m.children}}s.push({type:"file",name:a.name,path:a.path,depth:a.depth,children:[]})}return n},Um=(e)=>{if(e.type==="file")return!0;return e.children.some((n)=>Um(n))},$_='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/></svg>',j_='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/></svg>',w_='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3v18h18"/><path d="M18 17l-4-4-4 4-4-4"/></svg>',x_='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 11-6 6v3h9l3-3"/><path d="m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"/></svg>',Om=(e,n)=>e.filter((t)=>Um(t)).map((t)=>{if(t.type==="directory"){let s=t.children.length>0?Om(t.children,n):"";if(!s)return"";return`<li class="dir-item">
696
- <div class="nav-link-dir dir-label depth-${t.depth}">${$_}<span>${t.name}/</span></div>
697
- <ul>${s}</ul>
698
- </li>`}let i=n===t.path?"active":"";return`<li><a href="/view/${t.path}" class="nav-link-file depth-${t.depth} ${i}" data-file-path="${t.path}">${j_}<span>${t.name}</span></a></li>`}).join(`
695
+ `},__=(e)=>{let n=[],t=new Map;for(let a of e){let i=a.path.split("/"),s=n,r="";for(let c=0;c<i.length-1;c++){let o=i[c];if(!o)continue;r=r.length>0?`${r}/${o}`:o;let u=t.get(r);if(u)s=u.children;else{let m={type:"directory",name:o,path:r,depth:c,children:[]};t.set(r,m),s.push(m),s=m.children}}s.push({type:"file",name:a.name,path:a.path,depth:a.depth,children:[]})}return n},Um=(e)=>{if(e.type==="file")return!0;return e.children.some((n)=>Um(n))},$_='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/></svg>',j_='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/></svg>',w_='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3v18h18"/><path d="M18 17l-4-4-4 4-4-4"/></svg>',x_='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 11-6 6v3h9l3-3"/><path d="m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"/></svg>',Om=(e,n,t=0)=>e.filter((a)=>Um(a)).map((a)=>{if(a.type==="directory"){let r=a.children.length>0?Om(a.children,n,t+1):"";if(!r)return"";return`<li class="dir-item">
696
+ <div class="nav-link-dir dir-label depth-${t}">${$_}<span>${a.name}/</span></div>
697
+ <ul>${r}</ul>
698
+ </li>`}let s=n===a.path?"active":"";return`<li><a href="/view/${a.path}" class="nav-link-file depth-${t} ${s}" data-file-path="${a.path}">${j_}<span>${a.name}</span></a></li>`}).join(`
699
699
  `),k_=()=>`
700
700
  <div class="admin-section" style="padding: 12px 12px 8px 12px; border-bottom: 1px solid var(--border);">
701
701
  <div class="admin-header" style="display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 4px 6px; border-radius: 6px; transition: background 0.15s; user-select: none;">
@@ -1182,7 +1182,7 @@ ${s.notes}
1182
1182
 
1183
1183
  ---
1184
1184
 
1185
- `);return a+i},y$=(e,n)=>{let{ensureExportsDirectory:t}=(va(),He(ka)),{writeFileSync:a}=x("node:fs"),i=t(),s=xn(i,n);return a(s,e,"utf-8"),s},Us=()=>{let{readdirSync:e,statSync:n}=x("node:fs"),t=Ks();if(!ja(t))return[];return e(t).filter((i)=>i.endsWith(".md")).map((i)=>{let s=xn(t,i),r=n(s),c=i.split("_"),o=c[0]||"",u=Number.parseInt(c[1]||"0",10),m=c.slice(2).join("_");return{path:s,size:r.size,mtime:r.mtimeMs,resourceId:o,timestamp:u,originalName:m}}).sort((i,s)=>s.mtime-i.mtime)},h$=(e)=>{let{readFileSync:n}=x("node:fs"),a=Us().find((s)=>s.originalName===e||s.resourceId===e||s.path===e);if(!a)return null;let i=n(a.path,"utf-8");return{...a,content:i}},_$=()=>{let{rmSync:e}=x("node:fs"),n=Us(),t=n.reduce((i,s)=>i+s.size,0),a=n.length;for(let i of n)e(i.path);return{deletedCount:a,freedBytes:t}};var pt=G(()=>{P_=/\.md$/,i$=/\s+/g});import{execSync as ul}from"child_process";import{existsSync as $$}from"fs";import{homedir as j$}from"os";import{join as ml}from"path";import{spawn as gl}from"node:child_process";var xa=(e)=>{let n=process.platform;try{let t,a;if(n==="darwin")t="open",a=[e];else if(n==="win32")t="cmd",a=["/c","start",e];else t="xdg-open",a=[e];gl(t,a,{detached:!0,stdio:"ignore"}).unref()}catch(t){console.error("Failed to open browser:",t)}};import{existsSync as id}from"node:fs";import{dirname as sd,isAbsolute as rd,resolve as od}from"node:path";var Ms={name:"llmd",version:"0.4.5",description:"Local markdown server for LLM-generated docs",author:"Phil Zona <phil.b.zona@gmail.com>",license:"MIT",repository:{type:"git",url:"https://github.com/pbzona/llmd.git"},homepage:"https://github.com/pbzona/llmd#readme",bugs:{url:"https://github.com/pbzona/llmd/issues"},type:"module",bin:{llmd:"./dist/llmd"},files:["dist/llmd","dist/client.js","LICENSE","README.md"],engines:{node:">=22",bun:">=1.2.2"},publishConfig:{access:"public"},scripts:{dev:"bun --hot index.ts",test:"bun test",build:"bash scripts/build.sh",prepublishOnly:"bun test && bun run build","check-contrast":"bun scripts/check-contrast.ts",format:"biome format --write .","format:check":"biome format .",lint:"biome lint .","lint:fix":"biome lint --write .",check:"biome check --write .",prepare:"husky"},keywords:["markdown","server","documentation","html","llm"],dependencies:{"@types/ws":"^8.18.1","fast-glob":"^3.3.3",figlet:"^1.9.4",libsql:"^0.5.22",marked:"^17.0.1",shiki:"^3.20.0",ws:"^8.18.3"},devDependencies:{"@biomejs/biome":"2.3.8","@types/bun":"latest","@types/figlet":"^1.7.0",husky:"^9.1.7",ultracite:"6.4.1"},peerDependencies:{typescript:"^5"}};import{randomUUID as Dl}from"node:crypto";import{existsSync as Wl,mkdirSync as Ml}from"node:fs";import{homedir as Ll}from"node:os";import{basename as rr,dirname as or,join as yt}from"node:path";var Rl=["node_modules",".git","dist","build","test-fixtures"],cr=(e)=>{if(typeof Bun<"u"&&globalThis.Bun){let{Database:t}=x("bun:sqlite");return new t(e)}return new(x("libsql"))(e)},ur=()=>{let n=process.env.XDG_DATA_HOME||yt(Ll(),".local","share"),t=yt(n,"llmd");if(!Wl(t))Ml(t,{recursive:!0});return yt(t,"llmd.db")},Ja=(e,n)=>{if(e===n)return!1;return(e.startsWith(n)?e.slice(n.length+1):e).split("/").filter(Boolean).some((i)=>Rl.includes(i))},Fn=()=>Dl(),mr=(e)=>{e.exec("PRAGMA foreign_keys = ON"),e.exec(`
1185
+ `);return a+i},y$=(e,n)=>{let{ensureExportsDirectory:t}=(va(),He(ka)),{writeFileSync:a}=x("node:fs"),i=t(),s=xn(i,n);return a(s,e,"utf-8"),s},Us=()=>{let{readdirSync:e,statSync:n}=x("node:fs"),t=Ks();if(!ja(t))return[];return e(t).filter((i)=>i.endsWith(".md")).map((i)=>{let s=xn(t,i),r=n(s),c=i.split("_"),o=c[0]||"",u=Number.parseInt(c[1]||"0",10),m=c.slice(2).join("_");return{path:s,size:r.size,mtime:r.mtimeMs,resourceId:o,timestamp:u,originalName:m}}).sort((i,s)=>s.mtime-i.mtime)},h$=(e)=>{let{readFileSync:n}=x("node:fs"),a=Us().find((s)=>s.originalName===e||s.resourceId===e||s.path===e);if(!a)return null;let i=n(a.path,"utf-8");return{...a,content:i}},_$=()=>{let{rmSync:e}=x("node:fs"),n=Us(),t=n.reduce((i,s)=>i+s.size,0),a=n.length;for(let i of n)e(i.path);return{deletedCount:a,freedBytes:t}};var pt=G(()=>{P_=/\.md$/,i$=/\s+/g});import{execSync as ul}from"child_process";import{existsSync as $$}from"fs";import{homedir as j$}from"os";import{join as ml}from"path";import{spawn as gl}from"node:child_process";var xa=(e)=>{let n=process.platform;try{let t,a;if(n==="darwin")t="open",a=[e];else if(n==="win32")t="cmd",a=["/c","start",e];else t="xdg-open",a=[e];gl(t,a,{detached:!0,stdio:"ignore"}).unref()}catch(t){console.error("Failed to open browser:",t)}};import{existsSync as id}from"node:fs";import{dirname as sd,isAbsolute as rd,resolve as od}from"node:path";var Ms={name:"llmd",version:"0.4.6",description:"Local markdown server for LLM-generated docs",author:"Phil Zona <phil.b.zona@gmail.com>",license:"MIT",repository:{type:"git",url:"https://github.com/pbzona/llmd.git"},homepage:"https://github.com/pbzona/llmd#readme",bugs:{url:"https://github.com/pbzona/llmd/issues"},type:"module",bin:{llmd:"./dist/llmd"},files:["dist/llmd","dist/client.js","LICENSE","README.md"],engines:{node:">=22",bun:">=1.2.2"},publishConfig:{access:"public"},scripts:{dev:"bun --hot index.ts",test:"bun test",build:"bash scripts/build.sh",prepublishOnly:"bun test && bun run build","check-contrast":"bun scripts/check-contrast.ts",format:"biome format --write .","format:check":"biome format .",lint:"biome lint .","lint:fix":"biome lint --write .",check:"biome check --write .",prepare:"husky"},keywords:["markdown","server","documentation","html","llm"],dependencies:{"@types/ws":"^8.18.1","fast-glob":"^3.3.3",figlet:"^1.9.4",libsql:"^0.5.22",marked:"^17.0.1",shiki:"^3.20.0",ws:"^8.18.3"},devDependencies:{"@biomejs/biome":"2.3.8","@types/bun":"latest","@types/figlet":"^1.7.0",husky:"^9.1.7",ultracite:"6.4.1"},peerDependencies:{typescript:"^5"}};import{randomUUID as Dl}from"node:crypto";import{existsSync as Wl,mkdirSync as Ml}from"node:fs";import{homedir as Ll}from"node:os";import{basename as rr,dirname as or,join as yt}from"node:path";var Rl=["node_modules",".git","dist","build","test-fixtures"],cr=(e)=>{if(typeof Bun<"u"&&globalThis.Bun){let{Database:t}=x("bun:sqlite");return new t(e)}return new(x("libsql"))(e)},ur=()=>{let n=process.env.XDG_DATA_HOME||yt(Ll(),".local","share"),t=yt(n,"llmd");if(!Wl(t))Ml(t,{recursive:!0});return yt(t,"llmd.db")},Ja=(e,n)=>{if(e===n)return!1;return(e.startsWith(n)?e.slice(n.length+1):e).split("/").filter(Boolean).some((i)=>Rl.includes(i))},Fn=()=>Dl(),mr=(e)=>{e.exec("PRAGMA foreign_keys = ON"),e.exec(`
1186
1186
  CREATE TABLE IF NOT EXISTS resources (
1187
1187
  id TEXT PRIMARY KEY,
1188
1188
  path TEXT UNIQUE NOT NULL,
@@ -1555,5 +1555,5 @@ Content Preview (first 500 characters):
1555
1555
  \u2717 Unknown error occurred
1556
1556
  `);process.exit(1)}};z$();
1557
1557
 
1558
- //# debugId=C36C6046939A1AC564756E2164756E21
1558
+ //# debugId=BE9FDA631A620EEA64756E2164756E21
1559
1559
  //# sourceMappingURL=llmd.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llmd",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Local markdown server for LLM-generated docs",
5
5
  "author": "Phil Zona <phil.b.zona@gmail.com>",
6
6
  "license": "MIT",