moi-computer 0.12.0 → 0.12.1-next.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 (140) hide show
  1. package/README.md +1 -1
  2. package/client/AGENTS.md +2 -2
  3. package/client/api/app-ui-keys.ts +1 -1
  4. package/client/api/workspace-keys.ts +1 -3
  5. package/client/app/routes/WorkspaceRoute.tsx +2 -8
  6. package/client/features/applets/applet-runtime.ts +11 -13
  7. package/client/features/chat/ChatPanel.tsx +70 -49
  8. package/client/features/chat/ChatPopup.tsx +81 -8
  9. package/client/features/chat/applet-chat-intents.ts +31 -12
  10. package/client/features/chat/chat-send.ts +33 -1
  11. package/client/features/chat/chat-store.ts +10 -0
  12. package/client/features/chat/composer/ChatComposer.tsx +24 -27
  13. package/client/features/chat/composer/ModelPicker.tsx +3 -3
  14. package/client/features/chat/composer/useWorkspaceComposerState.tsx +3 -3
  15. package/client/features/chat/connection/chat-frames.ts +14 -7
  16. package/client/features/chat/messages/ChatEmptyState.tsx +33 -19
  17. package/client/features/chat/messages/MarkdownContent.tsx +3 -3
  18. package/client/features/chat/messages/fork-history.ts +14 -0
  19. package/client/features/chat/sessions/ChatSelector.tsx +138 -79
  20. package/client/features/chat/sessions/api.ts +109 -19
  21. package/client/features/chat/sessions/browser-tab-state.ts +30 -7
  22. package/client/features/chat/sessions/useSelectedSession.ts +217 -51
  23. package/client/features/chat/useChat.ts +43 -45
  24. package/client/features/collab/client.ts +10 -11
  25. package/client/features/collab/hooks.tsx +6 -11
  26. package/client/features/collab/host-state.ts +57 -128
  27. package/client/features/collab/provider.tsx +3 -3
  28. package/client/features/collab/testing/fake-engine.ts +6 -27
  29. package/client/features/collab/workspace-users-menu.tsx +3 -7
  30. package/client/features/drawings/{useViewBuilderSketch.ts → useViewSketch.ts} +7 -7
  31. package/client/features/home/HomePage.tsx +2 -2
  32. package/client/features/overview/Overview.tsx +3 -6
  33. package/client/features/overview/default/ViewsWidget.tsx +5 -12
  34. package/client/features/overview/default/registry.tsx +2 -4
  35. package/client/features/views/PendingViewScreen.tsx +279 -0
  36. package/client/features/views/ViewManager.tsx +10 -10
  37. package/client/features/views/api.ts +63 -130
  38. package/client/features/views/useViewActions.ts +151 -0
  39. package/client/features/views/useViewDrafts.ts +79 -0
  40. package/client/features/views/view-presentation.ts +4 -5
  41. package/client/features/views/view-submission.ts +88 -0
  42. package/client/features/workspace/WorkspaceMenu.tsx +63 -0
  43. package/client/features/workspace/WorkspaceScreen.tsx +180 -375
  44. package/client/features/workspace/browser-tab-state.ts +16 -9
  45. package/client/features/workspace/moi-context.ts +13 -15
  46. package/client/features/workspace/tab-resolution.ts +16 -29
  47. package/client/features/workspace/useWorkspaceNavigation.ts +146 -104
  48. package/client/index.tsx +5 -1
  49. package/client/runtime/useWorkspaceEvents.ts +7 -6
  50. package/client/store/ui.ts +25 -29
  51. package/dist/chunk-1zhnhy00.js +1 -0
  52. package/dist/chunk-27501vke.js +1 -0
  53. package/dist/{chunk-jf6czgrz.js → chunk-9xtv6djt.js} +2 -2
  54. package/dist/chunk-am1x230f.js +2 -0
  55. package/dist/{chunk-nez8sdta.js → chunk-darpsw65.js} +1 -1
  56. package/dist/{chunk-97eg9mjn.js → chunk-gps4qc38.js} +1 -1
  57. package/dist/{chunk-3a48fyf7.js → chunk-hzwr8dp8.js} +4 -4
  58. package/dist/{chunk-efdyz6xp.js → chunk-j905va8r.js} +1 -1
  59. package/dist/chunk-n33w9y38.js +10 -0
  60. package/dist/chunk-r63ks44z.js +68 -0
  61. package/dist/{chunk-vfpsc75k.js → chunk-vqpkqtdr.js} +1 -1
  62. package/dist/chunk-wd46nk26.css +1 -0
  63. package/dist/chunk-xgt7vxt9.js +1 -0
  64. package/dist/{chunk-z3byfve5.js → chunk-yvzhwtfa.js} +2 -2
  65. package/dist/index.html +1 -1
  66. package/lib/ids.ts +2 -5
  67. package/lib/moi-context.ts +100 -73
  68. package/lib/navigation.ts +48 -87
  69. package/lib/session-drafts.ts +10 -0
  70. package/lib/types.ts +64 -31
  71. package/lib/view-build-directives.ts +12 -0
  72. package/lib/workspace-layout.ts +1 -1
  73. package/lib/workspace-tabs.ts +12 -7
  74. package/package.json +3 -1
  75. package/server/agent-launcher.ts +27 -0
  76. package/server/api.ts +119 -209
  77. package/server/app-config.ts +21 -2
  78. package/server/applets/build-worker.ts +2 -1
  79. package/server/applets/view-source.ts +7 -1
  80. package/server/cli-env.ts +72 -50
  81. package/server/cli.ts +101 -64
  82. package/server/control.ts +82 -63
  83. package/server/data-dir.ts +13 -0
  84. package/server/functions.ts +2 -1
  85. package/server/harness/README.md +8 -0
  86. package/server/harness/acp/adapter.ts +2 -2
  87. package/server/harness/acp/client.ts +2 -1
  88. package/server/harness/acp/discovery.ts +3 -3
  89. package/server/harness/acp/session.ts +6 -9
  90. package/server/harness/claude-code/adapter.ts +13 -8
  91. package/server/harness/claude-code/auth.ts +3 -2
  92. package/server/harness/claude-code/cli.ts +3 -1
  93. package/server/harness/claude-code/git-worktree.ts +5 -2
  94. package/server/harness/claude-code/index.ts +5 -0
  95. package/server/harness/claude-code/mcp.ts +2 -0
  96. package/server/harness/claude-code/models.ts +2 -0
  97. package/server/harness/claude-code/session.ts +5 -34
  98. package/server/harness/claude-code/sessions.ts +8 -12
  99. package/server/harness/codex/NOTES.md +23 -4
  100. package/server/harness/codex/adapter.ts +5 -3
  101. package/server/harness/codex/client.ts +13 -21
  102. package/server/harness/codex/index.ts +18 -0
  103. package/server/harness/codex/session.ts +6 -14
  104. package/server/harness/codex/thread-list.ts +74 -0
  105. package/server/harness/fork.ts +12 -0
  106. package/server/harness/openclaw/adapter.ts +3 -3
  107. package/server/harness/openclaw/session.ts +2 -30
  108. package/server/harness/session-title.ts +12 -3
  109. package/server/harness/types.ts +8 -3
  110. package/server/moi-scaffold.ts +2 -1
  111. package/server/pending-views.ts +164 -0
  112. package/server/registry.ts +14 -4
  113. package/server/selected-session.ts +91 -44
  114. package/server/service.ts +16 -2
  115. package/server/session-archive.ts +32 -0
  116. package/server/session-config.ts +16 -111
  117. package/server/session-lifecycle.ts +17 -0
  118. package/server/session-store.ts +127 -0
  119. package/server/status.ts +3 -1
  120. package/server/tabs.ts +7 -10
  121. package/server/view-sessions.ts +267 -0
  122. package/server/views.ts +30 -41
  123. package/server/web.ts +47 -45
  124. package/server/workspace-env.ts +27 -0
  125. package/server/workspace-init.ts +6 -2
  126. package/workspace/.claude/skills/moi-workspace/SKILL.md +49 -20
  127. package/workspace/.claude/skills/moi-workspace/references/COLLAB.md +2 -5
  128. package/client/features/views/ViewBuilder.tsx +0 -239
  129. package/client/features/views/useViewBuilderActions.ts +0 -103
  130. package/client/features/views/useViewBuilderDrafts.ts +0 -68
  131. package/dist/chunk-2jncyq65.js +0 -1
  132. package/dist/chunk-e2q5ken7.js +0 -68
  133. package/dist/chunk-h2kj1ysj.js +0 -1
  134. package/dist/chunk-nzwgm8vc.css +0 -1
  135. package/dist/chunk-ph0h6h86.js +0 -1
  136. package/dist/chunk-ryg9z3kn.js +0 -10
  137. package/dist/chunk-tpn177bt.js +0 -2
  138. package/lib/view-builder-directives.ts +0 -16
  139. package/server/chat-selection.ts +0 -22
  140. package/server/view-builders.ts +0 -453
