@skybridge/devtools 0.0.0-dev.61fde9b → 0.0.0-dev.6366f6d
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.
|
@@ -180,4 +180,4 @@ Error generating stack: `+u.message+`
|
|
|
180
180
|
${i}
|
|
181
181
|
await waitForOpenAI();
|
|
182
182
|
${r.textContent}
|
|
183
|
-
`,t.head.innerHTML+t.body.innerHTML}const m2e=()=>{const e=Vh(),{openaiObject:t}=um(e.name),{data:r}=Rte(e._meta?.["openai/outputTemplate"]),{setToolData:i,pushOpenAiLog:o,updateOpenaiObject:l}=lm(),c=j.useRef(null),f=j.useRef(null),d=j.useRef(!1),h=r.contents[0].text,m=j.useCallback(()=>{if(d.current)return;const y=c.current;if(!y||!y.contentWindow||!y.contentDocument)return;d.current=!0,h2e(y.contentWindow,t,(b,T)=>{o(e.name,{timestamp:Date.now(),command:b,args:T})},(b,T)=>{l(e.name,b,T)}),y.contentDocument.open(),y.contentDocument.write(p2e(h)),y.contentDocument.close();const v=y.contentDocument;new ResizeObserver(()=>{y.style.height=`${v.documentElement.scrollHeight}px`}).observe(v.body),i(e.name,{openaiRef:c})},[t,o,i,l,e.name,h]);return j.useEffect(()=>{m()},[m]),N.jsx("div",{ref:f,className:"relative overflow-auto",style:{width:"100%"},children:N.jsx("iframe",{ref:c,src:"about:blank",onLoad:m,style:{width:"100%",border:"none",display:"block",maxHeight:"300px"},sandbox:"allow-scripts allow-same-origin",title:"html-preview"})})},g2e=()=>{const e=Vh(),t=um(e.name),{defaultLayout:r,onLayoutChange:i}=yk({id:"skybridge-devtools-input-column",storage:localStorage}),o=!!(e._meta?.["openai/outputTemplate"]&&t?.response&&!t.response.isError);return N.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative z-10",children:[N.jsxs(gO,{orientation:"horizontal",className:"flex-1 overflow-hidden border-b border-border",defaultLayout:r,onLayoutChange:i,children:[N.jsx(kv,{id:"input-column",minSize:"20",maxSize:"60",children:N.jsx("div",{className:"flex flex-col overflow-hidden h-full",children:N.jsx(Uye,{})})}),N.jsx(vO,{className:"w-px bg-border"}),N.jsx(kv,{id:"output-column",minSize:"30",children:N.jsx("div",{className:"flex flex-col overflow-hidden h-full",children:N.jsx(OSe,{})})})]}),o&&N.jsxs("div",{className:"flex overflow-hidden bg-card relative h-[60%]",children:[N.jsxs("div",{className:"flex flex-col flex-1 h-full overflow-hidden bg-card border-r border-border",children:[N.jsx("div",{className:"border-b border-border",children:N.jsx(j.Suspense,{children:N.jsx(m2e,{})})}),N.jsx("div",{className:"p-4 flex flex-col h-full min-h-0",children:N.jsx(_Se,{})})]}),N.jsx("div",{className:"flex flex-col overflow-hidden w-[400px] flex-none min-h-0",children:N.jsx("div",{className:"overflow-auto",children:N.jsx(bSe,{})})})]})]})};function y2e(){const e=qz(),[,t]=PO(),r=gA();return N.jsx("div",{className:"h-full border-r border-border bg-card flex flex-col",children:N.jsxs("aside",{className:"h-full flex flex-col",children:[N.jsxs("div",{className:"p-4 border-b border-border h-[72px] flex flex-col justify-center",children:[N.jsx("h2",{className:"text-sm font-semibold text-foreground mb-1",children:"Tools"}),N.jsxs("p",{className:"text-xs text-muted-foreground",children:[e?.length," ",e?.length===1?"tool":"tools"]})]}),N.jsx("div",{className:"flex-1 overflow-y-auto",children:N.jsx("div",{className:"p-2",children:e?.length===0?N.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No tools available"}):N.jsx("div",{className:"space-y-1",children:e?.map(i=>{const o=i.name===r?.name;return N.jsxs("button",{type:"button",onClick:()=>t(i.name),className:Qn("w-full text-left px-3 py-3 rounded-md transition-colors cursor-pointer relative","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1",o&&"bg-accent text-accent-foreground"),children:[N.jsxs("div",{className:"pr-6 flex flex-col gap-1",children:[N.jsx("div",{className:Qn("font-semibold text-sm leading-tight truncate",o&&"text-accent-foreground"),children:i.name}),i.description&&N.jsx("div",{className:Qn("text-xs leading-snug text-muted-foreground","line-clamp-2",o&&"text-accent-foreground/80"),children:i.description})]}),o&&N.jsx("div",{className:"absolute top-3 right-3 w-1.5 h-1.5 rounded-full bg-primary"})]},i.name)})})})})]})})}function v2e(){const e=gA(),{defaultLayout:t,onLayoutChange:r}=yk({id:"skybridge-devtools-tools-list",storage:localStorage});return N.jsxs("div",{className:"flex h-screen w-full flex-col overflow-hidden bg-background",children:[N.jsx(Ere,{}),N.jsxs(gO,{orientation:"horizontal",className:"flex-1 overflow-hidden",defaultLayout:t,onLayoutChange:r,children:[N.jsx(kv,{id:"tools-list",minSize:"15",maxSize:"40",children:N.jsx(y2e,{})}),N.jsx(vO,{className:"w-px bg-border"}),N.jsx(kv,{id:"main-content",minSize:"30",children:N.jsx("div",{className:"flex flex-1 flex-col overflow-hidden relative h-full",children:e?N.jsx(g2e,{}):N.jsx(tle,{})})})]})]})}const b2e=new UI;function S2e(){return N.jsx(II,{client:b2e,children:N.jsx(wL,{children:N.jsx(v2e,{})})})}pI.createRoot(document.getElementById("root")).render(N.jsx(j.StrictMode,{children:N.jsx(S2e,{})}))});export default w2e();
|
|
183
|
+
`,t.head.innerHTML+t.body.innerHTML}const m2e=()=>{const e=Vh(),{openaiObject:t}=um(e.name),{data:r}=Rte(e._meta?.["openai/outputTemplate"]),{setToolData:i,pushOpenAiLog:o,updateOpenaiObject:l}=lm(),c=j.useRef(null),f=j.useRef(null),d=j.useRef(!1),h=r.contents[0].text,m=j.useCallback(()=>{if(d.current)return;const y=c.current;if(!y||!y.contentWindow||!y.contentDocument)return;d.current=!0,h2e(y.contentWindow,t,(b,T)=>{o(e.name,{timestamp:Date.now(),command:b,args:T})},(b,T)=>{l(e.name,b,T)}),y.contentDocument.open(),y.contentDocument.write(p2e(h)),y.contentDocument.close();const v=y.contentDocument;new ResizeObserver(()=>{y.style.height=`${v.documentElement.scrollHeight}px`}).observe(v.body),i(e.name,{openaiRef:c})},[t,o,i,l,e.name,h]);return j.useEffect(()=>{const y=c.current;if(!y)return;const v=()=>m();return y.addEventListener("load",v),()=>y.removeEventListener("load",v)},[m]),N.jsx("div",{ref:f,className:"relative overflow-auto",style:{width:"100%"},children:N.jsx("iframe",{ref:c,src:"about:blank",onLoad:m,style:{width:"100%",border:"none",display:"block",maxHeight:"300px"},sandbox:"allow-scripts allow-same-origin",title:"html-preview"})})},g2e=()=>{const e=Vh(),t=um(e.name),{defaultLayout:r,onLayoutChange:i}=yk({id:"skybridge-devtools-input-column",storage:localStorage}),o=!!(e._meta?.["openai/outputTemplate"]&&t?.response&&!t.response.isError);return N.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden relative z-10",children:[N.jsxs(gO,{orientation:"horizontal",className:"flex-1 overflow-hidden border-b border-border",defaultLayout:r,onLayoutChange:i,children:[N.jsx(kv,{id:"input-column",minSize:"20",maxSize:"60",children:N.jsx("div",{className:"flex flex-col overflow-hidden h-full",children:N.jsx(Uye,{})})}),N.jsx(vO,{className:"w-px bg-border"}),N.jsx(kv,{id:"output-column",minSize:"30",children:N.jsx("div",{className:"flex flex-col overflow-hidden h-full",children:N.jsx(OSe,{})})})]}),o&&N.jsxs("div",{className:"flex overflow-hidden bg-card relative h-[60%]",children:[N.jsxs("div",{className:"flex flex-col flex-1 h-full overflow-hidden bg-card border-r border-border",children:[N.jsx("div",{className:"border-b border-border",children:N.jsx(j.Suspense,{children:N.jsx(m2e,{})})}),N.jsx("div",{className:"p-4 flex flex-col h-full min-h-0",children:N.jsx(_Se,{})})]}),N.jsx("div",{className:"flex flex-col overflow-hidden w-[400px] flex-none min-h-0",children:N.jsx("div",{className:"overflow-auto",children:N.jsx(bSe,{})})})]})]})};function y2e(){const e=qz(),[,t]=PO(),r=gA();return N.jsx("div",{className:"h-full border-r border-border bg-card flex flex-col",children:N.jsxs("aside",{className:"h-full flex flex-col",children:[N.jsxs("div",{className:"p-4 border-b border-border h-[72px] flex flex-col justify-center",children:[N.jsx("h2",{className:"text-sm font-semibold text-foreground mb-1",children:"Tools"}),N.jsxs("p",{className:"text-xs text-muted-foreground",children:[e?.length," ",e?.length===1?"tool":"tools"]})]}),N.jsx("div",{className:"flex-1 overflow-y-auto",children:N.jsx("div",{className:"p-2",children:e?.length===0?N.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No tools available"}):N.jsx("div",{className:"space-y-1",children:e?.map(i=>{const o=i.name===r?.name;return N.jsxs("button",{type:"button",onClick:()=>t(i.name),className:Qn("w-full text-left px-3 py-3 rounded-md transition-colors cursor-pointer relative","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1",o&&"bg-accent text-accent-foreground"),children:[N.jsxs("div",{className:"pr-6 flex flex-col gap-1",children:[N.jsx("div",{className:Qn("font-semibold text-sm leading-tight truncate",o&&"text-accent-foreground"),children:i.name}),i.description&&N.jsx("div",{className:Qn("text-xs leading-snug text-muted-foreground","line-clamp-2",o&&"text-accent-foreground/80"),children:i.description})]}),o&&N.jsx("div",{className:"absolute top-3 right-3 w-1.5 h-1.5 rounded-full bg-primary"})]},i.name)})})})})]})})}function v2e(){const e=gA(),{defaultLayout:t,onLayoutChange:r}=yk({id:"skybridge-devtools-tools-list",storage:localStorage});return N.jsxs("div",{className:"flex h-screen w-full flex-col overflow-hidden bg-background",children:[N.jsx(Ere,{}),N.jsxs(gO,{orientation:"horizontal",className:"flex-1 overflow-hidden",defaultLayout:t,onLayoutChange:r,children:[N.jsx(kv,{id:"tools-list",minSize:"15",maxSize:"40",children:N.jsx(y2e,{})}),N.jsx(vO,{className:"w-px bg-border"}),N.jsx(kv,{id:"main-content",minSize:"30",children:N.jsx("div",{className:"flex flex-1 flex-col overflow-hidden relative h-full",children:e?N.jsx(g2e,{}):N.jsx(tle,{})})})]})]})}const b2e=new UI;function S2e(){return N.jsx(II,{client:b2e,children:N.jsx(wL,{children:N.jsx(v2e,{})})})}pI.createRoot(document.getElementById("root")).render(N.jsx(j.StrictMode,{children:N.jsx(S2e,{})}))});export default w2e();
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Skybridge MCP devtools</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BA6xHqpN.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-Cy1bGKlJ.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skybridge/devtools",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.6366f6d",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"tailwindcss-animate": "^1.0.7",
|
|
38
38
|
"tw-animate-css": "^1.4.0",
|
|
39
39
|
"zustand": "^5.0.9",
|
|
40
|
-
"skybridge": "0.0.0-dev.
|
|
40
|
+
"skybridge": "0.0.0-dev.6366f6d"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@eslint/js": "^9.39.2",
|