@autopo/mcp 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cli.js +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +4 -4
- package/dist/server.js.map +1 -1
- package/dist/tools/marketing.js +2 -2
- package/dist/tools/marketing.js.map +1 -1
- package/dist/tools/studio.js +2 -2
- package/dist/tools/studio.js.map +1 -1
- package/dist/ui/gallery.html +2 -2
- package/dist/ui/home.html +2 -2
- package/dist/ui/inbox.html +2 -2
- package/dist/ui/money.html +2 -2
- package/dist/ui/storyboard.html +2 -2
- package/package.json +3 -2
package/dist/ui/storyboard.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<meta name="color-scheme" content="light dark" />
|
|
7
|
-
<title>
|
|
7
|
+
<title>Autopo Storyboard</title>
|
|
8
8
|
<script type="module" crossorigin>var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var t=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function ee(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var te=ee.prototype=new b;te.constructor=ee,_(te,y.prototype),te.isPureReactComponent=!0;var ne=Array.isArray;function re(){}var x={H:null,A:null,T:null,S:null},ie=Object.prototype.hasOwnProperty;function S(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ae(e,t){return S(e.type,t,e.props)}function oe(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function se(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ce=/\/+/g;function le(e,t){return typeof e==`object`&&e&&e.key!=null?se(``+e.key):t.toString(36)}function ue(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(re,re):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function de(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,de(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+le(e,0):a,ne(o)?(i=``,c!=null&&(i=c.replace(ce,`$&/`)+`/`),de(o,r,i,``,function(e){return e})):o!=null&&(oe(o)&&(o=ae(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ce,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ne(e))for(var u=0;u<e.length;u++)a=e[u],s=l+le(a,u),c+=de(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+le(a,u++),c+=de(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return de(ue(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function fe(e,t,n){if(e==null)return e;var r=[],i=0;return de(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function pe(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var me=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function he(e){var t=x.T,n={};n.types=t===null?null:t.types,x.T=n;try{var r=e(),i=x.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(re,me)}catch(e){me(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),x.T=t}}function ge(e){var t=x.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else he(ge.bind(null,e))}var _e={map:fe,forEach:function(e,t,n){fe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return fe(e,function(){t++}),t},toArray:function(e){return fe(e,function(e){return e})||[]},only:function(e){if(!oe(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=_e,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=ee,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=x,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return x.H.useMemoCache(e)}},e.addTransitionType=ge,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ie.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return S(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ie.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return S(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=oe,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:pe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=he,e.unstable_useCacheRefresh=function(){return x.H.useCacheRefresh()},e.use=function(e){return x.H.use(e)},e.useActionState=function(e,t,n){return x.H.useActionState(e,t,n)},e.useCallback=function(e,t){return x.H.useCallback(e,t)},e.useContext=function(e){return x.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return x.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return x.H.useEffect(e,t)},e.useEffectEvent=function(e){return x.H.useEffectEvent(e)},e.useId=function(){return x.H.useId()},e.useImperativeHandle=function(e,t,n){return x.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return x.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return x.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return x.H.useMemo(e,t)},e.useOptimistic=function(e,t){return x.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return x.H.useReducer(e,t,n)},e.useRef=function(e){return x.H.useRef(e)},e.useState=function(e){return x.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return x.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return x.H.useTransition()},e.version=`19.3.1`})),n=e(((e,n)=>{n.exports=t()})),r=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,te||(te=!0,ae());else{var t=n(l);t!==null&&ce(ee,t.startTime-e)}}}var te=!1,ne=-1,re=5,x=-1;function ie(){return g?!0:!(e.unstable_now()-x<re)}function S(){if(g=!1,te){var t=e.unstable_now();x=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(ne),ne=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ie());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ce(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ae():te=!1}}}var ae;if(typeof y==`function`)ae=function(){y(S)};else if(typeof MessageChannel<`u`){var oe=new MessageChannel,se=oe.port2;oe.port1.onmessage=S,ae=function(){se.postMessage(null)}}else ae=function(){_(S,0)};function ce(t,n){ne=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):re=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(ne),ne=-1):h=!0,ce(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,te||(te=!0,ae()))),r},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),i=e(((e,t)=>{t.exports=r()})),a=e((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return l(e,t,null,n)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),o=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=a()})),s=e((e=>{var t=i(),r=n(),a=o();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(s(559))}}var ee=null,te=null;function ne(e,t,n){return e===n||e===t&&(ee=e,!0)}function re(e,t,n){return e===n?(te=e,!1):e===t&&(te!==null&&(ee=e),!0)}function x(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function ie(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var S=Object.assign,ae=Symbol.for(`react.element`),oe=Symbol.for(`react.transitional.element`),se=Symbol.for(`react.portal`),ce=Symbol.for(`react.fragment`),le=Symbol.for(`react.strict_mode`),ue=Symbol.for(`react.profiler`),de=Symbol.for(`react.consumer`),fe=Symbol.for(`react.context`),pe=Symbol.for(`react.forward_ref`),me=Symbol.for(`react.suspense`),he=Symbol.for(`react.suspense_list`),ge=Symbol.for(`react.memo`),_e=Symbol.for(`react.lazy`),ve=Symbol.for(`react.activity`),ye=Symbol.for(`react.legacy_hidden`),be=Symbol.for(`react.memo_cache_sentinel`),C=Symbol.for(`react.view_transition`),xe=Symbol.for(`react.recoverable`),Se=Symbol.iterator;function Ce(e){return typeof e!=`object`||!e?null:(e=Se&&e[Se]||e[`@@iterator`],typeof e==`function`?e:null)}var we=Symbol.for(`react.client.reference`);function Te(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===we?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ce:return`Fragment`;case ue:return`Profiler`;case le:return`StrictMode`;case me:return`Suspense`;case he:return`SuspenseList`;case ve:return`Activity`;case C:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case se:return`Portal`;case fe:return e.displayName||`Context`;case de:return(e._context.displayName||`Context`)+`.Consumer`;case pe:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ge:return t=e.displayName||null,t===null?Te(e.type)||`Memo`:t;case _e:t=e._payload,e=e._init;try{return Te(e(t))}catch{}}return null}var Ee=Array.isArray,w=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,T=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,De={pending:!1,data:null,method:null,action:null},Oe=[],ke=-1;function Ae(e){return{current:e}}function je(e){0>ke||(e.current=Oe[ke],Oe[ke]=null,ke--)}function E(e,t){ke++,Oe[ke]=e.current,e.current=t}var Me=Ae(null),Ne=Ae(null),Pe=Ae(null),Fe=Ae(null);function Ie(e,t){switch(E(Pe,t),E(Ne,e),E(Me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?fp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=fp(t),e=pp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}je(Me),E(Me,e)}function Le(){je(Me),je(Ne),je(Pe)}function Re(e){var t=e.memoizedState;t!==null&&(ch._currentValue=t.memoizedState,E(Fe,e)),t=Me.current;var n=pp(t,e.type);t!==n&&(E(Ne,e),E(Me,n))}function ze(e){Ne.current===e&&(je(Me),je(Ne)),Fe.current===e&&(je(Fe),ch._currentValue=De)}var Be,Ve;function He(e){if(Be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Be=t&&t[1]||``,Ve=-1<e.stack.indexOf(`
|
|
9
9
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
10
10
|
`+Be+e+Ve}var Ue=!1;function We(e,t){if(!e||Ue)return``;Ue=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -114,7 +114,7 @@ Boolean requesting whether a visible border and background is provided by the ho
|
|
|
114
114
|
- "model": Tool visible to and callable by the agent
|
|
115
115
|
- "app": Tool callable by the app from this server only`),csp:wc().optional(),permissions:wc().optional()}),z({mimeTypes:R(P()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),z({method:W(`ui/download-file`),params:z({contents:R(V([$u,K])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),z({method:W(`ui/message`),params:z({role:W(`user`).describe(`Message role, currently only "user" is supported.`),content:R(q).describe(`Message content blocks (text, image, etc.).`)})}),z({method:W(`ui/notifications/sandbox-resource-ready`),params:z({html:P().describe(`HTML content to load into the inner iframe.`),sandbox:P().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:Rh.optional().describe(`CSP configuration from resource metadata.`),permissions:zh.optional().describe(`Sandbox permissions from resource metadata.`)})});var Qh=z({method:W(`ui/notifications/tool-result`),params:od.describe(`Standard MCP tool execution result.`)}),$h=z({toolInfo:z({id:Fl.optional().describe(`JSON-RPC id of the tools/call request.`),tool:rd.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:Mh.optional().describe(`Current color theme preference.`),styles:Wh.optional().describe(`Style configuration for theming the app.`),displayMode:Nh.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:R(Nh).optional().describe(`Display modes the host supports.`),containerDimensions:V([z({height:F().describe(`Fixed container height in pixels.`)}),z({maxHeight:V([F(),_c()]).optional().describe(`Maximum container height in pixels.`)})]).and(V([z({width:F().describe(`Fixed container width in pixels.`)}),z({maxWidth:V([F(),_c()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
116
116
|
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:P().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:P().optional().describe(`User's timezone in IANA format.`),userAgent:P().optional().describe(`Host application identifier.`),platform:V([W(`web`),W(`desktop`),W(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:z({touch:I().optional().describe(`Whether the device supports touch input.`),hover:I().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:z({top:F().describe(`Top safe area inset in pixels.`),right:F().describe(`Right safe area inset in pixels.`),bottom:F().describe(`Bottom safe area inset in pixels.`),left:F().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),eg=z({method:W(`ui/notifications/host-context-changed`),params:$h.describe(`Partial context update containing only changed fields.`)});z({method:W(`ui/update-model-context`),params:z({content:R(q).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:H(P(),L().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),z({method:W(`ui/initialize`),params:z({appInfo:Jl.describe(`App identification (name and version).`),appCapabilities:Yh.describe(`Features and capabilities this app provides.`),protocolVersion:P().describe(`Protocol version this app supports.`)})});var tg=z({protocolVersion:P().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:Jl.describe(`Host application identification and version.`),hostCapabilities:Jh.describe(`Features and capabilities provided by the host.`),hostContext:$h.describe(`Rich context about the host environment.`)}).passthrough(),ng={target:`draft-2020-12`};async function rg(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](ng);throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function ig(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function ag(){let e=document.documentElement.getAttribute(`data-theme`);return e===`dark`||e===`light`?e:document.documentElement.classList.contains(`dark`)?`dark`:`light`}function og(e){let t=document.documentElement;t.setAttribute(`data-theme`,e),t.style.colorScheme=e}function sg(e,t=document.documentElement){for(let[n,r]of Object.entries(e))r!==void 0&&t.style.setProperty(n,r)}function cg(e){if(document.getElementById(`__mcp-host-fonts`))return;let t=document.createElement(`style`);t.id=`__mcp-host-fonts`,t.textContent=e,document.head.appendChild(t)}function lg(e,t){let n={...e,...t};return t.experimental!==void 0&&(n.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(n.tools={...e.tools,...t.tools}),n}var ug=class e extends oh{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new Th;_methods=new Eh;setRequestHandler=(...e)=>{let[t,...n]=Oh(`request`,e)??e;this._methods.claim(t,`setRequestHandler`),super.setRequestHandler.call(this,t,...n)};setNotificationHandler=(...e)=>{let[t,...n]=Oh(`notification`,e)??e;this._methods.claim(t,`setNotificationHandler`),super.setNotificationHandler.call(this,t,...n)};removeRequestHandler=e=>{this._methods.release(e),super.removeRequestHandler(e)};removeNotificationHandler=e=>{this._methods.release(e),super.removeNotificationHandler(e)};replaceRequestHandler=(e,...t)=>{this._methods.replace(e),super.setRequestHandler.call(this,e,...t)};_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:Bh,toolinputpartial:Vh,toolresult:Qh,toolcancelled:Hh,hostcontextchanged:eg};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.setHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.addEventListener(e,t)}removeEventListener(e,t){this._events.removeEventListener(e,t)}_ensureEventSlot(e){if(this._registeredEvents.has(e))return;let t=this.eventSchemas[e];if(!t)throw Error(`Unknown event: ${String(e)}`);this.setNotificationHandler(t.shape.method.value,{params:t.shape.params},t=>{let n=t;e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...n}),this._events.dispatch(e,n)}),this._registeredEvents.add(e)}getEventHandler(e){return this._events.getHandler(e)}warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._appCapabilities=t,this.options=n,this._methods.replace(`notifications/cancelled`),this._methods.replace(`notifications/progress`),n.allowUnsafeEval||lt({jitless:!0}),this.replaceRequestHandler(`ping`,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}buildContext(e){return e}registerAppCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._appCapabilities=lg(this._appCapabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._appCapabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await ig(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await ig(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await rg(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await rg(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(`ui/resource-teardown`,{params:Gh.shape.params,result:Kh},(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(`tools/call`,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(`tools/list`,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;default:return}}assertNotificationCapability(e){}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},t)}async createSamplingMessage(e,t){return this._assertInitialized(`createSamplingMessage`),await this.request({method:`sampling/createMessage`,params:e},t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},Lh,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},Hl,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},Fh,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},Ih,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},Xh,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new jh(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1;try{await super.connect(e);let n=await this.request({method:`ui/initialize`,params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:Ah}},tg,t);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);this._hostCapabilities=n.hostCapabilities,this._hostInfo=n.hostInfo,this._hostContext=n.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function dg({appInfo:e,capabilities:t,onAppCreated:n,autoResize:r=!0,strict:i}){let[a,o]=(0,l.useState)(null),[s,c]=(0,l.useState)(!1),[u,d]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let a=!0,s;async function l(){try{let l=new jh(window.parent,window.parent);if(s=new ug(e,t,{autoResize:r,strict:i}),n?.(s),await s.connect(l),!a){s.close();return}o(s),c(!0),d(null)}catch(e){a&&(o(null),c(!1),d(e instanceof Error?e:Error(`Failed to connect`)))}}return l(),()=>{a=!1,s?.close()}},[]),{app:a,isConnected:s,error:u}}function fg(){let[e,t]=(0,l.useState)(ag);return(0,l.useEffect)(()=>{let e=new MutationObserver(()=>{t(ag())});return e.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`,`class`],characterData:!1,childList:!1,subtree:!1}),()=>e.disconnect()},[]),e}function pg(e,t){let n=(0,l.useRef)(!1);(0,l.useEffect)(()=>{n.current||(t?.theme&&og(t.theme),t?.styles?.variables&&sg(t.styles.variables),(t?.theme||t?.styles?.variables)&&(n.current=!0))},[t]),(0,l.useEffect)(()=>{if(!e)return;let t=e=>{e.theme&&og(e.theme),e.styles?.variables&&sg(e.styles.variables)};return e.addEventListener(`hostcontextchanged`,t),()=>e.removeEventListener(`hostcontextchanged`,t)},[e])}function mg(e,t){let n=(0,l.useRef)(!1);(0,l.useEffect)(()=>{n.current||t?.styles?.css?.fonts&&(cg(t.styles.css.fonts),n.current=!0)},[t]),(0,l.useEffect)(()=>{if(!e)return;let t=e=>{e.styles?.css?.fonts&&cg(e.styles.css.fonts)};return e.addEventListener(`hostcontextchanged`,t),()=>e.removeEventListener(`hostcontextchanged`,t)},[e])}function hg(e,t){pg(e,t),mg(e,t)}var gg=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),$=e(((e,t)=>{t.exports=gg()}))(),_g=e=>(e.content??[]).map(e=>e.text??``).join(`
|
|
117
|
-
`).trim()||`Something went wrong.`;function vg(e){let[t,n]=(0,l.useState)(null),[r,i]=(0,l.useState)({}),[a,o]=(0,l.useState)(null),[s,c]=(0,l.useState)(null),{app:u,isConnected:d,error:f}=dg({appInfo:{name:`autopoiesis-${e}`,version:`0.1.0`},capabilities:{},onAppCreated:e=>{e.ontoolinput=e=>i(e.arguments??{}),e.ontoolresult=e=>{let t=e;t.isError?o(_g(t)):(o(null),n(t.structuredContent??null))},e.onerror=e=>o(String(e?.message??e))}});hg(u,u?.getHostContext());let p=fg();(0,l.useEffect)(()=>{document.documentElement.dataset.theme=p},[p]);let m=(0,l.useCallback)(async(e,t={})=>{if(!u)throw Error(`Not connected yet.`);let n=await u.callServerTool({name:e,arguments:t});if(n.isError)throw Error(_g(n));return n.structuredContent},[u]),h=(0,l.useCallback)(e=>{u?.openLink({url:e})},[u]),g=(0,l.useCallback)(e=>{u?.sendMessage({role:`user`,content:[{type:`text`,text:e}]})},[u]),_=(0,l.useCallback)(e=>{c(e),window.setTimeout(()=>c(null),2200)},[]);return{app:u,ready:d&&!!u,data:t,setData:n,args:r,error:a??f?.message??null,theme:p,call:m,open:h,say:g,toast:_,notice:s}}function yg({live:e=!1,size:t=34}){return(0,$.jsxs)(`svg`,{className:`cell`,width:t,height:t,viewBox:`0 0 64 64`,"aria-hidden":!0,children:[(0,$.jsx)(`rect`,{width:`64`,height:`64`,rx:`18`,fill:`var(--surface-3)`}),(0,$.jsx)(`circle`,{cx:`32`,cy:`32`,r:`17`,fill:`none`,stroke:`var(--life)`,strokeWidth:`3`,opacity:`0.9`}),(0,$.jsx)(`circle`,{cx:`32`,cy:`32`,r:`6`,fill:`var(--life)`,className:e?`dot pulse`:void 0,style:{transformOrigin:`32px 32px`}}),(0,$.jsx)(`circle`,{cx:`46`,cy:`22`,r:`3`,fill:`var(--life)`,opacity:`0.7`})]})}function bg({eyebrow:e,title:t,sub:n,right:r,live:i,children:a,notice:o}){return(0,$.jsxs)(`section`,{className:`shell`,children:[(0,$.jsxs)(`header`,{className:`head`,children:[(0,$.jsx)(yg,{live:i}),(0,$.jsxs)(`div`,{className:`titles`,children:[(0,$.jsx)(`div`,{className:`eyebrow`,children:e}),(0,$.jsx)(`h1`,{className:`title`,children:t}),n?(0,$.jsx)(`p`,{className:`sub`,children:n}):null]}),r?(0,$.jsx)(`div`,{className:`right`,children:r}):null]}),(0,$.jsx)(`div`,{className:`body`,children:a}),o?(0,$.jsx)(`div`,{className:`toast`,role:`status`,children:o}):null]})}function xg({tone:e,children:t,outline:n}){return(0,$.jsx)(`span`,{className:[`pill`,e,n?`outline`:``].filter(Boolean).join(` `),children:t})}function Sg({tone:e,pulse:t}){return(0,$.jsx)(`i`,{className:[`dot`,e,t?`pulse`:``].filter(Boolean).join(` `)})}function Cg({tone:e,xs:t,busy:n,children:r,...i}){return(0,$.jsxs)(`button`,{...i,disabled:i.disabled||n,className:[`btn`,e,t?`xs`:``].filter(Boolean).join(` `),children:[n?(0,$.jsx)(`i`,{className:`spin`}):null,r]})}function wg({children:e}){return(0,$.jsx)(`div`,{className:`empty`,children:e})}function Tg(e){if(!e)return``;let t=(Date.now()-new Date(e).getTime())/1e3;return Number.isFinite(t)?t<60?`just now`:t<3600?`${Math.floor(t/60)} min ago`:t<86400?`${Math.floor(t/3600)} h ago`:`${Math.floor(t/86400)} d ago`:``}var Eg=e=>e==null?``:e>=60?`${Math.floor(e/60)}:${String(Math.round(e%60)).padStart(2,`0`)}`:`${Math.round(e)}s`,Dg=e=>!!(e&&[`queued`,`generating`,`running`,`rendering`,`processing`,`pending`].includes(e)),Og=e=>({"16:9":16/9,"9:16":9/16,"1:1":1,"4:5":4/5})[e]??16/9;function kg(e){if(e.media?.thumb_url||e.media?.url)return e.media;let t=(e.takes??[]).find(e=>e.picked&&(e.media.thumb_url||e.media.url));return t?t.media:[...e.takes??[]].reverse().find(e=>e.media.thumb_url||e.media.url)?.media??null}function Ag({shot:e,aspect:t,open:n,onOpen:r}){let i=kg(e),a=Dg(e.media?.status)||Dg(e.voice?.status)||(e.takes??[]).some(e=>Dg(e.media.status)),o=(e.takes??[]).filter(e=>e.stage===`keyframe`).length,s=(e.takes??[]).filter(e=>e.stage===`clip`).length;return(0,$.jsxs)(`div`,{className:`card`,style:{width:n?320:196,flex:`none`,scrollSnapAlign:`start`,padding:10,gap:6,cursor:`pointer`,borderColor:n?`var(--line-strong)`:void 0},onClick:r,children:[(0,$.jsxs)(`div`,{className:`thumb`,style:{aspectRatio:String(Og(t)),width:`100%`},children:[i?.thumb_url||i?.url?i.url&&!i.thumb_url&&/\.(mp4|webm|mov)(\?|$)/i.test(i.url)?(0,$.jsx)(`video`,{src:i.url,muted:!0,playsInline:!0}):(0,$.jsx)(`img`,{src:i.thumb_url??i.url??``,alt:``}):(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`grid`,placeItems:`center`,color:`var(--ink-4)`,fontSize:11},children:e.visual===`title`?e.on_screen_text||`Title card`:e.visual===`presenter`?`Presenter`:a?(0,$.jsx)(`i`,{className:`spin`}):`No picture yet`}),(0,$.jsx)(`span`,{className:`tag pill`,style:{height:18,fontSize:10},children:e.order}),(0,$.jsx)(`span`,{className:`tr`,children:a?(0,$.jsx)(Sg,{tone:`life`,pulse:!0}):e.media?(0,$.jsx)(Sg,{tone:`life`}):(0,$.jsx)(Sg,{})}),e.voice?(0,$.jsx)(`span`,{className:`pill info`,style:{position:`absolute`,right:6,bottom:6,height:18,fontSize:10},children:`voiced`}):null]}),(0,$.jsxs)(`div`,{className:`row`,style:{gap:6},children:[e.direction?.beat?(0,$.jsx)(xg,{outline:!0,children:e.direction.beat}):null,(0,$.jsx)(`span`,{className:`tiny faint`,children:Eg(e.cut_seconds??e.duration_seconds)}),(0,$.jsx)(`span`,{className:`grow`}),o||s?(0,$.jsxs)(`span`,{className:`tiny faint`,children:[o?`${o} kf`:``,o&&s?` · `:``,s?`${s} clips`:``]}):null]}),(0,$.jsx)(`div`,{className:[`small`,n?``:`clamp2`].join(` `),style:{fontStyle:e.voiceover?`italic`:`normal`,color:e.voiceover?`var(--ink-1)`:`var(--ink-4)`},children:e.voiceover?`“${e.voiceover}”`:`No line`}),n?(0,$.jsxs)(`div`,{className:`grid`,style:{gap:6},children:[e.direction_summary?(0,$.jsx)(`div`,{className:`tiny muted`,children:e.direction_summary}):null,(0,$.jsx)(`div`,{className:`tiny muted clamp3`,children:e.prompt}),(e.takes??[]).length?(0,$.jsx)(`div`,{className:`row`,style:{gap:6},children:(e.takes??[]).slice(-6).map((e,n)=>(0,$.jsxs)(`div`,{className:`thumb`,title:`${e.stage} · ${e.verdict??``} ${e.score??``}`,style:{width:54,aspectRatio:String(Og(t)),outline:e.picked?`2px solid var(--life)`:void 0},children:[e.media.thumb_url||e.media.url?(0,$.jsx)(`img`,{src:e.media.thumb_url??e.media.url??``,alt:``}):(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`grid`,placeItems:`center`},children:Dg(e.media.status)?(0,$.jsx)(`i`,{className:`spin`}):(0,$.jsx)(`span`,{className:`tiny faint`,children:e.stage[0]})}),e.verdict?(0,$.jsx)(`span`,{className:[`tag pill`,e.verdict===`pass`?`life`:e.verdict===`fix`?`attention`:`danger`].join(` `),style:{height:14,fontSize:9,padding:`0 4px`},children:e.score??e.verdict}):null]},n))}):null]}):null]})}function jg(){let e=vg(`storyboard`),t=e.data,[n,r]=(0,l.useState)(null),[i,a]=(0,l.useState)(null),o=t?.shots??[],s=o.filter(e=>Dg(e.media?.status)||Dg(e.voice?.status)||(e.takes??[]).some(e=>Dg(e.media.status))).length,c=t?.status===`rendering`||Dg(t?.output?.status),u=s>0||c,d=o.filter(e=>(e.visual===`generate`||e.visual===`footage`)&&!e.media).length,f=o.filter(e=>e.visual===`generate`&&!(e.takes??[]).some(e=>e.stage===`keyframe`)).length,p=o.filter(e=>e.voiceover&&!e.voice).length,m=async n=>{if(t){a(n);try{e.setData(await e.call(`app_video`,{video:t.id,action:n})),e.toast(n===`refresh`?`Refreshed`:`Started`)}catch(t){e.toast(t.message)}finally{a(null)}}};(0,l.useEffect)(()=>{if(!u||!t)return;let e=window.setInterval(()=>void m(`refresh`),8e3);return()=>window.clearInterval(e)},[u,t?.id]);let h=t?.style?.models??{};return(0,$.jsxs)(bg,{eyebrow:`Autopoiesis · Studio`,title:t?.title??`Storyboard`,sub:t?(0,$.jsxs)($.Fragment,{children:[o.length,` shots · `,Eg(t.running_seconds),` · `,t.aspect_ratio,t.style?.look?.name?` · ${t.style.look.name}`:``,t.updated_at?` · ${Tg(t.updated_at)}`:``]}):void 0,live:u,right:t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(xg,{tone:t.status===`ready`?`life`:t.status===`failed`?`danger`:c?`attention`:void 0,children:c?`rendering`:t.status}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,busy:i===`refresh`,onClick:()=>void m(`refresh`),children:`Refresh`})]}):null,notice:e.notice,children:[e.error?(0,$.jsx)(wg,{children:e.error}):null,!t&&!e.error?(0,$.jsx)(wg,{children:(0,$.jsx)(`i`,{className:`spin`})}):null,t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`rail`,children:[o.map(e=>(0,$.jsx)(Ag,{shot:e,aspect:t.aspect_ratio,open:n===e.id,onOpen:()=>r(n===e.id?null:e.id)},e.id)),o.length===0?(0,$.jsx)(wg,{children:`No shots yet. Ask the Creative Director to draft them.`}):null]}),(0,$.jsxs)(`div`,{className:`row`,style:{gap:6},children:[s?(0,$.jsxs)(xg,{tone:`life`,children:[(0,$.jsx)(Sg,{tone:`life`,pulse:!0}),` `,s,` generating`]}):null,f?(0,$.jsxs)(xg,{outline:!0,children:[f,` without keyframes`]}):null,d?(0,$.jsxs)(xg,{tone:`attention`,children:[d,` without a picture`]}):null,p?(0,$.jsxs)(xg,{tone:`attention`,children:[p,` lines unvoiced`]}):null,!d&&!p&&!s&&!c&&t.status!==`ready`?(0,$.jsx)(xg,{tone:`life`,children:`ready to render`}):null,(0,$.jsx)(`span`,{className:`grow`}),Object.keys(h).length?(0,$.jsx)(`span`,{className:`tiny faint`,children:Object.entries(h).filter(([,e])=>e).map(([e,t])=>`${e}: ${t}`).join(` · `)}):null]}),(0,$.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,$.jsx)(Cg,{xs:!0,busy:i===`keyframes`,disabled:u||f===0,onClick:()=>void m(`keyframes`),title:`A still per shot, cents each`,children:`Keyframes`}),(0,$.jsx)(Cg,{xs:!0,busy:i===`critique_keyframes`,disabled:u,onClick:()=>void m(`critique_keyframes`),children:`Critique keyframes`}),(0,$.jsx)(Cg,{tone:`ink`,xs:!0,busy:i===`make`,disabled:u||d===0&&p===0,onClick:()=>void m(`make`),title:`Clips and voice lines: credits leave your balance`,children:`Make clips & voice`}),(0,$.jsx)(Cg,{xs:!0,busy:i===`critique_clips`,disabled:u,onClick:()=>void m(`critique_clips`),children:`Critique clips`}),(0,$.jsx)(Cg,{tone:`life`,xs:!0,busy:i===`render`,disabled:u||d>0||p>0,onClick:()=>void m(`render`),children:`Render`}),(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:()=>e.say(`Direct the video "${t.title}" (${t.id}) with the Creative Director: what would make it stronger?`),children:`Ask Rose`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:()=>e.open(`https://app.autopoiesis.app/c/${e.args.company??``}/studio/${t.id}`),children:`Open in Studio`})]}),t.output?.url?(0,$.jsx)(`div`,{className:`thumb`,style:{aspectRatio:String(Og(t.aspect_ratio)),maxHeight:420},children:(0,$.jsx)(`video`,{src:t.output.url,controls:!0,playsInline:!0})}):null,t.render_error?(0,$.jsxs)(`div`,{className:`tiny`,style:{color:`var(--danger)`},children:[`Render failed: `,t.render_error]}):null]}):null]})}(0,u.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(l.StrictMode,{children:(0,$.jsx)(jg,{})}));</script>
|
|
117
|
+
`).trim()||`Something went wrong.`;function vg(e){let[t,n]=(0,l.useState)(null),[r,i]=(0,l.useState)({}),[a,o]=(0,l.useState)(null),[s,c]=(0,l.useState)(null),{app:u,isConnected:d,error:f}=dg({appInfo:{name:`autopoiesis-${e}`,version:`0.1.0`},capabilities:{},onAppCreated:e=>{e.ontoolinput=e=>i(e.arguments??{}),e.ontoolresult=e=>{let t=e;t.isError?o(_g(t)):(o(null),n(t.structuredContent??null))},e.onerror=e=>o(String(e?.message??e))}});hg(u,u?.getHostContext());let p=fg();(0,l.useEffect)(()=>{document.documentElement.dataset.theme=p},[p]);let m=(0,l.useCallback)(async(e,t={})=>{if(!u)throw Error(`Not connected yet.`);let n=await u.callServerTool({name:e,arguments:t});if(n.isError)throw Error(_g(n));return n.structuredContent},[u]),h=(0,l.useCallback)(e=>{u?.openLink({url:e})},[u]),g=(0,l.useCallback)(e=>{u?.sendMessage({role:`user`,content:[{type:`text`,text:e}]})},[u]),_=(0,l.useCallback)(e=>{c(e),window.setTimeout(()=>c(null),2200)},[]);return{app:u,ready:d&&!!u,data:t,setData:n,args:r,error:a??f?.message??null,theme:p,call:m,open:h,say:g,toast:_,notice:s}}function yg({live:e=!1,size:t=34}){return(0,$.jsxs)(`svg`,{className:`cell`,width:t,height:t,viewBox:`0 0 64 64`,"aria-hidden":!0,children:[(0,$.jsx)(`rect`,{width:`64`,height:`64`,rx:`18`,fill:`var(--surface-3)`}),(0,$.jsx)(`circle`,{cx:`32`,cy:`32`,r:`17`,fill:`none`,stroke:`var(--life)`,strokeWidth:`3`,opacity:`0.9`}),(0,$.jsx)(`circle`,{cx:`32`,cy:`32`,r:`6`,fill:`var(--life)`,className:e?`dot pulse`:void 0,style:{transformOrigin:`32px 32px`}}),(0,$.jsx)(`circle`,{cx:`46`,cy:`22`,r:`3`,fill:`var(--life)`,opacity:`0.7`})]})}function bg({eyebrow:e,title:t,sub:n,right:r,live:i,children:a,notice:o}){return(0,$.jsxs)(`section`,{className:`shell`,children:[(0,$.jsxs)(`header`,{className:`head`,children:[(0,$.jsx)(yg,{live:i}),(0,$.jsxs)(`div`,{className:`titles`,children:[(0,$.jsx)(`div`,{className:`eyebrow`,children:e}),(0,$.jsx)(`h1`,{className:`title`,children:t}),n?(0,$.jsx)(`p`,{className:`sub`,children:n}):null]}),r?(0,$.jsx)(`div`,{className:`right`,children:r}):null]}),(0,$.jsx)(`div`,{className:`body`,children:a}),o?(0,$.jsx)(`div`,{className:`toast`,role:`status`,children:o}):null]})}function xg({tone:e,children:t,outline:n}){return(0,$.jsx)(`span`,{className:[`pill`,e,n?`outline`:``].filter(Boolean).join(` `),children:t})}function Sg({tone:e,pulse:t}){return(0,$.jsx)(`i`,{className:[`dot`,e,t?`pulse`:``].filter(Boolean).join(` `)})}function Cg({tone:e,xs:t,busy:n,children:r,...i}){return(0,$.jsxs)(`button`,{...i,disabled:i.disabled||n,className:[`btn`,e,t?`xs`:``].filter(Boolean).join(` `),children:[n?(0,$.jsx)(`i`,{className:`spin`}):null,r]})}function wg({children:e}){return(0,$.jsx)(`div`,{className:`empty`,children:e})}function Tg(e){if(!e)return``;let t=(Date.now()-new Date(e).getTime())/1e3;return Number.isFinite(t)?t<60?`just now`:t<3600?`${Math.floor(t/60)} min ago`:t<86400?`${Math.floor(t/3600)} h ago`:`${Math.floor(t/86400)} d ago`:``}var Eg=e=>e==null?``:e>=60?`${Math.floor(e/60)}:${String(Math.round(e%60)).padStart(2,`0`)}`:`${Math.round(e)}s`,Dg=e=>!!(e&&[`queued`,`generating`,`running`,`rendering`,`processing`,`pending`].includes(e)),Og=e=>({"16:9":16/9,"9:16":9/16,"1:1":1,"4:5":4/5})[e]??16/9;function kg(e){if(e.media?.thumb_url||e.media?.url)return e.media;let t=(e.takes??[]).find(e=>e.picked&&(e.media.thumb_url||e.media.url));return t?t.media:[...e.takes??[]].reverse().find(e=>e.media.thumb_url||e.media.url)?.media??null}function Ag({shot:e,aspect:t,open:n,onOpen:r}){let i=kg(e),a=Dg(e.media?.status)||Dg(e.voice?.status)||(e.takes??[]).some(e=>Dg(e.media.status)),o=(e.takes??[]).filter(e=>e.stage===`keyframe`).length,s=(e.takes??[]).filter(e=>e.stage===`clip`).length;return(0,$.jsxs)(`div`,{className:`card`,style:{width:n?320:196,flex:`none`,scrollSnapAlign:`start`,padding:10,gap:6,cursor:`pointer`,borderColor:n?`var(--line-strong)`:void 0},onClick:r,children:[(0,$.jsxs)(`div`,{className:`thumb`,style:{aspectRatio:String(Og(t)),width:`100%`},children:[i?.thumb_url||i?.url?i.url&&!i.thumb_url&&/\.(mp4|webm|mov)(\?|$)/i.test(i.url)?(0,$.jsx)(`video`,{src:i.url,muted:!0,playsInline:!0}):(0,$.jsx)(`img`,{src:i.thumb_url??i.url??``,alt:``}):(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`grid`,placeItems:`center`,color:`var(--ink-4)`,fontSize:11},children:e.visual===`title`?e.on_screen_text||`Title card`:e.visual===`presenter`?`Presenter`:a?(0,$.jsx)(`i`,{className:`spin`}):`No picture yet`}),(0,$.jsx)(`span`,{className:`tag pill`,style:{height:18,fontSize:10},children:e.order}),(0,$.jsx)(`span`,{className:`tr`,children:a?(0,$.jsx)(Sg,{tone:`life`,pulse:!0}):e.media?(0,$.jsx)(Sg,{tone:`life`}):(0,$.jsx)(Sg,{})}),e.voice?(0,$.jsx)(`span`,{className:`pill info`,style:{position:`absolute`,right:6,bottom:6,height:18,fontSize:10},children:`voiced`}):null]}),(0,$.jsxs)(`div`,{className:`row`,style:{gap:6},children:[e.direction?.beat?(0,$.jsx)(xg,{outline:!0,children:e.direction.beat}):null,(0,$.jsx)(`span`,{className:`tiny faint`,children:Eg(e.cut_seconds??e.duration_seconds)}),(0,$.jsx)(`span`,{className:`grow`}),o||s?(0,$.jsxs)(`span`,{className:`tiny faint`,children:[o?`${o} kf`:``,o&&s?` · `:``,s?`${s} clips`:``]}):null]}),(0,$.jsx)(`div`,{className:[`small`,n?``:`clamp2`].join(` `),style:{fontStyle:e.voiceover?`italic`:`normal`,color:e.voiceover?`var(--ink-1)`:`var(--ink-4)`},children:e.voiceover?`“${e.voiceover}”`:`No line`}),n?(0,$.jsxs)(`div`,{className:`grid`,style:{gap:6},children:[e.direction_summary?(0,$.jsx)(`div`,{className:`tiny muted`,children:e.direction_summary}):null,(0,$.jsx)(`div`,{className:`tiny muted clamp3`,children:e.prompt}),(e.takes??[]).length?(0,$.jsx)(`div`,{className:`row`,style:{gap:6},children:(e.takes??[]).slice(-6).map((e,n)=>(0,$.jsxs)(`div`,{className:`thumb`,title:`${e.stage} · ${e.verdict??``} ${e.score??``}`,style:{width:54,aspectRatio:String(Og(t)),outline:e.picked?`2px solid var(--life)`:void 0},children:[e.media.thumb_url||e.media.url?(0,$.jsx)(`img`,{src:e.media.thumb_url??e.media.url??``,alt:``}):(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`grid`,placeItems:`center`},children:Dg(e.media.status)?(0,$.jsx)(`i`,{className:`spin`}):(0,$.jsx)(`span`,{className:`tiny faint`,children:e.stage[0]})}),e.verdict?(0,$.jsx)(`span`,{className:[`tag pill`,e.verdict===`pass`?`life`:e.verdict===`fix`?`attention`:`danger`].join(` `),style:{height:14,fontSize:9,padding:`0 4px`},children:e.score??e.verdict}):null]},n))}):null]}):null]})}function jg(){let e=vg(`storyboard`),t=e.data,[n,r]=(0,l.useState)(null),[i,a]=(0,l.useState)(null),o=t?.shots??[],s=o.filter(e=>Dg(e.media?.status)||Dg(e.voice?.status)||(e.takes??[]).some(e=>Dg(e.media.status))).length,c=t?.status===`rendering`||Dg(t?.output?.status),u=s>0||c,d=o.filter(e=>(e.visual===`generate`||e.visual===`footage`)&&!e.media).length,f=o.filter(e=>e.visual===`generate`&&!(e.takes??[]).some(e=>e.stage===`keyframe`)).length,p=o.filter(e=>e.voiceover&&!e.voice).length,m=async n=>{if(t){a(n);try{e.setData(await e.call(`app_video`,{video:t.id,action:n})),e.toast(n===`refresh`?`Refreshed`:`Started`)}catch(t){e.toast(t.message)}finally{a(null)}}};(0,l.useEffect)(()=>{if(!u||!t)return;let e=window.setInterval(()=>void m(`refresh`),8e3);return()=>window.clearInterval(e)},[u,t?.id]);let h=t?.style?.models??{};return(0,$.jsxs)(bg,{eyebrow:`Autopo · Studio`,title:t?.title??`Storyboard`,sub:t?(0,$.jsxs)($.Fragment,{children:[o.length,` shots · `,Eg(t.running_seconds),` · `,t.aspect_ratio,t.style?.look?.name?` · ${t.style.look.name}`:``,t.updated_at?` · ${Tg(t.updated_at)}`:``]}):void 0,live:u,right:t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(xg,{tone:t.status===`ready`?`life`:t.status===`failed`?`danger`:c?`attention`:void 0,children:c?`rendering`:t.status}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,busy:i===`refresh`,onClick:()=>void m(`refresh`),children:`Refresh`})]}):null,notice:e.notice,children:[e.error?(0,$.jsx)(wg,{children:e.error}):null,!t&&!e.error?(0,$.jsx)(wg,{children:(0,$.jsx)(`i`,{className:`spin`})}):null,t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`rail`,children:[o.map(e=>(0,$.jsx)(Ag,{shot:e,aspect:t.aspect_ratio,open:n===e.id,onOpen:()=>r(n===e.id?null:e.id)},e.id)),o.length===0?(0,$.jsx)(wg,{children:`No shots yet. Ask the Creative Director to draft them.`}):null]}),(0,$.jsxs)(`div`,{className:`row`,style:{gap:6},children:[s?(0,$.jsxs)(xg,{tone:`life`,children:[(0,$.jsx)(Sg,{tone:`life`,pulse:!0}),` `,s,` generating`]}):null,f?(0,$.jsxs)(xg,{outline:!0,children:[f,` without keyframes`]}):null,d?(0,$.jsxs)(xg,{tone:`attention`,children:[d,` without a picture`]}):null,p?(0,$.jsxs)(xg,{tone:`attention`,children:[p,` lines unvoiced`]}):null,!d&&!p&&!s&&!c&&t.status!==`ready`?(0,$.jsx)(xg,{tone:`life`,children:`ready to render`}):null,(0,$.jsx)(`span`,{className:`grow`}),Object.keys(h).length?(0,$.jsx)(`span`,{className:`tiny faint`,children:Object.entries(h).filter(([,e])=>e).map(([e,t])=>`${e}: ${t}`).join(` · `)}):null]}),(0,$.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,$.jsx)(Cg,{xs:!0,busy:i===`keyframes`,disabled:u||f===0,onClick:()=>void m(`keyframes`),title:`A still per shot, cents each`,children:`Keyframes`}),(0,$.jsx)(Cg,{xs:!0,busy:i===`critique_keyframes`,disabled:u,onClick:()=>void m(`critique_keyframes`),children:`Critique keyframes`}),(0,$.jsx)(Cg,{tone:`ink`,xs:!0,busy:i===`make`,disabled:u||d===0&&p===0,onClick:()=>void m(`make`),title:`Clips and voice lines: credits leave your balance`,children:`Make clips & voice`}),(0,$.jsx)(Cg,{xs:!0,busy:i===`critique_clips`,disabled:u,onClick:()=>void m(`critique_clips`),children:`Critique clips`}),(0,$.jsx)(Cg,{tone:`life`,xs:!0,busy:i===`render`,disabled:u||d>0||p>0,onClick:()=>void m(`render`),children:`Render`}),(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:()=>e.say(`Direct the video "${t.title}" (${t.id}) with the Creative Director: what would make it stronger?`),children:`Ask Rose`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:()=>e.open(`https://app.autopoiesis.app/c/${e.args.company??``}/studio/${t.id}`),children:`Open in Studio`})]}),t.output?.url?(0,$.jsx)(`div`,{className:`thumb`,style:{aspectRatio:String(Og(t.aspect_ratio)),maxHeight:420},children:(0,$.jsx)(`video`,{src:t.output.url,controls:!0,playsInline:!0})}):null,t.render_error?(0,$.jsxs)(`div`,{className:`tiny`,style:{color:`var(--danger)`},children:[`Render failed: `,t.render_error]}):null]}):null]})}(0,u.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(l.StrictMode,{children:(0,$.jsx)(jg,{})}));</script>
|
|
118
118
|
<style rel="stylesheet" crossorigin>@import "https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600&display=swap";:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;--font:"Schibsted Grotesk", var(--font-sans,ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif);--mono:var(--font-mono,ui-monospace, "SF Mono", Menlo, Consolas, monospace);--bg:oklch(99% 0 0);--bg-deep:oklch(97.4% 0 0);--surface:oklch(100% 0 0);--surface-2:oklch(96.6% 0 0);--surface-3:oklch(93.6% 0 0);--line:oklch(88% 0 0);--line-strong:oklch(74% 0 0);--ink-1:oklch(16.5% 0 0);--ink-2:oklch(37% 0 0);--ink-3:oklch(47.5% 0 0);--ink-4:oklch(60% 0 0);--life:oklch(50% .16 138);--life-strong:oklch(44% .15 138);--life-ink:oklch(99% .01 120);--life-soft:oklch(60% .17 138/.12);--life-glow:oklch(70% .19 135/.3);--attention:oklch(52% .125 80);--attention-soft:oklch(72% .15 70/.14);--danger:oklch(51.5% .19 30);--danger-soft:oklch(60% .19 32/.12);--info:oklch(50% .11 240);--info-soft:oklch(55% .11 240/.12);--shadow:0 1px 2px oklch(0% 0 0/.05), 0 12px 32px -18px oklch(0% 0 0/.18);--r:16px;--r-sm:10px}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial}}:root[data-theme=dark]{--bg:oklch(16.5% 0 0);--bg-deep:oklch(14% 0 0);--surface:oklch(19.5% 0 0);--surface-2:oklch(23.2% 0 0);--surface-3:oklch(27.2% 0 0);--line:oklch(28% 0 0);--line-strong:oklch(41% 0 0);--ink-1:oklch(96.5% 0 0);--ink-2:oklch(83.5% 0 0);--ink-3:oklch(78% 0 0);--ink-4:oklch(66% 0 0);--life:oklch(88% .18 128);--life-strong:oklch(93% .19 128);--life-ink:oklch(20% .05 135);--life-soft:oklch(88% .18 128/.14);--life-glow:oklch(88% .18 128/.35);--attention:oklch(84% .14 78);--attention-soft:oklch(84% .14 78/.14);--danger:oklch(71% .17 33);--danger-soft:oklch(71% .17 33/.15);--info:oklch(80% .09 230);--info-soft:oklch(80% .09 230/.14);--shadow:0 1px 0 oklch(100% 0 0/.04) inset, 0 12px 32px -14px oklch(0% 0 0/.7)}*{box-sizing:border-box}html,body{margin:0}body{font:14px/1.45 var(--font);color:var(--ink-1);background:var(--bg);-webkit-font-smoothing:antialiased;padding:2px}button{font:inherit}a{color:inherit}.shell{border:1px solid var(--line);border-radius:var(--r);background:var(--surface);box-shadow:var(--shadow);position:relative;overflow:hidden}.shell:before{content:"";background:radial-gradient(closest-side, var(--life-glow), transparent 70%);opacity:.55;pointer-events:none;width:60%;height:70%;position:absolute;inset:-40% -20% auto auto}.shell>*{position:relative}.head{align-items:center;gap:12px;padding:14px 16px 10px;display:flex}.head .cell{flex:none;width:34px;height:34px}.head .titles{flex:1;min-width:0}.eyebrow{letter-spacing:.12em;text-transform:uppercase;color:var(--ink-4);font-size:10.5px;font-weight:600}.title{letter-spacing:-.01em;margin:1px 0 0;font-size:17px;font-weight:600}.sub{color:var(--ink-3);margin:1px 0 0;font-size:12px}.head .right{flex:none;align-items:center;gap:6px;display:flex}.body{flex-direction:column;gap:10px;padding:4px 12px 12px;display:flex}.card{border:1px solid var(--line);border-radius:var(--r-sm);background:var(--bg);flex-direction:column;gap:8px;padding:12px 14px;transition:border-color .15s,opacity .3s,transform .3s;display:flex}.card:hover{border-color:var(--line-strong)}.card.done{opacity:.55}.row{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.grow{flex:1;min-width:0}.muted{color:var(--ink-3)}.faint{color:var(--ink-4)}.small{font-size:12px}.tiny{font-size:11px}.mono{font-family:var(--mono);font-size:11.5px}.clamp2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.clamp3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.name{letter-spacing:-.005em;font-size:14.5px;font-weight:600}.pill{letter-spacing:.01em;white-space:nowrap;background:var(--surface-3);height:20px;color:var(--ink-2);border:1px solid #0000;border-radius:999px;align-items:center;gap:5px;padding:0 8px;font-size:11px;font-weight:600;display:inline-flex}.pill.life{background:var(--life-soft);color:var(--life)}.pill.attention{background:var(--attention-soft);color:var(--attention)}.pill.danger{background:var(--danger-soft);color:var(--danger)}.pill.info{background:var(--info-soft);color:var(--info)}.pill.outline{border-color:var(--line);color:var(--ink-3);background:0 0}.dot{background:var(--ink-4);border-radius:999px;flex:none;width:8px;height:8px;display:inline-block}.dot.life{background:var(--life);box-shadow:0 0 0 3px var(--life-soft)}.dot.attention{background:var(--attention)}.dot.danger{background:var(--danger)}.dot.pulse{animation:1.6s ease-in-out infinite pulse}@keyframes pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.6;transform:scale(1.35)}}.btn{border:1px solid var(--line-strong);background:var(--surface);height:30px;color:var(--ink-1);cursor:pointer;border-radius:9px;justify-content:center;align-items:center;gap:6px;padding:0 12px;font-size:12.5px;font-weight:600;transition:background .12s,border-color .12s,transform 60ms;display:inline-flex}.btn:hover{background:var(--surface-2)}.btn:active{transform:translateY(1px)}.btn:disabled{opacity:.5;cursor:default}.btn.ink{background:var(--ink-1);color:var(--bg);border-color:var(--ink-1)}.btn.ink:hover{opacity:.9}.btn.life{background:var(--life);color:var(--life-ink);border-color:var(--life)}.btn.life:hover{background:var(--life-strong)}.btn.danger{color:var(--danger);border-color:var(--danger-soft);background:0 0}.btn.danger:hover{background:var(--danger-soft)}.btn.ghost{color:var(--ink-3);background:0 0;border-color:#0000}.btn.ghost:hover{background:var(--surface-2);color:var(--ink-1)}.btn.xs{border-radius:7px;height:24px;padding:0 8px;font-size:11.5px}.input,textarea.input{border:1px solid var(--line-strong);background:var(--surface);width:100%;color:var(--ink-1);font:inherit;resize:vertical;border-radius:9px;min-height:34px;padding:7px 10px}.input:focus{outline:2px solid var(--life-glow);outline-offset:0;border-color:var(--life)}.meter{background:var(--surface-3);border-radius:999px;height:8px;position:relative;overflow:hidden}.meter>i{background:var(--ink-1);border-radius:999px;height:100%;display:block}.meter>i.life{background:var(--life)}.meter>i.attention{background:var(--attention)}.meter>i.danger{background:var(--danger)}.meter>b{background:var(--ink-3);width:2px;position:absolute;top:-2px;bottom:-2px}.empty{text-align:center;color:var(--ink-3);padding:28px 12px;font-size:13px}.spin{border:2px solid var(--line-strong);border-top-color:var(--ink-1);border-radius:999px;width:14px;height:14px;animation:.8s linear infinite spin;display:inline-block}@keyframes spin{to{transform:rotate(360deg)}}details>summary{cursor:pointer;color:var(--ink-3);font-size:12px;list-style:none}details>summary::-webkit-details-marker{display:none}.prose p{margin:0 0 6px}.prose p:last-child{margin:0}.grid{gap:8px;display:grid}.rail{scroll-snap-type:x proximity;gap:10px;padding:2px 2px 8px;display:flex;overflow-x:auto}.rail::-webkit-scrollbar{height:6px}.rail::-webkit-scrollbar-thumb{background:var(--line-strong);border-radius:999px}.thumb{background:var(--surface-3);border-radius:8px;position:relative;overflow:hidden}.thumb img,.thumb video{object-fit:cover;width:100%;height:100%;display:block}.thumb .tag{position:absolute;bottom:6px;left:6px}.thumb .tr{position:absolute;top:6px;right:6px}.lightbox{z-index:10;background:oklch(10% 0 0/.86);place-items:center;padding:20px;display:grid;position:fixed;inset:0}.lightbox .frame{flex-direction:column;gap:10px;max-width:min(960px,100%);max-height:100%;display:flex}.lightbox img,.lightbox video{background:#000;border-radius:12px;max-width:100%;max-height:70vh}.tile{border:1px solid var(--line);border-radius:var(--r-sm);background:var(--bg);flex-direction:column;gap:2px;padding:10px 12px;display:flex}.tile .num{letter-spacing:-.02em;font-variant-numeric:tabular-nums;font-size:22px;font-weight:600}.list{flex-direction:column;display:flex}.list>.item{border-top:1px solid var(--line);align-items:flex-start;gap:10px;padding:8px 0;display:flex}.list>.item:first-child{border-top:0}.bar{background:var(--surface-3);border-radius:999px;height:6px;overflow:hidden}.bar>i{background:var(--ink-2);border-radius:999px;height:100%;display:block}.toast{background:var(--ink-1);color:var(--bg);box-shadow:var(--shadow);z-index:20;border-radius:999px;padding:8px 14px;font-size:12.5px;position:fixed;bottom:14px;left:50%;transform:translate(-50%)}
|
|
119
119
|
/*$vite$:1*/</style>
|
|
120
120
|
</head>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autopo/mcp",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "vitest run",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"keywords": [
|
|
16
16
|
"mcp",
|
|
17
17
|
"model-context-protocol",
|
|
18
|
+
"autopo",
|
|
18
19
|
"autopoiesis",
|
|
19
20
|
"claude-code",
|
|
20
21
|
"codex",
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
],
|
|
24
25
|
"author": "",
|
|
25
26
|
"license": "MIT",
|
|
26
|
-
"description": "Run your
|
|
27
|
+
"description": "Run your Autopo company from Claude Code, Codex, Cursor, Claude Desktop or ChatGPT over MCP: briefings, the inbox, tasks, the team, the Studio, marketing, money.",
|
|
27
28
|
"type": "module",
|
|
28
29
|
"dependencies": {
|
|
29
30
|
"@modelcontextprotocol/ext-apps": "^2.0.4",
|