MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / getAutoRoutingMode

Function getAutoRoutingMode

services/auto-routing/src/routing-mode.ts:60–77  ·  view source on GitHub ↗
(
  env: AutoRoutingModeEnv,
  owner: { userId: string; organizationId: string | null }
)

Source from the content-addressed store, hash-verified

58 await this.ctx.storage.put(POOL_STORAGE_KEY, pool);
59 }
60
61 async getSettings(): Promise<AutoRoutingOwnerSettings> {
62 const [mode, pool] = await Promise.all([this.getMode(), this.getPool()]);
63 return { mode, pool };
64 }
65
66 async setSettings(settings: AutoRoutingOwnerSettings): Promise<void> {
67 // Mode and pool commit or fail together in one storage transaction.
68 // setMode/setPool stay single-key for individual callers.
69 const toPut: Record<string, unknown> = {};
70 const toDelete: string[] = [];
71 if (settings.mode === null) {
72 toDelete.push(MODE_STORAGE_KEY);
73 } else {
74 toPut[MODE_STORAGE_KEY] = settings.mode;
75 }
76 if (settings.pool === null) {
77 toDelete.push(POOL_STORAGE_KEY);
78 } else {
79 toPut[POOL_STORAGE_KEY] = settings.pool;
80 }

Callers 2

decideHandlerFunction · 0.90

Calls 1

Tested by

no test coverage detected