import { K as createState, af as initializeStateSecrets } from './src-CidJbygh.js';

//#region src/lib/server/state.ts
/**
* Singleton control plane state — shared across all SvelteKit server routes.
*
* Initialized once on server start. All API endpoints operate on this
* shared state instance.
*/
var _state = null;
function getState() {
	if (!_state) {
		_state = createState();
		initializeStateSecrets(_state);
	}
	return _state;
}
/**
* Bust the singleton so the next getState() call re-reads from disk.
* Called after performSetup() writes new tokens to stack.env.
*/
function resetState() {
	_state = null;
}

export { getState as g, resetState as r };
//# sourceMappingURL=state-fxN45gBp.js.map
