dorkos 0.93.0 → 0.95.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 (86) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/cli.js +4450 -2445
  3. package/dist/client/assets/{AboutPage-R35A-Uu-.js → AboutPage-CG2AYFFf.js} +1 -1
  4. package/dist/client/assets/{AdapterIcon-kPDXiFU1.js → AdapterIcon-CBMQLe9z.js} +1 -1
  5. package/dist/client/assets/{AppearancePage-COqDtruX.js → AppearancePage-DspUlsTR.js} +1 -1
  6. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-CIKvkn5X.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-huqqF6pu.js} +1 -1
  7. package/dist/client/assets/{BlintzCanvas-4FX_eaSh.js → BlintzCanvas-C6RZ2Ma8.js} +34 -34
  8. package/dist/client/assets/{CanvasCsvContent-Dq2X1kUl.js → CanvasCsvContent-B_2SiitK.js} +1 -1
  9. package/dist/client/assets/{CanvasFileContent-CZUc62IR.js → CanvasFileContent-CzQ4p-Et.js} +2 -2
  10. package/dist/client/assets/{CanvasModel3dContent-D1IN_nl9.js → CanvasModel3dContent-ClJWuggg.js} +2 -2
  11. package/dist/client/assets/{CodeMirrorDiff-BeEhMSvL.js → CodeMirrorDiff-CCPfe0EW.js} +1 -1
  12. package/dist/client/assets/{CodeMirrorEditor-BlNLMvbo.js → CodeMirrorEditor-DPx3FVLK.js} +1 -1
  13. package/dist/client/assets/{ConnectionAccessLists-s7RnRr1y.js → ConnectionAccessLists-ZIjMb4KK.js} +1 -1
  14. package/dist/client/assets/{ConnectionsPage-BTTdQBdS.js → ConnectionsPage-BjJkzoDN.js} +3 -3
  15. package/dist/client/assets/{ConventionPage-CI3PeUHm.js → ConventionPage-D5vfTKHe.js} +1 -1
  16. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-D6OvDT9K.js → FloatingTanStackRouterDevtools-CqogiFob-DNaod9If.js} +1 -1
  17. package/dist/client/assets/HandlePage-C57WT1ZF.js +1 -0
  18. package/dist/client/assets/{LexicalField-Bqq5KeUW.js → LexicalField-rxowXJdq.js} +1 -1
  19. package/dist/client/assets/{ManagesPage-CWdKDvw1.js → ManagesPage-0BFekgi1.js} +1 -1
  20. package/dist/client/assets/{Model3dViewer-ClJVGLDb.js → Model3dViewer-Czy1kuZW.js} +1 -1
  21. package/dist/client/assets/NamePage-C-fa4chy.js +1 -0
  22. package/dist/client/assets/{NotificationsPage-C6tE8iuE.js → NotificationsPage-zXNdi5ED.js} +1 -1
  23. package/dist/client/assets/{PermissionsPage-BqDl7shN.js → PermissionsPage-BaU8pkuw.js} +1 -1
  24. package/dist/client/assets/{PersonalityPopover-B3q8QYcS.js → PersonalityPopover-8KiTZkS5.js} +1 -1
  25. package/dist/client/assets/PhotoPage-DBNYhKBY.js +1 -0
  26. package/dist/client/assets/{RoomsPage-DwYtOhd7.js → RoomsPage-DAJz2lm6.js} +1 -1
  27. package/dist/client/assets/{RunsOnPopover-BDPs-RYB.js → RunsOnPopover-6Paa4ED-.js} +1 -1
  28. package/dist/client/assets/{SessionsPage-Du24E934.js → SessionsPage-CBPMrutR.js} +2 -2
  29. package/dist/client/assets/{SkillsPage-DjLUEngt.js → SkillsPage-C5EjuSO4.js} +1 -1
  30. package/dist/client/assets/{TasksPage-B6i3r76o.js → TasksPage-B-v9Yfni.js} +1 -1
  31. package/dist/client/assets/{ToolsPage-DNoC2MMz.js → ToolsPage-DW-wnHEF.js} +2 -2
  32. package/dist/client/assets/{TopologyGraph-DtBDaHqX.js → TopologyGraph-BvrMJGBi.js} +17 -17
  33. package/dist/client/assets/{agent-browser-da9rKrej.js → agent-browser-CNWjB1KM.js} +1 -1
  34. package/dist/client/assets/{highlighted-body-KPVGNVTW-DJ5Xz8gv.js → highlighted-body-KPVGNVTW-CUHC5uD6.js} +1 -1
  35. package/dist/client/assets/{index-BzDP7VXZ.js → index-2SYRmZS_.js} +1 -1
  36. package/dist/client/assets/{index-Cvzimc0W.js → index-5pfHZhLE.js} +1 -1
  37. package/dist/client/assets/{index-DwfaFQZo.js → index-BDKfVboN.js} +1 -1
  38. package/dist/client/assets/{index-LcH-4hgH.js → index-BMFF169T.js} +1 -1
  39. package/dist/client/assets/{index-BVpHI-1y.js → index-BNDk_Yg-.js} +1 -1
  40. package/dist/client/assets/{index-DnN4PJaN.js → index-BOdZFetD.js} +1 -1
  41. package/dist/client/assets/{index-DsH33VjO.js → index-BRHzCdcO.js} +5 -5
  42. package/dist/client/assets/{index-CJK5Iw50.js → index-BU22tQ_6.js} +1 -1
  43. package/dist/client/assets/{index-Ca5JlBEc.js → index-Ba27lo1n.js} +1 -1
  44. package/dist/client/assets/{index-DdsOOmtz.js → index-BdIkR2G_.js} +1 -1
  45. package/dist/client/assets/{index-C9wgMNj5.js → index-BeRPIaN9.js} +8 -8
  46. package/dist/client/assets/{index-D1kH8Sr2.js → index-Bf3Hi1vd.js} +2 -2
  47. package/dist/client/assets/{index-Bp2CiCey.js → index-BorGy4Yi.js} +1 -1
  48. package/dist/client/assets/{index-CObinYlG.js → index-C1aaKV3U.js} +1 -1
  49. package/dist/client/assets/{index-DJGEk3-H.js → index-C6TgT2cV.js} +1 -1
  50. package/dist/client/assets/{index-CZ0BaV1t.js → index-CHcxc12T.js} +1 -1
  51. package/dist/client/assets/{index-CfUAagLY.js → index-CJ-SARTZ.js} +1 -1
  52. package/dist/client/assets/{index-CotYqF0w.js → index-CNQ9sgQn.js} +1 -1
  53. package/dist/client/assets/{index-1o6WO7iZ.js → index-CZuM2Qxl.js} +1 -1
  54. package/dist/client/assets/{index-Bl2j_xjE.js → index-CaBuRXmp.js} +1 -1
  55. package/dist/client/assets/{index-BQ-o6bQ0.js → index-CbrQOJ-r.js} +1 -1
  56. package/dist/client/assets/{index-Bu16-jWo.js → index-ChgU0Tq5.js} +1 -1
  57. package/dist/client/assets/{index-BnORUrPC.js → index-Ciylp2I7.js} +1 -1
  58. package/dist/client/assets/{index-B5yJddXH.js → index-DH0nOUQX.js} +1 -1
  59. package/dist/client/assets/{index-D0sn-ct6.js → index-DNl876ao.js} +1 -1
  60. package/dist/client/assets/{index-Dyeo69l2.js → index-DaIYCr-9.js} +1 -1
  61. package/dist/client/assets/{index-gIAwAMkn.js → index-DcdVwTgX.js} +1 -1
  62. package/dist/client/assets/{index-gHd4-GL-.js → index-DgrlhG9H.js} +1 -1
  63. package/dist/client/assets/index-DleaJjK-.js +1668 -0
  64. package/dist/client/assets/{index-3DE2Q3OD.js → index-DpnE5nll.js} +1 -1
  65. package/dist/client/assets/{index-CQXxVt4A.js → index-DyDsd7_9.js} +1 -1
  66. package/dist/client/assets/{index-CtJTMcuR.js → index-DzZSPXzN.js} +1 -1
  67. package/dist/client/assets/{index-DQWAoAN-.js → index-J5dXaon7.js} +1 -1
  68. package/dist/client/assets/index-XdysNkCU.css +1 -0
  69. package/dist/client/assets/{index-FsBhOkNr.js → index-iw7zEfsj.js} +1 -1
  70. package/dist/client/assets/{index-BC9LsNlJ.js → index-lnHJkPRg.js} +1 -1
  71. package/dist/client/assets/{index-CtlzkOJ3.js → index-m4dRQao_.js} +8 -8
  72. package/dist/client/assets/{room-files-source-DRQNpCWs.js → room-files-source-JVU1fIeW.js} +3 -3
  73. package/dist/client/assets/{soul-file-DcQD5pcS.js → soul-file-BQhkHCzH.js} +1 -1
  74. package/dist/client/assets/{use-personality-commit-Dsy9tqWY.js → use-personality-commit-CC3Q_bi4.js} +1 -1
  75. package/dist/client/index.html +2 -2
  76. package/dist/drizzle/0136_mirror_timeline_order.sql +23 -0
  77. package/dist/drizzle/meta/0136_snapshot.json +10232 -0
  78. package/dist/drizzle/meta/_journal.json +8 -1
  79. package/dist/server/index.js +8416 -5337
  80. package/dist/server/index.js.map +2 -2
  81. package/package.json +11 -11
  82. package/dist/client/assets/HandlePage-Dvqztr0N.js +0 -1
  83. package/dist/client/assets/NamePage-BgVZ-KD1.js +0 -1
  84. package/dist/client/assets/PhotoPage-lt6ZevHW.js +0 -1
  85. package/dist/client/assets/index-BCGiD7pg.js +0 -1674
  86. package/dist/client/assets/index-BG-HtbEP.css +0 -1
