Files
kandev/apps/web/components/state-hydrator.tsx
T
João Salavisa 7e43534cd2 refactor: remove auggie-specific code and use standard ACP protocol (#47)
- Remove ProtocolAuggie constant and AuggieAdapter
- Remove hooks system (HooksRegistry, AgentHooks, AuggieHooks)
- Remove PreGeneratedSessionID and SessionDir fields
- Change auggie-agent to use standard 'acp' protocol in agents.json
- Add model select dropdown to profile settings page
- Fix unused variable lint warnings

Auggie now uses the standard ACP protocol flow like other agents.
The --resume flag was found to not work in ACP mode, so the
workaround was unnecessary since session/new returns valid session IDs.
2026-01-19 22:41:00 +00:00

25 lines
711 B
TypeScript

'use client';
import { useLayoutEffect } from 'react';
import type { AppState } from '@/lib/state/store';
import { useAppStoreApi } from '@/components/state-provider';
type StateHydratorProps = {
initialState: Partial<AppState>;
};
export function StateHydrator({ initialState }: StateHydratorProps) {
const store = useAppStoreApi();
// Use useLayoutEffect to hydrate state synchronously before child effects run.
// This ensures SSR-hydrated data is available before hooks like useSettingsData
// decide whether to fetch data.
useLayoutEffect(() => {
if (Object.keys(initialState).length) {
store.getState().hydrate(initialState);
}
}, [initialState, store]);
return null;
}