okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
9caf39495
main
1import type { Session , Workspace } from './types' ; 2 3/** The workspace a chat was made in: the sidebar groups chats by this same rule (the saved path, or an earlier folder of the workspace). */ 4export function workspaceIdForSession ( workspaces :Workspace [], session :Pick < Session , 'workspace' > | null | undefined ) :string | null { 5const path = session ?. workspace ; 6if ( ! path ) return null ; 7return workspaces . find ( w => w . path === path || !! w . aliases ?. includes ( path ))?. id ?? null ; 8}