@@ -1,6 +1,6 @@
1
- import{dT as de,dU as x,cS as ue,dV as V,aG as Q,aj as me,ai as he,r as d,dh as fe,j as s,dW as ge,dX as ye,dY as Oe,dZ as xe,d_ as q,d$ as ve,B as O,ao as _e,e0 as Ee,aF as be,al as Re,e1 as Te,e2 as pe,e3 as we,e4 as Ne,e5 as L,e6 as X,e7 as Ce}from"./index-BCGiD7pg.js";/**
2
- * @license lucide-react v1.47.0 - ISC
1
+ import{dT as de,dU as x,cS as ue,dV as V,aG as Q,aj as me,ai as he,r as d,dh as fe,j as s,dW as ge,dX as ye,dY as Oe,dZ as xe,d_ as q,d$ as ve,B as O,ao as _e,e0 as Ee,aF as be,al as Re,e1 as Te,e2 as pe,e3 as we,e4 as Ne,e5 as L,e6 as X,e7 as Ce}from"./index-DleaJjK-.js";/**
2
+ * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const W={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};W.node;const Se=de(W),Fe=["CONFLICT","COPY_INTO_SELF","DIR_NOT_EMPTY","NOT_FOUND","REFUSE_ROOT","OUTSIDE_BOUNDARY"];function De(e){const t=x(e);return t!==void 0&&Fe.includes(t)?t:void 0}const Ae="Can’t copy a folder into itself",D="ROOM_REPO_CONFIG_UNSAFE",M="This room’s git settings could make git run a program, so DorkOS has stopped working on its files until they are removed. DorkOS’s log names each setting and how to remove it.",Ie={CONFLICT:"That name already exists",COPY_INTO_SELF:Ae,DIR_NOT_EMPTY:"This folder isn’t empty",NOT_FOUND:"That item no longer exists",REFUSE_ROOT:"Can’t modify the working directory root",OUTSIDE_BOUNDARY:"That path is outside the working directory"};function et(e,t){const o=De(e);ue.error(o?Ie[o]:t)}const Le=new Map([["ROOM_UPLOAD_TOO_MANY_FILES",`One upload can carry up to ${V} files, so nothing was uploaded. Try again with fewer.`],["FILE_TOO_LARGE","A file is bigger than this room allows, so nothing was changed."],["REPO_CAP_EXCEEDED","This room’s files are already as large as they are allowed to get, so nothing was changed. Delete something first."],["MAIN_CHECKOUT_DIRTY","Somebody changed this room’s files outside DorkOS, so changes are paused until that is sorted out. The warning above the files says how."],["MERGE_IN_FLIGHT","Somebody else is changing this room’s files right now, so nothing was changed. Try again in a moment."],["PEOPLE_ONLY","Only a person can change a room’s files this way. An agent brings its work in by merging."],["ROOM_FILE_PATH_INVALID","That name can’t be used in a room’s files, so nothing was changed."],["ROOM_FILE_NOT_READABLE","That isn’t something that can be changed here."],["ROOM_FILE_NOT_FOUND","That isn’t in the room’s files any more, so nothing was changed. The list has been refreshed."],["ATTACHMENT_NOT_FOUND","That file isn’t in this room’s chat any more."],["ROOM_HAS_NO_REPO","This room doesn’t have files of its own any more."],["ROOM_REPOS_DISABLED","Rooms can’t have files of their own on this install right now, so nothing was changed."],["ROOM_REPO_GIT_UNAVAILABLE","This computer doesn’t have git installed, and a room’s files are a git repository."],["ROOM_NOT_FOUND","This room isn’t there any more."],["ROOM_ARCHIVED","This room is archived, so its files can’t be changed."],[D,M]]),Me=new Set(["FILE_TOO_LARGE","ROOM_FILE_PATH_INVALID","ROOM_FILE_NOT_READABLE",D]);function ke(e){return e.replace(/`([^`]*)`/g,"“$1”").trim()}function je(e){const t=x(e);if(t===void 0)return;const o=Le.get(t);if(o!==void 0)return k(e)??o}function k(e){const t=x(e);if(!(t===void 0||!Me.has(t))&&!(!(e instanceof Error)||e.message.trim()===""))return ke(e.message)}function tt(e){return`There’s already something called “${e}” there, so nothing was changed. Pick another name.`}function st(e){if(x(e)!==D)return;const t=e.body,o=typeof(t==null?void 0:t.command)=="string"&&t.command!==""?t.command:null;return{message:k(e)??M,command:o}}const Pe="—";function Ue(e){if(e==null)return{label:Pe,title:null};const t=Q(e.at);return{label:`${e.author} · ${t}`,title:`${e.subject} · ${e.author}, ${t}`}}function ze(e){return/\.(md|markdown|mdx)$/i.test(e)}function Be(e){return e<1024?`${e} bytes`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function $e(e,t){return e.editable&&e.save!==void 0&&t!==void 0&&t.body.kind==="text"}function nt({source:e,path:t,isNew:o=!1,onCreated:a,onClose:c}){const r=e.read,i=me(),n=["file-explorer","preview",e.scopeKey,t],m=he({queryKey:n,queryFn:()=>r(t),enabled:t!==null&&r!==void 0&&!o}),h=o&&t!==null?{path:t,size:0,commit:null,lastCommit:null,body:{kind:"text",text:""}}:m.data,[v,j]=d.useState(!1),[P,U]=d.useState(null),A=e.showToEveryone,Z=d.useCallback(async l=>{if(A!==void 0){j(!0),U(null);try{await A(l),c()}catch(u){U(u instanceof Error&&u.message.trim().length>0?u.message:"DorkOS couldn’t reach the server. Check your connection and try again.")}finally{j(!1)}}},[A,c]),[g,w]=d.useState(o),[b,R]=d.useState(""),[z,N]=d.useState({text:"",commit:null}),[_,y]=d.useState(null),[I,f]=d.useState(null),[B,T]=d.useState(!1),[ee,C]=d.useState(!1),$=d.useRef(null),K=d.useRef(null),H=d.useRef(!1),E=g&&b!==z.text,te=E||g&&o,Y=ee&&E,S=d.useCallback(()=>{w(!1),R(""),N({text:"",commit:null}),y(null),f(null),T(!1),C(!1)},[]),[se,ne]=d.useState(t);se!==t&&(ne(t),(g||b!==""||_!==null||I!==null||B)&&S(),o&&w(!0));const p=fe({mutationFn:l=>e.save({path:t,baseCommit:l.baseCommit,text:l.text}),onSuccess:(l,u)=>{if(l.status==="saved"){N({text:u.text,commit:l.commit}),y(null),f(null),T(!0),o&&(a==null||a()),i.invalidateQueries({queryKey:n}),i.invalidateQueries({queryKey:["file-explorer","tree",e.scopeKey]});return}if(T(!1),l.status==="conflict"){y(ce=>({commit:l.commit,lastCommit:l.lastCommit,again:ce!==null})),f(null);return}y(null),f(l.reason)},onError:()=>{T(!1),y(null),f("That didn’t save. Try again in a moment.")}}),G=$e(e,h),oe=()=>{h===void 0||h.body.kind!=="text"||(R(h.body.text),N({text:h.body.text,commit:h.commit??null}),y(null),f(null),T(!1),w(!0))},ie=()=>{if(o){S(),c();return}w(!1),R(""),y(null),f(null),C(!1)},ae=async()=>{const l=await m.refetch();if(l.isError||l.data===void 0){f("Their version couldn’t be fetched just now, so nothing here changed.");return}const u=l.data;if(u.body.kind!=="text"){f(u.body.kind==="not-readable"?`${u.body.reason} What you typed is still here. Save it over their change, or close this and copy it out first.`:"Their version isn’t something that can be shown here, so nothing here changed.");return}R(u.body.text),N({text:u.body.text,commit:u.commit??null}),y(null),f(null)},re=()=>{_!==null&&p.mutate({text:b,baseCommit:_.commit})},le=()=>{if(E){C(!0);return}S(),c()};return d.useEffect(()=>{var l,u;g?(l=$.current)==null||l.focus():H.current&&((u=K.current)==null||u.focus()),H.current=g},[g]),s.jsx(ge,{open:t!==null,onOpenChange:l=>!l&&le(),children:s.jsxs(ye,{className:"max-h-[80vh] sm:max-w-2xl",children:[s.jsxs(Oe,{children:[s.jsx(xe,{className:"truncate font-mono text-sm",children:t===null?"":q(t)}),s.jsx(ve,{className:"truncate text-xs",children:o&&t!==null?`${t} · New file`:He(h,t)})]}),!g&&(e.showToEveryone!==void 0||G)&&s.jsxs("div",{className:"flex justify-end gap-1 px-4",children:[e.showToEveryone!==void 0&&t!==null&&s.jsxs(O,{type:"button",variant:"ghost",size:"sm",disabled:v,className:"text-muted-foreground hover:text-foreground gap-1.5",onClick:()=>void Z(t),children:[s.jsx(Se,{className:"size-(--size-icon-xs)"}),v?"Putting it there…":"Put on the canvas"]}),G&&s.jsxs(O,{ref:K,type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground gap-1.5",onClick:oe,children:[s.jsx(_e,{className:"size-(--size-icon-xs)"}),"Edit"]})]}),P!==null&&s.jsx("p",{role:"status",className:"text-destructive px-4 pb-1 text-xs",children:P}),_!==null&&s.jsx(Ke,{conflict:_,onTakeTheirs:()=>void ae(),onKeepMine:re,busy:p.isPending||m.isFetching}),I!==null&&s.jsx("p",{role:"alert",className:"bg-destructive/10 text-destructive mx-4 rounded-md px-3 py-2 text-sm",children:I}),s.jsx(Ee,{className:"min-h-0 flex-1 overflow-auto",children:m.isPending&&!o?s.jsx("div",{className:"flex h-32 items-center justify-center",children:s.jsx(be,{size:"md",className:"text-muted-foreground",label:"Loading the file"})}):m.isError&&!o||h===void 0?s.jsx(F,{children:"This file couldn’t be read."}):g?s.jsx("textarea",{ref:$,"aria-label":`${t===null?"File":q(t)} contents`,value:b,onChange:l=>R(l.target.value),spellCheck:!1,autoComplete:"off",className:Re("text-foreground/90 border-border/60 bg-background field-sizing-content","focus-visible:border-ring focus-visible:ring-ring/50 min-h-64 w-full","resize-none rounded-md border px-3 py-2 font-mono text-xs","whitespace-pre-wrap focus-visible:ring-[3px] focus-visible:outline-none")}):s.jsx(Ye,{file:h})}),g&&s.jsxs(Te,{className:"items-center gap-2 sm:justify-between",children:[s.jsx("span",{className:"text-muted-foreground text-xs","aria-live":"polite",children:p.isPending?"Saving…":Y?"You haven’t saved your changes.":B&&!E?"Saved":E?"Not saved yet":""}),s.jsx("span",{className:"flex gap-2",children:Y?s.jsxs(s.Fragment,{children:[s.jsx(O,{type:"button",variant:"ghost",size:"sm",onClick:()=>C(!1),children:"Keep editing"}),s.jsx(O,{type:"button",variant:"destructive",size:"sm",onClick:()=>{S(),c()},children:"Discard changes"})]}):s.jsxs(s.Fragment,{children:[s.jsx(O,{type:"button",variant:"ghost",size:"sm",onClick:ie,children:E?"Discard":o?"Cancel":"Done"}),s.jsx(O,{type:"button",size:"sm",disabled:!te||p.isPending||_!==null,onClick:()=>p.mutate({text:b,baseCommit:z.commit}),children:"Save"})]})})]})]})})}function Ke({conflict:e,onTakeTheirs:t,onKeepMine:o,busy:a}){const c=e.lastCommit,r=c===null?"Somebody":c.author;return s.jsxs("div",{role:"alert",className:"border-border/60 bg-muted/40 mx-4 space-y-2 rounded-md border px-3 py-2 text-sm",children:[s.jsx("p",{children:e.again?`${r} changed this file again while you were deciding, so it still isn’t saved.`:`${r} changed this file while you were editing it, so nothing was saved.`}),c!==null&&s.jsxs("p",{className:"text-muted-foreground text-xs",children:[c.subject," · ",Q(c.at)]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(O,{type:"button",variant:"outline",size:"sm",disabled:a,onClick:t,children:"Open their version"}),s.jsx(O,{type:"button",variant:"destructive",size:"sm",disabled:a,onClick:o,children:"Save mine over it"})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Opening theirs replaces what you typed here."})]})}function He(e,t){if(t===null)return"";const o=e===void 0?null:Ue(e.lastCommit);return o===null?t:`${t} · ${o.label}`}function Ye({file:e}){switch(e.body.kind){case"text":return ze(e.path)?s.jsx(we,{content:e.body.text,className:"text-sm",errorFallback:"This file couldn’t be displayed."}):s.jsx("pre",{className:"text-foreground/90 overflow-x-auto font-mono text-xs whitespace-pre",children:e.body.text});case"binary":return s.jsx(F,{children:"This isn’t a text file, so it can’t be shown or edited here."});case"too-large":return s.jsxs(F,{children:["This file is larger than ",Be(e.body.maxBytes),", so it isn’t shown here."]});case"not-readable":return s.jsx(F,{children:e.body.reason})}}function F({children:e}){return s.jsxs("div",{className:"text-muted-foreground flex h-32 flex-col items-center justify-center gap-2 px-6 text-center text-sm",children:[s.jsx(pe,{className:"size-(--size-icon-md) opacity-60"}),s.jsx("span",{children:e})]})}const Ge=new Map([["REQUEST_TOO_LARGE","That is too much text to send in one go, so nothing was saved. A room’s files are for documents people read. Anything this big belongs in the room’s attachments."],["FILE_TOO_LARGE","This file would be bigger than this room allows, so nothing was saved."],["REPO_CAP_EXCEEDED","This room’s files are already as large as they are allowed to get, so nothing was saved."],["MAIN_CHECKOUT_DIRTY","Somebody changed this room’s files outside DorkOS, so saving is paused until that is sorted out. The warning above the files says how."],["MERGE_IN_FLIGHT","Somebody else is writing to this room’s files right now. Nothing was saved. Try again in a moment."],["PEOPLE_ONLY","Only a person can save a room’s files this way. An agent brings its work in by merging."],["ROOM_FILE_NOT_TEXT","This file has something in it that is not text, so it cannot be saved from here."],["ROOM_FILE_PATH_INVALID","That file name could mean somewhere else, so nothing was saved."],["ROOM_FILE_NOT_FOUND","This file is not in the room’s files any more, so there was nothing to save over."],["ROOM_FILE_NOT_READABLE","This is not a file that can be edited here."],["ROOM_HAS_NO_REPO","This room does not have files of its own any more."],["ROOM_REPOS_DISABLED","Rooms cannot have files of their own on this install right now, so nothing was saved."],["ROOM_REPO_GIT_UNAVAILABLE","This computer doesn’t have git installed, and a room’s files are a git repository."],["ROOM_NOT_FOUND","This room is not there any more."],["ROOM_ARCHIVED","This room is archived, so its files cannot be changed."],[D,M]]);function qe(e){return e===void 0?void 0:Ge.get(e)}function J(e){if(typeof e!="object"||e===null)return null;const t=Ne.safeParse(e.body);return t.success?t.data.conflict:null}const Ve=15e3;function Qe(e,t,o){const a=JSON.stringify(L.entries(t));let c=0,r=null;const i=e.getQueryCache().subscribe(n=>{if(n.type!=="updated"||JSON.stringify(n.query.queryKey)!==a||r!==null)return;const m=Math.max(0,Ve-(Date.now()-c));r=setTimeout(()=>{r=null,c=Date.now(),o()},m)});return()=>{r!==null&&clearTimeout(r),i()}}function Xe(e){return{name:e.name,path:e.path,type:e.kind==="dir"?"dir":"file",size:e.size,isSymlink:e.kind==="symlink",lastCommit:e.lastCommit}}const We=new Map([["ROOM_FILE_NOT_READABLE","This isn’t a file that can be shown here."],["ROOM_FILE_NOT_FOUND","This file isn’t in the room’s files any more."]]);function ot(e){const{transport:t,queryClient:o,roomId:a,canChange:c=!0}=e,r=async i=>{try{return{status:"changed",commit:(await i()).commit}}catch(n){return Je(n,o,a)}};return{scopeKey:`room:${a}`,cwd:null,writable:c,provenance:!0,filtersHidden:!1,preview:"inline",async showToEveryone(i){await t.openRoomCanvasDocument(a,{type:"file",sourcePath:i})},editable:c,changes:c?{maxUploadFiles:V,upload:i=>r(()=>t.uploadRoomFiles(a,{dir:i.dir,baseCommit:i.baseCommit,replace:i.replace,files:i.files})),move:i=>r(()=>t.moveRoomFile(a,i)),remove:i=>r(()=>t.deleteRoomFile(a,i))}:void 0,async list(i){try{const n=await t.readRoomFiles(a,i===""?void 0:i);return{entries:n.entries.map(Xe),commit:n.commit}}catch(n){if(x(n)!==Ce)throw n;return{entries:[],absent:!0}}},async read(i){try{const n=await t.readRoomFileContent(a,i);return{path:n.path,size:n.size,lastCommit:n.lastCommit,commit:n.commit,body:n.body.kind==="text"?{kind:"text",text:n.body.text}:n.body.kind==="binary"?{kind:"binary"}:{kind:"too-large",maxBytes:n.body.maxBytes}}}catch(n){const m=We.get(x(n)??"");if(m===void 0)throw n;return{path:i,size:0,lastCommit:null,commit:null,body:{kind:"not-readable",reason:m}}}},async save(i){try{const n=await t.saveRoomFile(a,{path:i.path,baseCommit:i.baseCommit,text:i.text});return{status:"saved",commit:n.commit,lastCommit:n.lastCommit,committed:n.committed}}catch(n){const m=x(n);if(m===X){const v=J(n);return v!==null?{status:"conflict",commit:v.commit,lastCommit:v.lastCommit}:{status:"refused",reason:"Somebody changed this file while you were editing it, so nothing was saved. Close this and open it again to see their version."}}m==="MAIN_CHECKOUT_DIRTY"&&o.invalidateQueries({queryKey:L.repoStatus(a)});const h=k(n)??qe(m);if(h===void 0)throw n;return{status:"refused",reason:h}}},events(i){return Qe(o,a,i)}}}function Je(e,t,o){const a=x(e);if(a===X){const r=J(e);return r!==null?{status:"conflict",path:r.path,commit:r.commit,lastCommit:r.lastCommit}:{status:"refused",reason:"Somebody changed these files after you opened them, so nothing was changed. Look at the new version, then try again."}}if(a==="ROOM_FILE_EXISTS"){const r=e instanceof Error?e.message.replace(/`([^`]*)`/g,"“$1”"):"";return{status:"exists",reason:r.trim()!==""?r:"Something with that name is already there."}}a==="MAIN_CHECKOUT_DIRTY"&&t.invalidateQueries({queryKey:L.repoStatus(o)});const c=je(e);if(c===void 0)throw e;return{status:"refused",reason:c}}export{Ae as C,nt as F,Pe as N,Ve as R,st as a,Je as b,ot as c,De as g,tt as n,Ue as p,je as r,et as t,Qe as w};
6
+ */const W={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};W.node;const Se=de(W),Fe=["CONFLICT","COPY_INTO_SELF","DIR_NOT_EMPTY","NOT_FOUND","REFUSE_ROOT","OUTSIDE_BOUNDARY"];function De(e){const t=x(e);return t!==void 0&&Fe.includes(t)?t:void 0}const Ae="Can’t copy a folder into itself",D="ROOM_REPO_CONFIG_UNSAFE",M="This room’s git settings could make git run a program, so DorkOS has stopped working on its files until they are removed. DorkOS’s log names each setting and how to remove it.",Ie={CONFLICT:"That name already exists",COPY_INTO_SELF:Ae,DIR_NOT_EMPTY:"This folder isn’t empty",NOT_FOUND:"That item no longer exists",REFUSE_ROOT:"Can’t modify the working directory root",OUTSIDE_BOUNDARY:"That path is outside the working directory"};function et(e,t){const o=De(e);ue.error(o?Ie[o]:t)}const Le=new Map([["ROOM_UPLOAD_TOO_MANY_FILES",`One upload can carry up to ${V} files, so nothing was uploaded. Try again with fewer.`],["FILE_TOO_LARGE","A file is bigger than this room allows, so nothing was changed."],["REPO_CAP_EXCEEDED","This room’s files are already as large as they are allowed to get, so nothing was changed. Delete something first."],["MAIN_CHECKOUT_DIRTY","Somebody changed this room’s files outside DorkOS, so changes are paused until that is sorted out. The warning above the files says how."],["MERGE_IN_FLIGHT","Somebody else is changing this room’s files right now, so nothing was changed. Try again in a moment."],["PEOPLE_ONLY","Only a person can change a room’s files this way. An agent brings its work in by merging."],["ROOM_FILE_PATH_INVALID","That name can’t be used in a room’s files, so nothing was changed."],["ROOM_FILE_NOT_READABLE","That isn’t something that can be changed here."],["ROOM_FILE_NOT_FOUND","That isn’t in the room’s files any more, so nothing was changed. The list has been refreshed."],["ATTACHMENT_NOT_FOUND","That file isn’t in this room’s chat any more."],["ROOM_HAS_NO_REPO","This room doesn’t have files of its own any more."],["ROOM_REPOS_DISABLED","Rooms can’t have files of their own on this install right now, so nothing was changed."],["ROOM_REPO_GIT_UNAVAILABLE","This computer doesn’t have git installed, and a room’s files are a git repository."],["ROOM_NOT_FOUND","This room isn’t there any more."],["ROOM_ARCHIVED","This room is archived, so its files can’t be changed."],[D,M]]),Me=new Set(["FILE_TOO_LARGE","ROOM_FILE_PATH_INVALID","ROOM_FILE_NOT_READABLE",D]);function ke(e){return e.replace(/`([^`]*)`/g,"“$1”").trim()}function je(e){const t=x(e);if(t===void 0)return;const o=Le.get(t);if(o!==void 0)return k(e)??o}function k(e){const t=x(e);if(!(t===void 0||!Me.has(t))&&!(!(e instanceof Error)||e.message.trim()===""))return ke(e.message)}function tt(e){return`There’s already something called “${e}” there, so nothing was changed. Pick another name.`}function st(e){if(x(e)!==D)return;const t=e.body,o=typeof(t==null?void 0:t.command)=="string"&&t.command!==""?t.command:null;return{message:k(e)??M,command:o}}const Pe="—";function Ue(e){if(e==null)return{label:Pe,title:null};const t=Q(e.at);return{label:`${e.author} · ${t}`,title:`${e.subject} · ${e.author}, ${t}`}}function ze(e){return/\.(md|markdown|mdx)$/i.test(e)}function Be(e){return e<1024?`${e} bytes`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function $e(e,t){return e.editable&&e.save!==void 0&&t!==void 0&&t.body.kind==="text"}function nt({source:e,path:t,isNew:o=!1,onCreated:a,onClose:c}){const r=e.read,i=me(),n=["file-explorer","preview",e.scopeKey,t],m=he({queryKey:n,queryFn:()=>r(t),enabled:t!==null&&r!==void 0&&!o}),h=o&&t!==null?{path:t,size:0,commit:null,lastCommit:null,body:{kind:"text",text:""}}:m.data,[v,j]=d.useState(!1),[P,U]=d.useState(null),A=e.showToEveryone,Z=d.useCallback(async l=>{if(A!==void 0){j(!0),U(null);try{await A(l),c()}catch(u){U(u instanceof Error&&u.message.trim().length>0?u.message:"DorkOS couldn’t reach the server. Check your connection and try again.")}finally{j(!1)}}},[A,c]),[g,w]=d.useState(o),[b,R]=d.useState(""),[z,N]=d.useState({text:"",commit:null}),[_,y]=d.useState(null),[I,f]=d.useState(null),[B,T]=d.useState(!1),[ee,C]=d.useState(!1),$=d.useRef(null),K=d.useRef(null),H=d.useRef(!1),E=g&&b!==z.text,te=E||g&&o,Y=ee&&E,S=d.useCallback(()=>{w(!1),R(""),N({text:"",commit:null}),y(null),f(null),T(!1),C(!1)},[]),[se,ne]=d.useState(t);se!==t&&(ne(t),(g||b!==""||_!==null||I!==null||B)&&S(),o&&w(!0));const p=fe({mutationFn:l=>e.save({path:t,baseCommit:l.baseCommit,text:l.text}),onSuccess:(l,u)=>{if(l.status==="saved"){N({text:u.text,commit:l.commit}),y(null),f(null),T(!0),o&&(a==null||a()),i.invalidateQueries({queryKey:n}),i.invalidateQueries({queryKey:["file-explorer","tree",e.scopeKey]});return}if(T(!1),l.status==="conflict"){y(ce=>({commit:l.commit,lastCommit:l.lastCommit,again:ce!==null})),f(null);return}y(null),f(l.reason)},onError:()=>{T(!1),y(null),f("That didn’t save. Try again in a moment.")}}),G=$e(e,h),oe=()=>{h===void 0||h.body.kind!=="text"||(R(h.body.text),N({text:h.body.text,commit:h.commit??null}),y(null),f(null),T(!1),w(!0))},ie=()=>{if(o){S(),c();return}w(!1),R(""),y(null),f(null),C(!1)},ae=async()=>{const l=await m.refetch();if(l.isError||l.data===void 0){f("Their version couldn’t be fetched just now, so nothing here changed.");return}const u=l.data;if(u.body.kind!=="text"){f(u.body.kind==="not-readable"?`${u.body.reason} What you typed is still here. Save it over their change, or close this and copy it out first.`:"Their version isn’t something that can be shown here, so nothing here changed.");return}R(u.body.text),N({text:u.body.text,commit:u.commit??null}),y(null),f(null)},re=()=>{_!==null&&p.mutate({text:b,baseCommit:_.commit})},le=()=>{if(E){C(!0);return}S(),c()};return d.useEffect(()=>{var l,u;g?(l=$.current)==null||l.focus():H.current&&((u=K.current)==null||u.focus()),H.current=g},[g]),s.jsx(ge,{open:t!==null,onOpenChange:l=>!l&&le(),children:s.jsxs(ye,{className:"max-h-[80vh] sm:max-w-2xl",children:[s.jsxs(Oe,{children:[s.jsx(xe,{className:"truncate font-mono text-sm",children:t===null?"":q(t)}),s.jsx(ve,{className:"truncate text-xs",children:o&&t!==null?`${t} · New file`:He(h,t)})]}),!g&&(e.showToEveryone!==void 0||G)&&s.jsxs("div",{className:"flex justify-end gap-1 px-4",children:[e.showToEveryone!==void 0&&t!==null&&s.jsxs(O,{type:"button",variant:"ghost",size:"sm",disabled:v,className:"text-muted-foreground hover:text-foreground gap-1.5",onClick:()=>void Z(t),children:[s.jsx(Se,{className:"size-(--size-icon-xs)"}),v?"Putting it there…":"Put on the canvas"]}),G&&s.jsxs(O,{ref:K,type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground gap-1.5",onClick:oe,children:[s.jsx(_e,{className:"size-(--size-icon-xs)"}),"Edit"]})]}),P!==null&&s.jsx("p",{role:"status",className:"text-destructive px-4 pb-1 text-xs",children:P}),_!==null&&s.jsx(Ke,{conflict:_,onTakeTheirs:()=>void ae(),onKeepMine:re,busy:p.isPending||m.isFetching}),I!==null&&s.jsx("p",{role:"alert",className:"bg-destructive/10 text-destructive mx-4 rounded-md px-3 py-2 text-sm",children:I}),s.jsx(Ee,{className:"min-h-0 flex-1 overflow-auto",children:m.isPending&&!o?s.jsx("div",{className:"flex h-32 items-center justify-center",children:s.jsx(be,{size:"md",className:"text-muted-foreground",label:"Loading the file"})}):m.isError&&!o||h===void 0?s.jsx(F,{children:"This file couldn’t be read."}):g?s.jsx("textarea",{ref:$,"aria-label":`${t===null?"File":q(t)} contents`,value:b,onChange:l=>R(l.target.value),spellCheck:!1,autoComplete:"off",className:Re("text-foreground/90 border-border/60 bg-background field-sizing-content","focus-visible:border-ring focus-visible:ring-ring min-h-64 w-full","resize-none rounded-md border px-3 py-2 font-mono text-xs","whitespace-pre-wrap focus-visible:ring-[3px] focus-visible:outline-none")}):s.jsx(Ye,{file:h})}),g&&s.jsxs(Te,{className:"items-center gap-2 sm:justify-between",children:[s.jsx("span",{className:"text-muted-foreground text-xs","aria-live":"polite",children:p.isPending?"Saving…":Y?"You haven’t saved your changes.":B&&!E?"Saved":E?"Not saved yet":""}),s.jsx("span",{className:"flex gap-2",children:Y?s.jsxs(s.Fragment,{children:[s.jsx(O,{type:"button",variant:"ghost",size:"sm",onClick:()=>C(!1),children:"Keep editing"}),s.jsx(O,{type:"button",variant:"destructive",size:"sm",onClick:()=>{S(),c()},children:"Discard changes"})]}):s.jsxs(s.Fragment,{children:[s.jsx(O,{type:"button",variant:"ghost",size:"sm",onClick:ie,children:E?"Discard":o?"Cancel":"Done"}),s.jsx(O,{type:"button",size:"sm",disabled:!te||p.isPending||_!==null,onClick:()=>p.mutate({text:b,baseCommit:z.commit}),children:"Save"})]})})]})]})})}function Ke({conflict:e,onTakeTheirs:t,onKeepMine:o,busy:a}){const c=e.lastCommit,r=c===null?"Somebody":c.author;return s.jsxs("div",{role:"alert",className:"border-border/60 bg-muted/40 mx-4 space-y-2 rounded-md border px-3 py-2 text-sm",children:[s.jsx("p",{children:e.again?`${r} changed this file again while you were deciding, so it still isn’t saved.`:`${r} changed this file while you were editing it, so nothing was saved.`}),c!==null&&s.jsxs("p",{className:"text-muted-foreground text-xs",children:[c.subject," · ",Q(c.at)]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(O,{type:"button",variant:"outline",size:"sm",disabled:a,onClick:t,children:"Open their version"}),s.jsx(O,{type:"button",variant:"destructive",size:"sm",disabled:a,onClick:o,children:"Save mine over it"})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Opening theirs replaces what you typed here."})]})}function He(e,t){if(t===null)return"";const o=e===void 0?null:Ue(e.lastCommit);return o===null?t:`${t} · ${o.label}`}function Ye({file:e}){switch(e.body.kind){case"text":return ze(e.path)?s.jsx(we,{content:e.body.text,className:"text-sm",errorFallback:"This file couldn’t be displayed."}):s.jsx("pre",{className:"text-foreground/90 overflow-x-auto font-mono text-xs whitespace-pre",children:e.body.text});case"binary":return s.jsx(F,{children:"This isn’t a text file, so it can’t be shown or edited here."});case"too-large":return s.jsxs(F,{children:["This file is larger than ",Be(e.body.maxBytes),", so it isn’t shown here."]});case"not-readable":return s.jsx(F,{children:e.body.reason})}}function F({children:e}){return s.jsxs("div",{className:"text-muted-foreground flex h-32 flex-col items-center justify-center gap-2 px-6 text-center text-sm",children:[s.jsx(pe,{className:"size-(--size-icon-md) opacity-60"}),s.jsx("span",{children:e})]})}const Ge=new Map([["REQUEST_TOO_LARGE","That is too much text to send in one go, so nothing was saved. A room’s files are for documents people read. Anything this big belongs in the room’s attachments."],["FILE_TOO_LARGE","This file would be bigger than this room allows, so nothing was saved."],["REPO_CAP_EXCEEDED","This room’s files are already as large as they are allowed to get, so nothing was saved."],["MAIN_CHECKOUT_DIRTY","Somebody changed this room’s files outside DorkOS, so saving is paused until that is sorted out. The warning above the files says how."],["MERGE_IN_FLIGHT","Somebody else is writing to this room’s files right now. Nothing was saved. Try again in a moment."],["PEOPLE_ONLY","Only a person can save a room’s files this way. An agent brings its work in by merging."],["ROOM_FILE_NOT_TEXT","This file has something in it that is not text, so it cannot be saved from here."],["ROOM_FILE_PATH_INVALID","That file name could mean somewhere else, so nothing was saved."],["ROOM_FILE_NOT_FOUND","This file is not in the room’s files any more, so there was nothing to save over."],["ROOM_FILE_NOT_READABLE","This is not a file that can be edited here."],["ROOM_HAS_NO_REPO","This room does not have files of its own any more."],["ROOM_REPOS_DISABLED","Rooms cannot have files of their own on this install right now, so nothing was saved."],["ROOM_REPO_GIT_UNAVAILABLE","This computer doesn’t have git installed, and a room’s files are a git repository."],["ROOM_NOT_FOUND","This room is not there any more."],["ROOM_ARCHIVED","This room is archived, so its files cannot be changed."],[D,M]]);function qe(e){return e===void 0?void 0:Ge.get(e)}function J(e){if(typeof e!="object"||e===null)return null;const t=Ne.safeParse(e.body);return t.success?t.data.conflict:null}const Ve=15e3;function Qe(e,t,o){const a=JSON.stringify(L.entries(t));let c=0,r=null;const i=e.getQueryCache().subscribe(n=>{if(n.type!=="updated"||JSON.stringify(n.query.queryKey)!==a||r!==null)return;const m=Math.max(0,Ve-(Date.now()-c));r=setTimeout(()=>{r=null,c=Date.now(),o()},m)});return()=>{r!==null&&clearTimeout(r),i()}}function Xe(e){return{name:e.name,path:e.path,type:e.kind==="dir"?"dir":"file",size:e.size,isSymlink:e.kind==="symlink",lastCommit:e.lastCommit}}const We=new Map([["ROOM_FILE_NOT_READABLE","This isn’t a file that can be shown here."],["ROOM_FILE_NOT_FOUND","This file isn’t in the room’s files any more."]]);function ot(e){const{transport:t,queryClient:o,roomId:a,canChange:c=!0}=e,r=async i=>{try{return{status:"changed",commit:(await i()).commit}}catch(n){return Je(n,o,a)}};return{scopeKey:`room:${a}`,cwd:null,writable:c,provenance:!0,filtersHidden:!1,preview:"inline",async showToEveryone(i){await t.openRoomCanvasDocument(a,{type:"file",sourcePath:i})},editable:c,changes:c?{maxUploadFiles:V,upload:i=>r(()=>t.uploadRoomFiles(a,{dir:i.dir,baseCommit:i.baseCommit,replace:i.replace,files:i.files})),move:i=>r(()=>t.moveRoomFile(a,i)),remove:i=>r(()=>t.deleteRoomFile(a,i))}:void 0,async list(i){try{const n=await t.readRoomFiles(a,i===""?void 0:i);return{entries:n.entries.map(Xe),commit:n.commit}}catch(n){if(x(n)!==Ce)throw n;return{entries:[],absent:!0}}},async read(i){try{const n=await t.readRoomFileContent(a,i);return{path:n.path,size:n.size,lastCommit:n.lastCommit,commit:n.commit,body:n.body.kind==="text"?{kind:"text",text:n.body.text}:n.body.kind==="binary"?{kind:"binary"}:{kind:"too-large",maxBytes:n.body.maxBytes}}}catch(n){const m=We.get(x(n)??"");if(m===void 0)throw n;return{path:i,size:0,lastCommit:null,commit:null,body:{kind:"not-readable",reason:m}}}},async save(i){try{const n=await t.saveRoomFile(a,{path:i.path,baseCommit:i.baseCommit,text:i.text});return{status:"saved",commit:n.commit,lastCommit:n.lastCommit,committed:n.committed}}catch(n){const m=x(n);if(m===X){const v=J(n);return v!==null?{status:"conflict",commit:v.commit,lastCommit:v.lastCommit}:{status:"refused",reason:"Somebody changed this file while you were editing it, so nothing was saved. Close this and open it again to see their version."}}m==="MAIN_CHECKOUT_DIRTY"&&o.invalidateQueries({queryKey:L.repoStatus(a)});const h=k(n)??qe(m);if(h===void 0)throw n;return{status:"refused",reason:h}}},events(i){return Qe(o,a,i)}}}function Je(e,t,o){const a=x(e);if(a===X){const r=J(e);return r!==null?{status:"conflict",path:r.path,commit:r.commit,lastCommit:r.lastCommit}:{status:"refused",reason:"Somebody changed these files after you opened them, so nothing was changed. Look at the new version, then try again."}}if(a==="ROOM_FILE_EXISTS"){const r=e instanceof Error?e.message.replace(/`([^`]*)`/g,"“$1”"):"";return{status:"exists",reason:r.trim()!==""?r:"Something with that name is already there."}}a==="MAIN_CHECKOUT_DIRTY"&&t.invalidateQueries({queryKey:L.repoStatus(o)});const c=je(e);if(c===void 0)throw e;return{status:"refused",reason:c}}export{Ae as C,nt as F,Pe as N,Ve as R,st as a,Je as b,ot as c,De as g,tt as n,Ue as p,je as r,et as t,Qe as w};
@@ -1 +1 @@
1
- import{A as e,F as n}from"./index-BCGiD7pg.js";function s(t,o){return n(o,t)}function u(t,o){return{traits:o,soulContent:s(o,e(t.soulContent??""))}}export{u as p,s};
1
+ import{A as e,F as n}from"./index-DleaJjK-.js";function s(t,o){return n(o,t)}function u(t,o){return{traits:o,soulContent:s(o,e(t.soulContent??""))}}export{u as p,s};
@@ -1 +1 @@
1
- import{D as d,r as t}from"./index-BCGiD7pg.js";import{p as E}from"./soul-file-DcQD5pcS.js";const C=400;function A(u,s){const f=(u==null?void 0:u.traits)??d,[a,c]=t.useState(null),r=t.useRef(null),n=t.useRef(null),o=t.useRef({agent:u,update:s});t.useEffect(()=>{o.current={agent:u,update:s}});const m=(u==null?void 0:u.id)??null;t.useEffect(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null),n.current=null,c(null)},[m]);const l=t.useCallback(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null);const e=n.current;if(n.current=null,e===null)return;const{agent:i,update:p}=o.current;i!==null&&p(E(i,e))},[]);t.useEffect(()=>()=>l(),[l]);const T=t.useCallback(e=>{c(e),n.current=e,r.current!==null&&clearTimeout(r.current),r.current=setTimeout(l,C)},[l]);return{traits:a??f,onTraitsChange:T}}export{A as u};
1
+ import{D as d,r as t}from"./index-DleaJjK-.js";import{p as E}from"./soul-file-BQhkHCzH.js";const C=400;function A(u,s){const f=(u==null?void 0:u.traits)??d,[a,c]=t.useState(null),r=t.useRef(null),n=t.useRef(null),o=t.useRef({agent:u,update:s});t.useEffect(()=>{o.current={agent:u,update:s}});const m=(u==null?void 0:u.id)??null;t.useEffect(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null),n.current=null,c(null)},[m]);const l=t.useCallback(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null);const e=n.current;if(n.current=null,e===null)return;const{agent:i,update:p}=o.current;i!==null&&p(E(i,e))},[]);t.useEffect(()=>()=>l(),[l]);const T=t.useCallback(e=>{c(e),n.current=e,r.current!==null&&clearTimeout(r.current),r.current=setTimeout(l,C)},[l]);return{traits:a??f,onTraitsChange:T}}export{A as u};
@@ -524,8 +524,8 @@
524
524
  }
