7e43534cd2
- 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.
25 lines
711 B
TypeScript
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;
|
|
}
|