@autopo/mcp 0.4.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  <p align="center">
2
2
  <img src="https://autopoiesis.app/favicon.svg" width="56" alt="" />
3
3
  </p>
4
- <h1 align="center">Autopoiesis MCP</h1>
4
+ <h1 align="center">Autopo MCP</h1>
5
5
  <p align="center">Run your AI-run company from Claude Code, Codex, Cursor, Claude Desktop or ChatGPT.<br/>
6
6
  Briefings, the Board inbox, tasks, the team, the Studio, marketing, money: as you, with your permissions.</p>
7
7
 
@@ -110,7 +110,7 @@ A `Dockerfile` builds the hosted server (Cloud Run: `PORT` is set for you; turn
110
110
 
111
111
  ## Develop
112
112
 
113
- The source lives in Autopoiesis' repository; this package ships the built server and views.
113
+ The source lives in Autopo's repository; this package ships the built server and views.
114
114
 
115
115
  ```sh
116
116
  npm install
package/dist/cli.js CHANGED
@@ -8,7 +8,7 @@ import { createServer, DEFAULT_API_URL, DEFAULT_APP_URL, VERSION } from './serve
8
8
  import { serveHttp } from './http.js';
9
9
  const HELP = `autopoiesis-mcp ${VERSION}
10
10
 
11
- Run your Autopoiesis company from your own AI tool, over MCP.
11
+ Run your Autopo company from your own AI tool, over MCP.
12
12
 
13
13
  Usage
14
14
  autopoiesis-mcp stdio server (what Claude Code, Codex, Cursor and Claude Desktop launch)
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- /** The Autopoiesis MCP server: one person's tool on the platform, as them. */
1
+ /** The Autopo MCP server: one person's tool on the platform, as them. */
2
2
  import { McpServer } from '@modelcontextprotocol/server';
3
- export declare const VERSION = "0.4.1";
3
+ export declare const VERSION = "0.4.2";
4
4
  export declare const DEFAULT_API_URL = "https://autopoiesis-api-267405155162.us-west1.run.app";
5
5
  export declare const DEFAULT_APP_URL = "https://app.autopoiesis.app";
6
6
  /** The cell mark, served by the landing site (an inline data URI would ride along on every result). */
package/dist/server.js CHANGED
@@ -1,4 +1,4 @@
1
- /** The Autopoiesis MCP server: one person's tool on the platform, as them. */
1
+ /** The Autopo MCP server: one person's tool on the platform, as them. */
2
2
  import { McpServer } from '@modelcontextprotocol/server';
3
3
  import { Api } from './api.js';
4
4
  import { Session } from './kit.js';
@@ -9,13 +9,13 @@ import { registerResources } from './resources.js';
9
9
  import { registerCompanyTools } from './tools/company.js';
10
10
  import { registerMarketingAndApiTools } from './tools/marketing.js';
11
11
  import { registerStudioTools } from './tools/studio.js';
12
- export const VERSION = '0.4.1';
12
+ export const VERSION = '0.4.2';
13
13
  export const DEFAULT_API_URL = 'https://autopoiesis-api-267405155162.us-west1.run.app';
14
14
  export const DEFAULT_APP_URL = 'https://app.autopoiesis.app';
15
15
  /** The cell mark, served by the landing site (an inline data URI would ride along on every result). */
16
16
  export const ICON = { src: 'https://autopoiesis.app/favicon.svg', mimeType: 'image/svg+xml', sizes: ['any'] };
17
17
  export const INSTRUCTIONS = [
18
- 'Autopoiesis runs a person\'s AI-run company: a team of agents (CEO, CTO, engineers, Rose the Creative Director, marketers) that works on tasks, asks the founder for decisions in the Board inbox, delivers artifacts, makes media and videos in the Studio and posts for the company. You act as the signed-in person, in their companies, with their permissions.',
18
+ 'Autopo runs a person\'s AI-run company: a team of agents (CEO, CTO, engineers, Rose the Creative Director, marketers) that works on tasks, asks the founder for decisions in the Board inbox, delivers artifacts, makes media and videos in the Studio and posts for the company. You act as the signed-in person, in their companies, with their permissions.',
19
19
  'Start with list_companies (pass `company` when they have several; otherwise you are asked) and founder_home. Read before you write.',
20
20
  'Anything that spends credits (generate_media, make_video_media, video_keyframes) or decides something (decide, create_posts, cancel_task, delete_video) opens a confirmation dialog for the person; never work around it. Costs are shown in that dialog.',
21
21
  'Your own files (recordings, screen captures, photos, a voice track) go into the Studio with upload_media: paths on this machine when the server runs here, URLs otherwise; attach_media puts one on a shot; import_video_plan takes a plan.json or zip with the footage it names. Never say files cannot be uploaded: upload_media does it.',
@@ -32,7 +32,7 @@ export function createServer(options) {
32
32
  ...(options.publicUrl ? { publicUrl: options.publicUrl } : {}),
33
33
  local: options.local ?? false,
34
34
  });
35
- const server = new McpServer({ name: 'autopoiesis', title: 'Autopoiesis', version: VERSION, description: 'Your AI-run company, from your own tool.', websiteUrl: 'https://autopoiesis.app', icons: [ICON] }, { instructions: INSTRUCTIONS, capabilities: { logging: {} } });
35
+ const server = new McpServer({ name: 'autopoiesis', title: 'Autopo', version: VERSION, description: 'Your AI-run company, from your own tool.', websiteUrl: 'https://autopoiesis.app', icons: [ICON] }, { instructions: INSTRUCTIONS, capabilities: { logging: {} } });
36
36
  logCalls(server, api);
37
37
  registerCompanyTools(server, session);
38
38
  registerStudioTools(server, session);
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAEvD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAA;AAC9B,MAAM,CAAC,MAAM,eAAe,GAAG,uDAAuD,CAAA;AACtF,MAAM,CAAC,MAAM,eAAe,GAAG,6BAA6B,CAAA;AAE5D,uGAAuG;AACvG,MAAM,C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KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK;KAC9B,CAAC,CAAA;IACF,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,0CAA0C,EAAE,UAAU,EAAE,yBAAyB,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,EACzK,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAC9D,CAAA;IACD,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACrB,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC,4BAA4B,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7C,eAAe,CAAC,MAAM,CAAC,CAAA;IACvB,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -143,7 +143,7 @@ export function registerMarketingAndApiTools(server, s) {
143
143
  // --- everything else: the whole API ----------------------------------------------------------------------------------
144
144
  define(server, s, 'api_request', {
145
145
  title: 'Call the API',
146
- description: 'Call any endpoint of the Autopoiesis REST API as yourself: `method`, `path` (starts with /api/, ids filled in), optional JSON `body` and `query`. api_reference is the manual: use this for anything the other tools don’t cover. Writes are real.',
146
+ description: 'Call any endpoint of the Autopo REST API as yourself: `method`, `path` (starts with /api/, ids filled in), optional JSON `body` and `query`. api_reference is the manual: use this for anything the other tools don’t cover. Writes are real.',
147
147
  input: {
148
148
  method: z.enum(['GET', 'POST', 'PATCH', 'PUT', 'DELETE']),
149
149
  path: z.string(),
@@ -196,7 +196,7 @@ export function registerMarketingAndApiTools(server, s) {
196
196
  });
197
197
  define(server, s, 'open_in_app', {
198
198
  title: 'Open in the app',
199
- description: 'Open a place in the Autopoiesis web app in your browser: `what` is home, hive, inbox, task, work, team, chat, studio, video, marketing, social, money, connectors or settings; `id` the card, task, chat or video when there is one.',
199
+ description: 'Open a place in the Autopo web app in your browser: `what` is home, hive, inbox, task, work, team, chat, studio, video, marketing, social, money, connectors or settings; `id` the card, task, chat or video when there is one.',
200
200
  input: { ...COMPANY_ARG, what: z.enum(Object.keys(PLACES)), id: z.string().optional() },
201
201
  group: 'company',
202
202
  kind: 'write',
@@ -1 +1 @@
1
- {"version":3,"file":"marketing.js","sourceRoot":"","sources":["../../src/tools/marketing.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAW,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEtI,0EAA0E;AAC1E,MAAM,MAAM,GAAuD;IACjE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW;IAC/B,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO;IAC3B,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;IACrE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;IAClE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,OA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8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <meta name="color-scheme" content="light dark" />
7
- <title>Autopoiesis Gallery</title>
7
+ <title>Autopo Gallery</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,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 Cg({children:e}){return(0,$.jsx)(`div`,{className:`empty`,children:e})}var wg=e=>{if(e==null)return``;let t=e/100;return t>=100?`$${Math.round(t)}`:`$${t.toFixed(2)}`};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=[`all`,`image`,`video`,`audio`],Og=e=>!!(e&&[`queued`,`generating`,`running`,`processing`,`pending`].includes(e));function kg({m:e,onOpen:t,onStar:n,onRetry:r}){let i=e.width&&e.height?e.width/e.height:e.kind===`audio`?2.2:16/9;return(0,$.jsxs)(`div`,{className:`thumb`,style:{aspectRatio:String(Math.min(Math.max(i,.56),2.4)),cursor:`pointer`},onClick:t,title:e.title||e.prompt||``,children:[e.thumb_url||e.kind===`image`&&e.url?(0,$.jsx)(`img`,{src:e.thumb_url??e.url??``,alt:e.title??``,loading:`lazy`}):(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`grid`,placeItems:`center`,padding:10,textAlign:`center`},children:Og(e.status)?(0,$.jsx)(`i`,{className:`spin`}):e.status===`failed`?(0,$.jsx)(`span`,{className:`tiny`,style:{color:`var(--danger)`},children:`failed`}):(0,$.jsx)(`span`,{className:`tiny muted clamp3`,children:e.kind===`audio`?`♪ ${e.title||e.purpose||`audio`}`:e.title||e.prompt||e.kind})}),(0,$.jsx)(`span`,{className:`tag pill`,style:{height:18,fontSize:10},children:e.kind===`video`&&e.duration_seconds?Eg(e.duration_seconds):e.kind}),(0,$.jsxs)(`span`,{className:`tr row`,style:{gap:4},children:[e.status===`failed`?(0,$.jsx)(`button`,{className:`btn xs`,onClick:e=>{e.stopPropagation(),r()},children:`Retry`}):null,(0,$.jsx)(`button`,{className:`btn xs ghost`,style:{background:`var(--surface)`,color:e.starred?`var(--attention)`:`var(--ink-3)`},onClick:e=>{e.stopPropagation(),n()},"aria-label":e.starred?`Unstar`:`Star`,children:e.starred?`★`:`☆`})]})]})}function Ag(){let e=vg(`gallery`),[t,n]=(0,l.useState)(`all`),[r,i]=(0,l.useState)(null),[a,o]=(0,l.useState)(!1),s=(e.data?.results??[]).filter(e=>t===`all`||e.kind===t),c=e.data?.company??e.args.company,u=s.find(e=>e.id===r)??null,d=async(n=t)=>{if(c){o(!0);try{e.setData(await e.call(`app_media`,{company:c,action:`refresh`,...n===`all`?{}:{kind:n}}))}finally{o(!1)}}},f=(t,n)=>e.data&&e.setData({...e.data,results:e.data.results.map(e=>e.id===t?{...e,...n}:e)});return(0,$.jsxs)(bg,{eyebrow:`Autopoiesis · Studio`,title:e.data?.single?s[0]?.title||`Media`:`Media library`,sub:e.data&&!e.data.single?`${e.data.count} pieces${e.data.more?`, newest shown`:``}`:void 0,right:c?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`row`,style:{gap:2},children:Dg.map(e=>(0,$.jsx)(Sg,{xs:!0,tone:t===e?`ink`:`ghost`,onClick:()=>{n(e),d(e)},children:e},e))}),(0,$.jsx)(Sg,{tone:`ghost`,xs:!0,busy:a,onClick:()=>void d(),children:`Refresh`})]}):null,notice:e.notice,children:[e.error?(0,$.jsx)(Cg,{children:e.error}):null,!e.data&&!e.error?(0,$.jsx)(Cg,{children:(0,$.jsx)(`i`,{className:`spin`})}):null,e.data&&s.length===0?(0,$.jsx)(Cg,{children:`Nothing here yet. Ask for an image or a clip.`}):null,(0,$.jsx)(`div`,{className:`grid`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(150px, 1fr))`},children:s.map(t=>(0,$.jsx)(kg,{m:t,onOpen:()=>i(t.id),onStar:()=>{f(t.id,{starred:!t.starred}),e.call(`app_media`,{media:t.id,action:t.starred?`unstar`:`star`}).catch(t=>e.toast(t.message))},onRetry:()=>{f(t.id,{status:`queued`}),e.call(`app_media`,{media:t.id,action:`retry`}).catch(t=>e.toast(t.message))}},t.id))}),u?(0,$.jsx)(`div`,{className:`lightbox`,onClick:()=>i(null),children:(0,$.jsxs)(`div`,{className:`frame`,onClick:e=>e.stopPropagation(),children:[u.kind===`video`&&u.url?(0,$.jsx)(`video`,{src:u.url,controls:!0,autoPlay:!0,playsInline:!0}):u.kind===`audio`&&u.url?(0,$.jsx)(`audio`,{src:u.url,controls:!0,autoPlay:!0,style:{width:`min(600px, 90vw)`}}):u.url||u.thumb_url?(0,$.jsx)(`img`,{src:u.url??u.thumb_url??``,alt:u.title??``}):null,(0,$.jsxs)(`div`,{className:`card`,style:{background:`var(--surface)`},children:[(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(`span`,{className:`name`,children:u.title||u.kind}),(0,$.jsx)(`span`,{className:`grow`}),u.model_label||u.model?(0,$.jsx)(xg,{outline:!0,children:u.model_label??u.model}):null,typeof u.cost_cents==`number`?(0,$.jsx)(xg,{children:wg(u.cost_cents)}):null,(0,$.jsx)(`span`,{className:`tiny faint`,children:Tg(u.created_at)})]}),u.prompt?(0,$.jsx)(`div`,{className:`small muted`,children:u.prompt}):null,u.error?(0,$.jsx)(`div`,{className:`tiny`,style:{color:`var(--danger)`},children:u.error}):null,(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(Sg,{xs:!0,onClick:()=>e.say(`Use the media ${u.id} ("${u.title||u.prompt?.slice(0,60)||u.kind}") as a reference for the next shot.`),children:`Use in chat`}),(0,$.jsx)(Sg,{xs:!0,tone:`ghost`,onClick:()=>{navigator.clipboard?.writeText(u.id),e.toast(`Id copied`)},children:`Copy id`}),u.url?(0,$.jsx)(Sg,{xs:!0,tone:`ghost`,onClick:()=>e.open(u.url),children:`Open file`}):null,(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsx)(Sg,{xs:!0,tone:`ghost`,onClick:()=>i(null),children:`Close`})]})]})]})}):null]})}(0,u.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(l.StrictMode,{children:(0,$.jsx)(Ag,{})}));</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,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 Cg({children:e}){return(0,$.jsx)(`div`,{className:`empty`,children:e})}var wg=e=>{if(e==null)return``;let t=e/100;return t>=100?`$${Math.round(t)}`:`$${t.toFixed(2)}`};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=[`all`,`image`,`video`,`audio`],Og=e=>!!(e&&[`queued`,`generating`,`running`,`processing`,`pending`].includes(e));function kg({m:e,onOpen:t,onStar:n,onRetry:r}){let i=e.width&&e.height?e.width/e.height:e.kind===`audio`?2.2:16/9;return(0,$.jsxs)(`div`,{className:`thumb`,style:{aspectRatio:String(Math.min(Math.max(i,.56),2.4)),cursor:`pointer`},onClick:t,title:e.title||e.prompt||``,children:[e.thumb_url||e.kind===`image`&&e.url?(0,$.jsx)(`img`,{src:e.thumb_url??e.url??``,alt:e.title??``,loading:`lazy`}):(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`grid`,placeItems:`center`,padding:10,textAlign:`center`},children:Og(e.status)?(0,$.jsx)(`i`,{className:`spin`}):e.status===`failed`?(0,$.jsx)(`span`,{className:`tiny`,style:{color:`var(--danger)`},children:`failed`}):(0,$.jsx)(`span`,{className:`tiny muted clamp3`,children:e.kind===`audio`?`♪ ${e.title||e.purpose||`audio`}`:e.title||e.prompt||e.kind})}),(0,$.jsx)(`span`,{className:`tag pill`,style:{height:18,fontSize:10},children:e.kind===`video`&&e.duration_seconds?Eg(e.duration_seconds):e.kind}),(0,$.jsxs)(`span`,{className:`tr row`,style:{gap:4},children:[e.status===`failed`?(0,$.jsx)(`button`,{className:`btn xs`,onClick:e=>{e.stopPropagation(),r()},children:`Retry`}):null,(0,$.jsx)(`button`,{className:`btn xs ghost`,style:{background:`var(--surface)`,color:e.starred?`var(--attention)`:`var(--ink-3)`},onClick:e=>{e.stopPropagation(),n()},"aria-label":e.starred?`Unstar`:`Star`,children:e.starred?`★`:`☆`})]})]})}function Ag(){let e=vg(`gallery`),[t,n]=(0,l.useState)(`all`),[r,i]=(0,l.useState)(null),[a,o]=(0,l.useState)(!1),s=(e.data?.results??[]).filter(e=>t===`all`||e.kind===t),c=e.data?.company??e.args.company,u=s.find(e=>e.id===r)??null,d=async(n=t)=>{if(c){o(!0);try{e.setData(await e.call(`app_media`,{company:c,action:`refresh`,...n===`all`?{}:{kind:n}}))}finally{o(!1)}}},f=(t,n)=>e.data&&e.setData({...e.data,results:e.data.results.map(e=>e.id===t?{...e,...n}:e)});return(0,$.jsxs)(bg,{eyebrow:`Autopo · Studio`,title:e.data?.single?s[0]?.title||`Media`:`Media library`,sub:e.data&&!e.data.single?`${e.data.count} pieces${e.data.more?`, newest shown`:``}`:void 0,right:c?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`row`,style:{gap:2},children:Dg.map(e=>(0,$.jsx)(Sg,{xs:!0,tone:t===e?`ink`:`ghost`,onClick:()=>{n(e),d(e)},children:e},e))}),(0,$.jsx)(Sg,{tone:`ghost`,xs:!0,busy:a,onClick:()=>void d(),children:`Refresh`})]}):null,notice:e.notice,children:[e.error?(0,$.jsx)(Cg,{children:e.error}):null,!e.data&&!e.error?(0,$.jsx)(Cg,{children:(0,$.jsx)(`i`,{className:`spin`})}):null,e.data&&s.length===0?(0,$.jsx)(Cg,{children:`Nothing here yet. Ask for an image or a clip.`}):null,(0,$.jsx)(`div`,{className:`grid`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(150px, 1fr))`},children:s.map(t=>(0,$.jsx)(kg,{m:t,onOpen:()=>i(t.id),onStar:()=>{f(t.id,{starred:!t.starred}),e.call(`app_media`,{media:t.id,action:t.starred?`unstar`:`star`}).catch(t=>e.toast(t.message))},onRetry:()=>{f(t.id,{status:`queued`}),e.call(`app_media`,{media:t.id,action:`retry`}).catch(t=>e.toast(t.message))}},t.id))}),u?(0,$.jsx)(`div`,{className:`lightbox`,onClick:()=>i(null),children:(0,$.jsxs)(`div`,{className:`frame`,onClick:e=>e.stopPropagation(),children:[u.kind===`video`&&u.url?(0,$.jsx)(`video`,{src:u.url,controls:!0,autoPlay:!0,playsInline:!0}):u.kind===`audio`&&u.url?(0,$.jsx)(`audio`,{src:u.url,controls:!0,autoPlay:!0,style:{width:`min(600px, 90vw)`}}):u.url||u.thumb_url?(0,$.jsx)(`img`,{src:u.url??u.thumb_url??``,alt:u.title??``}):null,(0,$.jsxs)(`div`,{className:`card`,style:{background:`var(--surface)`},children:[(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(`span`,{className:`name`,children:u.title||u.kind}),(0,$.jsx)(`span`,{className:`grow`}),u.model_label||u.model?(0,$.jsx)(xg,{outline:!0,children:u.model_label??u.model}):null,typeof u.cost_cents==`number`?(0,$.jsx)(xg,{children:wg(u.cost_cents)}):null,(0,$.jsx)(`span`,{className:`tiny faint`,children:Tg(u.created_at)})]}),u.prompt?(0,$.jsx)(`div`,{className:`small muted`,children:u.prompt}):null,u.error?(0,$.jsx)(`div`,{className:`tiny`,style:{color:`var(--danger)`},children:u.error}):null,(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(Sg,{xs:!0,onClick:()=>e.say(`Use the media ${u.id} ("${u.title||u.prompt?.slice(0,60)||u.kind}") as a reference for the next shot.`),children:`Use in chat`}),(0,$.jsx)(Sg,{xs:!0,tone:`ghost`,onClick:()=>{navigator.clipboard?.writeText(u.id),e.toast(`Id copied`)},children:`Copy id`}),u.url?(0,$.jsx)(Sg,{xs:!0,tone:`ghost`,onClick:()=>e.open(u.url),children:`Open file`}):null,(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsx)(Sg,{xs:!0,tone:`ghost`,onClick:()=>i(null),children:`Close`})]})]})]})}):null]})}(0,u.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(l.StrictMode,{children:(0,$.jsx)(Ag,{})}));</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/dist/ui/home.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>Autopoiesis Home</title>
7
+ <title>Autopo Home</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})}var Tg=e=>{if(e==null)return``;let t=e/100;return t>=100?`$${Math.round(t)}`:`$${t.toFixed(2)}`};function Eg(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 Dg=e=>e.title??e.headline??e.summary??e.key??`Untitled`,Og=e=>e.assignee?.name??e.agent?.name??``;function kg({title:e,rows:t,tone:n,empty:r,render:i}){return(0,$.jsxs)(`div`,{className:`card`,style:{gap:4},children:[(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(`span`,{className:`eyebrow`,children:e}),(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsx)(`span`,{className:`tiny faint`,children:t.length||``})]}),t.length===0?(0,$.jsx)(`div`,{className:`tiny faint`,children:r}):(0,$.jsx)(`div`,{className:`list`,children:t.slice(0,6).map((e,t)=>(0,$.jsxs)(`div`,{className:`item`,children:[(0,$.jsx)(Sg,{tone:n}),(0,$.jsxs)(`div`,{className:`grow`,children:[(0,$.jsx)(`div`,{className:`small`,children:Dg(e)}),(0,$.jsx)(`div`,{className:`tiny faint`,children:[e.key,Og(e),e.status,e.reason??e.why??e.needed].filter(Boolean).join(` · `)})]}),i?i(e):(0,$.jsx)(`span`,{className:`tiny faint`,children:Eg(e.done_at??e.updated_at??e.created_at)})]},e.id??t))})]})}function Ag(){let e=vg(`home`),t=e.data,n=t?.counts,r=t?.company??e.args.company,i=typeof t?.digest==`string`?t.digest:t?.digest?.text,a=(n?.in_progress??0)>0;return(0,$.jsxs)(bg,{eyebrow:`Autopoiesis · Home`,title:n?n.decisions?`${n.decisions} waiting on you`:`Nothing waiting on you`:`Home`,sub:t?.generated_at?`as of ${Eg(t.generated_at)}`:void 0,live:a,right:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:()=>e.say(`Give me the morning review: what needs me, what landed, what is stuck, and what you would decide.`),children:`Brief me`}),r?(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:()=>e.open(`https://app.autopoiesis.app/c/${r}/overview`),children:`Open`}):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:[i?(0,$.jsx)(`div`,{className:`small`,style:{padding:`2px 2px 4px`,color:`var(--ink-2)`},children:i}):null,(0,$.jsx)(`div`,{className:`grid`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(96px, 1fr))`},children:[[`decisions`,`Decisions`,`attention`],[`in_progress`,`Working now`,`life`],[`delivered`,`Delivered`,void 0],[`stuck`,`Stuck`,`danger`],[`incidents`,`Incidents`,`danger`]].map(([e,t,r])=>(0,$.jsxs)(`div`,{className:`tile`,children:[(0,$.jsx)(`span`,{className:`num`,style:{color:r&&(n?.[e]??0)>0?`var(--${r})`:void 0},children:n?.[e]??0}),(0,$.jsx)(`span`,{className:`tiny muted`,children:t})]},e))}),(0,$.jsx)(kg,{title:`Needs you`,rows:t.decisions??[],tone:`attention`,empty:`The inbox is clear.`,render:t=>(0,$.jsxs)(`div`,{className:`row`,style:{gap:4},children:[typeof t.amount_cents==`number`&&t.amount_cents>0?(0,$.jsx)(xg,{tone:`info`,children:Tg(t.amount_cents)}):null,(0,$.jsx)(Cg,{xs:!0,onClick:()=>e.say(`Open the card "${Dg(t)}" (${t.id}) for me: what is asked and what would you decide?`),children:`Look`})]})}),(0,$.jsxs)(`div`,{className:`grid`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(260px, 1fr))`},children:[(0,$.jsx)(kg,{title:`Working now`,rows:t.in_progress??[],tone:`life`,empty:`Quiet right now.`}),(0,$.jsx)(kg,{title:`Stuck`,rows:t.stuck??[],tone:`danger`,empty:`Nothing stuck.`,render:t=>(0,$.jsx)(Cg,{xs:!0,tone:`ghost`,onClick:()=>e.say(`Why is "${Dg(t)}" (${t.key??t.id}) stuck, and what unblocks it?`),children:`Why`})})]}),(0,$.jsx)(kg,{title:`Delivered this week`,rows:t.delivered??[],empty:`Nothing landed yet this week.`}),t.incidents?.length?(0,$.jsx)(kg,{title:`Incidents`,rows:t.incidents,tone:`danger`,empty:``}):null,t.health?.metrics?.length?(0,$.jsx)(`div`,{className:`row`,style:{gap:6},children:t.health.metrics.slice(0,6).map((e,t)=>(0,$.jsxs)(xg,{outline:!0,children:[e.label??e.key,`: `,e.value,e.unit?` ${e.unit}`:``,typeof e.delta==`number`?` (${e.delta>0?`+`:``}${e.delta})`:``]},t))}):null]}):null]})}(0,u.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(l.StrictMode,{children:(0,$.jsx)(Ag,{})}));</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})}var Tg=e=>{if(e==null)return``;let t=e/100;return t>=100?`$${Math.round(t)}`:`$${t.toFixed(2)}`};function Eg(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 Dg=e=>e.title??e.headline??e.summary??e.key??`Untitled`,Og=e=>e.assignee?.name??e.agent?.name??``;function kg({title:e,rows:t,tone:n,empty:r,render:i}){return(0,$.jsxs)(`div`,{className:`card`,style:{gap:4},children:[(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(`span`,{className:`eyebrow`,children:e}),(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsx)(`span`,{className:`tiny faint`,children:t.length||``})]}),t.length===0?(0,$.jsx)(`div`,{className:`tiny faint`,children:r}):(0,$.jsx)(`div`,{className:`list`,children:t.slice(0,6).map((e,t)=>(0,$.jsxs)(`div`,{className:`item`,children:[(0,$.jsx)(Sg,{tone:n}),(0,$.jsxs)(`div`,{className:`grow`,children:[(0,$.jsx)(`div`,{className:`small`,children:Dg(e)}),(0,$.jsx)(`div`,{className:`tiny faint`,children:[e.key,Og(e),e.status,e.reason??e.why??e.needed].filter(Boolean).join(` · `)})]}),i?i(e):(0,$.jsx)(`span`,{className:`tiny faint`,children:Eg(e.done_at??e.updated_at??e.created_at)})]},e.id??t))})]})}function Ag(){let e=vg(`home`),t=e.data,n=t?.counts,r=t?.company??e.args.company,i=typeof t?.digest==`string`?t.digest:t?.digest?.text,a=(n?.in_progress??0)>0;return(0,$.jsxs)(bg,{eyebrow:`Autopo · Home`,title:n?n.decisions?`${n.decisions} waiting on you`:`Nothing waiting on you`:`Home`,sub:t?.generated_at?`as of ${Eg(t.generated_at)}`:void 0,live:a,right:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:()=>e.say(`Give me the morning review: what needs me, what landed, what is stuck, and what you would decide.`),children:`Brief me`}),r?(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:()=>e.open(`https://app.autopoiesis.app/c/${r}/overview`),children:`Open`}):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:[i?(0,$.jsx)(`div`,{className:`small`,style:{padding:`2px 2px 4px`,color:`var(--ink-2)`},children:i}):null,(0,$.jsx)(`div`,{className:`grid`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(96px, 1fr))`},children:[[`decisions`,`Decisions`,`attention`],[`in_progress`,`Working now`,`life`],[`delivered`,`Delivered`,void 0],[`stuck`,`Stuck`,`danger`],[`incidents`,`Incidents`,`danger`]].map(([e,t,r])=>(0,$.jsxs)(`div`,{className:`tile`,children:[(0,$.jsx)(`span`,{className:`num`,style:{color:r&&(n?.[e]??0)>0?`var(--${r})`:void 0},children:n?.[e]??0}),(0,$.jsx)(`span`,{className:`tiny muted`,children:t})]},e))}),(0,$.jsx)(kg,{title:`Needs you`,rows:t.decisions??[],tone:`attention`,empty:`The inbox is clear.`,render:t=>(0,$.jsxs)(`div`,{className:`row`,style:{gap:4},children:[typeof t.amount_cents==`number`&&t.amount_cents>0?(0,$.jsx)(xg,{tone:`info`,children:Tg(t.amount_cents)}):null,(0,$.jsx)(Cg,{xs:!0,onClick:()=>e.say(`Open the card "${Dg(t)}" (${t.id}) for me: what is asked and what would you decide?`),children:`Look`})]})}),(0,$.jsxs)(`div`,{className:`grid`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(260px, 1fr))`},children:[(0,$.jsx)(kg,{title:`Working now`,rows:t.in_progress??[],tone:`life`,empty:`Quiet right now.`}),(0,$.jsx)(kg,{title:`Stuck`,rows:t.stuck??[],tone:`danger`,empty:`Nothing stuck.`,render:t=>(0,$.jsx)(Cg,{xs:!0,tone:`ghost`,onClick:()=>e.say(`Why is "${Dg(t)}" (${t.key??t.id}) stuck, and what unblocks it?`),children:`Why`})})]}),(0,$.jsx)(kg,{title:`Delivered this week`,rows:t.delivered??[],empty:`Nothing landed yet this week.`}),t.incidents?.length?(0,$.jsx)(kg,{title:`Incidents`,rows:t.incidents,tone:`danger`,empty:``}):null,t.health?.metrics?.length?(0,$.jsx)(`div`,{className:`row`,style:{gap:6},children:t.health.metrics.slice(0,6).map((e,t)=>(0,$.jsxs)(xg,{outline:!0,children:[e.label??e.key,`: `,e.value,e.unit?` ${e.unit}`:``,typeof e.delta==`number`?` (${e.delta>0?`+`:``}${e.delta})`:``]},t))}):null]}):null]})}(0,u.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(l.StrictMode,{children:(0,$.jsx)(Ag,{})}));</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>
@@ -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>Autopoiesis Inbox</title>
7
+ <title>Autopo Inbox</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})}var Tg=e=>{if(e==null)return``;let t=e/100;return t>=100?`$${Math.round(t)}`:`$${t.toFixed(2)}`};function Eg(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`:``}function Dg({text:e,clamp:t}){if(!e)return null;let n=e.replace(/[*_`#>]/g,``).split(/\n{2,}/).map(e=>e.trim()).filter(Boolean);return(0,$.jsx)(`div`,{className:[`prose small`,t?`clamp3`:``].filter(Boolean).join(` `),children:n.map((e,t)=>(0,$.jsx)(`p`,{children:e},t))})}var Og=e=>e===`high`?`danger`:e===`medium`?`attention`:void 0,kg=e=>e.replace(/_/g,` `);function Ag({card:e,onDecide:t,onOpen:n,onAsk:r}){let[i,a]=(0,l.useState)(null),[o,s]=(0,l.useState)(!1),[c,u]=(0,l.useState)(``),[d,f]=(0,l.useState)(null),[p,m]=(0,l.useState)(null),h=async(e,n,r=e)=>{a(r),m(null);try{await t(e,n),f(r)}catch(e){m(e.message)}finally{a(null)}},g=e.kind===`question`&&(e.options?.length??0)>0,_=e.requested_by?.name??e.requested_by?.role_key??`the team`;return(0,$.jsxs)(`article`,{className:[`card`,d?`done`:``].join(` `),"aria-label":e.title,children:[(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(xg,{outline:!0,children:kg(e.kind)}),e.risk_tier?(0,$.jsxs)(xg,{tone:Og(e.risk_tier),children:[e.risk_tier,` risk`]}):null,typeof e.amount_cents==`number`&&e.amount_cents>0?(0,$.jsx)(xg,{tone:`info`,children:Tg(e.amount_cents)}):null,e.founder_reason?.label?(0,$.jsxs)(`span`,{className:`tiny faint`,children:[`· `,e.founder_reason.label]}):null,(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsx)(`span`,{className:`tiny faint`,children:Eg(e.created_at)})]}),(0,$.jsx)(`div`,{className:`name`,children:e.title}),(0,$.jsxs)(`div`,{className:`tiny muted`,children:[_,e.about?.task?.key?(0,$.jsxs)($.Fragment,{children:[` · `,e.about.task.key,` `,e.about.task.title]}):null,e.about?.waiting?.length?(0,$.jsxs)($.Fragment,{children:[` · `,e.about.waiting.length,` waiting on this`]}):null]}),(0,$.jsx)(Dg,{text:e.rationale,clamp:!0}),e.risk?(0,$.jsxs)(`div`,{className:`tiny`,style:{color:`var(--attention)`},children:[`Risk: `,e.risk]}):null,e.details?(0,$.jsxs)(`details`,{children:[(0,$.jsx)(`summary`,{children:`Details`}),(0,$.jsx)(`pre`,{className:`mono`,style:{whiteSpace:`pre-wrap`,margin:`6px 0 0`,color:`var(--ink-2)`},children:e.details})]}):null,d?(0,$.jsxs)(`div`,{className:`row small`,style:{color:`var(--life)`},children:[(0,$.jsx)(Sg,{tone:`life`}),` `,d===`reject`?`Rejected`:d===`cancel`?`Cancelled`:`Done`]}):g?(0,$.jsxs)(`div`,{className:`row`,children:[e.options.map(e=>(0,$.jsx)(Cg,{tone:e.recommended?`life`:void 0,xs:!0,busy:i===e.value,title:e.consequence,onClick:()=>void h(`approve`,{answer:e.value},e.value),children:e.label},e.value)),(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:r,children:`Ask`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:n,children:`Open`})]}):o?(0,$.jsxs)(`div`,{className:`grid`,style:{gap:6},children:[(0,$.jsx)(`textarea`,{className:`input`,placeholder:`Why not, in a line (the team reads this)`,value:c,onChange:e=>u(e.target.value),rows:2}),(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(Cg,{tone:`danger`,xs:!0,busy:i===`reject`,disabled:!c.trim(),onClick:()=>void h(`reject`,{note:c}),children:`Reject with note`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:()=>s(!1),children:`Back`})]})]}):(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(Cg,{tone:`life`,xs:!0,busy:i===`approve`,onClick:()=>void h(`approve`),children:`Approve`}),(0,$.jsx)(Cg,{tone:`danger`,xs:!0,onClick:()=>s(!0),children:`Reject`}),(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:r,children:`Ask`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:n,children:`Open`})]}),p?(0,$.jsx)(`div`,{className:`tiny`,style:{color:`var(--danger)`},children:p}):null]})}function jg(){let e=vg(`inbox`),t=e.data?.results??[],n=e.data?.company??e.args.company,[r,i]=(0,l.useState)(!1),a=async()=>{if(n){i(!0);try{e.setData(await e.call(`app_refresh_inbox`,{company:n}))}finally{i(!1)}}},o=t.filter(e=>e.status===`pending`).length;return(0,$.jsxs)(bg,{eyebrow:`Autopoiesis · Board inbox`,title:e.data?o===0?`Nothing waiting on you`:`${o} waiting on you`:`Inbox`,sub:e.data?.more?`Showing ${t.length} of ${e.data.count}`:void 0,live:o>0,right:n?(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,busy:r,onClick:()=>void a(),children:`Refresh`}):null,notice:e.notice,children:[e.error?(0,$.jsx)(wg,{children:e.error}):null,!e.data&&!e.error?(0,$.jsx)(wg,{children:(0,$.jsx)(`i`,{className:`spin`})}):null,e.data&&t.length===0?(0,$.jsx)(wg,{children:`The inbox is clear.`}):null,t.map(t=>(0,$.jsx)(Ag,{card:t,onDecide:async(n,r)=>{await e.call(`app_decide`,{decision:t.id,choice:n,...r?.note?{note:r.note}:{},...r?.answer===void 0?{}:{answer:r.answer}}),e.toast(n===`approve`?`Approved`:n===`reject`?`Rejected`:`Cancelled`),e.app?.updateModelContext({content:[{type:`text`,text:`The founder ${n===`approve`?`approved`:n+`ed`} the card "${t.title}" (${t.id}) in the inbox view.`}]})},onOpen:()=>e.open(`${Mg(e.args)}/c/${n??``}/inbox?card=${t.id}`),onAsk:()=>e.say(`About the card "${t.title}" (${t.id}): what is the team asking exactly, what does it cost or risk, and what would you decide?`)},t.id))]})}var Mg=e=>`https://app.autopoiesis.app`;(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})}var Tg=e=>{if(e==null)return``;let t=e/100;return t>=100?`$${Math.round(t)}`:`$${t.toFixed(2)}`};function Eg(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`:``}function Dg({text:e,clamp:t}){if(!e)return null;let n=e.replace(/[*_`#>]/g,``).split(/\n{2,}/).map(e=>e.trim()).filter(Boolean);return(0,$.jsx)(`div`,{className:[`prose small`,t?`clamp3`:``].filter(Boolean).join(` `),children:n.map((e,t)=>(0,$.jsx)(`p`,{children:e},t))})}var Og=e=>e===`high`?`danger`:e===`medium`?`attention`:void 0,kg=e=>e.replace(/_/g,` `);function Ag({card:e,onDecide:t,onOpen:n,onAsk:r}){let[i,a]=(0,l.useState)(null),[o,s]=(0,l.useState)(!1),[c,u]=(0,l.useState)(``),[d,f]=(0,l.useState)(null),[p,m]=(0,l.useState)(null),h=async(e,n,r=e)=>{a(r),m(null);try{await t(e,n),f(r)}catch(e){m(e.message)}finally{a(null)}},g=e.kind===`question`&&(e.options?.length??0)>0,_=e.requested_by?.name??e.requested_by?.role_key??`the team`;return(0,$.jsxs)(`article`,{className:[`card`,d?`done`:``].join(` `),"aria-label":e.title,children:[(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(xg,{outline:!0,children:kg(e.kind)}),e.risk_tier?(0,$.jsxs)(xg,{tone:Og(e.risk_tier),children:[e.risk_tier,` risk`]}):null,typeof e.amount_cents==`number`&&e.amount_cents>0?(0,$.jsx)(xg,{tone:`info`,children:Tg(e.amount_cents)}):null,e.founder_reason?.label?(0,$.jsxs)(`span`,{className:`tiny faint`,children:[`· `,e.founder_reason.label]}):null,(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsx)(`span`,{className:`tiny faint`,children:Eg(e.created_at)})]}),(0,$.jsx)(`div`,{className:`name`,children:e.title}),(0,$.jsxs)(`div`,{className:`tiny muted`,children:[_,e.about?.task?.key?(0,$.jsxs)($.Fragment,{children:[` · `,e.about.task.key,` `,e.about.task.title]}):null,e.about?.waiting?.length?(0,$.jsxs)($.Fragment,{children:[` · `,e.about.waiting.length,` waiting on this`]}):null]}),(0,$.jsx)(Dg,{text:e.rationale,clamp:!0}),e.risk?(0,$.jsxs)(`div`,{className:`tiny`,style:{color:`var(--attention)`},children:[`Risk: `,e.risk]}):null,e.details?(0,$.jsxs)(`details`,{children:[(0,$.jsx)(`summary`,{children:`Details`}),(0,$.jsx)(`pre`,{className:`mono`,style:{whiteSpace:`pre-wrap`,margin:`6px 0 0`,color:`var(--ink-2)`},children:e.details})]}):null,d?(0,$.jsxs)(`div`,{className:`row small`,style:{color:`var(--life)`},children:[(0,$.jsx)(Sg,{tone:`life`}),` `,d===`reject`?`Rejected`:d===`cancel`?`Cancelled`:`Done`]}):g?(0,$.jsxs)(`div`,{className:`row`,children:[e.options.map(e=>(0,$.jsx)(Cg,{tone:e.recommended?`life`:void 0,xs:!0,busy:i===e.value,title:e.consequence,onClick:()=>void h(`approve`,{answer:e.value},e.value),children:e.label},e.value)),(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:r,children:`Ask`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:n,children:`Open`})]}):o?(0,$.jsxs)(`div`,{className:`grid`,style:{gap:6},children:[(0,$.jsx)(`textarea`,{className:`input`,placeholder:`Why not, in a line (the team reads this)`,value:c,onChange:e=>u(e.target.value),rows:2}),(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(Cg,{tone:`danger`,xs:!0,busy:i===`reject`,disabled:!c.trim(),onClick:()=>void h(`reject`,{note:c}),children:`Reject with note`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:()=>s(!1),children:`Back`})]})]}):(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(Cg,{tone:`life`,xs:!0,busy:i===`approve`,onClick:()=>void h(`approve`),children:`Approve`}),(0,$.jsx)(Cg,{tone:`danger`,xs:!0,onClick:()=>s(!0),children:`Reject`}),(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:r,children:`Ask`}),(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,onClick:n,children:`Open`})]}),p?(0,$.jsx)(`div`,{className:`tiny`,style:{color:`var(--danger)`},children:p}):null]})}function jg(){let e=vg(`inbox`),t=e.data?.results??[],n=e.data?.company??e.args.company,[r,i]=(0,l.useState)(!1),a=async()=>{if(n){i(!0);try{e.setData(await e.call(`app_refresh_inbox`,{company:n}))}finally{i(!1)}}},o=t.filter(e=>e.status===`pending`).length;return(0,$.jsxs)(bg,{eyebrow:`Autopo · Board inbox`,title:e.data?o===0?`Nothing waiting on you`:`${o} waiting on you`:`Inbox`,sub:e.data?.more?`Showing ${t.length} of ${e.data.count}`:void 0,live:o>0,right:n?(0,$.jsx)(Cg,{tone:`ghost`,xs:!0,busy:r,onClick:()=>void a(),children:`Refresh`}):null,notice:e.notice,children:[e.error?(0,$.jsx)(wg,{children:e.error}):null,!e.data&&!e.error?(0,$.jsx)(wg,{children:(0,$.jsx)(`i`,{className:`spin`})}):null,e.data&&t.length===0?(0,$.jsx)(wg,{children:`The inbox is clear.`}):null,t.map(t=>(0,$.jsx)(Ag,{card:t,onDecide:async(n,r)=>{await e.call(`app_decide`,{decision:t.id,choice:n,...r?.note?{note:r.note}:{},...r?.answer===void 0?{}:{answer:r.answer}}),e.toast(n===`approve`?`Approved`:n===`reject`?`Rejected`:`Cancelled`),e.app?.updateModelContext({content:[{type:`text`,text:`The founder ${n===`approve`?`approved`:n+`ed`} the card "${t.title}" (${t.id}) in the inbox view.`}]})},onOpen:()=>e.open(`${Mg(e.args)}/c/${n??``}/inbox?card=${t.id}`),onAsk:()=>e.say(`About the card "${t.title}" (${t.id}): what is the team asking exactly, what does it cost or risk, and what would you decide?`)},t.id))]})}var Mg=e=>`https://app.autopoiesis.app`;(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>
@@ -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>Autopoiesis Money</title>
7
+ <title>Autopo Money</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,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 Cg({children:e}){return(0,$.jsx)(`div`,{className:`empty`,children:e})}var wg=e=>{if(e==null)return``;let t=e/100;return`${t>=100?Math.round(t):t.toFixed(1)} cr`},Tg=e=>e===`exhausted`?`danger`:e===`warning`?`attention`:`life`;function Eg({days:e}){let t=Math.max(1,...e.map(e=>e.cents)),n=e.length*8;return(0,$.jsx)(`svg`,{width:`100%`,viewBox:`0 0 ${n} 40`,preserveAspectRatio:`none`,height:40,"aria-label":`Spend by day`,children:e.map((n,r)=>{let i=Math.max(1,n.cents/t*36);return(0,$.jsx)(`rect`,{x:r*8,y:40-i,width:6,height:i,rx:1.5,fill:r===e.length-1?`var(--life)`:`var(--ink-3)`,opacity:r===e.length-1?1:.55,children:(0,$.jsxs)(`title`,{children:[n.date,`: `,wg(n.cents)]})},n.date)})})}function Dg(){let e=vg(`money`),t=e.data?.budget,n=t?.company,r=e.data?.company??e.args.company,i=n&&n.limit_cents>0?Math.min(100,n.spent_cents/n.limit_cents*100):0,a=n&&n.limit_cents>0?Math.min(100,n.projected_cents/n.limit_cents*100):0,o=n?.credits_cents??e.data?.credits?.balance_cents,s=[...t?.agents??[]].sort((e,t)=>t.spent_cents-e.spent_cents),c=Math.max(1,...s.map(e=>e.spent_cents));return(0,$.jsxs)(bg,{eyebrow:`Autopoiesis · Money`,title:n?`${wg(n.spent_cents)} spent this month`:`Money`,sub:t?.period_start?`${t.period_start.slice(0,10)} → ${t.period_end?.slice(0,10)}`:void 0,right:(0,$.jsxs)($.Fragment,{children:[n?(0,$.jsx)(xg,{tone:Tg(n.status),children:n.status}):null,r?(0,$.jsx)(Sg,{xs:!0,tone:`ink`,onClick:()=>e.open(`https://app.autopoiesis.app/c/${r}/money`),children:`Buy credits`}):null]}),notice:e.notice,children:[e.error?(0,$.jsx)(Cg,{children:e.error}):null,!e.data&&!e.error?(0,$.jsx)(Cg,{children:(0,$.jsx)(`i`,{className:`spin`})}):null,n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`grid`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(120px, 1fr))`},children:[(0,$.jsxs)(`div`,{className:`tile`,children:[(0,$.jsx)(`span`,{className:`num`,children:wg(o)}),(0,$.jsx)(`span`,{className:`tiny muted`,children:`credits left`})]}),(0,$.jsxs)(`div`,{className:`tile`,children:[(0,$.jsx)(`span`,{className:`num`,children:wg(n.limit_cents)}),(0,$.jsx)(`span`,{className:`tiny muted`,children:`monthly budget`})]}),(0,$.jsxs)(`div`,{className:`tile`,children:[(0,$.jsx)(`span`,{className:`num`,style:{color:a>100?`var(--attention)`:void 0},children:wg(n.projected_cents)}),(0,$.jsx)(`span`,{className:`tiny muted`,children:`projected`})]}),t?.founder_plan?.runs?(0,$.jsxs)(`div`,{className:`tile`,children:[(0,$.jsx)(`span`,{className:`num`,children:t.founder_plan.runs}),(0,$.jsx)(`span`,{className:`tiny muted`,children:`runs on your plan`})]}):null]}),(0,$.jsxs)(`div`,{className:`card`,style:{gap:6},children:[(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(`span`,{className:`eyebrow`,children:`Budget`}),(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsxs)(`span`,{className:`tiny faint`,children:[Math.round(i),`% used · warns at `,n.warn_pct,`%`]})]}),(0,$.jsxs)(`div`,{className:`meter`,children:[(0,$.jsx)(`i`,{className:Tg(n.status),style:{width:`${i}%`}}),a>0?(0,$.jsx)(`b`,{style:{left:`${a}%`},title:`projected`}):null]})]}),t?.by_day?.length?(0,$.jsxs)(`div`,{className:`card`,style:{gap:6},children:[(0,$.jsx)(`span`,{className:`eyebrow`,children:`Day by day`}),(0,$.jsx)(Eg,{days:t.by_day.slice(-31)})]}):null,s.length?(0,$.jsxs)(`div`,{className:`card`,style:{gap:6},children:[(0,$.jsx)(`span`,{className:`eyebrow`,children:`By agent`}),(0,$.jsx)(`div`,{className:`list`,children:s.slice(0,8).map(e=>(0,$.jsx)(`div`,{className:`item`,style:{alignItems:`center`},children:(0,$.jsxs)(`div`,{className:`grow`,children:[(0,$.jsxs)(`div`,{className:`row small`,children:[(0,$.jsx)(`span`,{children:e.agent.name}),(0,$.jsx)(`span`,{className:`tiny faint`,children:e.agent.role_key}),(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsxs)(`span`,{className:`tiny`,children:[wg(e.spent_cents),e.limit_cents?(0,$.jsxs)(`span`,{className:`faint`,children:[` / `,wg(e.limit_cents)]}):null]})]}),(0,$.jsx)(`div`,{className:`bar`,children:(0,$.jsx)(`i`,{style:{width:`${e.spent_cents/c*100}%`,background:e.status===`exhausted`?`var(--danger)`:e.status===`warning`?`var(--attention)`:void 0}})})]})},e.agent.id))})]}):null,t?.by_runtime?.length?(0,$.jsx)(`div`,{className:`row`,style:{gap:6},children:t.by_runtime.map(e=>(0,$.jsxs)(xg,{outline:!0,children:[e.runtime,`: `,wg(e.cents)]},e.runtime))}):null,t?.incidents?.filter(e=>!e.resolved_at).length?(0,$.jsxs)(`div`,{className:`tiny`,style:{color:`var(--danger)`},children:[`Open: `,t.incidents.filter(e=>!e.resolved_at).map(e=>`${e.scope} (${e.level})`).join(`, `)]}):null,(0,$.jsx)(`div`,{className:`row`,children:(0,$.jsx)(Sg,{xs:!0,tone:`ghost`,onClick:()=>e.say(`Where did the credits go this month, and what would you cut?`),children:`Explain the spend`})})]}):null]})}(0,u.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(l.StrictMode,{children:(0,$.jsx)(Dg,{})}));</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,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 Cg({children:e}){return(0,$.jsx)(`div`,{className:`empty`,children:e})}var wg=e=>{if(e==null)return``;let t=e/100;return`${t>=100?Math.round(t):t.toFixed(1)} cr`},Tg=e=>e===`exhausted`?`danger`:e===`warning`?`attention`:`life`;function Eg({days:e}){let t=Math.max(1,...e.map(e=>e.cents)),n=e.length*8;return(0,$.jsx)(`svg`,{width:`100%`,viewBox:`0 0 ${n} 40`,preserveAspectRatio:`none`,height:40,"aria-label":`Spend by day`,children:e.map((n,r)=>{let i=Math.max(1,n.cents/t*36);return(0,$.jsx)(`rect`,{x:r*8,y:40-i,width:6,height:i,rx:1.5,fill:r===e.length-1?`var(--life)`:`var(--ink-3)`,opacity:r===e.length-1?1:.55,children:(0,$.jsxs)(`title`,{children:[n.date,`: `,wg(n.cents)]})},n.date)})})}function Dg(){let e=vg(`money`),t=e.data?.budget,n=t?.company,r=e.data?.company??e.args.company,i=n&&n.limit_cents>0?Math.min(100,n.spent_cents/n.limit_cents*100):0,a=n&&n.limit_cents>0?Math.min(100,n.projected_cents/n.limit_cents*100):0,o=n?.credits_cents??e.data?.credits?.balance_cents,s=[...t?.agents??[]].sort((e,t)=>t.spent_cents-e.spent_cents),c=Math.max(1,...s.map(e=>e.spent_cents));return(0,$.jsxs)(bg,{eyebrow:`Autopo · Money`,title:n?`${wg(n.spent_cents)} spent this month`:`Money`,sub:t?.period_start?`${t.period_start.slice(0,10)} → ${t.period_end?.slice(0,10)}`:void 0,right:(0,$.jsxs)($.Fragment,{children:[n?(0,$.jsx)(xg,{tone:Tg(n.status),children:n.status}):null,r?(0,$.jsx)(Sg,{xs:!0,tone:`ink`,onClick:()=>e.open(`https://app.autopoiesis.app/c/${r}/money`),children:`Buy credits`}):null]}),notice:e.notice,children:[e.error?(0,$.jsx)(Cg,{children:e.error}):null,!e.data&&!e.error?(0,$.jsx)(Cg,{children:(0,$.jsx)(`i`,{className:`spin`})}):null,n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`grid`,style:{gridTemplateColumns:`repeat(auto-fit, minmax(120px, 1fr))`},children:[(0,$.jsxs)(`div`,{className:`tile`,children:[(0,$.jsx)(`span`,{className:`num`,children:wg(o)}),(0,$.jsx)(`span`,{className:`tiny muted`,children:`credits left`})]}),(0,$.jsxs)(`div`,{className:`tile`,children:[(0,$.jsx)(`span`,{className:`num`,children:wg(n.limit_cents)}),(0,$.jsx)(`span`,{className:`tiny muted`,children:`monthly budget`})]}),(0,$.jsxs)(`div`,{className:`tile`,children:[(0,$.jsx)(`span`,{className:`num`,style:{color:a>100?`var(--attention)`:void 0},children:wg(n.projected_cents)}),(0,$.jsx)(`span`,{className:`tiny muted`,children:`projected`})]}),t?.founder_plan?.runs?(0,$.jsxs)(`div`,{className:`tile`,children:[(0,$.jsx)(`span`,{className:`num`,children:t.founder_plan.runs}),(0,$.jsx)(`span`,{className:`tiny muted`,children:`runs on your plan`})]}):null]}),(0,$.jsxs)(`div`,{className:`card`,style:{gap:6},children:[(0,$.jsxs)(`div`,{className:`row`,children:[(0,$.jsx)(`span`,{className:`eyebrow`,children:`Budget`}),(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsxs)(`span`,{className:`tiny faint`,children:[Math.round(i),`% used · warns at `,n.warn_pct,`%`]})]}),(0,$.jsxs)(`div`,{className:`meter`,children:[(0,$.jsx)(`i`,{className:Tg(n.status),style:{width:`${i}%`}}),a>0?(0,$.jsx)(`b`,{style:{left:`${a}%`},title:`projected`}):null]})]}),t?.by_day?.length?(0,$.jsxs)(`div`,{className:`card`,style:{gap:6},children:[(0,$.jsx)(`span`,{className:`eyebrow`,children:`Day by day`}),(0,$.jsx)(Eg,{days:t.by_day.slice(-31)})]}):null,s.length?(0,$.jsxs)(`div`,{className:`card`,style:{gap:6},children:[(0,$.jsx)(`span`,{className:`eyebrow`,children:`By agent`}),(0,$.jsx)(`div`,{className:`list`,children:s.slice(0,8).map(e=>(0,$.jsx)(`div`,{className:`item`,style:{alignItems:`center`},children:(0,$.jsxs)(`div`,{className:`grow`,children:[(0,$.jsxs)(`div`,{className:`row small`,children:[(0,$.jsx)(`span`,{children:e.agent.name}),(0,$.jsx)(`span`,{className:`tiny faint`,children:e.agent.role_key}),(0,$.jsx)(`span`,{className:`grow`}),(0,$.jsxs)(`span`,{className:`tiny`,children:[wg(e.spent_cents),e.limit_cents?(0,$.jsxs)(`span`,{className:`faint`,children:[` / `,wg(e.limit_cents)]}):null]})]}),(0,$.jsx)(`div`,{className:`bar`,children:(0,$.jsx)(`i`,{style:{width:`${e.spent_cents/c*100}%`,background:e.status===`exhausted`?`var(--danger)`:e.status===`warning`?`var(--attention)`:void 0}})})]})},e.agent.id))})]}):null,t?.by_runtime?.length?(0,$.jsx)(`div`,{className:`row`,style:{gap:6},children:t.by_runtime.map(e=>(0,$.jsxs)(xg,{outline:!0,children:[e.runtime,`: `,wg(e.cents)]},e.runtime))}):null,t?.incidents?.filter(e=>!e.resolved_at).length?(0,$.jsxs)(`div`,{className:`tiny`,style:{color:`var(--danger)`},children:[`Open: `,t.incidents.filter(e=>!e.resolved_at).map(e=>`${e.scope} (${e.level})`).join(`, `)]}):null,(0,$.jsx)(`div`,{className:`row`,children:(0,$.jsx)(Sg,{xs:!0,tone:`ghost`,onClick:()=>e.say(`Where did the credits go this month, and what would you cut?`),children:`Explain the spend`})})]}):null]})}(0,u.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(l.StrictMode,{children:(0,$.jsx)(Dg,{})}));</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>
@@ -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>Autopoiesis Storyboard</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.1",
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 Autopoiesis company from Claude Code, Codex, Cursor, Claude Desktop or ChatGPT over MCP: briefings, the inbox, tasks, the team, the Studio, marketing, money.",
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",