525
525
  })();
526
526
  </script>
527
- <script type="module" crossorigin src="/assets/index-BCGiD7pg.js"></script>
528
- <link rel="stylesheet" crossorigin href="/assets/index-BG-HtbEP.css">
527
+ <script type="module" crossorigin src="/assets/index-DleaJjK-.js"></script>
528
+ <link rel="stylesheet" crossorigin href="/assets/index-XdysNkCU.css">
529
529
  </head>
530
530
  <body>
531
531
  <div id="root"></div>
@@ -0,0 +1,23 @@
1
+ ALTER TABLE `room_entries` ADD `timeline_band` integer;--> statement-breakpoint
2
+ ALTER TABLE `room_entries` ADD `timeline_pos` integer;--> statement-breakpoint
3
+ -- Place every row of a mirrored room in its timeline (DOR-2573): what was written here follows
4
+ -- remote history in seq order, and an imported Community entry sits at its Community sequence.
5
+ UPDATE `room_entries` SET `timeline_band` = 1, `timeline_pos` = `seq`
6
+ WHERE `room_id` IN (SELECT `local_room_id` FROM `community_room_mirrors`);--> statement-breakpoint
7
+ UPDATE `room_entries` SET `timeline_band` = 0, `timeline_pos` = (
8
+ SELECT `remote_seq` FROM `community_mirror_entries` WHERE `local_entry_id` = `room_entries`.`id`
9
+ )
10
+ WHERE `room_id` IN (SELECT `local_room_id` FROM `community_room_mirrors`)
11
+ AND EXISTS (SELECT 1 FROM `community_mirror_entries` WHERE `local_entry_id` = `room_entries`.`id`);--> statement-breakpoint
12
+ CREATE INDEX `idx_room_entries_mirror_timeline` ON `room_entries` (`room_id`,`timeline_band`,`timeline_pos`) WHERE "timeline_band" IS NOT NULL;--> statement-breakpoint
13
+ ALTER TABLE `community_mirror_entries` ADD `remote_parent_entry_id` text;--> statement-breakpoint
14
+ ALTER TABLE `community_mirror_entries` ADD `remote_thread_root_entry_id` text;--> statement-breakpoint
15
+ -- The Community relation each cached entry was sent with, so the import can link replies that
16
+ -- arrived before their parent without reading the room. Rows cached before entry_json existed
17
+ -- have none, exactly as the old full-room repair skipped them.
18
+ UPDATE `community_mirror_entries` SET
19
+ `remote_parent_entry_id` = json_extract(`entry_json`, '$.parentEntryId'),
20
+ `remote_thread_root_entry_id` = json_extract(`entry_json`, '$.threadRootEntryId')
21
+ WHERE `entry_json` IS NOT NULL;--> statement-breakpoint
22
+ CREATE INDEX `idx_community_mirror_entries_remote_parent` ON `community_mirror_entries` (`local_room_id`,`remote_parent_entry_id`) WHERE "remote_parent_entry_id" IS NOT NULL;--> statement-breakpoint
23
+ CREATE INDEX `idx_community_mirror_entries_remote_thread_root` ON `community_mirror_entries` (`local_room_id`,`remote_thread_root_entry_id`) WHERE "remote_thread_root_entry_id" IS NOT NULL;