@theoremjs/studio 0.3.5-next.945.g127cfdd → 0.3.5-next.947.ga93f6be

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/package.json +4 -4
  2. package/page/assets/{BottomSheet-CGCeV0j1.js → BottomSheet-CbCAQUBQ.js} +1 -1
  3. package/page/assets/{ConsoleFrame-D2GshrNG.js → ConsoleFrame-DH2a1vrD.js} +1 -1
  4. package/page/assets/{ContextMenu-DBz-JG4k.js → ContextMenu-D0oalW1u.js} +2 -2
  5. package/page/assets/{DateInput-D4P1qXs4.js → DateInput-tbtgv-q-.js} +1 -1
  6. package/page/assets/{DropdownMenu-L_jMBqTm.js → DropdownMenu-BGHkPlA7.js} +2 -2
  7. package/page/assets/{Link-8shHw31C.js → Link-BdlPyZ6G.js} +1 -1
  8. package/page/assets/{MenuBottomSheet-CpgKx3Gn.js → MenuBottomSheet-WfWPx-Ma.js} +1 -1
  9. package/page/assets/{PowerSearchBottomSheet-DpeYUQEs.js → PowerSearchBottomSheet-Dhba6Dlf.js} +1 -1
  10. package/page/assets/{RankedBars-BiLmrqKa.js → RankedBars-X7KS7Ey_.js} +1 -1
  11. package/page/assets/{SchemaFields-CFmjkJ6M.js → SchemaFields-BSR3HgW9.js} +1 -1
  12. package/page/assets/{ShapedData-DwKqBicC.js → ShapedData-8E1Hf69N.js} +1 -1
  13. package/page/assets/{TokenizerBottomSheet-CqNod-xJ.js → TokenizerBottomSheet-CFnjuPJw.js} +1 -1
  14. package/page/assets/{ToolResultCharts-B8nqKU-p.js → ToolResultCharts-DT0OMyYN.js} +1 -1
  15. package/page/assets/{Toolbar-JItJGIdz.js → Toolbar-B2vBVJtH.js} +1 -1
  16. package/page/assets/{TraceInspector-CR2p0Rsk.js → TraceInspector-Pj2XJuEw.js} +2 -2
  17. package/page/assets/{TraceOverview-4URknKAx.js → TraceOverview-D4DIcN9l.js} +1 -1
  18. package/page/assets/{_virtual_studio-type-sources-D6OCf7oS.js → _virtual_studio-type-sources-CWoI42kg.js} +57 -28
  19. package/page/assets/browser-connection-Dv7xbw01.js +1 -0
  20. package/page/assets/browser-engine-CUolmSdJ.js +16 -0
  21. package/page/assets/{browser-transport-B4Kwu8zD.js → browser-transport-DZysgy_n.js} +2 -2
  22. package/page/assets/{compile-8yHA7cmn.js → compile-DLWyxLzo.js} +2 -2
  23. package/page/assets/{encode-files-C49AZpSN.js → encode-files-Ds3y6S6n.js} +1 -1
  24. package/page/assets/{export-agent-DnBVyBSA.js → export-agent-CXvtWAIR.js} +1 -1
  25. package/page/assets/{getRadiusAndStrokeWidthFromDot-BWoQYgPp.js → getRadiusAndStrokeWidthFromDot-j4wSScez.js} +1 -1
  26. package/page/assets/{guardrail-health-Bx0iZLTr.js → guardrail-health-B5uD28im.js} +1 -1
  27. package/page/assets/{guardrail-tester-BQJ57eVF.js → guardrail-tester-COTpzp0w.js} +1 -1
  28. package/page/assets/{index-yC5X4xkW.js → index-9t-ygFkN.js} +8 -8
  29. package/page/assets/{json-code-DvTbV1HF.js → json-code-DtIiEApl.js} +1 -1
  30. package/page/assets/{labels-provider-BEgq92JU.js → labels-provider-Bd1FiylS.js} +1 -1
  31. package/page/assets/{live-messages-BrQhgNiV.js → live-messages-C-FbebJ6.js} +1 -1
  32. package/page/assets/{prompt-row-D6KsHzGX.js → prompt-row-DGQ7P1Ze.js} +1 -1
  33. package/page/assets/{reader--ohfEAKk.js → reader-Zu8mdSRg.js} +2 -2
  34. package/page/assets/{registry-DTX5GVdX.js → registry-CjatM33q.js} +1 -1
  35. package/page/assets/schema-CHxE5EUz.js +3 -0
  36. package/page/assets/{shaped-data-gYhn8vze.js → shaped-data-KV3CIOIt.js} +15 -15
  37. package/page/assets/{stub-CnSd7ZhQ.js → stub-DiDXlAmt.js} +1 -1
  38. package/page/assets/{studio-code-pane-DqwItrQC.js → studio-code-pane-BRxcoh92.js} +3 -3
  39. package/page/assets/{studio-console-C3fb3uvx.js → studio-console-vhGV4snh.js} +1 -1
  40. package/page/assets/{studio-decision-DU0xJ_yF.js → studio-decision-Dd7Cz-Yf.js} +1 -1
  41. package/page/assets/{studio-embedding-BWRXx7j3.js → studio-embedding-D2GQt7X2.js} +1 -1
  42. package/page/assets/studio-host-console-D-lSv2ma.js +2 -0
  43. package/page/assets/{studio-live-V8VdBf-b.js → studio-live-D_nF6Z7B.js} +1 -1
  44. package/page/assets/{studio-map-DUsPuSdw.js → studio-map-BjwC3AFc.js} +1 -1
  45. package/page/assets/{studio-media-DrQcx2gs.js → studio-media-BqVez1lU.js} +3 -3
  46. package/page/assets/{studio-trace-replay-CiPB4pLJ.js → studio-trace-replay-Pw89VSWS.js} +1 -1
  47. package/page/assets/{studio-type-checker-DE8zvwkv.js → studio-type-checker-DC1LxprE.js} +1 -1
  48. package/page/assets/{tool-schema-Cw0KPTnQ.js → tool-schema-h27oVndM.js} +1 -1
  49. package/page/assets/{trace-record-DK92KCo0.js → trace-record-BOw-semK.js} +1 -1
  50. package/page/assets/{tree-CrlkcK_x.js → tree-CUvi9p2d.js} +1 -1
  51. package/page/assets/{turn-client-Cef0JadZ.js → turn-client-w8IxCaeD.js} +2 -2
  52. package/page/assets/types-Bl7WithI.js +1 -0
  53. package/page/assets/{use-one-call-BzjYM1tg.js → use-one-call-C_E4YmwY.js} +1 -1
  54. package/page/assets/{useDismissSearchOnTouchDrag-CJF2iaqF.js → useDismissSearchOnTouchDrag-Cv-vZ59K.js} +1 -1
  55. package/page/assets/{workspace-iTQdUZ--.js → workspace-BluAvYVx.js} +1 -1
  56. package/page/index.html +21 -21
  57. package/page/assets/browser-connection-WnnSpy0l.js +0 -1
  58. package/page/assets/browser-engine-B3DypGiU.js +0 -16
  59. package/page/assets/schema-DXPRQZid.js +0 -3
  60. package/page/assets/studio-host-console-BcxYCUod.js +0 -2
  61. package/page/assets/types-D394SB-s.js +0 -1
