/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */ import type { RuntimeEventBus } from '../events/index.js'; import type { ConfigEventValue } from '../../../events/config.js'; /** * The narrow config surface this needs: one subscription per key, and nothing * else. Structural so a test supplies four lines instead of a whole manager. */ export interface ConfigChangeSource { subscribe(key: string, callback: (newValue: unknown, previousValue: unknown) => void): () => void; } export interface ConfigEmitBridgeDeps { /** The live ConfigManager, only its per-key subscription is used. */ readonly config: ConfigChangeSource; /** The runtime event bus the config events are emitted onto. */ readonly bus: Pick; /** * Extra config paths a product knows about that the platform set does not * name. Merged with the platform set; duplicates are collapsed. */ readonly additionalKeys?: readonly string[] | undefined; /** * Trace id source for the emitted envelopes. A settings change is not born of * a single caller turn, so absent a real trace a fresh id per event is honest * (default). Injected in tests for determinism. */ readonly traceId?: (() => string) | undefined; /** Clock seam for `changedAt`; injected in tests. */ readonly now?: (() => number) | undefined; } /** * Every config path this bridge watches: the declared scalar schema keys, the * daemon-owned non-scalar paths, and the declared secret-bearing paths. */ export declare function listWatchableConfigPaths(additionalKeys?: readonly string[]): readonly string[]; /** * A config value in the JSON shape the wire carries, or undefined when it is * not representable. * * A value that cannot survive a JSON round trip (a function, a class instance, * a cyclic object) is dropped rather than coerced into something that reads as * the setting: an event saying `value: "[object Object]"` is worse than one * saying only that the key changed, and the subscriber's fallback, re-read the * key, is correct in both cases. */ export declare function toConfigEventValue(value: unknown): ConfigEventValue | undefined; /** * Attach the bridge. Returns a function that detaches every subscription. * * Safe to call once at composition time. Detaching matters: the subscriptions * are held by the ConfigManager, so a bridge that outlived its bus would keep * emitting into a torn-down graph, the same reason the push event sources are * registered with the disposal registry. */ export declare function attachConfigEmitBridge(deps: ConfigEmitBridgeDeps): () => void; //# sourceMappingURL=emit-bridge.d.ts.map