@alook/app 0.1.46 → 0.1.47
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/bundled/email-worker/index.js +2 -2
- package/bundled/queue-worker/index.js +1 -1
- package/bundled/web/.open-next/.build/durable-objects/queue.js +5 -5
- package/bundled/web/.open-next/assets/BUILD_ID +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{1thqqd8mgk392.js → 0_vlirz00r9q3.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0fhupcu7gw5-g.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{00nwwh7t3-94u.js → 0t1fkk2aoe46s.js} +2 -2
- package/bundled/web/.open-next/assets/_next/static/chunks/{0bbbf3c--s4nt.js → 0xd95q8dh9nth.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{0177g_82selwt.js → 0yvh-4_s35xb-.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/140rz0mf_gln5.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/17_1uj99552co.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{2lzrcnv3h01ye.js → 188n8dv95gspf.js} +2 -2
- package/bundled/web/.open-next/assets/_next/static/chunks/1t1-4gr4g9-gk.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/1vv8sekkn7ca7.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/2009nt3x08t7f.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{2h4tal5a8ozdj.css → 21hdf3-tpkomr.css} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/2axyc5j5bmuu7.js +20 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/2cg05psk59acc.css +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/2l5ipmh5tt-zw.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{3j04_qzqc8w_l.js → 2mmbu93s7a0m4.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/2pi74q1djax_j.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/2pup1a3f06cvv.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/2rppouots3wnd.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/2umnqrh2lz20p.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/2wol9tomcwmy-.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{1nztgrf53ss2o.js → 34ad0gln6p9mc.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/3678fpz9w9yx7.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/38-2d78030m_h.js +1 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{2uu-vuh4bhmn-.js → 392tyqmzowh4n.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{42xemtm1t_inw.js → 3dweor92bn1fg.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{0yrjoj6i80b13.js → 3fycjvwvjxxe7.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{0a7ly50c0irhh.js → 3kp4-3im11oyn.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/{1e5hn5ft96mrw.js → 3qwk5pvuky-tc.js} +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/3ud6196bax4yc.js +2 -0
- package/bundled/web/.open-next/assets/_next/static/chunks/{turbopack-3v2fy6lperb7_.js → turbopack-3t97qecmun8ck.js} +1 -1
- package/bundled/web/.open-next/assets/sw.js +1 -1
- package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/_global-error.cache +1 -1
- package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/_not-found.cache +1 -1
- package/bundled/web/.open-next/cache/l7JcQdOJYySajzS1KAORl/contact.cache +1 -0
- package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/device.cache +1 -1
- package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/onboarding-preview.cache +1 -1
- package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/pricing-concept.cache +1 -1
- package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/pricing.cache +1 -1
- package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/privacy.cache +1 -1
- package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/serwist/sw.js.cache +1 -1
- package/bundled/web/.open-next/cloudflare/cache-assets-manifest.sql +1 -1
- package/bundled/web/.open-next/cloudflare/init.js +1 -1
- package/bundled/web/.open-next/dynamodb-provider/dynamodb-cache.json +1 -1
- package/bundled/web/.open-next/middleware/handler.mjs +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/BUILD_ID +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/build-manifest.json +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/prerender-manifest.json +4 -4
- package/bundled/web/.open-next/server-functions/default/src/web/.next/required-server-files.json +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(auth)/sign-in/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(home)/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/channels/[serverId]/[channelId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/channels/[serverId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/channels/[serverId]/settings/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/invite/[token]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/me/[dmId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/me/bots/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/me/friends/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/me/machines/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/me/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/onboarding-preview/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/@sidebar/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/channels/[serverId]/[channelId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/channels/[serverId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/channels/[serverId]/settings/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/invite/[token]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/[dmId]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/bots/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/friends/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/machines/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/me/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/onboarding-preview/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/c/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/contact/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/device/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/landing-legacy/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/onboarding-preview/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/pricing/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/pricing-concept/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/[id]/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/page_client-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[turbopack]_runtime.js +65 -69
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/_1ct1usd._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{0iuv_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1-7foy1._.js → 0iuv_@mermaid-js_parser_dist_chunks_mermaid-parser_core_03no4-2._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{0iuv_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1_ivo7r._.js → 0iuv_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0zd2m6u._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{0iuv_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1iexmau._.js → 0iuv_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1jq9i9s._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__024hatd._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__08bo8pg._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0er5w1y._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__1n1hzgg._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[turbopack]_runtime.js +65 -69
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_00cx5e_._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_00d19_4._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0cogu8j._.js → _06jf8-3._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0819w4u._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_086-1v_._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_09v7ppp._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_127opyy._.js → _0_d2_yz._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0djtnj_._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0fgqn7p._.js +22 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0gt3fqd._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_1m_bb91._.js → _0kjmsuf._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0laj1vh._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0a1covk._.js → _0op1s0h._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0tr5tf8._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0uinku_._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0ulh9qf._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0xvya63._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0zk-6sq._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1-1q6bt._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1-x1xdl._.js +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0xp97b1._.js → _117-2e3._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_11h5qp9._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_13xipld._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_15gov5k._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1640_ni._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_17fctb6._.js +22 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1ewek2f._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0ljlxsv._.js → _1gakrqx._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1gj8gn1._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_1b2ol5x._.js → _1gytpb_._.js} +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_1fhm2rs._.js → _1jtz070._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1nm05cr._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1nytmku._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1us65pi._.js +3 -0
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1w0zw8i._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_1cx9ua4._.js → _214ta2t._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0-f4fpm._.js → node_modules__pnpm_0097mmd._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0r6z90r._.js → node_modules__pnpm_00eiak_._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0s-z4zf._.js → node_modules__pnpm_01cia-g._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0m2qxgk._.js → node_modules__pnpm_01yk3fx._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1ayb864._.js → node_modules__pnpm_02smzd_._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_00c11_c._.js → node_modules__pnpm_03rxn2x._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0_nw64v._.js → node_modules__pnpm_03wj0t4._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0cvjw9i._.js → node_modules__pnpm_05c5bgp._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0blbev3._.js → node_modules__pnpm_064o-o_._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_11e-npx._.js → node_modules__pnpm_07l09-d._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_09bvy71._.js → node_modules__pnpm_0dori0l._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1mfsik-._.js → node_modules__pnpm_0fgssuc._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0m-2ca1._.js → node_modules__pnpm_0h31fyp._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_08sh6lq._.js → node_modules__pnpm_0iorffo._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1-c3rlj._.js → node_modules__pnpm_0tx0dz2._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1vs8g1m._.js → node_modules__pnpm_0u3tve4._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0-kb9vk._.js → node_modules__pnpm_0un9z0x._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_070fpt8._.js → node_modules__pnpm_0ux1312._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_157gdig._.js → node_modules__pnpm_0vbkpol._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1asgfic._.js → node_modules__pnpm_0wrv_s9._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0b1vf_7._.js → node_modules__pnpm_0yy67gq._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1nq5wvh._.js → node_modules__pnpm_167ic81._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1mib8iw._.js → node_modules__pnpm_16a71ys._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1_et9ao._.js → node_modules__pnpm_1bj-8tf._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1prm9wo._.js → node_modules__pnpm_1dav1ya._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0m7v0y2._.js → node_modules__pnpm_1edc4wg._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0gqxh94._.js → node_modules__pnpm_1g67_l_._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1orcadd._.js → node_modules__pnpm_1h_4uav._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1-dd625._.js → node_modules__pnpm_1kdkhmj._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1y8nnsd._.js → node_modules__pnpm_1kxm1bx._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0fdef--._.js → node_modules__pnpm_1mu5qb5._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1xhq2ni._.js → node_modules__pnpm_1n0a569._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1wj99ai._.js → node_modules__pnpm_1p-jj1h._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1diq3cq._.js → node_modules__pnpm_1rcn3pb._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_07mqf39._.js → node_modules__pnpm_1uaag00._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_0-l2dm_._.js → node_modules__pnpm_1ukw6z6._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_08f9ywz._.js → node_modules__pnpm_1v0qc-p._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_03c-uqx._.js → node_modules__pnpm_1xy4aqy._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{node_modules__pnpm_1sh8pig._.js → node_modules__pnpm_1xzd_xq._.js} +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_09h-4yj._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_0yqt0fx._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_11g9nod._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_1-ostj6._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_app_pricing_127grdu._.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-build-manifest.js +6 -6
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-manifest.json +5 -5
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.js +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.json +1 -1
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs +2 -2
- package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +795 -867
- package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +4 -4
- package/bundled/web/wrangler.toml +1 -1
- package/bundled/ws-do/index.js +2 -2
- package/dist/daemon/index.js +418 -303
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0ib9uwa0z-dsz.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0iwup-jnjrnec.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/0yvr7whfqda3q.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/1zpwi6czw7ai-.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/20loivmezlm5a.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/28pnob-12so6n.js +0 -20
- package/bundled/web/.open-next/assets/_next/static/chunks/2i53b9t712-8k.js +0 -2
- package/bundled/web/.open-next/assets/_next/static/chunks/2tqh9wwavuxwq.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/2uwi9gt28dg6t.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/3-m490wvnsr-n.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/30gpw8oi502mg.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/3861y4ak8gkfc.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/39-78ukwmmip3.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/3dbjh1gzez-8i.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/3ekglfdj1praq.css +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/3g8qj_h02jo0x.js +0 -1
- package/bundled/web/.open-next/assets/_next/static/chunks/3jtsw1j65-agm.js +0 -1
- package/bundled/web/.open-next/cache/EYIUufIdDY9MZnN1L4UIr/contact.cache +0 -1
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__06dwsqz._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0a_lhi2._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__0ag1oov._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__1kqvewd._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0b6xa_y._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0fczp2o._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0lkpg4u._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0slfbkf._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0wm9g4g._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0z8ofkn._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1213-9m._.js +0 -22
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_19kvvyn._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1h0ocvt._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1m9xtpd._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1pgfzei._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1tciap9._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1zfcy06._.js +0 -3
- package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_08frtr7._.js +0 -22
- /package/bundled/web/.open-next/assets/_next/static/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/_buildManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/_clientMiddlewareManifest.js +0 -0
- /package/bundled/web/.open-next/assets/_next/static/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/_ssgManifest.js +0 -0
- /package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/favicon.ico.cache +0 -0
- /package/bundled/web/.open-next/cache/{EYIUufIdDY9MZnN1L4UIr → l7JcQdOJYySajzS1KAORl}/robots.txt.cache +0 -0
package/bundled/web/.open-next/assets/_next/static/chunks/{42xemtm1t_inw.js → 3dweor92bn1fg.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,328076,e=>{"use strict";var t=e.i(248933),n=e.i(382416);e.s(["useCreateStore",0,function(e,a){let[i]=(0,n.useState)(()=>"function"==typeof e?(0,t.createStore)(e):a?(0,t.createStore)(e,a):(0,t.createStore)(e));return i}])},383275,e=>{"use strict";var t=e.i(1087);let n={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};n.node;let a=(0,t.default)(n);e.s(["ChevronLeft",0,a],383275)},846367,e=>{"use strict";e.s(["isPresenceOffline",0,function(e){return"offline"===e},"isPresenceOnline",0,function(e){return"online"===e}])},989621,e=>{e.v({action:"billing-plan-module__2wDEuW__action",botDots:"billing-plan-module__2wDEuW__botDots",content:"billing-plan-module__2wDEuW__content",currentName:"billing-plan-module__2wDEuW__currentName",house:"billing-plan-module__2wDEuW__house",limit:"billing-plan-module__2wDEuW__limit",name:"billing-plan-module__2wDEuW__name",offer:"billing-plan-module__2wDEuW__offer",offers:"billing-plan-module__2wDEuW__offers",price:"billing-plan-module__2wDEuW__price",stub:"billing-plan-module__2wDEuW__stub",studio:"billing-plan-module__2wDEuW__studio"})},166037,e=>{"use strict";var t=e.i(237649),n=e.i(779646),a=e.i(186339);e.s(["FounderPlanChangeDialog",0,function({offer:e,busy:i,onCancel:s,onConfirm:r}){return(0,t.jsx)(n.Dialog,{open:null!==e,onOpenChange:e=>{e||i||s()},children:(0,t.jsxs)(n.DialogContent,{className:"sm:max-w-md",showCloseButton:!i,children:[(0,t.jsxs)(n.DialogHeader,{children:[(0,t.jsxs)(n.DialogTitle,{children:["Leave Founder for ",e?.plan.displayName,"?"]}),(0,t.jsx)(n.DialogDescription,{children:"Completing this purchase permanently ends your Founder access. You can’t restore it, even if you later cancel your subscription. If you leave checkout without paying, you keep Founder."})]}),(0,t.jsxs)(n.DialogFooter,{children:[(0,t.jsx)(a.Button,{variant:"outline",disabled:i,onClick:s,children:"Keep Founder"}),(0,t.jsx)(a.Button,{disabled:i,onClick:r,children:i?"Opening…":"Continue to checkout"})]})]})})}])},765867,690887,e=>{"use strict";var t=e.i(237649),n=e.i(383275),a=e.i(792265),a=a,i=e.i(186339),s=e.i(934351),r=e.i(728886),o=e.i(382416),l=e.i(732919),d=e.i(904550),c=e.i(909850),u=e.i(621202);function m({idPrefix:e="ot-create"}){let n=(0,o.useRef)(null),a=(0,c.tileIds)(e);return(0,d.useGSAP)(()=>{if(!n.current)return;l.default.set(".ot-bot",{opacity:0,scale:.9}),l.default.set(".ot-dot",{opacity:0}),l.default.set(".ot-say",{opacity:0}),l.default.set(".ot-av",{x:0,y:0,scale:1,svgOrigin:"100 65"});let e=l.default.timeline({repeat:-1,defaults:{ease:u.OT_EASE}});e.fromTo(".ot-plus",{scale:.9},{scale:1.12,duration:.9,yoyo:!0,repeat:1}).to(".ot-ph",{opacity:0,scale:1.06,duration:.55},"+=0.15").to(".ot-bot",{opacity:1,scale:1,duration:.55},"<"),(0,u.comeOnline)(e,".ot-dot",120.5,85.5,"-=0.1"),e.to(".ot-av",{scale:.77,x:-50,y:-4,duration:.6,svgOrigin:"100 65"},"+=0.5").from(".ot-say",{x:-8,duration:.5},"<0.15").to(".ot-say",{opacity:1,duration:.4},"<").to({},{duration:1.6}).to(".ot-say",{opacity:0,x:-8,duration:.4}).to(".ot-av",{scale:.9,x:0,y:0,duration:.45,svgOrigin:"100 65"},"<0.1").to(".ot-bot",{opacity:0,duration:.4}).set(".ot-dot",{opacity:0}).set(".ot-av",{scale:1}).to(".ot-ph",{opacity:1,scale:1,duration:.5},"<0.1").to({},{duration:.5})},{scope:n}),(0,t.jsxs)("svg",{ref:n,viewBox:"0 0 200 130",className:"ot-svg h-full w-full",children:[(0,t.jsx)(c.TileDefs,{idPrefix:e}),(0,t.jsxs)("g",{className:"ot-ph ot-center",children:[(0,t.jsx)("rect",{className:"ot-art",x:"74",y:"39",width:"52",height:"52",rx:"16",strokeDasharray:"7 7",opacity:"0.65"}),(0,t.jsxs)("g",{className:"ot-plus ot-center",children:[(0,t.jsx)("line",{className:"ot-art",x1:"100",y1:"55",x2:"100",y2:"75"}),(0,t.jsx)("line",{className:"ot-art",x1:"90",y1:"65",x2:"110",y2:"65"})]})]}),(0,t.jsxs)("g",{className:"ot-bot ot-center",opacity:"0",children:[(0,t.jsxs)("g",{className:"ot-av",children:[(0,t.jsx)("svg",{x:"74",y:"39",width:"52",height:"52",viewBox:"0 0 36 36",children:(0,t.jsx)("g",{clipPath:`url(#${a.disc})`,children:(0,t.jsx)("use",{href:`#${a.faceB}`})})}),(0,t.jsxs)("g",{className:"ot-online",children:[(0,t.jsx)("circle",{cx:"120.5",cy:"85.5",r:"8.5",fill:"var(--card)"}),(0,t.jsx)("circle",{cx:"120.5",cy:"85.5",r:"5.5",fill:"var(--muted-foreground)"}),(0,t.jsx)("circle",{className:"ot-dot",cx:"120.5",cy:"85.5",r:"5.5",fill:"var(--status-online)"})]})]}),(0,t.jsxs)("g",{className:"ot-say",opacity:"0",children:[(0,t.jsx)("text",{x:"82",y:"60",fontFamily:"DM Sans, sans-serif",fontSize:"15",fontWeight:"600",fill:"var(--foreground)",children:"Alli"}),(0,t.jsx)("text",{x:"112",y:"60",fontFamily:"DM Sans, sans-serif",fontSize:"12",fill:"var(--muted-foreground)",children:"now"}),(0,t.jsx)("text",{x:"82",y:"80",fontFamily:"DM Sans, sans-serif",fontSize:"15",fill:"var(--foreground)",children:"Hello World"})]})]})]})}var p=e.i(381153),h=e.i(224950),x=e.i(592941);function f({summary:e,isFounder:n=!1,onViewPlan:a}){let s=e?.activeCount??0,r=e?.ownedCount??0,o=e?.limit??0,l=o>0?Math.min(100,Math.max(0,s/o*100)):0;return(0,t.jsxs)(h.Popover,{children:[(0,t.jsx)(h.PopoverTrigger,{openOnHover:!0,delay:150,render:(0,t.jsxs)("button",{type:"button","data-testid":p.tid.myBotsPlanSummary,disabled:!e,"aria-label":e?`Active Bots: ${s} of ${e.limit} allowed, ${r} owned, ${n?"Founder":e.plan.displayName} plan`:"Active Bots loading",className:"flex min-h-11 w-fit items-center gap-2 rounded-sm text-sm text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:min-h-6",children:["Active Bots",(0,t.jsxs)("svg",{"aria-hidden":"true",className:"size-4 -rotate-90",viewBox:"0 0 20 20",fill:"none",children:[(0,t.jsx)("circle",{cx:"10",cy:"10",r:"8",stroke:"currentColor",strokeWidth:"2",className:"text-border"}),(0,t.jsx)("circle",{cx:"10",cy:"10",r:"8",stroke:"currentColor",strokeWidth:"2",pathLength:"100",strokeDasharray:`${l} 100`,strokeLinecap:l>0?"round":"butt"})]})]})}),(0,t.jsx)(h.PopoverContent,{className:"w-64 overflow-hidden p-0",side:"bottom",align:"start",children:(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-5",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:"Active bots"}),(0,t.jsx)("span",{className:"font-brand text-xl font-bold leading-none",children:n?"Founder":e?.plan.displayName})]}),(0,t.jsxs)("p",{className:"text-2xl font-semibold leading-none tracking-tight tabular-nums","aria-label":`${s} of ${o} active bot slots used`,children:[s,(0,t.jsxs)("span",{className:"text-lg font-normal text-muted-foreground",children:[" / ",o]})]}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[r," bots owned"]}),a&&(0,t.jsxs)(h.PopoverClose,{onClick:a,render:(0,t.jsx)(i.Button,{variant:"ghost",size:"sm",className:"-mx-2 min-h-11 justify-between sm:min-h-8"}),children:["View plan",(0,t.jsx)(x.ArrowRight,{className:"size-3.5"})]})]})})]})}var g=e.i(248933),b=e.i(777104),y=e.i(561261),v=e.i(159514),j=e.i(374402),N=e.i(636557),w=e.i(51201),C=e.i(506607),k=e.i(849050);e.i(954194);var A=e.i(846367),D=e.i(130901),S=e.i(972525),B=e.i(473131),_=e.i(435355),T=e.i(939088),P=e.i(855372),I=e.i(617527),O=e.i(985885),M=e.i(551095),R=e.i(521073),E=e.i(613349);let $=(0,_.serializeBeamSeed)("initial");function z(e){return(e?.availableRuntimes??[]).map(e=>"string"==typeof e?{id:e,unhealthy:!1}:{id:e.id,...void 0!==e.reasoning?{reasoning:e.reasoning}:{},unhealthy:"unhealthy"===e.status}).sort((e,t)=>Number(e.unhealthy)-Number(t.unhealthy))}function F(e){return e.find(e=>!e.unhealthy)?.id??""}function L({open:e,onOpenChange:n,onCreated:a,guided:s=!1,avatarSeed:r}){let l=(0,w.useCommunityViewSource)("create-bot",e),d=(0,v.useQueryClient)(),c=e=>{e||l.retire(),n(e)},{machines:u}=(0,I.useMachines)(),m=(0,O.useCreateBot)(),p=(0,O.useUploadBotAvatar)(),[h,x]=(0,b.useAtom)((0,y.useCreateAtom)("")),[f,q]=(0,b.useAtom)((0,y.useCreateAtom)("")),[K,U]=(0,b.useAtom)((0,y.useCreateAtom)("")),[Q,W]=(0,b.useAtom)((0,y.useCreateAtom)("")),[H,V]=(0,b.useAtom)((0,y.useCreateAtom)(null)),[Y,G]=(0,b.useAtom)((0,y.useCreateAtom)(null)),[J,X]=(0,b.useAtom)((0,y.useCreateAtom)({})),[Z,ee]=(0,b.useAtom)((0,y.useCreateAtom)(!1)),[et,en]=(0,b.useAtom)((0,y.useCreateAtom)({kind:"procedural",image:$})),ea=u.find(e=>e.id===K),ei=(0,o.useMemo)(()=>z(ea),[ea]),es=s&&!!(ea&&Q)&&1===u.filter(e=>(0,A.isPresenceOnline)(e.status)).length&&1===ei.filter(e=>!e.unhealthy).length,er=(0,o.useMemo)(()=>({scope:[l.signal],store:(0,g.createStore)(!1)}),[l.signal]).store;async function eo(){if(["create-command","avatar-command"].some(e=>d.isMutating({mutationKey:[...j.communityKeys.bots(),e],exact:!0,predicate:e=>e.state.variables.input?.assertActive?.signal===l.signal})>0))return;let e=l.capture();e();let t=function({name:e,machineId:t,runtime:n}){let a={};return e.trim()||(a.name="Name is required"),t||(a.machineId="Pick a machine"),n||(a.runtime="Pick a runtime"),a}({name:h,machineId:K,runtime:Q});if(X(t),!(t.name||t.machineId||t.runtime))try{let t=await m.mutateAsync({assertActive:e,name:h.trim(),description:f.trim()||void 0,machineId:K,runtime:Q,image:"procedural"===et.kind?et.image:void 0,model:H,reasoningEffort:Y});e();let n=!1;if("photo"===et.kind&&et.file)try{await p.mutateAsync({botId:t.bot.id,file:et.file,assertActive:e}),e()}catch(t){try{e()}catch{return}if((0,N.isAbortError)(t))return;n=!0,(0,k.toastApiError)(t,"Bot created, but the avatar photo failed to upload",e)}n||C.toast.success(`Created ${h.trim()}`),e(),await a?.(t.bot),e(),c(!1)}catch(t){if((0,N.isAbortError)(t))return;(0,k.toastApiError)(t,"Couldn't create the bot",e)}}return(0,o.useEffect)(()=>{!e||er.get()||(er.setState(()=>!0),x((0,T.randomBotName)()),en({kind:"procedural",image:(0,_.serializeBeamSeed)(r??crypto.randomUUID())}),q(""),U(""),W(""),V(null),G(null),X({}),ee(!1))},[e,r,er,x,en,q,U,W,V,G,X,ee]),(0,o.useEffect)(()=>{if(e){if(""===K){let e=u.find(e=>(0,A.isPresenceOnline)(e.status))?.id??"";e&&U(e);return}if(""===Q){let e=F(ei);e&&W(e)}}},[e,u,ei,K,Q,U,W]),(0,t.jsxs)(S.CommunitySheet,{open:e,onOpenChange:c,title:"Create a bot",bodyClassName:"flex flex-col gap-6",footer:e=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:e,children:"Cancel"}),(0,t.jsx)(i.Button,{onClick:eo,disabled:m.isPending||p.isPending,children:m.isPending?"Creating…":"Create bot"})]}),children:[(0,t.jsx)(M.BotFormFields,{avatarDraft:et,onAvatarChange:en,name:h,setName:function(e){x(e),J.name&&e.trim()&&X(e=>({...e,name:void 0}))},onShuffle:function(){x((0,T.randomBotName)()),X(e=>({...e,name:void 0}))},description:f,setDescription:q,nameError:J.name}),es&&!Z?(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-lg bg-muted/60 px-3 py-2.5",children:[(0,t.jsx)(P.ProviderLogo,{provider:Q,className:"size-5 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("p",{className:"truncate text-sm font-medium",children:["Ready on ",ea?(0,D.machineName)(ea):"your machine"]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[Q," · Default model"]})]}),(0,t.jsx)(i.Button,{variant:"ghost",size:"sm",onClick:()=>ee(!0),children:"Change"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(B.Label,{className:"text-xs text-muted-foreground",children:"Machine"}),0===u.length?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"No paired machines — pair one first."}):(0,t.jsx)("div",{className:"flex flex-col gap-2",role:"radiogroup","aria-label":"Machine","data-testid":"bot-machine-picker",children:u.map(e=>{let n=(0,A.isPresenceOnline)(e.status),a=K===e.id;return(0,t.jsxs)("label",{className:(0,E.cn)("flex items-center gap-2 rounded-lg border p-2 cursor-pointer transition-colors",a?"border-primary bg-primary/5":"border-border/50 hover:border-foreground/20",!n&&"opacity-40 pointer-events-none"),children:[(0,t.jsx)("input",{type:"radio",name:"bot-machine",value:e.id,checked:a,disabled:!n,onChange:()=>{var t;U(t=e.id),W(F(z(u.find(e=>e.id===t)))),V(null),G(null),X(e=>({...e,machineId:void 0}))},className:"accent-primary size-3.5"}),(0,t.jsx)("span",{className:"text-sm",children:(0,D.machineName)(e)}),(0,t.jsxs)("span",{className:(0,E.cn)("ml-auto inline-flex items-center gap-1 text-xs",n?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground"),children:[(0,t.jsx)("span",{className:(0,E.cn)("inline-block size-1.5 rounded-full",n?"bg-status-online":"bg-muted-foreground")}),n?"Online":"Offline"]})]},e.id)})}),J.machineId&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:J.machineId})]}),ea&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:(0,t.jsx)(R.BotRuntimeFields,{options:ei,runtime:Q,model:H,daemonVersion:ea?.daemonVersion,reasoningEffort:Y,onRuntimeChange:function(e){W(e),X(e=>({...e,runtime:void 0}))},onModelChange:V,onReasoningEffortChange:G,radioName:"bot-runtime",runtimeError:J.runtime,disableUnhealthyOptions:!0})})]})]})}var q=e.i(484065),K=e.i(569697),U=e.i(48920),Q=e.i(606261),W=e.i(746069),H=e.i(168614);e.i(400175);var V=e.i(261819),Y=e.i(89164),G=e.i(344431),J=e.i(450463);let X=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"});function Z(e){return"reported"===e.bucket.product.kind?`reported:${e.bucket.product.id}`:"unknown"}function ee(e){let t=e.bucket.model;return"reported"===t.kind?`reported:${t.id}`:t.kind}function et(e){let t;return[Z(e),ee(e),"rolling"===(t=e.bucket.window).kind?`rolling:${t.durationSeconds}`:"calendar"===t.kind?`calendar:${t.period}`:`provider_defined:${t.id}:${void 0===t.durationSeconds?"absent":t.durationSeconds}`,e.bucket.limitId].join("\0")}function en(e){let t=Math.min(12,function(e){let t=String(e).toLowerCase();if(t.includes("e-")){let[e,n]=t.split("e-");return Number(n)+(e.split(".")[1]?.length??0)}return t.split(".")[1]?.length??0}(e.usedPercent));return Number((100-e.usedPercent).toFixed(t))}function ea(e){return`${en(e)}% left`}function ei(e){if(!e.resetsAt)return 1/0;let t=Date.parse(e.resetsAt);return Number.isNaN(t)?1/0:t}function es(e){return"supported"===e.capability&&("available"===e.snapshot.status||"stale"===e.snapshot.status)&&e.snapshot.limits.length>0}function er(e){return e.split(/[-_]/).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" ")}function eo({machineId:e,entries:n}){let[a,i]=(0,b.useAtom)((0,y.useCreateAtom)(!1)),s=n?.some(es)?null:n?.length?n.some(e=>"supported"===e.capability&&"pending"===e.snapshot.status)?"Quota pending":n.every(e=>"unsupported"===e.capability)?"Quota not supported":"Quota unavailable":"Quota unavailable";if(!n?.length)return(0,t.jsxs)("div",{"data-testid":p.tid.machineQuota(e),className:"flex h-7 min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[n?.map(e=>(0,t.jsx)(P.ProviderLogo,{provider:e.scope.agentBackendId,className:"size-3.5 shrink-0"},e.scope.agentBackendId)),(0,t.jsx)("span",{className:"truncate",children:s??"Quota unavailable"})]});let r=n.filter(es).toSorted((e,t)=>e.scope.agentBackendId.localeCompare(t.scope.agentBackendId)).flatMap(e=>{if("available"!==e.snapshot.status&&"stale"!==e.snapshot.status)return[];let t=e.snapshot.limits.toSorted((e,t)=>{let n=en(e)-en(t);if(0!==n)return n;let a=ei(e),i=ei(t);return a!==i?a<i?-1:1:et(e).localeCompare(et(t))})[0]??null;return t?[{entry:e,limit:t}]:[]}),o=n.reduce((e,t)=>"available"===t.snapshot.status||"stale"===t.snapshot.status?e+t.snapshot.limits.length:e,0),l=r.map(({entry:e,limit:t})=>{let n="stale"===e.snapshot.status?", stale":"";return`${er(e.scope.agentBackendId)} ${ea(t)}${n}`}).join("; "),d=n.toSorted((e,t)=>{let n=Number(es(t))-Number(es(e));return 0!==n?n:e.scope.agentBackendId.localeCompare(t.scope.agentBackendId)});return(0,t.jsxs)(h.Popover,{open:a,onOpenChange:i,children:[(0,t.jsx)(h.PopoverTrigger,{render:(0,t.jsxs)("button",{type:"button","aria-expanded":a,"aria-label":s?`Quota details: ${s}`:`Quota details: ${l}. ${o} ${1===o?"limit":"limits"}`,"data-testid":p.tid.machineQuota(e),className:"group flex min-h-11 max-w-full min-w-0 flex-wrap items-center gap-x-2 gap-y-1 rounded-md py-2 text-left text-xs text-muted-foreground transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:min-h-7 sm:py-1",children:[s?(0,t.jsxs)(t.Fragment,{children:[n.map(e=>(0,t.jsx)(P.ProviderLogo,{provider:e.scope.agentBackendId,className:"size-3.5 shrink-0"},e.scope.agentBackendId)),(0,t.jsx)("span",{className:"truncate",children:s})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"shrink-0 text-foreground/70",children:"Quota"}),(0,t.jsx)("span",{"aria-hidden":!0,className:"shrink-0 text-border",children:"·"})]}),r.map(({entry:e,limit:n},a)=>{let i="stale"===e.snapshot.status,s=`${er(e.scope.agentBackendId)}: ${ea(n)}${i?" (stale)":""}`;return(0,t.jsxs)("span",{className:"contents",children:[a>0&&(0,t.jsx)("span",{"aria-hidden":!0,className:"shrink-0 text-border",children:"·"}),(0,t.jsxs)("span",{"aria-label":s,title:s,className:"inline-flex shrink-0 items-center gap-1.5",children:[(0,t.jsx)(P.ProviderLogo,{provider:e.scope.agentBackendId,className:"size-3.5 shrink-0"}),(0,t.jsxs)("span",{className:i?"font-mono tabular-nums text-warning":"font-mono tabular-nums text-foreground/85",children:[en(n),"%"]}),i&&(0,t.jsx)("span",{className:"text-[10px] text-warning",children:"stale"})]})]},e.scope.agentBackendId)}),(0,t.jsx)(K.ChevronDown,{className:"size-3 shrink-0 transition-transform group-data-popup-open:rotate-180"})]})}),(0,t.jsx)(h.PopoverContent,{align:"start",className:"max-h-[min(32rem,calc(100vh-2rem))] w-80 max-w-[calc(100vw-1rem)] overflow-y-auto p-4 thin-scrollbar","data-testid":p.tid.machineQuotaDetail(e),children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:"Machine quota"}),d.map(e=>{let n=e.snapshot;if("available"!==n.status&&"stale"!==n.status)return(0,t.jsxs)("section",{"data-quota-backend":e.scope.agentBackendId,className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)(P.ProviderLogo,{provider:e.scope.agentBackendId,className:"size-3.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate text-xs font-medium text-foreground",children:er(e.scope.agentBackendId)})]}),(0,t.jsx)("div",{className:"rounded-md border border-border/70 px-3 py-2 text-xs text-muted-foreground",children:"unsupported"===e.capability?"Not supported":"supported"===e.capability&&"pending"===e.snapshot.status?"Pending":"Unavailable"})]},e.scope.agentBackendId);let a=function(e){let t=new Map;for(let n of e){let e=`${Z(n)}\u0000${ee(n)}`,a=t.get(e);a?a.limits.push(n):t.set(e,{key:e,product:n.bucket.product.displayName,model:function(e){let t=e.bucket.model;return"not_applicable"===t.kind?null:"unknown"===t.kind?"Model unavailable":t.id}(n),limits:[n]})}return[...t.values()]}(n.limits);return(0,t.jsxs)("section",{"data-quota-backend":e.scope.agentBackendId,className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5",children:[(0,t.jsx)(P.ProviderLogo,{provider:e.scope.agentBackendId,className:"size-3.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate text-xs font-medium text-foreground",children:er(e.scope.agentBackendId)})]}),(0,t.jsx)("span",{className:"stale"===n.status?"shrink-0 text-[11px] text-warning":"shrink-0 text-[11px] text-muted-foreground",children:[n.planName,"stale"===n.status?"Stale":null].filter(Boolean).join(" · ")})]}),0===a.length?(0,t.jsx)("div",{className:"rounded-md border border-border/70 px-3 py-2 text-xs text-muted-foreground",children:"Unavailable"}):a.map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-xs text-foreground",children:e.product}),e.model&&(0,t.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:e.model})]}),(0,t.jsx)("div",{className:"flex flex-col divide-y divide-border/60 rounded-md border border-border/70",children:e.limits.map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-1 p-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-foreground",children:e.bucket.window.displayName}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-xs font-medium tabular-nums text-foreground",children:ea(e)})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 text-[11px] text-muted-foreground",children:[(0,t.jsx)("span",{children:function(e){if(!e.resetsAt)return"Reset unavailable";let t=new Date(e.resetsAt);return Number.isNaN(t.getTime())?"Reset unavailable":`Resets ${X.format(t)}`}(e)}),(0,t.jsxs)("span",{className:"shrink-0",children:["Updated ",(0,J.timeAgo)(n.observedAt)]})]})]},et(e)))})]},e.key))]},e.scope.agentBackendId)})]})})]})}var el=e.i(329686),ed=e.i(779646),ec=e.i(996718);let eu=new Intl.NumberFormat(void 0),em=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",timeZone:"UTC"}),ep=["bg-muted-foreground/15","bg-status-online/30","bg-status-online/55","bg-status-online/80","bg-status-online"],eh=[{key:"input",label:"Input"},{key:"output",label:"Output"},{key:"cache",label:"Cache"}];function ex(e){var t;let n=(t=e.day,new Date(`${t}T00:00:00.000Z`));return Number.isNaN(n.getTime())?e.day:em.format(n)}function ef(e){return null===e?"Unavailable":eu.format(e)}function eg(e){let t=Object.values(e.metrics).filter(e=>null!==e);return{knownTotal:t.reduce((e,t)=>e+t,0),unavailable:0===t.length}}function eb({day:e,includeTotal:n=!1}){let a=eg(e);return(0,t.jsxs)("span",{className:"flex min-w-44 flex-col gap-1",children:[(0,t.jsx)("span",{className:"font-medium",children:ex(e)}),n&&(0,t.jsxs)("span",{className:"flex items-center justify-between gap-4 font-medium",children:[(0,t.jsx)("span",{children:"Known total"}),(0,t.jsx)("span",{className:"font-mono tabular-nums",children:a.unavailable?"Unavailable":eu.format(a.knownTotal)})]}),eh.map(n=>(0,t.jsxs)("span",{className:"flex items-center justify-between gap-4",children:[(0,t.jsx)("span",{children:n.label}),(0,t.jsx)("span",{className:"font-mono tabular-nums",children:ef(e.metrics[n.key])})]},n.key))]})}function ey({botId:e,days:n,interactive:a,ariaLabel:i,className:s}){return(0,t.jsx)("span",{role:a?"img":void 0,"aria-label":a?i:void 0,"aria-hidden":!a||void 0,"data-testid":p.tid.botUsage(e),className:["grid w-fit grid-flow-col gap-[3px] [grid-template-rows:repeat(3,minmax(0,1fr))]",s??""].join(" "),children:n.map(n=>{var i;let s=(i=eg(n)).unavailable||i.knownTotal<=0?0:i.knownTotal<1e7?1:i.knownTotal<1e8?2:i.knownTotal<5e8?3:4,r=(0,t.jsx)("span",{"aria-label":a?[ex(n),`Input ${ef(n.metrics.input)}`,`Output ${ef(n.metrics.output)}`,`Cache ${ef(n.metrics.cache)}`].join(". "):void 0,"data-testid":p.tid.botUsageDay(e,n.day),className:["size-3 rounded-[2px]",ep[s]].join(" ")},n.day);return a?(0,t.jsxs)(el.Tooltip,{children:[(0,t.jsx)(el.TooltipTrigger,{render:r}),(0,t.jsx)(el.TooltipContent,{className:"items-start",children:(0,t.jsx)(eb,{day:n})})]},n.day):r})})}function ev({botId:e,usage:n,className:a}){let i=(0,ec.useBreakpoint)(),s=n?.capability==="supported"?n.days.at(-1):void 0,[r,l]=(0,b.useAtom)((0,y.useCreateAtom)(!1)),[d,c]=(0,b.useAtom)((0,y.useCreateAtom)(s?.day??""));if((0,o.useEffect)(()=>{!s||n?.days.some(e=>e.day===d)||c(s.day)},[s,d,c,n]),(0,o.useEffect)(()=>{"mobile"!==i&&l(!1)},[i,l]),!n||"supported"!==n.capability)return null;let u=n.days.reduce((e,t)=>e+eg(t).knownTotal,0),m=`Token usage over the last 30 days: ${eu.format(u)} known tokens total`;if("mobile"===i){let i=n.days.find(e=>e.day===d)??s,o=[...n.days].reverse();return(0,t.jsxs)(ed.Dialog,{open:r,onOpenChange:e=>{e&&s&&c(s.day),l(e)},children:[(0,t.jsx)(ed.DialogTrigger,{render:(0,t.jsx)("button",{type:"button","aria-label":"Open token usage details","aria-haspopup":"dialog","data-testid":p.tid.botUsageTrigger(e),className:["grid min-h-11 place-items-center rounded-md px-1 outline-none active:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a??""].join(" ")}),children:(0,t.jsx)(ey,{botId:e,days:n.days,interactive:!1})}),(0,t.jsxs)(ed.DialogContent,{"data-testid":p.tid.botUsageDialog(e),className:"gap-4",children:[(0,t.jsxs)(ed.DialogHeader,{children:[(0,t.jsx)(ed.DialogTitle,{children:"Token usage"}),(0,t.jsx)(ed.DialogDescription,{children:"Choose a date to view token usage. Known total excludes unavailable values."})]}),(0,t.jsx)("div",{"data-testid":p.tid.botUsageDateRail(e),className:"-mx-1 flex min-w-0 gap-2 overflow-x-auto px-1 pb-1 overscroll-x-contain thin-scrollbar scrollbar-none",children:o.map(n=>{let a=n.day===i?.day;return(0,t.jsx)("button",{type:"button","aria-pressed":a,"data-testid":p.tid.botUsageDialogDay(e,n.day),className:["h-11 shrink-0 whitespace-nowrap rounded-md border px-3 text-sm outline-none active:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a?"border-foreground bg-foreground font-medium text-background":"border-border bg-background text-muted-foreground hover:bg-accent hover:text-foreground"].join(" "),onClick:()=>c(n.day),children:ex(n)},n.day)})}),i&&(0,t.jsx)("div",{"aria-live":"polite","data-testid":p.tid.botUsageDialogSummary(e),className:"border-t pt-4",children:(0,t.jsx)(eb,{day:i,includeTotal:!0})})]})]})}return(0,t.jsx)(ey,{botId:e,days:n.days,interactive:!0,ariaLabel:m,className:a})}var ej=e.i(575695),eN=e.i(962726),ew=e.i(731517);let eC=[{key:"memory",title:"Memory",tile:function({idPrefix:e="ot-memory"}){let n=(0,o.useRef)(null),a=(0,c.tileIds)(e);(0,d.useGSAP)(()=>{let e=n.current;if(!e)return;let t=[".ot-src0",".ot-src1",".ot-src2"].map((t,n)=>{let a=e.querySelector(t);return{g:a,lbl:a.querySelector(".ot-lbl"),base:-90+120*n}}),a=(e,t)=>{let n=t*Math.PI/180,a=100+40*Math.cos(n),i=62+40*Math.sin(n),s=Math.max(0,1-Math.abs(((t- -90)%360+540)%360-180)/60);e.g.setAttribute("transform",`translate(${a.toFixed(2)} ${i.toFixed(2)})`),e.g.style.opacity=(.5+.5*s).toFixed(3)},i={a:0};l.default.set(".ot-dot",{opacity:1}),l.default.set(".ot-lbl",{opacity:0}),t.forEach(e=>a(e,e.base)),(0,u.breathe)(e,".ot-agent",1.02,3.4);let s=l.default.timeline({repeat:-1});for(let e=0;e<3;e++){let n=t[(-e%3+3)%3];s.to(n.lbl,{opacity:1,duration:.3}).to({},{duration:.6}).to(n.lbl,{opacity:0,duration:.25}).to(i,{a:"+=120",duration:.85,ease:"power2.inOut",onUpdate:()=>t.forEach(e=>a(e,e.base+i.a))})}let r=l.default.timeline({repeat:-1,defaults:{ease:u.OT_EASE}});r.to({},{duration:3}).to(".ot-agent",{opacity:.3,duration:.5}),(0,u.goOffline)(r,".ot-dot",112,73,"<"),r.to({},{duration:1.1}).to(".ot-agent",{opacity:1,duration:.5}),(0,u.comeOnline)(r,".ot-dot",112,73,"<"),r.to({},{duration:1.5})},{scope:n});let i=[{cls:"ot-src0",icon:a.book,label:"memory.md"},{cls:"ot-src1",icon:a.layers,label:"experiences"},{cls:"ot-src2",icon:a.clock,label:"timeline"}];return(0,t.jsxs)("svg",{ref:n,viewBox:"0 0 200 130",className:"ot-svg h-full w-full",children:[(0,t.jsx)(c.TileDefs,{idPrefix:e}),(0,t.jsx)("circle",{cx:"100",cy:"62",r:"40",className:"ot-art",opacity:"0.14",strokeDasharray:"2 5"}),(0,t.jsx)("g",{className:"ot-agent ot-center",children:(0,t.jsx)("svg",{x:"83",y:"45",width:"34",height:"34",viewBox:"0 0 36 36",children:(0,t.jsx)("g",{clipPath:`url(#${a.disc})`,children:(0,t.jsx)("use",{href:`#${a.faceA}`})})})}),(0,t.jsxs)("g",{className:"ot-online",children:[(0,t.jsx)("circle",{cx:"112",cy:"73",r:"6",fill:"var(--card)"}),(0,t.jsx)("circle",{cx:"112",cy:"73",r:"4",fill:"var(--muted-foreground)"}),(0,t.jsx)("circle",{className:"ot-dot",cx:"112",cy:"73",r:"4",fill:"var(--status-online)"})]}),i.map(e=>(0,t.jsxs)("g",{className:`ot-src ${e.cls}`,children:[(0,t.jsx)("circle",{className:"ot-pill",cx:"0",cy:"0",r:"12",fill:"var(--muted)"}),(0,t.jsx)("svg",{className:"ot-ic ot-accent",x:"-8",y:"-8",width:"16",height:"16",viewBox:"0 0 24 24",children:(0,t.jsx)("use",{href:`#${e.icon}`})}),(0,t.jsx)("text",{className:"ot-lbl",x:"16",y:"4",textAnchor:"start",fontFamily:"DM Mono, monospace",fontSize:"8.5",fill:"var(--foreground)",opacity:"0",children:e.label})]},e.cls))]})},body:"Your agent has a built-in memory: it writes to memory.md, experiences, and a timeline. These survive a reset and load back on wake."},{key:"workspace",title:"Local workspace",tile:function({idPrefix:e="ot-workspace"}){let n=(0,o.useRef)(null),a=(0,c.tileIds)(e);return(0,d.useGSAP)(()=>{if(!n.current)return;let e=[".ot-f0",".ot-f1",".ot-f2"];l.default.set(e,{opacity:0});let t=l.default.timeline({repeat:-1,defaults:{ease:u.OT_EASE}});e.forEach((e,n)=>{t.fromTo(e,{opacity:0},{opacity:1,duration:.5},0===n?">":"+=0.5")}),t.to({},{duration:1.7}).to(e,{opacity:0,duration:.5,stagger:.08}).to({},{duration:.5})},{scope:n}),(0,t.jsxs)("svg",{ref:n,viewBox:"0 0 200 130",className:"ot-svg h-full w-full",children:[(0,t.jsx)(c.TileDefs,{idPrefix:e}),(0,t.jsx)("rect",{className:"ot-art",x:"20",y:"20",width:"160",height:"100",rx:"9",opacity:"0.9"}),(0,t.jsx)("svg",{x:"29",y:"30",width:"22",height:"22",viewBox:"0 0 36 36",children:(0,t.jsx)("g",{clipPath:`url(#${a.disc})`,children:(0,t.jsx)("use",{href:`#${a.faceA}`})})}),(0,t.jsxs)("g",{className:"ot-oon",children:[(0,t.jsx)("circle",{cx:"48",cy:"49",r:"4",fill:"var(--card)"}),(0,t.jsx)("circle",{cx:"48",cy:"49",r:"2.5",fill:"var(--status-online)"})]}),(0,t.jsx)("text",{x:"60",y:"45",fontFamily:"DM Mono, monospace",fontSize:"10",fill:"var(--foreground)",children:"~/.alook/agent"}),(0,t.jsx)("line",{className:"ot-art",x1:"20",y1:"58",x2:"180",y2:"58",opacity:"0.35"}),[{cls:"ot-f0",ty:"65.5",name:"memory.md"},{cls:"ot-f1",ty:"83.5",name:"work.pdf"},{cls:"ot-f2",ty:"101.5",name:"todo.md"}].map(e=>(0,t.jsxs)("g",{className:`ot-wfile ${e.cls}`,transform:`translate(34.5 ${e.ty})`,children:[(0,t.jsx)("svg",{x:"0",y:"0",width:"11",height:"11",viewBox:"0 0 24 24",className:"ot-accent",children:(0,t.jsx)("use",{href:`#${a.file}`})}),(0,t.jsx)("text",{x:"17",y:"9.5",fontFamily:"DM Mono, monospace",fontSize:"10",fill:"var(--foreground)",children:e.name})]},e.cls))]})},body:"Each agent gets a private folder on your machine. Its files — and the runtime itself — stay local; nothing is uploaded."},{key:"nap",title:"Nap",tile:function({idPrefix:e="ot-nap"}){let n=(0,o.useRef)(null),a=(0,c.tileIds)(e);return(0,d.useGSAP)(()=>{let e=n.current;if(!e)return;let t=e.querySelector(".ot-ring"),a=e.querySelector(".ot-pct");l.default.set(".ot-sleep",{opacity:0,y:4}),l.default.set(".ot-dot",{opacity:1}),l.default.set(t,{attr:{"stroke-dashoffset":188.5}}),a.textContent="context 0%";let i=l.default.to(".ot-agent",{scale:1.03,duration:2,ease:u.OT_EASE,yoyo:!0,repeat:-1,transformOrigin:"center"}),s={v:0},r=()=>{a.textContent="context "+Math.round(s.v)+"%",t.setAttribute("stroke-dashoffset",(188.5*(1-s.v/100)).toFixed(1))},o=l.default.timeline({repeat:-1,defaults:{ease:u.OT_EASE}});o.to(s,{v:100,duration:3.2,ease:"power1.in",onUpdate:()=>{r(),i.timeScale(1-s.v/100*.7)}}).to({},{duration:.5}).to(".ot-agent",{opacity:.32,duration:.5}).to(".ot-sleep",{opacity:.9,y:-6,duration:.9,ease:"power1.out"},"<0.1"),(0,u.goOffline)(o,".ot-dot",112,71,"<"),o.to(s,{v:0,duration:.7,ease:"power2.inOut",onUpdate:r},"<0.1").to(".ot-sleep",{opacity:0,duration:.4}).to(".ot-agent",{opacity:1,duration:.5,onStart:()=>i.timeScale(1)},"+=0.3"),(0,u.comeOnline)(o,".ot-dot",112,71,"<"),o.to({},{duration:1})},{scope:n}),(0,t.jsxs)("svg",{ref:n,viewBox:"0 0 200 130",className:"ot-svg h-full w-full",children:[(0,t.jsx)(c.TileDefs,{idPrefix:e}),(0,t.jsx)("circle",{cx:"100",cy:"60",r:"30",fill:"none",stroke:"var(--muted)",strokeWidth:"5"}),(0,t.jsx)("circle",{className:"ot-ring",cx:"100",cy:"60",r:"30",fill:"none",stroke:"var(--status-online)",strokeWidth:"5",strokeLinecap:"round",transform:"rotate(-90 100 60)",strokeDasharray:"188.5",strokeDashoffset:"188.5"}),(0,t.jsx)("g",{className:"ot-agent ot-center",children:(0,t.jsx)("svg",{x:"83",y:"43",width:"34",height:"34",viewBox:"0 0 36 36",children:(0,t.jsx)("g",{clipPath:`url(#${a.disc})`,children:(0,t.jsx)("use",{href:`#${a.faceA}`})})})}),(0,t.jsxs)("g",{className:"ot-online",children:[(0,t.jsx)("circle",{cx:"112",cy:"71",r:"6",fill:"var(--card)"}),(0,t.jsx)("circle",{cx:"112",cy:"71",r:"4",fill:"var(--muted-foreground)"}),(0,t.jsx)("circle",{className:"ot-dot",cx:"112",cy:"71",r:"4",fill:"var(--status-online)"})]}),(0,t.jsx)("text",{className:"ot-pct",x:"100",y:"106",textAnchor:"middle",fontFamily:"DM Mono, monospace",fontSize:"10",fill:"var(--muted-foreground)",children:"context 0%"}),(0,t.jsxs)("g",{className:"ot-sleep ot-accent ot-center",opacity:"0",children:[(0,t.jsx)("svg",{x:"140",y:"30",width:"20",height:"20",viewBox:"0 0 24 24",children:(0,t.jsx)("use",{href:`#${a.moon}`})}),(0,t.jsx)("text",{x:"163",y:"40",fontFamily:"DM Mono, monospace",fontSize:"12",fill:"currentColor",children:"z"}),(0,t.jsx)("text",{x:"172",y:"32",fontFamily:"DM Mono, monospace",fontSize:"8",fill:"currentColor",children:"z"})]})]})},body:'With time and work, your agent piles up context from every turn. Tell it to "nap" to clear that short-term context and start fresh — it leaves a handoff note first.'}];function ek({open:e,onOpenChange:a}){let[s,r]=(0,b.useAtom)((0,y.useCreateAtom)(0)),o=eC[s],l=o.tile,d=e=>r(t=>(t+e+eC.length)%eC.length);return(0,t.jsx)(ed.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(ed.DialogContent,{showCloseButton:!1,className:"flex w-full max-w-lg flex-col gap-0 overflow-hidden p-0 sm:max-w-lg",children:[(0,t.jsxs)("header",{className:"flex items-start justify-between gap-3 px-5 pt-4 pb-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)(ed.DialogTitle,{className:"text-base font-medium",children:"How your agent works"}),(0,t.jsx)(ed.DialogDescription,{className:"text-xs text-muted-foreground",children:"A few mechanics worth knowing about the agents you own."})]}),(0,t.jsx)(ed.DialogClose,{render:(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-sm","aria-label":"Close",className:"-mr-1 shrink-0 text-muted-foreground hover:text-foreground"}),children:(0,t.jsx)(ew.X,{className:"size-4"})})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 px-5 pb-5",children:[(0,t.jsx)("div",{className:"overflow-hidden rounded-xl bg-muted/40",children:(0,t.jsx)("div",{className:"aspect-200/130 w-full",children:(0,t.jsx)(l,{},o.key)})}),(0,t.jsxs)("div",{className:"flex h-28 flex-col gap-1 text-center",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground",children:o.title}),(0,t.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:o.body})]}),(0,t.jsxs)("div",{className:"mt-1 flex items-center justify-between",children:[(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-sm","aria-label":"Previous",onClick:()=>d(-1),className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(n.ChevronLeft,{className:"size-5"})}),(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:eC.map((e,n)=>(0,t.jsx)("button",{type:"button","aria-label":`Go to ${e.title}`,"aria-current":n===s,onClick:()=>r(n),className:"size-1.5 rounded-full transition-colors "+(n===s?"bg-foreground":"bg-border hover:bg-muted-foreground")},e.key))}),(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-sm","aria-label":"Next",onClick:()=>d(1),className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(eN.ChevronRight,{className:"size-5"})})]})]})]})})}var eA=e.i(86694),eD=e.i(678401),eS=e.i(183866);function eB({event:e}){let n,a,i,s;return(0,t.jsxs)("div",{"data-testid":"bot-activity-row",className:"group grid min-h-11 grid-cols-[64px_56px_minmax(0,1fr)] items-center gap-x-3 px-4 hover:bg-accent/30 sm:min-h-0 sm:items-baseline sm:py-1.5",children:[(0,t.jsx)("time",{dateTime:e.createdAt,title:new Date(e.createdAt).toLocaleString(),className:"font-mono text-[11px] tabular-nums text-muted-foreground/70",children:(a=String((n=new Date(e.createdAt)).getHours()).padStart(2,"0"),i=String(n.getMinutes()).padStart(2,"0"),s=String(n.getSeconds()).padStart(2,"0"),`${a}:${i}:${s}`)}),(0,t.jsx)(e_,{kind:e.kind}),(0,t.jsx)("div",{className:"min-w-0 text-left",children:(0,t.jsx)(eT,{event:e})})]})}function e_({kind:e}){var n;let{label:a,tone:i}="cli_invocation"===(n=e)?{label:"daemon",tone:"text-foreground/70"}:"tool_call"===n?{label:"tool",tone:"text-muted-foreground"}:"turn_interrupt"===n?{label:"stop",tone:"text-foreground/70"}:"wake_trigger"===n?{label:"wake",tone:"text-foreground/70"}:"session_reset"===n?{label:"reset",tone:"text-foreground/70"}:"nap"===n?{label:"nap",tone:"text-foreground/70"}:"model_changed"===n?{label:"model",tone:"text-foreground/70"}:"provider_changed"===n?{label:"provider",tone:"text-foreground/70"}:"error"===n?{label:"err",tone:"text-destructive"}:{label:"think",tone:"text-muted-foreground/70"};return(0,t.jsx)("span",{className:`select-none font-mono text-[10px] font-medium uppercase tracking-wider ${i}`,"aria-label":a,children:a})}function eT({event:e}){if("cli_invocation"===e.kind){let n=(0,eS.formatAlookAuditCommand)(e.payload),a=n.replace(/^alook\s+/,"");return(0,t.jsxs)(eP,{fullText:n,children:["alook ",(0,t.jsx)("span",{className:"text-muted-foreground",children:a})]})}if("tool_call"===e.kind){let n=e.payload,a=(0,eS.formatAuditToolName)(e.payload);return n?.target?(0,t.jsxs)(eP,{fullText:`${a} \xb7 ${n.target}`,children:[a," ",(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"·"})," ",(0,t.jsx)("span",{className:"text-muted-foreground",children:n.target})]}):(0,t.jsx)(eP,{fullText:a,children:a})}if("turn_interrupt"===e.kind)return(0,t.jsxs)(eP,{fullText:"Stop accepted by daemon — waiting for the active turn to become idle.","data-testid":"bot-activity-event-turn_interrupt",children:[(0,t.jsx)("span",{children:"Stop accepted by daemon"})," ",(0,t.jsx)("span",{className:"text-muted-foreground",children:"— waiting for the active turn to become idle."})]});if("session_reset"===e.kind)return(0,t.jsxs)(eP,{fullText:"Session reset requested — the bot will start a fresh session on its next message.","data-testid":"bot-activity-event-session_reset",children:[(0,t.jsx)("span",{children:"Session reset requested"})," ",(0,t.jsx)("span",{className:"text-muted-foreground",children:"— the bot will start a fresh session on its next message."})]});if("nap"===e.kind)return(0,t.jsxs)(eP,{fullText:"Reset its own session — the bot napped and will start fresh on its next message.","data-testid":"bot-activity-event-nap",children:[(0,t.jsx)("span",{children:"Reset its own session"})," ",(0,t.jsx)("span",{className:"text-muted-foreground",children:"— the bot napped and will start fresh on its next message."})]});if("model_changed"===e.kind){let n=e.payload,a=n?.from??"default",i=n?.to??"default";return(0,t.jsxs)(eP,{fullText:`${a} → ${i}`,"data-testid":"bot-activity-event-model_changed",children:[a," ",(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"→"})," ",i]})}if("provider_changed"===e.kind){let n=e.payload,a=n?.from??"?",i=n?.to??"?";return(0,t.jsxs)(eP,{fullText:`${a} → ${i}`,"data-testid":"bot-activity-event-provider_changed",children:[a," ",(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"→"})," ",i]})}if("error"===e.kind){let n=e.payload,a=n?.message||"Something went wrong",i=n?.model?`${n?.code??"error"} \xb7 ${n.model}`:n?.code??n?.scope??"error";return(0,t.jsxs)(eP,{fullText:`${a} \xb7 ${i}`,"data-testid":"bot-activity-event-error",children:[(0,t.jsx)("span",{className:"text-destructive",children:a})," ",(0,t.jsx)("span",{className:"text-muted-foreground/60",children:"·"})," ",(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground/70",children:i})]})}if("wake_trigger"===e.kind){let n=e.payload,a=n?.senderHandle??"Sender unavailable",i=n?.channel??"Conversation unavailable",s=n?.seq!=null?`#${n.seq}`:"",r=n?.reason==="mention"?"Mentioned by":"Woken by",o=`${r} ${a} in ${i}${s?` ${s}`:""}`;return(0,t.jsxs)(eP,{fullText:o,children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:r})," ",a," ",(0,t.jsx)("span",{className:"text-muted-foreground",children:"in"})," ",i,s?(0,t.jsxs)("span",{className:"text-muted-foreground/70",children:[" ",s]}):null]})}let n=e.payload,a=n?.text??"",i=n?.truncated??!1,s=n?.chars??eI(a),r=i?Math.max(0,s-eI(a)):0,o=r>0?`${a}
|
|
2
|
-
… ${r} character${1===r?"":"s"} not retained in the audit log`:a;return(0,t.jsx)(eP,{fullText:o,className:"text-[12.5px] text-muted-foreground",children:a})}function eP({children:e,fullText:n,className:a="",...i}){let s=(0,o.useId)(),r=(0,o.useRef)(null),l=(0,o.useRef)(null),[d,c]=(0,b.useAtom)((0,y.useCreateAtom)(!1)),[u,m]=(0,b.useAtom)((0,y.useCreateAtom)(!1));(0,o.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{let t=e.scrollWidth>e.clientWidth+1;c(t),t||m(!1)};if(t(),"u"<typeof ResizeObserver)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[n,c,m]);let p=(0,t.jsx)("button",{type:"button",disabled:!d,"data-activity-tooltip-trigger":d||void 0,onPointerDown:e=>{l.current=e.pointerType},onClick:()=>{d&&("touch"===l.current||"pen"===l.current)&&m(!0)},className:"block min-h-11 w-full min-w-0 cursor-default rounded-sm text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 sm:min-h-0",children:(0,t.jsx)("span",{ref:r,className:`block truncate font-mono text-[13px] text-foreground ${a}`,...i,children:e})});return(0,t.jsxs)(el.Tooltip,{disabled:!d,open:u&&d,triggerId:s,onOpenChange:m,children:[(0,t.jsx)(el.TooltipTrigger,{id:s,disabled:!d,closeOnClick:!1,render:p}),(0,t.jsx)(el.TooltipContent,{role:"tooltip",side:"bottom",align:"start",className:"thin-scrollbar max-h-[min(24rem,calc(100dvh-2rem))] max-w-[min(32rem,calc(100vw-2rem))] overflow-y-auto whitespace-pre-wrap wrap-break-word font-mono text-[12px] leading-relaxed",children:n})]})}function eI(e){return[...e].length}function eO({bot:e,open:n,onOpenChange:a,onOpenChangeComplete:i}){let s=(0,eA.useCanonicalCommunityProfile)(e?.id),r=s?.presence==="online",{events:l,isLoading:d,fetchNextPage:c,hasNextPage:u,isFetchingNextPage:m}=(0,eD.useBotAuditLog)(e?.id??null),h=(0,o.useMemo)(()=>[...l].sort((e,t)=>e.createdAt!==t.createdAt?e.createdAt<t.createdAt?-1:1:e.id<t.id?-1:+(e.id>t.id)),[l]),x=(0,o.useMemo)(()=>(function(e){let t=[];for(let n of e){let e=function(e){let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}(n.createdAt),a=t[t.length-1];a&&a.dayKey===e?a.events.push(n):t.push({dayKey:e,label:function(e){let t=new Date(e),n=new Date,a=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),i=Math.round((a(n)-a(t))/864e5);return 0===i?"Today":1===i?"Yesterday":i<7?t.toLocaleDateString(void 0,{weekday:"long"}):t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:t.getFullYear()===n.getFullYear()?void 0:"numeric"})}(n.createdAt),events:[n]})}return t})(h),[h]),f=(0,o.useRef)(null),g=(0,o.useRef)(null),b=(0,o.useRef)(0),y=(0,o.useRef)(null),v=(0,o.useRef)(!1);return(0,o.useEffect)(()=>{n||(b.current=0,y.current=null,v.current=!1)},[n,e?.id]),(0,o.useEffect)(()=>{if(!n||v.current||0===h.length)return;let e=g.current,t=f.current;e&&t&&(v.current=!0,b.current=h.length,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.scrollIntoView({block:"end"}),t.scrollTop=t.scrollHeight})}))},[n,h.length]),(0,o.useLayoutEffect)(()=>{let e=f.current;if(!e)return;let t=b.current,n=h.length;if(b.current=n,0===n)return;if(null!==y.current){if(n>t){let t=e.scrollHeight-y.current;e.scrollTop=e.scrollTop+t}y.current=null;return}if(!v.current)return;let a=e.scrollHeight-(e.scrollTop+e.clientHeight)<80;n>t&&a&&(e.scrollTop=e.scrollHeight)},[h.length]),(0,t.jsx)(S.CommunitySheet,{open:n,onOpenChange:a,onOpenChangeComplete:i,title:e?.name??"Bot",headerLeading:(0,t.jsx)(V.AgentAvatar,{name:e?.name??"",avatarUrl:e?.image??null,seed:e?.id,size:32}),description:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:["inline-block size-1.5 rounded-full",r?"bg-status-online":"bg-muted-foreground/60"].join(" "),"aria-hidden":!0}),(0,t.jsx)("span",{children:r?"Live":"Offline"}),(0,t.jsx)("span",{"aria-hidden":!0,className:"text-muted-foreground/40",children:"·"}),(0,t.jsx)("span",{children:"Activity log"})]}),desktopWidth:672,resizable:!0,contentTestId:p.tid.botActivityModal,bodyRef:f,bodyClassName:"bg-background p-0",children:d&&0===h.length?(0,t.jsx)(eR,{}):0===h.length?(0,t.jsx)(eE,{}):(0,t.jsxs)("div",{className:"pb-3",children:[u?(0,t.jsx)("div",{className:"flex justify-center py-2",children:(0,t.jsx)("button",{type:"button",onClick:()=>{if(!u||m)return;let e=f.current;e&&(y.current=e.scrollHeight),c()},disabled:m,className:"min-h-11 rounded-md px-3 py-1 font-mono text-[10px] uppercase tracking-wider text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-60 sm:min-h-8",children:m?"Loading older":"Load older"})}):(0,t.jsx)("div",{className:"py-2 text-center font-mono text-[10px] uppercase tracking-wider text-muted-foreground/40",children:"Beginning of log"}),x.map(e=>(0,t.jsxs)("section",{children:[(0,t.jsx)(eM,{label:e.label}),e.events.map(e=>(0,t.jsx)(eB,{event:e},e.id))]},e.dayKey)),(0,t.jsx)("div",{ref:g,"aria-hidden":!0})]})})}function eM({label:e}){return(0,t.jsx)("div",{className:"sticky top-0 z-10 border-b border-border/40 bg-background/95 px-4 py-1 backdrop-blur supports-backdrop-filter:bg-background/80",children:(0,t.jsx)("span",{className:"font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:e})})}function eR(){return(0,t.jsx)("div",{className:"flex flex-col gap-2 p-4",children:Array.from({length:8}).map((e,n)=>(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"h-3 w-16 animate-pulse rounded bg-muted/40"}),(0,t.jsx)("div",{className:"h-3 w-10 animate-pulse rounded bg-muted/30"}),(0,t.jsx)("div",{className:"h-3 flex-1 animate-pulse rounded bg-muted/40"})]},n))})}function eE(){return(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-8 text-center",children:[(0,t.jsx)("div",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground/60",children:"No activity yet"}),(0,t.jsx)("p",{className:"max-w-xs text-xs text-muted-foreground",children:"This bot hasn't run since audit logging was enabled. New runs will stream in here as they happen."})]})}var e$=e.i(557922),ez=e.i(362790),eF=e.i(328076),eL=e.i(152961),eq=e.i(193497),eK=e.i(562088);let eU=["rate_limited","target_unavailable","nonce_conflict","network_error"],eQ={phase:"confirm",terminal:!1,clientNonce:null,reportId:null,deadlineAt:null,completedAt:null,errorCode:null,objectExpired:!1},eW={offline:"Bring the daemon online, then try again.",timeout:"Collection timed out. Try again.",upload_conflict:"The report could not be uploaded safely. Try again.",invalid_upload:"The report upload was rejected. Try again.",diagnostics_unavailable:"Diagnostics are unavailable right now. Try again.",collector_busy:"Another report is being collected. Try again shortly.",bot_not_bound:"This bot is no longer available on that machine.",collection_failed:"Diagnostics could not be collected. Try again.",local_artifact_invalid:"The local diagnostic bundle could not be verified.",bundle_too_large:"The diagnostic bundle was too large to upload.",upload_failed:"The report upload failed. Try again.",internal_error:"The report could not be completed. Try again.",rate_limited:"You can send another report in a minute.",target_unavailable:"Diagnostics aren't available for this bot right now.",nonce_conflict:"That report already belongs to another bot. Try again.",network_error:"Unable to connect — check your network"};function eH(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function eV(e){return eK.DiagnosticReportFailureCodeSchema.safeParse(e).success}function eY(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function eG(e,t){let n={...e,reportId:t.reportId,deadlineAt:t.deadlineAt,completedAt:t.completedAt,errorCode:t.failureCode,objectExpired:t.objectExpired};return"pending"===t.status?{...n,phase:"collecting",terminal:!1}:"uploaded"===t.status?{...n,phase:"uploaded",terminal:!0}:{...n,phase:"timeout"===t.failureCode?"timeout":"failed",terminal:!0}}function eJ(e,t){if("created"===t.type||"status"===t.type)return eG(e,t.report);if("create_error"===t.type)return{...e,phase:"failed",terminal:!1,errorCode:"internal_error"};if("create_rejected"===t.type){var n;return{...e,phase:"failed",terminal:"rate_limited"===(n=t.code)||"nonce_conflict"===n,errorCode:t.code}}return"invalid_payload"===t.type?{...e,phase:"failed",terminal:!0,errorCode:"internal_error"}:"deadline"===t.type?{...e,phase:"timeout",terminal:!0,errorCode:"timeout"}:e}function eX(e){var t;return eH(e)?eH(t=e.report)&&"string"==typeof t.reportId&&t.reportId.startsWith("dbr_")&&("pending"===t.status||"uploaded"===t.status||"failed"===t.status)&&eY(t.deadlineAt)&&"boolean"==typeof t.objectExpired&&(null===t.completedAt||void 0===t.completedAt||eY(t.completedAt))&&(null===t.failureCode||void 0===t.failureCode||eV(t.failureCode))&&("failed"!==t.status||eV(t.failureCode))&&("failed"===t.status||null===t.failureCode||void 0===t.failureCode)?{reportId:t.reportId,status:t.status,deadlineAt:t.deadlineAt,completedAt:t.completedAt??null,failureCode:t.failureCode??null,objectExpired:t.objectExpired}:null:null}class eZ extends Error{}function e0({reportId:e}){let[n,a]=(0,b.useAtom)((0,y.useCreateAtom)("idle")),s=async()=>{try{await navigator.clipboard.writeText(e),a("copied")}catch{a("failed")}};return(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:"Report ID"}),(0,t.jsx)("code",{className:"font-mono text-xs text-muted-foreground",children:e}),(0,t.jsx)(i.Button,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs","aria-label":"Copy report ID",onClick:()=>void s(),children:"Copy"}),"copied"===n&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Copied"}),"failed"===n&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Couldn’t copy. Select the ID instead."})]})}function e1(e){var n,a,s,r,o;let l="confirm"!==e.phase&&"submitting"!==e.phase,d="failed"===e.phase||"timeout"===e.phase?"Try again":e.isSubmitting?"Submitting…":"Confirm",c="collecting"!==e.phase&&"uploaded"!==e.phase&&("failed"!==e.phase||"rate_limited"!==e.errorCode);return(0,t.jsx)(ej.AlertDialog,{open:e.open,onOpenChange:e.onOpenChange,children:(0,t.jsxs)(ej.AlertDialogContent,{"data-testid":p.tid.botReportProblemDialog,children:[(0,t.jsxs)(ej.AlertDialogHeader,{children:[(0,t.jsxs)(ej.AlertDialogTitle,{children:["Report a problem with ",e.bot.name,"?"]}),(0,t.jsxs)(ej.AlertDialogDescription,{className:"space-y-3 text-left",children:[(0,t.jsx)("span",{className:"block",children:"We’ll upload only program logs needed to diagnose the problem."}),(0,t.jsx)("span",{className:"block",children:"We won’t read or upload your agent’s local chat history or files."}),(0,t.jsx)("span",{className:"block",children:"Reports are deleted after 7 days."})]})]}),l&&(0,t.jsxs)("div",{"data-testid":p.tid.botReportProblemStatus,className:"rounded-md bg-muted/60 px-3 py-2 text-sm",children:[(0,t.jsx)("p",{className:"font-medium text-foreground",children:(n=e.phase,a=e.errorCode,"failed"===n&&"rate_limited"===a?"A report was sent recently":"collecting"===n?"Collecting diagnostics":"uploaded"===n?"Report uploaded":"timeout"===n?"Collection timed out":"Report failed")}),"failed"===e.phase&&(0,t.jsx)("p",{className:"mt-1 text-muted-foreground",children:"string"==typeof(o=r=s=e.errorCode)&&eU.includes(o)||eV(r)?eW[s]:eW.internal_error}),e.reportId&&(0,t.jsx)(e0,{reportId:e.reportId},e.reportId)]}),(0,t.jsxs)(ej.AlertDialogFooter,{children:[(0,t.jsx)(ej.AlertDialogCancel,{children:"Close"}),c&&(0,t.jsx)(i.Button,{"data-testid":p.tid.botReportProblemSubmit,disabled:e.isSubmitting,onClick:()=>void e.onConfirm(),children:d})]})]})})}function e2({bot:e,open:n,onOpenChange:a}){let{state:i,confirm:s}=function({agentId:e,open:t}){let n=(0,eq.useCommunityMutationOrigin)(),a=(0,v.useQueryClient)(),i=(0,w.useCommunityViewSource)(`bug-report:${e}`),s=(0,eF.useCreateStore)({nonce:null,expiredReportId:null}),r=(0,eL.useSelector)(s,e=>e),l=["community","bug-report-create",e],d=(0,ez.useMutation)({meta:{observabilityAction:"bot.bug_report.submit"},mutationKey:l,mutationFn:async({nonce:t,token:i,assert:s})=>{s();let r={path:`/api/community/bots/${e}/diagnostics`,init:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientNonce:t})}},o=await n.request(i,r.path,{...r.init,signal:s.signal,assertActive:s});s();let l=eX(o);if(!l)throw new eZ("Invalid diagnostics response");let d=j.communityKeys.bugReport(l.reportId),c=a.getQueryCache().build(a,{queryKey:d,gcTime:3e5});return c.state.data||c.setData(l),n.assert(i),{nonce:t,reportId:l.reportId}}}),c=d.reset,u=d.data?.nonce===r.nonce?d.data.reportId:null,m=t&&!!u&&r.expiredReportId!==u,p=(0,e$.useQuery)({queryKey:j.communityKeys.bugReport(u??"inactive"),subscribed:m,gcTime:3e5,enabled:e=>m&&e.state.data?.status==="pending"&&Date.now()<e.state.data.deadlineAt&&!(e.state.error instanceof eZ),retry:!1,queryFn:async({signal:e})=>{let t=n.begin().token,a={path:`/api/community/diagnostics/${u}`,init:{method:"GET"}},i=await n.request(t,a.path,{...a.init,signal:e});n.assert(t);let s=eX(i);if(!s)throw new eZ("Invalid diagnostics response");return s},refetchInterval:e=>{let t=e.state.data;return!!(m&&!(e.state.error instanceof eZ)&&t?.status==="pending"&&Date.now()<t.deadlineAt)&&1e3}}),h={...eQ,clientNonce:r.nonce};d.variables?.nonce===r.nonce&&(d.isPending?h={...h,phase:"submitting"}:d.error&&!(d.error instanceof DOMException&&"AbortError"===d.error.name)&&(h=eJ(h,d.error instanceof eZ?{type:"invalid_payload"}:function(e){if(e instanceof N.ApiError){if(e.isNetworkError||0===e.status)return{type:"create_rejected",code:"network_error"};if(e.isRateLimit)return{type:"create_rejected",code:"rate_limited"};if(404===e.status)return{type:"create_rejected",code:"target_unavailable"};if(409===e.status)return{type:"create_rejected",code:"nonce_conflict"}}return{type:"create_error"}}(d.error)))),p.data&&p.data.reportId===u&&(h=eG(h,p.data)),p.error instanceof eZ&&(h=eJ(h,{type:"invalid_payload"})),r.expiredReportId===u&&"collecting"===h.phase&&(h=eJ(h,{type:"deadline"})),(0,o.useEffect)(()=>{let e=p.data;if(!t||!e||"pending"!==e.status)return;let n=i.capture(),a=()=>{try{n()}catch{return}s.setState(t=>({...t,expiredReportId:e.reportId}))},r=e.deadlineAt-Date.now();if(r<=0)return void a();let o=setTimeout(a,r);return()=>clearTimeout(o)},[t,p.data,i,s]),(0,o.useEffect)(()=>{!t&&h.terminal&&(s.setState(()=>({nonce:null,expiredReportId:null})),c())},[t,h.terminal,s,c]);let x=async()=>{if("submitting"!==h.phase&&"collecting"!==h.phase&&!a.getMutationCache().findAll({mutationKey:l,status:"pending"}).length)try{let e=i.capture(),t=n.begin().token;e();let a=function(e,t=()=>globalThis.crypto.randomUUID()){return"submitting"===e.phase||"collecting"===e.phase?e:!e.terminal&&e.clientNonce?{...e,phase:"submitting",errorCode:null}:{...eQ,phase:"submitting",clientNonce:t()}}({...h,clientNonce:s.get().nonce});if(!a.clientNonce)return;s.setState(()=>({nonce:a.clientNonce,expiredReportId:null})),await d.mutateAsync({nonce:a.clientNonce,token:t,assert:e})}catch{}};return{state:h,confirm:x}}({agentId:e.id,open:n});return(0,t.jsx)(e1,{bot:e,open:n,phase:i.phase,isSubmitting:"submitting"===i.phase,reportId:i.reportId,errorCode:i.errorCode,onConfirm:s,onOpenChange:a})}function e5(e){return void 0!==e.phase?(0,t.jsx)(e1,{...e}):(0,t.jsx)(e2,{...e})}var e3=e.i(540604),e4=e.i(909832);function e6(e){return(0,e3.isPhotoAvatarUrl)(e.image)?{kind:"photo",file:null,previewUrl:e.image}:{kind:"procedural",image:(0,_.parseBeamSeed)(e.image)?e.image:(0,_.serializeBeamSeed)(e.id)}}function e8({bot:e,open:n,onOpenChange:a}){let s=(0,w.useCommunityViewSource)("edit-bot:"+(e?.id??"none"),n&&!!e),r=(0,v.useQueryClient)(),l=e=>{e||s.retire(),a(e)},[d,c]=(0,b.useAtom)((0,y.useCreateAtom)(e?.name??"")),[u,m]=(0,b.useAtom)((0,y.useCreateAtom)(e?.description??"")),[p,h]=(0,b.useAtom)((0,y.useCreateAtom)(e?.modelName??null)),[x,f]=(0,b.useAtom)((0,y.useCreateAtom)(e?.reasoningEffort??null)),[A,D]=(0,b.useAtom)((0,y.useCreateAtom)(e?.runtime??"")),[B,T]=(0,b.useAtom)((0,y.useCreateAtom)(!1)),[P,E]=(0,b.useAtom)((0,y.useCreateAtom)(void 0)),[$,F]=(0,b.useAtom)((0,y.useCreateAtom)(e?e6(e):{kind:"procedural",image:(0,_.serializeBeamSeed)("initial")})),L=(0,O.useUpdateBot)(),q=(0,O.useUploadBotAvatar)(),{machines:K}=(0,I.useMachines)(),U=K.find(t=>t.id===e?.machineId),Q=(0,o.useMemo)(()=>{let e=z(U);return A&&!e.some(e=>e.id===A)&&e.push({id:A,unhealthy:!0}),e},[U,A]),W=(0,o.useMemo)(()=>({scope:[s.signal],store:(0,g.createStore)(!1)}),[s.signal]).store;async function H(){if(!e||["update-command","avatar-command"].some(e=>r.isMutating({mutationKey:[...j.communityKeys.bots(),e],exact:!0,predicate:e=>e.state.variables.input?.assertActive?.signal===s.signal})>0))return;let t=s.capture();if(t(),!d.trim())return void E("Name is required");let n=function(e){if(null!==e){if(0===e.trim().length)return"Enter a model name";if(e.length>100)return"Model name must be 100 characters or fewer"}}(p);if(n)return void C.toast.error(n);let a=p!==(e.modelName??null),i=A!==e.runtime,o=x!==(e.reasoningEffort??null);try{let n=await L.mutateAsync({assertActive:t,id:e.id,name:d.trim(),description:u.trim(),image:"procedural"===$.kind?$.image:void 0,...a?{model:p}:{},...i?{runtime:A}:{},...o?{reasoningEffort:x}:{}});t();let s=!1;if("photo"===$.kind&&$.file)try{await q.mutateAsync({botId:e.id,file:$.file,assertActive:t}),t()}catch(e){try{t()}catch{return}if((0,N.isAbortError)(e))return;s=!0,(0,k.toastApiError)(e,"Bot updated, but the avatar photo failed to upload",t)}if(!s)if((i||a)&&"saved_not_applied"===n.application)C.toast.success("Runtime settings saved for next start.");else if(i)C.toast.success(`Provider switch to ${A} dispatched`);else if(a){let e=p??"the runtime default";C.toast.success(`Model switch to ${e} dispatched`)}else o?C.toast.success("next_turn"===n.application?"Reasoning effort saved. Next turn takes effect.":"Reasoning effort saved for next start."):C.toast.success("Bot updated");t(),l(!1)}catch(e){if((0,N.isAbortError)(e))return;(0,k.toastApiError)(e,"Update failed",t)}}function V(){if(e){if(!d.trim())return void E("Name is required");if(A!==e.runtime)return void T(!0);H()}}return(0,o.useEffect)(()=>{n&&e&&(W.get()||(W.setState(()=>!0),c(e.name),m(e.description??""),h(e.modelName??null),f(e.reasoningEffort??null),D(e.runtime),F(e6(e)),E(void 0),T(!1)))},[n,e,W,c,m,h,f,D,F,E,T]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(S.CommunitySheet,{open:n,onOpenChange:l,title:`Edit ${e?.name??"bot"}`,description:"Name and description edits take effect on the next wake. Reasoning effort applies on the next turn when online, or the next start when offline. Provider and model switches require the bot to be online.",bodyClassName:"flex flex-col gap-6",footer:n=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:n,children:"Cancel"}),(0,t.jsx)(i.Button,{onClick:V,disabled:L.isPending||q.isPending||!e,children:L.isPending?"Saving…":"Save"})]}),children:[(0,t.jsx)(M.BotFormFields,{avatarDraft:$,onAvatarChange:F,name:d,setName:function(e){c(e),P&&e.trim()&&E(void 0)},onShuffle:function(){c((0,e4.uniqueNamesGenerator)({dictionaries:[e4.names],length:1,style:"capital"})),E(void 0)},description:u,setDescription:m,nameError:P}),e&&(0,t.jsx)(R.BotRuntimeFields,{options:Q,runtime:A,model:p,daemonVersion:U?.daemonVersion,reasoningEffort:x,onRuntimeChange:D,onModelChange:h,onReasoningEffortChange:f})]}),(0,t.jsx)(ej.AlertDialog,{open:B,onOpenChange:T,children:(0,t.jsxs)(ej.AlertDialogContent,{children:[(0,t.jsxs)(ej.AlertDialogHeader,{children:[(0,t.jsx)(ej.AlertDialogTitle,{children:"Switch provider and reset this session?"}),(0,t.jsxs)(ej.AlertDialogDescription,{children:["Switching from ",e?.runtime," to ",A," starts a fresh session. The bot cannot resume its current provider session."]})]}),(0,t.jsxs)(ej.AlertDialogFooter,{children:[(0,t.jsx)(ej.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(ej.AlertDialogAction,{onClick:()=>{T(!1),H()},children:"Switch provider"})]})]})})]})}var e7=e.i(166037),e9=e.i(820655),te=e.i(49980);function tt({count:e,className:n}){let a=e<=10?5:10,i=Math.max(1,Math.ceil(e/a)),s=Math.max(32,8*i),r=(80-(Math.min(e,a)-1)*8)/2,o=(s-(i-1)*8)/2;return(0,t.jsx)("svg",{className:n,viewBox:`0 0 80 ${s}`,role:"img","aria-label":`${e} bot slots`,children:Array.from({length:e},(e,n)=>(0,t.jsx)("circle",{cx:r+n%a*8,cy:o+8*Math.floor(n/a),r:"1.5",fill:"currentColor"},n))})}var tn=e.i(989621),ta=e.i(205189);function ti(e){let t=e.currency.toUpperCase(),n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??2,a=new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(e.unitAmount/10**n),i=1===e.intervalCount?e.interval:`${e.intervalCount} ${e.interval}s`;return`${a} ${t} / ${i}`}function ts(e){return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric"}).format(new Date(e))}function tr({open:e,onOpenChange:n,limit:a,onViewPlan:s}){return(0,t.jsx)(ed.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(ed.DialogContent,{className:"sm:max-w-md","data-testid":"upgrade-plan-modal",children:[(0,t.jsxs)(ed.DialogHeader,{children:[(0,t.jsx)(ed.DialogTitle,{children:"Plan limit reached"}),(0,t.jsxs)(ed.DialogDescription,{children:["Your owned bots have reached your plan’s limit of ",a,". You can’t create another bot. Delete bots until you own fewer than ",a," to make room."]})]}),(0,t.jsxs)(ed.DialogFooter,{children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:()=>n(!1),children:"Got it"}),(0,t.jsx)(i.Button,{onClick:()=>{n(!1),s()},children:"View plan"})]})]})})}function to(){return(0,t.jsx)(s.Card,{className:"flex flex-col gap-3 p-4",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsx)(r.Skeleton,{className:"size-10 shrink-0 rounded-full"}),(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2.5 sm:items-end",children:(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1 sm:min-w-55",children:[(0,t.jsx)(r.Skeleton,{className:"h-6 w-40 max-w-full rounded"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-48 max-w-full rounded"})]})}),(0,t.jsx)(r.Skeleton,{className:"size-8 shrink-0 rounded-md"})]})})}function tl(e,a=!1){return e||a?(0,t.jsxs)("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b border-border/40 px-6",children:[e?(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-sm",onClick:e,className:"text-muted-foreground hover:text-foreground","aria-label":"Back",children:(0,t.jsx)(n.ChevronLeft,{className:"size-5"})}):(0,t.jsx)(r.Skeleton,{"data-slot":"loading-back-placeholder","aria-hidden":!0,className:"size-8 shrink-0 rounded-md"}),(0,t.jsx)("span",{className:"ml-1 truncate text-base font-semibold",children:"My Bots"})]}):null}function td({onBack:e,reserveBackSlot:n=!1}={}){return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[tl(void 0,n||!!e),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-6 overflow-y-auto p-6 thin-scrollbar",children:[(0,t.jsxs)("header",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,t.jsx)(r.Skeleton,{className:"h-6 w-24 rounded"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-full max-w-80 rounded"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(r.Skeleton,{className:"size-9 rounded-md"}),(0,t.jsx)(r.Skeleton,{className:"h-9 w-28 rounded-md"})]})]}),(0,t.jsx)("div",{className:"flex flex-col gap-6",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg p-1",children:[(0,t.jsxs)("div",{className:"flex h-7 items-center gap-2 px-1",children:[(0,t.jsx)(r.Skeleton,{className:"size-3 rounded"}),(0,t.jsx)(r.Skeleton,{className:"size-3.5 rounded"}),(0,t.jsx)(r.Skeleton,{className:"h-3 w-28 rounded"}),(0,t.jsx)(r.Skeleton,{className:"size-1.5 rounded-full"}),(0,t.jsx)(r.Skeleton,{className:"ml-auto h-7 w-20 rounded-md"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(to,{}),(0,t.jsx)(to,{}),(0,t.jsx)(to,{})]})]})})]})]})}e.s(["BillingContent",0,function({billing:e}){let[n,a]=(0,b.useAtom)((0,y.useCreateAtom)(null)),s=e=>a(e?.priceId??null),o=e.data,l=o?.offers.find(e=>e.priceId===n)??null,d=o?.isFounder?null:o?.subscription,c=o?.offers.find(e=>e.plan.id===o.plan.id),u="checkout"===e.returnFrom&&(o?.isFounder||!d||d.plan.id!==o?.plan.id);return(0,t.jsxs)("div",{className:tn.default.content,"data-testid":p.tid.billingSheet,children:[(0,t.jsxs)("section",{className:"pb-2","aria-label":"Current plan",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[e.isPending&&(0,t.jsx)(r.Skeleton,{className:"h-14 w-36","aria-label":"Loading billing"}),o&&(0,t.jsxs)("div",{className:"flex flex-wrap items-start gap-2",children:[(0,t.jsx)("h2",{className:tn.default.currentName,children:o.isFounder?"Founder":o.plan.displayName}),(0,t.jsx)("span",{className:"mt-1 rounded-md bg-muted px-2 py-1 text-xs font-medium leading-none text-muted-foreground",children:"Current"})]})]}),(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-sm",className:"size-11 shrink-0 text-muted-foreground sm:size-8",onClick:e.refresh,disabled:e.isFetching,"aria-label":"Refresh status","data-testid":p.tid.billingRefresh,children:(0,t.jsx)(te.RefreshCw,{className:`size-4 ${e.isFetching?"animate-spin motion-reduce:animate-none":""}`})})]}),o&&(0,t.jsxs)(t.Fragment,{children:[(o.isFounder||c||d)&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-3",children:[o.isFounder?(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Permanent ",o.plan.displayName," access"]}):c&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:ti(c)}),d&&!o.isFounder&&(0,t.jsxs)(i.Button,{variant:"outline",onClick:()=>void e.portal(),disabled:e.isBusy,"data-testid":p.tid.billingPortal,children:["Manage billing",(0,t.jsx)(e9.ExternalLink,{className:"size-3.5"})]})]}),(d?.scheduledChange||d?.cancelAt||d?.currentPeriodEnd||d?.status==="past_due")&&(0,t.jsxs)("div",{className:"mt-5 flex flex-col gap-3 border-t border-border pt-4 text-sm",children:[d?.scheduledChange&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("p",{children:["Changes to ",d.scheduledChange.plan.displayName," on ",ts(d.scheduledChange.effectiveAt)]}),!o.isFounder&&(0,t.jsx)(i.Button,{variant:"outline",size:"sm",onClick:()=>void e.cancelChange(),disabled:e.isBusy,"data-testid":p.tid.billingCancelChange,children:e.isCancelingChange?"Keeping current plan…":"Keep current plan"})]}),d?.cancelAt&&(0,t.jsxs)("p",{children:["Ends ",ts(d.cancelAt),". Your current access stays until then."]}),d&&!d.cancelAt&&!d.scheduledChange&&d.currentPeriodEnd&&(0,t.jsxs)("p",{className:"text-muted-foreground",children:["Current period ends ",ts(d.currentPeriodEnd)]}),d?.status==="past_due"&&(0,t.jsx)("p",{children:"Your renewal payment needs attention. Update your payment method in billing management."})]})]})]}),e.isError&&(0,t.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:"Couldn't refresh your plan. Check your connection and refresh status."}),e.returnFrom&&(0,t.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"cancel"===e.returnFrom?"Checkout closed. Your current plan is shown above.":u?e.polling?"Waiting for payment confirmation. Your current access stays in place.":"Payment confirmation hasn't arrived yet. Refresh status to check again.":e.polling?"Refreshing your plan and billing status…":"Your current plan is shown above. Refresh status to check for further changes."}),o&&(0,t.jsxs)("section",{className:"flex flex-col gap-4","aria-label":"Available plans",children:[(0,t.jsx)("h2",{className:"text-base font-medium",children:d?"Change plan":"Choose a plan"}),0===o.offers.length&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Paid plans are unavailable right now. Refresh status to try again."}),(0,t.jsx)("div",{className:tn.default.offers,children:o.offers.map(n=>{let a=!!(d&&n.plan.id===o.plan.id),r=d?.scheduledChange?.plan.id===n.plan.id;return(0,t.jsxs)("article",{className:`${tn.default.offer} ${"house"===n.plan.id?tn.default.house:tn.default.studio}`,children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:tn.default.name,children:n.plan.displayName}),(0,t.jsx)("p",{className:tn.default.price,children:ti(n)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("p",{className:tn.default.limit,children:["Up to ",(0,t.jsx)("strong",{children:n.botLimit})," active bots"]}),(0,t.jsxs)("p",{className:tn.default.limit,children:["Up to ",(0,t.jsx)("strong",{children:n.machineLimit})," online machine",1===n.machineLimit?"":"s"]})]}),(0,t.jsx)(i.Button,{className:tn.default.action,variant:a||r?"outline":"default",onClick:()=>(t=>{if(!o)return;let n=(0,ta.toAnalyticsPlanId)(t.plan.id);n&&"free"!==n&&(0,ta.trackPricingCtaClick)({plan_id:n,cta_action:"choose_plan",auth_state:"signed_in",current_plan:(0,ta.toAnalyticsCurrentPlan)(o.plan.id,o.isFounder),entry_point:"billing_sheet"}),o.isFounder?s(t):d?e.portal(t.priceId):e.checkout(t.priceId,!1,"billing_sheet")})(n),disabled:e.isBusy||!!u||a||r,"data-testid":d?p.tid.billingChangePlan:p.tid.billingCheckout,"data-price-id":n.priceId,children:e.isBusy&&!e.isCancelingChange?"Opening…":r?"Scheduled":a?"Current plan":`Choose ${n.plan.displayName}`}),(0,t.jsxs)("div",{className:tn.default.stub,children:[(0,t.jsxs)("span",{children:["Alook · ",n.botLimit," bots"]}),(0,t.jsx)(tt,{count:n.botLimit,className:tn.default.botDots})]})]},n.priceId)})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:d?"Review changes and any payment on Stripe.":"Continue to Stripe to review and pay."})]}),(0,t.jsx)(e7.FounderPlanChangeDialog,{offer:l,busy:e.isBusy,onCancel:()=>s(null),onConfirm:()=>{if(!l)return;let t=l.priceId;s(null),e.checkout(t,!0,"billing_sheet")}}),e.actionError&&(0,t.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:e.actionError})]})},"BillingSheet",0,tr],690887),e.s(["BotListSkeleton",0,td,"renderBotListView",0,function({onBack:e},n){let r=tl(e);if((n.isLoading||n.machinesLoading)&&0===n.bots.length)return(0,t.jsx)(td,{onBack:e});if(0===n.bots.length){let e=0===n.machines.length;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[r,(0,t.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-12 text-center",children:[(0,t.jsx)("div",{className:"w-full max-w-70 overflow-hidden rounded-xl",children:(0,t.jsx)("div",{className:"aspect-200/130 w-full",children:(0,t.jsx)(m,{})})}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"text-lg font-medium text-foreground",children:e?"Connect a machine first":"No bots yet"}),(0,t.jsx)("p",{className:"max-w-md text-sm text-muted-foreground",children:e?"Bots need a connected machine to run. Connect one first, then come back to create your bot.":"Create a bot and chat with it from anywhere — spin up servers and share it with family and friends."})]}),(0,t.jsx)("div",{"data-onboarding-target":"create-bot",className:"w-fit",children:(0,t.jsx)(i.Button,{onClick:e?n.openMachines:n.openGuidedCreate,disabled:!e&&n.isCreateDisabled&&!n.canShowLimit,"data-testid":e?void 0:p.tid.createBot,children:e?"Connect a machine":n.guidedCreateLabel})}),n.planSummary?.isFounder&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Founder plan"})]}),(0,t.jsx)(L,{open:n.createOpen,onOpenChange:n.setCreateOpen,onCreated:n.onBotCreated,guided:n.guidedActive,avatarSeed:n.guidedAvatarSeed}),(0,t.jsx)(tr,{open:n.billingOpen&&n.canShowLimit,onOpenChange:n.setBillingOpen,limit:n.planSummary?.limit??0,onViewPlan:n.viewPlan})]})}let o={billing:(0,t.jsx)(tr,{open:n.billingOpen&&n.canShowLimit,onOpenChange:n.setBillingOpen,limit:n.planSummary?.limit??0,onViewPlan:n.viewPlan}),create:(0,t.jsx)(L,{open:n.createOpen,onOpenChange:n.setCreateOpen,onCreated:n.onBotCreated,guided:n.guidedActive,avatarSeed:n.guidedAvatarSeed}),help:(0,t.jsx)(ek,{open:n.helpOpen,onOpenChange:n.setHelpOpen}),edit:(0,t.jsx)(e8,{bot:n.editingBot,open:n.editOpen,onOpenChange:n.setEditOpen}),activity:(0,t.jsx)(eO,{bot:n.activityBot,open:n.activityOpen,onOpenChange:n.onActivityOpenChange,onOpenChangeComplete:e=>n.onActivityOpenChangeComplete(e,n.activityGeneration)},n.activityGeneration),bug:n.bugReportBot?(0,t.jsx)(e5,{bot:n.bugReportBot,open:n.bugReportOpen,onOpenChange:n.setBugReportOpen},n.bugReportBot.id):null,deleteDialog:(0,t.jsx)(ej.AlertDialog,{open:!!n.confirmDelete,onOpenChange:e=>!e&&n.setConfirmDelete(null),children:(0,t.jsxs)(ej.AlertDialogContent,{children:[(0,t.jsxs)(ej.AlertDialogHeader,{children:[(0,t.jsxs)(ej.AlertDialogTitle,{children:["Delete ",n.confirmDelete?.name,"?"]}),(0,t.jsx)(ej.AlertDialogDescription,{children:"The bot will leave every server it's in and its runner key will be revoked. Past messages remain in history with the bot's current name and avatar."})]}),(0,t.jsxs)(ej.AlertDialogFooter,{children:[(0,t.jsx)(ej.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(ej.AlertDialogAction,{onClick:n.deleteConfirmedBot,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),resetDialog:(0,t.jsx)(ej.AlertDialog,{open:!!n.confirmReset,onOpenChange:e=>!e&&n.setConfirmReset(null),children:(0,t.jsxs)(ej.AlertDialogContent,{children:[(0,t.jsxs)(ej.AlertDialogHeader,{children:[(0,t.jsx)(ej.AlertDialogTitle,{children:"Reset this bot's session?"}),(0,t.jsx)(ej.AlertDialogDescription,{children:"Its running process will stop and it'll start a fresh session that picks up unfinished work from its notes."})]}),(0,t.jsxs)(ej.AlertDialogFooter,{children:[(0,t.jsx)(ej.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(ej.AlertDialogAction,{"data-testid":"bot-reset-confirm",onClick:n.resetConfirmedBot,children:"Reset"})]})]})}),resetMachineDialog:(0,t.jsx)(ej.AlertDialog,{open:!!n.confirmResetMachine,onOpenChange:e=>!e&&n.setConfirmResetMachine(null),children:(0,t.jsxs)(ej.AlertDialogContent,{children:[(0,t.jsxs)(ej.AlertDialogHeader,{children:[(0,t.jsxs)(ej.AlertDialogTitle,{children:["Reset all agents on ",n.confirmResetMachine?n.machineName(n.confirmResetMachine):"this machine","?"]}),(0,t.jsx)(ej.AlertDialogDescription,{children:"Every agent on this machine will start a fresh session. Any that aren't currently running will be woken too."})]}),(0,t.jsxs)(ej.AlertDialogFooter,{children:[(0,t.jsx)(ej.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(ej.AlertDialogAction,{"data-testid":"machine-reset-all-confirm",onClick:n.resetConfirmedMachine,children:"Reset all"})]})]})})};return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[r,(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-6 overflow-y-auto thin-scrollbar p-6",children:[(0,t.jsxs)("header",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h1",{className:"text-xl font-medium text-foreground",children:"My Bots"}),(0,t.jsx)(f,{onViewPlan:n.viewPlan,summary:n.planSummary,isFounder:n.planSummary?.isFounder})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(i.Button,{variant:"ghost",size:"icon","aria-label":"How your agent works",onClick:()=>n.setHelpOpen(!0),className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(a.default,{className:"size-5"})}),(0,t.jsx)("div",{"data-onboarding-target":"create-bot",className:"w-fit",children:(0,t.jsx)(i.Button,{onClick:n.openGuidedCreate,disabled:n.isCreateDisabled&&!n.canShowLimit,"data-testid":p.tid.createBot,title:n.isCreateDisabled?"Bot limit reached. Delete a bot or change plan to create another.":void 0,children:n.guidedCreateLabel})})]})]}),(0,t.jsx)("div",{className:"flex flex-col gap-6",children:n.groups.map(e=>(function({machineId:e,machine:n,bots:a},r){let o=(0,A.isPresenceOnline)(n?.status),l=r.collapsedMachines.has(e),d=r.machineName(e);return(0,t.jsxs)("div",{ref:t=>{r.groupRefs.current[e]=t},className:["flex flex-col gap-3 rounded-lg p-1 transition-colors duration-500",r.highlightId===e?"bg-primary/5 ring-2 ring-primary/40":""].join(" "),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 items-center gap-2 rounded-md text-left focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none","aria-expanded":!l,"aria-label":`${l?"Expand":"Collapse"} ${d}`,onClick:()=>{r.setCollapsedMachines(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},children:[(0,t.jsx)(K.ChevronDown,{className:`size-3 shrink-0 text-muted-foreground transition-transform ${l?"-rotate-90":""}`}),(0,t.jsx)(U.Monitor,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs font-medium text-muted-foreground",children:d}),(0,t.jsx)("span",{className:["inline-block size-1.5 shrink-0 rounded-full",o?"bg-status-online":"bg-muted-foreground"].join(" ")})]}),(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"ml-auto h-7 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>r.setConfirmResetMachine(e),children:[(0,t.jsx)(W.RotateCcw,{className:"size-3.5"}),"Reset all"]})]}),(0,t.jsx)("div",{className:"pl-5",children:(0,t.jsx)(eo,{machineId:e,entries:n?.quota})})]}),(0,t.jsx)("div",{className:"flex flex-col gap-3",hidden:l,children:a.map(e=>{let a=e.isActive&&r.profilesByUserId.get(e.id)?.presence==="online",o=r.pendingActiveBotIds.has(e.id);return(0,t.jsx)(s.Card,{className:"flex flex-col gap-3 p-4",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsx)(V.AgentAvatar,{name:e.name,avatarUrl:e.image,seed:e.id,size:40}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2.5",children:[(0,t.jsxs)("div",{className:"flex min-w-55 flex-1 flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-[15px] font-medium text-foreground",children:e.name}),(0,t.jsxs)("span",{className:["inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-1 text-[11px] font-medium",a?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-muted text-muted-foreground"].join(" "),children:[(0,t.jsx)("span",{className:["inline-block size-1.5 rounded-full",a?"bg-status-online":"bg-muted-foreground"].join(" ")}),a?"Online":"Offline"]}),(!e.isActive||!a&&n)&&(0,t.jsx)(i.Button,{size:"sm",variant:"outline",className:"h-6 shrink-0 px-2 text-xs",disabled:!e.isActive&&o,"aria-busy":!e.isActive&&o||void 0,onClick:t=>{t.stopPropagation(),e.isActive?n&&r.bringMachineOnline(n.id):r.setBotActive(e,!0)},children:e.isActive?"Bring online":"Activate"})]}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(P.ProviderLogo,{provider:e.runtime,className:"size-3.5 shrink-0"}),(0,t.jsx)("span",{children:e.runtime})]}),(0,t.jsx)("span",{"aria-hidden":!0,className:"shrink-0",children:"·"}),(0,H.formatModelLabel)(e.runtime,e.modelName)?(0,t.jsx)("span",{"data-testid":p.tid.botCardModel,className:"font-mono",children:(0,H.formatModelLabel)(e.runtime,e.modelName)}):(0,t.jsx)("span",{"data-testid":p.tid.botCardModel,className:"font-mono text-muted-foreground/70",title:"No model set — uses the machine's local default",children:"local default"}),e.lastRefreshContextAt&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"shrink-0",children:"·"}),(0,t.jsx)("span",{className:"shrink-0",children:(0,G.formatAwakeDuration)(e.lastRefreshContextAt)})]})]})]}),e.usage?.capability==="supported"&&(0,t.jsx)(ev,{botId:e.id,usage:e.usage,className:"self-center"})]}),(0,t.jsxs)(Y.DropdownMenu,{children:[(0,t.jsx)(Y.DropdownMenuTrigger,{render:(0,t.jsx)("button",{"aria-label":"Bot actions",className:"grid size-8 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",children:(0,t.jsx)(Q.MoreVertical,{className:"size-4"})})}),(0,t.jsxs)(Y.DropdownMenuContent,{align:"end",className:"w-auto min-w-36 max-w-56",children:[(0,t.jsxs)(Y.DropdownMenuItem,{onClick:()=>r.chatWithBot(e),children:[(0,t.jsx)("span",{className:"size-4","aria-hidden":!0})," Chat"]}),(0,t.jsxs)(Y.DropdownMenuItem,{onClick:()=>r.openActivity(e),children:[(0,t.jsx)(q.Activity,{className:"size-4"})," View activity"]}),(0,t.jsxs)(Y.DropdownMenuItem,{onClick:()=>{r.setEditingBot(e),r.setEditOpen(!0)},children:[(0,t.jsx)("span",{className:"size-4","aria-hidden":!0})," Edit"]}),(0,t.jsxs)(Y.DropdownMenuItem,{"data-testid":"bot-reset-session-item",onClick:()=>r.setConfirmReset(e),children:[(0,t.jsx)(W.RotateCcw,{className:"size-4"})," Reset"]}),(0,t.jsxs)(Y.DropdownMenuItem,{"data-testid":p.tid.botReportProblemItem,onClick:()=>{r.setBugReportBot({id:e.id,name:e.name}),r.setBugReportOpen(!0)},children:[(0,t.jsx)("span",{className:"size-4","aria-hidden":!0})," Report a problem"]}),(0,t.jsxs)(Y.DropdownMenuItem,{"data-testid":p.tid.botActive(e.id),disabled:o,"aria-busy":o||void 0,onClick:()=>{r.setBotActive(e,!e.isActive)},children:[(0,t.jsx)("span",{className:"size-4","aria-hidden":!0})," ",e.isActive?"Deactivate":"Activate"]}),(0,t.jsxs)(Y.DropdownMenuItem,{variant:"destructive",onClick:()=>r.setConfirmDelete(e),children:[(0,t.jsx)("span",{className:"size-4","aria-hidden":!0})," Delete"]})]})]})]})},e.id)})})]},e)})(e,n))})]}),o.create,o.billing,o.help,o.edit,o.activity,o.bug,o.deleteDialog,o.resetDialog,o.resetMachineDialog]})}],765867)},972525,e=>{"use strict";var t=e.i(237649),n=e.i(382416),a=e.i(873120),i=e.i(186339),s=e.i(332680),r=e.i(777104),o=e.i(561261),l=e.i(613349);function d({onPointerDown:e,onPointerMove:n,onPointerUp:a,className:i,withHandle:s=!0}){return(0,t.jsx)("div",{onPointerDown:e,onPointerMove:n,onPointerUp:a,onLostPointerCapture:a,className:(0,l.cn)("hidden sm:flex absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize z-10 items-center justify-center hover:bg-primary/10 active:bg-primary/20 transition-colors rounded-l-xl",i),children:s&&(0,t.jsx)("div",{className:"h-6 w-1 rounded-lg bg-border"})})}function c({width:e,maxWidth:n,resize:r,title:o,description:u,headerLeading:m,footer:p,children:h,bodyClassName:x,bodyRef:f,closeLabel:g,contentTestId:b,bodyTestId:y,requestClose:v}){let j="function"==typeof p?p(v):p;return(0,t.jsxs)(s.SheetContent,{"data-testid":b,side:"right",showOverlay:!0,showCloseButton:!1,style:{"--community-sheet-width":`${e}px`,"--community-sheet-max-width":n,maxWidth:"none"},className:(0,l.cn)("data-[side=right]:h-dvh data-[side=right]:w-screen data-[side=right]:max-w-none data-[side=right]:overflow-hidden","data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:w-[clamp(20rem,var(--community-sheet-width),min(var(--community-sheet-max-width),calc(100vw-1rem)))] data-[side=right]:sm:rounded-xl data-[side=right]:sm:border"),children:[r&&(0,t.jsx)(d,{...r}),(0,t.jsx)(s.SheetHeader,{className:"pr-14 sm:pr-14",children:null==m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.SheetTitle,{className:"truncate",children:o}),null!=u&&(0,t.jsx)(s.SheetDescription,{children:u})]}):(0,t.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,t.jsx)("div",{"data-slot":"sheet-header-leading",className:"shrink-0",children:m}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,t.jsx)(s.SheetTitle,{className:"truncate",children:o}),null!=u&&(0,t.jsx)(s.SheetDescription,{children:u})]})]})}),(0,t.jsx)(s.SheetBody,{ref:f,"data-testid":y,className:x,children:h}),null!=j&&(0,t.jsx)(s.SheetFooter,{className:"flex-row items-center justify-end **:data-[slot=button]:min-h-11 sm:**:data-[slot=button]:min-h-0",children:j}),(0,t.jsxs)(i.Button,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute top-0.5 right-0.5 z-20 size-11 sm:top-3 sm:right-3 sm:size-7","aria-label":g,onClick:v,children:[(0,t.jsx)(a.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:g})]})]})}function u({desktopWidth:e,...a}){let i=function({defaultWidth:e=480,minWidth:t=320,maxWidthRatio:a=.8}={}){let[i,s]=(0,r.useAtom)((0,o.useCreateAtom)(e)),l=(0,n.useRef)(!1),d=(0,n.useCallback)(e=>{e.preventDefault(),e.target.setPointerCapture(e.pointerId),l.current=!0},[]);return{width:i,onPointerDown:d,onPointerMove:(0,n.useCallback)(e=>{l.current&&s(Math.min(window.innerWidth*a,Math.max(t,window.innerWidth-e.clientX)))},[a,s,t]),onPointerUp:(0,n.useCallback)(e=>{l.current=!1,e.target.releasePointerCapture(e.pointerId)},[])}}({defaultWidth:m(e)});return(0,t.jsx)(c,{...a,width:i.width,maxWidth:"80vw",resize:i})}function m(e){return Number.isFinite(e)?Math.max(320,e):480}e.s(["CommunitySheet",0,function({open:e,onOpenChange:a,onOpenChangeComplete:i,title:r,description:o,headerLeading:l,footer:d,children:p,bodyClassName:h,bodyRef:x,desktopWidth:f=480,resizable:g=!1,closeLabel:b="Close",contentTestId:y,bodyTestId:v}){let j=n.useCallback(()=>a(!1),[a]),N=n.useCallback(e=>{e?a(!0):j()},[a,j]);return(0,t.jsx)(s.Sheet,{open:e,onOpenChange:N,onOpenChangeComplete:i,modal:!0,children:g?(0,t.jsx)(u,{title:r,description:o,headerLeading:l,footer:d,bodyClassName:h,bodyRef:x,desktopWidth:f,closeLabel:b,contentTestId:y,bodyTestId:v,requestClose:j,children:p}):(0,t.jsx)(c,{width:m(f),maxWidth:"80vw",title:r,description:o,headerLeading:l,footer:d,bodyClassName:h,bodyRef:x,closeLabel:b,contentTestId:y,bodyTestId:v,requestClose:j,children:p})})}],972525)},678401,e=>{"use strict";var t=e.i(204779),n=e.i(382416),a=e.i(765686),i=e.i(159514),s=e.i(343699),r=e.i(849050),o=e.i(374402),l=e.i(323512),d=e.i(636557);let c=(e,t)=>e.createdAt===t.createdAt?e.id>t.id?-1:+(e.id<t.id):e.createdAt>t.createdAt?-1:1;e.s(["appendBotAuditEvent",0,function(e,t,n){let a=o.communityKeys.botAuditLog(t),i=e.getQueryCache().find({queryKey:a,exact:!0}),s=i?.state.dataUpdatedAt??0,r=!i?.getObserversCount(),l=!1;e.setQueryData(a,e=>{let[t,...a]=e?.pages??[],i=new Map((t?.events??[]).map(e=>[e.id,e])),s=i.get(n.id);if(s&&0>=c(s,n))return e;i.set(n.id,n);let o=[...i.values()].sort(c),d=(l=r&&o.length>200)?o.slice(0,200):o,u=new Set(d.map(e=>e.id)),m=[...new Set([n.id,...t?.liveIds??[]])].filter(e=>u.has(e));return{pages:[{...t,events:d,nextCursor:t?.nextCursor??null,liveIds:m},...a],pageParams:e?.pageParams??[null]}},{updatedAt:s}),l&&e.invalidateQueries({queryKey:a,exact:!0,refetchType:"none"})},"useBotAuditLog",0,function(e){let u=(0,i.useQueryClient)(),m=(0,a.useInfiniteQuery)({enabled:!!e,queryKey:e?o.communityKeys.botAuditLog(e):["disabled-bot-audit-log"],structuralSharing:(t,n)=>(function(e,t,n=!1){if(!t?.pages[0])return(0,s.replaceEqualDeep)(e,t);let a=new Set(t.pages[0].liveIds),i=new Set(t.pages.flatMap(e=>e.events.filter(e=>!a.has(e.id)).map(e=>e.id))),r=new Set([...e?.pages[0]?.liveIds??[],...a].filter(e=>!i.has(e))),o=new Map(t.pages[0].events.map(e=>[e.id,e])),l=new Set(t.pages.slice(1).flatMap(e=>e.events.map(e=>e.id)));for(let t of e?.pages[0]?.events??[])!r.has(t.id)||o.has(t.id)||l.has(t.id)||o.set(t.id,t);let d=[...o.values()].sort(c),u=n?d.slice(0,200):d,m=new Set(u.map(e=>e.id)),[p,...h]=t.pages;return(0,s.replaceEqualDeep)(e,{...t,pages:[{...p,events:u,liveIds:[...r].filter(e=>m.has(e))},...h]})})(t,n,!u.getQueryCache().find({queryKey:o.communityKeys.botAuditLog(e),exact:!0})?.getObserversCount()),initialPageParam:null,queryFn:async({pageParam:n,signal:a})=>{let i=(0,l.captureCommunityLiveSnapshotToken)(u),s=new URLSearchParams;s.set("limit",String(50)),n&&(s.set("beforeCreatedAt",n.beforeCreatedAt),s.set("beforeId",n.beforeId));let d=await (0,r.apiFetch)(`/api/community/bots/${e}/audit-log?${s.toString()}`,(0,t.communityRequestOptions)(u,i,a));if(n)return d;let c=new Set(d.events.map(e=>e.id)),m=u.getQueryData(o.communityKeys.botAuditLog(e))?.pages[0],p=new Set(m?.liveIds),h=m?.events.filter(e=>p.has(e.id)&&!c.has(e.id))??[];return h.length?{...d,events:[...h,...d.events],liveIds:h.map(e=>e.id)}:d},retry:(e,t)=>!(t instanceof d.ApiError&&404===t.status)&&e<1,staleTime:3e4,getNextPageParam:e=>e.nextCursor});return{events:(0,n.useMemo)(()=>{if(!m.data)return[];let e=new Set,t=[];for(let n of m.data.pages)for(let a of n.events)e.has(a.id)||(e.add(a.id),t.push(a));return t},[m.data]),error:m.error,isError:m.isError,isLoading:m.isLoading,fetchNextPage:m.fetchNextPage,hasNextPage:m.hasNextPage,isFetchingNextPage:m.isFetchingNextPage}}])},985885,e=>{"use strict";var t=e.i(693760),n=e.i(984858),a=e.i(557922),i=e.i(362790),s=e.i(159514),r=e.i(152845),o=e.i(374402),l=e.i(280958),d=e.i(382416),c=e.i(902429),u=e.i(351777),m=e.i(86694),p=e.i(695230),h=e.i(193497);function x(e){return{id:e.id,identityAbout:{name:e.name,kind:"bot",..."discriminator"in e&&"string"==typeof e.discriminator?{discriminator:e.discriminator}:{},...void 0===e.description?{}:{aboutMe:e.description}},avatar:{avatar:e.image??(0,l.avatarInitial)(e.name),avatarVersion:e.avatarVersion}}}let f=e=>[o.communityKeys.bots(),o.communityKeys.friends(),o.communityKeys.dms(),...e?[o.communityKeys.profile(e)]:[]],g=()=>f(),b=({id:e})=>f(e),y=({botId:e})=>f(e),v=({id:e})=>[o.communityKeys.botAuditLog(e)],j=()=>[];function N(e,t,a){let l=(0,s.useQueryClient)(),u=(0,h.useCommunityMutationOrigin)(),m=(0,i.useMutation)({meta:{observabilityAction:(0,n.resolveActionName)("bot.command",{kind:e})},mutationKey:[...o.communityKeys.bots(),e],scope:{id:"community-bot-command"},gcTime:0,mutationFn:async({input:e,original:n,resources:a})=>{let i=()=>{u.assert(n),e.assertActive?.()};i();let s=(0,r.beginCommunityProfileSeed)(u.registry);try{for(let e of a)l.getQueryCache().find({queryKey:e.queryKey,exact:!0})===e&&await l.cancelQueries({queryKey:e.queryKey,exact:!0});i(),await u.registry.collections.profiles.preload(),i();let o=await t(e,{client:l,resources:a,assert:i,request:(t,a)=>u.request(n,t,{...a,signal:e.assertActive?.signal,assertActive:i}),publishProfile:e=>{i(),(0,r.writeCommunityProfilePatches)([e],u.registry,{snapshot:s,command:!0})}});return i(),o}finally{try{for(let e of(u.assert(n),a))l.getQueryCache().find({queryKey:e.queryKey,exact:!0})===e&&l.invalidateQueries({queryKey:e.queryKey,exact:!0}).catch(()=>void 0)}catch{}}}}),p=(0,d.useCallback)(e=>(e.assertActive?.(),{input:e,original:u.begin().token,resources:[...new Set(a(e).flatMap(e=>l.getQueryCache().findAll({queryKey:e})))]}),[u,l,a]),x=(0,d.useCallback)(e=>{u.assert(e.original),e.input.assertActive?.()},[u]);return(0,c.useNativeMutationFacade)(m,p,x)}let w=e=>"string"==typeof e?{id:e}:e;function C(e){let t=(0,d.useCallback)((e,t)=>t&&{onSuccess:(n,a,i,s)=>t.onSuccess?.(n,e,i,s),onError:(n,a,i,s)=>t.onError?.(n,e,i,s),onSettled:(n,a,i,s,r)=>t.onSettled?.(n,a,e,s,r)},[]),n=e.mutate,a=e.mutateAsync,i=(0,d.useCallback)((e,a)=>n(w(e),t(e,a)),[n,t]),s=(0,d.useCallback)((e,n)=>a(w(e),t(e,n)),[a,t]);return{...e,mutate:i,mutateAsync:s}}e.s(["useBots",0,function(){let e=(0,s.useQueryClient)(),n=(0,a.useQuery)({queryKey:o.communityKeys.bots(),queryFn:async({client:e,signal:t})=>{let n=await (0,r.apiFetchProfiles)("/api/community/bots",e=>e.bots.map(e=>({...x(e),presence:e.presence})),{signal:t},(0,p.getCommunityDbRegistry)(e));return{...n,bots:n.bots.map(({name:e,description:t,image:n,avatarVersion:a,presence:i,...s})=>s)}}}),i=(0,m.useCanonicalProfilesByUserId)(n.data?.bots.map(e=>e.id)??[]),l=(0,d.useMemo)(()=>(n.data?.bots??[]).map(a=>{let s=(0,u.readCommunityProfile)(i.get(a.id),a.id);return(0,t.deriveView)({...a,name:s.name,description:s.aboutMe,image:s.avatar,avatarVersion:s.avatarVersion,presence:s.presence},[(0,t.valueEvidence)(e,n.data),(0,t.viewEvidence)(s)])}),[i,n.data,e]);return(0,t.deriveView)(l,[(0,t.valueEvidence)(e,n.data),...l.map(t.viewEvidence)]),{...n,bots:l}},"useCreateBot",0,function(){return N("create-command",async({assertActive:e,...t},n)=>{let a=await n.request("/api/community/bots",{method:"POST",body:JSON.stringify(t)});return n.publishProfile(x(a.bot)),a},g)},"useDeleteBot",0,function(){return C(N("delete-command",async({id:e},t)=>{await t.request("/api/community/bots/"+e,{method:"DELETE"})},b))},"useResetBotSession",0,function(){return C(N("reset-command",({id:e},t)=>t.request("/api/community/bots/"+e+"/reset-session",{method:"POST"}),v))},"useResetMachineAgents",0,function(){return C(N("machine-reset-command",({id:e},t)=>t.request("/api/community/machines/"+e+"/reset-agents",{method:"POST"}),j))},"useSetBotActive",0,function(){return N("active-command",async({id:e,active:t},n)=>{let a=o.communityKeys.bots(),i=n.resources.find(e=>e.queryHash===n.client.getQueryCache().find({queryKey:a,exact:!0})?.queryHash),s=i?.state.dataUpdateCount,r=await n.request("/api/community/bots/"+e+"/active",{method:"PATCH",body:JSON.stringify({active:t})});return n.assert(),i&&n.client.getQueryCache().find({queryKey:a,exact:!0})===i&&i.state.dataUpdateCount===s&&n.client.setQueryData(a,e=>{if(!e)return e;let t=e.bots.find(e=>e.id===r.bot.id);return t&&t.isActive!==r.bot.isActive?{...e,activeCount:Math.max(0,e.activeCount+(r.bot.isActive?1:-1)),bots:e.bots.map(e=>e.id===r.bot.id?{...e,isActive:r.bot.isActive}:e)}:e}),r},b)},"useUpdateBot",0,function(){return N("update-command",async({id:e,assertActive:t,...n},a)=>{let i=await a.request("/api/community/bots/"+e,{method:"PATCH",body:JSON.stringify(n)});a.publishProfile(x(i.bot));let s=o.communityKeys.bots();return a.resources.find(e=>a.client.getQueryCache().find({queryKey:s,exact:!0})===e)&&a.client.setQueryData(s,t=>t?{...t,bots:t.bots.map(t=>t.id===e&&t.runtimeConfigRevision<=i.bot.runtimeConfigRevision?{...t,runtime:i.bot.runtime,modelName:i.bot.modelName,reasoningEffort:i.bot.reasoningEffort,runtimeConfigRevision:i.bot.runtimeConfigRevision}:t)}:t),i},b)},"useUploadBotAvatar",0,function(){return N("avatar-command",async({botId:e,file:t},n)=>{let a=new FormData;a.append("file",t);let i=await n.request("/api/community/bots/"+e+"/avatar",{method:"POST",body:a});return n.publishProfile({id:e,avatar:{avatar:i.url,avatarVersion:i.avatarVersion}}),i},y)}])},617527,e=>{"use strict";var t=e.i(693760),n=e.i(159514),a=e.i(557922);e.i(954194);var i=e.i(846367),s=e.i(323512),r=e.i(849050),o=e.i(374402);let l=Object.freeze([]),d=e=>(0,r.apiFetch)("/api/community/machines",(0,s.communityRequestOptions)(e.client,e.signal));e.s(["machinesQueryFn",0,d,"replaceMachines",0,function(e,t){return{...e,machines:t,...e.machineCapacity?{machineCapacity:{...e.machineCapacity,ownedCount:t.length,onlineCount:t.filter(e=>(0,i.isPresenceOnline)(e.status)).length}}:{}}},"useMachines",0,function(e){let i=(0,n.useQueryClient)(),s=(0,a.useQuery)({queryKey:o.communityKeys.machines(),queryFn:d,...e}),r=s.data?.machines??l;return(0,t.deriveView)(r,[(0,t.valueEvidence)(i,s.data)]),{...s,machines:r}}])},366020,e=>{"use strict";var t=e.i(152961),n=e.i(474707),a=e.i(205189);function i(e,t){if(!e.lifecycle.get().active)throw new DOMException("Retired onboarding owner","AbortError");return e.ui.setState(e=>({...e,onboardingState:t})),t}function s(e){return e.ui.get().onboardingState}e.s(["advanceCommunityOnboarding",0,function(e,t,n,r={}){let o=s(e);if(o?.status!=="active"||o.stage!==t)return o;let l={...o,...r,status:"active",stage:n};return i(e,l),(0,a.trackCommunityOnboardingStageCompleted)(t),l},"completeCommunityOnboarding",0,function(e){let t=s(e);return t?.status!=="active"||"initializing"!==t.stage?t:(i(e,null),(0,a.trackCommunityOnboardingStageCompleted)("initializing"),(0,a.trackCommunityOnboardingCompleted)(),null)},"isCommunityOnboardingStage",0,function(e,t){let n=s(e);return n?.status==="active"&&n.stage===t},"readCommunityOnboardingState",0,s,"recoverCommunityOnboardingHarness",0,function(e){let t=s(e);if(t?.status!=="active"||"machine"!==t.stage)return t;let{harness:n,machineId:a,...r}=t;return i(e,{...r,stage:"harness"})},"recoverCommunityOnboardingMachine",0,function(e){let t=s(e);return t?.status!=="active"||"bot"!==t.stage?t:i(e,{...t,machineRecovery:!0})},"skipCommunityOnboarding",0,function(e){let t=s(e);if(!t)return null;let n=t.stage;return i(e,null),(0,a.trackCommunityOnboardingSkipped)(n),null},"startCommunityOnboarding",0,function(e,t={}){let n=s(e);if(n)return n;let r={...t,status:"active",stage:"harness"};return i(e,r),(0,a.trackCommunityOnboardingStarted)(),r},"updateCommunityOnboardingInitialization",0,function(e,t){let n=s(e);if(n?.stage!=="initializing")throw new DOMException("Retired onboarding initialization","AbortError");return i(e,{...n,initialization:t(n.initialization??{checkpoint:{},step:"creating-bots",result:null,pendingDestination:null})})},"updateCommunityOnboardingResources",0,function(e,t){let n=s(e);return n?.status!=="active"?n:i(e,{...n,...t})},"useCommunityOnboarding",0,function(){return(0,t.useSelector)((0,n.useCommunityRuntime)().ui,e=>e.onboardingState)}])},183866,e=>{"use strict";let t={cli_invocation:"alook command",tool_call:"tool",thinking:"Updated its reasoning",turn_interrupt:"Stop accepted by daemon",wake_trigger:"Woke for a new message",session_reset:"Session reset requested",nap:"Started a fresh session",model_changed:"Model changed",provider_changed:"Provider changed",error:"Encountered an error"},n={send:"message send",read:"channel history",resolve:"channel history",reactAdd:"message emoji",messagePropertySet:"message property set",messagePropertyList:"message property list",messagePropertyRemove:"message property remove",markSet:"message mark set",markRemove:"message mark remove",markList:"message mark list",channelMember:"channel member",attachmentUpload:"message attachment upload",attachmentDownload:"message attachment download",listMembers:"server member",listChannels:"channel list",listFriends:"friend list",friendRequest:"friend request",inboxPull:"inbox pull",inboxSnapshot:"inbox pull",profileBioUpdate:"setting profile",profileAvatarUpdate:"setting profile",nap:"nap"};function a(e){let t=e&&"object"==typeof e&&"subcommand"in e&&"string"==typeof e.subcommand?e.subcommand:null;if(!t)return"alook command";let a=n[t]??t.replace(/([a-z\d])([A-Z])/g,"$1 $2").toLowerCase(),i=e&&"object"==typeof e&&"propertyType"in e&&("emoji"===e.propertyType||"tag"===e.propertyType||"mark"===e.propertyType)&&("messagePropertySet"===t||"messagePropertyRemove"===t)?e.propertyType:null;return`alook ${a}${i?` ${i}`:""}`}function i(e){return(e&&"object"==typeof e&&"name"in e&&"string"==typeof e.name?e.name.trim().toLowerCase():"")||"tool"}e.s(["formatAlookAuditCommand",0,a,"formatAuditPreviewTime",0,function(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})},"formatAuditToolName",0,i,"summarizeAuditEvent",0,function(e){return"cli_invocation"===e.kind?a(e.payload):"tool_call"===e.kind?i(e.payload):t[e.kind]}])}]);
|
|
2
|
+
… ${r} character${1===r?"":"s"} not retained in the audit log`:a;return(0,t.jsx)(eP,{fullText:o,className:"text-[12.5px] text-muted-foreground",children:a})}function eP({children:e,fullText:n,className:a="",...i}){let s=(0,o.useId)(),r=(0,o.useRef)(null),l=(0,o.useRef)(null),[d,c]=(0,b.useAtom)((0,y.useCreateAtom)(!1)),[u,m]=(0,b.useAtom)((0,y.useCreateAtom)(!1));(0,o.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{let t=e.scrollWidth>e.clientWidth+1;c(t),t||m(!1)};if(t(),"u"<typeof ResizeObserver)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[n,c,m]);let p=(0,t.jsx)("button",{type:"button",disabled:!d,"data-activity-tooltip-trigger":d||void 0,onPointerDown:e=>{l.current=e.pointerType},onClick:()=>{d&&("touch"===l.current||"pen"===l.current)&&m(!0)},className:"block min-h-11 w-full min-w-0 cursor-default rounded-sm text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 sm:min-h-0",children:(0,t.jsx)("span",{ref:r,className:`block truncate font-mono text-[13px] text-foreground ${a}`,...i,children:e})});return(0,t.jsxs)(el.Tooltip,{disabled:!d,open:u&&d,triggerId:s,onOpenChange:m,children:[(0,t.jsx)(el.TooltipTrigger,{id:s,disabled:!d,closeOnClick:!1,render:p}),(0,t.jsx)(el.TooltipContent,{role:"tooltip",side:"bottom",align:"start",className:"thin-scrollbar max-h-[min(24rem,calc(100dvh-2rem))] max-w-[min(32rem,calc(100vw-2rem))] overflow-y-auto whitespace-pre-wrap wrap-break-word font-mono text-[12px] leading-relaxed",children:n})]})}function eI(e){return[...e].length}function eO({bot:e,open:n,onOpenChange:a,onOpenChangeComplete:i}){let s=(0,eA.useCanonicalCommunityProfile)(e?.id),r=s?.presence==="online",{events:l,isLoading:d,fetchNextPage:c,hasNextPage:u,isFetchingNextPage:m}=(0,eD.useBotAuditLog)(e?.id??null),h=(0,o.useMemo)(()=>[...l].sort((e,t)=>e.createdAt!==t.createdAt?e.createdAt<t.createdAt?-1:1:e.id<t.id?-1:+(e.id>t.id)),[l]),x=(0,o.useMemo)(()=>(function(e){let t=[];for(let n of e){let e=function(e){let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}(n.createdAt),a=t[t.length-1];a&&a.dayKey===e?a.events.push(n):t.push({dayKey:e,label:function(e){let t=new Date(e),n=new Date,a=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),i=Math.round((a(n)-a(t))/864e5);return 0===i?"Today":1===i?"Yesterday":i<7?t.toLocaleDateString(void 0,{weekday:"long"}):t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:t.getFullYear()===n.getFullYear()?void 0:"numeric"})}(n.createdAt),events:[n]})}return t})(h),[h]),f=(0,o.useRef)(null),g=(0,o.useRef)(null),b=(0,o.useRef)(0),y=(0,o.useRef)(null),v=(0,o.useRef)(!1);return(0,o.useEffect)(()=>{n||(b.current=0,y.current=null,v.current=!1)},[n,e?.id]),(0,o.useEffect)(()=>{if(!n||v.current||0===h.length)return;let e=g.current,t=f.current;e&&t&&(v.current=!0,b.current=h.length,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.scrollIntoView({block:"end"}),t.scrollTop=t.scrollHeight})}))},[n,h.length]),(0,o.useLayoutEffect)(()=>{let e=f.current;if(!e)return;let t=b.current,n=h.length;if(b.current=n,0===n)return;if(null!==y.current){if(n>t){let t=e.scrollHeight-y.current;e.scrollTop=e.scrollTop+t}y.current=null;return}if(!v.current)return;let a=e.scrollHeight-(e.scrollTop+e.clientHeight)<80;n>t&&a&&(e.scrollTop=e.scrollHeight)},[h.length]),(0,t.jsx)(S.CommunitySheet,{open:n,onOpenChange:a,onOpenChangeComplete:i,title:e?.name??"Bot",headerLeading:(0,t.jsx)(V.AgentAvatar,{name:e?.name??"",avatarUrl:e?.image??null,seed:e?.id,size:32}),description:(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:["inline-block size-1.5 rounded-full",r?"bg-status-online":"bg-muted-foreground/60"].join(" "),"aria-hidden":!0}),(0,t.jsx)("span",{children:r?"Live":"Offline"}),(0,t.jsx)("span",{"aria-hidden":!0,className:"text-muted-foreground/40",children:"·"}),(0,t.jsx)("span",{children:"Activity log"})]}),desktopWidth:672,resizable:!0,contentTestId:p.tid.botActivityModal,bodyRef:f,bodyClassName:"bg-background p-0",children:d&&0===h.length?(0,t.jsx)(eR,{}):0===h.length?(0,t.jsx)(eE,{}):(0,t.jsxs)("div",{className:"pb-3",children:[u?(0,t.jsx)("div",{className:"flex justify-center py-2",children:(0,t.jsx)("button",{type:"button",onClick:()=>{if(!u||m)return;let e=f.current;e&&(y.current=e.scrollHeight),c()},disabled:m,className:"min-h-11 rounded-md px-3 py-1 font-mono text-[10px] uppercase tracking-wider text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-60 sm:min-h-8",children:m?"Loading older":"Load older"})}):(0,t.jsx)("div",{className:"py-2 text-center font-mono text-[10px] uppercase tracking-wider text-muted-foreground/40",children:"Beginning of log"}),x.map(e=>(0,t.jsxs)("section",{children:[(0,t.jsx)(eM,{label:e.label}),e.events.map(e=>(0,t.jsx)(eB,{event:e},e.id))]},e.dayKey)),(0,t.jsx)("div",{ref:g,"aria-hidden":!0})]})})}function eM({label:e}){return(0,t.jsx)("div",{className:"sticky top-0 z-10 border-b border-border/40 bg-background/95 px-4 py-1 backdrop-blur supports-backdrop-filter:bg-background/80",children:(0,t.jsx)("span",{className:"font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:e})})}function eR(){return(0,t.jsx)("div",{className:"flex flex-col gap-2 p-4",children:Array.from({length:8}).map((e,n)=>(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"h-3 w-16 animate-pulse rounded bg-muted/40"}),(0,t.jsx)("div",{className:"h-3 w-10 animate-pulse rounded bg-muted/30"}),(0,t.jsx)("div",{className:"h-3 flex-1 animate-pulse rounded bg-muted/40"})]},n))})}function eE(){return(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-8 text-center",children:[(0,t.jsx)("div",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground/60",children:"No activity yet"}),(0,t.jsx)("p",{className:"max-w-xs text-xs text-muted-foreground",children:"This bot hasn't run since audit logging was enabled. New runs will stream in here as they happen."})]})}var e$=e.i(557922),ez=e.i(362790),eF=e.i(328076),eL=e.i(152961),eq=e.i(193497),eK=e.i(562088);let eU=["rate_limited","target_unavailable","nonce_conflict","network_error"],eQ={phase:"confirm",terminal:!1,clientNonce:null,reportId:null,deadlineAt:null,completedAt:null,errorCode:null,objectExpired:!1},eW={offline:"Bring the daemon online, then try again.",timeout:"Collection timed out. Try again.",upload_conflict:"The report could not be uploaded safely. Try again.",invalid_upload:"The report upload was rejected. Try again.",diagnostics_unavailable:"Diagnostics are unavailable right now. Try again.",collector_busy:"Another report is being collected. Try again shortly.",bot_not_bound:"This bot is no longer available on that machine.",collection_failed:"Diagnostics could not be collected. Try again.",local_artifact_invalid:"The local diagnostic bundle could not be verified.",bundle_too_large:"The diagnostic bundle was too large to upload.",upload_failed:"The report upload failed. Try again.",internal_error:"The report could not be completed. Try again.",rate_limited:"You can send another report in a minute.",target_unavailable:"Diagnostics aren't available for this bot right now.",nonce_conflict:"That report already belongs to another bot. Try again.",network_error:"Unable to connect — check your network"};function eH(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function eV(e){return eK.DiagnosticReportFailureCodeSchema.safeParse(e).success}function eY(e){return"number"==typeof e&&Number.isSafeInteger(e)&&e>=0}function eG(e,t){let n={...e,reportId:t.reportId,deadlineAt:t.deadlineAt,completedAt:t.completedAt,errorCode:t.failureCode,objectExpired:t.objectExpired};return"pending"===t.status?{...n,phase:"collecting",terminal:!1}:"uploaded"===t.status?{...n,phase:"uploaded",terminal:!0}:{...n,phase:"timeout"===t.failureCode?"timeout":"failed",terminal:!0}}function eJ(e,t){if("created"===t.type||"status"===t.type)return eG(e,t.report);if("create_error"===t.type)return{...e,phase:"failed",terminal:!1,errorCode:"internal_error"};if("create_rejected"===t.type){var n;return{...e,phase:"failed",terminal:"rate_limited"===(n=t.code)||"nonce_conflict"===n,errorCode:t.code}}return"invalid_payload"===t.type?{...e,phase:"failed",terminal:!0,errorCode:"internal_error"}:"deadline"===t.type?{...e,phase:"timeout",terminal:!0,errorCode:"timeout"}:e}function eX(e){var t;return eH(e)?eH(t=e.report)&&"string"==typeof t.reportId&&t.reportId.startsWith("dbr_")&&("pending"===t.status||"uploaded"===t.status||"failed"===t.status)&&eY(t.deadlineAt)&&"boolean"==typeof t.objectExpired&&(null===t.completedAt||void 0===t.completedAt||eY(t.completedAt))&&(null===t.failureCode||void 0===t.failureCode||eV(t.failureCode))&&("failed"!==t.status||eV(t.failureCode))&&("failed"===t.status||null===t.failureCode||void 0===t.failureCode)?{reportId:t.reportId,status:t.status,deadlineAt:t.deadlineAt,completedAt:t.completedAt??null,failureCode:t.failureCode??null,objectExpired:t.objectExpired}:null:null}class eZ extends Error{}function e0({reportId:e}){let[n,a]=(0,b.useAtom)((0,y.useCreateAtom)("idle")),s=async()=>{try{await navigator.clipboard.writeText(e),a("copied")}catch{a("failed")}};return(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:"Report ID"}),(0,t.jsx)("code",{className:"font-mono text-xs text-muted-foreground",children:e}),(0,t.jsx)(i.Button,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs","aria-label":"Copy report ID",onClick:()=>void s(),children:"Copy"}),"copied"===n&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Copied"}),"failed"===n&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Couldn’t copy. Select the ID instead."})]})}function e1(e){var n,a,s,r,o;let l="confirm"!==e.phase&&"submitting"!==e.phase,d="failed"===e.phase||"timeout"===e.phase?"Try again":e.isSubmitting?"Submitting…":"Confirm",c="collecting"!==e.phase&&"uploaded"!==e.phase&&("failed"!==e.phase||"rate_limited"!==e.errorCode);return(0,t.jsx)(ej.AlertDialog,{open:e.open,onOpenChange:e.onOpenChange,children:(0,t.jsxs)(ej.AlertDialogContent,{"data-testid":p.tid.botReportProblemDialog,children:[(0,t.jsxs)(ej.AlertDialogHeader,{children:[(0,t.jsxs)(ej.AlertDialogTitle,{children:["Report a problem with ",e.bot.name,"?"]}),(0,t.jsxs)(ej.AlertDialogDescription,{className:"space-y-3 text-left",children:[(0,t.jsx)("span",{className:"block",children:"We’ll upload only program logs needed to diagnose the problem."}),(0,t.jsx)("span",{className:"block",children:"We won’t read or upload your agent’s local chat history or files."}),(0,t.jsx)("span",{className:"block",children:"Reports are deleted after 7 days."})]})]}),l&&(0,t.jsxs)("div",{"data-testid":p.tid.botReportProblemStatus,className:"rounded-md bg-muted/60 px-3 py-2 text-sm",children:[(0,t.jsx)("p",{className:"font-medium text-foreground",children:(n=e.phase,a=e.errorCode,"failed"===n&&"rate_limited"===a?"A report was sent recently":"collecting"===n?"Collecting diagnostics":"uploaded"===n?"Report uploaded":"timeout"===n?"Collection timed out":"Report failed")}),"failed"===e.phase&&(0,t.jsx)("p",{className:"mt-1 text-muted-foreground",children:"string"==typeof(o=r=s=e.errorCode)&&eU.includes(o)||eV(r)?eW[s]:eW.internal_error}),e.reportId&&(0,t.jsx)(e0,{reportId:e.reportId},e.reportId)]}),(0,t.jsxs)(ej.AlertDialogFooter,{children:[(0,t.jsx)(ej.AlertDialogCancel,{children:"Close"}),c&&(0,t.jsx)(i.Button,{"data-testid":p.tid.botReportProblemSubmit,disabled:e.isSubmitting,onClick:()=>void e.onConfirm(),children:d})]})]})})}function e2({bot:e,open:n,onOpenChange:a}){let{state:i,confirm:s}=function({agentId:e,open:t}){let n=(0,eq.useCommunityMutationOrigin)(),a=(0,v.useQueryClient)(),i=(0,w.useCommunityViewSource)(`bug-report:${e}`),s=(0,eF.useCreateStore)({nonce:null,expiredReportId:null}),r=(0,eL.useSelector)(s,e=>e),l=["community","bug-report-create",e],d=(0,ez.useMutation)({meta:{observabilityAction:"bot.bug_report.submit"},mutationKey:l,mutationFn:async({nonce:t,token:i,assert:s})=>{s();let r={path:`/api/community/bots/${e}/diagnostics`,init:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientNonce:t})}},o=await n.request(i,r.path,{...r.init,signal:s.signal,assertActive:s});s();let l=eX(o);if(!l)throw new eZ("Invalid diagnostics response");let d=j.communityKeys.bugReport(l.reportId),c=a.getQueryCache().build(a,{queryKey:d,gcTime:3e5});return c.state.data||c.setData(l),n.assert(i),{nonce:t,reportId:l.reportId}}}),c=d.reset,u=d.data?.nonce===r.nonce?d.data.reportId:null,m=t&&!!u&&r.expiredReportId!==u,p=(0,e$.useQuery)({queryKey:j.communityKeys.bugReport(u??"inactive"),subscribed:m,gcTime:3e5,enabled:e=>m&&e.state.data?.status==="pending"&&Date.now()<e.state.data.deadlineAt&&!(e.state.error instanceof eZ),retry:!1,queryFn:async({signal:e})=>{let t=n.begin().token,a={path:`/api/community/diagnostics/${u}`,init:{method:"GET"}},i=await n.request(t,a.path,{...a.init,signal:e});n.assert(t);let s=eX(i);if(!s)throw new eZ("Invalid diagnostics response");return s},refetchInterval:e=>{let t=e.state.data;return!!(m&&!(e.state.error instanceof eZ)&&t?.status==="pending"&&Date.now()<t.deadlineAt)&&1e3}}),h={...eQ,clientNonce:r.nonce};d.variables?.nonce===r.nonce&&(d.isPending?h={...h,phase:"submitting"}:d.error&&!(d.error instanceof DOMException&&"AbortError"===d.error.name)&&(h=eJ(h,d.error instanceof eZ?{type:"invalid_payload"}:function(e){if(e instanceof N.ApiError){if(e.isNetworkError||0===e.status)return{type:"create_rejected",code:"network_error"};if(e.isRateLimit)return{type:"create_rejected",code:"rate_limited"};if(404===e.status)return{type:"create_rejected",code:"target_unavailable"};if(409===e.status)return{type:"create_rejected",code:"nonce_conflict"}}return{type:"create_error"}}(d.error)))),p.data&&p.data.reportId===u&&(h=eG(h,p.data)),p.error instanceof eZ&&(h=eJ(h,{type:"invalid_payload"})),r.expiredReportId===u&&"collecting"===h.phase&&(h=eJ(h,{type:"deadline"})),(0,o.useEffect)(()=>{let e=p.data;if(!t||!e||"pending"!==e.status)return;let n=i.capture(),a=()=>{try{n()}catch{return}s.setState(t=>({...t,expiredReportId:e.reportId}))},r=e.deadlineAt-Date.now();if(r<=0)return void a();let o=setTimeout(a,r);return()=>clearTimeout(o)},[t,p.data,i,s]),(0,o.useEffect)(()=>{!t&&h.terminal&&(s.setState(()=>({nonce:null,expiredReportId:null})),c())},[t,h.terminal,s,c]);let x=async()=>{if("submitting"!==h.phase&&"collecting"!==h.phase&&!a.getMutationCache().findAll({mutationKey:l,status:"pending"}).length)try{let e=i.capture(),t=n.begin().token;e();let a=function(e,t=()=>globalThis.crypto.randomUUID()){return"submitting"===e.phase||"collecting"===e.phase?e:!e.terminal&&e.clientNonce?{...e,phase:"submitting",errorCode:null}:{...eQ,phase:"submitting",clientNonce:t()}}({...h,clientNonce:s.get().nonce});if(!a.clientNonce)return;s.setState(()=>({nonce:a.clientNonce,expiredReportId:null})),await d.mutateAsync({nonce:a.clientNonce,token:t,assert:e})}catch{}};return{state:h,confirm:x}}({agentId:e.id,open:n});return(0,t.jsx)(e1,{bot:e,open:n,phase:i.phase,isSubmitting:"submitting"===i.phase,reportId:i.reportId,errorCode:i.errorCode,onConfirm:s,onOpenChange:a})}function e5(e){return void 0!==e.phase?(0,t.jsx)(e1,{...e}):(0,t.jsx)(e2,{...e})}var e3=e.i(540604),e4=e.i(909832);function e6(e){return(0,e3.isPhotoAvatarUrl)(e.image)?{kind:"photo",file:null,previewUrl:e.image}:{kind:"procedural",image:(0,_.parseBeamSeed)(e.image)?e.image:(0,_.serializeBeamSeed)(e.id)}}function e8({bot:e,open:n,onOpenChange:a}){let s=(0,w.useCommunityViewSource)("edit-bot:"+(e?.id??"none"),n&&!!e),r=(0,v.useQueryClient)(),l=e=>{e||s.retire(),a(e)},[d,c]=(0,b.useAtom)((0,y.useCreateAtom)(e?.name??"")),[u,m]=(0,b.useAtom)((0,y.useCreateAtom)(e?.description??"")),[p,h]=(0,b.useAtom)((0,y.useCreateAtom)(e?.modelName??null)),[x,f]=(0,b.useAtom)((0,y.useCreateAtom)(e?.reasoningEffort??null)),[A,D]=(0,b.useAtom)((0,y.useCreateAtom)(e?.runtime??"")),[B,T]=(0,b.useAtom)((0,y.useCreateAtom)(!1)),[P,E]=(0,b.useAtom)((0,y.useCreateAtom)(void 0)),[$,F]=(0,b.useAtom)((0,y.useCreateAtom)(e?e6(e):{kind:"procedural",image:(0,_.serializeBeamSeed)("initial")})),L=(0,O.useUpdateBot)(),q=(0,O.useUploadBotAvatar)(),{machines:K}=(0,I.useMachines)(),U=K.find(t=>t.id===e?.machineId),Q=(0,o.useMemo)(()=>{let e=z(U);return A&&!e.some(e=>e.id===A)&&e.push({id:A,unhealthy:!0}),e},[U,A]),W=(0,o.useMemo)(()=>({scope:[s.signal],store:(0,g.createStore)(!1)}),[s.signal]).store;async function H(){if(!e||["update-command","avatar-command"].some(e=>r.isMutating({mutationKey:[...j.communityKeys.bots(),e],exact:!0,predicate:e=>e.state.variables.input?.assertActive?.signal===s.signal})>0))return;let t=s.capture();if(t(),!d.trim())return void E("Name is required");let n=function(e){if(null!==e){if(0===e.trim().length)return"Enter a model name";if(e.length>100)return"Model name must be 100 characters or fewer"}}(p);if(n)return void C.toast.error(n);let a=p!==(e.modelName??null),i=A!==e.runtime,o=x!==(e.reasoningEffort??null);try{let n=await L.mutateAsync({assertActive:t,id:e.id,name:d.trim(),description:u.trim(),image:"procedural"===$.kind?$.image:void 0,...a?{model:p}:{},...i?{runtime:A}:{},...o?{reasoningEffort:x}:{}});t();let s=!1;if("photo"===$.kind&&$.file)try{await q.mutateAsync({botId:e.id,file:$.file,assertActive:t}),t()}catch(e){try{t()}catch{return}if((0,N.isAbortError)(e))return;s=!0,(0,k.toastApiError)(e,"Bot updated, but the avatar photo failed to upload",t)}if(!s)if((i||a)&&"saved_not_applied"===n.application)C.toast.success("Runtime settings saved for next start.");else if(i)C.toast.success(`Provider switch to ${A} dispatched`);else if(a){let e=p??"the runtime default";C.toast.success(`Model switch to ${e} dispatched`)}else o?C.toast.success("next_turn"===n.application?"Reasoning effort saved. Next turn takes effect.":"Reasoning effort saved for next start."):C.toast.success("Bot updated");t(),l(!1)}catch(e){if((0,N.isAbortError)(e))return;(0,k.toastApiError)(e,"Update failed",t)}}function V(){if(e){if(!d.trim())return void E("Name is required");if(A!==e.runtime)return void T(!0);H()}}return(0,o.useEffect)(()=>{n&&e&&(W.get()||(W.setState(()=>!0),c(e.name),m(e.description??""),h(e.modelName??null),f(e.reasoningEffort??null),D(e.runtime),F(e6(e)),E(void 0),T(!1)))},[n,e,W,c,m,h,f,D,F,E,T]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(S.CommunitySheet,{open:n,onOpenChange:l,title:`Edit ${e?.name??"bot"}`,description:"Name and description edits take effect on the next wake. Reasoning effort applies on the next turn when online, or the next start when offline. Provider and model switches require the bot to be online.",bodyClassName:"flex flex-col gap-6",footer:n=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:n,children:"Cancel"}),(0,t.jsx)(i.Button,{onClick:V,disabled:L.isPending||q.isPending||!e,children:L.isPending?"Saving…":"Save"})]}),children:[(0,t.jsx)(M.BotFormFields,{avatarDraft:$,onAvatarChange:F,name:d,setName:function(e){c(e),P&&e.trim()&&E(void 0)},onShuffle:function(){c((0,e4.uniqueNamesGenerator)({dictionaries:[e4.names],length:1,style:"capital"})),E(void 0)},description:u,setDescription:m,nameError:P}),e&&(0,t.jsx)(R.BotRuntimeFields,{options:Q,runtime:A,model:p,daemonVersion:U?.daemonVersion,reasoningEffort:x,onRuntimeChange:D,onModelChange:h,onReasoningEffortChange:f})]}),(0,t.jsx)(ej.AlertDialog,{open:B,onOpenChange:T,children:(0,t.jsxs)(ej.AlertDialogContent,{children:[(0,t.jsxs)(ej.AlertDialogHeader,{children:[(0,t.jsx)(ej.AlertDialogTitle,{children:"Switch provider and reset this session?"}),(0,t.jsxs)(ej.AlertDialogDescription,{children:["Switching from ",e?.runtime," to ",A," starts a fresh session. The bot cannot resume its current provider session."]})]}),(0,t.jsxs)(ej.AlertDialogFooter,{children:[(0,t.jsx)(ej.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(ej.AlertDialogAction,{onClick:()=>{T(!1),H()},children:"Switch provider"})]})]})})]})}var e7=e.i(166037),e9=e.i(820655),te=e.i(49980);function tt({count:e,className:n}){let a=e<=10?5:10,i=Math.max(1,Math.ceil(e/a)),s=Math.max(32,8*i),r=(80-(Math.min(e,a)-1)*8)/2,o=(s-(i-1)*8)/2;return(0,t.jsx)("svg",{className:n,viewBox:`0 0 80 ${s}`,role:"img","aria-label":`${e} bot slots`,children:Array.from({length:e},(e,n)=>(0,t.jsx)("circle",{cx:r+n%a*8,cy:o+8*Math.floor(n/a),r:"1.5",fill:"currentColor"},n))})}var tn=e.i(989621),ta=e.i(205189);function ti(e){let t=e.currency.toUpperCase(),n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??2,a=new Intl.NumberFormat(void 0,{style:"currency",currency:t}).format(e.unitAmount/10**n),i=1===e.intervalCount?e.interval:`${e.intervalCount} ${e.interval}s`;return`${a} ${t} / ${i}`}function ts(e){return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric"}).format(new Date(e))}function tr({open:e,onOpenChange:n,limit:a,onViewPlan:s}){return(0,t.jsx)(ed.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(ed.DialogContent,{className:"sm:max-w-md","data-testid":"upgrade-plan-modal",children:[(0,t.jsxs)(ed.DialogHeader,{children:[(0,t.jsx)(ed.DialogTitle,{children:"Plan limit reached"}),(0,t.jsxs)(ed.DialogDescription,{children:["Your owned bots have reached your plan’s limit of ",a,". You can’t create another bot. Delete bots until you own fewer than ",a," to make room."]})]}),(0,t.jsxs)(ed.DialogFooter,{children:[(0,t.jsx)(i.Button,{variant:"outline",onClick:()=>n(!1),children:"Got it"}),(0,t.jsx)(i.Button,{onClick:()=>{n(!1),s()},children:"View plan"})]})]})})}function to(){return(0,t.jsx)(s.Card,{className:"flex flex-col gap-3 p-4",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsx)(r.Skeleton,{className:"size-10 shrink-0 rounded-full"}),(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2.5 sm:items-end",children:(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1 sm:min-w-55",children:[(0,t.jsx)(r.Skeleton,{className:"h-6 w-40 max-w-full rounded"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-48 max-w-full rounded"})]})}),(0,t.jsx)(r.Skeleton,{className:"size-8 shrink-0 rounded-md"})]})})}function tl(e,a=!1){return e||a?(0,t.jsxs)("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b border-border/40 px-6",children:[e?(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-sm",onClick:e,className:"text-muted-foreground hover:text-foreground","aria-label":"Back",children:(0,t.jsx)(n.ChevronLeft,{className:"size-5"})}):(0,t.jsx)(r.Skeleton,{"data-slot":"loading-back-placeholder","aria-hidden":!0,className:"size-8 shrink-0 rounded-md"}),(0,t.jsx)("span",{className:"ml-1 truncate text-base font-semibold",children:"My Bots"})]}):null}function td({onBack:e,reserveBackSlot:n=!1}={}){return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[tl(void 0,n||!!e),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-6 overflow-y-auto p-6 thin-scrollbar",children:[(0,t.jsxs)("header",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,t.jsx)(r.Skeleton,{className:"h-6 w-24 rounded"}),(0,t.jsx)(r.Skeleton,{className:"h-4 w-full max-w-80 rounded"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(r.Skeleton,{className:"size-9 rounded-md"}),(0,t.jsx)(r.Skeleton,{className:"h-9 w-28 rounded-md"})]})]}),(0,t.jsx)("div",{className:"flex flex-col gap-6",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-lg p-1",children:[(0,t.jsxs)("div",{className:"flex h-7 items-center gap-2 px-1",children:[(0,t.jsx)(r.Skeleton,{className:"size-3 rounded"}),(0,t.jsx)(r.Skeleton,{className:"size-3.5 rounded"}),(0,t.jsx)(r.Skeleton,{className:"h-3 w-28 rounded"}),(0,t.jsx)(r.Skeleton,{className:"size-1.5 rounded-full"}),(0,t.jsx)(r.Skeleton,{className:"ml-auto h-7 w-20 rounded-md"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(to,{}),(0,t.jsx)(to,{}),(0,t.jsx)(to,{})]})]})})]})]})}e.s(["BillingContent",0,function({billing:e}){let[n,a]=(0,b.useAtom)((0,y.useCreateAtom)(null)),s=e=>a(e?.priceId??null),o=e.data,l=o?.offers.find(e=>e.priceId===n)??null,d=o?.isFounder?null:o?.subscription,c=o?.offers.find(e=>e.plan.id===o.plan.id),u="checkout"===e.returnFrom&&(o?.isFounder||!d||d.plan.id!==o?.plan.id);return(0,t.jsxs)("div",{className:tn.default.content,"data-testid":p.tid.billingSheet,children:[(0,t.jsxs)("section",{className:"pb-2","aria-label":"Current plan",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[e.isPending&&(0,t.jsx)(r.Skeleton,{className:"h-14 w-36","aria-label":"Loading billing"}),o&&(0,t.jsxs)("div",{className:"flex flex-wrap items-start gap-2",children:[(0,t.jsx)("h2",{className:tn.default.currentName,children:o.isFounder?"Founder":o.plan.displayName}),(0,t.jsx)("span",{className:"mt-1 rounded-md bg-muted px-2 py-1 text-xs font-medium leading-none text-muted-foreground",children:"Current"})]})]}),(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-sm",className:"size-11 shrink-0 text-muted-foreground sm:size-8",onClick:e.refresh,disabled:e.isFetching,"aria-label":"Refresh status","data-testid":p.tid.billingRefresh,children:(0,t.jsx)(te.RefreshCw,{className:`size-4 ${e.isFetching?"animate-spin motion-reduce:animate-none":""}`})})]}),o&&(0,t.jsxs)(t.Fragment,{children:[(o.isFounder||c||d)&&(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-3",children:[o.isFounder?(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Permanent ",o.plan.displayName," access"]}):c&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:ti(c)}),d&&!o.isFounder&&(0,t.jsxs)(i.Button,{variant:"outline",onClick:()=>void e.portal(),disabled:e.isBusy,"data-testid":p.tid.billingPortal,children:["Manage billing",(0,t.jsx)(e9.ExternalLink,{className:"size-3.5"})]})]}),(d?.scheduledChange||d?.cancelAt||d?.currentPeriodEnd||d?.status==="past_due")&&(0,t.jsxs)("div",{className:"mt-5 flex flex-col gap-3 border-t border-border pt-4 text-sm",children:[d?.scheduledChange&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("p",{children:["Changes to ",d.scheduledChange.plan.displayName," on ",ts(d.scheduledChange.effectiveAt)]}),!o.isFounder&&(0,t.jsx)(i.Button,{variant:"outline",size:"sm",onClick:()=>void e.cancelChange(),disabled:e.isBusy,"data-testid":p.tid.billingCancelChange,children:e.isCancelingChange?"Keeping current plan…":"Keep current plan"})]}),d?.cancelAt&&(0,t.jsxs)("p",{children:["Ends ",ts(d.cancelAt),". Your current access stays until then."]}),d&&!d.cancelAt&&!d.scheduledChange&&d.currentPeriodEnd&&(0,t.jsxs)("p",{className:"text-muted-foreground",children:["Current period ends ",ts(d.currentPeriodEnd)]}),d?.status==="past_due"&&(0,t.jsx)("p",{children:"Your renewal payment needs attention. Update your payment method in billing management."})]})]}),(0,t.jsxs)("p",{className:"mt-4 text-sm text-muted-foreground",children:["Questions about your plan? ",(0,t.jsxs)("a",{href:"/contact",target:"_blank",rel:"noopener noreferrer","aria-label":"Contact us (opens in a new tab)",className:"inline-flex min-h-11 items-center gap-1 rounded-sm text-foreground underline underline-offset-4 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-ring",children:["Contact us",(0,t.jsx)(e9.ExternalLink,{className:"size-3.5","aria-hidden":"true"})]})]})]}),e.isError&&(0,t.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:"Couldn't refresh your plan. Check your connection and refresh status."}),e.returnFrom&&(0,t.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"cancel"===e.returnFrom?"Checkout closed. Your current plan is shown above.":u?e.polling?"Waiting for payment confirmation. Your current access stays in place.":"Payment confirmation hasn't arrived yet. Refresh status to check again.":e.polling?"Refreshing your plan and billing status…":"Your current plan is shown above. Refresh status to check for further changes."}),o&&(0,t.jsxs)("section",{className:"flex flex-col gap-4","aria-label":"Available plans",children:[(0,t.jsx)("h2",{className:"text-base font-medium",children:d?"Change plan":"Choose a plan"}),0===o.offers.length&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Paid plans are unavailable right now. Refresh status to try again."}),(0,t.jsx)("div",{className:tn.default.offers,children:o.offers.map(n=>{let a=!!(d&&n.plan.id===o.plan.id),r=d?.scheduledChange?.plan.id===n.plan.id;return(0,t.jsxs)("article",{className:`${tn.default.offer} ${"house"===n.plan.id?tn.default.house:tn.default.studio}`,children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h3",{className:tn.default.name,children:n.plan.displayName}),(0,t.jsx)("p",{className:tn.default.price,children:ti(n)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("p",{className:tn.default.limit,children:["Up to ",(0,t.jsx)("strong",{children:n.botLimit})," active bots"]}),(0,t.jsxs)("p",{className:tn.default.limit,children:["Up to ",(0,t.jsx)("strong",{children:n.machineLimit})," online machine",1===n.machineLimit?"":"s"]})]}),(0,t.jsx)(i.Button,{className:tn.default.action,variant:a||r?"outline":"default",onClick:()=>(t=>{if(!o)return;let n=(0,ta.toAnalyticsPlanId)(t.plan.id);n&&"free"!==n&&(0,ta.trackPricingCtaClick)({plan_id:n,cta_action:"choose_plan",auth_state:"signed_in",current_plan:(0,ta.toAnalyticsCurrentPlan)(o.plan.id,o.isFounder),entry_point:"billing_sheet"}),o.isFounder?s(t):d?e.portal(t.priceId):e.checkout(t.priceId,!1,"billing_sheet")})(n),disabled:e.isBusy||!!u||a||r,"data-testid":d?p.tid.billingChangePlan:p.tid.billingCheckout,"data-price-id":n.priceId,children:e.isBusy&&!e.isCancelingChange?"Opening…":r?"Scheduled":a?"Current plan":`Choose ${n.plan.displayName}`}),(0,t.jsxs)("div",{className:tn.default.stub,children:[(0,t.jsxs)("span",{children:["Alook · ",n.botLimit," bots"]}),(0,t.jsx)(tt,{count:n.botLimit,className:tn.default.botDots})]})]},n.priceId)})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:d?"Review changes and any payment on Stripe.":"Continue to Stripe to review and pay."})]}),(0,t.jsx)(e7.FounderPlanChangeDialog,{offer:l,busy:e.isBusy,onCancel:()=>s(null),onConfirm:()=>{if(!l)return;let t=l.priceId;s(null),e.checkout(t,!0,"billing_sheet")}}),e.actionError&&(0,t.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:e.actionError})]})},"BillingSheet",0,tr],690887),e.s(["BotListSkeleton",0,td,"renderBotListView",0,function({onBack:e},n){let r=tl(e);if((n.isLoading||n.machinesLoading)&&0===n.bots.length)return(0,t.jsx)(td,{onBack:e});if(0===n.bots.length){let e=0===n.machines.length;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[r,(0,t.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 p-12 text-center",children:[(0,t.jsx)("div",{className:"w-full max-w-70 overflow-hidden rounded-xl",children:(0,t.jsx)("div",{className:"aspect-200/130 w-full",children:(0,t.jsx)(m,{})})}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h2",{className:"text-lg font-medium text-foreground",children:e?"Connect a machine first":"No bots yet"}),(0,t.jsx)("p",{className:"max-w-md text-sm text-muted-foreground",children:e?"Bots need a connected machine to run. Connect one first, then come back to create your bot.":"Create a bot and chat with it from anywhere — spin up servers and share it with family and friends."})]}),(0,t.jsx)("div",{"data-onboarding-target":"create-bot",className:"w-fit",children:(0,t.jsx)(i.Button,{onClick:e?n.openMachines:n.openGuidedCreate,disabled:!e&&n.isCreateDisabled&&!n.canShowLimit,"data-testid":e?void 0:p.tid.createBot,children:e?"Connect a machine":n.guidedCreateLabel})}),n.planSummary?.isFounder&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Founder plan"})]}),(0,t.jsx)(L,{open:n.createOpen,onOpenChange:n.setCreateOpen,onCreated:n.onBotCreated,guided:n.guidedActive,avatarSeed:n.guidedAvatarSeed}),(0,t.jsx)(tr,{open:n.billingOpen&&n.canShowLimit,onOpenChange:n.setBillingOpen,limit:n.planSummary?.limit??0,onViewPlan:n.viewPlan})]})}let o={billing:(0,t.jsx)(tr,{open:n.billingOpen&&n.canShowLimit,onOpenChange:n.setBillingOpen,limit:n.planSummary?.limit??0,onViewPlan:n.viewPlan}),create:(0,t.jsx)(L,{open:n.createOpen,onOpenChange:n.setCreateOpen,onCreated:n.onBotCreated,guided:n.guidedActive,avatarSeed:n.guidedAvatarSeed}),help:(0,t.jsx)(ek,{open:n.helpOpen,onOpenChange:n.setHelpOpen}),edit:(0,t.jsx)(e8,{bot:n.editingBot,open:n.editOpen,onOpenChange:n.setEditOpen}),activity:(0,t.jsx)(eO,{bot:n.activityBot,open:n.activityOpen,onOpenChange:n.onActivityOpenChange,onOpenChangeComplete:e=>n.onActivityOpenChangeComplete(e,n.activityGeneration)},n.activityGeneration),bug:n.bugReportBot?(0,t.jsx)(e5,{bot:n.bugReportBot,open:n.bugReportOpen,onOpenChange:n.setBugReportOpen},n.bugReportBot.id):null,deleteDialog:(0,t.jsx)(ej.AlertDialog,{open:!!n.confirmDelete,onOpenChange:e=>!e&&n.setConfirmDelete(null),children:(0,t.jsxs)(ej.AlertDialogContent,{children:[(0,t.jsxs)(ej.AlertDialogHeader,{children:[(0,t.jsxs)(ej.AlertDialogTitle,{children:["Delete ",n.confirmDelete?.name,"?"]}),(0,t.jsx)(ej.AlertDialogDescription,{children:"The bot will leave every server it's in and its runner key will be revoked. Past messages remain in history with the bot's current name and avatar."})]}),(0,t.jsxs)(ej.AlertDialogFooter,{children:[(0,t.jsx)(ej.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(ej.AlertDialogAction,{onClick:n.deleteConfirmedBot,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),resetDialog:(0,t.jsx)(ej.AlertDialog,{open:!!n.confirmReset,onOpenChange:e=>!e&&n.setConfirmReset(null),children:(0,t.jsxs)(ej.AlertDialogContent,{children:[(0,t.jsxs)(ej.AlertDialogHeader,{children:[(0,t.jsx)(ej.AlertDialogTitle,{children:"Reset this bot's session?"}),(0,t.jsx)(ej.AlertDialogDescription,{children:"Its running process will stop and it'll start a fresh session that picks up unfinished work from its notes."})]}),(0,t.jsxs)(ej.AlertDialogFooter,{children:[(0,t.jsx)(ej.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(ej.AlertDialogAction,{"data-testid":"bot-reset-confirm",onClick:n.resetConfirmedBot,children:"Reset"})]})]})}),resetMachineDialog:(0,t.jsx)(ej.AlertDialog,{open:!!n.confirmResetMachine,onOpenChange:e=>!e&&n.setConfirmResetMachine(null),children:(0,t.jsxs)(ej.AlertDialogContent,{children:[(0,t.jsxs)(ej.AlertDialogHeader,{children:[(0,t.jsxs)(ej.AlertDialogTitle,{children:["Reset all agents on ",n.confirmResetMachine?n.machineName(n.confirmResetMachine):"this machine","?"]}),(0,t.jsx)(ej.AlertDialogDescription,{children:"Every agent on this machine will start a fresh session. Any that aren't currently running will be woken too."})]}),(0,t.jsxs)(ej.AlertDialogFooter,{children:[(0,t.jsx)(ej.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(ej.AlertDialogAction,{"data-testid":"machine-reset-all-confirm",onClick:n.resetConfirmedMachine,children:"Reset all"})]})]})})};return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[r,(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-6 overflow-y-auto thin-scrollbar p-6",children:[(0,t.jsxs)("header",{className:"flex items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h1",{className:"text-xl font-medium text-foreground",children:"My Bots"}),(0,t.jsx)(f,{onViewPlan:n.viewPlan,summary:n.planSummary,isFounder:n.planSummary?.isFounder})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(i.Button,{variant:"ghost",size:"icon","aria-label":"How your agent works",onClick:()=>n.setHelpOpen(!0),className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(a.default,{className:"size-5"})}),(0,t.jsx)("div",{"data-onboarding-target":"create-bot",className:"w-fit",children:(0,t.jsx)(i.Button,{onClick:n.openGuidedCreate,disabled:n.isCreateDisabled&&!n.canShowLimit,"data-testid":p.tid.createBot,title:n.isCreateDisabled?"Bot limit reached. Delete a bot or change plan to create another.":void 0,children:n.guidedCreateLabel})})]})]}),(0,t.jsx)("div",{className:"flex flex-col gap-6",children:n.groups.map(e=>(function({machineId:e,machine:n,bots:a},r){let o=(0,A.isPresenceOnline)(n?.status),l=r.collapsedMachines.has(e),d=r.machineName(e);return(0,t.jsxs)("div",{ref:t=>{r.groupRefs.current[e]=t},className:["flex flex-col gap-3 rounded-lg p-1 transition-colors duration-500",r.highlightId===e?"bg-primary/5 ring-2 ring-primary/40":""].join(" "),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1 px-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 items-center gap-2 rounded-md text-left focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none","aria-expanded":!l,"aria-label":`${l?"Expand":"Collapse"} ${d}`,onClick:()=>{r.setCollapsedMachines(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},children:[(0,t.jsx)(K.ChevronDown,{className:`size-3 shrink-0 text-muted-foreground transition-transform ${l?"-rotate-90":""}`}),(0,t.jsx)(U.Monitor,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs font-medium text-muted-foreground",children:d}),(0,t.jsx)("span",{className:["inline-block size-1.5 shrink-0 rounded-full",o?"bg-status-online":"bg-muted-foreground"].join(" ")})]}),(0,t.jsxs)(i.Button,{variant:"ghost",size:"sm",className:"ml-auto h-7 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>r.setConfirmResetMachine(e),children:[(0,t.jsx)(W.RotateCcw,{className:"size-3.5"}),"Reset all"]})]}),(0,t.jsx)("div",{className:"pl-5",children:(0,t.jsx)(eo,{machineId:e,entries:n?.quota})})]}),(0,t.jsx)("div",{className:"flex flex-col gap-3",hidden:l,children:a.map(e=>{let a=e.isActive&&r.profilesByUserId.get(e.id)?.presence==="online",o=r.pendingActiveBotIds.has(e.id);return(0,t.jsx)(s.Card,{className:"flex flex-col gap-3 p-4",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsx)(V.AgentAvatar,{name:e.name,avatarUrl:e.image,seed:e.id,size:40}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2.5",children:[(0,t.jsxs)("div",{className:"flex min-w-55 flex-1 flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-[15px] font-medium text-foreground",children:e.name}),(0,t.jsxs)("span",{className:["inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-1 text-[11px] font-medium",a?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-muted text-muted-foreground"].join(" "),children:[(0,t.jsx)("span",{className:["inline-block size-1.5 rounded-full",a?"bg-status-online":"bg-muted-foreground"].join(" ")}),a?"Online":"Offline"]}),(!e.isActive||!a&&n)&&(0,t.jsx)(i.Button,{size:"sm",variant:"outline",className:"h-6 shrink-0 px-2 text-xs",disabled:!e.isActive&&o,"aria-busy":!e.isActive&&o||void 0,onClick:t=>{t.stopPropagation(),e.isActive?n&&r.bringMachineOnline(n.id):r.setBotActive(e,!0)},children:e.isActive?"Bring online":"Activate"})]}),(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(P.ProviderLogo,{provider:e.runtime,className:"size-3.5 shrink-0"}),(0,t.jsx)("span",{children:e.runtime})]}),(0,t.jsx)("span",{"aria-hidden":!0,className:"shrink-0",children:"·"}),(0,H.formatModelLabel)(e.runtime,e.modelName)?(0,t.jsx)("span",{"data-testid":p.tid.botCardModel,className:"font-mono",children:(0,H.formatModelLabel)(e.runtime,e.modelName)}):(0,t.jsx)("span",{"data-testid":p.tid.botCardModel,className:"font-mono text-muted-foreground/70",title:"No model set — uses the machine's local default",children:"local default"}),e.lastRefreshContextAt&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"shrink-0",children:"·"}),(0,t.jsx)("span",{className:"shrink-0",children:(0,G.formatAwakeDuration)(e.lastRefreshContextAt)})]})]})]}),e.usage?.capability==="supported"&&(0,t.jsx)(ev,{botId:e.id,usage:e.usage,className:"self-center"})]}),(0,t.jsxs)(Y.DropdownMenu,{children:[(0,t.jsx)(Y.DropdownMenuTrigger,{render:(0,t.jsx)("button",{"aria-label":"Bot actions",className:"grid size-8 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground",children:(0,t.jsx)(Q.MoreVertical,{className:"size-4"})})}),(0,t.jsxs)(Y.DropdownMenuContent,{align:"end",className:"w-auto min-w-36 max-w-56",children:[(0,t.jsxs)(Y.DropdownMenuItem,{onClick:()=>r.chatWithBot(e),children:[(0,t.jsx)("span",{className:"size-4","aria-hidden":!0})," Chat"]}),(0,t.jsxs)(Y.DropdownMenuItem,{onClick:()=>r.openActivity(e),children:[(0,t.jsx)(q.Activity,{className:"size-4"})," View activity"]}),(0,t.jsxs)(Y.DropdownMenuItem,{onClick:()=>{r.setEditingBot(e),r.setEditOpen(!0)},children:[(0,t.jsx)("span",{className:"size-4","aria-hidden":!0})," Edit"]}),(0,t.jsxs)(Y.DropdownMenuItem,{"data-testid":"bot-reset-session-item",onClick:()=>r.setConfirmReset(e),children:[(0,t.jsx)(W.RotateCcw,{className:"size-4"})," Reset"]}),(0,t.jsxs)(Y.DropdownMenuItem,{"data-testid":p.tid.botReportProblemItem,onClick:()=>{r.setBugReportBot({id:e.id,name:e.name}),r.setBugReportOpen(!0)},children:[(0,t.jsx)("span",{className:"size-4","aria-hidden":!0})," Report a problem"]}),(0,t.jsxs)(Y.DropdownMenuItem,{"data-testid":p.tid.botActive(e.id),disabled:o,"aria-busy":o||void 0,onClick:()=>{r.setBotActive(e,!e.isActive)},children:[(0,t.jsx)("span",{className:"size-4","aria-hidden":!0})," ",e.isActive?"Deactivate":"Activate"]}),(0,t.jsxs)(Y.DropdownMenuItem,{variant:"destructive",onClick:()=>r.setConfirmDelete(e),children:[(0,t.jsx)("span",{className:"size-4","aria-hidden":!0})," Delete"]})]})]})]})},e.id)})})]},e)})(e,n))})]}),o.create,o.billing,o.help,o.edit,o.activity,o.bug,o.deleteDialog,o.resetDialog,o.resetMachineDialog]})}],765867)},972525,e=>{"use strict";var t=e.i(237649),n=e.i(382416),a=e.i(873120),i=e.i(186339),s=e.i(332680),r=e.i(777104),o=e.i(561261),l=e.i(613349);function d({onPointerDown:e,onPointerMove:n,onPointerUp:a,className:i,withHandle:s=!0}){return(0,t.jsx)("div",{onPointerDown:e,onPointerMove:n,onPointerUp:a,onLostPointerCapture:a,className:(0,l.cn)("hidden sm:flex absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize z-10 items-center justify-center hover:bg-primary/10 active:bg-primary/20 transition-colors rounded-l-xl",i),children:s&&(0,t.jsx)("div",{className:"h-6 w-1 rounded-lg bg-border"})})}function c({width:e,maxWidth:n,resize:r,title:o,description:u,headerLeading:m,footer:p,children:h,bodyClassName:x,bodyRef:f,closeLabel:g,contentTestId:b,bodyTestId:y,requestClose:v}){let j="function"==typeof p?p(v):p;return(0,t.jsxs)(s.SheetContent,{"data-testid":b,side:"right",showOverlay:!0,showCloseButton:!1,style:{"--community-sheet-width":`${e}px`,"--community-sheet-max-width":n,maxWidth:"none"},className:(0,l.cn)("data-[side=right]:h-dvh data-[side=right]:w-screen data-[side=right]:max-w-none data-[side=right]:overflow-hidden","data-[side=right]:sm:inset-y-2 data-[side=right]:sm:right-2 data-[side=right]:sm:h-auto data-[side=right]:sm:w-[clamp(20rem,var(--community-sheet-width),min(var(--community-sheet-max-width),calc(100vw-1rem)))] data-[side=right]:sm:rounded-xl data-[side=right]:sm:border"),children:[r&&(0,t.jsx)(d,{...r}),(0,t.jsx)(s.SheetHeader,{className:"pr-14 sm:pr-14",children:null==m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.SheetTitle,{className:"truncate",children:o}),null!=u&&(0,t.jsx)(s.SheetDescription,{children:u})]}):(0,t.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,t.jsx)("div",{"data-slot":"sheet-header-leading",className:"shrink-0",children:m}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,t.jsx)(s.SheetTitle,{className:"truncate",children:o}),null!=u&&(0,t.jsx)(s.SheetDescription,{children:u})]})]})}),(0,t.jsx)(s.SheetBody,{ref:f,"data-testid":y,className:x,children:h}),null!=j&&(0,t.jsx)(s.SheetFooter,{className:"flex-row items-center justify-end **:data-[slot=button]:min-h-11 sm:**:data-[slot=button]:min-h-0",children:j}),(0,t.jsxs)(i.Button,{type:"button",variant:"ghost",size:"icon-sm",className:"absolute top-0.5 right-0.5 z-20 size-11 sm:top-3 sm:right-3 sm:size-7","aria-label":g,onClick:v,children:[(0,t.jsx)(a.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:g})]})]})}function u({desktopWidth:e,...a}){let i=function({defaultWidth:e=480,minWidth:t=320,maxWidthRatio:a=.8}={}){let[i,s]=(0,r.useAtom)((0,o.useCreateAtom)(e)),l=(0,n.useRef)(!1),d=(0,n.useCallback)(e=>{e.preventDefault(),e.target.setPointerCapture(e.pointerId),l.current=!0},[]);return{width:i,onPointerDown:d,onPointerMove:(0,n.useCallback)(e=>{l.current&&s(Math.min(window.innerWidth*a,Math.max(t,window.innerWidth-e.clientX)))},[a,s,t]),onPointerUp:(0,n.useCallback)(e=>{l.current=!1,e.target.releasePointerCapture(e.pointerId)},[])}}({defaultWidth:m(e)});return(0,t.jsx)(c,{...a,width:i.width,maxWidth:"80vw",resize:i})}function m(e){return Number.isFinite(e)?Math.max(320,e):480}e.s(["CommunitySheet",0,function({open:e,onOpenChange:a,onOpenChangeComplete:i,title:r,description:o,headerLeading:l,footer:d,children:p,bodyClassName:h,bodyRef:x,desktopWidth:f=480,resizable:g=!1,closeLabel:b="Close",contentTestId:y,bodyTestId:v}){let j=n.useCallback(()=>a(!1),[a]),N=n.useCallback(e=>{e?a(!0):j()},[a,j]);return(0,t.jsx)(s.Sheet,{open:e,onOpenChange:N,onOpenChangeComplete:i,modal:!0,children:g?(0,t.jsx)(u,{title:r,description:o,headerLeading:l,footer:d,bodyClassName:h,bodyRef:x,desktopWidth:f,closeLabel:b,contentTestId:y,bodyTestId:v,requestClose:j,children:p}):(0,t.jsx)(c,{width:m(f),maxWidth:"80vw",title:r,description:o,headerLeading:l,footer:d,bodyClassName:h,bodyRef:x,closeLabel:b,contentTestId:y,bodyTestId:v,requestClose:j,children:p})})}],972525)},678401,e=>{"use strict";var t=e.i(204779),n=e.i(382416),a=e.i(765686),i=e.i(159514),s=e.i(343699),r=e.i(849050),o=e.i(374402),l=e.i(323512),d=e.i(636557);let c=(e,t)=>e.createdAt===t.createdAt?e.id>t.id?-1:+(e.id<t.id):e.createdAt>t.createdAt?-1:1;e.s(["appendBotAuditEvent",0,function(e,t,n){let a=o.communityKeys.botAuditLog(t),i=e.getQueryCache().find({queryKey:a,exact:!0}),s=i?.state.dataUpdatedAt??0,r=!i?.getObserversCount(),l=!1;e.setQueryData(a,e=>{let[t,...a]=e?.pages??[],i=new Map((t?.events??[]).map(e=>[e.id,e])),s=i.get(n.id);if(s&&0>=c(s,n))return e;i.set(n.id,n);let o=[...i.values()].sort(c),d=(l=r&&o.length>200)?o.slice(0,200):o,u=new Set(d.map(e=>e.id)),m=[...new Set([n.id,...t?.liveIds??[]])].filter(e=>u.has(e));return{pages:[{...t,events:d,nextCursor:t?.nextCursor??null,liveIds:m},...a],pageParams:e?.pageParams??[null]}},{updatedAt:s}),l&&e.invalidateQueries({queryKey:a,exact:!0,refetchType:"none"})},"useBotAuditLog",0,function(e){let u=(0,i.useQueryClient)(),m=(0,a.useInfiniteQuery)({enabled:!!e,queryKey:e?o.communityKeys.botAuditLog(e):["disabled-bot-audit-log"],structuralSharing:(t,n)=>(function(e,t,n=!1){if(!t?.pages[0])return(0,s.replaceEqualDeep)(e,t);let a=new Set(t.pages[0].liveIds),i=new Set(t.pages.flatMap(e=>e.events.filter(e=>!a.has(e.id)).map(e=>e.id))),r=new Set([...e?.pages[0]?.liveIds??[],...a].filter(e=>!i.has(e))),o=new Map(t.pages[0].events.map(e=>[e.id,e])),l=new Set(t.pages.slice(1).flatMap(e=>e.events.map(e=>e.id)));for(let t of e?.pages[0]?.events??[])!r.has(t.id)||o.has(t.id)||l.has(t.id)||o.set(t.id,t);let d=[...o.values()].sort(c),u=n?d.slice(0,200):d,m=new Set(u.map(e=>e.id)),[p,...h]=t.pages;return(0,s.replaceEqualDeep)(e,{...t,pages:[{...p,events:u,liveIds:[...r].filter(e=>m.has(e))},...h]})})(t,n,!u.getQueryCache().find({queryKey:o.communityKeys.botAuditLog(e),exact:!0})?.getObserversCount()),initialPageParam:null,queryFn:async({pageParam:n,signal:a})=>{let i=(0,l.captureCommunityLiveSnapshotToken)(u),s=new URLSearchParams;s.set("limit",String(50)),n&&(s.set("beforeCreatedAt",n.beforeCreatedAt),s.set("beforeId",n.beforeId));let d=await (0,r.apiFetch)(`/api/community/bots/${e}/audit-log?${s.toString()}`,(0,t.communityRequestOptions)(u,i,a));if(n)return d;let c=new Set(d.events.map(e=>e.id)),m=u.getQueryData(o.communityKeys.botAuditLog(e))?.pages[0],p=new Set(m?.liveIds),h=m?.events.filter(e=>p.has(e.id)&&!c.has(e.id))??[];return h.length?{...d,events:[...h,...d.events],liveIds:h.map(e=>e.id)}:d},retry:(e,t)=>!(t instanceof d.ApiError&&404===t.status)&&e<1,staleTime:3e4,getNextPageParam:e=>e.nextCursor});return{events:(0,n.useMemo)(()=>{if(!m.data)return[];let e=new Set,t=[];for(let n of m.data.pages)for(let a of n.events)e.has(a.id)||(e.add(a.id),t.push(a));return t},[m.data]),error:m.error,isError:m.isError,isLoading:m.isLoading,fetchNextPage:m.fetchNextPage,hasNextPage:m.hasNextPage,isFetchingNextPage:m.isFetchingNextPage}}])},985885,e=>{"use strict";var t=e.i(693760),n=e.i(984858),a=e.i(557922),i=e.i(362790),s=e.i(159514),r=e.i(152845),o=e.i(374402),l=e.i(280958),d=e.i(382416),c=e.i(902429),u=e.i(351777),m=e.i(86694),p=e.i(695230),h=e.i(193497);function x(e){return{id:e.id,identityAbout:{name:e.name,kind:"bot",..."discriminator"in e&&"string"==typeof e.discriminator?{discriminator:e.discriminator}:{},...void 0===e.description?{}:{aboutMe:e.description}},avatar:{avatar:e.image??(0,l.avatarInitial)(e.name),avatarVersion:e.avatarVersion}}}let f=e=>[o.communityKeys.bots(),o.communityKeys.friends(),o.communityKeys.dms(),...e?[o.communityKeys.profile(e)]:[]],g=()=>f(),b=({id:e})=>f(e),y=({botId:e})=>f(e),v=({id:e})=>[o.communityKeys.botAuditLog(e)],j=()=>[];function N(e,t,a){let l=(0,s.useQueryClient)(),u=(0,h.useCommunityMutationOrigin)(),m=(0,i.useMutation)({meta:{observabilityAction:(0,n.resolveActionName)("bot.command",{kind:e})},mutationKey:[...o.communityKeys.bots(),e],scope:{id:"community-bot-command"},gcTime:0,mutationFn:async({input:e,original:n,resources:a})=>{let i=()=>{u.assert(n),e.assertActive?.()};i();let s=(0,r.beginCommunityProfileSeed)(u.registry);try{for(let e of a)l.getQueryCache().find({queryKey:e.queryKey,exact:!0})===e&&await l.cancelQueries({queryKey:e.queryKey,exact:!0});i(),await u.registry.collections.profiles.preload(),i();let o=await t(e,{client:l,resources:a,assert:i,request:(t,a)=>u.request(n,t,{...a,signal:e.assertActive?.signal,assertActive:i}),publishProfile:e=>{i(),(0,r.writeCommunityProfilePatches)([e],u.registry,{snapshot:s,command:!0})}});return i(),o}finally{try{for(let e of(u.assert(n),a))l.getQueryCache().find({queryKey:e.queryKey,exact:!0})===e&&l.invalidateQueries({queryKey:e.queryKey,exact:!0}).catch(()=>void 0)}catch{}}}}),p=(0,d.useCallback)(e=>(e.assertActive?.(),{input:e,original:u.begin().token,resources:[...new Set(a(e).flatMap(e=>l.getQueryCache().findAll({queryKey:e})))]}),[u,l,a]),x=(0,d.useCallback)(e=>{u.assert(e.original),e.input.assertActive?.()},[u]);return(0,c.useNativeMutationFacade)(m,p,x)}let w=e=>"string"==typeof e?{id:e}:e;function C(e){let t=(0,d.useCallback)((e,t)=>t&&{onSuccess:(n,a,i,s)=>t.onSuccess?.(n,e,i,s),onError:(n,a,i,s)=>t.onError?.(n,e,i,s),onSettled:(n,a,i,s,r)=>t.onSettled?.(n,a,e,s,r)},[]),n=e.mutate,a=e.mutateAsync,i=(0,d.useCallback)((e,a)=>n(w(e),t(e,a)),[n,t]),s=(0,d.useCallback)((e,n)=>a(w(e),t(e,n)),[a,t]);return{...e,mutate:i,mutateAsync:s}}e.s(["useBots",0,function(){let e=(0,s.useQueryClient)(),n=(0,a.useQuery)({queryKey:o.communityKeys.bots(),queryFn:async({client:e,signal:t})=>{let n=await (0,r.apiFetchProfiles)("/api/community/bots",e=>e.bots.map(e=>({...x(e),presence:e.presence})),{signal:t},(0,p.getCommunityDbRegistry)(e));return{...n,bots:n.bots.map(({name:e,description:t,image:n,avatarVersion:a,presence:i,...s})=>s)}}}),i=(0,m.useCanonicalProfilesByUserId)(n.data?.bots.map(e=>e.id)??[]),l=(0,d.useMemo)(()=>(n.data?.bots??[]).map(a=>{let s=(0,u.readCommunityProfile)(i.get(a.id),a.id);return(0,t.deriveView)({...a,name:s.name,description:s.aboutMe,image:s.avatar,avatarVersion:s.avatarVersion,presence:s.presence},[(0,t.valueEvidence)(e,n.data),(0,t.viewEvidence)(s)])}),[i,n.data,e]);return(0,t.deriveView)(l,[(0,t.valueEvidence)(e,n.data),...l.map(t.viewEvidence)]),{...n,bots:l}},"useCreateBot",0,function(){return N("create-command",async({assertActive:e,...t},n)=>{let a=await n.request("/api/community/bots",{method:"POST",body:JSON.stringify(t)});return n.publishProfile(x(a.bot)),a},g)},"useDeleteBot",0,function(){return C(N("delete-command",async({id:e},t)=>{await t.request("/api/community/bots/"+e,{method:"DELETE"})},b))},"useResetBotSession",0,function(){return C(N("reset-command",({id:e},t)=>t.request("/api/community/bots/"+e+"/reset-session",{method:"POST"}),v))},"useResetMachineAgents",0,function(){return C(N("machine-reset-command",({id:e},t)=>t.request("/api/community/machines/"+e+"/reset-agents",{method:"POST"}),j))},"useSetBotActive",0,function(){return N("active-command",async({id:e,active:t},n)=>{let a=o.communityKeys.bots(),i=n.resources.find(e=>e.queryHash===n.client.getQueryCache().find({queryKey:a,exact:!0})?.queryHash),s=i?.state.dataUpdateCount,r=await n.request("/api/community/bots/"+e+"/active",{method:"PATCH",body:JSON.stringify({active:t})});return n.assert(),i&&n.client.getQueryCache().find({queryKey:a,exact:!0})===i&&i.state.dataUpdateCount===s&&n.client.setQueryData(a,e=>{if(!e)return e;let t=e.bots.find(e=>e.id===r.bot.id);return t&&t.isActive!==r.bot.isActive?{...e,activeCount:Math.max(0,e.activeCount+(r.bot.isActive?1:-1)),bots:e.bots.map(e=>e.id===r.bot.id?{...e,isActive:r.bot.isActive}:e)}:e}),r},b)},"useUpdateBot",0,function(){return N("update-command",async({id:e,assertActive:t,...n},a)=>{let i=await a.request("/api/community/bots/"+e,{method:"PATCH",body:JSON.stringify(n)});a.publishProfile(x(i.bot));let s=o.communityKeys.bots();return a.resources.find(e=>a.client.getQueryCache().find({queryKey:s,exact:!0})===e)&&a.client.setQueryData(s,t=>t?{...t,bots:t.bots.map(t=>t.id===e&&t.runtimeConfigRevision<=i.bot.runtimeConfigRevision?{...t,runtime:i.bot.runtime,modelName:i.bot.modelName,reasoningEffort:i.bot.reasoningEffort,runtimeConfigRevision:i.bot.runtimeConfigRevision}:t)}:t),i},b)},"useUploadBotAvatar",0,function(){return N("avatar-command",async({botId:e,file:t},n)=>{let a=new FormData;a.append("file",t);let i=await n.request("/api/community/bots/"+e+"/avatar",{method:"POST",body:a});return n.publishProfile({id:e,avatar:{avatar:i.url,avatarVersion:i.avatarVersion}}),i},y)}])},617527,e=>{"use strict";var t=e.i(693760),n=e.i(159514),a=e.i(557922);e.i(954194);var i=e.i(846367),s=e.i(323512),r=e.i(849050),o=e.i(374402);let l=Object.freeze([]),d=e=>(0,r.apiFetch)("/api/community/machines",(0,s.communityRequestOptions)(e.client,e.signal));e.s(["machinesQueryFn",0,d,"replaceMachines",0,function(e,t){return{...e,machines:t,...e.machineCapacity?{machineCapacity:{...e.machineCapacity,ownedCount:t.length,onlineCount:t.filter(e=>(0,i.isPresenceOnline)(e.status)).length}}:{}}},"useMachines",0,function(e){let i=(0,n.useQueryClient)(),s=(0,a.useQuery)({queryKey:o.communityKeys.machines(),queryFn:d,...e}),r=s.data?.machines??l;return(0,t.deriveView)(r,[(0,t.valueEvidence)(i,s.data)]),{...s,machines:r}}])},366020,e=>{"use strict";var t=e.i(152961),n=e.i(474707),a=e.i(205189);function i(e,t){if(!e.lifecycle.get().active)throw new DOMException("Retired onboarding owner","AbortError");return e.ui.setState(e=>({...e,onboardingState:t})),t}function s(e){return e.ui.get().onboardingState}e.s(["advanceCommunityOnboarding",0,function(e,t,n,r={}){let o=s(e);if(o?.status!=="active"||o.stage!==t)return o;let l={...o,...r,status:"active",stage:n};return i(e,l),(0,a.trackCommunityOnboardingStageCompleted)(t),l},"completeCommunityOnboarding",0,function(e){let t=s(e);return t?.status!=="active"||"initializing"!==t.stage?t:(i(e,null),(0,a.trackCommunityOnboardingStageCompleted)("initializing"),(0,a.trackCommunityOnboardingCompleted)(),null)},"isCommunityOnboardingStage",0,function(e,t){let n=s(e);return n?.status==="active"&&n.stage===t},"readCommunityOnboardingState",0,s,"recoverCommunityOnboardingHarness",0,function(e){let t=s(e);if(t?.status!=="active"||"machine"!==t.stage)return t;let{harness:n,machineId:a,...r}=t;return i(e,{...r,stage:"harness"})},"recoverCommunityOnboardingMachine",0,function(e){let t=s(e);return t?.status!=="active"||"bot"!==t.stage?t:i(e,{...t,machineRecovery:!0})},"skipCommunityOnboarding",0,function(e){let t=s(e);if(!t)return null;let n=t.stage;return i(e,null),(0,a.trackCommunityOnboardingSkipped)(n),null},"startCommunityOnboarding",0,function(e,t={}){let n=s(e);if(n)return n;let r={...t,status:"active",stage:"harness"};return i(e,r),(0,a.trackCommunityOnboardingStarted)(),r},"updateCommunityOnboardingInitialization",0,function(e,t){let n=s(e);if(n?.stage!=="initializing")throw new DOMException("Retired onboarding initialization","AbortError");return i(e,{...n,initialization:t(n.initialization??{checkpoint:{},step:"creating-bots",result:null,pendingDestination:null})})},"updateCommunityOnboardingResources",0,function(e,t){let n=s(e);return n?.status!=="active"?n:i(e,{...n,...t})},"useCommunityOnboarding",0,function(){return(0,t.useSelector)((0,n.useCommunityRuntime)().ui,e=>e.onboardingState)}])},183866,e=>{"use strict";let t={cli_invocation:"alook command",tool_call:"tool",thinking:"Updated its reasoning",turn_interrupt:"Stop accepted by daemon",wake_trigger:"Woke for a new message",session_reset:"Session reset requested",nap:"Started a fresh session",model_changed:"Model changed",provider_changed:"Provider changed",error:"Encountered an error"},n={send:"message send",read:"channel history",resolve:"channel history",reactAdd:"message emoji",messagePropertySet:"message property set",messagePropertyList:"message property list",messagePropertyRemove:"message property remove",markSet:"message mark set",markRemove:"message mark remove",markList:"message mark list",channelMember:"channel member",attachmentUpload:"message attachment upload",attachmentDownload:"message attachment download",listMembers:"server member",listChannels:"channel list",listFriends:"friend list",friendRequest:"friend request",inboxPull:"inbox pull",inboxSnapshot:"inbox pull",profileBioUpdate:"setting profile",profileAvatarUpdate:"setting profile",nap:"nap"};function a(e){let t=e&&"object"==typeof e&&"subcommand"in e&&"string"==typeof e.subcommand?e.subcommand:null;if(!t)return"alook command";let a=n[t]??t.replace(/([a-z\d])([A-Z])/g,"$1 $2").toLowerCase(),i=e&&"object"==typeof e&&"propertyType"in e&&("emoji"===e.propertyType||"tag"===e.propertyType||"mark"===e.propertyType)&&("messagePropertySet"===t||"messagePropertyRemove"===t)?e.propertyType:null;return`alook ${a}${i?` ${i}`:""}`}function i(e){return(e&&"object"==typeof e&&"name"in e&&"string"==typeof e.name?e.name.trim().toLowerCase():"")||"tool"}e.s(["formatAlookAuditCommand",0,a,"formatAuditPreviewTime",0,function(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})},"formatAuditToolName",0,i,"summarizeAuditEvent",0,function(e){return"cli_invocation"===e.kind?a(e.payload):"tool_call"===e.kind?i(e.payload):t[e.kind]}])}]);
|