UNPKG

@adonis-agora/agent

Version:

Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.

27 lines • 930 B
/** * In-memory {@link ActorDirectory}: a plain `actorRef → label` map. Handy for tests, the offline demo, * and small apps that seed a fixed label table at boot. Missing refs are omitted from the result (never * fabricated), so a governance surface falls back to rendering the raw ref. */ export class InMemoryActorDirectory { labels; constructor(labels = {}) { this.labels = new Map(Object.entries(labels)); } /** Add or overwrite a single ref → label mapping. Returns `this` for chaining. */ set(ref, label) { this.labels.set(ref, label); return this; } async resolveDisplay(refs) { const out = {}; for (const ref of refs) { const label = this.labels.get(ref); if (label !== undefined) { out[ref] = label; } } return out; } } //# sourceMappingURL=in-memory-actor-directory.js.map