@@ -0,0 +1 @@
1
+ import{Fc as a,Gc as b}from"/chunk-9xtv6djt.js";import"/chunk-vqpkqtdr.js";import"/chunk-yvzhwtfa.js";import"/chunk-gps4qc38.js";export{b as useAppConfig,a as loadAppConfig};
@@ -0,0 +1 @@
1
+ import{Nc as t,Oc as e}from"/chunk-am1x230f.js";import{$c as r}from"/chunk-gps4qc38.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);e();async function c(o){let[{mount:i},n,s]=await Promise.all([import("/chunk-r63ks44z.js"),import("/chunk-1zhnhy00.js").then((a)=>a.loadAppConfig()),import("/chunk-darpsw65.js").then((a)=>a.loadProxyUser())]);t(n?.experimental.collab===!0,s),i(o)}globalThis.__init=c;
@@ -1,2 +1,2 @@
1
- import{Nc as p}from"/chunk-vfpsc75k.js";import{Qc as y,Tc as r}from"/chunk-z3byfve5.js";import{Wc as m}from"/chunk-97eg9mjn.js";var E=m(y(),1);var a={collab:!1},f=Object.keys(a);var F={cloudDemo:!1,experimental:{...a},demoInstallUrl:"https://moi.computer"},t=F,o=new Set;function d(e){return o.add(e),()=>{o.delete(e)}}async function x(){try{t=await p("/api/config");for(let e of o)e();return t}catch{}}async function b(){let e=await x();return r(()=>{x()}),e}function A(){return E.useSyncExternalStore(d,()=>t)}
2
- export{b as Dc,A as Ec};
1
+ import{Pc as p}from"/chunk-vqpkqtdr.js";import{Sc as y,Vc as r}from"/chunk-yvzhwtfa.js";import{Yc as m}from"/chunk-gps4qc38.js";var E=m(y(),1);var a={collab:!1},f=Object.keys(a);var F={cloudDemo:!1,experimental:{...a},demoInstallUrl:"https://moi.computer"},t=F,o=new Set;function d(e){return o.add(e),()=>{o.delete(e)}}async function x(){try{t=await p("/api/config");for(let e of o)e();return t}catch{}}async function b(){let e=await x();return r(()=>{x()}),e}function A(){return E.useSyncExternalStore(d,()=>t)}
2
+ export{b as Fc,A as Gc};
@@ -0,0 +1,2 @@
1
+ var T=["pink","orange","amber","lime","emerald","cyan","blue","violet"];function _(A){return typeof A==="string"&&T.includes(A)}function I(A){let f=2166136261;for(let n=0;n<A.length;n++)f^=A.charCodeAt(n),f=Math.imul(f,16777619);return T[(f>>>0)%T.length]??T[0]}var P=1;var Y=8192,p=320;function q(A){return typeof A==="object"&&A!==null&&!Array.isArray(A)}function y(A,f=256){return typeof A==="string"&&A.length>0&&!A.includes("\x00")&&new TextEncoder().encode(A).length<=f}function k(A){return q(A)&&y(A.id,240)&&A.id.trim().length>0&&(A.name===void 0||y(A.name)&&A.name.trim().length>0)&&_(A.color)&&(A.avatar===void 0||y(A.avatar,Y))&&(A.email===void 0||y(A.email,p))}var D=["Curious Kiwi","Cheerful Cherry","Sleepy Peach","Excited Banana","Cosmic Mango","Velvet Lemon","Electric Plum","Wandering Pear","Dramatic Papaya","Suspicious Pineapple","Confused Coconut","Sneaky Tangerine","Gentle Fig","Quiet Apricot","Mellow Melon","Dreamy Guava"];function o(A,f){let n=A.filter((g)=>g!==f);return n[Math.floor(Math.random()*n.length)]??A[0]}function H(A){return{name:o(D,A?.name),color:o(T,A?.color)}}function Q(A,f){let n=f.name.trim();return{id:A,...n?{name:n}:{},color:f.color}}function J(){return Q(`local-${crypto.randomUUID().slice(0,8)}`,H())}var E="moi:collab:dev-profile",W=Object.freeze([]),M,C,G,V=!1,w=new Set,N=new Set;function L(A,f){return JSON.stringify(A)===JSON.stringify(f)}function X(A){if(!A||typeof A.id!=="string"||!A.id.trim())throw Error("A user profile needs an id.");if(A.name!==void 0&&typeof A.name!=="string")throw Error("A user profile name must be a string when provided.");if(A.color!==void 0&&!_(A.color))throw Error("A user profile color must be one of the user palette names.");let f=A.id.trim(),n=A.name?.trim(),g={id:f,...n?{name:n}:{},color:A.color??I(f),...A.avatar!==void 0?{avatar:A.avatar}:{},...A.email!==void 0?{email:A.email}:{}};if(!k(g))throw Error("Invalid user profile.");return Object.freeze(g)}function Z(A){if(!Array.isArray(A))throw Error("Users must be an array.");let f=new Set,n=A.map((g)=>{let B=X(g);if(f.has(B.id))throw Error("Users must have unique ids.");return f.add(B.id),B});return Object.freeze(n)}function $(A){if(!A||typeof A!=="object")throw Error("Users must be published as an object.");let f=Z(A.users),n;if(A.me!==void 0&&A.me!==null){if(typeof A.me!=="string")throw Error("The current user id must be a string.");let B=A.me.trim();if(n=f.find((O)=>O.id===B),!n)throw Error("The current user must be listed in users.")}let g=C!=="external"||!L(M,n);if(C="external",g)M=n;if(G=n?f:W,g)w.forEach((B)=>B());N.forEach((B)=>B())}function h(){return G}function i(A){return N.add(A),()=>{N.delete(A)}}function c(){return M}function d(A){return w.add(A),()=>{w.delete(A)}}function U({provider:A,profile:f}){if(C==="external")return;if(A===void 0){if(C===void 0||C==="local")return;C=void 0,M=void 0}else{let n=f===void 0?void 0:X(f);if(C===A&&L(M,n))return;C=A,M=n}w.forEach((n)=>n())}function t(){try{sessionStorage.setItem(E,JSON.stringify(M))}catch{}}function j(A){if(C!==void 0&&C!=="local")return;let f=X(A);C="local",M=f,t(),w.forEach((n)=>n())}function v(A,f){if(!A||!f||f.provider!==void 0||C!==void 0)return;try{let n=sessionStorage.getItem(E);if(n){j(JSON.parse(n));return}}catch{}j(J())}function a(){if(typeof window>"u"||V)return;V=!0;let A=window;A.moi??={};let f={publishUsers:$};A.moi.collab=f}
2
+ export{P as Hc,h as Ic,i as Jc,c as Kc,d as Lc,U as Mc,v as Nc,a as Oc};
@@ -1 +1 @@
1
- import{Kc as g}from"/chunk-tpn177bt.js";import{Nc as j}from"/chunk-vfpsc75k.js";import{Tc as w}from"/chunk-z3byfve5.js";import"/chunk-97eg9mjn.js";async function d(){try{let b=await j("/api/proxy-user");if(!b||typeof b!=="object"||Array.isArray(b)||b.provider!==void 0&&b.provider!=="cloudflare-access"||b.provider===void 0&&b.profile!==void 0)return;return g(b),b}catch{}}async function C(){let b=await d();return w(()=>{d()}),b}export{C as loadProxyUser};
1
+ import{Mc as g}from"/chunk-am1x230f.js";import{Pc as j}from"/chunk-vqpkqtdr.js";import{Vc as w}from"/chunk-yvzhwtfa.js";import"/chunk-gps4qc38.js";async function d(){try{let b=await j("/api/proxy-user");if(!b||typeof b!=="object"||Array.isArray(b)||b.provider!==void 0&&b.provider!=="cloudflare-access"||b.provider===void 0&&b.profile!==void 0)return;return g(b),b}catch{}}async function C(){let b=await d();return w(()=>{d()}),b}export{C as loadProxyUser};
@@ -1,2 +1,2 @@
1
1
  var j=Object.create;var{getPrototypeOf:k,defineProperty:f,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,s=(a,b,c)=>{var g=a!=null&&typeof a==="object";if(g){var h=b?o??=new WeakMap:p??=new WeakMap,i=h.get(a);if(i)return i}c=a!=null?j(k(a)):{};let d=b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c;for(let e of l(a))if(!m.call(d,e))f(d,e,{get:n.bind(a,e),enumerable:!0});if(g)h.set(a,d);return d};var t=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var q=(a)=>a;function r(a,b){this[a]=q.bind(null,b)}var u=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0,configurable:!0,set:r.bind(b,c)})};var v=((a)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});
2
- export{s as Wc,t as Xc,u as Yc,v as Zc};
2
+ export{s as Yc,t as Zc,u as _c,v as $c};