@mean-weasel/lineage 0.1.24 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.1.26
6
+
7
+ - Prevent GitHub Pages asset paths from contaminating the npm package, restore stable app rendering, and reject mismatched production asset URLs during package smoke verification.
8
+
9
+ ## 0.1.25
10
+
11
+ - Keep tagged release provenance clean after documentation builds so verified stable installations accept the published package.
12
+
5
13
  ## 0.1.24
6
14
 
7
15
  - Add persistent per-canvas Social marks across the UI and CLI, including agent-readable local media context, claim enforcement, and safe cleanup when a node leaves its canvas.
@@ -47,4 +47,4 @@ import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t
47
47
  "providerId": "codex-handoff",
48
48
  "providerLabel": "Codex handoff"
49
49
  }
50
- ]`);function ob(e,t){let n=ab.find(n=>n.adapterType===e&&n.providerId===t);if(!n)throw Error(`Missing public adapter catalog entry: ${e}/${t}`);return n}var sb={channel:`dev`,version:`0.1.24`},cb={cloud:D,image_generator:V,scheduler:ae},lb=Object.fromEntries(ab.map(e=>[e.adapterType,e.capabilityLabel])),ub=[{adapterType:`cloud`,ariaLabel:`Cloud storage settings`},{adapterType:`scheduler`,ariaLabel:`Social scheduling settings`},{adapterType:`image_generator`,ariaLabel:`Image generation settings`}];function db(e){return typeof e==`boolean`?e?`on`:`off`:typeof e==`number`?String(e):typeof e==`string`?e||`not set`:JSON.stringify(e)}function fb(e){return Object.entries(e.safe_config).filter(([e])=>![`secret`,`token`,`password`,`credential`,`apiKey`].includes(e))}function pb(e){return e.health_status===`configured`?`ok`:e.health_status===`missing_config`?`warn`:`muted`}function mb(e){return(0,X.jsx)(`button`,{"aria-checked":e.checked,"aria-label":e.label,className:`settings-switch ${e.checked?`on`:``}`,disabled:e.disabled,onClick:e.onClick,role:`switch`,type:`button`,children:(0,X.jsx)(`span`,{})})}function hb(e){let[t,n]=(0,p.useState)(null),[r,i]=(0,p.useState)(null),[a,s]=(0,p.useState)(!0),[c,l]=(0,p.useState)(``),[u,d]=(0,p.useState)(Cm);function f(){let t=!u;if(!wm(t)){e.onToast(`error`,`Browser storage is unavailable, so the hover preview preference could not be saved`);return}d(t),e.onToast(`ok`,`Lineage hover previews ${t?`enabled`:`disabled`}`)}async function m(){s(!0);try{let[t,r]=await Promise.all([g(`/api/adapters/settings?project=${encodeURIComponent(e.project)}`),g(`/api/runtime`)]);n(t),i(r.runtime)}catch(t){e.onToast(`error`,t instanceof Error?t.message:String(t))}finally{s(!1)}}async function h(t){let r=`${t.adapter_type}:${t.provider}`;l(r);try{let r=await g(`/api/adapters/settings/${t.adapter_type}/${t.provider}`,{body:JSON.stringify({confirmWrite:!0,enabled:!t.enabled,project:e.project,safeConfig:t.safe_config}),headers:{"Content-Type":`application/json`},method:`POST`});n(e=>e&&{...e,settings:e.settings.map(e=>e.adapter_type===r.setting.adapter_type&&e.provider===r.setting.provider?r.setting:e)}),e.onToast(`ok`,`${lb[t.adapter_type]} ${r.setting.enabled?`enabled`:`disabled`}`)}catch(t){e.onToast(`error`,t instanceof Error?t.message:String(t))}finally{l(``)}}return(0,p.useEffect)(()=>{m()},[e.project]),(0,X.jsxs)(`section`,{className:`settings-view`,children:[(0,X.jsxs)(`header`,{className:`settings-header`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{children:`Settings`}),(0,X.jsxs)(`p`,{children:[`Adapter switches, safe local preferences, and credential-source status for `,e.project,`.`]})]}),(0,X.jsxs)(`button`,{className:`secondary-button`,disabled:a,onClick:()=>void m(),type:`button`,children:[a?(0,X.jsx)(W,{className:`spin`,size:17}):(0,X.jsx)(o,{size:17}),`Refresh`]})]}),(0,X.jsxs)(`div`,{className:`settings-sections`,children:[(0,X.jsxs)(`section`,{"aria-label":`Release information`,className:`settings-section`,children:[(0,X.jsx)(`h3`,{children:`Release`}),(0,X.jsxs)(`dl`,{className:`settings-release`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Version`}),(0,X.jsx)(`dd`,{children:r?.version||sb.version})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Channel`}),(0,X.jsx)(`dd`,{children:r?.channel||sb.channel})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Profile`}),(0,X.jsx)(`dd`,{children:r?.profile.id||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Environment`}),(0,X.jsx)(`dd`,{children:r?.profile.environment||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Binding`}),(0,X.jsx)(`dd`,{children:r?r.profile.bound?`bound`:`legacy unbound`:`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Git`}),(0,X.jsx)(`dd`,{children:r?.git_sha||`not available`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Assets`}),(0,X.jsx)(`dd`,{className:`settings-path`,children:r?.asset_root||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`SQLite`}),(0,X.jsx)(`dd`,{className:`settings-path`,children:r?.database.path||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Database`}),(0,X.jsx)(`dd`,{children:r?.database.exists?`${r.database.projects??0} projects / ${r.database.workspaces??0} workspaces`:`not created yet`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Schema`}),(0,X.jsx)(`dd`,{children:r?`${r.schema.migration_keys.length} migration marker(s)`:`loading`})]})]})]}),(0,X.jsxs)(`section`,{"aria-label":`Lineage experience settings`,className:`settings-section`,children:[(0,X.jsx)(`h3`,{children:`Lineage experience`}),(0,X.jsx)(`div`,{className:`settings-grid`,children:(0,X.jsx)(`article`,{className:`settings-card`,children:(0,X.jsxs)(`div`,{className:`settings-card-head`,children:[(0,X.jsx)(`span`,{className:`settings-icon`,children:(0,X.jsx)(N,{size:19})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h4`,{children:`Hover previews`}),(0,X.jsx)(`p`,{children:`Show the full asset and quick Branch/Re-roll/Details actions when hovering over or focusing a lineage node. Double-click details remain available when this is off.`})]}),(0,X.jsx)(mb,{checked:u,label:`Enable lineage hover previews`,onClick:f})]})})})]}),ub.map(e=>(0,X.jsxs)(`section`,{"aria-label":e.ariaLabel,className:`settings-section`,children:[(0,X.jsx)(`h3`,{children:lb[e.adapterType]}),(0,X.jsx)(`div`,{className:`settings-grid`,children:(t?.settings||[]).filter(t=>t.adapter_type===e.adapterType).map(e=>{let t=cb[e.adapter_type],n=ob(e.adapter_type,e.provider),r=`Enable ${e.label===`Buffer`?`Buffer scheduling`:e.label}`,i=c===`${e.adapter_type}:${e.provider}`;return(0,X.jsxs)(`article`,{className:`settings-card`,children:[(0,X.jsxs)(`div`,{className:`settings-card-head`,children:[(0,X.jsx)(`span`,{className:`settings-icon`,children:(0,X.jsx)(t,{size:19})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h4`,{children:e.label}),(0,X.jsx)(`p`,{children:e.description})]}),(0,X.jsx)(mb,{checked:e.enabled,disabled:i,label:r,onClick:()=>void h(e)})]}),(0,X.jsxs)(`dl`,{className:`settings-meta`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Status`}),(0,X.jsxs)(`dd`,{className:pb(e),children:[e.health_status===`configured`?(0,X.jsx)(w,{size:14}):(0,X.jsx)(C,{size:14}),e.health_status.replace(/_/g,` `)]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Maturity`}),(0,X.jsx)(`dd`,{children:n.maturity})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Credential source`}),(0,X.jsx)(`dd`,{children:e.credential.label})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Secret ref`}),(0,X.jsx)(`dd`,{children:e.credential.secret_ref||`none`})]})]}),fb(e).length>0&&(0,X.jsx)(`div`,{className:`settings-config`,children:fb(e).map(([e,t])=>(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`strong`,{children:e}),db(t)]},e))})]},`${e.adapter_type}:${e.provider}`)})})]},e.adapterType)),a&&!t&&(0,X.jsx)(`div`,{className:`settings-loading`,children:`Loading settings...`})]})]})}var gb=`Lineage`,_b=`Local-first creative lineage workspace`;function vb(e){let{channel:t,channels:n,placementStatus:r,project:i,projects:a,setChannel:o,setPlacementStatus:s,setProject:c,setSource:l,setStatus:u,source:d,status:f}=e,[m,h]=(0,p.useState)(!1),[g,_]=(0,p.useState)(!0),v=a.length?a.map(e=>e.project):[i];return(0,X.jsxs)(`aside`,{className:`sidebar ${g?``:`collapsed`}`,children:[(0,X.jsx)(`button`,{"aria-label":g?`Collapse sidebar`:`Expand sidebar`,className:`sidebar-collapse-toggle`,onClick:()=>_(e=>!e),type:`button`,children:g?(0,X.jsx)(te,{size:16}):(0,X.jsx)(ne,{size:16})}),(0,X.jsxs)(`div`,{className:`brand`,children:[(0,X.jsx)(`div`,{className:`brand-mark`,"aria-label":_b,children:`L`}),(0,X.jsxs)(`div`,{className:`brand-copy`,children:[(0,X.jsx)(`h1`,{children:gb}),(0,X.jsxs)(`p`,{children:[(0,X.jsx)(`span`,{children:i}),(0,X.jsxs)(`span`,{"aria-label":`Lineage version ${sb.version}`,className:`brand-version`,title:`Lineage version ${sb.version}, ${sb.channel} channel`,children:[`v`,sb.version]})]})]})]}),(0,X.jsxs)(`button`,{"aria-controls":`mobile-sidebar-controls`,"aria-expanded":m,className:`mobile-filter-toggle`,onClick:()=>h(e=>!e),type:`button`,children:[(0,X.jsx)(K,{size:16}),`Filters`,(0,X.jsx)(S,{className:m?`open`:``,size:16})]}),(0,X.jsxs)(`div`,{className:`sidebar-mobile-collapse`,"data-open":m,id:`mobile-sidebar-controls`,children:[(0,X.jsxs)(`div`,{className:`side-section`,children:[(0,X.jsx)(`h2`,{children:`Project`}),(0,X.jsx)(yb,{id:`asset-project-filter`,label:`Project`,value:i,values:v,onChange:c})]}),(0,X.jsxs)(`section`,{className:`side-section`,children:[(0,X.jsx)(`h2`,{children:`Filters`}),(0,X.jsx)(yb,{id:`asset-source-filter`,label:`Source`,value:d,values:Y,onChange:e=>l(e)}),(0,X.jsx)(yb,{id:`asset-status-filter`,label:`Status`,value:f,values:J,onChange:e=>u(e)}),(0,X.jsx)(yb,{id:`asset-channel-filter`,label:`Channel`,value:t,values:n,onChange:o}),(0,X.jsx)(yb,{id:`asset-placement-filter`,label:`Placement`,value:r,values:he,onChange:e=>s(e)})]})]})]})}function yb({id:e,label:t,value:n,values:r,onChange:i}){return(0,X.jsxs)(`label`,{htmlFor:e,children:[t,(0,X.jsx)(`select`,{"aria-label":t,id:e,value:n,onChange:e=>i(e.target.value),children:r.map(e=>(0,X.jsx)(`option`,{value:e,children:e},e))})]})}var bb=[{label:`Lineage`,view:`lineage`},{label:`Review`,view:`review`},{label:`Assets`,view:`assets`},{label:`Agents`,view:`agents`},{label:`Settings`,view:`settings`}],xb=[{label:`Ledger`,view:`ledger`},{label:`Content batches`,view:`content`},{label:`Backup queue`,view:`backup`}];function Sb(e){let t=xb.some(t=>t.view===e.view);function n(t){e.setView(t),e.onMoreOpenChange(!1)}function r(t){e.setView(t),e.onMoreOpenChange(!1)}return(0,X.jsxs)(`header`,{className:`topbar`,children:[(0,X.jsxs)(`div`,{className:`view-tabs`,role:`tablist`,"aria-label":`${gb} views`,children:[bb.map(t=>(0,X.jsx)(`button`,{"aria-pressed":e.view===t.view,className:e.view===t.view?`active`:``,onClick:()=>n(t.view),type:`button`,children:t.label},t.view)),(0,X.jsxs)(`div`,{className:`more-menu`,children:[(0,X.jsxs)(`button`,{"aria-expanded":e.moreOpen,"aria-haspopup":`menu`,"aria-pressed":t,className:t?`active`:``,onClick:()=>e.onMoreOpenChange(!e.moreOpen),type:`button`,children:[(0,X.jsx)(j,{size:16}),` More `,(0,X.jsx)(S,{className:e.moreOpen?`open`:``,size:15})]}),e.moreOpen&&(0,X.jsx)(`div`,{className:`more-menu-popover`,role:`menu`,children:xb.map(t=>(0,X.jsx)(`button`,{"aria-pressed":e.view===t.view,onClick:()=>r(t.view),role:`menuitem`,type:`button`,children:t.label},t.view))})]})]}),(0,X.jsx)(Cb,{runtime:e.runtime,unavailable:e.runtimeIdentityUnavailable}),(0,X.jsxs)(`div`,{className:`searchbox`,children:[(0,X.jsx)(ie,{size:17}),(0,X.jsx)(`input`,{onChange:t=>e.setQuery(t.target.value),placeholder:`Search assets, campaigns, hooks`,value:e.query})]}),e.view!==`lineage`&&(0,X.jsxs)(`button`,{"aria-expanded":e.assetDetailsOpen,className:`secondary-button`,disabled:!e.canInspectAsset,onClick:()=>{e.onMoreOpenChange(!1),e.setAssetDetailsOpen(!e.assetDetailsOpen)},type:`button`,children:[(0,X.jsx)(I,{size:17}),`Details`]}),(0,X.jsx)(`button`,{className:`icon-button`,disabled:e.loading,onClick:()=>void e.refresh(),title:`Refresh current page`,children:e.loading?(0,X.jsx)(W,{className:`spin`,size:18}):(0,X.jsx)(o,{size:18})}),(0,X.jsxs)(`button`,{className:`primary-button`,onClick:()=>e.setUploadOpen(!0),children:[(0,X.jsx)(ue,{size:17}),`Upload`]})]})}function Cb(e){if(e.unavailable)return(0,X.jsx)(`div`,{"aria-label":`Lineage runtime identity unavailable`,className:`runtime-identity-badge unavailable`,children:`IDENTITY UNAVAILABLE`});if(!e.runtime)return(0,X.jsx)(`div`,{"aria-label":`Loading Lineage runtime identity`,className:`runtime-identity-badge loading`,children:`IDENTITY LOADING`});let{profile:t}=e.runtime,n=t.bound?``:` · UNBOUND`,r=[`${t.environment.toUpperCase()} profile ${t.id}${t.bound?``:` (unbound)`}`,`Channel ${e.runtime.channel}`,`Version ${e.runtime.version}`,t.warning].filter(Boolean).join(` · `);return(0,X.jsxs)(`div`,{"aria-label":`Lineage ${t.environment} profile ${t.id}${t.bound?``:` unbound`}`,className:`runtime-identity-badge ${t.environment} ${t.bound?`bound`:`unbound`}`,"data-profile-id":t.id,title:r,children:[(0,X.jsx)(`strong`,{children:t.environment.toUpperCase()}),(0,X.jsxs)(`span`,{children:[t.id,n]})]})}function wb({toast:e,onDismiss:t}){return(0,X.jsxs)(`div`,{className:`toast ${e.type}`,role:`status`,children:[e.type===`ok`?(0,X.jsx)(w,{size:16}):(0,X.jsx)(oe,{size:16}),(0,X.jsx)(`span`,{children:e.message}),(0,X.jsx)(`button`,{onClick:t,children:`Dismiss`})]})}var Tb=200*1024*1024;function Eb({channels:e,project:t,onClose:n,onUploaded:r,onError:i}){let[a,o]=(0,p.useState)({assetId:``,audience:`short-form-creators`,campaign:`2026-06-organic-traffic-test`,channel:e[0]||`meta`,cta:``,hook:``,status:`working`,title:``,type:`image`,utmContent:``}),[s,c]=(0,p.useState)(null),[l,u]=(0,p.useState)(!1),[d,f]=(0,p.useState)(!1);function m(e,t){o(n=>({...n,[e]:t}))}function h(e){o(t=>({...t,assetId:t.assetId||pe(`demo-${t.channel}-${e}`),title:e,utmContent:t.utmContent||pe(e).replaceAll(`-`,`_`)}))}function _(e){if(!e){c(null);return}if(e.size>Tb){i(`File is larger than ${q(Tb)}`);return}c(e)}async function v(e){if(e.preventDefault(),!s)return i(`Choose a file before uploading`);f(!0);try{let e=new FormData;Object.entries({project:t,...a,confirmWrite:String(l)}).forEach(([t,n])=>e.append(t,n)),e.append(`file`,s),await r((await g(`/api/assets/upload`,{method:`POST`,body:e})).message)}catch(e){i(e instanceof Error?e.message:String(e))}finally{f(!1)}}return(0,X.jsx)(`div`,{className:`drawer-backdrop`,children:(0,X.jsxs)(`form`,{className:`upload-drawer`,onSubmit:v,children:[(0,X.jsxs)(`header`,{children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{children:`Upload asset`}),(0,X.jsx)(`p`,{children:t})]}),(0,X.jsx)(`button`,{type:`button`,onClick:n,children:`Close`})]}),(0,X.jsxs)(`label`,{className:`file-drop`,children:[(0,X.jsx)(ue,{size:20}),(0,X.jsx)(`span`,{children:s?s.name:`Choose creative export up to ${q(Tb)}`}),(0,X.jsx)(`input`,{type:`file`,onChange:e=>_(e.target.files?.[0])})]}),(0,X.jsxs)(`div`,{className:`form-grid`,children:[(0,X.jsxs)(`label`,{children:[`Title`,(0,X.jsx)(`input`,{value:a.title,onChange:e=>h(e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Asset ID`,(0,X.jsx)(`input`,{value:a.assetId,onChange:e=>m(`assetId`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Campaign`,(0,X.jsx)(`input`,{value:a.campaign,onChange:e=>m(`campaign`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Channel`,(0,X.jsx)(`select`,{value:a.channel,onChange:e=>m(`channel`,e.target.value),children:e.map(e=>(0,X.jsx)(`option`,{children:e},e))})]}),(0,X.jsxs)(`label`,{children:[`Audience`,(0,X.jsx)(`input`,{value:a.audience,onChange:e=>m(`audience`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Status`,(0,X.jsxs)(`select`,{value:a.status,onChange:e=>m(`status`,e.target.value),children:[(0,X.jsx)(`option`,{children:`working`}),(0,X.jsx)(`option`,{children:`published`})]})]}),(0,X.jsxs)(`label`,{children:[`Type`,(0,X.jsx)(`select`,{value:a.type,onChange:e=>m(`type`,e.target.value),children:ge.map(e=>(0,X.jsx)(`option`,{children:e},e))})]}),(0,X.jsxs)(`label`,{children:[`UTM content`,(0,X.jsx)(`input`,{value:a.utmContent,onChange:e=>m(`utmContent`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{className:`wide`,children:[`Hook`,(0,X.jsx)(`input`,{value:a.hook,onChange:e=>m(`hook`,e.target.value)})]}),(0,X.jsxs)(`label`,{className:`wide`,children:[`CTA`,(0,X.jsx)(`input`,{value:a.cta,onChange:e=>m(`cta`,e.target.value),required:!0})]})]}),(0,X.jsxs)(`label`,{className:`confirm-line`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked)}),(0,X.jsx)(`span`,{children:`Confirm write to the production asset bucket`})]}),(0,X.jsxs)(`footer`,{children:[(0,X.jsx)(`button`,{type:`button`,onClick:n,children:`Cancel`}),(0,X.jsxs)(`button`,{className:`primary-button`,disabled:d||!l,children:[d?(0,X.jsx)(W,{className:`spin`,size:16}):(0,X.jsx)(ue,{size:16}),`Upload`]})]})]})})}function Db(e,t){let n=`${e} ${t}`.toLowerCase();return n.includes(`agent`)||n.includes(`command`)||n.includes(`selection`)||n.includes(`next context`)}function Ob(){return typeof window>`u`?me:new URLSearchParams(window.location.search).get(`project`)||`demo-project`}function kb(){let[e,t]=(0,p.useState)(null),[n,r]=(0,p.useState)(null),[i,a]=(0,p.useState)(Ob),[o,s]=(0,p.useState)([]),[c,l]=(0,p.useState)(`all`),[u,d]=(0,p.useState)(`all`),[f,m]=(0,p.useState)(`local`),[h,y]=(0,p.useState)(`all`),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(1),[w,T]=(0,p.useState)(10),[E,D]=(0,p.useState)(!1),[O,k]=(0,p.useState)(!0),[A,j]=(0,p.useState)(null),[M,N]=(0,p.useState)(null),[P,F]=(0,p.useState)({}),[I,L]=(0,p.useState)({}),[R,z]=(0,p.useState)([]),[B,V]=(0,p.useState)([]),[ee,H]=(0,p.useState)(!1),[U,W]=(0,p.useState)(!1),[G,te]=(0,p.useState)(`lineage`),[ne,re]=(0,p.useState)(!1),[ie,ae]=(0,p.useState)(null),[oe,K]=(0,p.useState)(0),[se,ce]=(0,p.useState)(null),[le,ue]=(0,p.useState)(!1),[de,q]=(0,p.useState)(null),fe=(0,p.useCallback)(e=>{q(t=>e?`lineage-actions`:t===`lineage-actions`?null:t)},[]),pe=(0,p.useCallback)(e=>{q(t=>e?`topbar-more`:t===`topbar-more`?null:t)},[]),me=(0,p.useCallback)((e,t)=>{j({type:e,message:t})},[]),J=e?.catalog.project===i?e:null,he=J?.assets||[],Y=xe(he,n)||(ie?.project===i&&ie.asset_id===n?ie:void 0),ge=Y?.asset_id||``,_e=[...B.filter(e=>R.includes(e.asset_id)),...he.filter(e=>R.includes(e.asset_id)&&e.local?.relative_path)].filter((e,t,n)=>n.findIndex(t=>t.asset_id===e.asset_id)===t),ve=Y&&P[Y.asset_id]||null,ye=(0,p.useMemo)(()=>[`all`,...J?.facets.channels||[]],[J]),be=(0,p.useMemo)(()=>({assets:J?.catalog.asset_count||0,live:J?.liveObjects.length||0,orphan:J?.orphanObjects.length||0,size:J?.facets.totalSizeBytes||0}),[J]);async function Ce(){try{let e=await g(`/api/projects`);s(e.projects),a(t=>e.projects.some(e=>e.project===t)?t:e.projects[0]?.project||`demo-project`)}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}async function we(){try{let e=await g(`/api/runtime`);ce(e.runtime),ue(!1)}catch{ce(null),ue(!0)}}async function Te(){k(!0);try{let e=await g(`/api/assets?${Ee()}`);t(e),r(t=>xe(e.assets,t)?.asset_id||(t&&ie?.asset_id===t?t:null)),F({}),L({})}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}finally{k(!1)}}function Ee(){let e=new URLSearchParams({project:i,page:String(S),pageSize:String(w),live:String(E),source:f});return c!==`all`&&e.set(`status`,c),u!==`all`&&e.set(`placementStatus`,u),h!==`all`&&e.set(`channel`,h),b.trim()&&e.set(`q`,b.trim()),e.toString()}async function De(e){try{let t=await e();j({type:`ok`,message:t.message}),F({}),await Te()}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}async function Oe(e,t={}){if(!Se(e))return null;let n=P[e.asset_id];if(n)return t.open&&window.open(n,`_blank`,`noopener,noreferrer`),n;if(e.local?.relative_path){let n=`/api/assets/local-preview?${new URLSearchParams({project:i,path:e.local.relative_path}).toString()}`;return F(t=>({...t,[e.asset_id]:n})),L(t=>({...t,[e.asset_id]:``})),t.open&&window.open(n,`_blank`,`noopener,noreferrer`),n}try{let n=await g(`/api/assets/presign`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project:i,assetId:e.asset_id,expiresIn:900})});return F(t=>({...t,[e.asset_id]:n.url})),L(t=>({...t,[e.asset_id]:``})),t.open&&window.open(n.url,`_blank`,`noopener,noreferrer`),n.url}catch(n){let r=n instanceof Error?n.message:String(n);return L(t=>({...t,[e.asset_id]:r})),t.quiet||j({type:`error`,message:`Preview unavailable. Check S3 credentials or pull the asset locally.`}),null}}async function ke(e,t){try{let n=await Bm(e);j({type:`ok`,message:n.method===`fallback`?`Copied ${t} using browser fallback`:`Copied ${t}`}),N(Db(t,e)?{label:t,text:e}:null)}catch(n){N(Db(t,e)?{label:t,text:e}:null),j({type:`error`,message:n instanceof Error?n.message:String(n)})}}async function je(e){let t=await Oe(e,{quiet:!0});t&&await ke(t,`preview link`)}function Ne(e){e.local?.relative_path&&(z(t=>t.includes(e.asset_id)?t:[...t,e.asset_id]),V(t=>t.some(t=>t.asset_id===e.asset_id)?t:[...t,e]))}function Z(e){ae(e),r(e.asset_id),re(!0)}async function Pe(e){r(e),re(!0);let t=he.find(t=>t.asset_id===e);if(t){ae(t);return}try{let t=await g(`/api/assets/lookup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project:i,assetIds:[e]})});t.assets[0]&&ae(t.assets[0])}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}function Fe(){m(`local`),l(`all`),d(`all`),x(``),te(`backup`)}async function Ie(e){try{e.assetId&&r(e.assetId),e.view===`lineage`&&e.workspaceId&&await g(`/api/lineage-workspaces/${encodeURIComponent(e.workspaceId)}/activate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project:i,confirmWrite:!0})}),re(!1),te(e.view),j({type:`ok`,message:`Opened ${e.claim.target_title||e.claim.target_id}`})}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}function Le(e){e.local?.relative_path&&(z(t=>t.includes(e.asset_id)?t.filter(t=>t!==e.asset_id):[...t,e.asset_id]),V(t=>t.filter(t=>t.asset_id!==e.asset_id)))}return(0,p.useEffect)(()=>{Ce(),we()},[]),(0,p.useEffect)(()=>{let e=new URLSearchParams(window.location.search);e.get(`project`)!==i&&(e.set(`project`,i),window.history.replaceState(null,``,`${window.location.pathname}?${e.toString()}${window.location.hash}`))},[i]),(0,p.useEffect)(()=>{j(null),N(null),ae(null),re(!1)},[i]),(0,p.useEffect)(()=>{Te()},[S,w,i,c,u,f,h,b,E]),(0,p.useEffect)(()=>{C(1)},[i,c,u,f,h,b,w]),(0,p.useEffect)(()=>{!Se(Y)||P[Y.asset_id]||Oe(Y,{quiet:!0})},[Y?.asset_id,Y?.s3?.version_id,P]),(0,p.useEffect)(()=>{if(A?.type!==`ok`)return;let e=window.setTimeout(()=>j(null),2600);return()=>window.clearTimeout(e)},[A?.message,A?.type]),(0,p.useEffect)(()=>{G===`backup`&&(m(`local`),l(`all`),d(`all`))},[G]),(0,p.useEffect)(()=>{q(null)},[G]),(0,p.useEffect)(()=>{ge||re(!1)},[ge]),(0,X.jsx)(Me,{runtime:se,children:(0,X.jsxs)(`div`,{className:`app-shell ${G===`lineage`?`lineage-mode`:``}`,children:[(0,X.jsx)(vb,{channel:h,channels:ye,liveSync:E,placementStatus:u,project:i,projects:o,setChannel:y,setPlacementStatus:d,setProject:a,setSource:m,setStatus:l,setView:te,showBackupQueue:Fe,source:f,snapshot:J,status:c,totals:be}),(0,X.jsxs)(`main`,{className:`workspace`,children:[(0,X.jsx)(Sb,{assetDetailsOpen:ne,canInspectAsset:!!Y,loading:O,moreOpen:de===`topbar-more`,onMoreOpenChange:pe,query:b,refresh:Te,runtime:se,runtimeIdentityUnavailable:le,setAssetDetailsOpen:re,setQuery:x,setUploadOpen:W,setView:e=>e===`backup`?Fe():te(e),view:G}),A&&(0,X.jsx)(wb,{toast:A,onDismiss:()=>j(null)}),M&&(0,X.jsx)(Ct,{copiedText:M,onDismiss:()=>N(null)}),(0,X.jsx)(Ot,{onCopy:ke,project:i,refreshKey:oe,selectedAsset:Y,view:G}),G===`review`?(0,X.jsx)(Yy,{channel:h,onCopy:ke,onLocalReview:async(e,t)=>{await De(()=>_(`/api/local-review/${e.asset_id}`,i,{reviewState:t,confirmWrite:!0}))},onOpenBackup:e=>{Ne(e),H(!0)},onSelectAsset:e=>{Z(e)},project:i,selected:Y}):G===`ledger`?(0,X.jsx)(Vt,{project:i,query:b,onOpenAsset:Pe}):G===`content`?(0,X.jsx)(_t,{onCopy:ke,onOpenAsset:Pe,onToast:me,onWorkTargetsChanged:()=>K(e=>e+1),project:i,selectedAsset:Y}):G===`agents`?(0,X.jsx)(ze,{onCopy:ke,onOpenWork:Ie,project:i}):G===`backup`?(0,X.jsx)(zy,{assets:he,cli:se?.cli,onCopy:ke,onLocalReview:async(e,t)=>{await De(()=>_(`/api/local-review/${e.asset_id}`,i,{reviewState:t,confirmWrite:!0}))},onOpenBackup:()=>H(!0),onQueueBackup:Ne,onSelectAsset:e=>{Z(e)},page:S,pageSize:w,project:i,selected:Y,selectedBackupIds:R,setPage:C,setPageSize:T,snapshot:J}):G===`assets`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Gy,{assets:_e,onClear:()=>{z([]),V([])},onOpen:()=>H(!0)}),(0,X.jsx)(Re,{assets:he,liveSync:E,onCopy:ke,onSelectionChanged:()=>K(e=>e+1),page:S,pageSize:w,previewUrls:P,project:i,selected:Y,setLiveSync:D,setPage:C,setPageSize:T,setSelectedId:r,snapshot:J,source:f,totals:be})]}):G===`settings`?(0,X.jsx)(hb,{onToast:me,project:i}):(0,X.jsx)(jy,{asset:Y,actionsOpen:de===`lineage-actions`,onAssetsChanged:Te,onActionsOpenChange:fe,onSelectedAsset:r,onToast:me,project:i})]}),G!==`lineage`&&ne&&(0,X.jsx)(Ae,{asset:Y,onArchive:e=>void De(()=>_(`/api/assets/archive`,i,{assetId:e.asset_id,confirmArchive:!0})),onClose:()=>re(!1),onCopy:(e,t)=>void ke(e,t),onCopyPreview:e=>void je(e),onDelete:(e,t)=>void De(()=>_(`/api/assets/delete-object`,i,{assetId:e.asset_id,confirmation:t})),onPlacement:(e,t,n)=>void De(()=>_(`/api/assets/placement`,i,{assetId:e.asset_id,channel:e.channel,...v(n),status:t,confirmWrite:!0})),onPresign:e=>void Oe(e,{open:!0}),onPromote:e=>void De(()=>_(`/api/assets/promote`,i,{assetId:e.asset_id,confirmWrite:!0})),onPull:e=>void De(()=>_(`/api/assets/pull`,i,{assetId:e.asset_id,out:`.asset-scratch`})),onToggleBackup:Le,previewError:Y&&I[Y.asset_id]||null,previewUrl:ve,selectedForBackup:Y?R.includes(Y.asset_id):!1}),U&&(0,X.jsx)(Eb,{channels:ye.filter(e=>e!==`all`),project:i,onClose:()=>W(!1),onError:e=>j({type:`error`,message:e}),onUploaded:async e=>{j({type:`ok`,message:e}),W(!1),await Te()}}),ee&&(0,X.jsx)(Py,{assets:_e,project:i,onClose:()=>H(!1),onError:e=>j({type:`error`,message:e}),onDone:async e=>{j({type:`ok`,message:e}),z([]),V([]),H(!1),await Te()}})]})})}(0,m.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(p.StrictMode,{children:(0,X.jsx)(kb,{})}));
50
+ ]`);function ob(e,t){let n=ab.find(n=>n.adapterType===e&&n.providerId===t);if(!n)throw Error(`Missing public adapter catalog entry: ${e}/${t}`);return n}var sb={channel:`dev`,version:`0.1.26`},cb={cloud:D,image_generator:V,scheduler:ae},lb=Object.fromEntries(ab.map(e=>[e.adapterType,e.capabilityLabel])),ub=[{adapterType:`cloud`,ariaLabel:`Cloud storage settings`},{adapterType:`scheduler`,ariaLabel:`Social scheduling settings`},{adapterType:`image_generator`,ariaLabel:`Image generation settings`}];function db(e){return typeof e==`boolean`?e?`on`:`off`:typeof e==`number`?String(e):typeof e==`string`?e||`not set`:JSON.stringify(e)}function fb(e){return Object.entries(e.safe_config).filter(([e])=>![`secret`,`token`,`password`,`credential`,`apiKey`].includes(e))}function pb(e){return e.health_status===`configured`?`ok`:e.health_status===`missing_config`?`warn`:`muted`}function mb(e){return(0,X.jsx)(`button`,{"aria-checked":e.checked,"aria-label":e.label,className:`settings-switch ${e.checked?`on`:``}`,disabled:e.disabled,onClick:e.onClick,role:`switch`,type:`button`,children:(0,X.jsx)(`span`,{})})}function hb(e){let[t,n]=(0,p.useState)(null),[r,i]=(0,p.useState)(null),[a,s]=(0,p.useState)(!0),[c,l]=(0,p.useState)(``),[u,d]=(0,p.useState)(Cm);function f(){let t=!u;if(!wm(t)){e.onToast(`error`,`Browser storage is unavailable, so the hover preview preference could not be saved`);return}d(t),e.onToast(`ok`,`Lineage hover previews ${t?`enabled`:`disabled`}`)}async function m(){s(!0);try{let[t,r]=await Promise.all([g(`/api/adapters/settings?project=${encodeURIComponent(e.project)}`),g(`/api/runtime`)]);n(t),i(r.runtime)}catch(t){e.onToast(`error`,t instanceof Error?t.message:String(t))}finally{s(!1)}}async function h(t){let r=`${t.adapter_type}:${t.provider}`;l(r);try{let r=await g(`/api/adapters/settings/${t.adapter_type}/${t.provider}`,{body:JSON.stringify({confirmWrite:!0,enabled:!t.enabled,project:e.project,safeConfig:t.safe_config}),headers:{"Content-Type":`application/json`},method:`POST`});n(e=>e&&{...e,settings:e.settings.map(e=>e.adapter_type===r.setting.adapter_type&&e.provider===r.setting.provider?r.setting:e)}),e.onToast(`ok`,`${lb[t.adapter_type]} ${r.setting.enabled?`enabled`:`disabled`}`)}catch(t){e.onToast(`error`,t instanceof Error?t.message:String(t))}finally{l(``)}}return(0,p.useEffect)(()=>{m()},[e.project]),(0,X.jsxs)(`section`,{className:`settings-view`,children:[(0,X.jsxs)(`header`,{className:`settings-header`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{children:`Settings`}),(0,X.jsxs)(`p`,{children:[`Adapter switches, safe local preferences, and credential-source status for `,e.project,`.`]})]}),(0,X.jsxs)(`button`,{className:`secondary-button`,disabled:a,onClick:()=>void m(),type:`button`,children:[a?(0,X.jsx)(W,{className:`spin`,size:17}):(0,X.jsx)(o,{size:17}),`Refresh`]})]}),(0,X.jsxs)(`div`,{className:`settings-sections`,children:[(0,X.jsxs)(`section`,{"aria-label":`Release information`,className:`settings-section`,children:[(0,X.jsx)(`h3`,{children:`Release`}),(0,X.jsxs)(`dl`,{className:`settings-release`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Version`}),(0,X.jsx)(`dd`,{children:r?.version||sb.version})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Channel`}),(0,X.jsx)(`dd`,{children:r?.channel||sb.channel})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Profile`}),(0,X.jsx)(`dd`,{children:r?.profile.id||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Environment`}),(0,X.jsx)(`dd`,{children:r?.profile.environment||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Binding`}),(0,X.jsx)(`dd`,{children:r?r.profile.bound?`bound`:`legacy unbound`:`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Git`}),(0,X.jsx)(`dd`,{children:r?.git_sha||`not available`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Assets`}),(0,X.jsx)(`dd`,{className:`settings-path`,children:r?.asset_root||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`SQLite`}),(0,X.jsx)(`dd`,{className:`settings-path`,children:r?.database.path||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Database`}),(0,X.jsx)(`dd`,{children:r?.database.exists?`${r.database.projects??0} projects / ${r.database.workspaces??0} workspaces`:`not created yet`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Schema`}),(0,X.jsx)(`dd`,{children:r?`${r.schema.migration_keys.length} migration marker(s)`:`loading`})]})]})]}),(0,X.jsxs)(`section`,{"aria-label":`Lineage experience settings`,className:`settings-section`,children:[(0,X.jsx)(`h3`,{children:`Lineage experience`}),(0,X.jsx)(`div`,{className:`settings-grid`,children:(0,X.jsx)(`article`,{className:`settings-card`,children:(0,X.jsxs)(`div`,{className:`settings-card-head`,children:[(0,X.jsx)(`span`,{className:`settings-icon`,children:(0,X.jsx)(N,{size:19})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h4`,{children:`Hover previews`}),(0,X.jsx)(`p`,{children:`Show the full asset and quick Branch/Re-roll/Details actions when hovering over or focusing a lineage node. Double-click details remain available when this is off.`})]}),(0,X.jsx)(mb,{checked:u,label:`Enable lineage hover previews`,onClick:f})]})})})]}),ub.map(e=>(0,X.jsxs)(`section`,{"aria-label":e.ariaLabel,className:`settings-section`,children:[(0,X.jsx)(`h3`,{children:lb[e.adapterType]}),(0,X.jsx)(`div`,{className:`settings-grid`,children:(t?.settings||[]).filter(t=>t.adapter_type===e.adapterType).map(e=>{let t=cb[e.adapter_type],n=ob(e.adapter_type,e.provider),r=`Enable ${e.label===`Buffer`?`Buffer scheduling`:e.label}`,i=c===`${e.adapter_type}:${e.provider}`;return(0,X.jsxs)(`article`,{className:`settings-card`,children:[(0,X.jsxs)(`div`,{className:`settings-card-head`,children:[(0,X.jsx)(`span`,{className:`settings-icon`,children:(0,X.jsx)(t,{size:19})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h4`,{children:e.label}),(0,X.jsx)(`p`,{children:e.description})]}),(0,X.jsx)(mb,{checked:e.enabled,disabled:i,label:r,onClick:()=>void h(e)})]}),(0,X.jsxs)(`dl`,{className:`settings-meta`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Status`}),(0,X.jsxs)(`dd`,{className:pb(e),children:[e.health_status===`configured`?(0,X.jsx)(w,{size:14}):(0,X.jsx)(C,{size:14}),e.health_status.replace(/_/g,` `)]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Maturity`}),(0,X.jsx)(`dd`,{children:n.maturity})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Credential source`}),(0,X.jsx)(`dd`,{children:e.credential.label})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Secret ref`}),(0,X.jsx)(`dd`,{children:e.credential.secret_ref||`none`})]})]}),fb(e).length>0&&(0,X.jsx)(`div`,{className:`settings-config`,children:fb(e).map(([e,t])=>(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`strong`,{children:e}),db(t)]},e))})]},`${e.adapter_type}:${e.provider}`)})})]},e.adapterType)),a&&!t&&(0,X.jsx)(`div`,{className:`settings-loading`,children:`Loading settings...`})]})]})}var gb=`Lineage`,_b=`Local-first creative lineage workspace`;function vb(e){let{channel:t,channels:n,placementStatus:r,project:i,projects:a,setChannel:o,setPlacementStatus:s,setProject:c,setSource:l,setStatus:u,source:d,status:f}=e,[m,h]=(0,p.useState)(!1),[g,_]=(0,p.useState)(!0),v=a.length?a.map(e=>e.project):[i];return(0,X.jsxs)(`aside`,{className:`sidebar ${g?``:`collapsed`}`,children:[(0,X.jsx)(`button`,{"aria-label":g?`Collapse sidebar`:`Expand sidebar`,className:`sidebar-collapse-toggle`,onClick:()=>_(e=>!e),type:`button`,children:g?(0,X.jsx)(te,{size:16}):(0,X.jsx)(ne,{size:16})}),(0,X.jsxs)(`div`,{className:`brand`,children:[(0,X.jsx)(`div`,{className:`brand-mark`,"aria-label":_b,children:`L`}),(0,X.jsxs)(`div`,{className:`brand-copy`,children:[(0,X.jsx)(`h1`,{children:gb}),(0,X.jsxs)(`p`,{children:[(0,X.jsx)(`span`,{children:i}),(0,X.jsxs)(`span`,{"aria-label":`Lineage version ${sb.version}`,className:`brand-version`,title:`Lineage version ${sb.version}, ${sb.channel} channel`,children:[`v`,sb.version]})]})]})]}),(0,X.jsxs)(`button`,{"aria-controls":`mobile-sidebar-controls`,"aria-expanded":m,className:`mobile-filter-toggle`,onClick:()=>h(e=>!e),type:`button`,children:[(0,X.jsx)(K,{size:16}),`Filters`,(0,X.jsx)(S,{className:m?`open`:``,size:16})]}),(0,X.jsxs)(`div`,{className:`sidebar-mobile-collapse`,"data-open":m,id:`mobile-sidebar-controls`,children:[(0,X.jsxs)(`div`,{className:`side-section`,children:[(0,X.jsx)(`h2`,{children:`Project`}),(0,X.jsx)(yb,{id:`asset-project-filter`,label:`Project`,value:i,values:v,onChange:c})]}),(0,X.jsxs)(`section`,{className:`side-section`,children:[(0,X.jsx)(`h2`,{children:`Filters`}),(0,X.jsx)(yb,{id:`asset-source-filter`,label:`Source`,value:d,values:Y,onChange:e=>l(e)}),(0,X.jsx)(yb,{id:`asset-status-filter`,label:`Status`,value:f,values:J,onChange:e=>u(e)}),(0,X.jsx)(yb,{id:`asset-channel-filter`,label:`Channel`,value:t,values:n,onChange:o}),(0,X.jsx)(yb,{id:`asset-placement-filter`,label:`Placement`,value:r,values:he,onChange:e=>s(e)})]})]})]})}function yb({id:e,label:t,value:n,values:r,onChange:i}){return(0,X.jsxs)(`label`,{htmlFor:e,children:[t,(0,X.jsx)(`select`,{"aria-label":t,id:e,value:n,onChange:e=>i(e.target.value),children:r.map(e=>(0,X.jsx)(`option`,{value:e,children:e},e))})]})}var bb=[{label:`Lineage`,view:`lineage`},{label:`Review`,view:`review`},{label:`Assets`,view:`assets`},{label:`Agents`,view:`agents`},{label:`Settings`,view:`settings`}],xb=[{label:`Ledger`,view:`ledger`},{label:`Content batches`,view:`content`},{label:`Backup queue`,view:`backup`}];function Sb(e){let t=xb.some(t=>t.view===e.view);function n(t){e.setView(t),e.onMoreOpenChange(!1)}function r(t){e.setView(t),e.onMoreOpenChange(!1)}return(0,X.jsxs)(`header`,{className:`topbar`,children:[(0,X.jsxs)(`div`,{className:`view-tabs`,role:`tablist`,"aria-label":`${gb} views`,children:[bb.map(t=>(0,X.jsx)(`button`,{"aria-pressed":e.view===t.view,className:e.view===t.view?`active`:``,onClick:()=>n(t.view),type:`button`,children:t.label},t.view)),(0,X.jsxs)(`div`,{className:`more-menu`,children:[(0,X.jsxs)(`button`,{"aria-expanded":e.moreOpen,"aria-haspopup":`menu`,"aria-pressed":t,className:t?`active`:``,onClick:()=>e.onMoreOpenChange(!e.moreOpen),type:`button`,children:[(0,X.jsx)(j,{size:16}),` More `,(0,X.jsx)(S,{className:e.moreOpen?`open`:``,size:15})]}),e.moreOpen&&(0,X.jsx)(`div`,{className:`more-menu-popover`,role:`menu`,children:xb.map(t=>(0,X.jsx)(`button`,{"aria-pressed":e.view===t.view,onClick:()=>r(t.view),role:`menuitem`,type:`button`,children:t.label},t.view))})]})]}),(0,X.jsx)(Cb,{runtime:e.runtime,unavailable:e.runtimeIdentityUnavailable}),(0,X.jsxs)(`div`,{className:`searchbox`,children:[(0,X.jsx)(ie,{size:17}),(0,X.jsx)(`input`,{onChange:t=>e.setQuery(t.target.value),placeholder:`Search assets, campaigns, hooks`,value:e.query})]}),e.view!==`lineage`&&(0,X.jsxs)(`button`,{"aria-expanded":e.assetDetailsOpen,className:`secondary-button`,disabled:!e.canInspectAsset,onClick:()=>{e.onMoreOpenChange(!1),e.setAssetDetailsOpen(!e.assetDetailsOpen)},type:`button`,children:[(0,X.jsx)(I,{size:17}),`Details`]}),(0,X.jsx)(`button`,{className:`icon-button`,disabled:e.loading,onClick:()=>void e.refresh(),title:`Refresh current page`,children:e.loading?(0,X.jsx)(W,{className:`spin`,size:18}):(0,X.jsx)(o,{size:18})}),(0,X.jsxs)(`button`,{className:`primary-button`,onClick:()=>e.setUploadOpen(!0),children:[(0,X.jsx)(ue,{size:17}),`Upload`]})]})}function Cb(e){if(e.unavailable)return(0,X.jsx)(`div`,{"aria-label":`Lineage runtime identity unavailable`,className:`runtime-identity-badge unavailable`,children:`IDENTITY UNAVAILABLE`});if(!e.runtime)return(0,X.jsx)(`div`,{"aria-label":`Loading Lineage runtime identity`,className:`runtime-identity-badge loading`,children:`IDENTITY LOADING`});let{profile:t}=e.runtime,n=t.bound?``:` · UNBOUND`,r=[`${t.environment.toUpperCase()} profile ${t.id}${t.bound?``:` (unbound)`}`,`Channel ${e.runtime.channel}`,`Version ${e.runtime.version}`,t.warning].filter(Boolean).join(` · `);return(0,X.jsxs)(`div`,{"aria-label":`Lineage ${t.environment} profile ${t.id}${t.bound?``:` unbound`}`,className:`runtime-identity-badge ${t.environment} ${t.bound?`bound`:`unbound`}`,"data-profile-id":t.id,title:r,children:[(0,X.jsx)(`strong`,{children:t.environment.toUpperCase()}),(0,X.jsxs)(`span`,{children:[t.id,n]})]})}function wb({toast:e,onDismiss:t}){return(0,X.jsxs)(`div`,{className:`toast ${e.type}`,role:`status`,children:[e.type===`ok`?(0,X.jsx)(w,{size:16}):(0,X.jsx)(oe,{size:16}),(0,X.jsx)(`span`,{children:e.message}),(0,X.jsx)(`button`,{onClick:t,children:`Dismiss`})]})}var Tb=200*1024*1024;function Eb({channels:e,project:t,onClose:n,onUploaded:r,onError:i}){let[a,o]=(0,p.useState)({assetId:``,audience:`short-form-creators`,campaign:`2026-06-organic-traffic-test`,channel:e[0]||`meta`,cta:``,hook:``,status:`working`,title:``,type:`image`,utmContent:``}),[s,c]=(0,p.useState)(null),[l,u]=(0,p.useState)(!1),[d,f]=(0,p.useState)(!1);function m(e,t){o(n=>({...n,[e]:t}))}function h(e){o(t=>({...t,assetId:t.assetId||pe(`demo-${t.channel}-${e}`),title:e,utmContent:t.utmContent||pe(e).replaceAll(`-`,`_`)}))}function _(e){if(!e){c(null);return}if(e.size>Tb){i(`File is larger than ${q(Tb)}`);return}c(e)}async function v(e){if(e.preventDefault(),!s)return i(`Choose a file before uploading`);f(!0);try{let e=new FormData;Object.entries({project:t,...a,confirmWrite:String(l)}).forEach(([t,n])=>e.append(t,n)),e.append(`file`,s),await r((await g(`/api/assets/upload`,{method:`POST`,body:e})).message)}catch(e){i(e instanceof Error?e.message:String(e))}finally{f(!1)}}return(0,X.jsx)(`div`,{className:`drawer-backdrop`,children:(0,X.jsxs)(`form`,{className:`upload-drawer`,onSubmit:v,children:[(0,X.jsxs)(`header`,{children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{children:`Upload asset`}),(0,X.jsx)(`p`,{children:t})]}),(0,X.jsx)(`button`,{type:`button`,onClick:n,children:`Close`})]}),(0,X.jsxs)(`label`,{className:`file-drop`,children:[(0,X.jsx)(ue,{size:20}),(0,X.jsx)(`span`,{children:s?s.name:`Choose creative export up to ${q(Tb)}`}),(0,X.jsx)(`input`,{type:`file`,onChange:e=>_(e.target.files?.[0])})]}),(0,X.jsxs)(`div`,{className:`form-grid`,children:[(0,X.jsxs)(`label`,{children:[`Title`,(0,X.jsx)(`input`,{value:a.title,onChange:e=>h(e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Asset ID`,(0,X.jsx)(`input`,{value:a.assetId,onChange:e=>m(`assetId`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Campaign`,(0,X.jsx)(`input`,{value:a.campaign,onChange:e=>m(`campaign`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Channel`,(0,X.jsx)(`select`,{value:a.channel,onChange:e=>m(`channel`,e.target.value),children:e.map(e=>(0,X.jsx)(`option`,{children:e},e))})]}),(0,X.jsxs)(`label`,{children:[`Audience`,(0,X.jsx)(`input`,{value:a.audience,onChange:e=>m(`audience`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Status`,(0,X.jsxs)(`select`,{value:a.status,onChange:e=>m(`status`,e.target.value),children:[(0,X.jsx)(`option`,{children:`working`}),(0,X.jsx)(`option`,{children:`published`})]})]}),(0,X.jsxs)(`label`,{children:[`Type`,(0,X.jsx)(`select`,{value:a.type,onChange:e=>m(`type`,e.target.value),children:ge.map(e=>(0,X.jsx)(`option`,{children:e},e))})]}),(0,X.jsxs)(`label`,{children:[`UTM content`,(0,X.jsx)(`input`,{value:a.utmContent,onChange:e=>m(`utmContent`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{className:`wide`,children:[`Hook`,(0,X.jsx)(`input`,{value:a.hook,onChange:e=>m(`hook`,e.target.value)})]}),(0,X.jsxs)(`label`,{className:`wide`,children:[`CTA`,(0,X.jsx)(`input`,{value:a.cta,onChange:e=>m(`cta`,e.target.value),required:!0})]})]}),(0,X.jsxs)(`label`,{className:`confirm-line`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked)}),(0,X.jsx)(`span`,{children:`Confirm write to the production asset bucket`})]}),(0,X.jsxs)(`footer`,{children:[(0,X.jsx)(`button`,{type:`button`,onClick:n,children:`Cancel`}),(0,X.jsxs)(`button`,{className:`primary-button`,disabled:d||!l,children:[d?(0,X.jsx)(W,{className:`spin`,size:16}):(0,X.jsx)(ue,{size:16}),`Upload`]})]})]})})}function Db(e,t){let n=`${e} ${t}`.toLowerCase();return n.includes(`agent`)||n.includes(`command`)||n.includes(`selection`)||n.includes(`next context`)}function Ob(){return typeof window>`u`?me:new URLSearchParams(window.location.search).get(`project`)||`demo-project`}function kb(){let[e,t]=(0,p.useState)(null),[n,r]=(0,p.useState)(null),[i,a]=(0,p.useState)(Ob),[o,s]=(0,p.useState)([]),[c,l]=(0,p.useState)(`all`),[u,d]=(0,p.useState)(`all`),[f,m]=(0,p.useState)(`local`),[h,y]=(0,p.useState)(`all`),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(1),[w,T]=(0,p.useState)(10),[E,D]=(0,p.useState)(!1),[O,k]=(0,p.useState)(!0),[A,j]=(0,p.useState)(null),[M,N]=(0,p.useState)(null),[P,F]=(0,p.useState)({}),[I,L]=(0,p.useState)({}),[R,z]=(0,p.useState)([]),[B,V]=(0,p.useState)([]),[ee,H]=(0,p.useState)(!1),[U,W]=(0,p.useState)(!1),[G,te]=(0,p.useState)(`lineage`),[ne,re]=(0,p.useState)(!1),[ie,ae]=(0,p.useState)(null),[oe,K]=(0,p.useState)(0),[se,ce]=(0,p.useState)(null),[le,ue]=(0,p.useState)(!1),[de,q]=(0,p.useState)(null),fe=(0,p.useCallback)(e=>{q(t=>e?`lineage-actions`:t===`lineage-actions`?null:t)},[]),pe=(0,p.useCallback)(e=>{q(t=>e?`topbar-more`:t===`topbar-more`?null:t)},[]),me=(0,p.useCallback)((e,t)=>{j({type:e,message:t})},[]),J=e?.catalog.project===i?e:null,he=J?.assets||[],Y=xe(he,n)||(ie?.project===i&&ie.asset_id===n?ie:void 0),ge=Y?.asset_id||``,_e=[...B.filter(e=>R.includes(e.asset_id)),...he.filter(e=>R.includes(e.asset_id)&&e.local?.relative_path)].filter((e,t,n)=>n.findIndex(t=>t.asset_id===e.asset_id)===t),ve=Y&&P[Y.asset_id]||null,ye=(0,p.useMemo)(()=>[`all`,...J?.facets.channels||[]],[J]),be=(0,p.useMemo)(()=>({assets:J?.catalog.asset_count||0,live:J?.liveObjects.length||0,orphan:J?.orphanObjects.length||0,size:J?.facets.totalSizeBytes||0}),[J]);async function Ce(){try{let e=await g(`/api/projects`);s(e.projects),a(t=>e.projects.some(e=>e.project===t)?t:e.projects[0]?.project||`demo-project`)}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}async function we(){try{let e=await g(`/api/runtime`);ce(e.runtime),ue(!1)}catch{ce(null),ue(!0)}}async function Te(){k(!0);try{let e=await g(`/api/assets?${Ee()}`);t(e),r(t=>xe(e.assets,t)?.asset_id||(t&&ie?.asset_id===t?t:null)),F({}),L({})}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}finally{k(!1)}}function Ee(){let e=new URLSearchParams({project:i,page:String(S),pageSize:String(w),live:String(E),source:f});return c!==`all`&&e.set(`status`,c),u!==`all`&&e.set(`placementStatus`,u),h!==`all`&&e.set(`channel`,h),b.trim()&&e.set(`q`,b.trim()),e.toString()}async function De(e){try{let t=await e();j({type:`ok`,message:t.message}),F({}),await Te()}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}async function Oe(e,t={}){if(!Se(e))return null;let n=P[e.asset_id];if(n)return t.open&&window.open(n,`_blank`,`noopener,noreferrer`),n;if(e.local?.relative_path){let n=`/api/assets/local-preview?${new URLSearchParams({project:i,path:e.local.relative_path}).toString()}`;return F(t=>({...t,[e.asset_id]:n})),L(t=>({...t,[e.asset_id]:``})),t.open&&window.open(n,`_blank`,`noopener,noreferrer`),n}try{let n=await g(`/api/assets/presign`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project:i,assetId:e.asset_id,expiresIn:900})});return F(t=>({...t,[e.asset_id]:n.url})),L(t=>({...t,[e.asset_id]:``})),t.open&&window.open(n.url,`_blank`,`noopener,noreferrer`),n.url}catch(n){let r=n instanceof Error?n.message:String(n);return L(t=>({...t,[e.asset_id]:r})),t.quiet||j({type:`error`,message:`Preview unavailable. Check S3 credentials or pull the asset locally.`}),null}}async function ke(e,t){try{let n=await Bm(e);j({type:`ok`,message:n.method===`fallback`?`Copied ${t} using browser fallback`:`Copied ${t}`}),N(Db(t,e)?{label:t,text:e}:null)}catch(n){N(Db(t,e)?{label:t,text:e}:null),j({type:`error`,message:n instanceof Error?n.message:String(n)})}}async function je(e){let t=await Oe(e,{quiet:!0});t&&await ke(t,`preview link`)}function Ne(e){e.local?.relative_path&&(z(t=>t.includes(e.asset_id)?t:[...t,e.asset_id]),V(t=>t.some(t=>t.asset_id===e.asset_id)?t:[...t,e]))}function Z(e){ae(e),r(e.asset_id),re(!0)}async function Pe(e){r(e),re(!0);let t=he.find(t=>t.asset_id===e);if(t){ae(t);return}try{let t=await g(`/api/assets/lookup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project:i,assetIds:[e]})});t.assets[0]&&ae(t.assets[0])}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}function Fe(){m(`local`),l(`all`),d(`all`),x(``),te(`backup`)}async function Ie(e){try{e.assetId&&r(e.assetId),e.view===`lineage`&&e.workspaceId&&await g(`/api/lineage-workspaces/${encodeURIComponent(e.workspaceId)}/activate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project:i,confirmWrite:!0})}),re(!1),te(e.view),j({type:`ok`,message:`Opened ${e.claim.target_title||e.claim.target_id}`})}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}function Le(e){e.local?.relative_path&&(z(t=>t.includes(e.asset_id)?t.filter(t=>t!==e.asset_id):[...t,e.asset_id]),V(t=>t.filter(t=>t.asset_id!==e.asset_id)))}return(0,p.useEffect)(()=>{Ce(),we()},[]),(0,p.useEffect)(()=>{let e=new URLSearchParams(window.location.search);e.get(`project`)!==i&&(e.set(`project`,i),window.history.replaceState(null,``,`${window.location.pathname}?${e.toString()}${window.location.hash}`))},[i]),(0,p.useEffect)(()=>{j(null),N(null),ae(null),re(!1)},[i]),(0,p.useEffect)(()=>{Te()},[S,w,i,c,u,f,h,b,E]),(0,p.useEffect)(()=>{C(1)},[i,c,u,f,h,b,w]),(0,p.useEffect)(()=>{!Se(Y)||P[Y.asset_id]||Oe(Y,{quiet:!0})},[Y?.asset_id,Y?.s3?.version_id,P]),(0,p.useEffect)(()=>{if(A?.type!==`ok`)return;let e=window.setTimeout(()=>j(null),2600);return()=>window.clearTimeout(e)},[A?.message,A?.type]),(0,p.useEffect)(()=>{G===`backup`&&(m(`local`),l(`all`),d(`all`))},[G]),(0,p.useEffect)(()=>{q(null)},[G]),(0,p.useEffect)(()=>{ge||re(!1)},[ge]),(0,X.jsx)(Me,{runtime:se,children:(0,X.jsxs)(`div`,{className:`app-shell ${G===`lineage`?`lineage-mode`:``}`,children:[(0,X.jsx)(vb,{channel:h,channels:ye,liveSync:E,placementStatus:u,project:i,projects:o,setChannel:y,setPlacementStatus:d,setProject:a,setSource:m,setStatus:l,setView:te,showBackupQueue:Fe,source:f,snapshot:J,status:c,totals:be}),(0,X.jsxs)(`main`,{className:`workspace`,children:[(0,X.jsx)(Sb,{assetDetailsOpen:ne,canInspectAsset:!!Y,loading:O,moreOpen:de===`topbar-more`,onMoreOpenChange:pe,query:b,refresh:Te,runtime:se,runtimeIdentityUnavailable:le,setAssetDetailsOpen:re,setQuery:x,setUploadOpen:W,setView:e=>e===`backup`?Fe():te(e),view:G}),A&&(0,X.jsx)(wb,{toast:A,onDismiss:()=>j(null)}),M&&(0,X.jsx)(Ct,{copiedText:M,onDismiss:()=>N(null)}),(0,X.jsx)(Ot,{onCopy:ke,project:i,refreshKey:oe,selectedAsset:Y,view:G}),G===`review`?(0,X.jsx)(Yy,{channel:h,onCopy:ke,onLocalReview:async(e,t)=>{await De(()=>_(`/api/local-review/${e.asset_id}`,i,{reviewState:t,confirmWrite:!0}))},onOpenBackup:e=>{Ne(e),H(!0)},onSelectAsset:e=>{Z(e)},project:i,selected:Y}):G===`ledger`?(0,X.jsx)(Vt,{project:i,query:b,onOpenAsset:Pe}):G===`content`?(0,X.jsx)(_t,{onCopy:ke,onOpenAsset:Pe,onToast:me,onWorkTargetsChanged:()=>K(e=>e+1),project:i,selectedAsset:Y}):G===`agents`?(0,X.jsx)(ze,{onCopy:ke,onOpenWork:Ie,project:i}):G===`backup`?(0,X.jsx)(zy,{assets:he,cli:se?.cli,onCopy:ke,onLocalReview:async(e,t)=>{await De(()=>_(`/api/local-review/${e.asset_id}`,i,{reviewState:t,confirmWrite:!0}))},onOpenBackup:()=>H(!0),onQueueBackup:Ne,onSelectAsset:e=>{Z(e)},page:S,pageSize:w,project:i,selected:Y,selectedBackupIds:R,setPage:C,setPageSize:T,snapshot:J}):G===`assets`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Gy,{assets:_e,onClear:()=>{z([]),V([])},onOpen:()=>H(!0)}),(0,X.jsx)(Re,{assets:he,liveSync:E,onCopy:ke,onSelectionChanged:()=>K(e=>e+1),page:S,pageSize:w,previewUrls:P,project:i,selected:Y,setLiveSync:D,setPage:C,setPageSize:T,setSelectedId:r,snapshot:J,source:f,totals:be})]}):G===`settings`?(0,X.jsx)(hb,{onToast:me,project:i}):(0,X.jsx)(jy,{asset:Y,actionsOpen:de===`lineage-actions`,onAssetsChanged:Te,onActionsOpenChange:fe,onSelectedAsset:r,onToast:me,project:i})]}),G!==`lineage`&&ne&&(0,X.jsx)(Ae,{asset:Y,onArchive:e=>void De(()=>_(`/api/assets/archive`,i,{assetId:e.asset_id,confirmArchive:!0})),onClose:()=>re(!1),onCopy:(e,t)=>void ke(e,t),onCopyPreview:e=>void je(e),onDelete:(e,t)=>void De(()=>_(`/api/assets/delete-object`,i,{assetId:e.asset_id,confirmation:t})),onPlacement:(e,t,n)=>void De(()=>_(`/api/assets/placement`,i,{assetId:e.asset_id,channel:e.channel,...v(n),status:t,confirmWrite:!0})),onPresign:e=>void Oe(e,{open:!0}),onPromote:e=>void De(()=>_(`/api/assets/promote`,i,{assetId:e.asset_id,confirmWrite:!0})),onPull:e=>void De(()=>_(`/api/assets/pull`,i,{assetId:e.asset_id,out:`.asset-scratch`})),onToggleBackup:Le,previewError:Y&&I[Y.asset_id]||null,previewUrl:ve,selectedForBackup:Y?R.includes(Y.asset_id):!1}),U&&(0,X.jsx)(Eb,{channels:ye.filter(e=>e!==`all`),project:i,onClose:()=>W(!1),onError:e=>j({type:`error`,message:e}),onUploaded:async e=>{j({type:`ok`,message:e}),W(!1),await Te()}}),ee&&(0,X.jsx)(Py,{assets:_e,project:i,onClose:()=>H(!1),onError:e=>j({type:`error`,message:e}),onDone:async e=>{j({type:`ok`,message:e}),z([]),V([]),H(!1),await Te()}})]})})}(0,m.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(p.StrictMode,{children:(0,X.jsx)(kb,{})}));
@@ -1,9 +1,9 @@
1
1
  {
2
- "build_fingerprint": "1de9a20d920379b657767e159916911a4e232357924c1ce80fff291f73de9c46",
2
+ "build_fingerprint": "7daf19a536b18ad472bb402e3242375a41dc5739b0ff6b2374e352097d242188",
3
3
  "package_name": "@mean-weasel/lineage",
4
- "package_version": "0.1.24",
4
+ "package_version": "0.1.26",
5
5
  "schema_version": "lineage.runtime_build.v1",
6
- "source_dirty": true,
7
- "source_fingerprint": "bc512d2d50f082c272f6dda86a69aae05b6175f31344163206be59752a52cc2d",
8
- "source_git_sha": "d6299071a5a3d71b0c0c3c9ee28b6955ef1a7c7c"
6
+ "source_dirty": false,
7
+ "source_fingerprint": "333b426a2bf1ab80d5268c9a3ea403e48694b1216a097d5d5eeb13e0d2520c04",
8
+ "source_git_sha": "eef358ba16f60619f6ba8104d3bed14ab8d58257"
9
9
  }