@@ -1,3 +0,0 @@
1
- import{A as e,D as t,E as n,O as r,T as i,b as a,c as o,d as s,f as c,x as l}from"./schemas-D7cgkv3L.js";import{Cn as u,Nt as ee,at as te,bn as ne,ct as re,di as ie,ft as ae,hi as oe,hn as se,ot as d,pi as f}from"./shaped-data-gYhn8vze.js";import{c as p}from"./host-patterns-F-KZIzkF.js";var ce=`
2
-
3
- `;function le(e){if(typeof e==`string`)return;if(typeof e!=`object`||!e||Array.isArray(e))return`must be a string or { private: string }`;let t=Object.keys(e);if(t.length!==1||t[0]!==`private`)return`must have exactly one key, private`;let n=e.private;if(typeof n!=`string`)return`must be a string`;if(n===``)return`must not be empty`}function m(e,t){if(typeof e!=`string`){if(!Array.isArray(e))return`${t} must be a string or an array of parts`;if(e.length===0)return`${t} must not be an empty array`;for(let[n,r]of e.entries()){let e=le(r);if(e)return`${t}[${n}]${typeof r==`object`&&r&&`private`in r?`.private`:``} ${e}`}}}function h(e,t){let n=m(e,t);if(n)throw new p(`config`,n)}function g(e,t,n){return h(e,t),typeof e==`string`?n(e):e.map(e=>typeof e==`string`?n(e):{private:n(e.private)})}function _(e){if(typeof e==`string`)return[{text:e,private:!0}];let t=e.some(e=>typeof e!=`string`);return e.map(e=>typeof e==`string`?{text:e,private:!t}:{text:e.private,private:!0})}function v(e){let t=[];for(let n of e)n.some(e=>e.text)&&(t.length>0&&t.push({text:ce,private:!0}),t.push(...n));return t}function y(e){return e.map(e=>e.text).join(``)}function ue(e){let t=[],n=``;for(let r of e)r.private?n+=r.text:(n.trim()&&t.push(n),n=``);return n.trim()&&t.push(n),{text:y(e),private:t}}function de(e,t){return ue(v([e,...t.map(e=>e?[{text:e,private:!0}]:[])]))}var fe=/^[A-Za-z_][\w-]*$/,pe=/\{([A-Za-z_][\w-]*)\}/g,me=[`input`,`output`];function b(e){return e.choices.map(e=>e.value)}function x(e){return(e.type===`text`||e.type===`image`||e.type===`live`?e.identity.options:void 0)??{}}function S(e){return u(e)?.options??{}}function C(e,t){let n={...x(e),...S(e)};return Object.hasOwn(n,t)?n[t]:void 0}function w(e,t){if(!fe.test(e))return`Option "${e}" needs a plain name.`;if(me.includes(e))return`Option "${e}" is a reserved name.`;let n=Array.isArray(t.choices)?b(t):[];if(n.length===0)return`Option "${e}" lists no values.`;let r=n.find(e=>!e.trim()||e===`null`);return r===void 0?void 0:`Option "${e}" can't take the value "${r}".`}function T(e,t){for(let[n,r]of Object.entries({...e,...t})){if(e&&t&&Object.hasOwn(e,n)&&Object.hasOwn(t,n))return`"${n}" is on both identity.options and inputs.options.`;let i=w(n,r);if(i)return i}}function E(e,t,n,r){for(let[i,a]of Object.entries(r??{})){let r=Object.hasOwn(t,i)?t[i]:void 0;if(!r)throw new p(`request`,`Profile ${e} has no option '${i}' on ${n}`);let o=b(r);if(!o.includes(a))throw new p(`request`,`Profile ${e}: option '${i}' takes ${o.join(`, `)}, not '${a}'`)}}function D(e,t){return Object.hasOwn(e,`path`)&&t.path!==void 0?{path:t.path}:{}}function O(e,t){let n=x(e);if(t.options&&Object.hasOwn(t.options,`path`))throw new p(`request`,`Profile ${e.id}: the turn's own path states path`);E(e.id,n,`identity.options`,{...t.options,...D(n,t)}),E(e.id,S(e),`inputs.options`,t.input?.options)}function k(e,t){return{...t.options,...D(x(e),t),...t.input?.options}}function A(e,t,n){let r=!0,i=t.replace(pe,(t,i)=>{if(!C(e,i))return t;let a=Object.hasOwn(n,i)?n[i]:void 0;return a===void 0&&(r=!1),a??t});return r?i:void 0}function j(e){return typeof e==`string`?[[e]]:e.map(e=>typeof e==`string`?[e]:e)}function M(e){return typeof e==`string`?e:e.private}function N(e){return re(e[0]===void 0?``:M(e[0]))}function P(e){let t={};for(let[n,r]of Object.entries(e))t[n]={type:`string`,enum:b(r)};return{type:`object`,properties:t}}function F(e,t){if(e.length===0)return`It has no wording to send.`;let n=N(e);if(n.joined)return`A prompt line can't start with "+"; every line that fits is sent.`;if(n.when===`unreadable`)return`A line that opens with "when" needs an option and a colon, like "when path is web: …".`;for(let e of n.when){if(e.path.includes(`.`))return`"${e.path}" isn't one option.`;if(`has`in e)return`An option is one value, so it has no fields.`;if(e.expected===null)return`An option has no null value, so "is null" never fits.`;let n=d(e,t,`this profile’s options`);if(n)return n}if(n.when.length>0&&!n.text&&e.length===1)return`It has no wording to send.`}function I(e,t,n){let r=T(t,n);if(r)return r;let i=P({...t,...n});for(let[t,n]of j(e).entries()){let e=F(n,i);if(e)return`Line ${t+1}: ${e}`}}function L(e,t){return e.when!==`unreadable`&&e.when.every(e=>te(e,t))}function R(e,t,n){let r=j(e),i=r.flat().some(e=>typeof e!=`string`),a=[];for(let[e,o]of r.entries()){let r=N(o);if(!L(r,t))continue;let s=o.map((e,t)=>n(t===0?r.text:M(e)));if(s.includes(void 0))continue;let c=o.flatMap((e,t)=>{let n=s[t];return n?[{text:n,private:typeof e!=`string`||!i}]:[]});a.push({line:e+1,pieces:c})}return a}function z(e,t){if(typeof e!=`string`){if(!Array.isArray(e))throw new p(`config`,`${t} must be a string or an array of lines`);if(e.length===0)throw new p(`config`,`${t} must not be an empty array`);for(let[n,r]of e.entries())if(typeof r!=`string`){if(!Array.isArray(r))throw new p(`config`,`${t}[${n}] must be a string or a list of parts; put { private } inside the list`);h(r,`${t}[${n}]`)}}}function he(e,t){let n=e?.path;if(!n)return;let r=b(n);for(let e of t){let t=e.paths?.find(e=>e!==`*`&&!r.includes(e));if(t!==void 0)return`Tool ${e.name} lists path "${t}", which is not one of ${r.join(`, `)}.`}}function B(e,t){let n=e.get(t);return n!==void 0&&n.type!==`builtin`}function V(e,t){return!e||e.includes(`*`)?!0:t?e.includes(t):!1}function ge(e,t){return t.filter(n=>{let r=e.get(n);return r?.type!==`builtin`||!(r.conflictsWith??[]).some(e=>t.includes(e))})}function H(e){return`tools`in e?e.tools.allow:[]}function U(e){return e.type===`text`||e.type===`image`?e.tools:void 0}function _e(e){return`tools`in e?e.tools.parallel:void 0}function ve(e,t,n){return H(t).filter(r=>{let i=e.get(r);return!i||i.type===`builtin`?!1:t.type===`host`||V(i.paths,n.path)})}function ye(e,t,n,r){let i=t.models[r];return i?(i.builtInTools??[]).filter(t=>{let r=e.get(t);return r?.type===`builtin`&&V(r.paths,n.path)}):[]}function W(e,t,n){let r=e.get(t);if(r&&r.type!==`builtin`)return{type:`function`,name:r.name,description:r.description,parameters:ae(n&&r.askInputSchema||r.inputSchema)}}function be(e,t,n){let r=[];for(let i of t){let t=W(e,i,n);t&&r.push(t)}return r}function G(e,t,n){if(t.visible.includes(n))return;t.visible.push(n);let r=W(e,n,t.modelBackground);r&&!t.wire.some(e=>e.name===n)&&t.wire.push(r)}function xe(e,t,n){if(t.builtins.includes(n))return;let r=e.get(n);if(r?.type!==`builtin`)return;let i=r.conflictsWith??[];t.builtins=t.builtins.filter(t=>{if(i.includes(t))return!1;let r=e.get(t);return!(r?.type===`builtin`&&r.conflictsWith?.includes(n))}),t.builtins.push(n)}function Se(e,t,n){return t.type===`live`||t.type===`host`?[...n]:n.filter(t=>e.get(t)?.loadTier===`T0`)}function Ce(e,t,n){return ge(e,n.filter(n=>{let r=e.get(n);return r?.type===`builtin`&&(t.type===`live`||r.loadTier===`T0`)}))}function we(e,t){if(t.type!==`text`&&t.type!==`image`&&t.type!==`live`)return;let n=H(t).flatMap(t=>e.get(t)??[]),r=he(t.identity.options,n);if(r)throw new p(`config`,`Profile ${t.id}: ${r}`)}function Te(e,t){let n=U(t)?.t2Loader,r=n===void 0?void 0:e.get(n);if(r&&r.type!==`builtin`&&(r.background??`never`)!==`never`)throw new p(`config`,`Profile ${t.id}: tools.t2Loader '${r.name}' sets background, and a loader cannot detach`)}function Ee(e,t,n,r){we(e,t),Te(e,t);let i=ve(e,t,n),a=t.type===`host`||t.type===`decision`||t.type===`embedding`||r===void 0?[]:ye(e,t,n,r),o=[...i,...a],s=Ce(e,t,o),c=Se(e,t,o),l=c.filter(t=>B(e,t)),u=n.background!==void 0;return{builtins:s,gated:o,visible:c,executable:l,path:n.path,sessionPermissions:n.sessionPermissions,wire:be(e,c,u),...u?{modelBackground:u}:{}}}function De(e){return{builtins:[...e.builtins],gated:[...e.gated],visible:[...e.visible],executable:[...e.executable],path:e.path,sessionPermissions:e.sessionPermissions?[...e.sessionPermissions]:void 0,wire:e.wire.map(e=>({...e,parameters:structuredClone(e.parameters)})),...e.modelBackground?{modelBackground:e.modelBackground}:{}}}async function Oe(e,t,n,r){try{await ke(e,t,n,r)}catch(e){return{crashed:e}}}async function ke(e,t,n,r){let i=U(n)?.t1Policy;if(!i)return;let a;try{a=await i({profile:n,input:r.input,path:r.path,sessionPermissions:r.sessionPermissions,gated:t.gated,host:r.host})}catch(e){let t=e instanceof Error?e.message:String(e);throw new p(`config`,`Profile '${n.id}' tools.t1Policy rejected: ${t}`,{cause:e})}if(!Array.isArray(a))throw new p(`config`,`Profile '${n.id}' tools.t1Policy must return ToolId[]`);K(e,t,a)}function K(e,t,n=[]){for(let r of n){if(!t.gated.includes(r))continue;let n=e.get(r);n?.loadTier===`T2`&&(n.type===`builtin`?xe(e,t,r):G(e,t,r))}t.executable=t.visible.filter(t=>B(e,t))}var Ae=new Set([`__proto__`,`constructor`,`prototype`]);function je(e){if(!se(e))return;let{loaded:t}=e;if(Array.isArray(t)&&t.every(e=>typeof e==`string`))return t}function Me(e,t,n,r){if(r.type===`live`||r.type===`host`)return{promoted:[]};let i=[];for(let a of n){if(typeof a!=`string`||Ae.has(a))return{promoted:[],failure:{code:`invalid_output`,kind:`bad_response`,message:`tools.t2Loader loaded ids must be plain strings`}};let n=Ne(e,a,r);if(`failure`in n)return{promoted:[],failure:n.failure};let{tool:o}=n;V(o.paths,t.path)&&t.gated.includes(a)&&i.push(a)}let a=[];for(let n of i)G(e,t,n),a.push(n);return t.executable=t.visible.filter(t=>B(e,t)),{promoted:a}}function q(e){return{failure:{code:`invalid_output`,kind:`bad_response`,message:e}}}function Ne(e,t,n){if(!H(n).includes(t))return q(`tools.t2Loader attempted to promote tool '${t}' outside profile allow`);let r=e.get(t);return r?r.type===`builtin`?q(`tools.t2Loader attempted to promote builtin '${t}' — only custom tools may be promoted`):r.loadTier===`T2`?{tool:r}:q(`tools.t2Loader attempted to promote tool '${t}' with loadTier '${r.loadTier}' — only T2 tools may be promoted`):q(`tools.t2Loader attempted to promote unknown tool '${t}'`)}var Pe=new Set([`text`,`image`,`speech`]),Fe=n().regex(/\S/),J=i({mimeType:n(),data:c(),name:n().optional()}),Ie=i({mimeType:n(),uri:n(),name:n().optional()}),Le=i({voice:n().optional(),style:n().optional(),speed:a().positive().optional()});function Re(e){return i(Object.fromEntries(Object.entries(e).map(([e,t])=>{let n=b(t);return[e,o(n).optional()]})))}var ze=new Set([`text`,`attachments`,`voice`,`options`,`speech`]);function Be(e,t){if(!e.hostFields)return{sent:t};let n={...t},r={};for(let t of Object.keys(e.hostFields))n[t]!==void 0&&(r[t]=n[t]);let{text:i,attachments:a,voice:o,options:s,speech:c}=t;return{sent:{text:i,...a?{attachments:a}:{},...o?{voice:o}:{},...s?{options:s}:{},...c?{speech:c}:{}},hostInput:r}}function Ve(e,n){let{inputs:r}=e,a={text:Fe};r?.attachments&&(a.attachments=s(t([J,Ie])).optional()),r?.voice&&(a.voice=s(J).optional()),r?.options&&(a.options=Re(r.options).optional()),e.type===`speech`&&(a.speech=Le.optional());for(let e of n?.hostOnly??[]){if(!a[e])throw new p(`config`,`Tool '${n?.name}' keeps '${e}' for the host, which its profile does not take`);delete a[e]}for(let[e,t]of Object.entries(n?.fieldText??{})){let r=a[e];if(!r)throw new p(`config`,`Tool '${n?.name}' describes '${e}', which its profile does not take`);a[e]=r.describe(t)}for(let[e,t]of Object.entries(n?.hostFields??{})){if(ze.has(e))throw new p(`config`,`Tool '${n?.name}' declares the host field '${e}', which is a field of every agent tool`);a[e]=t}return i(a)}var Y=l({text:n().optional(),structured:r().optional(),removed:s(l({path:n(),reason:n(),item:r()})).optional(),parts:s(oe).optional(),sources:s(f).optional()});function He(e){return e.type===`speech`||(e.type===`text`||e.type===`image`)&&e.inputs.text!==!1}function Ue(e){return e.type===`builtin`?!1:e.permission!==`auto`||`auth`in e&&e.auth!==void 0&&(e.auth.onUnauthenticated??`gate`)===`gate`}function X(e,t){if(!Pe.has(e.type))return`it is a ${e.type} profile; an agent tool runs a text, image, or speech profile`;if(!He(e))return`it does not take text`;for(let n of H(e)){let e=t(n);if(!e)return`its tool '${n}' is not registered; register it first`;if(Ue(e))return`its tool '${n}' can stop on a gate; give it permission 'auto' and no sign-in`}}function We(e,t,n){let r=`Agent tool "${e.name}"`,i=e.maxCallsPerTurn;if(i!==void 0&&!(Number.isInteger(i)&&i>0))throw new p(`config`,`${r}: maxCallsPerTurn must be a whole number above 0`);let a=t(e.profile);if(!a)throw new p(`config`,`${r}: profile '${e.profile}' must be registered before the tool`);let o=X(a,n);if(o)throw new p(`config`,`${r} can't run '${e.profile}': ${o}`);return a}function Ge(e){if(!e)return`delegated`;let t=`models`in e&&Object.values(e.models).some(e=>(e.builtInTools?.length??0)>0);return H(e).length===0&&!t?`local`:`delegated`}function Z(e){let t=ie(e),n=t.flatMap(e=>e.type===`text`?[e.text]:[]).join(``),r=ee(t,e=>e.type===`structured`),i=r?.structured,a=t.flatMap(e=>e.type===`media`?[{type:ne(e.media.mimeType)??`document`,mimeType:e.media.mimeType,data:e.media.data,sent:!0}]:[]),o=t.flatMap(e=>e.type===`citation`?e.sources:[]);return{...i===void 0?{text:n}:{structured:i},...r?.removed?.length?{removed:r.removed}:{},...a.length>0?{parts:a}:{},...o.length>0?{sources:o}:{}}}function Ke(e,t,n){return{...e,type:`agent`,input:t,output:Y,sources:e=>e.sources??[],...n}}function qe(e,t,n){if(!e||typeof e!=`object`||Array.isArray(e))return n.push(`${t}: schema must be an object`),!1;let r=typeof e.type==`string`||Array.isArray(e.type),i=e.anyOf!==void 0||e.oneOf!==void 0;if(!r&&!i){if(t!==`$`)return!0;n.push(`${t}: missing type or combinator`)}return e.type===`array`&&e.items===void 0&&n.push(`${t}: array schema must define items`),!0}function Je(e,t,n,r){let i=Array.isArray(t)?t:[];for(let t of i)typeof t==`string`&&!Object.hasOwn(e,t)&&r.push(`${n}: required key '${t}' missing from properties`);for(let[t,i]of Object.entries(e))i&&typeof i==`object`&&Q(i,`${n}.properties.${t}`,r)}function Q(e,t,n){if(!qe(e,t,n))return;let r=e.properties;r&&typeof r==`object`&&!Array.isArray(r)&&Je(r,e.required,t,n),e.items&&typeof e.items==`object`&&!Array.isArray(e.items)&&Q(e.items,`${t}.items`,n);for(let r of[`anyOf`,`oneOf`]){let i=e[r];Array.isArray(i)&&i.forEach((e,i)=>{e&&typeof e==`object`&&Q(e,`${t}.${r}[${i}]`,n)})}}function Ye(e,t){let n=[];if(Q(e,`$`,n),n.length>0)throw new p(`config`,`Invalid tool ${t} schema: ${n.join(`; `)}`)}var Xe=`object`;function Ze(t,n=`output`){let r=e(t,{target:`draft-7`,io:n});return delete r.$schema,r.type||=Xe,r}function $(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map($);let t={};for(let n of Object.keys(e))n!==`__proto__`&&n!==`constructor`&&n!==`prototype`&&(t[n]=$(e[n]));return t}function Qe(e){let t=/^[a-z][a-z0-9+.-]*:\/\/[^/?#]*/i.exec(e)?.[0];if(!t||/[{}]/.test(t))throw new p(`config`,`Endpoint "${e}" must start with a fixed scheme and host; placeholders belong in the path or query`)}export{k as A,R as C,b as D,A as E,v as M,g as N,T as O,_ as P,z as S,O as T,_e as _,X as a,K as b,Y as c,Ke as d,Be as f,H as g,je as h,Ye as i,de as j,C as k,Z as l,De as m,Ze as n,Ve as o,Oe as p,$ as r,Ge as s,Qe as t,We as u,U as v,I as w,Ee as x,Me as y};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ToolResultCharts-B8nqKU-p.js","assets/rolldown-runtime-hePW80VL.js","assets/themeProps-Bo2jNkIC.js","assets/Text-Cq4yqBpQ.js","assets/useMergedRefs-S6y2xAId.js","assets/mergeProps-ptS-gIMz.js","assets/sharedResizeObserver-Ce0raAy-.js","assets/preload-helper-DpV6A1kQ.js","assets/shaped-data-gYhn8vze.js","assets/schemas-D7cgkv3L.js","assets/host-patterns-F-KZIzkF.js","assets/TraceOverview-4URknKAx.js","assets/useLayerDismissal-DwwLDEpO.js","assets/coarsePointer-B10KWVuz.js","assets/scrollView-DKN9Tc2s.js","assets/tokenReferences-tYcl-8O-.js","assets/Icon-Cd9sDRzY.js","assets/devWarning-DxuplmRl.js","assets/useMediaQuery-Q9CwxYQy.js","assets/Button-Bwkht0RI.js","assets/Spinner-ObDlWHHD.js","assets/useAnnounceRenderedText-C7Yqc9vL.js","assets/useIsHydrating-DmtPcCGm.js","assets/focusOutline.stylex-DXNeAcgS.js","assets/useClickableContainer-B08uXDf4.js","assets/usePressFeedback-DoNqlnA9.js","assets/useTooltip-DQ4LKI-B.js","assets/VisuallyHidden-Dfmmn1_I.js","assets/touchHitArea.stylex-D2yrbNzX.js","assets/press.stylex-aDT5uXq9.js","assets/Tooltip-Rh2iV9Vn.js","assets/Timestamp-CVGzbkGE.js","assets/useCalendarSystem-Crg71MEB.js","assets/characters-Dp4H_dX7.js","assets/rtlStyles-CVVETNV7.js","assets/ComponentIcon-75dIY9g7.js","assets/useScrollableArea-DLpP0enQ.js","assets/focusableSelector-kxmVieoO.js","assets/useDevWarning-WeXt8Pe8.js","assets/useLocale-CPtOawsd.js","assets/IconButton-BenRR-zK.js","assets/useClipboard-CE6Krn40.js","assets/highlightStyles-CJuQk9n5.js","assets/row-keys-0Bn7ZyYy.js","assets/createReactComponent-DVEyVJ-p.js","assets/trace-record-DK92KCo0.js","assets/labels-provider-BEgq92JU.js","assets/fullEnglishFallback-Css2A5hC.js","assets/useTranslator-BKF5qhFP.js","assets/HStack-B00ufja5.js","assets/Stack-3jR93LgR.js","assets/padding.stylex-Nfq09GFM.js","assets/VStack-D1ZLA9g3.js","assets/Card-C6l0Ne1A.js","assets/container.stylex-CS4Pmkv3.js","assets/MetadataListItem-D_UEO4Yo.js","assets/index-yC5X4xkW.js","assets/LayoutContent-BWpUj2Iy.js","assets/useScrollRegionProps-CnJi1TnL.js","assets/useFocusTrap-DyznXJtp.js","assets/focusReturn-DNKESCUc.js","assets/OverflowList-DDC9bnia.js","assets/useGestureRecognizer-C1yNE90T.js","assets/chainEventHandlers-BSZ5MWAl.js","assets/scroll-74w_rjcI.js","assets/isRtlElement-BG33-k_H.js","assets/composeEventHandlers-CHIontwB.js","assets/groupItems-BLHEgC4O.js","assets/fieldParts-rVBtMOBE.js","assets/FieldStatus-DOXgh0K8.js","assets/SidePanel-DcAhRInK.js","assets/useFocusLeavingChange-xsJxlBAc.js","assets/ScrollableArea-DgswAvfJ.js","assets/StackItem-nWHq5y--.js","assets/IconX-Cx51PGNB.js","assets/CheckboxIndicator-BvfHW9OX.js","assets/holdEntranceInput-BRGRVT6b.js","assets/useScrollLock-DGeH0BW_.js","assets/animatedLayout-alPkNRf2.js","assets/SegmentedControlItem-DLUgv9BP.js","assets/PressTracker-CEJ69JTB.js","assets/useKeyboardHint-CV0b5BIQ.js","assets/Token-CGIAH1hn.js","assets/disabledInteraction-u9yjM5Jo.js","assets/HoverCard-BgPoXy85.js","assets/browser-transport-B4Kwu8zD.js","assets/IconAlertTriangle-CL88MFAk.js","assets/compile-8yHA7cmn.js","assets/tool-schema-Cw0KPTnQ.js","assets/tree-CrlkcK_x.js","assets/live-ingress-OuSlQ6q7.js","assets/browser-connection-WnnSpy0l.js","assets/schema-DXPRQZid.js","assets/types-D394SB-s.js","assets/Center-CPu_uP6i.js","assets/IconFilter-DYCjUyWk.js","assets/IconMicrophone-BT77cilC.js","assets/IconSearch-BN1R3FIx.js","assets/IconTool-BHps7rbl.js","assets/reader--ohfEAKk.js","assets/trace-schema--4IGmLeE.js","assets/stub-CnSd7ZhQ.js","assets/registry-DTX5GVdX.js","assets/type-icons-ImkV_hD4.js","assets/IconMathFunction-rKhqXcO3.js","assets/IconServer-Dfs13rbh.js","assets/IconWorld-DkkGLUyH.js","assets/useAdaptivePresentation-D53OuCPm.js","assets/studio-media-DrQcx2gs.js","assets/turn-client-Cef0JadZ.js","assets/encode-files-C49AZpSN.js","assets/use-second-ticker-Dd57a-0O.js","assets/use-second-ticker-C3VX4c6o.css","assets/ShapedData-DwKqBicC.js","assets/arrive-DnkDKJb5.js","assets/rubberBand-urxgJfJ0.js","assets/LongPressGestureRecognizer-DsJzrIAQ.js","assets/CollapsibleGroup-483UEs5v.js","assets/MarkdownPluginNodeRenderer-CrUcBZdC.js","assets/ListItem-C8WPxjPx.js","assets/CheckboxInput-Dd_tzCIt.js","assets/boxHold-C4vf0eaW.js","assets/CheckboxListItem-BvWifH4u.js","assets/Field-DvUFAlQ-.js","assets/Link-8shHw31C.js","assets/EmptyState-DW-8doL9.js","assets/ContextMenu-DBz-JG4k.js","assets/menuBottomSheet.stylex-BF-z_H3I.js","assets/Divider-DzOWjyex.js","assets/useMenuPress-Bjaz5nPC.js","assets/menuItemRoles-Bod0knkp.js","assets/useMenuOverflow-C6hNF-rg.js","assets/typeaheadMatch-BJfmSQc6.js","assets/MenuBottomSheetActionList-CZkxfDz5.js","assets/ToggleButton-DS8nQhRT.js","assets/Badge-BUFlIXVD.js","assets/DropdownMenu-L_jMBqTm.js","assets/useFocusReturnVisibility-Brk7Chog.js","assets/TextInput-DwHcdc-E.js","assets/inputStyles.stylex-CwhFgCYO.js","assets/textEntryTraits-C_EOnS4-.js","assets/project-address-DjxPZuyn.js","assets/workspace-iTQdUZ--.js","assets/lent-keys-C32ems-I.js","assets/editors-BJX_S59A.js","assets/people-CIsR0-5R.js","assets/studio-session-ClF2iNCX.js","assets/PanelSearchInput-CS1aeOUr.js","assets/projection-C57DLs2K.js","assets/modalOutlet-CNlIUlZC.js","assets/haptics-5boj200r.js","assets/useListFormatter-BL-mfYUA.js","assets/Dialog-tyH-Jv5A.js","assets/index-BvVj0JHm.css","assets/trace-patterns-Bka_qf33.js","assets/getRadiusAndStrokeWidthFromDot-BWoQYgPp.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{d as n,l as r,r as i,u as a}from"./themeProps-Bo2jNkIC.js";import{t as o}from"./mergeProps-ptS-gIMz.js";import{r as s}from"./Spinner-ObDlWHHD.js";import{t as c}from"./Text-Cq4yqBpQ.js";import{t as l}from"./preload-helper-DpV6A1kQ.js";import{t as u}from"./Token-CGIAH1hn.js";import{t as d}from"./Tooltip-Rh2iV9Vn.js";import{b as f,i as p,u as m,v as h}from"./browser-transport-B4Kwu8zD.js";import{t as g}from"./row-keys-0Bn7ZyYy.js";import{n as ee,t as te}from"./IconMathFunction-rKhqXcO3.js";import{_ as ne,g as re,h as ie,i as ae,l as oe,n as se,o as ce,s as le,t as ue,u as de}from"./studio-media-DrQcx2gs.js";import{t as fe}from"./IconWorld-DkkGLUyH.js";import{l as pe,u as me}from"./tool-schema-Cw0KPTnQ.js";import{Ni as he,_ as ge,a as _,b as v,c as y,f as _e,h as b,l as x,n as S,o as ve,r as ye,t as be,v as xe,x as Se,y as C}from"./shaped-data-gYhn8vze.js";import{a as Ce,f as we,w as Te}from"./turn-client-Cef0JadZ.js";import{t as w}from"./EmptyState-DW-8doL9.js";import{t as T}from"./use-second-ticker-Dd57a-0O.js";import{s as E,t as D}from"./ShapedData-DwKqBicC.js";import{i as O,l as Ee,n as k}from"./labels-provider-BEgq92JU.js";import{t as A}from"./useLocale-CPtOawsd.js";import{t as De}from"./HStack-B00ufja5.js";import{t as j}from"./VStack-D1ZLA9g3.js";import{i as Oe,l as ke,n as Ae,o as je,t as M}from"./arrive-DnkDKJb5.js";import{n as Me,t as Ne}from"./ListItem-C8WPxjPx.js";import{a as Pe,i as Fe,o as Ie,r as Le,t as Re}from"./ConsoleFrame-D2GshrNG.js";import{i as ze}from"./trace-patterns-Bka_qf33.js";import{n as Be,t as Ve}from"./studio-console-C3fb3uvx.js";import{t as He}from"./SchemaFields-CFmjkJ6M.js";import{C as Ue,E as We,N as Ge,O as Ke,Y as qe,k as N,q as Je,w as Ye}from"./index-yC5X4xkW.js";var Xe=4,Ze=3,Qe=3,P=8,F=3,$e=3,et=/(^|_)(id|ids|lat|lon|lng|latitude|longitude|offset|interval|index|rank|order)$|Id$|^(generationtime_ms|utc_offset_seconds)$/i;function I(e){return!et.test(e)}function L(e){return/^[A-Z][A-Z0-9]{1,5}$/.test(e)?e:_(e)}function R(e,t){if(!I(e)||t&&e in t&&_e(t[e])===void 0)return;let{label:n,unit:r}=ye(e,t);return{label:L(e)===e?e:n,unit:r}}function z(e,t){let n=[];for(let[r,i]of b(e)){if(typeof i!=`number`||!Number.isFinite(i))continue;let e=R(r,t);e&&n.push({key:r,value:i,...e})}return n.sort((e,t)=>Number(t.unit!==void 0)-Number(e.unit!==void 0)).slice(0,Xe)}function tt(e){if(!y(e))return[];for(let[t,n]of b(e)){let r=v(n);if(!y(r)||S(r))continue;let i=Object.values(r);if(i.length===0||!i.every(ve))continue;let a=z(r,C(e,t));if(a.length>0)return a}return z(e,void 0)}function B(e,t){return new Set(e.map(e=>e[t])).size}function V(e,t,n){return[...new Set(e.flatMap(e=>Object.keys(e)))].filter(n=>n!==t&&e.every(e=>typeof e[n]==`number`||e[n]===null)&&B(e,n)>1).flatMap(e=>{let t=R(e,n);return t?[{key:e,...t}]:[]})}function nt(e){let[t]=e;if(t)return Object.keys(t).find(t=>e.every(e=>typeof e[t]==`string`&&be.test(e[t])))}function rt(e){let t=e.map(e=>e.label.split(` `)),[n=[]]=t,r=0;for(;r<n.length&&t.every(e=>e.length>r+1&&e[r]===n[r]);)r++;if(r)return{title:n.slice(0,r).join(` `),series:e.map((e,n)=>{let i=(t[n]??[]).slice(r).join(` `);return{...e,label:i.charAt(0).toUpperCase()+i.slice(1)}})}}function it(e,t,n,r,i){let a=new Map;for(let e of V(n,r,i)){let t=a.get(e.unit??``)??[];t.push(e),a.set(e.unit??``,t)}return[...a.values()].map(i=>{let a=i.slice(0,Qe),o=a.length>1?rt(a):void 0;return{kind:`time`,key:`${e}:${a.map(e=>e.key).join(`+`)}`,title:a.length===1?a[0]?.label??t:o?.title??(t||a.map(e=>e.label).join(` · `)),x:r,series:o?.series??a,rows:n}})}function at(e){let[t]=e,n=t?xe(t):void 0;if(!t||!n||!e.every(e=>typeof e[n]==`string`||typeof e[n]==`number`))return;if(B(e,n)===e.length)return n;let r=t=>e.reduce((e,n)=>e+String(n[t]).length,0),[i]=Object.keys(t).filter(t=>e.every(e=>typeof e[t]==`string`)&&B(e,t)===e.length).sort((e,t)=>r(e)-r(t));return i??n}function ot(e,t,n,r){let i=at(n);return i?V(n,i,r).sort((e,t)=>B(n,t.key)-B(n,e.key)).map(r=>({kind:`category`,key:`${e}:${r.key}`,title:t?`${t} · ${r.label}`:r.label,series:r,rows:n.filter(e=>typeof e[r.key]==`number`).map(e=>({label:String(e[i]),value:e[r.key]})).sort((e,t)=>t.value-e.value).slice(0,P)})):[]}function H(e,t,n,r){if(n.length<F)return[];let i=nt(n);return i?it(e,t,n,i,r):ot(e,t,n,r)}function U(e,t,n,r,i){if(i>$e)return[];if(Array.isArray(e)){let i=e.map(v);return i.every(y)?H(t,n,i,r):[]}if(!y(e))return[];let a=S(e);if(a)return H(t,n,ge(e,a),r);let o=b(e),s=o.filter(([e,t])=>typeof t==`number`&&I(e));if(i>0&&s.length>=F&&s.length===o.length){let e=s.map(([e,t])=>({label:L(e),value:t}));return[{kind:`category`,key:t,title:n,series:{key:`value`,label:n},rows:e.sort((e,t)=>t.value-e.value).slice(0,P)}]}return o.flatMap(([r,a])=>U(v(a),t?`${t}.${r}`:r,i===0?_(r):`${n} › ${_(r)}`,C(e,r),i+1))}function st(e){let t=v(e);return{figures:tt(t),charts:U(t,``,``,void 0,0).slice(0,Ze)}}function ct(e){return e.mimeType&&e.data?`data:${e.mimeType};base64,${e.data}`:void 0}function lt(e,t){let n=e.flatMap(e=>{let t=ct(e);return t?[{type:e.type,src:t,mimeType:e.mimeType}]:[]});return{images:n.filter(e=>e.type===`image`).map(({src:e})=>({src:e,alt:t})),audio:n.filter(e=>e.type===`audio`).map(({src:e,mimeType:t})=>({src:e,...t?{mimeType:t}:{}}))}}function ut(e){return e.flatMap(e=>e.uri!==void 0&&e.mimeType!==void 0&&dt(e.type)?[{type:e.type,mimeType:e.mimeType,uri:e.uri}]:[])}function dt(e){return he.includes(e)}function ft(e,t){return e.figures.length+e.charts.length+t.images.length+t.audio.length>0}var pt=864e5,mt=10;function ht(e){return e.some(e=>e.includes(`T`))?{tick:Math.abs(Date.parse(e.at(-1)??``)-Date.parse(e[0]??``))<=pt?{hour:`numeric`}:{month:`short`,day:`numeric`},when:{dateStyle:`medium`,timeStyle:`short`}}:{tick:e.length<=mt?{weekday:`short`,timeZone:`UTC`}:{month:`short`,day:`numeric`,timeZone:`UTC`},when:{dateStyle:`medium`,timeZone:`UTC`}}}var W=r(),G={base:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kaIpWk:`x16rqkct`,kmuXW:`x2lah0s`,kzqmXN:`x1xc55vz`,kZKoxP:`xdk7pt`,$$css:!0},pulsing:{kKVMdj:`x1mta51n`,k44tkh:`x1c74tu6`,kyAemX:`x4hg4is`,ko0y90:`xa4qsjk`,$$css:!0},reducedMotion:{kjO2d4:`x1aquc0h`,$$css:!0}},gt={success:{kWkggS:`x14en1nb`,kMwMTN:`xrkvqaz`,kMeerF:`xcthrzx`,k3XXqK:`x815t2r`,kjBf7l:`x3teovq`,kInvED:`xvr1dqx`,$$css:!0},warning:{kWkggS:`xzud2hm`,kMwMTN:`xrkvqaz`,kMeerF:`xcthrzx`,k3XXqK:`x815t2r`,kjBf7l:`x3teovq`,kInvED:`xvr1dqx`,$$css:!0},error:{kWkggS:`xa2dwd4`,kMwMTN:`xrkvqaz`,kMeerF:`xcthrzx`,k3XXqK:`x815t2r`,kjBf7l:`x3teovq`,kInvED:`xvr1dqx`,$$css:!0},accent:{kWkggS:`x1ewilqj`,kMwMTN:`x17wrial`,$$css:!0},neutral:{kWkggS:`x1q5y3ey`,kMwMTN:`xrkvqaz`,$$css:!0}};function K({variant:e,label:t,isPulsing:n=!1,tooltip:r,icon:c,xstyle:l,className:u,style:f,ref:p,...m}){let h=s(c),g=(0,W.jsx)(`span`,{ref:p,role:`img`,"aria-label":t,...o(i(`status-dot`,{variant:e}),a(G.base,gt[e],n&&G.pulsing,n&&G.reducedMotion,l),u,f),...m,children:h&&(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`x78zum5 x6s0dn4 xl56j7k x14ju556 x1xc55vz xdk7pt`,children:c})});return r?(0,W.jsx)(d,{content:r,children:g}):g}K.displayName=`StatusDot`;var _t=new Set([`gate`,`background`,`complete`,`error`,`cancel`]);function vt({call:e,failure:t,isRunning:n}){let r=e?.state?.phase;return r!==void 0&&_t.has(r)?r:t?`error`:n?`running`:`cancel`}function q({call:e,failure:t}){if(t)return{title:t.error};let n=e?.state;if(n?.phase!==`error`)return null;let{error:r,message:i}=n.failure;return r?r===i?{title:r}:{title:r,description:i}:{title:i}}function yt(e){let t=e.tools.find(t=>t.name===e.picked)??e.tools[0],n=t?e.drafts[t.name]??x(me(t.inputSchema)):``,r=e.calls.filter(e=>e.name===t?.name),i=r.find(t=>t.id===e.shownId)??r[0]??null;return{tool:t,text:n,shown:i,earlier:e.calls.filter(e=>e!==i)}}var J=t(n(),1);function bt(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`call-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function xt(e,t){let n=[...e.events,t],r=t.type===`tool`&&t.tool.phase===`progress`?t.tool.data:e.progress;return{...e,events:n,call:Te(n)[0]??null,progress:r}}function St(e,t){let n=(0,J.useMemo)(()=>ne(e,t),[e,t]),{iface:r,describeFailure:i}=Ye(n),[a,o]=(0,J.useState)([]),s=(0,J.useRef)(new Map),c=(0,J.useRef)([]),l=(0,J.useRef)(a);l.current=a,(0,J.useEffect)(()=>{let e=s.current;return()=>{for(let t of e.values())t.abort()}},[]);let u=(0,J.useCallback)((e,t)=>{o(n=>n.map(n=>n.id===e?t(n):n))},[]),d=(0,J.useCallback)(async(e,t)=>{let n=new AbortController;s.current.set(e,n);let r=performance.now();u(e,e=>({...e,isRunning:!0,failure:null}));try{await t(t=>{t.type!==`unsupported`&&t.type!==`malformed`&&u(e,e=>xt(e,t))},n.signal),u(e,e=>({...e,isRunning:!1,answering:null,elapsedMs:performance.now()-r}))}catch(t){let i=n.signal.aborted?null:f(t);u(e,e=>({...e,isRunning:!1,answering:null,failure:i,elapsedMs:performance.now()-r}))}finally{s.current.get(e)===n&&s.current.delete(e)}},[u]);return{iface:r,describeFailure:i,calls:a,run:(0,J.useCallback)((e,t)=>{let r=bt();return o(n=>[{id:r,name:e,input:t,events:[],call:null,progress:void 0,isRunning:!0,failure:null,answering:null,startedAt:Date.now(),elapsedMs:null},...n]),d(r,(r,i)=>n.call({name:e,input:t},r,i)),r},[d,n]),answer:(0,J.useCallback)(async(e,t)=>{let r=l.current.find(t=>t.id===e),i=r?.call?.state;if(!r?.call||i?.phase!==`gate`)return;let a=r.call.callId,o=Ce(r.call),s=re({toolName:r.name,gate:i.gate,sessionPermissions:c.current,resolution:t});s.decision===`approve`&&(c.current=s.sessionPermissions);let f=we(r.events);u(e,e=>({...e,answering:t.action})),await d(e,(e,t)=>n.invoke({gateId:a,operationId:o,decision:s.decision,...s.decision===`approve`&&s.secret!==void 0?{secret:s.secret}:{},replay:{name:r.name,input:i.gate.preparedArguments??r.input,gateKind:i.gate.kind,sessionPermissions:c.current,...f?{snapshot:f}:{}}},e,t))},[d,n,u]),cancel:(0,J.useCallback)(e=>{s.current.get(e)?.abort(),s.current.delete(e)},[])}}function Ct(e){return(0,W.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":!0,...e,children:(0,W.jsx)(`path`,{d:`M13.85 0a4.16 4.16 0 0 0-2.95 1.217L1.456 10.66a.835.835 0 0 0 0 1.18.835.835 0 0 0 1.18 0l9.442-9.442a2.49 2.49 0 0 1 3.541 0 2.49 2.49 0 0 1 0 3.541L8.59 12.97l-.1.1a.835.835 0 0 0 0 1.18.835.835 0 0 0 1.18 0l.1-.098 7.03-7.034a2.49 2.49 0 0 1 3.542 0l.049.05a2.49 2.49 0 0 1 0 3.54l-8.54 8.54a1.96 1.96 0 0 0 0 2.755l1.753 1.753a.835.835 0 0 0 1.18 0 .835.835 0 0 0 0-1.18l-1.753-1.753a.266.266 0 0 1 0-.394l8.54-8.54a4.185 4.185 0 0 0 0-5.9l-.05-.05a4.16 4.16 0 0 0-2.95-1.218c-.2 0-.401.02-.6.048a4.17 4.17 0 0 0-1.17-3.552A4.16 4.16 0 0 0 13.85 0m0 3.333a.84.84 0 0 0-.59.245L6.275 10.56a4.186 4.186 0 0 0 0 5.902 4.186 4.186 0 0 0 5.902 0L19.16 9.48a.835.835 0 0 0 0-1.18.835.835 0 0 0-1.18 0l-6.985 6.984a2.49 2.49 0 0 1-3.54 0 2.49 2.49 0 0 1 0-3.54l6.983-6.985a.835.835 0 0 0 0-1.18.84.84 0 0 0-.59-.245`})})}var wt=(0,J.lazy)(()=>l(()=>import(`./ToolResultCharts-B8nqKU-p.js`).then(e=>({default:e.ToolResultChart})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155]))),Tt=236,Et=260;function Dt({layout:e,parts:t=[]}){let n=k(),r=A(),i=(0,J.useMemo)(()=>new Intl.NumberFormat(r,{maximumFractionDigits:2}),[r]),a=(0,J.useMemo)(()=>lt(t,n(`@theorem.host.image`)),[t,n]),o=(0,J.useMemo)(()=>ut(t),[t]),[s,c]=(0,J.useState)(null);if(!ft(e,a)&&o.length===0)return null;let{images:l,audio:u}=a;return(0,W.jsxs)(j,{gap:3,children:[(0,W.jsxs)(Be,{minWidth:Et,children:[e.figures.map(e=>(0,W.jsx)(M,{children:(0,W.jsx)(ze,{title:e.label,value:Se(i.format(e.value),e.unit)})},`figure:${e.key}`)),e.charts.map(e=>(0,W.jsx)(J.Suspense,{fallback:(0,W.jsx)(M,{children:(0,W.jsx)(ke,{height:Tt})}),children:(0,W.jsx)(M,{children:(0,W.jsx)(wt,{chart:e})})},`chart:${e.key}`)),l.map((e,t)=>(0,W.jsx)(M,{children:(0,W.jsx)(je,{label:e.alt||`Open image`,padding:0,onClick:()=>c(t),children:(0,W.jsx)(de,{ratio:4/3,fit:`cover`,children:(0,W.jsx)(`img`,{src:e.src,alt:e.alt,loading:`lazy`})})})},`image:${e.src}`))]}),l.length>0?(0,W.jsx)(Oe,{isOpen:s!==null,onOpenChange:e=>{e||c(null)},media:l.map(e=>({src:e.src,alt:e.alt})),index:s??0,onIndexChange:c}):null,g(u,e=>e.src).map(({item:e,key:t})=>(0,W.jsx)(M,{children:(0,W.jsx)(E,{src:e.src,mimeType:e.mimeType})},t)),o.map(e=>(0,W.jsx)(M,{children:(0,W.jsx)(ae,{reference:e})},`reference:${e.uri}`))]})}function Ot({output:e,parts:t}){let n=k(),r=(0,J.useMemo)(()=>st(e),[e]),i=(0,J.useMemo)(()=>r.figures.map(e=>e.key),[r]);return(0,W.jsx)(D,{value:e,title:n(`@theorem.host.response`),lead:(0,W.jsx)(Dt,{layout:r,parts:t}),ledKeys:i})}var kt=8,At={running:`accent`,background:`accent`,gate:`warning`,complete:`success`,error:`error`,cancel:`neutral`};function jt(e,t,n){let r;try{r=JSON.parse(n)}catch{return{ok:!1,note:e(`@theorem.decision.invalid_json`)}}if(!y(r))return{ok:!1,note:e(`@theorem.decision.invalid_json`)};let i=pe(t.inputSchema,r);return i.length>0?{ok:!1,note:e(`@theorem.host.missing`,{fields:i.join(`, `)}),input:r}:{ok:!0,input:r}}var Mt={function:te,http:fe,mcp:Ct,agent:ee},Nt=440,Pt=2;function Ft(e,t){let n=e(`@theorem.host.kind.${t.kind}`);return t.description?`${n} · ${t.description}`:n}function It({tool:e}){let t=k();return e.access===`read-only`?null:(0,W.jsx)(De,{gap:1,wrap:`wrap`,children:(0,W.jsx)(u,{label:t(`@theorem.tool.access.${e.access}`),size:`sm`,color:e.access===`destructive`?`red`:`orange`})})}function Lt(e,t,n){return{label:t.call?oe(t.call):t.name,duration:t.isRunning?O(e,n-t.startedAt):t.elapsedMs==null?null:Ee(e,t.elapsedMs)}}function Y({call:e,onAnswer:t}){let n=e.call?.state;return n?.phase===`gate`?n.gate.kind===`auth`?(0,W.jsx)(le,{gate:n.gate,toolName:e.name,submitted:e.answering===`auth`,onAuthenticated:n=>void t(e.id,{action:`auth`,secret:n})}):(0,W.jsx)(ce,{gate:n.gate,toolName:e.name,input:e.input,decided:e.answering===`auth`?null:e.answering,onDecision:n=>void t(e.id,{action:n})}):null}function X(e){let t=e.call?.state;return!!q(e)||t?.phase===`complete`||!e.isRunning}function Z(e){let t=e.call?.state;return!X(e)&&t?.phase!==`gate`}function Rt({call:e,activity:t}){let n=e.call?.state,r=q(e);return(0,W.jsx)(Ae,{children:(0,W.jsxs)(j,{gap:3,children:[r?(0,W.jsx)(M,{children:(0,W.jsx)(We,{status:`error`,role:`alert`,title:r.title,description:r.description})}):null,n?.phase===`complete`?(0,W.jsx)(Ot,{output:n.output,parts:n.parts}):null,e.isRunning?null:(0,W.jsx)(M,{children:t})]})})}function zt({call:e,onAnswer:t}){let n=k(),{label:r,duration:i}=Lt(n,e,T(e.isRunning));if(Z(e))return(0,W.jsx)(N,{label:r,since:e.startedAt});let a=(0,W.jsx)(c,{size:`sm`,color:`secondary`,children:i?n(`@theorem.host.finished`,{activity:r,duration:i}):r});return(0,W.jsxs)(j,{gap:3,children:[(0,W.jsx)(Y,{call:e,onAnswer:t}),X(e)?(0,W.jsx)(Rt,{call:e,activity:a}):null]})}function Bt({calls:e,onPick:t}){let n=k(),r=A(),i=(0,J.useMemo)(()=>new Intl.DateTimeFormat(r,{timeStyle:`medium`}),[r]);return e.length===0?null:(0,W.jsxs)(j,{gap:1,children:[(0,W.jsx)(c,{type:`supporting`,color:`secondary`,as:`h3`,children:n(`@theorem.host.earlier`)}),(0,W.jsx)(Me,{hasDividers:!0,density:`compact`,children:e.slice(0,kt).map(e=>{let r=vt(e);return(0,W.jsx)(Ne,{label:e.name,startContent:(0,W.jsx)(K,{variant:At[r],label:n(`@theorem.host.status.${r}`),isPulsing:e.isRunning}),endContent:(0,W.jsx)(c,{type:`supporting`,color:`secondary`,hasTabularNumbers:!0,children:i.format(e.startedAt)}),onClick:()=>t(e)},e.id)})})]})}function Vt({tools:e,tool:t,check:n,text:r,view:i,shown:a,onText:o,onPick:s,onView:l,onRun:u,onStop:d}){let f=k(),p=`input`in n?n.input:void 0,m=i===`fields`&&p!==void 0;return(0,W.jsxs)(Fe,{title:f(`@theorem.host.request`),view:m?`fields`:`json`,hasFields:p!==void 0,onView:l,onRun:u,children:[(0,W.jsxs)(j,{gap:2,children:[(0,W.jsx)(Je,{label:f(`@theorem.host.tool`),size:`sm`,options:e.map(e=>({value:e.name,label:e.name,icon:Mt[e.kind],description:Ft(f,e)})),value:t.name,hasSearch:e.length>8,renderOption:e=>(0,W.jsx)(`div`,{style:{width:Nt,maxWidth:`100%`,minWidth:0},children:(0,W.jsx)(qe,{icon:e.icon,label:e.label,description:e.description&&(0,W.jsx)(c,{type:`supporting`,color:`secondary`,maxLines:Pt,children:e.description})})}),onChange:s}),(0,W.jsx)(It,{tool:t})]}),m?(0,W.jsx)(He,{schema:t.inputSchema,value:p,onChange:e=>{o(x(e))}},t.name):(0,W.jsx)(Le,{label:f(`@theorem.host.request`),text:r,isInvalid:p===void 0,onChange:o}),(0,W.jsx)(Ie,{note:n.ok?f(`@theorem.host.shortcut`):n.note,isReady:n.ok,isRunning:a?.isRunning===!0,runLabel:f(`@theorem.host.run`),runningLabel:f(`@theorem.host.running`),stopLabel:f(`@theorem.host.stop`),onRun:u,onStop:()=>{a&&d(a.id)}})]})}function Ht(e,t,n,r){return!t||!n?.ok||r?.isRunning?null:e.run(t.name,n.input)}function Ut(e,t){let n=k(),[r,i]=(0,J.useState)(e.tools[0]?.name),[a,o]=(0,J.useState)({}),[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)(`fields`),{tool:d,text:f,shown:p,earlier:m}=yt({tools:e.tools,picked:r,drafts:a,calls:t.calls,shownId:s}),h=d?jt(n,d,f):null;return{tool:d,text:f,shown:p,earlier:m,check:h,view:l,setView:u,setPicked:i,setText:e=>{d&&o(t=>({...t,[d.name]:e}))},run:()=>{let e=Ht(t,d,h,p);e!==null&&c(e)},pick:e=>{i(e.name),o(t=>({...t,[e.name]:x(e.input)})),c(e.id)}}}function Wt({shown:e,earlier:t,onAnswer:n,onPick:r}){return(0,W.jsxs)(W.Fragment,{children:[e?(0,W.jsx)(zt,{call:e,onAnswer:n}):null,(0,W.jsx)(Bt,{calls:t,onPick:r})]})}function Gt(e,t,n,r,i){if(!e)return i;let a=r.length===0;return!n&&a?null:(0,W.jsx)(Pe,{label:t,fill:n!=null&&Z(n)&&a,children:i})}function Kt({transport:e,iface:t,host:n,maxWidth:r=`960px`,trace:i,flush:a,columns:o=!1,className:s,style:c}){let l=k(),u=Ge(t,e.traces,i),d=Ut(t,n),{tool:f,check:p,shown:m,earlier:h}=d;return(0,W.jsxs)(Re,{inspector:u,maxWidth:r,flush:a,columns:o,requestLabel:l(`@theorem.host.request`),className:s,style:c,children:[f&&p?(0,W.jsx)(Vt,{tools:t.tools,tool:f,check:p,text:d.text,view:d.view,shown:m,onText:d.setText,onPick:d.setPicked,onView:d.setView,onRun:d.run,onStop:n.cancel}):(0,W.jsx)(w,{title:l(`@theorem.host.no_tools`)}),Gt(o,l(`@theorem.host.response`),m,h,(0,W.jsx)(Wt,{shown:m,earlier:h,onAnswer:n.answer,onPick:d.pick}))]})}function qt(e){let t=k(),n=St(e.transport,e.pageTools);return n.describeFailure?(0,W.jsx)(Ke,{title:n.describeFailure.error}):n.iface?(0,W.jsx)(Kt,{...e,iface:n.iface,host:n}):(0,W.jsx)(N,{label:t(`@theorem.chat.loading`)})}function Jt({endpoint:e,http:t,transport:n,theme:r,mode:i,labels:a,detectCodeLanguage:o,resolveMedia:s,...c}){let l=(0,J.useRef)(t);l.current=t;let u=(0,J.useMemo)(()=>n??h({...l.current,endpoint:e}),[n,e]);return(0,W.jsx)(Ue,{theme:r,mode:i,labels:a,detectCodeLanguage:o,media:`all`,resolveMedia:s,children:(0,W.jsx)(qt,{...c,transport:u})})}var Yt=e({HostView:()=>$,StudioHostConsole:()=>Q});function Q(e){let t=Ve(e,m,p);return(0,W.jsx)($,{...e,transport:t})}function $({payload:e,transport:t,trace:n,flush:r,columns:i,className:a}){let o=(0,J.useMemo)(()=>ie(e),[e]);return(0,W.jsx)(Jt,{detectCodeLanguage:!0,labels:se,resolveMedia:ue,transport:t,pageTools:o,trace:n,flush:r,columns:i,className:a})}export{$ as HostView,Q as StudioHostConsole,ht as n,Yt as t};
@@ -1 +0,0 @@
1
- import{Gi as e}from"./shaped-data-gYhn8vze.js";var t=e.filter(e=>e!==`builtin`),n=`Tool type must be ${t.join(`, `).replace(/, ([^,]+)$/,`, or $1`)}.`;export{n,t};