@cartanova/qgrid-cli 2.10.2 → 2.10.3
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/bundle/dist/application/monit/log-buffer.js +7 -11
- package/bundle/dist/application/monit/monit.frame.js +6 -11
- package/bundle/dist/application/qgrid/oauth.js +2 -2
- package/bundle/dist/application/qgrid/qgrid-run-lifecycle.js +2 -2
- package/bundle/dist/application/qgrid/qgrid.dispatcher.js +12 -36
- package/bundle/dist/application/qgrid/qgrid.frame.js +2 -2
- package/bundle/dist/application/qgrid/qgrid.types.js +2 -1
- package/bundle/dist/application/qgrid/token-subscriber.js +4 -7
- package/bundle/dist/application/qgrid/token-window-keepalive.js +3 -2
- package/bundle/dist/application/qgrid/tool-emulation-schema.js +4 -4
- package/bundle/dist/application/qgrid/tool-emulation.js +14 -2
- package/bundle/dist/application/request-log/request-log.model.js +7 -5
- package/bundle/dist/application/setting/setting.model.js +1 -1
- package/bundle/dist/sonamu.config.js +6 -6
- package/bundle/dist/utils/providers/anthropic/anthropic-constants.js +1 -1
- package/bundle/dist/utils/providers/anthropic/anthropic-dispatcher.js +53 -84
- package/bundle/dist/utils/providers/anthropic/anthropic-thinking.js +55 -0
- package/bundle/dist/utils/providers/anthropic/claude-session.js +11 -13
- package/bundle/dist/utils/providers/common/effort.js +1 -1
- package/bundle/dist/utils/providers/common/smooth-weighted-round-robin.js +3 -3
- package/bundle/dist/utils/providers/common/thinking.js +12 -0
- package/bundle/dist/utils/providers/openai/openai-backend-protocol.js +3 -2
- package/bundle/dist/utils/providers/openai/openai-direct-client.js +6 -16
- package/bundle/dist/utils/providers/openai/openai-dispatcher.js +89 -78
- package/bundle/src/application/monit/log-buffer.test.ts +3 -4
- package/bundle/src/application/monit/log-buffer.ts +13 -27
- package/bundle/src/application/monit/monit.frame.test.ts +7 -8
- package/bundle/src/application/monit/monit.frame.ts +9 -14
- package/bundle/src/application/qgrid/oauth.ts +1 -1
- package/bundle/src/application/qgrid/qgrid-run-lifecycle.test.ts +7 -0
- package/bundle/src/application/qgrid/qgrid-run-lifecycle.ts +1 -1
- package/bundle/src/application/qgrid/qgrid.dispatcher.test.ts +62 -1
- package/bundle/src/application/qgrid/qgrid.dispatcher.ts +25 -71
- package/bundle/src/application/qgrid/qgrid.frame.ts +4 -8
- package/bundle/src/application/qgrid/qgrid.types.ts +2 -0
- package/bundle/src/application/qgrid/token-subscriber.test.ts +8 -18
- package/bundle/src/application/qgrid/token-subscriber.ts +10 -20
- package/bundle/src/application/qgrid/token-window-keepalive.test.ts +2 -2
- package/bundle/src/application/qgrid/token-window-keepalive.ts +2 -1
- package/bundle/src/application/qgrid/tool-emulation-schema.test.ts +6 -3
- package/bundle/src/application/qgrid/tool-emulation-schema.ts +3 -3
- package/bundle/src/application/qgrid/tool-emulation.test.ts +8 -1
- package/bundle/src/application/qgrid/tool-emulation.ts +29 -0
- package/bundle/src/application/request-log/request-log.model.ts +5 -5
- package/bundle/src/application/setting/setting.model.ts +1 -1
- package/bundle/src/sonamu.config.ts +5 -5
- package/bundle/src/utils/providers/anthropic/anthropic-constants.ts +3 -6
- package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.test.ts +26 -0
- package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.ts +70 -148
- package/bundle/src/utils/providers/anthropic/anthropic-thinking.test.ts +36 -0
- package/bundle/src/utils/providers/anthropic/anthropic-thinking.ts +84 -0
- package/bundle/src/utils/providers/anthropic/claude-session.test.ts +74 -13
- package/bundle/src/utils/providers/anthropic/claude-session.ts +11 -20
- package/bundle/src/utils/providers/common/effort.ts +1 -1
- package/bundle/src/utils/providers/common/provider-dispatcher.ts +4 -0
- package/bundle/src/utils/providers/common/smooth-weighted-round-robin.ts +4 -4
- package/bundle/src/utils/providers/common/thinking.ts +10 -0
- package/bundle/src/utils/providers/openai/openai-backend-protocol.ts +7 -3
- package/bundle/src/utils/providers/openai/openai-direct-client.test.ts +3 -3
- package/bundle/src/utils/providers/openai/openai-direct-client.ts +20 -33
- package/bundle/src/utils/providers/openai/openai-dispatcher.test.ts +97 -6
- package/bundle/src/utils/providers/openai/openai-dispatcher.ts +113 -77
- package/bundle/web-dist/client/assets/{index-DtRTSTes.js → index-BIC1sQxw.js} +3 -3
- package/bundle/web-dist/client/assets/{logs-BhVYDEzC.js → logs-zvdujZWn.js} +1 -1
- package/bundle/web-dist/client/assets/{monit-BxN4JWqK.js → monit-CraVV3MQ.js} +1 -1
- package/bundle/web-dist/client/assets/{routes-CBCqRp2o.js → routes-B3ZBoJ60.js} +1 -1
- package/bundle/web-dist/client/assets/{settings-hBTEC7Ki.js → settings-DwbzT5jo.js} +1 -1
- package/bundle/web-dist/client/assets/{show-BzYft5N4.js → show-ItTExdAh.js} +1 -1
- package/bundle/web-dist/client/assets/{tokens-PMybtI8X.js → tokens-BynKx8Vn.js} +1 -1
- package/bundle/web-dist/client/assets/{use-oauth-login-flow-C51_d6-6.js → use-oauth-login-flow-8xw6on5P.js} +1 -1
- package/bundle/web-dist/client/index.html +1 -1
- package/bundle/web-dist/server/entry-server.generated.js +1 -1
- package/package.json +1 -1
- package/skills/qgrid/SKILL.md +1 -0
- package/skills/qgrid/references/ai-sdk-provider-contract.md +2 -1
- package/skills/qgrid/references/anthropic-claude-code-runtime.md +7 -4
- package/skills/qgrid/references/decision-rationale.md +9 -0
- package/skills/qgrid/references/openai-codex-runtime.md +6 -0
- package/skills/qgrid/references/token-auth-quota-lifecycle.md +2 -0
- package/skills/qgrid/references/tool-calling-and-multiturn.md +18 -1
- package/skills/qgrid/references/verification-and-debugging.md +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{_ as t,l as n}from"./vendor-tanstack-DJRQAbrY.js";import{i as r,r as i}from"./vendor-react-DH4kUfK2.js";import{i as a,r as o,u as s}from"./services.generated-Cbvg2sGQ.js";import{c,d as l,t as u,u as d}from"./index-DtRTSTes.js";import{n as f,t as p}from"./cost-CpjVoAqp.js";import{t as m}from"./request-model-D4CZPmnG.js";function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(null,arguments)}function g(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _=e(r()),v=i(),y={},b=(0,_.createContext)(y),x=(e,t)=>h({},e,t),S=()=>(0,_.useContext)(b),C=(0,_.createContext)(()=>{});C.displayName=`JVR.DispatchShowTools`;function w(){return(0,_.useReducer)(x,y)}function T(){return(0,_.useContext)(C)}var E=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,v.jsx)(b.Provider,{value:t,children:(0,v.jsx)(C.Provider,{value:n,children:r})})};E.displayName=`JVR.ShowTools`;var D={},ee=(0,_.createContext)(D),te=(e,t)=>h({},e,t),O=()=>(0,_.useContext)(ee),ne=(0,_.createContext)(()=>{});ne.displayName=`JVR.DispatchExpands`;function re(){return(0,_.useReducer)(te,D)}function ie(){return(0,_.useContext)(ne)}var ae=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,v.jsx)(ee.Provider,{value:t,children:(0,v.jsx)(ne.Provider,{value:n,children:r})})};ae.displayName=`JVR.Expands`;var oe={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},se=(0,_.createContext)(oe),ce=(e,t)=>h({},e,t),k=()=>(0,_.useContext)(se),A=(0,_.createContext)(()=>{});A.displayName=`JVR.DispatchTypes`;function le(){return(0,_.useReducer)(ce,oe)}function ue(){return(0,_.useContext)(A)}function de(e){var{initial:t,dispatch:n,children:r}=e;return(0,v.jsx)(se.Provider,{value:t,children:(0,v.jsx)(A.Provider,{value:n,children:r})})}de.displayName=`JVR.Types`;var fe=[`style`];function pe(e){var{style:t}=e,n=g(e,fe);return(0,v.jsx)(`svg`,h({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:h({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,v.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}pe.displayName=`JVR.TriangleArrow`;var me={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,v.jsx)(pe,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},he=(0,_.createContext)(me),ge=(e,t)=>h({},e,t),j=()=>(0,_.useContext)(he),_e=(0,_.createContext)(()=>{});_e.displayName=`JVR.DispatchSymbols`;function ve(){return(0,_.useReducer)(ge,me)}function ye(){return(0,_.useContext)(_e)}var be=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,v.jsx)(he.Provider,{value:t,children:(0,v.jsx)(_e.Provider,{value:n,children:r})})};be.displayName=`JVR.Symbols`;var xe={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},Se=(0,_.createContext)(xe),Ce=(e,t)=>h({},e,t),M=()=>(0,_.useContext)(Se),we=(0,_.createContext)(()=>{});we.displayName=`JVR.DispatchSection`;function Te(){return(0,_.useReducer)(Ce,xe)}function Ee(){return(0,_.useContext)(we)}var De=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,v.jsx)(Se.Provider,{value:t,children:(0,v.jsx)(we.Provider,{value:n,children:r})})};De.displayName=`JVR.Section`;var Oe={objectSortKeys:!1,indentWidth:15},N=(0,_.createContext)(Oe);N.displayName=`JVR.Context`;var ke=(0,_.createContext)(()=>{});ke.displayName=`JVR.DispatchContext`;function Ae(e,t){return h({},e,t)}var P=()=>(0,_.useContext)(N),je=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,_.useReducer)(Ae,Object.assign({},Oe,n)),[o,s]=w(),[c,l]=re(),[u,d]=le(),[f,p]=ve(),[m,g]=Te();return(0,_.useEffect)(()=>a(h({},n)),[n]),(0,v.jsx)(N.Provider,{value:i,children:(0,v.jsx)(ke.Provider,{value:a,children:(0,v.jsx)(E,{initial:o,dispatch:s,children:(0,v.jsx)(ae,{initial:c,dispatch:l,children:(0,v.jsx)(de,{initial:h({},u,r),dispatch:d,children:(0,v.jsx)(be,{initial:f,dispatch:p,children:(0,v.jsx)(De,{initial:m,dispatch:g,children:t})})})})})})})};je.displayName=`JVR.Provider`;function Me(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var Ne=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],Pe=[`as`,`render`],Fe=[`as`,`render`],Ie=[`as`,`render`],Le=[`as`,`style`,`render`],Re=[`as`,`render`],ze=[`as`,`render`],Be=[`as`,`render`],Ve=[`as`,`render`],F=e=>{var{Quote:t={}}=j(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=g(e,Ne);if(n)return null;var{as:c,render:l}=t,u=g(t,Pe),d=c||`span`,f=h({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,v.jsx)(d,h({},f))};F.displayName=`JVR.Quote`;var I=e=>{var{ValueQuote:t={}}=j(),n=h({},(Me(e),e)),{as:r,render:i}=t,a=g(t,Fe),o=r||`span`,s=h({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,v.jsx)(o,h({},s))};I.displayName=`JVR.ValueQuote`;var He=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=j(),{as:o,render:s}=a,c=g(a,Ie),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,v.jsx)(l,h({},c))};He.displayName=`JVR.Colon`;var Ue=e=>{var{Arrow:t={}}=j(),n=O(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=g(t,Le),m=u||`span`,_=f&&typeof f==`function`,y=h({},p,{"data-expanded":l,style:h({},d,i)});return _&&f(y,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,v.jsx)(m,h({},p,{style:h({},d,i)}))};Ue.displayName=`JVR.Arrow`;var We=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=j(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=g(o,Re),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,v.jsx)(f,h({},d))}var{as:p,render:m}=s,_=g(s,ze),y=p||`span`;return m&&typeof m==`function`&&m(_,c)||(0,v.jsx)(y,h({},_))};We.displayName=`JVR.BracketsOpen`;var L=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=j();if(t){var{as:u,render:d}=c,f=g(c,Be),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,v.jsx)(p,h({},f))}var{as:m,render:_}=l,y=g(l,Ve),b=m||`span`;return _&&typeof _==`function`&&_(y,s)||(0,v.jsx)(b,h({},y))};L.displayName=`JVR.BracketsClose`;var Ge=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=O(),{collapsed:c,shouldExpandNodeInitially:l}=P(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},g={keyName:t,value:n,keys:o,parentValue:i},_=Array.isArray(n),y=n instanceof Set;return(0,v.jsx)(`div`,{style:m,children:(0,v.jsx)(L,h({isBrackets:_||y},g,{isVisiable:!0}))})};Ge.displayName=`JVR.NestedClose`;var Ke=[`as`,`render`],qe=[`as`,`render`],Je=[`as`,`render`],Ye=[`as`,`render`],Xe=[`as`,`render`],Ze=[`as`,`render`],Qe=[`as`,`render`],$e=[`as`,`render`],et=[`as`,`render`],tt=[`as`,`render`],nt=[`as`,`render`],rt=[`as`,`render`],it=[`as`,`render`],R=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},at=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=k();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=g(r,Ke);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,v.jsx)(a||`span`,h({},s))};at.displayName=`JVR.SetComp`;var ot=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=k();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=g(r,qe);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,v.jsx)(a||`span`,h({},s))};ot.displayName=`JVR.MapComp`;var z={opacity:.75,paddingRight:4},st=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=k(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=P(),{as:c,render:l}=i,u=g(i,Je),d=t,[f,p]=(0,_.useState)(o&&d.length>o);(0,_.useEffect)(()=>p(o&&d.length>o),[o]);var m=c||`span`,y=h({},z,i.style||{});o>0&&(u.style=h({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var b=f?``+d.slice(0,o)+s:d,x=l&&typeof l==`function`,S=x&&l(h({},u,{style:y}),{type:`type`,value:t,keyName:n,keys:r}),C=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,w=x&&l(h({},u,{children:b,className:C}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(S||(0,v.jsx)(m,h({},u,{style:y}))),w||(0,v.jsxs)(_.Fragment,{children:[(0,v.jsx)(I,{}),(0,v.jsx)(m,h({},u,{className:C,children:b})),(0,v.jsx)(I,{})]})]})};st.displayName=`JVR.TypeString`;var ct=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,Ye),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p||(0,v.jsx)(l,h({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};ct.displayName=`JVR.TypeTrue`;var lt=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,Xe),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p||(0,v.jsx)(l,h({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};lt.displayName=`JVR.TypeFalse`;var ut=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,Ze),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p||(0,v.jsx)(l,h({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};ut.displayName=`JVR.TypeFloat`;var dt=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,Qe),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p||(0,v.jsx)(l,h({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};dt.displayName=`JVR.TypeInt`;var ft=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,$e),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p||(0,v.jsx)(l,h({},c,{className:`w-rjv-value`,children:R(t?.toString())}))]})};ft.displayName=`JVR.TypeFloat`;var pt=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,et),l=o||`span`,u=h({},z,i.style),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p||(0,v.jsxs)(`a`,h({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,v.jsx)(I,{}),t?.href,(0,v.jsx)(I,{})]}))]})};pt.displayName=`JVR.TypeUrl`;var mt=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,tt),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,m=d&&s(h({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),m||(0,v.jsx)(l,h({},c,{className:`w-rjv-value`,children:p}))]})};mt.displayName=`JVR.TypeDate`;var ht=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,nt),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p]})};ht.displayName=`JVR.TypeUndefined`;var gt=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,rt),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p]})};gt.displayName=`JVR.TypeNull`;var _t=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,it),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p]})};_t.displayName=`JVR.TypeNan`;var vt=e=>Number(e)===e&&e%1!=0||isNaN(e),yt=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,v.jsx)(pt,h({},i,{children:t})):typeof t==`string`?(0,v.jsx)(st,h({},i,{children:t})):t===!0?(0,v.jsx)(ct,h({},i,{children:t})):t===!1?(0,v.jsx)(lt,h({},i,{children:t})):t===null?(0,v.jsx)(gt,h({},i,{children:t})):t===void 0?(0,v.jsx)(ht,h({},i,{children:t})):t instanceof Date?(0,v.jsx)(mt,h({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,v.jsx)(_t,h({},i,{children:t})):typeof t==`number`&&vt(t)?(0,v.jsx)(ut,h({},i,{children:t})):typeof t==`bigint`?(0,v.jsx)(ft,h({},i,{children:t})):typeof t==`number`?(0,v.jsx)(dt,h({},i,{children:t})):null};yt.displayName=`JVR.Value`;function B(e,t,n){var r=ye(),i=h({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:h({},e.style,t.style),children:t.children||e.children});(0,_.useEffect)(()=>r({[n]:i}),[t])}function V(e,t,n){var r=ue(),i=h({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:h({},e.style,t.style),children:t.children||e.children});(0,_.useEffect)(()=>r({[n]:i}),[t])}function H(e,t,n){var r=Ee(),i=h({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:h({},e.style,t.style),children:t.children||e.children});(0,_.useEffect)(()=>r({[n]:i}),[t])}var bt=[`as`,`render`],xt=e=>{var{KeyName:t={}}=M();return H(t,e,`KeyName`),null};xt.displayName=`JVR.KeyName`;var St=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=M(),{as:c,render:l}=s,u=g(s,bt);u.style=h({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(h({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,v.jsx)(d,h({},u,{children:t}))};St.displayName=`JVR.KeyNameComp`;var Ct=[`children`,`value`,`parentValue`,`keyName`,`keys`],wt=[`as`,`render`,`children`],Tt=e=>{var{Row:t={}}=M();return H(t,e,`Row`),null};Tt.displayName=`JVR.Row`;var Et=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=g(e,Ct),{Row:s={}}=M(),{as:c,render:l}=s,u=g(s,wt),d=c||`div`;return l&&typeof l==`function`&&l(h({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,v.jsx)(d,h({},o,u,{children:t}))};Et.displayName=`JVR.RowComp`;function Dt(e){var t=(0,_.useRef)();return(0,_.useEffect)(()=>{t.current=e}),t.current}function Ot(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=Dt(t),a=(0,_.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,_.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var kt=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],At=[`as`,`render`],U=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=g(e,kt),{onCopied:c,enableClipboard:l,beforeCopy:u}=P(),d=S()[i],[f,p]=(0,_.useState)(!1),{Copied:m={}}=M(),y=m?.beforeCopy;if(l===!1||!d)return null;var b={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?R(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?R(t):t,2);var l=o||y||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:x}=m,C=g(m,At),w=h({},C,s,b,{style:h({},C.style,s.style,b.style)});return x&&typeof x==`function`&&x(h({},w,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,v.jsx)(`svg`,h({viewBox:`0 0 32 36`},w,{children:(0,v.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,v.jsx)(`svg`,h({viewBox:`0 0 32 36`},w,{children:(0,v.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};U.displayName=`JVR.Copied`;function jt(){var e=(0,_.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var Mt=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=O(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=P(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,v.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,v.jsx)(Nt,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};Mt.displayName=`JVR.KeyValues`;var W=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=P(),o=typeof t==`number`,s=(0,_.useRef)(null);Ot({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,v.jsxs)(_.Fragment,{children:[(0,v.jsxs)(`span`,{ref:s,children:[(0,v.jsx)(F,h({isNumber:o,"data-placement":`left`},c)),(0,v.jsx)(St,h({},c,{children:t})),(0,v.jsx)(F,h({isNumber:o,"data-placement":`right`},c))]}),(0,v.jsx)(He,h({},c))]})};W.displayName=`JVR.KayName`;var Nt=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=T(),s=jt(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,v.jsx)(qt,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,v.jsxs)(Et,h({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,v.jsx)(W,{keyName:t,value:n,keys:a,parentValue:r}),(0,v.jsx)(yt,{keyName:t,value:n,keys:a}),(0,v.jsx)(U,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Nt.displayName=`JVR.KeyValuesItem`;var Pt=[`value`,`keyName`],Ft=[`as`,`render`],It=e=>{var{CountInfoExtra:t={}}=M();return H(t,e,`CountInfoExtra`),null};It.displayName=`JVR.CountInfoExtra`;var Lt=e=>{var{value:t={},keyName:n}=e,r=g(e,Pt),{CountInfoExtra:i={}}=M(),{as:a,render:o}=i,s=g(i,Ft);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=h({},s,r);return l&&o(u,{value:t,keyName:n})||(0,v.jsx)(c,h({},u))};Lt.displayName=`JVR.CountInfoExtraComps`;var Rt=[`value`,`keyName`],zt=[`as`,`render`],Bt=e=>{var{CountInfo:t={}}=M();return H(t,e,`CountInfo`),null};Bt.displayName=`JVR.CountInfo`;var Vt=e=>{var{value:t={},keyName:n}=e,r=g(e,Rt),{displayObjectSize:i}=P(),{CountInfo:a={}}=M();if(!i)return null;var{as:o,render:s}=a,c=g(a,zt),l=o||`span`;c.style=h({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=h({},c,r);return s&&typeof s==`function`&&s(h({},d,{"data-length":u}),{value:t,keyName:n})||(0,v.jsx)(l,h({},d))};Vt.displayName=`JVR.CountInfoComp`;var Ht=[`as`,`render`],Ut=e=>{var{Ellipsis:t={}}=M();return H(t,e,`Ellipsis`),null};Ut.displayName=`JVR.Ellipsis`;var Wt=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=M(),{as:a,render:o}=i,s=g(i,Ht),c=a||`span`;return o&&typeof o==`function`&&o(h({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,v.jsx)(c,h({},s)))};Wt.displayName=`JVR.EllipsisComp`;var Gt=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=O(),l=ie(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=P(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),g=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!g);var _=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},y={display:`inline-flex`,alignItems:`center`},b={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},x=Object.keys(a).length,S=typeof a==`object`,C=Array.isArray(a),w=a instanceof Set,T=x!==0&&(C||w||S),E={style:y};T&&(E.onClick=_);var D={keyName:t,value:a,keys:r,parentValue:o};return(0,v.jsxs)(`span`,h({},E,{children:[T&&(0,v.jsx)(Ue,h({style:b,expandKey:n},D)),(t||typeof t==`number`)&&(0,v.jsx)(W,h({},D)),(0,v.jsx)(at,{value:i,keyName:t}),(0,v.jsx)(ot,{value:i,keyName:t}),(0,v.jsx)(We,h({isBrackets:C||w},D)),(0,v.jsx)(Wt,{keyName:t,value:a,isExpanded:m}),(0,v.jsx)(L,h({isVisiable:m||!T,isBrackets:C||w},D)),(0,v.jsx)(Vt,{value:a,keyName:t}),(0,v.jsx)(Lt,{value:a,keyName:t}),(0,v.jsx)(U,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};Gt.displayName=`JVR.NestedOpen`;var Kt=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],qt=(0,_.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=g(e,Kt),u=T(),d=jt();return(0,v.jsxs)(`div`,h({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,v.jsx)(Gt,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,v.jsx)(Mt,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,v.jsx)(Ge,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});qt.displayName=`JVR.Container`;var Jt=e=>{var{BraceLeft:t={}}=j();return B(t,e,`BraceLeft`),null};Jt.displayName=`JVR.BraceLeft`;var Yt=e=>{var{BraceRight:t={}}=j();return B(t,e,`BraceRight`),null};Yt.displayName=`JVR.BraceRight`;var Xt=e=>{var{BracketsLeft:t={}}=j();return B(t,e,`BracketsLeft`),null};Xt.displayName=`JVR.BracketsLeft`;var Zt=e=>{var{BracketsRight:t={}}=j();return B(t,e,`BracketsRight`),null};Zt.displayName=`JVR.BracketsRight`;var Qt=e=>{var{Arrow:t={}}=j();return B(t,e,`Arrow`),null};Qt.displayName=`JVR.Arrow`;var $t=e=>{var{Colon:t={}}=j();return B(t,e,`Colon`),null};$t.displayName=`JVR.Colon`;var en=e=>{var{Quote:t={}}=j();return B(t,e,`Quote`),null};en.displayName=`JVR.Quote`;var tn=e=>{var{ValueQuote:t={}}=j();return B(t,e,`ValueQuote`),null};tn.displayName=`JVR.ValueQuote`;var nn=e=>{var{Bigint:t={}}=k();return V(t,e,`Bigint`),null};nn.displayName=`JVR.Bigint`;var rn=e=>{var{Date:t={}}=k();return V(t,e,`Date`),null};rn.displayName=`JVR.Date`;var an=e=>{var{False:t={}}=k();return V(t,e,`False`),null};an.displayName=`JVR.False`;var on=e=>{var{Float:t={}}=k();return V(t,e,`Float`),null};on.displayName=`JVR.Float`;var sn=e=>{var{Int:t={}}=k();return V(t,e,`Int`),null};sn.displayName=`JVR.Int`;var cn=e=>{var{Map:t={}}=k();return V(t,e,`Map`),null};cn.displayName=`JVR.Map`;var ln=e=>{var{Nan:t={}}=k();return V(t,e,`Nan`),null};ln.displayName=`JVR.Nan`;var un=e=>{var{Null:t={}}=k();return V(t,e,`Null`),null};un.displayName=`JVR.Null`;var dn=e=>{var{Set:t={}}=k();return V(t,e,`Set`),null};dn.displayName=`JVR.Set`;var fn=e=>{var{Str:t={}}=k();return V(t,e,`Str`),null};fn.displayName=`JVR.StringText`;var pn=e=>{var{True:t={}}=k();return V(t,e,`True`),null};pn.displayName=`JVR.True`;var mn=e=>{var{Undefined:t={}}=k();return V(t,e,`Undefined`),null};mn.displayName=`JVR.Undefined`;var hn=e=>{var{Url:t={}}=k();return V(t,e,`Url`),null};hn.displayName=`JVR.Url`;var gn=e=>{var{Copied:t={}}=M();return H(t,e,`Copied`),null};gn.displayName=`JVR.Copied`;var _n=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],G=(0,_.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:_=!1,onExpand:y,onCopied:b,beforeCopy:x}=e,S=g(e,_n),C=h({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),w=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,v.jsxs)(je,{initialState:{value:i,objectSortKeys:_,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:b,onExpand:y,beforeCopy:x},initialTypes:{displayDataTypes:m},children:[(0,v.jsx)(qt,h({value:i},S,{ref:t,className:w,style:C})),a]})});G.Bigint=nn,G.Date=rn,G.False=an,G.Float=on,G.Int=sn,G.Map=cn,G.Nan=ln,G.Null=un,G.Set=dn,G.String=fn,G.True=pn,G.Undefined=mn,G.Url=hn,G.ValueQuote=tn,G.Arrow=Qt,G.Colon=$t,G.Quote=en,G.Ellipsis=Ut,G.BraceLeft=Jt,G.BraceRight=Yt,G.BracketsLeft=Xt,G.BracketsRight=Zt,G.Copied=gn,G.CountInfo=Bt,G.CountInfoExtra=It,G.KeyName=xt,G.Row=Tt,G.displayName=`JVR.JsonView`;var vn={"--w-rjv-font-family":`monospace`,"--w-rjv-color":`#002b36`,"--w-rjv-key-string":`#002b36`,"--w-rjv-background-color":`#ffffff`,"--w-rjv-line-color":`#ebebeb`,"--w-rjv-arrow-color":`var(--w-rjv-color)`,"--w-rjv-edit-color":`var(--w-rjv-color)`,"--w-rjv-info-color":`#0000004d`,"--w-rjv-update-color":`#ebcb8b`,"--w-rjv-copied-color":`#002b36`,"--w-rjv-copied-success-color":`#28a745`,"--w-rjv-curlybraces-color":`#236a7c`,"--w-rjv-colon-color":`#002b36`,"--w-rjv-brackets-color":`#236a7c`,"--w-rjv-quotes-color":`var(--w-rjv-key-string)`,"--w-rjv-quotes-string-color":`var(--w-rjv-type-string-color)`,"--w-rjv-type-string-color":`#cb4b16`,"--w-rjv-type-int-color":`#268bd2`,"--w-rjv-type-float-color":`#859900`,"--w-rjv-type-bigint-color":`#268bd2`,"--w-rjv-type-boolean-color":`#2aa198`,"--w-rjv-type-date-color":`#586e75`,"--w-rjv-type-url-color":`#0969da`,"--w-rjv-type-null-color":`#d33682`,"--w-rjv-type-nan-color":`#859900`,"--w-rjv-type-undefined-color":`#586e75`},yn=e=>(0,v.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,v.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m12 19l-7-7l7-7m7 7H5`})}),bn=e=>(0,v.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,v.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M20 6L9 17l-5-5`})}),K=e=>(0,v.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,v.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m6 9l6 6l6-6`})}),xn=e=>(0,v.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,v.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,v.jsx)(`rect`,{width:14,height:14,x:8,y:8,rx:2,ry:2}),(0,v.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]})});function Sn(){let{id:e}=u.useSearch();return(0,v.jsx)(lr,{id:e})}function q(e){return e.toLocaleString()}var Cn=new Set;function wn(e){try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}}function Tn(e){if(!e)return{};try{return JSON.parse(e)}catch{return e}}function J({text:e,dark:t}){let[n,r]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>r(!1),1500);return()=>clearTimeout(e)},[n]),(0,v.jsx)(`button`,{type:`button`,className:`absolute top-2 right-2 p-1 rounded transition-colors ${t?`text-sand-500 hover:text-sand-300`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>{navigator.clipboard.writeText(e),r(!0)},children:n?(0,v.jsx)(bn,{className:`size-3.5 text-sage-500`}):(0,v.jsx)(xn,{className:`size-3.5`})})}var En=/<img\s+[^>]*src=["'](data:image\/[^"']+;base64,[^"']+)["'][^>]*(?:alt=["']([^"']*)["'][^>]*)?\/?>/gi;function Dn(e){let t=[],n=0;for(let r of e.matchAll(En)){let i=r.index??0;i>n&&t.push({type:`text`,text:e.slice(n,i)}),t.push({type:`image`,src:r[1],alt:r[2]??`generated image`}),n=i+r[0].length}return n<e.length&&t.push({type:`text`,text:e.slice(n)}),t.filter(e=>e.type===`image`||e.text.trim().length>0)}function On({text:e,markdown:t}){let[n,r]=(0,_.useState)(null),i=Dn(e);return i.some(e=>e.type===`image`)?(0,v.jsxs)(`div`,{className:`space-y-3`,children:[i.map((e,n)=>e.type===`text`?t?(0,v.jsx)(`div`,{className:`prose prose-sm prose-qgrid max-w-none`,children:(0,v.jsx)(l,{remarkPlugins:[d],children:e.text})},`text-${n}`):(0,v.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:e.text},`text-${n}`):(0,v.jsx)(`button`,{type:`button`,className:`block max-w-full rounded-md border border-sand-200 overflow-hidden bg-white hover:border-sienna-300 transition-colors`,onClick:()=>r(e.src),title:`Open image`,children:(0,v.jsx)(`img`,{src:e.src,alt:e.alt,className:`max-h-[520px] max-w-full object-contain`,loading:`lazy`})},`image-${n}`)),n&&(0,v.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-black/70 p-4 flex items-center justify-center`,onClick:()=>r(null),children:[(0,v.jsx)(`button`,{type:`button`,className:`absolute top-4 right-4 p-2 rounded-full bg-white/90 text-sand-700 hover:bg-white`,onClick:()=>r(null),title:`Close image`,children:(0,v.jsx)(c,{className:`size-5`})}),(0,v.jsx)(`img`,{src:n,alt:`generated preview`,className:`max-h-full max-w-full object-contain rounded-md bg-white`,onClick:e=>e.stopPropagation()})]})]}):t?(0,v.jsx)(`div`,{className:`prose prose-sm prose-qgrid max-w-none`,children:(0,v.jsx)(l,{remarkPlugins:[d],children:e})}):(0,v.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:e})}function Y({text:e,markdown:t}){let n=wn(e),[r,i]=(0,_.useState)(`pretty`),a=n.ok&&n.value!==null&&(Array.isArray(n.value)||typeof n.value==`object`);return!n.ok||!a?t?(0,v.jsx)(On,{text:e,markdown:!0}):(0,v.jsx)(On,{text:n.ok?JSON.stringify(n.value,null,2):e}):(0,v.jsxs)(`div`,{children:[(0,v.jsxs)(`div`,{className:`flex gap-1 mb-2`,children:[(0,v.jsx)(`button`,{type:`button`,className:`px-2 py-0.5 text-[10px] rounded-md transition-colors ${r===`plain`?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>i(`plain`),children:`Plain`}),(0,v.jsx)(`button`,{type:`button`,className:`px-2 py-0.5 text-[10px] rounded-md transition-colors ${r===`pretty`?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>i(`pretty`),children:`Pretty`})]}),r===`pretty`?(0,v.jsx)(G,{value:n.value,style:vn,displayDataTypes:!1,enableClipboard:!0,collapsed:!1}):(0,v.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:JSON.stringify(n.value,null,2)})]})}function X({title:e,defaultOpen:t=!0,headerMetadata:n,onOpenChange:r,children:i}){let[a,o]=(0,_.useState)(t);return(0,v.jsxs)(`details`,{open:a,className:`group panel overflow-hidden`,onToggle:e=>{let t=e.currentTarget.open;o(t),r?.(t)},children:[(0,v.jsxs)(`summary`,{className:`panel-header flex min-w-0 items-center gap-1.5 whitespace-nowrap cursor-pointer select-none list-none px-4 py-2.5`,children:[(0,v.jsx)(K,{className:`size-3.5 shrink-0 text-sand-400 transition-transform group-open:rotate-0 -rotate-90`}),(0,v.jsx)(`span`,{className:`shrink-0 text-[11px] uppercase tracking-wider text-sand-500 font-medium`,children:e}),n&&(0,v.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden whitespace-nowrap text-[11px] normal-case text-sand-400`,children:n})]}),(0,v.jsx)(`div`,{className:`p-4`,children:i})]})}function Z({label:e,value:t}){return(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(`dt`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate`,children:e}),(0,v.jsx)(`dd`,{className:`text-[15px] font-semibold text-sand-800 tabular-nums mt-0.5 truncate`,children:t})]})}var kn={running:`bg-blue-100 text-blue-600`,succeeded:`bg-sage-100 text-sage-600`,error:`bg-red-100 text-red-600`,aborted:`bg-caution-400/15 text-caution-500`};function An({message:e}){return(0,v.jsxs)(`div`,{className:`panel overflow-hidden border border-red-200 bg-red-50/60`,children:[(0,v.jsx)(`div`,{className:`px-4 py-2.5 border-b border-red-100 flex items-center gap-1.5`,children:(0,v.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-red-600 font-medium`,children:`Error`})}),(0,v.jsx)(`div`,{className:`p-4`,children:(0,v.jsx)(`pre`,{className:`text-[12px] text-red-700 whitespace-pre-wrap break-words font-mono leading-relaxed max-h-80 overflow-auto`,children:e})})]})}function jn({data:e}){let t=e.status===`running`,n=m({status:e.status,requestedModel:e.requested_model_name,servedModel:e.model_name,imageCostMethod:e.image_cost_method}),r=!t&&e.requested_model_name!==null&&e.model_name===null;return(0,v.jsxs)(`div`,{className:`panel overflow-hidden px-4 py-3 flex flex-wrap items-center gap-x-2 gap-y-1.5 sm:px-5`,children:[(0,v.jsx)(`span`,{className:`text-[15px] font-semibold text-sand-900 break-all`,children:n.label===`—`?`Unknown model`:n.label}),r&&(0,v.jsx)(`span`,{className:`text-[10px] text-sand-400`,children:`요청`}),!t&&(e.fallback_count??0)>0&&(0,v.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase`,children:[`fallback ×`,e.fallback_count]}),!t&&e.status!==`succeeded`&&(0,v.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium uppercase ${kn[e.status]??`bg-sand-100 text-sand-500`}`,children:e.status}),e.response_json_ok===!1&&(0,v.jsx)(`span`,{title:`structured 요청의 응답이 JSON 파싱에 실패했습니다`,className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase`,children:`broken json`}),e.effort&&(0,v.jsxs)(`span`,{className:`text-[11px] px-1.5 py-0.5 rounded-md bg-sand-100 text-sand-500 font-mono`,children:[`effort=`,e.effort]}),e.project_name&&(0,v.jsxs)(`span`,{className:`text-[12px] text-sand-400`,children:[`· project=`,e.project_name]}),(0,v.jsx)(`span`,{className:`ml-auto text-[11px] text-sand-400`,children:e.token_name})]})}function Mn({data:e,toolCallCount:t}){let n=In(e);return(0,v.jsxs)(`div`,{className:`panel overflow-hidden px-5 py-3 space-y-3`,children:[(0,v.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3`,children:[(0,v.jsx)(Z,{label:`Duration`,value:`${(e.duration_ms/1e3).toFixed(1)}s`}),(0,v.jsx)(Z,{label:`TTFT`,value:Pn(e.ttft_ms)}),(0,v.jsx)(Z,{label:`Tokens/sec`,value:Ln(e.output_tokens,e.duration_ms,e.ttft_ms,n)}),(0,v.jsx)(Z,{label:`Driver Cost`,value:e.cost_usd===null?`—`:f(e.cost_usd)}),(0,v.jsx)(Z,{label:`Cost Source`,value:e.cost_source??`legacy`}),(0,v.jsx)(Z,{label:`Image Cost`,value:e.image_cost_usd===null?`—`:f(e.image_cost_usd)}),(0,v.jsx)(Z,{label:`Tool Calls`,value:`${t}회`})]}),(0,v.jsxs)(`div`,{className:`border-t border-sand-100/60 pt-3 grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3`,children:[(0,v.jsx)(Z,{label:`Input`,value:q(e.input_tokens)}),(0,v.jsx)(Z,{label:`Output`,value:q(e.output_tokens)}),(0,v.jsx)(Z,{label:`Cache Read`,value:q(e.cache_read_tokens)}),(0,v.jsx)(Z,{label:`Cache Write`,value:q(e.cache_creation_tokens)}),(0,v.jsx)(Z,{label:`Cache Write (5m)`,value:e.cache_creation_5m_tokens===null?`—`:q(e.cache_creation_5m_tokens)}),(0,v.jsx)(Z,{label:`Cache Write (1h)`,value:e.cache_creation_1h_tokens===null?`—`:q(e.cache_creation_1h_tokens)}),(0,v.jsx)(Z,{label:`Cache Hit`,value:p(e)})]})]})}function Nn(e){return e==null?`—`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function Pn(e){return e==null||e<=0?`—`:Nn(e)}function Fn(e){let t=e.model_name?.trim().toLowerCase();if(t){let e=t.includes(`/`)?t.split(`/`).pop():t;if(e.startsWith(`claude-`))return`anthropic`;if(/^(gpt-|codex-|o\d)/.test(e))return`openai`}let n=e.token_name?.trim().toLowerCase();return n?.startsWith(`anthropic/`)?`anthropic`:n?.startsWith(`openai/`)?`openai`:null}function In(e){let t=Fn(e);return t!==null&&Cn.has(t)}function Ln(e,t,n,r){if(!r||e==null||t==null||n==null||n<=0)return`—`;let i=t-n;return e<=0||i<=0?`—`:`${Math.round(e/(i/1e3)).toLocaleString()} tok/s`}function Q({label:e,value:t}){return(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate`,children:e}),(0,v.jsx)(`div`,{className:`mt-0.5 text-[13px] font-semibold text-sand-800 tabular-nums truncate`,children:t})]})}function Rn(e){if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e.inputImages;return Array.isArray(t)?t:void 0}function zn(e){return(Rn(e)??[]).filter(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.url==`string`&&t.url.length>0||typeof t.data==`string`&&t.data.length>0})}function Bn(e){if(!e||typeof e!=`object`||Array.isArray(e))return e;let t=e,n=Rn(t);return n?{...t,inputImages:n.map(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return e;let t=e,n=typeof t.url==`string`&&t.url.toLowerCase().startsWith(`data:`)?`[data-url ${t.url.length} chars]`:t.url;return{mediaType:t.mediaType,byteSize:t.byteSize,...n?{url:n}:{},...t.data?{data:`[base64 ${t.data.length} chars]`}:{}}})}:e}function Vn({images:e}){let t=e.map((e,t)=>{let n=e.url&&!e.url.startsWith(`[`)?e.url:void 0,r=e.data?`data:${e.mediaType??`image/png`};base64,${e.data}`:``,i=n??r;return i?{image:e,index:t,src:i}:null}).filter(e=>e!==null);return t.length===0?null:(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Input Images`}),(0,v.jsx)(`div`,{className:`mt-1 grid grid-cols-1 sm:grid-cols-2 gap-2`,children:t.map(({image:e,index:t,src:n})=>(0,v.jsxs)(`div`,{className:`rounded-md border border-sand-200 bg-white overflow-hidden`,children:[(0,v.jsx)(`img`,{src:n,alt:`reference ${t+1}`,className:`max-h-64 w-full object-contain bg-white`,loading:`lazy`}),(0,v.jsxs)(`div`,{className:`px-2 py-1 text-[10px] text-sand-500 font-mono border-t border-sand-100`,children:[e.mediaType??`image`,` ·`,` `,e.byteSize===void 0?`url`:`${e.byteSize.toLocaleString()} bytes`]})]},`${e.mediaType??`image`}-${t}`))})]})}function Hn({stepId:e}){let{data:t}=a.useRequestLogStep(`I`,e??0,{enabled:e!==null});return(0,v.jsx)(Vn,{images:zn(t?Tn(t.tool_args):null)})}function Un({entry:e}){let t=!!e.error,[n,r]=(0,_.useState)(!1),{data:i}=a.useRequestLogStep(`A`,e.id,{enabled:n}),o=Bn(i?Tn(i.tool_args):null),s=i?Tn(i.tool_result):null,c=i?.error??e.error;return(0,v.jsxs)(`details`,{className:`group/tool`,onToggle:e=>r(e.currentTarget.open),children:[(0,v.jsxs)(`summary`,{className:`flex items-center gap-2 px-3 py-2 cursor-pointer select-none list-none hover:bg-sand-50 transition-colors rounded-md`,children:[(0,v.jsx)(K,{className:`size-3 text-sand-400 transition-transform group-open/tool:rotate-0 -rotate-90 shrink-0`}),(0,v.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0`,children:[`call `,e.callIndex+1]}),(0,v.jsx)(`span`,{className:`text-[13px] font-medium text-sand-800 font-mono truncate`,children:e.toolName}),t&&(0,v.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0`,children:`error`}),(0,v.jsx)(`span`,{className:`ml-auto text-[11px] text-sand-400 tabular-nums shrink-0`,children:Nn(e.durationMs)})]}),n&&(0,v.jsxs)(`div`,{className:`mt-1 mx-1 mb-3 space-y-2`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Request`}),(0,v.jsx)(`div`,{className:`mt-1 rounded-md bg-sand-50 p-3 overflow-auto`,children:(0,v.jsx)(Y,{text:i?JSON.stringify(o):`Loading...`})})]}),c&&(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-red-500 font-medium px-2`,children:`Error`}),(0,v.jsx)(`div`,{className:`mt-1 rounded-md bg-red-50 border border-red-100 p-3 overflow-auto`,children:(0,v.jsx)(Y,{text:c})})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Response`}),(0,v.jsx)(`div`,{className:`mt-1 rounded-md bg-sand-50 p-3 overflow-auto`,children:(0,v.jsx)(Y,{text:i?typeof s==`string`?s:JSON.stringify(s):`Loading...`,markdown:!0})})]})]})]})}function Wn({stepId:e}){let[t,n]=(0,_.useState)(!1),{data:r}=a.useRequestLogStep(`A`,e,{enabled:t}),i=r?.reasoning_text??null;return(0,v.jsxs)(`details`,{className:`group/reason mt-3`,onToggle:e=>n(e.currentTarget.open),children:[(0,v.jsxs)(`summary`,{className:`flex items-center gap-2 cursor-pointer select-none list-none`,children:[(0,v.jsx)(K,{className:`size-3 text-sand-400 transition-transform group-open/reason:rotate-0 -rotate-90 shrink-0`}),(0,v.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Reasoning`})]}),t&&(0,v.jsx)(`div`,{className:`mt-2 rounded-md bg-white/70 border border-sand-100 p-3 overflow-auto`,children:i?(0,v.jsx)(Y,{text:i,markdown:!0}):r?(0,v.jsx)(`p`,{className:`text-sm text-sand-400`,children:`No reasoning text captured.`}):(0,v.jsx)(`p`,{className:`text-sm text-sand-400`,children:`Loading...`})})]})}function Gn({entry:e,tokensPerSecEnabled:t}){let n=e.generate,r=n!==null&&n.reasoningTokens!==null&&n.reasoningTokens!==void 0&&n.reasoningTokens>0,i=e.toolCalls.filter(e=>e.error).length;return(0,v.jsxs)(`details`,{open:!0,className:`group/step border-l border-sand-200 pl-3`,children:[(0,v.jsxs)(`summary`,{className:`flex items-center gap-2 py-2 cursor-pointer select-none list-none`,children:[(0,v.jsx)(K,{className:`size-3.5 text-sand-400 transition-transform group-open/step:rotate-0 -rotate-90 shrink-0`}),(0,v.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sienna-100 text-sienna-700 font-mono shrink-0`,children:[`step `,e.stepIndex+1]}),(0,v.jsx)(`span`,{className:`text-[13px] font-semibold text-sand-900`,children:`LLM call`}),n?.finishReason&&(0,v.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0`,children:n.finishReason}),n&&(n.fallbackCount??0)>0&&(0,v.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase shrink-0`,children:[n.requestedModelName,` → `,n.modelName]}),r&&(0,v.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-blue-100 text-blue-600 font-medium shrink-0`,children:`reasoning`}),i>0&&(0,v.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0`,children:[i,` error`]}),(0,v.jsxs)(`span`,{className:`ml-auto text-[11px] text-sand-400 tabular-nums shrink-0`,children:[e.toolCalls.length,` tools`]})]}),(0,v.jsxs)(`div`,{className:`ml-4 mb-4 space-y-3`,children:[n&&(0,v.jsxs)(`div`,{className:`rounded-md border border-sand-100 bg-sand-50/70 p-3`,children:[(0,v.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-8 gap-x-4 gap-y-3`,children:[(0,v.jsx)(Q,{label:`Duration`,value:Nn(n.durationMs)}),(0,v.jsx)(Q,{label:`TTFT`,value:Pn(n.ttftMs)}),(0,v.jsx)(Q,{label:`Tokens/sec`,value:Ln(n.outputTokens,n.durationMs,n.ttftMs,t)}),(0,v.jsx)(Q,{label:`Input`,value:q(n.inputTokens??0)}),(0,v.jsx)(Q,{label:`Output`,value:q(n.outputTokens??0)}),(0,v.jsx)(Q,{label:`Cache Read`,value:q(n.cacheReadTokens??0)}),(0,v.jsx)(Q,{label:`Cache Write`,value:q(n.cacheCreationTokens??0)}),(0,v.jsx)(Q,{label:`Cache 5m / 1h`,value:`${n.cacheCreation5mTokens===null?`—`:q(n.cacheCreation5mTokens)} / ${n.cacheCreation1hTokens===null?`—`:q(n.cacheCreation1hTokens)}`}),(0,v.jsx)(Q,{label:`Cost`,value:n.costUsd===null?`—`:f(n.costUsd)}),(0,v.jsx)(Q,{label:`Cost Source`,value:n.costSource??`legacy`}),(0,v.jsx)(Q,{label:`Reasoning`,value:n.reasoningTokens!==null&&n.reasoningTokens!==void 0?q(n.reasoningTokens):`—`})]}),r&&(0,v.jsx)(Wn,{stepId:n.id})]}),e.toolCalls.length>0&&(0,v.jsx)(`div`,{className:`space-y-0.5`,children:e.toolCalls.map(e=>(0,v.jsx)(Un,{entry:e},`${e.stepIndex}-${e.callIndex}-${e.toolCallId}`))})]})]})}function Kn({steps:e,tokensPerSecEnabled:t}){let n=e.reduce((e,t)=>e+t.toolCalls.length,0);return(0,v.jsx)(X,{title:`Steps (${e.length} steps · ${n} tool calls)`,defaultOpen:!0,children:(0,v.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>(0,v.jsx)(Gn,{entry:e,tokensPerSecEnabled:t},e.stepIndex))})})}function qn(e){let t=new Map;function n(e){let n=t.get(e);if(n)return n;let r={stepIndex:e,generate:null,toolCalls:[]};return t.set(e,r),r}for(let t of e){let e=n(t.step_index);if(t.type===`generate`){e.generate={id:t.id,stepIndex:t.step_index,modelName:t.model_name,requestedModelName:t.requested_model_name,fallbackCount:t.fallback_count,inputTokens:t.input_tokens,outputTokens:t.output_tokens,cacheReadTokens:t.cache_read_tokens,cacheCreationTokens:t.cache_creation_tokens,cacheCreation5mTokens:t.cache_creation_5m_tokens,cacheCreation1hTokens:t.cache_creation_1h_tokens,costUsd:t.cost_usd,costSource:t.cost_source,durationMs:t.duration_ms,ttftMs:t.ttft_ms,finishReason:t.finish_reason,reasoningTokens:t.reasoning_tokens};continue}t.type===`tool_call`&&e.toolCalls.push({id:t.id,stepIndex:t.step_index,callIndex:t.tool_call_index??e.toolCalls.length,toolCallId:t.tool_call_id??``,toolName:t.tool_name??``,durationMs:t.tool_duration_ms??0,error:t.error})}return[...t.values()].map(e=>({...e,toolCalls:e.toolCalls.toSorted((e,t)=>e.callIndex-t.callIndex)})).toSorted((e,t)=>e.stepIndex-t.stepIndex)}function Jn(e){return e.type===`function_call`||e.type===`function_call_output`?`bg-caution-400/10`:e.role===`assistant`?`bg-sage-50`:`bg-sand-50`}function Yn(e){return e.type===`function_call`?`fn: ${e.name??`unknown`}`:e.type===`function_call_output`?`fn result`:e.role??e.type}function Xn(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>typeof e==`object`&&e&&`text`in e?e.text:JSON.stringify(e)).join(`
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{_ as t,l as n}from"./vendor-tanstack-DJRQAbrY.js";import{i as r,r as i}from"./vendor-react-DH4kUfK2.js";import{i as a,r as o,u as s}from"./services.generated-Cbvg2sGQ.js";import{c,d as l,t as u,u as d}from"./index-BIC1sQxw.js";import{n as f,t as p}from"./cost-CpjVoAqp.js";import{t as m}from"./request-model-D4CZPmnG.js";function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(null,arguments)}function g(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _=e(r()),v=i(),y={},b=(0,_.createContext)(y),x=(e,t)=>h({},e,t),S=()=>(0,_.useContext)(b),C=(0,_.createContext)(()=>{});C.displayName=`JVR.DispatchShowTools`;function w(){return(0,_.useReducer)(x,y)}function T(){return(0,_.useContext)(C)}var E=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,v.jsx)(b.Provider,{value:t,children:(0,v.jsx)(C.Provider,{value:n,children:r})})};E.displayName=`JVR.ShowTools`;var D={},ee=(0,_.createContext)(D),te=(e,t)=>h({},e,t),O=()=>(0,_.useContext)(ee),ne=(0,_.createContext)(()=>{});ne.displayName=`JVR.DispatchExpands`;function re(){return(0,_.useReducer)(te,D)}function ie(){return(0,_.useContext)(ne)}var ae=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,v.jsx)(ee.Provider,{value:t,children:(0,v.jsx)(ne.Provider,{value:n,children:r})})};ae.displayName=`JVR.Expands`;var oe={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},se=(0,_.createContext)(oe),ce=(e,t)=>h({},e,t),k=()=>(0,_.useContext)(se),A=(0,_.createContext)(()=>{});A.displayName=`JVR.DispatchTypes`;function le(){return(0,_.useReducer)(ce,oe)}function ue(){return(0,_.useContext)(A)}function de(e){var{initial:t,dispatch:n,children:r}=e;return(0,v.jsx)(se.Provider,{value:t,children:(0,v.jsx)(A.Provider,{value:n,children:r})})}de.displayName=`JVR.Types`;var fe=[`style`];function pe(e){var{style:t}=e,n=g(e,fe);return(0,v.jsx)(`svg`,h({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:h({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,v.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}pe.displayName=`JVR.TriangleArrow`;var me={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,v.jsx)(pe,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},he=(0,_.createContext)(me),ge=(e,t)=>h({},e,t),j=()=>(0,_.useContext)(he),_e=(0,_.createContext)(()=>{});_e.displayName=`JVR.DispatchSymbols`;function ve(){return(0,_.useReducer)(ge,me)}function ye(){return(0,_.useContext)(_e)}var be=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,v.jsx)(he.Provider,{value:t,children:(0,v.jsx)(_e.Provider,{value:n,children:r})})};be.displayName=`JVR.Symbols`;var xe={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},Se=(0,_.createContext)(xe),Ce=(e,t)=>h({},e,t),M=()=>(0,_.useContext)(Se),we=(0,_.createContext)(()=>{});we.displayName=`JVR.DispatchSection`;function Te(){return(0,_.useReducer)(Ce,xe)}function Ee(){return(0,_.useContext)(we)}var De=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,v.jsx)(Se.Provider,{value:t,children:(0,v.jsx)(we.Provider,{value:n,children:r})})};De.displayName=`JVR.Section`;var Oe={objectSortKeys:!1,indentWidth:15},N=(0,_.createContext)(Oe);N.displayName=`JVR.Context`;var ke=(0,_.createContext)(()=>{});ke.displayName=`JVR.DispatchContext`;function Ae(e,t){return h({},e,t)}var P=()=>(0,_.useContext)(N),je=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,_.useReducer)(Ae,Object.assign({},Oe,n)),[o,s]=w(),[c,l]=re(),[u,d]=le(),[f,p]=ve(),[m,g]=Te();return(0,_.useEffect)(()=>a(h({},n)),[n]),(0,v.jsx)(N.Provider,{value:i,children:(0,v.jsx)(ke.Provider,{value:a,children:(0,v.jsx)(E,{initial:o,dispatch:s,children:(0,v.jsx)(ae,{initial:c,dispatch:l,children:(0,v.jsx)(de,{initial:h({},u,r),dispatch:d,children:(0,v.jsx)(be,{initial:f,dispatch:p,children:(0,v.jsx)(De,{initial:m,dispatch:g,children:t})})})})})})})};je.displayName=`JVR.Provider`;function Me(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var Ne=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],Pe=[`as`,`render`],Fe=[`as`,`render`],Ie=[`as`,`render`],Le=[`as`,`style`,`render`],Re=[`as`,`render`],ze=[`as`,`render`],Be=[`as`,`render`],Ve=[`as`,`render`],F=e=>{var{Quote:t={}}=j(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=g(e,Ne);if(n)return null;var{as:c,render:l}=t,u=g(t,Pe),d=c||`span`,f=h({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,v.jsx)(d,h({},f))};F.displayName=`JVR.Quote`;var I=e=>{var{ValueQuote:t={}}=j(),n=h({},(Me(e),e)),{as:r,render:i}=t,a=g(t,Fe),o=r||`span`,s=h({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,v.jsx)(o,h({},s))};I.displayName=`JVR.ValueQuote`;var He=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=j(),{as:o,render:s}=a,c=g(a,Ie),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,v.jsx)(l,h({},c))};He.displayName=`JVR.Colon`;var Ue=e=>{var{Arrow:t={}}=j(),n=O(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=g(t,Le),m=u||`span`,_=f&&typeof f==`function`,y=h({},p,{"data-expanded":l,style:h({},d,i)});return _&&f(y,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,v.jsx)(m,h({},p,{style:h({},d,i)}))};Ue.displayName=`JVR.Arrow`;var We=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=j(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=g(o,Re),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,v.jsx)(f,h({},d))}var{as:p,render:m}=s,_=g(s,ze),y=p||`span`;return m&&typeof m==`function`&&m(_,c)||(0,v.jsx)(y,h({},_))};We.displayName=`JVR.BracketsOpen`;var L=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=j();if(t){var{as:u,render:d}=c,f=g(c,Be),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,v.jsx)(p,h({},f))}var{as:m,render:_}=l,y=g(l,Ve),b=m||`span`;return _&&typeof _==`function`&&_(y,s)||(0,v.jsx)(b,h({},y))};L.displayName=`JVR.BracketsClose`;var Ge=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=O(),{collapsed:c,shouldExpandNodeInitially:l}=P(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},g={keyName:t,value:n,keys:o,parentValue:i},_=Array.isArray(n),y=n instanceof Set;return(0,v.jsx)(`div`,{style:m,children:(0,v.jsx)(L,h({isBrackets:_||y},g,{isVisiable:!0}))})};Ge.displayName=`JVR.NestedClose`;var Ke=[`as`,`render`],qe=[`as`,`render`],Je=[`as`,`render`],Ye=[`as`,`render`],Xe=[`as`,`render`],Ze=[`as`,`render`],Qe=[`as`,`render`],$e=[`as`,`render`],et=[`as`,`render`],tt=[`as`,`render`],nt=[`as`,`render`],rt=[`as`,`render`],it=[`as`,`render`],R=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},at=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=k();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=g(r,Ke);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,v.jsx)(a||`span`,h({},s))};at.displayName=`JVR.SetComp`;var ot=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=k();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=g(r,qe);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,v.jsx)(a||`span`,h({},s))};ot.displayName=`JVR.MapComp`;var z={opacity:.75,paddingRight:4},st=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=k(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=P(),{as:c,render:l}=i,u=g(i,Je),d=t,[f,p]=(0,_.useState)(o&&d.length>o);(0,_.useEffect)(()=>p(o&&d.length>o),[o]);var m=c||`span`,y=h({},z,i.style||{});o>0&&(u.style=h({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var b=f?``+d.slice(0,o)+s:d,x=l&&typeof l==`function`,S=x&&l(h({},u,{style:y}),{type:`type`,value:t,keyName:n,keys:r}),C=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,w=x&&l(h({},u,{children:b,className:C}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(S||(0,v.jsx)(m,h({},u,{style:y}))),w||(0,v.jsxs)(_.Fragment,{children:[(0,v.jsx)(I,{}),(0,v.jsx)(m,h({},u,{className:C,children:b})),(0,v.jsx)(I,{})]})]})};st.displayName=`JVR.TypeString`;var ct=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,Ye),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p||(0,v.jsx)(l,h({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};ct.displayName=`JVR.TypeTrue`;var lt=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,Xe),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p||(0,v.jsx)(l,h({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};lt.displayName=`JVR.TypeFalse`;var ut=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,Ze),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p||(0,v.jsx)(l,h({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};ut.displayName=`JVR.TypeFloat`;var dt=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,Qe),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p||(0,v.jsx)(l,h({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};dt.displayName=`JVR.TypeInt`;var ft=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,$e),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p||(0,v.jsx)(l,h({},c,{className:`w-rjv-value`,children:R(t?.toString())}))]})};ft.displayName=`JVR.TypeFloat`;var pt=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,et),l=o||`span`,u=h({},z,i.style),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p||(0,v.jsxs)(`a`,h({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,v.jsx)(I,{}),t?.href,(0,v.jsx)(I,{})]}))]})};pt.displayName=`JVR.TypeUrl`;var mt=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,tt),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,m=d&&s(h({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),m||(0,v.jsx)(l,h({},c,{className:`w-rjv-value`,children:p}))]})};mt.displayName=`JVR.TypeDate`;var ht=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,nt),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p]})};ht.displayName=`JVR.TypeUndefined`;var gt=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,rt),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p]})};gt.displayName=`JVR.TypeNull`;var _t=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=k(),{as:o,render:s}=i,c=g(i,it),l=o||`span`,u=h({},z,i.style||{}),d=s&&typeof s==`function`,f=d&&s(h({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(h({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,v.jsxs)(_.Fragment,{children:[a&&(f||(0,v.jsx)(l,h({},c,{style:u}))),p]})};_t.displayName=`JVR.TypeNan`;var vt=e=>Number(e)===e&&e%1!=0||isNaN(e),yt=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,v.jsx)(pt,h({},i,{children:t})):typeof t==`string`?(0,v.jsx)(st,h({},i,{children:t})):t===!0?(0,v.jsx)(ct,h({},i,{children:t})):t===!1?(0,v.jsx)(lt,h({},i,{children:t})):t===null?(0,v.jsx)(gt,h({},i,{children:t})):t===void 0?(0,v.jsx)(ht,h({},i,{children:t})):t instanceof Date?(0,v.jsx)(mt,h({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,v.jsx)(_t,h({},i,{children:t})):typeof t==`number`&&vt(t)?(0,v.jsx)(ut,h({},i,{children:t})):typeof t==`bigint`?(0,v.jsx)(ft,h({},i,{children:t})):typeof t==`number`?(0,v.jsx)(dt,h({},i,{children:t})):null};yt.displayName=`JVR.Value`;function B(e,t,n){var r=ye(),i=h({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:h({},e.style,t.style),children:t.children||e.children});(0,_.useEffect)(()=>r({[n]:i}),[t])}function V(e,t,n){var r=ue(),i=h({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:h({},e.style,t.style),children:t.children||e.children});(0,_.useEffect)(()=>r({[n]:i}),[t])}function H(e,t,n){var r=Ee(),i=h({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:h({},e.style,t.style),children:t.children||e.children});(0,_.useEffect)(()=>r({[n]:i}),[t])}var bt=[`as`,`render`],xt=e=>{var{KeyName:t={}}=M();return H(t,e,`KeyName`),null};xt.displayName=`JVR.KeyName`;var St=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=M(),{as:c,render:l}=s,u=g(s,bt);u.style=h({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(h({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,v.jsx)(d,h({},u,{children:t}))};St.displayName=`JVR.KeyNameComp`;var Ct=[`children`,`value`,`parentValue`,`keyName`,`keys`],wt=[`as`,`render`,`children`],Tt=e=>{var{Row:t={}}=M();return H(t,e,`Row`),null};Tt.displayName=`JVR.Row`;var Et=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=g(e,Ct),{Row:s={}}=M(),{as:c,render:l}=s,u=g(s,wt),d=c||`div`;return l&&typeof l==`function`&&l(h({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,v.jsx)(d,h({},o,u,{children:t}))};Et.displayName=`JVR.RowComp`;function Dt(e){var t=(0,_.useRef)();return(0,_.useEffect)(()=>{t.current=e}),t.current}function Ot(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=Dt(t),a=(0,_.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,_.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var kt=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],At=[`as`,`render`],U=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=g(e,kt),{onCopied:c,enableClipboard:l,beforeCopy:u}=P(),d=S()[i],[f,p]=(0,_.useState)(!1),{Copied:m={}}=M(),y=m?.beforeCopy;if(l===!1||!d)return null;var b={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?R(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?R(t):t,2);var l=o||y||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:x}=m,C=g(m,At),w=h({},C,s,b,{style:h({},C.style,s.style,b.style)});return x&&typeof x==`function`&&x(h({},w,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,v.jsx)(`svg`,h({viewBox:`0 0 32 36`},w,{children:(0,v.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,v.jsx)(`svg`,h({viewBox:`0 0 32 36`},w,{children:(0,v.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};U.displayName=`JVR.Copied`;function jt(){var e=(0,_.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var Mt=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=O(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=P(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,v.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,v.jsx)(Nt,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};Mt.displayName=`JVR.KeyValues`;var W=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=P(),o=typeof t==`number`,s=(0,_.useRef)(null);Ot({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,v.jsxs)(_.Fragment,{children:[(0,v.jsxs)(`span`,{ref:s,children:[(0,v.jsx)(F,h({isNumber:o,"data-placement":`left`},c)),(0,v.jsx)(St,h({},c,{children:t})),(0,v.jsx)(F,h({isNumber:o,"data-placement":`right`},c))]}),(0,v.jsx)(He,h({},c))]})};W.displayName=`JVR.KayName`;var Nt=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=T(),s=jt(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,v.jsx)(qt,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,v.jsxs)(Et,h({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,v.jsx)(W,{keyName:t,value:n,keys:a,parentValue:r}),(0,v.jsx)(yt,{keyName:t,value:n,keys:a}),(0,v.jsx)(U,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Nt.displayName=`JVR.KeyValuesItem`;var Pt=[`value`,`keyName`],Ft=[`as`,`render`],It=e=>{var{CountInfoExtra:t={}}=M();return H(t,e,`CountInfoExtra`),null};It.displayName=`JVR.CountInfoExtra`;var Lt=e=>{var{value:t={},keyName:n}=e,r=g(e,Pt),{CountInfoExtra:i={}}=M(),{as:a,render:o}=i,s=g(i,Ft);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=h({},s,r);return l&&o(u,{value:t,keyName:n})||(0,v.jsx)(c,h({},u))};Lt.displayName=`JVR.CountInfoExtraComps`;var Rt=[`value`,`keyName`],zt=[`as`,`render`],Bt=e=>{var{CountInfo:t={}}=M();return H(t,e,`CountInfo`),null};Bt.displayName=`JVR.CountInfo`;var Vt=e=>{var{value:t={},keyName:n}=e,r=g(e,Rt),{displayObjectSize:i}=P(),{CountInfo:a={}}=M();if(!i)return null;var{as:o,render:s}=a,c=g(a,zt),l=o||`span`;c.style=h({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=h({},c,r);return s&&typeof s==`function`&&s(h({},d,{"data-length":u}),{value:t,keyName:n})||(0,v.jsx)(l,h({},d))};Vt.displayName=`JVR.CountInfoComp`;var Ht=[`as`,`render`],Ut=e=>{var{Ellipsis:t={}}=M();return H(t,e,`Ellipsis`),null};Ut.displayName=`JVR.Ellipsis`;var Wt=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=M(),{as:a,render:o}=i,s=g(i,Ht),c=a||`span`;return o&&typeof o==`function`&&o(h({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,v.jsx)(c,h({},s)))};Wt.displayName=`JVR.EllipsisComp`;var Gt=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=O(),l=ie(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=P(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),g=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!g);var _=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},y={display:`inline-flex`,alignItems:`center`},b={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},x=Object.keys(a).length,S=typeof a==`object`,C=Array.isArray(a),w=a instanceof Set,T=x!==0&&(C||w||S),E={style:y};T&&(E.onClick=_);var D={keyName:t,value:a,keys:r,parentValue:o};return(0,v.jsxs)(`span`,h({},E,{children:[T&&(0,v.jsx)(Ue,h({style:b,expandKey:n},D)),(t||typeof t==`number`)&&(0,v.jsx)(W,h({},D)),(0,v.jsx)(at,{value:i,keyName:t}),(0,v.jsx)(ot,{value:i,keyName:t}),(0,v.jsx)(We,h({isBrackets:C||w},D)),(0,v.jsx)(Wt,{keyName:t,value:a,isExpanded:m}),(0,v.jsx)(L,h({isVisiable:m||!T,isBrackets:C||w},D)),(0,v.jsx)(Vt,{value:a,keyName:t}),(0,v.jsx)(Lt,{value:a,keyName:t}),(0,v.jsx)(U,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};Gt.displayName=`JVR.NestedOpen`;var Kt=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],qt=(0,_.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=g(e,Kt),u=T(),d=jt();return(0,v.jsxs)(`div`,h({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,v.jsx)(Gt,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,v.jsx)(Mt,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,v.jsx)(Ge,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});qt.displayName=`JVR.Container`;var Jt=e=>{var{BraceLeft:t={}}=j();return B(t,e,`BraceLeft`),null};Jt.displayName=`JVR.BraceLeft`;var Yt=e=>{var{BraceRight:t={}}=j();return B(t,e,`BraceRight`),null};Yt.displayName=`JVR.BraceRight`;var Xt=e=>{var{BracketsLeft:t={}}=j();return B(t,e,`BracketsLeft`),null};Xt.displayName=`JVR.BracketsLeft`;var Zt=e=>{var{BracketsRight:t={}}=j();return B(t,e,`BracketsRight`),null};Zt.displayName=`JVR.BracketsRight`;var Qt=e=>{var{Arrow:t={}}=j();return B(t,e,`Arrow`),null};Qt.displayName=`JVR.Arrow`;var $t=e=>{var{Colon:t={}}=j();return B(t,e,`Colon`),null};$t.displayName=`JVR.Colon`;var en=e=>{var{Quote:t={}}=j();return B(t,e,`Quote`),null};en.displayName=`JVR.Quote`;var tn=e=>{var{ValueQuote:t={}}=j();return B(t,e,`ValueQuote`),null};tn.displayName=`JVR.ValueQuote`;var nn=e=>{var{Bigint:t={}}=k();return V(t,e,`Bigint`),null};nn.displayName=`JVR.Bigint`;var rn=e=>{var{Date:t={}}=k();return V(t,e,`Date`),null};rn.displayName=`JVR.Date`;var an=e=>{var{False:t={}}=k();return V(t,e,`False`),null};an.displayName=`JVR.False`;var on=e=>{var{Float:t={}}=k();return V(t,e,`Float`),null};on.displayName=`JVR.Float`;var sn=e=>{var{Int:t={}}=k();return V(t,e,`Int`),null};sn.displayName=`JVR.Int`;var cn=e=>{var{Map:t={}}=k();return V(t,e,`Map`),null};cn.displayName=`JVR.Map`;var ln=e=>{var{Nan:t={}}=k();return V(t,e,`Nan`),null};ln.displayName=`JVR.Nan`;var un=e=>{var{Null:t={}}=k();return V(t,e,`Null`),null};un.displayName=`JVR.Null`;var dn=e=>{var{Set:t={}}=k();return V(t,e,`Set`),null};dn.displayName=`JVR.Set`;var fn=e=>{var{Str:t={}}=k();return V(t,e,`Str`),null};fn.displayName=`JVR.StringText`;var pn=e=>{var{True:t={}}=k();return V(t,e,`True`),null};pn.displayName=`JVR.True`;var mn=e=>{var{Undefined:t={}}=k();return V(t,e,`Undefined`),null};mn.displayName=`JVR.Undefined`;var hn=e=>{var{Url:t={}}=k();return V(t,e,`Url`),null};hn.displayName=`JVR.Url`;var gn=e=>{var{Copied:t={}}=M();return H(t,e,`Copied`),null};gn.displayName=`JVR.Copied`;var _n=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],G=(0,_.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:_=!1,onExpand:y,onCopied:b,beforeCopy:x}=e,S=g(e,_n),C=h({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),w=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,v.jsxs)(je,{initialState:{value:i,objectSortKeys:_,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:b,onExpand:y,beforeCopy:x},initialTypes:{displayDataTypes:m},children:[(0,v.jsx)(qt,h({value:i},S,{ref:t,className:w,style:C})),a]})});G.Bigint=nn,G.Date=rn,G.False=an,G.Float=on,G.Int=sn,G.Map=cn,G.Nan=ln,G.Null=un,G.Set=dn,G.String=fn,G.True=pn,G.Undefined=mn,G.Url=hn,G.ValueQuote=tn,G.Arrow=Qt,G.Colon=$t,G.Quote=en,G.Ellipsis=Ut,G.BraceLeft=Jt,G.BraceRight=Yt,G.BracketsLeft=Xt,G.BracketsRight=Zt,G.Copied=gn,G.CountInfo=Bt,G.CountInfoExtra=It,G.KeyName=xt,G.Row=Tt,G.displayName=`JVR.JsonView`;var vn={"--w-rjv-font-family":`monospace`,"--w-rjv-color":`#002b36`,"--w-rjv-key-string":`#002b36`,"--w-rjv-background-color":`#ffffff`,"--w-rjv-line-color":`#ebebeb`,"--w-rjv-arrow-color":`var(--w-rjv-color)`,"--w-rjv-edit-color":`var(--w-rjv-color)`,"--w-rjv-info-color":`#0000004d`,"--w-rjv-update-color":`#ebcb8b`,"--w-rjv-copied-color":`#002b36`,"--w-rjv-copied-success-color":`#28a745`,"--w-rjv-curlybraces-color":`#236a7c`,"--w-rjv-colon-color":`#002b36`,"--w-rjv-brackets-color":`#236a7c`,"--w-rjv-quotes-color":`var(--w-rjv-key-string)`,"--w-rjv-quotes-string-color":`var(--w-rjv-type-string-color)`,"--w-rjv-type-string-color":`#cb4b16`,"--w-rjv-type-int-color":`#268bd2`,"--w-rjv-type-float-color":`#859900`,"--w-rjv-type-bigint-color":`#268bd2`,"--w-rjv-type-boolean-color":`#2aa198`,"--w-rjv-type-date-color":`#586e75`,"--w-rjv-type-url-color":`#0969da`,"--w-rjv-type-null-color":`#d33682`,"--w-rjv-type-nan-color":`#859900`,"--w-rjv-type-undefined-color":`#586e75`},yn=e=>(0,v.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,v.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m12 19l-7-7l7-7m7 7H5`})}),bn=e=>(0,v.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,v.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M20 6L9 17l-5-5`})}),K=e=>(0,v.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,v.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m6 9l6 6l6-6`})}),xn=e=>(0,v.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,v.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,v.jsx)(`rect`,{width:14,height:14,x:8,y:8,rx:2,ry:2}),(0,v.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]})});function Sn(){let{id:e}=u.useSearch();return(0,v.jsx)(lr,{id:e})}function q(e){return e.toLocaleString()}var Cn=new Set;function wn(e){try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}}function Tn(e){if(!e)return{};try{return JSON.parse(e)}catch{return e}}function J({text:e,dark:t}){let[n,r]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>r(!1),1500);return()=>clearTimeout(e)},[n]),(0,v.jsx)(`button`,{type:`button`,className:`absolute top-2 right-2 p-1 rounded transition-colors ${t?`text-sand-500 hover:text-sand-300`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>{navigator.clipboard.writeText(e),r(!0)},children:n?(0,v.jsx)(bn,{className:`size-3.5 text-sage-500`}):(0,v.jsx)(xn,{className:`size-3.5`})})}var En=/<img\s+[^>]*src=["'](data:image\/[^"']+;base64,[^"']+)["'][^>]*(?:alt=["']([^"']*)["'][^>]*)?\/?>/gi;function Dn(e){let t=[],n=0;for(let r of e.matchAll(En)){let i=r.index??0;i>n&&t.push({type:`text`,text:e.slice(n,i)}),t.push({type:`image`,src:r[1],alt:r[2]??`generated image`}),n=i+r[0].length}return n<e.length&&t.push({type:`text`,text:e.slice(n)}),t.filter(e=>e.type===`image`||e.text.trim().length>0)}function On({text:e,markdown:t}){let[n,r]=(0,_.useState)(null),i=Dn(e);return i.some(e=>e.type===`image`)?(0,v.jsxs)(`div`,{className:`space-y-3`,children:[i.map((e,n)=>e.type===`text`?t?(0,v.jsx)(`div`,{className:`prose prose-sm prose-qgrid max-w-none`,children:(0,v.jsx)(l,{remarkPlugins:[d],children:e.text})},`text-${n}`):(0,v.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:e.text},`text-${n}`):(0,v.jsx)(`button`,{type:`button`,className:`block max-w-full rounded-md border border-sand-200 overflow-hidden bg-white hover:border-sienna-300 transition-colors`,onClick:()=>r(e.src),title:`Open image`,children:(0,v.jsx)(`img`,{src:e.src,alt:e.alt,className:`max-h-[520px] max-w-full object-contain`,loading:`lazy`})},`image-${n}`)),n&&(0,v.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-black/70 p-4 flex items-center justify-center`,onClick:()=>r(null),children:[(0,v.jsx)(`button`,{type:`button`,className:`absolute top-4 right-4 p-2 rounded-full bg-white/90 text-sand-700 hover:bg-white`,onClick:()=>r(null),title:`Close image`,children:(0,v.jsx)(c,{className:`size-5`})}),(0,v.jsx)(`img`,{src:n,alt:`generated preview`,className:`max-h-full max-w-full object-contain rounded-md bg-white`,onClick:e=>e.stopPropagation()})]})]}):t?(0,v.jsx)(`div`,{className:`prose prose-sm prose-qgrid max-w-none`,children:(0,v.jsx)(l,{remarkPlugins:[d],children:e})}):(0,v.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:e})}function Y({text:e,markdown:t}){let n=wn(e),[r,i]=(0,_.useState)(`pretty`),a=n.ok&&n.value!==null&&(Array.isArray(n.value)||typeof n.value==`object`);return!n.ok||!a?t?(0,v.jsx)(On,{text:e,markdown:!0}):(0,v.jsx)(On,{text:n.ok?JSON.stringify(n.value,null,2):e}):(0,v.jsxs)(`div`,{children:[(0,v.jsxs)(`div`,{className:`flex gap-1 mb-2`,children:[(0,v.jsx)(`button`,{type:`button`,className:`px-2 py-0.5 text-[10px] rounded-md transition-colors ${r===`plain`?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>i(`plain`),children:`Plain`}),(0,v.jsx)(`button`,{type:`button`,className:`px-2 py-0.5 text-[10px] rounded-md transition-colors ${r===`pretty`?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600`}`,onClick:()=>i(`pretty`),children:`Pretty`})]}),r===`pretty`?(0,v.jsx)(G,{value:n.value,style:vn,displayDataTypes:!1,enableClipboard:!0,collapsed:!1}):(0,v.jsx)(`pre`,{className:`text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed`,children:JSON.stringify(n.value,null,2)})]})}function X({title:e,defaultOpen:t=!0,headerMetadata:n,onOpenChange:r,children:i}){let[a,o]=(0,_.useState)(t);return(0,v.jsxs)(`details`,{open:a,className:`group panel overflow-hidden`,onToggle:e=>{let t=e.currentTarget.open;o(t),r?.(t)},children:[(0,v.jsxs)(`summary`,{className:`panel-header flex min-w-0 items-center gap-1.5 whitespace-nowrap cursor-pointer select-none list-none px-4 py-2.5`,children:[(0,v.jsx)(K,{className:`size-3.5 shrink-0 text-sand-400 transition-transform group-open:rotate-0 -rotate-90`}),(0,v.jsx)(`span`,{className:`shrink-0 text-[11px] uppercase tracking-wider text-sand-500 font-medium`,children:e}),n&&(0,v.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden whitespace-nowrap text-[11px] normal-case text-sand-400`,children:n})]}),(0,v.jsx)(`div`,{className:`p-4`,children:i})]})}function Z({label:e,value:t}){return(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(`dt`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate`,children:e}),(0,v.jsx)(`dd`,{className:`text-[15px] font-semibold text-sand-800 tabular-nums mt-0.5 truncate`,children:t})]})}var kn={running:`bg-blue-100 text-blue-600`,succeeded:`bg-sage-100 text-sage-600`,error:`bg-red-100 text-red-600`,aborted:`bg-caution-400/15 text-caution-500`};function An({message:e}){return(0,v.jsxs)(`div`,{className:`panel overflow-hidden border border-red-200 bg-red-50/60`,children:[(0,v.jsx)(`div`,{className:`px-4 py-2.5 border-b border-red-100 flex items-center gap-1.5`,children:(0,v.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-red-600 font-medium`,children:`Error`})}),(0,v.jsx)(`div`,{className:`p-4`,children:(0,v.jsx)(`pre`,{className:`text-[12px] text-red-700 whitespace-pre-wrap break-words font-mono leading-relaxed max-h-80 overflow-auto`,children:e})})]})}function jn({data:e}){let t=e.status===`running`,n=m({status:e.status,requestedModel:e.requested_model_name,servedModel:e.model_name,imageCostMethod:e.image_cost_method}),r=!t&&e.requested_model_name!==null&&e.model_name===null;return(0,v.jsxs)(`div`,{className:`panel overflow-hidden px-4 py-3 flex flex-wrap items-center gap-x-2 gap-y-1.5 sm:px-5`,children:[(0,v.jsx)(`span`,{className:`text-[15px] font-semibold text-sand-900 break-all`,children:n.label===`—`?`Unknown model`:n.label}),r&&(0,v.jsx)(`span`,{className:`text-[10px] text-sand-400`,children:`요청`}),!t&&(e.fallback_count??0)>0&&(0,v.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase`,children:[`fallback ×`,e.fallback_count]}),!t&&e.status!==`succeeded`&&(0,v.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium uppercase ${kn[e.status]??`bg-sand-100 text-sand-500`}`,children:e.status}),e.response_json_ok===!1&&(0,v.jsx)(`span`,{title:`structured 요청의 응답이 JSON 파싱에 실패했습니다`,className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase`,children:`broken json`}),e.effort&&(0,v.jsxs)(`span`,{className:`text-[11px] px-1.5 py-0.5 rounded-md bg-sand-100 text-sand-500 font-mono`,children:[`effort=`,e.effort]}),e.project_name&&(0,v.jsxs)(`span`,{className:`text-[12px] text-sand-400`,children:[`· project=`,e.project_name]}),(0,v.jsx)(`span`,{className:`ml-auto text-[11px] text-sand-400`,children:e.token_name})]})}function Mn({data:e,toolCallCount:t}){let n=In(e);return(0,v.jsxs)(`div`,{className:`panel overflow-hidden px-5 py-3 space-y-3`,children:[(0,v.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3`,children:[(0,v.jsx)(Z,{label:`Duration`,value:`${(e.duration_ms/1e3).toFixed(1)}s`}),(0,v.jsx)(Z,{label:`TTFT`,value:Pn(e.ttft_ms)}),(0,v.jsx)(Z,{label:`Tokens/sec`,value:Ln(e.output_tokens,e.duration_ms,e.ttft_ms,n)}),(0,v.jsx)(Z,{label:`Driver Cost`,value:e.cost_usd===null?`—`:f(e.cost_usd)}),(0,v.jsx)(Z,{label:`Cost Source`,value:e.cost_source??`legacy`}),(0,v.jsx)(Z,{label:`Image Cost`,value:e.image_cost_usd===null?`—`:f(e.image_cost_usd)}),(0,v.jsx)(Z,{label:`Tool Calls`,value:`${t}회`})]}),(0,v.jsxs)(`div`,{className:`border-t border-sand-100/60 pt-3 grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3`,children:[(0,v.jsx)(Z,{label:`Input`,value:q(e.input_tokens)}),(0,v.jsx)(Z,{label:`Output`,value:q(e.output_tokens)}),(0,v.jsx)(Z,{label:`Cache Read`,value:q(e.cache_read_tokens)}),(0,v.jsx)(Z,{label:`Cache Write`,value:q(e.cache_creation_tokens)}),(0,v.jsx)(Z,{label:`Cache Write (5m)`,value:e.cache_creation_5m_tokens===null?`—`:q(e.cache_creation_5m_tokens)}),(0,v.jsx)(Z,{label:`Cache Write (1h)`,value:e.cache_creation_1h_tokens===null?`—`:q(e.cache_creation_1h_tokens)}),(0,v.jsx)(Z,{label:`Cache Hit`,value:p(e)})]})]})}function Nn(e){return e==null?`—`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function Pn(e){return e==null||e<=0?`—`:Nn(e)}function Fn(e){let t=e.model_name?.trim().toLowerCase();if(t){let e=t.includes(`/`)?t.split(`/`).pop():t;if(e.startsWith(`claude-`))return`anthropic`;if(/^(gpt-|codex-|o\d)/.test(e))return`openai`}let n=e.token_name?.trim().toLowerCase();return n?.startsWith(`anthropic/`)?`anthropic`:n?.startsWith(`openai/`)?`openai`:null}function In(e){let t=Fn(e);return t!==null&&Cn.has(t)}function Ln(e,t,n,r){if(!r||e==null||t==null||n==null||n<=0)return`—`;let i=t-n;return e<=0||i<=0?`—`:`${Math.round(e/(i/1e3)).toLocaleString()} tok/s`}function Q({label:e,value:t}){return(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate`,children:e}),(0,v.jsx)(`div`,{className:`mt-0.5 text-[13px] font-semibold text-sand-800 tabular-nums truncate`,children:t})]})}function Rn(e){if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e.inputImages;return Array.isArray(t)?t:void 0}function zn(e){return(Rn(e)??[]).filter(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.url==`string`&&t.url.length>0||typeof t.data==`string`&&t.data.length>0})}function Bn(e){if(!e||typeof e!=`object`||Array.isArray(e))return e;let t=e,n=Rn(t);return n?{...t,inputImages:n.map(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return e;let t=e,n=typeof t.url==`string`&&t.url.toLowerCase().startsWith(`data:`)?`[data-url ${t.url.length} chars]`:t.url;return{mediaType:t.mediaType,byteSize:t.byteSize,...n?{url:n}:{},...t.data?{data:`[base64 ${t.data.length} chars]`}:{}}})}:e}function Vn({images:e}){let t=e.map((e,t)=>{let n=e.url&&!e.url.startsWith(`[`)?e.url:void 0,r=e.data?`data:${e.mediaType??`image/png`};base64,${e.data}`:``,i=n??r;return i?{image:e,index:t,src:i}:null}).filter(e=>e!==null);return t.length===0?null:(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Input Images`}),(0,v.jsx)(`div`,{className:`mt-1 grid grid-cols-1 sm:grid-cols-2 gap-2`,children:t.map(({image:e,index:t,src:n})=>(0,v.jsxs)(`div`,{className:`rounded-md border border-sand-200 bg-white overflow-hidden`,children:[(0,v.jsx)(`img`,{src:n,alt:`reference ${t+1}`,className:`max-h-64 w-full object-contain bg-white`,loading:`lazy`}),(0,v.jsxs)(`div`,{className:`px-2 py-1 text-[10px] text-sand-500 font-mono border-t border-sand-100`,children:[e.mediaType??`image`,` ·`,` `,e.byteSize===void 0?`url`:`${e.byteSize.toLocaleString()} bytes`]})]},`${e.mediaType??`image`}-${t}`))})]})}function Hn({stepId:e}){let{data:t}=a.useRequestLogStep(`I`,e??0,{enabled:e!==null});return(0,v.jsx)(Vn,{images:zn(t?Tn(t.tool_args):null)})}function Un({entry:e}){let t=!!e.error,[n,r]=(0,_.useState)(!1),{data:i}=a.useRequestLogStep(`A`,e.id,{enabled:n}),o=Bn(i?Tn(i.tool_args):null),s=i?Tn(i.tool_result):null,c=i?.error??e.error;return(0,v.jsxs)(`details`,{className:`group/tool`,onToggle:e=>r(e.currentTarget.open),children:[(0,v.jsxs)(`summary`,{className:`flex items-center gap-2 px-3 py-2 cursor-pointer select-none list-none hover:bg-sand-50 transition-colors rounded-md`,children:[(0,v.jsx)(K,{className:`size-3 text-sand-400 transition-transform group-open/tool:rotate-0 -rotate-90 shrink-0`}),(0,v.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0`,children:[`call `,e.callIndex+1]}),(0,v.jsx)(`span`,{className:`text-[13px] font-medium text-sand-800 font-mono truncate`,children:e.toolName}),t&&(0,v.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0`,children:`error`}),(0,v.jsx)(`span`,{className:`ml-auto text-[11px] text-sand-400 tabular-nums shrink-0`,children:Nn(e.durationMs)})]}),n&&(0,v.jsxs)(`div`,{className:`mt-1 mx-1 mb-3 space-y-2`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Request`}),(0,v.jsx)(`div`,{className:`mt-1 rounded-md bg-sand-50 p-3 overflow-auto`,children:(0,v.jsx)(Y,{text:i?JSON.stringify(o):`Loading...`})})]}),c&&(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-red-500 font-medium px-2`,children:`Error`}),(0,v.jsx)(`div`,{className:`mt-1 rounded-md bg-red-50 border border-red-100 p-3 overflow-auto`,children:(0,v.jsx)(Y,{text:c})})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2`,children:`Response`}),(0,v.jsx)(`div`,{className:`mt-1 rounded-md bg-sand-50 p-3 overflow-auto`,children:(0,v.jsx)(Y,{text:i?typeof s==`string`?s:JSON.stringify(s):`Loading...`,markdown:!0})})]})]})]})}function Wn({stepId:e}){let[t,n]=(0,_.useState)(!1),{data:r}=a.useRequestLogStep(`A`,e,{enabled:t}),i=r?.reasoning_text??null;return(0,v.jsxs)(`details`,{className:`group/reason mt-3`,onToggle:e=>n(e.currentTarget.open),children:[(0,v.jsxs)(`summary`,{className:`flex items-center gap-2 cursor-pointer select-none list-none`,children:[(0,v.jsx)(K,{className:`size-3 text-sand-400 transition-transform group-open/reason:rotate-0 -rotate-90 shrink-0`}),(0,v.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Reasoning`})]}),t&&(0,v.jsx)(`div`,{className:`mt-2 rounded-md bg-white/70 border border-sand-100 p-3 overflow-auto`,children:i?(0,v.jsx)(Y,{text:i,markdown:!0}):r?(0,v.jsx)(`p`,{className:`text-sm text-sand-400`,children:`No reasoning text captured.`}):(0,v.jsx)(`p`,{className:`text-sm text-sand-400`,children:`Loading...`})})]})}function Gn({entry:e,tokensPerSecEnabled:t}){let n=e.generate,r=n!==null&&n.reasoningTokens!==null&&n.reasoningTokens!==void 0&&n.reasoningTokens>0,i=e.toolCalls.filter(e=>e.error).length;return(0,v.jsxs)(`details`,{open:!0,className:`group/step border-l border-sand-200 pl-3`,children:[(0,v.jsxs)(`summary`,{className:`flex items-center gap-2 py-2 cursor-pointer select-none list-none`,children:[(0,v.jsx)(K,{className:`size-3.5 text-sand-400 transition-transform group-open/step:rotate-0 -rotate-90 shrink-0`}),(0,v.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sienna-100 text-sienna-700 font-mono shrink-0`,children:[`step `,e.stepIndex+1]}),(0,v.jsx)(`span`,{className:`text-[13px] font-semibold text-sand-900`,children:`LLM call`}),n?.finishReason&&(0,v.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0`,children:n.finishReason}),n&&(n.fallbackCount??0)>0&&(0,v.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase shrink-0`,children:[n.requestedModelName,` → `,n.modelName]}),r&&(0,v.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-blue-100 text-blue-600 font-medium shrink-0`,children:`reasoning`}),i>0&&(0,v.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0`,children:[i,` error`]}),(0,v.jsxs)(`span`,{className:`ml-auto text-[11px] text-sand-400 tabular-nums shrink-0`,children:[e.toolCalls.length,` tools`]})]}),(0,v.jsxs)(`div`,{className:`ml-4 mb-4 space-y-3`,children:[n&&(0,v.jsxs)(`div`,{className:`rounded-md border border-sand-100 bg-sand-50/70 p-3`,children:[(0,v.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-8 gap-x-4 gap-y-3`,children:[(0,v.jsx)(Q,{label:`Duration`,value:Nn(n.durationMs)}),(0,v.jsx)(Q,{label:`TTFT`,value:Pn(n.ttftMs)}),(0,v.jsx)(Q,{label:`Tokens/sec`,value:Ln(n.outputTokens,n.durationMs,n.ttftMs,t)}),(0,v.jsx)(Q,{label:`Input`,value:q(n.inputTokens??0)}),(0,v.jsx)(Q,{label:`Output`,value:q(n.outputTokens??0)}),(0,v.jsx)(Q,{label:`Cache Read`,value:q(n.cacheReadTokens??0)}),(0,v.jsx)(Q,{label:`Cache Write`,value:q(n.cacheCreationTokens??0)}),(0,v.jsx)(Q,{label:`Cache 5m / 1h`,value:`${n.cacheCreation5mTokens===null?`—`:q(n.cacheCreation5mTokens)} / ${n.cacheCreation1hTokens===null?`—`:q(n.cacheCreation1hTokens)}`}),(0,v.jsx)(Q,{label:`Cost`,value:n.costUsd===null?`—`:f(n.costUsd)}),(0,v.jsx)(Q,{label:`Cost Source`,value:n.costSource??`legacy`}),(0,v.jsx)(Q,{label:`Reasoning`,value:n.reasoningTokens!==null&&n.reasoningTokens!==void 0?q(n.reasoningTokens):`—`})]}),r&&(0,v.jsx)(Wn,{stepId:n.id})]}),e.toolCalls.length>0&&(0,v.jsx)(`div`,{className:`space-y-0.5`,children:e.toolCalls.map(e=>(0,v.jsx)(Un,{entry:e},`${e.stepIndex}-${e.callIndex}-${e.toolCallId}`))})]})]})}function Kn({steps:e,tokensPerSecEnabled:t}){let n=e.reduce((e,t)=>e+t.toolCalls.length,0);return(0,v.jsx)(X,{title:`Steps (${e.length} steps · ${n} tool calls)`,defaultOpen:!0,children:(0,v.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>(0,v.jsx)(Gn,{entry:e,tokensPerSecEnabled:t},e.stepIndex))})})}function qn(e){let t=new Map;function n(e){let n=t.get(e);if(n)return n;let r={stepIndex:e,generate:null,toolCalls:[]};return t.set(e,r),r}for(let t of e){let e=n(t.step_index);if(t.type===`generate`){e.generate={id:t.id,stepIndex:t.step_index,modelName:t.model_name,requestedModelName:t.requested_model_name,fallbackCount:t.fallback_count,inputTokens:t.input_tokens,outputTokens:t.output_tokens,cacheReadTokens:t.cache_read_tokens,cacheCreationTokens:t.cache_creation_tokens,cacheCreation5mTokens:t.cache_creation_5m_tokens,cacheCreation1hTokens:t.cache_creation_1h_tokens,costUsd:t.cost_usd,costSource:t.cost_source,durationMs:t.duration_ms,ttftMs:t.ttft_ms,finishReason:t.finish_reason,reasoningTokens:t.reasoning_tokens};continue}t.type===`tool_call`&&e.toolCalls.push({id:t.id,stepIndex:t.step_index,callIndex:t.tool_call_index??e.toolCalls.length,toolCallId:t.tool_call_id??``,toolName:t.tool_name??``,durationMs:t.tool_duration_ms??0,error:t.error})}return[...t.values()].map(e=>({...e,toolCalls:e.toolCalls.toSorted((e,t)=>e.callIndex-t.callIndex)})).toSorted((e,t)=>e.stepIndex-t.stepIndex)}function Jn(e){return e.type===`function_call`||e.type===`function_call_output`?`bg-caution-400/10`:e.role===`assistant`?`bg-sage-50`:`bg-sand-50`}function Yn(e){return e.type===`function_call`?`fn: ${e.name??`unknown`}`:e.type===`function_call_output`?`fn result`:e.role??e.type}function Xn(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>typeof e==`object`&&e&&`text`in e?e.text:JSON.stringify(e)).join(`
|
|
2
2
|
`):JSON.stringify(e)}function $({className:e,children:t}){return(0,v.jsx)(`pre`,{className:`text-[12px] text-sand-700 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed max-h-40 overflow-auto ${e??``}`,children:t})}function Zn({history:e}){return(0,v.jsx)(X,{title:`History`,defaultOpen:!1,children:(0,v.jsx)(`div`,{className:`space-y-1.5`,children:e.map((e,t)=>(0,v.jsxs)(`div`,{className:`rounded-md px-3 py-2 ${Jn(e)}`,children:[(0,v.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium mb-1`,children:Yn(e)}),e.content!==null&&e.content!==void 0&&(0,v.jsx)($,{children:Xn(e.content)}),e.arguments&&(0,v.jsx)($,{children:e.arguments}),e.output&&(0,v.jsx)($,{children:e.output})]},`hist-${t}`))})})}var Qn=60,$n=30,er=18;function tr(e,t=Qn){let n=[];for(let r of e){if([...n,r.name].join(`, `).length>t)break;n.push(r.name)}return{names:n,omittedCount:e.length-n.length}}function nr({tools:e}){let t=tr(e),n=tr(e,$n),r=tr(e,er);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`span`,{className:`shrink-0`,children:`·`}),t.names.length>0&&(0,v.jsx)(`span`,{className:`hidden shrink-0 xl:inline`,children:t.names.join(`, `)}),t.omittedCount>0&&(0,v.jsxs)(`span`,{className:`hidden shrink-0 xl:inline`,children:[`+`,t.omittedCount]}),n.names.length>0&&(0,v.jsx)(`span`,{className:`hidden shrink-0 sm:inline xl:hidden`,children:n.names.join(`, `)}),n.omittedCount>0&&(0,v.jsxs)(`span`,{className:`hidden shrink-0 sm:inline xl:hidden`,children:[`+`,n.omittedCount]}),r.names.length>0&&(0,v.jsx)(`span`,{className:`shrink-0 sm:hidden`,children:r.names.join(`, `)}),r.omittedCount>0&&(0,v.jsxs)(`span`,{className:`shrink-0 sm:hidden`,children:[`+`,r.omittedCount]})]})}function rr({code:e,fullCode:t}){let n=(0,_.useMemo)(()=>sr(e),[e]);return(0,v.jsx)(`pre`,{"data-zod-parameter-shape":!0,className:`max-h-64 overflow-auto rounded-md bg-sand-900 px-3 py-2.5 font-mono text-[11px] leading-relaxed whitespace-pre text-sand-200 ${t?`cursor-help outline-none focus-visible:ring-2 focus-visible:ring-sienna-300`:``}`,tabIndex:t?0:void 0,title:t,children:t?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`span`,{"aria-hidden":`true`,children:n}),(0,v.jsx)(`span`,{className:`sr-only`,children:t})]}):n})}function ir({tool:e}){return(0,v.jsxs)(`div`,{className:`min-w-0 rounded-md border border-sand-100 bg-sand-50/70 p-3`,children:[(0,v.jsx)(`div`,{className:`break-all font-mono text-[13px] font-semibold text-sand-900`,children:e.name}),e.description&&(0,v.jsx)(`p`,{className:`mt-2 text-[12px] leading-relaxed text-sand-700`,children:e.description}),(0,v.jsxs)(`div`,{className:`mt-3`,children:[(0,v.jsxs)(`div`,{className:`mb-1.5 text-[10px] font-medium uppercase tracking-wider text-sand-400`,children:[`Parameters (`,e.parameterCount,`)`]}),(0,v.jsx)(rr,{code:e.inputZod,fullCode:e.fullInputZod})]})]})}function ar({id:e,tools:n}){let[r,i]=(0,_.useState)(!1),a=t({...o.toolsViewQueryOptions(e),enabled:r,staleTime:e=>e.state.data&&e.state.data.length>0?1/0:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1}),s=a.data!==void 0&&a.data.length>0;return(0,v.jsx)(X,{title:`Tools (${n.length})`,defaultOpen:!1,headerMetadata:(0,v.jsx)(nr,{tools:n}),onOpenChange:i,children:a.isFetching&&!s?(0,v.jsx)(`p`,{className:`text-[12px] text-sand-400`,children:`Loading tool contracts…`}):a.isError||!s?(0,v.jsx)(`p`,{className:`text-[12px] text-sand-400`,children:`Tool contracts could not be loaded.`}):(0,v.jsx)(`div`,{className:`space-y-2`,children:a.data.map((e,t)=>(0,v.jsx)(ir,{tool:e},`${e.name}-${t}`))})})}var or=/("(?:[^"\\]|\\.)*")|(\b\d+(?:\.\d+)?\b)|(\btype\b|\bz\b(?=\.))|(\b(?:string|number|boolean|null|unknown|Record)\b)|([{}[\]()<>|?:,.=])|([A-Za-z_$][\w$]*)|(\s+|.)/g;function sr(e){let t=[],n=!1;for(let r of e.matchAll(or)){let[e,i,a,o,s,c,l]=r,u=`${r.index}-${e}`;i||a?t.push((0,v.jsx)(`span`,{className:`text-sage-400`,children:e},u)):o?(n=e===`type`,t.push((0,v.jsx)(`span`,{className:`text-sienna-400`,children:e},u))):s?t.push((0,v.jsx)(`span`,{className:`text-blue-300`,children:e},u)):c?t.push((0,v.jsx)(`span`,{className:`text-sand-500`,children:e},u)):l&&n?(n=!1,t.push((0,v.jsx)(`span`,{className:`font-semibold text-sand-50`,children:e},u))):t.push(e)}return t}function cr({id:e}){let{data:t}=o.useResponseTypeTs(e),[n,r]=(0,_.useState)(`zod`),{zod:i=null,typescript:a=null}=t??{},s=n===`zod`?i??a:a??i,c=(0,_.useMemo)(()=>s===null?null:sr(s),[s]);return!t||s===null||c===null?null:(0,v.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,v.jsxs)(`div`,{className:`panel-header flex items-center px-4 py-2`,children:[(0,v.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-sand-500 font-medium`,children:`Response Type`}),(0,v.jsx)(`div`,{className:`ml-auto flex gap-1`,children:[{value:`zod`,label:`zod`,available:i!==null},{value:`ts`,label:`ts`,available:a!==null}].map(e=>(0,v.jsx)(`button`,{type:`button`,disabled:!e.available,className:`px-3 py-1 text-[12px] font-mono rounded-md transition-colors ${n===e.value?`bg-sand-200 text-sand-700`:`text-sand-400 hover:text-sand-600 disabled:text-sand-300 disabled:cursor-not-allowed`}`,onClick:()=>r(e.value),children:e.label},e.value))})]}),(0,v.jsxs)(`div`,{className:`relative`,children:[(0,v.jsx)(J,{text:s,dark:!0}),(0,v.jsx)(`pre`,{className:`bg-sand-900 px-4 py-3 text-[12px] text-sand-200 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed max-h-64 overflow-auto`,children:c})]})]})}function lr({id:e}){let{data:t,isLoading:r,error:i,isError:c}=o.useRequestLog(`A`,e),{data:l,isLoading:u,isError:d}=a.useRequestLogSteps(`T`,{request_log_id:e,num:0,page:1,orderBy:`id-asc`}),f=qn(l?.rows??[]);if(r||u)return(0,v.jsxs)(`div`,{className:`max-w-6xl mx-auto space-y-4`,children:[(0,v.jsx)(`div`,{className:`h-4 w-32 bg-sand-200 rounded animate-pulse`}),(0,v.jsx)(`div`,{className:`h-40 panel animate-pulse`}),(0,v.jsx)(`div`,{className:`h-32 panel animate-pulse`})]});if(c||d||!t)return(0,v.jsxs)(`div`,{className:`max-w-6xl mx-auto`,children:[(0,v.jsxs)(n,{to:`/logs`,className:`flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 mb-4`,children:[(0,v.jsx)(yn,{className:`size-3.5`}),`Back to Logs`]}),(0,v.jsx)(`p`,{role:`alert`,className:`text-danger-500 text-sm`,children:c?s(i)&&i.code===404?`Request not found.`:`Failed to load request.`:d?`Failed to load request steps.`:`Request not found.`})]});let p=f.flatMap(e=>e.toolCalls),m=p.find(e=>e.toolName===`image_generation`)?.id??null,h=f.length>0,g=In(t),_=t.history??null,y=_!==null&&_.length>0,b=t.tools??null,x=b!==null&&b.length>0,S=t.is_structured?(0,v.jsx)(cr,{id:e}):null,C=(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsx)(X,{title:`System`,children:(0,v.jsxs)(`div`,{className:`relative`,children:[(0,v.jsx)(J,{text:t.system_prompt??`null`}),(0,v.jsx)(Y,{text:t.system_prompt??`null`,markdown:!0})]})}),(0,v.jsx)(X,{title:`User`,children:(0,v.jsxs)(`div`,{className:`space-y-3`,children:[(0,v.jsxs)(`div`,{className:`relative`,children:[(0,v.jsx)(J,{text:t.user_prompt??`null`}),(0,v.jsx)(Y,{text:t.user_prompt??`null`,markdown:!0})]}),(0,v.jsx)(Hn,{stepId:m})]})})]});return(0,v.jsxs)(`div`,{className:`mx-auto space-y-4 ${h?`max-w-[120rem]`:`max-w-6xl`}`,children:[(0,v.jsxs)(n,{to:`/logs`,className:`inline-flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 transition-colors`,children:[(0,v.jsx)(yn,{className:`size-3.5`}),`Back to Logs`]}),(0,v.jsx)(jn,{data:t}),t.error_message&&(0,v.jsx)(An,{message:t.error_message}),y&&(0,v.jsx)(Zn,{history:_}),h?(0,v.jsxs)(`div`,{className:`flex flex-col lg:flex-row gap-4 items-stretch lg:items-start`,children:[(0,v.jsxs)(`div`,{className:`order-1 lg:order-2 flex-1 min-w-0 space-y-4`,children:[S,x&&(0,v.jsx)(ar,{id:e,tools:b}),(0,v.jsx)(Kn,{steps:f,tokensPerSecEnabled:g})]}),(0,v.jsx)(`div`,{className:`order-2 lg:order-1 flex-1 min-w-0`,children:C})]}):(0,v.jsxs)(v.Fragment,{children:[S,x&&(0,v.jsx)(ar,{id:e,tools:b}),C]}),(0,v.jsx)(X,{title:`Response`,children:(0,v.jsxs)(`div`,{className:`relative`,children:[(0,v.jsx)(J,{text:t.response}),(0,v.jsx)(Y,{text:t.response,markdown:!0})]})}),(0,v.jsx)(Mn,{data:t,toolCallCount:p.length}),(0,v.jsx)(`div`,{className:`pb-8`})]})}export{Sn as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{y as t}from"./vendor-tanstack-DJRQAbrY.js";import{i as n,r}from"./vendor-react-DH4kUfK2.js";import{n as i,o as a}from"./services.generated-Cbvg2sGQ.js";import{f as o,o as s}from"./index-DtRTSTes.js";import{t as c}from"./use-update-token-mutation-D-Y8OySK.js";import{n as l,t as u}from"./use-oauth-login-flow-C51_d6-6.js";import{t as d}from"./plus-B62CuqT8.js";var f=e(n(),1),p=r();function m(){let[e,t]=(0,f.useState)(!1),[n,r]=(0,f.useState)(``),i=u(),a=()=>{t(!1),r(``),i.reset()},c=async e=>{await i.submitCode(e)&&a()};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,className:`px-3.5 py-1.5 text-[12px] font-medium rounded-lg bg-sienna-500 text-white hover:bg-sienna-600 disabled:opacity-50 transition-all duration-150 active:scale-[0.97] flex items-center gap-1.5 shadow-sm`,onClick:()=>t(!0),children:[(0,p.jsx)(d,{className:`size-3.5`}),`Add Token`]}),e&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:a,onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-md mx-4`,children:[(0,p.jsx)(`div`,{className:`px-5 py-4 border-b border-sand-100/50`,children:(0,p.jsx)(`h2`,{className:`text-base font-medium text-sand-900`,children:`Add Token`})}),(0,p.jsxs)(`div`,{className:`px-5 py-4 space-y-4`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{htmlFor:`token-name`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Name *`}),(0,p.jsx)(s,{value:n,onChange:e=>r(e.target.value),placeholder:`e.g. your-token-name`,className:`mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`})]}),i.codeEntryProvider?(0,p.jsx)(l,{provider:i.codeEntryProvider,isPending:i.completeMutation.isPending,isError:i.completeMutation.isError,onSubmit:e=>void c(e),onRestart:i.reset}):(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!n.trim()||i.loadingProvider!==null,onClick:()=>void i.start(`openai`,n),children:i.loadingProvider===`openai`?(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,p.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}),`Waiting for login...`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o,{className:`size-4`}),`Login with OpenAI`]})}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`flex-1 h-px bg-sand-200`}),(0,p.jsx)(`span`,{className:`text-[10px] text-sand-400 uppercase`,children:`or`}),(0,p.jsx)(`div`,{className:`flex-1 h-px bg-sand-200`})]}),(0,p.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md border border-sand-300 text-sand-700 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!n.trim()||i.loadingProvider!==null,onClick:()=>void i.start(`anthropic`,n),children:i.loadingProvider===`anthropic`?(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,p.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-sand-400 border-t-transparent rounded-full animate-spin`}),`Waiting for login...`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o,{className:`size-4`}),`Login with Claude`]})})]})]}),(0,p.jsx)(`div`,{className:`px-5 py-3 border-t border-sand-100/50 flex items-center justify-end gap-2`,children:(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:a,children:`Cancel`})})]})]})]})}var h=e=>(0,p.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,p.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4`})}),g=e=>(0,p.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,p.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})});function _(e){if(!e||typeof e!=`object`)return`—`;if(`authSource`in e&&e.authSource===`system-keychain`)return`System Keychain`;let t=`accessToken`in e?e.accessToken:void 0;return typeof t!=`string`||!t?`—`:t.length<=12?t:`${t.slice(0,8)}...${t.slice(-4)}`}function v(e){let t=e.credentials;return`expiresAt`in t&&typeof t.expiresAt==`number`?t.expiresAt:`accessTokenExpiresAt`in t&&typeof t.accessTokenExpiresAt==`number`?t.accessTokenExpiresAt:null}function y(e){if(!e)return{text:``,color:``};let t=e-Date.now();if(t<=0)return{text:`expired`,color:`text-red-500`};let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),i=n>0?`${n}h ${r}m`:`${r}m`;return t<36e5?{text:i,color:`text-amber-500`}:{text:i,color:`text-sand-400`}}function b({data:e,isLoading:n}){let[r,a]=(0,f.useState)(null),[o,l]=(0,f.useState)(null),[u,d]=(0,f.useState)(``),m=t(),b=i.useRemoveTokenMutation(),x=c(),S=i.useToggleTokenMutation(),C=()=>Promise.all([m.invalidateQueries({queryKey:[`Token`]}),m.invalidateQueries({queryKey:[`Qgrid`]})]),w=async e=>{await S.mutateAsync({id:e.id}),await C()},T=async()=>{r&&(await b.mutateAsync({id:r.id}),await C(),a(null))},E=e=>{l(e),d(e.name??``)},D=async()=>{o&&(await x.mutateAsync({id:o.id,name:u.trim()}),await C(),l(null))};if(n)return(0,p.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:3}).map((e,t)=>(0,p.jsx)(`div`,{className:`h-12 bg-sand-100 rounded-md animate-pulse`},`skeleton-${t}`))});let O=e??[];return O.length===0?(0,p.jsxs)(`div`,{className:`text-sand-400 text-center py-16 text-sm`,children:[`No tokens registered. Click `,(0,p.jsx)(`strong`,{className:`text-sand-600`,children:`Add Token`}),` to get started.`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`panel overflow-hidden`,children:(0,p.jsx)(`div`,{className:`overflow-x-auto`,children:(0,p.jsxs)(`table`,{className:`w-full min-w-[640px] text-[13px]`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`panel-header`,children:[(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Provider`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Name`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Token`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Status`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Expires`}),(0,p.jsx)(`th`,{className:`w-20 px-3 py-2.5`})]})}),(0,p.jsx)(`tbody`,{className:`divide-y divide-sand-100/80`,children:O.map(e=>{let t=y(v(e));return(0,p.jsxs)(`tr`,{className:`transition-colors duration-150 hover:bg-sand-100/60 ${e.active?``:`opacity-50`}`,children:[(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`span`,{className:`text-xs font-medium text-sand-500 uppercase`,children:e.provider})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:e.name?(0,p.jsx)(`span`,{className:`text-sm text-sand-700`,children:e.name}):(0,p.jsx)(`span`,{className:`text-[11px] text-sand-400`,children:`—`})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`code`,{className:`text-[13px] font-mono text-sand-800`,children:_(e.credentials)})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`button`,{type:`button`,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors duration-200 ${e.active?`bg-sage-400`:`bg-sand-300`}`,onClick:()=>w(e),disabled:S.isPending||!e.active&&e.reauth_required,title:!e.active&&e.reauth_required?`재로그인이 필요한 토큰입니다`:void 0,children:(0,p.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform duration-200 ${e.active?`translate-x-4.5`:`translate-x-0.5`}`})})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:t.text&&(0,p.jsx)(`span`,{className:`text-xs ${t.color}`,children:t.text})}),(0,p.jsx)(`td`,{className:`px-3 py-3`,children:(0,p.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,p.jsx)(`button`,{type:`button`,className:`p-1 rounded text-sand-400 hover:text-sienna-500 transition-colors duration-150`,onClick:()=>E(e),children:(0,p.jsx)(h,{className:`size-4`})}),(0,p.jsx)(`button`,{type:`button`,className:`p-1 rounded text-sand-400 hover:text-red-500 transition-colors duration-150`,onClick:()=>a(e),children:(0,p.jsx)(g,{className:`size-4`})})]})})]},e.id)})})]})})}),o&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:()=>l(null),onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-sm mx-4`,children:[(0,p.jsx)(`div`,{className:`px-5 py-4 border-b border-sand-100/60`,children:(0,p.jsx)(`h3`,{className:`text-base font-medium text-sand-900`,children:`Edit Token`})}),(0,p.jsx)(`div`,{className:`px-5 py-4 space-y-3`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{htmlFor:`token-name`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Name`}),(0,p.jsx)(s,{value:u,onChange:e=>d(e.target.value),placeholder:`e.g. prod, dev, team-a`,className:`mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`})]})}),(0,p.jsxs)(`div`,{className:`px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:()=>l(null),children:`Cancel`}),(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150`,disabled:x.isPending,onClick:D,children:x.isPending?`Saving...`:`Save`})]})]})]}),r&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:()=>a(null),onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-sm mx-4`,children:[(0,p.jsxs)(`div`,{className:`px-5 py-4`,children:[(0,p.jsx)(`h3`,{className:`text-base font-medium text-sand-900`,children:`Remove Token`}),(0,p.jsxs)(`p`,{className:`text-sm text-sand-700 mt-2`,children:[`Are you sure you want to remove`,` `,(0,p.jsx)(`code`,{className:`text-[13px] font-mono text-sand-800`,children:_(r.credentials)}),r.name&&(0,p.jsxs)(`span`,{className:`text-sand-500`,children:[` (`,r.name,`)`]}),`?`]})]}),(0,p.jsxs)(`div`,{className:`px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:()=>a(null),children:`Cancel`}),(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 transition-colors duration-150`,disabled:b.isPending,onClick:T,children:b.isPending?`Removing...`:`Remove`})]})]})]})]})}function x(){let{data:e,isLoading:t}=a.useTokens(`A`);return(0,p.jsxs)(`div`,{className:`max-w-6xl mx-auto space-y-4`,children:[(0,p.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,p.jsx)(m,{})}),(0,p.jsx)(b,{data:e?.rows,isLoading:t})]})}export{x as component};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{y as t}from"./vendor-tanstack-DJRQAbrY.js";import{i as n,r}from"./vendor-react-DH4kUfK2.js";import{n as i,o as a}from"./services.generated-Cbvg2sGQ.js";import{f as o,o as s}from"./index-BIC1sQxw.js";import{t as c}from"./use-update-token-mutation-D-Y8OySK.js";import{n as l,t as u}from"./use-oauth-login-flow-8xw6on5P.js";import{t as d}from"./plus-B62CuqT8.js";var f=e(n(),1),p=r();function m(){let[e,t]=(0,f.useState)(!1),[n,r]=(0,f.useState)(``),i=u(),a=()=>{t(!1),r(``),i.reset()},c=async e=>{await i.submitCode(e)&&a()};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,className:`px-3.5 py-1.5 text-[12px] font-medium rounded-lg bg-sienna-500 text-white hover:bg-sienna-600 disabled:opacity-50 transition-all duration-150 active:scale-[0.97] flex items-center gap-1.5 shadow-sm`,onClick:()=>t(!0),children:[(0,p.jsx)(d,{className:`size-3.5`}),`Add Token`]}),e&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:a,onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-md mx-4`,children:[(0,p.jsx)(`div`,{className:`px-5 py-4 border-b border-sand-100/50`,children:(0,p.jsx)(`h2`,{className:`text-base font-medium text-sand-900`,children:`Add Token`})}),(0,p.jsxs)(`div`,{className:`px-5 py-4 space-y-4`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{htmlFor:`token-name`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Name *`}),(0,p.jsx)(s,{value:n,onChange:e=>r(e.target.value),placeholder:`e.g. your-token-name`,className:`mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`})]}),i.codeEntryProvider?(0,p.jsx)(l,{provider:i.codeEntryProvider,isPending:i.completeMutation.isPending,isError:i.completeMutation.isError,onSubmit:e=>void c(e),onRestart:i.reset}):(0,p.jsxs)(`div`,{className:`space-y-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!n.trim()||i.loadingProvider!==null,onClick:()=>void i.start(`openai`,n),children:i.loadingProvider===`openai`?(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,p.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}),`Waiting for login...`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o,{className:`size-4`}),`Login with OpenAI`]})}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`flex-1 h-px bg-sand-200`}),(0,p.jsx)(`span`,{className:`text-[10px] text-sand-400 uppercase`,children:`or`}),(0,p.jsx)(`div`,{className:`flex-1 h-px bg-sand-200`})]}),(0,p.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md border border-sand-300 text-sand-700 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!n.trim()||i.loadingProvider!==null,onClick:()=>void i.start(`anthropic`,n),children:i.loadingProvider===`anthropic`?(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,p.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-sand-400 border-t-transparent rounded-full animate-spin`}),`Waiting for login...`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(o,{className:`size-4`}),`Login with Claude`]})})]})]}),(0,p.jsx)(`div`,{className:`px-5 py-3 border-t border-sand-100/50 flex items-center justify-end gap-2`,children:(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:a,children:`Cancel`})})]})]})]})}var h=e=>(0,p.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,p.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4`})}),g=e=>(0,p.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,p.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})});function _(e){if(!e||typeof e!=`object`)return`—`;if(`authSource`in e&&e.authSource===`system-keychain`)return`System Keychain`;let t=`accessToken`in e?e.accessToken:void 0;return typeof t!=`string`||!t?`—`:t.length<=12?t:`${t.slice(0,8)}...${t.slice(-4)}`}function v(e){let t=e.credentials;return`expiresAt`in t&&typeof t.expiresAt==`number`?t.expiresAt:`accessTokenExpiresAt`in t&&typeof t.accessTokenExpiresAt==`number`?t.accessTokenExpiresAt:null}function y(e){if(!e)return{text:``,color:``};let t=e-Date.now();if(t<=0)return{text:`expired`,color:`text-red-500`};let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),i=n>0?`${n}h ${r}m`:`${r}m`;return t<36e5?{text:i,color:`text-amber-500`}:{text:i,color:`text-sand-400`}}function b({data:e,isLoading:n}){let[r,a]=(0,f.useState)(null),[o,l]=(0,f.useState)(null),[u,d]=(0,f.useState)(``),m=t(),b=i.useRemoveTokenMutation(),x=c(),S=i.useToggleTokenMutation(),C=()=>Promise.all([m.invalidateQueries({queryKey:[`Token`]}),m.invalidateQueries({queryKey:[`Qgrid`]})]),w=async e=>{await S.mutateAsync({id:e.id}),await C()},T=async()=>{r&&(await b.mutateAsync({id:r.id}),await C(),a(null))},E=e=>{l(e),d(e.name??``)},D=async()=>{o&&(await x.mutateAsync({id:o.id,name:u.trim()}),await C(),l(null))};if(n)return(0,p.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:3}).map((e,t)=>(0,p.jsx)(`div`,{className:`h-12 bg-sand-100 rounded-md animate-pulse`},`skeleton-${t}`))});let O=e??[];return O.length===0?(0,p.jsxs)(`div`,{className:`text-sand-400 text-center py-16 text-sm`,children:[`No tokens registered. Click `,(0,p.jsx)(`strong`,{className:`text-sand-600`,children:`Add Token`}),` to get started.`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`panel overflow-hidden`,children:(0,p.jsx)(`div`,{className:`overflow-x-auto`,children:(0,p.jsxs)(`table`,{className:`w-full min-w-[640px] text-[13px]`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`panel-header`,children:[(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Provider`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Name`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Token`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Status`}),(0,p.jsx)(`th`,{className:`text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium`,children:`Expires`}),(0,p.jsx)(`th`,{className:`w-20 px-3 py-2.5`})]})}),(0,p.jsx)(`tbody`,{className:`divide-y divide-sand-100/80`,children:O.map(e=>{let t=y(v(e));return(0,p.jsxs)(`tr`,{className:`transition-colors duration-150 hover:bg-sand-100/60 ${e.active?``:`opacity-50`}`,children:[(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`span`,{className:`text-xs font-medium text-sand-500 uppercase`,children:e.provider})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:e.name?(0,p.jsx)(`span`,{className:`text-sm text-sand-700`,children:e.name}):(0,p.jsx)(`span`,{className:`text-[11px] text-sand-400`,children:`—`})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`code`,{className:`text-[13px] font-mono text-sand-800`,children:_(e.credentials)})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:(0,p.jsx)(`button`,{type:`button`,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors duration-200 ${e.active?`bg-sage-400`:`bg-sand-300`}`,onClick:()=>w(e),disabled:S.isPending||!e.active&&e.reauth_required,title:!e.active&&e.reauth_required?`재로그인이 필요한 토큰입니다`:void 0,children:(0,p.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform duration-200 ${e.active?`translate-x-4.5`:`translate-x-0.5`}`})})}),(0,p.jsx)(`td`,{className:`px-5 py-3`,children:t.text&&(0,p.jsx)(`span`,{className:`text-xs ${t.color}`,children:t.text})}),(0,p.jsx)(`td`,{className:`px-3 py-3`,children:(0,p.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,p.jsx)(`button`,{type:`button`,className:`p-1 rounded text-sand-400 hover:text-sienna-500 transition-colors duration-150`,onClick:()=>E(e),children:(0,p.jsx)(h,{className:`size-4`})}),(0,p.jsx)(`button`,{type:`button`,className:`p-1 rounded text-sand-400 hover:text-red-500 transition-colors duration-150`,onClick:()=>a(e),children:(0,p.jsx)(g,{className:`size-4`})})]})})]},e.id)})})]})})}),o&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:()=>l(null),onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-sm mx-4`,children:[(0,p.jsx)(`div`,{className:`px-5 py-4 border-b border-sand-100/60`,children:(0,p.jsx)(`h3`,{className:`text-base font-medium text-sand-900`,children:`Edit Token`})}),(0,p.jsx)(`div`,{className:`px-5 py-4 space-y-3`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{htmlFor:`token-name`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`Name`}),(0,p.jsx)(s,{value:u,onChange:e=>d(e.target.value),placeholder:`e.g. prod, dev, team-a`,className:`mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`})]})}),(0,p.jsxs)(`div`,{className:`px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:()=>l(null),children:`Cancel`}),(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150`,disabled:x.isPending,onClick:D,children:x.isPending?`Saving...`:`Save`})]})]})]}),r&&(0,p.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,p.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:()=>a(null),onKeyDown:()=>{}}),(0,p.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-sm mx-4`,children:[(0,p.jsxs)(`div`,{className:`px-5 py-4`,children:[(0,p.jsx)(`h3`,{className:`text-base font-medium text-sand-900`,children:`Remove Token`}),(0,p.jsxs)(`p`,{className:`text-sm text-sand-700 mt-2`,children:[`Are you sure you want to remove`,` `,(0,p.jsx)(`code`,{className:`text-[13px] font-mono text-sand-800`,children:_(r.credentials)}),r.name&&(0,p.jsxs)(`span`,{className:`text-sand-500`,children:[` (`,r.name,`)`]}),`?`]})]}),(0,p.jsxs)(`div`,{className:`px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2`,children:[(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:()=>a(null),children:`Cancel`}),(0,p.jsx)(`button`,{type:`button`,className:`px-3 py-1 text-xs font-medium rounded-md bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 transition-colors duration-150`,disabled:b.isPending,onClick:T,children:b.isPending?`Removing...`:`Remove`})]})]})]})]})}function x(){let{data:e,isLoading:t}=a.useTokens(`A`);return(0,p.jsxs)(`div`,{className:`max-w-6xl mx-auto space-y-4`,children:[(0,p.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,p.jsx)(m,{})}),(0,p.jsx)(b,{data:e?.rows,isLoading:t})]})}export{x as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{y as t}from"./vendor-tanstack-DJRQAbrY.js";import{i as n,r}from"./vendor-react-DH4kUfK2.js";import{n as i,o as a}from"./services.generated-Cbvg2sGQ.js";import{o}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{y as t}from"./vendor-tanstack-DJRQAbrY.js";import{i as n,r}from"./vendor-react-DH4kUfK2.js";import{n as i,o as a}from"./services.generated-Cbvg2sGQ.js";import{o}from"./index-BIC1sQxw.js";var s=e(n(),1),c=r();function l({provider:e,isPending:t,isError:n,onSubmit:r,onRestart:i}){let[a,l]=(0,s.useState)(``),u=e===`openai`;return(0,c.jsxs)(`div`,{className:`space-y-2`,children:[(0,c.jsx)(`p`,{className:`text-[12px] text-sand-600 leading-relaxed`,children:u?`새 탭에서 OpenAI 로그인을 완료한 뒤 연결 실패 화면이 나타나면, 주소창의 전체 URL을 아래에 붙여넣으세요.`:`새 탭에서 Claude 로그인을 완료하면 코드가 표시됩니다. 코드 전체를 아래에 붙여넣으세요.`}),(0,c.jsx)(o,{value:a,onChange:e=>l(e.target.value),placeholder:u?`http://localhost:1455/auth/callback?code=...&state=...`:`code#state`,className:`w-full border border-sand-200 rounded-md px-3 py-2 text-sm font-mono text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300`}),n&&(0,c.jsx)(`p`,{className:`text-[11px] text-red-500`,children:`인증 결과 확인에 실패했습니다 — 전체 값을 다시 붙여넣거나 로그인을 다시 시작하세요.`}),(0,c.jsx)(`button`,{type:`button`,className:`w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2`,disabled:!a.trim()||t,onClick:()=>r(a),children:t?(0,c.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,c.jsx)(`span`,{className:`w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin`}),`Verifying...`]}):`Complete login`}),(0,c.jsx)(`button`,{type:`button`,className:`w-full py-1.5 text-[12px] text-sand-500 hover:text-sand-700 transition-colors duration-150`,onClick:()=>{l(``),i()},children:`처음부터 다시 시작`})]})}var u=3e3,d=3e5;async function f(e,t){let{rows:n}=await a.getTokens(`A`,{num:0,queryMode:`list`});return new Set(n.filter(n=>n.provider===e&&n.name===t).map(e=>e.id))}function p(){let[e,n]=(0,s.useState)(null),[r,a]=(0,s.useState)(null),o=t(),c=i.useOauthStartMutation(),l=i.useOauthStartOpenAIMutation(),p=i.useOauthCompleteMutation(),m=(0,s.useRef)({}),h=(0,s.useRef)(0),g=()=>{h.current+=1,m.current.interval!==void 0&&clearInterval(m.current.interval),m.current.timeout!==void 0&&clearTimeout(m.current.timeout),m.current={}};(0,s.useEffect)(()=>g,[]);let _=()=>Promise.all([o.invalidateQueries({queryKey:[`Token`]}),o.invalidateQueries({queryKey:[`Qgrid`]})]);return{loadingProvider:e,codeEntryProvider:r,start:async(e,t)=>{let r=t.trim();if(!r)return;g();let i=h.current,o=window.open(`about:blank`,`_blank`);n(e);try{if(e===`openai`){let t=await f(e,r);if(i!==h.current){o?.close();return}let{authUrl:s,mode:c}=await l.mutateAsync({name:r});if(i!==h.current){o?.close();return}if(o?o.location.href=s:window.open(s,`_blank`),c===`code`){a(e),n(null);return}m.current.interval=window.setInterval(()=>{f(e,r).then(e=>{i===h.current&&[...e].some(e=>!t.has(e))&&(g(),n(null),_())}).catch(()=>{})},u),m.current.timeout=window.setTimeout(()=>{i===h.current&&(g(),n(null))},d);return}let{authUrl:t,mode:s}=await c.mutateAsync({name:r});if(i!==h.current){o?.close();return}s===`code`?(o?o.location.href=t:window.open(t,`_blank`),a(e),n(null)):(o?.close(),window.location.href=t)}catch(e){if(o?.close(),i!==h.current)return;console.error(`OAuth start failed:`,e),n(null)}},submitCode:async e=>{let t=e.trim();if(!t)return!1;try{await p.mutateAsync({pastedCode:t})}catch(e){return console.error(`OAuth complete failed:`,e),!1}return await _(),!0},reset:()=>{g(),n(null),a(null),p.reset()},completeMutation:p}}export{l as n,p as t};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/sonamu.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Qgrid</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BIC1sQxw.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dw2cE7zH.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ca-nBW7U.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-DH4kUfK2.js">
|
|
@@ -46874,7 +46874,7 @@ function ChatWidget() {
|
|
|
46874
46874
|
}
|
|
46875
46875
|
//#endregion
|
|
46876
46876
|
//#region src/components/Sidebar.tsx
|
|
46877
|
-
var qgridVersion = "2.10.
|
|
46877
|
+
var qgridVersion = "2.10.3";
|
|
46878
46878
|
function Sidebar({ className }) {
|
|
46879
46879
|
const pathname = useRouterState({ select: (s) => s.location.pathname });
|
|
46880
46880
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("aside", {
|
package/package.json
CHANGED
package/skills/qgrid/SKILL.md
CHANGED
|
@@ -45,6 +45,7 @@ Request logging is enabled by default. Use `providerOptions.qgrid.logger: false`
|
|
|
45
45
|
## Non-Negotiable Boundaries
|
|
46
46
|
|
|
47
47
|
- Use `packages/ai-sdk` as the active public SDK surface.
|
|
48
|
+
- Expose thinking only as `providerOptions.qgrid.thinking?: boolean`: omission preserves the model policy, false overrides effort, and unsupported/unverified off requests fail explicitly. See the SDK and provider runtime references for the dated support snapshot. Keep Anthropic thinking controls separate from mandatory configuration and memory isolation. Haiku/Sonnet 5.5 off uses a computed thinking-only native body override with Claude Code >=2.1.295; never inherit or expose arbitrary extra body.
|
|
48
49
|
- The old v1 SDK package (`packages/sdk`, `@cartanova/qgrid-sdk`) has been removed from the repository. It survives only as a deprecated npm artifact (1.9.0); do not resurrect it or write new code against it.
|
|
49
50
|
- Let the server infer single-turn versus tool-run request-log lifecycle. Do not recreate caller-selected logging modes in the SDK or API examples.
|
|
50
51
|
- Route provider models by prefix: `openai/*` goes to the OpenAI Codex runtime, `anthropic/*` goes to the Anthropic Claude Code runtime. Prefix-less model fallback is not implemented.
|
|
@@ -63,7 +63,8 @@ Do not write `providerOptions: { ... } satisfies QgridProviderOptions`: the expo
|
|
|
63
63
|
rejected by the SDK before transport; omission keeps weighted round-robin routing.
|
|
64
64
|
- `logger`: request-log switch. Omitted or `true` is the default and enables qgrid logging; `false` guarantees that generation creates zero qgrid request-log rows.
|
|
65
65
|
- `sessionKey`: source for model-scoped opaque OpenAI prompt-cache affinity. Disabled for Anthropic models.
|
|
66
|
-
- `
|
|
66
|
+
- `thinking`: optional boolean for both providers. Omission preserves existing model behavior. True enables thinking with the normal request effort → config `defaultEffort` → default resolution; it does not guarantee thinking tokens on every response. False ignores both efforts, including in request logging, and rejects unsupported or unverified model/runtime combinations. Generate, stream, tool continuation, and structured output carry the same boolean. Update SDK and server together: older servers can ignore the field. No `defaultThinking` or public `effort: "none"` is exposed. Haiku/Sonnet 5.5 off requires Claude Code >=2.1.295; Sonnet uses `between_tools` and may retain thinking blocks between tools.
|
|
67
|
+
- `effort`: provider-specific vocabulary. OpenAI (ChatGPT-subscription Codex route): `low | medium | high | xhigh | max | ultra`, where GPT-6 Astra, GPT-6 Sol, GPT-5.6 Sol, and Terra support `ultra`, and GPT-6 Luna and GPT-5.6 Luna support through `max`; `none`/`minimal` are not public effort values; use `thinking: false` for verified off-capable models. Anthropic (Claude Code `--effort`): `low | medium | high | xhigh | max`. The server resolves the value per provider and model (`providers/common/effort.ts`): anything outside the provider set, or above the Codex model's supported maximum, is silently dropped and treated as unspecified. With thinking omitted, Anthropic falls back to qgrid's default `low`; OpenAI omits `reasoning.effort` so the backend default applies. With `thinking: true`, OpenAI explicitly falls back to `low` for absent or unsupported effort, including raw API requests. With `thinking: false`, both providers ignore caller/default effort and apply their off policy instead. Invalid effort itself produces no error or metadata, only a debug log; unsupported thinking-off requests still fail explicitly. Use `QgridOpenAIProviderOptions` / `QgridAnthropicProviderOptions` for provider-typed `satisfies`; `QgridProviderOptions` is their union.
|
|
67
68
|
- `verbosity`: OpenAI/Codex route only.
|
|
68
69
|
- `reasoningSummary`: OpenAI/Codex route only.
|
|
69
70
|
- `serviceTier`: OpenAI/Codex route only.
|
|
@@ -77,7 +77,7 @@ claude -p
|
|
|
77
77
|
--model <canonical-model-or-1m-suffix>
|
|
78
78
|
--system-prompt <text> # small system prompt
|
|
79
79
|
--system-prompt-file <path> # large system prompt
|
|
80
|
-
--thinking disabled
|
|
80
|
+
--thinking <disabled|adaptive> # resolved from thinking and the existing model default
|
|
81
81
|
--effort <effort-or-low>
|
|
82
82
|
--disable-slash-commands
|
|
83
83
|
--session-id <uuid>
|
|
@@ -97,7 +97,11 @@ Important details:
|
|
|
97
97
|
- Large system prompts over 64 KiB are written to a temporary file to avoid argv `E2BIG` — this
|
|
98
98
|
same branch absorbs large injected schema contracts, so the old 64 KiB schema argv limit no
|
|
99
99
|
longer applies (only the global 512 KiB caller-schema complexity limit remains).
|
|
100
|
-
-
|
|
100
|
+
- One policy resolves the CLI thinking flag and effort before spawning. Omission preserves the existing model policy: Fable 5/5.1, Opus 5/5.5, Sonnet 5.5 and Haiku 5.5 keep adaptive defaults; other models use `--thinking disabled`. Explicit `true` uses `--thinking adaptive` and the normal effort resolution. Explicit `false` uses `--thinking disabled --effort low` only on supported models, ignoring caller/default effort. `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING` and `MAX_THINKING_TOKENS` are no longer sent. Do not reintroduce overlapping suppressors or inherit `CLAUDE_CODE_EFFORT_LEVEL`.
|
|
101
|
+
- The 2026-10-10 off policy includes Haiku 4.5/5.5, Sonnet 4.5/4.6/5/5.5, and Opus 4.5/4.6/4.7/4.8/5. Fable 5/5.1 and Opus 5.5 reject disabled thinking at the backend. Off requests for unverified models fail before spawning instead of changing models or silently enabling thinking.
|
|
102
|
+
- Haiku 5.5 and Sonnet 5.5 require Claude Code 2.1.295 or newer for explicit false. Cache the result of `claude --version`; unknown or older versions return an input error. The policy computes `CLAUDE_CODE_EXTRA_BODY` containing only `thinking: {type: "disabled"}` for Haiku or `thinking: {type: "between_tools"}` for Sonnet, alongside `--thinking disabled --effort low`. Native delivery was verified on 2.1.295; invalid-type and Sonnet-disabled negative controls confirmed that the CLI applied the body field. `between_tools` disables pre-answer thinking but may emit thinking blocks between tools. Never inherit this env variable or expose arbitrary body overrides to callers.
|
|
103
|
+
- Legacy environment suppression versus CLI-only disabled was compared on Sonnet 4.6 and Opus 4.8: both completed with zero thinking tokens in the short-text baseline. The comparison supports removing the duplicate suppressors without changing the omitted-option policy.
|
|
104
|
+
|
|
101
105
|
|
|
102
106
|
## Spawn env
|
|
103
107
|
|
|
@@ -109,14 +113,13 @@ Included env:
|
|
|
109
113
|
- `TMPDIR`
|
|
110
114
|
- `CLAUDE_CODE_OAUTH_TOKEN`
|
|
111
115
|
- `CLAUDE_CONFIG_DIR`
|
|
116
|
+
- `CLAUDE_CODE_EXTRA_BODY` only when computed by the thinking policy for explicit Haiku/Sonnet 5.5 off; never inherited
|
|
112
117
|
- `CLAUDE_CODE_DISABLE_AUTO_MEMORY=1`
|
|
113
|
-
- `CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1` except for Fable 5/5.1 and Opus 5
|
|
114
118
|
- `CLAUDE_CODE_DISABLE_CLAUDE_MDS=1`
|
|
115
119
|
- `CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1`
|
|
116
120
|
- `CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1`
|
|
117
121
|
- `CLAUDE_CODE_DISABLE_WORKFLOWS=1`
|
|
118
122
|
- `CLAUDE_CODE_ATTRIBUTION_HEADER=0`
|
|
119
|
-
- `MAX_THINKING_TOKENS=0` except for Fable 5/5.1 and Opus 5
|
|
120
123
|
- `CLAUDE_CODE_DISABLE_1M_CONTEXT=1` when model does not support qgrid's 1M path
|
|
121
124
|
- `MAX_STRUCTURED_OUTPUT_RETRIES` for streaming structured output only (not non-streaming `generate`)
|
|
122
125
|
|
|
@@ -37,6 +37,15 @@ Key decisions:
|
|
|
37
37
|
- The SDK should stay a thin adapter. Server APIs own request-log lifecycle, provider dispatch, structured-output emulation, and provider runtime details.
|
|
38
38
|
- Request logging defaults to enabled. `providerOptions.qgrid.logger: false` is the single per-generation opt-out for both native qgrid logs and `createQgridLogger` telemetry logs; it must not alter generation or tool behavior.
|
|
39
39
|
|
|
40
|
+
## Thinking Control
|
|
41
|
+
|
|
42
|
+
Source: `docs/plans/2026-10-10-001-feat-thinking-control-plan.md`.
|
|
43
|
+
|
|
44
|
+
- Use the independent `providerOptions.qgrid.thinking?: boolean` switch. False makes effort irrelevant; do not reject the combination or expose a cross-provider `effort: "none"` value.
|
|
45
|
+
- Preserve omitted-option behavior. Reject unsupported and runtime-unverified off requests before token acquisition/spawn, without fallback. Backend capability and Claude Code delivery are separate evidence.
|
|
46
|
+
- Use one Anthropic CLI thinking policy instead of overlapping environment suppressors. Preserve the OAuth env allowlist, token-specific config, empty settings, isolated cwd, memory/CLAUDE.md/skills/workflow disabling, tools, attribution, and 1M policy. These isolation controls prevent previously observed cross-request context injection and account metadata leakage.
|
|
47
|
+
- Haiku/Sonnet 5.5 use a narrowly computed native `CLAUDE_CODE_EXTRA_BODY` thinking field, guarded by Claude Code >=2.1.295. Do not inherit that variable, expose arbitrary body overrides, add a transport, or add a relay. Sonnet's `between_tools` exception remains visible: it turns off pre-answer thinking but can retain thinking blocks between tools.
|
|
48
|
+
|
|
40
49
|
## Tool Calling And Request-Log Lifecycle
|
|
41
50
|
|
|
42
51
|
Sources:
|
|
@@ -12,6 +12,12 @@ Use this reference before changing OpenAI transport, concurrency, routing, promp
|
|
|
12
12
|
- Direct quota lookup: `openai-quota.ts`.
|
|
13
13
|
- Provider integration and history: `packages/api/src/application/qgrid/qgrid.dispatcher.ts`, `conv-routing.ts`.
|
|
14
14
|
|
|
15
|
+
## Thinking control
|
|
16
|
+
|
|
17
|
+
`providerOptions.qgrid.thinking` reaches the Responses builder as a boolean. False overrides request/default effort and sends `reasoning: { effort: "none" }` without a reasoning summary. True uses a valid resolved effort, or explicitly sends `low` when effort is absent or unsupported, so a raw API request cannot fall back to a non-thinking backend default. Omission preserves the existing behavior: valid effort is forwarded; absent or unsupported effort leaves the backend default in effect. True and omission retain the requested reasoning summary policy. `none` belongs only to the internal wire type, not the public effort enum.
|
|
18
|
+
|
|
19
|
+
The 2026-10-10 subscription probe accepted off for `gpt-6-sol`, `gpt-6-luna`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, and `gpt-5.5`. `gpt-6-astra` and `gpt-6.1-sol` explicitly rejected it. Other model IDs are unverified for off and are rejected locally only when false is requested. Model-access failures are not evidence of mandatory thinking. Validate terminal success and response settings, not HTTP 200 alone: errors can arrive within SSE. The same policy applies to text-model requests driving image generation, not to the image model itself.
|
|
20
|
+
|
|
15
21
|
## Adding an OpenAI model
|
|
16
22
|
|
|
17
23
|
Use this checklist whenever a model is added. A public API release does not by itself prove
|
|
@@ -253,6 +253,8 @@ Anthropic's 5-hour usage window anchors on the first request, so an unused token
|
|
|
253
253
|
|
|
254
254
|
Keepalive breaks that coupling by burning the window clock during idle time. Every keepalive-enabled active Anthropic token gets one cheap request as soon as its window expires, so windows always run and a workday lands mid-window rather than on a boundary. Across an eight-hour day this raises the number of windows the day can touch from a fixed 2 to an expected 2.6.
|
|
255
255
|
|
|
256
|
+
The keepalive request uses `anthropic/claude-haiku-5-5`, `thinking: false`, `effort: "low"`, and the prompt `Reply OK.`. Thinking is disabled because this request only opens the usage window; the false policy overrides the supplied effort and uses the provider's low-effort off path. Haiku 5.5 off requires Claude Code >=2.1.295. The model constant lives in `token-window-keepalive.ts`; changing it does not change the scheduler or opt-in gates below.
|
|
257
|
+
|
|
256
258
|
- Since 2.8.0 (`ea7feb3`) keepalive is opt-in at two levels. The runner instance must have env `QGRID_TOKEN_WINDOW_KEEPALIVE_ENABLED=true` (default off; set it on one instance per shared DB), and a token is a target only when `tokens.keepalive_enabled` is `true` (default `false`, toggled in the dashboard settings panel). The global setting `qgrid.tokenWindowKeepaliveEnabled` is a kill switch (`false` disables everything), not a substitute for either gate. In 2.7.6 every instance fired for every active token.
|
|
257
259
|
- Operational trap: the 2.8.0 migration adds `keepalive_enabled` as default `false` without backfilling existing tokens. After upgrading, both the runner env and the per-token toggles must be set, or keepalive silently schedules zero tokens. This happened on dev0 after the 2026-08-31 self-update; a lingering 2.7.6 instance masked it until 2026-09-01. Diagnose with `GET /api/setting/listSettings` (`keepaliveRunnerEnabled`), `GET /api/token/findMany?subset=A` (`keepalive_enabled`), and the latest request log under project `qgrid-token-window-keepalive`.
|
|
258
260
|
- The next fire is scheduled from the token's real `resetsAt` rather than a fixed five-hour timer, so a provider-side change to the window length is followed automatically.
|
|
@@ -24,6 +24,16 @@ qgrid supports the AI SDK `tools` interface, but it does not use native provider
|
|
|
24
24
|
- qgrid maps that structured object back into AI SDK `tool-call` content.
|
|
25
25
|
- The AI SDK executes the actual tool functions and calls qgrid again with tool results.
|
|
26
26
|
|
|
27
|
+
OpenAI can emit separate commentary and final-answer message items in one response.
|
|
28
|
+
Plain commentary is an intermediate update, not an emulation payload: do not join
|
|
29
|
+
it to the final JSON. Known final-answer message deltas still stream incrementally.
|
|
30
|
+
For tool emulation, a complete message that passes the strict envelope and tool-name
|
|
31
|
+
validation with `action: tool_call` is the client handoff boundary. Stop aggregating
|
|
32
|
+
and streaming later text from that response: it cannot incorporate a tool result
|
|
33
|
+
that the client has not produced yet. Drain the upstream response to preserve usage,
|
|
34
|
+
errors, and cancellation. Never split concatenated JSON inside a single message or
|
|
35
|
+
recover malformed envelopes. Ordinary text requests keep their existing aggregation.
|
|
36
|
+
|
|
27
37
|
`generateText` and `streamText` default to `stepCountIs(1)`. When an executable
|
|
28
38
|
tool can run before the final answer, callers must set a bounded `stopWhen`
|
|
29
39
|
(for example `stepCountIs(3)`) or the AI SDK stops after the first tool-call
|
|
@@ -99,9 +109,16 @@ The schema explicitly tells the model:
|
|
|
99
109
|
|
|
100
110
|
- use `tool_call` when client-side tool execution is needed;
|
|
101
111
|
- use `answer` only for a final answer;
|
|
102
|
-
-
|
|
112
|
+
- return the tool request as the JSON response body, then end the turn and wait for client results;
|
|
113
|
+
- do not invent tool results or emit an answer before the required results arrive;
|
|
103
114
|
- put tool arguments in `args` as a JSON string.
|
|
104
115
|
|
|
116
|
+
Do not instruct OpenAI to use a `StructuredOutput` or Claude Code tool: neither is
|
|
117
|
+
provided on this route. The legacy schema descriptions contained that stale
|
|
118
|
+
instruction; schema descriptions now explain the actual client handoff protocol.
|
|
119
|
+
The discriminated union, required fields, argument encoding and user-schema refs
|
|
120
|
+
are unchanged. Prompt wording improves guidance but does not guarantee model compliance.
|
|
121
|
+
|
|
105
122
|
Delivery differs by provider (SON-532). OpenAI: `qgrid.dispatcher.ts` strictifies the composed
|
|
106
123
|
envelope through `buildStrictOutputSchema` and passes it as the response format — constrained
|
|
107
124
|
decoding enforces it. Anthropic: no schema is passed to CC at all; `schema-prompt.ts` renders the
|
|
@@ -149,7 +149,7 @@ Generated SSE handlers missing a newly added event field:
|
|
|
149
149
|
`NO_OPENAI_WORKERS`:
|
|
150
150
|
|
|
151
151
|
- The request path returns this only when there is no active OpenAI token candidate; there is no queue and no busy state.
|
|
152
|
-
- Check active OpenAI tokens and credential state (`OpenAIDispatcher.
|
|
152
|
+
- Check active OpenAI tokens and credential state (`OpenAIDispatcher.countActiveTokens()`).
|
|
153
153
|
- If tokens were recently changed, inspect `TokenSubscriber` status and reconcile behavior.
|
|
154
154
|
|
|
155
155
|
`NO_ACTIVE_WORKERS`:
|