@visulima/ono 1.0.12 → 2.0.0-alpha.2

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## @visulima/ono [2.0.0-alpha.2](https://github.com/visulima/visulima/compare/@visulima/ono@2.0.0-alpha.1...@visulima/ono@2.0.0-alpha.2) (2025-12-11)
2
+
3
+ ### Bug Fixes
4
+
5
+ * update dependencies and improve error handling in error-debugging packages ([b95fea4](https://github.com/visulima/visulima/commit/b95fea4ef0e0a6777b3dd465603b1dd3c40aa4e8))
6
+
7
+ ## @visulima/ono [2.0.0-alpha.1](https://github.com/visulima/visulima/compare/@visulima/ono@1.0.12...@visulima/ono@2.0.0-alpha.1) (2025-12-07)
8
+
9
+ ### ⚠ BREAKING CHANGES
10
+
11
+ * change min node version to 22.13
12
+
13
+ ### Bug Fixes
14
+
15
+ * add new package image, fixed readme rendering on npm, fixed building of packages ([b790ba2](https://github.com/visulima/visulima/commit/b790ba253ea07fef83528fd822a678facf021b5f))
16
+ * update Node.js engine version requirement to >=22.13 in multiple package.json files for improved compatibility ([b828e9a](https://github.com/visulima/visulima/commit/b828e9aeaebfc798eecddccd90e6ec7560c6d36a))
17
+
18
+
19
+ ### Dependencies
20
+
21
+ * **@visulima/error:** upgraded to 6.0.0-alpha.1
22
+
1
23
  ## @visulima/ono [1.0.12](https://github.com/visulima/visulima/compare/@visulima/ono@1.0.11...@visulima/ono@1.0.12) (2025-11-13)
2
24
 
3
25
  ### Bug Fixes
package/README.md CHANGED
@@ -1,15 +1,24 @@
1
- <div align="center">
2
- <h3>Visulima ono (Oh No!)</h3>
3
- <p>
4
- A modern, delightful error overlay and inspector for Node.js servers and dev tooling.
5
- </p>
6
- </div>
1
+ <!-- START_PACKAGE_OG_IMAGE_PLACEHOLDER -->
2
+
3
+ <a href="https://www.anolilab.com/open-source" align="center">
4
+
5
+ <img src="__assets__/package-og.svg" alt="ono" />
6
+
7
+ </a>
8
+
9
+ <h3 align="center">Ono is an error-parsing library that pretty prints JavaScript errors on a web page or the terminal.</h3>
10
+
11
+ <!-- END_PACKAGE_OG_IMAGE_PLACEHOLDER -->
7
12
 
8
13
  <br />
9
14
 
10
15
  <div align="center">
11
16
 
12
- [![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url]
17
+ [![typescript-image][typescript-badge]][typescript-url]
18
+ [![mit licence][license-badge]][license]
19
+ [![npm downloads][npm-downloads-badge]][npm-downloads]
20
+ [![Chat][chat-badge]][chat]
21
+ [![PRs Welcome][prs-welcome-badge]][prs-welcome]
13
22
 
14
23
  </div>
15
24
 
@@ -605,13 +614,23 @@ If you would like to help take a look at the [list of issues](https://github.com
605
614
  - [Daniel Bannert](https://github.com/prisis)
606
615
  - [All Contributors](https://github.com/visulima/visulima/graphs/contributors)
607
616
 
617
+ ## Made with ❤️ at Anolilab
618
+
619
+ This is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Anolilab](https://www.anolilab.com/open-source) is a Development and AI Studio. Contact us at [hello@anolilab.com](mailto:hello@anolilab.com) if you need any help with these technologies or just want to say hi!
620
+
608
621
  ## License
609
622
 
610
- The visulima error is open-sourced software licensed under the [MIT][license-url]
623
+ The visulima error is open-sourced software licensed under the [MIT][license]
624
+
625
+ <!-- badges -->
611
626
 
612
- [typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
613
- [typescript-url]: "typescript"
614
- [license-image]: https://img.shields.io/npm/l/@visulima/ono?color=blueviolet&style=for-the-badge
615
- [license-url]: LICENSE.md "license"
616
- [npm-image]: https://img.shields.io/npm/v/@visulima/ono/latest.svg?style=for-the-badge&logo=npm
617
- [npm-url]: https://www.npmjs.com/package/@visulima/ono/v/latest "npm"
627
+ [license-badge]: https://img.shields.io/npm/l/@visulima/ono?style=for-the-badge
628
+ [license]: https://github.com/visulima/visulima/blob/main/LICENSE
629
+ [npm-downloads-badge]: https://img.shields.io/npm/dm/@visulima/ono?style=for-the-badge
630
+ [npm-downloads]: https://www.npmjs.com/package/@visulima/ono
631
+ [prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
632
+ [prs-welcome]: https://github.com/visulima/visulima/blob/main/.github/CONTRIBUTING.md
633
+ [chat-badge]: https://img.shields.io/discord/932323359193186354.svg?style=for-the-badge
634
+ [chat]: https://discord.gg/TtFJY8xkFK
635
+ [typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
636
+ [typescript-url]: https://www.typescriptlang.org/
@@ -1,3 +1,3 @@
1
- import Editors from "../../../../../../shared/utils/editors.d.ts";
1
+ import Editors from "../../../../../../../shared/utils/editors.d.ts";
2
2
  declare const editorSelector: (editor?: Editors) => string;
3
3
  export default editorSelector;
@@ -1,4 +1,4 @@
1
- import type Editors from "../../../../../../shared/utils/editors.d.ts";
1
+ import type Editors from "../../../../../../../shared/utils/editors.d.ts";
2
2
  import type { Theme } from "../../../types.d.ts";
3
3
  declare const headerBar: (options: Partial<{
4
4
  editor: Editors;
@@ -1,4 +1,4 @@
1
- var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0});import{a as P,s as G,n as X,e as W,c as de,g as le,d as ce}from"../../packem_shared/clipboard-CI3XgYla.js";const q="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-braces%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M8%203H7a2%202%200%200%200-2%202v5a2%202%200%200%201-2%202%202%202%200%200%201%202%202v5c0%201.1.9%202%202%202h1%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2021h1a2%202%200%200%200%202-2v-5c0-1.1.9-2%202-2a2%202%200%200%201-2-2V5a2%202%200%200%200-2-2h-1%22%20%2F%3E%20%3C%2Fsvg%3E",J="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-cookie%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M12%202a10%2010%200%201%200%2010%2010%204%204%200%200%201-5-5%204%204%200%200%201-5-5%22%20%2F%3E%20%3Cpath%20d%3D%22M8.5%208.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2015.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2012v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M11%2017v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M7%2014v.01%22%20%2F%3E%20%3C%2Fsvg%3E",S="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-file-text%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M6%2022a2%202%200%200%201-2-2V4a2%202%200%200%201%202-2h8a2.4%202.4%200%200%201%201.704.706l3.588%203.588A2.4%202.4%200%200%201%2020%208v12a2%202%200%200%201-2%202z%22%20%2F%3E%20%3Cpath%20d%3D%22M14%202v5a1%201%200%200%200%201%201h5%22%20%2F%3E%20%3Cpath%20d%3D%22M10%209H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2013H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2017H8%22%20%2F%3E%20%3C%2Fsvg%3E",I="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-globe%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M12%202a14.5%2014.5%200%200%200%200%2020%2014.5%2014.5%200%200%200%200-20%22%20%2F%3E%20%3Cpath%20d%3D%22M2%2012h20%22%20%2F%3E%20%3C%2Fsvg%3E",R="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-user%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M19%2021v-2a4%204%200%200%200-4-4H9a4%204%200%200%200-4%204v2%22%20%2F%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%227%22%20r%3D%224%22%20%2F%3E%20%3C%2Fsvg%3E";var ue=Object.defineProperty,ve=T((e,o)=>ue(e,"name",{value:o,configurable:!0}),"s$2");const O=ve(({label:e="Copy",successText:o="Copied!",targetId:r})=>{const c=P(r),h=P(e),x=G(e),l=G(o);return{html:`
1
+ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0});import{a as P,s as G,n as X,e as W,d as de,g as le,c as ce}from"../../packem_shared/clipboard-BS03XwiW.js";const q="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-braces%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M8%203H7a2%202%200%200%200-2%202v5a2%202%200%200%201-2%202%202%202%200%200%201%202%202v5c0%201.1.9%202%202%202h1%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2021h1a2%202%200%200%200%202-2v-5c0-1.1.9-2%202-2a2%202%200%200%201-2-2V5a2%202%200%200%200-2-2h-1%22%20%2F%3E%20%3C%2Fsvg%3E",J="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-cookie%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M12%202a10%2010%200%201%200%2010%2010%204%204%200%200%201-5-5%204%204%200%200%201-5-5%22%20%2F%3E%20%3Cpath%20d%3D%22M8.5%208.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2015.5v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2012v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M11%2017v.01%22%20%2F%3E%20%3Cpath%20d%3D%22M7%2014v.01%22%20%2F%3E%20%3C%2Fsvg%3E",S="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-file-text%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M6%2022a2%202%200%200%201-2-2V4a2%202%200%200%201%202-2h8a2.4%202.4%200%200%201%201.704.706l3.588%203.588A2.4%202.4%200%200%201%2020%208v12a2%202%200%200%201-2%202z%22%20%2F%3E%20%3Cpath%20d%3D%22M14%202v5a1%201%200%200%200%201%201h5%22%20%2F%3E%20%3Cpath%20d%3D%22M10%209H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2013H8%22%20%2F%3E%20%3Cpath%20d%3D%22M16%2017H8%22%20%2F%3E%20%3C%2Fsvg%3E",I="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-globe%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%20%2F%3E%20%3Cpath%20d%3D%22M12%202a14.5%2014.5%200%200%200%200%2020%2014.5%2014.5%200%200%200%200-20%22%20%2F%3E%20%3Cpath%20d%3D%22M2%2012h20%22%20%2F%3E%20%3C%2Fsvg%3E",R="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-user%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M19%2021v-2a4%204%200%200%200-4-4H9a4%204%200%200%200-4%204v2%22%20%2F%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%227%22%20r%3D%224%22%20%2F%3E%20%3C%2Fsvg%3E";var ue=Object.defineProperty,ve=T((e,o)=>ue(e,"name",{value:o,configurable:!0}),"s$2");const O=ve(({label:e="Copy",successText:o="Copied!",targetId:r})=>{const c=P(r),h=P(e),x=G(e),l=G(o);return{html:`
2
2
  <button
3
3
  type="button"
4
4
  aria-label="${h}"
@@ -11,21 +11,21 @@ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0})
11
11
  <span class="ono-copy-success dui hidden size-4 text-[var(--ono-red-orange)]" style="-webkit-mask-image: url('${W}'); mask-image: url('${W}')"></span>
12
12
  <span class="sr-only">${x}</span>
13
13
  </button>
14
- `}},"copyButton");var pe=Object.defineProperty,j=T((e,o)=>pe(e,"name",{value:o,configurable:!0}),"s$1");const xe=typeof globalThis<"u"&&"Request"in globalThis,Z=j((e,o)=>o in e,"hasProperty"),V=j((e,o)=>Z(e,o)&&typeof e[o]=="function","hasMethod"),ee=j((e,o)=>Z(e,o)&&typeof e[o]=="string","hasStringProperty"),me=j(e=>xe&&V(e,"clone"),"isNativeRequest"),be=j(e=>V(e,"on")&&ee(e,"method"),"isIncomingMessage");j(e=>!me(e)&&!be(e)&&ee(e,"method"),"isExpressRequest");const L=j(e=>typeof e=="object"&&e!==null&&V(e,"forEach")&&V(e,"get"),"isHeadersObject");var ge=Object.defineProperty,a=T((e,o)=>ge(e,"name",{value:o,configurable:!0}),"s");const he=[/authorization/i,/cookie/i,/set-cookie/i,/x-api-key/i,/api-key/i,/x-auth/i,/token/i,/secret/i],H=a((e,o)=>{if(typeof e=="object"&&e!==null&&o in e)return e[o]},"safeGetProperty"),p=a((e,o)=>{const r=H(e,o);return typeof r=="function"?r:void 0},"safeGetMethod"),A=a((e,o)=>{const r=H(e,o);return typeof r=="string"?r:void 0},"safeGetString"),fe=a((e,o)=>o&&o.some(r=>r.toLowerCase()===e.toLowerCase())?!0:he.some(r=>r.test(e)),"isSensitiveHeader"),ye=a(e=>{if(!e)return[];if(L(e)){const o=p(e,"entries");if(o)return[...o()].map(([r,c])=>[r,c])}return Object.entries(e)},"normalizeHeadersToEntries"),we=a((e,o)=>!o||o.length===0?!0:o.some(r=>r.toLowerCase()===e.toLowerCase()),"shouldIncludeHeader"),$e=a((e,o)=>!e||!o?e:Array.isArray(e)?e.map(()=>o):o,"maskHeaderValue"),ke=a((e,o,r,c="[masked]")=>{const h=ye(e);if(h.length===0)return;const x={};for(const[l,s]of h){if(!we(l,o)||s===void 0)continue;const m=fe(l.toLowerCase(),r)?c:void 0;x[l]=$e(s,m)}return x},"filterHeaders"),Y=a(e=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},"safeJsonStringify"),De=a(e=>{if(!e)return{};const o={};return e.split(";").map(r=>r.trim()).filter(Boolean).forEach(r=>{const c=r.indexOf("=");if(c===-1)return;const h=r.slice(0,c).trim(),x=r.slice(c+1).trim();o[h]=x}),o},"parseCookieString"),Ce=a(async(e,o)=>{try{const r=String(A(e,"method")||"GET").toUpperCase();if(r==="GET"||r==="HEAD")return;const c=H(e,"headers"),h=L(c)?p(c,"get")?.("content-type")||"":String(c?.["content-type"]||""),x=p(e,"clone"),l=x?x():e;if(p(l,"json")&&String(h).includes("application/json"))try{const s=p(l,"json");return s?await s():void 0}catch{try{const s=p(l,"text");return s?await s()||"":void 0}catch{return}}if(p(l,"text"))try{const s=p(l,"text");return s?await s():void 0}catch{return}return p(e,"on")?await new Promise(s=>{try{let m="",N=!1;const C=p(e,"setEncoding");C&&C("utf8");const k=a(y=>{if(N)return;const M=typeof y=="string"?y:String(y);if(m.length+M.length>o){const D=Math.max(0,o-m.length);m+=M.slice(0,D),N=!0,b(),s(`${m}
15
- … [truncated]`);return}m+=M},"onData"),E=a(()=>{b(),s(m||void 0)},"onEnd"),B=a(()=>{b(),s(void 0)},"onError"),b=a(()=>{const y=p(e,"off");y?.("data",k),y?.("end",E),y?.("error",B)},"cleanup"),F=p(e,"on");F?.("data",k),F?.("end",E),F?.("error",B)}catch{s(void 0)}}):void 0}catch{return}},"readRequestBody"),Fe=a(async(e,o)=>{const r=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`,{headerAllowlist:c,headerDenylist:h,maskValue:x="[masked]"}=o||{},l=ke(H(e,"headers"),c,h,x),s=a(t=>{if(t!==void 0)return Array.isArray(t)?t.join(", "):t},"toSingle"),m=a(t=>`'${String(t).replaceAll("'",String.raw`'\''`)}'`,"shellQuote"),N=a(t=>{if(!t)return;const n=[];for(const[i,d]of Object.entries(t)){const g=s(d)??"";n.push(`${i}=${g}`)}return n.length>0?n.join("; "):void 0},"buildCookieHeader");let C;const k=H(e,"headers");if(L(k)){const t=p(k,"get")?.("cookie");C=typeof t=="string"?t:void 0}else if(Array.isArray(k?.cookie))C=k?.cookie?.[0];else{const t=k?.cookie;C=typeof t=="string"?t:void 0}const E=De(C),B=Math.max(0,Number(o?.previewBytes??64e3)),b=await Ce(e,B),F=a(()=>{const t=String(A(e,"method")||"GET").toUpperCase(),n=String(A(e,"url")||""),i=[],d={};if(l)for(const[w,$]of Object.entries(l)){const Q=s($);Q!==void 0&&(d[w]=Q)}const g=N(E);g&&!d.cookie&&(d.Cookie=g);for(const[w,$]of Object.entries(d))i.push(`-H ${m(`${w}: ${$}`)}`);let v="";if(e&&b!==void 0&&b!==null&&t!=="GET"){const w=typeof b=="string"?b:Y(b);v=`--data ${m(w)}`}const u=["curl","-X",t];return i.length>0&&u.push("\\",` ${i.join(` \\
16
- `)}`),v&&u.push("\\",` ${v}`),u.push("\\",` ${m(n)}`),u.join(" ")},"buildCurl")(),y=await(await de()).codeToHtml(F,{lang:"bash",themes:{dark:"github-dark-default",light:"github-light"}}),M=le(y),D=a(t=>P(t),"attributeEscape"),f=a(t=>G(t),"escapeHtml"),U=a(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([n,i])=>{const d=Array.isArray(i)?i.join(", "):i;return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
14
+ `}},"copyButton");var pe=Object.defineProperty,j=T((e,o)=>pe(e,"name",{value:o,configurable:!0}),"s$1");const xe=typeof globalThis<"u"&&"Request"in globalThis,Z=j((e,o)=>o in e,"hasProperty"),V=j((e,o)=>Z(e,o)&&typeof e[o]=="function","hasMethod"),ee=j((e,o)=>Z(e,o)&&typeof e[o]=="string","hasStringProperty"),me=j(e=>xe&&V(e,"clone"),"isNativeRequest"),be=j(e=>V(e,"on")&&ee(e,"method"),"isIncomingMessage");j(e=>!me(e)&&!be(e)&&ee(e,"method"),"isExpressRequest");const L=j(e=>typeof e=="object"&&e!==null&&V(e,"forEach")&&V(e,"get"),"isHeadersObject");var ge=Object.defineProperty,s=T((e,o)=>ge(e,"name",{value:o,configurable:!0}),"s");const he=[/authorization/i,/cookie/i,/set-cookie/i,/x-api-key/i,/api-key/i,/x-auth/i,/token/i,/secret/i],H=s((e,o)=>{if(typeof e=="object"&&e!==null&&o in e)return e[o]},"safeGetProperty"),p=s((e,o)=>{const r=H(e,o);return typeof r=="function"?r:void 0},"safeGetMethod"),A=s((e,o)=>{const r=H(e,o);return typeof r=="string"?r:void 0},"safeGetString"),fe=s((e,o)=>o&&o.some(r=>r.toLowerCase()===e.toLowerCase())?!0:he.some(r=>r.test(e)),"isSensitiveHeader"),ye=s(e=>{if(!e)return[];if(L(e)){const o=p(e,"entries");if(o)return[...o()].map(([r,c])=>[r,c])}return Object.entries(e)},"normalizeHeadersToEntries"),we=s((e,o)=>!o||o.length===0?!0:o.some(r=>r.toLowerCase()===e.toLowerCase()),"shouldIncludeHeader"),$e=s((e,o)=>!e||!o?e:Array.isArray(e)?e.map(()=>o):o,"maskHeaderValue"),ke=s((e,o,r,c="[masked]")=>{const h=ye(e);if(h.length===0)return;const x={};for(const[l,a]of h){if(!we(l,o)||a===void 0)continue;const m=fe(l.toLowerCase(),r)?c:void 0;x[l]=$e(a,m)}return x},"filterHeaders"),Y=s(e=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},"safeJsonStringify"),De=s(e=>{if(!e)return{};const o={};return e.split(";").map(r=>r.trim()).filter(Boolean).forEach(r=>{const c=r.indexOf("=");if(c===-1)return;const h=r.slice(0,c).trim(),x=r.slice(c+1).trim();o[h]=x}),o},"parseCookieString"),Ce=s(async(e,o)=>{try{const r=String(A(e,"method")||"GET").toUpperCase();if(r==="GET"||r==="HEAD")return;const c=H(e,"headers"),h=L(c)?p(c,"get")?.("content-type")||"":String(c?.["content-type"]||""),x=p(e,"clone"),l=x?x():e;if(p(l,"json")&&String(h).includes("application/json"))try{const a=p(l,"json");return a?await a():void 0}catch{try{const a=p(l,"text");return a?await a()||"":void 0}catch{return}}if(p(l,"text"))try{const a=p(l,"text");return a?await a():void 0}catch{return}return p(e,"on")?await new Promise(a=>{try{let m="",N=!1;const C=p(e,"setEncoding");C&&C("utf8");const k=s(y=>{if(N)return;const M=typeof y=="string"?y:String(y);if(m.length+M.length>o){const D=Math.max(0,o-m.length);m+=M.slice(0,D),N=!0,b(),a(`${m}
15
+ … [truncated]`);return}m+=M},"onData"),E=s(()=>{b(),a(m||void 0)},"onEnd"),B=s(()=>{b(),a(void 0)},"onError"),b=s(()=>{const y=p(e,"off");y?.("data",k),y?.("end",E),y?.("error",B)},"cleanup"),F=p(e,"on");F?.("data",k),F?.("end",E),F?.("error",B)}catch{a(void 0)}}):void 0}catch{return}},"readRequestBody"),Fe=s(async(e,o)=>{const r=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`,{headerAllowlist:c,headerDenylist:h,maskValue:x="[masked]"}=o||{},l=ke(H(e,"headers"),c,h,x),a=s(t=>{if(t!==void 0)return Array.isArray(t)?t.join(", "):t},"toSingle"),m=s(t=>`'${String(t).replaceAll("'",String.raw`'\''`)}'`,"shellQuote"),N=s(t=>{if(!t)return;const n=[];for(const[i,d]of Object.entries(t)){const g=a(d)??"";n.push(`${i}=${g}`)}return n.length>0?n.join("; "):void 0},"buildCookieHeader");let C;const k=H(e,"headers");if(L(k)){const t=p(k,"get")?.("cookie");C=typeof t=="string"?t:void 0}else if(Array.isArray(k?.cookie))C=k?.cookie?.[0];else{const t=k?.cookie;C=typeof t=="string"?t:void 0}const E=De(C),B=Math.max(0,Number(o?.previewBytes??64e3)),b=await Ce(e,B),F=s(()=>{const t=String(A(e,"method")||"GET").toUpperCase(),n=String(A(e,"url")||""),i=[],d={};if(l)for(const[w,$]of Object.entries(l)){const Q=a($);Q!==void 0&&(d[w]=Q)}const g=N(E);g&&!d.cookie&&(d.Cookie=g);for(const[w,$]of Object.entries(d))i.push(`-H ${m(`${w}: ${$}`)}`);let v="";if(e&&b!==void 0&&b!==null&&t!=="GET"){const w=typeof b=="string"?b:Y(b);v=`--data ${m(w)}`}const u=["curl","-X",t];return i.length>0&&u.push("\\",` ${i.join(` \\
16
+ `)}`),v&&u.push("\\",` ${v}`),u.push("\\",` ${m(n)}`),u.join(" ")},"buildCurl")(),y=(await de(["bash"])).codeToHtml(F,{lang:"bash",themes:{dark:"github-dark-default",light:"github-light"}}),M=le(y),D=s(t=>P(t),"attributeEscape"),f=s(t=>G(t),"escapeHtml"),U=s(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([n,i])=>{const d=Array.isArray(i)?i.join(", "):i;return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
17
17
  <div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${f(n)}</div>
18
18
  <div class="text-sm break-words whitespace-pre-wrap text-[var(--ono-text)]">${f(String(d))}</div>
19
- </div>`}).join("")}</div>`,"renderKeyValueTable"),te=a(t=>`<span class="text-[var(--ono-red-orange)]">${typeof t=="string"?`"${f(t)}"`:String(t)}</span>`,"renderPrimitiveValue"),oe=a(t=>`<span class="italic text-[var(--ono-text-muted)]">${t===null?"null":"undefined"}</span>`,"renderNullishValue"),re=a((t,n)=>{if(Object.keys(t).length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty object)</span>';if(n>=3)return`<span class="italic text-[var(--ono-text-muted)]">{Object with ${Object.keys(t).length} keys}</span>`;const i=Object.entries(t).slice(0,10).map(([g,v])=>{const u=z(v,n+1);return`
19
+ </div>`}).join("")}</div>`,"renderKeyValueTable"),te=s(t=>`<span class="text-[var(--ono-red-orange)]">${typeof t=="string"?`"${f(t)}"`:String(t)}</span>`,"renderPrimitiveValue"),oe=s(t=>`<span class="italic text-[var(--ono-text-muted)]">${t===null?"null":"undefined"}</span>`,"renderNullishValue"),re=s((t,n)=>{if(Object.keys(t).length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty object)</span>';if(n>=3)return`<span class="italic text-[var(--ono-text-muted)]">{Object with ${Object.keys(t).length} keys}</span>`;const i=Object.entries(t).slice(0,10).map(([g,v])=>{const u=z(v,n+1);return`
20
20
  <div class="ml-4 pl-3 py-1 border-l-2 border-[var(--ono-border)]">
21
21
  <span class="font-medium text-[var(--ono-text)]">${f(g)}:</span> ${u}
22
- </div>`}).join(""),d=Object.keys(t).length>10?`<div class="ml-4 italic text-[var(--ono-text-muted)]">... and ${Object.keys(t).length-10} more keys</div>`:"";return`<div class="space-y-1">${i}${d}</div>`},"renderObjectValue"),z=a((t,n=0)=>{if(t==null)return oe(t);if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return te(t);if(Array.isArray(t)){if(t.length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty array)</span>';if(n>=3)return`<span class="italic text-[var(--ono-text-muted)]">[Array with ${t.length} items]</span>`;const i=t.slice(0,10).map((g,v)=>{const u=z(g,n+1);return`
22
+ </div>`}).join(""),d=Object.keys(t).length>10?`<div class="ml-4 italic text-[var(--ono-text-muted)]">... and ${Object.keys(t).length-10} more keys</div>`:"";return`<div class="space-y-1">${i}${d}</div>`},"renderObjectValue"),z=s((t,n=0)=>{if(t==null)return oe(t);if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return te(t);if(Array.isArray(t)){if(t.length===0)return'<span class="italic text-[var(--ono-text-muted)]">(empty array)</span>';if(n>=3)return`<span class="italic text-[var(--ono-text-muted)]">[Array with ${t.length} items]</span>`;const i=t.slice(0,10).map((g,v)=>{const u=z(g,n+1);return`
23
23
  <div class="ml-4 pl-3 py-1 border-l-2 border-[var(--ono-border)]">
24
24
  <span class="text-xs text-[var(--ono-text-muted)]">[${v}]:</span> ${u}
25
- </div>`}).join(""),d=t.length>10?`<div class="ml-4 text-sm italic text-[var(--ono-text-muted)]">... and ${t.length-10} more items</div>`:"";return`<div class="space-y-1">${i}${d}</div>`}return typeof t=="object"?re(t,n):`<span class="text-[var(--ono-text)]">${f(String(t))}</span>`},"renderValue"),_=a(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([n,i])=>{const d=z(i);return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
25
+ </div>`}).join(""),d=t.length>10?`<div class="ml-4 text-sm italic text-[var(--ono-text-muted)]">... and ${t.length-10} more items</div>`:"";return`<div class="space-y-1">${i}${d}</div>`}return typeof t=="object"?re(t,n):`<span class="text-[var(--ono-text)]">${f(String(t))}</span>`},"renderValue"),_=s(t=>!t||Object.keys(t).length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty)</div>':`<div class="px-4 pb-4">${Object.entries(t).map(([n,i])=>{const d=z(i);return`<div class="grid grid-cols-[200px_1fr] gap-3 items-start py-2 border-b border-[var(--ono-border)]">
26
26
  <div class="text-[11px] uppercase tracking-wide text-[var(--ono-text-muted)]">${f(n)}</div>
27
27
  <div class="text-sm break-words text-[var(--ono-text)]">${d}</div>
28
- </div>`}).join("")}</div>`,"renderObjectTable"),ae=a(t=>t==null?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(no body)</div>':typeof t=="string"?t.trim()===""?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty string)</div>':`<div class="px-4 pb-4">
28
+ </div>`}).join("")}</div>`,"renderObjectTable"),se=s(t=>t==null?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(no body)</div>':typeof t=="string"?t.trim()===""?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty string)</div>':`<div class="px-4 pb-4">
29
29
  <div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${f(t)}</div>
30
30
  </div>`:typeof t=="object"?Array.isArray(t)?t.length===0?'<div class="px-4 pb-4 pt-2 text-xs text-[var(--ono-text-muted)]">(empty array)</div>':`<div class="px-4 pb-4">
31
31
  <div class="text-sm break-words p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${z(t)}</div>
@@ -33,7 +33,7 @@ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0})
33
33
  <div class="text-sm break-words p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${z(t)}</div>
34
34
  </div>`:`<div class="px-4 pb-4">
35
35
  <div class="text-sm break-words whitespace-pre-wrap font-mono p-3 rounded border border-[var(--ono-border)] bg-[var(--ono-surface-muted)] text-[var(--ono-text)]">${f(String(t))}</div>
36
- </div>`,"renderBodyContent"),K=a(t=>{if(!t)return{content:"",sidebar:""};const n=new Set(["request"]),i=Object.keys(t).filter(v=>!n.has(v));if(i.length===0)return{content:"",sidebar:""};let d="",g="";return i.forEach(v=>{const u=t[v];if(u&&typeof u=="object"&&(Array.isArray(u)||Object.keys(u).length>0)){const w=v.charAt(0).toUpperCase()+v.slice(1),$=`context-${v}`;d+=`
36
+ </div>`,"renderBodyContent"),K=s(t=>{if(!t)return{content:"",sidebar:""};const n=new Set(["request"]),i=Object.keys(t).filter(v=>!n.has(v));if(i.length===0)return{content:"",sidebar:""};let d="",g="";return i.forEach(v=>{const u=t[v];if(u&&typeof u=="object"&&(Array.isArray(u)||Object.keys(u).length>0)){const w=v.charAt(0).toUpperCase()+v.slice(1),$=`context-${v}`;d+=`
37
37
  <div>
38
38
  <div class="text-[11px] uppercase tracking-wide mb-2 text-[var(--ono-text-muted)]">${w}</div>
39
39
  <ul class="space-y-1 text-sm">
@@ -54,7 +54,7 @@ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0})
54
54
  ${O({label:"Copy JSON",targetId:`clipboard-${$}-${r}`}).html}
55
55
  </div>
56
56
  <div class="max-w-full overflow-auto mt-2">${_(u)}</div>
57
- </section>`}}),{content:g,sidebar:d}},"generateContextSections")(o.context),se=`
57
+ </section>`}}),{content:g,sidebar:d}},"generateContextSections")(o.context),ae=`
58
58
  <aside class="shrink-0 w-64 sticky top-4 self-start">
59
59
  <nav aria-label="Context sections" class="p-3 rounded-[var(--ono-radius-md)] shadow-[var(--ono-elevation-1)] space-y-4 overflow-auto bg-[var(--ono-surface)] border border-[var(--ono-border)] max-h-[calc(100dvh-2rem)]">
60
60
  <div>
@@ -129,7 +129,7 @@ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0})
129
129
  <a href="#context-body" class="text-xs text-[var(--ono-text-muted)]" aria-label="Anchor">#</a>
130
130
  ${O({label:"Copy JSON",targetId:`clipboard-body-${r}`}).html}
131
131
  </div>
132
- <div class="max-w-full overflow-auto mt-2">${ae(b)}</div>
132
+ <div class="max-w-full overflow-auto mt-2">${se(b)}</div>
133
133
  </section>
134
134
 
135
135
  <input type="hidden" id="clipboard-session-${r}" value="${D(JSON.stringify(e?.session??{}))}">
@@ -158,6 +158,6 @@ var ie=Object.defineProperty;var T=(e,o)=>ie(e,"name",{value:o,configurable:!0})
158
158
  </section>${K.content}
159
159
  </div>`;return{code:{html:`
160
160
  <div class="w-full flex gap-4 relative">
161
- ${se}
161
+ ${ae}
162
162
  ${ne}
163
163
  </div>`,script:""},id:"context",name:"Context"}},"createRequestContext");export{Fe as default};
@@ -1,4 +1,4 @@
1
- import type Editors from "../../../../shared/utils/editors.d.ts";
1
+ import type Editors from "../../../../../shared/utils/editors.d.ts";
2
2
  import type { Theme } from "../types.d.ts";
3
3
  export type RequestTimings = {
4
4
  elapsedMs?: number;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { SolutionFinder } from "@visulima/error/solution";
2
- import type { BaseCliOptions } from "../../../shared/utils/cli-error-builder.d.ts";
2
+ import type { BaseCliOptions } from "../../../../shared/utils/cli-error-builder.d.ts";
3
3
  import type { TemplateOptions as BaseTemplateOptions } from "./error-inspector/types.d.ts";
4
4
  export type TemplateOptions = BaseTemplateOptions & {
5
5
  solutionFinders?: SolutionFinder[];