@mrpatronz/nexusflow 2.11.0 → 2.12.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/LICENSE +1 -1
- package/README.md +151 -12
- package/dist/analyzers/detect-deps.js +1 -1
- package/dist/analyzers/detect-deps.js.map +1 -1
- package/dist/commands/commit.d.ts.map +1 -1
- package/dist/commands/commit.js +15 -0
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/create.d.ts +10 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +44 -23
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/finish.d.ts.map +1 -1
- package/dist/commands/finish.js +15 -0
- package/dist/commands/finish.js.map +1 -1
- package/dist/commands/flow.d.ts +13 -0
- package/dist/commands/flow.d.ts.map +1 -0
- package/dist/commands/flow.js +91 -0
- package/dist/commands/flow.js.map +1 -0
- package/dist/commands/skill.d.ts +28 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +250 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +14 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/tag.d.ts +13 -0
- package/dist/commands/tag.d.ts.map +1 -0
- package/dist/commands/tag.js +179 -0
- package/dist/commands/tag.js.map +1 -0
- package/dist/commands/verify.d.ts +16 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +91 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/core/adapters/local-storage.d.ts.map +1 -1
- package/dist/core/adapters/local-storage.js +2 -2
- package/dist/core/adapters/local-storage.js.map +1 -1
- package/dist/core/commit.d.ts +2 -0
- package/dist/core/commit.d.ts.map +1 -1
- package/dist/core/commit.js +15 -0
- package/dist/core/commit.js.map +1 -1
- package/dist/core/domain-catalog.d.ts +9 -0
- package/dist/core/domain-catalog.d.ts.map +1 -0
- package/dist/core/domain-catalog.js +47 -0
- package/dist/core/domain-catalog.js.map +1 -0
- package/dist/core/domain-packs.d.ts +81 -0
- package/dist/core/domain-packs.d.ts.map +1 -0
- package/dist/core/domain-packs.js +443 -0
- package/dist/core/domain-packs.js.map +1 -0
- package/dist/core/generation-lock.d.ts.map +1 -1
- package/dist/core/generation-lock.js +1 -3
- package/dist/core/generation-lock.js.map +1 -1
- package/dist/core/lifecycle.d.ts +28 -0
- package/dist/core/lifecycle.d.ts.map +1 -0
- package/dist/core/lifecycle.js +411 -0
- package/dist/core/lifecycle.js.map +1 -0
- package/dist/core/verify.d.ts +39 -0
- package/dist/core/verify.d.ts.map +1 -0
- package/dist/core/verify.js +397 -0
- package/dist/core/verify.js.map +1 -0
- package/dist/core/work-guidance.d.ts +201 -0
- package/dist/core/work-guidance.d.ts.map +1 -0
- package/dist/core/work-guidance.js +225 -0
- package/dist/core/work-guidance.js.map +1 -0
- package/dist/core/workspace-state.d.ts +24 -3
- package/dist/core/workspace-state.d.ts.map +1 -1
- package/dist/core/workspace-state.js +93 -31
- package/dist/core/workspace-state.js.map +1 -1
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +7 -0
- package/dist/core/workspace.js.map +1 -1
- package/dist/generators/base.d.ts.map +1 -1
- package/dist/generators/base.js +38 -4
- package/dist/generators/base.js.map +1 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +4 -0
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/plan-generator.d.ts.map +1 -1
- package/dist/generators/plan-generator.js +6 -1
- package/dist/generators/plan-generator.js.map +1 -1
- package/dist/generators/skills-generator.d.ts.map +1 -1
- package/dist/generators/skills-generator.js +36 -3
- package/dist/generators/skills-generator.js.map +1 -1
- package/dist/gui/assets/AgentsPage-GCFiyNSm.js +3 -0
- package/dist/gui/assets/DashboardPage-51JHl4Hg.js +1 -0
- package/dist/gui/assets/{GettingStartedPage-1MOTng3B.js → GettingStartedPage-DH-zXYgU.js} +1 -1
- package/dist/gui/assets/ProjectsPage-DUv2fhI8.js +1 -0
- package/dist/gui/assets/ScaffoldRepoInline-Asao9IqG.js +1 -0
- package/dist/gui/assets/SettingsPage--pnZKpmm.js +1 -0
- package/dist/gui/assets/SkillsPage-BPq8arO5.js +7 -0
- package/dist/gui/assets/StartWorkPage-CypGEQZ0.js +1 -0
- package/dist/gui/assets/{StrategiesPage-CdCbbIu-.js → StrategiesPage-BHAzXMnc.js} +2 -2
- package/dist/gui/assets/WorkroomsPage-BYC8c-rP.js +4 -0
- package/dist/gui/assets/WorkspacesPage-DRASo1aL.js +13 -0
- package/dist/gui/assets/{alert-dialog-u7qgb9Hq.js → alert-dialog-BD3wT0w3.js} +1 -1
- package/dist/gui/assets/badge-DTBzXOWn.js +1 -0
- package/dist/gui/assets/index-er-mkc2S.css +2 -0
- package/dist/gui/assets/index-jcGHcXQ1.js +57 -0
- package/dist/gui/assets/square-check-big-Bj8Rf_dH.js +1 -0
- package/dist/gui/assets/tabs-DfbdubLX.js +1 -0
- package/dist/gui/assets/{useAriaLabelledBy-C4zV-1Ra.js → useAriaLabelledBy-BmJErI5a.js} +1 -1
- package/dist/gui/assets/vsc-Dn-smJni.js +1 -0
- package/dist/gui/index.html +3 -5
- package/dist/http/work-guidance-routes.d.ts +4 -0
- package/dist/http/work-guidance-routes.d.ts.map +1 -0
- package/dist/http/work-guidance-routes.js +44 -0
- package/dist/http/work-guidance-routes.js.map +1 -0
- package/dist/index.js +169 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +183 -0
- package/dist/mcp/tools.js.map +1 -1
- package/dist/resources/contracts.d.ts.map +1 -1
- package/dist/resources/contracts.js +2 -1
- package/dist/resources/contracts.js.map +1 -1
- package/dist/resources/fs-safety.d.ts.map +1 -1
- package/dist/resources/fs-safety.js +2 -1
- package/dist/resources/fs-safety.js.map +1 -1
- package/dist/resources/materializer.d.ts +3 -0
- package/dist/resources/materializer.d.ts.map +1 -1
- package/dist/resources/materializer.js +45 -19
- package/dist/resources/materializer.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +327 -4
- package/dist/server.js.map +1 -1
- package/dist/static-resources/skills/contextspace-verify-release/SKILL.md +51 -0
- package/dist/static-resources/skills/contextspace-verify-release/references/evidence.md +21 -0
- package/dist/static-resources/skills/nexusflow-dev/SKILL.md +49 -0
- package/dist/static-resources/skills/nexusflow-dev/references/cli-conventions.md +15 -0
- package/dist/static-resources/skills/nexusflow-dev/references/verification-checklist.md +28 -0
- package/dist/static-resources/skills/nexusflow-lifecycle/SKILL.md +62 -0
- package/dist/static-resources/skills/nexusflow-lifecycle/references/epic-deliverables.md +22 -0
- package/dist/static-resources/skills/nexusflow-lifecycle/references/flow-selection-matrix.md +21 -0
- package/dist/static-resources/skills/nexusflow-lifecycle/references/stage-outcomes.md +23 -0
- package/dist/static-resources/workflows/epic-multi-slice.md +21 -0
- package/dist/static-resources/workflows/plan-implement-review.md +17 -6
- package/dist/static-resources/workflows/research-verify.md +15 -4
- package/dist/static-resources/workflows/solo-developer.md +11 -2
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +8 -0
- package/dist/test-setup.js.map +1 -0
- package/dist/types.d.ts +175 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/resolve-workspace.d.ts.map +1 -1
- package/dist/utils/resolve-workspace.js +15 -8
- package/dist/utils/resolve-workspace.js.map +1 -1
- package/dist/utils/skills-catalog.d.ts +13 -9
- package/dist/utils/skills-catalog.d.ts.map +1 -1
- package/dist/utils/skills-catalog.js +241 -341
- package/dist/utils/skills-catalog.js.map +1 -1
- package/dist/utils/workflow-advisor.d.ts +1 -1
- package/dist/utils/workflow-advisor.d.ts.map +1 -1
- package/dist/utils/workflow-advisor.js +16 -4
- package/dist/utils/workflow-advisor.js.map +1 -1
- package/dist/utils/workflows.d.ts.map +1 -1
- package/dist/utils/workflows.js +5 -2
- package/dist/utils/workflows.js.map +1 -1
- package/dist/workrooms/contracts.d.ts +3 -3
- package/dist/workrooms/local-resources.d.ts +4 -1
- package/dist/workrooms/local-resources.d.ts.map +1 -1
- package/dist/workrooms/manager.d.ts +5 -2
- package/dist/workrooms/manager.d.ts.map +1 -1
- package/dist/workrooms/store.d.ts +2 -2
- package/package.json +3 -2
- package/resources/skills/contextspace-verify-release/SKILL.md +51 -0
- package/resources/skills/contextspace-verify-release/references/evidence.md +21 -0
- package/resources/skills/nexusflow-dev/SKILL.md +49 -0
- package/resources/skills/nexusflow-dev/references/cli-conventions.md +15 -0
- package/resources/skills/nexusflow-dev/references/verification-checklist.md +28 -0
- package/resources/skills/nexusflow-lifecycle/SKILL.md +62 -0
- package/resources/skills/nexusflow-lifecycle/references/epic-deliverables.md +22 -0
- package/resources/skills/nexusflow-lifecycle/references/flow-selection-matrix.md +21 -0
- package/resources/skills/nexusflow-lifecycle/references/stage-outcomes.md +23 -0
- package/resources/workflows/epic-multi-slice.md +21 -0
- package/resources/workflows/plan-implement-review.md +17 -6
- package/resources/workflows/research-verify.md +15 -4
- package/resources/workflows/solo-developer.md +11 -2
- package/dist/gui/assets/AgentsPage-DbivhmK0.js +0 -3
- package/dist/gui/assets/DashboardPage-D50Qrm3e.js +0 -1
- package/dist/gui/assets/NullStore-tdPen1kp.js +0 -1
- package/dist/gui/assets/ProjectsPage-srKgf7VN.js +0 -1
- package/dist/gui/assets/ScaffoldRepoInline-CP0yn5mw.js +0 -1
- package/dist/gui/assets/SettingsPage-DWmrLV8o.js +0 -1
- package/dist/gui/assets/SkillsPage-CKjTXdrd.js +0 -6
- package/dist/gui/assets/StartWorkPage-BCUnJ9k8.js +0 -1
- package/dist/gui/assets/WorkroomsPage-BcT-mGtT.js +0 -4
- package/dist/gui/assets/WorkspacesPage-CYFCm-7_.js +0 -2
- package/dist/gui/assets/badge-DwXvB44H.js +0 -1
- package/dist/gui/assets/chunk-BV7QT456-DfUBKG-z.js +0 -3
- package/dist/gui/assets/index-3tD_IeyQ.js +0 -55
- package/dist/gui/assets/index-CK5YRfPV.css +0 -2
- package/dist/gui/assets/square-check-big-BSIiYXPI.js +0 -1
- package/dist/gui/assets/tabs-BrHKp5bD.js +0 -1
- package/dist/gui/assets/vsc-D80c4gBT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,t}from"./button-CREn1mup.js";import{t as n}from"./circle-plus--zM3-3r3.js";import{t as r}from"./brand-hHByyyzq.js";import{
|
|
1
|
+
import{g as e,t}from"./button-CREn1mup.js";import{t as n}from"./circle-plus--zM3-3r3.js";import{t as r}from"./brand-hHByyyzq.js";import{wn as i}from"./index-jcGHcXQ1.js";var a=e();function o({config:e,onCreateWorkspace:o,onModifySettings:s}){return(0,a.jsxs)(`div`,{className:`max-w-4xl mx-auto animate-fade-in`,children:[(0,a.jsxs)(`header`,{className:`mb-10`,children:[(0,a.jsx)(`div`,{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-primary/10 text-primary border border-primary/20 text-xs font-semibold uppercase tracking-wider mb-4`,children:`Getting Started Guide`}),(0,a.jsxs)(`h1`,{className:`text-3xl font-bold tracking-tight text-foreground mb-2`,children:[`Welcome to `,r]}),(0,a.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[r,` orchestrates multi-repository developer environments. It combines isolated Git worktrees, automatic code analyzer sweeps, and background process running into a single dashboard.`]})]}),(0,a.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-8 mb-10`,children:[(0,a.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm space-y-6`,children:[(0,a.jsxs)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:[r,` Workflows`]}),(0,a.jsxs)(`div`,{className:`flex gap-4`,children:[(0,a.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`1`}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Configure Folders`}),(0,a.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Specify your Development folder (where repositories live) and Workspaces folder. These are currently set to:`,(0,a.jsx)(`code`,{className:`block mt-1 text-[10px] text-primary break-all`,children:e.devDir||`Not Configured`})]})]})]}),(0,a.jsxs)(`div`,{className:`flex gap-4`,children:[(0,a.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`2`}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Build Workspaces`}),(0,a.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Choose repositories and feature branch. `,r,` checks out dependencies under a unified workspace directory using Git Worktrees, keeping original projects clean.`]})]})]}),(0,a.jsxs)(`div`,{className:`flex gap-4`,children:[(0,a.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`3`}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Align AI Context`}),(0,a.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[r,` writes files like `,(0,a.jsx)(`code`,{children:`CLAUDE.md`}),`, `,(0,a.jsx)(`code`,{children:`.cursorrules`}),`, `,(0,a.jsx)(`code`,{children:`AGENTS.md`}),` prompting the LLM to inspect project relations and list key assumptions and questions before coding.`]})]})]})]}),(0,a.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm flex flex-col justify-between`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`Current Configuration`}),(0,a.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,a.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,a.jsx)(`span`,{className:`text-muted-foreground`,children:`Dev Folder:`}),(0,a.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.devDir})]}),(0,a.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,a.jsx)(`span`,{className:`text-muted-foreground`,children:`Workspaces Folder:`}),(0,a.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.workspacesDir})]}),(0,a.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,a.jsx)(`span`,{className:`text-muted-foreground`,children:`Preferred AI:`}),(0,a.jsx)(`span`,{className:`text-primary font-semibold uppercase`,children:e.defaultAssistant||`None`})]}),(0,a.jsxs)(`div`,{className:`flex justify-between py-1.5`,children:[(0,a.jsx)(`span`,{className:`text-muted-foreground`,children:`Scan Depth:`}),(0,a.jsxs)(`span`,{className:`text-foreground font-semibold`,children:[e.scanDepth,` levels`]})]})]})]}),(0,a.jsxs)(`div`,{className:`pt-6 border-t border-border flex flex-col gap-2`,children:[(0,a.jsxs)(t,{className:`w-full gap-2`,onClick:o,children:[(0,a.jsx)(n,{size:14}),` Create a Workspace`]}),(0,a.jsxs)(t,{variant:`outline`,className:`w-full gap-2`,onClick:s,children:[(0,a.jsx)(i,{size:14,className:`text-muted-foreground`}),` Modify Settings`]})]})]})]})]})}export{o as GettingStartedPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,t as r}from"./button-CREn1mup.js";import{n as i,t as a}from"./badge-DTBzXOWn.js";import{n as o,t as s}from"./ScaffoldRepoInline-Asao9IqG.js";import{a as c,c as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./alert-dialog-BD3wT0w3.js";import{t as g}from"./trash-2-CMdv3eD3.js";import{I as _,Nn as v,On as y,U as b,_ as x,a as S,ct as ee,d as C,f as w,g as T,h as E,i as D,j as O,kn as k,m as A,mn as j,n as M,nt as N,p as P,q as F,r as I,t as L,v as te}from"./index-jcGHcXQ1.js";var R=t(e(),1),z=n(),B={editingId:null,name:``,description:``,repoPaths:[]};function V(){let e=j(),t=b(),n=F(),V=ee(),H=O(),U=N(),W=_(),[G,K]=(0,R.useState)(null),[q,J]=(0,R.useState)(null),[Y,X]=(0,R.useState)(null),Z=(0,R.useMemo)(()=>{let e={};for(let t of V.data??[])t.projectId&&(e[t.projectId]=(e[t.projectId]??0)+1);return e},[V.data]),Q=()=>{J(null),K(B)},ne=e=>{J(null),K({editingId:e.id,name:e.name,description:e.description??``,repoPaths:e.repos.map(e=>e.path)})},re=e=>{K(t=>t&&{...t,repoPaths:t.repoPaths.includes(e.path)?t.repoPaths.filter(t=>t!==e.path):[...t.repoPaths,e.path]})},ie=async()=>{if(G){J(null);try{G.editingId?await U.mutateAsync({id:G.editingId,name:G.name,description:G.description||null,repos:G.repoPaths}):await H.mutateAsync({name:G.name,description:G.description||void 0,repos:G.repoPaths}),K(null)}catch(e){J(e instanceof Error?e.message:String(e))}}},ae=async()=>{if(Y)try{await W.mutateAsync(Y.id)}finally{X(null)}},oe=!!(G&&G.name.trim()&&G.repoPaths.length>0),$=H.isPending||U.isPending;return(0,z.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,z.jsxs)(`header`,{className:`mb-6 flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-border/70 pb-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`text-xl font-bold tracking-tight text-foreground`,children:`Projects`}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Named groups of repositories you start work from. Registered once, reused for every feature workspace.`})]}),(0,z.jsxs)(r,{onClick:Q,className:`gap-1.5 shadow-sm`,children:[(0,z.jsx)(y,{size:15}),` New project`]})]}),t.isLoading?(0,z.jsx)(`div`,{className:`flex justify-center py-20`,children:(0,z.jsx)(C,{className:`size-6`})}):(t.data??[]).length===0?(0,z.jsxs)(L,{className:`border border-border border-dashed`,children:[(0,z.jsxs)(I,{children:[(0,z.jsx)(D,{variant:`icon`,children:(0,z.jsx)(v,{})}),(0,z.jsx)(S,{children:`No projects yet`}),(0,z.jsx)(M,{children:`Register your first project to start work without re-picking repositories every time.`})]}),(0,z.jsxs)(r,{onClick:Q,children:[(0,z.jsx)(y,{}),` New project`]})]}):(0,z.jsx)(`ul`,{className:`flex flex-col gap-3`,children:(t.data??[]).map(t=>(0,z.jsx)(`li`,{className:`rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-4 transition-all duration-200 hover:border-primary/40 hover:shadow-xs`,children:(0,z.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:t.name}),(Z[t.id]??0)>0&&(0,z.jsxs)(a,{variant:`secondary`,children:[Z[t.id],` workspace`,Z[t.id]===1?``:`s`]})]}),t.description&&(0,z.jsx)(`p`,{className:`mt-0.5 truncate text-sm text-muted-foreground`,children:t.description}),(0,z.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:t.repos.map(e=>(0,z.jsxs)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:[e.path,(0,z.jsxs)(`span`,{className:`ml-2 text-muted-foreground/60`,children:[`[`,e.defaultBranch,`]`]})]},e.path))})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,z.jsxs)(r,{size:`sm`,onClick:()=>e(`/new?project=${encodeURIComponent(t.id)}`),children:[(0,z.jsx)(k,{}),` Start work`]}),(0,z.jsx)(r,{size:`icon-sm`,variant:`ghost`,"aria-label":`Edit ${t.name}`,onClick:()=>ne(t),children:(0,z.jsx)(l,{})}),(0,z.jsx)(r,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${t.name}`,onClick:()=>X(t),children:(0,z.jsx)(g,{})})]})]})},t.id))}),(0,z.jsx)(w,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,z.jsxs)(x,{className:`max-w-lg`,children:[(0,z.jsxs)(E,{children:[(0,z.jsx)(te,{children:G?.editingId?`Edit project`:`New project`}),(0,z.jsx)(P,{children:`A project is a reusable group of source repositories. Removing one later never touches disk.`})]}),(0,z.jsxs)(T,{className:`space-y-4`,children:[(0,z.jsxs)(`label`,{className:`block`,children:[(0,z.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Name`}),(0,z.jsx)(i,{value:G?.name??``,onChange:e=>K(t=>t&&{...t,name:e.target.value}),placeholder:`e.g. Acme Billing`,autoFocus:!0})]}),(0,z.jsxs)(`label`,{className:`block`,children:[(0,z.jsxs)(`span`,{className:`mb-1 block text-sm font-medium`,children:[`Description `,(0,z.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional)`})]}),(0,z.jsx)(i,{value:G?.description??``,onChange:e=>K(t=>t&&{...t,description:e.target.value}),placeholder:`What this group of repos is for`})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Repositories`}),(0,z.jsx)(o,{repos:n.data??[],selectedPaths:G?.repoPaths??[],onToggle:re,loading:n.isLoading,emptyHint:`No repositories found in your dev directory.`}),(0,z.jsx)(s,{onCreated:e=>K(t=>t&&{...t,repoPaths:[...t.repoPaths,e.path]})})]}),q&&(0,z.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:q})]}),(0,z.jsxs)(A,{children:[(0,z.jsx)(r,{variant:`outline`,onClick:()=>K(null),children:`Cancel`}),(0,z.jsxs)(r,{onClick:ie,disabled:!oe||$,children:[$?(0,z.jsx)(C,{}):null,G?.editingId?`Save changes`:`Create project`]})]})]})}),(0,z.jsx)(h,{open:Y!==null,onOpenChange:e=>!e&&X(null),children:(0,z.jsxs)(f,{children:[(0,z.jsxs)(c,{children:[(0,z.jsxs)(m,{children:[`Remove “`,Y?.name,`”?`]}),(0,z.jsx)(p,{children:`This only removes the project from the registry — repositories and workspaces on disk are not touched.`})]}),(0,z.jsxs)(u,{children:[(0,z.jsx)(d,{render:(0,z.jsx)(r,{variant:`outline`,children:`Cancel`})}),(0,z.jsxs)(r,{variant:`destructive`,onClick:ae,disabled:W.isPending,children:[W.isPending?(0,z.jsx)(C,{}):null,`Remove project`]})]})]})})]})}export{V as ProjectsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,o as u,p as d,t as f}from"./button-CREn1mup.js";import{En as p,Jn as m,Kt as ee,Ln as h,Wt as g,Xt as _,Yt as te,_n as ne,bt as re,c as ie,i as ae,l as oe,n as v,nn as se,o as ce,rn as le,s as ue,sn as y,xt as de}from"./badge-DTBzXOWn.js";import{t as fe}from"./useAriaLabelledBy-BmJErI5a.js";import{En as pe,M as b,Pt as me,d as x,u as he}from"./index-jcGHcXQ1.js";var S=o(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),C=t(e(),1),w=C.createContext({disabled:!1});function ge(){return C.useContext(w)}function _e(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}function ve(e){return{checked(t){return e.indeterminate?{}:t?{"data-checked":``}:{"data-unchecked":``}},...oe}}var T=C.createContext(void 0);function ye(){return C.useContext(T)}var be=C.createContext(void 0);function E(){let e=C.useContext(be);if(e===void 0)throw Error(d(14));return e}var D=a(),xe=`data-parent`,Se=C.forwardRef(function(e,t){let{checked:a,className:o,defaultChecked:l=!1,"aria-labelledby":d,disabled:f=!1,form:m,id:ee,indeterminate:g=!1,inputRef:oe,name:v,onCheckedChange:pe,parent:b=!1,readOnly:x=!1,render:he,required:S=!1,uncheckedValue:w,value:T,nativeButton:E=!1,style:Se,...O}=e,{clearErrors:k}=ue(),{disabled:A,name:j,setDirty:Ce,setFilled:M,setFocused:N,setTouched:we,state:P,validationMode:Te,validityData:Ee,validation:De}=ie(),Oe=ge(),{labelId:ke,controlId:Ae,registerControlId:F,getDescriptionProps:je}=ce(),I=ye(),L=I?.allValues===void 0?void 0:I.parent,R=L!==void 0,z=A||Oe.disabled||I?.disabled||f,B=j??v,V=T??B,Me=_(),Ne=_(),H=ee||Ae;R&&(b?H=Ne:V===void 0?H||=Ne:H=`${L.id}-${V}`);let U={};R&&(b?U=L.getParentProps():V!==void 0&&(U=L.getChildProps(V)));let{checked:Pe=a,indeterminate:Fe=g,onCheckedChange:Ie,...Le}=U,W=I?.value,G=C.useRef(null),K=i(()=>Symbol()),q=C.useRef(!1),{getButtonProps:Re,buttonRef:ze}=se({disabled:z,native:E}),J=I?.validation??De,[Y,Be]=p({controlled:V!==void 0&&W!==void 0&&!b?W.includes(V):Pe,default:l,name:`Checkbox`,state:`checked`}),X=R?!!Pe:Y,Z=R&&Fe||g;y(()=>{F!==c&&(q.current=!0,F(K.current,H))},[H,F,K]),C.useEffect(()=>{let e=K.current;return()=>{!q.current||F===c||(q.current=!1,F(e,void 0))}},[F,K]),ae(G,Me,Y,void 0,!I&&!z,v);let Q=C.useRef(null),Ve=J.registerInput,He=I?V:void 0,Ue=C.useCallback(e=>Ve(e,{controlRef:G,value:He}),[Ve,He]),We=r(oe,Q,b?void 0:Ue),Ge=fe(d,ke,Q,!E,H??void 0);y(()=>{Q.current&&(Q.current.indeterminate=Z,Y&&M(!0))},[Y,Z,M]),me(Y,()=>{I||(k(B),M(Y),Ce(Y!==Ee.initialValue),J.change(Y))});let Ke=u({checked:Y,disabled:z,form:m,name:b?void 0:B,id:E?void 0:H??void 0,required:S,ref:We,style:B?de:re,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(x){e.preventDefault();return}let t=e.currentTarget.checked,n=te(h,e.nativeEvent);if(pe?.(t,n),!n.isCanceled&&(Ie?.(t,n),!n.isCanceled&&(Be(t),V!==void 0&&I!==void 0&&!b&&!R))){let e=t?[...I.value,V]:I.value.filter(e=>e!==V);I.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){G.current?.focus()}},T===void 0?n:{value:(I?Y&&T:T)||``},je,e=>J.getValidationProps(z,e));C.useEffect(()=>{if(!L||V===void 0)return;let e=L.disabledStatesRef.current;return e.set(V,z),()=>{e.delete(V)}},[L,z,V]);let $=C.useMemo(()=>({...P,checked:X,disabled:z,readOnly:x,required:S,indeterminate:Z}),[P,X,z,x,S,Z]),qe=ve($),Je=s(`span`,e,{state:$,ref:[ze,G,t],props:[{id:E?H??void 0:Me,role:`checkbox`,"aria-checked":Z?`mixed`:X,"aria-readonly":x||void 0,"aria-required":S||void 0,"aria-labelledby":Ge,[xe]:b?``:void 0,onFocus(){z||N(!0)},onBlur(){let e=Q.current;e&&(we(!0),N(!1),Te===`onBlur`&&J.commit(I?W:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=Q.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),ne(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||_e(t)?.click()})},onClick(e){if(x||z)return;e.preventDefault();let t=Q.current;t&&le(t,e)}},O,Le,Re,je,e=>J.getValidationProps(z,e)],stateAttributesMapping:qe});return(0,D.jsxs)(be.Provider,{value:$,children:[Je,!Y&&!I&&B&&!b&&w!==void 0&&(0,D.jsx)(`input`,{type:`hidden`,form:m,name:B,value:w,disabled:z}),(0,D.jsx)(`input`,{...Ke,suppressHydrationWarning:!0})]})}),O=C.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,c=E(),l=c.checked||c.indeterminate,{mounted:u,transitionStatus:d,setMounted:f}=ee(l),p=C.useRef(null),h={...c,transitionStatus:d};g({open:l,ref:p,onComplete(){l||f(!1)}});let _={...ve(c),...m},te=a||u,ne=s(`span`,e,{ref:[t,p],state:h,stateAttributesMapping:_,props:o});return te?ne:null});function k({className:e,...t}){return(0,D.jsx)(Se,{className:l(`relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[.25rem] border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none ring-ring transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none`,e),"data-slot":`checkbox`,...t,children:(0,D.jsx)(O,{className:`-inset-px absolute flex items-center justify-center rounded-[.25rem] text-primary-foreground data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground`,"data-slot":`checkbox-indicator`,render:(e,t)=>(0,D.jsx)(`span`,{...e,children:t.indeterminate?(0,D.jsx)(`svg`,{className:`size-3.5 sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,D.jsx)(`path`,{d:`M5.252 12h13.496`})}):(0,D.jsx)(`svg`,{className:`size-3.5 sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,D.jsx)(`path`,{d:`M5.252 12.7 10.2 18.63 18.748 5.37`})})})})})}function A({repos:e,selectedPaths:t,onToggle:n,loading:r,emptyHint:i,className:a,freshnessMap:o}){let[s,c]=(0,C.useState)(``),u=(0,C.useMemo)(()=>{let t=s.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,s]);return(0,D.jsxs)(`div`,{className:l(`flex flex-col gap-2`,a),children:[(0,D.jsxs)(`div`,{className:`relative`,children:[(0,D.jsx)(pe,{className:`absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,D.jsx)(v,{value:s,onChange:e=>c(e.target.value),placeholder:`Filter repositories…`,className:`pl-8`,"aria-label":`Filter repositories`})]}),(0,D.jsx)(`div`,{className:`max-h-56 overflow-y-auto rounded-lg border border-border`,children:r?(0,D.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:`Scanning for repositories…`}):u.length===0?(0,D.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:i??`No repositories found.`}):(0,D.jsx)(`ul`,{className:`divide-y divide-border`,children:u.map(e=>{let r=t.includes(e.path),i=o?.[e.path];return(0,D.jsx)(`li`,{children:(0,D.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 px-3 py-2 hover:bg-accent`,children:[(0,D.jsx)(k,{checked:r,onCheckedChange:()=>n(e),"aria-label":e.name}),(0,D.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,D.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,D.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.path})]}),(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[i&&(0,D.jsx)(he,{tone:i.status===`up-to-date`?`success`:i.status===`behind`?`warning`:i.status===`diverged`?`danger`:i.status===`ahead`?`info`:`neutral`,title:i.message,children:i.status===`behind`?`↓ ${i.behind} behind`:i.status===`up-to-date`?`Up to date`:i.status===`diverged`?`Diverged`:i.status===`ahead`?`↑ ${i.ahead} ahead`:`Local`}),(0,D.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.defaultBranch})]})]})},e.path)})})})]})}function j({onCreated:e}){let[t,n]=(0,C.useState)(!1),[r,i]=(0,C.useState)(``),[a,o]=(0,C.useState)(null),s=b(),c=async()=>{o(null);try{let{repo:t}=await s.mutateAsync(r.trim());i(``),n(!1),e(t)}catch(e){o(e instanceof Error?e.message:String(e))}};return t?(0,D.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-1.5`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(v,{value:r,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===`Enter`&&r.trim()&&c(),placeholder:`new-repo-name`,className:`h-7 font-mono text-xs`,"aria-label":`New repository name`,autoFocus:!0}),(0,D.jsxs)(f,{size:`xs`,onClick:c,disabled:!r.trim()||s.isPending,children:[s.isPending?(0,D.jsx)(x,{}):null,`Create`]}),(0,D.jsx)(f,{size:`xs`,variant:`ghost`,onClick:()=>{n(!1),o(null)},children:`Cancel`})]}),a&&(0,D.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:a})]}):(0,D.jsxs)(`button`,{type:`button`,onClick:()=>n(!0),className:`mt-1.5 inline-flex cursor-pointer items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,D.jsx)(S,{className:`size-3.5`}),` Scaffold a brand-new repository`]})}export{A as n,k as r,j as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,c as n,d as r,g as i,i as a,m as o,p as s,t as c}from"./button-CREn1mup.js";import{En as l,Ln as u,Xt as d,Yt as f,a as p,bt as m,c as ee,i as te,l as h,n as g,nn as ne,o as _,rn as re,s as v,sn as ie,t as y,xt as b}from"./badge-DTBzXOWn.js";import{t as ae}from"./useAriaLabelledBy-BmJErI5a.js";import{C as x,Dn as S,Ot as C,Pt as oe,Rn as w,S as T,b as E,bn as se,d as D,w as O,x as k}from"./index-jcGHcXQ1.js";import{t as A}from"./card-yrg6ov8B.js";import{t as j}from"./label-DC730X8s.js";import{t as M}from"./alert-QnMXzwpU.js";var N=i();function P({className:e,orientation:t=`horizontal`,...n}){return(0,N.jsx)(C,{className:o(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch`,e),"data-slot":`separator`,orientation:t,...n})}var F=t(e(),1),I=F.createContext(void 0);function L(){let e=F.useContext(I);if(e===void 0)throw Error(s(63));return e}var R={...h,checked(e){return e?{"data-checked":``}:{"data-unchecked":``}}},z=F.forwardRef(function(e,t){let{checked:i,className:o,defaultChecked:s,"aria-labelledby":c,form:h,id:g,inputRef:y,name:x,nativeButton:S=!1,onCheckedChange:C,readOnly:w=!1,required:T=!1,disabled:E=!1,render:se,uncheckedValue:D,value:O,style:k,...A}=e,{clearErrors:j}=v(),{state:M,setTouched:P,setDirty:L,validityData:z,setFilled:B,setFocused:V,validationMode:H,disabled:ce,name:U,validation:W}=ee(),{labelId:le}=_(),G=ce||E,K=U??x,q=F.useRef(null),ue=r(q,y,W.inputRef),J=F.useRef(null),Y=d(),X=p({id:g,implicit:!1,controlRef:J}),Z=S?void 0:X,[Q,de]=l({controlled:i,default:!!s,name:`Switch`,state:`checked`});te(J,Y,Q,void 0,!G,x),ie(()=>{q.current&&B(q.current.checked)},[B]),oe(Q,()=>{j(K),L(Q!==z.initialValue),B(Q),W.change(Q)});let{getButtonProps:fe,buttonRef:pe}=ne({disabled:G,native:S}),me=ae(c,le,q,!S,Z),he={id:S?X:Y,role:`switch`,"aria-checked":Q,"aria-readonly":w||void 0,"aria-required":T||void 0,"aria-labelledby":me,onFocus(){G||V(!0)},onBlur(){let e=q.current;!e||G||(P(!0),V(!1),H===`onBlur`&&W.commit(e.checked))},onClick(e){if(w||G)return;e.preventDefault();let t=q.current;t&&re(t,e)}},ge={...W.getValidationProps(G),checked:Q,disabled:G,form:h,id:Z,name:K,required:T,style:K?b:m,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:ue,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(w){e.preventDefault();return}let t=e.currentTarget.checked,n=f(u,e.nativeEvent);C?.(t,n),!n.isCanceled&&de(t)},onClick(e){e.stopPropagation()},onFocus(){J.current?.focus()},...O===void 0?n:{value:O}},$=F.useMemo(()=>({...M,checked:Q,disabled:G,readOnly:w,required:T}),[M,Q,G,w,T]),_e=a(`span`,e,{state:$,ref:[t,J,pe],props:[he,A,fe,e=>W.getValidationProps(G,e)],stateAttributesMapping:R});return(0,N.jsxs)(I.Provider,{value:$,children:[_e,!Q&&K&&D!==void 0&&(0,N.jsx)(`input`,{type:`hidden`,form:h,name:K,value:D,disabled:G}),(0,N.jsx)(`input`,{...ge,suppressHydrationWarning:!0})]})}),B=F.forwardRef(function(e,t){let{render:n,className:r,style:i,...o}=e,s=L();return a(`span`,e,{state:s,ref:t,stateAttributesMapping:R,props:o})});function V({className:e,...t}){return(0,N.jsx)(z,{className:o(`inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 cursor-pointer items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(5)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-64 sm:[--thumb-size:--spacing(4)]`,e),"data-slot":`switch`,...t,children:(0,N.jsx)(B,{className:o(`pointer-events-none block aspect-square h-full origin-left in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110 in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)] rounded-(--thumb-size) bg-background shadow-sm/5 will-change-transform [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s] data-checked:origin-[var(--thumb-size)_50%] data-checked:translate-x-[calc(var(--thumb-size)-4px)]`),"data-slot":`switch-thumb`})})}function H({config:e,setConfig:t,saveStatus:n,editors:r,adapters:i,saveAppConfig:a,isSettingsFormValid:o,toolsStatus:s,toolsLoading:l,updatingToolId:u,fetchToolsStatus:d,handleUpdateTool:f}){if(!e)return null;let p=r.find(t=>t.command===e.defaultEditor),m=i.find(t=>t.name===(e.storageProvider||`local`));return(0,N.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,N.jsxs)(`header`,{className:`mb-6 border-b border-border/70 pb-4`,children:[(0,N.jsx)(`h1`,{className:`text-xl font-bold tracking-tight text-foreground`,children:`Global Settings`}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Configure your local development directories, AI search parameters, storage adapters, and editor defaults.`})]}),n===`success`&&(0,N.jsxs)(M,{variant:`success`,className:`mb-6`,children:[(0,N.jsx)(w,{size:18}),` Settings successfully saved and updated!`]}),n===`error`&&(0,N.jsxs)(M,{variant:`error`,className:`mb-6`,children:[(0,N.jsx)(se,{size:18}),` Error: Could not save configuration details to disk.`]}),(0,N.jsx)(A,{className:`mb-6 rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-6 shadow-xs`,children:(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-2`,children:[(0,N.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,N.jsx)(j,{htmlFor:`settings-devDir`,className:`text-sm`,children:`Development Directory`}),(0,N.jsx)(g,{type:`text`,id:`settings-devDir`,value:e.devDir,onChange:n=>t({...e,devDir:n.target.value})}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where your git projects are scanned.`})]}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,N.jsx)(j,{htmlFor:`settings-workspacesDir`,className:`text-sm`,children:`Workspaces Directory`}),(0,N.jsx)(g,{type:`text`,id:`settings-workspacesDir`,value:e.workspacesDir,onChange:n=>t({...e,workspacesDir:n.target.value})}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where unified worktree environments are spun up.`})]}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,N.jsx)(j,{htmlFor:`settings-scanDepth`,className:`text-sm`,children:`Repo Search Depth`}),(0,N.jsx)(g,{type:`number`,min:1,max:5,id:`settings-scanDepth`,value:e.scanDepth,onChange:n=>t({...e,scanDepth:parseInt(n.target.value,10)})}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Max directory levels deep the system will traverse for git repos.`})]}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,N.jsx)(j,{className:`text-sm`,children:`Default Assistant`}),(0,N.jsxs)(E,{value:e.defaultAssistant||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultAssistant:n||null}),children:[(0,N.jsx)(x,{"aria-label":`Default Assistant`,children:(0,N.jsx)(O,{children:e.defaultAssistant===`claude`?`Claude Code`:e.defaultAssistant===`antigravity`?`Antigravity`:e.defaultAssistant===`codex`?`Codex`:e.defaultAssistant===`copilot`?`GitHub Copilot`:e.defaultAssistant===`cursor`?`Cursor`:`None (Prompt me)`})}),(0,N.jsxs)(T,{alignItemWithTrigger:!1,children:[(0,N.jsx)(k,{value:``,children:`None (Prompt me)`}),(0,N.jsx)(k,{value:`claude`,children:`Claude Code`}),(0,N.jsx)(k,{value:`antigravity`,children:`Antigravity`}),(0,N.jsx)(k,{value:`codex`,children:`Codex`}),(0,N.jsx)(k,{value:`copilot`,children:`GitHub Copilot`}),(0,N.jsx)(k,{value:`cursor`,children:`Cursor`})]})]}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your preferred workspace context manager.`})]}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,N.jsx)(j,{className:`text-sm`,children:`Preferred Editor`}),(0,N.jsxs)(E,{value:e.defaultEditor||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultEditor:n||null}),children:[(0,N.jsx)(x,{"aria-label":`Preferred Editor`,children:(0,N.jsx)(O,{children:p?`${p.name} ${p.detected?`(Detected)`:`(Not found)`}`:`No preference`})}),(0,N.jsxs)(T,{alignItemWithTrigger:!1,children:[(0,N.jsx)(k,{value:``,children:`No preference`}),r.map(e=>(0,N.jsxs)(k,{value:e.command,children:[e.name,` `,e.detected?`(Detected)`:`(Not found)`]},e.command))]})]}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Shown first in the “Open with…” workspace chooser.`})]}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-4 md:col-span-2`,children:[(0,N.jsx)(P,{className:`mt-1`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Workspace Storage Settings`}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Choose where maps, plans, and knowledge files are stored.`})]}),(0,N.jsxs)(`div`,{className:`flex max-w-md flex-col gap-1.5`,children:[(0,N.jsx)(j,{htmlFor:`storageProvider`,className:`text-sm`,children:`Storage Provider`}),(0,N.jsxs)(E,{value:e.storageProvider||`local`,onValueChange:n=>{if(typeof n!=`string`)return;let r=n,a={...e,storageProvider:r},o=i.find(e=>e.name===r);o?.configFields?.length&&(a.adapterConfig||={},a.adapterConfig[r]||(a.adapterConfig[r]={}),o.configFields.forEach(e=>{a.adapterConfig[r][e.key]===void 0&&e.default!==void 0&&(a.adapterConfig[r][e.key]=e.default)})),t(a)},children:[(0,N.jsx)(x,{id:`storageProvider`,"aria-label":`Storage Provider`,children:(0,N.jsx)(O,{children:m?.displayName??`Local Workspace (Folders)`})}),(0,N.jsx)(T,{alignItemWithTrigger:!1,children:i.length>0?i.map(e=>(0,N.jsx)(k,{value:e.name,children:e.displayName},e.name)):(0,N.jsx)(k,{value:`local`,children:`Local Workspace (Folders)`})})]}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:m?.description||`Choose where to store maps, plans, and knowledge files. Centralized vault keeps repositories 100% clean and allows Obsidian integration.`})]}),(()=>{let n=e.storageProvider||`local`,r=i.find(e=>e.name===n);return r?.configFields?.length?(0,N.jsxs)(`div`,{className:`flex max-w-md flex-col gap-4 rounded-xl border border-border bg-muted/40 p-4`,children:[(0,N.jsxs)(`h4`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:[r.displayName,` Settings`]}),r.configFields.map(r=>{let i=e.adapterConfig?.[n]?.[r.key]??r.default??``,a=i=>{let a={...e.adapterConfig||{},[n]:{...e.adapterConfig?.[n]||{},[r.key]:i}};t({...e,adapterConfig:a})};return r.type===`boolean`?(0,N.jsxs)(j,{className:`flex cursor-pointer items-start gap-3 text-sm`,children:[(0,N.jsx)(V,{checked:!!i,onCheckedChange:e=>a(e)}),(0,N.jsxs)(`span`,{className:`flex flex-col`,children:[(0,N.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:r.label}),r.description&&(0,N.jsx)(`span`,{className:`mt-0.5 text-xs leading-normal text-muted-foreground`,children:r.description})]})]},r.key):(0,N.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,N.jsx)(j,{className:`text-sm`,children:r.label}),(0,N.jsx)(g,{type:r.type===`number`?`number`:`text`,value:i,onChange:e=>{let t=r.type===`number`?Number(e.target.value):e.target.value;a(t)}}),r.description&&(0,N.jsx)(`span`,{className:`text-xs leading-normal text-muted-foreground`,children:r.description})]},r.key)})]}):null})()]})]})}),(0,N.jsxs)(A,{className:`mt-6 rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-6 shadow-xs`,children:[(0,N.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:`AI Toolchain Updates`}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Monitor and update the CLI packages and assistants in your workflow.`})]}),(0,N.jsxs)(c,{variant:`outline`,size:`sm`,onClick:()=>d(!0),disabled:l,children:[l?(0,N.jsx)(D,{className:`size-3`}):(0,N.jsx)(S,{size:13}),l?`Checking...`:`Check Now`]})]}),l&&s.length===0?(0,N.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground`,children:[(0,N.jsx)(D,{className:`size-6`}),(0,N.jsx)(`span`,{className:`text-xs`,children:`Fetching registry version details...`})]}):s.length===0?(0,N.jsx)(`p`,{className:`py-4 text-xs text-muted-foreground`,children:`No toolchain information available.`}):(0,N.jsx)(`div`,{className:`space-y-4`,children:s.map(e=>(0,N.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-xl border border-border bg-muted/30 p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[e.name,(0,N.jsx)(y,{variant:e.installed?`success`:`secondary`,size:`sm`,children:e.installed?`Installed`:`Not Installed`})]}),(0,N.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,N.jsxs)(`span`,{children:[`Installed version: `,(0,N.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.currentVersion})]}),e.installed&&(0,N.jsxs)(`span`,{children:[`Latest: `,(0,N.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.latestVersion})]})]}),(0,N.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:e.updateCmd})]}),(0,N.jsx)(`div`,{className:`flex shrink-0 items-center gap-3`,children:e.updateAvailable?(0,N.jsx)(c,{size:`sm`,onClick:()=>f(e.id),disabled:u!==null,children:u===e.id?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(D,{className:`size-3`}),` Updating...`]}):`Update Tool`}):e.installed?(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsxs)(y,{variant:`success`,className:`gap-1.5`,children:[(0,N.jsx)(w,{size:12}),` Up to Date`]}),(0,N.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:u!==null,children:u===e.id?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(D,{className:`size-3`}),` Reinstalling...`]}):`Reinstall`})]}):(0,N.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:u!==null,children:u===e.id?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(D,{className:`size-3`}),` Installing...`]}):`Install CLI`})})]},e.id))})]}),(0,N.jsx)(`div`,{className:`mb-10 flex justify-end pt-4`,children:(0,N.jsxs)(c,{onClick:()=>a(e),disabled:!o,children:[(0,N.jsx)(w,{size:16}),` Save Configuration`]})})]})}export{H as SettingsPage};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-CREn1mup.js";import{n as o,t as s}from"./badge-DTBzXOWn.js";import{t as ee}from"./chevron-down-B_Mwbim8.js";import{n as c,r as te,t as l}from"./shield-check-Dd1Yv3l2.js";import{t as ne}from"./code-xml-DH-38Tt7.js";import{a as re,i as ie,n as ae,o as oe,r as se,s as u,t as ce}from"./square-check-big-Bj8Rf_dH.js";import{t as d}from"./layers-j_brOuoa.js";import{t as f}from"./trash-2-CMdv3eD3.js";import{Cn as le,En as ue,Fn as p,L as de,Nn as fe,O as pe,On as me,Q as he,R as ge,Rn as _e,Sn as ve,Z as ye,_ as m,_n as be,a as xe,ct as Se,d as Ce,et as we,f as h,ft as Te,gn as Ee,h as g,i as De,m as _,n as Oe,o as ke,p as v,pn as Ae,r as je,st as Me,t as Ne,tt as Pe,v as y,xn as b,z as Fe,zn as x}from"./index-jcGHcXQ1.js";import{t as Ie}from"./card-yrg6ov8B.js";import{t as S}from"./label-DC730X8s.js";var Le=r(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),Re=r(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),ze=r(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),C=t(e(),1),w=n(),T={"git-pull-request":ie,"flask-conical":re,package:se,database:u,"shield-check":l,terminal:b,zap:Ee,cpu:p,layers:d,boxes:x,code:ne},Be=[{label:`Blue`,value:`#3b82f6`},{label:`Green`,value:`#10b981`},{label:`Purple`,value:`#8b5cf6`},{label:`Amber`,value:`#f59e0b`},{label:`Red`,value:`#ef4444`},{label:`Cyan`,value:`#06b6d4`},{label:`Pink`,value:`#ec4899`},{label:`Emerald`,value:`#059669`}];function E({showToast:e}){let[t,n]=(0,C.useState)(`global`),[r,l]=(0,C.useState)(``),[re,ie]=(0,C.useState)({}),[se,u]=(0,C.useState)(!1),[d,p]=(0,C.useState)(null),[Ee,b]=(0,C.useState)(!1),[E,D]=(0,C.useState)(null),[Ve,O]=(0,C.useState)(!1),[k,A]=(0,C.useState)(`edit`),[j,M]=(0,C.useState)(`global`),[N,P]=(0,C.useState)(``),[He,F]=(0,C.useState)(!1),[I,L]=(0,C.useState)(null),[Ue,R]=(0,C.useState)(!1),[z,B]=(0,C.useState)(null),[We,Ge]=(0,C.useState)(null),[Ke,V]=(0,C.useState)(null),{data:H=[],isLoading:qe}=we(),{data:U=[],isLoading:Je}=Pe(t===`global`?void 0:t),{data:W=[]}=Se(),{data:Ye=[]}=Fe(),{data:G,isLoading:Xe,isError:Ze}=Me(t===`global`?``:t),[K,q]=(0,C.useState)(null),Qe=Array.from(new Set(Ye.flatMap(e=>[e.id,...e.tags||[]]).concat([`git`,`pr`,`testing`,`security`,`performance`,`database`,`ci-cd`,`frontend`,`backend`]).filter(Boolean))).slice(0,24),$e=he(),et=ge(),tt=ye(),nt=de(),J=pe(),Y=t!==`global`,X=new Set(K??G?.enabledSkills??[]),Z=!Y||!Xe&&!Ze&&!!G;(0,C.useEffect)(()=>{if(!Y){q(null);return}G&&q([...G.enabledSkills])},[Y,t,G]);let rt=e=>{ie(t=>({...t,[e]:!t[e]}))},Q=U.filter(e=>{if(!r.trim())return!0;let t=r.toLowerCase();return e.title?.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.tags?.some(e=>e.toLowerCase().includes(t))}),it=H.reduce((e,t)=>(e[t.id]=Q.filter(e=>e.category===t.id),e),{}),at=Q.filter(e=>!e.category||!H.some(t=>t.id===e.category)),ot=e=>{p(e||{name:``,description:``,icon:`boxes`,color:`#3b82f6`,custom:!0}),u(!0)},st=async()=>{if(!(!d||!d.name?.trim()))try{await $e.mutateAsync({id:d.id,name:d.name.trim(),description:d.description,icon:d.icon,color:d.color}),e?.(`Category saved successfully`,`success`),u(!1),p(null)}catch(t){e?.(`Failed to save category`,`error`),console.error(t)}},ct=(e,t)=>{t.stopPropagation(),B({type:`category`,id:e.id,title:e.name}),R(!0)},$=(e,n)=>{let r=e?.scope??(Y?`workspace`:`global`);M(r),P(Y?t:W[0]?.id||``),D(e||{name:``,title:``,category:n||(H[0]?.id??`pull-requests`),description:``,tags:[],allowedTools:[],content:`# Skill Title
|
|
2
|
+
|
|
3
|
+
Instructions and playbook for the AI assistant.
|
|
4
|
+
`,custom:!0,scope:r}),O(!!e),A(`edit`),b(!0)};(0,C.useEffect)(()=>{!N&&W.length>0&&P(W[0].id)},[W,N]);let lt=e=>{if(!E)return;let t={...E,title:e};!Ve&&!E.id&&(t.name=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)),D(t)},ut=async()=>{if(!E||!E.name?.trim()||!E.description?.trim()||!E.content?.trim()){e?.(`Skill name, trigger description, and content are required`,`error`);return}if(j===`workspace`&&!N){e?.(`Please select a target workspace for workspace-local skill`,`error`);return}try{await tt.mutateAsync({id:E.id,name:E.name.trim(),title:E.title||E.name,category:E.category||`general`,description:E.description||``,tags:E.tags||[],allowedTools:E.allowedTools||[],content:E.content,scope:j,workspaceId:j===`workspace`?N:void 0}),e?.(j===`workspace`?`Workspace skill saved successfully in .agents/skills/`:`Global skill package saved successfully`,`success`),b(!1),D(null)}catch(t){e?.(t?.message||`Failed to save skill`,`error`),console.error(t)}},dt=(e,n)=>{n.stopPropagation();let r=e.scope===`workspace`||j===`workspace`?t===`global`?N||void 0:t:void 0;B({type:`skill`,id:e.id,title:e.title||e.name,workspaceId:r}),R(!0)},ft=async()=>{if(z)try{z.type===`category`?(await et.mutateAsync(z.id),e?.(`Category deleted`,`info`)):(await nt.mutateAsync({id:z.id,workspaceId:z.workspaceId}),e?.(`Skill package deleted`,`info`)),R(!1),B(null)}catch(t){e?.(t?.message||`Failed to delete item`,`error`),console.error(t)}},pt=e=>{if(!Y||!Z||K===null)return;let t=new Set(K);t.has(e)?t.delete(e):t.add(e),q(Array.from(t))},mt=()=>{if(!E||E.custom!==!1)return;let e=`${E.name}-copy`;D({...E,id:void 0,name:e,title:`${E.title||E.name} Copy`,allowedTools:[],custom:!0,sourcePath:void 0,references:void 0,scripts:void 0}),O(!0)},ht=(e,t)=>{if(!Y||!Z||K===null)return;let n=it[e]||[],r=new Set(K);for(let e of n)t?r.add(e.id):r.delete(e.id);q(Array.from(r))},gt=async()=>{if(!(!G||K===null||!Y))try{await J.mutateAsync({workspaceId:t,expectedRevision:G.revision??0,enabledSkills:K,enabledAgents:G.enabledAgents??[],enabledCategories:H.map(e=>e.id)}),e?.(`Skill selection saved. Refresh the workspace to apply it.`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save skill selection`,`error`)}},_t=(e,t)=>{e.dataTransfer.setData(`text/plain`,t),e.dataTransfer.effectAllowed=`move`,Ge(t)},vt=(e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`,Ke!==t&&V(t)},yt=()=>{V(null)},bt=async(t,n)=>{t.preventDefault(),V(null);let r=t.dataTransfer.getData(`text/plain`)||We;if(Ge(null),!r)return;let i=U.find(e=>e.id===r);!i||!i.custom||Y||i.category===n||(await tt.mutateAsync({id:i.id,name:i.name,title:i.title,description:i.description,tags:i.tags,allowedTools:i.allowedTools,content:i.content,category:n}),e?.(`Skill re-categorized`,`success`))},xt=(e,t)=>{t.stopPropagation(),L(e),F(!0)},St=async t=>{if(!I||I.category===t){F(!1),L(null);return}await tt.mutateAsync({id:I.id,name:I.name,title:I.title,description:I.description,tags:I.tags,allowedTools:I.allowedTools,content:I.content,category:t}),e?.(`Skill moved to category`,`success`),F(!1),L(null)};return(0,w.jsxs)(`div`,{className:`flex-1 flex flex-col h-full overflow-hidden bg-background text-foreground`,children:[(0,w.jsxs)(`div`,{className:`p-6 border-b border-border flex flex-col sm:flex-row sm:items-center justify-between gap-4 bg-card/40 backdrop-blur-sm`,children:[(0,w.jsx)(`div`,{children:(0,w.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,w.jsx)(`div`,{className:`p-2 rounded-xl bg-primary/10 text-primary`,children:(0,w.jsx)(x,{className:`h-6 w-6`})}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h1`,{className:`text-xl font-bold tracking-tight`,children:`Skill Library`}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Create, organize, and assign reusable Agent Skill packages.`})]})]})}),(0,w.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,w.jsx)(a,{render:(0,w.jsx)(Ae,{to:`/agents`}),variant:`outline`,size:`sm`,children:`Codex Agents`}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2 bg-muted/50 rounded-lg px-3 py-1.5 border border-border`,children:[(0,w.jsx)(fe,{className:`h-4 w-4 text-muted-foreground`}),(0,w.jsx)(S,{htmlFor:`skill-scope`,className:`text-xs font-medium text-muted-foreground`,children:`Scope:`}),(0,w.jsxs)(`select`,{id:`skill-scope`,value:t,onChange:e=>n(e.target.value),className:`bg-transparent text-xs font-semibold focus:outline-none cursor-pointer text-foreground`,children:[(0,w.jsx)(`option`,{value:`global`,className:`bg-popover text-popover-foreground`,children:`🌐 Global Skills Catalog`}),W.map(e=>(0,w.jsxs)(`option`,{value:e.id,className:`bg-popover text-popover-foreground`,children:[`📁 `,e.id,` (`,e.branchName,`)`]},e.id))]})]}),!Y&&(0,w.jsxs)(a,{variant:`outline`,size:`sm`,onClick:()=>ot(),className:`flex items-center gap-1.5`,children:[(0,w.jsx)(me,{className:`h-3.5 w-3.5`}),(0,w.jsx)(`span`,{children:`New Category`})]}),Y&&(0,w.jsx)(a,{size:`sm`,onClick:gt,disabled:!Z||J.isPending||K===null,children:J.isPending?`Saving…`:`Save selection`}),(0,w.jsxs)(a,{variant:`default`,size:`sm`,onClick:()=>$(),className:`flex items-center gap-1.5`,children:[(0,w.jsx)(le,{className:`h-3.5 w-3.5`}),(0,w.jsx)(`span`,{children:`New Skill`})]})]})]}),(0,w.jsxs)(`div`,{className:`px-6 py-3 border-b border-border/60 bg-muted/20 flex items-center justify-between gap-4`,children:[(0,w.jsxs)(`div`,{className:`relative flex-1 max-w-md`,children:[(0,w.jsx)(ue,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,w.jsx)(o,{value:r,onChange:e=>l(e.target.value),placeholder:`Search skills by keyword, tag, or tool...`,className:`pl-9 pr-8 h-9 text-xs`}),r&&(0,w.jsx)(`button`,{onClick:()=>l(``),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,children:(0,w.jsx)(be,{className:`h-3.5 w-3.5`})})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,w.jsxs)(`span`,{children:[`Showing `,(0,w.jsx)(`strong`,{className:`text-foreground`,children:Q.length}),` of`,` `,(0,w.jsx)(`strong`,{className:`text-foreground`,children:U.length}),` skills`]}),Y&&(0,w.jsxs)(s,{variant:`secondary`,className:`text-[10px] uppercase font-mono`,children:[`Workspace Mode (`,X.size,` active)`]})]})]}),(0,w.jsx)(Te,{className:`flex-1 p-6`,children:qe||Je||Y&&Xe?(0,w.jsxs)(`div`,{className:`flex items-center justify-center p-12 gap-3 text-muted-foreground`,children:[(0,w.jsx)(Ce,{}),(0,w.jsx)(`span`,{className:`text-sm`,children:`Loading skills catalog...`})]}):Y&&Ze?(0,w.jsx)(Ne,{className:`py-12 border border-dashed rounded-xl`,children:(0,w.jsxs)(je,{children:[(0,w.jsx)(xe,{children:`Workspace resources could not be loaded`}),(0,w.jsx)(Oe,{children:`Assignment controls are disabled so an existing selection cannot be overwritten.`})]})}):Q.length===0&&r?(0,w.jsxs)(Ne,{className:`py-12 border border-dashed rounded-xl`,children:[(0,w.jsx)(De,{children:(0,w.jsx)(ue,{className:`h-8 w-8 text-muted-foreground/60`})}),(0,w.jsxs)(je,{children:[(0,w.jsx)(xe,{children:`No matching skills found`}),(0,w.jsxs)(Oe,{children:[`No skills matched your search query "`,r,`".`]})]}),(0,w.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>l(``),children:`Clear Search`})]}):(0,w.jsxs)(`div`,{className:`space-y-6 max-w-7xl mx-auto pb-12`,children:[H.map(e=>{let t=T[e.icon||`boxes`]||x,n=it[e.id]||[],r=!!re[e.id],o=Ke===e.id,c=n.length>0&&n.every(e=>X.has(e.id));return(0,w.jsxs)(`div`,{onDragOver:t=>vt(t,e.id),onDragLeave:yt,onDrop:t=>bt(t,e.id),className:i(`border rounded-xl transition-all duration-150 overflow-hidden bg-card/60`,o?`border-primary ring-2 ring-primary/20 bg-primary/5`:`border-border`),children:[(0,w.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":!r,onClick:()=>rt(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),rt(e.id))},className:`p-4 flex items-center justify-between cursor-pointer hover:bg-muted/40 transition-colors border-b border-border/40 select-none`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,w.jsx)(`div`,{className:`p-2 rounded-lg text-white shadow-sm flex items-center justify-center`,style:{backgroundColor:e.color||`#3b82f6`},children:(0,w.jsx)(t,{className:`h-4 w-4`})}),(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`h2`,{className:`font-semibold text-sm tracking-tight`,children:e.name}),(0,w.jsxs)(s,{variant:`outline`,className:`text-[10px] px-1.5 py-0`,children:[n.length,` `,n.length===1?`skill`:`skills`]}),e.isTemplate&&!e.custom&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px] px-1 py-0 uppercase`,children:`Template`})]}),e.description&&(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e.description})]})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:[Y&&n.length>0&&(0,w.jsxs)(a,{variant:`ghost`,size:`xs`,onClick:()=>ht(e.id,!c),className:`h-7 text-xs mr-2 text-muted-foreground hover:text-foreground`,title:c?`Deselect all in category`:`Select all in category`,children:[c?(0,w.jsx)(ce,{className:`h-3.5 w-3.5 mr-1 text-primary`}):(0,w.jsx)(ve,{className:`h-3.5 w-3.5 mr-1`}),(0,w.jsx)(`span`,{children:c?`Deselect All`:`Select All`})]}),!Y&&(0,w.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:()=>$(void 0,e.id),title:`Add skill to this category`,children:(0,w.jsx)(me,{className:`h-3.5 w-3.5`})}),!Y&&(0,w.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:()=>ot(e),title:`Edit category`,children:(0,w.jsx)(ae,{className:`h-3 w-3`})}),!Y&&e.custom&&(0,w.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:t=>ct(e,t),title:`Delete category`,className:`text-destructive hover:text-destructive`,children:(0,w.jsx)(f,{className:`h-3 w-3`})}),(0,w.jsx)(`div`,{className:`p-1 text-muted-foreground`,children:r?(0,w.jsx)(te,{className:`h-4 w-4`}):(0,w.jsx)(ee,{className:`h-4 w-4`})})]})]}),!r&&(0,w.jsx)(`div`,{className:`p-4 bg-background/50`,children:n.length===0?(0,w.jsxs)(`div`,{className:`border border-dashed border-border/80 rounded-lg p-6 text-center text-xs text-muted-foreground`,children:[`No skills in this category.`,!Y&&(0,w.jsxs)(w.Fragment,{children:[` `,`Drag a custom skill here, or click`,` `,(0,w.jsx)(`button`,{onClick:()=>$(void 0,e.id),className:`text-primary underline font-medium`,children:`+ Add Skill`})]})]}):(0,w.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3.5`,children:n.map(e=>{let t=X.has(e.id);return(0,w.jsxs)(Ie,{draggable:!Y&&!!e.custom,onDragStart:t=>{!Y&&e.custom&&_t(t,e.id)},onClick:()=>$(e),role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),$(e))},className:i(`group relative cursor-pointer hover:border-primary/60 transition-all p-3.5 flex flex-col justify-between select-none shadow-sm`,Y&&!t&&`opacity-60 bg-muted/20`,We===e.id&&`opacity-40 border-dashed`),children:[(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground group-hover:text-foreground cursor-grab active:cursor-grabbing`,title:`Drag to reorder or re-categorize`,"aria-label":`Drag handle`,children:[(0,w.jsx)(Re,{className:`h-3.5 w-3.5`}),(0,w.jsx)(`span`,{className:`font-mono text-xs font-bold text-foreground`,children:e.title||e.name})]}),Y?(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,w.jsx)(s,{variant:`outline`,className:i(`text-[9px] font-mono px-1 py-0.2 uppercase`,e.scope===`workspace`?`border-amber-500/40 text-amber-300 bg-amber-500/10`:`border-blue-500/40 text-blue-300 bg-blue-500/10`),children:e.scope===`workspace`?`Workspace`:`Global`}),(0,w.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),pt(e.id)},disabled:!Z||J.isPending,className:i(`h-5 px-2 rounded-md flex items-center gap-1 text-[10px] font-semibold transition-colors`,t?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:bg-muted/80`),children:[(0,w.jsx)(_e,{className:i(`h-3 w-3`,!t&&`opacity-0`)}),(0,w.jsx)(`span`,{children:t?`Enabled`:`Disabled`})]})]}):(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,w.jsx)(s,{variant:`outline`,className:i(`text-[9px] font-mono px-1 py-0.2 uppercase`,e.scope===`workspace`?`border-amber-500/40 text-amber-300 bg-amber-500/10`:`border-blue-500/40 text-blue-300 bg-blue-500/10`),children:e.scope===`workspace`?`Workspace`:`Global`}),(0,w.jsx)(s,{variant:`outline`,className:`text-[10px] font-mono`,children:e.custom?`Custom`:`Template`})]})]}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2 mb-3 leading-relaxed`,children:e.description||`No description provided.`})]}),(0,w.jsxs)(`div`,{className:`pt-2 border-t border-border/40 flex items-center justify-between gap-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap overflow-hidden`,children:[e.tags?.slice(0,3).map(e=>(0,w.jsxs)(`span`,{className:`text-[10px] font-mono bg-muted px-1.5 py-0.5 rounded text-muted-foreground`,children:[`#`,e]},e)),e.allowedTools&&e.allowedTools.length>0&&(0,w.jsxs)(`span`,{className:`text-[10px] text-muted-foreground flex items-center gap-0.5 font-mono`,children:[(0,w.jsx)(ze,{className:`h-2.5 w-2.5`}),e.allowedTools.length]})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:[!Y&&e.custom&&(0,w.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:t=>xt(e,t),title:`Move to another category`,className:`h-6 w-6 text-muted-foreground hover:text-foreground`,children:(0,w.jsx)(Le,{className:`h-3 w-3`})}),e.custom&&(0,w.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:t=>dt(e,t),title:`Delete skill`,className:`h-6 w-6 text-destructive hover:text-destructive cursor-pointer`,children:(0,w.jsx)(f,{className:`h-3 w-3`})})]})]})]},e.id)})})})]},e.id)}),at.length>0&&(0,w.jsxs)(`div`,{className:`border border-border/80 rounded-xl overflow-hidden bg-card/60`,children:[(0,w.jsx)(`div`,{className:`p-4 bg-muted/30 border-b border-border/40 flex items-center justify-between`,children:(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(x,{className:`h-4 w-4 text-muted-foreground`}),(0,w.jsx)(`h2`,{className:`font-semibold text-sm`,children:`Uncategorized Skills`}),(0,w.jsx)(s,{variant:`outline`,className:`text-[10px]`,children:at.length})]})}),(0,w.jsx)(`div`,{className:`p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3.5`,children:at.map(e=>(0,w.jsxs)(Ie,{onClick:()=>$(e),role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),$(e))},className:`p-3.5 cursor-pointer hover:border-primary/60 flex flex-col justify-between`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,w.jsx)(`div`,{className:`font-mono text-xs font-bold`,children:e.title||e.name}),(0,w.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,w.jsx)(s,{variant:`outline`,className:i(`text-[9px] font-mono px-1 py-0.2 uppercase`,e.scope===`workspace`?`border-amber-500/40 text-amber-300 bg-amber-500/10`:`border-blue-500/40 text-blue-300 bg-blue-500/10`),children:e.scope===`workspace`?`Workspace`:`Global`}),Y&&(0,w.jsx)(a,{size:`xs`,variant:X.has(e.id)?`default`:`outline`,disabled:!Z||J.isPending,onClick:t=>{t.stopPropagation(),pt(e.id)},children:X.has(e.id)?`Enabled`:`Disabled`})]})]}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:e.description})]}),(0,w.jsxs)(`div`,{className:`pt-2 mt-2 border-t border-border/40 flex items-center justify-between gap-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap overflow-hidden`,children:[e.tags&&e.tags.length>0?e.tags.slice(0,3).map(e=>(0,w.jsxs)(`span`,{className:`text-[10px] font-mono bg-muted px-1.5 py-0.5 rounded text-muted-foreground`,children:[`#`,e]},e)):(0,w.jsx)(`span`,{className:`text-[10px] text-muted-foreground italic`,children:`No tags`}),e.allowedTools&&e.allowedTools.length>0&&(0,w.jsxs)(`span`,{className:`text-[10px] text-muted-foreground flex items-center gap-0.5 font-mono`,children:[(0,w.jsx)(ze,{className:`h-2.5 w-2.5`}),e.allowedTools.length]})]}),e.custom&&(0,w.jsx)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:(0,w.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:t=>dt(e,t),title:`Delete skill`,className:`h-6 w-6 text-destructive hover:text-destructive cursor-pointer`,children:(0,w.jsx)(f,{className:`h-3 w-3`})})})]})]},e.id))})]})]})}),(0,w.jsx)(h,{open:se,onOpenChange:u,children:(0,w.jsxs)(m,{className:`sm:max-w-lg`,children:[(0,w.jsxs)(g,{children:[(0,w.jsx)(y,{children:d?.id?`Edit Skill Category`:`Create Skill Category`}),(0,w.jsx)(v,{children:`Categories group related procedural skills and agent tools into clean visual boxes.`})]}),(0,w.jsxs)(`div`,{className:`space-y-4 py-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(S,{htmlFor:`cat-name`,className:`text-xs font-medium`,children:`Category Name`}),(0,w.jsx)(o,{id:`cat-name`,value:d?.name||``,onChange:e=>p(t=>t?{...t,name:e.target.value}:null),placeholder:`e.g. Pull Requests & Review`,className:`mt-1 text-xs`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(S,{htmlFor:`cat-desc`,className:`text-xs font-medium`,children:`Description`}),(0,w.jsx)(o,{id:`cat-desc`,value:d?.description||``,onChange:e=>p(t=>t?{...t,description:e.target.value}:null),placeholder:`Brief summary of what skills belong in this box...`,className:`mt-1 text-xs`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(S,{className:`text-xs font-medium`,children:`Icon`}),(0,w.jsx)(`div`,{className:`grid grid-cols-6 gap-2 mt-1.5`,children:Object.keys(T).map(e=>{let t=T[e],n=(d?.icon||`boxes`)===e;return(0,w.jsx)(`button`,{type:`button`,onClick:()=>p(t=>t?{...t,icon:e}:null),className:i(`p-2.5 rounded-lg border flex items-center justify-center transition-colors`,n?`border-primary bg-primary/10 text-primary`:`border-border hover:bg-muted text-muted-foreground`),children:(0,w.jsx)(t,{className:`h-4 w-4`})},e)})})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(S,{className:`text-xs font-medium`,children:`Color Accent`}),(0,w.jsx)(`div`,{className:`flex items-center gap-2 mt-1.5 flex-wrap`,children:Be.map(e=>{let t=d?.color===e.value;return(0,w.jsx)(`button`,{type:`button`,"aria-label":`Select color ${e.label}`,onClick:()=>p(t=>t?{...t,color:e.value}:null),className:i(`w-7 h-7 rounded-full transition-transform flex items-center justify-center shadow-sm`,t?`scale-110 ring-2 ring-primary ring-offset-2`:`hover:scale-105`),style:{backgroundColor:e.value},children:t&&(0,w.jsx)(_e,{className:`h-3.5 w-3.5 text-white`})},e.value)})})]})]}),(0,w.jsxs)(_,{children:[(0,w.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>u(!1),children:`Cancel`}),(0,w.jsx)(a,{variant:`default`,size:`sm`,onClick:st,disabled:!d?.name?.trim(),children:`Save Category`})]})]})}),(0,w.jsx)(h,{open:Ee,onOpenChange:b,children:(0,w.jsxs)(m,{className:`max-w-[96vw] sm:max-w-5xl lg:max-w-6xl xl:max-w-7xl h-[90vh] max-h-[92vh] flex flex-col p-6`,children:[(0,w.jsx)(g,{className:`pb-3 border-b border-border/70 shrink-0`,children:(0,w.jsxs)(`div`,{className:`flex items-center justify-between pr-8`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(y,{className:`text-base font-bold flex items-center gap-2`,children:[(0,w.jsx)(le,{className:`h-4 w-4 text-primary`}),(0,w.jsx)(`span`,{children:E?.id?`Edit Skill Package`:`Create New Skill`})]}),(0,w.jsx)(v,{className:`text-xs text-muted-foreground mt-0.5`,children:`Configure SKILL.md metadata triggers and markdown playbook instructions.`})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-1 bg-muted/60 p-1 rounded-lg border border-border text-xs`,children:[(0,w.jsxs)(`button`,{type:`button`,onClick:()=>A(`edit`),className:i(`px-3 py-1.5 rounded-md flex items-center gap-1.5 font-medium transition-colors cursor-pointer`,k===`edit`?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,w.jsx)(c,{className:`h-3.5 w-3.5`}),(0,w.jsx)(`span`,{children:`Edit`})]}),(0,w.jsxs)(`button`,{type:`button`,onClick:()=>A(`preview`),className:i(`px-3 py-1.5 rounded-md flex items-center gap-1.5 font-medium transition-colors cursor-pointer`,k===`preview`?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,w.jsx)(oe,{className:`h-3.5 w-3.5`}),(0,w.jsx)(`span`,{children:`Preview`})]})]})]})}),(0,w.jsxs)(`div`,{className:`flex-1 min-h-0 py-4 flex flex-col lg:flex-row gap-6 overflow-hidden`,children:[(0,w.jsxs)(`div`,{className:`lg:w-[420px] xl:w-[460px] shrink-0 flex flex-col gap-4 overflow-y-auto pr-2 pb-2`,children:[(0,w.jsxs)(`div`,{className:`space-y-3`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(S,{htmlFor:`skill-title`,className:`text-xs font-medium`,children:`Display Title`}),(0,w.jsx)(o,{id:`skill-title`,value:E?.title||``,onChange:e=>lt(e.target.value),placeholder:`e.g. Pull Request Reviewer`,className:`mt-1 text-xs`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(S,{htmlFor:`skill-name`,className:`text-xs font-medium`,children:`Identifier (Slug)`}),(0,w.jsx)(o,{id:`skill-name`,value:E?.name||``,disabled:!!E?.id,onChange:e=>{O(!0),D(t=>t?{...t,name:e.target.value}:null)},placeholder:`e.g. pr-review-toolkit`,className:`mt-1 text-xs font-mono`})]})]}),(0,w.jsxs)(`div`,{className:`p-3 rounded-lg border border-border/80 bg-muted/20 space-y-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsxs)(S,{className:`text-xs font-semibold text-foreground flex items-center gap-1.5`,children:[(0,w.jsx)(x,{className:`h-3.5 w-3.5 text-primary`}),(0,w.jsx)(`span`,{children:`Skill Scope`})]}),(0,w.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:j===`global`?`Machine-wide catalog`:`Project-specific (.agents/skills/)`})]}),(0,w.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,w.jsx)(`button`,{type:`button`,onClick:()=>M(`global`),className:i(`flex items-center justify-center gap-2 p-2 rounded-lg border text-xs font-medium transition-all cursor-pointer`,j===`global`?`border-blue-500/50 bg-blue-500/15 text-blue-300 font-semibold shadow-xs`:`border-border/60 bg-card/60 text-muted-foreground hover:bg-muted/60 hover:text-foreground`),children:(0,w.jsx)(`span`,{children:`🌐 Global Catalog`})}),(0,w.jsx)(`button`,{type:`button`,onClick:()=>M(`workspace`),className:i(`flex items-center justify-center gap-2 p-2 rounded-lg border text-xs font-medium transition-all cursor-pointer`,j===`workspace`?`border-amber-500/50 bg-amber-500/15 text-amber-300 font-semibold shadow-xs`:`border-border/60 bg-card/60 text-muted-foreground hover:bg-muted/60 hover:text-foreground`),children:(0,w.jsx)(`span`,{children:`📁 Workspace-Local`})})]}),j===`workspace`&&(0,w.jsxs)(`div`,{className:`pt-1`,children:[(0,w.jsx)(S,{htmlFor:`target-ws`,className:`text-[11px] font-medium text-muted-foreground`,children:`Target Workspace:`}),W.length>0?(0,w.jsx)(`select`,{id:`target-ws`,value:N,onChange:e=>P(e.target.value),className:`mt-1 w-full bg-background border border-border rounded-md px-3 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-primary text-foreground`,children:W.map(e=>(0,w.jsxs)(`option`,{value:e.id,children:[`📁 `,e.id,` (`,e.branchName,`)`]},e.id))}):(0,w.jsx)(`div`,{className:`mt-1 text-xs text-destructive italic`,children:`No active workspaces found. Please create a workspace first.`})]})]}),(0,w.jsxs)(`div`,{className:`space-y-3`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(S,{htmlFor:`skill-cat`,className:`text-xs font-medium`,children:`Category Box`}),(0,w.jsx)(`select`,{id:`skill-cat`,value:E?.category||``,onChange:e=>D(t=>t?{...t,category:e.target.value}:null),className:`mt-1 w-full bg-background border border-border rounded-md px-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-primary`,children:H.map(e=>(0,w.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsx)(S,{htmlFor:`skill-tags`,className:`text-xs font-medium`,children:`Tags & Domain Categories`}),(0,w.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`Click chips below to toggle`})]}),(0,w.jsx)(o,{id:`skill-tags`,value:E?.tags?.join(`, `)||``,onChange:e=>D(t=>t?{...t,tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)}:null),placeholder:`e.g. nexusflow, core, cli, testing`,className:`mt-1 text-xs font-mono`})]}),Qe.length>0&&(0,w.jsxs)(`div`,{className:`space-y-1`,children:[(0,w.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Quick Tag Assignment:`}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1 max-h-24 overflow-y-auto pr-1`,children:Qe.map(e=>{let t=E?.tags?.includes(e);return(0,w.jsxs)(`button`,{type:`button`,onClick:()=>{D(n=>{if(!n)return null;let r=n.tags||[],i=t?r.filter(t=>t!==e):[...r,e];return{...n,tags:i}})},className:i(`px-2 py-0.5 rounded-md text-[11px] font-mono transition-colors cursor-pointer border`,t?`bg-primary/20 text-primary border-primary/40 font-semibold shadow-xs`:`bg-muted/40 text-muted-foreground border-border/60 hover:bg-muted hover:text-foreground`),children:[`#`,e]},e)})})]})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(S,{htmlFor:`skill-desc`,className:`text-xs font-medium`,children:`Trigger Description (for AI Autonomous Discovery)`}),(0,w.jsx)(ke,{id:`skill-desc`,rows:3,value:E?.description||``,onChange:e=>D(t=>t?{...t,description:e.target.value}:null),placeholder:`e.g. Use when reviewing PR diffs or when user asks for a PR audit...`,className:`mt-1 text-xs leading-relaxed resize-none`})]})]}),(0,w.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col min-h-[380px] lg:min-h-0 border-t lg:border-t-0 lg:border-l border-border/70 pt-4 lg:pt-0 lg:pl-6`,children:k===`edit`?(0,w.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 h-full`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between pb-2 shrink-0`,children:[(0,w.jsxs)(S,{htmlFor:`skill-content`,className:`text-xs font-semibold flex items-center gap-1.5`,children:[(0,w.jsx)(ne,{className:`h-3.5 w-3.5 text-primary`}),(0,w.jsx)(`span`,{children:`Playbook Instructions (Markdown)`})]}),(0,w.jsxs)(`span`,{className:`text-[10px] text-muted-foreground font-mono`,children:[(E?.content||``).split(`
|
|
5
|
+
`).length,` lines · `,(E?.content||``).length,` characters`]})]}),(0,w.jsxs)(`p`,{className:`text-xs text-muted-foreground mb-2 leading-relaxed`,children:[`Frontmatter (`,(0,w.jsx)(`code`,{className:`font-mono text-[11px] bg-muted/60 px-1 py-0.5 rounded text-foreground`,children:`name`}),`,`,` `,(0,w.jsx)(`code`,{className:`font-mono text-[11px] bg-muted/60 px-1 py-0.5 rounded text-foreground`,children:`description`}),`,`,` `,(0,w.jsx)(`code`,{className:`font-mono text-[11px] bg-muted/60 px-1 py-0.5 rounded text-foreground`,children:`tags`}),`) is managed in the Metadata panel on the left and auto-injected into`,` `,(0,w.jsx)(`code`,{className:`font-mono text-[11px] bg-muted/60 px-1 py-0.5 rounded text-foreground`,children:`SKILL.md`}),` on save.`]}),(0,w.jsx)(ke,{id:`skill-content`,value:E?.content||``,onChange:e=>D(t=>t?{...t,content:e.target.value}:null),placeholder:`# Playbook Title
|
|
6
|
+
|
|
7
|
+
Detailed instructions for the AI assistant...`,className:`flex-1 w-full min-h-[360px] lg:min-h-full font-mono text-xs leading-relaxed resize-none focus:ring-1 focus:ring-primary`})]}):(0,w.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 h-full`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between pb-2 shrink-0`,children:[(0,w.jsxs)(`span`,{className:`text-xs font-semibold flex items-center gap-1.5 text-foreground`,children:[(0,w.jsx)(oe,{className:`h-3.5 w-3.5 text-primary`}),(0,w.jsx)(`span`,{children:`Documentation Preview`})]}),(0,w.jsx)(s,{variant:`outline`,className:`text-[10px] font-mono`,children:`SKILL.md`})]}),(0,w.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-5 border rounded-lg bg-card/40 prose prose-sm dark:prose-invert max-w-none`,children:[(0,w.jsxs)(`div`,{className:`mb-4 pb-3 border-b border-border/70`,children:[(0,w.jsx)(`h2`,{className:`text-lg font-bold m-0 text-foreground`,children:E?.title||E?.name}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground m-0 mt-1`,children:E?.description}),E?.tags&&E.tags.length>0&&(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2.5`,children:E.tags.map(e=>(0,w.jsxs)(`span`,{className:`px-2 py-0.5 rounded bg-muted text-[11px] font-mono text-muted-foreground`,children:[`#`,e]},e))})]}),(0,w.jsx)(`pre`,{className:`text-xs whitespace-pre-wrap font-sans bg-transparent p-0 border-0 leading-relaxed`,children:E?.content||`*(No playbook markdown provided)*`})]})]})})]}),(0,w.jsxs)(_,{className:`mt-4 pt-3 border-t flex items-center justify-between sm:justify-between w-full`,children:[(0,w.jsx)(`div`,{children:E?.id&&E?.custom&&(0,w.jsxs)(a,{type:`button`,variant:`outline`,size:`sm`,onClick:e=>{let t=E;b(!1),dt(t,e)},className:`text-destructive hover:bg-destructive/10 border-destructive/30 text-xs gap-1.5`,children:[(0,w.jsx)(f,{className:`h-3.5 w-3.5`}),(0,w.jsx)(`span`,{children:`Delete Skill`})]})}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>b(!1),children:`Cancel`}),(0,w.jsx)(a,{variant:`default`,size:`sm`,onClick:E?.custom===!1?mt:ut,disabled:!E?.name?.trim()||!E?.description?.trim()||!E?.content?.trim(),children:E?.custom===!1?`Create editable copy`:`Save Skill`})]})]})]})}),(0,w.jsx)(h,{open:He,onOpenChange:F,children:(0,w.jsxs)(m,{className:`sm:max-w-md`,children:[(0,w.jsxs)(g,{children:[(0,w.jsx)(y,{children:`Move Skill to Category`}),(0,w.jsxs)(v,{children:[`Select the destination category box for "`,I?.title||I?.name,`".`]})]}),(0,w.jsx)(`div`,{className:`space-y-2 py-2`,children:H.map(e=>{let t=T[e.icon||`boxes`]||x,n=I?.category===e.id;return(0,w.jsxs)(`button`,{type:`button`,onClick:()=>St(e.id),className:i(`w-full p-3 rounded-lg border text-left flex items-center justify-between transition-colors`,n?`border-primary bg-primary/10`:`border-border hover:bg-muted/50 text-foreground`),children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,w.jsx)(`div`,{className:`p-1.5 rounded text-white flex items-center justify-center`,style:{backgroundColor:e.color||`#3b82f6`},children:(0,w.jsx)(t,{className:`h-4 w-4`})}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`div`,{className:`font-semibold text-xs`,children:e.name}),e.description&&(0,w.jsx)(`div`,{className:`text-[11px] text-muted-foreground line-clamp-1`,children:e.description})]})]}),n&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[10px]`,children:`Current`})]},e.id)})}),(0,w.jsx)(_,{children:(0,w.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>F(!1),children:`Cancel`})})]})}),(0,w.jsx)(h,{open:Ue,onOpenChange:R,children:(0,w.jsxs)(m,{className:`sm:max-w-md`,children:[(0,w.jsxs)(g,{children:[(0,w.jsxs)(y,{className:`text-destructive`,children:[`Delete `,z?.type===`category`?`Category`:z?.workspaceId?`Workspace Skill`:`Global Skill`]}),(0,w.jsxs)(v,{children:[`Are you sure you want to delete "`,z?.title,`"`,z?.workspaceId?` from workspace "${z.workspaceId}"`:``,`? This action cannot be undone.`]})]}),(0,w.jsxs)(_,{className:`mt-4`,children:[(0,w.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>R(!1),children:`Cancel`}),(0,w.jsx)(a,{variant:`destructive`,size:`sm`,onClick:ft,children:`Delete Permanently`})]})]})})]})}export{E as SkillsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-CREn1mup.js";import{n as o,t as s}from"./badge-DTBzXOWn.js";import{t as c}from"./chevron-down-B_Mwbim8.js";import{t as l}from"./code-xml-DH-38Tt7.js";import{n as u,r as d,t as f}from"./ScaffoldRepoInline-Asao9IqG.js";import{t as p}from"./git-branch-Ce0I2663.js";import{n as m,r as h,t as g}from"./vsc-Dn-smJni.js";import{s as _}from"./brand-hHByyyzq.js";import{A as v,Bn as ee,C as y,Cn as te,D as ne,Dn as re,E as ie,Gn as b,In as x,J as ae,K as S,Ln as oe,N as se,Nn as ce,Pn as C,Rn as le,S as ue,U as de,W as fe,_ as pe,a as w,an as T,at as me,b as he,c as ge,cn as _e,d as E,dn as ve,f as ye,g as be,gn as D,h as xe,hn as Se,i as Ce,it as O,k as we,ln as Te,m as Ee,mn as De,n as Oe,nn as ke,o as Ae,on as je,p as Me,pn as Ne,q as Pe,r as k,rn as Fe,rt as Ie,s as A,sn as j,t as Le,tt as Re,u as ze,un as Be,ut as Ve,v as He,w as Ue,x as M,xn as N,z as We,zn as Ge}from"./index-jcGHcXQ1.js";var Ke=r(`app-window`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),qe=r(`orbit`,[[`path`,{d:`M20.341 6.484A10 10 0 0 1 10.266 21.85`,key:`1enhxb`}],[`path`,{d:`M3.659 17.516A10 10 0 0 1 13.74 2.152`,key:`1crzgf`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`circle`,{cx:`19`,cy:`5`,r:`2`,key:`mhkx31`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,key:`v8kfzx`}]]),Je=r(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),P=t(e(),1),F={status:`idle`,steps:[]};function Ye(){let[e,t]=(0,P.useState)(F),n=(0,P.useRef)(null),r=(0,P.useRef)(null),i=b(),a=(0,P.useCallback)(()=>{n.current?.close(),n.current=null,r.current=null},[]);return(0,P.useEffect)(()=>a,[a]),{progress:e,start:(0,P.useCallback)(e=>{if(n.current&&r.current===e)return;a(),r.current=e,t({status:`running`,steps:[]});let o=new EventSource(`/api/workspace/create-stream/${encodeURIComponent(e)}`);n.current=o;let s=0;o.addEventListener(`progress`,r=>{if(n.current===o){s=0;try{let n=JSON.parse(r.data);t({status:n.status===`completed`||n.status===`failed`?n.status:`running`,steps:n.steps??[],error:n.error,workspacePath:n.workspacePath,workspaceId:n.feature?.id??e}),(n.status===`completed`||n.status===`failed`)&&(a(),i.invalidateQueries({queryKey:[`workspaces`]}),i.invalidateQueries({queryKey:[`workspaces-status`]}))}catch{}}}),o.onerror=()=>{n.current===o&&(s+=1,!(o.readyState!==EventSource.CLOSED&&s<5)&&(t(e=>e.status===`running`?{...e,status:`unavailable`,error:e.error??`Unable to reconnect to the creation stream. The workspace may still have been created.`}:e),a(),i.invalidateQueries({queryKey:[`workspaces`]}),i.invalidateQueries({queryKey:[`workspaces-status`]})))}},[a,i]),reset:(0,P.useCallback)(()=>{a(),t(F)},[a])}}var I=n(),L=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,R={codex:ve,claude:ke,vscode:g,"vscode-insiders":m,cursor:Fe,antigravity:qe,powershell:N,cmd:N,terminal:N,intellij:T,webstorm:_e,pycharm:je,sublime:j,zed:Be,windsurf:Te},Xe={codex:`bg-foreground text-background`,claude:`bg-[#D97757] text-white`,vscode:`bg-[#007ACC] text-white`,"vscode-insiders":`bg-[#24A148] text-white`,cursor:`bg-zinc-950 text-white dark:bg-white dark:text-zinc-950`,antigravity:`bg-violet-600 text-white`,powershell:`bg-sky-700 text-white`,cmd:`bg-zinc-800 text-amber-400`,terminal:`bg-zinc-800 text-emerald-400`,intellij:`bg-fuchsia-600 text-white`,webstorm:`bg-cyan-600 text-white`,pycharm:`bg-lime-600 text-zinc-950`,sublime:`bg-orange-500 text-white`,zed:`bg-red-600 text-white`,windsurf:`bg-teal-600 text-white`};function z({icon:e}){let t=R[e]??l;return(0,I.jsx)(`span`,{className:i(`grid size-10 shrink-0 place-items-center rounded-xl shadow-sm`,Xe[e]),"aria-hidden":`true`,children:(0,I.jsx)(t,{className:`size-5`})})}function B({target:e,busy:t,launching:n,preferred:r,onLaunch:a}){return(0,I.jsxs)(`button`,{type:`button`,disabled:!e.available||t,onClick:()=>a(e),"aria-label":`Open workspace in ${e.name}`,className:i(`flex min-h-20 w-full items-center gap-3 rounded-xl border p-3 text-left outline-none transition-colors`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,`cursor-pointer border-border bg-card hover:border-primary/40 hover:bg-accent/60`),children:[(0,I.jsx)(z,{icon:e.icon}),(0,I.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.name}),n?(0,I.jsx)(E,{className:`size-4`}):r?(0,I.jsx)(s,{size:`sm`,variant:`secondary`,children:`Preferred`}):null]}),(0,I.jsx)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})}function Ze({session:e,busy:t,launching:n,onResume:r}){let a=e.desktopHandoff.method===`direct`,o=a?`Codex Desktop`:`Claude Desktop`;return(0,I.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>r(e),"aria-label":a?`Resume ${e.title} in Codex Desktop`:`Move ${e.title} to Claude Desktop`,className:i(`flex min-h-20 w-full cursor-pointer items-center gap-3 rounded-xl border border-primary/25 bg-primary/5 p-3 text-left outline-none transition-colors`,`hover:border-primary/45 hover:bg-primary/10 focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-65`),children:[(0,I.jsx)(z,{icon:a?`codex`:`claude`}),(0,I.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`truncate font-medium text-foreground`,title:e.title,children:e.title}),n?(0,I.jsx)(E,{className:`size-4 shrink-0`}):a?(0,I.jsx)(C,{className:`size-4 shrink-0 text-muted-foreground`}):(0,I.jsx)(x,{className:`size-4 shrink-0 text-muted-foreground`})]}),(0,I.jsxs)(`span`,{className:`mt-0.5 block text-xs leading-relaxed text-muted-foreground`,children:[a?`Open this existing task in ${o}`:`Resume in Claude Code, then type /desktop`,` · `,new Date(e.updatedAt).toLocaleString()]})]})]})}function Qe({workspaceId:e,workspacePath:t,isVsCode:n=!1,className:r}){let[i,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(null),[l,u]=(0,P.useState)(null),[d,f]=(0,P.useState)(null),p=(0,P.useRef)(!1),m=O(),h=me(e,i),g=we().data?.config,v=m.data?.filter(e=>e.available)??[],ee=v.filter(e=>e.kind===`ai-app`),y=g?.defaultEditor?{code:`vscode`,"code-insiders":`vscode-insiders`,cursor:`cursor`,antigravity:`antigravity`,idea:`intellij`,webstorm:`webstorm`,charm:`pycharm`,subl:`sublime`,zed:`zed`,windsurf:`windsurf`}[g.defaultEditor]:void 0,te=v.filter(e=>e.kind===`editor`).toSorted((e,t)=>Number(t.id===y)-Number(e.id===y)),ne=new Set(v.map(e=>e.id)),ie=(h.data??[]).filter(e=>e.desktopHandoff&&ne.has(e.desktopHandoff.targetId)),b=n||v.length>0,x=async t=>{if(!p.current){p.current=!0,u(null),f(null),c(t.id);try{await Ve(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.id})}),o(!1)}catch(e){u(e instanceof Error?e.message:String(e)),await m.refetch()}finally{c(null),p.current=!1}}},ae=async t=>{if(!(p.current||!t.desktopHandoff||!L.test(t.id))){p.current=!0,u(null),f(null),c(`session:${t.id}`);try{if(t.desktopHandoff.method===`guided`){await A(`claude --resume ${t.id}`),f(`Claude resume command copied. With a Claude subscription login, run it in this workspace, then type /desktop in Claude to move the session into Claude Desktop.`);return}await Ve(`/api/workspace/${encodeURIComponent(e)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.desktopHandoff.targetId,action:`resume`,sessionId:t.id})}),o(!1)}catch(e){u(e instanceof Error?e.message:String(e)),await Promise.all([m.refetch(),h.refetch()])}finally{c(null),p.current=!1}}},S=()=>{window.parent.postMessage({type:`openWorkspaceFolder`,workspacePath:t},`*`),o(!1)},oe=()=>Promise.all([m.refetch(),h.refetch()]),se=m.isFetching||h.isFetching;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(a,{variant:`outline`,className:r,onClick:()=>o(!0),children:[(0,I.jsx)(Je,{}),`Open with…`]}),(0,I.jsx)(ye,{open:i,onOpenChange:e=>{o(e),e||(u(null),f(null))},children:(0,I.jsxs)(pe,{className:`max-w-2xl`,"aria-busy":s!==null,children:[(0,I.jsxs)(xe,{children:[(0,I.jsx)(He,{children:`Open workspace with…`}),(0,I.jsx)(Me,{children:`Continue recent AI work or start in an installed coding app or editor. AI apps may use their own online services.`})]}),(0,I.jsxs)(be,{className:`space-y-5`,children:[l&&(0,I.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive-foreground`,children:l}),d&&(0,I.jsx)(`div`,{role:`status`,className:`rounded-lg border border-primary/25 bg-primary/5 px-3 py-2 text-sm text-foreground`,children:d}),h.isLoading?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,I.jsx)(E,{className:`size-4`}),` Checking recent sessions…`]}):ie.length>0?(0,I.jsxs)(`section`,{"aria-labelledby":`recent-sessions-heading`,children:[(0,I.jsx)(`h3`,{id:`recent-sessions-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Continue recent work`}),(0,I.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:ie.map(e=>(0,I.jsx)(Ze,{session:e,busy:s!==null,launching:s===`session:${e.id}`,onResume:ae},`${e.assistant}:${e.id}`))})]}):h.isError?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Recent sessions could not be checked. Starting new work is still available.`}):null,n&&(0,I.jsxs)(`section`,{"aria-labelledby":`current-editor-heading`,children:[(0,I.jsx)(`h3`,{id:`current-editor-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Current window`}),(0,I.jsxs)(`button`,{type:`button`,disabled:s!==null,onClick:S,className:`flex min-h-20 w-full cursor-pointer items-center gap-3 rounded-xl border border-primary/30 bg-primary/5 p-3 text-left outline-none transition-colors hover:bg-primary/10 focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-65`,children:[(0,I.jsx)(z,{icon:`vscode`}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`span`,{className:`block font-medium`,children:`Current VS Code window`}),(0,I.jsxs)(`span`,{className:`mt-0.5 block text-xs text-muted-foreground`,children:[`Open through the installed `,_,` extension.`]})]})]})]}),m.isLoading?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 py-8 text-sm text-muted-foreground`,"aria-live":`polite`,children:[(0,I.jsx)(E,{}),` Checking apps on this computer…`]}):m.isError?(0,I.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/10 p-3 text-sm text-destructive-foreground`,children:m.error instanceof Error?m.error.message:`Could not check available apps.`}):(0,I.jsxs)(I.Fragment,{children:[ee.length>0&&(0,I.jsxs)(`section`,{"aria-labelledby":`ai-apps-heading`,children:[(0,I.jsx)(`h3`,{id:`ai-apps-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`AI coding apps`}),(0,I.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:ee.map(e=>(0,I.jsx)(B,{target:e,busy:s!==null,launching:s===e.id,onLaunch:x},e.id))})]}),te.length>0&&(0,I.jsxs)(`section`,{"aria-labelledby":`editors-heading`,children:[(0,I.jsx)(`h3`,{id:`editors-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Code editors`}),(0,I.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:te.map(e=>(0,I.jsx)(B,{target:e,busy:s!==null,launching:s===e.id,preferred:e.id===y,onLaunch:x},e.id))})]}),!b&&(0,I.jsx)(Le,{className:`rounded-xl border border-dashed py-8 md:p-8`,children:(0,I.jsxs)(k,{children:[(0,I.jsx)(Ce,{variant:`icon`,children:(0,I.jsx)(Ke,{})}),(0,I.jsx)(w,{className:`text-base`,children:`No compatible apps detected`}),(0,I.jsx)(Oe,{children:`Install a supported coding app or add its command to PATH, then recheck.`})]})})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-border pt-3`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,"aria-live":`polite`,children:se?`Checking recent sessions and apps…`:`Can’t find your app or session? Recheck detection.`}),(0,I.jsxs)(a,{size:`sm`,variant:`ghost`,onClick:()=>void oe(),disabled:se||s!==null,children:[(0,I.jsx)(re,{className:se?`animate-spin`:``}),`Recheck`]})]})]})]})})]})}var $e=`__ad-hoc__`,et=new URLSearchParams(window.location.search).get(`env`)===`vscode`,tt=[{value:`quick`,title:`Small task`,body:`Make and verify a focused change.`},{value:`feature`,title:`Standard change`,body:`Plan, implement, verify, and review a feature.`},{value:`epic`,title:`Epic`,body:`Track a larger change through dependent milestones.`}],nt=[{value:`in-place`,icon:D,title:`In-place`,body:`Work directly in the source repos. No branches or worktrees — fastest start.`},{value:`worktree`,icon:p,title:`Isolated worktrees`,body:`A feature branch and worktree per repo. Your source checkouts stay untouched.`}];function rt({repo:e,value:t,onChange:n,enabled:r}){let i=S(e.path,r),a=(0,P.useMemo)(()=>[...new Set([...i.data?.local??[],...i.data?.remote??[]])],[i.data]),s=`branches-${e.path.replace(/[^a-zA-Z0-9]/g,`-`)}`;return(0,I.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`w-40 shrink-0 truncate text-xs`,children:e.name}),(0,I.jsx)(o,{list:s,value:t,onChange:e=>n(e.target.value),placeholder:`existing branch (must exist)`,className:`h-7 font-mono text-xs`}),(0,I.jsx)(`datalist`,{id:s,children:a.map(e=>(0,I.jsx)(`option`,{value:e},e))})]})}function it({step:e}){return(0,I.jsxs)(`li`,{className:`flex items-center gap-3 py-2`,children:[(0,I.jsx)(`span`,{className:i(`grid size-5 shrink-0 place-items-center rounded-full border`,e.status===`completed`&&`border-success bg-success/15 text-success-foreground`,e.status===`running`&&`border-primary text-primary`,e.status===`failed`&&`border-destructive bg-destructive/15 text-destructive-foreground`,e.status===`pending`&&`border-border text-muted-foreground`),children:e.status===`completed`?(0,I.jsx)(le,{className:`size-3`}):e.status===`running`?(0,I.jsx)(E,{className:`size-3`}):e.status===`failed`?(0,I.jsx)(oe,{className:`size-3`}):null}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:e.name}),(0,I.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.message})]})]})}function V(){let e=De(),[t,n]=Se(),r=de(),l=Pe(),m=ne(),g=Ie(),_=Re(),b=ie(),x=We(),S=se(),{progress:oe,start:C,reset:le}=Ye(),w=t.get(`job`),[T,me]=(0,P.useState)(t.get(`project`)??$e),[_e,ve]=(0,P.useState)(`feature`),[D,Ce]=(0,P.useState)(`feature`),[O,we]=(0,P.useState)(`in-place`),[Te,Oe]=(0,P.useState)(``),[ke,je]=(0,P.useState)(``),[k,Fe]=(0,P.useState)(``),[A,j]=(0,P.useState)([]),[Le,Be]=(0,P.useState)([]),[N,Ke]=(0,P.useState)(!1),[qe,Je]=(0,P.useState)([]),[F,L]=(0,P.useState)([]),[R,Xe]=(0,P.useState)([]),[z,B]=(0,P.useState)(``),[Ze,V]=(0,P.useState)(``),[at,ot]=(0,P.useState)(!1),[st,ct]=(0,P.useState)(null),[H,lt]=(0,P.useState)({}),[ut,dt]=(0,P.useState)(!1),[ft,U]=(0,P.useState)(null),[pt,W]=(0,P.useState)(!1),[G,mt]=(0,P.useState)(``),[K,ht]=(0,P.useState)(``),[gt,_t]=(0,P.useState)(``),[vt,yt]=(0,P.useState)(`vertical`),[bt,xt]=(0,P.useState)(``),[St,Ct]=(0,P.useState)(!1),wt=v(),Tt=async()=>{if(!(!G.trim()||!K.trim())){Ct(!0);try{let e=K.trim().toLowerCase();await wt.mutateAsync({id:e,name:G.trim(),description:gt.trim()||G.trim(),categoryType:vt,verifyCommand:bt.trim()||void 0,tags:[e,...G.trim().toLowerCase().split(/\s+/).filter(Boolean)]}),j(t=>t.includes(e)?t:[...t,e]),W(!1),mt(``),ht(``),_t(``),xt(``)}catch{}finally{Ct(!1)}}},Et=(0,P.useMemo)(()=>{if(!k.trim()||k.trim().length<3)return[];let e=k.toLowerCase(),t=[];for(let n of x.data??[])A.includes(n.id)||[n.id,n.name,...n.tags??[]].some(t=>t&&e.includes(t.toLowerCase()))&&t.push({id:n.id,title:`#${n.id}`,type:`tag`});for(let n of _.data??[])F.includes(n.id)||[n.id,n.name,n.title,...n.tags??[]].some(t=>t&&t.length>2&&e.includes(t.toLowerCase()))&&t.push({id:n.id,title:n.title||n.name,type:`skill`});return t.slice(0,6)},[k,x.data,_.data,A,F]);(0,P.useEffect)(()=>{w?C(w):le()},[w,le,C]);let Dt=()=>{le(),n(e=>{let t=new URLSearchParams(e);return t.delete(`job`),t},{replace:!0})},Ot=()=>{let e=new URL(window.location.href);e.hash=`#/new`,window.location.replace(e.toString())},kt=()=>{w&&C(w)},At=(0,P.useRef)(!1);(0,P.useEffect)(()=>{!At.current&&m.data&&(At.current=!0,Je(m.data.filter(e=>e.detected).map(e=>e.name)))},[m.data]);let q=(0,P.useMemo)(()=>(r.data??[]).find(e=>e.id===T)??null,[r.data,T]),J=(0,P.useMemo)(()=>q?q.repos.map(e=>({name:ge(e.path),path:e.path,defaultBranch:e.defaultBranch})):(l.data??[]).filter(e=>Le.includes(e.path)),[q,l.data,Le]),[jt,Mt]=(0,P.useState)(!0),[Nt,Y]=(0,P.useState)(null),X=fe(),Pt=(0,P.useMemo)(()=>J.map(e=>({path:e.path,branch:H[e.path]||e.defaultBranch})),[J,H]),Z=ae(Pt,Pt.length>0),Ft=(0,P.useMemo)(()=>{let e={};for(let t of Z.data??[])e[t.repoPath]=t;return e},[Z.data]),It=(0,P.useMemo)(()=>(Z.data??[]).filter(e=>e.status===`behind`),[Z.data]),Lt=async()=>{Y(null);try{let e=(await X.mutateAsync({repos:It.map(e=>({path:e.repoPath,branch:e.branch}))})).results.filter(e=>e.status===`dirty`||e.status===`diverged`);e.length>0&&Y(`Could not update ${e.length} repo(s): ${e.map(e=>`${e.repoName} (${e.message})`).join(`; `)}`)}catch(e){Y(e instanceof Error?e.message:String(e))}},Rt=async(e,t)=>{Y(null);try{let n=(await X.mutateAsync({path:e,branch:t})).results.find(e=>!e.success);n&&Y(`Could not update ${n.repoName}: ${n.message}`)}catch(e){Y(e instanceof Error?e.message:String(e))}},Q=O===`in-place`,zt=(Q?ke.trim().length>0:Te.trim().length>0)&&J.length>0&&k.trim().length>0,Bt=e=>{B(e),ct(null);let t=(g.data??[]).find(t=>t.id===e);V(t?.content??``)},Vt=async()=>{if(!k.trim()){U(`Describe what you are building first — the suggestion is based on it.`);return}U(null),ot(!0);try{let e=await Ve(`/api/workspace/suggest-workflow`,{method:`POST`,body:JSON.stringify({description:k,repos:J})});B(e.suggestedWorkflowId),V(e.customInstructions),ct(e.difficulty)}catch(e){U(e instanceof Error?e.message:String(e))}finally{ot(!1)}},Ht=(0,P.useRef)(!1),Ut=async()=>{if(Ht.current||S.isPending||!zt)return;Ht.current=!0,U(null);let e={flowType:D,workType:_e,mode:O,projectId:q?.id,...Q?{name:ke.trim()}:{branchName:Te.trim()},description:k.trim(),repos:J.map(e=>({...e,existingBranch:!Q&&H[e.path]?.trim()?H[e.path].trim():void 0})),assistants:qe,enabledSkills:F.length>0?F:void 0,enabledAgents:R.length>0?R:void 0,domainPacks:A.length>0?A:void 0,teamworkInstructions:Ze.trim()||void 0,autoUpdateBase:jt};try{let{jobId:t}=await S.mutateAsync(e);C(t),n(e=>{let n=new URLSearchParams(e);return n.set(`job`,t),n},{replace:!0})}catch(e){U(e instanceof Error?e.message:String(e))}finally{Ht.current=!1}},$=oe.status===`idle`&&w?{status:`running`,steps:[]}:oe;if($.status!==`idle`){let t=$.steps.find(e=>e.status===`failed`);return(0,I.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,I.jsx)(`h1`,{className:`text-xl font-semibold`,children:$.status===`running`?`Setting up your workspace…`:$.status===`completed`?`Workspace ready`:$.status===`failed`?`Workspace creation failed`:`Unable to reconnect to workspace setup`}),(0,I.jsx)(`ul`,{"aria-live":`polite`,"aria-relevant":`additions text`,className:`mt-6 divide-y divide-border rounded-xl border border-border bg-card px-4`,children:$.steps.length>0?$.steps.map(e=>(0,I.jsx)(it,{step:e},e.id)):(0,I.jsxs)(`li`,{className:`flex items-center gap-3 py-3.5`,children:[(0,I.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary`,children:(0,I.jsx)(E,{className:`size-3`})}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Connecting to workspace setup…`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Waiting for creation progress…`})]})]})}),($.status===`failed`||$.status===`unavailable`)&&(0,I.jsx)(`p`,{className:`mt-4 text-sm text-destructive-foreground`,children:t?.message??$.error??`Something went wrong.`}),$.status===`completed`&&$.workspacePath&&(0,I.jsx)(`p`,{className:`mt-4 truncate font-mono text-xs text-muted-foreground`,children:$.workspacePath}),ft&&(0,I.jsx)(`p`,{className:`mt-2 text-sm text-destructive-foreground`,children:ft}),(0,I.jsxs)(`div`,{"data-testid":`workspace-ready-actions`,className:`mt-6 flex min-w-0 flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[$.status===`completed`&&$.workspaceId&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(a,{className:`w-full min-w-0 whitespace-normal sm:w-auto`,onClick:()=>e(`/workspaces/${encodeURIComponent($.workspaceId)}`),children:`Open workspace`}),$.workspacePath&&(0,I.jsx)(Qe,{workspaceId:$.workspaceId,workspacePath:$.workspacePath,isVsCode:et,className:`w-full min-w-0 whitespace-normal sm:w-auto`})]}),$.status===`failed`&&(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(a,{variant:`default`,onClick:Dt,children:`Back to form (edit & retry)`}),(0,I.jsx)(a,{variant:`outline`,onClick:Ot,children:`Start over (clear form)`})]}),$.status===`unavailable`&&(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(a,{variant:`default`,onClick:kt,children:`Try reconnecting`}),(0,I.jsx)(a,{variant:`outline`,onClick:Dt,children:`Back to form`})]}),$.status===`running`&&(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This can take a moment for large repositories.`}),(0,I.jsx)(a,{variant:`outline`,size:`sm`,onClick:Dt,children:`Return to form`})]})]})]})}return(0,I.jsxs)(`div`,{className:`mx-auto max-w-xl animate-fade-in`,children:[(0,I.jsxs)(`header`,{className:`mb-6`,children:[(0,I.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Start work`}),(0,I.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Pick where the work happens and how isolated it should be.`})]}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`Project`}),(0,I.jsxs)(he,{value:T,onValueChange:e=>typeof e==`string`&&me(e),children:[(0,I.jsx)(y,{className:`w-full`,"aria-label":`Project`,children:(0,I.jsx)(Ue,{children:q?q.name:`Ad-hoc — pick repositories manually`})}),(0,I.jsxs)(ue,{alignItemWithTrigger:!1,children:[(r.data??[]).map(e=>(0,I.jsx)(M,{value:e.id,children:e.name},e.id)),(0,I.jsx)(M,{value:$e,children:`Ad-hoc — pick repositories manually`})]})]}),q?(0,I.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:q.repos.map(e=>(0,I.jsx)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:e.path},e.path))}):(0,I.jsxs)(`div`,{className:`mt-2`,children:[(0,I.jsx)(u,{repos:l.data??[],selectedPaths:Le,onToggle:e=>Be(t=>t.includes(e.path)?t.filter(t=>t!==e.path):[...t,e.path]),loading:l.isLoading,freshnessMap:Ft}),(0,I.jsx)(f,{onCreated:e=>Be(t=>[...t,e.path])})]}),J.length>0&&(0,I.jsxs)(`div`,{className:`mt-3 rounded-lg border border-border bg-card p-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1.5`,children:[(0,I.jsx)(p,{className:`size-3.5`}),`Base repository sync (`,J.length,`)`]}),(0,I.jsx)(`div`,{className:`flex items-center gap-2`,children:It.length>0&&(0,I.jsxs)(a,{size:`sm`,variant:`outline`,className:`h-6 text-xs px-2`,onClick:Lt,disabled:X.isPending,children:[X.isPending?(0,I.jsx)(E,{className:`size-3 mr-1`}):(0,I.jsx)(re,{className:`size-3 mr-1`}),`Pull `,It.length,` stale `,It.length===1?`repo`:`repos`]})})]}),(0,I.jsx)(`ul`,{className:`mt-2 divide-y divide-border text-xs`,children:J.map(e=>{let t=Ft[e.path],n=t?.status===`behind`;return(0,I.jsxs)(`li`,{className:`flex items-center justify-between py-1.5`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 truncate pr-2`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,I.jsxs)(`span`,{className:`ml-2 font-mono text-[11px] text-muted-foreground`,children:[`(`,H[e.path]||e.defaultBranch,`)`]})]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[Z.isLoading?(0,I.jsx)(`span`,{className:`text-muted-foreground text-[11px]`,children:`Checking…`}):t?(0,I.jsx)(ze,{tone:t.status===`up-to-date`?`success`:t.status===`behind`?`warning`:t.status===`diverged`?`danger`:t.status===`ahead`?`info`:`neutral`,title:t.message,children:t.status===`behind`?`↓ ${t.behind} behind ${t.trackingBranch}`:t.status===`up-to-date`?`Up to date`:t.status===`diverged`?`Diverged`:t.status===`ahead`?`↑ ${t.ahead} ahead`:`Local`}):null,n&&(0,I.jsx)(a,{size:`sm`,variant:`ghost`,className:`h-5 px-1.5 text-[11px] text-amber-500 hover:text-amber-600`,onClick:()=>Rt(e.path,H[e.path]||e.defaultBranch),disabled:X.isPending,children:`Pull`})]})]},e.path)})}),Nt&&(0,I.jsx)(`p`,{className:`mt-2 text-xs text-amber-500`,children:Nt})]}),(r.data??[]).length===0&&!r.isLoading&&(0,I.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Tip: `,(0,I.jsx)(Ne,{to:`/projects`,className:`text-primary hover:underline`,children:`register a project`}),` to skip repo picking next time.`]})]}),(0,I.jsxs)(`fieldset`,{children:[(0,I.jsx)(`legend`,{className:`mb-1.5 text-sm font-medium`,children:`What kind of work is this?`}),(0,I.jsxs)(`label`,{className:`mb-3 block text-sm`,children:[`Work type`,(0,I.jsxs)(`select`,{"aria-label":`Work type`,className:`mt-1 block w-full rounded-md border border-border bg-background p-2`,value:_e,onChange:e=>ve(e.target.value),children:[(0,I.jsx)(`option`,{value:`bug`,children:`Bug fix`}),(0,I.jsx)(`option`,{value:`feature`,children:`Feature`}),(0,I.jsx)(`option`,{value:`performance`,children:`Performance`}),(0,I.jsx)(`option`,{value:`refactor`,children:`Refactor`}),(0,I.jsx)(`option`,{value:`rewrite`,children:`Rewrite`})]})]}),(0,I.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Choose a starting size and milestone preset. You can edit milestones in Plan.`}),(0,I.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:tt.map(e=>(0,I.jsxs)(`label`,{className:i(`cursor-pointer rounded-xl border p-4 focus-within:ring-2 focus-within:ring-ring`,D===e.value?`border-primary bg-primary/5`:`border-border bg-card`),children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[(0,I.jsx)(`input`,{type:`radio`,name:`flowType`,value:e.value,checked:D===e.value,onChange:()=>Ce(e.value),"aria-label":e.title,"aria-describedby":`flow-${e.value}-description`,className:`accent-primary`}),e.title]}),(0,I.jsx)(`p`,{id:`flow-${e.value}-description`,className:`mt-2 text-xs text-muted-foreground`,children:e.body})]},e.value))})]}),(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`How do you want to work?`}),(0,I.jsx)(`div`,{role:`radiogroup`,"aria-label":`Work mode`,className:`grid gap-3 sm:grid-cols-2`,onKeyDown:e=>{if([`ArrowRight`,`ArrowDown`,`ArrowLeft`,`ArrowUp`].includes(e.key)){e.preventDefault();let t=O===`in-place`?`worktree`:`in-place`;we(t),document.getElementById(`mode-${t}`)?.focus()}},children:nt.map(e=>(0,I.jsxs)(`button`,{id:`mode-${e.value}`,type:`button`,role:`radio`,"aria-checked":O===e.value,tabIndex:O===e.value?0:-1,onClick:()=>we(e.value),className:i(`cursor-pointer rounded-xl border p-4 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,O===e.value?`border-primary bg-primary/5 ring-1 ring-primary`:`border-border bg-card hover:border-foreground/20`),children:[(0,I.jsx)(e.icon,{className:i(`size-4`,O===e.value?`text-primary`:`text-muted-foreground`)}),(0,I.jsx)(`p`,{className:`mt-2 text-sm font-semibold`,children:e.title}),(0,I.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.body})]},e.value))})]}),(0,I.jsxs)(`section`,{children:[Q?(0,I.jsxs)(`label`,{className:`block`,children:[(0,I.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Workspace name`}),(0,I.jsx)(o,{value:ke,onChange:e=>je(e.target.value),placeholder:`e.g. Fix invoice rounding`})]}):(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,I.jsxs)(`label`,{className:`block`,children:[(0,I.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Feature branch`}),(0,I.jsx)(o,{value:Te,onChange:e=>Oe(e.target.value),placeholder:`e.g. feature/invoice-rounding`,className:`font-mono`})]}),J.length>0&&(0,I.jsxs)(`details`,{className:`rounded-lg border border-border px-3 py-2`,onToggle:e=>dt(e.target.open),children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Use an existing branch for specific repos (optional)`}),(0,I.jsx)(`div`,{className:`mt-2 flex flex-col gap-2`,children:J.map(e=>(0,I.jsx)(rt,{repo:e,enabled:ut,value:H[e.path]??``,onChange:t=>lt(n=>({...n,[e.path]:t}))},e.path))})]})]}),(0,I.jsxs)(`label`,{className:`mt-3 flex items-center gap-2 cursor-pointer text-xs text-muted-foreground`,children:[(0,I.jsx)(d,{checked:jt,onCheckedChange:e=>Mt(!!e),"aria-label":`Fast-forward clean base branches before creating workspace`}),(0,I.jsx)(`span`,{children:`Fast-forward clean base branches to latest remote commits`})]})]}),(0,I.jsxs)(`section`,{children:[(0,I.jsxs)(`label`,{className:`block`,children:[(0,I.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`What are you building?`}),(0,I.jsx)(Ae,{value:k,onChange:e=>Fe(e.target.value),placeholder:`A short description — your AI assistant reads this to plan the work.`,rows:3})]}),Et.length>0&&(0,I.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 p-2 rounded-lg bg-primary/5 border border-primary/20 text-xs`,children:[(0,I.jsxs)(`span`,{className:`text-primary font-medium flex items-center gap-1 text-[11px]`,children:[(0,I.jsx)(te,{className:`size-3`}),` Suggested for this task:`]}),Et.map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>{e.type===`tag`?j(t=>t.includes(e.id)?t:[...t,e.id]):L(t=>t.includes(e.id)?t:[...t,e.id])},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-card border border-primary/30 text-[11px] font-mono hover:bg-primary/10 transition-colors text-foreground`,children:[(0,I.jsxs)(`span`,{children:[`+`,e.title]}),(0,I.jsx)(s,{variant:`outline`,className:`text-[8px] px-0.5 py-0 uppercase`,children:e.type})]},`${e.type}-${e.id}`))]})]}),(0,I.jsxs)(`section`,{children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,I.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,I.jsx)(h,{className:`size-4 text-primary`}),`Category & Domain Tags`,A.length>0&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[`(`,A.length,` attached)`]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground hidden sm:inline`,children:`Tags attach curated skill bundles & standards`}),(0,I.jsxs)(a,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>W(!0),className:`h-6 text-xs gap-1 px-2 border-primary/40 text-primary hover:bg-primary/10`,children:[(0,I.jsx)(h,{className:`size-3`}),`+ New Tag`]})]})]}),(0,I.jsx)(`div`,{className:`space-y-2`,children:x.isLoading?(0,I.jsxs)(`div`,{className:`flex items-center justify-center p-4 gap-2 text-xs text-muted-foreground rounded-lg border border-border`,children:[(0,I.jsx)(E,{className:`size-3`}),`Loading category tags...`]}):(x.data??[]).length===0?(0,I.jsx)(`div`,{className:`p-3.5 border border-border rounded-xl bg-card/40 space-y-2`,children:(0,I.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-xs font-semibold text-foreground`,children:`No domain tags defined yet`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:`Tags are optional bundles that package skills, rules, and test commands for a domain. You can create a tag now, or select skills directly below.`})]}),(0,I.jsxs)(a,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>W(!0),className:`text-xs gap-1.5 h-7 shrink-0 text-primary border-primary/40 hover:bg-primary/10`,children:[(0,I.jsx)(h,{className:`size-3 text-primary`}),`+ Create Tag`]})]})}):(0,I.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:(x.data??[]).map(e=>{let t=A.includes(e.id),n=e.skills?.length??0,r=e.rules?.length??0;return(0,I.jsxs)(`div`,{onClick:()=>j(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),className:i(`flex flex-col justify-between p-3 rounded-xl border cursor-pointer transition-colors text-left outline-none select-none`,t?`border-primary bg-primary/5 ring-1 ring-primary/40`:`border-border bg-card hover:border-foreground/20`),children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(d,{checked:t,onCheckedChange:()=>j(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),"aria-label":`Attach ${e.name}`}),(0,I.jsxs)(`span`,{className:`font-medium text-xs font-mono`,children:[`#`,e.id]})]}),e.categoryType&&(0,I.jsx)(s,{variant:`outline`,className:`text-[10px] px-1 py-0 shrink-0 capitalize`,children:e.categoryType===`trait`?`trait`:`domain`})]}),(0,I.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground line-clamp-2`,children:e.description||e.name}),(n>0||r>0)&&(0,I.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border/50 flex flex-wrap gap-1 items-center text-[10px]`,children:[n>0&&(0,I.jsxs)(`span`,{className:`text-primary font-mono flex items-center gap-1`,children:[(0,I.jsx)(Ge,{className:`size-2.5`}),e.skills.join(`, `)]}),r>0&&(0,I.jsxs)(`span`,{className:`text-muted-foreground ml-auto font-mono`,children:[r,` rule`,r===1?``:`s`]})]})]},e.id)})})}),(0,I.jsxs)(`div`,{className:`mt-4 pt-4 border-t border-border/60`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,I.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,I.jsx)(Ge,{className:`size-4 text-primary`}),`Direct Agent Skills`,F.length>0&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[`(`,F.length,` selected)`]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(_.data??[]).length>0&&(0,I.jsx)(a,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>{let e=(_.data??[]).map(e=>e.id);L(F.length===e.length?[]:e)},className:`text-xs text-muted-foreground hover:text-foreground h-6 px-2`,children:F.length===(_.data??[]).length&&(_.data??[]).length>0?`Deselect All`:`Select All`}),(0,I.jsx)(Ne,{to:`/skills`,className:`text-xs text-primary hover:underline flex items-center gap-1`,children:`Skill Library →`})]})]}),_.isLoading?(0,I.jsxs)(`div`,{className:`flex items-center justify-center p-3 gap-2 text-xs text-muted-foreground rounded-lg border border-border`,children:[(0,I.jsx)(E,{className:`size-3`}),`Loading skills...`]}):(_.data??[]).length===0?(0,I.jsx)(`div`,{className:`p-3 border border-dashed border-border rounded-lg bg-card/20 text-center`,children:(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`No skills in your catalog yet. You can create skills in the`,` `,(0,I.jsx)(Ne,{to:`/skills`,className:`text-primary underline`,children:`Skill Library`}),` `,`or let AI agents create them during development.`]})}):(0,I.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:(_.data??[]).map(e=>{let t=F.includes(e.id);return(0,I.jsxs)(`div`,{onClick:()=>L(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),className:i(`flex items-center justify-between gap-2 p-2.5 rounded-lg border cursor-pointer transition-colors select-none text-left`,t?`border-primary/60 bg-primary/5 ring-1 ring-primary/40 text-foreground`:`border-border bg-card hover:border-foreground/20 text-muted-foreground`),children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,I.jsx)(d,{checked:t,onCheckedChange:()=>L(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id]),"aria-label":`Select ${e.title||e.name}`}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`font-mono text-xs font-medium truncate text-foreground`,children:e.title||e.name}),e.description&&(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground line-clamp-1`,children:e.description})]})]}),e.category&&(0,I.jsx)(s,{variant:`outline`,className:`text-[9px] px-1 py-0 shrink-0 capitalize`,children:e.category})]},e.id)})})]})]}),(0,I.jsxs)(`section`,{className:`rounded-xl border border-border`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>Ke(e=>!e),className:`flex w-full items-center justify-between px-4 py-3 text-sm font-medium hover:bg-accent`,"aria-expanded":N,children:[`Advanced`,(0,I.jsx)(c,{className:i(`size-4 text-muted-foreground transition-transform`,N&&`rotate-180`)})]}),N&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border p-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`span`,{className:`mb-1.5 block text-sm font-medium`,children:`AI assistants`}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:(m.data??[]).map(e=>(0,I.jsxs)(`label`,{className:i(`flex cursor-pointer items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-sm`,!e.detected&&`opacity-50`),children:[(0,I.jsx)(d,{checked:qe.includes(e.name),onCheckedChange:()=>Je(t=>t.includes(e.name)?t.filter(t=>t!==e.name):[...t,e.name])}),e.displayName]},e.name))})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium`,children:`Teamwork strategy`}),(0,I.jsxs)(a,{size:`xs`,variant:`outline`,onClick:Vt,disabled:at,children:[at?(0,I.jsx)(E,{}):(0,I.jsx)(te,{}),`Suggest with AI`]})]}),(0,I.jsxs)(he,{value:z,onValueChange:e=>typeof e==`string`&&Bt(e),children:[(0,I.jsx)(y,{className:`w-full`,"aria-label":`Teamwork strategy`,children:(0,I.jsx)(Ue,{children:(g.data??[]).find(e=>e.id===z)?.name??`None`})}),(0,I.jsxs)(ue,{alignItemWithTrigger:!1,children:[(0,I.jsx)(M,{value:``,children:`None`}),(g.data??[]).map(e=>(0,I.jsx)(M,{value:e.id,children:e.name},e.id))]})]}),st&&(0,I.jsxs)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[`AI classified this task as `,(0,I.jsx)(`span`,{className:`font-medium`,children:st}),` difficulty.`]}),(0,I.jsx)(Ae,{value:Ze,onChange:e=>V(e.target.value),placeholder:`Cooperation instructions for the agent team (editable — prefilled by the strategy pick or AI suggestion).`,rows:4,className:`mt-2 font-mono text-xs`})]}),(b.data??[]).length>0&&(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:(0,I.jsxs)(`span`,{className:`text-sm font-medium flex items-center gap-1.5`,children:[(0,I.jsx)(ee,{className:`size-4 text-purple-400`}),`Codex Native Agents (`,R.length,` selected)`]})}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(b.data??[]).map(e=>{let t=R.includes(e.id);return(0,I.jsxs)(`label`,{className:i(`flex cursor-pointer items-center gap-2 rounded-lg border border-border px-3 py-1.5 text-xs`,t?`border-purple-500/60 bg-purple-500/5 text-foreground`:`text-muted-foreground hover:bg-muted/50`),children:[(0,I.jsx)(d,{checked:t,onCheckedChange:()=>Xe(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}),(0,I.jsx)(`span`,{className:`font-mono`,children:e.name})]},e.id)})})]})]})]}),ft&&(0,I.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:ft}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-border pt-4`,children:[(0,I.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(ce,{className:`size-3.5`}),J.length,` repositor`,J.length===1?`y`:`ies`,` selected`]}),(0,I.jsxs)(a,{onClick:Ut,disabled:!zt||S.isPending,children:[S.isPending?(0,I.jsx)(E,{}):null,Q?`Start working`:`Create workspace`]})]})]}),(0,I.jsx)(ye,{open:pt,onOpenChange:W,children:(0,I.jsxs)(pe,{className:`max-w-md`,children:[(0,I.jsxs)(xe,{children:[(0,I.jsxs)(He,{className:`flex items-center gap-2`,children:[(0,I.jsx)(h,{size:16,className:`text-primary`}),(0,I.jsx)(`span`,{children:`Create Category Tag`})]}),(0,I.jsx)(Me,{children:`Tags bundle reusable skills, rules, and test verification commands for a domain.`})]}),(0,I.jsxs)(be,{className:`space-y-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Tag Name`}),(0,I.jsx)(o,{value:G,onChange:e=>{mt(e.target.value),(!K||K===G.toLowerCase().replace(/[^a-z0-9]+/g,`-`).slice(0,30))&&ht(e.target.value.toLowerCase().replace(/[^a-z0-9]+/g,`-`).slice(0,30))},placeholder:`e.g. Invoicing & Billing`,size:`sm`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Tag ID / Slug`}),(0,I.jsx)(o,{value:K,onChange:e=>ht(e.target.value),placeholder:`e.g. billing`,size:`sm`,className:`font-mono`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Type`}),(0,I.jsxs)(`select`,{value:vt,onChange:e=>yt(e.target.value),className:`w-full h-7.5 px-2 text-xs rounded-md border border-border bg-background text-foreground`,children:[(0,I.jsx)(`option`,{value:`vertical`,children:`Vertical Subsystem`}),(0,I.jsx)(`option`,{value:`trait`,children:`Horizontal Trait`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Description (optional)`}),(0,I.jsx)(o,{value:gt,onChange:e=>_t(e.target.value),placeholder:`What this domain covers...`,size:`sm`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`label`,{className:`text-xs font-semibold text-foreground`,children:`Verification Command (optional)`}),(0,I.jsx)(o,{value:bt,onChange:e=>xt(e.target.value),placeholder:`e.g. npm test -- billing`,size:`sm`,className:`font-mono`})]})]}),(0,I.jsxs)(Ee,{className:`flex items-center justify-end gap-2 pt-2 border-t`,children:[(0,I.jsx)(a,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>W(!1),children:`Cancel`}),(0,I.jsx)(a,{type:`button`,size:`sm`,disabled:!G.trim()||!K.trim()||St,onClick:()=>void Tt(),children:St?`Creating...`:`Create & Attach Tag`})]})]})})]})}export{V as StartWorkPage};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{_ as e,g as t,h as n,m as r,t as i}from"./button-CREn1mup.js";import{n as a,t as o}from"./badge-
|
|
1
|
+
import{_ as e,g as t,h as n,m as r,t as i}from"./button-CREn1mup.js";import{n as a,t as o}from"./badge-DTBzXOWn.js";import{t as s}from"./circle-plus--zM3-3r3.js";import{t as c}from"./trash-2-CMdv3eD3.js";import{C as l,Fn as u,S as d,a as f,b as p,d as m,ft as h,i as g,n as _,o as v,r as y,t as b,w as x,x as S}from"./index-jcGHcXQ1.js";import{t as C}from"./card-yrg6ov8B.js";import{t as w}from"./label-DC730X8s.js";var T=n(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),E=n(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]);e();var D=t();function O(e){let{workflowTemplates:t,isEditingTemplate:n,setIsEditingTemplate:O,mgtTemplateName:k,setMgtTemplateName:A,mgtTemplateContent:j,setMgtTemplateContent:M,selectedMgtTemplateId:N,setSelectedMgtTemplateId:P,analysisResult:F,setAnalysisResult:I,showToast:L,handleAnalyzeTemplate:R,handleSaveTemplate:z,handleDeleteTemplate:B,aiAssistants:V,analyzingTemplate:H,mgtAnalysisComment:U,setMgtAnalysisComment:W,suggestedImprovement:G,setSuggestedImprovement:K,savingTemplate:q,deletingTemplate:J,selectedInspectAssistant:Y,setSelectedInspectAssistant:X}=e,Z=t.find(e=>e.id===N),Q=V.filter(e=>e.detected&&e.command),$=Q.find(e=>e.name===Y)?.displayName??`No Harness Found`;return(0,D.jsxs)(`div`,{className:`mx-auto max-w-6xl animate-fade-in`,children:[(0,D.jsxs)(`header`,{className:`mb-6 border-b border-border/70 pb-4`,children:[(0,D.jsx)(`h1`,{className:`text-xl font-bold tracking-tight text-foreground`,children:`Team Collaboration Strategies`}),(0,D.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Predefine and review custom teamwork orchestration templates injected into workspaces' AGENTS.md files.`})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 text-left lg:grid-cols-12`,children:[(0,D.jsx)(`div`,{className:`flex flex-col gap-4 lg:col-span-4`,children:(0,D.jsxs)(C,{className:`rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-5 shadow-xs`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,D.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Strategies`}),(0,D.jsxs)(i,{size:`sm`,onClick:()=>{O(!0),A(`New Strategy`),M(`# New Strategy
|
|
2
2
|
|
|
3
|
-
Write custom teamwork rules here for subagent orchestration...`),P(null),I(null)},children:[(0,D.jsx)(s,{size:12}),` Add New`]})]}),(0,D.jsx)(
|
|
3
|
+
Write custom teamwork rules here for subagent orchestration...`),P(null),I(null)},children:[(0,D.jsx)(s,{size:12}),` Add New`]})]}),(0,D.jsx)(h,{className:`mt-4 max-h-[480px]`,children:(0,D.jsx)(`div`,{className:`flex flex-col gap-2 pr-1`,children:t.map(e=>{let t=N===e.id;return(0,D.jsxs)(`div`,{className:r(`flex cursor-pointer flex-col gap-1.5 rounded-lg border p-3 text-left transition-colors`,t?`border-primary bg-primary/5 ring-1 ring-primary/40`:`border-border bg-card hover:border-foreground/15 hover:bg-muted/40`),onClick:()=>{P(e.id),O(!1),A(e.name),M(e.content),I(null)},children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,D.jsx)(`span`,{className:r(`text-xs font-semibold`,t?`text-primary`:`text-foreground`),children:e.name}),(0,D.jsx)(o,{variant:e.custom?`info`:`secondary`,size:`sm`,className:`font-mono uppercase`,children:e.custom?`Custom`:`Built-in`})]}),(0,D.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:e.description})]},e.id)})})})]})}),(0,D.jsx)(`div`,{className:`flex flex-col gap-6 lg:col-span-8`,children:N||n?(0,D.jsxs)(C,{className:`flex flex-col gap-5 rounded-xl p-6 shadow-sm`,children:[(0,D.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,D.jsx)(`div`,{className:`flex-1`,children:n?(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(w,{className:`text-sm`,children:`Strategy Name`}),(0,D.jsx)(a,{type:`text`,value:k,onChange:e=>A(e.target.value),placeholder:`e.g. Test-Driven Development`})]}):(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`h2`,{className:`flex items-center gap-2 text-lg font-semibold text-foreground`,children:[k,Z?.custom&&(0,D.jsx)(o,{variant:`info`,className:`font-mono uppercase`,children:`Custom Template`})]}),(0,D.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:Z?.description||`Custom strategy template.`})]})}),(0,D.jsx)(`div`,{className:`flex gap-2`,children:n?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(i,{variant:`outline`,size:`sm`,onClick:()=>{if(N){let e=t.find(e=>e.id===N);e&&(A(e.name),M(e.content)),O(!1)}else if(O(!1),t.length>0){let e=t[0];P(e.id),A(e.name),M(e.content)}},children:`Cancel`}),(0,D.jsx)(i,{size:`sm`,onClick:z,disabled:q,children:q?`Saving...`:`Save Strategy`})]}):(0,D.jsxs)(D.Fragment,{children:[Z?.custom&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(i,{variant:`outline`,size:`sm`,onClick:()=>O(!0),children:`Edit`}),(0,D.jsxs)(i,{variant:`destructive`,size:`sm`,onClick:()=>B(N),disabled:J,children:[(0,D.jsx)(c,{size:12}),` Delete`]})]}),!Z?.custom&&(0,D.jsx)(i,{variant:`outline`,size:`sm`,onClick:()=>{O(!0),A(`${k} Copy`),M(j),P(null),I(null)},children:`Duplicate & Customize`})]})})]}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(w,{className:`text-sm`,children:`Guidelines Markdown`}),(0,D.jsx)(v,{className:`min-h-[250px] font-mono text-xs leading-relaxed`,value:j,onChange:e=>M(e.target.value),disabled:!n,placeholder:`Write cooperation guidelines in Markdown...`})]}),!n&&N&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-4 border-t border-border pt-5`,children:[(0,D.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,D.jsxs)(`div`,{className:`flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center`,children:[(0,D.jsxs)(`div`,{className:`flex flex-col`,children:[(0,D.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold text-foreground`,children:[(0,D.jsx)(u,{size:14,className:`text-muted-foreground`}),` AI Strategy Analysis`]}),(0,D.jsx)(`span`,{className:`mt-0.5 text-xs text-muted-foreground`,children:`Select an AI assistant harness installed on your system to inspect these guidelines.`})]}),(0,D.jsxs)(`div`,{className:`flex w-full items-center justify-end gap-3 sm:w-auto`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Harness:`}),(0,D.jsxs)(p,{value:Y,disabled:Q.length===0,onValueChange:e=>typeof e==`string`&&X(e),children:[(0,D.jsx)(l,{size:`sm`,className:`w-44`,"aria-label":`Harness`,children:(0,D.jsx)(x,{children:$})}),(0,D.jsx)(d,{alignItemWithTrigger:!1,children:Q.length>0?Q.map(e=>(0,D.jsx)(S,{value:e.name,children:e.displayName},e.name)):(0,D.jsx)(S,{value:``,children:`No Harness Found`})})]})]}),(0,D.jsx)(i,{size:`sm`,onClick:()=>R(N,j,Y),disabled:H||Q.length===0,children:H?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(m,{className:`size-3`}),` Inspecting...`]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(u,{size:12}),` Inspect Strategy`]})})]})]}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(w,{className:`text-left text-xs uppercase tracking-wider text-muted-foreground`,children:`Evaluation Focus / Instructions (Optional)`}),(0,D.jsx)(v,{className:`min-h-[60px] text-xs leading-relaxed`,value:U,onChange:e=>W(e.target.value),placeholder:`e.g. Focus on checking if timeouts are handled well, check subagent roles coordination...`,disabled:H})]})]}),F&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,D.jsx)(h,{className:`max-h-[300px] rounded-xl border border-border bg-muted/40 p-5`,children:(0,D.jsx)(`div`,{className:`select-text whitespace-pre-wrap text-left text-xs leading-relaxed text-foreground`,children:F})}),G&&(0,D.jsx)(`div`,{className:`flex justify-end`,children:(0,D.jsxs)(i,{size:`sm`,onClick:()=>{M(G),O(!0),K(null),I(null),L(`Suggested improvements applied! Click Save to persist changes.`,`success`)},children:[(0,D.jsx)(T,{size:14}),` Apply Suggested Improvements`]})})]})]})]}):(0,D.jsx)(`div`,{className:`flex min-h-[400px] flex-col items-center justify-center`,children:(0,D.jsx)(b,{className:`w-full max-w-md border border-dashed border-border`,children:(0,D.jsxs)(y,{children:[(0,D.jsx)(g,{variant:`icon`,children:(0,D.jsx)(E,{})}),(0,D.jsx)(f,{children:`No strategy template selected`}),(0,D.jsx)(_,{children:`Select a template from the list to view, edit, or analyze it, or add a new custom teamwork workflow template.`})]})})})})]})]})}export{O as StrategiesPage};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,h as r,t as i}from"./button-CREn1mup.js";import{n as a,t as o}from"./badge-DTBzXOWn.js";import{n as ee,r as te,t as ne}from"./shield-check-Dd1Yv3l2.js";import{t as s}from"./git-branch-Ce0I2663.js";import{t as c}from"./trash-2-CMdv3eD3.js";import{i as l,n as re,r as u,t as ie}from"./tabs-DfbdubLX.js";import{C as ae,S as d,d as oe,i as se,t as f,x as ce}from"./brand-hHByyyzq.js";import{C as p,Ct as m,Dn as h,Et as g,Rn as le,S as _,Sn as ue,St as de,Tn as v,Tt as fe,Un as y,Wn as pe,b,d as x,kn as S,lt as C,o as w,s as me,ut as T,w as E,wt as he,x as D,yn as ge}from"./index-jcGHcXQ1.js";import{a as O,i as k,n as A,r as j,t as M}from"./card-yrg6ov8B.js";import{t as N}from"./label-DC730X8s.js";import{n as _e,r as ve,t as ye}from"./alert-QnMXzwpU.js";var be=r(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),P=r(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),xe=r(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Se=r(`clipboard`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]),Ce=r(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),we=r(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),F=r(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Te=r(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Ee=r(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),De=r(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),Oe=r(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),ke=r(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Ae=r(`package-check`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`m16 17 2 2 4-4`,key:`uh5qu3`}],[`path`,{d:`M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753`,key:`kpkbpo`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),je=r(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Me=r(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Ne=r(`user-check`,[[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Pe=r(`user-minus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),I=r(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),L=t(e(),1),R=n(),Fe=[{pattern:/plan|decision|context|document|handoff/i,label:`Shared context`,tool:`context`},{pattern:/resource|package|skill|agent/i,label:`Resource evidence`,tool:`resources`},{pattern:/workflow|step|completion|evidence/i,label:`Workflow evidence`,tool:`workflow`},{pattern:/member|join|participant|invite/i,label:`People`,tool:`members`},{pattern:/password|credential|security|certificate|tls/i,label:`Security record`,tool:`security`}],Ie=[{tool:`overview`,label:`Project & privacy`,icon:ne},{tool:`context`,label:`Shared context`,icon:ee},{tool:`resources`,label:`Resources`,icon:Ae},{tool:`workflow`,label:`Workflow`,icon:s},{tool:`members`,label:`People`,icon:ge},{tool:`activity`,label:`Full activity log`,icon:pe},{tool:`security`,label:`Security & export`,icon:De}];function Le(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t)}function Re(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(t)}function z(e){return e.role===`host`?`host`:e.role===`publisher`?`publisher`:`member`}function B(e){switch(e){case`in_progress`:return`In progress`;case`completion_proposed`:return`Review requested`;case`completed`:return`Complete`;case`skipped`:return`Skipped`;default:return`Pending`}}function ze({status:e}){return e===`completed`?(0,R.jsx)(le,{"aria-hidden":`true`,className:`text-success`,size:14}):e===`in_progress`?(0,R.jsx)(P,{"aria-hidden":`true`,className:`text-primary`,size:14}):e===`completion_proposed`?(0,R.jsx)(Ce,{"aria-hidden":`true`,className:`text-warning`,size:14}):(0,R.jsx)(xe,{"aria-hidden":`true`,className:`text-muted-foreground`,size:14})}function V({participant:e,emphasized:t=!1}){return(0,R.jsx)(`span`,{"aria-hidden":`true`,"data-role":e?.role??`system`,className:`grid shrink-0 place-items-center rounded-full border ${t?`size-9 border-primary/60 bg-primary/15 text-primary`:`size-8 border-border bg-muted text-muted-foreground`}`,children:(0,R.jsx)(I,{"aria-hidden":`true`,size:t?17:15})})}function Be({snapshot:e,roomUrl:t,isHost:n,me:r,busy:a,message:c,hasUnsavedHandoffDraft:l,headingRef:re,onCreateInvite:u,onRefresh:ie,onStopOrLeave:ae,onOpenTool:d,onMessageChange:oe,onPostUpdate:se}){let f=(0,L.useMemo)(()=>e.participants.filter(e=>!e.revokedAt),[e.participants]),ce=(0,L.useMemo)(()=>new Map(e.participants.map(e=>[e.id,e])),[e.participants]),p=e.workflowProgress,le=p?.steps.findIndex(e=>e.status===`completion_proposed`)??-1,_=p?.steps.findIndex(e=>e.status===`in_progress`)??-1,b=le>=0?le:_,x=p?.steps.findIndex(e=>e.status===`pending`)??-1,S=b>=0?p?.steps[b]:void 0,C=x>=0?p?.steps[x]:void 0,me=p?.package.steps.find(e=>e.id===S?.stepId),T=p?.package.steps.find(e=>e.id===C?.stepId),E=b>=0?p?.steps.slice(b+1).find(e=>e.status===`pending`):void 0,D=p?.package.steps.find(e=>e.id===E?.stepId),ge=S?ce.get(S.updatedBy):void 0,O=!!(p?.steps.length&&p.steps.every(e=>e.status===`completed`||e.status===`skipped`)),k=e.activity.slice(-20);return(0,R.jsxs)(`section`,{"aria-labelledby":`handoff-stream-title`,className:`animate-fade-in`,"data-testid":`handoff-stream`,children:[(0,R.jsx)(`header`,{className:`border-b border-border pb-4`,children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-4 xl:flex-row xl:items-center xl:justify-between`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 xl:flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(pe,{"aria-hidden":`true`,className:`text-muted-foreground`,size:17}),(0,R.jsx)(`h1`,{ref:re,id:`handoff-stream-title`,tabIndex:-1,className:`text-lg font-semibold tracking-tight outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:`Handoff Stream`}),(0,R.jsxs)(o,{variant:`success`,children:[(0,R.jsx)(`span`,{className:`mr-1 inline-block size-1.5 rounded-full bg-success`}),`Live`]})]}),(0,R.jsx)(`p`,{className:`mt-1 truncate text-sm text-muted-foreground`,children:e.bundle.feature.goal})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 sm:gap-3`,children:[(0,R.jsxs)(`div`,{"aria-label":`${f.length} participants`,className:`flex items-center gap-1`,children:[f.slice(0,4).map(e=>(0,R.jsxs)(`span`,{className:`flex items-center gap-2 rounded-md px-1 py-0.5`,title:`${e.displayName} · ${z(e)}`,children:[(0,R.jsx)(V,{participant:e,emphasized:e.id===r?.id}),(0,R.jsxs)(`span`,{className:`hidden max-w-24 leading-tight 2xl:block`,children:[(0,R.jsx)(`span`,{className:`block truncate text-xs font-semibold`,children:e.displayName}),(0,R.jsx)(`span`,{className:`block text-[10px] text-muted-foreground`,children:z(e)})]})]},e.id)),f.length>4&&(0,R.jsxs)(`span`,{className:`grid size-8 place-items-center rounded-full border border-border bg-muted text-[10px] font-semibold text-muted-foreground`,children:[`+`,f.length-4]})]}),n&&(0,R.jsxs)(i,{variant:`outline`,onClick:u,disabled:a!==null,children:[(0,R.jsx)(Ee,{"aria-hidden":`true`}),` Invite`,e.pendingJoins.length>0&&(0,R.jsx)(`span`,{className:`ml-0.5 rounded bg-warning/15 px-1 text-[10px] text-warning-foreground`,children:e.pendingJoins.length})]}),(0,R.jsxs)(de,{children:[(0,R.jsx)(g,{"aria-label":`Open room tools`,className:`grid size-8 cursor-pointer place-items-center rounded-md border border-border bg-card text-muted-foreground shadow-2xs transition-colors hover:bg-accent hover:text-foreground`,children:(0,R.jsx)(F,{"aria-hidden":`true`,size:16})}),(0,R.jsxs)(he,{align:`end`,className:`w-56`,children:[Ie.map(({tool:t,label:n,icon:r})=>(0,R.jsxs)(m,{onClick:()=>d(t),children:[(0,R.jsx)(r,{"aria-hidden":`true`}),` `,n,t===`members`&&e.pendingJoins.length>0&&(0,R.jsx)(`span`,{className:`ml-auto text-[10px] text-warning-foreground`,children:e.pendingJoins.length})]},t)),(0,R.jsx)(fe,{}),(0,R.jsxs)(m,{onClick:ie,children:[(0,R.jsx)(h,{"aria-hidden":`true`}),` Refresh room`]}),(0,R.jsxs)(m,{variant:`destructive`,disabled:a!==null,onClick:()=>{let e=n?`stop hosting this Workroom`:`leave this Workroom`;window.confirm(`Are you sure you want to ${e}?`)&&ae()},children:[(0,R.jsx)(ue,{"aria-hidden":`true`}),` `,n?`Stop room`:`Leave room`]})]})]})]})]})}),(0,R.jsxs)(`div`,{className:`mt-4 grid gap-4 xl:grid-cols-[minmax(0,1fr)_17rem]`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg border border-primary/35 bg-primary/10 px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-full border border-primary/50 bg-primary/12 text-primary`,children:(0,R.jsx)(s,{"aria-hidden":`true`,size:17})}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`p`,{className:`text-sm font-semibold`,children:p?O?`Workflow complete`:S?.status===`completion_proposed`?`A review is ready`:S?`Work is moving`:`Workflow ready`:`No shared workflow yet`}),(0,R.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:O?`Every shared step has been completed.`:p&&S?`${ge?.displayName||`A participant`} updated ${me?.title||S.stepId} · step ${b+1} of ${p.steps.length}${D?` · next: ${D.title}`:``}`:p&&C?`Next: ${T?.title||C.stepId} · step ${x+1} of ${p.steps.length}`:p?`The shared workflow is ready to start.`:n?`Choose a reviewed workflow to make the next handoff explicit.`:`The host has not selected a shared workflow yet.`})]})]}),(p||n)&&(0,R.jsxs)(i,{size:`sm`,onClick:()=>d(`workflow`),children:[S?.status===`completion_proposed`?`Review proposal`:p?`Open workflow`:`Set workflow`,(0,R.jsx)(te,{"aria-hidden":`true`})]})]}),(0,R.jsxs)(`div`,{className:`rounded-lg border border-border bg-card`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Room activity`}),(0,R.jsx)(`p`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:`Decisions, evidence, and handoffs shared with this room.`})]}),(0,R.jsxs)(i,{variant:`ghost`,size:`xs`,onClick:()=>d(`activity`),children:[`View log `,(0,R.jsx)(y,{"aria-hidden":`true`})]})]}),k.length>0?(0,R.jsx)(`ol`,{"aria-label":`Workroom activity`,className:`relative divide-y divide-border/70 before:absolute before:bottom-8 before:left-[2.05rem] before:top-8 before:w-px before:bg-border`,children:k.map(e=>{let t=ce.get(e.actorId),n=Fe.find(({pattern:t})=>t.test(e.type));return(0,R.jsxs)(`li`,{className:`relative flex gap-3 px-4 py-4 sm:gap-4`,children:[(0,R.jsx)(`span`,{className:`relative z-10 rounded-full bg-card p-0.5`,children:(0,R.jsx)(V,{participant:t,emphasized:t?.id===r?.id})}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,R.jsx)(`span`,{className:`min-w-0 break-words text-xs font-semibold [overflow-wrap:anywhere]`,children:t?.displayName||`Historical participant`}),t&&(0,R.jsx)(o,{variant:t.role===`host`?`info`:`secondary`,children:z(t)}),(0,R.jsx)(`time`,{className:`text-[10px] text-muted-foreground`,dateTime:e.createdAt,children:Le(e.createdAt)})]}),(0,R.jsx)(`p`,{className:`mt-1.5 break-words text-sm font-medium text-foreground [overflow-wrap:anywhere]`,children:e.summary}),(0,R.jsxs)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:[e.type,` · event #`,e.sequence]}),n&&(0,R.jsxs)(`button`,{type:`button`,className:`mt-2 inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-border bg-muted/35 px-2 py-1 text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,onClick:()=>d(n.tool),children:[(0,R.jsx)(ee,{"aria-hidden":`true`,size:12}),` `,n.label]})]})]},e.sequence)})}):(0,R.jsxs)(`div`,{className:`px-4 py-10 text-center`,children:[(0,R.jsx)(pe,{"aria-hidden":`true`,className:`mx-auto text-muted-foreground`,size:20}),(0,R.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`No shared activity yet`}),(0,R.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Post an update below to begin the handoff stream.`})]}),(0,R.jsxs)(`form`,{className:`border-t border-border p-3`,onSubmit:async e=>{e.preventDefault();let t=c.trim();!t||a!==null||l||await se(t)},children:[(0,R.jsx)(`label`,{className:`sr-only`,htmlFor:`handoff-stream-message`,children:`Share a handoff update`}),(0,R.jsx)(w,{id:`handoff-stream-message`,className:`min-h-20 resize-y border-0 bg-transparent px-1 py-1 shadow-none focus-visible:ring-0`,maxLength:4e3,placeholder:`Share a decision, result, blocker, or next step…`,value:c,onChange:e=>oe(e.target.value),onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&e.key===`Enter`&&e.currentTarget.form?.requestSubmit()}}),(0,R.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,R.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:`Only the text you enter is shared from this composer. No files, diffs, paths, credentials, or transcripts are collected automatically.`}),l&&(0,R.jsx)(`p`,{className:`text-[10px] text-warning-foreground`,children:`Resolve your unsaved Handoff draft in Shared context before posting another update.`})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2`,children:[l&&(0,R.jsx)(i,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>d(`context`),children:`Review draft`}),(0,R.jsxs)(i,{type:`submit`,size:`sm`,disabled:!c.trim()||a!==null||l,children:[(0,R.jsx)(v,{"aria-hidden":`true`}),` `,a===`stream-post`?`Posting…`:`Post update`]})]})]})]})]})]}),(0,R.jsxs)(`aside`,{"aria-label":`Workroom details`,className:`h-fit divide-y divide-border rounded-lg border border-border bg-card xl:sticky xl:top-4`,children:[(0,R.jsxs)(`section`,{className:`p-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`h2`,{className:`text-xs font-semibold`,children:[`Steps `,p?`(${p.steps.length})`:``]}),(p||n)&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>d(`workflow`),className:`cursor-pointer text-muted-foreground hover:text-foreground`,"aria-label":`Open workflow tools`,children:(0,R.jsx)(je,{"aria-hidden":`true`,size:14})})]}),p?(0,R.jsx)(`ol`,{className:`mt-3 space-y-1`,children:p.steps.map((e,t)=>{let n=p.package.steps.find(t=>t.id===e.stepId),r=ce.get(e.updatedBy),i=B(e.status);return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,onClick:()=>d(`workflow`),className:`group flex w-full cursor-pointer items-start gap-2 rounded-md px-1 py-2 text-left hover:bg-accent/60`,children:[(0,R.jsx)(`span`,{className:`mt-0.5 grid size-5 shrink-0 place-items-center rounded-full border border-border bg-background text-[10px]`,children:t+1}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-xs ${e.status===`in_progress`||e.status===`completion_proposed`?`font-semibold text-foreground`:`text-muted-foreground`}`,children:n?.title||e.stepId}),(0,R.jsx)(`span`,{className:`mt-0.5 block truncate text-[10px] text-muted-foreground`,children:e.status===`pending`||!r?i:`${i} · updated by ${r.displayName}`})]}),(0,R.jsx)(`span`,{className:`mt-1`,children:(0,R.jsx)(ze,{status:e.status})})]})},e.stepId)})}):n?(0,R.jsxs)(`button`,{type:`button`,onClick:()=>d(`workflow`),className:`mt-3 w-full cursor-pointer rounded-md border border-dashed border-border px-3 py-4 text-left hover:bg-accent/50`,children:[(0,R.jsx)(`span`,{className:`text-xs font-medium`,children:`Make turns explicit`}),(0,R.jsx)(`span`,{className:`mt-1 block text-[10px] text-muted-foreground`,children:`Select a shared workflow and require evidence for completion.`})]}):(0,R.jsxs)(`div`,{className:`mt-3 rounded-md border border-dashed border-border px-3 py-4`,children:[(0,R.jsx)(`span`,{className:`text-xs font-medium`,children:`Waiting for a workflow`}),(0,R.jsx)(`span`,{className:`mt-1 block text-[10px] text-muted-foreground`,children:`The host can select a shared workflow for this room.`})]})]}),(0,R.jsxs)(`section`,{className:`p-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`h2`,{className:`text-xs font-semibold`,children:[`Participants (`,f.length,`)`]}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>d(`members`),className:`cursor-pointer text-[10px] text-muted-foreground hover:text-foreground`,children:`Manage`})]}),(0,R.jsx)(`ul`,{className:`mt-3 space-y-2.5`,children:f.slice(0,6).map(e=>(0,R.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(V,{participant:e,emphasized:e.id===r?.id}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,children:e.displayName}),(0,R.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:z(e)})]},e.id))})]}),(0,R.jsxs)(`section`,{className:`space-y-2.5 p-4`,children:[(0,R.jsx)(`h2`,{className:`text-xs font-semibold`,children:`Room details`}),(0,R.jsxs)(`dl`,{className:`space-y-2 text-[11px]`,children:[(0,R.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created by`}),(0,R.jsx)(`dd`,{className:`truncate text-right`,children:e.participants.find(e=>e.role===`host`)?.displayName||`Host`})]}),(0,R.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created`}),(0,R.jsx)(`dd`,{className:`text-right`,children:Re(e.createdAt)})]}),(0,R.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:`Workspace`}),(0,R.jsx)(`dd`,{className:`truncate text-right`,children:e.bundle.feature.id})]}),(0,R.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,R.jsx)(`dt`,{className:`text-muted-foreground`,children:`Status`}),(0,R.jsxs)(`dd`,{className:`inline-flex items-center gap-1.5`,children:[`Live `,(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-success`})]})]})]}),(0,R.jsx)(`p`,{className:`truncate border-t border-border pt-2 font-mono text-[9px] text-muted-foreground`,title:t,children:t})]}),(0,R.jsx)(`section`,{className:`p-3`,children:(0,R.jsxs)(i,{variant:`ghost`,className:`w-full justify-start`,onClick:()=>d(`security`),children:[(0,R.jsx)(ne,{"aria-hidden":`true`}),` Security & encrypted export`]})})]})]})]})}var H={plan:`Plan`,decisions:`Decisions & knowledge`,handoff:`Handoff`},Ve={overview:`Project & privacy`,context:`Shared context`,resources:`Resources`,workflow:`Workflow`,members:`People`,activity:`Full activity log`,security:`Security & encrypted export`};function He(){let e=new Uint8Array(18);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e)).replace(/[+/=]/g,``).slice(0,24)}function Ue(e){return e instanceof Error?e.message:String(e)}function U(e){return e.mode===`host`||e.mode===`guest`?e.snapshot:void 0}function We(e,t){return e.mode===`host`||e.mode===`guest`?{...e,snapshot:t}:e}function Ge(e,t){let n=U(e),r=U(t);if(!n||!r||n.roomId!==r.roomId)return t;let i=r.revision>=n.revision?r:n,a={plan:r.documents.plan.revision>=n.documents.plan.revision?r.documents.plan:n.documents.plan,decisions:r.documents.decisions.revision>=n.documents.decisions.revision?r.documents.decisions:n.documents.decisions,handoff:r.documents.handoff.revision>=n.documents.handoff.revision?r.documents.handoff:n.documents.handoff};return We(t,{...i,documents:a})}function Ke(e,t,n){let r=U(e);return!r||r.roomId!==t||n.revision<r.documents.handoff.revision?e:We(e,{...r,documents:{...r.documents,handoff:n}})}async function qe(e,t){let n=JSON.stringify({bundle:e,documents:{plan:t.plan,decisions:t.decisions,handoff:t.handoff}}),r=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(n));return[...new Uint8Array(r)].map(e=>e.toString(16).padStart(2,`0`)).join(``)}function Je({workspaces:e,showToast:t}){let[n,r]=(0,L.useState)({mode:`idle`}),[ee,te]=(0,L.useState)([]),[s,m]=(0,L.useState)(null),[g,de]=(0,L.useState)(``),[v,fe]=(0,L.useState)(null),[y,he]=(0,L.useState)({plan:``,decisions:``,handoff:``}),[P,xe]=(0,L.useState)({plan:!1,decisions:!1,handoff:!1}),[Ce,F]=(0,L.useState)(!1),[De,je]=(0,L.useState)(``),[I,Fe]=(0,L.useState)(``),[Ie,Le]=(0,L.useState)(`4242`),[Re,z]=(0,L.useState)(``),[B,ze]=(0,L.useState)(()=>He()),[V,U]=(0,L.useState)(``),[We,Je]=(0,L.useState)(``),[Ye,Xe]=(0,L.useState)(``),[Ze,Qe]=(0,L.useState)(``),[$e,et]=(0,L.useState)(``),[tt,nt]=(0,L.useState)(``),[rt,it]=(0,L.useState)({plan:``,decisions:``,handoff:``}),[W,at]=(0,L.useState)({plan:!1,decisions:!1,handoff:!1}),[G,ot]=(0,L.useState)([]),[st,ct]=(0,L.useState)(``),[lt,ut]=(0,L.useState)(`0.1.0`),[dt,ft]=(0,L.useState)({}),[pt,mt]=(0,L.useState)(``),[ht,gt]=(0,L.useState)(`0.1.0`),[_t,vt]=(0,L.useState)(`Plan
|
|
2
|
+
Implement
|
|
3
|
+
Verify
|
|
4
|
+
Review`),[yt,bt]=(0,L.useState)({}),[xt,St]=(0,L.useState)(()=>He()),[K,Ct]=(0,L.useState)(()=>He()),[wt,Tt]=(0,L.useState)(null),[q,J]=(0,L.useState)(`stream`),[Et,Dt]=(0,L.useState)(``),[Ot,kt]=(0,L.useState)([]),[At,jt]=(0,L.useState)([]),Mt=(0,L.useRef)(null),Nt=(0,L.useRef)(null),Pt=(0,L.useRef)(null),Ft=(0,L.useRef)(!1),Y=n.mode===`host`||n.mode===`guest`?n.snapshot:void 0,X=n.mode===`host`,Z=n.mode===`guest`&&n.status===`pending`,It=n.mode===`host`?Y?.participants.find(e=>e.role===`host`):n.mode===`guest`?Y?.participants.find(e=>e.id===n.memberId):void 0,Lt=It?.role===`host`||It?.role===`publisher`,Rt=!!Y,Q=(0,L.useCallback)(async(e=!1)=>{try{let e=await T(`/api/workrooms/status`);r(t=>Ge(t,e.status))}catch(n){if(n instanceof C&&n.status===401)try{let e=await T(`/api/workrooms/session`);r(e.active&&e.locked&&e.roomType?{mode:`locked`,roomType:e.roomType}:{mode:`idle`});return}catch(n){e&&t(Ue(n),`error`);return}e&&t(Ue(n),`error`)}},[t]),zt=(0,L.useCallback)(async()=>{let[e,t]=await Promise.all([T(`/api/workrooms/paused`),T(`/api/workrooms/quarantined`)]);kt(e.rooms),jt(t.rooms)},[]);(0,L.useEffect)(()=>{Promise.all([Q(),T(`/api/workrooms/interfaces`).then(e=>{te(e.interfaces),Fe(t=>t||e.interfaces.find(e=>!e.internal&&e.family===`IPv4`)?.address||e.interfaces[0]?.address||``)}),zt()]);let e=window.setInterval(()=>void Q(),3e3);return()=>window.clearInterval(e)},[Q,zt]),(0,L.useEffect)(()=>{if(!g){fe(null);return}T(`/api/workrooms/preview/${encodeURIComponent(g)}`).then(({preview:e})=>{fe(e),he(e.documents),xe({plan:!1,decisions:!1,handoff:!1}),F(!1),je(t=>t||`${e.bundle.feature.id} workroom`)}).catch(e=>t(Ue(e),`error`))},[g,t]),(0,L.useEffect)(()=>{Y&&it(e=>({plan:W.plan?e.plan:Y.documents.plan.content,decisions:W.decisions?e.decisions:Y.documents.decisions.content,handoff:W.handoff?e.handoff:Y.documents.handoff.content}))},[Y,W]),(0,L.useEffect)(()=>{Y?.workflowProgress&&bt(e=>Object.fromEntries(Y.workflowProgress.steps.map(t=>[t.stepId,e[t.stepId]??t.evidence??``])))},[Y?.workflowProgress]),(0,L.useEffect)(()=>{Rt&&T(`/api/workrooms/local-resources`).then(({resources:e})=>{ot(e),ct(t=>t||(e[0]?`${e[0].kind}:${e[0].id}`:``)),mt(t=>t||e.find(e=>e.kind===`workflow`)?.id||``)}).catch(()=>{})},[Rt]),(0,L.useEffect)(()=>{n.mode===`idle`&&(Dt(``),J(`stream`))},[n.mode]),(0,L.useEffect)(()=>{if(!Rt){Ft.current=!1;return}if(!Ft.current){Ft.current=!0;return}let e=window.requestAnimationFrame(()=>{q===`stream`?Nt.current?.focus():Pt.current?.focus()});return()=>window.cancelAnimationFrame(e)},[q,Rt]);let $=async(e,n,r)=>{if(Mt.current!==null)return!1;Mt.current=e,m(e);try{return await n(),await Q(),await zt().catch(()=>{}),r&&t(r,`success`),!0}catch(e){return t(Ue(e),`error`,8e3),!1}finally{Mt.current=null,m(null)}},Bt=()=>$(`start`,async()=>{if(!v)throw Error(`Select and preview a workspace first.`);let e={plan:P.plan?y.plan:``,decisions:P.decisions?y.decisions:``,handoff:P.handoff?y.handoff:``},t=await T(`/api/workrooms/start`,{method:`POST`,body:JSON.stringify({workspaceId:g,name:De,address:I,port:Number(Ie),password:B,hostDisplayName:Re,contextConfirmed:Ce,contextDigest:await qe(v.bundle,e),documents:e})});r(t.status)},`Workroom started.`),Vt=e=>$(`resume-${e}`,async()=>{let t=await T(`/api/workrooms/${encodeURIComponent(e)}/resume`,{method:`POST`,body:JSON.stringify({password:B})});r(t.status)},`Workroom resumed with its existing identity and memberships.`),Ht=e=>{window.confirm(`Discard failed import ${e}? This removes only its quarantined local files so you can retry the original encrypted export.`)&&$(`discard-${e}`,async()=>{await T(`/api/workrooms/quarantined/${encodeURIComponent(e)}/discard`,{method:`POST`,body:JSON.stringify({confirmRoomId:e})})},`Failed import discarded. You can retry the encrypted export.`)},Ut=()=>$(`join`,async()=>{let e=await T(`/api/workrooms/join`,{method:`POST`,body:JSON.stringify({invite:Ye,password:Ze,displayName:$e,workspaceId:g||void 0})});r(e.status)},`Join request sent to the host.`),Wt=()=>$(`poll`,async()=>{let e=await T(`/api/workrooms/join/poll`,{method:`POST`});r(e.status)}),Gt=()=>$(`stop`,async()=>{await T(`/api/workrooms/stop`,{method:`POST`}),r({mode:`idle`}),J(`stream`),Dt(``),U(``)},X?`Workroom stopped.`:`Left the Workroom.`),Kt=()=>$(`invite`,async()=>{let e=await T(`/api/workrooms/invites`,{method:`POST`});U(e.invite),Je(e.expiresAt),await me(e.invite)},`One-use invitation copied. Share the password separately.`),qt=e=>$(`doc-${e}`,async()=>{if(Y)try{await T(`/api/workrooms/documents/${e}`,{method:`PUT`,body:JSON.stringify({content:rt[e],expectedRevision:Y.documents[e].revision})}),at(t=>({...t,[e]:!1}))}catch(e){throw e instanceof C&&e.status===409?(await Q(),Error(`Someone updated this document first. Your draft is preserved; compare it with the latest revision and save again.`,{cause:e})):e}},`${H[e]} shared.`),Jt=()=>$(`publish-resource`,async()=>{let[e,t]=st.split(`:`);await T(`/api/workrooms/resources/publish`,{method:`POST`,body:JSON.stringify({kind:e,id:t,version:lt})})},`Immutable resource version published.`),Yt=e=>$(`download-${e}`,async()=>{let t=await T(`/api/workrooms/resources/${e}/download`,{method:`POST`});ft(n=>({...n,[e]:t.preview}))},`Resource downloaded to the local quarantine cache. Review it before applying.`),Xt=e=>$(`apply-${e}`,async()=>{let t=dt[e];if(!t)throw Error(`Download and review this resource again before applying it.`);await T(`/api/workrooms/resources/${e}/apply`,{method:`POST`,body:JSON.stringify({approvedDigest:e,approvedLocalDigest:t.localDigest})})},`Resource applied to your local ${f} catalog.`),Zt=e=>$(`quarantine-${e}`,async()=>{await T(`/api/workrooms/resources/${e}/quarantine`,{method:`POST`})},`Resource version quarantined and removed from future exports and downloads.`),Qt=e=>{window.confirm(`Permanently purge quarantined resource ${e}? Its package bytes and catalog entry will be removed so the room quota can be reused.`)&&$(`purge-${e}`,async()=>{await T(`/api/workrooms/resources/${e}/purge`,{method:`POST`,body:JSON.stringify({confirmDigest:e})})},`Quarantined resource permanently purged and its room quota released.`)},$t=()=>$(`select-workflow`,async()=>{let e=G.find(e=>e.kind===`workflow`&&e.id===pt);if(!e)throw Error(`Select a local workflow.`);let t=_t.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map((e,t)=>({id:`${t+1}-${e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)||`step`}`,title:e,requiresEvidence:!0}));await T(`/api/workrooms/workflow/select`,{method:`POST`,body:JSON.stringify({workflowId:e.id,version:ht,steps:t,expectedRevision:Y?.workflowProgress?.revision??0})})},`Shared workflow selected.`),en=(e,t)=>$(`step-${e.stepId}`,async()=>{let n=Y?.workflowProgress?.package.steps.find(t=>t.id===e.stepId),r=(yt[e.stepId]??e.evidence??``).trim();if(t===`completed`&&n?.requiresEvidence&&!r)throw Error(`Add evidence before completing this workflow step.`);await T(`/api/workrooms/workflow/steps/${encodeURIComponent(e.stepId)}/transition`,{method:`POST`,body:JSON.stringify({status:t,expectedRevision:e.revision,...t===`completed`&&r?{evidence:r}:{}})})}),tn=async e=>{let t=e.trim(),n=await $(`stream-post`,async()=>{if(!Y)throw Error(`The Workroom snapshot is not available.`);if(W.handoff)throw Error(`Resolve the unsaved Handoff draft in Shared context before posting another update.`);let e=Y.documents.handoff.content.trimEnd(),n=e?`${e}\n\n${t}\n`:`${t}\n`;try{let e=await T(`/api/workrooms/documents/handoff`,{method:`PUT`,body:JSON.stringify({content:n,expectedRevision:Y.documents.handoff.revision})});r(t=>Ke(t,Y.roomId,e.document))}catch(e){throw e instanceof C&&e.status===409?(await Q(),Error(`Someone updated the handoff first. Your update is preserved; review the latest shared context and post again.`,{cause:e})):e}},`Handoff update shared.`);return n&&Dt(e=>e.trim()===t?``:e),n},nn=()=>$(`export`,async()=>{let e=await T(`/api/workrooms/export`,{method:`POST`,body:JSON.stringify({passphrase:K})}),t=new Blob([JSON.stringify(e.export,null,2)],{type:`application/json`}),n=document.createElement(`a`);n.href=URL.createObjectURL(t),n.download=`${Y?.roomId??`${se}-workroom`}${ae}`,n.click(),URL.revokeObjectURL(n.href)},`Encrypted Workroom export created.`),rn=()=>$(`import`,async()=>{if(!wt)throw Error(`Choose a ${ae} or ${d} export first.`);let e=await T(`/api/workrooms/import`,{method:`POST`,body:JSON.stringify({export:wt,exportPassphrase:K,name:De||void 0,address:I,port:Number(Ie),password:B,hostDisplayName:Re})});r(e.status)},`Encrypted export imported as a new Workroom with new credentials.`);if(n.mode===`locked`)return(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-xl flex-col gap-5 py-16 text-center`,children:[(0,R.jsx)(`div`,{className:`mx-auto grid size-14 place-items-center rounded-full bg-amber-500/10 text-amber-700`,children:(0,R.jsx)(Te,{})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Active Workroom is locked`}),(0,R.jsxs)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:[`This browser lost its local human-session cookie. `,n.roomType===`host`?`Enter the room password to regain host dashboard controls.`:`For safety, leave this local guest connection and join again with the invitation and room password.`]})]}),n.roomType===`host`?(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-sm flex-col gap-3`,children:[(0,R.jsx)(N,{htmlFor:`workroom-recovery-password`,children:`Room password`}),(0,R.jsx)(a,{id:`workroom-recovery-password`,type:`password`,value:tt,onChange:e=>nt(e.target.value)}),(0,R.jsxs)(i,{onClick:()=>$(`reclaim`,async()=>{await T(`/api/workrooms/session/reclaim`,{method:`POST`,body:JSON.stringify({password:tt})}),nt(``)},`Local Workroom dashboard reconnected.`),disabled:s!==null||!tt,children:[s===`reclaim`?(0,R.jsx)(x,{}):(0,R.jsx)(Te,{}),` Unlock host dashboard`]})]}):(0,R.jsx)(`div`,{children:(0,R.jsxs)(i,{variant:`destructive-outline`,onClick:()=>$(`abandon-locked-guest`,async()=>{await T(`/api/workrooms/session/abandon`,{method:`POST`,body:JSON.stringify({confirm:!0})}),r({mode:`idle`})},`Locked guest connection left. Join the Workroom again.`),disabled:s!==null,children:[s===`abandon-locked-guest`?(0,R.jsx)(x,{}):(0,R.jsx)(Oe,{}),` Leave and rejoin`]})})]});if(n.mode===`idle`)return(0,R.jsxs)(`div`,{className:`mx-auto max-w-6xl animate-fade-in space-y-6`,children:[(0,R.jsxs)(`header`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(ge,{className:`text-primary`,size:20}),(0,R.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:`Workrooms`}),(0,R.jsx)(o,{variant:`info`,children:`Experimental`})]}),(0,R.jsxs)(`p`,{className:`mt-1 max-w-3xl text-sm text-muted-foreground`,children:[`Share only the project context and reusable agent resources you explicitly review over a private LAN or VPN. `,f,` never adds code, diffs, credentials, terminals, or AI sessions automatically.`]})]}),(0,R.jsxs)(ye,{variant:`info`,children:[(0,R.jsx)(ne,{}),(0,R.jsx)(ve,{children:`No listener runs by default`}),(0,R.jsxs)(_e,{children:[`A Workroom binds only to the network address you select and stops with `,f,`.`]})]}),Ot.length>0&&(0,R.jsxs)(M,{children:[(0,R.jsxs)(j,{children:[(0,R.jsx)(O,{children:`Paused Workrooms`}),(0,R.jsx)(A,{children:`Enter the room password in the host form below, then resume on the same saved address and port. The password unlocks human authority; agent credentials remain read-and-propose-only.`})]}),(0,R.jsx)(k,{className:`grid gap-2 sm:grid-cols-2`,children:Ot.map(e=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border p-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`p`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,R.jsxs)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:[e.address,`:`,e.port,` · `,e.workspaceId]})]}),(0,R.jsxs)(i,{size:`sm`,variant:`outline`,onClick:()=>Vt(e.roomId),disabled:s!==null||B.length<12,children:[s===`resume-${e.roomId}`?(0,R.jsx)(x,{}):(0,R.jsx)(S,{}),` Resume`]})]},e.roomId))})]}),At.length>0&&(0,R.jsxs)(M,{children:[(0,R.jsxs)(j,{children:[(0,R.jsx)(O,{children:`Failed imports`}),(0,R.jsx)(A,{children:`These rooms never completed import and cannot be resumed. Inspect the identity below, discard its quarantined local files, then retry the original encrypted export.`})]}),(0,R.jsx)(k,{className:`grid gap-2 sm:grid-cols-2`,children:At.map(e=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-amber-500/40 p-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`p`,{className:`truncate text-sm font-semibold`,children:e.name||e.roomId}),(0,R.jsxs)(`p`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:[e.status===`failed`?`Import failed`:`Import interrupted`,e.workspaceId?` · ${e.workspaceId}`:``]})]}),(0,R.jsxs)(i,{size:`sm`,variant:`destructive-outline`,onClick:()=>Ht(e.roomId),disabled:s!==null,children:[s===`discard-${e.roomId}`?(0,R.jsx)(x,{}):(0,R.jsx)(c,{}),` Discard`]})]},e.roomId))})]}),(0,R.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-2`,children:[(0,R.jsxs)(M,{children:[(0,R.jsxs)(j,{children:[(0,R.jsxs)(O,{className:`flex items-center gap-2`,children:[(0,R.jsx)(ke,{size:15}),` Start a Workroom`]}),(0,R.jsx)(A,{children:`Host collaboration from this computer. Your existing dashboard remains localhost-only.`})]}),(0,R.jsxs)(k,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Workspace`}),(0,R.jsxs)(b,{value:g,onValueChange:e=>typeof e==`string`&&de(e),children:[(0,R.jsx)(p,{children:(0,R.jsx)(E,{children:e.find(e=>e.branchName===g)?.branchName||`Select a workspace`})}),(0,R.jsx)(_,{children:e.map(e=>(0,R.jsx)(D,{value:e.branchName,children:e.branchName},e.id))})]})]}),(0,R.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Room name`}),(0,R.jsx)(a,{value:De,onChange:e=>je(e.target.value)})]}),(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Your display name`}),(0,R.jsx)(a,{value:Re,onChange:e=>z(e.target.value),placeholder:`Defaults to OS user`})]})]}),(0,R.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[1fr_100px]`,children:[(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Network interface`}),(0,R.jsxs)(b,{value:I,onValueChange:e=>typeof e==`string`&&Fe(e),children:[(0,R.jsx)(p,{children:(0,R.jsx)(E,{children:I||`Select an address`})}),(0,R.jsx)(_,{children:ee.map(e=>(0,R.jsxs)(D,{value:e.address,children:[e.name,` · `,e.address,e.internal?` (local only)`:``]},`${e.name}-${e.address}`))})]})]}),(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Port`}),(0,R.jsx)(a,{type:`number`,value:Ie,onChange:e=>Le(e.target.value)})]})]}),(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsx)(N,{children:`Room password`}),(0,R.jsx)(i,{size:`xs`,variant:`ghost`,onClick:()=>ze(He()),children:`Generate`})]}),(0,R.jsx)(a,{type:`password`,value:B,onChange:e=>ze(e.target.value)}),(0,R.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Share this separately from the invitation. Minimum 12 characters.`})]}),v&&(0,R.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border bg-muted/30 p-3 text-xs`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`font-semibold text-foreground`,children:`Exact sharing review`}),(0,R.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Repository identities below are always included. Local context files are excluded until you explicitly include each one.`})]}),v.bundleWarnings.map(e=>(0,R.jsxs)(`p`,{className:`text-amber-700 dark:text-amber-300`,children:[`Bundle warning: `,e]},e)),(0,R.jsx)(`div`,{className:`space-y-1 font-mono text-[10px] text-muted-foreground`,children:v.bundle.repos.map(e=>(0,R.jsxs)(`div`,{className:`break-all`,children:[e.name,`: `,e.remoteUrl]},e.id))}),(0,R.jsxs)(`details`,{children:[(0,R.jsx)(`summary`,{className:`cursor-pointer font-semibold text-foreground`,children:`Complete shared feature metadata`}),(0,R.jsx)(`pre`,{className:`mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 font-mono text-[10px]`,children:JSON.stringify(v.bundle,null,2)})]}),Object.keys(H).map(e=>(0,R.jsxs)(`div`,{className:`space-y-1.5 rounded border border-border bg-background p-2`,children:[(0,R.jsxs)(`label`,{className:`flex items-center gap-2 font-semibold text-foreground`,children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:P[e],onChange:t=>{xe(n=>({...n,[e]:t.target.checked})),F(!1)}}),` Include `,H[e]]}),v.warnings[e].map(e=>(0,R.jsxs)(`p`,{className:`text-amber-700 dark:text-amber-300`,children:[`Warning: `,e]},e)),(0,R.jsx)(w,{"aria-label":`${H[e]} exact outbound content`,className:`min-h-28 font-mono text-[10px]`,value:y[e],onChange:t=>{he(n=>({...n,[e]:t.target.value})),F(!1)}}),(0,R.jsx)(`p`,{className:`text-[10px] text-muted-foreground`,children:P[e]?`${y[e].length.toLocaleString()} characters will be shared.`:`Excluded from the Workroom.`})]},e)),(0,R.jsxs)(`label`,{className:`flex items-start gap-2 rounded border border-border bg-background p-2 text-[11px]`,children:[(0,R.jsx)(`input`,{className:`mt-0.5`,type:`checkbox`,checked:Ce,onChange:e=>F(e.target.checked)}),(0,R.jsx)(`span`,{children:`I reviewed the exact included text and repository identities, including any credential, path, diff, or transcript warnings.`})]})]}),(0,R.jsxs)(i,{className:`w-full`,onClick:Bt,disabled:!v||!Ce||!I||B.length<12||s!==null,children:[s===`start`?(0,R.jsx)(x,{}):(0,R.jsx)(S,{}),` Start private Workroom`]})]})]}),(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(M,{children:[(0,R.jsxs)(j,{children:[(0,R.jsxs)(O,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Ee,{size:15}),` Join a Workroom`]}),(0,R.jsx)(A,{children:`Paste the invitation and enter the separately shared password. The host must approve this device.`})]}),(0,R.jsxs)(k,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Invitation`}),(0,R.jsx)(w,{className:`min-h-24 font-mono text-xs`,value:Ye,onChange:e=>Xe(e.target.value),placeholder:`${ce}//workroom/join?...`})]}),(0,R.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Password`}),(0,R.jsx)(a,{type:`password`,value:Ze,onChange:e=>Qe(e.target.value)})]}),(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Your display name`}),(0,R.jsx)(a,{value:$e,onChange:e=>et(e.target.value)})]})]}),(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Local workspace mapping`}),(0,R.jsxs)(b,{value:g,onValueChange:e=>typeof e==`string`&&de(e),children:[(0,R.jsx)(p,{children:(0,R.jsx)(E,{children:e.find(e=>e.branchName===g)?.branchName||`Select your checkout (recommended)`})}),(0,R.jsx)(_,{children:e.map(e=>(0,R.jsx)(D,{value:e.branchName,children:e.branchName},e.id))})]}),(0,R.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Used for local agent proposals and handoff snapshots; code remains in this checkout.`})]}),(0,R.jsxs)(i,{className:`w-full`,onClick:Ut,disabled:!Ye||!Ze||s!==null,children:[s===`join`?(0,R.jsx)(x,{}):(0,R.jsx)(Ne,{}),` Request to join`]})]})]}),(0,R.jsxs)(M,{children:[(0,R.jsxs)(j,{children:[(0,R.jsxs)(O,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Me,{size:15}),` Import an encrypted room`]}),(0,R.jsx)(A,{children:`Creates a new room identity, certificate, password, and membership set.`})]}),(0,R.jsxs)(k,{className:`space-y-3`,children:[(0,R.jsx)(a,{type:`file`,accept:`.json,${ae},${d}`,onChange:e=>{let n=e.target.files?.[0];if(n){if(n.size>157286400){t(`Workroom export files are limited to 150 MiB.`,`error`);return}n.text().then(e=>Tt(JSON.parse(e))).catch(()=>t(`Invalid Workroom export file.`,`error`))}}}),(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Export passphrase`}),(0,R.jsx)(a,{type:`password`,value:K,onChange:e=>Ct(e.target.value)})]}),(0,R.jsxs)(i,{variant:`outline`,className:`w-full`,onClick:rn,disabled:!wt||!I||B.length<12||s!==null,children:[s===`import`?(0,R.jsx)(x,{}):(0,R.jsx)(Me,{}),` Import and host`]})]})]})]})]})]});if(Z||n.mode===`guest`&&n.status===`rejected`)return(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-xl flex-col gap-5 py-16 text-center`,children:[(0,R.jsx)(`div`,{className:`mx-auto grid size-14 place-items-center rounded-full bg-primary/10 text-primary`,children:Z?(0,R.jsx)(h,{className:`animate-spin`}):(0,R.jsx)(Pe,{})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`text-xl font-semibold`,children:Z?`Waiting for host approval`:`Join request rejected`}),(0,R.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:Z?`Your device credential is ready, but no room context is available until the host accepts you.`:`Ask the host for a new one-use invitation if this was unexpected.`})]}),(0,R.jsxs)(`div`,{className:`flex justify-center gap-2`,children:[Z&&(0,R.jsxs)(i,{onClick:Wt,disabled:s!==null,children:[s===`poll`?(0,R.jsx)(x,{}):(0,R.jsx)(h,{}),` Check approval`]}),(0,R.jsx)(i,{variant:`outline`,onClick:Gt,children:`Cancel`})]})]});if(n.mode===`guest`&&n.status===`accepted`&&!Y){let e=n.connection===`revoked`;return(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-xl flex-col gap-5 py-16 text-center`,children:[(0,R.jsx)(`div`,{className:`mx-auto grid size-14 place-items-center rounded-full bg-amber-500/10 text-amber-700`,children:e?(0,R.jsx)(Pe,{}):(0,R.jsx)(ke,{})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`text-xl font-semibold`,children:e?`Workroom access was revoked`:`Workroom connection is unavailable`}),(0,R.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e?`Leave this local connection, then ask the host for a new one-use invitation if you should rejoin.`:`The host or VPN may be offline. You can retry without losing the local connection, or leave immediately.`})]}),(0,R.jsxs)(`div`,{className:`flex justify-center gap-2`,children:[!e&&(0,R.jsxs)(i,{onClick:()=>Q(!0),disabled:s!==null,children:[(0,R.jsx)(h,{}),` Retry connection`]}),(0,R.jsxs)(i,{variant:`outline`,onClick:Gt,disabled:s!==null,children:[s===`stop`?(0,R.jsx)(x,{}):(0,R.jsx)(ue,{}),` Leave local connection`]})]})]})}return Y?(0,R.jsxs)(`div`,{className:`mx-auto max-w-[1500px] animate-fade-in space-y-4`,children:[q!==`stream`&&(0,R.jsxs)(`header`,{className:`flex flex-col gap-3 border-b border-border pb-4 sm:flex-row sm:items-center`,children:[(0,R.jsxs)(i,{ref:Pt,variant:`ghost`,onClick:()=>J(`stream`),children:[(0,R.jsx)(be,{}),` Back to Handoff Stream`]}),(0,R.jsxs)(`div`,{className:`min-w-0 sm:border-l sm:border-border sm:pl-4`,children:[(0,R.jsx)(`p`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground`,children:Y.name}),(0,R.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:Ve[q]})]})]}),V&&(0,R.jsxs)(ye,{variant:`success`,children:[(0,R.jsx)(Te,{}),(0,R.jsx)(ve,{children:`One-use invitation ready`}),(0,R.jsxs)(_e,{children:[(0,R.jsx)(`span`,{className:`break-all font-mono text-[10px]`,children:V}),(0,R.jsxs)(`span`,{children:[`Expires `,new Date(We).toLocaleString(),`. Share the password separately.`]})]}),(0,R.jsxs)(i,{size:`sm`,variant:`outline`,onClick:()=>void me(V),children:[(0,R.jsx)(Se,{}),` Copy`]})]}),(0,R.jsxs)(ie,{value:q,onValueChange:e=>J(e),children:[(0,R.jsxs)(re,{className:`hidden`,children:[(0,R.jsx)(l,{value:`stream`,children:`Handoff Stream`}),Object.keys(Ve).map(e=>(0,R.jsx)(l,{value:e,children:Ve[e]},e))]}),(0,R.jsx)(u,{value:`stream`,className:`mt-0`,children:(0,R.jsx)(Be,{snapshot:Y,roomUrl:n.url,isHost:X,me:It,busy:s,message:Et,hasUnsavedHandoffDraft:W.handoff,headingRef:Nt,onCreateInvite:Kt,onRefresh:()=>Q(!0),onStopOrLeave:Gt,onOpenTool:J,onMessageChange:Dt,onPostUpdate:tn})}),(0,R.jsxs)(u,{value:`overview`,className:`space-y-5`,children:[(0,R.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[(0,R.jsx)(M,{children:(0,R.jsxs)(j,{children:[(0,R.jsx)(A,{children:`Members`}),(0,R.jsx)(O,{className:`text-2xl`,children:Y.participants.filter(e=>!e.revokedAt).length})]})}),(0,R.jsx)(M,{children:(0,R.jsxs)(j,{children:[(0,R.jsx)(A,{children:`Shared resources`}),(0,R.jsx)(O,{className:`text-2xl`,children:Y.resources.filter(e=>!e.quarantinedAt).length})]})}),(0,R.jsx)(M,{children:(0,R.jsxs)(j,{children:[(0,R.jsx)(A,{children:`Repository identities`}),(0,R.jsx)(O,{className:`text-2xl`,children:Y.bundle.repos.length})]})})]}),(0,R.jsxs)(M,{children:[(0,R.jsxs)(j,{children:[(0,R.jsx)(O,{children:Y.bundle.feature.goal}),(0,R.jsxs)(A,{children:[Y.bundle.project.name,` · portable feature `,Y.bundle.feature.id]})]}),(0,R.jsx)(k,{className:`space-y-2`,children:Y.bundle.repos.map(e=>(0,R.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,R.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium`,children:e.name}),(0,R.jsx)(o,{variant:`secondary`,children:e.defaultBranch})]}),(0,R.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-muted-foreground`,children:e.remoteUrl}),e.handoff&&(0,R.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.handoff.branch,` @ `,e.handoff.commit.slice(0,12),` · `,e.handoff.dirty?`dirty`:`clean`,` · ↑`,e.handoff.ahead,` ↓`,e.handoff.behind]})]},e.id))})]}),(0,R.jsxs)(ye,{variant:`info`,children:[(0,R.jsx)(ne,{}),(0,R.jsx)(ve,{children:`Never collected automatically`}),(0,R.jsxs)(_e,{children:[f,` does not add source archives, filenames, diffs, local paths, credentials, terminals, editor state, or AI transcripts. A developer can still include sensitive text in a reviewed shared document.`]})]})]}),(0,R.jsx)(u,{value:`context`,className:`space-y-4`,children:Object.keys(H).map(e=>(0,R.jsxs)(M,{children:[(0,R.jsx)(j,{children:(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(O,{children:H[e]}),(0,R.jsxs)(A,{children:[`Revision `,Y.documents[e].revision,` · updated `,new Date(Y.documents[e].updatedAt).toLocaleString()]})]}),W[e]&&(0,R.jsx)(o,{variant:`warning`,children:`Local draft`})]})}),(0,R.jsxs)(k,{className:`space-y-3`,children:[(0,R.jsx)(w,{className:`min-h-64 font-mono text-xs`,value:rt[e],disabled:s!==null,onChange:t=>{it(n=>({...n,[e]:t.target.value})),at(t=>({...t,[e]:!0}))}}),(0,R.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[e===`handoff`&&(0,R.jsxs)(i,{variant:`outline`,onClick:()=>$(`handoff`,()=>T(`/api/workrooms/handoff`,{method:`POST`,body:JSON.stringify({workspaceId:n.localWorkspaceId})}).then(()=>void 0),`Git metadata handoff published.`),disabled:!n.localWorkspaceId||s!==null,children:[(0,R.jsx)(h,{}),` Publish Git snapshot`]}),(0,R.jsxs)(i,{onClick:()=>qt(e),disabled:!W[e]||s!==null,children:[s===`doc-${e}`?(0,R.jsx)(x,{}):(0,R.jsx)(Me,{}),` Share revision`]})]})]})]},e))}),(0,R.jsxs)(u,{value:`resources`,className:`space-y-4`,children:[Lt&&(0,R.jsxs)(M,{children:[(0,R.jsxs)(j,{children:[(0,R.jsx)(O,{children:`Publish a local resource`}),(0,R.jsx)(A,{children:`Published versions are immutable. Connected developers are notified and choose whether to download and apply them.`})]}),(0,R.jsxs)(k,{className:`flex flex-col gap-3 sm:flex-row sm:items-end`,children:[(0,R.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,R.jsx)(N,{children:`Resource`}),(0,R.jsxs)(b,{value:st,onValueChange:e=>typeof e==`string`&&ct(e),children:[(0,R.jsx)(p,{children:(0,R.jsx)(E,{children:G.find(e=>`${e.kind}:${e.id}`===st)?.name||`Select resource`})}),(0,R.jsx)(_,{children:G.map(e=>(0,R.jsxs)(D,{value:`${e.kind}:${e.id}`,children:[e.kind,` · `,e.name]},`${e.kind}:${e.id}`))})]})]}),(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Version`}),(0,R.jsx)(a,{className:`w-32 font-mono`,value:lt,onChange:e=>ut(e.target.value)})]}),(0,R.jsxs)(i,{onClick:Jt,disabled:!st||s!==null,children:[(0,R.jsx)(Me,{}),` Publish`]})]})]}),(0,R.jsx)(`div`,{className:`grid gap-3`,children:Y.resources.length===0?(0,R.jsx)(M,{className:`p-8 text-center text-sm text-muted-foreground`,children:`No resources have been published.`}):Y.resources.map(e=>{let t=dt[e.digest],n=[e.compatibility?.platforms?.length?`platforms: ${e.compatibility.platforms.join(`, `)}`:void 0,e.compatibility?.contextspace?`${f} ${e.compatibility.contextspace}`:e.compatibility?.nexusflow?`${oe} ${e.compatibility.nexusflow}`:void 0].filter(Boolean).join(` · `);return(0,R.jsx)(M,{className:e.quarantinedAt?`opacity-60`:``,children:(0,R.jsxs)(k,{className:`space-y-3 p-4`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(o,{variant:`secondary`,children:e.kind}),(0,R.jsxs)(`span`,{className:`text-sm font-semibold`,children:[e.id,`@`,e.version]}),e.quarantinedAt&&(0,R.jsx)(o,{variant:`error`,children:`Quarantined`})]}),(0,R.jsxs)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:[`SHA-256 `,e.digest]}),n&&(0,R.jsxs)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:[`Compatibility · `,n]})]}),e.quarantinedAt?X&&(0,R.jsxs)(i,{variant:`destructive-outline`,onClick:()=>Qt(e.digest),disabled:s!==null,children:[s===`purge-${e.digest}`?(0,R.jsx)(x,{}):(0,R.jsx)(c,{}),` Purge permanently`]}):(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t?(0,R.jsxs)(i,{onClick:()=>Xt(e.digest),disabled:s!==null,children:[(0,R.jsx)(Ae,{}),` Approve exact digest & apply`]}):(0,R.jsxs)(i,{variant:`outline`,onClick:()=>Yt(e.digest),disabled:s!==null,children:[(0,R.jsx)(we,{}),` Download for review`]}),X&&(0,R.jsx)(i,{variant:`ghost`,onClick:()=>Zt(e.digest),disabled:s!==null,children:`Quarantine`})]})]}),t&&(0,R.jsxs)(`div`,{className:`space-y-3 rounded border border-border bg-muted/30 p-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`p`,{className:`text-xs font-semibold`,children:[`Exact package review · `,t.action===`update`?`updates an existing local resource`:`creates a new local resource`]}),(0,R.jsxs)(`p`,{className:`text-[10px] text-muted-foreground`,children:[`Applying installs the incoming definition shown below and is bound to SHA-256 `,e.digest,`.`]})]}),t.existingDefinition&&(0,R.jsxs)(`details`,{children:[(0,R.jsx)(`summary`,{className:`cursor-pointer text-xs font-semibold`,children:`Current local definition`}),(0,R.jsx)(`pre`,{className:`mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 text-[10px]`,children:t.existingDefinition})]}),(0,R.jsxs)(`details`,{open:!0,children:[(0,R.jsx)(`summary`,{className:`cursor-pointer text-xs font-semibold`,children:`Incoming applied definition`}),(0,R.jsx)(`pre`,{className:`mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 text-[10px]`,children:t.incomingDefinition})]}),(0,R.jsx)(`div`,{className:`space-y-2`,children:t.files.map(e=>(0,R.jsxs)(`details`,{children:[(0,R.jsxs)(`summary`,{className:`cursor-pointer font-mono text-[10px]`,children:[e.path,` · `,e.bytes.toLocaleString(),` bytes · `,e.encoding,e.executable?` · executable`:``]}),(0,R.jsx)(`pre`,{className:`mt-1 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-2 text-[10px]`,children:e.content})]},e.path))})]})]})},e.digest)})})]}),(0,R.jsxs)(u,{value:`workflow`,className:`space-y-4`,children:[X&&!Y.workflowProgress&&(0,R.jsxs)(M,{children:[(0,R.jsxs)(j,{children:[(0,R.jsx)(O,{children:`Start shared workflow tracking`}),(0,R.jsx)(A,{children:`Convert a local strategy into explicit ordered steps. Agents may propose completion; a developer confirms it.`})]}),(0,R.jsxs)(k,{className:`space-y-3`,children:[(0,R.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[1fr_130px]`,children:[(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Workflow`}),(0,R.jsxs)(b,{value:pt,onValueChange:e=>typeof e==`string`&&mt(e),children:[(0,R.jsx)(p,{children:(0,R.jsx)(E,{children:G.find(e=>e.id===pt&&e.kind===`workflow`)?.name||`Select workflow`})}),(0,R.jsx)(_,{children:G.filter(e=>e.kind===`workflow`).map(e=>(0,R.jsx)(D,{value:e.id,children:e.name},e.id))})]})]}),(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Version`}),(0,R.jsx)(a,{value:ht,onChange:e=>gt(e.target.value)})]})]}),(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Ordered steps, one per line`}),(0,R.jsx)(w,{className:`min-h-32`,value:_t,onChange:e=>vt(e.target.value)})]}),(0,R.jsxs)(i,{onClick:$t,disabled:!pt||s!==null,children:[(0,R.jsx)(S,{}),` Start workflow`]})]})]}),!X&&!Y.workflowProgress&&(0,R.jsx)(M,{children:(0,R.jsxs)(j,{children:[(0,R.jsx)(O,{children:`No shared workflow yet`}),(0,R.jsx)(A,{children:`The host can select a reviewed workflow for this room. You can continue sharing context and handoff updates while you wait.`})]})}),Y.workflowProgress&&(0,R.jsxs)(M,{children:[(0,R.jsxs)(j,{children:[(0,R.jsxs)(O,{children:[Y.workflowProgress.package.name,`@`,Y.workflowProgress.workflow.version]}),(0,R.jsxs)(A,{children:[`Exact strategy retained at digest `,Y.workflowProgress.workflow.digest.slice(0,12),`… · shared progress revision `,Y.workflowProgress.revision]})]}),(0,R.jsx)(k,{className:`space-y-3`,children:Y.workflowProgress.steps.map((e,t)=>{let n=Y.workflowProgress.package.steps.find(t=>t.id===e.stepId);return(0,R.jsx)(`div`,{className:`rounded-lg border border-border p-3`,children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`grid size-5 place-items-center rounded-full bg-muted text-[10px]`,children:t+1}),(0,R.jsx)(`span`,{className:`text-xs font-semibold`,children:n?.title||e.stepId}),(0,R.jsx)(o,{variant:e.status===`completed`?`success`:e.status===`completion_proposed`?`warning`:`secondary`,children:e.status.replace(`_`,` `)})]}),(0,R.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:e.stepId}),e.evidence&&(0,R.jsxs)(`p`,{className:`mt-2 whitespace-pre-wrap text-xs text-muted-foreground`,children:[`Evidence: `,e.evidence]}),n?.requiresEvidence&&(0,R.jsxs)(`div`,{className:`mt-3 space-y-1.5`,children:[(0,R.jsx)(N,{htmlFor:`workflow-evidence-${e.stepId}`,children:`Completion evidence`}),(0,R.jsx)(w,{id:`workflow-evidence-${e.stepId}`,className:`min-h-20 text-xs`,value:yt[e.stepId]??e.evidence??``,onChange:t=>bt(n=>({...n,[e.stepId]:t.target.value})),placeholder:`Tests, review result, or other verification`})]})]}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.status===`completion_proposed`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(i,{size:`sm`,onClick:()=>en(e,`completed`),children:[(0,R.jsx)(le,{}),` Confirm`]}),(0,R.jsx)(i,{size:`sm`,variant:`outline`,onClick:()=>en(e,`in_progress`),children:`Reject`})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(i,{size:`sm`,variant:`outline`,onClick:()=>en(e,`in_progress`),children:`In progress`}),(0,R.jsx)(i,{size:`sm`,variant:`outline`,onClick:()=>en(e,`completed`),children:`Complete`}),(0,R.jsx)(i,{size:`sm`,variant:`ghost`,onClick:()=>en(e,`pending`),children:`Reopen`})]})})]})},e.stepId)})})]})]}),(0,R.jsxs)(u,{value:`members`,className:`space-y-4`,children:[X&&Y.pendingJoins.map(e=>(0,R.jsxs)(ye,{variant:`warning`,children:[(0,R.jsx)(Ne,{}),(0,R.jsxs)(ve,{children:[e.displayName,` wants to join`]}),(0,R.jsxs)(_e,{children:[`Requested `,new Date(e.requestedAt).toLocaleString()]}),(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[(0,R.jsx)(i,{size:`sm`,onClick:()=>$(`accept-${e.id}`,()=>T(`/api/workrooms/members/${e.id}/decision`,{method:`POST`,body:JSON.stringify({accept:!0})}).then(()=>void 0)),children:`Accept`}),(0,R.jsx)(i,{size:`sm`,variant:`outline`,onClick:()=>$(`reject-${e.id}`,()=>T(`/api/workrooms/members/${e.id}/decision`,{method:`POST`,body:JSON.stringify({accept:!1})}).then(()=>void 0)),children:`Reject`})]})]},e.id)),(0,R.jsx)(M,{children:(0,R.jsx)(k,{className:`divide-y divide-border p-0`,children:Y.participants.map(e=>(0,R.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`size-2 rounded-full ${e.revokedAt?`bg-muted-foreground`:`bg-emerald-500`}`}),(0,R.jsx)(`span`,{className:`text-sm font-semibold`,children:e.displayName}),(0,R.jsx)(o,{variant:e.role===`host`?`info`:`secondary`,children:e.role}),e.id===It?.id&&(0,R.jsx)(o,{variant:`success`,children:`You`})]}),(0,R.jsxs)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:[`Joined `,new Date(e.joinedAt).toLocaleString()]})]}),X&&e.role!==`host`&&!e.revokedAt&&(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(i,{size:`sm`,variant:`outline`,onClick:()=>$(`role-${e.id}`,()=>T(`/api/workrooms/members/${e.id}/role`,{method:`PUT`,body:JSON.stringify({role:e.role===`publisher`?`member`:`publisher`})}).then(()=>void 0)),children:e.role===`publisher`?`Make member`:`Make publisher`}),(0,R.jsxs)(i,{size:`sm`,variant:`destructive-outline`,onClick:()=>$(`revoke-${e.id}`,()=>T(`/api/workrooms/members/${e.id}`,{method:`DELETE`}).then(()=>void 0)),children:[(0,R.jsx)(Pe,{}),` Revoke`]})]})]},e.id))})})]}),(0,R.jsx)(u,{value:`activity`,children:(0,R.jsx)(M,{children:(0,R.jsx)(k,{className:`divide-y divide-border p-0`,children:[...Y.activity].reverse().map(e=>(0,R.jsxs)(`div`,{className:`flex gap-3 p-4`,children:[(0,R.jsx)(pe,{className:`mt-0.5 shrink-0 text-muted-foreground`,size:14}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-sm`,children:e.summary}),(0,R.jsxs)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:[`#`,e.sequence,` · `,e.type,` · `,new Date(e.createdAt).toLocaleString()]})]})]},e.sequence))})})}),(0,R.jsxs)(u,{value:`security`,className:`space-y-4`,children:[(0,R.jsxs)(M,{children:[(0,R.jsxs)(j,{children:[(0,R.jsx)(O,{children:`TLS identity`}),(0,R.jsx)(A,{children:`Guests pin this SHA-256 fingerprint from the invitation. Mismatches stop before any password or device credential is sent.`})]}),(0,R.jsx)(k,{children:(0,R.jsx)(`code`,{className:`break-all text-xs`,children:Y.certificateFingerprint})})]}),X&&(0,R.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,R.jsxs)(M,{children:[(0,R.jsxs)(j,{children:[(0,R.jsx)(O,{children:`Rotate room password`}),(0,R.jsx)(A,{children:`Outstanding invitations are revoked. Existing device credentials are revoked by default.`})]}),(0,R.jsxs)(k,{className:`space-y-3`,children:[(0,R.jsx)(a,{type:`password`,value:xt,onChange:e=>St(e.target.value)}),(0,R.jsxs)(i,{variant:`destructive-outline`,onClick:()=>$(`rotate`,()=>T(`/api/workrooms/password/rotate`,{method:`POST`,body:JSON.stringify({password:xt,revokeDevices:!0})}).then(()=>void 0),`Password rotated and guest devices revoked.`),children:[(0,R.jsx)(Te,{}),` Rotate and revoke`]})]})]}),(0,R.jsxs)(M,{children:[(0,R.jsxs)(j,{children:[(0,R.jsx)(O,{children:`Encrypted portable export`}),(0,R.jsx)(A,{children:`Excludes certificates, password hashes, invitations, and device credentials.`})]}),(0,R.jsxs)(k,{className:`space-y-3`,children:[(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsx)(N,{children:`Export passphrase`}),(0,R.jsx)(a,{type:`password`,value:K,onChange:e=>Ct(e.target.value)})]}),(0,R.jsxs)(i,{variant:`outline`,onClick:nn,disabled:K.length<12||s!==null,children:[(0,R.jsx)(we,{}),` Export room`]})]})]})]})]})]})]}):(0,R.jsx)(`div`,{className:`flex justify-center py-24`,children:(0,R.jsx)(x,{className:`size-6`})})}export{Je as WorkroomsPage};
|