feat(FN-1400): add getPluginStore() lazy getter to TaskStore

- Add PluginStore lazy getter to TaskStore class
- Update memory documentation with plugin foundation learnings
This commit is contained in:
gsxdsm
2026-04-09 15:50:57 -07:00
parent 8f50526158
commit 7db168d5d7
2 changed files with 48 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import { GlobalSettingsStore } from "./global-settings.js";
import { Database, toJson, toJsonNullable, fromJson } from "./db.js";
import { detectLegacyData, migrateFromLegacy } from "./db-migrate.js";
import { MissionStore } from "./mission-store.js";
import { PluginStore } from "./plugin-store.js";
import { BackwardCompat, ProjectRequiredError } from "./migration.js";
import { CentralCore } from "./central-core.js";
import { getTaskMergeBlocker } from "./task-merge.js";
@@ -95,6 +96,8 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
}
/** Cached MissionStore instance */
private missionStore: MissionStore | null = null;
/** Cached PluginStore instance */
private pluginStore: PluginStore | null = null;
constructor(private rootDir: string, globalSettingsDir?: string) {
super();
@@ -3890,6 +3893,17 @@ ${notificationsSection}`;
return this.missionStore;
}
/**
* Get the PluginStore instance for plugin registry operations.
* Lazily initializes the PluginStore on first access.
*/
getPluginStore(): PluginStore {
if (!this.pluginStore) {
this.pluginStore = new PluginStore(this.rootDir);
}
return this.pluginStore;
}
// ── Backward Compatibility (Multi-Project Support) ────────────────────────
}