thursday-agent 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/app/_global-error.html +1 -1
  5. package/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  9. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  10. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/_not-found.html +1 -1
  12. package/.next/server/app/_not-found.rsc +2 -2
  13. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  14. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  15. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  16. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  17. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  18. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  19. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  20. package/.next/server/app/api/bot/task/[id]/route.js.nft.json +1 -1
  21. package/.next/server/app/api/bot/task/route.js.nft.json +1 -1
  22. package/.next/server/app/api/config/route.js.nft.json +1 -1
  23. package/.next/server/app/api/events/route.js.nft.json +1 -1
  24. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  25. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  26. package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -1
  27. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  28. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  29. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  30. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  31. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  32. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  33. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  34. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  35. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  36. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  37. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  38. package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
  39. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  40. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  41. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
  42. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  43. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  44. package/.next/server/app/page/server-reference-manifest.json +40 -40
  45. package/.next/server/app/page.js +2 -2
  46. package/.next/server/app/page.js.nft.json +1 -1
  47. package/.next/server/app/page_client-reference-manifest.js +1 -1
  48. package/.next/server/chunks/[root-of-the-server]__02va5wz._.js +1 -1
  49. package/.next/server/chunks/[root-of-the-server]__0ls6_8y._.js +4 -4
  50. package/.next/server/chunks/[root-of-the-server]__0ncs9uu._.js +1 -1
  51. package/.next/server/chunks/[root-of-the-server]__1-ga0kh._.js +2 -2
  52. package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +2 -2
  53. package/.next/server/chunks/[root-of-the-server]__1anc1p9._.js +1 -1
  54. package/.next/server/chunks/[root-of-the-server]__1ccon1w._.js +3 -3
  55. package/.next/server/chunks/[root-of-the-server]__1orn-5b._.js +4 -3
  56. package/.next/server/chunks/[root-of-the-server]__1wa1k7r._.js +3 -3
  57. package/.next/server/chunks/_0-fjql4._.js +5 -5
  58. package/.next/server/chunks/_00xh_q0._.js +3 -5
  59. package/.next/server/chunks/_05h2cii._.js +1 -1
  60. package/.next/server/chunks/_0fzqt2y._.js +48 -44
  61. package/.next/server/chunks/_0mecv0f._.js +5 -5
  62. package/.next/server/chunks/_0mh8j4m._.js +1 -1
  63. package/.next/server/chunks/_0wp4le3._.js +1 -1
  64. package/.next/server/chunks/_0y5fg-x._.js +1 -1
  65. package/.next/server/chunks/_1230wbx._.js +3 -3
  66. package/.next/server/chunks/_15hq89o._.js +1 -1
  67. package/.next/server/chunks/{_03kp0jp._.js → _1c78vw5._.js} +58 -56
  68. package/.next/server/chunks/_1j8k_j5._.js +1 -1
  69. package/.next/server/chunks/_1krd9rf._.js +1 -1
  70. package/.next/server/chunks/_1php4eq._.js +1 -1
  71. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  72. package/.next/server/chunks/features_1qf3cei._.js +1 -1
  73. package/.next/server/chunks/features_memory_1uqvksn._.js +2 -2
  74. package/.next/server/chunks/ssr/[root-of-the-server]__092knlj._.js +3 -0
  75. package/.next/server/chunks/ssr/{[root-of-the-server]__1eh7hid._.js → [root-of-the-server]__0s9dq5u._.js} +1 -1
  76. package/.next/server/chunks/ssr/{[root-of-the-server]__1cyjywu._.js → [root-of-the-server]__0s9l2sv._.js} +1 -1
  77. package/.next/server/chunks/ssr/{[root-of-the-server]__0zkv7z_._.js → [root-of-the-server]__0xsog8n._.js} +2 -2
  78. package/.next/server/chunks/ssr/[root-of-the-server]__10-dz5o._.js +13 -9
  79. package/.next/server/chunks/ssr/[root-of-the-server]__1gtlw6v._.js +2 -2
  80. package/.next/server/chunks/ssr/[root-of-the-server]__1mzi-ju._.js +1 -1
  81. package/.next/server/chunks/ssr/[root-of-the-server]__1ox7hbk._.js +1 -1
  82. package/.next/server/chunks/ssr/{[root-of-the-server]__0_69wqr._.js → [root-of-the-server]__202p40z._.js} +1 -1
  83. package/.next/server/chunks/ssr/_001_ms1._.js +1 -1
  84. package/.next/server/chunks/ssr/{_0c-ql2m._.js → _0fz4mf_._.js} +2 -2
  85. package/.next/server/chunks/ssr/{_07uchnc._.js → _0gb4gmf._.js} +2 -2
  86. package/.next/server/chunks/ssr/_0i_6q1w._.js +2 -2
  87. package/.next/server/chunks/ssr/{_20kd_n0._.js → _0ilna52._.js} +3 -3
  88. package/.next/server/chunks/ssr/{_0mo2w06._.js → _0n3toaw._.js} +2 -2
  89. package/.next/server/chunks/ssr/{_0mb8zc8._.js → _0s99bgb._.js} +2 -2
  90. package/.next/server/chunks/ssr/_0zcjrbg._.js +3 -0
  91. package/.next/server/chunks/ssr/{_13z3f85._.js → _1-_etts._.js} +2 -2
  92. package/.next/server/chunks/ssr/_13fke0x._.js +1 -1
  93. package/.next/server/chunks/ssr/{_01_6m32._.js → _1b2mjwr._.js} +2 -2
  94. package/.next/server/chunks/ssr/{_1eoqg_g._.js → _1f-dg-6._.js} +2 -2
  95. package/.next/server/chunks/ssr/{_0y0tiht._.js → _1fojd41._.js} +3 -3
  96. package/.next/server/chunks/ssr/_1gd8q8l._.js +3 -0
  97. package/.next/server/chunks/ssr/{_1xvgn77._.js → _1h0rw11._.js} +2 -2
  98. package/.next/server/chunks/ssr/_1jhd09t._.js +3 -0
  99. package/.next/server/chunks/ssr/{_0u2jv_x._.js → _1lz_cq2._.js} +46 -44
  100. package/.next/server/chunks/ssr/{_0kbkmar._.js → _1nnsk7z._.js} +2 -2
  101. package/.next/server/chunks/ssr/_1sji22n._.js +1 -1
  102. package/.next/server/chunks/ssr/_1vyd1ji._.js +1 -1
  103. package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
  104. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  105. package/.next/server/chunks/ssr/{node_modules_0z5tsu8._.js → node_modules_00etblx._.js} +1 -1
  106. package/.next/server/chunks/ssr/{node_modules_1h4a4pp._.js → node_modules_04jf_m8._.js} +1 -1
  107. package/.next/server/chunks/ssr/{node_modules_0h5hnr1._.js → node_modules_08dhkiq._.js} +1 -1
  108. package/.next/server/chunks/ssr/{node_modules_1vqb6po._.js → node_modules_0940ns5._.js} +1 -1
  109. package/.next/server/chunks/ssr/{node_modules_1i7u1ia._.js → node_modules_09q35v_._.js} +1 -1
  110. package/.next/server/chunks/ssr/{node_modules_124bue5._.js → node_modules_0_-_a--._.js} +1 -1
  111. package/.next/server/chunks/ssr/{node_modules_0h7u60n._.js → node_modules_0arus10._.js} +1 -1
  112. package/.next/server/chunks/ssr/{node_modules_0rjg6t1._.js → node_modules_0b__sgl._.js} +1 -1
  113. package/.next/server/chunks/ssr/{node_modules_113tz0l._.js → node_modules_0cxaxk9._.js} +1 -1
  114. package/.next/server/chunks/ssr/{node_modules_0lm7_vm._.js → node_modules_0g7fzk3._.js} +1 -1
  115. package/.next/server/chunks/ssr/{node_modules_0h50b8n._.js → node_modules_0had7xd._.js} +1 -1
  116. package/.next/server/chunks/ssr/{node_modules_1-hc6uv._.js → node_modules_0pvd7q-._.js} +1 -1
  117. package/.next/server/chunks/ssr/{node_modules_1bc7gu8._.js → node_modules_0yugy6m._.js} +1 -1
  118. package/.next/server/chunks/ssr/{node_modules_0y_cded._.js → node_modules_14om4ar._.js} +1 -1
  119. package/.next/server/chunks/ssr/{node_modules_0zp9r92._.js → node_modules_14q6g4n._.js} +1 -1
  120. package/.next/server/chunks/ssr/{node_modules_0eu1va6._.js → node_modules_198nmll._.js} +1 -1
  121. package/.next/server/chunks/ssr/{node_modules_1t9cyee._.js → node_modules_1_pc9kq._.js} +1 -1
  122. package/.next/server/chunks/ssr/{node_modules_063xwpp._.js → node_modules_1aaxuef._.js} +1 -1
  123. package/.next/server/chunks/ssr/{node_modules_0bvraul._.js → node_modules_1cx_ql6._.js} +1 -1
  124. package/.next/server/chunks/ssr/{node_modules_1xx28h1._.js → node_modules_1cz2hle._.js} +1 -1
  125. package/.next/server/chunks/ssr/{node_modules_1l0qtdu._.js → node_modules_1efrqxi._.js} +1 -1
  126. package/.next/server/chunks/ssr/{node_modules_1juq3hs._.js → node_modules_1eg7m6c._.js} +1 -1
  127. package/.next/server/chunks/ssr/{node_modules_1_n3ztw._.js → node_modules_1gdh31p._.js} +1 -1
  128. package/.next/server/chunks/ssr/{node_modules_0mwym0g._.js → node_modules_1hpopmo._.js} +1 -1
  129. package/.next/server/chunks/ssr/{node_modules_1bgb6-f._.js → node_modules_1qpjvy5._.js} +1 -1
  130. package/.next/server/chunks/ssr/{node_modules_1uuj9x1._.js → node_modules_1vh5ntv._.js} +1 -1
  131. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0d3skpl._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1b748ic._.js} +1 -1
  132. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0i44kk5._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1z4hm5e._.js} +1 -1
  133. package/.next/server/chunks/ssr/{node_modules_@vercel_oidc_dist_0qe30a_._.js → node_modules_@vercel_oidc_dist_06mk8id._.js} +1 -1
  134. package/.next/server/middleware-build-manifest.js +3 -3
  135. package/.next/server/pages/404.html +1 -1
  136. package/.next/server/pages/500.html +1 -1
  137. package/.next/server/server-reference-manifest.js +1 -1
  138. package/.next/server/server-reference-manifest.json +41 -41
  139. package/.next/static/chunks/00rd4-v8r7axp.js +1 -0
  140. package/.next/static/chunks/{0tmgrnlje14-s.js → 08qe4as2q428z.js} +2 -2
  141. package/.next/static/chunks/{3ok9_x74rip3v.js → 0fl3gwe4-l6tz.js} +1 -1
  142. package/.next/static/chunks/{2a0k6jlq0_v1u.js → 0gnqdjn2lvdad.js} +2 -2
  143. package/.next/static/chunks/{1okqiww3pnwka.js → 0hwap1-p0m5sa.js} +1 -1
  144. package/.next/static/chunks/{1ekc7ul556kbl.js → 0w52rrrmuj9r9.js} +1 -1
  145. package/.next/static/chunks/{3agpgkwaa321p.js → 0wcprt5ot5she.js} +1 -1
  146. package/.next/static/chunks/{3xpbkl66ssib5.js → 15m575979un5f.js} +6 -6
  147. package/.next/static/chunks/{2fzs9fm8yarvq.js → 17p6tk6k88dq6.js} +1 -1
  148. package/.next/static/chunks/{26-pr2c9ro222.js → 1jd09sxcjddu1.js} +1 -1
  149. package/.next/static/chunks/{280t0_e99i276.js → 1w73ece_6bheu.js} +1 -1
  150. package/.next/static/chunks/{1grhjo7a5a0_-.js → 214ya3n5gxeih.js} +1 -1
  151. package/.next/static/chunks/22_zkas21rpna.js +1 -0
  152. package/.next/static/chunks/{0x79tx04dxbpp.js → 2u7xt6mxg44lf.js} +1 -1
  153. package/.next/static/chunks/{17donp69y4do7.js → 39j0fvpybzabl.js} +8 -8
  154. package/.next/static/chunks/{28cizcdaabd4h.js → 3akmqm77muj4-.js} +1 -1
  155. package/.next/static/chunks/3cq5g494yuke8.css +1 -0
  156. package/.next/static/chunks/3woj-xd7ki5_i.js +1 -0
  157. package/.next/static/chunks/{3cfi_q6d_wtci.js → 3zmcsnuo25zvq.js} +1 -1
  158. package/README.md +46 -23
  159. package/app/api/events/app-event.ts +0 -2
  160. package/bin/port.mjs +65 -0
  161. package/bin/thursday.mjs +2 -33
  162. package/docs/how-it-works.md +11 -7
  163. package/docs/images/face-dark.png +0 -0
  164. package/docs/images/face-light.png +0 -0
  165. package/docs/images/keeps-going.png +0 -0
  166. package/features/ai/chatgpt.ts +42 -20
  167. package/features/ai/load-tools.ts +20 -14
  168. package/features/ai/prompts/bot.prompt.ts +90 -88
  169. package/features/ai/prompts/thursday.prompt.ts +48 -41
  170. package/features/ai/tools/memory.tool.ts +65 -62
  171. package/features/ai/tools/tool-name.ts +0 -1
  172. package/features/ai/tools/workspace.tool.ts +3 -0
  173. package/features/bot/bot.action.ts +6 -1
  174. package/features/bot/bot.run.ts +11 -7
  175. package/features/bot/bot.runner.ts +34 -16
  176. package/features/bot/bot.schema.ts +25 -0
  177. package/features/bot/components/bot-room.tsx +57 -4
  178. package/features/bot/components/bot-tool.tsx +0 -1
  179. package/features/bot/task.query.ts +25 -6
  180. package/features/bot/task.store.ts +23 -4
  181. package/features/memory/components/memory-edit.tsx +7 -5
  182. package/features/thursday/components/thursday.tsx +0 -3
  183. package/features/thursday/tool-line.ts +0 -1
  184. package/features/thursday/use-thursday.ts +1 -1
  185. package/package.json +1 -1
  186. package/.next/server/chunks/ssr/[root-of-the-server]__1pduf5n._.js +0 -3
  187. package/.next/server/chunks/ssr/_14_lw10._.js +0 -3
  188. package/.next/server/chunks/ssr/_1spzm8z._.js +0 -3
  189. package/.next/server/chunks/ssr/lib_date-like_ts_02is0pw._.js +0 -3
  190. package/.next/static/chunks/0xzgvc0fkdb6t.js +0 -1
  191. package/.next/static/chunks/14hgtsjg-kael.css +0 -1
  192. package/.next/static/chunks/2hw2f6zmt7fmt.js +0 -1
  193. package/.next/static/chunks/3111pj5wnjgos.js +0 -1
  194. package/features/memory/components/memory-view.tsx +0 -84
  195. /package/.next/static/{x1cCqY0kWpR_VcYx_lWO5 → kaTO0UHqF1bMnWgCDik2f}/_buildManifest.js +0 -0
  196. /package/.next/static/{x1cCqY0kWpR_VcYx_lWO5 → kaTO0UHqF1bMnWgCDik2f}/_clientMiddlewareManifest.js +0 -0
  197. /package/.next/static/{x1cCqY0kWpR_VcYx_lWO5 → kaTO0UHqF1bMnWgCDik2f}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,621285,616172,555085,t=>{"use strict";var e=t.i(843476),r=t.i(271645),a=t.i(798120),n=t.i(167881),i=t.i(630374),l=t.i(683408),s=t.i(671428),o=t.i(647163);function d({className:t,...r}){return(0,e.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,e.jsx)("table",{"data-slot":"table",className:(0,o.cn)("w-full caption-bottom text-sm",t),...r})})}function c({className:t,...r}){return(0,e.jsx)("thead",{"data-slot":"table-header",className:(0,o.cn)("[&_tr]:border-b",t),...r})}function u({className:t,...r}){return(0,e.jsx)("tbody",{"data-slot":"table-body",className:(0,o.cn)("[&_tr:last-child]:border-0",t),...r})}function h({className:t,...r}){return(0,e.jsx)("tr",{"data-slot":"table-row",className:(0,o.cn)("border-b border-border/60 transition-colors data-[state=selected]:bg-muted hover:bg-muted/40",t),...r})}function f({className:t,...r}){return(0,e.jsx)("th",{"data-slot":"table-head",className:(0,o.cn)("h-9 px-2 text-left align-middle font-mono text-[11px] font-normal tracking-[0.1em] whitespace-nowrap text-muted-foreground uppercase [&:has([role=checkbox])]:pr-0",t),...r})}function g({className:t,...r}){return(0,e.jsx)("td",{"data-slot":"table-cell",className:(0,o.cn)("p-2 align-middle [&:has([role=checkbox])]:pr-0",t),...r})}var m=t.i(41533);let w=t=>`text/${t}; charset=utf-8`,p={md:{kind:"markdown",mime:w("markdown")},markdown:{kind:"markdown",mime:w("markdown")},csv:{kind:"csv",mime:w("csv")},json:{kind:"json",mime:"application/json; charset=utf-8"},txt:{kind:"text",mime:w("plain")},log:{kind:"text",mime:w("plain")},html:{kind:"frame",mime:w("html")},htm:{kind:"frame",mime:w("html")},pdf:{kind:"frame",mime:"application/pdf"},png:{kind:"image",mime:"image/png"},jpg:{kind:"image",mime:"image/jpeg"},jpeg:{kind:"image",mime:"image/jpeg"},gif:{kind:"image",mime:"image/gif"},webp:{kind:"image",mime:"image/webp"},svg:{kind:"image",mime:"image/svg+xml"},mp3:{kind:"audio",mime:"audio/mpeg"},wav:{kind:"audio",mime:"audio/wav"},mp4:{kind:"video",mime:"video/mp4"},webm:{kind:"video",mime:"video/webm"},css:{kind:"none",mime:w("css")},js:{kind:"none",mime:w("javascript")},woff2:{kind:"none",mime:"font/woff2"}},x=t=>p[t.split(".").pop()?.toLowerCase()??""]?.kind??"none",b=Object.entries(p).filter(([,t])=>"none"!==t.kind).map(([t])=>t),y=RegExp(String.raw`(?<![\p{L}\p{N}_/:@%-])(?:[\p{L}\p{N}_.@%-]+/)*[\p{L}\p{N}_@%-]+(?:\.[\p{L}\p{N}_-]+)*\.(?:${b.join("|")})\b`,"giu"),k=`${m.PATHS.workspace}/`;function v(t){let e=t.trim(),r=e.indexOf(k);return r>=0?e.slice(r+k.length)||null:e.startsWith("/")||/^[A-Za-z]:/.test(e)||e.split("/").includes("..")?null:e||null}t.s(["pathsIn",0,function(t){let e=t.replace(/\b[a-z][\w+.-]*:\/\/\S+/gi," "),r=new Set;for(let t of e.match(y)??[]){let e=function(t){let e=v(t);if(!e)return null;let[r,...a]=e.split("/");return a.length&&r.includes(".")?null:e}(t);e&&r.add(e)}return[...r].slice(0,6)},"viewKindOf",0,x,"workspaceRelative",0,v],616172);var N=t.i(95187);let j=(0,N.createServerReference)("7f647083e5350baa7762d6d282de825cdf6b737384",N.callServer,void 0,N.findSourceMapURL,"openFileAction");t.s(["openFileAction",0,j],555085);var S=t.i(609856);let D=new Set(["frame","image","audio","video"]);function M(t){let e=v(t);if(!e)return{how:"os"};let r=x(e);return D.has(r)?{how:"tab",path:e,href:a.queryKey.fileView(e)}:"none"===r?{how:"os"}:{how:"dialog",path:e}}let _=(0,r.createContext)(null),C={dialog:{prose:"px-5 py-4",block:"px-4 py-3"},page:{prose:"px-5 py-6 sm:px-8",block:"px-5 py-5"},inline:{prose:"pb-3",block:"pb-3"}};function B({kind:t,content:r,truncated:a,where:n="dialog"}){return(0,e.jsxs)(e.Fragment,{children:[null!=a&&(0,e.jsx)(T,{of:a}),(0,e.jsx)(O,{kind:t,content:r,where:n})]})}function T({of:t}){return(0,e.jsxs)("p",{className:"border-b border-border/60 px-5 py-2.5 font-mono text-[11px] text-muted-foreground",children:[`Showing the first ${(0,o.formatBytes)(m.WORKSPACE_VIEW.textMax)} of ${(0,o.formatBytes)(t)}. `,"Open the file itself for the rest."]})}function O({kind:t,content:r,where:a}){let n=C[a];switch(t){case"markdown":return(0,e.jsx)("div",{className:(0,o.cn)("min-w-0 text-sm leading-relaxed",n.prose),children:(0,e.jsx)(l.Markdown,{children:r})});case"csv":return(0,e.jsx)(P,{content:r,className:n.block});case"json":return(0,e.jsx)(F,{text:function(t){try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}}(r),className:n.block});default:return(0,e.jsx)(F,{text:r,className:n.block})}}function $(t){let[e,n]=(0,r.useState)(null),[i,l]=(0,r.useState)(null),[s,d]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(!t)return;n(null),l(null),d(null);let e=!1;return fetch(a.queryKey.file(t),{headers:{range:`bytes=0-${m.WORKSPACE_VIEW.textMax-1}`}}).then(async t=>{if(!t.ok)throw Error(await t.text());return{text:await t.text(),of:function(t){let e=t.headers.get("content-range")?.match(/^bytes \d+-(\d+)\/(\d+)$/);if(!e)return null;let[,r,a]=e.map(Number);return r+1<a?a:null}(t)}}).then(({text:t,of:r})=>{e||(n(null===r?t:t.slice(0,t.lastIndexOf("\n")+1||void 0)),d(r))}).catch(t=>!e&&l((0,o.errorToString)(t))),()=>{e=!0}},[t]),{content:e,failure:i,truncated:s}}function L({path:t,bytes:r}){let[a,i]=(0,S.useServerAction)(j);return(0,e.jsxs)("div",{className:"space-y-4 p-8",children:[(0,e.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:[`This file is ${(0,o.formatBytes)(r)} — too big to draw here without `,"taking the window with it. Open it where it is instead."]}),(0,e.jsx)(n.Button,{variant:"outline",loading:i,onClick:()=>a(t),children:"Reveal in the file manager"})]})}function E({path:t,kind:r,onClose:a}){let{content:n,failure:l,truncated:o}=$(t),d=t?.split("/").pop()??"";return(0,e.jsx)(i.Dialog,{open:null!==t,onOpenChange:t=>!t&&a(),children:(0,e.jsxs)(i.DialogContent,{className:"flex max-h-[calc(100vh-3rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl",children:[(0,e.jsx)(i.DialogTitle,{className:"sr-only",children:d}),(0,e.jsx)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border/60 px-4 py-2.5 pr-12",children:(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px]",children:t})}),(0,e.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:l?(0,e.jsx)("p",{className:"p-5 font-mono text-xs text-destructive",children:l}):null===n?(0,e.jsxs)("div",{className:"space-y-3 p-5",children:[(0,e.jsx)(s.Skeleton,{className:"h-5 w-2/3"}),(0,e.jsx)(s.Skeleton,{className:"h-4 w-full"}),(0,e.jsx)(s.Skeleton,{className:"h-4 w-5/6"})]}):(0,e.jsx)(B,{kind:r,content:n,truncated:o})})]})})}function F({text:t,className:r}){return(0,e.jsx)("pre",{className:(0,o.cn)("overflow-x-auto font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-foreground/90",r),children:t})}function P({content:t,className:a}){let[n,...i]=(0,r.useMemo)(()=>(function(t){let e=[],r=[],a="",n=!1;for(let i=0;i<t.length;i++){let l=t[i];n?'"'===l&&'"'===t[i+1]?(a+='"',i++):'"'===l?n=!1:a+=l:'"'===l?n=!0:","===l?(r.push(a),a=""):"\n"===l||"\r"===l?("\r"===l&&"\n"===t[i+1]&&i++,r.push(a),e.push(r),r=[],a=""):a+=l}return(a.length||r.length)&&(r.push(a),e.push(r)),e.filter(t=>t.some(t=>t.trim()))})(t),[t]);return n?(0,e.jsx)("div",{className:(0,o.cn)("overflow-x-auto",a),children:(0,e.jsxs)(d,{children:[(0,e.jsx)(c,{children:(0,e.jsx)(h,{children:n.map((t,r)=>(0,e.jsx)(f,{className:"whitespace-nowrap",children:t},`${r}-${t}`))})}),(0,e.jsx)(u,{children:i.map((t,r)=>(0,e.jsx)(h,{children:n.map((a,n)=>(0,e.jsx)(g,{className:"whitespace-nowrap",children:t[n]??""},`${r}-${n}`))},`${r}-${t[0]??""}`))})]})}):(0,e.jsx)(F,{text:t,className:a})}t.s(["FileBody",0,B,"FileDialog",0,E,"FileLink",0,function({path:t,className:n,title:i,label:l,children:s}){let o=M(t),d=(0,r.useContext)(_),[c,u]=(0,S.useServerAction)(j);return"tab"===o.how?(0,e.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",title:i??t,"aria-label":l,className:n,children:s}):(0,e.jsx)("button",{type:"button",disabled:u,title:i??t,"aria-label":l,className:n,onClick:()=>{"dialog"===o.how?d?d(o.path):window.open(a.queryKey.fileView(o.path),"_blank"):c(t)},children:s})},"FilePreview",0,function({path:t,bytes:r}){let n=x(t),{content:i,failure:l,truncated:o}=$(D.has(n)?null:t);return("frame"===n||"image"===n)&&r>m.WORKSPACE_VIEW.elementMax?(0,e.jsx)(L,{path:t,bytes:r}):"frame"===n?(0,e.jsx)("iframe",{title:t,src:a.queryKey.file(t),allow:"clipboard-read; clipboard-write; fullscreen; autoplay",className:"h-full w-full bg-white"}):"image"===n?(0,e.jsx)("img",{src:a.queryKey.file(t),alt:t,className:"mx-auto max-w-full p-6"}):"audio"===n||"video"===n?"audio"===n?(0,e.jsx)("audio",{controls:!0,src:a.queryKey.file(t),className:"w-full p-6",children:(0,e.jsx)("track",{kind:"captions"})}):(0,e.jsx)("video",{controls:!0,src:a.queryKey.file(t),className:"max-w-full p-6",children:(0,e.jsx)("track",{kind:"captions"})}):l?(0,e.jsx)("p",{className:"p-5 font-mono text-xs text-destructive",children:l}):null===i?(0,e.jsxs)("div",{className:"space-y-3 p-5",children:[(0,e.jsx)(s.Skeleton,{className:"h-5 w-2/3"}),(0,e.jsx)(s.Skeleton,{className:"h-4 w-full"}),(0,e.jsx)(s.Skeleton,{className:"h-4 w-5/6"})]}):(0,e.jsx)(B,{kind:n,content:i,truncated:o})},"FileViewer",0,function({children:t}){let[a,n]=(0,r.useState)(null);return(0,e.jsxs)(_,{value:n,children:[t,(0,e.jsx)(E,{path:a,kind:a?x(a):"text",onClose:()=>n(null)})]})},"fileTarget",0,M,"useFileText",0,$,"useOpenFile",0,function(){let t=(0,r.useContext)(_);return(0,r.useCallback)(e=>{let r=M(e);if("os"===r.how)return!1;if("dialog"===r.how&&t)return t(r.path),!0;let n="tab"===r.how?r.href:a.queryKey.fileView(r.path);return null!==window.open(n,"_blank")},[t])}],621285)},245629,401851,t=>{"use strict";var e=t.i(55545),r=t.i(455024),a=t.i(99151),n=t.i(845110),i=t.i(234662),l=t.i(281092);function s(t,e){let r=(0,l.toDate)(t,e?.in);return r.setHours(0,0,0,0),r}function o(t,e){let a=(0,r.getDefaultOptions)(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,i=(0,l.toDate)(t,e?.in),s=i.getDay();return i.setDate(i.getDate()-(7*(s<n)+s-n)),i.setHours(0,0,0,0),i}function d(t,e){return o(t,{...e,weekStartsOn:1})}var c=t.i(677241);function u(t,e){let r=(0,l.toDate)(t,e?.in),a=r.getFullYear(),n=(0,c.constructFrom)(r,0);n.setFullYear(a+1,0,4),n.setHours(0,0,0,0);let i=d(n),s=(0,c.constructFrom)(r,0);s.setFullYear(a,0,4),s.setHours(0,0,0,0);let o=d(s);return r.getTime()>=i.getTime()?a+1:r.getTime()>=o.getTime()?a:a-1}function h(t,e){let a=(0,l.toDate)(t,e?.in),n=a.getFullYear(),i=(0,r.getDefaultOptions)(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,d=(0,c.constructFrom)(e?.in||t,0);d.setFullYear(n+1,0,s),d.setHours(0,0,0,0);let u=o(d,e),h=(0,c.constructFrom)(e?.in||t,0);h.setFullYear(n,0,s),h.setHours(0,0,0,0);let f=o(h,e);return+a>=+u?n+1:+a>=+f?n:n-1}function f(t,e){let r=Math.abs(t).toString().padStart(e,"0");return(t<0?"-":"")+r}let g={y(t,e){let r=t.getFullYear(),a=r>0?r:1-r;return f("yy"===e?a%100:a,e.length)},M(t,e){let r=t.getMonth();return"M"===e?String(r+1):f(r+1,2)},d:(t,e)=>f(t.getDate(),e.length),a(t,e){let r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>f(t.getHours()%12||12,e.length),H:(t,e)=>f(t.getHours(),e.length),m:(t,e)=>f(t.getMinutes(),e.length),s:(t,e)=>f(t.getSeconds(),e.length),S(t,e){let r=e.length;return f(Math.trunc(t.getMilliseconds()*Math.pow(10,r-3)),e.length)}},m={G:function(t,e,r){let a=+(t.getFullYear()>0);switch(e){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});default:return r.era(a,{width:"wide"})}},y:function(t,e,r){if("yo"===e){let e=t.getFullYear();return r.ordinalNumber(e>0?e:1-e,{unit:"year"})}return g.y(t,e)},Y:function(t,e,r,a){let n=h(t,a),i=n>0?n:1-n;return"YY"===e?f(i%100,2):"Yo"===e?r.ordinalNumber(i,{unit:"year"}):f(i,e.length)},R:function(t,e){return f(u(t),e.length)},u:function(t,e){return f(t.getFullYear(),e.length)},Q:function(t,e,r){let a=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(a);case"QQ":return f(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,e,r){let a=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(a);case"qq":return f(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,e,r){let a=t.getMonth();switch(e){case"M":case"MM":return g.M(t,e);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(t,e,r){let a=t.getMonth();switch(e){case"L":return String(a+1);case"LL":return f(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(t,e,a,n){let s,d,u,g,m,w=Math.round((o(s=(0,l.toDate)(t,n?.in),n)-(d=(0,r.getDefaultOptions)(),u=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??d.firstWeekContainsDate??d.locale?.options?.firstWeekContainsDate??1,g=h(s,n),(m=(0,c.constructFrom)(n?.in||s,0)).setFullYear(g,0,u),m.setHours(0,0,0,0),o(m,n)))/i.millisecondsInWeek)+1;return"wo"===e?a.ordinalNumber(w,{unit:"week"}):f(w,e.length)},I:function(t,e,r){let a,n,s,o=Math.round((d(a=(0,l.toDate)(t,void 0))-(n=u(a,void 0),(s=(0,c.constructFrom)(a,0)).setFullYear(n,0,4),s.setHours(0,0,0,0),d(s)))/i.millisecondsInWeek)+1;return"Io"===e?r.ordinalNumber(o,{unit:"week"}):f(o,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):g.d(t,e)},D:function(t,e,r){let o,d,c=function(t,e){let[r,l]=(0,n.normalizeDates)(void 0,t,e),o=s(r),d=s(l);return Math.round((o-(0,a.getTimezoneOffsetInMilliseconds)(o)-(d-(0,a.getTimezoneOffsetInMilliseconds)(d)))/i.millisecondsInDay)}(o=(0,l.toDate)(t,void 0),((d=(0,l.toDate)(o,void 0)).setFullYear(d.getFullYear(),0,1),d.setHours(0,0,0,0),d))+1;return"Do"===e?r.ordinalNumber(c,{unit:"dayOfYear"}):f(c,e.length)},E:function(t,e,r){let a=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(t,e,r,a){let n=t.getDay(),i=(n-a.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return f(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},c:function(t,e,r,a){let n=t.getDay(),i=(n-a.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return f(i,e.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(n,{width:"narrow",context:"standalone"});case"cccccc":return r.day(n,{width:"short",context:"standalone"});default:return r.day(n,{width:"wide",context:"standalone"})}},i:function(t,e,r){let a=t.getDay(),n=0===a?7:a;switch(e){case"i":return String(n);case"ii":return f(n,e.length);case"io":return r.ordinalNumber(n,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(t,e,r){let a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,r){let a,n=t.getHours();switch(a=12===n?"noon":0===n?"midnight":n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,r){let a,n=t.getHours();switch(a=n>=17?"evening":n>=12?"afternoon":n>=4?"morning":"night",e){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return g.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):g.H(t,e)},K:function(t,e,r){let a=t.getHours()%12;return"Ko"===e?r.ordinalNumber(a,{unit:"hour"}):f(a,e.length)},k:function(t,e,r){let a=t.getHours();return(0===a&&(a=24),"ko"===e)?r.ordinalNumber(a,{unit:"hour"}):f(a,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):g.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):g.s(t,e)},S:function(t,e){return g.S(t,e)},X:function(t,e,r){let a=t.getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return p(a);case"XXXX":case"XX":return x(a);default:return x(a,":")}},x:function(t,e,r){let a=t.getTimezoneOffset();switch(e){case"x":return p(a);case"xxxx":case"xx":return x(a);default:return x(a,":")}},O:function(t,e,r){let a=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+w(a,":");default:return"GMT"+x(a,":")}},z:function(t,e,r){let a=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+w(a,":");default:return"GMT"+x(a,":")}},t:function(t,e,r){return f(Math.trunc(t/1e3),e.length)},T:function(t,e,r){return f(+t,e.length)}};function w(t,e=""){let r=t>0?"-":"+",a=Math.abs(t),n=Math.trunc(a/60),i=a%60;return 0===i?r+String(n):r+String(n)+e+f(i,2)}function p(t,e){return t%60==0?(t>0?"-":"+")+f(Math.abs(t)/60,2):x(t,e)}function x(t,e=""){let r=Math.abs(t);return(t>0?"-":"+")+f(Math.trunc(r/60),2)+e+f(r%60,2)}let b=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},y=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},k={p:y,P:(t,e)=>{let r,a=t.match(/(P+)(p+)?/)||[],n=a[1],i=a[2];if(!i)return b(t,e);switch(n){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;default:r=e.dateTime({width:"full"})}return r.replace("{{date}}",b(n,e)).replace("{{time}}",y(i,e))}},v=/^D+$/,N=/^Y+$/,j=["D","DD","YY","YYYY"],S=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,D=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,M=/^'([^]*?)'?$/,_=/''/g,C=/[a-zA-Z]/;function B(t,a,n){let i=(0,r.getDefaultOptions)(),s=n?.locale??i.locale??e.defaultLocale,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,d=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,c=(0,l.toDate)(t,n?.in);if(!(c instanceof Date||"object"==typeof c&&"[object Date]"===Object.prototype.toString.call(c))&&"number"!=typeof c||isNaN(+(0,l.toDate)(c)))throw RangeError("Invalid time value");let u=a.match(D).map(t=>{let e=t[0];return"p"===e||"P"===e?(0,k[e])(t,s.formatLong):t}).join("").match(S).map(t=>{if("''"===t)return{isToken:!1,value:"'"};let e=t[0];if("'"===e){var r;let e;return{isToken:!1,value:(e=(r=t).match(M))?e[1].replace(_,"'"):r}}if(m[e])return{isToken:!0,value:t};if(e.match(C))throw RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}});s.localize.preprocessor&&(u=s.localize.preprocessor(c,u));let h={firstWeekContainsDate:o,weekStartsOn:d,locale:s};return u.map(e=>{if(!e.isToken)return e.value;let r=e.value;return(!n?.useAdditionalWeekYearTokens&&N.test(r)||!n?.useAdditionalDayOfYearTokens&&v.test(r))&&function(t,e,r){var a,n,i;let l,s=(a=t,n=e,i=r,l="Y"===a[0]?"years":"days of the month",`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${n}\`) for formatting ${l} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(s),j.includes(t))throw RangeError(s)}(r,a,String(t)),(0,m[r[0]])(c,r,s.localize,h)}).join("")}t.s(["format",0,B],401851);var T=t.i(24708);function O(t,e,r){let[a,i]=(0,n.normalizeDates)(r?.in,t,e);return+s(a)==+s(i)}var $=t.i(681307);let L=$.z.union([$.z.date(),$.z.iso.datetime()]),E=t=>new Date(t);t.s(["DateLikeSchema",0,L,"shortAgo",0,function(t,e=Date.now()){let r=Math.max(0,Math.round((e-E(t).getTime())/1e3));if(r<60)return"now";let a=Math.round(r/60);if(a<60)return`${a}m`;let n=Math.round(a/60);return n<24?`${n}h`:`${Math.round(n/24)}d`},"toDate",0,E,"whenOf",0,function(t){let e=E(t),r=B(e,"HH:mm");return O((0,c.constructFrom)(e,e),(0,T.constructNow)(e))?r:!function(t){var e,r;let a;return O((0,c.constructFrom)(t,t),(e=(0,T.constructNow)(t),r=void 0,a=(0,l.toDate)(e,r?.in),isNaN(-1)?(0,c.constructFrom)(r?.in||e,NaN):(a.setDate(a.getDate()+-1),a)))}(e)?`${B(e,"MMM d")} \xb7 ${r}`:`Yesterday ${r}`}],245629)},696017,t=>{"use strict";var e=t.i(60231),r=t.i(419524);t.i(947716);var a=t.i(723685),n=(0,r.__name)(t=>{let{securityLevel:r}=(0,e.getConfig2)(),n=(0,a.select)("body");if("sandbox"===r){let e=(0,a.select)(`#i${t}`),r=e.node()?.contentDocument??document;n=(0,a.select)(r.body)}return n.select(`#${t}`)},"selectSvgElement");t.s(["selectSvgElement",0,n])},502056,t=>{"use strict";var e=t.i(217248),r=t.i(447804),a=t.i(508324),n=t.i(419524),i=(0,n.__name)(({flowchart:t})=>{let e=t?.subGraphTitleMargin?.top??0,r=t?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:e+r}},"getSubGraphTitleMargins"),l=new Map;async function s(t,a,n){let i,s;"rect"===a.shape&&(a.rx&&a.ry?a.shape="roundedRect":a.shape="squareRect");let o=a.shape?e.shapes[a.shape]:void 0;if(!o)throw Error(`No such shape: ${a.shape}. Please check your syntax.`);if(a.link){let e;"sandbox"===n.config.securityLevel?e="_top":a.linkTarget&&(e=a.linkTarget||"_blank"),i=t.insert("svg:a").attr("xlink:href",a.link).attr("target",e??null),s=await o(i,a,n)}else i=s=await o(t,a,n);return i.attr("data-look",(0,r.handleUndefinedAttr)(a.look)),a.tooltip&&s.attr("title",a.tooltip),l.set(a.id,i),a.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}(0,n.__name)(s,"insertNode");var o=(0,n.__name)((t,e)=>{l.set(e.id,t)},"setNodeElem"),d=(0,n.__name)(()=>{l.clear()},"clear"),c=(0,n.__name)(t=>{let e=l.get(t.id);a.log.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode");t.s(["clear",0,d,"getSubGraphTitleMargins",0,i,"insertNode",0,s,"positionNode",0,c,"setNodeElem",0,o])},369110,t=>{"use strict";var e=t.i(502056),r=t.i(217248),a=t.i(224797),n=t.i(836333),i=t.i(60231),l=t.i(508324),s=t.i(419524);t.i(947716);var o=t.i(723685),d=t.i(883272),c=(0,s.__name)(async(t,e)=>{let s,c,u=(0,i.getConfig2)(),{themeVariables:h,handDrawnSeed:f}=u,{clusterBkg:g,clusterBorder:m}=h,{labelStyles:w,nodeStyles:p,borderStyles:x,backgroundStyles:b}=(0,a.styles2String)(e),y=t.insert("g").attr("class","cluster swimlane "+(e.cssClasses||"")).attr("id",e.id).attr("data-id",e.id).attr("data-et","cluster").attr("data-look",e.look),k=(0,i.evaluate)(u.flowchart.htmlLabels),v="LR"===e.direction,N=y.insert("g").attr("class","cluster-label swimlane-label"),j=await (0,n.createText)(N,e.label,{style:e.labelStyle,useHtmlLabels:k,isNode:!0,width:e.width}),S=j.getBBox();if(k){let t=j.children[0],e=(0,o.select)(j);S=t.getBoundingClientRect(),e.attr("width",S.width),e.attr("height",S.height)}let D=e.padding??0,M=e.width<=S.width+D?S.width+D:e.width;e.width<=S.width+D?e.diff=(M-e.width)/2-D:e.diff=-D;let _=e.height,C=e.y-_/2,B=e.y+_/2,T=e.x-M/2,O=void 0!==e.swimlaneContentTop?e.swimlaneContentTop:C+_/3,$=4*!!v,L=S.height+2*$;if(v){let t=Math.max(L,S.height+2*$),r=T+t,n=Math.max(0,M-t);if("handDrawn"===e.look){let i=d.default.svg(y),l=(0,a.userNodeOverrides)(e,{roughness:.7,fill:g,stroke:m,fillWeight:3,seed:f}),o=(0,a.userNodeOverrides)(e,{roughness:.7,fill:"none",stroke:m,seed:f}),u=i.rectangle(T,C,t,_,l);s=y.insert(()=>u,":first-child");let h=i.rectangle(r,C,n,_,o);c=y.insert(()=>h,":first-child"),s.select("path:nth-child(2)").attr("style",x.join(";")),s.select("path").attr("style",b.join(";").replace("fill","stroke"))}else s=y.insert("rect",":first-child"),c=y.insert("rect",":first-child"),s.attr("class","swimlane-title").attr("style",p).attr("x",T).attr("y",C).attr("width",t).attr("height",_).attr("fill",g).attr("stroke",m),c.attr("class","swimlane-body").attr("style",p).attr("x",r).attr("y",C).attr("width",n).attr("height",_).attr("fill","none").attr("stroke",m);let i=T+t/2,l=e.y;N.attr("transform",`translate(${i}, ${l}) rotate(-90) translate(${-S.width/2}, ${-S.height/2})`)}else{let t=Math.min(L,Math.max(0,O-C)),r=C+t,n=Math.max(0,B-r),i=e.x-M/2;if("handDrawn"===e.look){let l=d.default.svg(y),o=(0,a.userNodeOverrides)(e,{roughness:.7,fill:g,stroke:m,fillWeight:3,seed:f}),u=(0,a.userNodeOverrides)(e,{roughness:.7,fill:"none",stroke:m,seed:f}),h=l.rectangle(i,C,M,t,o);s=y.insert(()=>h,":first-child");let w=l.rectangle(i,r,M,n,u);c=y.insert(()=>w,":first-child"),s.select("path:nth-child(2)").attr("style",x.join(";")),s.select("path").attr("style",b.join(";").replace("fill","stroke"))}else s=y.insert("rect",":first-child"),c=y.insert("rect",":first-child"),s.attr("class","swimlane-title").attr("style",p).attr("x",i).attr("y",C).attr("width",M).attr("height",t).attr("fill",g).attr("stroke",m),c.attr("class","swimlane-body").attr("style",p).attr("x",i).attr("y",r).attr("width",M).attr("height",n).attr("fill","none").attr("stroke",m);let l=e.x-S.width/2,o=C+(t-S.height)/2;N.attr("transform",`translate(${l}, ${o})`)}if(l.log.trace("Swimlane data ",e,JSON.stringify(e)),w){let t=N.select("span");t&&t.attr("style",w)}return e.offsetX=0,e.width=M,e.height=_,e.offsetY=S.height-D/2,e.intersect=function(t){return(0,r.intersect_rect_default)(e,t)},{cluster:y,labelBBox:S}},"swimlane"),u=(0,s.__name)(async(t,s)=>{let c,u;l.log.info("Creating subgraph rect for ",s.id,s);let h=(0,i.getConfig2)(),{themeVariables:f,handDrawnSeed:g}=h,{clusterBkg:m,clusterBorder:w}=f,{labelStyles:p,nodeStyles:x,borderStyles:b,backgroundStyles:y}=(0,a.styles2String)(s),k=t.insert("g").attr("class","cluster "+s.cssClasses).attr("id",s.domId).attr("data-look",s.look),v=(0,i.getEffectiveHtmlLabels)(h),N=k.insert("g").attr("class","cluster-label "),j=(c="markdown"===s.labelType?await (0,n.createText)(N,s.label,{style:s.labelStyle,useHtmlLabels:v,isNode:!0,width:s.width}):await (0,r.createLabel_default)(N,s.label,s.labelStyle||"",!1,!0)).getBBox();if((0,i.getEffectiveHtmlLabels)(h)){let t=c.children[0],e=(0,o.select)(c);j=t.getBoundingClientRect(),e.attr("width",j.width),e.attr("height",j.height)}let S=s.width<=j.width+s.padding?j.width+s.padding:s.width;s.width<=j.width+s.padding?s.diff=(S-s.width)/2-s.padding:s.diff=-s.padding;let D=s.height,M=s.x-S/2,_=s.y-D/2;if(l.log.trace("Data ",s,JSON.stringify(s)),"handDrawn"===s.look){let t=d.default.svg(k),e=(0,a.userNodeOverrides)(s,{roughness:.7,fill:m,stroke:w,fillWeight:3,seed:g}),n=t.path((0,r.createRoundedRectPathD)(M,_,S,D,0),e);(u=k.insert(()=>(l.log.debug("Rough node insert CXC",n),n),":first-child")).select("path:nth-child(2)").attr("style",b.join(";")),u.select("path").attr("style",y.join(";").replace("fill","stroke"))}else(u=k.insert("rect",":first-child")).attr("style",x).attr("rx",s.rx).attr("ry",s.ry).attr("x",M).attr("y",_).attr("width",S).attr("height",D);let{subGraphTitleTopMargin:C}=(0,e.getSubGraphTitleMargins)(h);if(N.attr("transform",`translate(${s.x-j.width/2}, ${s.y-s.height/2+C})`),p){let t=N.select("span");t&&t.attr("style",p)}let B=u.node().getBBox();return s.offsetX=0,s.width=B.width,s.height=B.height,s.offsetY=j.height-s.padding/2,s.intersect=function(t){return(0,r.intersect_rect_default)(s,t)},{cluster:k,labelBBox:j}},"rect"),h=(0,s.__name)((t,e)=>{let a=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=a.insert("rect",":first-child"),i=0*e.padding,l=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-l).attr("y",e.y-e.height/2-l).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");let s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(t){return(0,r.intersect_rect_default)(e,t)},{cluster:a,labelBBox:{width:0,height:0}}},"noteGroup"),f=(0,s.__name)(async(t,e)=>{let a,n=(0,i.getConfig2)(),{themeVariables:l,handDrawnSeed:s}=n,{altBackground:c,compositeBackground:u,compositeTitleBackground:h,nodeBorder:f}=l,g=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),m=g.insert("g",":first-child"),w=g.insert("g").attr("class","cluster-label"),p=g.append("rect"),x=await (0,r.createLabel_default)(w,e.label,e.labelStyle,void 0,!0),b=x.getBBox();if((0,i.getEffectiveHtmlLabels)(n)){let t=x.children[0],e=(0,o.select)(x);b=t.getBoundingClientRect(),e.attr("width",b.width),e.attr("height",b.height)}let y=0*e.padding,k=(e.width<=b.width+e.padding?b.width+e.padding:e.width)+y;e.width<=b.width+e.padding?e.diff=(k-e.width)/2-e.padding:e.diff=-e.padding;let v=e.height+y,N=e.height+y-b.height-6,j=e.x-k/2,S=e.y-v/2;e.width=k;let D=e.y-e.height/2-y/2+b.height+2;if("handDrawn"===e.look){let t=e.cssClasses.includes("statediagram-cluster-alt"),n=d.default.svg(g),i=e.rx||e.ry?n.path((0,r.createRoundedRectPathD)(j,S,k,v,10),{roughness:.7,fill:h,fillStyle:"solid",stroke:f,seed:s}):n.rectangle(j,S,k,v,{seed:s});a=g.insert(()=>i,":first-child");let l=n.rectangle(j,D,k,N,{fill:t?c:u,fillStyle:t?"hachure":"solid",stroke:f,seed:s});a=g.insert(()=>i,":first-child"),p=g.insert(()=>l)}else(a=m.insert("rect",":first-child")).attr("class","outer").attr("x",j).attr("y",S).attr("width",k).attr("height",v).attr("data-look",e.look),p.attr("class","inner").attr("x",j).attr("y",D).attr("width",k).attr("height",N);return w.attr("transform",`translate(${e.x-b.width/2}, ${S+1-3*!(0,i.getEffectiveHtmlLabels)(n)})`),e.height=a.node().getBBox().height,e.offsetX=0,e.offsetY=b.height-e.padding/2,e.labelBBox=b,e.intersect=function(t){return(0,r.intersect_rect_default)(e,t)},{cluster:g,labelBBox:b}},"roundedWithTitle"),g=(0,s.__name)(async(t,s)=>{let c;l.log.info("Creating subgraph rect for ",s.id,s);let u=(0,i.getConfig2)(),{themeVariables:h,handDrawnSeed:f}=u,{clusterBkg:g,clusterBorder:m}=h,{labelStyles:w,nodeStyles:p,borderStyles:x,backgroundStyles:b}=(0,a.styles2String)(s),y=t.insert("g").attr("class","cluster "+s.cssClasses).attr("id",s.domId).attr("data-look",s.look),k=(0,i.getEffectiveHtmlLabels)(u),v=y.insert("g").attr("class","cluster-label "),N=await (0,n.createText)(v,s.label,{style:s.labelStyle,useHtmlLabels:k,isNode:!0,width:s.width}),j=N.getBBox();if((0,i.getEffectiveHtmlLabels)(u)){let t=N.children[0],e=(0,o.select)(N);j=t.getBoundingClientRect(),e.attr("width",j.width),e.attr("height",j.height)}let S=s.width<=j.width+s.padding?j.width+s.padding:s.width;s.width<=j.width+s.padding?s.diff=(S-s.width)/2-s.padding:s.diff=-s.padding;let D=s.height,M=s.x-S/2,_=s.y-D/2;if(l.log.trace("Data ",s,JSON.stringify(s)),"handDrawn"===s.look){let t=d.default.svg(y),e=(0,a.userNodeOverrides)(s,{roughness:.7,fill:g,stroke:m,fillWeight:4,seed:f}),n=t.path((0,r.createRoundedRectPathD)(M,_,S,D,s.rx),e);(c=y.insert(()=>(l.log.debug("Rough node insert CXC",n),n),":first-child")).select("path:nth-child(2)").attr("style",x.join(";")),c.select("path").attr("style",b.join(";").replace("fill","stroke"))}else(c=y.insert("rect",":first-child")).attr("style",p).attr("rx",s.rx).attr("ry",s.ry).attr("x",M).attr("y",_).attr("width",S).attr("height",D);let{subGraphTitleTopMargin:C}=(0,e.getSubGraphTitleMargins)(u);if(v.attr("transform",`translate(${s.x-j.width/2}, ${s.y-s.height/2+C})`),w){let t=v.select("span");t&&t.attr("style",w)}let B=c.node().getBBox();return s.offsetX=0,s.width=B.width,s.height=B.height,s.offsetY=j.height-s.padding/2,s.intersect=function(t){return(0,r.intersect_rect_default)(s,t)},{cluster:y,labelBBox:j}},"kanbanSection"),m={rect:u,squareRect:u,roundedWithTitle:f,noteGroup:h,divider:(0,s.__name)((t,e)=>{let a,{themeVariables:n,handDrawnSeed:l}=(0,i.getConfig2)(),{nodeBorder:s}=n,o=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),c=o.insert("g",":first-child"),u=0*e.padding,h=e.width+u;e.diff=-e.padding;let f=e.height+u,g=e.x-h/2,m=e.y-f/2;if(e.width=h,"handDrawn"===e.look){let t=d.default.svg(o).rectangle(g,m,h,f,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:l});a=o.insert(()=>t,":first-child")}else{a=c.insert("rect",":first-child");let t="outer";e.look,t="divider",a.attr("class",t).attr("x",g).attr("y",m).attr("width",h).attr("height",f).attr("data-look",e.look)}return e.height=a.node().getBBox().height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return(0,r.intersect_rect_default)(e,t)},{cluster:o,labelBBox:{}}},"divider"),kanbanSection:g,swimlane:c},w=new Map,p=(0,s.__name)(async(t,e)=>{let r=e.shape||"rect",a=await m[r](t,e);return w.set(e.id,a),a},"insertCluster"),x=(0,s.__name)(()=>{w=new Map},"clear");t.s(["clear",0,x,"insertCluster",0,p])},121292,t=>{"use strict";var e=t.i(369110),r=t.i(382793),a=t.i(502056),n=t.i(217248),i=t.i(447804),l=t.i(60231),s=t.i(508324),o=t.i(419524),d={common:l.common_default,getConfig:l.getConfig,insertCluster:e.insertCluster,insertEdge:r.insertEdge,insertEdgeLabel:r.insertEdgeLabel,insertMarkers:r.markers_default,insertNode:a.insertNode,interpolateToCurve:i.interpolateToCurve,labelHelper:n.labelHelper,log:s.log,positionEdgeLabel:r.positionEdgeLabel},c={},u=(0,o.__name)(t=>{for(let e of t)c[e.name]=e},"registerLayoutLoaders");(0,o.__name)(()=>{u([{name:"dagre",loader:(0,o.__name)(async()=>await t.A(555153),"loader")},{name:"swimlane",loader:(0,o.__name)(async()=>await t.A(12782),"loader")},{name:"cose-bilkent",loader:(0,o.__name)(async()=>await t.A(208503),"loader")}])},"registerDefaultLayoutLoaders")();var h=(0,o.__name)(async(t,e)=>{if(!(t.layoutAlgorithm in c))throw Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(let e of t.nodes){let r=e.domId||e.id;e.domId=`${t.diagramId}-${r}`}let r=c[t.layoutAlgorithm],a=await r.loader(),{theme:n,themeVariables:i}=t.config,{useGradient:l,gradientStart:s,gradientStop:o}=i,u=e.attr("id");if(e.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n?.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n?.includes("dark")?"#FFFFFF":"#000000"}`),l){let t=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");t.append("svg:stop").attr("offset","0%").attr("stop-color",s).attr("stop-opacity",1),t.append("svg:stop").attr("offset","100%").attr("stop-color",o).attr("stop-opacity",1)}return a.render(t,e,d,{algorithm:r.algorithm})},"render"),f=(0,o.__name)((t="",{fallback:e="dagre"}={})=>{if(t in c)return t;if(e in c)return s.log.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm");t.s(["getRegisteredLayoutAlgorithm",0,f,"registerLayoutLoaders",0,u,"render",0,h])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,621285,616172,177373,t=>{"use strict";var e=t.i(843476),r=t.i(271645),a=t.i(798120),n=t.i(167881),i=t.i(630374),l=t.i(683408),s=t.i(671428),o=t.i(647163);function d({className:t,...r}){return(0,e.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,e.jsx)("table",{"data-slot":"table",className:(0,o.cn)("w-full caption-bottom text-sm",t),...r})})}function c({className:t,...r}){return(0,e.jsx)("thead",{"data-slot":"table-header",className:(0,o.cn)("[&_tr]:border-b",t),...r})}function u({className:t,...r}){return(0,e.jsx)("tbody",{"data-slot":"table-body",className:(0,o.cn)("[&_tr:last-child]:border-0",t),...r})}function h({className:t,...r}){return(0,e.jsx)("tr",{"data-slot":"table-row",className:(0,o.cn)("border-b border-border/60 transition-colors data-[state=selected]:bg-muted hover:bg-muted/40",t),...r})}function f({className:t,...r}){return(0,e.jsx)("th",{"data-slot":"table-head",className:(0,o.cn)("h-9 px-2 text-left align-middle font-mono text-[11px] font-normal tracking-[0.1em] whitespace-nowrap text-muted-foreground uppercase [&:has([role=checkbox])]:pr-0",t),...r})}function g({className:t,...r}){return(0,e.jsx)("td",{"data-slot":"table-cell",className:(0,o.cn)("p-2 align-middle [&:has([role=checkbox])]:pr-0",t),...r})}var m=t.i(41533);let w=t=>`text/${t}; charset=utf-8`,p={md:{kind:"markdown",mime:w("markdown")},markdown:{kind:"markdown",mime:w("markdown")},csv:{kind:"csv",mime:w("csv")},json:{kind:"json",mime:"application/json; charset=utf-8"},txt:{kind:"text",mime:w("plain")},log:{kind:"text",mime:w("plain")},html:{kind:"frame",mime:w("html")},htm:{kind:"frame",mime:w("html")},pdf:{kind:"frame",mime:"application/pdf"},png:{kind:"image",mime:"image/png"},jpg:{kind:"image",mime:"image/jpeg"},jpeg:{kind:"image",mime:"image/jpeg"},gif:{kind:"image",mime:"image/gif"},webp:{kind:"image",mime:"image/webp"},svg:{kind:"image",mime:"image/svg+xml"},mp3:{kind:"audio",mime:"audio/mpeg"},wav:{kind:"audio",mime:"audio/wav"},mp4:{kind:"video",mime:"video/mp4"},webm:{kind:"video",mime:"video/webm"},css:{kind:"none",mime:w("css")},js:{kind:"none",mime:w("javascript")},woff2:{kind:"none",mime:"font/woff2"}},x=t=>p[t.split(".").pop()?.toLowerCase()??""]?.kind??"none",b=Object.entries(p).filter(([,t])=>"none"!==t.kind).map(([t])=>t),y=RegExp(String.raw`(?<![\p{L}\p{N}_/:@%-])(?:[\p{L}\p{N}_.@%-]+/)*[\p{L}\p{N}_@%-]+(?:\.[\p{L}\p{N}_-]+)*\.(?:${b.join("|")})\b`,"giu"),k=`${m.PATHS.workspace}/`;function v(t){let e=t.trim(),r=e.indexOf(k);return r>=0?e.slice(r+k.length)||null:e.startsWith("/")||/^[A-Za-z]:/.test(e)||e.split("/").includes("..")?null:e||null}t.s(["pathsIn",0,function(t){let e=t.replace(/\b[a-z][\w+.-]*:\/\/\S+/gi," "),r=new Set;for(let t of e.match(y)??[]){let e=function(t){let e=v(t);if(!e)return null;let[r,...a]=e.split("/");return a.length&&r.includes(".")?null:e}(t);e&&r.add(e)}return[...r].slice(0,6)},"viewKindOf",0,x,"workspaceRelative",0,v],616172);var N=t.i(95187);let j=(0,N.createServerReference)("7f4957e151a50cd41ee138dc20323d2118d625a8e9",N.callServer,void 0,N.findSourceMapURL,"openFileAction");t.s(["openFileAction",0,j],177373);var S=t.i(609856);let D=new Set(["frame","image","audio","video"]);function M(t){let e=v(t);if(!e)return{how:"os"};let r=x(e);return D.has(r)?{how:"tab",path:e,href:a.queryKey.fileView(e)}:"none"===r?{how:"os"}:{how:"dialog",path:e}}let _=(0,r.createContext)(null),C={dialog:{prose:"px-5 py-4",block:"px-4 py-3"},page:{prose:"px-5 py-6 sm:px-8",block:"px-5 py-5"},inline:{prose:"pb-3",block:"pb-3"}};function B({kind:t,content:r,truncated:a,where:n="dialog"}){return(0,e.jsxs)(e.Fragment,{children:[null!=a&&(0,e.jsx)(T,{of:a}),(0,e.jsx)(O,{kind:t,content:r,where:n})]})}function T({of:t}){return(0,e.jsxs)("p",{className:"border-b border-border/60 px-5 py-2.5 font-mono text-[11px] text-muted-foreground",children:[`Showing the first ${(0,o.formatBytes)(m.WORKSPACE_VIEW.textMax)} of ${(0,o.formatBytes)(t)}. `,"Open the file itself for the rest."]})}function O({kind:t,content:r,where:a}){let n=C[a];switch(t){case"markdown":return(0,e.jsx)("div",{className:(0,o.cn)("min-w-0 text-sm leading-relaxed",n.prose),children:(0,e.jsx)(l.Markdown,{children:r})});case"csv":return(0,e.jsx)(P,{content:r,className:n.block});case"json":return(0,e.jsx)(F,{text:function(t){try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}}(r),className:n.block});default:return(0,e.jsx)(F,{text:r,className:n.block})}}function $(t){let[e,n]=(0,r.useState)(null),[i,l]=(0,r.useState)(null),[s,d]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(!t)return;n(null),l(null),d(null);let e=!1;return fetch(a.queryKey.file(t),{headers:{range:`bytes=0-${m.WORKSPACE_VIEW.textMax-1}`}}).then(async t=>{if(!t.ok)throw Error(await t.text());return{text:await t.text(),of:function(t){let e=t.headers.get("content-range")?.match(/^bytes \d+-(\d+)\/(\d+)$/);if(!e)return null;let[,r,a]=e.map(Number);return r+1<a?a:null}(t)}}).then(({text:t,of:r})=>{e||(n(null===r?t:t.slice(0,t.lastIndexOf("\n")+1||void 0)),d(r))}).catch(t=>!e&&l((0,o.errorToString)(t))),()=>{e=!0}},[t]),{content:e,failure:i,truncated:s}}function L({path:t,bytes:r}){let[a,i]=(0,S.useServerAction)(j);return(0,e.jsxs)("div",{className:"space-y-4 p-8",children:[(0,e.jsxs)("p",{className:"max-w-lg text-sm leading-relaxed text-muted-foreground",children:[`This file is ${(0,o.formatBytes)(r)} — too big to draw here without `,"taking the window with it. Open it where it is instead."]}),(0,e.jsx)(n.Button,{variant:"outline",loading:i,onClick:()=>a(t),children:"Reveal in the file manager"})]})}function E({path:t,kind:r,onClose:a}){let{content:n,failure:l,truncated:o}=$(t),d=t?.split("/").pop()??"";return(0,e.jsx)(i.Dialog,{open:null!==t,onOpenChange:t=>!t&&a(),children:(0,e.jsxs)(i.DialogContent,{className:"flex max-h-[calc(100vh-3rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl",children:[(0,e.jsx)(i.DialogTitle,{className:"sr-only",children:d}),(0,e.jsx)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border/60 px-4 py-2.5 pr-12",children:(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[12px]",children:t})}),(0,e.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:l?(0,e.jsx)("p",{className:"p-5 font-mono text-xs text-destructive",children:l}):null===n?(0,e.jsxs)("div",{className:"space-y-3 p-5",children:[(0,e.jsx)(s.Skeleton,{className:"h-5 w-2/3"}),(0,e.jsx)(s.Skeleton,{className:"h-4 w-full"}),(0,e.jsx)(s.Skeleton,{className:"h-4 w-5/6"})]}):(0,e.jsx)(B,{kind:r,content:n,truncated:o})})]})})}function F({text:t,className:r}){return(0,e.jsx)("pre",{className:(0,o.cn)("overflow-x-auto font-mono text-[12px] leading-relaxed whitespace-pre-wrap text-foreground/90",r),children:t})}function P({content:t,className:a}){let[n,...i]=(0,r.useMemo)(()=>(function(t){let e=[],r=[],a="",n=!1;for(let i=0;i<t.length;i++){let l=t[i];n?'"'===l&&'"'===t[i+1]?(a+='"',i++):'"'===l?n=!1:a+=l:'"'===l?n=!0:","===l?(r.push(a),a=""):"\n"===l||"\r"===l?("\r"===l&&"\n"===t[i+1]&&i++,r.push(a),e.push(r),r=[],a=""):a+=l}return(a.length||r.length)&&(r.push(a),e.push(r)),e.filter(t=>t.some(t=>t.trim()))})(t),[t]);return n?(0,e.jsx)("div",{className:(0,o.cn)("overflow-x-auto",a),children:(0,e.jsxs)(d,{children:[(0,e.jsx)(c,{children:(0,e.jsx)(h,{children:n.map((t,r)=>(0,e.jsx)(f,{className:"whitespace-nowrap",children:t},`${r}-${t}`))})}),(0,e.jsx)(u,{children:i.map((t,r)=>(0,e.jsx)(h,{children:n.map((a,n)=>(0,e.jsx)(g,{className:"whitespace-nowrap",children:t[n]??""},`${r}-${n}`))},`${r}-${t[0]??""}`))})]})}):(0,e.jsx)(F,{text:t,className:a})}t.s(["FileBody",0,B,"FileDialog",0,E,"FileLink",0,function({path:t,className:n,title:i,label:l,children:s}){let o=M(t),d=(0,r.useContext)(_),[c,u]=(0,S.useServerAction)(j);return"tab"===o.how?(0,e.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",title:i??t,"aria-label":l,className:n,children:s}):(0,e.jsx)("button",{type:"button",disabled:u,title:i??t,"aria-label":l,className:n,onClick:()=>{"dialog"===o.how?d?d(o.path):window.open(a.queryKey.fileView(o.path),"_blank"):c(t)},children:s})},"FilePreview",0,function({path:t,bytes:r}){let n=x(t),{content:i,failure:l,truncated:o}=$(D.has(n)?null:t);return("frame"===n||"image"===n)&&r>m.WORKSPACE_VIEW.elementMax?(0,e.jsx)(L,{path:t,bytes:r}):"frame"===n?(0,e.jsx)("iframe",{title:t,src:a.queryKey.file(t),allow:"clipboard-read; clipboard-write; fullscreen; autoplay",className:"h-full w-full bg-white"}):"image"===n?(0,e.jsx)("img",{src:a.queryKey.file(t),alt:t,className:"mx-auto max-w-full p-6"}):"audio"===n||"video"===n?"audio"===n?(0,e.jsx)("audio",{controls:!0,src:a.queryKey.file(t),className:"w-full p-6",children:(0,e.jsx)("track",{kind:"captions"})}):(0,e.jsx)("video",{controls:!0,src:a.queryKey.file(t),className:"max-w-full p-6",children:(0,e.jsx)("track",{kind:"captions"})}):l?(0,e.jsx)("p",{className:"p-5 font-mono text-xs text-destructive",children:l}):null===i?(0,e.jsxs)("div",{className:"space-y-3 p-5",children:[(0,e.jsx)(s.Skeleton,{className:"h-5 w-2/3"}),(0,e.jsx)(s.Skeleton,{className:"h-4 w-full"}),(0,e.jsx)(s.Skeleton,{className:"h-4 w-5/6"})]}):(0,e.jsx)(B,{kind:n,content:i,truncated:o})},"FileViewer",0,function({children:t}){let[a,n]=(0,r.useState)(null);return(0,e.jsxs)(_,{value:n,children:[t,(0,e.jsx)(E,{path:a,kind:a?x(a):"text",onClose:()=>n(null)})]})},"fileTarget",0,M,"useFileText",0,$,"useOpenFile",0,function(){let t=(0,r.useContext)(_);return(0,r.useCallback)(e=>{let r=M(e);if("os"===r.how)return!1;if("dialog"===r.how&&t)return t(r.path),!0;let n="tab"===r.how?r.href:a.queryKey.fileView(r.path);return null!==window.open(n,"_blank")},[t])}],621285)},245629,401851,t=>{"use strict";var e=t.i(55545),r=t.i(455024),a=t.i(99151),n=t.i(845110),i=t.i(234662),l=t.i(281092);function s(t,e){let r=(0,l.toDate)(t,e?.in);return r.setHours(0,0,0,0),r}function o(t,e){let a=(0,r.getDefaultOptions)(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,i=(0,l.toDate)(t,e?.in),s=i.getDay();return i.setDate(i.getDate()-(7*(s<n)+s-n)),i.setHours(0,0,0,0),i}function d(t,e){return o(t,{...e,weekStartsOn:1})}var c=t.i(677241);function u(t,e){let r=(0,l.toDate)(t,e?.in),a=r.getFullYear(),n=(0,c.constructFrom)(r,0);n.setFullYear(a+1,0,4),n.setHours(0,0,0,0);let i=d(n),s=(0,c.constructFrom)(r,0);s.setFullYear(a,0,4),s.setHours(0,0,0,0);let o=d(s);return r.getTime()>=i.getTime()?a+1:r.getTime()>=o.getTime()?a:a-1}function h(t,e){let a=(0,l.toDate)(t,e?.in),n=a.getFullYear(),i=(0,r.getDefaultOptions)(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,d=(0,c.constructFrom)(e?.in||t,0);d.setFullYear(n+1,0,s),d.setHours(0,0,0,0);let u=o(d,e),h=(0,c.constructFrom)(e?.in||t,0);h.setFullYear(n,0,s),h.setHours(0,0,0,0);let f=o(h,e);return+a>=+u?n+1:+a>=+f?n:n-1}function f(t,e){let r=Math.abs(t).toString().padStart(e,"0");return(t<0?"-":"")+r}let g={y(t,e){let r=t.getFullYear(),a=r>0?r:1-r;return f("yy"===e?a%100:a,e.length)},M(t,e){let r=t.getMonth();return"M"===e?String(r+1):f(r+1,2)},d:(t,e)=>f(t.getDate(),e.length),a(t,e){let r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(t,e)=>f(t.getHours()%12||12,e.length),H:(t,e)=>f(t.getHours(),e.length),m:(t,e)=>f(t.getMinutes(),e.length),s:(t,e)=>f(t.getSeconds(),e.length),S(t,e){let r=e.length;return f(Math.trunc(t.getMilliseconds()*Math.pow(10,r-3)),e.length)}},m={G:function(t,e,r){let a=+(t.getFullYear()>0);switch(e){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"});case"GGGGG":return r.era(a,{width:"narrow"});default:return r.era(a,{width:"wide"})}},y:function(t,e,r){if("yo"===e){let e=t.getFullYear();return r.ordinalNumber(e>0?e:1-e,{unit:"year"})}return g.y(t,e)},Y:function(t,e,r,a){let n=h(t,a),i=n>0?n:1-n;return"YY"===e?f(i%100,2):"Yo"===e?r.ordinalNumber(i,{unit:"year"}):f(i,e.length)},R:function(t,e){return f(u(t),e.length)},u:function(t,e){return f(t.getFullYear(),e.length)},Q:function(t,e,r){let a=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(a);case"QQ":return f(a,2);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});default:return r.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,e,r){let a=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(a);case"qq":return f(a,2);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});default:return r.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,e,r){let a=t.getMonth();switch(e){case"M":case"MM":return g.M(t,e);case"Mo":return r.ordinalNumber(a+1,{unit:"month"});case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});default:return r.month(a,{width:"wide",context:"formatting"})}},L:function(t,e,r){let a=t.getMonth();switch(e){case"L":return String(a+1);case"LL":return f(a+1,2);case"Lo":return r.ordinalNumber(a+1,{unit:"month"});case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});default:return r.month(a,{width:"wide",context:"standalone"})}},w:function(t,e,a,n){let s,d,u,g,m,w=Math.round((o(s=(0,l.toDate)(t,n?.in),n)-(d=(0,r.getDefaultOptions)(),u=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??d.firstWeekContainsDate??d.locale?.options?.firstWeekContainsDate??1,g=h(s,n),(m=(0,c.constructFrom)(n?.in||s,0)).setFullYear(g,0,u),m.setHours(0,0,0,0),o(m,n)))/i.millisecondsInWeek)+1;return"wo"===e?a.ordinalNumber(w,{unit:"week"}):f(w,e.length)},I:function(t,e,r){let a,n,s,o=Math.round((d(a=(0,l.toDate)(t,void 0))-(n=u(a,void 0),(s=(0,c.constructFrom)(a,0)).setFullYear(n,0,4),s.setHours(0,0,0,0),d(s)))/i.millisecondsInWeek)+1;return"Io"===e?r.ordinalNumber(o,{unit:"week"}):f(o,e.length)},d:function(t,e,r){return"do"===e?r.ordinalNumber(t.getDate(),{unit:"date"}):g.d(t,e)},D:function(t,e,r){let o,d,c=function(t,e){let[r,l]=(0,n.normalizeDates)(void 0,t,e),o=s(r),d=s(l);return Math.round((o-(0,a.getTimezoneOffsetInMilliseconds)(o)-(d-(0,a.getTimezoneOffsetInMilliseconds)(d)))/i.millisecondsInDay)}(o=(0,l.toDate)(t,void 0),((d=(0,l.toDate)(o,void 0)).setFullYear(d.getFullYear(),0,1),d.setHours(0,0,0,0),d))+1;return"Do"===e?r.ordinalNumber(c,{unit:"dayOfYear"}):f(c,e.length)},E:function(t,e,r){let a=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},e:function(t,e,r,a){let n=t.getDay(),i=(n-a.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return f(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},c:function(t,e,r,a){let n=t.getDay(),i=(n-a.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return f(i,e.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(n,{width:"narrow",context:"standalone"});case"cccccc":return r.day(n,{width:"short",context:"standalone"});default:return r.day(n,{width:"wide",context:"standalone"})}},i:function(t,e,r){let a=t.getDay(),n=0===a?7:a;switch(e){case"i":return String(n);case"ii":return f(n,e.length);case"io":return r.ordinalNumber(n,{unit:"day"});case"iii":return r.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},a:function(t,e,r){let a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,r){let a,n=t.getHours();switch(a=12===n?"noon":0===n?"midnight":n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,r){let a,n=t.getHours();switch(a=n>=17?"evening":n>=12?"afternoon":n>=4?"morning":"night",e){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,r){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),r.ordinalNumber(e,{unit:"hour"})}return g.h(t,e)},H:function(t,e,r){return"Ho"===e?r.ordinalNumber(t.getHours(),{unit:"hour"}):g.H(t,e)},K:function(t,e,r){let a=t.getHours()%12;return"Ko"===e?r.ordinalNumber(a,{unit:"hour"}):f(a,e.length)},k:function(t,e,r){let a=t.getHours();return(0===a&&(a=24),"ko"===e)?r.ordinalNumber(a,{unit:"hour"}):f(a,e.length)},m:function(t,e,r){return"mo"===e?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):g.m(t,e)},s:function(t,e,r){return"so"===e?r.ordinalNumber(t.getSeconds(),{unit:"second"}):g.s(t,e)},S:function(t,e){return g.S(t,e)},X:function(t,e,r){let a=t.getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return p(a);case"XXXX":case"XX":return x(a);default:return x(a,":")}},x:function(t,e,r){let a=t.getTimezoneOffset();switch(e){case"x":return p(a);case"xxxx":case"xx":return x(a);default:return x(a,":")}},O:function(t,e,r){let a=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+w(a,":");default:return"GMT"+x(a,":")}},z:function(t,e,r){let a=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+w(a,":");default:return"GMT"+x(a,":")}},t:function(t,e,r){return f(Math.trunc(t/1e3),e.length)},T:function(t,e,r){return f(+t,e.length)}};function w(t,e=""){let r=t>0?"-":"+",a=Math.abs(t),n=Math.trunc(a/60),i=a%60;return 0===i?r+String(n):r+String(n)+e+f(i,2)}function p(t,e){return t%60==0?(t>0?"-":"+")+f(Math.abs(t)/60,2):x(t,e)}function x(t,e=""){let r=Math.abs(t);return(t>0?"-":"+")+f(Math.trunc(r/60),2)+e+f(r%60,2)}let b=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},y=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},k={p:y,P:(t,e)=>{let r,a=t.match(/(P+)(p+)?/)||[],n=a[1],i=a[2];if(!i)return b(t,e);switch(n){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;default:r=e.dateTime({width:"full"})}return r.replace("{{date}}",b(n,e)).replace("{{time}}",y(i,e))}},v=/^D+$/,N=/^Y+$/,j=["D","DD","YY","YYYY"],S=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,D=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,M=/^'([^]*?)'?$/,_=/''/g,C=/[a-zA-Z]/;function B(t,a,n){let i=(0,r.getDefaultOptions)(),s=n?.locale??i.locale??e.defaultLocale,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,d=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,c=(0,l.toDate)(t,n?.in);if(!(c instanceof Date||"object"==typeof c&&"[object Date]"===Object.prototype.toString.call(c))&&"number"!=typeof c||isNaN(+(0,l.toDate)(c)))throw RangeError("Invalid time value");let u=a.match(D).map(t=>{let e=t[0];return"p"===e||"P"===e?(0,k[e])(t,s.formatLong):t}).join("").match(S).map(t=>{if("''"===t)return{isToken:!1,value:"'"};let e=t[0];if("'"===e){var r;let e;return{isToken:!1,value:(e=(r=t).match(M))?e[1].replace(_,"'"):r}}if(m[e])return{isToken:!0,value:t};if(e.match(C))throw RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}});s.localize.preprocessor&&(u=s.localize.preprocessor(c,u));let h={firstWeekContainsDate:o,weekStartsOn:d,locale:s};return u.map(e=>{if(!e.isToken)return e.value;let r=e.value;return(!n?.useAdditionalWeekYearTokens&&N.test(r)||!n?.useAdditionalDayOfYearTokens&&v.test(r))&&function(t,e,r){var a,n,i;let l,s=(a=t,n=e,i=r,l="Y"===a[0]?"years":"days of the month",`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${n}\`) for formatting ${l} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(s),j.includes(t))throw RangeError(s)}(r,a,String(t)),(0,m[r[0]])(c,r,s.localize,h)}).join("")}t.s(["format",0,B],401851);var T=t.i(24708);function O(t,e,r){let[a,i]=(0,n.normalizeDates)(r?.in,t,e);return+s(a)==+s(i)}var $=t.i(681307);let L=$.z.union([$.z.date(),$.z.iso.datetime()]),E=t=>new Date(t);t.s(["DateLikeSchema",0,L,"shortAgo",0,function(t,e=Date.now()){let r=Math.max(0,Math.round((e-E(t).getTime())/1e3));if(r<60)return"now";let a=Math.round(r/60);if(a<60)return`${a}m`;let n=Math.round(a/60);return n<24?`${n}h`:`${Math.round(n/24)}d`},"toDate",0,E,"whenOf",0,function(t){let e=E(t),r=B(e,"HH:mm");return O((0,c.constructFrom)(e,e),(0,T.constructNow)(e))?r:!function(t){var e,r;let a;return O((0,c.constructFrom)(t,t),(e=(0,T.constructNow)(t),r=void 0,a=(0,l.toDate)(e,r?.in),isNaN(-1)?(0,c.constructFrom)(r?.in||e,NaN):(a.setDate(a.getDate()+-1),a)))}(e)?`${B(e,"MMM d")} \xb7 ${r}`:`Yesterday ${r}`}],245629)},696017,t=>{"use strict";var e=t.i(60231),r=t.i(419524);t.i(947716);var a=t.i(723685),n=(0,r.__name)(t=>{let{securityLevel:r}=(0,e.getConfig2)(),n=(0,a.select)("body");if("sandbox"===r){let e=(0,a.select)(`#i${t}`),r=e.node()?.contentDocument??document;n=(0,a.select)(r.body)}return n.select(`#${t}`)},"selectSvgElement");t.s(["selectSvgElement",0,n])},502056,t=>{"use strict";var e=t.i(217248),r=t.i(447804),a=t.i(508324),n=t.i(419524),i=(0,n.__name)(({flowchart:t})=>{let e=t?.subGraphTitleMargin?.top??0,r=t?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:e+r}},"getSubGraphTitleMargins"),l=new Map;async function s(t,a,n){let i,s;"rect"===a.shape&&(a.rx&&a.ry?a.shape="roundedRect":a.shape="squareRect");let o=a.shape?e.shapes[a.shape]:void 0;if(!o)throw Error(`No such shape: ${a.shape}. Please check your syntax.`);if(a.link){let e;"sandbox"===n.config.securityLevel?e="_top":a.linkTarget&&(e=a.linkTarget||"_blank"),i=t.insert("svg:a").attr("xlink:href",a.link).attr("target",e??null),s=await o(i,a,n)}else i=s=await o(t,a,n);return i.attr("data-look",(0,r.handleUndefinedAttr)(a.look)),a.tooltip&&s.attr("title",a.tooltip),l.set(a.id,i),a.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}(0,n.__name)(s,"insertNode");var o=(0,n.__name)((t,e)=>{l.set(e.id,t)},"setNodeElem"),d=(0,n.__name)(()=>{l.clear()},"clear"),c=(0,n.__name)(t=>{let e=l.get(t.id);a.log.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode");t.s(["clear",0,d,"getSubGraphTitleMargins",0,i,"insertNode",0,s,"positionNode",0,c,"setNodeElem",0,o])},369110,t=>{"use strict";var e=t.i(502056),r=t.i(217248),a=t.i(224797),n=t.i(836333),i=t.i(60231),l=t.i(508324),s=t.i(419524);t.i(947716);var o=t.i(723685),d=t.i(883272),c=(0,s.__name)(async(t,e)=>{let s,c,u=(0,i.getConfig2)(),{themeVariables:h,handDrawnSeed:f}=u,{clusterBkg:g,clusterBorder:m}=h,{labelStyles:w,nodeStyles:p,borderStyles:x,backgroundStyles:b}=(0,a.styles2String)(e),y=t.insert("g").attr("class","cluster swimlane "+(e.cssClasses||"")).attr("id",e.id).attr("data-id",e.id).attr("data-et","cluster").attr("data-look",e.look),k=(0,i.evaluate)(u.flowchart.htmlLabels),v="LR"===e.direction,N=y.insert("g").attr("class","cluster-label swimlane-label"),j=await (0,n.createText)(N,e.label,{style:e.labelStyle,useHtmlLabels:k,isNode:!0,width:e.width}),S=j.getBBox();if(k){let t=j.children[0],e=(0,o.select)(j);S=t.getBoundingClientRect(),e.attr("width",S.width),e.attr("height",S.height)}let D=e.padding??0,M=e.width<=S.width+D?S.width+D:e.width;e.width<=S.width+D?e.diff=(M-e.width)/2-D:e.diff=-D;let _=e.height,C=e.y-_/2,B=e.y+_/2,T=e.x-M/2,O=void 0!==e.swimlaneContentTop?e.swimlaneContentTop:C+_/3,$=4*!!v,L=S.height+2*$;if(v){let t=Math.max(L,S.height+2*$),r=T+t,n=Math.max(0,M-t);if("handDrawn"===e.look){let i=d.default.svg(y),l=(0,a.userNodeOverrides)(e,{roughness:.7,fill:g,stroke:m,fillWeight:3,seed:f}),o=(0,a.userNodeOverrides)(e,{roughness:.7,fill:"none",stroke:m,seed:f}),u=i.rectangle(T,C,t,_,l);s=y.insert(()=>u,":first-child");let h=i.rectangle(r,C,n,_,o);c=y.insert(()=>h,":first-child"),s.select("path:nth-child(2)").attr("style",x.join(";")),s.select("path").attr("style",b.join(";").replace("fill","stroke"))}else s=y.insert("rect",":first-child"),c=y.insert("rect",":first-child"),s.attr("class","swimlane-title").attr("style",p).attr("x",T).attr("y",C).attr("width",t).attr("height",_).attr("fill",g).attr("stroke",m),c.attr("class","swimlane-body").attr("style",p).attr("x",r).attr("y",C).attr("width",n).attr("height",_).attr("fill","none").attr("stroke",m);let i=T+t/2,l=e.y;N.attr("transform",`translate(${i}, ${l}) rotate(-90) translate(${-S.width/2}, ${-S.height/2})`)}else{let t=Math.min(L,Math.max(0,O-C)),r=C+t,n=Math.max(0,B-r),i=e.x-M/2;if("handDrawn"===e.look){let l=d.default.svg(y),o=(0,a.userNodeOverrides)(e,{roughness:.7,fill:g,stroke:m,fillWeight:3,seed:f}),u=(0,a.userNodeOverrides)(e,{roughness:.7,fill:"none",stroke:m,seed:f}),h=l.rectangle(i,C,M,t,o);s=y.insert(()=>h,":first-child");let w=l.rectangle(i,r,M,n,u);c=y.insert(()=>w,":first-child"),s.select("path:nth-child(2)").attr("style",x.join(";")),s.select("path").attr("style",b.join(";").replace("fill","stroke"))}else s=y.insert("rect",":first-child"),c=y.insert("rect",":first-child"),s.attr("class","swimlane-title").attr("style",p).attr("x",i).attr("y",C).attr("width",M).attr("height",t).attr("fill",g).attr("stroke",m),c.attr("class","swimlane-body").attr("style",p).attr("x",i).attr("y",r).attr("width",M).attr("height",n).attr("fill","none").attr("stroke",m);let l=e.x-S.width/2,o=C+(t-S.height)/2;N.attr("transform",`translate(${l}, ${o})`)}if(l.log.trace("Swimlane data ",e,JSON.stringify(e)),w){let t=N.select("span");t&&t.attr("style",w)}return e.offsetX=0,e.width=M,e.height=_,e.offsetY=S.height-D/2,e.intersect=function(t){return(0,r.intersect_rect_default)(e,t)},{cluster:y,labelBBox:S}},"swimlane"),u=(0,s.__name)(async(t,s)=>{let c,u;l.log.info("Creating subgraph rect for ",s.id,s);let h=(0,i.getConfig2)(),{themeVariables:f,handDrawnSeed:g}=h,{clusterBkg:m,clusterBorder:w}=f,{labelStyles:p,nodeStyles:x,borderStyles:b,backgroundStyles:y}=(0,a.styles2String)(s),k=t.insert("g").attr("class","cluster "+s.cssClasses).attr("id",s.domId).attr("data-look",s.look),v=(0,i.getEffectiveHtmlLabels)(h),N=k.insert("g").attr("class","cluster-label "),j=(c="markdown"===s.labelType?await (0,n.createText)(N,s.label,{style:s.labelStyle,useHtmlLabels:v,isNode:!0,width:s.width}):await (0,r.createLabel_default)(N,s.label,s.labelStyle||"",!1,!0)).getBBox();if((0,i.getEffectiveHtmlLabels)(h)){let t=c.children[0],e=(0,o.select)(c);j=t.getBoundingClientRect(),e.attr("width",j.width),e.attr("height",j.height)}let S=s.width<=j.width+s.padding?j.width+s.padding:s.width;s.width<=j.width+s.padding?s.diff=(S-s.width)/2-s.padding:s.diff=-s.padding;let D=s.height,M=s.x-S/2,_=s.y-D/2;if(l.log.trace("Data ",s,JSON.stringify(s)),"handDrawn"===s.look){let t=d.default.svg(k),e=(0,a.userNodeOverrides)(s,{roughness:.7,fill:m,stroke:w,fillWeight:3,seed:g}),n=t.path((0,r.createRoundedRectPathD)(M,_,S,D,0),e);(u=k.insert(()=>(l.log.debug("Rough node insert CXC",n),n),":first-child")).select("path:nth-child(2)").attr("style",b.join(";")),u.select("path").attr("style",y.join(";").replace("fill","stroke"))}else(u=k.insert("rect",":first-child")).attr("style",x).attr("rx",s.rx).attr("ry",s.ry).attr("x",M).attr("y",_).attr("width",S).attr("height",D);let{subGraphTitleTopMargin:C}=(0,e.getSubGraphTitleMargins)(h);if(N.attr("transform",`translate(${s.x-j.width/2}, ${s.y-s.height/2+C})`),p){let t=N.select("span");t&&t.attr("style",p)}let B=u.node().getBBox();return s.offsetX=0,s.width=B.width,s.height=B.height,s.offsetY=j.height-s.padding/2,s.intersect=function(t){return(0,r.intersect_rect_default)(s,t)},{cluster:k,labelBBox:j}},"rect"),h=(0,s.__name)((t,e)=>{let a=t.insert("g").attr("class","note-cluster").attr("id",e.domId),n=a.insert("rect",":first-child"),i=0*e.padding,l=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-l).attr("y",e.y-e.height/2-l).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");let s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(t){return(0,r.intersect_rect_default)(e,t)},{cluster:a,labelBBox:{width:0,height:0}}},"noteGroup"),f=(0,s.__name)(async(t,e)=>{let a,n=(0,i.getConfig2)(),{themeVariables:l,handDrawnSeed:s}=n,{altBackground:c,compositeBackground:u,compositeTitleBackground:h,nodeBorder:f}=l,g=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-id",e.id).attr("data-look",e.look),m=g.insert("g",":first-child"),w=g.insert("g").attr("class","cluster-label"),p=g.append("rect"),x=await (0,r.createLabel_default)(w,e.label,e.labelStyle,void 0,!0),b=x.getBBox();if((0,i.getEffectiveHtmlLabels)(n)){let t=x.children[0],e=(0,o.select)(x);b=t.getBoundingClientRect(),e.attr("width",b.width),e.attr("height",b.height)}let y=0*e.padding,k=(e.width<=b.width+e.padding?b.width+e.padding:e.width)+y;e.width<=b.width+e.padding?e.diff=(k-e.width)/2-e.padding:e.diff=-e.padding;let v=e.height+y,N=e.height+y-b.height-6,j=e.x-k/2,S=e.y-v/2;e.width=k;let D=e.y-e.height/2-y/2+b.height+2;if("handDrawn"===e.look){let t=e.cssClasses.includes("statediagram-cluster-alt"),n=d.default.svg(g),i=e.rx||e.ry?n.path((0,r.createRoundedRectPathD)(j,S,k,v,10),{roughness:.7,fill:h,fillStyle:"solid",stroke:f,seed:s}):n.rectangle(j,S,k,v,{seed:s});a=g.insert(()=>i,":first-child");let l=n.rectangle(j,D,k,N,{fill:t?c:u,fillStyle:t?"hachure":"solid",stroke:f,seed:s});a=g.insert(()=>i,":first-child"),p=g.insert(()=>l)}else(a=m.insert("rect",":first-child")).attr("class","outer").attr("x",j).attr("y",S).attr("width",k).attr("height",v).attr("data-look",e.look),p.attr("class","inner").attr("x",j).attr("y",D).attr("width",k).attr("height",N);return w.attr("transform",`translate(${e.x-b.width/2}, ${S+1-3*!(0,i.getEffectiveHtmlLabels)(n)})`),e.height=a.node().getBBox().height,e.offsetX=0,e.offsetY=b.height-e.padding/2,e.labelBBox=b,e.intersect=function(t){return(0,r.intersect_rect_default)(e,t)},{cluster:g,labelBBox:b}},"roundedWithTitle"),g=(0,s.__name)(async(t,s)=>{let c;l.log.info("Creating subgraph rect for ",s.id,s);let u=(0,i.getConfig2)(),{themeVariables:h,handDrawnSeed:f}=u,{clusterBkg:g,clusterBorder:m}=h,{labelStyles:w,nodeStyles:p,borderStyles:x,backgroundStyles:b}=(0,a.styles2String)(s),y=t.insert("g").attr("class","cluster "+s.cssClasses).attr("id",s.domId).attr("data-look",s.look),k=(0,i.getEffectiveHtmlLabels)(u),v=y.insert("g").attr("class","cluster-label "),N=await (0,n.createText)(v,s.label,{style:s.labelStyle,useHtmlLabels:k,isNode:!0,width:s.width}),j=N.getBBox();if((0,i.getEffectiveHtmlLabels)(u)){let t=N.children[0],e=(0,o.select)(N);j=t.getBoundingClientRect(),e.attr("width",j.width),e.attr("height",j.height)}let S=s.width<=j.width+s.padding?j.width+s.padding:s.width;s.width<=j.width+s.padding?s.diff=(S-s.width)/2-s.padding:s.diff=-s.padding;let D=s.height,M=s.x-S/2,_=s.y-D/2;if(l.log.trace("Data ",s,JSON.stringify(s)),"handDrawn"===s.look){let t=d.default.svg(y),e=(0,a.userNodeOverrides)(s,{roughness:.7,fill:g,stroke:m,fillWeight:4,seed:f}),n=t.path((0,r.createRoundedRectPathD)(M,_,S,D,s.rx),e);(c=y.insert(()=>(l.log.debug("Rough node insert CXC",n),n),":first-child")).select("path:nth-child(2)").attr("style",x.join(";")),c.select("path").attr("style",b.join(";").replace("fill","stroke"))}else(c=y.insert("rect",":first-child")).attr("style",p).attr("rx",s.rx).attr("ry",s.ry).attr("x",M).attr("y",_).attr("width",S).attr("height",D);let{subGraphTitleTopMargin:C}=(0,e.getSubGraphTitleMargins)(u);if(v.attr("transform",`translate(${s.x-j.width/2}, ${s.y-s.height/2+C})`),w){let t=v.select("span");t&&t.attr("style",w)}let B=c.node().getBBox();return s.offsetX=0,s.width=B.width,s.height=B.height,s.offsetY=j.height-s.padding/2,s.intersect=function(t){return(0,r.intersect_rect_default)(s,t)},{cluster:y,labelBBox:j}},"kanbanSection"),m={rect:u,squareRect:u,roundedWithTitle:f,noteGroup:h,divider:(0,s.__name)((t,e)=>{let a,{themeVariables:n,handDrawnSeed:l}=(0,i.getConfig2)(),{nodeBorder:s}=n,o=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),c=o.insert("g",":first-child"),u=0*e.padding,h=e.width+u;e.diff=-e.padding;let f=e.height+u,g=e.x-h/2,m=e.y-f/2;if(e.width=h,"handDrawn"===e.look){let t=d.default.svg(o).rectangle(g,m,h,f,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:l});a=o.insert(()=>t,":first-child")}else{a=c.insert("rect",":first-child");let t="outer";e.look,t="divider",a.attr("class",t).attr("x",g).attr("y",m).attr("width",h).attr("height",f).attr("data-look",e.look)}return e.height=a.node().getBBox().height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return(0,r.intersect_rect_default)(e,t)},{cluster:o,labelBBox:{}}},"divider"),kanbanSection:g,swimlane:c},w=new Map,p=(0,s.__name)(async(t,e)=>{let r=e.shape||"rect",a=await m[r](t,e);return w.set(e.id,a),a},"insertCluster"),x=(0,s.__name)(()=>{w=new Map},"clear");t.s(["clear",0,x,"insertCluster",0,p])},121292,t=>{"use strict";var e=t.i(369110),r=t.i(382793),a=t.i(502056),n=t.i(217248),i=t.i(447804),l=t.i(60231),s=t.i(508324),o=t.i(419524),d={common:l.common_default,getConfig:l.getConfig,insertCluster:e.insertCluster,insertEdge:r.insertEdge,insertEdgeLabel:r.insertEdgeLabel,insertMarkers:r.markers_default,insertNode:a.insertNode,interpolateToCurve:i.interpolateToCurve,labelHelper:n.labelHelper,log:s.log,positionEdgeLabel:r.positionEdgeLabel},c={},u=(0,o.__name)(t=>{for(let e of t)c[e.name]=e},"registerLayoutLoaders");(0,o.__name)(()=>{u([{name:"dagre",loader:(0,o.__name)(async()=>await t.A(555153),"loader")},{name:"swimlane",loader:(0,o.__name)(async()=>await t.A(12782),"loader")},{name:"cose-bilkent",loader:(0,o.__name)(async()=>await t.A(208503),"loader")}])},"registerDefaultLayoutLoaders")();var h=(0,o.__name)(async(t,e)=>{if(!(t.layoutAlgorithm in c))throw Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);if(t.diagramId)for(let e of t.nodes){let r=e.domId||e.id;e.domId=`${t.diagramId}-${r}`}let r=c[t.layoutAlgorithm],a=await r.loader(),{theme:n,themeVariables:i}=t.config,{useGradient:l,gradientStart:s,gradientStop:o}=i,u=e.attr("id");if(e.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n?.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n?.includes("dark")?"#FFFFFF":"#000000"}`),l){let t=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");t.append("svg:stop").attr("offset","0%").attr("stop-color",s).attr("stop-opacity",1),t.append("svg:stop").attr("offset","100%").attr("stop-color",o).attr("stop-opacity",1)}return a.render(t,e,d,{algorithm:r.algorithm})},"render"),f=(0,o.__name)((t="",{fallback:e="dagre"}={})=>{if(t in c)return t;if(e in c)return s.log.warn(`Layout algorithm ${t} is not registered. Using ${e} as fallback.`),e;throw Error(`Both layout algorithms ${t} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm");t.s(["getRegisteredLayoutAlgorithm",0,f,"registerLayoutLoaders",0,u,"render",0,h])}]);
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <div align="center">
2
2
 
3
- <img src="docs/images/hero.png" alt="Thursday" width="760">
3
+ <img src="docs/images/hero.png" alt="Thursday — an open-source voice agent with a face made of emoji" width="760">
4
4
 
5
5
  ### Everyone wanted Friday. This is Thursday.
6
6
 
7
- **A voice agent that lives on your machine.** You talk. It works. You keep talking.
7
+ **An open-source voice agent that lives on your machine.** You talk. It works. You keep talking.
8
8
 
9
9
  [![npm](https://img.shields.io/npm/v/thursday-agent?style=flat-square&color=111&label=npm)](https://www.npmjs.com/package/thursday-agent)
10
10
  [![CI](https://img.shields.io/github/actions/workflow/status/cgoinglove/thursday/ci.yml?style=flat-square&label=ci)](https://github.com/cgoinglove/thursday/actions/workflows/ci.yml)
@@ -21,7 +21,7 @@
21
21
  npx thursday-agent
22
22
  ```
23
23
 
24
- One API key, typed into the first screen. No `.env`, no account, no cloud. That is the whole setup.
24
+ One API key, typed into the first screen. Then say **"hey thursday."** No `.env`, no account, no cloud. That is the whole setup.
25
25
 
26
26
  <br>
27
27
 
@@ -35,6 +35,21 @@ You never watched a spinner. You never stopped talking.
35
35
 
36
36
  <br>
37
37
 
38
+ ## She has a face, and it is made of emoji
39
+
40
+ <div align="center">
41
+ <picture>
42
+ <source media="(prefers-color-scheme: dark)" srcset="docs/images/face-dark.png">
43
+ <img src="docs/images/face-light.png" alt="Thursday's face: an orb of emoji that swells when she speaks" width="280">
44
+ </picture>
45
+ </div>
46
+
47
+ Hundreds of them, packed into one orb. When she talks, the rim swells with her voice and every syllable shakes a few loose — you can tell she is speaking with the sound off.
48
+
49
+ Rather have letters, a sprinkle, or a plain mark with two eyes? Settings › Thursday.
50
+
51
+ <br>
52
+
38
53
  ## A harness you talk to
39
54
 
40
55
  A **harness** is the layer around a model that decides what it sees, which tools it may call, where its commands run, and what survives the session. Claude Code, [OpenClaw](https://github.com/openclaw/openclaw) and [Hermes](https://github.com/NousResearch/hermes-agent) are harnesses, and they got very good this year.
@@ -64,7 +79,7 @@ The split is not new. OpenAI's own [realtime-agents](https://github.com/openai/o
64
79
 
65
80
  They are frameworks and demonstrations: excellent parts for building a voice agent. What they hand the supervisor is a tool list.
66
81
 
67
- Thursday hands it a machine — a shell, the Chrome you are already signed into, skills, connectors, a workspace, and jobs that keep running after you hang up. It is a harness first, and speech is how you operate it. That is the whole difference, and it is the half that takes the work.
82
+ Thursday hands it a machine — a shell, a real browser, skills, connectors, a workspace, and jobs that keep running after you hang up. It is a harness first, and speech is how you operate it. That is the whole difference, and it is the half that takes the work.
68
83
 
69
84
  </details>
70
85
 
@@ -72,18 +87,19 @@ Thursday hands it a machine — a shell, the Chrome you are already signed into,
72
87
 
73
88
  ## What a bot actually has
74
89
 
75
- Not an API sandbox. **Your computer.**
90
+ Not an API sandbox. **Your computer** — down to the Chrome you are already signed into, which no agent in someone else's cloud can borrow.
76
91
 
77
92
  - **A shell** — real commands on your real files
78
- - **A real browser** — and it attaches to the Chrome you are *already signed into*. Your email, your accounts, your 2FA already done. **A cloud agent physically cannot do this.**
93
+ - **A real browser** — its own, or attached to your Chrome. When there is something for you to see — a checkout, a map, a sign-in — it opens a window on your screen and leaves it there
79
94
  - **Skills** — the browser, this Mac, building a page; `npx skills add` for the rest
80
95
  - **46 connectors** — Notion, GitHub, Linear, Slack, Figma, Stripe, Supabase… one click each
81
96
  - **A studio** — image, video, speech, transcription
97
+ - **Its own memory** — what it learned doing the job, kept as files you can open on its page
82
98
  - **Each other** — a bot hands a part of its job to the bot that exists for it
83
99
 
84
- ![A bot gets your shell, your skills, and the Chrome you are already signed into](docs/images/machine.png)
100
+ ![A bot gets your shell, your skills and a real browser — and leaves the checkout for you](docs/images/machine.png)
85
101
 
86
- It signs in where it has to, in a window you can watch, and stops at exactly one thing: **the password.** That half is yours. Everything else it finishes.
102
+ It signs in the way you would let it: a session it kept, your own Chrome, you in the window it opened, or the login you gave it — after asking. And there is one button it never presses: **pay.** It takes the order to the last screen, leaves it open in front of you, and tells you what it buys and for how much.
87
103
 
88
104
  <br>
89
105
 
@@ -93,23 +109,25 @@ It signs in where it has to, in a window you can watch, and stops at exactly one
93
109
 
94
110
  Jarvis holds the job and decides neither half is his. Navigator opens six shops and reads them. Scribe builds the page out of what came back. It reaches you as one line, out loud — and the room is there to read if you ever want to know how.
95
111
 
112
+ Those three come with her. Two more are ready-made in Settings — **Insta** draws the post, writes the caption and puts it up once you say so; **Voyage** plans the trip with a map for each day — and one of your own takes a name and a sentence.
113
+
96
114
  <br>
97
115
 
98
116
  ## Hang up. It keeps going.
99
117
 
100
- The job is not in the call. It runs on the server and the screen is a projection of it — so hang up mid-sentence, open a new tab, come back in ten minutes. She tells you what came in, or rings you, if you let her.
118
+ The job is not in the call. It runs on the server and the screen is a projection of it — so hang up mid-sentence, open a new tab, come back in ten minutes. She tells you what came in, or rings you, if you let her. The tab says it too: `(2) Thursday` means two things are waiting on you.
101
119
 
102
120
  ![The call ends at 0:12; the job runs to 2:41](docs/images/keeps-going.png)
103
121
 
104
- Close the app entirely and it does the honest thing instead: ten seconds with no browser on it and every running job stops where it stands, keeps its thread, and waits for you to pick it back up. **Nothing spends your keys while you are not looking.**
122
+ Close the app and it does the honest thing: ten seconds with no browser on it and every running job stops where it stands. **Nothing spends your keys while you are not looking.** Open it again and they pick themselves back up — the same after a restart, a `Ctrl+C`, or a model that went quiet for a minute.
105
123
 
106
124
  <br>
107
125
 
108
126
  ## It remembers you, and you can read it
109
127
 
110
- One fact per line, in the database on your disk. Open the Memory screen and read every one — where it came from, when it landed, whether it rides in every call — and delete any of them.
128
+ One fact per line, in the database on your disk. Open the Memory screen and read every one — where it came from, when it landed, whether it rides in every call — and delete any of them. Or type what changed, *"I moved to Busan"*, and watch the edit land.
111
129
 
112
- And after every call a text model **re-reads what was actually said** and reconciles the notes with it — so what she keeps is not only what she thought to write down mid-sentence.
130
+ Every fact remembers the call it was said in, so when one line is not enough she can go back and read the conversation.
113
131
 
114
132
  <br>
115
133
 
@@ -117,10 +135,10 @@ And after every call a text model **re-reads what was actually said** and reconc
117
135
 
118
136
  | | |
119
137
  |---|---|
120
- | **Your browser** | Bots attach to the Chrome already open on your desk — your sessions, your logins |
138
+ | **Your browser** | Bots drive a real browser on your machine — and can attach to the Chrome already open on your desk |
121
139
  | **Your machine** | Real commands on real files. Not a VM with a copy |
122
140
  | **Your keys** | A SQLite file on your disk, stripped from the shell a bot runs in |
123
- | **Your memory** | Facts in a file on your disk. Read, edit and delete them on the screen |
141
+ | **Your memory** | Facts in a database on your disk. Read, edit and delete them on the screen |
124
142
  | **No account** | Nothing to sign up for. The "server" is a Node process on `127.0.0.1` |
125
143
 
126
144
  **Honest caveat:** the *intelligence* is remote. There is no local realtime speech model worth putting a call on yet, so the audio goes to OpenAI or xAI. Everything else never leaves the machine. When a local voice model lands, this is the app that is ready for it.
@@ -141,7 +159,7 @@ It runs in the terminal you started it in, like `n8n`. There is no daemon and no
141
159
 
142
160
  | | |
143
161
  |---|---|
144
- | **Stop it** | `Ctrl+C` |
162
+ | **Stop it** | `Ctrl+C` — running jobs are parked and pick up at the next start |
145
163
  | **Start it again** | the same `npx thursday-agent` |
146
164
  | **Close the terminal** | it stops with the terminal — nothing is left running |
147
165
  | **Keep it up while you work** | run it in its own tab, or `npx thursday-agent &` |
@@ -153,7 +171,12 @@ It runs in the terminal you started it in, like `n8n`. There is no daemon and no
153
171
  ```
154
172
  ~/.thursday
155
173
  ├── local.db calls, memory, bots, jobs, keys
156
- └── .ai-workspace what the bots wrote: artifacts, projects, scratch, skills
174
+ └── .ai-workspace
175
+ ├── artifacts/ what the bots made for you
176
+ ├── projects/ code they build
177
+ ├── bots/ each bot's own memory and kept sign-ins
178
+ ├── .agents/ skills you installed
179
+ └── scratch/ one folder per job, cleared three days after it ends
157
180
  ```
158
181
 
159
182
  The first run also fetches the browser bots drive (~280 MB) in the background, once. That one lands in Playwright's own cache — `~/Library/Caches/ms-playwright`, or `~/.cache/ms-playwright` on Linux — so every run after it, and every upgrade, skips the download.
@@ -178,7 +201,7 @@ Node 22.18+ and pnpm 10+. The first run fetches the browser bots drive (~280 MB)
178
201
  | | Providers |
179
202
  |---|---|
180
203
  | **Voice** (the call) | OpenAI Realtime · xAI Grok Voice |
181
- | **Text** (the bots) | OpenAI · Anthropic · Google · xAI · Vercel AI Gateway — every model it carries, live |
204
+ | **Text** (the bots) | OpenAI · Anthropic · Google · xAI · Vercel AI Gateway — every model it carries, live · your ChatGPT plan, by signing in |
182
205
  | **Studio** | OpenAI · Google · xAI · Vercel AI Gateway |
183
206
 
184
207
  Every bot can run on its own model. Give the errand-runner something cheap and the planner something good.
@@ -190,12 +213,12 @@ Every bot can run on its own model. Give the errand-runner something cheap and t
190
213
 
191
214
  - "What did I download this week?" — one command, run while you talk
192
215
  - "Remember my sister's birthday is March 3rd." — saved the moment it lands
193
- - "Anything from my landlord in my email?" — attaches to the Chrome you are signed into
194
- - "Set up a Google account just for my bots." — stops at the password, then carries on
216
+ - "Anything from my landlord in my email?" — read in the Chrome you are signed into
217
+ - "Find the cheapest flight to Osaka on the 14th." — left at the pay button, on your screen
218
+ - "Plan three days in Kyoto, with a map for each day." — Voyage
219
+ - "Make a post about Friday's gig and put it on Instagram." — Insta, once you say so
195
220
  - "Write up what we decided today as a one-pager." — opens as a document, not a chat bubble
196
- - "Draw me a logo for a bakery called Crumb."
197
221
  - "Go through my card statements and list every subscription I am paying for."
198
- - "Book a table for four on Friday, somewhere my sister can actually eat."
199
222
  - "Watch this page and tell me when the price drops."
200
223
  - "Build me a page of thirty wedding pose photos."
201
224
 
@@ -215,9 +238,9 @@ Tell me what you said to her and where it stopped. That is the roadmap.
215
238
 
216
239
  ## The part where I am honest with you
217
240
 
218
- She is a language model with a shell, a browser and your API keys. **That is the product, not an accident.** Keys are stripped from the environment the shell runs in. Writes are fenced to a workspace. The server is localhost-only. Passwords, one-time codes and passkeys stay yours to type.
241
+ She is a language model with a shell, a browser and your API keys. **That is the product, not an accident.** Keys are stripped from the environment the shell runs in. The server is localhost-only. A login you gave a bot is asked about before it is used, and a payment is left for you to press — instructions a skill carries, not a lock the code holds.
219
242
 
220
- Reads are not fenced, and they are not meant to be — a bot that cannot look around cannot do the job. That includes the database your keys sit in.
243
+ The shell is not fenced, and it is not meant to be — a bot that cannot look around cannot do the job, and a command writes wherever you can. That includes the database your keys sit in.
221
244
 
222
245
  It is not a sandbox and it does not pretend to be. → [SECURITY.md](SECURITY.md)
223
246
 
@@ -14,8 +14,6 @@ export type AppEvent =
14
14
  | { type: "mcp" }
15
15
  /** Signal: a sign-in was written away from the settings screen (ai/chatgpt's sign-in answer). */
16
16
  | { type: "config" }
17
- /** Data: show this note on screen, or hide it when null (memory.tool). */
18
- | { type: "memory-view"; path: string | null }
19
17
  /** Data: a finished job produced a document; `path` is workspace-relative. */
20
18
  | { type: "artifact"; taskId: string; label: string; path: string };
21
19
 
package/bin/port.mjs ADDED
@@ -0,0 +1,65 @@
1
+ // Which port the app serves on. Plain JavaScript and no app imports: both
2
+ // starters run it before anything is built — `thursday` (bin/thursday.mjs) and
3
+ // `pnpm dev` (scripts/dev.mts).
4
+
5
+ import { createServer } from "node:net";
6
+
7
+ /** The port when none is asked for. */
8
+ const DEFAULT_PORT = 3000;
9
+ /** How far past it to look before giving up. */
10
+ const SEARCH = 20;
11
+
12
+ /**
13
+ * Every address a holder of the port may have bound. No single probe sees them
14
+ * all: on macOS a socket on 127.0.0.1 does not block `::`, and one on `::` does
15
+ * not block 127.0.0.1 — yet `localhost` reaches whichever answers first, so two
16
+ * servers "on 3000" each serve some of the page. Probed one at a time, since
17
+ * `0.0.0.0` and `::` block each other.
18
+ */
19
+ const ADDRESSES = ["127.0.0.1", "::1", "0.0.0.0", "::"];
20
+
21
+ /** No IPv6 on this machine: nobody can hold that address either. */
22
+ const UNBINDABLE = new Set(["EADDRNOTAVAIL", "EAFNOSUPPORT"]);
23
+
24
+ const heldAt = (port, host) =>
25
+ new Promise((resolve) => {
26
+ const probe = createServer()
27
+ .once("error", (cause) => resolve(!UNBINDABLE.has(cause.code)))
28
+ .once("listening", () => probe.close(() => resolve(false)));
29
+ probe.listen(port, host);
30
+ });
31
+
32
+ /** Whether something already holds the port, on any address. */
33
+ async function taken(port) {
34
+ for (const host of ADDRESSES) {
35
+ if (await heldAt(port, host)) return true;
36
+ }
37
+ return false;
38
+ }
39
+
40
+ /**
41
+ * 3000 is the most occupied port on a developer's machine. A port nobody asked
42
+ * for is ours to move; a port that was asked for (`--port`, `PORT`) is not, and
43
+ * saying so is more use than moving it quietly. Exits with the reason when no
44
+ * port will do.
45
+ */
46
+ export async function freePort(asked) {
47
+ const wanted = asked?.trim() || undefined;
48
+ const from = Number(wanted ?? DEFAULT_PORT);
49
+ if (!Number.isInteger(from) || from < 1 || from > 65535) {
50
+ console.error(`\n Not a port: ${wanted}\n`);
51
+ process.exit(1);
52
+ }
53
+ if (!(await taken(from))) return from;
54
+ if (wanted !== undefined) {
55
+ console.error(
56
+ `\n Port ${from} is already in use.\n Try another: --port ${from + 1}\n`,
57
+ );
58
+ process.exit(1);
59
+ }
60
+ for (let port = from + 1; port < from + SEARCH; port++) {
61
+ if (!(await taken(port))) return port;
62
+ }
63
+ console.error(`\n Nothing free between ${from} and ${from + SEARCH}.\n`);
64
+ process.exit(1);
65
+ }
package/bin/thursday.mjs CHANGED
@@ -6,9 +6,9 @@
6
6
  import { spawn } from "node:child_process";
7
7
  import { existsSync, symlinkSync } from "node:fs";
8
8
  import { readFile } from "node:fs/promises";
9
- import { createServer } from "node:net";
10
9
  import { homedir } from "node:os";
11
10
  import { join, resolve } from "node:path";
11
+ import { freePort } from "./port.mjs";
12
12
  import { ROOT, toolPath } from "./tools.mjs";
13
13
 
14
14
  const { version, name } = JSON.parse(
@@ -34,7 +34,7 @@ if (has("-h", "--help")) {
34
34
  $ thursday [options]
35
35
 
36
36
  Options
37
- --port <n> Port to serve on (default 3000)
37
+ --port <n> Port to serve on (default 3000, or the next free one)
38
38
  --home <dir> Where your data lives (default ~/.thursday)
39
39
  --no-open Do not open a browser
40
40
  -v, --version Print the version
@@ -50,37 +50,6 @@ if (has("-v", "--version")) {
50
50
  process.exit(0);
51
51
  }
52
52
 
53
- /** Whether something already holds the port we are about to bind. */
54
- const taken = (port) =>
55
- new Promise((resolve) => {
56
- const probe = createServer()
57
- .once("error", () => resolve(true))
58
- .once("listening", () => probe.close(() => resolve(false)))
59
- .listen(port, "127.0.0.1");
60
- });
61
-
62
- /**
63
- * 3000 is the most occupied port on a developer's machine, and the first thing
64
- * `npx thursday-agent` does is bind it — so an untouched install used to end in
65
- * an EADDRINUSE stack trace. A port nobody asked for is ours to move; a port
66
- * that was asked for is not, and saying so is more use than moving it quietly.
67
- */
68
- async function freePort(asked) {
69
- const from = Number(asked ?? 3000);
70
- if (!(await taken(from))) return from;
71
- if (asked !== undefined) {
72
- console.error(
73
- `\n Port ${from} is already in use.\n Try another: thursday --port ${from + 1}\n`,
74
- );
75
- process.exit(1);
76
- }
77
- for (let port = from + 1; port < from + 20; port++) {
78
- if (!(await taken(port))) return port;
79
- }
80
- console.error(`\n Nothing free between ${from} and ${from + 20}.\n`);
81
- process.exit(1);
82
- }
83
-
84
53
  const asked = flag("port") ?? process.env.PORT;
85
54
  const port = String(await freePort(asked));
86
55
  const home = resolve(flag("home") || process.env.THURSDAY_HOME || DEFAULT_HOME);
@@ -30,9 +30,11 @@ A bot is a text model — any of OpenAI, Anthropic, Google, xAI, or whatever the
30
30
 
31
31
  A job ends in the thing that was asked for — the account made, the page built, the comparison in a table — and a report, written to be heard, because she reads it out loud. Anything that does not fit in a few lines is a file under `artifacts/`, and the report names it.
32
32
 
33
- What only you can give — a password, a one-time code, a passkey, a decision between two real options — stops the job at that point. The bot sets it up one action away, asks, and continues when the answer comes.
33
+ What only you can give — a sign-in it holds no session for, a decision between two real options — stops the job at that point. The bot sets it up one action away, asks, and continues when the answer comes. Credentials you handed it are used only after it asks. A payment is the one thing it never finishes: it takes the purchase to the last screen, leaves that window open on yours, and reports what it buys and for how much.
34
34
 
35
- Three bots come with the app, split by temperament: **Jarvis** plans a job, hands parts to whoever fits and does the rest; **Navigator** goes and looks; **Scribe** writes. Make more in settings: a name, a sentence about what it is for, optionally a model and a few pinned tools. The sentence is what she reads when deciding who gets the job.
35
+ Three bots come with the app, split by temperament: **Jarvis** plans a job, hands parts to whoever fits and does the rest; **Navigator** goes and looks; **Scribe** writes. More are ready-made in settings — **Insta** draws, captions and posts to Instagram, **Voyage** plans a trip with a map for each day — or make your own: a name, a sentence about what it is for, optionally a model and a few pinned tools. The sentence is what she reads when deciding who gets the job. A bot can be switched off without being deleted.
36
+
37
+ Each bot keeps its own memory as files in its folder (`bots/<name>/memory/`), one topic per file, and reads the list at the start of every job. Its page in settings shows them; open one in place or delete it.
36
38
 
37
39
  ## Jobs outlive the call
38
40
 
@@ -40,15 +42,17 @@ A job runs on the server. It is not in the tab, and it does not stop when you ha
40
42
 
41
43
  A job that stopped to ask, or ran out of its step budget, is resumed from where it stopped: the same thread, with your answer appended. A long thread is compacted — the model summarizes what happened so far and continues from the summary.
42
44
 
43
- ## Memory is a folder
45
+ With no browser on the app for ten seconds, running jobs stop where they stand, so nothing spends your keys while nobody is looking. A job the app stopped — a closed tab, a restart, a model call that failed — picks itself back up when it can, up to three times in a row before it waits for you. A job a bot or a person stopped waits for a person.
46
+
47
+ ## Memory you can read
44
48
 
45
- Memory is plain notes on your disk, in the data folder (`~/.thursday` when installed with `npx`, the checkout otherwise). Each note is a topic — `profile`, `preferences`, `people/…`, and whatever she creates. A few are `alwaysLoad` and travel into every call: your name, your language, how you like to be addressed, the rules you gave her.
49
+ Memory is notes in the database on your disk, in the data folder (`~/.thursday` when installed with `npx`, the checkout otherwise). Each note is a topic — `profile`, `preferences`, `people/…`, and whatever she creates — and holds one fact per line. A few are `alwaysLoad` and travel into every call: your name, your language, how you like to be addressed, the rules you gave her.
46
50
 
47
- You can open any note from settings and read exactly what she knows. When the listing gets long she says so in a lull, puts a note on your screen and forgets only what you name.
51
+ She writes the moment something worth keeping comes up. Each fact remembers the call it was said in, so when a line is not enough she can open that conversation again. Nothing re-reads calls after they end: what is kept is what was written.
48
52
 
49
- Writing mid-conversation catches what she noticed; it misses what only reads back as important afterwards. So when a call ends, a text model re-reads the most recent turns and reconciles the notes with them — correcting what changed, adding what was said in passing. Calls are stamped as they are read, so a backlog of short calls collapses into one pass rather than one per call.
53
+ You can open any note from settings and read exactly what she knows. To change it, type what changed on the Memory screen, pick a model, and watch each edit land. When the listing gets long she says so in a lull, puts a note on your screen and forgets only what you name.
50
54
 
51
- Bots read memory but do not write it. What a bot learns goes into its report; whether it is worth keeping is her call, with you.
55
+ Bots read your memory but do not write it. What a bot learns about its own work goes into its own memory files; what it learns about you goes into its report, and whether that is worth keeping is her call, with you.
52
56
 
53
57
  ## What is not here
54
58
 
Binary file
Binary file
Binary file