feat(daemon): wire PairingStore from SessionStore into PairingManager
This commit is contained in:
+2
-1
@@ -101,7 +101,8 @@ export async function startDaemon(config: Config): Promise<DaemonContext> {
|
|||||||
|
|
||||||
// ── Gateway & Channels ──
|
// ── Gateway & Channels ──
|
||||||
const channelRegistry = new ChannelRegistry();
|
const channelRegistry = new ChannelRegistry();
|
||||||
const pairingManager = initPairingManager(config);
|
const pairingStore = config.pairing.enabled ? sessionStore.getPairingStore() : undefined;
|
||||||
|
const pairingManager = initPairingManager(config, pairingStore);
|
||||||
|
|
||||||
let channelAgents: ReturnType<typeof createMessageRouter>['agents'] | null = null;
|
let channelAgents: ReturnType<typeof createMessageRouter>['agents'] | null = null;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import type { OutboundAttachmentCollector } from '../backends/native/attachments
|
|||||||
import { ModelRouter } from '../models/index.js';
|
import { ModelRouter } from '../models/index.js';
|
||||||
import { SessionManager } from '../session/index.js';
|
import { SessionManager } from '../session/index.js';
|
||||||
import { GatewayServer } from '../gateway/index.js';
|
import { GatewayServer } from '../gateway/index.js';
|
||||||
import { ChannelRegistry, PairingManager } from '../channels/index.js';
|
import { ChannelRegistry, PairingManager, type PairingStore } from '../channels/index.js';
|
||||||
import { HeartbeatMonitor } from '../automation/index.js';
|
import { HeartbeatMonitor } from '../automation/index.js';
|
||||||
import { McpManager } from '../mcp/index.js';
|
import { McpManager } from '../mcp/index.js';
|
||||||
import { SkillRegistry, SkillInstaller, loadAllSkills } from '../skills/index.js';
|
import { SkillRegistry, SkillInstaller, loadAllSkills } from '../skills/index.js';
|
||||||
@@ -91,7 +91,7 @@ export function loadSystemPrompt(config: Config, skillRegistry: SkillRegistry):
|
|||||||
|
|
||||||
// ── Pairing Manager ─────────────────────────────────────────────
|
// ── Pairing Manager ─────────────────────────────────────────────
|
||||||
|
|
||||||
export function initPairingManager(config: Config): PairingManager | undefined {
|
export function initPairingManager(config: Config, store?: PairingStore): PairingManager | undefined {
|
||||||
if (!config.pairing.enabled) return undefined;
|
if (!config.pairing.enabled) return undefined;
|
||||||
|
|
||||||
const ttlMatch = config.pairing.code_ttl.match(/^(\d+)(s|m|h)$/);
|
const ttlMatch = config.pairing.code_ttl.match(/^(\d+)(s|m|h)$/);
|
||||||
@@ -103,7 +103,7 @@ export function initPairingManager(config: Config): PairingManager | undefined {
|
|||||||
enabled: true,
|
enabled: true,
|
||||||
codeTtl: codeTtlMs,
|
codeTtl: codeTtlMs,
|
||||||
codeLength: config.pairing.code_length,
|
codeLength: config.pairing.code_length,
|
||||||
});
|
}, store);
|
||||||
console.log(`Pairing codes enabled (TTL: ${config.pairing.code_ttl}, length: ${config.pairing.code_length})`);
|
console.log(`Pairing codes enabled (TTL: ${config.pairing.code_ttl}, length: ${config.pairing.code_length})`);
|
||||||
return manager;
|
return manager;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user