@sanctuary-framework/mcp-server 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -4325,6 +4325,12 @@ interface HubPolicyAndBudgetSources {
4325
4325
  * may persist records to disk or recompute them per call.
4326
4326
  */
4327
4327
  interface HubAgentRegistrySource {
4328
+ /**
4329
+ * Insert or replace a record. Used by wrap-side registration and by
4330
+ * read-side persistence refresh to merge records written after dashboard
4331
+ * boot.
4332
+ */
4333
+ put(record: LocalAgentRecord): void;
4328
4334
  list(filter?: LocalAgentRegistryFilter): LocalAgentRecord[];
4329
4335
  get(agentId: string): LocalAgentRecord | null;
4330
4336
  /**
@@ -4350,6 +4356,12 @@ interface HubServiceDeps {
4350
4356
  fortressId: string;
4351
4357
  /** Local agent registry source. */
4352
4358
  agentRegistry: HubAgentRegistrySource;
4359
+ /**
4360
+ * Optional best-effort persisted agent reader. When supplied, list
4361
+ * operations merge records written after hub construction before
4362
+ * returning the in-memory projection.
4363
+ */
4364
+ readPersistedLocalAgents?: () => LocalAgentRecord[];
4353
4365
  /** Inbox aggregation sources. */
4354
4366
  inboxSources: HubInboxSources;
4355
4367
  /** Activity feed sources. */
@@ -4403,6 +4415,7 @@ declare class HubService {
4403
4415
  constructor(deps: HubServiceDeps);
4404
4416
  private now;
4405
4417
  private nowIso;
4418
+ private refreshPersistedLocalAgents;
4406
4419
  listInbox(): HubInboxItem[];
4407
4420
  resolveInboxItem(itemId: string, action: HubInboxAction): Promise<HubInboxItem>;
4408
4421
  listAgents(filter?: LocalAgentRegistryFilter): LocalAgentRecord[];
package/dist/index.d.ts CHANGED
@@ -4325,6 +4325,12 @@ interface HubPolicyAndBudgetSources {
4325
4325
  * may persist records to disk or recompute them per call.
4326
4326
  */
4327
4327
  interface HubAgentRegistrySource {
4328
+ /**
4329
+ * Insert or replace a record. Used by wrap-side registration and by
4330
+ * read-side persistence refresh to merge records written after dashboard
4331
+ * boot.
4332
+ */
4333
+ put(record: LocalAgentRecord): void;
4328
4334
  list(filter?: LocalAgentRegistryFilter): LocalAgentRecord[];
4329
4335
  get(agentId: string): LocalAgentRecord | null;
4330
4336
  /**
@@ -4350,6 +4356,12 @@ interface HubServiceDeps {
4350
4356
  fortressId: string;
4351
4357
  /** Local agent registry source. */
4352
4358
  agentRegistry: HubAgentRegistrySource;
4359
+ /**
4360
+ * Optional best-effort persisted agent reader. When supplied, list
4361
+ * operations merge records written after hub construction before
4362
+ * returning the in-memory projection.
4363
+ */
4364
+ readPersistedLocalAgents?: () => LocalAgentRecord[];
4353
4365
  /** Inbox aggregation sources. */
4354
4366
  inboxSources: HubInboxSources;
4355
4367
  /** Activity feed sources. */
@@ -4403,6 +4415,7 @@ declare class HubService {
4403
4415
  constructor(deps: HubServiceDeps);
4404
4416
  private now;
4405
4417
  private nowIso;
4418
+ private refreshPersistedLocalAgents;
4406
4419
  listInbox(): HubInboxItem[];
4407
4420
  resolveInboxItem(itemId: string, action: HubInboxAction): Promise<HubInboxItem>;
4408
4421
  listAgents(filter?: LocalAgentRegistryFilter): LocalAgentRecord[];
package/dist/index.js CHANGED
@@ -26871,6 +26871,13 @@ var HubService = class {
26871
26871
  nowIso() {
26872
26872
  return this.now().toISOString();
26873
26873
  }
26874
+ refreshPersistedLocalAgents() {
26875
+ const readPersistedLocalAgents2 = this.deps.readPersistedLocalAgents;
26876
+ if (!readPersistedLocalAgents2) return;
26877
+ for (const record of readPersistedLocalAgents2()) {
26878
+ this.deps.agentRegistry.put(record);
26879
+ }
26880
+ }
26874
26881
  // ── Inbox ───────────────────────────────────────────────────────────
26875
26882
  listInbox() {
26876
26883
  const items = aggregateInbox(this.deps.inboxSources, this.inboxStore);
@@ -26882,6 +26889,7 @@ var HubService = class {
26882
26889
  }
26883
26890
  // ── Agents ──────────────────────────────────────────────────────────
26884
26891
  listAgents(filter) {
26892
+ this.refreshPersistedLocalAgents();
26885
26893
  const safeFilter = {
26886
26894
  ...filter ?? {},
26887
26895
  identity_id: this.deps.identityId
@@ -27346,10 +27354,13 @@ var CapabilityErrorAgentController = class {
27346
27354
  function buildV11Bindings(inputs) {
27347
27355
  const seed = inputs.storagePath !== void 0 ? readPersistedLocalAgents(inputs.storagePath) : [];
27348
27356
  const registry = new InMemoryLocalAgentRegistry(seed);
27357
+ const storagePath = inputs.storagePath;
27358
+ const readPersisted = storagePath !== void 0 ? () => readPersistedLocalAgents(storagePath) : void 0;
27349
27359
  const hubService = new HubService({
27350
27360
  identityId: inputs.identityId,
27351
27361
  fortressId: inputs.fortressId,
27352
27362
  agentRegistry: registry,
27363
+ ...readPersisted ? { readPersistedLocalAgents: readPersisted } : {},
27353
27364
  inboxSources: {
27354
27365
  listPendingApprovals: () => [],
27355
27366
  listRecentBlockedEgress: () => [],