@lobu/runtime-server 20.0.1 → 20.1.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/dist/catalogs/connectors.json +98 -1
- package/dist/component.json +1 -1
- package/dist/connectors/chat-user-identity.ts +45 -0
- package/dist/connectors/google-identity.ts +107 -0
- package/dist/connectors/google_drive.ts +36 -151
- package/dist/connectors/google_gmail.ts +149 -0
- package/dist/connectors/microsoft_outlook.ts +193 -0
- package/dist/connectors/slack-identity.ts +20 -0
- package/dist/dependencies.bun.lock +42 -42
- package/dist/owletto/dist/assets/_-CfcfHJO8.js +1 -0
- package/dist/owletto/dist/assets/{_-BTmsEMQo.js → _-DdvHIadV.js} +2 -2
- package/dist/owletto/dist/assets/_agentId-BTmFhpb6.js +1 -0
- package/dist/owletto/dist/assets/{_agentId-DON3NuNk.js → _agentId-DbTBU4KZ.js} +1 -1
- package/dist/owletto/dist/assets/{_automationId-Bprfhhg8.js → _automationId-C7dZzg6X.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey._connectionId-75LMK1pB.js → _connectorKey._connectionId-NQf43Ew3.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey.index-N0fJPz8N.js → _connectorKey.index-D-0ZNsgM.js} +1 -1
- package/dist/owletto/dist/assets/{_conversationId-BY5q9MHG.js → _conversationId-F5YmyLV9.js} +1 -1
- package/dist/owletto/dist/assets/{_deploymentId-DFh2d5Pm.js → _deploymentId-3LTMi0ZT.js} +1 -1
- package/dist/owletto/dist/assets/_name-BKeZbc-h.js +1 -0
- package/dist/owletto/dist/assets/{_owner-B92z-CVu.js → _owner-DglbbDEx.js} +1 -1
- package/dist/owletto/dist/assets/_skillKey-DhiGYYFq.js +1 -0
- package/dist/owletto/dist/assets/{_slug-CvHxtUEf.js → _slug-CnQDfsCE.js} +1 -1
- package/dist/owletto/dist/assets/{accept-invitation-CXSrxBJN.js → accept-invitation-Dgoyublh.js} +1 -1
- package/dist/owletto/dist/assets/{activity-route-view-C9W2Ipni.js → activity-route-view-BNzKO6aD.js} +1 -1
- package/dist/owletto/dist/assets/{agent-card-controls-CLupkefQ.js → agent-card-controls-VJgcB5-0.js} +1 -1
- package/dist/owletto/dist/assets/{agent-client-setup-list-DgFv4h0W.js → agent-client-setup-list-C5KRNRw3.js} +1 -1
- package/dist/owletto/dist/assets/{agent-connect-pages-DT8R_qnj.js → agent-connect-pages-BFSb6vmW.js} +1 -1
- package/dist/owletto/dist/assets/{agent-editor-form-ayUg3Ws1.js → agent-editor-form-CajEehVn.js} +1 -1
- package/dist/owletto/dist/assets/{agent-guardrails-route-D-b6CIt2.js → agent-guardrails-route-CZ_rXj-3.js} +1 -1
- package/dist/owletto/dist/assets/{agent-loading-shells-DjMpSoub.js → agent-loading-shells-Dczhk067.js} +1 -1
- package/dist/owletto/dist/assets/{agent-permissions-matrix-BuGatiEq.js → agent-permissions-matrix-DIVHvpZG.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skill-context-DKpIFmCh.js → agent-skill-context-CxglCznW.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skills-route-DqIMttMK.js → agent-skills-route-CatU8soC.js} +1 -1
- package/dist/owletto/dist/assets/{agent-subpage-shell-Bojgj1uq.js → agent-subpage-shell-DVSUdIBn.js} +1 -1
- package/dist/owletto/dist/assets/agent-thread-DnLUOzXk.js +134 -0
- package/dist/owletto/dist/assets/agents-OLmcj-qM.js +1 -0
- package/dist/owletto/dist/assets/{agents-workbench-BojDv6gX.js → agents-workbench-BOKifKIO.js} +1 -1
- package/dist/owletto/dist/assets/{app._appId-DNNB5FaI.js → app._appId-BXmITXO7.js} +1 -1
- package/dist/owletto/dist/assets/{automation-detail-content-CzqrHc4P.js → automation-detail-content-wJC9hhmA.js} +1 -1
- package/dist/owletto/dist/assets/automations-OLmcj-qM.js +1 -0
- package/dist/owletto/dist/assets/{calendar-VAaxHxss.js → calendar-taCoBmAh.js} +1 -1
- package/dist/owletto/dist/assets/{callback-0VB9tUCF.js → callback-CJxC8u_x.js} +1 -1
- package/dist/owletto/dist/assets/{card-HMQT7vU5.js → card-kpw3EaKC.js} +1 -1
- package/dist/owletto/dist/assets/{claim-C2-YTMw-.js → claim-DLHRN0bA.js} +1 -1
- package/dist/owletto/dist/assets/{clients-C0I3V7XE.js → clients-R4JsT_Fz.js} +1 -1
- package/dist/owletto/dist/assets/{code-editor-hOZHdlxM.js → code-editor-D3X0yQdI.js} +1 -1
- package/dist/owletto/dist/assets/connect-1ysEq9l0.js +1 -0
- package/dist/owletto/dist/assets/connect._clientId-BbMPs6l3.js +1 -0
- package/dist/owletto/dist/assets/{connected._clientId-BFuU4-8j.js → connected._clientId-ByH4etku.js} +1 -1
- package/dist/owletto/dist/assets/{connection-De_2AD46.js → connection-DdBkXNbX.js} +1 -1
- package/dist/owletto/dist/assets/{connection-feed-detail-Cbn85fG9.js → connection-feed-detail-DF93zx0A.js} +1 -1
- package/dist/owletto/dist/assets/{connector-provenance-B17-ze5S.js → connector-provenance-N3sc0nbo.js} +1 -1
- package/dist/owletto/dist/assets/{connectors-KnNED_-4.js → connectors-Ckn_aoNE.js} +1 -1
- package/dist/owletto/dist/assets/{consent-BOYb4pNu.js → consent-Bi6KCVtT.js} +1 -1
- package/dist/owletto/dist/assets/{core.esm-COW6Pfy6.js → core.esm-CFYXLQXH.js} +1 -1
- package/dist/owletto/dist/assets/{create-BFpUZ_mU.js → create-BiHpu2f4.js} +1 -1
- package/dist/owletto/dist/assets/create-C37QtjbJ.js +1 -0
- package/dist/owletto/dist/assets/{create-automation-form-CRenA7Ix.js → create-automation-form-Cv2RHsQ6.js} +1 -1
- package/dist/owletto/dist/assets/create-kAQa5_Q7.js +1 -0
- package/dist/owletto/dist/assets/{create._connectorKey-D4dIDQIQ.js → create._connectorKey-Qynix_hA.js} +1 -1
- package/dist/owletto/dist/assets/{cronstrue-BrlFh5Jy.js → cronstrue-D7xlYtGk.js} +1 -1
- package/dist/owletto/dist/assets/deployments-C5kSeowq.js +1 -0
- package/dist/owletto/dist/assets/{deployments-body-CXqfjLqj.js → deployments-body-BPCALbQe.js} +1 -1
- package/dist/owletto/dist/assets/{device-B0BBIdVx.js → device-DToHXxDM.js} +1 -1
- package/dist/owletto/dist/assets/{device-pin-tombstone-BBYes4en.js → device-pin-tombstone-DrTJYNKG.js} +1 -1
- package/dist/owletto/dist/assets/{device-rows-E63OZ9Cp.js → device-rows-fVm-zAiU.js} +1 -1
- package/dist/owletto/dist/assets/{device._deviceId-JN0cUCGe.js → device._deviceId-CIe7taim.js} +1 -1
- package/dist/owletto/dist/assets/{entity-options-qan9-Ycm.js → entity-options-DOGD_EyZ.js} +1 -1
- package/dist/owletto/dist/assets/{entity-page-CozUOlVP.js → entity-page-C8oDszRY.js} +1 -1
- package/dist/owletto/dist/assets/{entity-type-page-xISySjVW.js → entity-type-page-BfxIgJLq.js} +1 -1
- package/dist/owletto/dist/assets/{events-feed-DmZ3Ig3X.js → events-feed-B9OqmSBy.js} +1 -1
- package/dist/owletto/dist/assets/{full-page-spinner-Q_J5Wcop.js → full-page-spinner-DTSqneUO.js} +1 -1
- package/dist/owletto/dist/assets/guardrails-9Mr6avxk.js +1 -0
- package/dist/owletto/dist/assets/identity-DMfCjdBz.js +1 -0
- package/dist/owletto/dist/assets/{index-BKZMzuMS.js → index-Bfux0kHb.js} +34 -34
- package/dist/owletto/dist/assets/{index-pKfsEvLt.js → index-Bq4m-sK0.js} +1 -1
- package/dist/owletto/dist/assets/{index-CGx4og7r.js → index-CK2-iHcz.js} +1 -1
- package/dist/owletto/dist/assets/{index-C78ucWDF.js → index-CMOHHdFH.js} +1 -1
- package/dist/owletto/dist/assets/{index-BwVojwkg.js → index-COgBJ_ab.js} +1 -1
- package/dist/owletto/dist/assets/index-CkwwaMrx.js +1 -0
- package/dist/owletto/dist/assets/index-D0lZrXrY.js +1 -0
- package/dist/owletto/dist/assets/{index-DmB-3GhU.js → index-DYe_DVHa.js} +1 -1
- package/dist/owletto/dist/assets/index-DZadnZpq.js +1 -0
- package/dist/owletto/dist/assets/{index-DLZbFRSM.js → index-DcWyuLQS.js} +1 -1
- package/dist/owletto/dist/assets/{index-BwN9pHNs.js → index-DkKALC2l.js} +1 -1
- package/dist/owletto/dist/assets/index-DlqjyZKQ.js +1 -0
- package/dist/owletto/dist/assets/index-Dv0huHrO.js +1 -0
- package/dist/owletto/dist/assets/index-DxIDxgPJ.js +1 -0
- package/dist/owletto/dist/assets/index-bKUccXCc.js +1 -0
- package/dist/owletto/dist/assets/{index-C9Dtjaoi.js → index-jGZeANLE.js} +1 -1
- package/dist/owletto/dist/assets/{json-diff-1FNS_wGA.js → json-diff-CANZD4MQ.js} +1 -1
- package/dist/owletto/dist/assets/{list-skeleton-B6gjzr8t.js → list-skeleton-DZTUxpBx.js} +1 -1
- package/dist/owletto/dist/assets/{login-S9EGV_EA.js → login-D53geSP7.js} +1 -1
- package/dist/owletto/dist/assets/{logout-BOXPSr57.js → logout-DKQS25qd.js} +1 -1
- package/dist/owletto/dist/assets/{member-scope-gate-yGr4lrGD.js → member-scope-gate-C4QyRm2Q.js} +1 -1
- package/dist/owletto/dist/assets/{memory-browse-page-5n3MvqdS.js → memory-browse-page-DOpV3vht.js} +1 -1
- package/dist/owletto/dist/assets/{model-selector-9ZRlR7Sa.js → model-selector-CvU3VP90.js} +1 -1
- package/dist/owletto/dist/assets/models-ooBIWFuB.js +1 -0
- package/dist/owletto/dist/assets/new-B8_sRMYD.js +1 -0
- package/dist/owletto/dist/assets/{new-D4wlbvAZ.js → new-DIjOVXrQ.js} +1 -1
- package/dist/owletto/dist/assets/{new-BeZJOJgR.js → new-Df1q7GEj.js} +1 -1
- package/dist/owletto/dist/assets/{oauth-workspace-access-DoE-9F42.js → oauth-workspace-access-DWfiekRz.js} +1 -1
- package/dist/owletto/dist/assets/{organization-BezNEJK7.js → organization-DHEC7kDq.js} +1 -1
- package/dist/owletto/dist/assets/{permissions-GkKtC6a5.js → permissions-i7iwnE1a.js} +1 -1
- package/dist/owletto/dist/assets/{proposal-review-shell-Bk9D_9YN.js → proposal-review-shell-C_LcyUEF.js} +1 -1
- package/dist/owletto/dist/assets/{recent-BVvscz1V.js → recent-By19_Buq.js} +1 -1
- package/dist/owletto/dist/assets/{renderer-CAyr3B3s.js → renderer-B1UThnk2.js} +1 -1
- package/dist/owletto/dist/assets/{reset-password-atCMI5uQ.js → reset-password-Dsz5-Xeo.js} +1 -1
- package/dist/owletto/dist/assets/{runs-CftQDTkq.js → runs-BQ11PAQT.js} +1 -1
- package/dist/owletto/dist/assets/{runs-panel-BkRtr_C4.js → runs-panel-wkV1aGD9.js} +1 -1
- package/dist/owletto/dist/assets/{runs-table-CWCl38L5.js → runs-table-DzSWYkaf.js} +1 -1
- package/dist/owletto/dist/assets/{schema-value-normalization-C9Lm83-q.js → schema-value-normalization--DhnhJNf.js} +1 -1
- package/dist/owletto/dist/assets/{settings-CgTgofgd.js → settings-Bu239SXe.js} +1 -1
- package/dist/owletto/dist/assets/settings-FxbIvOhH.js +1 -0
- package/dist/owletto/dist/assets/skills-MBZ5ilDK.js +1 -0
- package/dist/owletto/dist/assets/{switch-BOGbkDQb.js → switch-CCKllS7w.js} +1 -1
- package/dist/owletto/dist/assets/{use-mention-search-C9ckRw0s.js → use-mention-search-CldNZTiT.js} +1 -1
- package/dist/owletto/dist/index.html +1 -1
- package/dist/server-main.bundle.mjs +3950 -3509
- package/npm-shrinkwrap.json +164 -160
- package/package.json +1 -1
- package/vendor/connector-sdk/dist/file-output.d.ts +97 -0
- package/vendor/connector-sdk/dist/file-output.js +176 -0
- package/vendor/connector-sdk/dist/index.d.ts +2 -0
- package/vendor/connector-sdk/dist/index.js +1 -0
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/classify-error.js +50 -2
- package/vendor/core/dist/constants.d.ts +13 -6
- package/vendor/core/dist/constants.js +22 -8
- package/vendor/core/dist/errors.d.ts +20 -0
- package/vendor/core/dist/errors.js +21 -1
- package/vendor/core/package.json +1 -1
- package/dist/owletto/dist/assets/_-ea0K1u_g.js +0 -1
- package/dist/owletto/dist/assets/_agentId-qF8hi8Cf.js +0 -1
- package/dist/owletto/dist/assets/_name-OY_X_Zm-.js +0 -1
- package/dist/owletto/dist/assets/_skillKey-CeEE23_w.js +0 -1
- package/dist/owletto/dist/assets/agent-thread-R8Pego9t.js +0 -134
- package/dist/owletto/dist/assets/agents-C9x76gSX.js +0 -1
- package/dist/owletto/dist/assets/automations-C9x76gSX.js +0 -1
- package/dist/owletto/dist/assets/connect-DSr_gD8x.js +0 -1
- package/dist/owletto/dist/assets/connect._clientId-CTamwGrw.js +0 -1
- package/dist/owletto/dist/assets/create-CblXKFGZ.js +0 -1
- package/dist/owletto/dist/assets/create-ChUbSYvl.js +0 -1
- package/dist/owletto/dist/assets/deployments-DTFrUY7p.js +0 -1
- package/dist/owletto/dist/assets/guardrails-BB9iOxE3.js +0 -1
- package/dist/owletto/dist/assets/identity-DYbfG4hU.js +0 -1
- package/dist/owletto/dist/assets/index-7d9B918E.js +0 -1
- package/dist/owletto/dist/assets/index-BsDA0XzK.js +0 -1
- package/dist/owletto/dist/assets/index-C4Lz_gB-.js +0 -1
- package/dist/owletto/dist/assets/index-CO65Rkad.js +0 -1
- package/dist/owletto/dist/assets/index-CT_kxGkR.js +0 -1
- package/dist/owletto/dist/assets/index-CrKgNtiq.js +0 -1
- package/dist/owletto/dist/assets/index-DUIbfL6x.js +0 -1
- package/dist/owletto/dist/assets/models-LOhfJ0sb.js +0 -1
- package/dist/owletto/dist/assets/new-Dxn1qrmS.js +0 -1
- package/dist/owletto/dist/assets/settings-BKMOjfYf.js +0 -1
- package/dist/owletto/dist/assets/skills-DWr8qR3U.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a2 as z,Y as F,a9 as L,r,j as e,aa as v,ab as S,B as U,ac as N,ad as E}from"./index-
|
|
1
|
+
import{a2 as z,Y as F,a9 as L,r,j as e,aa as v,ab as S,B as U,ac as N,ad as E}from"./index-Bfux0kHb.js";import{C as A,a as I,b as T,c as k}from"./card-kpw3EaKC.js";import{F as B}from"./full-page-spinner-DTSqneUO.js";function c(l){return l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function H(){const l=z(),{session:u,isReady:d}=F(),{slug:n,name:i}=L.useSearch(),[m,b]=r.useState(i||n||""),[g,h]=r.useState(n||(i?c(i):"")),[y,C]=r.useState(!!n),[x,o]=r.useState(null),[f,p]=r.useState(!1),j=r.useRef(!1);if(r.useEffect(()=>{if(!d||u||j.current)return;j.current=!0;const a=new URL("/orgs/new",window.location.origin);n&&a.searchParams.set("slug",n),i&&a.searchParams.set("name",i);const s=new URL("/auth/login",window.location.origin);s.searchParams.set("callbackUrl",`${a.pathname}${a.search}`),window.location.assign(s.toString())},[d,u,n,i]),!d||!u)return e.jsx(B,{});const P=a=>{const s=E(a);if(s.kind==="cross-host"){window.location.assign(s.href);return}l({to:s.to})},R=async a=>{a.preventDefault(),o(null);const s=m.trim(),w=(g.trim()||c(s)).trim();if(!s){o("Name is required");return}if(!w){o("Slug is required");return}p(!0);try{const t=await N.create({name:s,slug:w});if(t.error){o(t.error.message||"Failed to create organization");return}t.data&&(await N.setActive({organizationId:t.data.id}),P(t.data.slug))}catch(t){o(t instanceof Error?t.message:"An error occurred")}finally{p(!1)}};return e.jsx("div",{className:"container mx-auto max-w-md px-4 py-10",children:e.jsxs(A,{children:[e.jsx(I,{children:e.jsx(T,{children:"Create organization"})}),e.jsx(k,{children:e.jsxs("form",{onSubmit:R,className:"space-y-4",children:[x&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:x}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"org-name",children:["Name",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"org-name",value:m,onChange:a=>{b(a.target.value),y||h(c(a.target.value))},placeholder:"Acme Inc.",autoFocus:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"org-slug",children:["Slug",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"org-slug",value:g,onChange:a=>{C(!0),h(c(a.target.value))},placeholder:"acme"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Used in URLs and as the org id in ",e.jsx("code",{children:"lobu.toml"}),". Lowercase letters, numbers, and hyphens."]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(U,{type:"submit",disabled:f,children:f?"Creating…":"Create organization"})})]})})]})})}export{H as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{gb as l,a2 as u,cU as p,Y as x,bM as b,bv as h,j as e,bc as A,g2 as L,aT as f,g3 as j,L as C,g4 as w,cr as N,bm as S,cZ as k}from"./index-
|
|
1
|
+
import{gb as l,a2 as u,cU as p,Y as x,bM as b,bv as h,j as e,bc as A,g2 as L,aT as f,g3 as j,L as C,g4 as w,cr as N,bm as S,cZ as k}from"./index-Bfux0kHb.js";import{A as y}from"./agent-editor-form-CajEehVn.js";import"./model-selector-CvU3VP90.js";const E="flex min-h-0 flex-1 flex-col gap-3 px-4 pt-4 pb-8 lg:px-6";function O(){const{owner:a}=l.useParams(),n=u(),r=p(),{isAuthenticated:o}=x(),{isMember:i,isLoading:c}=b(),s=o&&i,{data:g=[],isLoading:m}=h({enabled:s});return e.jsx("div",{className:E,children:e.jsxs(A,{className:"flex flex-1 flex-col gap-6",children:[e.jsx(L,{breadcrumb:e.jsx(j,{crumbs:[e.jsx(C,{to:"/$owner/agents",params:{owner:a},className:w,children:"Agents"},"agents")]}),icon:e.jsx(f.agents.icon,{className:"h-6 w-6"}),title:"Build a managed agent",caption:"Create an agent that Lobu runs and manages for this workspace."}),c||s&&m?e.jsx(N,{rows:1}):s?e.jsx(y,{mode:{kind:"create"},existingAgentIds:g.map(t=>t.agentId),onCreated:async t=>{const d=["agents",a];await r.refetchQueries({queryKey:d,exact:!0}),await n({to:"/$owner/agents/$agentId/settings",params:{owner:a,agentId:t},search:{run_id:void 0}})}}):e.jsx(S,{icon:k,title:"Workspace membership required",description:"Only workspace members can build managed agents."})]})})}export{O as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,af as k,aj as $,ak as E,B as R,r as p,al as P}from"./index-BKZMzuMS.js";const W=["mcp:read","mcp:write","mcp:admin"],O=[{value:"read",title:"Read only",description:"Search and view authorized workspace data."},{value:"write",title:"Read and make changes",description:"Includes read access. Create and update authorized workspace data."},{value:"admin",title:"Administer workspaces",description:"Includes read and write access. Manage administrator-only settings.",risk:"high"}],C={read:0,write:1,admin:2};function I(s){return s.includes("mcp:admin")?"admin":s.includes("mcp:write")?"write":s.includes("mcp:read")?"read":null}function F(s,n){const r=s.filter(x=>!W.includes(x));if(!n)return r;const o=I(s);return!o||C[n]>C[o]?r:["mcp:read",...n==="write"||n==="admin"?["mcp:write"]:[],...n==="admin"?["mcp:admin"]:[],...r]}function B({idPrefix:s,clientName:n,requestedScopes:r,accessLevel:o,onAccessLevelChange:x,sensitiveScopesAcknowledged:g=!1,onSensitiveScopesAcknowledgedChange:v,disabled:N=!1}){const f=I(r),j=r.includes("profile:read"),m=r.includes("device_worker:run"),i=r.includes("connections:token"),l=m||i,c=r.filter(t=>!W.includes(t)&&t!=="profile:read"&&t!=="device_worker:run"&&t!=="connections:token");return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("section",{"aria-labelledby":`${s}-application`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-application`,className:"text-sm font-medium",children:"Application"}),e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:n||"Unnamed application"}),e.jsx(k,{variant:"destructive",children:"Unverified"})]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"This name was supplied by the requester. Lobu has not verified the publisher."})]})]}),f&&e.jsxs("fieldset",{className:"space-y-2",disabled:N,children:[e.jsx("legend",{className:"text-sm font-medium",children:"Access level"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose the maximum access this application should receive."}),e.jsx("div",{className:"space-y-2",children:O.filter(t=>C[t.value]<=C[f]).map(t=>{const h=`${s}-access-${t.value}`,b=o===t.value;return e.jsxs("label",{htmlFor:h,className:$("flex cursor-pointer items-start gap-3 rounded-md border p-3 transition-colors",b&&"border-primary bg-primary/5"),children:[e.jsx("input",{id:h,type:"radio",name:`${s}-access-level`,value:t.value,checked:b,onChange:()=>x(t.value),className:"mt-1 h-4 w-4 accent-primary"}),e.jsxs("span",{className:"min-w-0 space-y-0.5",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[t.title,t.risk==="high"&&e.jsx(k,{variant:"destructive",children:"High risk"})]}),e.jsx("span",{className:"block text-sm text-muted-foreground",children:t.description})]})]},t.value)})})]}),j&&e.jsxs("section",{"aria-labelledby":`${s}-profile`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-profile`,className:"text-sm font-medium",children:"Account information"}),e.jsxs("div",{className:"rounded-md border p-3",children:[e.jsxs("p",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:["Basic profile",e.jsx(k,{variant:"secondary",children:"Included"})]}),e.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground",children:"See your basic Lobu identity and the names and slugs of workspaces you belong to."})]})]}),c.length>0&&e.jsxs("section",{"aria-labelledby":`${s}-additional`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-additional`,className:"text-sm font-medium",children:"Additional permissions"}),e.jsx("ul",{className:"space-y-2",children:c.map(t=>e.jsx("li",{className:"rounded-md border p-3 font-mono text-xs text-foreground",children:t},t))})]}),l&&e.jsxs("section",{className:"space-y-3 rounded-md border border-destructive/40 bg-destructive/5 p-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Device capabilities"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"These capabilities are fixed by the device request and cannot be reduced here."})]}),e.jsxs("ul",{className:"space-y-2",children:[m&&e.jsxs("li",{className:"rounded-md bg-background/70 p-3",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Operate this device"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Run jobs and Automations through capabilities advertised by this device."})]}),i&&e.jsxs("li",{className:"rounded-md bg-background/70 p-3",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Use connected services"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Request short-lived access for services you connected to Lobu."})]})]}),e.jsxs("div",{className:"flex items-start gap-3 rounded-md border bg-background p-3",children:[e.jsx(E,{id:`${s}-sensitive-acknowledgement`,checked:g,disabled:N,onCheckedChange:t=>v?.(t===!0),className:"mt-0.5"}),e.jsx("label",{htmlFor:`${s}-sensitive-acknowledgement`,className:"cursor-pointer text-sm font-medium text-foreground",children:"I initiated this request and confirmed that the device code matches."})]})]})]})}function q({idPrefix:s,orgList:n,selectedOrgIds:r,onWorkspaceAccessChange:o,onSelectedOrgChange:x,orgsLoading:g,orgsError:v,onRetry:N,disabled:f=!1,personalRequired:j=!1,allowMultiple:m}){const i=`${s}-workspace-access-legend`,l=r.length===n.length;return g?e.jsxs("section",{"aria-labelledby":i,className:"space-y-2",children:[e.jsx("p",{id:i,className:"text-sm font-medium",children:"Workspace access"}),e.jsx("p",{role:"status","aria-live":"polite",className:"text-sm text-muted-foreground",children:"Loading your workspaces..."})]}):v?e.jsxs("section",{"aria-labelledby":i,className:"space-y-2",children:[e.jsx("p",{id:i,className:"text-sm font-medium",children:"Workspace access"}),e.jsxs("div",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:[e.jsx("p",{children:"Workspaces could not be loaded. Approval is unavailable until they load."}),e.jsx(R,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:N,children:"Retry"})]})]}):n.length===0?e.jsxs("section",{"aria-labelledby":i,className:"space-y-2",children:[e.jsx("p",{id:i,className:"text-sm font-medium",children:"Workspace access"}),e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:"No member workspaces are available for this connection."})]}):e.jsxs("fieldset",{className:"space-y-3",disabled:f,children:[e.jsx("legend",{id:i,className:"sr-only",children:"Workspace access"}),e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Workspaces"}),e.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground",children:m?"Choose where this application can operate.":"Choose one workspace this application can access."})]}),m&&!l&&e.jsxs(R,{type:"button",variant:"outline",size:"sm",onClick:()=>o("all_current"),children:["Select all ",n.length]})]}),j&&e.jsxs("div",{className:"rounded-md border border-primary/20 bg-primary/5 p-3 text-sm",children:[e.jsx("p",{className:"font-medium text-foreground",children:"Device home: Personal workspace"}),e.jsx("p",{className:"mt-0.5 text-muted-foreground",children:m?"Fixed for device data. Additional workspaces grant MCP access only.":"Device data stays in your personal workspace."})]}),e.jsx("div",{className:"space-y-2",children:n.map(c=>{const t=`${s}-workspace-${c.id}`,h=j&&c.isPersonal,b=r.includes(c.id);return e.jsxs("div",{className:$("flex items-start gap-3 rounded-md border p-3 transition-colors",b&&"border-primary/40 bg-primary/5"),children:[e.jsx(E,{id:t,checked:b,disabled:f||h||j&&!m,onCheckedChange:S=>x(c.id,S===!0),className:"mt-0.5"}),e.jsxs("label",{htmlFor:t,className:"min-w-0 flex-1 cursor-pointer space-y-0.5",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[c.name,c.isPersonal&&e.jsx(k,{variant:"outline",children:"Personal"}),h&&e.jsx(k,{variant:"secondary",children:"Required"})]}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:c.slug})]})]},c.id)})}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs text-muted-foreground",children:[e.jsxs("p",{"aria-live":"polite",children:[r.length," of ",n.length," workspaces selected."]}),l&&e.jsx(k,{variant:"secondary",children:"All currently available"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Workspaces you join later are not added automatically."}),r.length===0&&e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Choose at least one workspace."})]})}function D(s,n){p.useEffect(()=>{if(n||s)return;const r=new URL("/auth/login",window.location.origin);r.searchParams.set("callbackUrl",window.location.href),window.location.href=r.toString()},[s,n])}function U(s,n){return s.length===n.length&&s.every((r,o)=>r===n[o])}function T(s={}){const{requirePersonal:n=!1,allowMultiple:r=!0}=s,{data:o,error:x,isPending:g,refetch:v}=P(),[N,f]=p.useState("selected"),[j,m]=p.useState([]),i=p.useRef(!1),l=p.useMemo(()=>o?o.filter(a=>a.is_member).map(a=>({id:a.id,name:a.name,slug:a.slug,isPersonal:a.is_personal===!0})):[],[o]),c=l.find(a=>a.isPersonal)?.id??null,t=p.useRef(l);t.current=l;const h=x instanceof Error?x.message:x?"Unable to load workspaces":null;p.useEffect(()=>{if(g||h)return;const a=l.map(d=>d.id),u=new Set(a);m(d=>{const w=i.current?d.filter(A=>u.has(A)):[c??a[0]].filter(A=>!!A);return i.current=!0,U(d,w)?d:w})},[l,h,g,c]);const b=p.useCallback(a=>{if(a==="all_current"){if(!r)return;m(t.current.map(u=>u.id))}f(a)},[r]),S=p.useCallback((a,u)=>{t.current.some(d=>d.id===a)&&(n&&(a===c||!r)||(f("selected"),m(d=>u?r?d.includes(a)?d:[...d,a]:[a]:d.filter(w=>w!==a))))},[r,c,n]),y=p.useMemo(()=>{const a=new Set(j);return n&&c&&a.add(c),l.filter(u=>a.has(u.id)).map(u=>u.id)},[j,l,c,n]),L=p.useCallback(()=>{const a=t.current,u=a.find(d=>d.isPersonal)?.id??a[0]?.id;i.current=a.length>0,f("selected"),m(u?[u]:[])},[]),_=!g&&!h&&l.length>0&&y.length>0&&(r||y.length===1)&&(!n||c!==null&&y.includes(c)),M=p.useCallback(()=>{v()},[v]);return{orgList:l,workspaceAccess:N,setWorkspaceAccess:b,selectedOrgIds:y,toggleSelectedOrgId:S,resetWorkspaceSelection:L,personalOrgId:c,orgsLoading:g,orgsError:h,retryOrgs:M,workspaceSelectionReady:_}}function V(s){if(!s)return null;try{return new URL(s).pathname.match(/^\/mcp\/([^/]+)$/)?.[1]?.trim()||null}catch{return null}}export{B as A,q as W,I as a,D as b,V as g,F as s,T as u};
|
|
1
|
+
import{j as e,af as k,aj as $,ak as E,B as R,r as p,al as P}from"./index-Bfux0kHb.js";const W=["mcp:read","mcp:write","mcp:admin"],O=[{value:"read",title:"Read only",description:"Search and view authorized workspace data."},{value:"write",title:"Read and make changes",description:"Includes read access. Create and update authorized workspace data."},{value:"admin",title:"Administer workspaces",description:"Includes read and write access. Manage administrator-only settings.",risk:"high"}],C={read:0,write:1,admin:2};function I(s){return s.includes("mcp:admin")?"admin":s.includes("mcp:write")?"write":s.includes("mcp:read")?"read":null}function F(s,n){const r=s.filter(x=>!W.includes(x));if(!n)return r;const o=I(s);return!o||C[n]>C[o]?r:["mcp:read",...n==="write"||n==="admin"?["mcp:write"]:[],...n==="admin"?["mcp:admin"]:[],...r]}function B({idPrefix:s,clientName:n,requestedScopes:r,accessLevel:o,onAccessLevelChange:x,sensitiveScopesAcknowledged:g=!1,onSensitiveScopesAcknowledgedChange:v,disabled:N=!1}){const f=I(r),j=r.includes("profile:read"),m=r.includes("device_worker:run"),i=r.includes("connections:token"),l=m||i,c=r.filter(t=>!W.includes(t)&&t!=="profile:read"&&t!=="device_worker:run"&&t!=="connections:token");return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("section",{"aria-labelledby":`${s}-application`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-application`,className:"text-sm font-medium",children:"Application"}),e.jsxs("div",{className:"rounded-lg border p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-foreground",children:n||"Unnamed application"}),e.jsx(k,{variant:"destructive",children:"Unverified"})]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"This name was supplied by the requester. Lobu has not verified the publisher."})]})]}),f&&e.jsxs("fieldset",{className:"space-y-2",disabled:N,children:[e.jsx("legend",{className:"text-sm font-medium",children:"Access level"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose the maximum access this application should receive."}),e.jsx("div",{className:"space-y-2",children:O.filter(t=>C[t.value]<=C[f]).map(t=>{const h=`${s}-access-${t.value}`,b=o===t.value;return e.jsxs("label",{htmlFor:h,className:$("flex cursor-pointer items-start gap-3 rounded-md border p-3 transition-colors",b&&"border-primary bg-primary/5"),children:[e.jsx("input",{id:h,type:"radio",name:`${s}-access-level`,value:t.value,checked:b,onChange:()=>x(t.value),className:"mt-1 h-4 w-4 accent-primary"}),e.jsxs("span",{className:"min-w-0 space-y-0.5",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[t.title,t.risk==="high"&&e.jsx(k,{variant:"destructive",children:"High risk"})]}),e.jsx("span",{className:"block text-sm text-muted-foreground",children:t.description})]})]},t.value)})})]}),j&&e.jsxs("section",{"aria-labelledby":`${s}-profile`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-profile`,className:"text-sm font-medium",children:"Account information"}),e.jsxs("div",{className:"rounded-md border p-3",children:[e.jsxs("p",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:["Basic profile",e.jsx(k,{variant:"secondary",children:"Included"})]}),e.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground",children:"See your basic Lobu identity and the names and slugs of workspaces you belong to."})]})]}),c.length>0&&e.jsxs("section",{"aria-labelledby":`${s}-additional`,className:"space-y-2",children:[e.jsx("p",{id:`${s}-additional`,className:"text-sm font-medium",children:"Additional permissions"}),e.jsx("ul",{className:"space-y-2",children:c.map(t=>e.jsx("li",{className:"rounded-md border p-3 font-mono text-xs text-foreground",children:t},t))})]}),l&&e.jsxs("section",{className:"space-y-3 rounded-md border border-destructive/40 bg-destructive/5 p-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Device capabilities"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"These capabilities are fixed by the device request and cannot be reduced here."})]}),e.jsxs("ul",{className:"space-y-2",children:[m&&e.jsxs("li",{className:"rounded-md bg-background/70 p-3",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Operate this device"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Run jobs and Automations through capabilities advertised by this device."})]}),i&&e.jsxs("li",{className:"rounded-md bg-background/70 p-3",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Use connected services"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Request short-lived access for services you connected to Lobu."})]})]}),e.jsxs("div",{className:"flex items-start gap-3 rounded-md border bg-background p-3",children:[e.jsx(E,{id:`${s}-sensitive-acknowledgement`,checked:g,disabled:N,onCheckedChange:t=>v?.(t===!0),className:"mt-0.5"}),e.jsx("label",{htmlFor:`${s}-sensitive-acknowledgement`,className:"cursor-pointer text-sm font-medium text-foreground",children:"I initiated this request and confirmed that the device code matches."})]})]})]})}function q({idPrefix:s,orgList:n,selectedOrgIds:r,onWorkspaceAccessChange:o,onSelectedOrgChange:x,orgsLoading:g,orgsError:v,onRetry:N,disabled:f=!1,personalRequired:j=!1,allowMultiple:m}){const i=`${s}-workspace-access-legend`,l=r.length===n.length;return g?e.jsxs("section",{"aria-labelledby":i,className:"space-y-2",children:[e.jsx("p",{id:i,className:"text-sm font-medium",children:"Workspace access"}),e.jsx("p",{role:"status","aria-live":"polite",className:"text-sm text-muted-foreground",children:"Loading your workspaces..."})]}):v?e.jsxs("section",{"aria-labelledby":i,className:"space-y-2",children:[e.jsx("p",{id:i,className:"text-sm font-medium",children:"Workspace access"}),e.jsxs("div",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:[e.jsx("p",{children:"Workspaces could not be loaded. Approval is unavailable until they load."}),e.jsx(R,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:N,children:"Retry"})]})]}):n.length===0?e.jsxs("section",{"aria-labelledby":i,className:"space-y-2",children:[e.jsx("p",{id:i,className:"text-sm font-medium",children:"Workspace access"}),e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:"No member workspaces are available for this connection."})]}):e.jsxs("fieldset",{className:"space-y-3",disabled:f,children:[e.jsx("legend",{id:i,className:"sr-only",children:"Workspace access"}),e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Workspaces"}),e.jsx("p",{className:"mt-0.5 text-sm text-muted-foreground",children:m?"Choose where this application can operate.":"Choose one workspace this application can access."})]}),m&&!l&&e.jsxs(R,{type:"button",variant:"outline",size:"sm",onClick:()=>o("all_current"),children:["Select all ",n.length]})]}),j&&e.jsxs("div",{className:"rounded-md border border-primary/20 bg-primary/5 p-3 text-sm",children:[e.jsx("p",{className:"font-medium text-foreground",children:"Device home: Personal workspace"}),e.jsx("p",{className:"mt-0.5 text-muted-foreground",children:m?"Fixed for device data. Additional workspaces grant MCP access only.":"Device data stays in your personal workspace."})]}),e.jsx("div",{className:"space-y-2",children:n.map(c=>{const t=`${s}-workspace-${c.id}`,h=j&&c.isPersonal,b=r.includes(c.id);return e.jsxs("div",{className:$("flex items-start gap-3 rounded-md border p-3 transition-colors",b&&"border-primary/40 bg-primary/5"),children:[e.jsx(E,{id:t,checked:b,disabled:f||h||j&&!m,onCheckedChange:S=>x(c.id,S===!0),className:"mt-0.5"}),e.jsxs("label",{htmlFor:t,className:"min-w-0 flex-1 cursor-pointer space-y-0.5",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[c.name,c.isPersonal&&e.jsx(k,{variant:"outline",children:"Personal"}),h&&e.jsx(k,{variant:"secondary",children:"Required"})]}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:c.slug})]})]},c.id)})}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs text-muted-foreground",children:[e.jsxs("p",{"aria-live":"polite",children:[r.length," of ",n.length," workspaces selected."]}),l&&e.jsx(k,{variant:"secondary",children:"All currently available"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Workspaces you join later are not added automatically."}),r.length===0&&e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Choose at least one workspace."})]})}function D(s,n){p.useEffect(()=>{if(n||s)return;const r=new URL("/auth/login",window.location.origin);r.searchParams.set("callbackUrl",window.location.href),window.location.href=r.toString()},[s,n])}function U(s,n){return s.length===n.length&&s.every((r,o)=>r===n[o])}function T(s={}){const{requirePersonal:n=!1,allowMultiple:r=!0}=s,{data:o,error:x,isPending:g,refetch:v}=P(),[N,f]=p.useState("selected"),[j,m]=p.useState([]),i=p.useRef(!1),l=p.useMemo(()=>o?o.filter(a=>a.is_member).map(a=>({id:a.id,name:a.name,slug:a.slug,isPersonal:a.is_personal===!0})):[],[o]),c=l.find(a=>a.isPersonal)?.id??null,t=p.useRef(l);t.current=l;const h=x instanceof Error?x.message:x?"Unable to load workspaces":null;p.useEffect(()=>{if(g||h)return;const a=l.map(d=>d.id),u=new Set(a);m(d=>{const w=i.current?d.filter(A=>u.has(A)):[c??a[0]].filter(A=>!!A);return i.current=!0,U(d,w)?d:w})},[l,h,g,c]);const b=p.useCallback(a=>{if(a==="all_current"){if(!r)return;m(t.current.map(u=>u.id))}f(a)},[r]),S=p.useCallback((a,u)=>{t.current.some(d=>d.id===a)&&(n&&(a===c||!r)||(f("selected"),m(d=>u?r?d.includes(a)?d:[...d,a]:[a]:d.filter(w=>w!==a))))},[r,c,n]),y=p.useMemo(()=>{const a=new Set(j);return n&&c&&a.add(c),l.filter(u=>a.has(u.id)).map(u=>u.id)},[j,l,c,n]),L=p.useCallback(()=>{const a=t.current,u=a.find(d=>d.isPersonal)?.id??a[0]?.id;i.current=a.length>0,f("selected"),m(u?[u]:[])},[]),_=!g&&!h&&l.length>0&&y.length>0&&(r||y.length===1)&&(!n||c!==null&&y.includes(c)),M=p.useCallback(()=>{v()},[v]);return{orgList:l,workspaceAccess:N,setWorkspaceAccess:b,selectedOrgIds:y,toggleSelectedOrgId:S,resetWorkspaceSelection:L,personalOrgId:c,orgsLoading:g,orgsError:h,retryOrgs:M,workspaceSelectionReady:_}}function V(s){if(!s)return null;try{return new URL(s).pathname.match(/^\/mcp\/([^/]+)$/)?.[1]?.trim()||null}catch{return null}}export{B as A,q as W,I as a,D as b,V as g,F as s,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cU as ae,cV as W,aD as k,j as e,c7 as P,c8 as pe,cW as M,B as b,cX as fe,cY as be,aj as ye,aS as je,a2 as ve,al as ie,a1 as Ne,k as we,co as S,r as V,Z as Ce,aa as B,ab as K,cZ as Se,c_ as ke,F as ze,s as Y,c$ as H,bw as Oe,ac as _,d0 as _e,d1 as U,d2 as Z,d3 as Pe,ad as Ee,d4 as Ae,d5 as De}from"./index-BKZMzuMS.js";import{o as Fe,u as $e,a as Re,d as Te,C as E,P as Ie,e as Le,A as qe}from"./agent-permissions-matrix-BuGatiEq.js";import{C as G,a as X,b as J,c as ee}from"./card-HMQT7vU5.js";const Qe=[{action:"create_type",label:"Create entity types",description:"Add a new type and its initial fields."},{action:"update_type",label:"Edit entity types",description:"Change fields, write rules, event kinds, or type metadata."},{action:"delete_type",label:"Delete entity types",description:"Remove an entity-type definition."}],We=[{action:"create_relationship_type",label:"Create relationship types",description:"Add a new kind of link between entity types."},{action:"update_relationship_type",label:"Edit relationship types",description:"Change a definition, or which types it may connect."},{action:"delete_relationship_type",label:"Delete relationship types",description:"Remove a relationship-type definition."}];function A(s){return s.resource_class==="entity_schema"&&s.principal_kind===null&&s.entity_type_slug===null&&s.operation_key===null&&s.target_agent_id===null}function Me(s){return s.agent.find(A)}function Ve(s,i){return{...s,agent:[...s.agent.filter(r=>!A(r)),i]}}function Be(s){return{...s,agent:s.agent.filter(i=>!A(i))}}function Ke({label:s,description:i,action:r,value:n,pending:p,onChange:g}){return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 first:border-t-0",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium leading-5 text-foreground",children:s}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:i})]}),e.jsx(Ie,{options:Le("entity_schema",r),value:n,floor:"auto",disabled:p,compact:!0,ariaLabel:s,onChange:g})]})}function se({icon:s,title:i,actions:r,effects:n,pending:p,onChange:g}){return e.jsxs("section",{className:"overflow-hidden rounded-lg border bg-background",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/30 px-4 py-2.5",children:[s,e.jsx("h4",{className:"text-sm font-semibold text-foreground",children:i})]}),r.map(({action:c,label:t,description:m})=>e.jsx(Ke,{action:c,label:t,description:m,value:n[c]??E.entity_schema[c]??"deny",pending:p,onChange:l=>g(c,l)},c))]})}function Ye({owner:s}){const i=ae(),r=Fe(s),n=$e(s),p=W({mutationFn:o=>Re(s,{resource_class:"entity_schema",effects:o}),onSuccess:o=>{i.setQueryData(r,y=>y&&Ve(y,o)),i.invalidateQueries({queryKey:r})},onError:o=>{k.error(o instanceof Error?o.message:"Failed to save schema policy")}}),g=W({mutationFn:()=>Te(s,{resource_class:"entity_schema"}),onSuccess:()=>{i.setQueryData(r,o=>o&&Be(o)),i.invalidateQueries({queryKey:r})},onError:o=>{k.error(o instanceof Error?o.message:"Failed to reset schema policy")}});if(n.isLoading)return e.jsx(P,{label:"schema policy",variant:"cards",cards:1});if(n.isError||!n.data)return e.jsx(pe,{label:"schema policy"});const c=Me(n.data),t=c?.effects??E.entity_schema,m=p.isPending||g.isPending,l=(o,y)=>{p.mutate({...c?.effects??E.entity_schema,[o]:y})};return e.jsxs("div",{className:ye(je,"space-y-3 p-4"),children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Schema changes"}),e.jsx("span",{className:"rounded-full border bg-muted/40 px-2 py-0.5 text-[11px] font-medium text-muted-foreground",children:c?"Custom policy":"Workspace defaults"})]}),e.jsx("p",{className:"max-w-2xl text-xs leading-5 text-muted-foreground",children:"Controls structural changes made by agents and connected AI clients. Auto applies immediately, Ask pauses for a workspace approver, and Deny blocks the change."})]}),c?e.jsxs(b,{type:"button",variant:"outline",size:"sm",disabled:m,onClick:()=>g.mutate(),children:[e.jsx(fe,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove custom policy"]}):null]}),e.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[e.jsx(se,{icon:e.jsx(M,{className:"h-4 w-4 text-muted-foreground"}),title:"Entity types",actions:Qe,effects:t,pending:m,onChange:l}),e.jsx(se,{icon:e.jsx(be,{className:"h-4 w-4 text-muted-foreground"}),title:"Relationship types",actions:We,effects:t,pending:m,onChange:l})]})]})}function te(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function He(s,i,r){const n=s.split("/");return n[1]===i?(n[1]=r,n.join("/")||"/"):`/${r}`}function Ue({owner:s}){const i=ve(),r=ae(),{data:n,error:p}=ie(),{activeOrg:g,urlOrgSlug:c}=Ne(),t=(n??[]).find(a=>a.slug===s&&a.is_member)??null,m=t?.id??s,l=we(m,{name:t?.name??"",slug:t?.slug??"",visibility:t?.visibility??"private"}),[o,y]=l.field("name"),[D,F]=l.field("slug"),[v,$]=l.field("visibility"),[ne,re]=S(m,!!t),[oe,w]=S(m,!1),[R,f]=S(m,null),[z,T]=V.useState(!1),[I,L]=V.useState(!1),[le,O]=S(m,!1);if(Ce(p)&&n===void 0)return e.jsxs(G,{role:"alert",children:[e.jsx(X,{children:e.jsx(J,{children:"Couldn't load organizations"})}),e.jsx(ee,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Please try again in a moment."})})]});if(n===void 0)return e.jsxs("div",{className:"max-w-2xl space-y-6",children:[e.jsx(P,{label:"organization",variant:"cards",cards:1}),e.jsx(P,{label:"visibility",variant:"panel"})]});if(!t)return e.jsxs(G,{children:[e.jsx(X,{children:e.jsx(J,{children:"Organization not found"})}),e.jsx(ee,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You aren't a member of an organization at"," ",e.jsx("span",{className:"font-mono",children:s}),", or it has been deleted."]})})]});const ce=a=>{const x=Ee(a);if(x.kind==="cross-host"){window.location.assign(x.href);return}i({to:x.to})},q=a=>{if(a==="public"&&t.visibility!=="public"){w(!0);return}$(a),w(!1)},de=async()=>{if(!l.canSubmit)return;const a=o.trim();if(!a){f("Name is required");return}const x=D.trim()||te(a);if(!x){f("Slug is required");return}T(!0),f(null);try{const h=a!==t.name||x!==t.slug,N=v!==t.visibility;let d=t.slug;if(h){const j=await _.update({organizationId:t.id,data:{name:a,slug:x}});if(j.error){f(j.error.message||"Failed to update organization");return}d=j.data?.slug??x}N&&(d=(await _e(d,v)).slug),(h||N)&&(l.accept(l.values,{name:a,slug:d,visibility:v}),await r.invalidateQueries({queryKey:["organizations"]}),k.success("Organization updated"));const C=g?.id===t.id||c===t.slug,ue=d!==t.slug;if(C&&ue){const j=U(),Q=Z();if(j===t.slug&&Q){const xe=Pe(window.location.pathname,t.slug)||"/",he=`${window.location.protocol}//${d}.${Q}${xe}${window.location.search}${window.location.hash}`;window.location.assign(he);return}const ge=He(window.location.pathname,t.slug,d);i({to:`${ge}${window.location.search}${window.location.hash}`});return}}catch(h){f(h instanceof Error?h.message:"Failed to update organization")}finally{T(!1)}},me=async()=>{L(!0),f(null);try{const a=await _.delete({organizationId:t.id});if(a.error){f(a.error.message||"Failed to delete organization");return}await r.invalidateQueries({queryKey:["organizations"]}),k.success("Organization deleted");const h=(n??[]).filter(d=>d.is_member).find(d=>d.id!==t.id)??null,N=g?.id===t.id||c===t.slug;if(N&&h){await _.setActive({organizationId:h.id}),ce(h.slug);return}if(N){const d=U(),C=Z();if(d===t.slug&&C){window.location.assign(`${window.location.protocol}//app.${C}/`);return}i({to:"/"});return}i({to:"/"})}catch(a){f(a instanceof Error?a.message:"Failed to delete organization")}finally{L(!1),O(!1)}},u=z||I;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Identity"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(B,{htmlFor:"org-name",children:"Name"}),e.jsx(K,{id:"org-name",value:o,onChange:a=>{y(a.target.value),ne||F(te(a.target.value))},placeholder:"e.g. My Team",disabled:u})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(B,{htmlFor:"org-slug",children:"Slug"}),e.jsx(K,{id:"org-slug",value:D,onChange:a=>{re(!0),F(a.target.value)},placeholder:"e.g. my-team",disabled:u}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Changing the slug rewrites this workspace's URL. Existing links to"," ",e.jsxs("span",{className:"font-mono",children:["/",t.slug]})," redirect for a grace period."]})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Workspace visibility"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose who can browse this workspace and its public pages."})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("button",{type:"button",onClick:()=>q("private"),disabled:u,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${v==="private"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(Se,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Private"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Only members can access this workspace."})]})]}),e.jsxs("button",{type:"button",onClick:()=>q("public"),disabled:u,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${v==="public"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(ke,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Public"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Anyone can browse public pages for this workspace."})]})]})]}),oe&&e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm",children:[e.jsx("p",{className:"text-foreground",children:"Make this workspace public? Catalog-style content may become visible outside the membership."}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx(b,{type:"button",size:"sm",onClick:()=>{$("public"),w(!1)},disabled:u,children:"Confirm public"}),e.jsx(b,{type:"button",size:"sm",variant:"ghost",onClick:()=>w(!1),disabled:u,children:"Cancel"})]})]})]}),R&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:R}),e.jsx(ze,{visible:l.hasConflict,onReload:l.reset}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(b,{variant:"outline",onClick:()=>void i({to:`/${s}`}),disabled:u,children:"Cancel"}),e.jsxs(b,{onClick:de,disabled:u||!l.canSubmit,children:[z?e.jsx(Y,{size:"lg",className:"mr-1.5"}):null,z?"Saving...":"Save changes"]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-baseline gap-2 px-0.5",children:[e.jsxs("h2",{className:"flex items-center gap-1.5 text-sm font-semibold",children:[e.jsx(H,{className:"h-3.5 w-3.5"}),"Agent write defaults"]}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:"saves as you click · agents can only tighten"})]}),e.jsx(qe,{owner:s,variant:"org-floor"})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-baseline gap-2 px-0.5",children:[e.jsxs("h2",{className:"flex items-center gap-1.5 text-sm font-semibold",children:[e.jsx(H,{className:"h-3.5 w-3.5"}),"Schema governance"]}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:"saves as you click"})]}),e.jsx(Ye,{owner:s})]}),e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:t.is_personal?"Personal workspace":"Delete this organization"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t.is_personal?"Your personal workspace can't be deleted — your devices and personal connections are bound to it.":"Permanently removes the organization and all members' workspace access. This cannot be undone."}),!t.is_personal&&e.jsx("div",{className:"mt-3",children:le?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(b,{variant:"destructive",size:"sm",onClick:me,disabled:u,children:[I?e.jsx(Y,{className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>O(!1),disabled:u,children:"Cancel"})]}):e.jsxs(b,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>O(!0),disabled:u,children:[e.jsx(Oe,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete organization"]})})]})]})}function Je(){const{owner:s}=Ae.useParams(),{data:i}=ie(),r=(i??[]).find(n=>n.slug===s&&n.is_member)?.name;return e.jsxs("div",{className:"mx-auto flex w-full max-w-4xl flex-1 flex-col gap-6 px-4 py-6 lg:px-6",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(De,{className:"h-7 w-7"}),e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:"Organization settings"})]}),r?e.jsx("p",{className:"text-base font-medium text-foreground",children:r}):null]}),e.jsx(Ue,{owner:s})]})}export{Je as component};
|
|
1
|
+
import{cU as ae,cV as W,aD as k,j as e,c7 as P,c8 as pe,cW as M,B as b,cX as fe,cY as be,aj as ye,aS as je,a2 as ve,al as ie,a1 as Ne,k as we,co as S,r as V,Z as Ce,aa as B,ab as K,cZ as Se,c_ as ke,F as ze,s as Y,c$ as H,bw as Oe,ac as _,d0 as _e,d1 as U,d2 as Z,d3 as Pe,ad as Ee,d4 as Ae,d5 as De}from"./index-Bfux0kHb.js";import{o as Fe,u as $e,a as Re,d as Te,C as E,P as Ie,e as Le,A as qe}from"./agent-permissions-matrix-DIVHvpZG.js";import{C as G,a as X,b as J,c as ee}from"./card-kpw3EaKC.js";const Qe=[{action:"create_type",label:"Create entity types",description:"Add a new type and its initial fields."},{action:"update_type",label:"Edit entity types",description:"Change fields, write rules, event kinds, or type metadata."},{action:"delete_type",label:"Delete entity types",description:"Remove an entity-type definition."}],We=[{action:"create_relationship_type",label:"Create relationship types",description:"Add a new kind of link between entity types."},{action:"update_relationship_type",label:"Edit relationship types",description:"Change a definition, or which types it may connect."},{action:"delete_relationship_type",label:"Delete relationship types",description:"Remove a relationship-type definition."}];function A(s){return s.resource_class==="entity_schema"&&s.principal_kind===null&&s.entity_type_slug===null&&s.operation_key===null&&s.target_agent_id===null}function Me(s){return s.agent.find(A)}function Ve(s,i){return{...s,agent:[...s.agent.filter(r=>!A(r)),i]}}function Be(s){return{...s,agent:s.agent.filter(i=>!A(i))}}function Ke({label:s,description:i,action:r,value:n,pending:p,onChange:g}){return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 first:border-t-0",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium leading-5 text-foreground",children:s}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:i})]}),e.jsx(Ie,{options:Le("entity_schema",r),value:n,floor:"auto",disabled:p,compact:!0,ariaLabel:s,onChange:g})]})}function se({icon:s,title:i,actions:r,effects:n,pending:p,onChange:g}){return e.jsxs("section",{className:"overflow-hidden rounded-lg border bg-background",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/30 px-4 py-2.5",children:[s,e.jsx("h4",{className:"text-sm font-semibold text-foreground",children:i})]}),r.map(({action:c,label:t,description:m})=>e.jsx(Ke,{action:c,label:t,description:m,value:n[c]??E.entity_schema[c]??"deny",pending:p,onChange:l=>g(c,l)},c))]})}function Ye({owner:s}){const i=ae(),r=Fe(s),n=$e(s),p=W({mutationFn:o=>Re(s,{resource_class:"entity_schema",effects:o}),onSuccess:o=>{i.setQueryData(r,y=>y&&Ve(y,o)),i.invalidateQueries({queryKey:r})},onError:o=>{k.error(o instanceof Error?o.message:"Failed to save schema policy")}}),g=W({mutationFn:()=>Te(s,{resource_class:"entity_schema"}),onSuccess:()=>{i.setQueryData(r,o=>o&&Be(o)),i.invalidateQueries({queryKey:r})},onError:o=>{k.error(o instanceof Error?o.message:"Failed to reset schema policy")}});if(n.isLoading)return e.jsx(P,{label:"schema policy",variant:"cards",cards:1});if(n.isError||!n.data)return e.jsx(pe,{label:"schema policy"});const c=Me(n.data),t=c?.effects??E.entity_schema,m=p.isPending||g.isPending,l=(o,y)=>{p.mutate({...c?.effects??E.entity_schema,[o]:y})};return e.jsxs("div",{className:ye(je,"space-y-3 p-4"),children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Schema changes"}),e.jsx("span",{className:"rounded-full border bg-muted/40 px-2 py-0.5 text-[11px] font-medium text-muted-foreground",children:c?"Custom policy":"Workspace defaults"})]}),e.jsx("p",{className:"max-w-2xl text-xs leading-5 text-muted-foreground",children:"Controls structural changes made by agents and connected AI clients. Auto applies immediately, Ask pauses for a workspace approver, and Deny blocks the change."})]}),c?e.jsxs(b,{type:"button",variant:"outline",size:"sm",disabled:m,onClick:()=>g.mutate(),children:[e.jsx(fe,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove custom policy"]}):null]}),e.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[e.jsx(se,{icon:e.jsx(M,{className:"h-4 w-4 text-muted-foreground"}),title:"Entity types",actions:Qe,effects:t,pending:m,onChange:l}),e.jsx(se,{icon:e.jsx(be,{className:"h-4 w-4 text-muted-foreground"}),title:"Relationship types",actions:We,effects:t,pending:m,onChange:l})]})]})}function te(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function He(s,i,r){const n=s.split("/");return n[1]===i?(n[1]=r,n.join("/")||"/"):`/${r}`}function Ue({owner:s}){const i=ve(),r=ae(),{data:n,error:p}=ie(),{activeOrg:g,urlOrgSlug:c}=Ne(),t=(n??[]).find(a=>a.slug===s&&a.is_member)??null,m=t?.id??s,l=we(m,{name:t?.name??"",slug:t?.slug??"",visibility:t?.visibility??"private"}),[o,y]=l.field("name"),[D,F]=l.field("slug"),[v,$]=l.field("visibility"),[ne,re]=S(m,!!t),[oe,w]=S(m,!1),[R,f]=S(m,null),[z,T]=V.useState(!1),[I,L]=V.useState(!1),[le,O]=S(m,!1);if(Ce(p)&&n===void 0)return e.jsxs(G,{role:"alert",children:[e.jsx(X,{children:e.jsx(J,{children:"Couldn't load organizations"})}),e.jsx(ee,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Please try again in a moment."})})]});if(n===void 0)return e.jsxs("div",{className:"max-w-2xl space-y-6",children:[e.jsx(P,{label:"organization",variant:"cards",cards:1}),e.jsx(P,{label:"visibility",variant:"panel"})]});if(!t)return e.jsxs(G,{children:[e.jsx(X,{children:e.jsx(J,{children:"Organization not found"})}),e.jsx(ee,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You aren't a member of an organization at"," ",e.jsx("span",{className:"font-mono",children:s}),", or it has been deleted."]})})]});const ce=a=>{const x=Ee(a);if(x.kind==="cross-host"){window.location.assign(x.href);return}i({to:x.to})},q=a=>{if(a==="public"&&t.visibility!=="public"){w(!0);return}$(a),w(!1)},de=async()=>{if(!l.canSubmit)return;const a=o.trim();if(!a){f("Name is required");return}const x=D.trim()||te(a);if(!x){f("Slug is required");return}T(!0),f(null);try{const h=a!==t.name||x!==t.slug,N=v!==t.visibility;let d=t.slug;if(h){const j=await _.update({organizationId:t.id,data:{name:a,slug:x}});if(j.error){f(j.error.message||"Failed to update organization");return}d=j.data?.slug??x}N&&(d=(await _e(d,v)).slug),(h||N)&&(l.accept(l.values,{name:a,slug:d,visibility:v}),await r.invalidateQueries({queryKey:["organizations"]}),k.success("Organization updated"));const C=g?.id===t.id||c===t.slug,ue=d!==t.slug;if(C&&ue){const j=U(),Q=Z();if(j===t.slug&&Q){const xe=Pe(window.location.pathname,t.slug)||"/",he=`${window.location.protocol}//${d}.${Q}${xe}${window.location.search}${window.location.hash}`;window.location.assign(he);return}const ge=He(window.location.pathname,t.slug,d);i({to:`${ge}${window.location.search}${window.location.hash}`});return}}catch(h){f(h instanceof Error?h.message:"Failed to update organization")}finally{T(!1)}},me=async()=>{L(!0),f(null);try{const a=await _.delete({organizationId:t.id});if(a.error){f(a.error.message||"Failed to delete organization");return}await r.invalidateQueries({queryKey:["organizations"]}),k.success("Organization deleted");const h=(n??[]).filter(d=>d.is_member).find(d=>d.id!==t.id)??null,N=g?.id===t.id||c===t.slug;if(N&&h){await _.setActive({organizationId:h.id}),ce(h.slug);return}if(N){const d=U(),C=Z();if(d===t.slug&&C){window.location.assign(`${window.location.protocol}//app.${C}/`);return}i({to:"/"});return}i({to:"/"})}catch(a){f(a instanceof Error?a.message:"Failed to delete organization")}finally{L(!1),O(!1)}},u=z||I;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Identity"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(B,{htmlFor:"org-name",children:"Name"}),e.jsx(K,{id:"org-name",value:o,onChange:a=>{y(a.target.value),ne||F(te(a.target.value))},placeholder:"e.g. My Team",disabled:u})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(B,{htmlFor:"org-slug",children:"Slug"}),e.jsx(K,{id:"org-slug",value:D,onChange:a=>{re(!0),F(a.target.value)},placeholder:"e.g. my-team",disabled:u}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Changing the slug rewrites this workspace's URL. Existing links to"," ",e.jsxs("span",{className:"font-mono",children:["/",t.slug]})," redirect for a grace period."]})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Workspace visibility"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose who can browse this workspace and its public pages."})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("button",{type:"button",onClick:()=>q("private"),disabled:u,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${v==="private"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(Se,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Private"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Only members can access this workspace."})]})]}),e.jsxs("button",{type:"button",onClick:()=>q("public"),disabled:u,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${v==="public"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(ke,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Public"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Anyone can browse public pages for this workspace."})]})]})]}),oe&&e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm",children:[e.jsx("p",{className:"text-foreground",children:"Make this workspace public? Catalog-style content may become visible outside the membership."}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx(b,{type:"button",size:"sm",onClick:()=>{$("public"),w(!1)},disabled:u,children:"Confirm public"}),e.jsx(b,{type:"button",size:"sm",variant:"ghost",onClick:()=>w(!1),disabled:u,children:"Cancel"})]})]})]}),R&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:R}),e.jsx(ze,{visible:l.hasConflict,onReload:l.reset}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(b,{variant:"outline",onClick:()=>void i({to:`/${s}`}),disabled:u,children:"Cancel"}),e.jsxs(b,{onClick:de,disabled:u||!l.canSubmit,children:[z?e.jsx(Y,{size:"lg",className:"mr-1.5"}):null,z?"Saving...":"Save changes"]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-baseline gap-2 px-0.5",children:[e.jsxs("h2",{className:"flex items-center gap-1.5 text-sm font-semibold",children:[e.jsx(H,{className:"h-3.5 w-3.5"}),"Agent write defaults"]}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:"saves as you click · agents can only tighten"})]}),e.jsx(qe,{owner:s,variant:"org-floor"})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-baseline gap-2 px-0.5",children:[e.jsxs("h2",{className:"flex items-center gap-1.5 text-sm font-semibold",children:[e.jsx(H,{className:"h-3.5 w-3.5"}),"Schema governance"]}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:"saves as you click"})]}),e.jsx(Ye,{owner:s})]}),e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:t.is_personal?"Personal workspace":"Delete this organization"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t.is_personal?"Your personal workspace can't be deleted — your devices and personal connections are bound to it.":"Permanently removes the organization and all members' workspace access. This cannot be undone."}),!t.is_personal&&e.jsx("div",{className:"mt-3",children:le?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(b,{variant:"destructive",size:"sm",onClick:me,disabled:u,children:[I?e.jsx(Y,{className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>O(!1),disabled:u,children:"Cancel"})]}):e.jsxs(b,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>O(!0),disabled:u,children:[e.jsx(Oe,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete organization"]})})]})]})}function Je(){const{owner:s}=Ae.useParams(),{data:i}=ie(),r=(i??[]).find(n=>n.slug===s&&n.is_member)?.name;return e.jsxs("div",{className:"mx-auto flex w-full max-w-4xl flex-1 flex-col gap-6 px-4 py-6 lg:px-6",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(De,{className:"h-7 w-7"}),e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:"Organization settings"})]}),r?e.jsx("p",{className:"text-base font-medium text-foreground",children:r}):null]}),e.jsx(Ue,{owner:s})]})}export{Je as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a1 as r,g as i,j as e,hr as m}from"./index-
|
|
1
|
+
import{a1 as r,g as i,j as e,hr as m}from"./index-Bfux0kHb.js";import{A as c}from"./agent-permissions-matrix-DIVHvpZG.js";import{A as l}from"./agent-subpage-shell-DVSUdIBn.js";function g({owner:s,agentId:t}){const{orgContext:n}=r(),{isAdmin:a,isLoading:o}=i(n.organizationId);return e.jsx(l,{owner:s,agentId:t,backLabel:"Permissions",backTo:"/$owner/agents/$agentId/permissions",children:a?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Control which data, agent settings, and connector actions this agent may use automatically, with approval, or not at all."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx(c,{owner:s,agentId:t})})]}):o?null:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Only organization admins can view or change agent permissions."})})}function p(){const{owner:s,agentId:t}=m.useParams();return e.jsx(g,{owner:s,agentId:t})}export{p as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{eI as f,ef as w,eg as y,r as N,j as e,bF as k,B as d,aa as C,ea as P}from"./index-
|
|
1
|
+
import{eI as f,ef as w,eg as y,r as N,j as e,bF as k,B as d,aa as C,ea as P}from"./index-Bfux0kHb.js";import{u as A}from"./runs-BQ11PAQT.js";function B({resource:g,runId:t,children:h,onDone:l}){const c=!!t,{data:a,isLoading:E,isError:u,refetch:v}=A(g,c?t:void 0),s=f({isReview:c,isError:u,status:a?.status}),m=a?.status==="pending"?a.proposal:null,n=w(),i=y(),[p,x]=N.useState(""),o=n.isPending||i.isPending,j=s==="active"||s==="loading"||s==="error",b=()=>{t&&n.mutate({run_id:t},{onSuccess:()=>l?.()})},R=()=>{if(!t)return;const r=p.trim();i.mutate({run_id:t,...r?{reason:r}:{}},{onSuccess:()=>l?.()})};return e.jsxs("div",{className:"grid content-start gap-4",children:[s==="active"?e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Review the change the builder agent proposed. The values below show the proposed change — ",e.jsx("strong",{children:"Approve"})," to apply, or"," ",e.jsx("strong",{children:"Reject"}),"."]})]})}):null,s==="gone"?e.jsx("div",{className:"rounded-lg border bg-muted/30 p-3 text-sm text-muted-foreground",children:"This change is no longer pending (it may have been approved or rejected already)."}):null,s==="error"?e.jsx("div",{className:"rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("p",{className:"text-destructive",children:"Couldn't load the proposed change to review. Editing is disabled until it loads — retry, or reopen the link."}),e.jsx(d,{type:"button",variant:"outline",size:"sm",onClick:()=>void v(),children:"Retry"})]})}):null,h({reviewMode:s,proposal:m,controlsDisabled:j}),s==="active"?e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(C,{htmlFor:"review-reject-reason",children:"Reason (optional)"}),e.jsx(P,{id:"review-reject-reason",rows:2,value:p,onChange:r=>x(r.target.value),placeholder:"Why you're rejecting — shared back to the requester.",disabled:o})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-end",children:[e.jsx(d,{type:"button",variant:"outline",onClick:R,disabled:o,children:i.isPending?"Rejecting...":"Reject"}),e.jsx(d,{type:"button",onClick:b,disabled:o,children:n.isPending?"Approving...":"Approve"})]})]}):null]})}export{B as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aT as t,j as e,aU as o,aV as d,aW as m,aX as h}from"./index-
|
|
1
|
+
import{aT as t,j as e,aU as o,aV as d,aW as m,aX as h}from"./index-Bfux0kHb.js";function p({section:s,icon:a,title:i,description:n,action:l}){const c=s?t[s]:null,x=s!==void 0?t[s].icon:a,r=i??c?.label??"";return e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(x,{className:"h-7 w-7 shrink-0","aria-hidden":!0}),e.jsx("h1",{className:"font-display text-3xl font-semibold leading-tight",children:r})]}),n?e.jsx("p",{className:"text-sm text-muted-foreground",children:n}):null]}),l?e.jsx("div",{className:"shrink-0",children:l}):null]})}function u(){const{owner:s}=o.useParams();return e.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 pt-4 pb-8 lg:px-6",children:e.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:e.jsx(d,{owner:s,children:a=>e.jsxs("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col gap-4",children:[e.jsx(p,{icon:m,title:"Recent",description:"Chats, connected apps, and Automations you used last."}),e.jsx(h,{owner:a.ownerSlug,tone:"page",empty:"message"})]})})})})}export{u as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as Ge,j as $,B as qc,E as II,cy as jN,cz as KN,cA as pp,cB as JN,dA as QN,f2 as eB,fE as tB,cC as rB,cD as Cx,aj as LI,U as nB,dU as aB,aS as iB,eM as oB,aL as sB}from"./index-
|
|
1
|
+
import{r as Ge,j as $,B as qc,E as II,cy as jN,cz as KN,cA as pp,cB as JN,dA as QN,f2 as eB,fE as tB,cC as rB,cD as Cx,aj as LI,U as nB,dU as aB,aS as iB,eM as oB,aL as sB}from"./index-Bfux0kHb.js";import{c as lB,d as uB,b as fB,a as vB,C as cB}from"./card-kpw3EaKC.js";const hB=r=>r!=null;function dB(r,e,t=hB){let n=r;for(const a of e.replace(/\[(\d+)\]/g,".$1").split(".")){if(!t(n))return;n=n[a]}return n}function pB(r,e,t){return typeof r!="string"?r:r.startsWith("@")?e?.[r.slice(1)]:r.startsWith("{{")&&r.endsWith("}}")&&r.indexOf("}}")===r.length-2?t(r.slice(2,-2).trim()):r.replace(/\{\{(.+?)\}\}/g,(n,a)=>{const i=t(a.trim());return i===void 0?"":String(i)})}const gB=new Set(["type","children","props","path","fallback","key"]);function yB(r,e){const t={};for(const[n,a]of Object.entries(r))gB.has(n)||(t[n]=a);return Object.assign(t,e)}const mB=/^\d{4}-\d{2}-\d{2}(?:[tT ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/,_B=/^\d{4}-\d{2}-\d{2}$/;function SB(r){return mB.test(r)}function jc(r){if(!/^https?:\/\//i.test(r))return!1;try{const e=new URL(r);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}function PI(r){return r.replace(/[-_]/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())}function Tx(r){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:r>=1e3?"compact":"standard",maximumFractionDigits:r>=1e9?1:0}).format(r)}function Ax(r){return new Intl.NumberFormat("en-US",{maximumFractionDigits:Number.isInteger(r)?0:2}).format(r)}function Mx(r){const e=new Date(_B.test(r)?`${r}T00:00:00`:r);return Number.isNaN(e.getTime())?r:e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function Dx(r){try{const e=new URL(r),t=e.hostname.replace(/^www\./i,""),n=e.pathname&&e.pathname!=="/"?e.pathname.replace(/\/$/,""):"";return`${t}${n}`}catch{return r}}function fm(r){return r==null?"":typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(RI(r)):Array.isArray(r)?r.some(e=>typeof e=="object"&&e!==null)?r.map((e,t)=>`${t+1}. ${fm(e)}`).join(`
|
|
2
2
|
`):JSON.stringify(r):typeof r=="object"?Object.entries(r).filter(([,t])=>t!=null&&t!=="").map(([t,n])=>`${PI(t)}: ${fm(n)}`).join("; "):JSON.stringify(r)}function RI(r,e){if(r==null)return"";if(typeof r=="boolean")return r?"Yes":"No";if(typeof r=="number")return e==="currency"?Tx(r):e===void 0||e==="text"?String(r):Ax(r);if(typeof r!="string")return fm(r);switch(e){case"currency":return Tx(Number(r));case"date":return Mx(r);case"url":return Dx(r);case"enum":return PI(r);case"number":return Ax(Number(r));case"auto":return jc(r)?Dx(r):SB(r)?Mx(r):r;default:return r}}function xB(r){return r==null?null:typeof r=="string"||typeof r=="number"||typeof r=="boolean"?String(r):null}function EI(r,e){return typeof r!="string"||!r.startsWith("@")||r.length===1?null:{action:r.slice(1),value:xB(e)}}/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{am as v,r as a,j as e,L as h,an as j,ag as y,ao as N}from"./index-
|
|
1
|
+
import{am as v,r as a,j as e,L as h,an as j,ag as y,ao as N}from"./index-Bfux0kHb.js";import{C as k,a as C,b as S,c as L}from"./card-kpw3EaKC.js";function R(){const{token:n,error:x}=v.useSearch(),[o,p]=a.useState(""),[i,f]=a.useState(""),[d,s]=a.useState(null),[l,c]=a.useState(!1),[u,g]=a.useState(!1),w=async t=>{if(t.preventDefault(),!n){s("This reset link is invalid or expired.");return}if(o.length<8){s("Password must be at least 8 characters.");return}if(o!==i){s("Passwords do not match.");return}c(!0),s(null);try{const r=await j(`${y}/api/auth/reset-password`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:n,newPassword:o})});if(!r.ok)throw await N(r);g(!0)}catch(r){s(r instanceof Error?r.message:"Failed to reset password")}finally{c(!1)}},b=!n||x==="INVALID_TOKEN",m={callbackUrl:void 0,mode:void 0,error:void 0,errorDescription:void 0,loginHint:void 0,invitationOrg:void 0,intent:void 0};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsxs(k,{children:[e.jsx(C,{children:e.jsx(S,{asChild:!0,children:e.jsx("h1",{className:"text-center text-2xl",children:"Reset your password"})})}),e.jsx(L,{children:b&&!u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-destructive",children:"This reset link is invalid or expired."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Back to sign in"})]}):u?e.jsxs("div",{className:"mt-6 space-y-4 text-center",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your password has been reset successfully."}),e.jsx(h,{to:"/auth/login",search:m,className:"text-sm text-primary hover:underline",children:"Continue to sign in"})]}):e.jsxs("form",{onSubmit:w,className:"mt-6 space-y-4",children:[d&&e.jsx("div",{className:"p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:d}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"new-password",className:"block text-sm font-medium",children:"New password"}),e.jsx("input",{id:"new-password",type:"password",value:o,onChange:t=>p(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirm-password",className:"block text-sm font-medium",children:"Confirm new password"}),e.jsx("input",{id:"confirm-password",type:"password",value:i,onChange:t=>f(t.target.value),minLength:8,required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l?"Resetting password...":"Reset password"})]})})]})]})})}export{R as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dc as s,cE as d,fq as c,cF as l,an as f,fr as g}from"./index-
|
|
1
|
+
import{dc as s,cE as d,fq as c,cF as l,an as f,fr as g}from"./index-Bfux0kHb.js";const y=30,_=new Set(["running","pending","claimed"]);function I(n){return"connectionId"in n?["connection",n.connectionId]:"deviceId"in n?["device",n.deviceId]:"connectorKey"in n?["connector",n.connectorKey]:["feed",n.feedId]}function m(n){return"connectionId"in n?{connection_ids:[n.connectionId]}:"deviceId"in n?{device_worker_id:n.deviceId}:"connectorKey"in n?{connector_key:n.connectorKey}:{feed_ids:[n.feedId]}}function v(n,t,i){return c({queryKey:["runs-infinite",i??null,n?I(n):null,t.runTypes??null,t.status??null],queryFn:async({pageParam:e})=>{const a=e;return l("manage_operations",{action:"list_runs",...m(n),...t.runTypes&&t.runTypes.length>0?{run_types:t.runTypes}:{},...t.status?{status:t.status}:{},...a?{before_id:a.before_id,before_created_at:a.before_created_at}:{},limit:y},i?{slug:i}:void 0)},initialPageParam:null,getNextPageParam:e=>{if(!e.has_more)return;const a=e.runs[e.runs.length-1];if(a)return{before_id:a.id,before_created_at:a.created_at}},refetchInterval:e=>(e.state.data?.pages??[]).some(o=>o.runs.some(u=>_.has(u.status)))?5e3:!1,enabled:!!n,staleTime:15e3})}function p(n,t){return n.kind==="agent"?n.agentId?`/${n.agentId}/config/pending/${t}`:null:n.agentId&&n.automationId?`/${n.agentId}/automations/${n.automationId}/pending/${t}`:null}function T(n,t){const{slug:i}=s(),e=t!=null?p(n,t):null,a=n.kind==="agent"?["agent",n.agentId]:["automation",n.agentId,n.automationId];return d({queryKey:["pending-proposal",i,...a,t],queryFn:async()=>{const r=await f(g(i,e),{credentials:"include"});if(r.status===404)return{status:"gone"};if(!r.ok)throw new Error(`Failed to fetch pending proposal: ${r.status}`);return{status:"pending",proposal:await r.json()}},enabled:!!i&&!!e&&!!t,staleTime:0,retry:!1})}export{v as a,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,aj as h,bY as k,bZ as T,b_ as w,b$ as A,c0 as C,S as l,r,s as I}from"./index-
|
|
1
|
+
import{j as e,aj as h,bY as k,bZ as T,b_ as w,b$ as A,c0 as C,S as l,r,s as I}from"./index-Bfux0kHb.js";import{a as P}from"./runs-BQ11PAQT.js";import{R as E}from"./runs-table-DzSWYkaf.js";const f=[{value:"all",label:"All"},{value:"sync",label:"Sync",runTypes:["sync"]},{value:"action",label:"Action",runTypes:["action"]},{value:"auth",label:"Auth",runTypes:["auth"]}];function F(s){return f.find(t=>t.value===s)?.runTypes}const B=[{value:"all",label:"All statuses"},{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"},{value:"pending",label:"Pending"}];function L({bucket:s,status:t,onBucketChange:a,onStatusChange:u}){return e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",children:f.map(n=>e.jsx("button",{type:"button",onClick:()=>a(n.value),className:h("rounded px-3 py-1 transition-colors",s===n.value?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"),children:n.label},n.value))}),e.jsxs(k,{value:t,onValueChange:u,children:[e.jsx(T,{className:"w-[150px]",children:e.jsx(w,{})}),e.jsx(A,{children:B.map(n=>e.jsx(C,{value:n.value,children:n.label},n.value))})]})]})}function M({labels:s,className:t}){return e.jsx("div",{className:h("inline-flex rounded-md border bg-muted/30 p-0.5 text-sm",t),children:s.map((a,u)=>e.jsx("span",{className:u===0?"rounded bg-background px-3 py-1 text-foreground ":"px-3 py-1 text-muted-foreground",children:a},a))})}function v({rows:s=6}){return e.jsxs("div",{className:"rounded-lg border",role:"status","aria-label":"Loading runs",children:[e.jsx("div",{className:"border-b px-3 py-2",children:e.jsx(l,{className:"h-3 w-1/4"})}),e.jsx("div",{className:"divide-y",children:Array.from({length:s}).map((t,a)=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsx(l,{className:"h-3.5 w-3.5 rounded-full shrink-0"}),e.jsx(l,{className:"h-3 w-20"}),e.jsx(l,{className:"h-3 w-16"}),e.jsx(l,{className:"ml-auto h-3 w-12 shrink-0"}),e.jsx(l,{className:"h-7 w-7 rounded-md shrink-0"})]},a))})]})}function K({rows:s=6}){return e.jsxs("div",{className:"space-y-4",role:"status","aria-label":"Loading runs",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(M,{labels:["All","Sync","Action","Auth"]}),e.jsx("div",{className:"h-9 w-[150px] rounded-md border border-input"})]}),e.jsx(v,{rows:s})]})}function V({scope:s,ownerSlug:t}){const[a,u]=r.useState("all"),[n,b]=r.useState("all"),j=r.useMemo(()=>({runTypes:F(a),status:n==="all"?void 0:n}),[a,n]),{data:i,isLoading:N,isError:y,hasNextPage:o,isFetchingNextPage:d,fetchNextPage:x}=P(s,j,t),m=r.useMemo(()=>i?.pages.flatMap(c=>c.runs)??[],[i]),S={runType:a==="all",feed:!0,connection:"deviceId"in s||"connectorKey"in s},p=r.useRef(null);return r.useEffect(()=>{const c=p.current;if(!c||!o)return;const g=new IntersectionObserver(R=>{R[0]?.isIntersecting&&!d&&x()},{rootMargin:"200px"});return g.observe(c),()=>g.disconnect()},[o,d,x]),e.jsxs("div",{className:"space-y-3",children:[e.jsx(L,{bucket:a,status:n,onBucketChange:u,onStatusChange:b}),N?e.jsx(v,{}):y?e.jsx("p",{className:"rounded-lg border bg-destructive/5 px-3 py-6 text-center text-xs text-destructive",children:"Failed to load runs."}):m.length===0?e.jsx("p",{className:"rounded-lg border bg-muted/20 px-3 py-6 text-center text-xs text-muted-foreground",children:"No runs yet."}):e.jsxs(e.Fragment,{children:[e.jsx(E,{runs:m,ownerSlug:t,columns:S}),e.jsx("div",{ref:p,className:"h-1"}),d&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsx(I,{size:"lg",className:"text-muted-foreground"})})]})]})}export{V as R,K as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,aj as f,J as v,fj as k,S as g,fk as w,n as C,fl as F,bm as P,fm as D,B as S,L as j,P as z,x as T,dU as O,aR as $,cM as U,dl as H,dm as q,dn as M,fn as J,fo as W,cy as K,cz as G,cA as N,cB as u,cC as X,cD as x,eW as Y,af as Q,fp as Z,cs as ee,az as te,s as se,bJ as ne,r as L,ci as A,cj as R,ck as E}from"./index-BKZMzuMS.js";import{c as ae}from"./connection-label-BobuYiAG.js";const re={amber:"bg-amber-500",muted:"bg-muted-foreground/40",destructive:"bg-destructive"};function B({tone:t}){return e.jsx("span",{"aria-hidden":t===null,className:f("h-1.5 w-1.5 shrink-0 rounded-full",t===null?"bg-transparent":re[t])})}function I(t){switch(t.attention){case"needs_auth":return"Needs authentication";case"setup_required":return t.attention_reason?.trim()||"Setup required";case"paused":return"Paused";case"misconfigured":return"Configuration error";case"device_offline":return`Waiting for ${t.device_label||t.device_platform||"device"}`;case"last_attempt_failed":{const n=Number(t.consecutive_failures??0);return t.last_error?.trim()||(n>0?`${n} consecutive sync ${n===1?"failure":"failures"}`:"Last sync failed")}case"overdue":return"Scheduled run overdue";case"no_trigger":return"No schedule — this feed only runs when you sync it";case"never_run":return t.execution_mode==="scheduled"?"Scheduled, not run yet":"Not synced yet";default:return null}}function ie(t){switch(t.attention){case"last_attempt_failed":case"misconfigured":return"destructive";case"needs_auth":case"setup_required":case"device_offline":case"overdue":case"no_trigger":case"never_run":return t.attention==="never_run"&&t.execution_mode!=="scheduled"?"muted":"amber";case"paused":return"muted";default:return t.status==="active"?null:t.status==="error"?"destructive":"muted"}}function ce(t){return Object.keys(t?.feeds_schema??{}).length>0}const y=new Set(["error","revoked","pending_auth"]),oe={pending_auth:"needs reconnect",revoked:"revoked",error:"error",paused:"paused",active:"active"};function Ne({connections:t,connectorDef:n,organizationId:r,ownerSlug:c,connectorKey:s,isLoading:a=!1}){const d=v(),i=t.filter(m=>y.has(m.status)||!!n&&k(n)&&!m.device_worker_id).length;if(a)return e.jsx(g,{className:"h-16 w-full rounded-lg"});const l=t.length;return e.jsx(w,{title:"Connections",summary:`${l} ${l===1?"connection":"connections"}${i?` · ${i} ${i===1?"needs":"need"} attention`:""}`,onOpen:()=>d?.open({href:"",title:"Connections",connectorPanel:{section:"connections",connectorKey:s,organizationId:r,ownerSlug:c}})})}function ve({connections:t,connectorDef:n,ownerSlug:r,connectorKey:c}){if(t.length===0)return null;const s=[...t].sort((a,d)=>{const i=y.has(a.status)?0:1,l=y.has(d.status)?0:1;return i-l});return e.jsx("ul",{className:"flex flex-col gap-2",children:s.map(a=>{const d=ae({...a,connector_name:a.connector_name??n?.name??null}),i=!!n&&k(n)&&!a.device_worker_id,l=a.status==="error"||a.status==="revoked"||a.status==="pending_auth";return e.jsx("li",{children:e.jsxs(j,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:r,connectorKey:c,connectionId:String(a.id)},search:{},className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2.5 transition-colors hover:bg-accent/50",children:[e.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx(B,{tone:a.status==="active"?null:a.status==="error"||a.status==="revoked"?"destructive":"amber"}),e.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:d})]}),e.jsxs("span",{className:"flex min-w-0 max-w-1/2 shrink-0 items-center gap-2",children:[i?e.jsx("span",{className:"shrink-0 text-xs text-amber-600",children:"Needs a device"}):l?e.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:a.error_message?.trim()||oe[a.status]||a.status}):null,e.jsx(O,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"})]})]})},a.id)})})}function ke({connection:t,ownerSlug:n,connectorKey:r,connectorDef:c}){const{data:s=[],isLoading:a}=C(t.id),d=ce(c),i=t.facets?.chat??!1,{inspectFeed:l}=F(),m=c?.feeds_schema??{},p={owner:n,connectorKey:r,connectionId:String(t.id)};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(g,{className:"h-12 w-full rounded-lg"}),e.jsx(g,{className:"h-12 w-full rounded-lg"})]}):s.length===0?e.jsx(P,{icon:D,title:i?"No channels":"No feeds",description:d?i?"Bind a channel to route conversations to this connection.":"Add a feed to start collecting data from this connection.":i?"This chat connection has no bound channels yet.":"This connector doesn't provide any feeds.",children:d?e.jsx(S,{asChild:!0,size:"sm",children:e.jsxs(j,{to:"/$owner/connectors/$connectorKey/$connectionId",params:p,search:{addFeed:!0},children:[e.jsx(z,{className:"h-3.5 w-3.5"}),i?"Add channel":"Add feed"]})}):null}):e.jsx("ul",{className:"flex flex-col gap-2",children:s.map(o=>{const h=o.display_name?.trim()||o.feed_key,b=I(o),_=m[o.feed_key],V=`/${n}/connectors/${r}/${t.id}?feedId=${o.id}`;return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>{_&&l(o.feed_key,_,V)},className:"flex w-full items-center justify-between gap-3 rounded-lg border border-border px-3 py-2.5 text-left transition-colors hover:bg-accent/50",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(B,{tone:ie(o)}),e.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:h})]}),e.jsx("span",{className:o.attention==="last_attempt_failed"||o.attention==="misconfigured"?"max-w-[50%] shrink-0 text-right text-xs text-destructive":o.attention&&o.attention!=="healthy"?"max-w-[50%] shrink-0 text-right text-xs text-amber-600 dark:text-amber-400":"shrink-0 text-xs text-muted-foreground",title:b??void 0,children:b??(o.store==="channel_messages"?"chat channel":o.operations.includes("read")&&o.operations.includes("sync")?"synced + live":o.operations.includes("read")?"live":o.last_sync_at?`synced ${T(o.last_sync_at)}`:"not synced yet")})]})},o.id)})})}function we({connection:t,ownerSlug:n,title:r}){const c=v(),{data:s=[],isLoading:a,isError:d}=C(t.id),i=s.filter(h=>["needs_auth","setup_required","misconfigured","last_attempt_failed","device_offline","overdue"].includes(h.attention??"")),l=s.filter(h=>h.status==="paused").length,m=a?t.feed_count:s.length,p=t.facets?.chat?"channels":"feeds",o=a?`Loading ${p}…`:d?`Could not load ${p} — open to retry`:`${m} ${p}${i.length?` · ${i.length} need attention`:""}${l?` · ${l} paused`:""}`;return e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{title:r,summary:o,onOpen:()=>c?.open({href:"",title:t.facets?.chat?"Channels":"Feeds",connectorPanel:{section:"feeds",connectorKey:t.connector_key,connectionId:t.id,organizationId:t.organization_id,ownerSlug:n}})}),i.length>0&&e.jsxs("ul",{className:"space-y-1 text-xs text-destructive",children:[i.slice(0,3).map(h=>e.jsxs("li",{children:[h.display_name||h.feed_key,": ",I(h)]},h.id)),i.length>3&&e.jsxs("li",{children:[i.length-3," more sources need attention."]})]})]})}const le=$("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{status:{active:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",paused:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",error:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",pending:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",rejected:"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}},defaultVariants:{status:"default"}}),de=$("h-1.5 w-1.5 rounded-full",{variants:{status:{active:"bg-green-500",paused:"bg-yellow-500",error:"bg-red-500",pending:"bg-blue-500",rejected:"bg-gray-500",default:"bg-gray-500"}},defaultVariants:{status:"default"}});function ue({className:t,status:n,showDot:r=!0,children:c,...s}){return e.jsxs("span",{className:f(le({status:n}),t),...s,children:[r&&e.jsx("span",{className:de({status:n})}),c]})}function xe(t,n){switch(n.kind){case"connection":return W(t,n.id);case"feed":return J(t,n.id);case"run":return{to:"/$owner/events",params:{owner:t},search:{run_ids:String(n.id)}}}}function he({ownerSlug:t,scope:n,variant:r="outline",iconOnly:c=!1,label:s,className:a,title:d}){const i=xe(t,n),l=d??s??"View in memory",m=e.jsx(S,{asChild:!0,variant:r,size:c?"icon":"sm",className:f(c&&"h-7 w-7",a),children:e.jsxs(j,{to:i.to,params:i.params,search:i.search,children:[e.jsx(U,{className:f("h-3.5 w-3.5",!c&&"mr-1.5")}),!c&&(s??"View in memory")]})});return c?e.jsxs(H,{children:[e.jsx(q,{asChild:!0,children:m}),e.jsx(M,{children:l})]}):m}const me=new Set(["error","failed","revoked"]);function pe(t){return t==="active"?"active":t==="paused"?"paused":t==="pending"||t==="pending_auth"?"pending":me.has(t)?"error":"default"}function fe({status:t}){return t==="completed"?e.jsx(ee,{className:"h-3.5 w-3.5 text-green-500"}):t==="failed"?e.jsx(te,{className:"h-3.5 w-3.5 text-destructive"}):t==="running"?e.jsx(se,{className:"text-blue-500"}):e.jsx(ne,{className:"h-3.5 w-3.5 text-muted-foreground"})}function ge({error:t}){const[n,r]=L.useState(!1);return t.length>80?e.jsxs(A,{open:n,onOpenChange:r,children:[e.jsx(R,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-destructive truncate max-w-[200px] hover:underline",children:t})}),e.jsx(E,{className:"w-96 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words text-destructive",children:t})})]}):e.jsx("span",{className:"text-destructive",children:t})}function ye({checkpoint:t}){const[n,r]=L.useState(!1);return e.jsxs(A,{open:n,onOpenChange:r,children:[e.jsx(R,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-muted-foreground hover:underline",children:"view"})}),e.jsx(E,{className:"w-80 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:JSON.stringify(t,null,2)})})]})}function je(t){return t.feed_display_name??t.feed_key??"—"}function Ce({runs:t,ownerSlug:n,columns:r={}}){const c=t.some(s=>s.checkpoint);return e.jsx("div",{className:"rounded-lg border",children:e.jsxs(K,{children:[e.jsx(G,{children:e.jsxs(N,{children:[e.jsx(u,{className:"text-xs py-1.5 px-3 w-8"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"When"}),r.runType&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Type"}),r.connection&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Connection"}),r.feed&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Feed"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Status"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Items"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Duration"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Version"}),c&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Checkpoint"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Error"}),e.jsx(u,{className:"text-xs py-1.5 px-3 w-8"})]})}),e.jsx(X,{children:t.map(s=>{const a=s.completed_at?Math.round((new Date(s.completed_at).getTime()-new Date(s.created_at).getTime())/1e3):null;return e.jsxs(N,{children:[e.jsx(x,{className:"py-1.5 px-3",children:e.jsx(fe,{status:s.status})}),e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",title:Y(s.created_at),children:T(s.created_at)}),r.runType&&e.jsx(x,{className:"py-1.5 px-3 text-xs",children:e.jsx(Q,{variant:"secondary",className:"font-mono text-[10px]",children:s.run_type??"—"})}),r.connection&&e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:s.connection_display_name??"—"}),r.feed&&e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:je(s)}),e.jsx(x,{className:"py-1.5 px-3 text-xs",children:e.jsx(ue,{status:pe(s.status),children:s.status})}),e.jsx(x,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.items_collected??"—"}),e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:a!=null?Z(a):"—"}),e.jsx(x,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.connector_version??"—"}),c&&e.jsx(x,{className:"py-1.5 px-3 text-xs",children:s.checkpoint?e.jsx(ye,{checkpoint:s.checkpoint}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx(x,{className:"py-1.5 px-3 text-xs",children:s.error_message?e.jsx(ge,{error:s.error_message}):""}),e.jsx(x,{className:"py-1.5 px-3 text-right",children:e.jsx(he,{ownerSlug:n,scope:{kind:"run",id:s.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})})]},s.id)})})]})})}export{ve as C,Ce as R,ue as S,he as V,Ne as a,ke as b,ce as c,we as d,I as f,pe as g};
|
|
1
|
+
import{j as e,aj as f,J as v,fj as k,S as g,fk as w,n as C,fl as F,bm as P,fm as D,B as S,L as j,P as z,x as T,dU as O,aR as $,cM as U,dl as H,dm as q,dn as M,fn as J,fo as W,cy as K,cz as G,cA as N,cB as u,cC as X,cD as x,eW as Y,af as Q,fp as Z,cs as ee,az as te,s as se,bJ as ne,r as L,ci as A,cj as R,ck as E}from"./index-Bfux0kHb.js";import{c as ae}from"./connection-label-BobuYiAG.js";const re={amber:"bg-amber-500",muted:"bg-muted-foreground/40",destructive:"bg-destructive"};function B({tone:t}){return e.jsx("span",{"aria-hidden":t===null,className:f("h-1.5 w-1.5 shrink-0 rounded-full",t===null?"bg-transparent":re[t])})}function I(t){switch(t.attention){case"needs_auth":return"Needs authentication";case"setup_required":return t.attention_reason?.trim()||"Setup required";case"paused":return"Paused";case"misconfigured":return"Configuration error";case"device_offline":return`Waiting for ${t.device_label||t.device_platform||"device"}`;case"last_attempt_failed":{const n=Number(t.consecutive_failures??0);return t.last_error?.trim()||(n>0?`${n} consecutive sync ${n===1?"failure":"failures"}`:"Last sync failed")}case"overdue":return"Scheduled run overdue";case"no_trigger":return"No schedule — this feed only runs when you sync it";case"never_run":return t.execution_mode==="scheduled"?"Scheduled, not run yet":"Not synced yet";default:return null}}function ie(t){switch(t.attention){case"last_attempt_failed":case"misconfigured":return"destructive";case"needs_auth":case"setup_required":case"device_offline":case"overdue":case"no_trigger":case"never_run":return t.attention==="never_run"&&t.execution_mode!=="scheduled"?"muted":"amber";case"paused":return"muted";default:return t.status==="active"?null:t.status==="error"?"destructive":"muted"}}function ce(t){return Object.keys(t?.feeds_schema??{}).length>0}const y=new Set(["error","revoked","pending_auth"]),oe={pending_auth:"needs reconnect",revoked:"revoked",error:"error",paused:"paused",active:"active"};function Ne({connections:t,connectorDef:n,organizationId:r,ownerSlug:c,connectorKey:s,isLoading:a=!1}){const d=v(),i=t.filter(m=>y.has(m.status)||!!n&&k(n)&&!m.device_worker_id).length;if(a)return e.jsx(g,{className:"h-16 w-full rounded-lg"});const l=t.length;return e.jsx(w,{title:"Connections",summary:`${l} ${l===1?"connection":"connections"}${i?` · ${i} ${i===1?"needs":"need"} attention`:""}`,onOpen:()=>d?.open({href:"",title:"Connections",connectorPanel:{section:"connections",connectorKey:s,organizationId:r,ownerSlug:c}})})}function ve({connections:t,connectorDef:n,ownerSlug:r,connectorKey:c}){if(t.length===0)return null;const s=[...t].sort((a,d)=>{const i=y.has(a.status)?0:1,l=y.has(d.status)?0:1;return i-l});return e.jsx("ul",{className:"flex flex-col gap-2",children:s.map(a=>{const d=ae({...a,connector_name:a.connector_name??n?.name??null}),i=!!n&&k(n)&&!a.device_worker_id,l=a.status==="error"||a.status==="revoked"||a.status==="pending_auth";return e.jsx("li",{children:e.jsxs(j,{to:"/$owner/connectors/$connectorKey/$connectionId",params:{owner:r,connectorKey:c,connectionId:String(a.id)},search:{},className:"flex items-center justify-between gap-3 rounded-lg border border-border px-3 py-2.5 transition-colors hover:bg-accent/50",children:[e.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx(B,{tone:a.status==="active"?null:a.status==="error"||a.status==="revoked"?"destructive":"amber"}),e.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:d})]}),e.jsxs("span",{className:"flex min-w-0 max-w-1/2 shrink-0 items-center gap-2",children:[i?e.jsx("span",{className:"shrink-0 text-xs text-amber-600",children:"Needs a device"}):l?e.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:a.error_message?.trim()||oe[a.status]||a.status}):null,e.jsx(O,{"aria-hidden":"true",className:"size-4 shrink-0 text-muted-foreground"})]})]})},a.id)})})}function ke({connection:t,ownerSlug:n,connectorKey:r,connectorDef:c}){const{data:s=[],isLoading:a}=C(t.id),d=ce(c),i=t.facets?.chat??!1,{inspectFeed:l}=F(),m=c?.feeds_schema??{},p={owner:n,connectorKey:r,connectionId:String(t.id)};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(g,{className:"h-12 w-full rounded-lg"}),e.jsx(g,{className:"h-12 w-full rounded-lg"})]}):s.length===0?e.jsx(P,{icon:D,title:i?"No channels":"No feeds",description:d?i?"Bind a channel to route conversations to this connection.":"Add a feed to start collecting data from this connection.":i?"This chat connection has no bound channels yet.":"This connector doesn't provide any feeds.",children:d?e.jsx(S,{asChild:!0,size:"sm",children:e.jsxs(j,{to:"/$owner/connectors/$connectorKey/$connectionId",params:p,search:{addFeed:!0},children:[e.jsx(z,{className:"h-3.5 w-3.5"}),i?"Add channel":"Add feed"]})}):null}):e.jsx("ul",{className:"flex flex-col gap-2",children:s.map(o=>{const h=o.display_name?.trim()||o.feed_key,b=I(o),_=m[o.feed_key],V=`/${n}/connectors/${r}/${t.id}?feedId=${o.id}`;return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>{_&&l(o.feed_key,_,V)},className:"flex w-full items-center justify-between gap-3 rounded-lg border border-border px-3 py-2.5 text-left transition-colors hover:bg-accent/50",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(B,{tone:ie(o)}),e.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:h})]}),e.jsx("span",{className:o.attention==="last_attempt_failed"||o.attention==="misconfigured"?"max-w-[50%] shrink-0 text-right text-xs text-destructive":o.attention&&o.attention!=="healthy"?"max-w-[50%] shrink-0 text-right text-xs text-amber-600 dark:text-amber-400":"shrink-0 text-xs text-muted-foreground",title:b??void 0,children:b??(o.store==="channel_messages"?"chat channel":o.operations.includes("read")&&o.operations.includes("sync")?"synced + live":o.operations.includes("read")?"live":o.last_sync_at?`synced ${T(o.last_sync_at)}`:"not synced yet")})]})},o.id)})})}function we({connection:t,ownerSlug:n,title:r}){const c=v(),{data:s=[],isLoading:a,isError:d}=C(t.id),i=s.filter(h=>["needs_auth","setup_required","misconfigured","last_attempt_failed","device_offline","overdue"].includes(h.attention??"")),l=s.filter(h=>h.status==="paused").length,m=a?t.feed_count:s.length,p=t.facets?.chat?"channels":"feeds",o=a?`Loading ${p}…`:d?`Could not load ${p} — open to retry`:`${m} ${p}${i.length?` · ${i.length} need attention`:""}${l?` · ${l} paused`:""}`;return e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{title:r,summary:o,onOpen:()=>c?.open({href:"",title:t.facets?.chat?"Channels":"Feeds",connectorPanel:{section:"feeds",connectorKey:t.connector_key,connectionId:t.id,organizationId:t.organization_id,ownerSlug:n}})}),i.length>0&&e.jsxs("ul",{className:"space-y-1 text-xs text-destructive",children:[i.slice(0,3).map(h=>e.jsxs("li",{children:[h.display_name||h.feed_key,": ",I(h)]},h.id)),i.length>3&&e.jsxs("li",{children:[i.length-3," more sources need attention."]})]})]})}const le=$("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{status:{active:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",paused:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",error:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",pending:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",rejected:"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}},defaultVariants:{status:"default"}}),de=$("h-1.5 w-1.5 rounded-full",{variants:{status:{active:"bg-green-500",paused:"bg-yellow-500",error:"bg-red-500",pending:"bg-blue-500",rejected:"bg-gray-500",default:"bg-gray-500"}},defaultVariants:{status:"default"}});function ue({className:t,status:n,showDot:r=!0,children:c,...s}){return e.jsxs("span",{className:f(le({status:n}),t),...s,children:[r&&e.jsx("span",{className:de({status:n})}),c]})}function xe(t,n){switch(n.kind){case"connection":return W(t,n.id);case"feed":return J(t,n.id);case"run":return{to:"/$owner/events",params:{owner:t},search:{run_ids:String(n.id)}}}}function he({ownerSlug:t,scope:n,variant:r="outline",iconOnly:c=!1,label:s,className:a,title:d}){const i=xe(t,n),l=d??s??"View in memory",m=e.jsx(S,{asChild:!0,variant:r,size:c?"icon":"sm",className:f(c&&"h-7 w-7",a),children:e.jsxs(j,{to:i.to,params:i.params,search:i.search,children:[e.jsx(U,{className:f("h-3.5 w-3.5",!c&&"mr-1.5")}),!c&&(s??"View in memory")]})});return c?e.jsxs(H,{children:[e.jsx(q,{asChild:!0,children:m}),e.jsx(M,{children:l})]}):m}const me=new Set(["error","failed","revoked"]);function pe(t){return t==="active"?"active":t==="paused"?"paused":t==="pending"||t==="pending_auth"?"pending":me.has(t)?"error":"default"}function fe({status:t}){return t==="completed"?e.jsx(ee,{className:"h-3.5 w-3.5 text-green-500"}):t==="failed"?e.jsx(te,{className:"h-3.5 w-3.5 text-destructive"}):t==="running"?e.jsx(se,{className:"text-blue-500"}):e.jsx(ne,{className:"h-3.5 w-3.5 text-muted-foreground"})}function ge({error:t}){const[n,r]=L.useState(!1);return t.length>80?e.jsxs(A,{open:n,onOpenChange:r,children:[e.jsx(R,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-destructive truncate max-w-[200px] hover:underline",children:t})}),e.jsx(E,{className:"w-96 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words text-destructive",children:t})})]}):e.jsx("span",{className:"text-destructive",children:t})}function ye({checkpoint:t}){const[n,r]=L.useState(!1);return e.jsxs(A,{open:n,onOpenChange:r,children:[e.jsx(R,{asChild:!0,children:e.jsx("button",{type:"button",className:"text-left text-muted-foreground hover:underline",children:"view"})}),e.jsx(E,{className:"w-80 max-h-64 overflow-auto",children:e.jsx("pre",{className:"text-xs whitespace-pre-wrap break-words",children:JSON.stringify(t,null,2)})})]})}function je(t){return t.feed_display_name??t.feed_key??"—"}function Ce({runs:t,ownerSlug:n,columns:r={}}){const c=t.some(s=>s.checkpoint);return e.jsx("div",{className:"rounded-lg border",children:e.jsxs(K,{children:[e.jsx(G,{children:e.jsxs(N,{children:[e.jsx(u,{className:"text-xs py-1.5 px-3 w-8"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"When"}),r.runType&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Type"}),r.connection&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Connection"}),r.feed&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Feed"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Status"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Items"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Duration"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Version"}),c&&e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Checkpoint"}),e.jsx(u,{className:"text-xs py-1.5 px-3",children:"Error"}),e.jsx(u,{className:"text-xs py-1.5 px-3 w-8"})]})}),e.jsx(X,{children:t.map(s=>{const a=s.completed_at?Math.round((new Date(s.completed_at).getTime()-new Date(s.created_at).getTime())/1e3):null;return e.jsxs(N,{children:[e.jsx(x,{className:"py-1.5 px-3",children:e.jsx(fe,{status:s.status})}),e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",title:Y(s.created_at),children:T(s.created_at)}),r.runType&&e.jsx(x,{className:"py-1.5 px-3 text-xs",children:e.jsx(Q,{variant:"secondary",className:"font-mono text-[10px]",children:s.run_type??"—"})}),r.connection&&e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:s.connection_display_name??"—"}),r.feed&&e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:je(s)}),e.jsx(x,{className:"py-1.5 px-3 text-xs",children:e.jsx(ue,{status:pe(s.status),children:s.status})}),e.jsx(x,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.items_collected??"—"}),e.jsx(x,{className:"py-1.5 px-3 text-xs text-muted-foreground",children:a!=null?Z(a):"—"}),e.jsx(x,{className:"py-1.5 px-3 text-xs font-mono text-muted-foreground",children:s.connector_version??"—"}),c&&e.jsx(x,{className:"py-1.5 px-3 text-xs",children:s.checkpoint?e.jsx(ye,{checkpoint:s.checkpoint}):e.jsx("span",{className:"text-muted-foreground",children:"—"})}),e.jsx(x,{className:"py-1.5 px-3 text-xs",children:s.error_message?e.jsx(ge,{error:s.error_message}):""}),e.jsx(x,{className:"py-1.5 px-3 text-right",children:e.jsx(he,{ownerSlug:n,scope:{kind:"run",id:s.id},variant:"ghost",iconOnly:!0,title:"View events from this run"})})]},s.id)})})]})})}export{ve as C,Ce as R,ue as S,he as V,Ne as a,ke as b,ce as c,we as d,I as f,pe as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as O,j as t,aE as ae,eT as ne,ak as le,aa as q,bY as oe,bZ as de,b_ as ce,b$ as me,c0 as ue,fV as fe,fW as R,fX as Z,fY as xe,fZ as D,f_ as he,B as I,bw as G,P as Q,cy as be,cz as je,cA as z,cB as X,cC as ye,cD as B,ab as U,cI as ge,f$ as Ne,de as ve,df as W,g0 as we,aO as pe,aj as T,eq as Se,x as $e,dl as Oe,dm as Ie,af as Te,c$ as Ae,dn as Ee,ci as Le,cj as ke,dp as Re,ck as Ce,dq as P,cl as Pe}from"./index-BKZMzuMS.js";import{C as Fe}from"./calendar-VAaxHxss.js";var _e="Separator",K="horizontal",De=["horizontal","vertical"],re=O.forwardRef((s,r)=>{const{decorative:e,orientation:i=K,...a}=s,m=ze(i)?i:K,b=e?{role:"none"}:{"aria-orientation":m==="vertical"?m:void 0,role:"separator"};return t.jsx(ae.div,{"data-orientation":m,...b,...a,ref:r})});re.displayName=_e;function ze(s){return De.includes(s)}var ie=re;function L(s){return String(s??"").split(/[_-]/).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function Be(s){return s.replace(/[^a-zA-Z0-9_-]/g,"-")}const Ve=/^\d{4}-\d{2}-\d{2}$/;function J(s){if(Ve.test(s)){const[r,e,i]=s.split("-").map(Number),a=new Date(0);return a.setHours(0,0,0,0),a.setFullYear(r,e-1,i),a}return new Date(s)}function qe(s,r=!1){if(!s)return r?"Pick a date and time":"Pick a date";const e=J(s);return Number.isNaN(e.getTime())?s:r?e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):P(e,"LLL dd, y")}function V(s){if(!s)return"";const r=J(s);if(Number.isNaN(r.getTime()))return"";const e=r.getTimezoneOffset()*6e4;return new Date(r.getTime()-e).toISOString().slice(0,16)}function ee(s){if(!s)return;const r=new Date(s);if(!Number.isNaN(r.getTime()))return r.toISOString()}function C(s,r){const e=r==="slug"?s.slug:s.metadata?.[r];return e==null?"":String(e)}function Me({control:s}){const r=[s.set_by,s.set_at?$e(s.set_at):null].filter(Boolean).join(" · ");return t.jsxs(Oe,{children:[t.jsx(Ie,{asChild:!0,children:t.jsxs(Te,{variant:"outline",className:"gap-1 border-emerald-500/30 bg-emerald-500/10 text-[10px] uppercase tracking-wide text-emerald-600 dark:text-emerald-400",children:[t.jsx(Ae,{className:"h-3 w-3"}),"You"]})}),t.jsxs(Ee,{className:"max-w-xs space-y-1",children:[t.jsx("div",{className:"text-xs font-medium",children:"Human-owned field"}),s.note?t.jsx("div",{className:"text-xs text-primary-foreground/90",children:s.note}):null,r?t.jsx("div",{className:"text-[11px] text-primary-foreground/70",children:r}):null]})]})}function te({id:s,value:r,onChange:e,readonly:i,ariaLabel:a,includeTime:m=!1}){const u=r?J(r):void 0,[b,c]=O.useState(()=>V(r).slice(11));return O.useEffect(()=>{c(V(r).slice(11))},[r]),t.jsx("div",{className:"relative",children:t.jsxs(Le,{children:[t.jsx(ke,{asChild:!0,children:t.jsxs(I,{id:s,"aria-label":a,type:"button",variant:"outline",disabled:i,className:T("w-full justify-start rounded-md bg-muted px-3 text-left font-normal",!r&&"text-muted-foreground"),children:[t.jsx(Re,{className:"mr-2 h-4 w-4 shrink-0"}),t.jsx("span",{className:"truncate",children:qe(r,m)})]})}),t.jsxs(Ce,{className:"w-auto space-y-3 p-0",align:"start",children:[t.jsx(Fe,{mode:"single",selected:u,defaultMonth:u,onSelect:x=>{if(!x)return;if(!m){e(P(x,"yyyy-MM-dd"));return}const n=b||"00:00";e(ee(`${P(x,"yyyy-MM-dd")}T${n}`))},initialFocus:!0}),m?t.jsxs("div",{className:"border-t p-3 pt-0",children:[t.jsx(q,{htmlFor:`${s}-time`,className:"text-xs text-muted-foreground",children:"Time"}),t.jsx(U,{id:`${s}-time`,type:"time",value:b,onChange:x=>{c(x.target.value);const n=r?V(r).slice(0,10):u?P(u,"yyyy-MM-dd"):"";n&&e(ee(`${n}T${x.target.value}`))},disabled:i})]}):null]})]})})}function Ue({id:s,value:r,onChange:e,readonly:i,ariaLabel:a,entityType:m,lookupField:u,numeric:b=!1,orgContext:c}){const x=f=>{if(f===void 0||f==="")return e(void 0);if(!b)return e(f);const p=Number(f);e(Number.isFinite(p)?p:f)},{data:n}=ge(m,c,{limit:Ne}),d=(n?.entities??[]).filter(f=>C(f,u)!==""),l=r==null?"":String(r),$=d.find(f=>C(f,u)===l);return c?i?t.jsx("div",{className:"flex h-9 items-center rounded-md border border-input bg-muted px-3 text-sm",children:$?.name||l||"-"}):t.jsx(ve,{contentClassName:"w-[320px]",searchPlaceholder:`Search ${L(m).toLowerCase()}...`,emptyText:`No ${m} found.`,trigger:f=>t.jsxs(I,{id:s,"aria-label":a,type:"button",variant:"outline",role:"combobox","aria-expanded":f,className:"w-full justify-between",children:[t.jsx("span",{className:T("truncate",!l&&"text-muted-foreground"),children:$?.name||l||`Select ${L(m).toLowerCase()}`}),t.jsx(Se,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),children:(f,p)=>{const S=p.trim(),j=S.length>0&&!d.some(v=>C(v,u)===S);return t.jsxs(t.Fragment,{children:[j?t.jsxs(W,{value:`use ${S}`,onSelect:()=>{x(S),f()},children:[t.jsx(we,{className:"mr-2 h-3.5 w-3.5 opacity-60"}),t.jsxs("span",{className:"truncate",children:["Use ",t.jsx("span",{className:"font-medium",children:S})]})]}):null,d.map(v=>{const o=C(v,u),y=o===l;return t.jsxs(W,{value:`${v.name} ${v.slug} ${v.entity_type} ${o}`,onSelect:()=>{x(o||void 0),f()},children:[t.jsx(pe,{className:T("mr-2 h-4 w-4",y?"opacity-100":"opacity-0")}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"truncate",children:v.name}),t.jsx("div",{className:"text-xs text-muted-foreground",children:v.slug})]})]},`${v.id}-${o}`)})]})}}):t.jsx(U,{id:s,"aria-label":a,type:b?"number":"text",value:l,onChange:f=>x(f.target.value||void 0),disabled:i})}function M({fieldPath:s,fieldKey:r,prop:e,value:i,onChange:a,isRequired:m,readonly:u,control:b,compact:c=!1,orgContext:x}){const n=e.description||L(r),d=Be(s),l=u||e.readOnly===!0,$=!c&&b?t.jsx(Me,{control:b}):null,f=e.type==="object"||!!e.properties,p=e.type==="array"&&!!e.items&&(e.items?.type==="object"||!!e.items?.properties),S=e.type==="array"&&!!e.items&&(e.items?.type==="string"||e.items?.type==="number"||e.items?.type==="integer"||e.items?.type==="boolean");if(e.type==="boolean")return t.jsxs("div",{className:c?"flex items-center":"flex items-center space-x-2 py-1",children:[t.jsx(le,{id:d,"aria-label":c?n:void 0,checked:i??!1,onCheckedChange:o=>a(o),disabled:l}),c?null:t.jsxs(q,{htmlFor:d,className:"flex items-center gap-1.5 font-normal",children:[n,$]})]});let j;if(e.enum&&Array.isArray(e.enum))j=t.jsxs(oe,{value:i==null?"":String(i),onValueChange:o=>a(o===""?void 0:e.type==="number"||e.type==="integer"?Number(o):o),disabled:l,children:[t.jsx(de,{id:d,"aria-label":c?n:void 0,children:t.jsx(ce,{placeholder:`Select ${n.toLowerCase()}`})}),t.jsx(me,{children:e.enum.map(o=>{const y=String(o);return t.jsx(ue,{value:y,children:L(y)},y)})})]});else if(e["x-link-entity-type"])j=t.jsx(Ue,{id:d,value:i,onChange:a,readonly:l,ariaLabel:c?n:void 0,entityType:e["x-link-entity-type"],lookupField:e["x-link-lookup-field"]||"slug",numeric:e.type==="number"||e.type==="integer",orgContext:x});else if(e.type==="number"||e.type==="integer")j=t.jsx(fe,{id:d,ariaLabel:c?n:void 0,value:i,onChange:a,integer:e.type==="integer",placeholder:`Enter ${n.toLowerCase()}`,readOnly:l});else if(f){const o=Object.entries(e.properties??{}),y=new Set(e.required??[]),A=R(i)?i:{};j=o.length===0||!R(i)&&i!==void 0&&i!==null?t.jsx(Z,{id:d,value:i,ariaLabel:`${n} JSON object`,readOnly:l,onChange:a}):t.jsx("fieldset",{"aria-label":c?n:void 0,"aria-labelledby":c?void 0:`${d}-label`,className:"space-y-3 rounded-md border p-3",children:o.map(([w,k])=>t.jsx(M,{fieldPath:`${s}.${w}`,fieldKey:w,prop:k,value:A[w],onChange:g=>{const h={...A};g===void 0?delete h[w]:h[w]=g,a(h)},isRequired:y.has(w),readonly:l,orgContext:x},w))})}else if(S)j=i!=null&&!xe(i)?t.jsx(D,{id:d,value:i,ariaLabel:`${n} JSON array`,readOnly:l,itemType:e.items?.type,itemEnum:e.items?.enum,minItems:e.minItems,maxItems:e.maxItems,onChange:a}):t.jsx(he,{id:d,value:i,itemType:e.items?.type,itemEnum:e.items?.enum,minItems:e.minItems,maxItems:e.maxItems,ariaLabel:c?n:void 0,readOnly:l,showHelp:!c,onChange:a});else if(p&&e.items){const o=Array.isArray(i)?i:[],y=Object.entries(e.items.properties??{}),A=new Set(e.items.required??[]),w=e.maxItems===void 0||o.length<e.maxItems,k=e.minItems===void 0||o.length>e.minItems;j=!Array.isArray(i)&&i!==void 0&&i!==null||y.length>0&&o.some(g=>!R(g))?t.jsx(D,{id:d,value:i,ariaLabel:`${n} JSON array`,readOnly:l,itemType:"object",minItems:e.minItems,maxItems:e.maxItems,onChange:a}):y.length===0?t.jsxs("fieldset",{"aria-label":c?n:void 0,"aria-labelledby":c?void 0:`${d}-label`,className:"space-y-3",children:[o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No rows"}):o.map((g,h)=>t.jsxs("fieldset",{className:"space-y-2 rounded-md border p-3",children:[t.jsxs("legend",{className:"px-1 text-xs font-medium text-muted-foreground",children:["Row ",h+1]}),t.jsx(Z,{id:`${d}-${h}-json`,value:g,ariaLabel:`${n} row ${h+1} JSON object`,readOnly:l,onChange:E=>{const N=[...o];N[h]=E,a(N)}}),l?null:t.jsxs(I,{type:"button",variant:"ghost",size:"sm","aria-label":`Remove row ${h+1}`,disabled:!k,onClick:()=>a(o.filter((E,N)=>N!==h)),children:[t.jsx(G,{className:"mr-1.5 h-4 w-4"}),"Remove row"]})]},`${s}.${h}`)),l?null:t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!w,onClick:()=>a([...o,{}]),children:[t.jsx(Q,{className:"mr-1.5 h-4 w-4"}),"Add row"]})]}):t.jsxs("fieldset",{"aria-label":c?n:void 0,"aria-labelledby":c?void 0:`${d}-label`,className:"space-y-3",children:[t.jsx("div",{className:"rounded-md border",children:t.jsxs(be,{children:[t.jsx(je,{children:t.jsxs(z,{children:[y.map(([g,h])=>t.jsxs(X,{children:[h.description||L(g),A.has(g)?t.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]},g)),l?null:t.jsx(X,{className:"w-12"})]})}),t.jsx(ye,{children:o.length===0?t.jsx(z,{children:t.jsx(B,{colSpan:y.length+(l?0:1),className:"text-sm text-muted-foreground",children:"No rows"})}):o.map((g,h)=>{const E=R(g)?g:{};return t.jsxs(z,{children:[y.map(([N,F])=>t.jsx(B,{className:"align-top",children:t.jsx(M,{fieldPath:`${s}.${h}.${N}`,fieldKey:N,prop:F,value:E[N],onChange:H=>{const Y=[...o],_={...E};H===void 0?delete _[N]:_[N]=H,Y[h]=_,a(Y)},isRequired:A.has(N),readonly:l,compact:!0,orgContext:x})},N)),l?null:t.jsx(B,{className:"align-top",children:t.jsx(I,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove row ${h+1}`,disabled:!k,onClick:()=>a(o.filter((N,F)=>F!==h)),children:t.jsx(G,{className:"h-4 w-4"})})})]},`${s}.${h}`)})})]})}),l?null:t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!w,onClick:()=>a([...o,{}]),children:[t.jsx(Q,{className:"mr-1.5 h-4 w-4"}),"Add row"]})]})}else if(e.type==="array")j=t.jsx(D,{id:d,value:i,ariaLabel:`${n} JSON array`,readOnly:l,itemType:e.items?.type,itemEnum:e.items?.enum,minItems:e.minItems,maxItems:e.maxItems,onChange:a});else if(e.format==="date")j=t.jsx(te,{id:d,value:typeof i=="string"?i:void 0,onChange:a,readonly:l,ariaLabel:c?n:void 0});else if(e.format==="date-time")j=t.jsx(te,{id:d,value:typeof i=="string"?i:void 0,onChange:a,readonly:l,ariaLabel:c?n:void 0,includeTime:!0});else{const o=e.format==="uri"||e.format==="url";j=t.jsx(U,{id:d,"aria-label":c?n:void 0,type:o?"url":"text",value:i??"",onChange:y=>a(y.target.value||void 0),placeholder:o?"https://example.com":`Enter ${n.toLowerCase()}`,disabled:l})}if(c)return j;const v=f||p;return t.jsxs("div",{className:"space-y-1.5",children:[v?t.jsxs("p",{id:`${d}-label`,className:"flex items-center gap-1.5 text-sm font-medium",children:[t.jsxs("span",{children:[n,m?t.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]}),$]}):t.jsxs(q,{htmlFor:d,className:"flex items-center gap-1.5",children:[t.jsxs("span",{children:[n,m?t.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]}),$]}),j]})}function We(s){const r={};for(const[e,i]of Object.entries(s)){const a=ne(i);a==null||a===""||(r[e]=a)}return r}function Ke({schema:s,values:r,onValuesChange:e,readonly:i=!1,fieldControls:a,orgContext:m}){const u=s,b=u?.properties,c=new Set(u?.required??[]),x=(n,d)=>{e({...r,[n]:d})};return!b||Object.keys(b).length===0?t.jsx("p",{className:"text-sm text-muted-foreground py-2",children:"No additional fields required for this entity type."}):t.jsx("div",{className:"space-y-4",children:Object.entries(b).map(([n,d])=>"x-measure"in d||"x-dimension"in d?null:t.jsx(M,{fieldPath:n,fieldKey:n,prop:d,value:r[n],onChange:l=>x(n,l),isRequired:c.has(n),readonly:i,control:a?.[n],orgContext:m},n))})}const Je=O.forwardRef(({className:s,orientation:r="horizontal",decorative:e=!0,...i},a)=>t.jsx(ie,{ref:a,decorative:e,orientation:r,className:T("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...i}));Je.displayName=ie.displayName;function se(s,r){const e=s?.properties;if(e)return Object.entries(e).find(([,i])=>i[r])?.[0]}function He(s){const r=s.trim(),e=r.split(/[\s._@/-]+/).filter(Boolean),i=e.length>=2?`${e[0][0]}${e[1][0]}`:(e[0]??r).slice(0,2);let a=0;for(let m=0;m<r.length;m++)a=a*31+r.charCodeAt(m)>>>0;return{initials:i.toUpperCase()||"?",hue:a%360}}function Ye(s){const[r,e]=O.useState();return O.useEffect(()=>{if(!s){e(void 0);return}let i=!1;const a=s.trim().toLowerCase();return crypto.subtle.digest("SHA-256",new TextEncoder().encode(a)).then(m=>{i||e(Array.from(new Uint8Array(m)).map(u=>u.toString(16).padStart(2,"0")).join(""))}),()=>{i=!0}},[s]),r?`https://www.gravatar.com/avatar/${r}?d=identicon&s=80`:void 0}function et({metadata:s,metadataSchema:r,name:e,typeIcon:i,className:a="h-6 w-6",iconClassName:m="h-5 w-5",initialsFallback:u=!1}){const b=se(r,"x-image"),c=se(r,"x-email"),x=b&&s?.[b]||void 0,n=c&&s?.[c]||void 0,d=Ye(x?void 0:n),l=x||d,[$,f]=O.useState(!1);if(O.useEffect(()=>{f(!1)},[l]),l&&!$)return t.jsx("img",{src:l,alt:e,referrerPolicy:"no-referrer",onError:()=>f(!0),className:T("rounded-full object-cover border border-border",a)});if(u){const p=e.trim()||n||Ze(s,r)||e,{initials:S,hue:j}=He(p);return t.jsx("span",{role:"img","aria-label":e,className:T("inline-grid place-items-center rounded-full border border-border font-semibold text-white select-none",a),style:{background:`oklch(0.55 0.13 ${j})`,fontSize:"0.85em"},children:S})}return t.jsx(Pe,{icon:i,className:m})}function Ze(s,r){if(!s)return;const e=r?.properties,i=["email","handle","username","login","github","x_handle","slug"],a=Object.keys(e||s);for(const m of a)if(i.includes(m.toLowerCase())){const u=s[m];if(typeof u=="string"&&u.trim())return u}}function Ge(s,r){if(typeof s!="string"||!r||r.length===0)return s;const e=s.trim();if(r.includes(e))return e;try{const i=JSON.parse(e);if(typeof i=="string"&&r.includes(i))return i}catch{}return s}function tt(s,r){if(!s)return{};const e=r?.properties;return e?Object.fromEntries(Object.entries(s).map(([i,a])=>[i,Ge(a,e[i]?.enum)])):{...s}}export{Ke as D,et as E,Je as S,tt as a,We as c,Ge as n};
|
|
1
|
+
import{r as O,j as t,aE as ae,eT as ne,ak as le,aa as q,bY as oe,bZ as de,b_ as ce,b$ as me,c0 as ue,fV as fe,fW as R,fX as Z,fY as xe,fZ as D,f_ as he,B as I,bw as G,P as Q,cy as be,cz as je,cA as z,cB as X,cC as ye,cD as B,ab as U,cI as ge,f$ as Ne,de as ve,df as W,g0 as we,aO as pe,aj as T,eq as Se,x as $e,dl as Oe,dm as Ie,af as Te,c$ as Ae,dn as Ee,ci as Le,cj as ke,dp as Re,ck as Ce,dq as P,cl as Pe}from"./index-Bfux0kHb.js";import{C as Fe}from"./calendar-taCoBmAh.js";var _e="Separator",K="horizontal",De=["horizontal","vertical"],re=O.forwardRef((s,r)=>{const{decorative:e,orientation:i=K,...a}=s,m=ze(i)?i:K,b=e?{role:"none"}:{"aria-orientation":m==="vertical"?m:void 0,role:"separator"};return t.jsx(ae.div,{"data-orientation":m,...b,...a,ref:r})});re.displayName=_e;function ze(s){return De.includes(s)}var ie=re;function L(s){return String(s??"").split(/[_-]/).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function Be(s){return s.replace(/[^a-zA-Z0-9_-]/g,"-")}const Ve=/^\d{4}-\d{2}-\d{2}$/;function J(s){if(Ve.test(s)){const[r,e,i]=s.split("-").map(Number),a=new Date(0);return a.setHours(0,0,0,0),a.setFullYear(r,e-1,i),a}return new Date(s)}function qe(s,r=!1){if(!s)return r?"Pick a date and time":"Pick a date";const e=J(s);return Number.isNaN(e.getTime())?s:r?e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):P(e,"LLL dd, y")}function V(s){if(!s)return"";const r=J(s);if(Number.isNaN(r.getTime()))return"";const e=r.getTimezoneOffset()*6e4;return new Date(r.getTime()-e).toISOString().slice(0,16)}function ee(s){if(!s)return;const r=new Date(s);if(!Number.isNaN(r.getTime()))return r.toISOString()}function C(s,r){const e=r==="slug"?s.slug:s.metadata?.[r];return e==null?"":String(e)}function Me({control:s}){const r=[s.set_by,s.set_at?$e(s.set_at):null].filter(Boolean).join(" · ");return t.jsxs(Oe,{children:[t.jsx(Ie,{asChild:!0,children:t.jsxs(Te,{variant:"outline",className:"gap-1 border-emerald-500/30 bg-emerald-500/10 text-[10px] uppercase tracking-wide text-emerald-600 dark:text-emerald-400",children:[t.jsx(Ae,{className:"h-3 w-3"}),"You"]})}),t.jsxs(Ee,{className:"max-w-xs space-y-1",children:[t.jsx("div",{className:"text-xs font-medium",children:"Human-owned field"}),s.note?t.jsx("div",{className:"text-xs text-primary-foreground/90",children:s.note}):null,r?t.jsx("div",{className:"text-[11px] text-primary-foreground/70",children:r}):null]})]})}function te({id:s,value:r,onChange:e,readonly:i,ariaLabel:a,includeTime:m=!1}){const u=r?J(r):void 0,[b,c]=O.useState(()=>V(r).slice(11));return O.useEffect(()=>{c(V(r).slice(11))},[r]),t.jsx("div",{className:"relative",children:t.jsxs(Le,{children:[t.jsx(ke,{asChild:!0,children:t.jsxs(I,{id:s,"aria-label":a,type:"button",variant:"outline",disabled:i,className:T("w-full justify-start rounded-md bg-muted px-3 text-left font-normal",!r&&"text-muted-foreground"),children:[t.jsx(Re,{className:"mr-2 h-4 w-4 shrink-0"}),t.jsx("span",{className:"truncate",children:qe(r,m)})]})}),t.jsxs(Ce,{className:"w-auto space-y-3 p-0",align:"start",children:[t.jsx(Fe,{mode:"single",selected:u,defaultMonth:u,onSelect:x=>{if(!x)return;if(!m){e(P(x,"yyyy-MM-dd"));return}const n=b||"00:00";e(ee(`${P(x,"yyyy-MM-dd")}T${n}`))},initialFocus:!0}),m?t.jsxs("div",{className:"border-t p-3 pt-0",children:[t.jsx(q,{htmlFor:`${s}-time`,className:"text-xs text-muted-foreground",children:"Time"}),t.jsx(U,{id:`${s}-time`,type:"time",value:b,onChange:x=>{c(x.target.value);const n=r?V(r).slice(0,10):u?P(u,"yyyy-MM-dd"):"";n&&e(ee(`${n}T${x.target.value}`))},disabled:i})]}):null]})]})})}function Ue({id:s,value:r,onChange:e,readonly:i,ariaLabel:a,entityType:m,lookupField:u,numeric:b=!1,orgContext:c}){const x=f=>{if(f===void 0||f==="")return e(void 0);if(!b)return e(f);const p=Number(f);e(Number.isFinite(p)?p:f)},{data:n}=ge(m,c,{limit:Ne}),d=(n?.entities??[]).filter(f=>C(f,u)!==""),l=r==null?"":String(r),$=d.find(f=>C(f,u)===l);return c?i?t.jsx("div",{className:"flex h-9 items-center rounded-md border border-input bg-muted px-3 text-sm",children:$?.name||l||"-"}):t.jsx(ve,{contentClassName:"w-[320px]",searchPlaceholder:`Search ${L(m).toLowerCase()}...`,emptyText:`No ${m} found.`,trigger:f=>t.jsxs(I,{id:s,"aria-label":a,type:"button",variant:"outline",role:"combobox","aria-expanded":f,className:"w-full justify-between",children:[t.jsx("span",{className:T("truncate",!l&&"text-muted-foreground"),children:$?.name||l||`Select ${L(m).toLowerCase()}`}),t.jsx(Se,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),children:(f,p)=>{const S=p.trim(),j=S.length>0&&!d.some(v=>C(v,u)===S);return t.jsxs(t.Fragment,{children:[j?t.jsxs(W,{value:`use ${S}`,onSelect:()=>{x(S),f()},children:[t.jsx(we,{className:"mr-2 h-3.5 w-3.5 opacity-60"}),t.jsxs("span",{className:"truncate",children:["Use ",t.jsx("span",{className:"font-medium",children:S})]})]}):null,d.map(v=>{const o=C(v,u),y=o===l;return t.jsxs(W,{value:`${v.name} ${v.slug} ${v.entity_type} ${o}`,onSelect:()=>{x(o||void 0),f()},children:[t.jsx(pe,{className:T("mr-2 h-4 w-4",y?"opacity-100":"opacity-0")}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"truncate",children:v.name}),t.jsx("div",{className:"text-xs text-muted-foreground",children:v.slug})]})]},`${v.id}-${o}`)})]})}}):t.jsx(U,{id:s,"aria-label":a,type:b?"number":"text",value:l,onChange:f=>x(f.target.value||void 0),disabled:i})}function M({fieldPath:s,fieldKey:r,prop:e,value:i,onChange:a,isRequired:m,readonly:u,control:b,compact:c=!1,orgContext:x}){const n=e.description||L(r),d=Be(s),l=u||e.readOnly===!0,$=!c&&b?t.jsx(Me,{control:b}):null,f=e.type==="object"||!!e.properties,p=e.type==="array"&&!!e.items&&(e.items?.type==="object"||!!e.items?.properties),S=e.type==="array"&&!!e.items&&(e.items?.type==="string"||e.items?.type==="number"||e.items?.type==="integer"||e.items?.type==="boolean");if(e.type==="boolean")return t.jsxs("div",{className:c?"flex items-center":"flex items-center space-x-2 py-1",children:[t.jsx(le,{id:d,"aria-label":c?n:void 0,checked:i??!1,onCheckedChange:o=>a(o),disabled:l}),c?null:t.jsxs(q,{htmlFor:d,className:"flex items-center gap-1.5 font-normal",children:[n,$]})]});let j;if(e.enum&&Array.isArray(e.enum))j=t.jsxs(oe,{value:i==null?"":String(i),onValueChange:o=>a(o===""?void 0:e.type==="number"||e.type==="integer"?Number(o):o),disabled:l,children:[t.jsx(de,{id:d,"aria-label":c?n:void 0,children:t.jsx(ce,{placeholder:`Select ${n.toLowerCase()}`})}),t.jsx(me,{children:e.enum.map(o=>{const y=String(o);return t.jsx(ue,{value:y,children:L(y)},y)})})]});else if(e["x-link-entity-type"])j=t.jsx(Ue,{id:d,value:i,onChange:a,readonly:l,ariaLabel:c?n:void 0,entityType:e["x-link-entity-type"],lookupField:e["x-link-lookup-field"]||"slug",numeric:e.type==="number"||e.type==="integer",orgContext:x});else if(e.type==="number"||e.type==="integer")j=t.jsx(fe,{id:d,ariaLabel:c?n:void 0,value:i,onChange:a,integer:e.type==="integer",placeholder:`Enter ${n.toLowerCase()}`,readOnly:l});else if(f){const o=Object.entries(e.properties??{}),y=new Set(e.required??[]),A=R(i)?i:{};j=o.length===0||!R(i)&&i!==void 0&&i!==null?t.jsx(Z,{id:d,value:i,ariaLabel:`${n} JSON object`,readOnly:l,onChange:a}):t.jsx("fieldset",{"aria-label":c?n:void 0,"aria-labelledby":c?void 0:`${d}-label`,className:"space-y-3 rounded-md border p-3",children:o.map(([w,k])=>t.jsx(M,{fieldPath:`${s}.${w}`,fieldKey:w,prop:k,value:A[w],onChange:g=>{const h={...A};g===void 0?delete h[w]:h[w]=g,a(h)},isRequired:y.has(w),readonly:l,orgContext:x},w))})}else if(S)j=i!=null&&!xe(i)?t.jsx(D,{id:d,value:i,ariaLabel:`${n} JSON array`,readOnly:l,itemType:e.items?.type,itemEnum:e.items?.enum,minItems:e.minItems,maxItems:e.maxItems,onChange:a}):t.jsx(he,{id:d,value:i,itemType:e.items?.type,itemEnum:e.items?.enum,minItems:e.minItems,maxItems:e.maxItems,ariaLabel:c?n:void 0,readOnly:l,showHelp:!c,onChange:a});else if(p&&e.items){const o=Array.isArray(i)?i:[],y=Object.entries(e.items.properties??{}),A=new Set(e.items.required??[]),w=e.maxItems===void 0||o.length<e.maxItems,k=e.minItems===void 0||o.length>e.minItems;j=!Array.isArray(i)&&i!==void 0&&i!==null||y.length>0&&o.some(g=>!R(g))?t.jsx(D,{id:d,value:i,ariaLabel:`${n} JSON array`,readOnly:l,itemType:"object",minItems:e.minItems,maxItems:e.maxItems,onChange:a}):y.length===0?t.jsxs("fieldset",{"aria-label":c?n:void 0,"aria-labelledby":c?void 0:`${d}-label`,className:"space-y-3",children:[o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No rows"}):o.map((g,h)=>t.jsxs("fieldset",{className:"space-y-2 rounded-md border p-3",children:[t.jsxs("legend",{className:"px-1 text-xs font-medium text-muted-foreground",children:["Row ",h+1]}),t.jsx(Z,{id:`${d}-${h}-json`,value:g,ariaLabel:`${n} row ${h+1} JSON object`,readOnly:l,onChange:E=>{const N=[...o];N[h]=E,a(N)}}),l?null:t.jsxs(I,{type:"button",variant:"ghost",size:"sm","aria-label":`Remove row ${h+1}`,disabled:!k,onClick:()=>a(o.filter((E,N)=>N!==h)),children:[t.jsx(G,{className:"mr-1.5 h-4 w-4"}),"Remove row"]})]},`${s}.${h}`)),l?null:t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!w,onClick:()=>a([...o,{}]),children:[t.jsx(Q,{className:"mr-1.5 h-4 w-4"}),"Add row"]})]}):t.jsxs("fieldset",{"aria-label":c?n:void 0,"aria-labelledby":c?void 0:`${d}-label`,className:"space-y-3",children:[t.jsx("div",{className:"rounded-md border",children:t.jsxs(be,{children:[t.jsx(je,{children:t.jsxs(z,{children:[y.map(([g,h])=>t.jsxs(X,{children:[h.description||L(g),A.has(g)?t.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]},g)),l?null:t.jsx(X,{className:"w-12"})]})}),t.jsx(ye,{children:o.length===0?t.jsx(z,{children:t.jsx(B,{colSpan:y.length+(l?0:1),className:"text-sm text-muted-foreground",children:"No rows"})}):o.map((g,h)=>{const E=R(g)?g:{};return t.jsxs(z,{children:[y.map(([N,F])=>t.jsx(B,{className:"align-top",children:t.jsx(M,{fieldPath:`${s}.${h}.${N}`,fieldKey:N,prop:F,value:E[N],onChange:H=>{const Y=[...o],_={...E};H===void 0?delete _[N]:_[N]=H,Y[h]=_,a(Y)},isRequired:A.has(N),readonly:l,compact:!0,orgContext:x})},N)),l?null:t.jsx(B,{className:"align-top",children:t.jsx(I,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove row ${h+1}`,disabled:!k,onClick:()=>a(o.filter((N,F)=>F!==h)),children:t.jsx(G,{className:"h-4 w-4"})})})]},`${s}.${h}`)})})]})}),l?null:t.jsxs(I,{type:"button",variant:"outline",size:"sm",disabled:!w,onClick:()=>a([...o,{}]),children:[t.jsx(Q,{className:"mr-1.5 h-4 w-4"}),"Add row"]})]})}else if(e.type==="array")j=t.jsx(D,{id:d,value:i,ariaLabel:`${n} JSON array`,readOnly:l,itemType:e.items?.type,itemEnum:e.items?.enum,minItems:e.minItems,maxItems:e.maxItems,onChange:a});else if(e.format==="date")j=t.jsx(te,{id:d,value:typeof i=="string"?i:void 0,onChange:a,readonly:l,ariaLabel:c?n:void 0});else if(e.format==="date-time")j=t.jsx(te,{id:d,value:typeof i=="string"?i:void 0,onChange:a,readonly:l,ariaLabel:c?n:void 0,includeTime:!0});else{const o=e.format==="uri"||e.format==="url";j=t.jsx(U,{id:d,"aria-label":c?n:void 0,type:o?"url":"text",value:i??"",onChange:y=>a(y.target.value||void 0),placeholder:o?"https://example.com":`Enter ${n.toLowerCase()}`,disabled:l})}if(c)return j;const v=f||p;return t.jsxs("div",{className:"space-y-1.5",children:[v?t.jsxs("p",{id:`${d}-label`,className:"flex items-center gap-1.5 text-sm font-medium",children:[t.jsxs("span",{children:[n,m?t.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]}),$]}):t.jsxs(q,{htmlFor:d,className:"flex items-center gap-1.5",children:[t.jsxs("span",{children:[n,m?t.jsx("span",{className:"text-destructive ml-1",children:"*"}):null]}),$]}),j]})}function We(s){const r={};for(const[e,i]of Object.entries(s)){const a=ne(i);a==null||a===""||(r[e]=a)}return r}function Ke({schema:s,values:r,onValuesChange:e,readonly:i=!1,fieldControls:a,orgContext:m}){const u=s,b=u?.properties,c=new Set(u?.required??[]),x=(n,d)=>{e({...r,[n]:d})};return!b||Object.keys(b).length===0?t.jsx("p",{className:"text-sm text-muted-foreground py-2",children:"No additional fields required for this entity type."}):t.jsx("div",{className:"space-y-4",children:Object.entries(b).map(([n,d])=>"x-measure"in d||"x-dimension"in d?null:t.jsx(M,{fieldPath:n,fieldKey:n,prop:d,value:r[n],onChange:l=>x(n,l),isRequired:c.has(n),readonly:i,control:a?.[n],orgContext:m},n))})}const Je=O.forwardRef(({className:s,orientation:r="horizontal",decorative:e=!0,...i},a)=>t.jsx(ie,{ref:a,decorative:e,orientation:r,className:T("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...i}));Je.displayName=ie.displayName;function se(s,r){const e=s?.properties;if(e)return Object.entries(e).find(([,i])=>i[r])?.[0]}function He(s){const r=s.trim(),e=r.split(/[\s._@/-]+/).filter(Boolean),i=e.length>=2?`${e[0][0]}${e[1][0]}`:(e[0]??r).slice(0,2);let a=0;for(let m=0;m<r.length;m++)a=a*31+r.charCodeAt(m)>>>0;return{initials:i.toUpperCase()||"?",hue:a%360}}function Ye(s){const[r,e]=O.useState();return O.useEffect(()=>{if(!s){e(void 0);return}let i=!1;const a=s.trim().toLowerCase();return crypto.subtle.digest("SHA-256",new TextEncoder().encode(a)).then(m=>{i||e(Array.from(new Uint8Array(m)).map(u=>u.toString(16).padStart(2,"0")).join(""))}),()=>{i=!0}},[s]),r?`https://www.gravatar.com/avatar/${r}?d=identicon&s=80`:void 0}function et({metadata:s,metadataSchema:r,name:e,typeIcon:i,className:a="h-6 w-6",iconClassName:m="h-5 w-5",initialsFallback:u=!1}){const b=se(r,"x-image"),c=se(r,"x-email"),x=b&&s?.[b]||void 0,n=c&&s?.[c]||void 0,d=Ye(x?void 0:n),l=x||d,[$,f]=O.useState(!1);if(O.useEffect(()=>{f(!1)},[l]),l&&!$)return t.jsx("img",{src:l,alt:e,referrerPolicy:"no-referrer",onError:()=>f(!0),className:T("rounded-full object-cover border border-border",a)});if(u){const p=e.trim()||n||Ze(s,r)||e,{initials:S,hue:j}=He(p);return t.jsx("span",{role:"img","aria-label":e,className:T("inline-grid place-items-center rounded-full border border-border font-semibold text-white select-none",a),style:{background:`oklch(0.55 0.13 ${j})`,fontSize:"0.85em"},children:S})}return t.jsx(Pe,{icon:i,className:m})}function Ze(s,r){if(!s)return;const e=r?.properties,i=["email","handle","username","login","github","x_handle","slug"],a=Object.keys(e||s);for(const m of a)if(i.includes(m.toLowerCase())){const u=s[m];if(typeof u=="string"&&u.trim())return u}}function Ge(s,r){if(typeof s!="string"||!r||r.length===0)return s;const e=s.trim();if(r.includes(e))return e;try{const i=JSON.parse(e);if(typeof i=="string"&&r.includes(i))return i}catch{}return s}function tt(s,r){if(!s)return{};const e=r?.properties;return e?Object.fromEntries(Object.entries(s).map(([i,a])=>[i,Ge(a,e[i]?.enum)])):{...s}}export{Ke as D,et as E,Je as S,tt as a,We as c,Ge as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as i,j as e,L as c,a5 as m,aj as t,aS as a,B as l,ap as d}from"./index-
|
|
1
|
+
import{Y as i,j as e,L as c,a5 as m,aj as t,aS as a,B as l,ap as d}from"./index-Bfux0kHb.js";import{F as o}from"./full-page-spinner-DTSqneUO.js";function h(){const{session:s,isReady:n}=i();if(!n)return e.jsx(o,{});if(!s||!s.user)return e.jsx("div",{className:"container mx-auto py-8 px-4",children:e.jsxs("div",{className:"max-w-md mx-auto text-center space-y-4",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Not signed in"}),e.jsx("p",{className:"text-muted-foreground",children:"Please sign in to view your settings."}),e.jsx(c,{to:"/auth/login",search:m({intent:"sign-in"}),className:"inline-block px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Sign In"})]})});const r=async()=>{await d(),window.location.href="/"};return e.jsx("div",{className:"container mx-auto py-8 px-4",children:e.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage your account settings"})]}),e.jsxs("div",{className:t(a,"p-6 space-y-6"),children:[e.jsx("h2",{className:"text-lg font-medium",children:"Profile"}),e.jsxs("div",{className:"flex items-center gap-4",children:[s.user.image?e.jsx("img",{src:s.user.image,alt:s.user.name||"User",referrerPolicy:"no-referrer",className:"h-16 w-16 rounded-full object-cover"}):e.jsx("div",{className:"h-16 w-16 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-xl font-medium text-primary",children:(s.user.name||s.user.email||"U")[0].toUpperCase()})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.user.name||"User"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.user.email})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Name"}),e.jsx("p",{className:"mt-1",children:s.user.name||"Not set"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Email"}),e.jsx("p",{className:"mt-1",children:s.user.email})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"User ID"}),e.jsx("p",{className:"mt-1 text-xs font-mono text-muted-foreground",children:s.user.id})]})]})]}),e.jsxs("div",{className:t(a,"p-6 space-y-4"),children:[e.jsx("h2",{className:"text-lg font-medium",children:"Account"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign out of your account on this device."}),e.jsx(l,{variant:"destructive",onClick:r,children:"Sign Out"})]})]})})}export{h as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hq as t,j as n}from"./index-Bfux0kHb.js";import{a as s}from"./agents-workbench-BOKifKIO.js";import"./agent-editor-form-CajEehVn.js";import"./model-selector-CvU3VP90.js";import"./proposal-review-shell-C_LcyUEF.js";import"./runs-BQ11PAQT.js";function c(){const{owner:o,agentId:r}=t.useParams(),e=t.useSearch();return n.jsx(s,{owner:o,agentId:r,tab:"settings",runId:e.run_id})}export{c as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hp as r,j as t,a0 as s}from"./index-Bfux0kHb.js";import{A as e}from"./agent-skill-context-CxglCznW.js";import"./core.esm-CFYXLQXH.js";import"./skill-editor-D_W3QlRz.js";function p(){const{agentId:o}=r.useParams();return t.jsx(e,{agentId:o,children:t.jsx(s,{})})}export{p as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,aj as i}from"./index-
|
|
1
|
+
import{j as r,aj as i}from"./index-Bfux0kHb.js";function l({checked:n,onCheckedChange:s,disabled:o,className:e,...t}){return r.jsx("button",{type:"button",role:"switch","aria-checked":n,disabled:o,onClick:()=>s(!n),className:i("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",n?"bg-primary":"bg-input",e),...t,children:r.jsx("span",{className:i("pointer-events-none block h-4 w-4 rounded-full bg-background ring-0 transition-transform",n?"translate-x-4":"translate-x-0")})})}export{l as S};
|