feat(web): ask before sending analytics, drop team screens, hide v1-absent memory features (P1.3a)
- Analytics are opt-in (decision Q7, ADR-0006). PostHog does not start or capture anything until the user clicks Allow in a first-run dialog that says what is sent. Escape or closing stores nothing and asks again. The existing Privacy & Telemetry toggle in Settings withdraws consent at once. Builds without VITE_POSTHOG_KEY show no dialog and send nothing. - Remove the remaining upsell copy: the /team page with its per-seat price, Stripe and Teams wording in the erase-data dialog, Teams/Enterprise hints. - Remove team screens (decision Q3): Waggle Dance, team presence in chat, team storage and sharing in workspace creation, storage and files. - Hide memory features that are not in v1 (decision Q2) behind one map in lib/memory-features.ts: the knowledge graph, import history, wiki, agent memory hooks and Room launches. The map is the seam P1.5 fills from the memory store's capabilities. - Say Windows, macOS and Linux instead of "Linux soon". - Update the e2e specs for the removed and hidden screens. Also logs UF-029: the Settings "Import Data" button has no handler.
This commit is contained in:
@@ -21,7 +21,7 @@ import type {
|
||||
AgentStep, Session, SkillPack, FleetSession, CronJob,
|
||||
Notification, AgentStatus, Persona, SystemHealth,
|
||||
Settings, StreamEvent, KGNode, KGEdge,
|
||||
ModelPricing, WaggleSignal, FileEntry, WorkspaceTemplate,
|
||||
ModelPricing, FileEntry, WorkspaceTemplate,
|
||||
TimelineEvent,
|
||||
HomeBriefing, OvernightSummary, QuickCaptureInput,
|
||||
WorkspaceStateView, WorkspaceActivityEvent, WorkspaceTask,
|
||||
@@ -3270,24 +3270,6 @@ class LocalAdapter {
|
||||
},
|
||||
};
|
||||
|
||||
// --- Waggle Dance ---
|
||||
async getWaggleSignals(): Promise<WaggleSignal[]> {
|
||||
try {
|
||||
const res = await this.fetch('/api/waggle/signals');
|
||||
if (!res.ok) return [];
|
||||
return unwrapArray(await res.json());
|
||||
} catch (err) { console.error('[adapter] getWaggleSignals failed:', err); return []; }
|
||||
}
|
||||
|
||||
async publishWaggleSignal(data: Omit<WaggleSignal, 'id' | 'timestamp'>): Promise<WaggleSignal> {
|
||||
const res = await this.fetch('/api/waggle/signals', { method: 'POST', body: JSON.stringify(data) });
|
||||
return res.json();
|
||||
}
|
||||
|
||||
async acknowledgeWaggleSignal(id: string): Promise<void> {
|
||||
await this.fetch(`/api/waggle/signals/${id}/ack`, { method: 'PATCH' });
|
||||
}
|
||||
|
||||
// --- AI-OS launcher (Phase 2B) ---
|
||||
// detectTools/launchTool/manageHooks each surface the matching
|
||||
// sidecar route. All are loopback-only and report only the user's
|
||||
@@ -3442,12 +3424,6 @@ class LocalAdapter {
|
||||
};
|
||||
}
|
||||
|
||||
subscribeWaggleDance(onSignal: (signal: WaggleSignal) => void): () => void {
|
||||
// Server emits NAMED `event: signal` events (waggle-signals.ts:103); its
|
||||
// `event: connected` handshake is equally named and equally ignored here.
|
||||
return this.subscribeSSE('/api/waggle/stream', (data) => onSignal(data as WaggleSignal), 'signal');
|
||||
}
|
||||
|
||||
/**
|
||||
* P1b-SSE: shared EventSource lifecycle — token-attached, lazy-open,
|
||||
* reconnecting. Fixes the three defects that made every stream dead in
|
||||
@@ -3542,16 +3518,13 @@ class LocalAdapter {
|
||||
|
||||
/**
|
||||
* P1b-SSE review fix: FAN-OUT, not replace. One ref-counted stream per
|
||||
* (path, eventName); concurrent subscribers share it (AppShell's
|
||||
* always-mounted waggle badge + the WaggleDance screen both consume
|
||||
* /api/waggle/stream — the old replace-on-resubscribe dedup let the second
|
||||
* mount permanently kill the first's stream). The socket closes only when
|
||||
* the last subscriber leaves.
|
||||
* (path, eventName); concurrent subscribers share it (the old
|
||||
* replace-on-resubscribe dedup let a second mount permanently kill the
|
||||
* first's stream). The socket closes only when the last subscriber leaves.
|
||||
*
|
||||
* `eventName` selects NAMED SSE events (review fix: the events/waggle
|
||||
* routes emit `event: audit` / `event: signal`, which `onmessage` never
|
||||
* receives per the SSE spec — both channels were payload-dead even with
|
||||
* working auth).
|
||||
* `eventName` selects NAMED SSE events (review fix: the events route emits
|
||||
* `event: audit`, which `onmessage` never receives per the SSE spec — the
|
||||
* channel was payload-dead even with working auth).
|
||||
*/
|
||||
private subscribeSSE(path: string, onData: (data: unknown) => void, eventName?: string): () => void {
|
||||
const key = `${path}#${eventName ?? 'message'}`;
|
||||
|
||||
Reference in New Issue
Block a user