@@ -47,4 +47,4 @@ import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t
47
47
  "providerId": "codex-handoff",
48
48
  "providerLabel": "Codex handoff"
49
49
  }
50
- ]`);function ob(e,t){let n=ab.find(n=>n.adapterType===e&&n.providerId===t);if(!n)throw Error(`Missing public adapter catalog entry: ${e}/${t}`);return n}var sb={channel:`dev`,version:`0.1.24`},cb={cloud:D,image_generator:V,scheduler:ae},lb=Object.fromEntries(ab.map(e=>[e.adapterType,e.capabilityLabel])),ub=[{adapterType:`cloud`,ariaLabel:`Cloud storage settings`},{adapterType:`scheduler`,ariaLabel:`Social scheduling settings`},{adapterType:`image_generator`,ariaLabel:`Image generation settings`}];function db(e){return typeof e==`boolean`?e?`on`:`off`:typeof e==`number`?String(e):typeof e==`string`?e||`not set`:JSON.stringify(e)}function fb(e){return Object.entries(e.safe_config).filter(([e])=>![`secret`,`token`,`password`,`credential`,`apiKey`].includes(e))}function pb(e){return e.health_status===`configured`?`ok`:e.health_status===`missing_config`?`warn`:`muted`}function mb(e){return(0,X.jsx)(`button`,{"aria-checked":e.checked,"aria-label":e.label,className:`settings-switch ${e.checked?`on`:``}`,disabled:e.disabled,onClick:e.onClick,role:`switch`,type:`button`,children:(0,X.jsx)(`span`,{})})}function hb(e){let[t,n]=(0,p.useState)(null),[r,i]=(0,p.useState)(null),[a,s]=(0,p.useState)(!0),[c,l]=(0,p.useState)(``),[u,d]=(0,p.useState)(Cm);function f(){let t=!u;if(!wm(t)){e.onToast(`error`,`Browser storage is unavailable, so the hover preview preference could not be saved`);return}d(t),e.onToast(`ok`,`Lineage hover previews ${t?`enabled`:`disabled`}`)}async function m(){s(!0);try{let[t,r]=await Promise.all([g(`/api/adapters/settings?project=${encodeURIComponent(e.project)}`),g(`/api/runtime`)]);n(t),i(r.runtime)}catch(t){e.onToast(`error`,t instanceof Error?t.message:String(t))}finally{s(!1)}}async function h(t){let r=`${t.adapter_type}:${t.provider}`;l(r);try{let r=await g(`/api/adapters/settings/${t.adapter_type}/${t.provider}`,{body:JSON.stringify({confirmWrite:!0,enabled:!t.enabled,project:e.project,safeConfig:t.safe_config}),headers:{"Content-Type":`application/json`},method:`POST`});n(e=>e&&{...e,settings:e.settings.map(e=>e.adapter_type===r.setting.adapter_type&&e.provider===r.setting.provider?r.setting:e)}),e.onToast(`ok`,`${lb[t.adapter_type]} ${r.setting.enabled?`enabled`:`disabled`}`)}catch(t){e.onToast(`error`,t instanceof Error?t.message:String(t))}finally{l(``)}}return(0,p.useEffect)(()=>{m()},[e.project]),(0,X.jsxs)(`section`,{className:`settings-view`,children:[(0,X.jsxs)(`header`,{className:`settings-header`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{children:`Settings`}),(0,X.jsxs)(`p`,{children:[`Adapter switches, safe local preferences, and credential-source status for `,e.project,`.`]})]}),(0,X.jsxs)(`button`,{className:`secondary-button`,disabled:a,onClick:()=>void m(),type:`button`,children:[a?(0,X.jsx)(W,{className:`spin`,size:17}):(0,X.jsx)(o,{size:17}),`Refresh`]})]}),(0,X.jsxs)(`div`,{className:`settings-sections`,children:[(0,X.jsxs)(`section`,{"aria-label":`Release information`,className:`settings-section`,children:[(0,X.jsx)(`h3`,{children:`Release`}),(0,X.jsxs)(`dl`,{className:`settings-release`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Version`}),(0,X.jsx)(`dd`,{children:r?.version||sb.version})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Channel`}),(0,X.jsx)(`dd`,{children:r?.channel||sb.channel})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Profile`}),(0,X.jsx)(`dd`,{children:r?.profile.id||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Environment`}),(0,X.jsx)(`dd`,{children:r?.profile.environment||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Binding`}),(0,X.jsx)(`dd`,{children:r?r.profile.bound?`bound`:`legacy unbound`:`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Git`}),(0,X.jsx)(`dd`,{children:r?.git_sha||`not available`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Assets`}),(0,X.jsx)(`dd`,{className:`settings-path`,children:r?.asset_root||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`SQLite`}),(0,X.jsx)(`dd`,{className:`settings-path`,children:r?.database.path||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Database`}),(0,X.jsx)(`dd`,{children:r?.database.exists?`${r.database.projects??0} projects / ${r.database.workspaces??0} workspaces`:`not created yet`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Schema`}),(0,X.jsx)(`dd`,{children:r?`${r.schema.migration_keys.length} migration marker(s)`:`loading`})]})]})]}),(0,X.jsxs)(`section`,{"aria-label":`Lineage experience settings`,className:`settings-section`,children:[(0,X.jsx)(`h3`,{children:`Lineage experience`}),(0,X.jsx)(`div`,{className:`settings-grid`,children:(0,X.jsx)(`article`,{className:`settings-card`,children:(0,X.jsxs)(`div`,{className:`settings-card-head`,children:[(0,X.jsx)(`span`,{className:`settings-icon`,children:(0,X.jsx)(N,{size:19})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h4`,{children:`Hover previews`}),(0,X.jsx)(`p`,{children:`Show the full asset and quick Branch/Re-roll/Details actions when hovering over or focusing a lineage node. Double-click details remain available when this is off.`})]}),(0,X.jsx)(mb,{checked:u,label:`Enable lineage hover previews`,onClick:f})]})})})]}),ub.map(e=>(0,X.jsxs)(`section`,{"aria-label":e.ariaLabel,className:`settings-section`,children:[(0,X.jsx)(`h3`,{children:lb[e.adapterType]}),(0,X.jsx)(`div`,{className:`settings-grid`,children:(t?.settings||[]).filter(t=>t.adapter_type===e.adapterType).map(e=>{let t=cb[e.adapter_type],n=ob(e.adapter_type,e.provider),r=`Enable ${e.label===`Buffer`?`Buffer scheduling`:e.label}`,i=c===`${e.adapter_type}:${e.provider}`;return(0,X.jsxs)(`article`,{className:`settings-card`,children:[(0,X.jsxs)(`div`,{className:`settings-card-head`,children:[(0,X.jsx)(`span`,{className:`settings-icon`,children:(0,X.jsx)(t,{size:19})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h4`,{children:e.label}),(0,X.jsx)(`p`,{children:e.description})]}),(0,X.jsx)(mb,{checked:e.enabled,disabled:i,label:r,onClick:()=>void h(e)})]}),(0,X.jsxs)(`dl`,{className:`settings-meta`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Status`}),(0,X.jsxs)(`dd`,{className:pb(e),children:[e.health_status===`configured`?(0,X.jsx)(w,{size:14}):(0,X.jsx)(C,{size:14}),e.health_status.replace(/_/g,` `)]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Maturity`}),(0,X.jsx)(`dd`,{children:n.maturity})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Credential source`}),(0,X.jsx)(`dd`,{children:e.credential.label})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Secret ref`}),(0,X.jsx)(`dd`,{children:e.credential.secret_ref||`none`})]})]}),fb(e).length>0&&(0,X.jsx)(`div`,{className:`settings-config`,children:fb(e).map(([e,t])=>(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`strong`,{children:e}),db(t)]},e))})]},`${e.adapter_type}:${e.provider}`)})})]},e.adapterType)),a&&!t&&(0,X.jsx)(`div`,{className:`settings-loading`,children:`Loading settings...`})]})]})}var gb=`Lineage`,_b=`Local-first creative lineage workspace`;function vb(e){let{channel:t,channels:n,placementStatus:r,project:i,projects:a,setChannel:o,setPlacementStatus:s,setProject:c,setSource:l,setStatus:u,source:d,status:f}=e,[m,h]=(0,p.useState)(!1),[g,_]=(0,p.useState)(!0),v=a.length?a.map(e=>e.project):[i];return(0,X.jsxs)(`aside`,{className:`sidebar ${g?``:`collapsed`}`,children:[(0,X.jsx)(`button`,{"aria-label":g?`Collapse sidebar`:`Expand sidebar`,className:`sidebar-collapse-toggle`,onClick:()=>_(e=>!e),type:`button`,children:g?(0,X.jsx)(te,{size:16}):(0,X.jsx)(ne,{size:16})}),(0,X.jsxs)(`div`,{className:`brand`,children:[(0,X.jsx)(`div`,{className:`brand-mark`,"aria-label":_b,children:`L`}),(0,X.jsxs)(`div`,{className:`brand-copy`,children:[(0,X.jsx)(`h1`,{children:gb}),(0,X.jsxs)(`p`,{children:[(0,X.jsx)(`span`,{children:i}),(0,X.jsxs)(`span`,{"aria-label":`Lineage version ${sb.version}`,className:`brand-version`,title:`Lineage version ${sb.version}, ${sb.channel} channel`,children:[`v`,sb.version]})]})]})]}),(0,X.jsxs)(`button`,{"aria-controls":`mobile-sidebar-controls`,"aria-expanded":m,className:`mobile-filter-toggle`,onClick:()=>h(e=>!e),type:`button`,children:[(0,X.jsx)(K,{size:16}),`Filters`,(0,X.jsx)(S,{className:m?`open`:``,size:16})]}),(0,X.jsxs)(`div`,{className:`sidebar-mobile-collapse`,"data-open":m,id:`mobile-sidebar-controls`,children:[(0,X.jsxs)(`div`,{className:`side-section`,children:[(0,X.jsx)(`h2`,{children:`Project`}),(0,X.jsx)(yb,{id:`asset-project-filter`,label:`Project`,value:i,values:v,onChange:c})]}),(0,X.jsxs)(`section`,{className:`side-section`,children:[(0,X.jsx)(`h2`,{children:`Filters`}),(0,X.jsx)(yb,{id:`asset-source-filter`,label:`Source`,value:d,values:Y,onChange:e=>l(e)}),(0,X.jsx)(yb,{id:`asset-status-filter`,label:`Status`,value:f,values:J,onChange:e=>u(e)}),(0,X.jsx)(yb,{id:`asset-channel-filter`,label:`Channel`,value:t,values:n,onChange:o}),(0,X.jsx)(yb,{id:`asset-placement-filter`,label:`Placement`,value:r,values:he,onChange:e=>s(e)})]})]})]})}function yb({id:e,label:t,value:n,values:r,onChange:i}){return(0,X.jsxs)(`label`,{htmlFor:e,children:[t,(0,X.jsx)(`select`,{"aria-label":t,id:e,value:n,onChange:e=>i(e.target.value),children:r.map(e=>(0,X.jsx)(`option`,{value:e,children:e},e))})]})}var bb=[{label:`Lineage`,view:`lineage`},{label:`Review`,view:`review`},{label:`Assets`,view:`assets`},{label:`Agents`,view:`agents`},{label:`Settings`,view:`settings`}],xb=[{label:`Ledger`,view:`ledger`},{label:`Content batches`,view:`content`},{label:`Backup queue`,view:`backup`}];function Sb(e){let t=xb.some(t=>t.view===e.view);function n(t){e.setView(t),e.onMoreOpenChange(!1)}function r(t){e.setView(t),e.onMoreOpenChange(!1)}return(0,X.jsxs)(`header`,{className:`topbar`,children:[(0,X.jsxs)(`div`,{className:`view-tabs`,role:`tablist`,"aria-label":`${gb} views`,children:[bb.map(t=>(0,X.jsx)(`button`,{"aria-pressed":e.view===t.view,className:e.view===t.view?`active`:``,onClick:()=>n(t.view),type:`button`,children:t.label},t.view)),(0,X.jsxs)(`div`,{className:`more-menu`,children:[(0,X.jsxs)(`button`,{"aria-expanded":e.moreOpen,"aria-haspopup":`menu`,"aria-pressed":t,className:t?`active`:``,onClick:()=>e.onMoreOpenChange(!e.moreOpen),type:`button`,children:[(0,X.jsx)(j,{size:16}),` More `,(0,X.jsx)(S,{className:e.moreOpen?`open`:``,size:15})]}),e.moreOpen&&(0,X.jsx)(`div`,{className:`more-menu-popover`,role:`menu`,children:xb.map(t=>(0,X.jsx)(`button`,{"aria-pressed":e.view===t.view,onClick:()=>r(t.view),role:`menuitem`,type:`button`,children:t.label},t.view))})]})]}),(0,X.jsx)(Cb,{runtime:e.runtime,unavailable:e.runtimeIdentityUnavailable}),(0,X.jsxs)(`div`,{className:`searchbox`,children:[(0,X.jsx)(ie,{size:17}),(0,X.jsx)(`input`,{onChange:t=>e.setQuery(t.target.value),placeholder:`Search assets, campaigns, hooks`,value:e.query})]}),e.view!==`lineage`&&(0,X.jsxs)(`button`,{"aria-expanded":e.assetDetailsOpen,className:`secondary-button`,disabled:!e.canInspectAsset,onClick:()=>{e.onMoreOpenChange(!1),e.setAssetDetailsOpen(!e.assetDetailsOpen)},type:`button`,children:[(0,X.jsx)(I,{size:17}),`Details`]}),(0,X.jsx)(`button`,{className:`icon-button`,disabled:e.loading,onClick:()=>void e.refresh(),title:`Refresh current page`,children:e.loading?(0,X.jsx)(W,{className:`spin`,size:18}):(0,X.jsx)(o,{size:18})}),(0,X.jsxs)(`button`,{className:`primary-button`,onClick:()=>e.setUploadOpen(!0),children:[(0,X.jsx)(ue,{size:17}),`Upload`]})]})}function Cb(e){if(e.unavailable)return(0,X.jsx)(`div`,{"aria-label":`Lineage runtime identity unavailable`,className:`runtime-identity-badge unavailable`,children:`IDENTITY UNAVAILABLE`});if(!e.runtime)return(0,X.jsx)(`div`,{"aria-label":`Loading Lineage runtime identity`,className:`runtime-identity-badge loading`,children:`IDENTITY LOADING`});let{profile:t}=e.runtime,n=t.bound?``:` · UNBOUND`,r=[`${t.environment.toUpperCase()} profile ${t.id}${t.bound?``:` (unbound)`}`,`Channel ${e.runtime.channel}`,`Version ${e.runtime.version}`,t.warning].filter(Boolean).join(` · `);return(0,X.jsxs)(`div`,{"aria-label":`Lineage ${t.environment} profile ${t.id}${t.bound?``:` unbound`}`,className:`runtime-identity-badge ${t.environment} ${t.bound?`bound`:`unbound`}`,"data-profile-id":t.id,title:r,children:[(0,X.jsx)(`strong`,{children:t.environment.toUpperCase()}),(0,X.jsxs)(`span`,{children:[t.id,n]})]})}function wb({toast:e,onDismiss:t}){return(0,X.jsxs)(`div`,{className:`toast ${e.type}`,role:`status`,children:[e.type===`ok`?(0,X.jsx)(w,{size:16}):(0,X.jsx)(oe,{size:16}),(0,X.jsx)(`span`,{children:e.message}),(0,X.jsx)(`button`,{onClick:t,children:`Dismiss`})]})}var Tb=200*1024*1024;function Eb({channels:e,project:t,onClose:n,onUploaded:r,onError:i}){let[a,o]=(0,p.useState)({assetId:``,audience:`short-form-creators`,campaign:`2026-06-organic-traffic-test`,channel:e[0]||`meta`,cta:``,hook:``,status:`working`,title:``,type:`image`,utmContent:``}),[s,c]=(0,p.useState)(null),[l,u]=(0,p.useState)(!1),[d,f]=(0,p.useState)(!1);function m(e,t){o(n=>({...n,[e]:t}))}function h(e){o(t=>({...t,assetId:t.assetId||pe(`demo-${t.channel}-${e}`),title:e,utmContent:t.utmContent||pe(e).replaceAll(`-`,`_`)}))}function _(e){if(!e){c(null);return}if(e.size>Tb){i(`File is larger than ${q(Tb)}`);return}c(e)}async function v(e){if(e.preventDefault(),!s)return i(`Choose a file before uploading`);f(!0);try{let e=new FormData;Object.entries({project:t,...a,confirmWrite:String(l)}).forEach(([t,n])=>e.append(t,n)),e.append(`file`,s),await r((await g(`/api/assets/upload`,{method:`POST`,body:e})).message)}catch(e){i(e instanceof Error?e.message:String(e))}finally{f(!1)}}return(0,X.jsx)(`div`,{className:`drawer-backdrop`,children:(0,X.jsxs)(`form`,{className:`upload-drawer`,onSubmit:v,children:[(0,X.jsxs)(`header`,{children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{children:`Upload asset`}),(0,X.jsx)(`p`,{children:t})]}),(0,X.jsx)(`button`,{type:`button`,onClick:n,children:`Close`})]}),(0,X.jsxs)(`label`,{className:`file-drop`,children:[(0,X.jsx)(ue,{size:20}),(0,X.jsx)(`span`,{children:s?s.name:`Choose creative export up to ${q(Tb)}`}),(0,X.jsx)(`input`,{type:`file`,onChange:e=>_(e.target.files?.[0])})]}),(0,X.jsxs)(`div`,{className:`form-grid`,children:[(0,X.jsxs)(`label`,{children:[`Title`,(0,X.jsx)(`input`,{value:a.title,onChange:e=>h(e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Asset ID`,(0,X.jsx)(`input`,{value:a.assetId,onChange:e=>m(`assetId`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Campaign`,(0,X.jsx)(`input`,{value:a.campaign,onChange:e=>m(`campaign`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Channel`,(0,X.jsx)(`select`,{value:a.channel,onChange:e=>m(`channel`,e.target.value),children:e.map(e=>(0,X.jsx)(`option`,{children:e},e))})]}),(0,X.jsxs)(`label`,{children:[`Audience`,(0,X.jsx)(`input`,{value:a.audience,onChange:e=>m(`audience`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Status`,(0,X.jsxs)(`select`,{value:a.status,onChange:e=>m(`status`,e.target.value),children:[(0,X.jsx)(`option`,{children:`working`}),(0,X.jsx)(`option`,{children:`published`})]})]}),(0,X.jsxs)(`label`,{children:[`Type`,(0,X.jsx)(`select`,{value:a.type,onChange:e=>m(`type`,e.target.value),children:ge.map(e=>(0,X.jsx)(`option`,{children:e},e))})]}),(0,X.jsxs)(`label`,{children:[`UTM content`,(0,X.jsx)(`input`,{value:a.utmContent,onChange:e=>m(`utmContent`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{className:`wide`,children:[`Hook`,(0,X.jsx)(`input`,{value:a.hook,onChange:e=>m(`hook`,e.target.value)})]}),(0,X.jsxs)(`label`,{className:`wide`,children:[`CTA`,(0,X.jsx)(`input`,{value:a.cta,onChange:e=>m(`cta`,e.target.value),required:!0})]})]}),(0,X.jsxs)(`label`,{className:`confirm-line`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked)}),(0,X.jsx)(`span`,{children:`Confirm write to the production asset bucket`})]}),(0,X.jsxs)(`footer`,{children:[(0,X.jsx)(`button`,{type:`button`,onClick:n,children:`Cancel`}),(0,X.jsxs)(`button`,{className:`primary-button`,disabled:d||!l,children:[d?(0,X.jsx)(W,{className:`spin`,size:16}):(0,X.jsx)(ue,{size:16}),`Upload`]})]})]})})}function Db(e,t){let n=`${e} ${t}`.toLowerCase();return n.includes(`agent`)||n.includes(`command`)||n.includes(`selection`)||n.includes(`next context`)}function Ob(){return typeof window>`u`?me:new URLSearchParams(window.location.search).get(`project`)||`demo-project`}function kb(){let[e,t]=(0,p.useState)(null),[n,r]=(0,p.useState)(null),[i,a]=(0,p.useState)(Ob),[o,s]=(0,p.useState)([]),[c,l]=(0,p.useState)(`all`),[u,d]=(0,p.useState)(`all`),[f,m]=(0,p.useState)(`local`),[h,y]=(0,p.useState)(`all`),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(1),[w,T]=(0,p.useState)(10),[E,D]=(0,p.useState)(!1),[O,k]=(0,p.useState)(!0),[A,j]=(0,p.useState)(null),[M,N]=(0,p.useState)(null),[P,F]=(0,p.useState)({}),[I,L]=(0,p.useState)({}),[R,z]=(0,p.useState)([]),[B,V]=(0,p.useState)([]),[ee,H]=(0,p.useState)(!1),[U,W]=(0,p.useState)(!1),[G,te]=(0,p.useState)(`lineage`),[ne,re]=(0,p.useState)(!1),[ie,ae]=(0,p.useState)(null),[oe,K]=(0,p.useState)(0),[se,ce]=(0,p.useState)(null),[le,ue]=(0,p.useState)(!1),[de,q]=(0,p.useState)(null),fe=(0,p.useCallback)(e=>{q(t=>e?`lineage-actions`:t===`lineage-actions`?null:t)},[]),pe=(0,p.useCallback)(e=>{q(t=>e?`topbar-more`:t===`topbar-more`?null:t)},[]),me=(0,p.useCallback)((e,t)=>{j({type:e,message:t})},[]),J=e?.catalog.project===i?e:null,he=J?.assets||[],Y=xe(he,n)||(ie?.project===i&&ie.asset_id===n?ie:void 0),ge=Y?.asset_id||``,_e=[...B.filter(e=>R.includes(e.asset_id)),...he.filter(e=>R.includes(e.asset_id)&&e.local?.relative_path)].filter((e,t,n)=>n.findIndex(t=>t.asset_id===e.asset_id)===t),ve=Y&&P[Y.asset_id]||null,ye=(0,p.useMemo)(()=>[`all`,...J?.facets.channels||[]],[J]),be=(0,p.useMemo)(()=>({assets:J?.catalog.asset_count||0,live:J?.liveObjects.length||0,orphan:J?.orphanObjects.length||0,size:J?.facets.totalSizeBytes||0}),[J]);async function Ce(){try{let e=await g(`/api/projects`);s(e.projects),a(t=>e.projects.some(e=>e.project===t)?t:e.projects[0]?.project||`demo-project`)}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}async function we(){try{let e=await g(`/api/runtime`);ce(e.runtime),ue(!1)}catch{ce(null),ue(!0)}}async function Te(){k(!0);try{let e=await g(`/api/assets?${Ee()}`);t(e),r(t=>xe(e.assets,t)?.asset_id||(t&&ie?.asset_id===t?t:null)),F({}),L({})}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}finally{k(!1)}}function Ee(){let e=new URLSearchParams({project:i,page:String(S),pageSize:String(w),live:String(E),source:f});return c!==`all`&&e.set(`status`,c),u!==`all`&&e.set(`placementStatus`,u),h!==`all`&&e.set(`channel`,h),b.trim()&&e.set(`q`,b.trim()),e.toString()}async function De(e){try{let t=await e();j({type:`ok`,message:t.message}),F({}),await Te()}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}async function Oe(e,t={}){if(!Se(e))return null;let n=P[e.asset_id];if(n)return t.open&&window.open(n,`_blank`,`noopener,noreferrer`),n;if(e.local?.relative_path){let n=`/api/assets/local-preview?${new URLSearchParams({project:i,path:e.local.relative_path}).toString()}`;return F(t=>({...t,[e.asset_id]:n})),L(t=>({...t,[e.asset_id]:``})),t.open&&window.open(n,`_blank`,`noopener,noreferrer`),n}try{let n=await g(`/api/assets/presign`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project:i,assetId:e.asset_id,expiresIn:900})});return F(t=>({...t,[e.asset_id]:n.url})),L(t=>({...t,[e.asset_id]:``})),t.open&&window.open(n.url,`_blank`,`noopener,noreferrer`),n.url}catch(n){let r=n instanceof Error?n.message:String(n);return L(t=>({...t,[e.asset_id]:r})),t.quiet||j({type:`error`,message:`Preview unavailable. Check S3 credentials or pull the asset locally.`}),null}}async function ke(e,t){try{let n=await Bm(e);j({type:`ok`,message:n.method===`fallback`?`Copied ${t} using browser fallback`:`Copied ${t}`}),N(Db(t,e)?{label:t,text:e}:null)}catch(n){N(Db(t,e)?{label:t,text:e}:null),j({type:`error`,message:n instanceof Error?n.message:String(n)})}}async function je(e){let t=await Oe(e,{quiet:!0});t&&await ke(t,`preview link`)}function Ne(e){e.local?.relative_path&&(z(t=>t.includes(e.asset_id)?t:[...t,e.asset_id]),V(t=>t.some(t=>t.asset_id===e.asset_id)?t:[...t,e]))}function Z(e){ae(e),r(e.asset_id),re(!0)}async function Pe(e){r(e),re(!0);let t=he.find(t=>t.asset_id===e);if(t){ae(t);return}try{let t=await g(`/api/assets/lookup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project:i,assetIds:[e]})});t.assets[0]&&ae(t.assets[0])}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}function Fe(){m(`local`),l(`all`),d(`all`),x(``),te(`backup`)}async function Ie(e){try{e.assetId&&r(e.assetId),e.view===`lineage`&&e.workspaceId&&await g(`/api/lineage-workspaces/${encodeURIComponent(e.workspaceId)}/activate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project:i,confirmWrite:!0})}),re(!1),te(e.view),j({type:`ok`,message:`Opened ${e.claim.target_title||e.claim.target_id}`})}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}function Le(e){e.local?.relative_path&&(z(t=>t.includes(e.asset_id)?t.filter(t=>t!==e.asset_id):[...t,e.asset_id]),V(t=>t.filter(t=>t.asset_id!==e.asset_id)))}return(0,p.useEffect)(()=>{Ce(),we()},[]),(0,p.useEffect)(()=>{let e=new URLSearchParams(window.location.search);e.get(`project`)!==i&&(e.set(`project`,i),window.history.replaceState(null,``,`${window.location.pathname}?${e.toString()}${window.location.hash}`))},[i]),(0,p.useEffect)(()=>{j(null),N(null),ae(null),re(!1)},[i]),(0,p.useEffect)(()=>{Te()},[S,w,i,c,u,f,h,b,E]),(0,p.useEffect)(()=>{C(1)},[i,c,u,f,h,b,w]),(0,p.useEffect)(()=>{!Se(Y)||P[Y.asset_id]||Oe(Y,{quiet:!0})},[Y?.asset_id,Y?.s3?.version_id,P]),(0,p.useEffect)(()=>{if(A?.type!==`ok`)return;let e=window.setTimeout(()=>j(null),2600);return()=>window.clearTimeout(e)},[A?.message,A?.type]),(0,p.useEffect)(()=>{G===`backup`&&(m(`local`),l(`all`),d(`all`))},[G]),(0,p.useEffect)(()=>{q(null)},[G]),(0,p.useEffect)(()=>{ge||re(!1)},[ge]),(0,X.jsx)(Me,{runtime:se,children:(0,X.jsxs)(`div`,{className:`app-shell ${G===`lineage`?`lineage-mode`:``}`,children:[(0,X.jsx)(vb,{channel:h,channels:ye,liveSync:E,placementStatus:u,project:i,projects:o,setChannel:y,setPlacementStatus:d,setProject:a,setSource:m,setStatus:l,setView:te,showBackupQueue:Fe,source:f,snapshot:J,status:c,totals:be}),(0,X.jsxs)(`main`,{className:`workspace`,children:[(0,X.jsx)(Sb,{assetDetailsOpen:ne,canInspectAsset:!!Y,loading:O,moreOpen:de===`topbar-more`,onMoreOpenChange:pe,query:b,refresh:Te,runtime:se,runtimeIdentityUnavailable:le,setAssetDetailsOpen:re,setQuery:x,setUploadOpen:W,setView:e=>e===`backup`?Fe():te(e),view:G}),A&&(0,X.jsx)(wb,{toast:A,onDismiss:()=>j(null)}),M&&(0,X.jsx)(Ct,{copiedText:M,onDismiss:()=>N(null)}),(0,X.jsx)(Ot,{onCopy:ke,project:i,refreshKey:oe,selectedAsset:Y,view:G}),G===`review`?(0,X.jsx)(Yy,{channel:h,onCopy:ke,onLocalReview:async(e,t)=>{await De(()=>_(`/api/local-review/${e.asset_id}`,i,{reviewState:t,confirmWrite:!0}))},onOpenBackup:e=>{Ne(e),H(!0)},onSelectAsset:e=>{Z(e)},project:i,selected:Y}):G===`ledger`?(0,X.jsx)(Vt,{project:i,query:b,onOpenAsset:Pe}):G===`content`?(0,X.jsx)(_t,{onCopy:ke,onOpenAsset:Pe,onToast:me,onWorkTargetsChanged:()=>K(e=>e+1),project:i,selectedAsset:Y}):G===`agents`?(0,X.jsx)(ze,{onCopy:ke,onOpenWork:Ie,project:i}):G===`backup`?(0,X.jsx)(zy,{assets:he,cli:se?.cli,onCopy:ke,onLocalReview:async(e,t)=>{await De(()=>_(`/api/local-review/${e.asset_id}`,i,{reviewState:t,confirmWrite:!0}))},onOpenBackup:()=>H(!0),onQueueBackup:Ne,onSelectAsset:e=>{Z(e)},page:S,pageSize:w,project:i,selected:Y,selectedBackupIds:R,setPage:C,setPageSize:T,snapshot:J}):G===`assets`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Gy,{assets:_e,onClear:()=>{z([]),V([])},onOpen:()=>H(!0)}),(0,X.jsx)(Re,{assets:he,liveSync:E,onCopy:ke,onSelectionChanged:()=>K(e=>e+1),page:S,pageSize:w,previewUrls:P,project:i,selected:Y,setLiveSync:D,setPage:C,setPageSize:T,setSelectedId:r,snapshot:J,source:f,totals:be})]}):G===`settings`?(0,X.jsx)(hb,{onToast:me,project:i}):(0,X.jsx)(jy,{asset:Y,actionsOpen:de===`lineage-actions`,onAssetsChanged:Te,onActionsOpenChange:fe,onSelectedAsset:r,onToast:me,project:i})]}),G!==`lineage`&&ne&&(0,X.jsx)(Ae,{asset:Y,onArchive:e=>void De(()=>_(`/api/assets/archive`,i,{assetId:e.asset_id,confirmArchive:!0})),onClose:()=>re(!1),onCopy:(e,t)=>void ke(e,t),onCopyPreview:e=>void je(e),onDelete:(e,t)=>void De(()=>_(`/api/assets/delete-object`,i,{assetId:e.asset_id,confirmation:t})),onPlacement:(e,t,n)=>void De(()=>_(`/api/assets/placement`,i,{assetId:e.asset_id,channel:e.channel,...v(n),status:t,confirmWrite:!0})),onPresign:e=>void Oe(e,{open:!0}),onPromote:e=>void De(()=>_(`/api/assets/promote`,i,{assetId:e.asset_id,confirmWrite:!0})),onPull:e=>void De(()=>_(`/api/assets/pull`,i,{assetId:e.asset_id,out:`.asset-scratch`})),onToggleBackup:Le,previewError:Y&&I[Y.asset_id]||null,previewUrl:ve,selectedForBackup:Y?R.includes(Y.asset_id):!1}),U&&(0,X.jsx)(Eb,{channels:ye.filter(e=>e!==`all`),project:i,onClose:()=>W(!1),onError:e=>j({type:`error`,message:e}),onUploaded:async e=>{j({type:`ok`,message:e}),W(!1),await Te()}}),ee&&(0,X.jsx)(Py,{assets:_e,project:i,onClose:()=>H(!1),onError:e=>j({type:`error`,message:e}),onDone:async e=>{j({type:`ok`,message:e}),z([]),V([]),H(!1),await Te()}})]})})}(0,m.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(p.StrictMode,{children:(0,X.jsx)(kb,{})}));
50
+ ]`);function ob(e,t){let n=ab.find(n=>n.adapterType===e&&n.providerId===t);if(!n)throw Error(`Missing public adapter catalog entry: ${e}/${t}`);return n}var sb={channel:`dev`,version:`0.1.26`},cb={cloud:D,image_generator:V,scheduler:ae},lb=Object.fromEntries(ab.map(e=>[e.adapterType,e.capabilityLabel])),ub=[{adapterType:`cloud`,ariaLabel:`Cloud storage settings`},{adapterType:`scheduler`,ariaLabel:`Social scheduling settings`},{adapterType:`image_generator`,ariaLabel:`Image generation settings`}];function db(e){return typeof e==`boolean`?e?`on`:`off`:typeof e==`number`?String(e):typeof e==`string`?e||`not set`:JSON.stringify(e)}function fb(e){return Object.entries(e.safe_config).filter(([e])=>![`secret`,`token`,`password`,`credential`,`apiKey`].includes(e))}function pb(e){return e.health_status===`configured`?`ok`:e.health_status===`missing_config`?`warn`:`muted`}function mb(e){return(0,X.jsx)(`button`,{"aria-checked":e.checked,"aria-label":e.label,className:`settings-switch ${e.checked?`on`:``}`,disabled:e.disabled,onClick:e.onClick,role:`switch`,type:`button`,children:(0,X.jsx)(`span`,{})})}function hb(e){let[t,n]=(0,p.useState)(null),[r,i]=(0,p.useState)(null),[a,s]=(0,p.useState)(!0),[c,l]=(0,p.useState)(``),[u,d]=(0,p.useState)(Cm);function f(){let t=!u;if(!wm(t)){e.onToast(`error`,`Browser storage is unavailable, so the hover preview preference could not be saved`);return}d(t),e.onToast(`ok`,`Lineage hover previews ${t?`enabled`:`disabled`}`)}async function m(){s(!0);try{let[t,r]=await Promise.all([g(`/api/adapters/settings?project=${encodeURIComponent(e.project)}`),g(`/api/runtime`)]);n(t),i(r.runtime)}catch(t){e.onToast(`error`,t instanceof Error?t.message:String(t))}finally{s(!1)}}async function h(t){let r=`${t.adapter_type}:${t.provider}`;l(r);try{let r=await g(`/api/adapters/settings/${t.adapter_type}/${t.provider}`,{body:JSON.stringify({confirmWrite:!0,enabled:!t.enabled,project:e.project,safeConfig:t.safe_config}),headers:{"Content-Type":`application/json`},method:`POST`});n(e=>e&&{...e,settings:e.settings.map(e=>e.adapter_type===r.setting.adapter_type&&e.provider===r.setting.provider?r.setting:e)}),e.onToast(`ok`,`${lb[t.adapter_type]} ${r.setting.enabled?`enabled`:`disabled`}`)}catch(t){e.onToast(`error`,t instanceof Error?t.message:String(t))}finally{l(``)}}return(0,p.useEffect)(()=>{m()},[e.project]),(0,X.jsxs)(`section`,{className:`settings-view`,children:[(0,X.jsxs)(`header`,{className:`settings-header`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{children:`Settings`}),(0,X.jsxs)(`p`,{children:[`Adapter switches, safe local preferences, and credential-source status for `,e.project,`.`]})]}),(0,X.jsxs)(`button`,{className:`secondary-button`,disabled:a,onClick:()=>void m(),type:`button`,children:[a?(0,X.jsx)(W,{className:`spin`,size:17}):(0,X.jsx)(o,{size:17}),`Refresh`]})]}),(0,X.jsxs)(`div`,{className:`settings-sections`,children:[(0,X.jsxs)(`section`,{"aria-label":`Release information`,className:`settings-section`,children:[(0,X.jsx)(`h3`,{children:`Release`}),(0,X.jsxs)(`dl`,{className:`settings-release`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Version`}),(0,X.jsx)(`dd`,{children:r?.version||sb.version})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Channel`}),(0,X.jsx)(`dd`,{children:r?.channel||sb.channel})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Profile`}),(0,X.jsx)(`dd`,{children:r?.profile.id||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Environment`}),(0,X.jsx)(`dd`,{children:r?.profile.environment||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Binding`}),(0,X.jsx)(`dd`,{children:r?r.profile.bound?`bound`:`legacy unbound`:`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Git`}),(0,X.jsx)(`dd`,{children:r?.git_sha||`not available`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Assets`}),(0,X.jsx)(`dd`,{className:`settings-path`,children:r?.asset_root||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`SQLite`}),(0,X.jsx)(`dd`,{className:`settings-path`,children:r?.database.path||`loading`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Database`}),(0,X.jsx)(`dd`,{children:r?.database.exists?`${r.database.projects??0} projects / ${r.database.workspaces??0} workspaces`:`not created yet`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Schema`}),(0,X.jsx)(`dd`,{children:r?`${r.schema.migration_keys.length} migration marker(s)`:`loading`})]})]})]}),(0,X.jsxs)(`section`,{"aria-label":`Lineage experience settings`,className:`settings-section`,children:[(0,X.jsx)(`h3`,{children:`Lineage experience`}),(0,X.jsx)(`div`,{className:`settings-grid`,children:(0,X.jsx)(`article`,{className:`settings-card`,children:(0,X.jsxs)(`div`,{className:`settings-card-head`,children:[(0,X.jsx)(`span`,{className:`settings-icon`,children:(0,X.jsx)(N,{size:19})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h4`,{children:`Hover previews`}),(0,X.jsx)(`p`,{children:`Show the full asset and quick Branch/Re-roll/Details actions when hovering over or focusing a lineage node. Double-click details remain available when this is off.`})]}),(0,X.jsx)(mb,{checked:u,label:`Enable lineage hover previews`,onClick:f})]})})})]}),ub.map(e=>(0,X.jsxs)(`section`,{"aria-label":e.ariaLabel,className:`settings-section`,children:[(0,X.jsx)(`h3`,{children:lb[e.adapterType]}),(0,X.jsx)(`div`,{className:`settings-grid`,children:(t?.settings||[]).filter(t=>t.adapter_type===e.adapterType).map(e=>{let t=cb[e.adapter_type],n=ob(e.adapter_type,e.provider),r=`Enable ${e.label===`Buffer`?`Buffer scheduling`:e.label}`,i=c===`${e.adapter_type}:${e.provider}`;return(0,X.jsxs)(`article`,{className:`settings-card`,children:[(0,X.jsxs)(`div`,{className:`settings-card-head`,children:[(0,X.jsx)(`span`,{className:`settings-icon`,children:(0,X.jsx)(t,{size:19})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h4`,{children:e.label}),(0,X.jsx)(`p`,{children:e.description})]}),(0,X.jsx)(mb,{checked:e.enabled,disabled:i,label:r,onClick:()=>void h(e)})]}),(0,X.jsxs)(`dl`,{className:`settings-meta`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Status`}),(0,X.jsxs)(`dd`,{className:pb(e),children:[e.health_status===`configured`?(0,X.jsx)(w,{size:14}):(0,X.jsx)(C,{size:14}),e.health_status.replace(/_/g,` `)]})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Maturity`}),(0,X.jsx)(`dd`,{children:n.maturity})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Credential source`}),(0,X.jsx)(`dd`,{children:e.credential.label})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`dt`,{children:`Secret ref`}),(0,X.jsx)(`dd`,{children:e.credential.secret_ref||`none`})]})]}),fb(e).length>0&&(0,X.jsx)(`div`,{className:`settings-config`,children:fb(e).map(([e,t])=>(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`strong`,{children:e}),db(t)]},e))})]},`${e.adapter_type}:${e.provider}`)})})]},e.adapterType)),a&&!t&&(0,X.jsx)(`div`,{className:`settings-loading`,children:`Loading settings...`})]})]})}var gb=`Lineage`,_b=`Local-first creative lineage workspace`;function vb(e){let{channel:t,channels:n,placementStatus:r,project:i,projects:a,setChannel:o,setPlacementStatus:s,setProject:c,setSource:l,setStatus:u,source:d,status:f}=e,[m,h]=(0,p.useState)(!1),[g,_]=(0,p.useState)(!0),v=a.length?a.map(e=>e.project):[i];return(0,X.jsxs)(`aside`,{className:`sidebar ${g?``:`collapsed`}`,children:[(0,X.jsx)(`button`,{"aria-label":g?`Collapse sidebar`:`Expand sidebar`,className:`sidebar-collapse-toggle`,onClick:()=>_(e=>!e),type:`button`,children:g?(0,X.jsx)(te,{size:16}):(0,X.jsx)(ne,{size:16})}),(0,X.jsxs)(`div`,{className:`brand`,children:[(0,X.jsx)(`div`,{className:`brand-mark`,"aria-label":_b,children:`L`}),(0,X.jsxs)(`div`,{className:`brand-copy`,children:[(0,X.jsx)(`h1`,{children:gb}),(0,X.jsxs)(`p`,{children:[(0,X.jsx)(`span`,{children:i}),(0,X.jsxs)(`span`,{"aria-label":`Lineage version ${sb.version}`,className:`brand-version`,title:`Lineage version ${sb.version}, ${sb.channel} channel`,children:[`v`,sb.version]})]})]})]}),(0,X.jsxs)(`button`,{"aria-controls":`mobile-sidebar-controls`,"aria-expanded":m,className:`mobile-filter-toggle`,onClick:()=>h(e=>!e),type:`button`,children:[(0,X.jsx)(K,{size:16}),`Filters`,(0,X.jsx)(S,{className:m?`open`:``,size:16})]}),(0,X.jsxs)(`div`,{className:`sidebar-mobile-collapse`,"data-open":m,id:`mobile-sidebar-controls`,children:[(0,X.jsxs)(`div`,{className:`side-section`,children:[(0,X.jsx)(`h2`,{children:`Project`}),(0,X.jsx)(yb,{id:`asset-project-filter`,label:`Project`,value:i,values:v,onChange:c})]}),(0,X.jsxs)(`section`,{className:`side-section`,children:[(0,X.jsx)(`h2`,{children:`Filters`}),(0,X.jsx)(yb,{id:`asset-source-filter`,label:`Source`,value:d,values:Y,onChange:e=>l(e)}),(0,X.jsx)(yb,{id:`asset-status-filter`,label:`Status`,value:f,values:J,onChange:e=>u(e)}),(0,X.jsx)(yb,{id:`asset-channel-filter`,label:`Channel`,value:t,values:n,onChange:o}),(0,X.jsx)(yb,{id:`asset-placement-filter`,label:`Placement`,value:r,values:he,onChange:e=>s(e)})]})]})]})}function yb({id:e,label:t,value:n,values:r,onChange:i}){return(0,X.jsxs)(`label`,{htmlFor:e,children:[t,(0,X.jsx)(`select`,{"aria-label":t,id:e,value:n,onChange:e=>i(e.target.value),children:r.map(e=>(0,X.jsx)(`option`,{value:e,children:e},e))})]})}var bb=[{label:`Lineage`,view:`lineage`},{label:`Review`,view:`review`},{label:`Assets`,view:`assets`},{label:`Agents`,view:`agents`},{label:`Settings`,view:`settings`}],xb=[{label:`Ledger`,view:`ledger`},{label:`Content batches`,view:`content`},{label:`Backup queue`,view:`backup`}];function Sb(e){let t=xb.some(t=>t.view===e.view);function n(t){e.setView(t),e.onMoreOpenChange(!1)}function r(t){e.setView(t),e.onMoreOpenChange(!1)}return(0,X.jsxs)(`header`,{className:`topbar`,children:[(0,X.jsxs)(`div`,{className:`view-tabs`,role:`tablist`,"aria-label":`${gb} views`,children:[bb.map(t=>(0,X.jsx)(`button`,{"aria-pressed":e.view===t.view,className:e.view===t.view?`active`:``,onClick:()=>n(t.view),type:`button`,children:t.label},t.view)),(0,X.jsxs)(`div`,{className:`more-menu`,children:[(0,X.jsxs)(`button`,{"aria-expanded":e.moreOpen,"aria-haspopup":`menu`,"aria-pressed":t,className:t?`active`:``,onClick:()=>e.onMoreOpenChange(!e.moreOpen),type:`button`,children:[(0,X.jsx)(j,{size:16}),` More `,(0,X.jsx)(S,{className:e.moreOpen?`open`:``,size:15})]}),e.moreOpen&&(0,X.jsx)(`div`,{className:`more-menu-popover`,role:`menu`,children:xb.map(t=>(0,X.jsx)(`button`,{"aria-pressed":e.view===t.view,onClick:()=>r(t.view),role:`menuitem`,type:`button`,children:t.label},t.view))})]})]}),(0,X.jsx)(Cb,{runtime:e.runtime,unavailable:e.runtimeIdentityUnavailable}),(0,X.jsxs)(`div`,{className:`searchbox`,children:[(0,X.jsx)(ie,{size:17}),(0,X.jsx)(`input`,{onChange:t=>e.setQuery(t.target.value),placeholder:`Search assets, campaigns, hooks`,value:e.query})]}),e.view!==`lineage`&&(0,X.jsxs)(`button`,{"aria-expanded":e.assetDetailsOpen,className:`secondary-button`,disabled:!e.canInspectAsset,onClick:()=>{e.onMoreOpenChange(!1),e.setAssetDetailsOpen(!e.assetDetailsOpen)},type:`button`,children:[(0,X.jsx)(I,{size:17}),`Details`]}),(0,X.jsx)(`button`,{className:`icon-button`,disabled:e.loading,onClick:()=>void e.refresh(),title:`Refresh current page`,children:e.loading?(0,X.jsx)(W,{className:`spin`,size:18}):(0,X.jsx)(o,{size:18})}),(0,X.jsxs)(`button`,{className:`primary-button`,onClick:()=>e.setUploadOpen(!0),children:[(0,X.jsx)(ue,{size:17}),`Upload`]})]})}function Cb(e){if(e.unavailable)return(0,X.jsx)(`div`,{"aria-label":`Lineage runtime identity unavailable`,className:`runtime-identity-badge unavailable`,children:`IDENTITY UNAVAILABLE`});if(!e.runtime)return(0,X.jsx)(`div`,{"aria-label":`Loading Lineage runtime identity`,className:`runtime-identity-badge loading`,children:`IDENTITY LOADING`});let{profile:t}=e.runtime,n=t.bound?``:` · UNBOUND`,r=[`${t.environment.toUpperCase()} profile ${t.id}${t.bound?``:` (unbound)`}`,`Channel ${e.runtime.channel}`,`Version ${e.runtime.version}`,t.warning].filter(Boolean).join(` · `);return(0,X.jsxs)(`div`,{"aria-label":`Lineage ${t.environment} profile ${t.id}${t.bound?``:` unbound`}`,className:`runtime-identity-badge ${t.environment} ${t.bound?`bound`:`unbound`}`,"data-profile-id":t.id,title:r,children:[(0,X.jsx)(`strong`,{children:t.environment.toUpperCase()}),(0,X.jsxs)(`span`,{children:[t.id,n]})]})}function wb({toast:e,onDismiss:t}){return(0,X.jsxs)(`div`,{className:`toast ${e.type}`,role:`status`,children:[e.type===`ok`?(0,X.jsx)(w,{size:16}):(0,X.jsx)(oe,{size:16}),(0,X.jsx)(`span`,{children:e.message}),(0,X.jsx)(`button`,{onClick:t,children:`Dismiss`})]})}var Tb=200*1024*1024;function Eb({channels:e,project:t,onClose:n,onUploaded:r,onError:i}){let[a,o]=(0,p.useState)({assetId:``,audience:`short-form-creators`,campaign:`2026-06-organic-traffic-test`,channel:e[0]||`meta`,cta:``,hook:``,status:`working`,title:``,type:`image`,utmContent:``}),[s,c]=(0,p.useState)(null),[l,u]=(0,p.useState)(!1),[d,f]=(0,p.useState)(!1);function m(e,t){o(n=>({...n,[e]:t}))}function h(e){o(t=>({...t,assetId:t.assetId||pe(`demo-${t.channel}-${e}`),title:e,utmContent:t.utmContent||pe(e).replaceAll(`-`,`_`)}))}function _(e){if(!e){c(null);return}if(e.size>Tb){i(`File is larger than ${q(Tb)}`);return}c(e)}async function v(e){if(e.preventDefault(),!s)return i(`Choose a file before uploading`);f(!0);try{let e=new FormData;Object.entries({project:t,...a,confirmWrite:String(l)}).forEach(([t,n])=>e.append(t,n)),e.append(`file`,s),await r((await g(`/api/assets/upload`,{method:`POST`,body:e})).message)}catch(e){i(e instanceof Error?e.message:String(e))}finally{f(!1)}}return(0,X.jsx)(`div`,{className:`drawer-backdrop`,children:(0,X.jsxs)(`form`,{className:`upload-drawer`,onSubmit:v,children:[(0,X.jsxs)(`header`,{children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{children:`Upload asset`}),(0,X.jsx)(`p`,{children:t})]}),(0,X.jsx)(`button`,{type:`button`,onClick:n,children:`Close`})]}),(0,X.jsxs)(`label`,{className:`file-drop`,children:[(0,X.jsx)(ue,{size:20}),(0,X.jsx)(`span`,{children:s?s.name:`Choose creative export up to ${q(Tb)}`}),(0,X.jsx)(`input`,{type:`file`,onChange:e=>_(e.target.files?.[0])})]}),(0,X.jsxs)(`div`,{className:`form-grid`,children:[(0,X.jsxs)(`label`,{children:[`Title`,(0,X.jsx)(`input`,{value:a.title,onChange:e=>h(e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Asset ID`,(0,X.jsx)(`input`,{value:a.assetId,onChange:e=>m(`assetId`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Campaign`,(0,X.jsx)(`input`,{value:a.campaign,onChange:e=>m(`campaign`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Channel`,(0,X.jsx)(`select`,{value:a.channel,onChange:e=>m(`channel`,e.target.value),children:e.map(e=>(0,X.jsx)(`option`,{children:e},e))})]}),(0,X.jsxs)(`label`,{children:[`Audience`,(0,X.jsx)(`input`,{value:a.audience,onChange:e=>m(`audience`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{children:[`Status`,(0,X.jsxs)(`select`,{value:a.status,onChange:e=>m(`status`,e.target.value),children:[(0,X.jsx)(`option`,{children:`working`}),(0,X.jsx)(`option`,{children:`published`})]})]}),(0,X.jsxs)(`label`,{children:[`Type`,(0,X.jsx)(`select`,{value:a.type,onChange:e=>m(`type`,e.target.value),children:ge.map(e=>(0,X.jsx)(`option`,{children:e},e))})]}),(0,X.jsxs)(`label`,{children:[`UTM content`,(0,X.jsx)(`input`,{value:a.utmContent,onChange:e=>m(`utmContent`,e.target.value),required:!0})]}),(0,X.jsxs)(`label`,{className:`wide`,children:[`Hook`,(0,X.jsx)(`input`,{value:a.hook,onChange:e=>m(`hook`,e.target.value)})]}),(0,X.jsxs)(`label`,{className:`wide`,children:[`CTA`,(0,X.jsx)(`input`,{value:a.cta,onChange:e=>m(`cta`,e.target.value),required:!0})]})]}),(0,X.jsxs)(`label`,{className:`confirm-line`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked)}),(0,X.jsx)(`span`,{children:`Confirm write to the production asset bucket`})]}),(0,X.jsxs)(`footer`,{children:[(0,X.jsx)(`button`,{type:`button`,onClick:n,children:`Cancel`}),(0,X.jsxs)(`button`,{className:`primary-button`,disabled:d||!l,children:[d?(0,X.jsx)(W,{className:`spin`,size:16}):(0,X.jsx)(ue,{size:16}),`Upload`]})]})]})})}function Db(e,t){let n=`${e} ${t}`.toLowerCase();return n.includes(`agent`)||n.includes(`command`)||n.includes(`selection`)||n.includes(`next context`)}function Ob(){return typeof window>`u`?me:new URLSearchParams(window.location.search).get(`project`)||`demo-project`}function kb(){let[e,t]=(0,p.useState)(null),[n,r]=(0,p.useState)(null),[i,a]=(0,p.useState)(Ob),[o,s]=(0,p.useState)([]),[c,l]=(0,p.useState)(`all`),[u,d]=(0,p.useState)(`all`),[f,m]=(0,p.useState)(`local`),[h,y]=(0,p.useState)(`all`),[b,x]=(0,p.useState)(``),[S,C]=(0,p.useState)(1),[w,T]=(0,p.useState)(10),[E,D]=(0,p.useState)(!1),[O,k]=(0,p.useState)(!0),[A,j]=(0,p.useState)(null),[M,N]=(0,p.useState)(null),[P,F]=(0,p.useState)({}),[I,L]=(0,p.useState)({}),[R,z]=(0,p.useState)([]),[B,V]=(0,p.useState)([]),[ee,H]=(0,p.useState)(!1),[U,W]=(0,p.useState)(!1),[G,te]=(0,p.useState)(`lineage`),[ne,re]=(0,p.useState)(!1),[ie,ae]=(0,p.useState)(null),[oe,K]=(0,p.useState)(0),[se,ce]=(0,p.useState)(null),[le,ue]=(0,p.useState)(!1),[de,q]=(0,p.useState)(null),fe=(0,p.useCallback)(e=>{q(t=>e?`lineage-actions`:t===`lineage-actions`?null:t)},[]),pe=(0,p.useCallback)(e=>{q(t=>e?`topbar-more`:t===`topbar-more`?null:t)},[]),me=(0,p.useCallback)((e,t)=>{j({type:e,message:t})},[]),J=e?.catalog.project===i?e:null,he=J?.assets||[],Y=xe(he,n)||(ie?.project===i&&ie.asset_id===n?ie:void 0),ge=Y?.asset_id||``,_e=[...B.filter(e=>R.includes(e.asset_id)),...he.filter(e=>R.includes(e.asset_id)&&e.local?.relative_path)].filter((e,t,n)=>n.findIndex(t=>t.asset_id===e.asset_id)===t),ve=Y&&P[Y.asset_id]||null,ye=(0,p.useMemo)(()=>[`all`,...J?.facets.channels||[]],[J]),be=(0,p.useMemo)(()=>({assets:J?.catalog.asset_count||0,live:J?.liveObjects.length||0,orphan:J?.orphanObjects.length||0,size:J?.facets.totalSizeBytes||0}),[J]);async function Ce(){try{let e=await g(`/api/projects`);s(e.projects),a(t=>e.projects.some(e=>e.project===t)?t:e.projects[0]?.project||`demo-project`)}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}async function we(){try{let e=await g(`/api/runtime`);ce(e.runtime),ue(!1)}catch{ce(null),ue(!0)}}async function Te(){k(!0);try{let e=await g(`/api/assets?${Ee()}`);t(e),r(t=>xe(e.assets,t)?.asset_id||(t&&ie?.asset_id===t?t:null)),F({}),L({})}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}finally{k(!1)}}function Ee(){let e=new URLSearchParams({project:i,page:String(S),pageSize:String(w),live:String(E),source:f});return c!==`all`&&e.set(`status`,c),u!==`all`&&e.set(`placementStatus`,u),h!==`all`&&e.set(`channel`,h),b.trim()&&e.set(`q`,b.trim()),e.toString()}async function De(e){try{let t=await e();j({type:`ok`,message:t.message}),F({}),await Te()}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}async function Oe(e,t={}){if(!Se(e))return null;let n=P[e.asset_id];if(n)return t.open&&window.open(n,`_blank`,`noopener,noreferrer`),n;if(e.local?.relative_path){let n=`/api/assets/local-preview?${new URLSearchParams({project:i,path:e.local.relative_path}).toString()}`;return F(t=>({...t,[e.asset_id]:n})),L(t=>({...t,[e.asset_id]:``})),t.open&&window.open(n,`_blank`,`noopener,noreferrer`),n}try{let n=await g(`/api/assets/presign`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project:i,assetId:e.asset_id,expiresIn:900})});return F(t=>({...t,[e.asset_id]:n.url})),L(t=>({...t,[e.asset_id]:``})),t.open&&window.open(n.url,`_blank`,`noopener,noreferrer`),n.url}catch(n){let r=n instanceof Error?n.message:String(n);return L(t=>({...t,[e.asset_id]:r})),t.quiet||j({type:`error`,message:`Preview unavailable. Check S3 credentials or pull the asset locally.`}),null}}async function ke(e,t){try{let n=await Bm(e);j({type:`ok`,message:n.method===`fallback`?`Copied ${t} using browser fallback`:`Copied ${t}`}),N(Db(t,e)?{label:t,text:e}:null)}catch(n){N(Db(t,e)?{label:t,text:e}:null),j({type:`error`,message:n instanceof Error?n.message:String(n)})}}async function je(e){let t=await Oe(e,{quiet:!0});t&&await ke(t,`preview link`)}function Ne(e){e.local?.relative_path&&(z(t=>t.includes(e.asset_id)?t:[...t,e.asset_id]),V(t=>t.some(t=>t.asset_id===e.asset_id)?t:[...t,e]))}function Z(e){ae(e),r(e.asset_id),re(!0)}async function Pe(e){r(e),re(!0);let t=he.find(t=>t.asset_id===e);if(t){ae(t);return}try{let t=await g(`/api/assets/lookup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project:i,assetIds:[e]})});t.assets[0]&&ae(t.assets[0])}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}function Fe(){m(`local`),l(`all`),d(`all`),x(``),te(`backup`)}async function Ie(e){try{e.assetId&&r(e.assetId),e.view===`lineage`&&e.workspaceId&&await g(`/api/lineage-workspaces/${encodeURIComponent(e.workspaceId)}/activate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({project:i,confirmWrite:!0})}),re(!1),te(e.view),j({type:`ok`,message:`Opened ${e.claim.target_title||e.claim.target_id}`})}catch(e){j({type:`error`,message:e instanceof Error?e.message:String(e)})}}function Le(e){e.local?.relative_path&&(z(t=>t.includes(e.asset_id)?t.filter(t=>t!==e.asset_id):[...t,e.asset_id]),V(t=>t.filter(t=>t.asset_id!==e.asset_id)))}return(0,p.useEffect)(()=>{Ce(),we()},[]),(0,p.useEffect)(()=>{let e=new URLSearchParams(window.location.search);e.get(`project`)!==i&&(e.set(`project`,i),window.history.replaceState(null,``,`${window.location.pathname}?${e.toString()}${window.location.hash}`))},[i]),(0,p.useEffect)(()=>{j(null),N(null),ae(null),re(!1)},[i]),(0,p.useEffect)(()=>{Te()},[S,w,i,c,u,f,h,b,E]),(0,p.useEffect)(()=>{C(1)},[i,c,u,f,h,b,w]),(0,p.useEffect)(()=>{!Se(Y)||P[Y.asset_id]||Oe(Y,{quiet:!0})},[Y?.asset_id,Y?.s3?.version_id,P]),(0,p.useEffect)(()=>{if(A?.type!==`ok`)return;let e=window.setTimeout(()=>j(null),2600);return()=>window.clearTimeout(e)},[A?.message,A?.type]),(0,p.useEffect)(()=>{G===`backup`&&(m(`local`),l(`all`),d(`all`))},[G]),(0,p.useEffect)(()=>{q(null)},[G]),(0,p.useEffect)(()=>{ge||re(!1)},[ge]),(0,X.jsx)(Me,{runtime:se,children:(0,X.jsxs)(`div`,{className:`app-shell ${G===`lineage`?`lineage-mode`:``}`,children:[(0,X.jsx)(vb,{channel:h,channels:ye,liveSync:E,placementStatus:u,project:i,projects:o,setChannel:y,setPlacementStatus:d,setProject:a,setSource:m,setStatus:l,setView:te,showBackupQueue:Fe,source:f,snapshot:J,status:c,totals:be}),(0,X.jsxs)(`main`,{className:`workspace`,children:[(0,X.jsx)(Sb,{assetDetailsOpen:ne,canInspectAsset:!!Y,loading:O,moreOpen:de===`topbar-more`,onMoreOpenChange:pe,query:b,refresh:Te,runtime:se,runtimeIdentityUnavailable:le,setAssetDetailsOpen:re,setQuery:x,setUploadOpen:W,setView:e=>e===`backup`?Fe():te(e),view:G}),A&&(0,X.jsx)(wb,{toast:A,onDismiss:()=>j(null)}),M&&(0,X.jsx)(Ct,{copiedText:M,onDismiss:()=>N(null)}),(0,X.jsx)(Ot,{onCopy:ke,project:i,refreshKey:oe,selectedAsset:Y,view:G}),G===`review`?(0,X.jsx)(Yy,{channel:h,onCopy:ke,onLocalReview:async(e,t)=>{await De(()=>_(`/api/local-review/${e.asset_id}`,i,{reviewState:t,confirmWrite:!0}))},onOpenBackup:e=>{Ne(e),H(!0)},onSelectAsset:e=>{Z(e)},project:i,selected:Y}):G===`ledger`?(0,X.jsx)(Vt,{project:i,query:b,onOpenAsset:Pe}):G===`content`?(0,X.jsx)(_t,{onCopy:ke,onOpenAsset:Pe,onToast:me,onWorkTargetsChanged:()=>K(e=>e+1),project:i,selectedAsset:Y}):G===`agents`?(0,X.jsx)(ze,{onCopy:ke,onOpenWork:Ie,project:i}):G===`backup`?(0,X.jsx)(zy,{assets:he,cli:se?.cli,onCopy:ke,onLocalReview:async(e,t)=>{await De(()=>_(`/api/local-review/${e.asset_id}`,i,{reviewState:t,confirmWrite:!0}))},onOpenBackup:()=>H(!0),onQueueBackup:Ne,onSelectAsset:e=>{Z(e)},page:S,pageSize:w,project:i,selected:Y,selectedBackupIds:R,setPage:C,setPageSize:T,snapshot:J}):G===`assets`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Gy,{assets:_e,onClear:()=>{z([]),V([])},onOpen:()=>H(!0)}),(0,X.jsx)(Re,{assets:he,liveSync:E,onCopy:ke,onSelectionChanged:()=>K(e=>e+1),page:S,pageSize:w,previewUrls:P,project:i,selected:Y,setLiveSync:D,setPage:C,setPageSize:T,setSelectedId:r,snapshot:J,source:f,totals:be})]}):G===`settings`?(0,X.jsx)(hb,{onToast:me,project:i}):(0,X.jsx)(jy,{asset:Y,actionsOpen:de===`lineage-actions`,onAssetsChanged:Te,onActionsOpenChange:fe,onSelectedAsset:r,onToast:me,project:i})]}),G!==`lineage`&&ne&&(0,X.jsx)(Ae,{asset:Y,onArchive:e=>void De(()=>_(`/api/assets/archive`,i,{assetId:e.asset_id,confirmArchive:!0})),onClose:()=>re(!1),onCopy:(e,t)=>void ke(e,t),onCopyPreview:e=>void je(e),onDelete:(e,t)=>void De(()=>_(`/api/assets/delete-object`,i,{assetId:e.asset_id,confirmation:t})),onPlacement:(e,t,n)=>void De(()=>_(`/api/assets/placement`,i,{assetId:e.asset_id,channel:e.channel,...v(n),status:t,confirmWrite:!0})),onPresign:e=>void Oe(e,{open:!0}),onPromote:e=>void De(()=>_(`/api/assets/promote`,i,{assetId:e.asset_id,confirmWrite:!0})),onPull:e=>void De(()=>_(`/api/assets/pull`,i,{assetId:e.asset_id,out:`.asset-scratch`})),onToggleBackup:Le,previewError:Y&&I[Y.asset_id]||null,previewUrl:ve,selectedForBackup:Y?R.includes(Y.asset_id):!1}),U&&(0,X.jsx)(Eb,{channels:ye.filter(e=>e!==`all`),project:i,onClose:()=>W(!1),onError:e=>j({type:`error`,message:e}),onUploaded:async e=>{j({type:`ok`,message:e}),W(!1),await Te()}}),ee&&(0,X.jsx)(Py,{assets:_e,project:i,onClose:()=>H(!1),onError:e=>j({type:`error`,message:e}),onDone:async e=>{j({type:`ok`,message:e}),z([]),V([]),H(!1),await Te()}})]})})}(0,m.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(p.StrictMode,{children:(0,X.jsx)(kb,{})}));
@@ -0,0 +1,2 @@
1
+ import{a as e,c as t,d as n,i as r,l as i,n as a,o,p as s,r as c,s as l,t as u}from"./jsx-runtime-DAFSxiwi.js";var d=t(`ArrowDownRight`,[[`path`,{d:`m7 7 10 10`,key:`1fmybs`}],[`path`,{d:`M17 7v10H7`,key:`6fjiku`}]]),f=t(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),p=t(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),m=t(`MousePointer2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),h=t(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),g=s(n(),1),_=i(),v=`/assets/agent-shared-state-DOfpTLiw.webp`,y=`/assets/agent-to-canvas-DtIu_cPq.mp4`,b=`/assets/attempt-history-D6wdic6n.webp`,x=`/assets/branching-tree-B8I5_S6D.png`,S=`/assets/canvas-cli-DHBacq7r.png`,C=`/assets/hero-agent-sync-poster-zBB3KpbO.png`,w=`/assets/hero-agent-sync-D8ibW83E.mp4`,T=`/assets/hero-board-DG3ED4AW.webp`,E=`/assets/hero-lineage-growth-Bsl9tiq-.mp4`,D=`/assets/hero-trace-connections-Bb52ABBc.mp4`,O=`/assets/human-selection-BdDBDE-I.webp`,k=`/assets/human-to-agent-D1z92ZO9.mp4`,A=`/assets/reroll-history-DQcEH42R.mp4`,j=[{id:`hero-lineage-growth`,eyebrow:`From agent to canvas`,title:`Turn agent output into visual creative history.`,description:`Every new asset joins the lineage instead of disappearing into a chat.`,kind:`video`,src:E,poster:T,fit:`contain`},{id:`hero-trace-connections`,eyebrow:`Context stays connected`,title:`Keep the reasoning behind the visual work.`,description:`Prompts, branches, and decisions remain attached to every result.`,kind:`video`,src:D,poster:x,fit:`contain`},{id:`hero-agent-sync`,eyebrow:`One shared creative state`,title:`Humans and agents continue from the same place.`,description:`New agent work returns to the canvas, ready for the next decision.`,kind:`video`,src:w,poster:C,fit:`contain`}],M={"human-to-agent":{id:`human-to-agent`,eyebrow:`Human → agent`,title:`Send the exact creative context to Codex.`,description:`A canvas selection becomes actionable agent context.`,kind:`video`,src:k,poster:S,fit:`contain`},"agent-to-canvas":{id:`agent-to-canvas`,eyebrow:`Agent → canvas`,title:`Bring agent results back into the shared state.`,description:`New agent output returns to the same visual workspace.`,kind:`video`,src:y,poster:v,fit:`contain`},"trace-tree":{id:`trace-tree`,eyebrow:`Lineage graph`,title:`Every branch remains visible.`,description:`The graph preserves the path from source to variation.`,kind:`image`,src:x,fit:`cover`},"selection-still":{id:`selection-still`,eyebrow:`Selection + direction`,title:`Choose exactly where the work continues.`,description:`Inspect, select, and turn the decision into precise context.`,kind:`image`,src:O,fit:`cover`,position:`left`},"reroll-history":{id:`reroll-history`,eyebrow:`Attempt history`,title:`Ask for another pass without losing the first.`,description:`The new attempt returns without replacing earlier work.`,kind:`video`,src:A,poster:b,fit:`cover`}},N=u(),P=[`npm install -g @mean-weasel/lineage@latest`,`lineage-channel install stable`,`lineage-stable runtime doctor --json`,`lineage-stable profile init --profile team-production --confirm-write --json`,`lineage-stable runtime doctor --json`,`lineage-stable profile doctor --profile team-production --json`,`lineage-stable db info --profile team-production --json`,`lineage-stable start --profile team-production`].join(` &&
2
+ `),F=`${`/`.replace(/\/$/,``)}/docs/`;function I(){let[e,t]=(0,g.useState)(!1);async function n(){try{await navigator.clipboard.writeText(P),t(!0),window.setTimeout(()=>t(!1),1800)}catch{t(!1)}}return(0,N.jsxs)(`div`,{className:`landing-shell`,children:[(0,N.jsxs)(`header`,{className:`landing-nav`,children:[(0,N.jsxs)(`a`,{"aria-label":`Lineage home`,className:`landing-brand`,href:`#top`,children:[(0,N.jsxs)(`span`,{"aria-hidden":`true`,className:`landing-brand-mark`,children:[(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{})]}),(0,N.jsx)(`span`,{children:`LINEAGE`})]}),(0,N.jsxs)(`nav`,{"aria-label":`Landing page`,children:[(0,N.jsx)(`a`,{href:`#loop`,children:`How it works`}),(0,N.jsx)(`a`,{href:`#features`,children:`What it enables`}),(0,N.jsx)(`a`,{href:F,children:`Documentation`}),(0,N.jsx)(`a`,{href:`#install`,children:`Install`})]}),(0,N.jsxs)(`a`,{className:`nav-cta`,href:`https://github.com/mean-weasel/lineage`,rel:`noreferrer`,target:`_blank`,children:[`View on GitHub `,(0,N.jsx)(d,{"aria-hidden":`true`,size:16})]})]}),(0,N.jsxs)(`main`,{id:`top`,children:[(0,N.jsxs)(`section`,{className:`hero-section`,children:[(0,N.jsxs)(`div`,{className:`hero-grid`,"aria-hidden":`true`,children:[(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{})]}),(0,N.jsxs)(`div`,{className:`hero-copy`,children:[(0,N.jsxs)(`p`,{className:`section-index`,children:[(0,N.jsx)(`span`,{children:`01`}),` Human × agent creative work`]}),(0,N.jsx)(`h1`,{children:`The UX where humans and agents shape visual work together.`}),(0,N.jsx)(`p`,{className:`hero-summary`,children:`Lineage is the shared visual workspace where humans and agents create, review, and evolve creative assets together.`}),(0,N.jsxs)(`div`,{className:`hero-actions`,children:[(0,N.jsxs)(`a`,{className:`primary-cta`,href:`#loop`,children:[`See the collaboration loop `,(0,N.jsx)(l,{"aria-hidden":`true`,size:18})]}),(0,N.jsx)(`a`,{className:`text-cta`,href:`#install`,children:`Install Lineage`})]})]}),(0,N.jsx)(`div`,{className:`hero-media-wrap`,children:(0,N.jsx)(L,{})})]}),(0,N.jsxs)(`section`,{className:`loop-section`,id:`loop`,children:[(0,N.jsxs)(`div`,{className:`loop-heading`,children:[(0,N.jsxs)(`p`,{className:`section-index`,children:[(0,N.jsx)(`span`,{children:`02`}),` Context travels both ways`]}),(0,N.jsx)(`h2`,{children:`One creative state for humans and agents.`}),(0,N.jsxs)(`div`,{className:`loop-copy`,children:[(0,N.jsx)(`p`,{className:`loop-problem`,children:`Chat is the right UX for directing agent-driven creative work. But it isn’t built to hold the state of that work.`}),(0,N.jsx)(`p`,{children:`Lineage preserves every asset, path, prompt, relationship, and decision in a shared record—precise enough for agents to retrieve through the CLI and organized visually for humans to review and direct.`})]})]}),(0,N.jsxs)(`div`,{className:`interface-grid`,children:[(0,N.jsxs)(`article`,{className:`interface-card agent-card`,children:[(0,N.jsx)(`div`,{className:`interface-number`,children:`A`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`card-eyebrow`,children:`For agents`}),(0,N.jsx)(`h3`,{children:`Never lose the state behind the work.`}),(0,N.jsx)(`p`,{children:`Every asset, path, prompt, iteration, and relationship stays available so the work can continue accurately.`})]}),(0,N.jsx)(R,{definition:M[`agent-to-canvas`],showCaption:!0})]}),(0,N.jsxs)(`div`,{className:`loop-bridge`,"aria-label":`Assets, context, selections, and annotations move through one creative state`,children:[(0,N.jsx)(`span`,{children:`Assets + context`}),(0,N.jsx)(`div`,{className:`bridge-line`,children:(0,N.jsx)(l,{"aria-hidden":`true`,size:18})}),(0,N.jsxs)(`strong`,{children:[`ONE CREATIVE`,(0,N.jsx)(`br`,{}),`STATE`]}),(0,N.jsx)(`div`,{className:`bridge-line reverse`,children:(0,N.jsx)(l,{"aria-hidden":`true`,size:18})}),(0,N.jsx)(`span`,{children:`Selections + annotations`})]}),(0,N.jsxs)(`article`,{className:`interface-card human-card`,children:[(0,N.jsx)(`div`,{className:`interface-number`,children:`H`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`card-eyebrow`,children:`For humans`}),(0,N.jsx)(`h3`,{children:`Keep your creative history organized.`}),(0,N.jsx)(`p`,{children:`Review and compare the history, then use selections and annotations to direct the next iteration.`})]}),(0,N.jsx)(R,{definition:M[`human-to-agent`],showCaption:!0})]})]})]}),(0,N.jsxs)(`section`,{className:`features-section`,id:`features`,children:[(0,N.jsxs)(`div`,{className:`features-heading`,children:[(0,N.jsxs)(`p`,{className:`section-index`,children:[(0,N.jsx)(`span`,{children:`03`}),` What it enables`]}),(0,N.jsx)(`h2`,{children:`A shared creative history you and your agents can build on.`}),(0,N.jsx)(`p`,{children:`Keep the useful context behind every asset available, understandable, and ready for the next human or agent action.`})]}),(0,N.jsxs)(`div`,{className:`feature-grid`,children:[(0,N.jsx)(B,{icon:(0,N.jsx)(p,{}),media:M[`trace-tree`],number:`01`,title:`Trace every iteration`,children:`Follow an asset from its origin through branches, selections, and final campaign formats.`}),(0,N.jsx)(B,{icon:(0,N.jsx)(m,{}),media:M[`selection-still`],number:`02`,title:`Continue from the exact asset`,children:`Select any useful point in the lineage and bring that context into the next agent session.`}),(0,N.jsx)(B,{icon:(0,N.jsx)(a,{}),media:M[`reroll-history`],number:`03`,title:`Keep every agent attempt tied to your decisions`,children:`Review another pass without losing earlier results, prompts, relationships, or human direction.`})]}),(0,N.jsxs)(`div`,{className:`final-cta`,id:`install`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`p`,{className:`section-index`,children:[(0,N.jsx)(`span`,{children:`→`}),` Local-first and agent-ready`]}),(0,N.jsx)(`h3`,{children:`One durable home for visual work made with your agents.`})]}),(0,N.jsxs)(`div`,{className:`install-panel`,children:[(0,N.jsxs)(`div`,{className:`install-command`,children:[(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`$`}),(0,N.jsx)(`pre`,{children:(0,N.jsx)(`code`,{children:P})}),(0,N.jsxs)(`button`,{"aria-label":`Copy first-run commands`,onClick:()=>void n(),type:`button`,children:[e?(0,N.jsx)(f,{"aria-hidden":`true`,size:18}):(0,N.jsx)(r,{"aria-hidden":`true`,size:18}),e?`Copied`:`Copy first-run commands`]})]}),(0,N.jsxs)(`a`,{className:`install-guide-link`,href:`https://github.com/mean-weasel/lineage#first-run`,rel:`noreferrer`,target:`_blank`,children:[`Read the complete first-run guide `,(0,N.jsx)(d,{"aria-hidden":`true`,size:15})]}),(0,N.jsxs)(`a`,{className:`install-guide-link`,href:F,children:[`Browse Lineage documentation `,(0,N.jsx)(d,{"aria-hidden":`true`,size:15})]}),(0,N.jsxs)(`div`,{className:`install-meta`,children:[(0,N.jsx)(`span`,{children:`Local-first`}),(0,N.jsx)(`span`,{children:`MIT licensed`}),(0,N.jsx)(`span`,{children:`Codex plugin`}),(0,N.jsx)(`span`,{children:`CLI access`})]}),(0,N.jsxs)(`a`,{className:`primary-cta dark`,href:`https://github.com/mean-weasel/lineage`,rel:`noreferrer`,target:`_blank`,children:[`Explore Lineage on GitHub `,(0,N.jsx)(d,{"aria-hidden":`true`,size:18})]})]})]})]})]}),(0,N.jsxs)(`footer`,{children:[(0,N.jsxs)(`a`,{className:`landing-brand`,href:`#top`,children:[(0,N.jsxs)(`span`,{"aria-hidden":`true`,className:`landing-brand-mark`,children:[(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{})]}),(0,N.jsx)(`span`,{children:`LINEAGE`})]}),(0,N.jsx)(`p`,{children:`The shared visual workspace for humans and agents.`}),(0,N.jsxs)(`a`,{href:`https://github.com/mean-weasel/lineage`,rel:`noreferrer`,target:`_blank`,children:[`GitHub `,(0,N.jsx)(d,{"aria-hidden":`true`,size:14})]})]})]})}function L(){let t=(0,g.useRef)(null),[n,r]=(0,g.useState)(0),[i,a]=(0,g.useState)(!0),[s,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(!1),[m,_]=(0,g.useState)(()=>typeof document>`u`||document.visibilityState===`visible`),[v,y]=(0,g.useState)(!1),[b,x]=(0,g.useState)(null),S=j[n],C=b?j[b.fromIndex]:null,w=b?.direction===1?`next`:`previous`,T=i&&!s&&!u&&f&&m&&!v&&!b;(0,g.useEffect)(()=>{let e=t.current;if(!e)return;if(!(`IntersectionObserver`in window)){p(!0);return}let n=new IntersectionObserver(([e])=>{p(!!(e&&e.intersectionRatio>=.35))},{threshold:.35});return n.observe(e),()=>n.disconnect()},[]),(0,g.useEffect)(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>y(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,g.useEffect)(()=>{let e=()=>_(document.visibilityState===`visible`);return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),(0,g.useEffect)(()=>{if(!T)return;let e=window.setTimeout(()=>{x({direction:1,fromIndex:n,initiatedBy:`automatic`}),r((n+1)%j.length)},15e3);return()=>window.clearTimeout(e)},[n,T]),(0,g.useEffect)(()=>{if(!b)return;let e=window.setTimeout(()=>x(null),700);return()=>window.clearTimeout(e)},[b]);function E(e){D((n+e+j.length)%j.length,e)}function D(e,t){if(!(b||e===n)){if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches){r(e);return}x({direction:t,fromIndex:n,initiatedBy:`manual`}),r(e)}}return(0,N.jsxs)(`div`,{"aria-label":`Lineage product tour`,"aria-roledescription":`carousel`,className:`hero-carousel`,onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||d(!1)},onFocusCapture:()=>d(!0),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`ArrowLeft`&&E(-1),e.key===`ArrowRight`&&E(1))},role:`region`,ref:t,tabIndex:0,children:[(0,N.jsx)(`div`,{className:`hero-carousel-media-viewport`,children:(0,N.jsxs)(`div`,{className:`hero-carousel-media-track ${b?`carousel-track-${w}`:``}`,onAnimationEnd:e=>{e.currentTarget===e.target&&x(null)},children:[b?.direction===-1&&(0,N.jsx)(`div`,{className:`hero-carousel-media-slide`,children:(0,N.jsx)(R,{definition:S,hero:!0})},S.id),(0,N.jsx)(`div`,{"aria-hidden":C?`true`:void 0,className:`hero-carousel-media-slide`,children:(0,N.jsx)(R,{definition:C??S,hero:!0,showPlaybackControl:!C})},(C??S).id),b?.direction===1&&(0,N.jsx)(`div`,{className:`hero-carousel-media-slide`,children:(0,N.jsx)(R,{definition:S,hero:!0})},S.id)]})}),(0,N.jsxs)(`div`,{"aria-live":T||b?.initiatedBy===`automatic`?`off`:`polite`,className:`hero-carousel-caption-viewport`,children:[C&&(0,N.jsxs)(`div`,{"aria-hidden":`true`,className:`hero-carousel-caption carousel-caption-exit carousel-${w}`,children:[(0,N.jsx)(`span`,{className:`media-eyebrow`,children:C.eyebrow}),(0,N.jsx)(`strong`,{children:C.title}),(0,N.jsx)(`small`,{children:C.description})]},C.id),(0,N.jsxs)(`div`,{className:`hero-carousel-caption ${b?`carousel-caption-enter carousel-${w}`:``}`,children:[(0,N.jsx)(`span`,{className:`media-eyebrow`,children:S.eyebrow}),(0,N.jsx)(`strong`,{children:S.title}),(0,N.jsx)(`small`,{children:S.description})]},S.id)]}),(0,N.jsxs)(`div`,{className:`hero-carousel-controls`,children:[(0,N.jsx)(`button`,{"aria-label":`Previous carousel slide`,onClick:()=>E(-1),type:`button`,children:(0,N.jsx)(o,{"aria-hidden":`true`,size:19})}),(0,N.jsxs)(`div`,{className:`carousel-center-controls`,children:[(0,N.jsx)(`button`,{"aria-label":i?`Pause carousel rotation`:`Resume carousel rotation`,className:`carousel-autoplay-toggle`,onClick:()=>a(e=>!e),type:`button`,children:i?(0,N.jsx)(h,{"aria-hidden":`true`,size:13}):(0,N.jsx)(c,{"aria-hidden":`true`,size:13})}),(0,N.jsx)(`div`,{"aria-label":`Slide ${n+1} of ${j.length}`,className:`carousel-progress`,children:j.map((e,t)=>(0,N.jsx)(`button`,{"aria-current":t===n?`true`:void 0,"aria-label":`Show slide ${t+1}: ${e.title}`,className:t===n?`active`:``,onClick:()=>D(t,t>n?1:-1),type:`button`},e.id))})]}),(0,N.jsx)(`button`,{"aria-label":`Next carousel slide`,onClick:()=>E(1),type:`button`,children:(0,N.jsx)(e,{"aria-hidden":`true`,size:19})})]})]})}function R({definition:e,hero:t=!1,showCaption:n=!1,showPlaybackControl:r=!0}){return(0,N.jsxs)(`figure`,{className:`media-slot media-slot-ready ${`media-fit-${e.fit??`cover`}`} ${e.position===`left`?`media-position-left`:``} ${t?`media-slot-hero`:``}`,"data-media-slot":e.id,children:[e.kind===`video`?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(z,{definition:e,showPlaybackControl:r}),e.poster&&(0,N.jsx)(`img`,{alt:``,"aria-hidden":`true`,className:`reduced-motion-poster`,src:e.poster})]}):(0,N.jsx)(`img`,{alt:e.description,loading:`lazy`,src:e.src}),n&&(0,N.jsxs)(`figcaption`,{"aria-live":t?`polite`:void 0,children:[(0,N.jsx)(`span`,{className:`media-eyebrow`,children:e.eyebrow}),(0,N.jsx)(`strong`,{children:e.title}),(0,N.jsx)(`small`,{children:e.description})]})]})}function z({definition:e,showPlaybackControl:t}){let n=(0,g.useRef)(null),[r,i]=(0,g.useState)(!1),[a,o]=(0,g.useState)(!1);(0,g.useEffect)(()=>{let e=n.current;if(!e||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;if(a){e.pause();return}if(!(`IntersectionObserver`in window)){e.play().catch(()=>void 0);return}let t=new IntersectionObserver(([t])=>{t?.isIntersecting?e.play().catch(()=>void 0):e.pause()},{threshold:.45});return t.observe(e),()=>{t.disconnect(),e.pause()}},[e.src,a]);function s(){let e=n.current;e&&(e.paused?(o(!1),e.play().catch(()=>void 0)):(o(!0),e.pause()))}return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`video`,{"aria-label":e.description,loop:!0,muted:!0,onPause:()=>i(!1),onPlay:()=>i(!0),playsInline:!0,poster:e.poster,preload:`metadata`,ref:n,src:e.src}),t&&(0,N.jsx)(`button`,{"aria-label":`${r?`Pause`:`Play`} ${e.title}`,className:`video-toggle`,onClick:s,type:`button`,children:r?(0,N.jsx)(h,{"aria-hidden":`true`,size:16}):(0,N.jsx)(c,{"aria-hidden":`true`,fill:`currentColor`,size:16})})]})}function B({children:e,icon:t,media:n,number:r,title:i}){return(0,N.jsxs)(`article`,{className:`feature-card`,children:[(0,N.jsxs)(`div`,{className:`feature-top`,children:[(0,N.jsx)(`span`,{children:r}),t]}),(0,N.jsx)(`h3`,{children:i}),(0,N.jsx)(`p`,{children:e}),(0,N.jsx)(`div`,{className:`feature-media`,children:(0,N.jsx)(R,{definition:n})})]})}(0,_.createRoot)(document.getElementById(`landing-root`)).render((0,N.jsx)(g.StrictMode,{children:(0,N.jsx)(I,{})}));
@@ -4,9 +4,9 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Lineage</title>
7
- <script type="module" crossorigin src="/lineage/assets/app-TEMX-pOn.js"></script>
8
- <link rel="modulepreload" crossorigin href="/lineage/assets/jsx-runtime-DAFSxiwi.js">
9
- <link rel="stylesheet" crossorigin href="/lineage/assets/app-CuBsKrS-.css">
7
+ <script type="module" crossorigin src="/assets/app-BFnrZXvW.js"></script>
8
+ <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-DAFSxiwi.js">
9
+ <link rel="stylesheet" crossorigin href="/assets/app-CuBsKrS-.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
@@ -32,9 +32,9 @@
32
32
  content="https://mean-weasel.github.io/lineage/lineage-showcase-cover-16x9.png"
33
33
  />
34
34
  <title>Lineage — Visual work for humans and agents</title>
35
- <script type="module" crossorigin src="/lineage/assets/landing-MwOFmHoi.js"></script>
36
- <link rel="modulepreload" crossorigin href="/lineage/assets/jsx-runtime-DAFSxiwi.js">
37
- <link rel="stylesheet" crossorigin href="/lineage/assets/landing-wy4L-yBm.css">
35
+ <script type="module" crossorigin src="/assets/landing-DqWZqSzT.js"></script>
36
+ <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-DAFSxiwi.js">
37
+ <link rel="stylesheet" crossorigin href="/assets/landing-wy4L-yBm.css">
38
38
  </head>
39
39
  <body>
40
40
  <div id="landing-root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mean-weasel/lineage",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "Local-first creative lineage workspace",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -28,7 +28,7 @@
28
28
  "docs:build": "astro build --root docs-site",
29
29
  "docs:check": "npm run docs:validate && npm run docs:build",
30
30
  "pages:prepare": "node scripts/prepare-pages.mjs",
31
- "pages:check": "npm run docs:validate && LINEAGE_DOCS_BASE=/lineage/docs/ npm run docs:build && LINEAGE_WEB_BASE=/lineage/ npm run build:web && npm run pages:prepare && test -f dist/pages/index.html && test -f dist/pages/docs/index.html",
31
+ "pages:check": "npm run docs:validate && LINEAGE_DOCS_BASE=/lineage/docs/ npm run docs:build && LINEAGE_WEB_BASE=/lineage/ npm run build:web && npm run pages:prepare && test -f dist/pages/index.html && test -f dist/pages/docs/index.html && npm run build:web",
32
32
  "build:provenance": "node scripts/write-runtime-build.mjs",
33
33
  "build:server": "esbuild src/server.ts --bundle --platform=node --format=esm --target=node22 --packages=external --outfile=dist/server.js --sourcemap",
34
34
  "build:cli": "esbuild src/cli/lineage.ts src/cli/lineage-channel.ts src/cli/lineage-dev.ts src/cli/lineage-preview.ts --bundle --platform=node --format=esm --target=node22 --packages=external --outdir=dist/cli --sourcemap && esbuild scripts/managed-service.mjs --bundle --platform=node --format=esm --target=node22 --packages=external --outfile=dist/cli/managed-service.js --sourcemap",
@@ -57,7 +57,7 @@
57
57
  "prepare-release": "node scripts/prepare-release.mjs",
58
58
  "release": "node scripts/release.mjs",
59
59
  "release:dry-run": "node scripts/release.mjs --dry-run",
60
- "release:policy:test": "node --test scripts/tag-release-plan.test.mjs",
60
+ "release:policy:test": "node --test scripts/tag-release-plan.test.mjs scripts/release-provenance.test.mjs",
61
61
  "release:github": "node scripts/sync-github-release.mjs --channel latest",
62
62
  "release:github:next": "node scripts/sync-github-release.mjs --channel next",
63
63
  "release:github:dry-run": "node scripts/sync-github-release.mjs --channel latest --dry-run",
@@ -1,2 +0,0 @@
1
- import{a as e,c as t,d as n,i as r,l as i,n as a,o,p as s,r as c,s as l,t as u}from"./jsx-runtime-DAFSxiwi.js";var d=t(`ArrowDownRight`,[[`path`,{d:`m7 7 10 10`,key:`1fmybs`}],[`path`,{d:`M17 7v10H7`,key:`6fjiku`}]]),f=t(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),p=t(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),m=t(`MousePointer2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),h=t(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),g=s(n(),1),_=i(),v=`/lineage/assets/agent-shared-state-DOfpTLiw.webp`,y=`/lineage/assets/agent-to-canvas-DtIu_cPq.mp4`,b=`/lineage/assets/attempt-history-D6wdic6n.webp`,x=`/lineage/assets/branching-tree-B8I5_S6D.png`,S=`/lineage/assets/canvas-cli-DHBacq7r.png`,C=`/lineage/assets/hero-agent-sync-poster-zBB3KpbO.png`,w=`/lineage/assets/hero-agent-sync-D8ibW83E.mp4`,T=`/lineage/assets/hero-board-DG3ED4AW.webp`,E=`/lineage/assets/hero-lineage-growth-Bsl9tiq-.mp4`,D=`/lineage/assets/hero-trace-connections-Bb52ABBc.mp4`,O=`/lineage/assets/human-selection-BdDBDE-I.webp`,k=`/lineage/assets/human-to-agent-D1z92ZO9.mp4`,A=`/lineage/assets/reroll-history-DQcEH42R.mp4`,j=[{id:`hero-lineage-growth`,eyebrow:`From agent to canvas`,title:`Turn agent output into visual creative history.`,description:`Every new asset joins the lineage instead of disappearing into a chat.`,kind:`video`,src:E,poster:T,fit:`contain`},{id:`hero-trace-connections`,eyebrow:`Context stays connected`,title:`Keep the reasoning behind the visual work.`,description:`Prompts, branches, and decisions remain attached to every result.`,kind:`video`,src:D,poster:x,fit:`contain`},{id:`hero-agent-sync`,eyebrow:`One shared creative state`,title:`Humans and agents continue from the same place.`,description:`New agent work returns to the canvas, ready for the next decision.`,kind:`video`,src:w,poster:C,fit:`contain`}],M={"human-to-agent":{id:`human-to-agent`,eyebrow:`Human → agent`,title:`Send the exact creative context to Codex.`,description:`A canvas selection becomes actionable agent context.`,kind:`video`,src:k,poster:S,fit:`contain`},"agent-to-canvas":{id:`agent-to-canvas`,eyebrow:`Agent → canvas`,title:`Bring agent results back into the shared state.`,description:`New agent output returns to the same visual workspace.`,kind:`video`,src:y,poster:v,fit:`contain`},"trace-tree":{id:`trace-tree`,eyebrow:`Lineage graph`,title:`Every branch remains visible.`,description:`The graph preserves the path from source to variation.`,kind:`image`,src:x,fit:`cover`},"selection-still":{id:`selection-still`,eyebrow:`Selection + direction`,title:`Choose exactly where the work continues.`,description:`Inspect, select, and turn the decision into precise context.`,kind:`image`,src:O,fit:`cover`,position:`left`},"reroll-history":{id:`reroll-history`,eyebrow:`Attempt history`,title:`Ask for another pass without losing the first.`,description:`The new attempt returns without replacing earlier work.`,kind:`video`,src:A,poster:b,fit:`cover`}},N=u(),P=[`npm install -g @mean-weasel/lineage@latest`,`lineage-channel install stable`,`lineage-stable runtime doctor --json`,`lineage-stable profile init --profile team-production --confirm-write --json`,`lineage-stable runtime doctor --json`,`lineage-stable profile doctor --profile team-production --json`,`lineage-stable db info --profile team-production --json`,`lineage-stable start --profile team-production`].join(` &&
2
- `),F=`${`/lineage/`.replace(/\/$/,``)}/docs/`;function I(){let[e,t]=(0,g.useState)(!1);async function n(){try{await navigator.clipboard.writeText(P),t(!0),window.setTimeout(()=>t(!1),1800)}catch{t(!1)}}return(0,N.jsxs)(`div`,{className:`landing-shell`,children:[(0,N.jsxs)(`header`,{className:`landing-nav`,children:[(0,N.jsxs)(`a`,{"aria-label":`Lineage home`,className:`landing-brand`,href:`#top`,children:[(0,N.jsxs)(`span`,{"aria-hidden":`true`,className:`landing-brand-mark`,children:[(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{})]}),(0,N.jsx)(`span`,{children:`LINEAGE`})]}),(0,N.jsxs)(`nav`,{"aria-label":`Landing page`,children:[(0,N.jsx)(`a`,{href:`#loop`,children:`How it works`}),(0,N.jsx)(`a`,{href:`#features`,children:`What it enables`}),(0,N.jsx)(`a`,{href:F,children:`Documentation`}),(0,N.jsx)(`a`,{href:`#install`,children:`Install`})]}),(0,N.jsxs)(`a`,{className:`nav-cta`,href:`https://github.com/mean-weasel/lineage`,rel:`noreferrer`,target:`_blank`,children:[`View on GitHub `,(0,N.jsx)(d,{"aria-hidden":`true`,size:16})]})]}),(0,N.jsxs)(`main`,{id:`top`,children:[(0,N.jsxs)(`section`,{className:`hero-section`,children:[(0,N.jsxs)(`div`,{className:`hero-grid`,"aria-hidden":`true`,children:[(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{})]}),(0,N.jsxs)(`div`,{className:`hero-copy`,children:[(0,N.jsxs)(`p`,{className:`section-index`,children:[(0,N.jsx)(`span`,{children:`01`}),` Human × agent creative work`]}),(0,N.jsx)(`h1`,{children:`The UX where humans and agents shape visual work together.`}),(0,N.jsx)(`p`,{className:`hero-summary`,children:`Lineage is the shared visual workspace where humans and agents create, review, and evolve creative assets together.`}),(0,N.jsxs)(`div`,{className:`hero-actions`,children:[(0,N.jsxs)(`a`,{className:`primary-cta`,href:`#loop`,children:[`See the collaboration loop `,(0,N.jsx)(l,{"aria-hidden":`true`,size:18})]}),(0,N.jsx)(`a`,{className:`text-cta`,href:`#install`,children:`Install Lineage`})]})]}),(0,N.jsx)(`div`,{className:`hero-media-wrap`,children:(0,N.jsx)(L,{})})]}),(0,N.jsxs)(`section`,{className:`loop-section`,id:`loop`,children:[(0,N.jsxs)(`div`,{className:`loop-heading`,children:[(0,N.jsxs)(`p`,{className:`section-index`,children:[(0,N.jsx)(`span`,{children:`02`}),` Context travels both ways`]}),(0,N.jsx)(`h2`,{children:`One creative state for humans and agents.`}),(0,N.jsxs)(`div`,{className:`loop-copy`,children:[(0,N.jsx)(`p`,{className:`loop-problem`,children:`Chat is the right UX for directing agent-driven creative work. But it isn’t built to hold the state of that work.`}),(0,N.jsx)(`p`,{children:`Lineage preserves every asset, path, prompt, relationship, and decision in a shared record—precise enough for agents to retrieve through the CLI and organized visually for humans to review and direct.`})]})]}),(0,N.jsxs)(`div`,{className:`interface-grid`,children:[(0,N.jsxs)(`article`,{className:`interface-card agent-card`,children:[(0,N.jsx)(`div`,{className:`interface-number`,children:`A`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`card-eyebrow`,children:`For agents`}),(0,N.jsx)(`h3`,{children:`Never lose the state behind the work.`}),(0,N.jsx)(`p`,{children:`Every asset, path, prompt, iteration, and relationship stays available so the work can continue accurately.`})]}),(0,N.jsx)(R,{definition:M[`agent-to-canvas`],showCaption:!0})]}),(0,N.jsxs)(`div`,{className:`loop-bridge`,"aria-label":`Assets, context, selections, and annotations move through one creative state`,children:[(0,N.jsx)(`span`,{children:`Assets + context`}),(0,N.jsx)(`div`,{className:`bridge-line`,children:(0,N.jsx)(l,{"aria-hidden":`true`,size:18})}),(0,N.jsxs)(`strong`,{children:[`ONE CREATIVE`,(0,N.jsx)(`br`,{}),`STATE`]}),(0,N.jsx)(`div`,{className:`bridge-line reverse`,children:(0,N.jsx)(l,{"aria-hidden":`true`,size:18})}),(0,N.jsx)(`span`,{children:`Selections + annotations`})]}),(0,N.jsxs)(`article`,{className:`interface-card human-card`,children:[(0,N.jsx)(`div`,{className:`interface-number`,children:`H`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`card-eyebrow`,children:`For humans`}),(0,N.jsx)(`h3`,{children:`Keep your creative history organized.`}),(0,N.jsx)(`p`,{children:`Review and compare the history, then use selections and annotations to direct the next iteration.`})]}),(0,N.jsx)(R,{definition:M[`human-to-agent`],showCaption:!0})]})]})]}),(0,N.jsxs)(`section`,{className:`features-section`,id:`features`,children:[(0,N.jsxs)(`div`,{className:`features-heading`,children:[(0,N.jsxs)(`p`,{className:`section-index`,children:[(0,N.jsx)(`span`,{children:`03`}),` What it enables`]}),(0,N.jsx)(`h2`,{children:`A shared creative history you and your agents can build on.`}),(0,N.jsx)(`p`,{children:`Keep the useful context behind every asset available, understandable, and ready for the next human or agent action.`})]}),(0,N.jsxs)(`div`,{className:`feature-grid`,children:[(0,N.jsx)(B,{icon:(0,N.jsx)(p,{}),media:M[`trace-tree`],number:`01`,title:`Trace every iteration`,children:`Follow an asset from its origin through branches, selections, and final campaign formats.`}),(0,N.jsx)(B,{icon:(0,N.jsx)(m,{}),media:M[`selection-still`],number:`02`,title:`Continue from the exact asset`,children:`Select any useful point in the lineage and bring that context into the next agent session.`}),(0,N.jsx)(B,{icon:(0,N.jsx)(a,{}),media:M[`reroll-history`],number:`03`,title:`Keep every agent attempt tied to your decisions`,children:`Review another pass without losing earlier results, prompts, relationships, or human direction.`})]}),(0,N.jsxs)(`div`,{className:`final-cta`,id:`install`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`p`,{className:`section-index`,children:[(0,N.jsx)(`span`,{children:`→`}),` Local-first and agent-ready`]}),(0,N.jsx)(`h3`,{children:`One durable home for visual work made with your agents.`})]}),(0,N.jsxs)(`div`,{className:`install-panel`,children:[(0,N.jsxs)(`div`,{className:`install-command`,children:[(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`$`}),(0,N.jsx)(`pre`,{children:(0,N.jsx)(`code`,{children:P})}),(0,N.jsxs)(`button`,{"aria-label":`Copy first-run commands`,onClick:()=>void n(),type:`button`,children:[e?(0,N.jsx)(f,{"aria-hidden":`true`,size:18}):(0,N.jsx)(r,{"aria-hidden":`true`,size:18}),e?`Copied`:`Copy first-run commands`]})]}),(0,N.jsxs)(`a`,{className:`install-guide-link`,href:`https://github.com/mean-weasel/lineage#first-run`,rel:`noreferrer`,target:`_blank`,children:[`Read the complete first-run guide `,(0,N.jsx)(d,{"aria-hidden":`true`,size:15})]}),(0,N.jsxs)(`a`,{className:`install-guide-link`,href:F,children:[`Browse Lineage documentation `,(0,N.jsx)(d,{"aria-hidden":`true`,size:15})]}),(0,N.jsxs)(`div`,{className:`install-meta`,children:[(0,N.jsx)(`span`,{children:`Local-first`}),(0,N.jsx)(`span`,{children:`MIT licensed`}),(0,N.jsx)(`span`,{children:`Codex plugin`}),(0,N.jsx)(`span`,{children:`CLI access`})]}),(0,N.jsxs)(`a`,{className:`primary-cta dark`,href:`https://github.com/mean-weasel/lineage`,rel:`noreferrer`,target:`_blank`,children:[`Explore Lineage on GitHub `,(0,N.jsx)(d,{"aria-hidden":`true`,size:18})]})]})]})]})]}),(0,N.jsxs)(`footer`,{children:[(0,N.jsxs)(`a`,{className:`landing-brand`,href:`#top`,children:[(0,N.jsxs)(`span`,{"aria-hidden":`true`,className:`landing-brand-mark`,children:[(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{})]}),(0,N.jsx)(`span`,{children:`LINEAGE`})]}),(0,N.jsx)(`p`,{children:`The shared visual workspace for humans and agents.`}),(0,N.jsxs)(`a`,{href:`https://github.com/mean-weasel/lineage`,rel:`noreferrer`,target:`_blank`,children:[`GitHub `,(0,N.jsx)(d,{"aria-hidden":`true`,size:14})]})]})]})}function L(){let t=(0,g.useRef)(null),[n,r]=(0,g.useState)(0),[i,a]=(0,g.useState)(!0),[s,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(!1),[m,_]=(0,g.useState)(()=>typeof document>`u`||document.visibilityState===`visible`),[v,y]=(0,g.useState)(!1),[b,x]=(0,g.useState)(null),S=j[n],C=b?j[b.fromIndex]:null,w=b?.direction===1?`next`:`previous`,T=i&&!s&&!u&&f&&m&&!v&&!b;(0,g.useEffect)(()=>{let e=t.current;if(!e)return;if(!(`IntersectionObserver`in window)){p(!0);return}let n=new IntersectionObserver(([e])=>{p(!!(e&&e.intersectionRatio>=.35))},{threshold:.35});return n.observe(e),()=>n.disconnect()},[]),(0,g.useEffect)(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>y(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,g.useEffect)(()=>{let e=()=>_(document.visibilityState===`visible`);return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),(0,g.useEffect)(()=>{if(!T)return;let e=window.setTimeout(()=>{x({direction:1,fromIndex:n,initiatedBy:`automatic`}),r((n+1)%j.length)},15e3);return()=>window.clearTimeout(e)},[n,T]),(0,g.useEffect)(()=>{if(!b)return;let e=window.setTimeout(()=>x(null),700);return()=>window.clearTimeout(e)},[b]);function E(e){D((n+e+j.length)%j.length,e)}function D(e,t){if(!(b||e===n)){if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches){r(e);return}x({direction:t,fromIndex:n,initiatedBy:`manual`}),r(e)}}return(0,N.jsxs)(`div`,{"aria-label":`Lineage product tour`,"aria-roledescription":`carousel`,className:`hero-carousel`,onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||d(!1)},onFocusCapture:()=>d(!0),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`ArrowLeft`&&E(-1),e.key===`ArrowRight`&&E(1))},role:`region`,ref:t,tabIndex:0,children:[(0,N.jsx)(`div`,{className:`hero-carousel-media-viewport`,children:(0,N.jsxs)(`div`,{className:`hero-carousel-media-track ${b?`carousel-track-${w}`:``}`,onAnimationEnd:e=>{e.currentTarget===e.target&&x(null)},children:[b?.direction===-1&&(0,N.jsx)(`div`,{className:`hero-carousel-media-slide`,children:(0,N.jsx)(R,{definition:S,hero:!0})},S.id),(0,N.jsx)(`div`,{"aria-hidden":C?`true`:void 0,className:`hero-carousel-media-slide`,children:(0,N.jsx)(R,{definition:C??S,hero:!0,showPlaybackControl:!C})},(C??S).id),b?.direction===1&&(0,N.jsx)(`div`,{className:`hero-carousel-media-slide`,children:(0,N.jsx)(R,{definition:S,hero:!0})},S.id)]})}),(0,N.jsxs)(`div`,{"aria-live":T||b?.initiatedBy===`automatic`?`off`:`polite`,className:`hero-carousel-caption-viewport`,children:[C&&(0,N.jsxs)(`div`,{"aria-hidden":`true`,className:`hero-carousel-caption carousel-caption-exit carousel-${w}`,children:[(0,N.jsx)(`span`,{className:`media-eyebrow`,children:C.eyebrow}),(0,N.jsx)(`strong`,{children:C.title}),(0,N.jsx)(`small`,{children:C.description})]},C.id),(0,N.jsxs)(`div`,{className:`hero-carousel-caption ${b?`carousel-caption-enter carousel-${w}`:``}`,children:[(0,N.jsx)(`span`,{className:`media-eyebrow`,children:S.eyebrow}),(0,N.jsx)(`strong`,{children:S.title}),(0,N.jsx)(`small`,{children:S.description})]},S.id)]}),(0,N.jsxs)(`div`,{className:`hero-carousel-controls`,children:[(0,N.jsx)(`button`,{"aria-label":`Previous carousel slide`,onClick:()=>E(-1),type:`button`,children:(0,N.jsx)(o,{"aria-hidden":`true`,size:19})}),(0,N.jsxs)(`div`,{className:`carousel-center-controls`,children:[(0,N.jsx)(`button`,{"aria-label":i?`Pause carousel rotation`:`Resume carousel rotation`,className:`carousel-autoplay-toggle`,onClick:()=>a(e=>!e),type:`button`,children:i?(0,N.jsx)(h,{"aria-hidden":`true`,size:13}):(0,N.jsx)(c,{"aria-hidden":`true`,size:13})}),(0,N.jsx)(`div`,{"aria-label":`Slide ${n+1} of ${j.length}`,className:`carousel-progress`,children:j.map((e,t)=>(0,N.jsx)(`button`,{"aria-current":t===n?`true`:void 0,"aria-label":`Show slide ${t+1}: ${e.title}`,className:t===n?`active`:``,onClick:()=>D(t,t>n?1:-1),type:`button`},e.id))})]}),(0,N.jsx)(`button`,{"aria-label":`Next carousel slide`,onClick:()=>E(1),type:`button`,children:(0,N.jsx)(e,{"aria-hidden":`true`,size:19})})]})]})}function R({definition:e,hero:t=!1,showCaption:n=!1,showPlaybackControl:r=!0}){return(0,N.jsxs)(`figure`,{className:`media-slot media-slot-ready ${`media-fit-${e.fit??`cover`}`} ${e.position===`left`?`media-position-left`:``} ${t?`media-slot-hero`:``}`,"data-media-slot":e.id,children:[e.kind===`video`?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(z,{definition:e,showPlaybackControl:r}),e.poster&&(0,N.jsx)(`img`,{alt:``,"aria-hidden":`true`,className:`reduced-motion-poster`,src:e.poster})]}):(0,N.jsx)(`img`,{alt:e.description,loading:`lazy`,src:e.src}),n&&(0,N.jsxs)(`figcaption`,{"aria-live":t?`polite`:void 0,children:[(0,N.jsx)(`span`,{className:`media-eyebrow`,children:e.eyebrow}),(0,N.jsx)(`strong`,{children:e.title}),(0,N.jsx)(`small`,{children:e.description})]})]})}function z({definition:e,showPlaybackControl:t}){let n=(0,g.useRef)(null),[r,i]=(0,g.useState)(!1),[a,o]=(0,g.useState)(!1);(0,g.useEffect)(()=>{let e=n.current;if(!e||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;if(a){e.pause();return}if(!(`IntersectionObserver`in window)){e.play().catch(()=>void 0);return}let t=new IntersectionObserver(([t])=>{t?.isIntersecting?e.play().catch(()=>void 0):e.pause()},{threshold:.45});return t.observe(e),()=>{t.disconnect(),e.pause()}},[e.src,a]);function s(){let e=n.current;e&&(e.paused?(o(!1),e.play().catch(()=>void 0)):(o(!0),e.pause()))}return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`video`,{"aria-label":e.description,loop:!0,muted:!0,onPause:()=>i(!1),onPlay:()=>i(!0),playsInline:!0,poster:e.poster,preload:`metadata`,ref:n,src:e.src}),t&&(0,N.jsx)(`button`,{"aria-label":`${r?`Pause`:`Play`} ${e.title}`,className:`video-toggle`,onClick:s,type:`button`,children:r?(0,N.jsx)(h,{"aria-hidden":`true`,size:16}):(0,N.jsx)(c,{"aria-hidden":`true`,fill:`currentColor`,size:16})})]})}function B({children:e,icon:t,media:n,number:r,title:i}){return(0,N.jsxs)(`article`,{className:`feature-card`,children:[(0,N.jsxs)(`div`,{className:`feature-top`,children:[(0,N.jsx)(`span`,{children:r}),t]}),(0,N.jsx)(`h3`,{children:i}),(0,N.jsx)(`p`,{children:e}),(0,N.jsx)(`div`,{className:`feature-media`,children:(0,N.jsx)(R,{definition:n})})]})}(0,_.createRoot)(document.getElementById(`landing-root`)).render((0,N.jsx)(g.StrictMode,{children:(0,N.jsx)(I,{})}));