feat(departments): construct DepartmentManager in the shared kernel
This commit is contained in:
parent
1004511d25
commit
cde027d330
|
|
@ -20,7 +20,7 @@
|
||||||
*/
|
*/
|
||||||
import { join, resolve } from 'node:path';
|
import { join, resolve } from 'node:path';
|
||||||
import { CloudClient } from "./api.js";
|
import { CloudClient } from "./api.js";
|
||||||
import { LocalMemoryManager, LocalMemoryRemote } from "./local-memory/index.js";
|
import { DepartmentManager, LocalMemoryManager, LocalMemoryRemote } from "./local-memory/index.js";
|
||||||
import { VERSION } from "./version.js";
|
import { VERSION } from "./version.js";
|
||||||
import { createCloudMemoryRemoteFactory } from "./cloudsync.js";
|
import { createCloudMemoryRemoteFactory } from "./cloudsync.js";
|
||||||
import { ClientRegistry } from "./clients.js";
|
import { ClientRegistry } from "./clients.js";
|
||||||
|
|
@ -59,6 +59,7 @@ export class BrainKernel {
|
||||||
memoryRemoteFactory;
|
memoryRemoteFactory;
|
||||||
localMemory;
|
localMemory;
|
||||||
localMemoryRemote;
|
localMemoryRemote;
|
||||||
|
departments;
|
||||||
reporter;
|
reporter;
|
||||||
skillAdmin;
|
skillAdmin;
|
||||||
skillRepository;
|
skillRepository;
|
||||||
|
|
@ -99,6 +100,7 @@ export class BrainKernel {
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
this.localMemoryRemote = new LocalMemoryRemote(this.localMemory);
|
this.localMemoryRemote = new LocalMemoryRemote(this.localMemory);
|
||||||
|
this.departments = new DepartmentManager({ memory: this.localMemory });
|
||||||
// The global space is part of first boot; project space stays lazy until
|
// The global space is part of first boot; project space stays lazy until
|
||||||
// the first memory use in that project.
|
// the first memory use in that project.
|
||||||
if (settings().localMemoryEnabled !== false && settings().autoMemorySpaces !== false)
|
if (settings().localMemoryEnabled !== false && settings().autoMemorySpaces !== false)
|
||||||
|
|
@ -273,6 +275,7 @@ export class BrainKernel {
|
||||||
clients: skills ? this.clients : undefined,
|
clients: skills ? this.clients : undefined,
|
||||||
mcp: this.isActive('mcp'),
|
mcp: this.isActive('mcp'),
|
||||||
localMemory: this.localMemory,
|
localMemory: this.localMemory,
|
||||||
|
departments: this.departments,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
*/
|
*/
|
||||||
import { join, resolve } from 'node:path'
|
import { join, resolve } from 'node:path'
|
||||||
import { CloudClient } from './api.ts'
|
import { CloudClient } from './api.ts'
|
||||||
import { LocalMemoryManager, LocalMemoryRemote } from './local-memory/index.ts'
|
import { DepartmentManager, LocalMemoryManager, LocalMemoryRemote } from './local-memory/index.ts'
|
||||||
import { VERSION } from './version.ts'
|
import { VERSION } from './version.ts'
|
||||||
import { createCloudMemoryRemoteFactory } from './cloudsync.ts'
|
import { createCloudMemoryRemoteFactory } from './cloudsync.ts'
|
||||||
import { ClientRegistry } from './clients.ts'
|
import { ClientRegistry } from './clients.ts'
|
||||||
|
|
@ -72,6 +72,7 @@ export class BrainKernel {
|
||||||
readonly memoryRemoteFactory: ReturnType<typeof createCloudMemoryRemoteFactory>
|
readonly memoryRemoteFactory: ReturnType<typeof createCloudMemoryRemoteFactory>
|
||||||
readonly localMemory: LocalMemoryManager
|
readonly localMemory: LocalMemoryManager
|
||||||
readonly localMemoryRemote: LocalMemoryRemote
|
readonly localMemoryRemote: LocalMemoryRemote
|
||||||
|
readonly departments: DepartmentManager
|
||||||
readonly reporter: Reporter
|
readonly reporter: Reporter
|
||||||
readonly skillAdmin: SkillAdmin
|
readonly skillAdmin: SkillAdmin
|
||||||
readonly skillRepository: AdminSkillRepository
|
readonly skillRepository: AdminSkillRepository
|
||||||
|
|
@ -116,6 +117,7 @@ export class BrainKernel {
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
this.localMemoryRemote = new LocalMemoryRemote(this.localMemory)
|
this.localMemoryRemote = new LocalMemoryRemote(this.localMemory)
|
||||||
|
this.departments = new DepartmentManager({ memory: this.localMemory })
|
||||||
// The global space is part of first boot; project space stays lazy until
|
// The global space is part of first boot; project space stays lazy until
|
||||||
// the first memory use in that project.
|
// the first memory use in that project.
|
||||||
if (settings().localMemoryEnabled !== false && settings().autoMemorySpaces !== false) void this.localMemory.ensureGlobal().catch((error: unknown) => { logger.warn('dsh-brain local memory initialization failed: ' + (error instanceof Error ? error.message : String(error))) })
|
if (settings().localMemoryEnabled !== false && settings().autoMemorySpaces !== false) void this.localMemory.ensureGlobal().catch((error: unknown) => { logger.warn('dsh-brain local memory initialization failed: ' + (error instanceof Error ? error.message : String(error))) })
|
||||||
|
|
@ -301,6 +303,7 @@ export class BrainKernel {
|
||||||
clients: skills ? this.clients : undefined,
|
clients: skills ? this.clients : undefined,
|
||||||
mcp: this.isActive('mcp'),
|
mcp: this.isActive('mcp'),
|
||||||
localMemory: this.localMemory,
|
localMemory: this.localMemory,
|
||||||
|
departments: this.departments,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import type { Reporter } from './reporter.ts'
|
||||||
import { createSettingsUiRoutes } from './settings-ui/routes.ts'
|
import { createSettingsUiRoutes } from './settings-ui/routes.ts'
|
||||||
import type { CloudMemoryWebRoute } from './context-types.ts'
|
import type { CloudMemoryWebRoute } from './context-types.ts'
|
||||||
import type { LocalMemoryManager } from './local-memory/manager.ts'
|
import type { LocalMemoryManager } from './local-memory/manager.ts'
|
||||||
|
import type { DepartmentManager } from './local-memory/departments/index.ts'
|
||||||
import type { SkillSync, SkillSyncStats } from './skill-sync.ts'
|
import type { SkillSync, SkillSyncStats } from './skill-sync.ts'
|
||||||
import type { SkillAdmin } from './skill-admin.ts'
|
import type { SkillAdmin } from './skill-admin.ts'
|
||||||
import type { SkillGroupManager } from './skill-groups.ts'
|
import type { SkillGroupManager } from './skill-groups.ts'
|
||||||
|
|
@ -79,6 +80,8 @@ export interface RouteDeps {
|
||||||
mcp?: boolean
|
mcp?: boolean
|
||||||
/** Local memory manager, when the memory bundle is available. */
|
/** Local memory manager, when the memory bundle is available. */
|
||||||
localMemory?: LocalMemoryManager
|
localMemory?: LocalMemoryManager
|
||||||
|
/** Department registry (P1.5), when wired in. */
|
||||||
|
departments?: DepartmentManager
|
||||||
}
|
}
|
||||||
|
|
||||||
/** One feature flag the card reads before it renders a control. */
|
/** One feature flag the card reads before it renders a control. */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue