Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
import type { CacheHost } from '@graphql-cache/host/types';
import { type Accessor, createSignal } from 'solid-js';
/** Async project creation must not publish into a replacement viewer or cache. */
export function captureProjectCacheScope(
userId: Accessor<string | undefined>,
cacheHost: () => CacheHost | undefined
) {
const viewer = userId();
const host = cacheHost();
const [valid, setValid] = createSignal(true);
const unsubscribe = host?.onCacheGenerationChanged((change) => {
if (change.storage === 'reset') setValid(false);
});
return {
viewer,
host,
isCurrent: () => valid() && viewer === userId() && host === cacheHost(),
dispose: () => unsubscribe?.(),
};
}