Power Configuration
Understand the boundary between unique Power instances, City-level configuration, and execution context.
Each Power ID has exactly one host configuration inside a City:
host stores Power Config
→ City owns one Power instance
→ City projects a configuration snapshot for each execution
→ Power reads the current PowerContext.configconst city = new City({
powers: [web_power],
workspaces: [workspace],
power_host: {
config: (power_id) => open_power_config_store(power_id),
notifications: (power_id, agent_id) => open_notifications(power_id, agent_id),
},
});
city.agents.add(agent);PowerConfigStore.get() synchronously returns the complete current snapshot, while set(config)
atomically replaces it. Agents store neither Power references nor configuration; every Agent sees the
same Power configuration. A Power that needs multiple accounts or tenants models them inside its own
Config instead of relying on a generic City named-configuration layer.
A Power registers Config actions during initialize(). City injects the Power's unique get/set
store when city.powers.invoke_config() calls one. Actions, Hooks, System providers, and Availability
checks read an immutable snapshot from the current PowerContext.config.
After a Config save, the Power should release or refresh affected long-lived resources. Never store
connections, callbacks, or client objects in Config. The Power still owns them by an actual domain key,
such as an account or Agent, and ultimately releases them in dispose().