shapewall 0.2.3 → 0.3.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.
- package/CHANGELOG.md +48 -0
- package/README.md +35 -1
- package/dist/agent/package-lock.json +2 -2
- package/dist/client/assets/BoardChat-CupOxioV.js +27 -0
- package/dist/client/assets/{BuzzDialog-CZdwIQLF.js → BuzzDialog-Ds7Thpfe.js} +1 -1
- package/dist/client/assets/ChecksPanel-BqrS02Ih.js +1 -0
- package/dist/client/assets/History-CQG3NQOC.js +1 -0
- package/dist/client/assets/{LocalSettings-CvlVtNY_.js → LocalSettings-CSNMhNyV.js} +1 -1
- package/dist/client/assets/{Management-DOJkFY_o.js → Management-CJVNAqAW.js} +1 -1
- package/dist/client/assets/QuickConnect-B-4pUgXH.js +1 -0
- package/dist/client/assets/{ShareDialog-CdVAreaw.js → ShareDialog-BouvNraR.js} +2 -2
- package/dist/client/assets/{app-update-dialog-Dox9-LWv.js → app-update-dialog-rhaw0MRk.js} +1 -1
- package/dist/client/assets/{circle-x-BmT6vHKl.js → circle-x-PRxj7kPi.js} +1 -1
- package/dist/client/assets/index-CXtuJi1K.css +2 -0
- package/dist/client/assets/index-DKOCIQiq.js +37 -0
- package/dist/client/assets/{refresh-cw-ugt3cWKH.js → refresh-cw-aeOBDuGQ.js} +1 -1
- package/dist/client/assets/{square-_KG6tM5A.js → shield-check-DuPBJ6H_.js} +1 -1
- package/dist/client/assets/ui-Cg4TTrec.js +41 -0
- package/dist/client/build-info.json +1 -1
- package/dist/client/index.html +3 -3
- package/dist/client/sw.js +2 -2
- package/dist/console/assets/LocalAccountsApp-DOKZI6Lt.js +1 -0
- package/dist/console/assets/LocalConsole-DXzldLW9.js +1 -0
- package/dist/console/assets/app-update-dialog-CrqIMEwN.js +1 -0
- package/dist/console/assets/console-76WovHlh.js +55 -0
- package/dist/console/assets/console-Fp4k9iyx.css +2 -0
- package/dist/console/build-info.json +1 -1
- package/dist/console/console.html +2 -2
- package/docs/agent-hardening.md +19 -0
- package/docs/agent-workflow.md +33 -0
- package/docs/agents.md +112 -0
- package/docs/config.md +41 -0
- package/docs/deployment.md +3 -0
- package/docs/design-system.md +13 -5
- package/docs/hosted.md +10 -0
- package/docs/journeys.md +13 -1
- package/docs/pull-requests.md +192 -0
- package/package.json +2 -1
- package/src/agent/backends/acp.js +35 -6
- package/src/agent/batch-fixes.js +45 -0
- package/src/agent/batch-queue.js +204 -0
- package/src/agent/branch-mode.js +753 -0
- package/src/agent/config.js +6 -0
- package/src/agent/fix-prompt.js +5 -0
- package/src/agent/manage.js +1 -1
- package/src/agent/routes.js +901 -186
- package/src/agent/run.js +8 -1
- package/src/agent/settings-events.js +103 -0
- package/src/agent/settings-routes.js +92 -2
- package/src/agent/starter/worktree.js +254 -25
- package/src/agent/threads.js +2 -7
- package/src/agent/tools.js +51 -0
- package/src/agent/user-settings.js +33 -2
- package/src/ci/capture.js +103 -0
- package/src/ci/compare.js +267 -0
- package/src/ci/github.js +307 -0
- package/src/ci/images.js +76 -0
- package/src/ci/settings.js +211 -0
- package/src/ci/start.js +148 -0
- package/src/ci/summary.js +262 -0
- package/src/ci/workflow.js +238 -0
- package/src/cli/args.js +24 -1
- package/src/cli/ci.js +229 -0
- package/src/cli/help.js +23 -1
- package/src/cli/init.js +33 -1
- package/src/cli.js +6 -2
- package/src/comment-drawing.js +161 -0
- package/src/comment-fields.js +51 -0
- package/src/comment-media.js +528 -0
- package/src/config.js +7 -0
- package/src/doctor.js +23 -0
- package/src/export.js +8 -0
- package/src/feedback.js +89 -12
- package/src/github.js +3 -3
- package/src/hosted/admin.js +36 -4
- package/src/hosted/app.js +5 -0
- package/src/hosted/board-routes.js +63 -7
- package/src/hosted/clean-worker.js +22 -4
- package/src/hosted/cleaner.js +4 -1
- package/src/hosted/comment-files.js +200 -0
- package/src/hosted/comments.js +68 -15
- package/src/hosted/db.js +32 -0
- package/src/hosted/guest-view.js +9 -0
- package/src/hosted/import.js +213 -18
- package/src/hosted/operator.js +3 -1
- package/src/hosted/projects.js +3 -2
- package/src/hosted/push.js +6 -3
- package/src/hosted/retention.js +18 -0
- package/src/hosted/tenancy.js +1 -0
- package/src/hosted/token-api.js +110 -9
- package/src/image-sniff.js +11 -0
- package/src/mcp.js +48 -3
- package/src/remote/remote-mcp.js +2 -2
- package/src/remote/remote.js +6 -2
- package/src/remote/share.js +77 -7
- package/src/server/app.js +18 -1
- package/src/store.js +119 -33
- package/src/watch.js +4 -0
- package/dist/client/assets/BoardChat-C88k4s-W.js +0 -28
- package/dist/client/assets/ChecksPanel-B54chcLA.js +0 -1
- package/dist/client/assets/History-CVVuuxUK.js +0 -1
- package/dist/client/assets/QuickConnect-D40mj4Ry.js +0 -1
- package/dist/client/assets/index-CwvFfwU0.js +0 -29
- package/dist/client/assets/index-UIYSPHoh.css +0 -2
- package/dist/client/assets/ui-BAGBTB_P.js +0 -41
- package/dist/console/assets/LocalAccountsApp-4MtW1QlZ.js +0 -1
- package/dist/console/assets/LocalConsole-CgKqYa8i.js +0 -1
- package/dist/console/assets/app-update-dialog-S2Yyc7Pw.js +0 -1
- package/dist/console/assets/console-BPmBRIoz.js +0 -51
- package/dist/console/assets/console-DgVrGRMD.css +0 -2
package/dist/client/sw.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
// static export) and live HTML always come from the network, never from
|
|
6
6
|
// here, so nothing captured can go stale in a cache.
|
|
7
7
|
|
|
8
|
-
const BUILD = "
|
|
9
|
-
const SHELL = ["./","manifest.webmanifest","favicon.svg","theme-boot.js","icons/icon-192.png","icons/icon-512.png","icons/maskable-512.png","icons/apple-touch-icon.png","assets/BoardChat-
|
|
8
|
+
const BUILD = "6efbef3c004e"
|
|
9
|
+
const SHELL = ["./","manifest.webmanifest","favicon.svg","theme-boot.js","icons/icon-192.png","icons/icon-512.png","icons/maskable-512.png","icons/apple-touch-icon.png","assets/BoardChat-CupOxioV.js","assets/BuzzDialog-Ds7Thpfe.js","assets/ChecksPanel-BqrS02Ih.js","assets/History-CQG3NQOC.js","assets/LocalSettings-CSNMhNyV.js","assets/Management-CJVNAqAW.js","assets/QuickConnect-B-4pUgXH.js","assets/ShareDialog-BouvNraR.js","assets/app-update-dialog-rhaw0MRk.js","assets/circle-x-PRxj7kPi.js","assets/index-CXtuJi1K.css","assets/index-DKOCIQiq.js","assets/refresh-cw-aeOBDuGQ.js","assets/runtime-Bft6x_6E.js","assets/shield-check-DuPBJ6H_.js","assets/ui-Cg4TTrec.js"]
|
|
10
10
|
const scope = () => new URL(self.registration.scope)
|
|
11
11
|
// Named after the scope: a board under a sub-path (shapewall.com/demo/) must
|
|
12
12
|
// not drop the caches of another service worker on the same origin.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,A as t,C as n,D as r,E as i,F as a,I as o,J as s,L as c,M as l,N as u,O as d,P as f,R as p,S as m,Y as h,Z as g,at as _,b as v,c as y,d as b,f as x,ft as S,h as C,j as w,k as T,l as E,pt as D,rt as O,s as k,u as A,ut as j,v as M,w as N,y as P}from"./console-76WovHlh.js";import F from"./LocalConsole-DXzldLW9.js";var I=D(S(),1),L=g(),R=!!document.querySelector(`meta[name="shapewall-local-accounts"]`);function z(){return R?(0,L.jsx)(h,{children:(0,L.jsx)(d,{children:(0,L.jsx)(r,{children:(0,L.jsx)(i,{children:(0,L.jsx)(B,{})})})})}):(0,L.jsx)(h,{children:(0,L.jsx)(H,{})})}function B(){let{me:r,anon:i,loading:a,error:o,refresh:c}=T(),u=l(),d=t(`/signin?next=%2Fconsole`);return(0,I.useEffect)(()=>{r&&(u===`/signin`||u===`/signup`)&&window.location.replace(`/console`),a||o||r||!i||i.setupRequired||u===`/signin`||window.location.replace(`/signin?next=${encodeURIComponent(u===`/account`?`/account`:`/console`)}`)},[r,i,u,a,o]),a?(0,L.jsx)(m,{}):o?(0,L.jsx)(b,{children:(0,L.jsxs)(M,{className:`space-y-4 p-6`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:`Could not load your account`}),(0,L.jsx)(`p`,{role:`alert`,className:`text-sm text-bad`,children:o.message}),(0,L.jsx)(s,{size:`touch`,onClick:c,children:`Try again`})]})}):r?u===`/account`?(0,L.jsxs)(`div`,{className:`flex min-h-dvh flex-col`,"data-sw-local-account":!0,children:[(0,L.jsx)(`header`,{className:`border-b border-line bg-surface`,children:(0,L.jsxs)(`div`,{className:`mx-auto flex h-14 max-w-6xl items-center gap-3 px-3 sm:px-6`,children:[(0,L.jsxs)(`a`,{href:`/console`,className:`flex min-w-0 items-center gap-2 font-semibold text-fg`,children:[(0,L.jsx)(n,{}),` Shapewall`]}),(0,L.jsx)(`div`,{className:`flex-1`}),(0,L.jsx)(x,{name:r.user.displayName,avatarUrl:r.user.avatarUrl,detail:`@${r.user.handle}`,items:[{id:`account`,label:`Account and security`,icon:e,onSelect:()=>w(`/account`)},{id:`sign-out`,label:`Sign out`,icon:O,onSelect:d}]})]})}),(0,L.jsxs)(`main`,{className:`mx-auto w-full max-w-6xl flex-1 px-3 py-6 sm:px-6`,children:[(0,L.jsxs)(`a`,{href:`/console`,className:`mb-5 inline-flex min-h-11 items-center gap-2 text-sm font-medium text-accent`,children:[(0,L.jsx)(j,{size:15,"aria-hidden":`true`}),` Workspace Console`]}),(0,L.jsx)(k,{})]}),(0,L.jsx)(C,{legal:!1})]}):(0,L.jsx)(F,{account:r,onSignOut:d}):i?.setupRequired?u===`/console`||u.startsWith(`/console/`)?(0,L.jsx)(F,{}):(0,L.jsx)(V,{allowed:!!i.setupAllowed}):u===`/signin`?(0,L.jsx)(E,{}):(0,L.jsx)(m,{})}function V({allowed:e}){let{refresh:t}=T(),[n,r]=(0,I.useState)(``),[i,l]=(0,I.useState)(``),[d,m]=(0,I.useState)(!1),[h,g]=(0,I.useState)(``),[x,S]=(0,I.useState)(null),C=(0,I.useRef)(!1),w=A(i);return(0,L.jsx)(b,{wide:!!x,children:(0,L.jsxs)(M,{className:`space-y-4 p-6 sm:p-8`,"data-sw-local-account-setup":!0,children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:x?`Save your recovery codes`:`Set up your account`}),x?(0,L.jsx)(y,{codes:x.recoveryCodes,onDone:async()=>{await t(),window.location.assign(`/account`)}}):e?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`text-sm text-muted`,children:`Create a passkey to protect this installation and use the same profile on your other devices. Your existing boards and comments stay in place.`}),a()?null:(0,L.jsx)(N,{tone:`warn`,children:`Use a browser with passkey support over HTTPS or localhost.`}),(0,L.jsxs)(`form`,{className:`space-y-4`,onSubmit:async e=>{if(e.preventDefault(),!(w||C.current)){C.current=!0,m(!0),g(``);try{let{options:e}=await o.post(`/auth/register/options`,{handle:i,displayName:n}),t=await u(e);S(await o.post(`/auth/register/verify`,{response:t}))}catch(e){g(f(e))}finally{C.current=!1,m(!1)}}},children:[(0,L.jsx)(P,{label:`Name`,children:e=>(0,L.jsx)(p,{...e,value:n,onChange:e=>r(e.target.value),maxLength:60,required:!0,size:`touch`,autoComplete:`name`,"data-sw-local-account-name":!0})}),(0,L.jsx)(P,{label:`Handle`,hint:w||`Lowercase letters, digits and dashes. Starts with a letter.`,children:e=>(0,L.jsx)(p,{...e,value:i,onChange:e=>l(e.target.value),minLength:3,maxLength:32,required:!0,size:`touch`,autoComplete:`username webauthn`,autoCapitalize:`none`,spellCheck:!1,"data-sw-local-account-handle":!0})}),(0,L.jsx)(v,{error:h}),(0,L.jsxs)(s,{type:`submit`,size:`touch`,disabled:d||!a()||!n.trim()||!i||!!w,"data-sw-local-account-create":!0,children:[d?(0,L.jsx)(c,{}):(0,L.jsx)(_,{size:16,"aria-hidden":`true`}),` Create passkey`]})]})]}):(0,L.jsx)(N,{title:`Account setup needs the installation owner`,children:`Open the owner’s setup link on the computer serving Shapewall, or ask the installer to grant setup access. Your boards remain stored on this installation.`})]})})}function H(){return(0,L.jsx)(b,{children:(0,L.jsxs)(M,{className:`space-y-4 p-6`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:`Account and security`}),(0,L.jsx)(N,{title:`Account sign-in is not enabled on this installation`,children:`Ask the installer to enable accounts to create a passkey, upload a profile photo and manage signed-in devices. Existing network and device access controls still apply.`}),(0,L.jsx)(s,{asChild:!0,size:`touch`,variant:`secondary`,children:(0,L.jsx)(`a`,{href:`/console`,children:`Back to Workspace Console`})})]})})}export{z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,C as t,H as n,J as r,K as i,Q as a,R as o,S as s,T as c,U as l,V as u,W as d,X as f,Y as p,Z as m,a as h,ct as g,et as _,f as v,ft as y,h as b,i as x,it as S,lt as C,m as w,n as T,nt as E,o as D,ot as O,p as k,pt as A,r as j,rt as M,st as N,t as P,v as F,x as I,z as L}from"./console-76WovHlh.js";var R=A(y(),1),z=m();function B(){let[e,t]=(0,R.useState)(``),[n,a]=(0,R.useState)(null),[s,c]=(0,R.useState)(``);(0,R.useEffect)(()=>{let e=!0,t=async()=>{try{let t=await i.get(`/api/pairing`);if(!e)return;a(t),(t.pairing.state===`approved`||[`host`,`device`,`identity`].includes(t.access))&&window.location.reload()}catch(t){e&&c(t.message)}};t();let n=setInterval(t,2e3);return()=>{e=!1,clearInterval(n)}},[]);let l=async t=>{t.preventDefault(),c(``);try{let t=await i.post(`/api/pairing`,{name:e});a(e=>({...e,pairing:t}))}catch(e){c(e.message)}},u=n?.pairing,d=u?.code,f=/iPad|iPhone|iPod/.test(navigator.userAgent),p=window.matchMedia(`(display-mode: standalone)`).matches||navigator.standalone;return(0,z.jsxs)(`main`,{className:`mx-auto flex min-h-dvh max-w-lg flex-col justify-center gap-5 p-6`,"data-sw-pairing":!0,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`text-xs font-medium text-accent`,children:`Shapewall`}),(0,z.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold text-fg`,children:`Pair this device`})]}),(0,z.jsx)(`p`,{className:`text-sm text-muted`,children:`This board belongs to the person running Shapewall. Match the code and approve this device on that computer.`}),u?.state===`pending`?(0,z.jsxs)(`section`,{className:`space-y-3 rounded-lg border border-line p-4`,"aria-live":`polite`,children:[(0,z.jsxs)(`p`,{className:`text-sm text-fg`,children:[`Waiting for approval: `,u.name]}),(0,z.jsxs)(`p`,{className:`font-mono text-3xl tracking-widest text-fg`,"data-sw-pairing-code":!0,children:[d.slice(0,4),`-`,d.slice(4)]}),(0,z.jsxs)(`p`,{className:`text-xs text-muted`,children:[`Expires in five minutes. On the host, open Devices or run `,(0,z.jsxs)(`code`,{children:[`shapewall devices approve `,d]}),`.`]})]}):(0,z.jsxs)(`form`,{className:`space-y-3`,onSubmit:l,children:[[`denied`,`expired`].includes(u?.state)?(0,z.jsxs)(`p`,{className:`text-sm text-warn`,role:`status`,children:[u.state===`denied`?`The host denied this request.`:`This request expired.`,` You can request again.`]}):null,(0,z.jsx)(`label`,{htmlFor:`device-name`,className:`block text-sm text-fg`,children:`Device name`}),(0,z.jsx)(o,{id:`device-name`,required:!0,maxLength:80,placeholder:`My phone`,value:e,onChange:e=>t(e.target.value)}),(0,z.jsx)(r,{type:`submit`,children:`Request pairing`})]}),s?(0,z.jsx)(`p`,{className:`text-sm text-bad`,role:`alert`,children:s}):null,n?.secure?null:(0,z.jsx)(`p`,{className:`rounded-lg border border-warn/30 p-3 text-xs text-warn`,children:`Plain HTTP on Wi-Fi exposes your device cookie to sniffing and replay. Use Tailscale for private HTTPS, or configure a TLS certificate. Without HTTPS this board installs only as a bookmark.`}),f&&!p?(0,z.jsx)(`p`,{className:`text-xs text-muted`,children:`Installing on your iPhone? Add the board to your Home Screen first, then pair from inside that app. Its cookies are separate from Safari.`}):null]})}var V=[[`projects`,`Projects`,O],[`agents`,`Agents`,g],[`feedback`,`Agent feedback`,E],[`settings`,`Settings`,_]];function H({account:o=null,onSignOut:m=null}){let g=d(`/api/info`);h(g.refetch,!!g.data?.agent);let _=g.data?.agent?.ownerWrites===!0;(0,R.useEffect)(()=>x(_),[_]);let y=d(`/api/boards`),[E,A]=l(),H=E.get(`section`)===`settings`&&window.location.hash===`#agents`?`agents`:E.get(`section`),U=V.some(([e])=>e===H)?H:`projects`,W=n(`(min-width: 1024px)`),[G,K]=w(W),q=(0,R.useRef)(null),J=Array.isArray(y.data?.boards)?y.data.boards:[],Y=g.data?.title||`Shapewall`,X=e=>A({section:e===`projects`?null:e}),ee=()=>{g.refetch(),y.refetch()};if((0,R.useEffect)(()=>{document.title=`${V.find(([e])=>e===U)?.[1]||`Projects`} · Shapewall`},[U]),(0,R.useEffect)(()=>{document.querySelector(`[data-sw-local-nav-pills] [aria-current="page"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[U]),(0,R.useEffect)(()=>{H===`agents`&&E.get(`section`)===`settings`&&(window.history.replaceState(window.history.state,``,window.location.pathname+window.location.search),A({section:`agents`}))},[H,E,A]),g.error?.code===`pairing_required`||y.error?.code===`pairing_required`)return(0,z.jsx)(B,{});let Z=g.error||y.error,te=!!g.data?.agent?.ownerWrites||U===`feedback`,Q=(t,n)=>(0,z.jsx)(v,{name:o?.user?.displayName||g.data?.user?.name||g.data?.localUser?.name||null,avatarUrl:o?.user?.avatarUrl||g.data?.user?.avatarUrl,detail:o?.user?`@${o.user.handle}`:`Local installation`,side:t?`right`:void 0,showName:n,triggerClassName:t?n?`w-full justify-start`:`w-10 min-w-10 px-0`:void 0,items:[{id:`account`,label:`Account and security`,icon:e,onSelect:()=>u(`/account`)},...m?[{id:`sign-out`,label:`Sign out`,icon:M,onSelect:m}]:[]]}),ne=[{id:`board`,label:`Board`,icon:S,href:`/`},{id:`workspace`,label:`Workspace`,icon:N,href:`/console`,active:!0}],re=e=>t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),X(e))},$=V.filter(([e])=>e!==`feedback`||te),ie=$.map(([e,t,n])=>({id:`local-${e}`,label:t,icon:n,href:e===`projects`?`/console`:`/console?section=${e}`,onClick:re(e),active:U===e,"data-sw-nav":e}));return(0,z.jsx)(p,{children:(0,z.jsxs)(`div`,{className:`flex min-h-dvh`,children:[W?(0,z.jsx)(k,{expanded:G,onToggle:K,home:`/console`,homeLabel:`Shapewall console`,title:Y,logo:(0,z.jsx)(t,{}),items:ne,sections:ie,sectionsLabel:`Local installation`,profile:e=>Q(!0,e),className:`sticky top-0 h-dvh`}):null,(0,z.jsxs)(`div`,{className:`flex min-h-dvh min-w-0 flex-1 flex-col`,"data-sw-local-console":!0,children:[(0,z.jsx)(`a`,{href:`#main`,className:`sr-only focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-50 focus:rounded-md focus:bg-surface focus:p-3 focus:text-fg`,children:`Skip to content`}),(0,z.jsx)(`header`,{className:`sticky top-0 z-40 border-b border-line bg-surface/95 backdrop-blur`,children:(0,z.jsxs)(`div`,{className:`mx-auto flex h-14 max-w-6xl items-center gap-2 px-3 sm:px-6`,children:[W?null:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`a`,{href:`/console`,className:`flex shrink-0 items-center gap-2 rounded-md px-1 py-1 outline-none focus-visible:outline-2 focus-visible:outline-accent`,"aria-label":`Shapewall console`,children:[(0,z.jsx)(t,{}),(0,z.jsx)(`span`,{className:`hidden text-[15px] font-semibold text-fg sm:inline`,children:`Shapewall`})]}),(0,z.jsx)(`span`,{className:`hidden text-line sm:inline`,"aria-hidden":`true`,children:`/`})]}),(0,z.jsx)(`span`,{className:a(`min-w-0 flex-1 truncate text-sm font-semibold text-fg`,!W&&`px-1`),"data-sw-local-console-title":!0,children:Y}),(0,z.jsx)(f,{className:`hidden sm:inline-flex`,children:`Local`}),W?null:Q(!1,!1)]})}),(0,z.jsxs)(`main`,{id:`main`,className:`mx-auto w-full max-w-6xl flex-1 px-3 pt-5 pb-10 sm:px-6 sm:pt-8`,children:[(0,z.jsxs)(`div`,{className:`mb-4 flex min-w-0 items-center gap-2 lg:hidden`,children:[(0,z.jsx)(`h1`,{className:`truncate text-lg font-semibold text-fg`,children:Y}),(0,z.jsx)(f,{children:`Local`})]}),(0,z.jsxs)(`div`,{children:[W?null:(0,z.jsxs)(`nav`,{"aria-label":`Console`,className:`mb-5`,children:[(0,z.jsxs)(`div`,{className:`hidden px-2 pb-3 lg:block`,children:[(0,z.jsx)(`p`,{className:`truncate text-sm font-semibold text-fg`,children:Y}),(0,z.jsx)(f,{className:`mt-1`,children:`Local installation`})]}),(0,z.jsx)(`ul`,{className:`sw-scroll-x -mx-3 flex gap-1 overflow-x-auto px-3 sm:-mx-6 sm:px-6`,"data-sw-local-nav-pills":!0,children:$.map(([e,t,n])=>(0,z.jsx)(`li`,{children:(0,z.jsx)(r,{asChild:!0,size:`touch`,variant:`ghost`,className:a(`gap-2.5 rounded-full border px-3.5 text-sm lg:h-9 lg:w-full lg:justify-start lg:rounded-md lg:border-transparent lg:px-2.5`,U===e?`border-accent/40 bg-accent/10 text-fg`:`border-line bg-surface text-muted lg:bg-transparent`),children:(0,z.jsxs)(`a`,{href:e===`projects`?`/console`:`/console?section=${e}`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),X(e))},"aria-current":U===e?`page`:void 0,"data-sw-nav":e,children:[(0,z.jsx)(n,{size:16,"aria-hidden":`true`,className:U===e?`text-accent`:``}),t]})})},e))})]}),(0,z.jsx)(`div`,{className:`min-w-0`,children:g.loading||y.loading?(0,z.jsx)(F,{children:(0,z.jsx)(s,{label:`Loading your installation`})}):Z?(0,z.jsx)(F,{className:`p-4`,children:(0,z.jsx)(I,{error:Z,onRetry:ee})}):U===`feedback`?(0,z.jsx)(D,{baseUrl:`/api/agent/feedback`,get:i.get,touch:!W}):U===`agents`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(c,{title:`Agents`,description:P}),(0,z.jsx)(T,{info:g.data,touch:!W,onChanged:g.refetch})]}):U===`settings`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(c,{title:`Settings`,description:`Preferences for this browser, and this installation.`}),(0,z.jsx)(F,{className:`p-5`,"data-sw-local-console-settings":!0,children:(0,z.jsx)(j,{info:g.data,boardCount:J.length,touch:!W,onOpenUpdates:()=>q.current?.open()})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(c,{title:`Projects`,description:`Open a board to review its pages and comments.`,badge:(0,z.jsxs)(f,{children:[J.length,` `,J.length===1?`board`:`boards`]})}),J.length?(0,z.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2`,"data-sw-local-projects":!0,children:J.map(e=>(0,z.jsxs)(F,{className:`flex min-w-0 flex-col p-4`,"data-sw-local-project":e.id,children:[(0,z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,z.jsx)(`span`,{className:`inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-accent/10 text-accent`,children:(0,z.jsx)(O,{size:18,"aria-hidden":`true`})}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`h2`,{className:`truncate font-semibold text-fg`,children:e.title}),(0,z.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted`,children:[`1 board · `,e.pageCount,` `,e.pageCount===1?`page`:`pages`]})]})]}),(0,z.jsx)(`div`,{className:`mt-4`,children:(0,z.jsx)(r,{asChild:!0,size:`touch`,variant:`default`,className:`lg:h-9`,children:(0,z.jsxs)(`a`,{href:`/?board=${encodeURIComponent(e.id)}`,"data-sw-local-open-board":e.id,children:[`Open board`,(0,z.jsx)(C,{size:15,"aria-hidden":`true`})]})})})]},e.id))}):(0,z.jsx)(F,{children:(0,z.jsx)(L,{icon:S,title:`No boards yet`,children:`Add pages to this installation's configuration, then capture them to start reviewing.`})})]})})]})]}),(0,z.jsx)(b,{legal:!1,updatesRef:q,transport:i})]})]})})}export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e,G as t,J as n,K as r,L as i,Z as a,_ as o,dt as s,ft as c,g as l,pt as u,q as d,tt as f}from"./console-76WovHlh.js";var p={name:`circle-arrow-up`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]],aliases:[`arrow-up-circle`]};p.node;var m=s(p),h=u(c(),1),g=a(),_=`/api/app-update`;function v({open:a,onClose:s,onCloseAutoFocus:c,transport:u=r}){let[p,v]=(0,h.useState)(null),[y,b]=(0,h.useState)(!1),[x,S]=(0,h.useState)(null),[C,w]=(0,h.useState)(null),[T,E]=(0,h.useState)(!1),[D,O]=(0,h.useState)(!1),k=(0,h.useRef)(!0),A=d||t;(0,h.useEffect)(()=>(k.current=!0,()=>{k.current=!1}),[]);let j=(0,h.useCallback)(async()=>{b(!0),w(null);try{let e=await u.get(_);k.current&&v(e)}catch(e){k.current&&w(e.status===404?`This installation needs a manual update before in-app updates are available.`:e.message)}finally{k.current&&b(!1)}},[u]);(0,h.useEffect)(()=>{a&&!A&&j()},[a,A,j]);let M=async e=>{S(e),w(null),O(!1);let t=e===`apply`?p?.latest:null,n=e=>t&&e.job?.state!==`running`&&e.current?.version===t.version&&(!t.revision||e.current?.revision===t.revision),r=Date.now()+(e===`apply`?96e4:9e4);try{if(e===`apply`&&(!t||!t.revision&&t.version===p?.current?.version))throw Error(`This update has no distinct build identity. Ask the installer to prepare a versioned release.`);let i=await u.post(`${_}/${e}`);if(!k.current)return;for(v(i);k.current&&(i.job?.state===`running`||e===`apply`&&i.job?.state!==`failed`&&!n(i));){if(Date.now()>=r)throw Error(`Still waiting for the update service. Reopen this panel to refresh its status.`);if(await new Promise(e=>window.setTimeout(e,1200)),!k.current)return;try{if(i=await u.get(_),!k.current)return;if(E(!1),v(i),e===`apply`&&n(i)){O(!0);return}}catch(t){if(e!==`apply`||t.status&&t.status<500)throw t;E(!0)}}if(!k.current)return;if(i.job?.state===`failed`)throw Error(i.job.error||`The update could not finish. Try again or contact the installer.`);e===`apply`&&n(i)&&O(!0)}catch(e){k.current&&w(e.message||`Could not reach Shapewall. Check your connection and try again.`)}finally{k.current&&(S(null),E(!1))}},N=x||p?.job?.state===`running`,P=D||p?.canUpdate&&p?.supported||C||p?.job?.state===`running`,F=T?`Shapewall is restarting. Reconnecting…`:x===`apply`?`Installing the update. This page may briefly disconnect.`:x===`check`?`Checking for updates…`:D?`Update installed. Reload to use the new version.`:p?.job?.state===`running`?`An update operation is running. Refresh its status in a moment.`:p?.job?.state===`failed`?`The last update operation did not finish. You can try again.`:p?.updateAvailable?`An update is available${p.latest?`: ${o(p.latest)}`:``}.`:p?.checkedAt?`You are up to date.`:`Check when you want the latest version.`;return(0,g.jsx)(e,{open:a,onClose:s,onCloseAutoFocus:c,title:`About & Updates`,description:`Shapewall`,footer:A||!P?null:(0,g.jsxs)(`div`,{className:`flex w-full flex-wrap justify-end gap-2`,children:[D?(0,g.jsxs)(n,{size:`touch`,className:`lg:h-9`,onClick:()=>window.location.reload(),"data-sw-app-reload":!0,children:[(0,g.jsx)(f,{size:15,"aria-hidden":`true`}),` Reload Shapewall`]}):null,!D&&p?.canUpdate&&p?.supported?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(n,{variant:`secondary`,size:`touch`,className:`lg:h-9`,disabled:!!(N||y),onClick:()=>M(`check`),"data-sw-app-check":!0,children:[(0,g.jsx)(f,{size:15,"aria-hidden":`true`}),` Check for updates`]}),p.updateAvailable?(0,g.jsxs)(n,{size:`touch`,className:`lg:h-9`,disabled:!!(N||y),onClick:()=>M(`apply`),"data-sw-app-update":!0,children:[(0,g.jsx)(m,{size:15,"aria-hidden":`true`}),` Update now`]}):null]}):null,!x&&(C||p?.job?.state===`running`)?(0,g.jsx)(n,{variant:`secondary`,size:`touch`,className:`lg:h-9`,disabled:y,onClick:j,children:`Refresh status`}):null]}),children:(0,g.jsxs)(`div`,{className:`space-y-4 p-5 text-sm`,"data-sw-app-updates":!0,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsxs)(`p`,{className:`font-semibold text-fg`,children:[`Shapewall `,o(l)]}),(0,g.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`Created by Dan Baruch`})]}),A?(0,g.jsxs)(`p`,{className:`text-muted`,children:[d?`This is the public demo.`:`This is a static export.`,` It cannot update a Shapewall installation. Ask the installer for a new build.`]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`p`,{className:`text-muted`,children:`Updates are manual. Shapewall checks and installs only when you ask.`}),p?.current&&o(p.current)!==o(l)?(0,g.jsxs)(`p`,{className:`text-xs text-muted`,children:[`Server: `,o(p.current),`. Reload this page to load its current interface.`]}):null,y?(0,g.jsxs)(`p`,{className:`flex items-center gap-2 text-muted`,role:`status`,children:[(0,g.jsx)(i,{}),` Reading installation details…`]}):p?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`p`,{className:`flex items-start gap-2 text-fg`,role:`status`,"data-sw-app-update-status":!0,children:[x?(0,g.jsx)(i,{}):null,(0,g.jsx)(`span`,{children:F})]}),!p.supported||!p.canUpdate?(0,g.jsx)(`p`,{className:`text-muted`,children:p.reason||`Updates are managed by the person who installed Shapewall.`}):null,p.checkedAt?(0,g.jsxs)(`p`,{className:`text-xs text-muted`,children:[`Last checked: `,new Date(p.checkedAt).toLocaleString()]}):null]}):null,C?(0,g.jsx)(`p`,{className:`text-bad`,role:`alert`,children:C}):null]})]})})}export{v as default};
|