@tonyclaw/agent-inspector 2.0.39 → 2.0.41
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/.output/nitro.json +1 -1
- package/.output/public/assets/CompareDrawer-DCg6S2cl.js +1 -0
- package/.output/public/assets/ProxyViewerContainer-DsU6QETm.js +115 -0
- package/.output/public/assets/{ReplayDialog-B58TbTtY.js → ReplayDialog-ClVgjSDE.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-d4P6JNiP.js → RequestAnatomy-BhqvLQp9.js} +1 -1
- package/.output/public/assets/ResponseView-BZAJoK6B.js +1 -0
- package/.output/public/assets/StreamingChunkSequence-CaORmoKX.js +1 -0
- package/.output/public/assets/_sessionId-BHqywvM3.js +1 -0
- package/.output/public/assets/index-B_LPYuM0.js +1 -0
- package/.output/public/assets/{main-DK9PoBjx.js → main-CI3HFEcV.js} +2 -2
- package/.output/server/{_sessionId-DjarbXpT.mjs → _sessionId-DQ0ljHQ8.mjs} +2 -2
- package/.output/server/_ssr/{CompareDrawer-C5Z6AlUk.mjs → CompareDrawer-nkVa9epn.mjs} +4 -3
- package/.output/server/_ssr/{ProxyViewerContainer-4pXsBywn.mjs → ProxyViewerContainer-CXA7iH3H.mjs} +140 -45
- package/.output/server/_ssr/{ReplayDialog-w1vc1p5e.mjs → ReplayDialog-CK71-ucq.mjs} +3 -3
- package/.output/server/_ssr/{RequestAnatomy-2HaBhsNV.mjs → RequestAnatomy-DDCUJJ3X.mjs} +2 -2
- package/.output/server/_ssr/{ResponseView-SO_Y_W85.mjs → ResponseView-C6ZA7V3B.mjs} +2 -2
- package/.output/server/_ssr/{StreamingChunkSequence-CXEa2DkO.mjs → StreamingChunkSequence-DW5v_o6G.mjs} +2 -2
- package/.output/server/_ssr/{index-DuCGt4a2.mjs → index-Ckex98yq.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-D0BaSzkZ.mjs → router-ChJIVv7-.mjs} +434 -6
- package/.output/server/{_tanstack-start-manifest_v-6N4SODyd.mjs → _tanstack-start-manifest_v-CJ4__weU.mjs} +1 -1
- package/.output/server/index.mjs +62 -62
- package/package.json +1 -1
- package/src/components/ProxyViewer.tsx +5 -2
- package/src/components/providers/ProviderCard.tsx +6 -3
- package/src/components/providers/ProviderForm.tsx +6 -3
- package/src/components/providers/ProvidersPanel.tsx +6 -1
- package/src/components/providers/SettingsDialog.tsx +5 -2
- package/src/components/proxy-viewer/CompareDrawer.tsx +3 -1
- package/src/components/proxy-viewer/LogEntry.tsx +23 -6
- package/src/components/proxy-viewer/LogEntryHeader.tsx +20 -0
- package/src/components/proxy-viewer/useCopyFeedback.ts +3 -1
- package/src/components/ui/json-viewer.tsx +7 -2
- package/src/contracts/log.ts +1 -0
- package/src/lib/clipboard.ts +67 -0
- package/src/proxy/logFinalizer.ts +58 -0
- package/src/proxy/logSearch.ts +1 -0
- package/src/proxy/toolSchemaWarnings.ts +515 -0
- package/.output/public/assets/CompareDrawer-Jfe6M6DQ.js +0 -1
- package/.output/public/assets/ProxyViewerContainer-CQKV0Bqq.js +0 -115
- package/.output/public/assets/ResponseView-Bum1a3tG.js +0 -1
- package/.output/public/assets/StreamingChunkSequence-CjBDp5E9.js +0 -1
- package/.output/public/assets/_sessionId-BupV2gtf.js +0 -1
- package/.output/public/assets/index-DHSww5em.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,j as e}from"./main-DK9PoBjx.js";import{c as F,U as G,V as K,b as E,W as h,Y as f,Z as L,B as m,Q as g,h as j,_ as N,$ as y,a0 as R,a1 as z,a2 as S,a3 as k,f as l,g as M,a4 as D,a5 as H}from"./ProxyViewerContainer-CQKV0Bqq.js";const P=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],O=F("circle-stop",P);var U="Separator",w="horizontal",J=["horizontal","vertical"],C=o.forwardRef((n,t)=>{const{decorative:a,orientation:s=w,...r}=n,i=W(s)?s:w,d=a?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return e.jsx(G.div,{"data-orientation":i,...d,...r,ref:t})});C.displayName=U;function W(n){return J.includes(n)}var $=C;const X="prose prose-sm dark:prose-invert max-w-none text-[13px] leading-[1.65] [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_p]:leading-[1.65] [&_ul]:my-1 [&_ol]:my-1 [&_li]:my-0.5 [&_li]:leading-[1.6]";function v({text:n}){return e.jsx("div",{className:X,children:e.jsx(K,{children:n})})}function V({className:n,orientation:t="horizontal",decorative:a=!0,...s}){return e.jsx($,{"data-slot":"separator",decorative:a,orientation:t,className:E("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),...s})}const Z=/<think>([\s\S]*?)<\/think>/gi,Q=/<think>([\s\S]*?)<\/think>/i;function B(n){const t=Q.exec(n);if(!t||t[1]===void 0)return{thinking:null,remainingText:n};const a=t[1].trim(),s=n.replace(Z,"").trim();return{thinking:a,remainingText:s}}function Y(n){return e.jsx(e.Fragment,{})}function q({text:n}){const[t,a]=o.useState(!1);return e.jsxs(h,{open:t,onOpenChange:a,children:[e.jsxs(f,{className:"flex items-center gap-1.5 py-0.5 cursor-pointer hover:opacity-80 transition-opacity group",children:[t?e.jsx(g,{className:"size-3 text-muted-foreground"}):e.jsx(j,{className:"size-3 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground text-xs italic select-none opacity-60",children:"[system-reminder]"})]}),e.jsx(N,{children:e.jsx("div",{className:"pl-4 pt-1",children:e.jsx(v,{text:n})})})]})}const ee=o.memo(function({text:t}){if(t.includes("<system-reminder>"))return e.jsx(q,{text:t});const{thinking:a,remainingText:s}=B(t);return e.jsxs("div",{className:"space-y-2",children:[a!==null&&e.jsx(p,{thinking:a}),s.length>0&&e.jsx(v,{text:s}),a===null&&s.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty text block"})]})}),p=o.memo(function({thinking:t}){const[a,s]=o.useState(!1);return e.jsx(h,{open:a,onOpenChange:s,children:e.jsxs("div",{className:"border-l-2 border-purple-500/40 my-1",children:[e.jsxs(f,{className:"flex items-center gap-1.5 px-3 py-1 w-full text-left cursor-pointer hover:bg-purple-500/5 transition-colors rounded-r-sm group",children:[e.jsx(L,{className:"size-3.5 text-purple-400 shrink-0"}),e.jsx("span",{className:"text-xs font-medium text-purple-400",children:"Thinking"}),e.jsxs(m,{variant:"ghost",className:"text-[10px] text-muted-foreground px-1.5 py-0 h-4 font-mono",children:[t.length.toLocaleString()," chars"]}),e.jsx("span",{className:"flex-1"}),a?e.jsx(g,{className:"size-3 text-muted-foreground"}):e.jsx(j,{className:"size-3 text-muted-foreground"})]}),e.jsx(N,{children:e.jsx("div",{className:"px-3 pb-2",children:e.jsx(y,{className:"max-h-[60vh]",children:e.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-mono leading-relaxed",children:t})})})})]})})}),te=o.memo(function({name:t,input:a}){const[s,r]=o.useState(!1);return e.jsx(h,{open:s,onOpenChange:r,children:e.jsxs("div",{className:"border-l-2 border-sky-400/25 my-1",children:[e.jsxs(f,{className:"flex items-center gap-1.5 px-3 py-1 w-full text-left cursor-pointer hover:bg-sky-400/[0.04] transition-colors rounded-r-sm group",children:[e.jsx(R,{className:"size-3.5 text-sky-400/70 shrink-0"}),e.jsx(m,{variant:"outline",className:"text-[10px] font-mono px-1.5 py-0 h-4",children:t}),e.jsx("span",{className:"flex-1"}),s?e.jsx(g,{className:"size-3 text-muted-foreground"}):e.jsx(j,{className:"size-3 text-muted-foreground"})]}),e.jsx(N,{children:e.jsx("div",{className:"px-3 pb-2",children:e.jsx(y,{className:"max-h-[60vh]",children:e.jsx(z,{data:S(a),defaultExpandDepth:0})})})})]})})}),ne=o.memo(function({block:t}){switch(t.type){case"text":return e.jsx(ee,{text:t.text});case"thinking":case"think":return e.jsx(p,{thinking:t.thinking});case"tool_use":return e.jsx(te,{name:t.name,input:t.input});default:return Y()}}),se=o.memo(function({response:t}){return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(m,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:t.model}),t.stop_reason!==null&&e.jsxs(m,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[e.jsx(O,{className:"size-2.5"}),t.stop_reason]}),e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[e.jsx(k,{className:"size-3"}),e.jsxs("span",{className:"font-mono tabular-nums",children:[l(t.usage.input_tokens??0)," in /"," ",l(t.usage.output_tokens??0)," out"]}),t.usage.cache_creation_input_tokens!==void 0&&t.usage.cache_creation_input_tokens!==null&&t.usage.cache_creation_input_tokens>0&&e.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["KV Cache +",l(t.usage.cache_creation_input_tokens)]}),t.usage.cache_read_input_tokens!==void 0&&t.usage.cache_read_input_tokens!==null&&t.usage.cache_read_input_tokens>0&&e.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["KV Cache ~",l(t.usage.cache_read_input_tokens)]})]})]}),e.jsx(V,{className:"opacity-50"}),e.jsxs("div",{className:"space-y-2",children:[t.content.map((a,s)=>e.jsx(ne,{block:a},s)),t.content.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})});function ae(n){if(n===void 0||n==="")return{};try{return JSON.parse(n)}catch{return null}}function re({call:n}){const[t,a]=o.useState(!1),s=n.function.name??"(unnamed tool)",r=ae(n.function.arguments);return e.jsx(h,{open:t,onOpenChange:a,children:e.jsxs("div",{className:"border-l-2 border-sky-400/25 my-1",children:[e.jsxs(f,{className:"flex items-center gap-1.5 px-3 py-1 w-full text-left cursor-pointer hover:bg-sky-400/[0.04] transition-colors rounded-r-sm group",children:[e.jsx(R,{className:"size-3.5 text-sky-400/70 shrink-0"}),e.jsx(m,{variant:"outline",className:"text-[10px] font-mono px-1.5 py-0 h-4",children:s}),n.id!==void 0&&n.id!==""&&e.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 truncate",children:n.id}),e.jsx("span",{className:"flex-1"}),t?e.jsx(g,{className:"size-3 text-muted-foreground"}):e.jsx(j,{className:"size-3 text-muted-foreground"})]}),e.jsx(N,{children:e.jsx("div",{className:"px-3 pb-2",children:e.jsx(y,{className:"max-h-[60vh]",children:r===null?e.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-words text-rose-300/90",children:n.function.arguments}):e.jsx(z,{data:S(r),defaultExpandDepth:0})})})})]})})}const oe=o.memo(function({response:t}){const a=t.choices[0],s=a?.message,r=s?.tool_calls??[];return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(m,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:t.model}),a?.finish_reason!==null&&a?.finish_reason!==void 0&&e.jsxs(m,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[e.jsx(O,{className:"size-2.5"}),a.finish_reason]}),e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[e.jsx(k,{className:"size-3"}),e.jsxs("span",{className:"font-mono tabular-nums",children:[l(t.usage.prompt_tokens??0)," in /"," ",l(t.usage.completion_tokens??0)," out"]})]})]}),e.jsx(V,{className:"opacity-50"}),e.jsxs("div",{className:"space-y-2",children:[s?.reasoning_content!==null&&s?.reasoning_content!==void 0&&s.reasoning_content.length>0&&e.jsx(p,{thinking:s.reasoning_content}),s?.content!==null&&s?.content!==void 0&&s.content.length>0&&(()=>{const i=s.reasoning_content!==null&&s.reasoning_content!==void 0&&s.reasoning_content.length>0,{thinking:c,remainingText:d}=B(s.content);return e.jsxs("div",{className:"space-y-2",children:[c!==null&&!i&&e.jsx(p,{thinking:c}),d.length>0&&e.jsx(v,{text:d})]})})(),r.map((i,c)=>e.jsx(re,{call:i},i.id??`tc-${c}`)),s?.function_call!==null&&s?.function_call!==void 0&&e.jsxs("div",{className:"border border-sky-400/20 rounded-md p-3 bg-muted/20",children:[e.jsx("div",{className:"text-xs text-sky-400/80 font-mono mb-1",children:"function_call"}),e.jsxs("div",{className:"font-mono text-xs",children:[e.jsx("span",{className:"text-foreground/80",children:s.function_call.name}),e.jsxs("span",{className:"text-muted-foreground",children:["(",s.function_call.arguments,")"]})]})]}),(s?.content===null||s?.content===void 0||s.content.length===0)&&(s?.reasoning_content===null||s?.reasoning_content===void 0||s.reasoning_content.length===0)&&(s?.function_call===null||s?.function_call===void 0)&&r.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})});function T(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function ie(n){return T(n)&&n.object==="chat.completion"}function ce(n){return T(n)&&n.type==="message"&&Array.isArray(n.content)}function le(n,t){return n==="openai"&&ie(t)?e.jsx(oe,{response:t}):n==="anthropic"&&ce(t)?e.jsx(se,{response:t}):null}function de(n){switch(n){case"success":return"text-emerald-400";case"client_error":return"text-amber-400";case"server_error":return"text-red-400";case"pending":return"text-muted-foreground"}}function u({status:n}){const t=H(n),a=de(t);return n===null?e.jsx("span",{className:"text-xs text-muted-foreground italic",children:"pending"}):e.jsxs("span",{className:E("flex items-center gap-1 text-xs font-mono font-semibold",a),children:[t==="server_error"&&e.jsx(D,{className:"size-3"}),n]})}function A({text:n}){return e.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-3",children:e.jsx("pre",{className:"text-xs text-red-300 whitespace-pre-wrap font-mono leading-relaxed overflow-auto max-h-[60vh]",children:n})})}function xe({text:n}){return e.jsx(v,{text:n})}const he=o.memo(function({responseText:t,responseStatus:a,streaming:s,inputTokens:r,outputTokens:i,cacheCreationInputTokens:c,cacheReadInputTokens:d,apiFormat:I,error:x}){const _=I??"unknown",b=o.useMemo(()=>M(_).analyzeResponse(t).parsed,[_,t]);return t===null&&x===void 0?e.jsxs("div",{className:"flex items-center gap-2 py-3",children:[e.jsx(u,{status:a}),e.jsx("span",{className:"text-xs text-muted-foreground italic",children:"No response"})]}):a!==null&&a>=400?e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{status:a}),e.jsx(A,{text:t??""}),x!=null&&e.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[e.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),e.jsx("div",{className:"text-muted-foreground font-mono",children:x})]})]}):x!=null?e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{status:a}),e.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[e.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),e.jsx("div",{className:"text-muted-foreground font-mono",children:x})]}),t!==null&&e.jsx("div",{className:"mt-2",children:e.jsx(A,{text:t})})]}):b!==null?e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{status:a}),le(_,b)]}):e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(u,{status:a}),s&&(r!==null||i!==null)&&e.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[e.jsx(k,{className:"size-3"}),e.jsxs("span",{className:"font-mono tabular-nums",children:[r!==null?l(r):"—"," in /"," ",i!==null?l(i):"—"," out"]}),c!=null&&c>0&&e.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["KV Cache +",l(c)]}),d!=null&&d>0&&e.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["KV Cache ~",l(d)]})]})]}),e.jsx(xe,{text:t??""})]})});export{he as ResponseView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,j as e}from"./main-DK9PoBjx.js";import{t as j,v,w as b,Q as l,h as u,B as N,x as k,a6 as S,a1 as y}from"./ProxyViewerContainer-CQKV0Bqq.js";const z=a.memo(function({logId:d,truncated:x}){const[o,m]=a.useState(!1),[r,i]=a.useState({status:"idle"}),[h,p]=a.useState(new Set);a.useEffect(()=>{if(!o||r.status!=="idle")return;let s=!1;return i({status:"loading"}),fetch(`/api/logs/${d}/chunks`).then(t=>t.ok?t.json():Promise.reject(new Error("Chunks not found"))).then(t=>{s||i({status:"success",chunks:t.chunks})}).catch(()=>{s||i({status:"error",message:"Chunk data unavailable"})}),()=>{s=!0}},[o,d]);const c=a.useMemo(()=>{if(r.status!=="success")return[];const s=new Map;for(const t of r.chunks){const n=s.get(t.index);n?n.push(t):s.set(t.index,[t])}return Array.from(s.entries()).map(([t,n])=>({index:t,chunks:n})).sort((t,n)=>t.index-n.index)},[r]),f=s=>{p(t=>{const n=new Set(t);return n.has(s)?n.delete(s):n.add(s),n})};function g(){return r.status==="idle"||r.status==="loading"?e.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs text-muted-foreground",children:[e.jsx(S,{className:"size-3 animate-spin"}),e.jsx("span",{children:"Loading chunks..."})]}):r.status==="error"?e.jsx("div",{className:"py-2 text-xs text-muted-foreground italic",children:r.message}):e.jsxs("div",{className:"p-2 space-y-1",children:[e.jsxs("div",{className:"text-[10px] text-muted-foreground font-mono mb-2",children:[c.length," index group",c.length!==1?"s":""," available"]}),c.map(s=>{const t=h.has(s.index);return e.jsxs("div",{className:"rounded border border-border bg-background",children:[e.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-2 py-1.5 text-left hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>f(s.index),children:[t?e.jsx(l,{className:"size-3 text-muted-foreground"}):e.jsx(u,{className:"size-3 text-muted-foreground"}),e.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["[",s.index,"] ",s.chunks[0]?.type??""]}),e.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[s.chunks.length," chunk",s.chunks.length!==1?"s":""]})]}),t&&e.jsx("div",{className:"px-2 pb-2 space-y-1",children:s.chunks.map(n=>e.jsxs("div",{className:"rounded border border-border bg-muted/20 p-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["+",n.timestamp,"ms"]}),e.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:n.type})]}),e.jsx(y,{data:n,defaultExpandDepth:0,showCopy:!0})]},n.index))})]},s.index)})]})}return e.jsxs("div",{className:"space-y-1",children:[e.jsx(j,{children:e.jsxs(v,{children:[e.jsx(b,{asChild:!0,children:e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>m(s=>!s),children:[o?e.jsx(l,{className:"size-3"}):e.jsx(u,{className:"size-3"}),e.jsx("span",{children:"Raw SSE Events"}),e.jsxs(N,{variant:"outline",className:"text-[9px] px-1 py-0 h-4 font-mono ml-1",children:[d,x===!0?"+":""]})]})}),e.jsx(k,{children:"Server-Sent Events streaming chunks from the provider"})]})}),o===!0?e.jsx("div",{className:"rounded-md border border-border bg-muted/20 overflow-auto max-h-64",children:g()}):null]})});export{z as StreamingChunkSequence};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as s,j as e}from"./main-DK9PoBjx.js";import{P as i}from"./ProxyViewerContainer-CQKV0Bqq.js";function t(){const{sessionId:o}=s.useParams();return e.jsx(i,{initialSessionId:o},o)}export{t as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as o}from"./ProxyViewerContainer-CQKV0Bqq.js";import"./main-DK9PoBjx.js";const r=o;export{r as component};
|